From nobody Thu Apr 2 09:49:05 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fmcWP6dMkz6Y7dM for ; Thu, 02 Apr 2026 09:49:05 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fmcWP51K8z42tY for ; Thu, 02 Apr 2026 09:49:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1775123345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lPjfMvfY6gAW1VQ1EQO1hs3wiC3mug3bL4JyMPeGGzI=; b=B2zz82742Os1mXypLjuIDJAuLQfO6x5uf8ztZAuRYx90paTvMyVx+3WOTgXS1Y8h7MBQOv 28SEQ9ppFR5VY349eP6quu2iK2f2GVn1lrZykoKmodAa2seII4UwNc64csmppKjZ0thR9/ 0fyn2j68V+rg7fGfD7Ce4g4Yh/ufU50Db0mtWeTYIG3u99dgv+FMrxHDt+3CwCBdSn+xYG POyFM2iquabqcwWumofLIHNzySt6WZJ8GErYgz89VXmcVPbyFwcoND3W3jeE+So+hpP+Av Q+JcQYzqmSfc9hYvEDmSci4XO8m8CBN2R+x7bJ0K/5d5p6XcEWIZjXkQB5Rr4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1775123345; a=rsa-sha256; cv=none; b=fTNpHOQzg+zneK0eLEGl6yy/m+UuD5yhdF6QQqFLtQX6IPnrPC8ETF6ewsjMQXQQvHuj9A bC+kegxIe4Nvt1cFABJ7bR4jFCh+wS1iJA5ciQTkC7S8+dFVk/qLBEq3qD64DY3Imu+0cr ARORVeFTDl9H7vwhhIVdHyx+DVTb/MX3pcvTxKfbeY9A/xoJxC4pI8kHVHCgF4QNfZKIUs VPkZf9k9JqBgPwNZ4wgk49otmSSQ+XTDH0zcGoQfioo1NMQ9w/F3XBJ7zxq5l+pjauxKvz xdLaFynIHtHt2VNX9MYF/Mw3+Rc8IkArH1XNrvj4z0wJqpBLP1Lzrr5wJRi8Uw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1775123345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lPjfMvfY6gAW1VQ1EQO1hs3wiC3mug3bL4JyMPeGGzI=; b=QmmjeFgryc+4Oh3SawAYRnojHVdo+1EuWbHV1mkyOuOzMRLVcEPfeyhc9NLWevSeDPY6mG BryXsAPJNJZwzz9std1Ng2WClgY6cipiQTXsI/pOB9y4eJOwKp+EmrVz1tHJvI/jS/IaWI MXAl3CiRhd7JsZovbrcYJKf/96qzFAts/Fnd3tK9qBj9sSgPehtaNUbOk4Sb7Pc5ssyTJ1 ZPMuA5OLEJG7LDmQtPAeVG6HjdhGtMPJYhsvv8KUtj7Zgw1e3CMJez25u+mAlySXvBtc46 +lZw08y/4KyyN4tGif2W1ipMhDc4vZtQ6U5O+12Q399V2kYFMBXOT/+fBGGmGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fmcWP4WT9zwLg for ; Thu, 02 Apr 2026 09:49:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3b2b9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 02 Apr 2026 09:49:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: bc735d80e2e8 - stable/13 - m4: Misc style fixes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bc735d80e2e8af03b2b5ae269080761659970d65 Auto-Submitted: auto-generated Date: Thu, 02 Apr 2026 09:49:05 +0000 Message-Id: <69ce3b91.3b2b9.6ff2d348@gitrepo.freebsd.org> The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=bc735d80e2e8af03b2b5ae269080761659970d65 commit bc735d80e2e8af03b2b5ae269080761659970d65 Author: Dag-Erling Smørgrav AuthorDate: 2026-03-25 00:41:23 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-04-02 09:48:17 +0000 m4: Misc style fixes MFC after: 1 week Reviewed by: fuz Differential Revision: https://reviews.freebsd.org/D55794 (cherry picked from commit 41474e78c493184f023723d1f86539e07bb01b92) --- usr.bin/m4/eval.c | 18 +++++++++--------- usr.bin/m4/expr.c | 2 +- usr.bin/m4/look.c | 17 +++++++++-------- usr.bin/m4/main.c | 5 ++--- usr.bin/m4/mdef.h | 2 +- usr.bin/m4/misc.c | 12 +++++------- 6 files changed, 27 insertions(+), 29 deletions(-) diff --git a/usr.bin/m4/eval.c b/usr.bin/m4/eval.c index e86af54adb53..50cdd5536d6e 100644 --- a/usr.bin/m4/eval.c +++ b/usr.bin/m4/eval.c @@ -298,7 +298,7 @@ expand_builtin(const char *argv[], int argc, int td) case PASTETYPE: if (argc > 2) if (!dopaste(argv[2])) - err(1, "%s at line %lu: paste(%s)", + err(1, "%s at line %lu: paste(%s)", CURRENT_NAME, CURRENT_LINE, argv[2]); break; @@ -353,7 +353,7 @@ expand_builtin(const char *argv[], int argc, int td) errstr, argv[2]); if (n != 0) { dodivert(n); - break; + break; } } active = stdout; @@ -900,11 +900,11 @@ dosubstr(const char *argv[], int argc) * map every character of s1 that is specified in from * into s3 and replace in s. (source s1 remains untouched) * - * This is derived from the a standard implementation of map(s,from,to) - * function of ICON language. Within mapvec, we replace every character - * of "from" with the corresponding character in "to". - * If "to" is shorter than "from", than the corresponding entries are null, - * which means that those characters disappear altogether. + * This is derived from the a standard implementation of map(s,from,to) + * function of ICON language. Within mapvec, we replace every character + * of "from" with the corresponding character in "to". + * If "to" is shorter than "from", than the corresponding entries are null, + * which means that those characters disappear altogether. */ static void map(char *dest, const char *src, const char *from, const char *to) @@ -994,7 +994,7 @@ handledash(char *buffer, char *end, const char *src) if (src[1] == '-' && src[2]) { unsigned char i; if ((unsigned char)src[0] <= (unsigned char)src[2]) { - for (i = (unsigned char)src[0]; + for (i = (unsigned char)src[0]; i <= (unsigned char)src[2]; i++) { *p++ = i; if (p == end) { @@ -1003,7 +1003,7 @@ handledash(char *buffer, char *end, const char *src) } } } else { - for (i = (unsigned char)src[0]; + for (i = (unsigned char)src[0]; i >= (unsigned char)src[2]; i--) { *p++ = i; if (p == end) { diff --git a/usr.bin/m4/expr.c b/usr.bin/m4/expr.c index 7910403d74f0..859be1557d83 100644 --- a/usr.bin/m4/expr.c +++ b/usr.bin/m4/expr.c @@ -32,7 +32,7 @@ int yyerror(const char *msg) { fprintf(stderr, "m4: %s in expr %s\n", msg, copy_toeval); - return(0); + return 0; } int diff --git a/usr.bin/m4/look.c b/usr.bin/m4/look.c index a7e6d87b0494..c1fccd7dd8e5 100644 --- a/usr.bin/m4/look.c +++ b/usr.bin/m4/look.c @@ -137,8 +137,8 @@ static ndptr create_entry(const char *name) { const char *end = NULL; - unsigned int i; ndptr n; + unsigned int i; i = ohash_qlookupi(¯os, name, &end); n = ohash_find(¯os, i); @@ -156,6 +156,7 @@ void macro_define(const char *name, const char *defn) { ndptr n = create_entry(name); + if (n->d != NULL) { if (n->d->defn != null) free_definition(n->d->defn); @@ -183,6 +184,7 @@ void macro_undefine(const char *name) { ndptr n = lookup(name); + if (n != NULL) { struct macro_definition *r, *r2; @@ -295,21 +297,21 @@ keep(char *ptr) kept_capacity *= 2; else kept_capacity = 50; - kept = xreallocarray(kept, kept_capacity, - sizeof(char *), "Out of memory while saving %d strings\n", + kept = xreallocarray(kept, kept_capacity, + sizeof(char *), "Out of memory while saving %d strings\n", kept_capacity); } kept[kept_size++] = ptr; } static int -string_in_use(const char *ptr) +string_in_use(const char *ptr) { int i; - for (i = 0; i <= sp; i++) { + + for (i = 0; i <= sp; i++) if (sstack[i] == STORAGE_MACRO && mstack[i].sstr == ptr) return 1; - } return 0; } @@ -324,7 +326,7 @@ free_definition(char *ptr) if (!string_in_use(kept[i])) { kept_size--; free(kept[i]); - if (i != kept_size) + if (i != kept_size) kept[i] = kept[kept_size]; i--; } @@ -336,4 +338,3 @@ free_definition(char *ptr) else free(ptr); } - diff --git a/usr.bin/m4/main.c b/usr.bin/m4/main.c index 6e4e79b2a414..5daae7fd22c2 100644 --- a/usr.bin/m4/main.c +++ b/usr.bin/m4/main.c @@ -86,7 +86,7 @@ int maxout; FILE *active; /* active output file pointer */ int ilevel = 0; /* input file stack pointer */ int oindex = 0; /* diversion index.. */ -const char *null = ""; /* as it says.. just a null.. */ +const char *null = ""; /* as it says.. just a null.. */ char **m4wraps = NULL; /* m4wraps array. */ int maxwraps = 0; /* size of m4wraps array */ int wrapindex = 0; /* current offset in m4wraps */ @@ -388,8 +388,7 @@ macro(void) CHRSAVE(l); } } - } - while (nlpar != 0); + } while (nlpar != 0); } else if (sp < 0 && LOOK_AHEAD(t, scommt)) { reallyoutputstr(scommt); diff --git a/usr.bin/m4/mdef.h b/usr.bin/m4/mdef.h index 86960e3741e1..424bdc91b241 100644 --- a/usr.bin/m4/mdef.h +++ b/usr.bin/m4/mdef.h @@ -206,7 +206,7 @@ struct input_file { mstack[sp].sstr = macro_getdef(p)->defn;\ sstack[sp] = STORAGE_MACRO; \ } while (0) - + /* * . . diff --git a/usr.bin/m4/misc.c b/usr.bin/m4/misc.c index ca37dc3c4593..84aeac6c27b5 100644 --- a/usr.bin/m4/misc.c +++ b/usr.bin/m4/misc.c @@ -136,8 +136,7 @@ pbnumbase(int n, int base, int d) do { pushback(digits[num % base]); printed++; - } - while ((num /= base) > 0); + } while ((num /= base) > 0); while (printed++ < d) pushback('0'); @@ -154,8 +153,7 @@ pbunsigned(unsigned long n) { do { pushback(n % 10 + '0'); - } - while ((n /= 10) > 0); + } while ((n /= 10) > 0); } void @@ -187,9 +185,9 @@ enlarge_strspace(void) memcpy(newstrspace, strspace, strsize/2); for (i = 0; i <= sp; i++) if (sstack[i] == STORAGE_STRSPACE) - mstack[i].sstr = (mstack[i].sstr - strspace) - + newstrspace; - ep = (ep-strspace) + newstrspace; + mstack[i].sstr = (mstack[i].sstr - strspace) + + newstrspace; + ep = (ep - strspace) + newstrspace; free(strspace); strspace = newstrspace; endest = strspace + strsize;