pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/icoutils graphics/icoutils: fix 'subscript ha...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1db02abcaab2
branches:  trunk
changeset: 414086:1db02abcaab2
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Tue Mar 24 06:29:40 2020 +0000

description:
graphics/icoutils: fix 'subscript has type char'

diffstat:

 graphics/icoutils/Makefile                            |   4 +-
 graphics/icoutils/distinfo                            |   4 +-
 graphics/icoutils/patches/patch-common_hmap.c         |  17 ++++
 graphics/icoutils/patches/patch-common_string-utils.c |  75 +++++++++++++++++++
 4 files changed, 97 insertions(+), 3 deletions(-)

diffs (126 lines):

diff -r 5cba6afa6ae1 -r 1db02abcaab2 graphics/icoutils/Makefile
--- a/graphics/icoutils/Makefile        Tue Mar 24 05:58:48 2020 +0000
+++ b/graphics/icoutils/Makefile        Tue Mar 24 06:29:40 2020 +0000
@@ -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 -r 5cba6afa6ae1 -r 1db02abcaab2 graphics/icoutils/distinfo
--- a/graphics/icoutils/distinfo        Tue Mar 24 05:58:48 2020 +0000
+++ b/graphics/icoutils/distinfo        Tue Mar 24 06:29:40 2020 +0000
@@ -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 -r 5cba6afa6ae1 -r 1db02abcaab2 graphics/icoutils/patches/patch-common_hmap.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/icoutils/patches/patch-common_hmap.c     Tue Mar 24 06:29:40 2020 +0000
@@ -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 -r 5cba6afa6ae1 -r 1db02abcaab2 graphics/icoutils/patches/patch-common_string-utils.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/icoutils/patches/patch-common_string-utils.c     Tue Mar 24 06:29:40 2020 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index