Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Sep 2020 15:37:20 +0000 (UTC)
From:      Alex Richardson <arichardson@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r365582 - head/usr.bin/sort
Message-ID:  <202009101537.08AFbKrN055897@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009101537.08AFbKrN055897>