[libami] more compile warning fixes

* fix 32/64 bit int size printing stuff
* more if braces
This commit is contained in:
Adrian Chadd
2022-02-26 11:31:37 -08:00
parent 2a05c6f3e4
commit 4162377f10
2 changed files with 5 additions and 3 deletions

View File

@@ -249,7 +249,7 @@ static LONG unpack_rle(unsigned char *src, LONG srclen, char *dst, LONG dstlen,
}
}
if(src != srcn)
fprintf(stderr, "Warning: Left %d bytes unused.\n", srcn-src);
fprintf(stderr, "Warning: Left %d bytes unused.\n", (int) (srcn-src));
return dst-dst0;
}

View File

@@ -229,11 +229,12 @@ LONG FindArg(STRPTR template, STRPTR keyword)
ch=*template++;
if(!ch)
return (kwindex == kwlen? argindex : -1);
if(ch == ',' || ch == '=' || ch == '/')
if(ch == ',' || ch == '=' || ch == '/') {
if(kwindex == kwlen)
return argindex;
else
break;
}
} while(ToUpper(ch) == ToUpper(keyword[kwindex++]));
while(ch != '=') {
@@ -353,7 +354,7 @@ struct RDArgs * ReadArgs(STRPTR template, LONG *array, struct RDArgs *rdargs)
while(numargs-->0) {
int isnumeric=0;
if((*swptr)&RA_MULTI)
if((*swptr)&RA_MULTI) {
if(multinum) {
((Argtype *)array)->ptr=ra_alloc(rdargs,
sizeof(Argtype)*(multinum+1));
@@ -365,6 +366,7 @@ struct RDArgs * ReadArgs(STRPTR template, LONG *array, struct RDArgs *rdargs)
isnumeric=((*swptr)&RA_NUMERIC)!=0;
}
else ((Argtype *)array)->ptr=NULL;
}
array=(LONG*)(((Argtype *)array)+1);
if(!((sw=*swptr++)&RA_FOUND) && (sw&RA_ALWAYS)) {
if((!lastmarg) || (sw&RA_KEYWORD) || multinum<2 ||