r9390 - in packages/trunk/cookietool/debian: . patches
Peter Pentchev
roam-guest at alioth.debian.org
Sat Apr 4 12:42:20 UTC 2009
Author: roam-guest
Date: 2009-04-04 12:42:19 +0000 (Sat, 04 Apr 2009)
New Revision: 9390
Modified:
packages/trunk/cookietool/debian/changelog
packages/trunk/cookietool/debian/patches/04-compiler-warnings.patch
packages/trunk/cookietool/debian/rules
Log:
Build cleanly with -Wall.
Remove the list of fixed compiler warnings from the changelog, it really
belongs in the quilt patch itself :)
Modified: packages/trunk/cookietool/debian/changelog
===================================================================
--- packages/trunk/cookietool/debian/changelog 2009-04-04 12:30:11 UTC (rev 9389)
+++ packages/trunk/cookietool/debian/changelog 2009-04-04 12:42:19 UTC (rev 9390)
@@ -21,8 +21,7 @@
- add a Homepage field pointing to cookietool.readme on the FTP site
* Remove some cruft from the rules file.
* Build with -Werror if the "werror" build option is specified.
- * Fix some compiler warnings:
- - include the proper header files for the system function prototypes
+ * Add the 04-compiler-warnings patch to fix some compiler warnings.
-- Peter Pentchev <roam at ringlet.net> Fri, 03 Apr 2009 16:18:42 +0300
Modified: packages/trunk/cookietool/debian/patches/04-compiler-warnings.patch
===================================================================
--- packages/trunk/cookietool/debian/patches/04-compiler-warnings.patch 2009-04-04 12:30:11 UTC (rev 9389)
+++ packages/trunk/cookietool/debian/patches/04-compiler-warnings.patch 2009-04-04 12:42:19 UTC (rev 9390)
@@ -1,5 +1,9 @@
Fix some compiler warnings:
- include <stdlib.h> for the exit(3) prototype
+- redefine the UBYTE type to just "char", not "unsigned char"; well, okay,
+ so it's a bit misleadingly named now, so what? :)
+- now that UBYTE is "char", cast it to unsigned when using it as an array
+ index in strstuff.c
--- a/cookio.c
+++ b/cookio.c
@@ -11,3 +15,118 @@
#include <string.h>
#include "cookio.h"
+--- a/strstuff.h
++++ b/strstuff.h
+@@ -30,7 +30,8 @@
+ #ifndef _STRSTUFF_H_
+ #define _STRSTUFF_H_
+
+-typedef unsigned char UBYTE;
++/* Argh. No, it's not unsigned. Deal with it :) -- Peter Pentchev */
++typedef char UBYTE;
+
+ /* special return values for str_cmp() and strn_cmp() */
+ #define STR_LONGER 256
+--- a/strstuff.c
++++ b/strstuff.c
+@@ -32,6 +32,9 @@
+ #include <string.h>
+ #include "strstuff.h"
+
++#define is_space(c) is_space[(unsigned char)(c)]
++#define to_upper(c) to_upper[(unsigned char)(c)]
++
+ UBYTE to_upper[ 256 ]; /* conversion table */
+ int is_space[ 256 ]; /* lookup table */
+ int bordermode, case_sense;
+@@ -107,29 +110,29 @@
+ {
+ if( bordermode < 3 )
+ { /* modes where number of 'spaces' doesn't count */
+- while( is_space[ *s ] )
++ while( is_space( *s ) )
+ s++; /* advance to first word */
+- while( is_space[ *t ] )
++ while( is_space( *t ) )
+ t++;
+- while( to_upper[ *s ] == to_upper[ *t ] )
++ while( to_upper( *s ) == to_upper( *t ) )
+ {
+ if( *s == '\0' )
+ return 0;
+ s++;
+ t++;
+- if( !bordermode || (is_space[ *s ] && is_space[ *t ]) )
++ if( !bordermode || (is_space( *s ) && is_space( *t )) )
+ {
+ /* both at the end of a word OR in sloppy bordermode */
+- while( is_space[ *s ] )
++ while( is_space( *s ) )
+ s++; /* skip the spaces */
+- while( is_space[ *t ] )
++ while( is_space( *t ) )
+ t++;
+ }
+ }
+ }
+ else
+ {
+- while( to_upper[ *s ] == to_upper[ *t ] )
++ while( to_upper( *s ) == to_upper( *t ) )
+ {
+ if( *s == '\0' )
+ return 0;
+@@ -142,7 +145,7 @@
+ else if( *t == '\0' )
+ return STR_LONGER;
+ else
+- return( to_upper[ *s ] - to_upper[ *t ] );
++ return( to_upper( *s ) - to_upper( *t ) );
+ }
+
+
+@@ -155,28 +158,28 @@
+ {
+ if( bordermode < 3 )
+ {
+- while( is_space[ *s ] )
++ while( is_space( *s ) )
+ s++;
+- while( is_space[ *t ] )
++ while( is_space( *t ) )
+ t++;
+- while( to_upper[ *s ] == to_upper[ *t ] )
++ while( to_upper( *s ) == to_upper( *t ) )
+ {
+ if( --n == 0 || *s == '\0' )
+ return 0; /* that's the difference */
+ s++;
+ t++;
+- if( !bordermode || (is_space[ *s ] && is_space[ *t ]) )
++ if( !bordermode || (is_space( *s ) && is_space( *t )) )
+ {
+- while( is_space[ *s ] )
++ while( is_space( *s ) )
+ s++;
+- while( is_space[ *t ] )
++ while( is_space( *t ) )
+ t++;
+ }
+ }
+ }
+ else
+ {
+- while( to_upper[ *s ] == to_upper[ *t ] )
++ while( to_upper( *s ) == to_upper( *t ) )
+ {
+ if( --n == 0 || *s == '\0' )
+ return 0; /* and here once more */
+@@ -189,7 +192,7 @@
+ else if( *t == '\0' )
+ return STR_LONGER;
+ else
+- return( to_upper[ *s ] - to_upper[ *t ] );
++ return( to_upper( *s ) - to_upper( *t ) );
+ }
+
+
Modified: packages/trunk/cookietool/debian/rules
===================================================================
--- packages/trunk/cookietool/debian/rules 2009-04-04 12:30:11 UTC (rev 9389)
+++ packages/trunk/cookietool/debian/rules 2009-04-04 12:42:19 UTC (rev 9390)
@@ -6,6 +6,7 @@
PACKAGE= cookietool
D= $(CURDIR)/debian/$(PACKAGE)
+CFLAGS+= -Wall
ifneq (,$(filter werror,$(DEB_BUILD_OPTIONS)))
CFLAGS+= -Werror
endif
More information about the Pkg-games-commits
mailing list