summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorjoerg <joerg>2012-06-15 18:51:32 +0000
committerjoerg <joerg>2012-06-15 18:51:32 +0000
commit1e24e6bc9f28dbf2dd1e915bc70827aef17f66af (patch)
tree883413134c934be5c260873058914cf630e9f00d /games
parent1d22ade6fe7edefd226ad73bf8cb092c27a55b2a (diff)
downloadpkgsrc-1e24e6bc9f28dbf2dd1e915bc70827aef17f66af.tar.gz
Fix use of nested functions. Bump revision. Fix C99 inline usage.
Diffstat (limited to 'games')
-rw-r--r--games/zoom/Makefile4
-rw-r--r--games/zoom/distinfo4
-rw-r--r--games/zoom/patches/patch-src_state.c75
-rw-r--r--games/zoom/patches/patch-src_tokenise.c17
4 files changed, 97 insertions, 3 deletions
diff --git a/games/zoom/Makefile b/games/zoom/Makefile
index 44392d9ba46..f2bcd5d6994 100644
--- a/games/zoom/Makefile
+++ b/games/zoom/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.24 2011/11/01 06:01:23 sbd Exp $
+# $NetBSD: Makefile,v 1.25 2012/06/15 18:51:32 joerg Exp $
DISTNAME= zoom-1.0.3
-PKGREVISION= 7
+PKGREVISION= 8
CATEGORIES= games
MASTER_SITES= http://www.logicalshift.co.uk/unix/zoom/
diff --git a/games/zoom/distinfo b/games/zoom/distinfo
index f050c569d37..ece05b271ea 100644
--- a/games/zoom/distinfo
+++ b/games/zoom/distinfo
@@ -1,7 +1,9 @@
-$NetBSD: distinfo,v 1.5 2010/05/31 23:53:36 dholland Exp $
+$NetBSD: distinfo,v 1.6 2012/06/15 18:51:32 joerg Exp $
SHA1 (zoom-1.0.3.tar.gz) = 1a171aaae1f9eaffb4a6c9aee2c32e26c4c3a081
RMD160 (zoom-1.0.3.tar.gz) = e40b7c7848299ae7e5005c138ea329e523f7cade
Size (zoom-1.0.3.tar.gz) = 1186847 bytes
SHA1 (patch-aa) = 3e38ab601ff5f0ec423991c91d5107b4775644b7
SHA1 (patch-ab) = c0953b6dcbbb41f7941b06ac86b22b62e225b90e
+SHA1 (patch-src_state.c) = 4cb81640e6c56f089ae7e6c67e1dc92c09319439
+SHA1 (patch-src_tokenise.c) = 9242b110b5344c5804d7d7f71409c804a6e509e8
diff --git a/games/zoom/patches/patch-src_state.c b/games/zoom/patches/patch-src_state.c
new file mode 100644
index 00000000000..d06f6f8b4ea
--- /dev/null
+++ b/games/zoom/patches/patch-src_state.c
@@ -0,0 +1,75 @@
+$NetBSD: patch-src_state.c,v 1.1 2012/06/15 18:51:32 joerg Exp $
+
+Avoid nested functions.
+
+--- src/state.c.orig 2012-06-15 14:14:35.000000000 +0000
++++ src/state.c
+@@ -181,37 +181,37 @@ ZByte* state_compile(ZStack* stack, ZDWo
+ time_t now;
+ ZByte version;
+
+- inline void wblock(ZByte* x, int len)
+- {
+- flen += len;
+- data = realloc(data, flen+16);
+- memcpy(data + flen - len, x, len);
+- }
+-
+- inline void wdword(ZDWord w)
+- {
+- flen +=4;
+- data = realloc(data, flen+16);
+- data[flen-4] = w>>24;
+- data[flen-3] = w>>16;
+- data[flen-2] = w>>8;
+- data[flen-1] = w;
+- }
+-
+- inline void wword(ZUWord w)
+- {
+- flen += 2;
+- data = realloc(data, flen+16);
+- data[flen-2] = w>>8;
+- data[flen-1] = w;
+- }
+-
+- inline void wbyte(ZUWord w)
+- {
+- flen += 1;
+- data = realloc(data, flen+16);
+- data[flen-1] = w;
+- }
++#define wblock(x,len) do { \
++ size_t wblock_len = (len); \
++ flen += wblock_len; \
++ data = realloc(data, flen+16); \
++ memcpy(data + flen - wblock_len, (x), wblock_len); \
++} while (0)
++
++#define wdword(w) do { \
++ ZDWord wdword_w = (w); \
++ flen +=4; \
++ data = realloc(data, flen+16); \
++ data[flen-4] = wdword_w>>24; \
++ data[flen-3] = wdword_w>>16; \
++ data[flen-2] = wdword_w>>8; \
++ data[flen-1] = wdword_w; \
++} while (0)
++
++#define wword(w) do { \
++ ZUWord wword_w = (w); \
++ flen += 2; \
++ data = realloc(data, flen+16); \
++ data[flen-2] = wword_w>>8; \
++ data[flen-1] = wword_w; \
++} while (0)
++
++#define wbyte(w) do { \
++ ZUWord wbyte_w = (w); \
++ flen += 1; \
++ data = realloc(data, flen+16); \
++ data[flen-1] = w; \
++} while (0)
+
+ *len = -1;
+ version = ReadByte(0);
diff --git a/games/zoom/patches/patch-src_tokenise.c b/games/zoom/patches/patch-src_tokenise.c
new file mode 100644
index 00000000000..c17c5cb43e4
--- /dev/null
+++ b/games/zoom/patches/patch-src_tokenise.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-src_tokenise.c,v 1.1 2012/06/15 18:51:32 joerg Exp $
+
+--- src/tokenise.c.orig 2012-06-15 14:24:46.000000000 +0000
++++ src/tokenise.c
+@@ -154,9 +154,9 @@ ZDictionary* dictionary_cache(const ZUWo
+
+ int cache = 1;
+
+-inline ZUWord lookup_word(unsigned int* word,
+- int wordlen,
+- ZUWord dct)
++ZUWord lookup_word(unsigned int* word,
++ int wordlen,
++ ZUWord dct)
+ {
+ ZByte packed[12];
+ int zscii_len;