Commit b3e95086 authored by Marko Mäkelä's avatar Marko Mäkelä

Fix function pointer type mismatch

parent e023f9a4
...@@ -87,7 +87,7 @@ extern int fts_lexer(YYSTYPE*, fts_lexer_t*); ...@@ -87,7 +87,7 @@ extern int fts_lexer(YYSTYPE*, fts_lexer_t*);
extern int fts_blexer(YYSTYPE*, yyscan_t); extern int fts_blexer(YYSTYPE*, yyscan_t);
extern int fts_tlexer(YYSTYPE*, yyscan_t); extern int fts_tlexer(YYSTYPE*, yyscan_t);
typedef int (*fts_scan)();
extern int ftserror(const char* p); extern int ftserror(const char* p);
...@@ -102,8 +102,8 @@ extern int ftserror(const char* p); ...@@ -102,8 +102,8 @@ extern int ftserror(const char* p);
#define YYTOKENFREE(token) fts_ast_string_free((token)) #define YYTOKENFREE(token) fts_ast_string_free((token))
typedef int (*fts_scanner_alt)(YYSTYPE* val, yyscan_t yyscanner);
typedef int (*fts_scanner)(); typedef int (*fts_scanner)(YYSTYPE* val, yyscan_t yyscanner);
struct fts_lexer_t { struct fts_lexer_t {
fts_scanner scanner; fts_scanner scanner;
...@@ -1950,7 +1950,7 @@ fts_lexer_create( ...@@ -1950,7 +1950,7 @@ fts_lexer_create(
reinterpret_cast<const char*>(query), reinterpret_cast<const char*>(query),
static_cast<int>(query_len), static_cast<int>(query_len),
fts_lexer->yyscanner); fts_lexer->yyscanner);
fts_lexer->scanner = reinterpret_cast<fts_scan>(fts_blexer); fts_lexer->scanner = fts_blexer;
/* FIXME: Debugging */ /* FIXME: Debugging */
/* fts0bset_debug(1 , fts_lexer->yyscanner); */ /* fts0bset_debug(1 , fts_lexer->yyscanner); */
} else { } else {
...@@ -1959,7 +1959,7 @@ fts_lexer_create( ...@@ -1959,7 +1959,7 @@ fts_lexer_create(
reinterpret_cast<const char*>(query), reinterpret_cast<const char*>(query),
static_cast<int>(query_len), static_cast<int>(query_len),
fts_lexer->yyscanner); fts_lexer->yyscanner);
fts_lexer->scanner = reinterpret_cast<fts_scan>(fts_tlexer); fts_lexer->scanner = fts_tlexer;
} }
return(fts_lexer); return(fts_lexer);
...@@ -1973,7 +1973,7 @@ fts_lexer_free( ...@@ -1973,7 +1973,7 @@ fts_lexer_free(
/*===========*/ /*===========*/
fts_lexer_t* fts_lexer) fts_lexer_t* fts_lexer)
{ {
if (fts_lexer->scanner == (fts_scan) fts_blexer) { if (fts_lexer->scanner == fts_blexer) {
fts0blex_destroy(fts_lexer->yyscanner); fts0blex_destroy(fts_lexer->yyscanner);
} else { } else {
fts0tlex_destroy(fts_lexer->yyscanner); fts0tlex_destroy(fts_lexer->yyscanner);
...@@ -1991,9 +1991,9 @@ fts_lexer( ...@@ -1991,9 +1991,9 @@ fts_lexer(
YYSTYPE* val, YYSTYPE* val,
fts_lexer_t* fts_lexer) fts_lexer_t* fts_lexer)
{ {
fts_scanner_alt func_ptr; fts_scanner func_ptr;
func_ptr = (fts_scanner_alt) fts_lexer->scanner; func_ptr = fts_lexer->scanner;
return(func_ptr(val, fts_lexer->yyscanner)); return(func_ptr(val, fts_lexer->yyscanner));
} }
......
...@@ -35,7 +35,7 @@ extern int fts_lexer(YYSTYPE*, fts_lexer_t*); ...@@ -35,7 +35,7 @@ extern int fts_lexer(YYSTYPE*, fts_lexer_t*);
extern int fts_blexer(YYSTYPE*, yyscan_t); extern int fts_blexer(YYSTYPE*, yyscan_t);
extern int fts_tlexer(YYSTYPE*, yyscan_t); extern int fts_tlexer(YYSTYPE*, yyscan_t);
typedef int (*fts_scan)();
extern int ftserror(const char* p); extern int ftserror(const char* p);
...@@ -48,8 +48,8 @@ extern int ftserror(const char* p); ...@@ -48,8 +48,8 @@ extern int ftserror(const char* p);
#define YYPARSE_PARAM state #define YYPARSE_PARAM state
#define YYLEX_PARAM ((fts_ast_state_t*) state)->lexer #define YYLEX_PARAM ((fts_ast_state_t*) state)->lexer
typedef int (*fts_scanner_alt)(YYSTYPE* val, yyscan_t yyscanner);
typedef int (*fts_scanner)(); typedef int (*fts_scanner)(YYSTYPE* val, yyscan_t yyscanner);
struct fts_lexer_struct { struct fts_lexer_struct {
fts_scanner scanner; fts_scanner scanner;
...@@ -238,13 +238,13 @@ fts_lexer_create( ...@@ -238,13 +238,13 @@ fts_lexer_create(
if (boolean_mode) { if (boolean_mode) {
fts0blex_init(&fts_lexer->yyscanner); fts0blex_init(&fts_lexer->yyscanner);
fts0b_scan_bytes((char*) query, query_len, fts_lexer->yyscanner); fts0b_scan_bytes((char*) query, query_len, fts_lexer->yyscanner);
fts_lexer->scanner = (fts_scan) fts_blexer; fts_lexer->scanner = fts_blexer;
/* FIXME: Debugging */ /* FIXME: Debugging */
/* fts0bset_debug(1 , fts_lexer->yyscanner); */ /* fts0bset_debug(1 , fts_lexer->yyscanner); */
} else { } else {
fts0tlex_init(&fts_lexer->yyscanner); fts0tlex_init(&fts_lexer->yyscanner);
fts0t_scan_bytes((char*) query, query_len, fts_lexer->yyscanner); fts0t_scan_bytes((char*) query, query_len, fts_lexer->yyscanner);
fts_lexer->scanner = (fts_scan) fts_tlexer; fts_lexer->scanner = fts_tlexer;
} }
return(fts_lexer); return(fts_lexer);
...@@ -258,7 +258,7 @@ fts_lexer_free( ...@@ -258,7 +258,7 @@ fts_lexer_free(
/*===========*/ /*===========*/
fts_lexer_t* fts_lexer) fts_lexer_t* fts_lexer)
{ {
if (fts_lexer->scanner == (fts_scan) fts_blexer) { if (fts_lexer->scanner == fts_blexer) {
fts0blex_destroy(fts_lexer->yyscanner); fts0blex_destroy(fts_lexer->yyscanner);
} else { } else {
fts0tlex_destroy(fts_lexer->yyscanner); fts0tlex_destroy(fts_lexer->yyscanner);
...@@ -276,9 +276,9 @@ fts_lexer( ...@@ -276,9 +276,9 @@ fts_lexer(
YYSTYPE* val, YYSTYPE* val,
fts_lexer_t* fts_lexer) fts_lexer_t* fts_lexer)
{ {
fts_scanner_alt func_ptr; fts_scanner func_ptr;
func_ptr = (fts_scanner_alt) fts_lexer->scanner; func_ptr = fts_lexer->scanner;
return(func_ptr(val, fts_lexer->yyscanner)); return(func_ptr(val, fts_lexer->yyscanner));
} }
......
...@@ -87,7 +87,7 @@ extern int fts_lexer(YYSTYPE*, fts_lexer_t*); ...@@ -87,7 +87,7 @@ extern int fts_lexer(YYSTYPE*, fts_lexer_t*);
extern int fts_blexer(YYSTYPE*, yyscan_t); extern int fts_blexer(YYSTYPE*, yyscan_t);
extern int fts_tlexer(YYSTYPE*, yyscan_t); extern int fts_tlexer(YYSTYPE*, yyscan_t);
typedef int (*fts_scan)();
extern int ftserror(const char* p); extern int ftserror(const char* p);
...@@ -102,8 +102,8 @@ extern int ftserror(const char* p); ...@@ -102,8 +102,8 @@ extern int ftserror(const char* p);
#define YYTOKENFREE(token) fts_ast_string_free((token)) #define YYTOKENFREE(token) fts_ast_string_free((token))
typedef int (*fts_scanner_alt)(YYSTYPE* val, yyscan_t yyscanner);
typedef int (*fts_scanner)(); typedef int (*fts_scanner)(YYSTYPE* val, yyscan_t yyscanner);
struct fts_lexer_t { struct fts_lexer_t {
fts_scanner scanner; fts_scanner scanner;
...@@ -1950,7 +1950,7 @@ fts_lexer_create( ...@@ -1950,7 +1950,7 @@ fts_lexer_create(
reinterpret_cast<const char*>(query), reinterpret_cast<const char*>(query),
static_cast<int>(query_len), static_cast<int>(query_len),
fts_lexer->yyscanner); fts_lexer->yyscanner);
fts_lexer->scanner = reinterpret_cast<fts_scan>(fts_blexer); fts_lexer->scanner = fts_blexer;
/* FIXME: Debugging */ /* FIXME: Debugging */
/* fts0bset_debug(1 , fts_lexer->yyscanner); */ /* fts0bset_debug(1 , fts_lexer->yyscanner); */
} else { } else {
...@@ -1959,7 +1959,7 @@ fts_lexer_create( ...@@ -1959,7 +1959,7 @@ fts_lexer_create(
reinterpret_cast<const char*>(query), reinterpret_cast<const char*>(query),
static_cast<int>(query_len), static_cast<int>(query_len),
fts_lexer->yyscanner); fts_lexer->yyscanner);
fts_lexer->scanner = reinterpret_cast<fts_scan>(fts_tlexer); fts_lexer->scanner = fts_tlexer;
} }
return(fts_lexer); return(fts_lexer);
...@@ -1973,7 +1973,7 @@ fts_lexer_free( ...@@ -1973,7 +1973,7 @@ fts_lexer_free(
/*===========*/ /*===========*/
fts_lexer_t* fts_lexer) fts_lexer_t* fts_lexer)
{ {
if (fts_lexer->scanner == (fts_scan) fts_blexer) { if (fts_lexer->scanner == fts_blexer) {
fts0blex_destroy(fts_lexer->yyscanner); fts0blex_destroy(fts_lexer->yyscanner);
} else { } else {
fts0tlex_destroy(fts_lexer->yyscanner); fts0tlex_destroy(fts_lexer->yyscanner);
...@@ -1991,9 +1991,9 @@ fts_lexer( ...@@ -1991,9 +1991,9 @@ fts_lexer(
YYSTYPE* val, YYSTYPE* val,
fts_lexer_t* fts_lexer) fts_lexer_t* fts_lexer)
{ {
fts_scanner_alt func_ptr; fts_scanner func_ptr;
func_ptr = (fts_scanner_alt) fts_lexer->scanner; func_ptr = fts_lexer->scanner;
return(func_ptr(val, fts_lexer->yyscanner)); return(func_ptr(val, fts_lexer->yyscanner));
} }
......
...@@ -35,7 +35,7 @@ extern int fts_lexer(YYSTYPE*, fts_lexer_t*); ...@@ -35,7 +35,7 @@ extern int fts_lexer(YYSTYPE*, fts_lexer_t*);
extern int fts_blexer(YYSTYPE*, yyscan_t); extern int fts_blexer(YYSTYPE*, yyscan_t);
extern int fts_tlexer(YYSTYPE*, yyscan_t); extern int fts_tlexer(YYSTYPE*, yyscan_t);
typedef int (*fts_scan)();
extern int ftserror(const char* p); extern int ftserror(const char* p);
...@@ -48,8 +48,8 @@ extern int ftserror(const char* p); ...@@ -48,8 +48,8 @@ extern int ftserror(const char* p);
#define YYPARSE_PARAM state #define YYPARSE_PARAM state
#define YYLEX_PARAM ((fts_ast_state_t*) state)->lexer #define YYLEX_PARAM ((fts_ast_state_t*) state)->lexer
typedef int (*fts_scanner_alt)(YYSTYPE* val, yyscan_t yyscanner);
typedef int (*fts_scanner)(); typedef int (*fts_scanner)(YYSTYPE* val, yyscan_t yyscanner);
struct fts_lexer_struct { struct fts_lexer_struct {
fts_scanner scanner; fts_scanner scanner;
...@@ -238,13 +238,13 @@ fts_lexer_create( ...@@ -238,13 +238,13 @@ fts_lexer_create(
if (boolean_mode) { if (boolean_mode) {
fts0blex_init(&fts_lexer->yyscanner); fts0blex_init(&fts_lexer->yyscanner);
fts0b_scan_bytes((char*) query, query_len, fts_lexer->yyscanner); fts0b_scan_bytes((char*) query, query_len, fts_lexer->yyscanner);
fts_lexer->scanner = (fts_scan) fts_blexer; fts_lexer->scanner = fts_blexer;
/* FIXME: Debugging */ /* FIXME: Debugging */
/* fts0bset_debug(1 , fts_lexer->yyscanner); */ /* fts0bset_debug(1 , fts_lexer->yyscanner); */
} else { } else {
fts0tlex_init(&fts_lexer->yyscanner); fts0tlex_init(&fts_lexer->yyscanner);
fts0t_scan_bytes((char*) query, query_len, fts_lexer->yyscanner); fts0t_scan_bytes((char*) query, query_len, fts_lexer->yyscanner);
fts_lexer->scanner = (fts_scan) fts_tlexer; fts_lexer->scanner = fts_tlexer;
} }
return(fts_lexer); return(fts_lexer);
...@@ -258,7 +258,7 @@ fts_lexer_free( ...@@ -258,7 +258,7 @@ fts_lexer_free(
/*===========*/ /*===========*/
fts_lexer_t* fts_lexer) fts_lexer_t* fts_lexer)
{ {
if (fts_lexer->scanner == (fts_scan) fts_blexer) { if (fts_lexer->scanner == fts_blexer) {
fts0blex_destroy(fts_lexer->yyscanner); fts0blex_destroy(fts_lexer->yyscanner);
} else { } else {
fts0tlex_destroy(fts_lexer->yyscanner); fts0tlex_destroy(fts_lexer->yyscanner);
...@@ -276,9 +276,9 @@ fts_lexer( ...@@ -276,9 +276,9 @@ fts_lexer(
YYSTYPE* val, YYSTYPE* val,
fts_lexer_t* fts_lexer) fts_lexer_t* fts_lexer)
{ {
fts_scanner_alt func_ptr; fts_scanner func_ptr;
func_ptr = (fts_scanner_alt) fts_lexer->scanner; func_ptr = fts_lexer->scanner;
return(func_ptr(val, fts_lexer->yyscanner)); return(func_ptr(val, fts_lexer->yyscanner));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment