Fix compilation warnings
This commit is contained in:
1 parent
58c0dbe275
commit
027a6d9a18
6 files changed
+15
-9
No files matched your search
@@ -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");
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
+2
-2
@@ -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);
|
||||
|
||||
+3
-1
@@ -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) {
|
||||
|
||||
+6
-2
@@ -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;
|
||||
}
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ _retry:
|
||||
}
|
||||
|
||||
pool = shmat(shmid, NULL, 0);
|
||||
if (((int)pool) == -1) {
|
||||
if (pool == (void *)-1) {
|
||||
perror("shmat");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user