mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Fix compiler warnings about unused return values
In some implementations of libc the function fread has the attribute `warn_unused_result`, that is treated as an error by the compiler as specified in the flags passed to it. Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
@@ -228,8 +228,11 @@ obj_ReadRGBSection(FILE * f)
|
|||||||
SLONG nNumberOfPatches;
|
SLONG nNumberOfPatches;
|
||||||
struct sPatch **ppPatch, *pPatch;
|
struct sPatch **ppPatch, *pPatch;
|
||||||
|
|
||||||
fread(pSection->pData, sizeof(UBYTE),
|
if (fread(pSection->pData, sizeof(UBYTE),
|
||||||
pSection->nByteSize, f);
|
pSection->nByteSize, f) != pSection->nByteSize) {
|
||||||
|
err(1, "Read error.");
|
||||||
|
}
|
||||||
|
|
||||||
nNumberOfPatches = readlong(f);
|
nNumberOfPatches = readlong(f);
|
||||||
ppPatch = &pSection->pPatches;
|
ppPatch = &pSection->pPatches;
|
||||||
|
|
||||||
@@ -254,8 +257,10 @@ obj_ReadRGBSection(FILE * f)
|
|||||||
err(1, NULL);
|
err(1, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
fread(pPatch->pRPN, sizeof(UBYTE),
|
if (fread(pPatch->pRPN, sizeof(UBYTE),
|
||||||
pPatch->nRPNSize, f);
|
pPatch->nRPNSize, f) != pPatch->nRPNSize) {
|
||||||
|
errx(1, "Read error.");
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
pPatch->pRPN = NULL;
|
pPatch->pRPN = NULL;
|
||||||
|
|
||||||
@@ -336,8 +341,10 @@ obj_ReadOpenFile(FILE * pObjfile, char *tzObjectfile)
|
|||||||
{
|
{
|
||||||
char tzHeader[strlen(RGBDS_OBJECT_VERSION_STRING) + 1];
|
char tzHeader[strlen(RGBDS_OBJECT_VERSION_STRING) + 1];
|
||||||
|
|
||||||
fread(tzHeader, sizeof(char), strlen(RGBDS_OBJECT_VERSION_STRING),
|
if (fread(tzHeader, sizeof(char), strlen(RGBDS_OBJECT_VERSION_STRING),
|
||||||
pObjfile);
|
pObjfile) != strlen(RGBDS_OBJECT_VERSION_STRING)) {
|
||||||
|
errx(1, "%s: Read error.", tzObjectfile);
|
||||||
|
}
|
||||||
|
|
||||||
tzHeader[strlen(RGBDS_OBJECT_VERSION_STRING)] = 0;
|
tzHeader[strlen(RGBDS_OBJECT_VERSION_STRING)] = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user