summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshemminger <shemminger>2005-07-14 16:49:27 +0000
committershemminger <shemminger>2005-07-14 16:49:27 +0000
commit3fcdebb6d0b6f7cafb0a21e5e892d3670326dc9a (patch)
treed26e090a46f8fd478ee42df17aeb8742d699f13f
parent737f15f6da0ed7512220f6fa5244a39777de4e0d (diff)
Fix ematch warnings with GCC4.0
-rw-r--r--ChangeLog8
-rw-r--r--tc/emp_ematch.l18
-rw-r--r--tc/m_ematch.c2
3 files changed, 16 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 0d457a70..847e5a26 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
-2005-07-05 Thomas Graf <tgraf@suug.ch>
+2005-07-14 Thomas Graf <tgraf@suug.ch>
- * Build check for GNU Bison
+ * Make ematch bison/lex build with common flex
+
+2005-07-10 Stephen Hemminger <shemminger@osdl.org>
+
+ * Fix Gcc 4.0 build warnings signed/unsigned
2005-06-23 Jamal Hadi Salim <hadi@znyx.com>
diff --git a/tc/emp_ematch.l b/tc/emp_ematch.l
index 70cdb9a6..09d535d0 100644
--- a/tc/emp_ematch.l
+++ b/tc/emp_ematch.l
@@ -35,14 +35,8 @@
static void __attribute__ ((unused)) yy_push_state (int new_state );
static void __attribute__ ((unused)) yy_pop_state (void);
static int __attribute__ ((unused)) yy_top_state (void );
-%}
-
-%x str
-
-%option 8bit stack warn noyywrap prefix="ematch_"
-%%
- static unsigned char *strbuf;
+ static char *strbuf;
static unsigned int strbuf_size;
static unsigned int strbuf_index;
@@ -52,14 +46,14 @@
strbuf = realloc(strbuf, strbuf_size);
}
- static void strbuf_append_char(unsigned char c)
+ static void strbuf_append_char(char c)
{
while (strbuf_index >= strbuf_size)
strbuf_enlarge();
strbuf[strbuf_index++] = c;
}
- static void strbuf_append_charp(unsigned char *s)
+ static void strbuf_append_charp(char *s)
{
while (strbuf_index >= strbuf_size)
strbuf_enlarge();
@@ -67,6 +61,12 @@
strbuf_index += strlen(s);
}
+%}
+
+%x str
+
+%option 8bit stack warn noyywrap prefix="ematch_"
+%%
[ \t\r\n]+
\" {
diff --git a/tc/m_ematch.c b/tc/m_ematch.c
index 37ef0459..44c621bc 100644
--- a/tc/m_ematch.c
+++ b/tc/m_ematch.c
@@ -193,7 +193,7 @@ static int parse_tree(struct nlmsghdr *n, struct ematch *tree)
addraw_l(n, MAX_MSG, &hdr, sizeof(hdr));
addraw_l(n, MAX_MSG, &r, sizeof(r));
} else {
- int num, err;
+ int num = 0, err;
char buf[64];
struct ematch_util *e;