Skip to content

Commit

Permalink
generated code, in yy_get_next_buffer(), change type of local `number…
Browse files Browse the repository at this point in the history
…_to_move'

suits better, because `yy_n_chars' and `yy_buf_size' are of type `int'
  • Loading branch information
rlar authored and westes committed Mar 12, 2016
1 parent cf4121f commit 8c098fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/flex.skl
Expand Up @@ -1661,7 +1661,7 @@ int yyFlexLexer::yy_get_next_buffer()
M4_YY_DECL_GUTS_VAR();
char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
char *source = YY_G(yytext_ptr);
yy_size_t number_to_move, i;
int number_to_move, i;
int ret_val;

if ( YY_G(yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars) + 1] )
Expand Down Expand Up @@ -1690,7 +1690,7 @@ int yyFlexLexer::yy_get_next_buffer()
/* Try to read more data. */

/* First move last chars to start of buffer. */
number_to_move = (yy_size_t) (YY_G(yy_c_buf_p) - YY_G(yytext_ptr)) - 1;
number_to_move = (int) (YY_G(yy_c_buf_p) - YY_G(yytext_ptr) - 1);

for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
Expand Down Expand Up @@ -1778,7 +1778,7 @@ m4_ifdef( [[M4_YY_USES_REJECT]],
else
ret_val = EOB_ACT_CONTINUE_SCAN;

if ((int) (YY_G(yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
if ((YY_G(yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
int new_size = YY_G(yy_n_chars) + number_to_move + (YY_G(yy_n_chars) >> 1);
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
Expand Down

0 comments on commit 8c098fe

Please sign in to comment.