[xiph-commits] r17063 - trunk/ogg/src

giles at svn.xiph.org giles at svn.xiph.org
Thu Mar 25 20:38:04 PDT 2010


Author: giles
Date: 2010-03-25 20:38:04 -0700 (Thu, 25 Mar 2010)
New Revision: 17063

Modified:
   trunk/ogg/src/bitwise.c
Log:
Cast away a char pointer signedness warning.

The oggpack_* calls expect an unsigned char *, but the self-test
code for convenience uses string literals for some of the test
vectors. This generates a warning on gcc and clang, at least.

We silence the warning by casting the literals to (unsigned char *).


Modified: trunk/ogg/src/bitwise.c
===================================================================
--- trunk/ogg/src/bitwise.c	2010-03-26 03:36:24 UTC (rev 17062)
+++ trunk/ogg/src/bitwise.c	2010-03-26 03:38:04 UTC (rev 17063)
@@ -692,7 +692,7 @@
   fprintf(stderr,"ok.");
 
   fprintf(stderr,"\nTesting read past end (LSb): ");
-  oggpack_readinit(&r,"\0\0\0\0\0\0\0\0",8);
+  oggpack_readinit(&r,(unsigned char *)"\0\0\0\0\0\0\0\0",8);
   for(i=0;i<64;i++){
     if(oggpack_read(&r,1)!=0){
       fprintf(stderr,"failed; got -1 prematurely.\n");
@@ -704,7 +704,7 @@
       fprintf(stderr,"failed; read past end without -1.\n");
       exit(1);
   }
-  oggpack_readinit(&r,"\0\0\0\0\0\0\0\0",8);
+  oggpack_readinit(&r,(unsigned char *)"\0\0\0\0\0\0\0\0",8);
   if(oggpack_read(&r,30)!=0 || oggpack_read(&r,16)!=0){
       fprintf(stderr,"failed 2; got -1 prematurely.\n");
       exit(1);
@@ -778,7 +778,7 @@
   fprintf(stderr,"ok.");
 
   fprintf(stderr,"\nTesting read past end (MSb): ");
-  oggpackB_readinit(&r,"\0\0\0\0\0\0\0\0",8);
+  oggpackB_readinit(&r,(unsigned char *)"\0\0\0\0\0\0\0\0",8);
   for(i=0;i<64;i++){
     if(oggpackB_read(&r,1)!=0){
       fprintf(stderr,"failed; got -1 prematurely.\n");
@@ -790,7 +790,7 @@
       fprintf(stderr,"failed; read past end without -1.\n");
       exit(1);
   }
-  oggpackB_readinit(&r,"\0\0\0\0\0\0\0\0",8);
+  oggpackB_readinit(&r,(unsigned char *)"\0\0\0\0\0\0\0\0",8);
   if(oggpackB_read(&r,30)!=0 || oggpackB_read(&r,16)!=0){
       fprintf(stderr,"failed 2; got -1 prematurely.\n");
       exit(1);



More information about the commits mailing list