]> git.stg.codes - stg.git/blobdiff - projects/sgconf_xml/parser.cpp
Fix build on Darwin.
[stg.git] / projects / sgconf_xml / parser.cpp
index 12a1c7a2d4bb171948167762548047a23e3dd747..f2d5993bb9bf2fa86eaf21178e8056c539248a9c 100644 (file)
@@ -3,14 +3,14 @@
 #include <expat.h>
 #include <string.h>
 
-#include "common.h"
-#include "netunit.h"
+#include "stg/common.h"
+#include "stg/netunit.h"
 #include "request.h"
 
 int parse_depth = 0;
 XML_Parser parser;
 //---------------------------------------------------------------------------
-int ParseAns(void * data, const char *el, const char **attr)
+int ParseAns(void *, const char *el, const char **attr)
 {
 if (strcasecmp(el, "ServerInfo") == 0 || strcasecmp(el, "Tariffs") == 0 || strcasecmp(el, "Admins") == 0 || strcasecmp(el, "Users") == 0 || strcasecmp(el, "user") == 0)
     {
@@ -127,7 +127,7 @@ if (parse_depth == 1)
     }
 }
 //-----------------------------------------------------------------------------
-void EndElement(void *data, const char *el)
+void EndElement(void *, const char *el)
 {
 parse_depth--;
 if (strcasecmp(el, "ServerInfo") == 0 || strcasecmp(el, "Tariffs") == 0 || strcasecmp(el, "Admins") == 0 || strcasecmp(el, "Users") == 0 || strcasecmp(el, "tariff") == 0 || strcasecmp(el, "user") == 0)
@@ -136,7 +136,7 @@ if (strcasecmp(el, "ServerInfo") == 0 || strcasecmp(el, "Tariffs") == 0 || strca
     }
 }
 //---------------------------------------------------------------------------
-int ParseReply(void * data, list<string> * ans)
+int ParseReply(void *, list<string> * ans)
 //int ParseReply(void * data, SLIST * ans)
 {
 //char answ[ENC_MSG_LEN + 1];
@@ -162,12 +162,11 @@ while (n != ans->end())
 
     if (++n == ans->end())
         done = 1;
-    n--;
+    --n;
 
     if (XML_Parse(parser, n->c_str(), len, done) == XML_STATUS_ERROR)
         {
-        char s[128];
-        printf(s, "Parse error at line %d: %s",
+        printf("Parse error at line %d: %s",
                XML_GetCurrentLineNumber(parser),
                XML_ErrorString(XML_GetErrorCode(parser)));
         return st_xml_parse_error;