Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup warnings #600

Merged
merged 5 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/c99-flex.skl
Original file line number Diff line number Diff line change
Expand Up @@ -854,8 +854,10 @@ void yypop_buffer_state (yyscan_t yyscanner)
*/
void yyrestart(FILE * input_file, yyscan_t yyscanner)
{
m4_ifdef( [[M4_MODE_USES_REJECT]], [[
size_t new_size = 0;
yy_state_type *new_state_buf = 0;
]] )

if ( yy_current_buffer(yyscanner) == NULL ) {
yyensure_buffer_stack (yyscanner);
Expand All @@ -869,7 +871,7 @@ void yyrestart(FILE * input_file, yyscan_t yyscanner)
m4_ifdef( [[M4_MODE_USES_REJECT]], [[
/* Ensure the reject state buffer is large enough.
*/
if ( yyscanner->yy_state_buf_max < (yy_current_buffer(yyscanner)->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE) ) {
if ( yyscanner->yy_state_buf_max < (size_t) (yy_current_buffer(yyscanner)->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE) ) {
new_size = yy_current_buffer(yyscanner)->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE;
new_state_buf = (yy_state_type*) yyrealloc( yyscanner->yy_state_buf, (new_size * sizeof(yy_state_type)), yyscanner );

Expand Down Expand Up @@ -1012,7 +1014,7 @@ m4_ifdef( [[M4_MODE_CPP_USE_READ]], [[
m4_ifdef( [[M4_MODE_NO_CPP_USE_READ]], [[
if ( yyscanner->yy_buffer_stack[yyscanner->yy_buffer_stack_top]->yy_is_interactive ) {
int c = '*';
int n;
size_t n;
for ( n = 0; n < max_size &&
(c = getc( yyscanner->yyin_r )) != EOF && c != '\n'; ++n ) {
buf[n] = (char) c;
Expand Down Expand Up @@ -1600,8 +1602,10 @@ bool yyatbol(yyscan_t yyscanner) {
*/
void yy_switch_to_buffer(yybuffer new_buffer, yyscan_t yyscanner)
{
m4_ifdef( [[M4_MODE_USES_REJECT]], [[
size_t new_size = 0;
yy_state_type *new_state_buf = 0;
]] )

/* TODO. We should be able to replace this entire function body
* with
Expand Down
15 changes: 11 additions & 4 deletions src/cpp-flex.skl
Original file line number Diff line number Diff line change
Expand Up @@ -1585,7 +1585,7 @@ m4_ifdef( [[M4_MODE_CPP_USE_READ]], [[
m4_ifdef( [[M4_MODE_NO_CPP_USE_READ]], [[
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) {
int c = '*';
int n;
yy_size_t n;
for ( n = 0; n < max_size &&
(c = getc( yyin )) != EOF && c != '\n'; ++n ) {
buf[n] = (char) c;
Expand Down Expand Up @@ -2685,6 +2685,7 @@ m4_ifdef([[M4_MODE_NULTRANS_WRAP]], [[
m4_ifdef([[M4_MODE_CXX_ONLY]], [[m4_undefine([[M4_YY_NO_YYUNPUT]])]])
m4_ifdef( [[M4_YY_NO_YYUNPUT]], , [[
m4_ifdef([[M4_MODE_C_ONLY]], [[
#ifndef YY_NO_YYUNPUT
static void yyunput_r YYFARGS2( int,c, char *,yy_bp)
]])
m4_ifdef([[M4_MODE_CXX_ONLY]], [[
Expand Down Expand Up @@ -2734,6 +2735,9 @@ m4_ifdef( [[M4_MODE_YYLINENO]],
YY_G(yy_hold_char) = *yy_cp;
YY_G(yy_c_buf_p) = yy_cp;
}
m4_ifdef([[M4_MODE_C_ONLY]], [[
#endif /* ifndef YY_NO_YYINPUT */
]])
]])

m4_ifdef([[M4_MODE_C_ONLY]], [[
Expand Down Expand Up @@ -2834,8 +2838,10 @@ void yyFlexLexer::yyrestart( std::istream& input_file )
]])
{
M4_YY_DECL_GUTS_VAR();
m4_ifdef( [[M4_MODE_USES_REJECT]], [[
size_t new_size = 0;
yy_state_type *new_state_buf = 0;
]] )

if ( yy_current_buffer() == NULL ) {
yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG);
Expand All @@ -2849,7 +2855,7 @@ void yyFlexLexer::yyrestart( std::istream& input_file )
m4_ifdef( [[M4_MODE_USES_REJECT]], [[
/* Ensure the reject state buffer is large enough.
*/
if ( YY_G(yy_state_buf_max) < (yy_current_buffer()->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE) ) {
if ( YY_G(yy_state_buf_max) < (yy_size_t) (yy_current_buffer()->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE) ) {
new_size = yy_current_buffer()->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE;
new_state_buf = (yy_state_type *)yyrealloc( YY_G(yy_state_buf), (new_size * sizeof(yy_state_type)) M4_YY_CALL_LAST_ARG );

Expand Down Expand Up @@ -2898,8 +2904,10 @@ void yyFlexLexer::yy_switch_to_buffer( yybuffer new_buffer )
]])
{
M4_YY_DECL_GUTS_VAR();
m4_ifdef( [[M4_MODE_USES_REJECT]], [[
size_t new_size = 0;
yy_state_type *new_state_buf = 0;
]] )

/* TODO. We should be able to replace this entire function body
* with
Expand All @@ -2923,7 +2931,7 @@ void yyFlexLexer::yy_switch_to_buffer( yybuffer new_buffer )
m4_ifdef( [[M4_MODE_USES_REJECT]], [[
/* Ensure the reject state buffer is large enough.
*/
if ( YY_G(yy_state_buf_max) < (YY_CURRENT_BUFFER_LVALUE->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE) ) {
if ( YY_G(yy_state_buf_max) < (yy_size_t) (YY_CURRENT_BUFFER_LVALUE->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE) ) {
new_size = YY_CURRENT_BUFFER_LVALUE->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE;
new_state_buf = (yy_state_type *)yyrealloc( YY_G(yy_state_buf), (new_size * sizeof(yy_state_type)) M4_YY_CALL_LAST_ARG );

Expand Down Expand Up @@ -2979,7 +2987,6 @@ yybuffer yyFlexLexer::yy_create_buffer( std::istream& file, int size )
]])
{
yybuffer b;
M4_YY_DECL_GUTS_VAR();

b = (yybuffer) yyalloc( sizeof( struct yy_buffer_state ) M4_YY_CALL_LAST_ARG );
if ( b == NULL ) {
Expand Down
Loading