From 97a88ccb352f2dfd3e465aaa38e728502c4e7230 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 20 Mar 2008 15:23:16 +0100 Subject: [PATCH] partx: fix compiler warnings dos.c:44: warning: pointer targets in assignment differ in signedness dos.c:93: warning: pointer targets in assignment differ in signedness Signed-off-by: Karel Zak --- partx/bsd.c | 2 +- partx/partx.c | 6 +++--- partx/partx.h | 2 +- partx/solaris.c | 2 +- partx/unixware.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/partx/bsd.c b/partx/bsd.c index 531c36c2..4532c324 100644 --- a/partx/bsd.c +++ b/partx/bsd.c @@ -52,7 +52,7 @@ read_bsd_pt(int fd, struct slice all, struct slice *sp, int ns) { struct bsd_partition *p; unsigned int offset = all.start; int max_partitions; - char *bp; + unsigned char *bp; int n = 0; bp = getblock(fd, offset+1); /* 1 sector suffices */ diff --git a/partx/partx.c b/partx/partx.c index ab10dc87..f911c57a 100644 --- a/partx/partx.c +++ b/partx/partx.c @@ -350,11 +350,11 @@ sseek(int fd, unsigned int secnr) { static struct block { unsigned int secnr; - char *block; + unsigned char *block; struct block *next; } *blockhead; -char * +unsigned char * getblock(int fd, unsigned int secnr) { struct block *bp; @@ -367,7 +367,7 @@ getblock(int fd, unsigned int secnr) { bp->secnr = secnr; bp->next = blockhead; blockhead = bp; - bp->block = (char *) xmalloc(1024); + bp->block = (unsigned char *) xmalloc(1024); if (read(fd, bp->block, 1024) != 1024) { fprintf(stderr, "read error, sector %d\n", secnr); bp->block = NULL; diff --git a/partx/partx.h b/partx/partx.h index efaa0640..d98d77a4 100644 --- a/partx/partx.h +++ b/partx/partx.h @@ -21,7 +21,7 @@ typedef int (ptreader)(int fd, struct slice all, struct slice *sp, int ns); extern ptreader read_dos_pt, read_bsd_pt, read_solaris_pt, read_unixware_pt, read_gpt_pt; -char *getblock(int fd, unsigned int secnr); +unsigned char *getblock(int fd, unsigned int secnr); static inline int four2int(unsigned char *p) { diff --git a/partx/solaris.c b/partx/solaris.c index 64c39664..86a3e364 100644 --- a/partx/solaris.c +++ b/partx/solaris.c @@ -34,7 +34,7 @@ read_solaris_pt(int fd, struct slice all, struct slice *sp, int ns) { struct solaris_x86_slice *s; unsigned int offset = all.start; int i, n; - char *bp; + unsigned char *bp; bp = getblock(fd, offset+1); /* 1 sector suffices */ if (bp == NULL) diff --git a/partx/unixware.c b/partx/unixware.c index 34cc226a..c131475f 100644 --- a/partx/unixware.c +++ b/partx/unixware.c @@ -52,7 +52,7 @@ read_unixware_pt(int fd, struct slice all, struct slice *sp, int ns) { struct unixware_disklabel *l; struct unixware_slice *p; unsigned int offset = all.start; - char *bp; + unsigned char *bp; int n = 0; bp = getblock(fd, offset+29); /* 1 sector suffices */ -- 2.39.5