From nobody Fri May 3 16:32:51 2024 X-Original-To: dev-commits-src-all@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 4VWGYw10R6z5J4LB; Fri, 3 May 2024 16:32:52 +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 4VWGYw0TnTz441s; Fri, 3 May 2024 16:32:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714753972; 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=3q4ptSHk7SGxtCCCHo0fnaU/VwYwBHNL8vR1aGkB8rY=; b=vG8YmOYMEFaCughNentv5G60yjlkc5JBPkCREiD2igF7z4Bs03rAYrKeNnnZUNO7dG0u3V 7gr33g5ZaxCRqIxetYrvhGM/7x/7vrGhYt+akWwXXzBQ60KGLxiQm4AqDjtttKyHcH8rJ3 SvzcOyHndfsuOSHU96FXK52u1qNJv6A0KSo+Pd94c8QVLO5WiPrXlD8EcUiWwg1R9QGswt b4Q00uGIMmO/An7WtSjzxD1s7jejF7NO57pVFkqvD4DzG4kPMPj2PFESHY67Tv84MvlM7R 9oqAQP+P1MvvAUv10zpG/AybeBrsLVvQtesKVNZKXz5wrC+W25xaLoAcAISzHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714753972; a=rsa-sha256; cv=none; b=gqqVK9DAulSx2LW4BjomKtiWjbhKb3+URTzlT7AZEuLsP7bu9zxcZVf/wtrQ+1bYlTSbLf tKXZheafA9LSzZEHCTSjRn5CJs0oDg/HhZMQ0e5N5pO2AGPJwywID7oAnVVSNvdm1MXiT3 DP45edSTmb+gXn6xM5JTYLjInxwmc+fLjOV9ApzjiJM4CHfBQvuNUy5CX907mfDBX/VE8K aKM2nRqjyH/7jT9NFWXYuqRHG9AQLydgOPWE/5tV55oxZvJEih/d4999QJQwYRH/VS5zN6 pAFlAUAU+Fnz8w071ievY1zs4OQbnJFdtEFdUo9rURe4Lm6vIjEFmSQrJL+oYw== 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=1714753972; 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=3q4ptSHk7SGxtCCCHo0fnaU/VwYwBHNL8vR1aGkB8rY=; b=l4wjvW3KqaXNanajWQL09WR/X/IfcKYnVtobrJxukaBPp9RzxDHtW7/LdbwASZfXyptfY4 gGN2p66c+Hr/uCBzJQWJJ+0fLSYrxPRGmkGTFA0ciLm48NLawUP7paqMJgNpPSQU3aEAmS YGvcAfPhamenKlxDbvJtmLcrSSm6SMC6m0MjLPmI3vq8y71cus/iXkzhfXTASGBjzMtlRT td6pwj3fym3YIEmzNX5CUmaPUZSQ0BhZxfhkkXh7uRgEl5Rf1U737EBbhPqQUUS5aFOQnB oAjppFFewiL4+DRcu7bEzpUIVvNgJhFvX30hMnS1/W5LWU0uiECyofVoXlmU4A== 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 4VWGYv6w8rztLx; Fri, 3 May 2024 16:32:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 443GWpx6039348; Fri, 3 May 2024 16:32:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 443GWp1O039345; Fri, 3 May 2024 16:32:51 GMT (envelope-from git) Date: Fri, 3 May 2024 16:32:51 GMT Message-Id: <202405031632.443GWp1O039345@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: b95e96028e5a - main - libdiff: More type issues. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: b95e96028e5a53116462151aee8fda7523a68d09 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=b95e96028e5a53116462151aee8fda7523a68d09 commit b95e96028e5a53116462151aee8fda7523a68d09 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-03 16:32:41 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-03 16:32:41 +0000 libdiff: More type issues. Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D45080 --- contrib/libdiff/lib/diff_output.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/contrib/libdiff/lib/diff_output.c b/contrib/libdiff/lib/diff_output.c index 78d9b8942077..3b84608882f6 100644 --- a/contrib/libdiff/lib/diff_output.c +++ b/contrib/libdiff/lib/diff_output.c @@ -75,8 +75,8 @@ diff_output_lines(struct diff_output_info *outinfo, FILE *dest, foreach_diff_atom(atom, start_atom, count) { off_t outlen = 0; int i, ch, nbuf = 0; - unsigned int len = atom->len; - unsigned char buf[DIFF_OUTPUT_BUF_SIZE + 1 /* '\n' */]; + size_t len = atom->len, wlen; + char buf[DIFF_OUTPUT_BUF_SIZE + 1 /* '\n' */]; size_t n; n = strlcpy(buf, prefix, sizeof(buf)); @@ -97,19 +97,19 @@ diff_output_lines(struct diff_output_info *outinfo, FILE *dest, if (rc) return rc; if (nbuf >= DIFF_OUTPUT_BUF_SIZE) { - rc = fwrite(buf, 1, nbuf, dest); - if (rc != nbuf) + wlen = fwrite(buf, 1, nbuf, dest); + if (wlen != nbuf) return errno; - outlen += rc; + outlen += wlen; nbuf = 0; } buf[nbuf++] = ch; } buf[nbuf++] = '\n'; - rc = fwrite(buf, 1, nbuf, dest); - if (rc != nbuf) + wlen = fwrite(buf, 1, nbuf, dest); + if (wlen != nbuf) return errno; - outlen += rc; + outlen += wlen; if (outinfo) { ARRAYLIST_ADD(offp, outinfo->line_offsets); if (offp == NULL) @@ -253,7 +253,7 @@ diff_output_trailing_newline_msg(struct diff_output_info *outinfo, FILE *dest, } static bool -is_function_prototype(unsigned char ch) +is_function_prototype(char ch) { return (isalpha((unsigned char)ch) || ch == '_' || ch == '$' || ch == '-' || ch == '+'); @@ -268,7 +268,7 @@ diff_output_match_function_prototype(char *prototype, size_t prototype_size, { struct diff_atom *start_atom, *atom; const struct diff_data *data; - unsigned char buf[DIFF_FUNCTION_CONTEXT_SIZE]; + char buf[DIFF_FUNCTION_CONTEXT_SIZE]; const char *state = NULL; int rc, i, ch; @@ -285,7 +285,7 @@ diff_output_match_function_prototype(char *prototype, size_t prototype_size, rc = get_atom_byte(&ch, atom, 0); if (rc) return rc; - buf[0] = (unsigned char)ch; + buf[0] = ch; if (!is_function_prototype(buf[0])) continue; for (i = 1; i < atom->len && i < sizeof(buf) - 1; i++) { @@ -294,7 +294,7 @@ diff_output_match_function_prototype(char *prototype, size_t prototype_size, return rc; if (ch == '\n') break; - buf[i] = (unsigned char)ch; + buf[i] = ch; } buf[i] = '\0'; if (begins_with(buf, "private:")) {