- Re-built lexer file
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Thu, 4 Jun 2015 11:21:43 +0000 (11:21 +0000)
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Thu, 4 Jun 2015 11:21:43 +0000 (11:21 +0000)
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/branches/1.0.x@6048 82007160-df01-0410-b94d-b575c5fd34c7

src/config-lexer.c

index 4e499461ce5283373ef591063b5001a2723bd978..7e556111f6f876d0eac30a76b318e512e03f09d6 100644 (file)
@@ -779,9 +779,9 @@ char *yytext;
 #include "config-parser.h"
 
 
-void ccomment(void);
+static void ccomment(void);
 
-int linenum = 1;
+unsigned int linenum = 1;
 char linebuf[512];
 
 #line 788 "config-lexer.c"
@@ -2567,34 +2567,40 @@ void yyfree (void * ptr )
 
 
 /* C-comment ignoring routine -kre*/
-void ccomment(void)
+static void
+ccomment(void)
 {
-  int c;
+  int c = 0;
 
   /* log(L_NOTICE, "got comment"); */
   while (1)
   {
-     while ((c = input()) != '*' && c != EOF)
-        if (c == '\n') ++linenum;
-     if (c == '*')
-     {
-        while ((c = input()) == '*');
-        if (c == '/') break;
-        else if (c == '\n')
-          ++linenum;
-     }
+    while ((c = input()) != '*' && c != EOF)
+      if (c == '\n')
+        ++linenum;
+
+    if (c == '*')
+    {
+      while ((c = input()) == '*')
+        /* Nothing */ ;
+      if (c == '/')
+        break;
+      else if (c == '\n')
+        ++linenum;
+    }
+
     if (c == EOF)
     {
-       YY_FATAL_ERROR("EOF in comment");
-       /* XXX hack alert this disables
-        * the stupid unused function warning
-        * gcc generates
-        */
-       if(1 == 0)
-          yy_fatal_error("EOF in comment");
-       break;
+      YY_FATAL_ERROR("EOF in comment");
+
+      /* XXX hack alert this disables
+       * the stupid unused function warning
+       * gcc generates
+       */
+      if (1 == 0)
+        yy_fatal_error("EOF in comment");
+      break;
     }
   }
 }
 
-