diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2016-01-29 14:31:54 +0100 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2016-01-29 21:19:48 -0500 |
commit | 1cc6c871f9891bbf02d600b7a515d3cad06b0e46 (patch) | |
tree | 53138078756452358fba52d65b7cf5efa8cd46bf /src | |
parent | a7ff1b23a9049767e1df308bf5313a477ea07935 (diff) |
Used NULL constant instead of plain integer for NULL pointer.
The sparse static checker warns about using plain integer 0 as NULL
pointers in the generated lexer code. Fix this by using NULL
consistently for pointers.
Diffstat (limited to 'src')
-rw-r--r-- | src/flex.skl | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/flex.skl b/src/flex.skl index bb9685e..8d9df7e 100644 --- a/src/flex.skl +++ b/src/flex.skl @@ -616,7 +616,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ %endif %ok-for-header %endif @@ -652,7 +652,7 @@ static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; +static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ @@ -1554,7 +1554,7 @@ void yyFlexLexer::ctor_common() yy_start_stack_ptr = yy_start_stack_depth = 0; yy_start_stack = NULL; - yy_buffer_stack = 0; + yy_buffer_stack = NULL; yy_buffer_stack_top = 0; yy_buffer_stack_max = 0; @@ -1736,7 +1736,7 @@ m4_ifdef( [[M4_YY_USES_REJECT]], } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -2391,7 +2391,7 @@ YY_BUFFER_STATE yy_scan_buffer YYFARGS2( char *,base, yy_size_t ,size) base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) M4_YY_CALL_LAST_ARG ); if ( ! b ) @@ -2400,7 +2400,7 @@ YY_BUFFER_STATE yy_scan_buffer YYFARGS2( char *,base, yy_size_t ,size) b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; + b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; @@ -2936,10 +2936,10 @@ m4_ifdef( [[M4_YY_USE_LINENO]], yylineno = 1; ]]) ]]) - YY_G(yy_buffer_stack) = 0; + YY_G(yy_buffer_stack) = NULL; YY_G(yy_buffer_stack_top) = 0; YY_G(yy_buffer_stack_max) = 0; - YY_G(yy_c_buf_p) = (char *) 0; + YY_G(yy_c_buf_p) = NULL; YY_G(yy_init) = 0; YY_G(yy_start) = 0; @@ -2970,8 +2970,8 @@ m4_ifdef( [[M4_YY_TEXT_IS_ARRAY]], yyin = stdin; yyout = stdout; #else - yyin = (FILE *) 0; - yyout = (FILE *) 0; + yyin = NULL; + yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by |