scanner.l: fix a few implicit conversion warnings
[collectd.git] / src / liboconfig / scanner.l
index 2b5dbfb..a9c733e 100644 (file)
@@ -38,8 +38,6 @@
 #pragma clang diagnostic ignored "-Wmissing-noreturn"
 #endif
 
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-compare"
 
 /* multiline string buffer */
 static char *ml_buffer = NULL;
@@ -112,7 +110,7 @@ IPV6_ADDR ({IPV6_BASE})|(\[{IPV6_BASE}\](:{PORT})?)
 {UNQUOTED_STRING}      {yylval.string = yytext; return (UNQUOTED_STRING);}
 
 \"{QUOTED_STRING}\\{EOL} {
-       int len = strlen (yytext);
+       size_t len = strlen (yytext);
 
        ml_pos = 0;
 
@@ -128,7 +126,7 @@ IPV6_ADDR ({IPV6_BASE})|(\[{IPV6_BASE}\](:{PORT})?)
 }
 <ML>^{WHITE_SPACE}+ {/* remove leading white-space */}
 <ML>{NON_WHITE_SPACE}{QUOTED_STRING}\\{EOL} {
-       int len = strlen (yytext);
+       size_t len = strlen (yytext);
 
        /* remove "\\<EOL>" */
        if ('\r' == yytext[len - 2])
@@ -149,7 +147,7 @@ IPV6_ADDR ({IPV6_BASE})|(\[{IPV6_BASE}\](:{PORT})?)
 %%
 static void ml_append (char *string)
 {
-       int len = strlen (string);
+       size_t len = strlen (string);
        int s;
 
        if (ml_free <= len) {
@@ -170,5 +168,3 @@ static void ml_append (char *string)
 #ifdef __clang__
 #pragma clang diagnostic pop
 #endif
-
-#pragma GCC diagnostic pop