diff options
author | Bill Meier <wmeier@newsguy.com> | 2008-04-25 17:40:29 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2008-04-25 17:40:29 +0000 |
commit | 0d4b874b44dd082eaa61b5b403069d0e3cd38453 (patch) | |
tree | c78189b236a540b92d55b797c7ec1bf798db3f76 | |
parent | ff523807655f111ba5ae1f84a030ee8a147c3997 (diff) |
Bug 2493: Fix (Part 2):
To prevent Windows compiler errors when using flex 2.5.35.
Fixes "missing unistd.h" and yywrap "mismatched parameter" warnings
[Upcoming Part 3: ignore 'signed /unsigned mismatch' errors]
svn path=/trunk/; revision=25173
-rw-r--r-- | epan/dfilter/scanner.l | 5 | ||||
-rw-r--r-- | epan/diam_dict.l | 21 | ||||
-rw-r--r-- | epan/dtd_parse.l | 23 | ||||
-rw-r--r-- | epan/dtd_preparse.l | 23 | ||||
-rw-r--r-- | epan/radius_dict.l | 16 | ||||
-rw-r--r-- | epan/uat_load.l | 16 | ||||
-rw-r--r-- | plugins/mate/mate_parser.l | 23 | ||||
-rw-r--r-- | plugins/wimaxasncp/wimaxasncp_dict.l | 16 | ||||
-rw-r--r-- | text2pcap-scanner.l | 9 | ||||
-rw-r--r-- | wiretap/ascend-scanner.l | 16 | ||||
-rw-r--r-- | wiretap/k12text.l | 16 |
11 files changed, 128 insertions, 56 deletions
diff --git a/epan/dfilter/scanner.l b/epan/dfilter/scanner.l index 8ce6d91d60..efcf4ce395 100644 --- a/epan/dfilter/scanner.l +++ b/epan/dfilter/scanner.l @@ -1,9 +1,4 @@ /* - * We want to stop processing when we get to the end of the input. - */ -%option noyywrap - -/* * We don't use unput, so don't generate code for it. */ %option nounput diff --git a/epan/diam_dict.l b/epan/diam_dict.l index 1927845689..e6478d5e9a 100644 --- a/epan/diam_dict.l +++ b/epan/diam_dict.l @@ -1,14 +1,4 @@ /* - * We want to stop processing when we get to the end of the input. - */ -%option noyywrap - -/* - * We don't use unput, so don't generate code for it. - */ -%option nounput - -/* * We don't read from the terminal. */ %option never-interactive @@ -806,6 +796,17 @@ void ddict_print(FILE* fh, ddict_t* d) { } } +/* + * We want to stop processing when we get to the end of the input. + * (%option noyywrap is not used because if used then + * some flex versions (eg: 2.5.35) generate code which causes + * warnings by the Windows VC compiler). + */ + +int yywrap(void) { + return 1; +} + #ifdef TEST_DIAM_DICT_STANDALONE int main(int argc, char** argv) { ddict_t* d; diff --git a/epan/dtd_parse.l b/epan/dtd_parse.l index 6749dfb556..f097148809 100644 --- a/epan/dtd_parse.l +++ b/epan/dtd_parse.l @@ -1,9 +1,4 @@ /* - * We want to stop processing when we get to the end of the input. - */ -%option noyywrap - -/* * We don't use unput, so don't generate code for it. */ %option nounput @@ -111,6 +106,13 @@ #define YY_INPUT(buff,result,max_size) ( (result) = my_yyinput((buff),(max_size)) ) +/* + * Flex (v 2.5.35) uses this symbol to "exclude" unistd.h + */ +#ifdef _WIN32 +#define YY_NO_UNISTD_H +#endif + %} comment_start "<!--" @@ -367,3 +369,14 @@ extern dtd_build_data_t* dtd_parse(GString* s) { return build_data; } + +/* + * We want to stop processing when we get to the end of the input. + * (%option noyywrap is not used because if used then + * some flex versions (eg: 2.5.35) generate code which causes + * warnings by the Windows VC compiler). + */ + +int yywrap(void) { + return 1; +} diff --git a/epan/dtd_preparse.l b/epan/dtd_preparse.l index 988cd87281..c73d722772 100644 --- a/epan/dtd_preparse.l +++ b/epan/dtd_preparse.l @@ -1,9 +1,4 @@ /* - * We want to stop processing when we get to the end of the input. - */ -%option noyywrap - -/* * We don't use unput, so don't generate code for it. */ %option nounput @@ -82,6 +77,13 @@ static guint linenum; static gchar* replace_entity(gchar* s); static const gchar* location(void); +/* + * Flex (v 2.5.35) uses this symbol to "exclude" unistd.h + */ +#ifdef _WIN32 +#define YY_NO_UNISTD_H +#endif + %} xmlpi_start "<?" xmlpi_stop "?>" @@ -217,3 +219,14 @@ extern GString* dtd_preparse(const gchar* dname,const gchar* fname, GString* er return output; } + +/* + * We want to stop processing when we get to the end of the input. + * (%option noyywrap is not used because if used then + * some flex versions (eg: 2.5.35) generate code which causes + * warnings by the Windows VC compiler). + */ + +int yywrap(void) { + return 1; +} diff --git a/epan/radius_dict.l b/epan/radius_dict.l index 2dfbcec1dd..677e039123 100644 --- a/epan/radius_dict.l +++ b/epan/radius_dict.l @@ -1,9 +1,4 @@ /* - * We want to stop processing when we get to the end of the input. - */ -%option noyywrap - -/* * We don't use unput, so don't generate code for it. */ %option nounput @@ -419,3 +414,14 @@ gboolean radius_load_dictionary (radius_dictionary_t* d, gchar* dir, const gchar return TRUE; } } + +/* + * We want to stop processing when we get to the end of the input. + * (%option noyywrap is not used because if used then + * some flex versions (eg: 2.5.35) generate code which causes + * warnings by the Windows VC compiler). + */ + +int yywrap(void) { + return 1; +} diff --git a/epan/uat_load.l b/epan/uat_load.l index ec93d11100..1045d8e757 100644 --- a/epan/uat_load.l +++ b/epan/uat_load.l @@ -1,9 +1,4 @@ /* - * We want to stop processing when we get to the end of the input. - */ -%option noyywrap - -/* * We don't use unput, so don't generate code for it. */ %option nounput @@ -349,3 +344,14 @@ gboolean uat_load_str(uat_t* uat_in, char* entry, char** err) { return TRUE; } } + +/* + * We want to stop processing when we get to the end of the input. + * (%option noyywrap is not used because if used then + * some flex versions (eg: 2.5.35) generate code which causes + * warnings by the Windows VC compiler). + */ + +int yywrap(void) { + return 1; +} diff --git a/plugins/mate/mate_parser.l b/plugins/mate/mate_parser.l index f3a190407b..c58210e574 100644 --- a/plugins/mate/mate_parser.l +++ b/plugins/mate/mate_parser.l @@ -1,9 +1,4 @@ /* - * We want to stop processing when we get to the end of the input. - */ -%option noyywrap - -/* * We don't use unput, so don't generate code for it. */ %option nounput @@ -73,6 +68,13 @@ #define MATE_PARSE(token_type) MateParser(pParser, (token_type), g_strdup(yytext), mc ); +/* + * Flex (v 2.5.35) uses this symbol to "exclude" unistd.h + */ +#ifdef _WIN32 +#define YY_NO_UNISTD_H +#endif + %} pdu_kw Pdu @@ -325,3 +327,14 @@ extern gboolean mate_load_config(const gchar* filename, mate_config* matecfg) { return state; } + +/* + * We want to stop processing when we get to the end of the input. + * (%option noyywrap is not used because if used then + * some flex versions (eg: 2.5.35) generate code which causes + * warnings by the Windows VC compiler). + */ + +int yywrap(void) { + return 1; +} diff --git a/plugins/wimaxasncp/wimaxasncp_dict.l b/plugins/wimaxasncp/wimaxasncp_dict.l index 6d8a4a3364..798946ffea 100644 --- a/plugins/wimaxasncp/wimaxasncp_dict.l +++ b/plugins/wimaxasncp/wimaxasncp_dict.l @@ -1,9 +1,4 @@ /* - * We want to stop processing when we get to the end of the input. - */ -%option noyywrap - -/* * We don't use unput, so don't generate code for it. */ %option nounput @@ -731,6 +726,17 @@ void wimaxasncp_dict_print(FILE *fh, wimaxasncp_dict_t *d) { } } +/* + * We want to stop processing when we get to the end of the input. + * (%option noyywrap is not used because if used then + * some flex versions (eg: 2.5.35) generate code which causes + * warnings by the Windows VC compiler). + */ + +int yywrap(void) { + return 1; +} + #ifdef TEST_WIMAXASNCP_DICT_STANDALONE int main(int argc, char **argv) { wimaxasncp_dict_t *d; diff --git a/text2pcap-scanner.l b/text2pcap-scanner.l index 6b0b716f45..90efadf4cf 100644 --- a/text2pcap-scanner.l +++ b/text2pcap-scanner.l @@ -41,7 +41,14 @@ #include <stdlib.h> #include "text2pcap.h" - + +/* + * Flex (v 2.5.35) uses this symbol to "exclude" unistd.h + */ +#ifdef _WIN32 +#define YY_NO_UNISTD_H +#endif + %} hexdigit [0-9A-Fa-f] diff --git a/wiretap/ascend-scanner.l b/wiretap/ascend-scanner.l index ac87f467f2..52dfd723a9 100644 --- a/wiretap/ascend-scanner.l +++ b/wiretap/ascend-scanner.l @@ -1,9 +1,4 @@ /* - * We want to stop processing when we get to the end of the input. - */ -%option noyywrap - -/* * We don't read from the terminal. */ %option never-interactive @@ -353,3 +348,14 @@ void ascend_init_lexer(FILE_T fh) yy_fh = fh; BEGIN(INITIAL); } + +/* + * We want to stop processing when we get to the end of the input. + * (%option noyywrap is not used because if used then + * some flex versions (eg: 2.5.35) generate code which causes + * warnings by the Windows VC compiler). + */ + +int yywrap(void) { + return 1; +} diff --git a/wiretap/k12text.l b/wiretap/k12text.l index 367b6aa38d..d832d6b588 100644 --- a/wiretap/k12text.l +++ b/wiretap/k12text.l @@ -1,9 +1,4 @@ /* - * We want to stop processing when we get to the end of the input. - */ -%option noyywrap - -/* * We don't use unput, so don't generate code for it. */ %option nounput @@ -327,3 +322,14 @@ int k12text_dump_can_write_encap(int encap) { return WTAP_ERR_UNSUPPORTED_ENCAP; } } + +/* + * We want to stop processing when we get to the end of the input. + * (%option noyywrap is not used because if used then + * some flex versions (eg: 2.5.35) generate code which causes + * warnings by the Windows VC compiler). + */ + +int yywrap(void) { + return 1; +} |