mirror of
https://github.com/jpluimers/macrompatcher.git
synced 2024-05-28 07:41:36 +00:00
Fixed type-casting and include directory path errors
This commit is contained in:
parent
2d78f78640
commit
f4ab9df764
10
cli/main.c
10
cli/main.c
|
@ -7,7 +7,7 @@
|
|||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#include "macrompatcher.h"
|
||||
#include "../lib/macrompatcher.h"
|
||||
|
||||
#define MINROMSIZE 262144 /* 256k is the smallest we know how to use */
|
||||
#define MAXROMSIZE 2097152 /* 2MB is the largest we know what to do with */
|
||||
|
@ -33,7 +33,7 @@ int main(int argc, char *argv[]) {
|
|||
char *outname = NULL;
|
||||
uint8_t *diskimage = NULL;
|
||||
uint32_t diskimagelen = 0;
|
||||
RomErr err = 0;
|
||||
RomErr err = (RomErr)0;
|
||||
struct option o[] = {
|
||||
{"checksum", 0, 0, 'c'},
|
||||
{"infile", 1, 0, 'f'},
|
||||
|
@ -70,7 +70,7 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
|
||||
diskimagelen = sb.st_size;
|
||||
diskimage = calloc(1, diskimagelen);
|
||||
diskimage = (uint8_t*)calloc(1, diskimagelen);
|
||||
if(!diskimage) {
|
||||
fprintf(stderr, "Could not allocate romdisk image memory\n");
|
||||
exit(1);
|
||||
|
@ -100,7 +100,7 @@ int main(int argc, char *argv[]) {
|
|||
exit(1);
|
||||
}
|
||||
|
||||
rom = calloc(1, sizeof(RomCtx));
|
||||
rom = (RomCtx*)calloc(1, sizeof(RomCtx));
|
||||
if(!rom) {
|
||||
fprintf(stderr, "Could not allocate memory for ROM context\n");
|
||||
exit(1);
|
||||
|
@ -121,7 +121,7 @@ int main(int argc, char *argv[]) {
|
|||
exit(1);
|
||||
}
|
||||
|
||||
rom->data = calloc(1, sb.st_size);
|
||||
rom->data = (uint8_t*)calloc(1, sb.st_size);
|
||||
if(!rom->data) {
|
||||
fprintf(stderr, "Could not allocate RAM for the ROM image\n");
|
||||
exit(1);
|
||||
|
|
|
@ -36,7 +36,7 @@ RomErr InstallRomdiskImage(RomCtx *rom, uint8_t *image, uint32_t imagesize) {
|
|||
}
|
||||
|
||||
rom->datasize = (512*1024) + imagesize;
|
||||
rom->data = realloc(rom->data, rom->datasize);
|
||||
rom->data = (uint8_t*)realloc(rom->data, rom->datasize);
|
||||
if(!rom->data) {
|
||||
rom->datasize = 0;
|
||||
return eParmErr;
|
||||
|
|
Loading…
Reference in New Issue
Block a user