diff options
author | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2015-05-14 11:16:04 -0700 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2015-11-19 19:26:07 -0500 |
commit | 0f7b9136ed566f4a79b2d6ca33299babcce3049e (patch) | |
tree | 4d7e50ccc92c0917ec491c23aadaf93b5b0c5047 /src/scan.l | |
parent | 09eae589d3954a1e1206aa01108ee75ef57776da (diff) |
Switch function definitions from mixed K&R to consistent ANSI C.
flex was using K&R function definitions for some functions and
ANSI C style in others, sometimes even in the same file. Change
the code to consistently use ANSI C.
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/scan.l')
-rw-r--r-- | src/scan.l | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -969,7 +969,7 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */ %% -int yywrap() +int yywrap(void) { if ( --num_input_files > 0 ) { @@ -984,8 +984,7 @@ int yywrap() /* set_input_file - open the given file (if NULL, stdin) for scanning */ -void set_input_file( file ) -char *file; +void set_input_file( char *file ) { if ( file && strcmp( file, "-" ) ) { @@ -1008,21 +1007,17 @@ char *file; /* Wrapper routines for accessing the scanner's malloc routines. */ -void *flex_alloc( size ) -size_t size; +void *flex_alloc( size_t size ) { return (void *) malloc( size ); } -void *flex_realloc( ptr, size ) -void *ptr; -size_t size; +void *flex_realloc( void *ptr, size_t size ) { return (void *) realloc( ptr, size ); } -void flex_free( ptr ) -void *ptr; +void flex_free( void *ptr ) { if ( ptr ) free( ptr ); |