changeset 1023:a39617d07de4

parse: avoid redefinition of typedef warnings Instead of trying to fight with the code generated by lex, we just use the void * type directly. It is slightly less obvious what the arguments are without looking at the name, but that is significantly better than dealing with a file full of ugly #ifdefs. Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Sat, 18 Jul 2020 10:50:39 -0400
parents 1224c5a5be96
children bcb849782534
files parse.h
diffstat 1 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/parse.h	Mon Jun 22 09:28:03 2020 -0400
+++ b/parse.h	Sat Jul 18 10:50:39 2020 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2017 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+ * Copyright (c) 2012-2020 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -59,16 +59,14 @@
 	struct str *sc_twitter_img;
 };
 
-typedef void* yyscan_t;
-
-extern int fmt3_lex_destroy(yyscan_t yyscanner);
-extern int tmpl_lex_destroy(yyscan_t yyscanner);
+extern int fmt3_lex_destroy(void *yyscanner);
+extern int tmpl_lex_destroy(void *yyscanner);
 extern int fmt3_parse(struct parser_output *data);
 extern int tmpl_parse(struct parser_output *data);
-extern void fmt3_set_extra(void * user_defined, yyscan_t yyscanner);
-extern void tmpl_set_extra(void * user_defined, yyscan_t yyscanner);
-extern int fmt3_lex_init(yyscan_t* scanner);
-extern int tmpl_lex_init(yyscan_t* scanner);
+extern void fmt3_set_extra(void *user_defined, void *yyscanner);
+extern void tmpl_set_extra(void *user_defined, void *yyscanner);
+extern int fmt3_lex_init(void **scanner);
+extern int tmpl_lex_init(void **scanner);
 
 static inline bool cond_value(struct parser_output *data)
 {