Merge pull request #287 from Ben10do/remove-dummymem

Two variables, pSection->Data and tSymbols, were previously set to
dummymem, a global variable that was otherwise not used.

As this can potentially cause alignment warnings on Clang, this commit
replaces that mechanism with a plain old NULL pointer, which is more
generally used as a dummy pointer value.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
Antonio Niño Díaz
2018-06-10 22:53:03 +01:00

View File

@@ -28,7 +28,6 @@
struct sSymbol **tSymbols;
struct sSection *pSections;
struct sSection *pLibSections;
uint8_t dummymem;
uint8_t oReadLib;
/*
@@ -209,7 +208,7 @@ struct sSection *obj_ReadRGBSection(FILE *f)
if (pSection->nByteSize == 0) {
/* Skip number of patches */
readlong(f);
pSection->pData = &dummymem;
pSection->pData = NULL;
return pSection;
}
@@ -283,7 +282,7 @@ void obj_ReadRGB(FILE *pObjfile, char *tzObjectfile)
for (i = 0; i < nNumberOfSymbols; i += 1)
tSymbols[i] = obj_ReadSymbol(pObjfile, tzObjectfile);
} else {
tSymbols = (struct sSymbol **)&dummymem;
tSymbols = NULL;
}
/* Next we have the sections */