mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 18:04:09 +03:00
Silence various warnings in builds removing content
The MAKEANDPLAY, NO_CUSTOM_LEVELS, and NO_EDITOR defines remove content or features. However, they then raise several warnings because of some cases, functions, or variables that end up not being used. This silences them by using the UNUSED macro, or by adding a default catch-all case if the define is defined (so unhandled cases will still raise warnings in a build that doesn't have these defines).
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include "Map.h"
|
||||
#include "Music.h"
|
||||
#include "Unreachable.h"
|
||||
#include "Unused.h"
|
||||
#include "UtilityClass.h"
|
||||
#include "VFormat.h"
|
||||
#include "Vlogging.h"
|
||||
@@ -2741,7 +2742,9 @@ void scriptclass::startgamemode(const enum StartMode mode)
|
||||
}
|
||||
break;
|
||||
|
||||
#ifndef NO_CUSTOM_LEVELS
|
||||
#ifdef NO_CUSTOM_LEVELS
|
||||
UNUSED(gotoerrorloadinglevel);
|
||||
#else
|
||||
# ifndef NO_EDITOR
|
||||
case Start_EDITOR:
|
||||
cl.reset();
|
||||
@@ -2836,6 +2839,12 @@ void scriptclass::startgamemode(const enum StartMode mode)
|
||||
|
||||
case Start_QUIT:
|
||||
VVV_unreachable();
|
||||
|
||||
#if defined(NO_CUSTOM_LEVELS) || defined(NO_EDITOR)
|
||||
/* Silence warnings about unhandled cases. */
|
||||
default:
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
game.gravitycontrol = game.savegc;
|
||||
|
||||
Reference in New Issue
Block a user