Get rid if --header-file argument for lex
authorJens Axboe <axboe@fb.com>
Wed, 15 Oct 2014 03:12:22 +0000 (21:12 -0600)
committerJens Axboe <axboe@fb.com>
Wed, 15 Oct 2014 03:12:22 +0000 (21:12 -0600)
Since we now wrap the lexer_input() call, should be safe to just
get rid of the lexer.h define since we don't need size_t/yy_size_t.

Signed-off-by: Jens Axboe <axboe@fb.com>
.gitignore
Makefile
exp/expression-parser.l
exp/expression-parser.y

index f13ec27..c9d90fb 100644 (file)
@@ -9,4 +9,3 @@
 /fio
 y.tab.*
 lex.yy.c
-lexer.h
index 750eccd..0f77df9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -267,7 +267,7 @@ override CFLAGS += -DFIO_VERSION='"$(FIO_VERSION)"'
 
 ifdef CONFIG_ARITHMETIC
 lex.yy.c: exp/expression-parser.l
-       $(QUIET_LEX)$(LEX) --header-file=lexer.h exp/expression-parser.l
+       $(QUIET_LEX)$(LEX) exp/expression-parser.l
 
 lex.yy.o: lex.yy.c y.tab.h
        $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
index 16e3873..856596a 100644 (file)
 
 #define YYSTYPE PARSER_VALUE_TYPE
 
-extern int lexer_input(char *buffer, size_t *nbytes, int buffersize);
+extern int lexer_input(char *buffer, unsigned int *nbytes, int buffersize);
 
 #undef YY_INPUT
 #define YY_INPUT(buffer, bytes_read, bytes_requested)                  \
 ({                                                                     \
        int __ret;                                                      \
-       size_t __bread = bytes_read;                                    \
+       unsigned int __bread = bytes_read;                              \
        __ret = lexer_input((buffer), &__bread, (bytes_requested));     \
        bytes_read = __bread;                                           \
        __ret;                                                          \
index 83b5b30..8ae0c01 100644 (file)
@@ -21,7 +21,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <math.h>
-#include "lexer.h"
 
 struct parser_value_type {
        double dval;
@@ -188,7 +187,7 @@ expression: expression '+' expression {
 static int lexer_read_offset = 0;
 static char lexer_input_buffer[1000];
 
-int lexer_input(char* buffer, yy_size_t *bytes_read, int bytes_requested)
+int lexer_input(char* buffer, unsigned int *bytes_read, int bytes_requested)
 {
        int bytes_left = strlen(lexer_input_buffer) - lexer_read_offset;