summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2012-06-23 17:39:33 +0200
committerPali Rohár <pali.rohar@gmail.com>2012-06-23 17:39:33 +0200
commit027a6d9a18b8767969127ffc1c4a734fec4b840b (patch)
treeea5d137bb5e15e3d818032cb4ed7798de7c33026
parent58c0dbe2753753e2eff5e27f98453aa8a020235f (diff)
download0xFFFF-027a6d9a18b8767969127ffc1c4a734fec4b840b.tar.bz2
Fix compilation warnings
-rw-r--r--logotool/uncompress.c4
-rw-r--r--src/Makefile2
-rw-r--r--src/dump.c4
-rw-r--r--src/fiasco.c4
-rw-r--r--src/main.c8
-rw-r--r--src/squeue/squeue.c2
6 files changed, 15 insertions, 9 deletions
diff --git a/logotool/uncompress.c b/logotool/uncompress.c
index 4d0599f..7fb8b10 100644
--- a/logotool/uncompress.c
+++ b/logotool/uncompress.c
@@ -71,7 +71,7 @@ int uncompress_image(char *srcf, char *dstf)
src = malloc ( fsize );
dst = malloc ( width*height*2 );
deof = dst+width*height*2;
- if ((int)src == -1 || (int)dst == -1 ) {
+ if (src == (void *)-1 || dst == (void *)-1 ) {
printf("Cannot malloc\n");
return 1;
}
@@ -105,7 +105,7 @@ int uncompress_image(char *srcf, char *dstf)
}
}
}
- fprintf(stderr, "Output Size: %d\n",dst2-dst);
+ fprintf(stderr, "Output Size: %lld\n",(long long int)(dst2-dst));
if ((dst2-dst)!=(width*height*2))
fprintf(stderr, "failed?\n");
diff --git a/src/Makefile b/src/Makefile
index a2231cb..a04638f 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -6,7 +6,7 @@ BIN=0xFFFF
#LIBS=`${HAVE_USB} && echo -- '-lusb'`
LIBS=`if [ "${HAVE_USB}" = 1 ]; then echo '-lusb'; fi`
CFLAGS+=-DVERSION=\"${VERSION}\" -Wall -I .
-CFLAGS+=-pedantic -std=c99 -DHAVE_USB=${HAVE_USB}
+CFLAGS+=-pedantic -std=c99 -DHAVE_USB=${HAVE_USB} -Wno-unused-result
USBOBJ=../libusb/error.o ../libusb/usb.o ../libusb/descriptors.o
USBOBJ+=../libusb/linux.o ## XXX not portable
diff --git a/src/dump.c b/src/dump.c
index 8957173..02900a3 100644
--- a/src/dump.c
+++ b/src/dump.c
@@ -37,7 +37,7 @@ int rf_extract(char *dev, off_t from, off_t to, char *file)
FILE *fd = fopen(file, "wb+");
if (from>to) {
- printf("Bad range %lld - %lld for %s\n", from, to, file);
+ printf("Bad range %lld - %lld for %s\n", (long long int)from, (long long int)to, file);
goto __rf_extract_exit;
}
if (fs == NULL) { perror(dev); goto __rf_extract_exit; }
@@ -56,7 +56,7 @@ int rf_extract(char *dev, off_t from, off_t to, char *file)
}
printf("\r%s: %lld bytes dumped from %s\n",
- file, to-from, dev);
+ file, (long long int)(to-from), dev);
__rf_extract_exit:
if (fs) fclose(fs);
diff --git a/src/fiasco.c b/src/fiasco.c
index c767407..3446364 100644
--- a/src/fiasco.c
+++ b/src/fiasco.c
@@ -28,6 +28,8 @@
#include "main.h"
#include "hash.h"
+char *strdup(const char *s);
+
int (*fiasco_callback)(struct header_t *header) = NULL;
int openfiasco(const char *name, const char *piece_grep, int v)
@@ -306,7 +308,7 @@ int fiasco_new(const char *filename, const char *swver)
{
int fd;
unsigned int len;
- uint8_t len8;
+ unsigned char len8;
const char *str = "OSSO UART+USB";
if (swver && strlen(swver)+1 > UINT8_MAX) {
diff --git a/src/main.c b/src/main.c
index b2196a6..67f78a7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -517,8 +517,12 @@ int main(int argc, char **argv)
}
if (unpack) {
- if (reverseto)
- chdir(reverseto);
+ if (reverseto) {
+ if (chdir(reverseto) < 0) {
+ printf("Error: Cannot change directory to %s\n", reverseto);
+ return 1;
+ }
+ }
unpack_fiasco_image(fiasco_image);
return 0;
}
diff --git a/src/squeue/squeue.c b/src/squeue/squeue.c
index 96f2b59..69bd595 100644
--- a/src/squeue/squeue.c
+++ b/src/squeue/squeue.c
@@ -89,7 +89,7 @@ _retry:
}
pool = shmat(shmid, NULL, 0);
- if (((int)pool) == -1) {
+ if (pool == (void *)-1) {
perror("shmat");
return NULL;
}