summaryrefslogtreecommitdiff
path: root/src/gen.c
diff options
context:
space:
mode:
authorrlar <rlar>2016-03-29 19:27:54 +0200
committerWill Estes <westes575@gmail.com>2016-03-31 07:17:32 -0400
commit8d09d89c33bafa2346d7a3d8528821df25cda3fd (patch)
treece898270e5b0b13d4beca23338daf747f668e839 /src/gen.c
parentf57cb42c7da9c3d14910002c153ed65b524a9fc7 (diff)
warning in generated code, with -Ca
warning: conversion to 'yy_state_type' from 'flex_uint32_t' may change the sign of the result [-Wsign-conversion]
Diffstat (limited to 'src/gen.c')
-rw-r--r--src/gen.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/gen.c b/src/gen.c
index 1e65d6c..8725949 100644
--- a/src/gen.c
+++ b/src/gen.c
@@ -72,20 +72,6 @@ static const char *get_state_decl (void)
: "static yyconst yy_state_type * %s = 0;\n";
}
-static const char *get_uint16_decl (void)
-{
- return (gentables)
- ? "static yyconst flex_uint16_t %s[%d] =\n { 0,\n"
- : "static yyconst flex_uint16_t * %s = 0;\n";
-}
-
-static const char *get_uint32_decl (void)
-{
- return (gentables)
- ? "static yyconst flex_uint32_t %s[%d] =\n { 0,\n"
- : "static yyconst flex_uint32_t * %s = 0;\n";
-}
-
static const char *get_yy_char_decl (void)
{
return (gentables)
@@ -1311,13 +1297,13 @@ void gentabs (void)
/* Begin generating yy_base */
out_str_dec ((tblend >= INT16_MAX || long_align) ?
- get_uint32_decl () : get_uint16_decl (),
+ get_int32_decl () : get_int16_decl (),
"yy_base", total_states + 1);
buf_prints (&yydmap_buf,
"\t{YYTD_ID_BASE, (void**)&yy_base, sizeof(%s)},\n",
(tblend >= INT16_MAX
- || long_align) ? "flex_uint32_t" : "flex_uint16_t");
+ || long_align) ? "flex_int32_t" : "flex_int16_t");
yybase_tbl = calloc (1, sizeof (struct yytbl_data));
yytbl_data_init (yybase_tbl, YYTD_ID_BASE);
yybase_tbl->td_lolen = (flex_uint32_t) (total_states + 1);
@@ -1400,13 +1386,13 @@ void gentabs (void)
/* Begin generating yy_nxt */
out_str_dec ((total_states >= INT16_MAX || long_align) ?
- get_uint32_decl () : get_uint16_decl (), "yy_nxt",
+ get_int32_decl () : get_int16_decl (), "yy_nxt",
tblend + 1);
buf_prints (&yydmap_buf,
"\t{YYTD_ID_NXT, (void**)&yy_nxt, sizeof(%s)},\n",
(total_states >= INT16_MAX
- || long_align) ? "flex_uint32_t" : "flex_uint16_t");
+ || long_align) ? "flex_int32_t" : "flex_int16_t");
yynxt_tbl = calloc (1, sizeof (struct yytbl_data));
yytbl_data_init (yynxt_tbl, YYTD_ID_NXT);