From owner-svn-src-all@freebsd.org Thu Sep 10 15:37:22 2020 Return-Path: Delivered-To: svn-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 12A293DA80C; Thu, 10 Sep 2020 15:37:22 +0000 (UTC) (envelope-from arichardson@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnNL92hwTz49dy; Thu, 10 Sep 2020 15:37:21 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F0D214ED9; Thu, 10 Sep 2020 15:37:20 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AFbK60055898; Thu, 10 Sep 2020 15:37:20 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AFbKrN055897; Thu, 10 Sep 2020 15:37:20 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202009101537.08AFbKrN055897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Thu, 10 Sep 2020 15:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365582 - head/usr.bin/sort X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/usr.bin/sort X-SVN-Commit-Revision: 365582 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 15:37:22 -0000 Author: arichardson Date: Thu Sep 10 15:37:19 2020 New Revision: 365582 URL: https://svnweb.freebsd.org/changeset/base/365582 Log: Fix -Wpointer-sign warnings in bwstring.c Modified: head/usr.bin/sort/bwstring.c Modified: head/usr.bin/sort/bwstring.c ============================================================================== --- head/usr.bin/sort/bwstring.c Thu Sep 10 15:37:15 2020 (r365581) +++ head/usr.bin/sort/bwstring.c Thu Sep 10 15:37:19 2020 (r365582) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); bool byte_sort; static wchar_t **wmonths; -static unsigned char **cmonths; +static char **cmonths; /* initialise months */ @@ -56,17 +56,17 @@ initialise_months(void) const nl_item item[12] = { ABMON_1, ABMON_2, ABMON_3, ABMON_4, ABMON_5, ABMON_6, ABMON_7, ABMON_8, ABMON_9, ABMON_10, ABMON_11, ABMON_12 }; - unsigned char *tmp; + char *tmp; size_t len; if (MB_CUR_MAX == 1) { if (cmonths == NULL) { - unsigned char *m; + char *m; - cmonths = sort_malloc(sizeof(unsigned char*) * 12); + cmonths = sort_malloc(sizeof(char*) * 12); for (int i = 0; i < 12; i++) { cmonths[i] = NULL; - tmp = (unsigned char *) nl_langinfo(item[i]); + tmp = nl_langinfo(item[i]); if (debug_sort) printf("month[%d]=%s\n", i, tmp); if (*tmp == '\0') @@ -86,14 +86,14 @@ initialise_months(void) wmonths = sort_malloc(sizeof(wchar_t *) * 12); for (int i = 0; i < 12; i++) { wmonths[i] = NULL; - tmp = (unsigned char *) nl_langinfo(item[i]); + tmp = nl_langinfo(item[i]); if (debug_sort) printf("month[%d]=%s\n", i, tmp); if (*tmp == '\0') continue; len = strlen(tmp); m = sort_malloc(SIZEOF_WCHAR_STRING(len + 1)); - if (mbstowcs(m, (char*)tmp, len) == + if (mbstowcs(m, tmp, len) == ((size_t) - 1)) { sort_free(m); continue;