aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid du Colombier <0intro@gmail.com>2013-10-23 22:10:31 +0200
committerDavid du Colombier <0intro@gmail.com>2013-10-23 22:10:31 +0200
commitb29ebaab99090fa06e27377fe9e1f356ac533604 (patch)
tree19bc881e1691fa82c07170fca346b664b26d26ae
parent5a69e405fcae96b476cdd7a0767e87b94c0b7266 (diff)
downloadplan9port-b29ebaab99090fa06e27377fe9e1f356ac533604.tar.gz
plan9port-b29ebaab99090fa06e27377fe9e1f356ac533604.tar.bz2
plan9port-b29ebaab99090fa06e27377fe9e1f356ac533604.zip
fossil: fix remaining warnings
R=rsc https://codereview.appspot.com/15100044
-rw-r--r--src/cmd/fossil/cache.c6
-rw-r--r--src/cmd/fossil/check.c6
-rw-r--r--src/cmd/fossil/flfmt9660.c4
-rw-r--r--src/cmd/fossil/pack.c2
-rw-r--r--src/cmd/fossil/vac.c8
5 files changed, 13 insertions, 13 deletions
diff --git a/src/cmd/fossil/cache.c b/src/cmd/fossil/cache.c
index f37a7101..23f89461 100644
--- a/src/cmd/fossil/cache.c
+++ b/src/cmd/fossil/cache.c
@@ -1900,11 +1900,11 @@ unlinkThread(void *a)
}
static int
-baddrCmp(void *a0, void *a1)
+baddrCmp(const void *a0, const void *a1)
{
BAddr *b0, *b1;
- b0 = a0;
- b1 = a1;
+ b0 = (BAddr*)a0;
+ b1 = (BAddr*)a1;
if(b0->part < b1->part)
return -1;
diff --git a/src/cmd/fossil/check.c b/src/cmd/fossil/check.c
index 53a1bf20..6aa90fc7 100644
--- a/src/cmd/fossil/check.c
+++ b/src/cmd/fossil/check.c
@@ -446,12 +446,12 @@ struct MetaChunk {
};
static int
-offsetCmp(void *s0, void *s1)
+offsetCmp(const void *s0, const void *s1)
{
MetaChunk *mc0, *mc1;
- mc0 = s0;
- mc1 = s1;
+ mc0 = (MetaChunk*)s0;
+ mc1 = (MetaChunk*)s1;
if(mc0->offset < mc1->offset)
return -1;
if(mc0->offset > mc1->offset)
diff --git a/src/cmd/fossil/flfmt9660.c b/src/cmd/fossil/flfmt9660.c
index f68bfb56..ac466bdd 100644
--- a/src/cmd/fossil/flfmt9660.c
+++ b/src/cmd/fossil/flfmt9660.c
@@ -234,7 +234,7 @@ iso9660init(int xfd, Header *xh, char *xfile9660, int xoff9660)
ascii();
v = (Voldesc*)root;
- if(memcmp(v->magic, "\x01CD001\x01\x00", 8) != 0)
+ if(memcmp(v->magic, "\001CD001\001\000", 8) != 0)
sysfatal("%s not a cd image", file9660);
startoff = iso9660start((Cdir*)v->rootdir)*Blocksize;
@@ -256,7 +256,7 @@ fprint(2, "look for %lud at %lud\n", startoff, startoff-off9660);
if(readn(fd, sect2, Blocksize) != Blocksize)
sysfatal("cannot read first data sector on cd via fossil");
if(memcmp(sect, sect2, Blocksize) != 0)
- sysfatal("iso9660 offset is a lie %08lux %08lux", *(long*)sect, *(long*)sect2);
+ sysfatal("iso9660 offset is a lie");
}
void
diff --git a/src/cmd/fossil/pack.c b/src/cmd/fossil/pack.c
index 1dc33470..b27f90b8 100644
--- a/src/cmd/fossil/pack.c
+++ b/src/cmd/fossil/pack.c
@@ -14,7 +14,7 @@
#define U8PUT(p,v) (p)[0]=(v)
#define U16PUT(p,v) (p)[0]=(v)>>8;(p)[1]=(v)
-#define U32PUT(p,v) (p)[0]=(v)>>24;(p)[1]=(v)>>16;(p)[2]=(v)>>8;(p)[3]=(v)
+#define U32PUT(p,v) (p)[0]=((v)>>24)&0xFF;(p)[1]=((v)>>16)&0xFF;(p)[2]=((v)>>8)&0xFF;(p)[3]=(v)&0xFF
#define U48PUT(p,v,t32) t32=(v)>>32;U16PUT(p,t32);t32=(v);U32PUT((p)+2,t32)
#define U64PUT(p,v,t32) t32=(v)>>32;U32PUT(p,t32);t32=(v);U32PUT((p)+4,t32)
diff --git a/src/cmd/fossil/vac.c b/src/cmd/fossil/vac.c
index 85f0c7f2..92c685ab 100644
--- a/src/cmd/fossil/vac.c
+++ b/src/cmd/fossil/vac.c
@@ -28,7 +28,7 @@ static char ENoFile[] = "file does not exist";
#define U8PUT(p,v) (p)[0]=(v)
#define U16PUT(p,v) (p)[0]=(v)>>8;(p)[1]=(v)
-#define U32PUT(p,v) (p)[0]=(v)>>24;(p)[1]=(v)>>16;(p)[2]=(v)>>8;(p)[3]=(v)
+#define U32PUT(p,v) (p)[0]=((v)>>24)&0xFF;(p)[1]=((v)>>16)&0xFF;(p)[2]=((v)>>8)&0xFF;(p)[3]=(v)&0xFF
#define U48PUT(p,v,t32) t32=(v)>>32;U16PUT(p,t32);t32=(v);U32PUT((p)+2,t32)
#define U64PUT(p,v,t32) t32=(v)>>32;U32PUT(p,t32);t32=(v);U32PUT((p)+4,t32)
@@ -355,12 +355,12 @@ meCmpOld(MetaEntry *me, char *s)
}
static int
-offsetCmp(void *s0, void *s1)
+offsetCmp(const void *s0, const void *s1)
{
MetaChunk *mc0, *mc1;
- mc0 = s0;
- mc1 = s1;
+ mc0 = (MetaChunk*)s0;
+ mc1 = (MetaChunk*)s1;
if(mc0->offset < mc1->offset)
return -1;
if(mc0->offset > mc1->offset)