summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2020-03-24 06:29:40 +0000
committerrillig <rillig@pkgsrc.org>2020-03-24 06:29:40 +0000
commit4dd4954547968881ada7e4690cbb319e4ed51977 (patch)
tree8a34df35b421befb3bc3a8179aa186b64511c366 /graphics
parent2154297d5be11a46ee5172f3cbbe14f84d3dc394 (diff)
downloadpkgsrc-4dd4954547968881ada7e4690cbb319e4ed51977.tar.gz
graphics/icoutils: fix 'subscript has type char'
Diffstat (limited to 'graphics')
-rw-r--r--graphics/icoutils/Makefile4
-rw-r--r--graphics/icoutils/distinfo4
-rw-r--r--graphics/icoutils/patches/patch-common_hmap.c17
-rw-r--r--graphics/icoutils/patches/patch-common_string-utils.c75
4 files changed, 97 insertions, 3 deletions
diff --git a/graphics/icoutils/Makefile b/graphics/icoutils/Makefile
index 17c65eb4676..73eaf042efc 100644
--- a/graphics/icoutils/Makefile
+++ b/graphics/icoutils/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.7 2019/10/24 20:43:21 nia Exp $
+# $NetBSD: Makefile,v 1.8 2020/03/24 06:29:40 rillig Exp $
DISTNAME= icoutils-0.32.3
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= graphics
MASTER_SITES= https://savannah.nongnu.org/download/icoutils/
EXTRACT_SUFX= .tar.bz2
diff --git a/graphics/icoutils/distinfo b/graphics/icoutils/distinfo
index 1471f7fddee..cd6b7ac4a0a 100644
--- a/graphics/icoutils/distinfo
+++ b/graphics/icoutils/distinfo
@@ -1,6 +1,8 @@
-$NetBSD: distinfo,v 1.2 2019/09/21 12:14:05 nia Exp $
+$NetBSD: distinfo,v 1.3 2020/03/24 06:29:40 rillig Exp $
SHA1 (icoutils-0.32.3.tar.bz2) = 6fe61b85b2a44bd1a8a7d8e03eeb0efa45f2a7fd
RMD160 (icoutils-0.32.3.tar.bz2) = 0ce5252ba66e100ac8aa1dd0850479ff41ec02a3
SHA512 (icoutils-0.32.3.tar.bz2) = 982a051a5dc4a63bb2a9f23e78e5a88e481e5c7a9c25789253e1c396e40d4c093e5a9b399966d660e4f2da21ce15d539cb9d20bfd8126b1138f148b86baa6726
Size (icoutils-0.32.3.tar.bz2) = 609286 bytes
+SHA1 (patch-common_hmap.c) = 0ee879db27f6bf632e2ce171a1fcf44194b5a6ab
+SHA1 (patch-common_string-utils.c) = 8fe8ce50925101331623e3719ffab51016146e2b
diff --git a/graphics/icoutils/patches/patch-common_hmap.c b/graphics/icoutils/patches/patch-common_hmap.c
new file mode 100644
index 00000000000..ef72e786e2f
--- /dev/null
+++ b/graphics/icoutils/patches/patch-common_hmap.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-common_hmap.c,v 1.1 2020/03/24 06:29:40 rillig Exp $
+
+hmap.c:77:30: error: array subscript has type 'char' [-Werror=char-subscripts]
+
+https://savannah.nongnu.org/bugs/index.php?58033
+
+--- common/hmap.c.orig 2012-05-03 23:14:50.000000000 +0000
++++ common/hmap.c
+@@ -74,7 +74,7 @@ strcasehash(const char *str)
+ uint32_t hash = 0;
+
+ for (; *str != '\0'; str++)
+- hash = (hash << 5) - hash + tolower(*str);
++ hash = (hash << 5) - hash + tolower((unsigned char)*str);
+
+ return hash;
+ }
diff --git a/graphics/icoutils/patches/patch-common_string-utils.c b/graphics/icoutils/patches/patch-common_string-utils.c
new file mode 100644
index 00000000000..ee73cb6894a
--- /dev/null
+++ b/graphics/icoutils/patches/patch-common_string-utils.c
@@ -0,0 +1,75 @@
+$NetBSD: patch-common_string-utils.c,v 1.1 2020/03/24 06:29:40 rillig Exp $
+
+string-utils.c:147:7: error: array subscript has type 'char' [-Werror=char-subscripts]
+(and a few others)
+
+https://savannah.nongnu.org/bugs/index.php?58033
+
+--- common/string-utils.c.orig 2012-05-03 23:14:50.000000000 +0000
++++ common/string-utils.c
+@@ -30,6 +30,10 @@
+ #include "error.h" /* common */
+ #include "string-utils.h" /* common */
+
++static int is_alnum(unsigned char ch) { return isalnum(ch); }
++static int is_space(unsigned char ch) { return isspace(ch); }
++static int to_lower(unsigned char ch) { return tolower(ch); }
++
+ /**
+ * Return a zero-based of a character in a string.
+ */
+@@ -144,7 +148,7 @@ ends_with_nocase(const char *str, const
+ return false;
+
+ for (c = 0; end[c] != '\0'; c++) {
+- if (tolower(end[c]) != tolower(str[c+diff]))
++ if (to_lower(end[c]) != to_lower(str[c+diff]))
+ return false;
+ }
+
+@@ -184,7 +188,7 @@ starts_with_nocase(const char *str, cons
+ {
+ int c;
+ for (c = 0; str[c] != '\0'; c++) {
+- if (tolower(str[c]) != tolower(start[c]))
++ if (to_lower(str[c]) != to_lower(start[c]))
+ break;
+ }
+ return (start[c] == '\0');
+@@ -230,7 +234,7 @@ str_convert(char *str, int (*convert)(in
+ int
+ iswordchar(int ch)
+ {
+- return isalnum(ch) || ch == '_';
++ return is_alnum(ch) || ch == '_';
+ }
+
+ /**
+@@ -398,10 +402,10 @@ word_get_index(const char *str, int pos)
+ int c;
+
+ for (c = 0; str[c] != '\0' && c < pos; c++) {
+- if (!in_word && !isspace(str[c])) {
++ if (!in_word && !is_space(str[c])) {
+ in_word = true;
+ }
+- if (in_word && isspace(str[c])) {
++ if (in_word && is_space(str[c])) {
+ in_word = false;
+ words++;
+ }
+@@ -419,12 +423,12 @@ word_get(const char *str, int idx)
+ int c;
+
+ for (c = 0; str[c] != '\0'; c++) {
+- if (!in_word && !isspace(str[c])) {
++ if (!in_word && !is_space(str[c])) {
+ words++;
+ start = c;
+ in_word = true;
+ }
+- if (in_word && isspace(str[c])) {
++ if (in_word && is_space(str[c])) {
+ if (words > idx)
+ return substring(str, start, c);
+ in_word = false;