Mon Feb 23 18:24:00 2015 UTC ()
Don't hard code endian lists. Fix format strings.
(joerg)
diff -r1.8 -r1.9 pkgsrc/graphics/s10sh/distinfo
diff -r1.2 -r1.3 pkgsrc/graphics/s10sh/patches/patch-ac
diff -r0 -r1.1 pkgsrc/graphics/s10sh/patches/patch-common.c
diff -r0 -r1.1 pkgsrc/graphics/s10sh/patches/patch-main.c
--- pkgsrc/graphics/s10sh/distinfo 2005/02/24 08:45:13 1.8
+++ pkgsrc/graphics/s10sh/distinfo 2015/02/23 18:24:00 1.9
| @@ -1,10 +1,12 @@ | | | @@ -1,10 +1,12 @@ |
1 | $NetBSD: distinfo,v 1.8 2005/02/24 08:45:13 agc Exp $ | | 1 | $NetBSD: distinfo,v 1.9 2015/02/23 18:24:00 joerg Exp $ |
2 | | | 2 | |
3 | SHA1 (s10sh-0.2.0.tar.gz) = a8ada7c84ff64be98a1195612d48e2042f293eba | | 3 | SHA1 (s10sh-0.2.0.tar.gz) = a8ada7c84ff64be98a1195612d48e2042f293eba |
4 | RMD160 (s10sh-0.2.0.tar.gz) = 2b0ef13958bde03b2e9056bc023e3dd0c84747b4 | | 4 | RMD160 (s10sh-0.2.0.tar.gz) = 2b0ef13958bde03b2e9056bc023e3dd0c84747b4 |
5 | Size (s10sh-0.2.0.tar.gz) = 172203 bytes | | 5 | Size (s10sh-0.2.0.tar.gz) = 172203 bytes |
6 | SHA1 (patch-aa) = 1708337ee44567e66e227903e0ae15101670ed31 | | 6 | SHA1 (patch-aa) = 1708337ee44567e66e227903e0ae15101670ed31 |
7 | SHA1 (patch-ab) = 83e20d2bbda9de83a3db5a5990f6cc7f1fb1a18c | | 7 | SHA1 (patch-ab) = 83e20d2bbda9de83a3db5a5990f6cc7f1fb1a18c |
8 | SHA1 (patch-ac) = ad1b07a2062c53807df905edb14416f0ed701134 | | 8 | SHA1 (patch-ac) = eb83c59a8d3c80048e23cc5b631f62dd8ca482ee |
9 | SHA1 (patch-ad) = 6e4164e2040508253075d5f482a527de9ff33d61 | | 9 | SHA1 (patch-ad) = 6e4164e2040508253075d5f482a527de9ff33d61 |
10 | SHA1 (patch-ae) = f22ee8feef8a8d99c91ecbdfc5dfd7e1751788b9 | | 10 | SHA1 (patch-ae) = f22ee8feef8a8d99c91ecbdfc5dfd7e1751788b9 |
| | | 11 | SHA1 (patch-common.c) = ba22cf896aa9826c925c56829485a77d5df453c3 |
| | | 12 | SHA1 (patch-main.c) = 668f78b4528a4ad37d3c9780709f97c4688480d0 |
--- pkgsrc/graphics/s10sh/patches/patch-ac 2004/02/25 20:29:50 1.2
+++ pkgsrc/graphics/s10sh/patches/patch-ac 2015/02/23 18:24:00 1.3
| @@ -1,21 +1,29 @@ | | | @@ -1,21 +1,29 @@ |
1 | $NetBSD: patch-ac,v 1.2 2004/02/25 20:29:50 drochner Exp $ | | 1 | $NetBSD: patch-ac,v 1.3 2015/02/23 18:24:00 joerg Exp $ |
2 | | | 2 | |
3 | --- bytesex.h.orig 2001-03-13 14:46:18.000000000 +0100 | | 3 | --- bytesex.h.orig 2001-03-13 13:46:18.000000000 +0000 |
4 | +++ bytesex.h 2004-02-25 21:18:34.000000000 +0100 | | 4 | +++ bytesex.h |
5 | @@ -3,7 +3,7 @@ | | 5 | @@ -3,18 +3,15 @@ |
6 | #ifndef S10SH_BYTESEX_H | | 6 | #ifndef S10SH_BYTESEX_H |
7 | #define S10SH_BYTESEX_H | | 7 | #define S10SH_BYTESEX_H |
8 | | | 8 | |
9 | -#if defined(__i386__) \ | | 9 | -#if defined(__i386__) \ |
10 | +#if defined(__i386__) || defined(__amd64__) \ | | 10 | - || defined(__alpha__) \ |
11 | || defined(__alpha__) \ | | 11 | - || (defined(__mips__) && (defined(MIPSEL) || defined (__MIPSEL__))) |
12 | || (defined(__mips__) && (defined(MIPSEL) || defined (__MIPSEL__))) | | 12 | +#include <sys/endian.h> |
| | | 13 | + |
| | | 14 | +#if defined(_BYTE_ORDER) && defined(_LITTLE_ENDIAN) && (_BYTE_ORDER == _LITTLE_ENDIAN) |
13 | #define BYTE_ORDER_LITTLE_ENDIAN | | 15 | #define BYTE_ORDER_LITTLE_ENDIAN |
14 | @@ -11,6 +11,7 @@ | | 16 | -#elif defined(__mc68000__) \ |
15 | || defined (__sparc__) \ | | 17 | - || defined (__sparc__) \ |
16 | || defined (__sparc) \ | | 18 | - || defined (__sparc) \ |
17 | || defined (__PPC__) \ | | 19 | - || defined (__PPC__) \ |
18 | + || defined (__powerpc__) \ | | 20 | - || (defined(__mips__) && (defined(MIPSEB) || defined (__MIPSEB__))) |
19 | || (defined(__mips__) && (defined(MIPSEB) || defined (__MIPSEB__))) | | 21 | +#elif defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && (__BYTE_ORDER == _LITTLE_ENDIAN) |
| | | 22 | +#elif defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && (__BYTE_ORDER == _BIG_ENDIAN) |
20 | #define BYTE_ORDER_BIG_ENDIAN | | 23 | #define BYTE_ORDER_BIG_ENDIAN |
21 | #else | | 24 | #else |
| | | 25 | -# error can not find the byte order for this architecture, fix bytesex.h |
| | | 26 | +#error can not find the byte order for this architecture, fix bytesex.h |
| | | 27 | #endif |
| | | 28 | |
| | | 29 | #endif /* S10SH_BYTESEX_H */ |
$NetBSD: patch-common.c,v 1.1 2015/02/23 18:24:00 joerg Exp $
--- common.c.orig 2015-02-23 13:32:08.000000000 +0000
+++ common.c
@@ -57,7 +57,7 @@ void dump_hex(const char *msg, const uns
fprintf(stderr,"%s: (%d bytes)\n", msg, len);
while (len > 0)
{
- sprintf(line, "%08x: ", buf - start);
+ sprintf(line, "%08zx: ", (size_t)(buf - start));
out = line + 10;
for (i = 0, pc = buf, nlocal = len; i < 16; i++, pc++)
@@ -423,8 +423,8 @@ int camera_get_image(char *pathname, cha
timestamp = time(NULL) - timestamp;
if (!timestamp)
timestamp = 1;
- printf("\nDownloaded in %ld seconds, %ld bytes/s\n",
- timestamp, len/timestamp);
+ printf("\nDownloaded in %lld seconds, %lld bytes/s\n",
+ (long long)timestamp, (long long)(len/timestamp));
imagedate = get_date_for_image (orig_pathname);
@@ -530,9 +530,9 @@ int camera_get_thumb(char *pathname, cha
timestamp = time(NULL) - timestamp;
if (!timestamp)
timestamp = 1;
- printf("Downloaded in %ld seconds,"
- " %ld bytes/s\n",
- timestamp, len/timestamp);
+ printf("Downloaded in %lld seconds,"
+ " %lld bytes/s\n",
+ (long long)timestamp, (long long)(len/timestamp));
free(image);
}
return 0;
$NetBSD: patch-main.c,v 1.1 2015/02/23 18:24:00 joerg Exp $
--- main.c.orig 2015-02-23 13:30:37.000000000 +0000
+++ main.c
@@ -150,7 +150,7 @@ int main(int argc, char **argv)
strncpy(command, p, 1024);
free(p);
#else
- printf(prompt);
+ printf("%s", prompt);
if (fgets(command, 1024, stdin) == NULL)
continue;
command[1023] = '\0';