From owner-dev-commits-src-all@freebsd.org Thu Feb 11 23:53:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAD5353A4D1; Thu, 11 Feb 2021 23:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcD3h50rGz3HD5; Thu, 11 Feb 2021 23:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D3A81A2B2; Thu, 11 Feb 2021 23:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11BNra26077456; Thu, 11 Feb 2021 23:53:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11BNraBT077455; Thu, 11 Feb 2021 23:53:36 GMT (envelope-from git) Date: Thu, 11 Feb 2021 23:53:36 GMT Message-Id: <202102112353.11BNraBT077455@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jung-uk Kim Subject: git: 80f314327434 - main - yacc: Use NULL instead of 0 for pointers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 80f31432743446a1e8e4f8cb8268b74ac4e4f2da Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 23:53:37 -0000 The branch main has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=80f31432743446a1e8e4f8cb8268b74ac4e4f2da commit 80f31432743446a1e8e4f8cb8268b74ac4e4f2da Author: Jung-uk Kim AuthorDate: 2021-02-11 23:40:00 +0000 Commit: Jung-uk Kim CommitDate: 2021-02-11 23:40:00 +0000 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. --- contrib/byacc/btyaccpar.c | 8 ++++---- contrib/byacc/btyaccpar.skel | 8 ++++---- contrib/byacc/yaccpar.c | 6 +++--- contrib/byacc/yaccpar.skel | 6 +++--- 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')