[unice68] unice68.c: Fix some 64-bit compile warnings.

Ideally, we'd make it use size_t for all size parameters, but this is
old code, and doing that would require going through a lot of stuff,
so just cast it to int for now.

FIXME: unice68 is expecting fread() and fwrite() to return -1 on error,
but these functions return size_t, which is unsigned...
This commit is contained in:
David Korth 2025-04-11 18:28:19 -04:00
parent fca4e6e56d
commit 2529100c11

View File

@ -316,7 +316,8 @@ static void * myalloc(void * buf, int len, char * name)
static int myread(void * buf, int len, FILE * inp, const char * name)
{
int n = fread(buf, 1, len, inp);
// rom-properties FIXME: fread() returns size_t, so it can't possibly return a negative value.
int n = (int)fread(buf, 1, len, inp);
if (n == -1) {
syserror(name);
return -1;
@ -680,7 +681,8 @@ int UNICE68_CDECL main(int argc, char *argv[])
syserror(fout);
goto error;
}
n = fwrite(obuffer,1,olen,out);
// rom-properties FIXME: fread() returns size_t, so it can't possibly return a negative value.
n = (int)fwrite(obuffer,1,olen,out);
message(D,"Have written %d bytes to %s\n", n, fout);
if (n != olen) {
syserror(fout);