projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
scanner.l: use size_t for 2 variables
[collectd.git]
/
src
/
liboconfig
/
scanner.l
diff --git
a/src/liboconfig/scanner.l
b/src/liboconfig/scanner.l
index
41d6643
..
be6d678
100644
(file)
--- a/
src/liboconfig/scanner.l
+++ b/
src/liboconfig/scanner.l
@@
-33,10
+33,16
@@
#include "aux_types.h"
#include "parser.h"
#include "aux_types.h"
#include "parser.h"
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wmissing-noreturn"
+#endif
+
+
/* multiline string buffer */
static char *ml_buffer = NULL;
/* multiline string buffer */
static char *ml_buffer = NULL;
-static
int
ml_pos = 0;
-static
int
ml_len = 0;
+static
size_t
ml_pos = 0;
+static
size_t
ml_len = 0;
#define ml_free (ml_len - ml_pos)
#define ml_free (ml_len - ml_pos)
@@
-104,7
+110,7
@@
IPV6_ADDR ({IPV6_BASE})|(\[{IPV6_BASE}\](:{PORT})?)
{UNQUOTED_STRING} {yylval.string = yytext; return (UNQUOTED_STRING);}
\"{QUOTED_STRING}\\{EOL} {
{UNQUOTED_STRING} {yylval.string = yytext; return (UNQUOTED_STRING);}
\"{QUOTED_STRING}\\{EOL} {
-
in
t len = strlen (yytext);
+
size_
t len = strlen (yytext);
ml_pos = 0;
ml_pos = 0;
@@
-120,7
+126,7
@@
IPV6_ADDR ({IPV6_BASE})|(\[{IPV6_BASE}\](:{PORT})?)
}
<ML>^{WHITE_SPACE}+ {/* remove leading white-space */}
<ML>{NON_WHITE_SPACE}{QUOTED_STRING}\\{EOL} {
}
<ML>^{WHITE_SPACE}+ {/* remove leading white-space */}
<ML>{NON_WHITE_SPACE}{QUOTED_STRING}\\{EOL} {
-
in
t len = strlen (yytext);
+
size_
t len = strlen (yytext);
/* remove "\\<EOL>" */
if ('\r' == yytext[len - 2])
/* remove "\\<EOL>" */
if ('\r' == yytext[len - 2])
@@
-141,12
+147,12
@@
IPV6_ADDR ({IPV6_BASE})|(\[{IPV6_BASE}\](:{PORT})?)
%%
static void ml_append (char *string)
{
%%
static void ml_append (char *string)
{
-
in
t len = strlen (string);
+
size_
t len = strlen (string);
int s;
if (ml_free <= len) {
ml_len += len - ml_free + 1;
int s;
if (ml_free <= len) {
ml_len += len - ml_free + 1;
- ml_buffer =
(char *)
realloc (ml_buffer, ml_len);
+ ml_buffer = realloc (ml_buffer, ml_len);
if (NULL == ml_buffer)
YY_FATAL_ERROR ("out of dynamic memory in ml_append");
}
if (NULL == ml_buffer)
YY_FATAL_ERROR ("out of dynamic memory in ml_append");
}
@@
-159,3
+165,6
@@
static void ml_append (char *string)
return;
} /* ml_append */
return;
} /* ml_append */
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif