]> git.mxchange.org Git - simgear.git/blobdiff - simgear/xml/easyxml.cxx
Fix a build order problem.
[simgear.git] / simgear / xml / easyxml.cxx
index 2331fc375aea9d49ade461e689a2d8942b5614d5..83e0735af2d998c9b9e77a683b9dcf52e7c0ee30 100644 (file)
@@ -1,5 +1,13 @@
 // easyxml.cxx - implementation of EasyXML interfaces.
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#include <simgear/compiler.h>
+
+#include <string.h>            // strcmp()
+
 #include "easyxml.hxx"
 #include "xmlparse.h"
 
@@ -20,9 +28,10 @@ int
 XMLAttributes::findAttribute (const char * name) const
 {
   int s = size();
-  for (int i = 0; i < s; i++)
+  for (int i = 0; i < s; i++) {
     if (strcmp(name, getName(i)) == 0)
       return i;
+  }
   return -1;
 }
 
@@ -39,7 +48,7 @@ XMLAttributes::getValue (const char * name) const
   if (pos >= 0)
     return getValue(pos);
   else
-    return getValue(0);
+    return 0;
 }
 
 \f
@@ -122,9 +131,9 @@ class ExpatAtts : public XMLAttributes
 public:
   ExpatAtts (const char ** atts) : _atts(atts) {}
   
-  int size () const;
-  const char * getName (int i) const;
-  const char * getValue (int i) const;
+  virtual int size () const;
+  virtual const char * getName (int i) const;
+  virtual const char * getValue (int i) const;
   
 private:
   const char ** _atts;
@@ -162,8 +171,7 @@ ExpatAtts::getValue (int i) const
 static void
 start_element (void * userData, const char * name, const char ** atts)
 {
-  ExpatAtts attributes(atts);
-  VISITOR.startElement(name, attributes);
+  VISITOR.startElement(name, ExpatAtts(atts));
 }
 
 static void