mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-22 03:02:06 +00:00
Make some changes noticed while porting to C++
This commit is contained in:
@@ -122,9 +122,8 @@ void charmap_Set(char const *name)
|
||||
|
||||
void charmap_Push(void)
|
||||
{
|
||||
struct CharmapStackEntry *stackEntry;
|
||||
struct CharmapStackEntry *stackEntry = malloc(sizeof(*stackEntry));
|
||||
|
||||
stackEntry = malloc(sizeof(*stackEntry));
|
||||
if (stackEntry == NULL)
|
||||
fatalerror("Failed to alloc charmap stack entry: %s\n", strerror(errno));
|
||||
|
||||
|
||||
@@ -386,7 +386,7 @@ static void changeSection(void)
|
||||
}
|
||||
|
||||
// Set the current section by name and type
|
||||
void sect_NewSection(char const *name, uint32_t type, uint32_t org,
|
||||
void sect_NewSection(char const *name, enum SectionType type, uint32_t org,
|
||||
struct SectionSpec const *attribs, enum SectionModifier mod)
|
||||
{
|
||||
if (currentLoadSection)
|
||||
@@ -406,7 +406,7 @@ void sect_NewSection(char const *name, uint32_t type, uint32_t org,
|
||||
}
|
||||
|
||||
// Set the current section by name and type
|
||||
void sect_SetLoadSection(char const *name, uint32_t type, uint32_t org,
|
||||
void sect_SetLoadSection(char const *name, enum SectionType type, uint32_t org,
|
||||
struct SectionSpec const *attribs, enum SectionModifier mod)
|
||||
{
|
||||
// Important info: currently, UNION and LOAD cannot interact, since UNION is prohibited in
|
||||
|
||||
@@ -260,7 +260,7 @@ void processWarningFlag(char *flag)
|
||||
// Not an error, then check if this is a negation
|
||||
strncmp(flag, "no-", strlen("no-")) ? WARNING_ENABLED
|
||||
: WARNING_DISABLED;
|
||||
char const *rootFlag = state == WARNING_DISABLED ? flag + strlen("no-") : flag;
|
||||
char *rootFlag = state == WARNING_DISABLED ? flag + strlen("no-") : flag;
|
||||
|
||||
// Is this a "parametric" warning?
|
||||
if (state != WARNING_DISABLED) { // The `no-` form cannot be parametrized
|
||||
|
||||
Reference in New Issue
Block a user