aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/indent
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2016-07-29 19:36:10 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2016-07-29 19:36:10 +0000
commitc917a54b26fe43c96896717af97ca8f7011a3dd4 (patch)
treeab94d4e9f32f17dc032d0f20ec8a50d6525aadbc /usr.bin/indent
parent005ce8e4e6041b626ba4b050db839e6764f44043 (diff)
downloadsrc-c917a54b26fe43c96896717af97ca8f7011a3dd4.tar.gz
src-c917a54b26fe43c96896717af97ca8f7011a3dd4.zip
indent(1): Use NULL instead of zero for pointers.
Notes
Notes: svn path=/head/; revision=303502
Diffstat (limited to 'usr.bin/indent')
-rw-r--r--usr.bin/indent/args.c4
-rw-r--r--usr.bin/indent/indent.c26
-rw-r--r--usr.bin/indent/io.c4
-rw-r--r--usr.bin/indent/lexi.c4
-rw-r--r--usr.bin/indent/pr_comment.c8
5 files changed, 23 insertions, 23 deletions
diff --git a/usr.bin/indent/args.c b/usr.bin/indent/args.c
index cab0f7d092b7..3321d20bd406 100644
--- a/usr.bin/indent/args.c
+++ b/usr.bin/indent/args.c
@@ -280,9 +280,9 @@ found:
break;
case STDIN:
- if (input == 0)
+ if (input == NULL)
input = stdin;
- if (output == 0)
+ if (output == NULL)
output = stdout;
break;
diff --git a/usr.bin/indent/indent.c b/usr.bin/indent/indent.c
index 33c5bcff6fd7..bd312dd24970 100644
--- a/usr.bin/indent/indent.c
+++ b/usr.bin/indent/indent.c
@@ -147,11 +147,11 @@ main(int argc, char **argv)
scase = ps.pcase = false;
squest = 0;
- sc_end = 0;
- bp_save = 0;
- be_save = 0;
+ sc_end = NULL;
+ bp_save = NULL;
+ be_save = NULL;
- output = 0;
+ output = NULL;
tabs_to_var = 0;
/*--------------------------------------------------*\
@@ -328,7 +328,7 @@ main(int argc, char **argv)
case lbrace: /* this is a brace that starts the compound
* 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 */
ps.search_brace = false;
goto check_type;
@@ -341,8 +341,8 @@ main(int argc, char **argv)
}
case comment: /* we have a comment, so we must copy it into
* the buffer */
- if (!flushed_nl || sc_end != 0) {
- if (sc_end == 0) { /* if this is the first comment, we
+ if (!flushed_nl || sc_end != NULL) {
+ if (sc_end == NULL) { /* if this is the first comment, we
* must set up the buffer */
save_com[0] = save_com[1] = ' ';
sc_end = &(save_com[2]);
@@ -386,7 +386,7 @@ main(int argc, char **argv)
&& e_code != s_code && e_code[-1] == '}'))
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 */
ps.search_brace = false;
goto check_type;
@@ -417,7 +417,7 @@ main(int argc, char **argv)
* save_com */
*sc_end++ = ' ';/* add trailing blank, just in case */
buf_end = sc_end;
- sc_end = 0;
+ sc_end = NULL;
break;
} /* end of switch */
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'))
e_lab--;
- if (e_lab - s_lab == com_end && bp_save == 0) { /* comment on
- * preprocessor line */
- if (sc_end == 0) /* if this is the first comment, we
+ /* comment on preprocessor line */
+ if (e_lab - s_lab == com_end && bp_save == NULL) {
+ if (sc_end == NULL) /* if this is the first comment, we
* must set up the buffer */
sc_end = &(save_com[0]);
else {
@@ -1126,7 +1126,7 @@ check_type:
* save_com */
*sc_end++ = ' '; /* add trailing blank, just in case */
buf_end = sc_end;
- sc_end = 0;
+ sc_end = NULL;
}
*e_lab = '\0'; /* null terminate line */
ps.pcase = false;
diff --git a/usr.bin/indent/io.c b/usr.bin/indent/io.c
index c2a5969ca271..d9d9df6f856d 100644
--- a/usr.bin/indent/io.c
+++ b/usr.bin/indent/io.c
@@ -348,10 +348,10 @@ fill_buffer(void)
int i;
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_end = be_save;
- bp_save = be_save = 0;
+ bp_save = be_save = NULL;
if (buf_ptr < buf_end)
return; /* only return if there is really something in
* this buffer */
diff --git a/usr.bin/indent/lexi.c b/usr.bin/indent/lexi.c
index a61f87e11a74..ac092a026eb7 100644
--- a/usr.bin/indent/lexi.c
+++ b/usr.bin/indent/lexi.c
@@ -262,7 +262,7 @@ lexi(void)
/*
* 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 */
if (*j++ != *q++ || *j++ != *q++)
continue; /* This test depends on the fact that
@@ -601,6 +601,6 @@ addkey(char *key, int val)
* ignored */
p->rwd = key;
p->rwcode = val;
- p[1].rwd = 0;
+ p[1].rwd = NULL;
p[1].rwcode = 0;
}
diff --git a/usr.bin/indent/pr_comment.c b/usr.bin/indent/pr_comment.c
index 9524bf404f19..91ba832cd844 100644
--- a/usr.bin/indent/pr_comment.c
+++ b/usr.bin/indent/pr_comment.c
@@ -100,7 +100,7 @@ pr_comment(void)
int one_liner = 1; /* true iff this comment is a one-liner */
adj_max_col = max_col;
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
* a boxed comment or some other
* comment that should not be touched */
@@ -196,7 +196,7 @@ pr_comment(void)
ps.use_ff = true;
/* fix so dump_line uses a form feed */
dump_line();
- last_bl = 0;
+ last_bl = NULL;
*e_com++ = ' ';
*e_com++ = '*';
*e_com++ = ' ';
@@ -392,7 +392,7 @@ pr_comment(void)
e_com = t;
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 */
*e_com++ = ' ';
}
@@ -408,7 +408,7 @@ pr_comment(void)
*e_com++ = ' ';
t_ptr = last_bl + 1;
- last_bl = 0;
+ last_bl = NULL;
if (t_ptr >= e_com) {
while (*t_ptr == ' ' || *t_ptr == '\t')
t_ptr++;