indent(1): Use NULL instead of zero for pointers.

This commit is contained in:
pfg 2016-07-29 19:36:10 +00:00
parent dc85464f48
commit 90f6fb9380
5 changed files with 23 additions and 23 deletions

View File

@ -280,9 +280,9 @@ found:
break; break;
case STDIN: case STDIN:
if (input == 0) if (input == NULL)
input = stdin; input = stdin;
if (output == 0) if (output == NULL)
output = stdout; output = stdout;
break; break;

View File

@ -147,11 +147,11 @@ main(int argc, char **argv)
scase = ps.pcase = false; scase = ps.pcase = false;
squest = 0; squest = 0;
sc_end = 0; sc_end = NULL;
bp_save = 0; bp_save = NULL;
be_save = 0; be_save = NULL;
output = 0; output = NULL;
tabs_to_var = 0; tabs_to_var = 0;
/*--------------------------------------------------*\ /*--------------------------------------------------*\
@ -328,7 +328,7 @@ main(int argc, char **argv)
case lbrace: /* this is a brace that starts the compound case lbrace: /* this is a brace that starts the compound
* stmt */ * stmt */
if (sc_end == 0) { /* ignore buffering if a comment wasn't if (sc_end == NULL) { /* ignore buffering if a comment wasn't
* stored up */ * stored up */
ps.search_brace = false; ps.search_brace = false;
goto check_type; goto check_type;
@ -341,8 +341,8 @@ main(int argc, char **argv)
} }
case comment: /* we have a comment, so we must copy it into case comment: /* we have a comment, so we must copy it into
* the buffer */ * the buffer */
if (!flushed_nl || sc_end != 0) { if (!flushed_nl || sc_end != NULL) {
if (sc_end == 0) { /* if this is the first comment, we if (sc_end == NULL) { /* if this is the first comment, we
* must set up the buffer */ * must set up the buffer */
save_com[0] = save_com[1] = ' '; save_com[0] = save_com[1] = ' ';
sc_end = &(save_com[2]); sc_end = &(save_com[2]);
@ -386,7 +386,7 @@ main(int argc, char **argv)
&& e_code != s_code && e_code[-1] == '}')) && e_code != s_code && e_code[-1] == '}'))
force_nl = false; force_nl = false;
if (sc_end == 0) { /* ignore buffering if comment wasn't if (sc_end == NULL) { /* ignore buffering if comment wasn't
* saved up */ * saved up */
ps.search_brace = false; ps.search_brace = false;
goto check_type; goto check_type;
@ -417,7 +417,7 @@ main(int argc, char **argv)
* save_com */ * save_com */
*sc_end++ = ' ';/* add trailing blank, just in case */ *sc_end++ = ' ';/* add trailing blank, just in case */
buf_end = sc_end; buf_end = sc_end;
sc_end = 0; sc_end = NULL;
break; break;
} /* end of switch */ } /* end of switch */
if (type_code != 0) /* we must make this check, just in case there if (type_code != 0) /* we must make this check, just in case there
@ -1101,9 +1101,9 @@ check_type:
while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t')) while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t'))
e_lab--; e_lab--;
if (e_lab - s_lab == com_end && bp_save == 0) { /* comment on /* comment on preprocessor line */
* preprocessor line */ if (e_lab - s_lab == com_end && bp_save == NULL) {
if (sc_end == 0) /* if this is the first comment, we if (sc_end == NULL) /* if this is the first comment, we
* must set up the buffer */ * must set up the buffer */
sc_end = &(save_com[0]); sc_end = &(save_com[0]);
else { else {
@ -1126,7 +1126,7 @@ check_type:
* save_com */ * save_com */
*sc_end++ = ' '; /* add trailing blank, just in case */ *sc_end++ = ' '; /* add trailing blank, just in case */
buf_end = sc_end; buf_end = sc_end;
sc_end = 0; sc_end = NULL;
} }
*e_lab = '\0'; /* null terminate line */ *e_lab = '\0'; /* null terminate line */
ps.pcase = false; ps.pcase = false;

View File

@ -348,10 +348,10 @@ fill_buffer(void)
int i; int i;
FILE *f = input; FILE *f = input;
if (bp_save != 0) { /* there is a partly filled input buffer left */ if (bp_save != NULL) { /* there is a partly filled input buffer left */
buf_ptr = bp_save; /* dont read anything, just switch buffers */ buf_ptr = bp_save; /* dont read anything, just switch buffers */
buf_end = be_save; buf_end = be_save;
bp_save = be_save = 0; bp_save = be_save = NULL;
if (buf_ptr < buf_end) if (buf_ptr < buf_end)
return; /* only return if there is really something in return; /* only return if there is really something in
* this buffer */ * this buffer */

View File

@ -262,7 +262,7 @@ lexi(void)
/* /*
* This loop will check if the token is a keyword. * This loop will check if the token is a keyword.
*/ */
for (p = specials; (j = p->rwd) != 0; p++) { for (p = specials; (j = p->rwd) != NULL; p++) {
const char *q = s_token; /* point at scanned token */ const char *q = s_token; /* point at scanned token */
if (*j++ != *q++ || *j++ != *q++) if (*j++ != *q++ || *j++ != *q++)
continue; /* This test depends on the fact that continue; /* This test depends on the fact that
@ -601,6 +601,6 @@ addkey(char *key, int val)
* ignored */ * ignored */
p->rwd = key; p->rwd = key;
p->rwcode = val; p->rwcode = val;
p[1].rwd = 0; p[1].rwd = NULL;
p[1].rwcode = 0; p[1].rwcode = 0;
} }

View File

@ -100,7 +100,7 @@ pr_comment(void)
int one_liner = 1; /* true iff this comment is a one-liner */ int one_liner = 1; /* true iff this comment is a one-liner */
adj_max_col = max_col; adj_max_col = max_col;
ps.just_saw_decl = 0; ps.just_saw_decl = 0;
last_bl = 0; /* no blanks found so far */ last_bl = NULL; /* no blanks found so far */
ps.box_com = false; /* at first, assume that we are not in ps.box_com = false; /* at first, assume that we are not in
* a boxed comment or some other * a boxed comment or some other
* comment that should not be touched */ * comment that should not be touched */
@ -196,7 +196,7 @@ pr_comment(void)
ps.use_ff = true; ps.use_ff = true;
/* fix so dump_line uses a form feed */ /* fix so dump_line uses a form feed */
dump_line(); dump_line();
last_bl = 0; last_bl = NULL;
*e_com++ = ' '; *e_com++ = ' ';
*e_com++ = '*'; *e_com++ = '*';
*e_com++ = ' '; *e_com++ = ' ';
@ -392,7 +392,7 @@ pr_comment(void)
e_com = t; e_com = t;
s_com[0] = s_com[1] = s_com[2] = ' '; s_com[0] = s_com[1] = s_com[2] = ' ';
} }
if (last_bl == 0) { /* we have seen no blanks */ if (last_bl == NULL) { /* we have seen no blanks */
last_bl = e_com; /* fake it */ last_bl = e_com; /* fake it */
*e_com++ = ' '; *e_com++ = ' ';
} }
@ -408,7 +408,7 @@ pr_comment(void)
*e_com++ = ' '; *e_com++ = ' ';
t_ptr = last_bl + 1; t_ptr = last_bl + 1;
last_bl = 0; last_bl = NULL;
if (t_ptr >= e_com) { if (t_ptr >= e_com) {
while (*t_ptr == ' ' || *t_ptr == '\t') while (*t_ptr == ' ' || *t_ptr == '\t')
t_ptr++; t_ptr++;