[SCM] Packaging for Tile World branch, master, updated. debian/1.3.0-5-2-g7ab34ac
Peter Pentchev
roam at ringlet.net
Fri Feb 11 08:16:57 UTC 2011
The following commit has been merged in the master branch:
commit 91ee7493eaeb0434ee9f53c57046ecb77655a013
Author: Peter Pentchev <roam at ringlet.net>
Date: Fri Feb 11 10:11:59 2011 +0200
Add the 02-integer-types patch to fix the 32/64-bit problems.
Closes: #427360
Submitted by: Drake Wilson <drake at begriffli.ch>
diff --git a/debian/changelog b/debian/changelog
index edf320e..dc0cb81 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+tworld (1.3.0-6) UNRELEASED; urgency=low
+
+ * Add the 02-integer-types patch to fix the 32/64-bit problems.
+ Closes: #427360
+
+ -- Peter Pentchev <roam at ringlet.net> Thu, 10 Feb 2011 22:11:53 +0200
+
tworld (1.3.0-5) unstable; urgency=low
* Switch doc dir from tworld to symlink as dpkg isn't able to do so.
diff --git a/debian/patches/02_integer-types b/debian/patches/02_integer-types
new file mode 100644
index 0000000..9da92bb
--- /dev/null
+++ b/debian/patches/02_integer-types
@@ -0,0 +1,320 @@
+Description: Fix 32/64-bit issues.
+Forwarded: no
+Author: Drake Wilson <drake at begriffli.ch>
+Last-Update: 2011-02-10
+
+--- a/defs.h
++++ b/defs.h
+@@ -8,6 +8,7 @@
+ #define _defs_h_
+
+ #include <stdio.h>
++#include <stdint.h>
+ #include "gen.h"
+
+ /*
+@@ -34,8 +35,8 @@
+ /* Pseudorandom number generators.
+ */
+ typedef struct prng {
+- unsigned long initial; /* initial seed value */
+- unsigned long value; /* latest random value */
++ uint32_t initial; /* initial seed value */
++ uint32_t value; /* latest random value */
+ char shared; /* FALSE if independent sequence */
+ } prng;
+
+@@ -65,8 +66,8 @@
+ */
+ typedef struct solutioninfo {
+ actlist moves; /* the actual moves of the solution */
+- unsigned long rndseed; /* the PRNG's initial seed */
+- unsigned long flags; /* other flags (currently unused) */
++ uint32_t rndseed; /* the PRNG's initial seed */
++ uint32_t flags; /* other flags (currently unused) */
+ unsigned char rndslidedir; /* random slide's initial direction */
+ signed char stepping; /* the timer offset */
+ } solutioninfo;
+@@ -196,7 +197,7 @@
+ int solutionsize; /* size of the saved solution data */
+ unsigned char *leveldata; /* the data defining the level */
+ unsigned char *solutiondata; /* the player's best solution so far */
+- unsigned long levelhash; /* the level data's hash value */
++ uint32_t levelhash; /* the level data's hash value */
+ char const *unsolvable; /* why level is unsolvable, or NULL */
+ char name[256]; /* name of the level */
+ char passwd[256]; /* the level's password */
+--- a/fileio.c
++++ b/fileio.c
+@@ -242,7 +242,7 @@
+
+ /* Read one byte as an unsigned integer value.
+ */
+-int filereadint8(fileinfo *file, unsigned char *val8, char const *msg)
++int filereadint8(fileinfo *file, uint8_t *val8, char const *msg)
+ {
+ int byte;
+
+@@ -255,7 +255,7 @@
+
+ /* Write one byte as an unsigned integer value.
+ */
+-int filewriteint8(fileinfo *file, unsigned char val8, char const *msg)
++int filewriteint8(fileinfo *file, uint8_t val8, char const *msg)
+ {
+ errno = 0;
+ if (fputc(val8, file->fp) != EOF)
+@@ -265,7 +265,7 @@
+
+ /* Read two bytes as an unsigned integer value stored in little-endian.
+ */
+-int filereadint16(fileinfo *file, unsigned short *val16, char const *msg)
++int filereadint16(fileinfo *file, uint16_t *val16, char const *msg)
+ {
+ int byte;
+
+@@ -282,7 +282,7 @@
+
+ /* Write two bytes as an unsigned integer value in little-endian.
+ */
+-int filewriteint16(fileinfo *file, unsigned short val16, char const *msg)
++int filewriteint16(fileinfo *file, uint16_t val16, char const *msg)
+ {
+ errno = 0;
+ if (fputc(val16 & 0xFF, file->fp) != EOF
+@@ -293,7 +293,7 @@
+
+ /* Read four bytes as an unsigned integer value stored in little-endian.
+ */
+-int filereadint32(fileinfo *file, unsigned long *val32, char const *msg)
++int filereadint32(fileinfo *file, uint32_t *val32, char const *msg)
+ {
+ int byte;
+
+@@ -316,7 +316,7 @@
+
+ /* Write four bytes as an unsigned integer value in little-endian.
+ */
+-int filewriteint32(fileinfo *file, unsigned long val32, char const *msg)
++int filewriteint32(fileinfo *file, uint32_t val32, char const *msg)
+ {
+ errno = 0;
+ if (fputc(val32 & 0xFF, file->fp) != EOF
+--- a/fileio.h
++++ b/fileio.h
+@@ -8,6 +8,7 @@
+ #define _fileio_h_
+
+ #include "defs.h"
++#include <stdint.h>
+
+ /* Reset a fileinfo structure to indicate no file.
+ */
+@@ -49,17 +50,17 @@
+ * from the current position in the given file. For the multi-byte
+ * values, the value is assumed to be stored in little-endian.
+ */
+-extern int filereadint8(fileinfo *file, unsigned char *val8,
++extern int filereadint8(fileinfo *file, uint8_t *val8,
+ char const *msg);
+-extern int filewriteint8(fileinfo *file, unsigned char val8,
++extern int filewriteint8(fileinfo *file, uint8_t val8,
+ char const *msg);
+-extern int filereadint16(fileinfo *file, unsigned short *val16,
++extern int filereadint16(fileinfo *file, uint16_t *val16,
+ char const *msg);
+-extern int filewriteint16(fileinfo *file, unsigned short val16,
++extern int filewriteint16(fileinfo *file, uint16_t val16,
+ char const *msg);
+-extern int filereadint32(fileinfo *file, unsigned long *val32,
++extern int filereadint32(fileinfo *file, uint32_t *val32,
+ char const *msg);
+-extern int filewriteint32(fileinfo *file, unsigned long val32,
++extern int filewriteint32(fileinfo *file, uint32_t val32,
+ char const *msg);
+
+ /* Read size bytes from the given file and return the bytes in a
+--- a/oshw.h
++++ b/oshw.h
+@@ -131,7 +131,7 @@
+
+ /* The font provides special monospaced digit characters at 144-153.
+ */
+-enum { CHAR_MZERO = 144 };
++#define CHAR_MZERO ((char)144)
+
+ /*
+ * Video output functions.
+--- a/random.c
++++ b/random.c
+@@ -24,12 +24,12 @@
+ /* The most recently generated random number is stashed here, so that
+ * it can provide the initial seed of the next PRNG.
+ */
+-static unsigned long lastvalue = 0x80000000UL;
++static uint32_t lastvalue = 0x80000000UL;
+
+ /* The standard linear congruential random-number generator needs no
+ * introduction.
+ */
+-static unsigned long nextvalue(unsigned long value)
++static uint32_t nextvalue(uint32_t value)
+ {
+ return ((value * 1103515245UL) + 12345UL) & 0x7FFFFFFFUL;
+ }
+@@ -67,7 +67,7 @@
+
+ /* Reset a PRNG to an independent sequence.
+ */
+-void restartprng(prng *gen, unsigned long seed)
++void restartprng(prng *gen, uint32_t seed)
+ {
+ gen->value = gen->initial = seed & 0x7FFFFFFFUL;
+ gen->shared = FALSE;
+--- a/random.h
++++ b/random.h
+@@ -19,7 +19,7 @@
+
+ /* Restart an existing PRNG upon a predetermined sequence.
+ */
+-extern void restartprng(prng *gen, unsigned long initial);
++extern void restartprng(prng *gen, uint32_t initial);
+
+ /* Retrieve the original seed value of the current sequence.
+ */
+--- a/series.c
++++ b/series.c
+@@ -46,9 +46,9 @@
+
+ /* Calculate a hash value for the given block of data.
+ */
+-static unsigned long hashvalue(unsigned char const *data, unsigned int size)
++static uint32_t hashvalue(unsigned char const *data, unsigned int size)
+ {
+- static unsigned long remainders[256] = {
++ static uint32_t remainders[256] = {
+ 0x00000000, 0x04C11DB7, 0x09823B6E, 0x0D4326D9, 0x130476DC, 0x17C56B6B,
+ 0x1A864DB2, 0x1E475005, 0x2608EDB8, 0x22C9F00F, 0x2F8AD6D6, 0x2B4BCB61,
+ 0x350C9B64, 0x31CD86D3, 0x3C8EA00A, 0x384FBDBD, 0x4C11DB70, 0x48D0C6C7,
+@@ -94,7 +94,7 @@
+ 0xBCB4666D, 0xB8757BDA, 0xB5365D03, 0xB1F740B4
+ };
+
+- unsigned long accum;
++ uint32_t accum;
+ unsigned int i, j;
+
+ for (j = 0, accum = 0xFFFFFFFFUL ; j < size ; ++j) {
+@@ -113,7 +113,7 @@
+ */
+ static int readseriesheader(gameseries *series)
+ {
+- unsigned short val16;
++ uint16_t val16;
+ int ruleset;
+
+ if (!filereadint16(&series->mapfile, &val16, "not a valid data file"))
+@@ -149,7 +149,7 @@
+ {
+ unsigned char *data;
+ unsigned char const *dataend;
+- unsigned short size;
++ uint16_t size;
+ int n;
+
+ if (!filereadint16(file, &size, NULL))
+@@ -450,7 +450,7 @@
+ fileinfo file;
+ seriesdata *sdata = (seriesdata*)data;
+ gameseries *series;
+- unsigned long magic;
++ uint32_t magic;
+ char *datfilename;
+ int config, f;
+
+--- a/solution.c
++++ b/solution.c
+@@ -8,6 +8,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <ctype.h>
++#include <stdint.h>
+ #include "defs.h"
+ #include "err.h"
+ #include "fileio.h"
+@@ -215,9 +216,9 @@
+ static int readsolutionheader(fileinfo *file, int ruleset, int *flags,
+ int *extrasize, unsigned char *extra)
+ {
+- unsigned long sig;
+- unsigned short f;
+- unsigned char n;
++ uint32_t sig;
++ uint16_t f;
++ uint8_t n;
+
+ if (!filereadint32(file, &sig, "not a valid solution file"))
+ return FALSE;
+@@ -475,7 +476,7 @@
+ */
+ static int readsolution(fileinfo *file, gamesetup *game)
+ {
+- unsigned long size;
++ uint32_t size;
+
+ game->number = 0;
+ game->sgflags = 0;
+@@ -706,8 +707,8 @@
+ int loadsolutionsetname(char const *filename, char *buffer)
+ {
+ fileinfo file;
+- unsigned long dwrd;
+- unsigned short word;
++ uint32_t dwrd;
++ uint16_t word;
+ int size;
+
+ clearfileinfo(&file);
+--- a/unslist.c
++++ b/unslist.c
+@@ -22,7 +22,7 @@
+ int setid; /* the ID of the level set's name */
+ int levelnum; /* the level's number */
+ int size; /* the levels data's compressed size */
+- unsigned long hashval; /* the levels data's hash value */
++ uint32_t hashval; /* the levels data's hash value */
+ int note; /* the entry's annotation ID, if any */
+ } unslistentry;
+
+@@ -112,7 +112,7 @@
+ /* Add a new entry with the given data to the list.
+ */
+ static int addtounslist(int setid, int levelnum,
+- int size, unsigned long hashval, int note)
++ int size, uint32_t hashval, int note)
+ {
+ if (listcount == listallocated) {
+ listallocated = listallocated ? listallocated * 2 : 16;
+@@ -152,8 +152,10 @@
+ {
+ char buf[256], token[256];
+ char const *p;
+- unsigned long hashval;
+- int setid, size;
++ uint32_t hashval;
++ unsigned long hashval_long;
++ int setid;
++ unsigned int size;
+ int lineno, levelnum, n;
+
+ setid = 0;
+@@ -169,7 +171,8 @@
+ continue;
+ }
+ n = sscanf(p, "%d: %04X%08lX: %[^\n\r]",
+- &levelnum, &size, &hashval, token);
++ &levelnum, &size, &hashval_long, token);
++ hashval = (uint32_t)hashval_long;
+ if (n > 0 && levelnum > 0 && levelnum < 65536 && setid) {
+ if (n == 1) {
+ n = sscanf(p, "%*d: %s", token);
diff --git a/debian/patches/series b/debian/patches/series
index 6b5e0b1..0f0c77f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
01_fix-manpage
+02_integer-types
--
Packaging for Tile World
More information about the Pkg-games-commits
mailing list