diff options
author | Manoj Srivastava <srivasta@debian.org> | 2018-02-08 13:02:55 -0800 |
---|---|---|
committer | Manoj Srivastava <srivasta@debian.org> | 2018-02-08 13:02:55 -0800 |
commit | 8852aa3f8eefeee4da27de0553b1653253b15619 (patch) | |
tree | 7e6b583ae61340aed4c30303b29d25944273b188 /src/dfa.c | |
parent | 355fad18841ec452fc9931ab7f1dbd93d5ebd0ca (diff) | |
parent | 7a39ce3d46f3d049ead08a455c5fcb1b37e153e3 (diff) |
Merge branch 'upstream'
Update to v2.6.4
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
Diffstat (limited to 'src/dfa.c')
-rw-r--r-- | src/dfa.c | 17 |
1 files changed, 6 insertions, 11 deletions
@@ -463,14 +463,9 @@ void ntod (void) /* We still may want to use the table if numecs * is a power of 2. */ - int power_of_two; - - for (power_of_two = 1; power_of_two <= csize; - power_of_two *= 2) - if (numecs == power_of_two) { - use_NUL_table = true; - break; - } + if (numecs <= csize && is_power_of_2(numecs)) { + use_NUL_table = true; + } } if (use_NUL_table) @@ -515,7 +510,7 @@ void ntod (void) yytbl_data_init (yynxt_tbl, YYTD_ID_NXT); yynxt_tbl->td_hilen = 1; - yynxt_tbl->td_lolen = num_full_table_rows; + yynxt_tbl->td_lolen = (flex_uint32_t) num_full_table_rows; yynxt_tbl->td_data = yynxt_data = calloc(yynxt_tbl->td_lolen * yynxt_tbl->td_hilen, @@ -531,12 +526,12 @@ void ntod (void) */ if (gentables) out_str_dec - ("static yyconst %s yy_nxt[][%d] =\n {\n", + ("static const %s yy_nxt[][%d] =\n {\n", long_align ? "flex_int32_t" : "flex_int16_t", num_full_table_rows); else { out_dec ("#undef YY_NXT_LOLEN\n#define YY_NXT_LOLEN (%d)\n", num_full_table_rows); - out_str ("static yyconst %s *yy_nxt =0;\n", + out_str ("static const %s *yy_nxt =0;\n", long_align ? "flex_int32_t" : "flex_int16_t"); } |