aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2021-02-11 23:40:00 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2021-02-11 23:40:00 +0000
commit80f31432743446a1e8e4f8cb8268b74ac4e4f2da (patch)
tree21bfdeaa9db8cbfb7b25aaba4748e9f8c680192a
parent34e67bb5977049afb3e965b52b86ac12ea4899b4 (diff)
downloadsrc-80f31432743446a1e8e4f8cb8268b74ac4e4f2da.tar.gz
src-80f31432743446a1e8e4f8cb8268b74ac4e4f2da.zip
yacc: Use NULL instead of 0 for pointers
Note araujo tried to fix it in r298241 but he only touched generated files for bootstrap. This commit properly fixes the problem.
-rw-r--r--contrib/byacc/btyaccpar.c8
-rw-r--r--contrib/byacc/btyaccpar.skel8
-rw-r--r--contrib/byacc/yaccpar.c6
-rw-r--r--contrib/byacc/yaccpar.skel6
4 files changed, 14 insertions, 14 deletions
diff --git a/contrib/byacc/btyaccpar.c b/contrib/byacc/btyaccpar.c
index 64a9febd17e4..f4db838e3244 100644
--- a/contrib/byacc/btyaccpar.c
+++ b/contrib/byacc/btyaccpar.c
@@ -326,14 +326,14 @@ const char *const body_1[] =
"",
" i = (int) (data->s_mark - data->s_base);",
" newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));",
- " if (newss == 0)",
+ " if (newss == NULL)",
" return YYENOMEM;",
"",
" data->s_base = newss;",
" data->s_mark = newss + i;",
"",
" newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));",
- " if (newvs == 0)",
+ " if (newvs == NULL)",
" return YYENOMEM;",
"",
" data->l_base = newvs;",
@@ -341,7 +341,7 @@ const char *const body_1[] =
"",
"#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)",
" newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps));",
- " if (newps == 0)",
+ " if (newps == NULL)",
" return YYENOMEM;",
"",
" data->p_base = newps;",
@@ -446,7 +446,7 @@ const char *const body_2[] =
"#if YYDEBUG",
" const char *yys;",
"",
- " if ((yys = getenv(\"YYDEBUG\")) != 0)",
+ " if ((yys = getenv(\"YYDEBUG\")) != NULL)",
" {",
" yyn = *yys;",
" if (yyn >= '0' && yyn <= '9')",
diff --git a/contrib/byacc/btyaccpar.skel b/contrib/byacc/btyaccpar.skel
index 009942ee041f..84ea14846138 100644
--- a/contrib/byacc/btyaccpar.skel
+++ b/contrib/byacc/btyaccpar.skel
@@ -271,14 +271,14 @@ static int yygrowstack(YYSTACKDATA *data)
i = (int) (data->s_mark - data->s_base);
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
- if (newss == 0)
+ if (newss == NULL)
return YYENOMEM;
data->s_base = newss;
data->s_mark = newss + i;
newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
- if (newvs == 0)
+ if (newvs == NULL)
return YYENOMEM;
data->l_base = newvs;
@@ -286,7 +286,7 @@ static int yygrowstack(YYSTACKDATA *data)
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps));
- if (newps == 0)
+ if (newps == NULL)
return YYENOMEM;
data->p_base = newps;
@@ -381,7 +381,7 @@ YYPARSE_DECL()
#if YYDEBUG
const char *yys;
- if ((yys = getenv("YYDEBUG")) != 0)
+ if ((yys = getenv("YYDEBUG")) != NULL)
{
yyn = *yys;
if (yyn >= '0' && yyn <= '9')
diff --git a/contrib/byacc/yaccpar.c b/contrib/byacc/yaccpar.c
index e57bd4bb7d36..30299074523f 100644
--- a/contrib/byacc/yaccpar.c
+++ b/contrib/byacc/yaccpar.c
@@ -160,14 +160,14 @@ const char *const body_1[] =
"",
" i = (int) (data->s_mark - data->s_base);",
" newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));",
- " if (newss == 0)",
+ " if (newss == NULL)",
" return YYENOMEM;",
"",
" data->s_base = newss;",
" data->s_mark = newss + i;",
"",
" newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));",
- " if (newvs == 0)",
+ " if (newvs == NULL)",
" return YYENOMEM;",
"",
" data->l_base = newvs;",
@@ -206,7 +206,7 @@ const char *const body_2[] =
"#if YYDEBUG",
" const char *yys;",
"",
- " if ((yys = getenv(\"YYDEBUG\")) != 0)",
+ " if ((yys = getenv(\"YYDEBUG\")) != NULL)",
" {",
" yyn = *yys;",
" if (yyn >= '0' && yyn <= '9')",
diff --git a/contrib/byacc/yaccpar.skel b/contrib/byacc/yaccpar.skel
index 32e2d1560537..f12e0d29cca9 100644
--- a/contrib/byacc/yaccpar.skel
+++ b/contrib/byacc/yaccpar.skel
@@ -119,14 +119,14 @@ static int yygrowstack(YYSTACKDATA *data)
i = (int) (data->s_mark - data->s_base);
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
- if (newss == 0)
+ if (newss == NULL)
return YYENOMEM;
data->s_base = newss;
data->s_mark = newss + i;
newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
- if (newvs == 0)
+ if (newvs == NULL)
return YYENOMEM;
data->l_base = newvs;
@@ -161,7 +161,7 @@ YYPARSE_DECL()
#if YYDEBUG
const char *yys;
- if ((yys = getenv("YYDEBUG")) != 0)
+ if ((yys = getenv("YYDEBUG")) != NULL)
{
yyn = *yys;
if (yyn >= '0' && yyn <= '9')