From 9f158a44b7e88c1dcfb8d56f4f85d642fc423b59 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 17 Oct 2014 08:17:49 -0700 Subject: Purge stray occurrences of "void *" from code base. * lib.c (cobj_print_op): In the format call, cast the C pointer to val, since the ~p conversion now takes a val rather than void *. (cptr_equal_op, obj_print, obj_pprint): Remove cast to void *, since obj now already has the type that ~p expects. * lib.h (struct any): Use mem_t * instead of void *. * parser.h (yyscan_t): Repeat the definition from inside the Flex-generated lex.yy.c. (yylex_init, yylex_destroy, yyget_extra, yyset_extra): Re-declare using yyscan_t typedef in place of void *. * parser.l (yyget_column, yyerrprepf): Re-declare using yyscan_t. (grammar): Use yyg in place of yyscanner in calls to yyerrprepf. * parser.y (yylex, %lex-param): Use yyscan_t instead of void *. (parse): Use yyscan_t for local variable. * signal.c (stack): Change type from void * to mem_t *. * stream.c (vformat): Conversion specifier p extracts val instead of void *. (run): Use casts that only remove const, not all the way to void *. * txr.1: Documented p conversion specifier of format. * Makefile (OBJS-y): Initialize with := to make sure it is a simple variable, and not a macro. (SRCS): New variable, listing source files. (enforce): New rule for enforcing coding conventions. Currently checks for void * occurrences. --- parser.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'parser.h') diff --git a/parser.h b/parser.h index 532fbfb1..e9003039 100644 --- a/parser.h +++ b/parser.h @@ -36,6 +36,11 @@ typedef struct { scanner_t *scanner; } parser_t; +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void *yyscan_t; +#endif + extern const wchar_t *spec_file; extern val form_to_ln_hash; void yyerror(scanner_t *scanner, parser_t *, const char *s); @@ -44,10 +49,10 @@ void yyerrorf(scanner_t *scanner, val s, ...); void yybadtoken(parser_t *, int tok, val context); void end_of_regex(scanner_t *scanner); void end_of_char(scanner_t *scanner); -int yylex_init(void **pscanner); -int yylex_destroy(void *scanner); -parser_t *yyget_extra(void *scanner); -void yyset_extra(parser_t *, void *scanner); +int yylex_init(yyscan_t *pscanner); +int yylex_destroy(yyscan_t scanner); +parser_t *yyget_extra(yyscan_t scanner); +void yyset_extra(parser_t *, yyscan_t); void parse_init(void); void open_txr_file(val spec_file, val *name, val *stream); int parse(val stream, val name, parser_t *parser); -- cgit v1.2.3