ref: 9da8db3ce185f63fb633ede319e46c98cbba34a2
parent: cdb90cea2951465357801e1fca4500aea1680ea4
author: bentley <[email protected]>
date: Wed Jan 13 02:31:34 EST 2010
fix cast warnings
--- a/src/fix/main.c
+++ b/src/fix/main.c
@@ -285,7 +285,7 @@
if (ulOptions & OPTF_PAD) {
int size, padto;
- int calcromsize, cartromsize;
+ unsigned int calcromsize, cartromsize;
int bytesadded = 0;
size = FileSize(f);
@@ -334,9 +334,9 @@
if (!(ulOptions & OPTF_QUIET)) {
printf("\tChanged ROM size byte from %#02x (%dKiB) to %#02x (%dKiB)\n",
cartromsize,
- (0x8000L << cartromsize) / 1024,
+ (0x8000 << cartromsize) / 1024,
calcromsize,
- (0x8000L << calcromsize) / 1024);
+ (0x8000 << calcromsize) / 1024);
}
} else if (!(ulOptions & OPTF_QUIET)) {
printf("\tROM size byte is OK\n");
@@ -343,7 +343,7 @@
}
if (calcromsize > 8)
- warnx("ROM is %dKiB, max valid size is 8192KiB", (0x8000L << calcromsize) / 1024);
+ warnx("ROM is %dKiB, max valid size is 8192KiB", (0x8000 << calcromsize) / 1024);
}
/*
* -t (Set carttitle) option code
@@ -492,7 +492,7 @@
if (ulOptions & OPTF_VALIDATE) {
long i, byteschanged = 0;
- long cartromsize, calcromsize = 0, filesize;
+ unsigned int cartromsize, calcromsize = 0, filesize;
unsigned short cartchecksum = 0, calcchecksum = 0;
unsigned char cartcompchecksum = 0, calccompchecksum =
0;
@@ -553,11 +553,11 @@
fflush(f);
}
if (!(ulOptions & OPTF_QUIET)) {
- printf("\tChanged ROM size byte from %#02x (%ldKiB) to %#02x (%ldKiB)\n",
+ printf("\tChanged ROM size byte from %#02x (%dKiB) to %#02x (%dKiB)\n",
cartromsize,
- (0x8000L << cartromsize) / 1024,
+ (0x8000 << cartromsize) / 1024,
calcromsize,
- (0x8000L << calcromsize) / 1024);
+ (0x8000 << calcromsize) / 1024);
}
} else if (!(ulOptions & OPTF_QUIET)) {
printf("\tROM size byte is OK\n");