LunaCON: Add -Wall option and sector[].*bunch, warn on some NYI gamevar flags.

git-svn-id: https://svn.eduke32.com/eduke32@3804 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-05-24 13:54:25 +00:00
parent 85cf8de0f3
commit 1ee43d5a6e
4 changed files with 25 additions and 12 deletions

View file

@ -122,7 +122,6 @@ enum GamevarFlags_t {
GAMEVAR_CHARPTR = 0x00010000, // plValues is a pointer to a char GAMEVAR_CHARPTR = 0x00010000, // plValues is a pointer to a char
GAMEVAR_PTR_MASK = GAMEVAR_INTPTR|GAMEVAR_FLOATPTR|GAMEVAR_SHORTPTR|GAMEVAR_CHARPTR, GAMEVAR_PTR_MASK = GAMEVAR_INTPTR|GAMEVAR_FLOATPTR|GAMEVAR_SHORTPTR|GAMEVAR_CHARPTR,
// GAMEVAR_NORESET = 0x00020000, // var values are not reset when restoring map state
GAMEVAR_SPECIAL = 0x00040000, // flag for structure member shortcut vars GAMEVAR_SPECIAL = 0x00040000, // flag for structure member shortcut vars
}; };
@ -142,7 +141,6 @@ enum GamearrayFlags_t {
GAMEARRAY_VARSIZE = 0x00000020, GAMEARRAY_VARSIZE = 0x00000020,
GAMEARRAY_RESET = 0x00000008, GAMEARRAY_RESET = 0x00000008,
/// GAMEARRAY_NORESET = 0x00000001,
}; };
typedef struct { typedef struct {

View file

@ -725,8 +725,8 @@ local SectorLabels = {
hitag = SEC".hitag", hitag = SEC".hitag",
extra = SEC".extra", extra = SEC".extra",
ceilingbunch = {}, ceilingbunch = { SEC".ceilingbunch" },
floorbunch = {}, floorbunch = { SEC".floorbunch" },
ulotag = S2U(SEC".lotag"), ulotag = S2U(SEC".lotag"),
uhitag = S2U(SEC".hitag"), uhitag = S2U(SEC".hitag"),

View file

@ -1376,7 +1376,7 @@ local function our_require(modname, ...)
errorf(ERRLEV-1, "Couldn't open file \"%s\"", modfn) errorf(ERRLEV-1, "Couldn't open file \"%s\"", modfn)
end end
local modfunc, errmsg = loadstring(str) local modfunc, errmsg = loadstring(str, modfn)
if (modfunc == nil) then if (modfunc == nil) then
errorf(ERRLEV-1, "Couldn't load \"%s\": %s", modname, errmsg) errorf(ERRLEV-1, "Couldn't load \"%s\": %s", modname, errmsg)
end end

View file

@ -1113,6 +1113,12 @@ function Cmd.gamevar(identifier, initval, flags)
return return
end end
local GVFLAG_NYI = GVFLAG.NODEFAULT + GVFLAG.NORESET
if (bit.band(flags, GVFLAG_NYI) ~= 0) then
warnprintf("gamevar \"%s\" flag(s) %d: not yet implemented",
identifier, bit.band(flags, GVFLAG_NYI))
end
if (flags==GVFLAG.PERPLAYER+GVFLAG.PERACTOR) then if (flags==GVFLAG.PERPLAYER+GVFLAG.PERACTOR) then
errprintf("invalid gamevar flags: must be either PERPLAYER or PERACTOR, not both") errprintf("invalid gamevar flags: must be either PERPLAYER or PERACTOR, not both")
return return
@ -3227,14 +3233,23 @@ local function handle_cmdline_arg(str)
local val = true local val = true
local warnstr = str:sub(3) local warnstr = str:sub(3)
if (warnstr:sub(1,3)=="no-") then if (warnstr == "all") then
val = false -- Enable all warnings.
warnstr = warnstr:sub(4) for wopt in pairs(g_warn) do
end g_warn[wopt] = true
end
if (type(g_warn[warnstr])=="boolean") then
g_warn[warnstr] = val
ok = true ok = true
else
-- Enable or disable a particular warning.
if (warnstr:sub(1,3)=="no-") then
val = false
warnstr = warnstr:sub(4)
end
if (type(g_warn[warnstr])=="boolean") then
g_warn[warnstr] = val
ok = true
end
end end
-- -fno* special handling -- -fno* special handling