diff options
author | Michael McConville <mmcconville@mykolab.com> | 2015-12-05 18:00:12 -0500 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2015-12-05 18:50:53 -0500 |
commit | e0877888da128c7a1fcb24f5a7b5959c54631e18 (patch) | |
tree | 01840925f9868764a6e15c6bb3a4b281127f42d9 | |
parent | 3a1d84cfc0988a3dbdba7a440571e987cb68973a (diff) |
Use NULL rather than (type *) 0.
-rw-r--r-- | src/buf.c | 4 | ||||
-rw-r--r-- | src/dfa.c | 2 | ||||
-rw-r--r-- | src/main.c | 6 | ||||
-rw-r--r-- | src/nfa.c | 2 | ||||
-rw-r--r-- | src/parse.y | 2 | ||||
-rw-r--r-- | src/scan.l | 4 | ||||
-rw-r--r-- | src/scanopt.c | 2 | ||||
-rw-r--r-- | src/sym.c | 5 | ||||
-rw-r--r-- | to.do/unicode/main.c | 6 | ||||
-rw-r--r-- | to.do/unicode/scan.l | 4 |
10 files changed, 18 insertions, 19 deletions
@@ -197,7 +197,7 @@ struct Buf *buf_m4_undefine (struct Buf *buf, const char* def) /* create buf with 0 elements, each of size elem_size. */ void buf_init (struct Buf *buf, size_t elem_size) { - buf->elts = (void *) 0; + buf->elts = NULL; buf->nelts = 0; buf->elt_size = elem_size; buf->nmax = 0; @@ -208,7 +208,7 @@ void buf_destroy (struct Buf *buf) { if (buf && buf->elts) flex_free (buf->elts); - buf->elts = (void *) 0; + buf->elts = NULL; } @@ -870,7 +870,7 @@ int snstods (int sns[], int numstates, int accset[], int nacc, int hashval, int if (nacc == 0) { if (reject) - dfaacc[newds].dfaacc_set = (int *) 0; + dfaacc[newds].dfaacc_set = NULL; else dfaacc[newds].dfaacc_state = 0; @@ -1451,9 +1451,9 @@ void readin (void) { static char yy_stdinit[] = "FILE *yyin = stdin, *yyout = stdout;"; static char yy_nostdinit[] = - "FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;"; + "FILE *yyin = NULL, *yyout = NULL;"; - line_directive_out ((FILE *) 0, 1); + line_directive_out(NULL, 1); if (yyparse ()) { pinpoint_message (_("fatal parse error")); @@ -1760,7 +1760,7 @@ void set_up_initial_allocations (void) dss = allocate_int_ptr_array (current_max_dfas); dfaacc = allocate_dfaacc_union (current_max_dfas); - nultrans = (int *) 0; + nultrans = NULL; } @@ -286,7 +286,7 @@ void finish_rule (int mach, int variable_trail_rule, int headcnt, int trailcn if (!continued_action) add_action ("YY_RULE_SETUP\n"); - line_directive_out ((FILE *) 0, 1); + line_directive_out(NULL, 1); } diff --git a/src/parse.y b/src/parse.y index 9bec1ee..c28d5bb 100644 --- a/src/parse.y +++ b/src/parse.y @@ -976,7 +976,7 @@ void build_eof_action(void) } } - line_directive_out( (FILE *) 0, 1 ); + line_directive_out(NULL, 1); /* This isn't a normal rule after all - don't count it as * such, so we don't have any holes in the rule numbering @@ -146,7 +146,7 @@ M4QEND "]]" ^"%x"{NAME}? return XSCDECL; ^"%{".*{NL} { ++linenum; - line_directive_out( (FILE *) 0, 1 ); + line_directive_out(NULL, 1); indented_code = false; BEGIN(CODEBLOCK); } @@ -166,7 +166,7 @@ M4QEND "]]" sectnum = 2; bracelevel = 0; mark_defs1(); - line_directive_out( (FILE *) 0, 1 ); + line_directive_out(NULL, 1); BEGIN(SECT2PROLOG); return SECTEND; } diff --git a/src/scanopt.c b/src/scanopt.c index 70c638d..2fe33f6 100644 --- a/src/scanopt.c +++ b/src/scanopt.c @@ -569,7 +569,7 @@ static int matchlongopt (char *str, char **optname, int *optlen, char **arg, int { char *p; - *optname = *arg = (char *) 0; + *optname = *arg = NULL; *optlen = *arglen = 0; /* Match regex /--./ */ @@ -141,8 +141,7 @@ int ccllookup (unsigned char ccltxt[]) static struct hash_entry *findsym (const char *sym, hash_table table, int table_size) { static struct hash_entry empty_entry = { - (struct hash_entry *) 0, (struct hash_entry *) 0, - (char *) 0, (char *) 0, 0, + NULL, NULL, NULL, NULL, 0, }; struct hash_entry *sym_entry = @@ -229,7 +228,7 @@ void scinstal (const char *str, int xcluflg) scname[lastsc] = xstrdup(str); - if (addsym (scname[lastsc], (char *) 0, lastsc, + if (addsym(scname[lastsc], NULL, lastsc, sctbl, START_COND_HASH_SIZE)) format_pinpoint_message (_ ("start condition %s declared twice"), diff --git a/to.do/unicode/main.c b/to.do/unicode/main.c index eee3c3e..ca38e10 100644 --- a/to.do/unicode/main.c +++ b/to.do/unicode/main.c @@ -908,9 +908,9 @@ void readin() { static char yy_stdinit[] = "FILE *yyin = stdin, *yyout = stdout;"; static char yy_nostdinit[] = - "FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;"; + "FILE *yyin = NULL, *yyout = NULL;"; - line_directive_out( (FILE *) 0, 1 ); + line_directive_out(NULL, 1); if ( yyparse() ) { @@ -1155,7 +1155,7 @@ void set_up_initial_allocations() dss = allocate_int_ptr_array( current_max_dfas ); dfaacc = allocate_dfaacc_union( current_max_dfas ); - nultrans = (int *) 0; + nultrans = NULL; } diff --git a/to.do/unicode/scan.l b/to.do/unicode/scan.l index d7bda22..34cac77 100644 --- a/to.do/unicode/scan.l +++ b/to.do/unicode/scan.l @@ -109,7 +109,7 @@ LEXOPT [aceknopr] ^"%x"{NAME}? return XSCDECL; ^"%{".*{NL} { ++linenum; - line_directive_out( (FILE *) 0, 1 ); + line_directive_out(NULL, 1); indented_code = false; BEGIN(CODEBLOCK); } @@ -120,7 +120,7 @@ LEXOPT [aceknopr] sectnum = 2; bracelevel = 0; mark_defs1(); - line_directive_out( (FILE *) 0, 1 ); + line_directive_out(NULL, 1); BEGIN(SECT2PROLOG); return SECTEND; } |