From 38d7b7d203999ad51d73bddf7cd41fe69a84d78e Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 18 Oct 2012 03:19:27 +0000 Subject: [PATCH] - Fixed errors and warnings when compiling with GCC. (Unfortunately, the VC++ debug builds become ungodly slow when using mods with complex DECORATE. The GCC debug builds run just fine, however. Hopefully this is something that can be fixed later with an assembly-optimized version of the main VM loop, because I don't relish the thought of being stuck with GDB for debugging.) - Fixed: The ACS_Named* action specials were erroneously defined as taking strings instead of names. - Fixed: Copy-paste error caused FxMultiNameState::Emit to generate code that called DecoNameToClass instead of DecoFindMultiNameState. - Updated FxActionSpecialCall::Emit for named script specials. - Fixed inverted asserts for FxMinusSign::Emit and FxUnaryNotBitwise::Emit. SVN r3893 (scripting) --- src/CMakeLists.txt | 7 +----- src/actor.h | 8 +++---- src/d_dehacked.cpp | 2 +- src/dobject.h | 1 + src/dobjtype.cpp | 12 +++++----- src/dthinker.h | 4 ++-- src/farchive.h | 2 +- src/g_shared/a_pickups.cpp | 2 +- src/g_shared/shared_sbar.cpp | 14 ++++++------ src/g_strife/a_thingstoblowup.cpp | 2 +- src/menu/menu.cpp | 2 +- src/p_mobj.cpp | 2 +- src/p_user.cpp | 4 ++-- src/r_data/sprites.cpp | 2 +- src/r_utility.cpp | 2 +- src/thingdef/thingdef_codeptr.cpp | 10 ++++----- src/thingdef/thingdef_expression.cpp | 33 ++++++++++++++++++---------- src/thingdef/thingdef_properties.cpp | 2 +- src/zscript/vmbuilder.cpp | 2 +- src/zscript/vmdisasm.cpp | 2 +- src/zscript/vmexec.h | 2 +- src/zscript/zcc_parser.cpp | 7 ++++-- wadsrc/static/actors/actor.txt | 14 ++++++------ 23 files changed, 73 insertions(+), 65 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4465b32d0..a96c5d097 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -566,11 +566,6 @@ else( NO_ASM ) ADD_ASM_FILE( asm_ia32 tmap2 ) ADD_ASM_FILE( asm_ia32 tmap3 ) endif( X64 ) - if( WIN32 ) - if( NOT X64 ) - ADD_ASM_FILE( win32 wrappers ) - endif( NOT X64 ) - endif( WIN32 ) endif( NO_ASM ) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xlat_parser.c ${CMAKE_CURRENT_BINARY_DIR}/xlat_parser.h @@ -880,7 +875,6 @@ add_executable( zdoom WIN32 thingdef/thingdef_data.cpp thingdef/thingdef_exp.cpp thingdef/thingdef_expression.cpp - thingdef/thingdef_function.cpp thingdef/thingdef_parse.cpp thingdef/thingdef_properties.cpp thingdef/thingdef_states.cpp @@ -910,6 +904,7 @@ add_executable( zdoom WIN32 r_data/renderstyle.cpp r_data/r_interpolate.cpp r_data/r_translate.cpp + zscript/ast.cpp zscript/vmbuilder.cpp zscript/vmdisasm.cpp zscript/vmexec.cpp diff --git a/src/actor.h b/src/actor.h index 4e0b0de06..995c4d073 100644 --- a/src/actor.h +++ b/src/actor.h @@ -500,7 +500,7 @@ inline AActor *GetDefaultByType (const PClass *type) template inline T *GetDefault () { - return (T *)(RUNTIME_CLASS(T)->Defaults); + return (T *)(RUNTIME_CLASS_CASTLESS(T)->Defaults); } struct line_t; @@ -634,7 +634,7 @@ public: AInventory *FindInventory (FName type); template T *FindInventory () { - return static_cast (FindInventory (RUNTIME_CLASS(T))); + return static_cast (FindInventory (RUNTIME_TEMPLATE_CLASS(T))); } // Adds one item of a particular type. Returns NULL if it could not be added. @@ -1018,7 +1018,7 @@ public: do { actor = FActorIterator::Next (); - } while (actor && !actor->IsKindOf (RUNTIME_CLASS(T))); + } while (actor && !actor->IsKindOf (RUNTIME_TEMPLATE_CLASS(T))); return static_cast(actor); } }; @@ -1055,7 +1055,7 @@ AActor *Spawn (FName classname, fixed_t x, fixed_t y, fixed_t z, replace_t allow template inline T *Spawn (fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement) { - return static_cast(AActor::StaticSpawn (RUNTIME_CLASS(T), x, y, z, allowreplacement)); + return static_cast(AActor::StaticSpawn (RUNTIME_TEMPLATE_CLASS(T), x, y, z, allowreplacement)); } diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index 40e919aae..97f76bce6 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -2040,7 +2040,7 @@ static int PatchCodePtrs (int dummy) if (!symname.CompareNoCase(MBFCodePointers[i].alias)) { symname = MBFCodePointers[i].name; - Printf("%s --> %s\n", MBFCodePointers[i].alias, MBFCodePointers[i].name); + Printf("%s --> %s\n", MBFCodePointers[i].alias, MBFCodePointers[i].name.GetChars()); } } diff --git a/src/dobject.h b/src/dobject.h index f19d84764..20426c72c 100644 --- a/src/dobject.h +++ b/src/dobject.h @@ -82,6 +82,7 @@ class PClassActor; #define RUNTIME_CLASS_CASTLESS(cls) (cls::RegistrationInfo.MyClass) // Passed a native class name, returns a PClass representing that class #define RUNTIME_CLASS(cls) ((cls::MetaClass *)RUNTIME_CLASS_CASTLESS(cls)) // Like above, but returns the true type of the meta object +#define RUNTIME_TEMPLATE_CLASS(cls) ((class cls::MetaClass *)RUNTIME_CLASS_CASTLESS(cls)) // RUNTIME_CLASS, but works with templated parameters on GCC #define NATIVE_TYPE(object) (object->StaticType()) // Passed an object, returns the type of the C++ class representing the object // Enumerations for the meta classes created by ClassReg::RegisterClass() diff --git a/src/dobjtype.cpp b/src/dobjtype.cpp index 950e9bd7f..bf3a6773f 100644 --- a/src/dobjtype.cpp +++ b/src/dobjtype.cpp @@ -103,7 +103,7 @@ void DumpTypeTable() if (len > max) max = len; } - if (len < countof(lens)) + if (len < (int)countof(lens)) { lens[len]++; } @@ -114,7 +114,7 @@ void DumpTypeTable() Printf("Max bucket size: %d\n", max); Printf("Avg bucket size: %.2f\n", double(all) / used); int j,k; - for (k = k = countof(lens)-1; k > 0; --k) + for (k = countof(lens)-1; k > 0; --k) if (lens[k]) break; for (j = 0; j <= k; ++j) @@ -224,8 +224,8 @@ bool PType::IsMatch(intptr_t id1, intptr_t id2) const void PType::GetTypeIDs(intptr_t &id1, intptr_t &id2) const { - id1 = NULL; - id2 = NULL; + id1 = 0; + id2 = 0; } //========================================================================== @@ -486,7 +486,7 @@ PPointer::PPointer(PType *pointsat) bool PPointer::IsMatch(intptr_t id1, intptr_t id2) const { - assert(id2 == NULL); + assert(id2 == 0); PType *pointat = (PType *)id1; return pointat == PointedType; @@ -733,7 +733,7 @@ PDynArray::PDynArray(PType *etype) bool PDynArray::IsMatch(intptr_t id1, intptr_t id2) const { - assert(id2 == NULL); + assert(id2 == 0); const PType *elemtype = (const PType *)id1; return elemtype == ElementType; diff --git a/src/dthinker.h b/src/dthinker.h index 32857d86b..e010e536d 100644 --- a/src/dthinker.h +++ b/src/dthinker.h @@ -121,10 +121,10 @@ public: template class TThinkerIterator : public FThinkerIterator { public: - TThinkerIterator (int statnum=MAX_STATNUM+1) : FThinkerIterator (RUNTIME_CLASS(T), statnum) + TThinkerIterator (int statnum=MAX_STATNUM+1) : FThinkerIterator (RUNTIME_TEMPLATE_CLASS(T), statnum) { } - TThinkerIterator (int statnum, DThinker *prev) : FThinkerIterator (RUNTIME_CLASS(T), statnum, prev) + TThinkerIterator (int statnum, DThinker *prev) : FThinkerIterator (RUNTIME_TEMPLATE_CLASS(T), statnum, prev) { } TThinkerIterator (const PClass *subclass, int statnum=MAX_STATNUM+1) : FThinkerIterator(subclass, statnum) diff --git a/src/farchive.h b/src/farchive.h index 6563bd15c..1a6f98ec5 100644 --- a/src/farchive.h +++ b/src/farchive.h @@ -272,7 +272,7 @@ inline FArchive &operator<< (FArchive &arc, PalEntry &p) template inline FArchive &operator<< (FArchive &arc, T* &object) { - return arc.SerializeObject ((DObject*&)object, RUNTIME_CLASS(T)); + return arc.SerializeObject ((DObject*&)object, RUNTIME_TEMPLATE_CLASS(T)); } FArchive &operator<< (FArchive &arc, PClass * &info); diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index 3c868ffed..8f7342e05 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -1273,7 +1273,7 @@ bool AInventory::DoRespawn () void AInventory::GiveQuest (AActor *toucher) { int quest = GetClass()->GiveQuest; - if (quest > 0 && quest <= countof(QuestItemClasses)) + if (quest > 0 && quest <= (int)countof(QuestItemClasses)) { toucher->GiveInventoryType (QuestItemClasses[quest-1]); } diff --git a/src/g_shared/shared_sbar.cpp b/src/g_shared/shared_sbar.cpp index 4ca4a519c..13e802bef 100644 --- a/src/g_shared/shared_sbar.cpp +++ b/src/g_shared/shared_sbar.cpp @@ -240,7 +240,7 @@ DBaseStatusBar::DBaseStatusBar (int reltop, int hres, int vres) void DBaseStatusBar::Destroy () { - for (int i = 0; i < countof(Messages); ++i) + for (size_t i = 0; i < countof(Messages); ++i) { DHUDMessage *msg = Messages[i]; while (msg) @@ -342,7 +342,7 @@ void DBaseStatusBar::MultiplayerChanged () void DBaseStatusBar::Tick () { - for (int i = 0; i < countof(Messages); ++i) + for (size_t i = 0; i < countof(Messages); ++i) { DHUDMessage *msg = Messages[i]; DHUDMessage **prev = &Messages[i]; @@ -424,7 +424,7 @@ void DBaseStatusBar::AttachMessage (DHUDMessage *msg, DWORD id, int layer) DHUDMessage *DBaseStatusBar::DetachMessage (DHUDMessage *msg) { - for (int i = 0; i < countof(Messages); ++i) + for (size_t i = 0; i < countof(Messages); ++i) { DHUDMessage *probe = Messages[i]; DHUDMessage **prev = &Messages[i]; @@ -451,7 +451,7 @@ DHUDMessage *DBaseStatusBar::DetachMessage (DHUDMessage *msg) DHUDMessage *DBaseStatusBar::DetachMessage (DWORD id) { - for (int i = 0; i < countof(Messages); ++i) + for (size_t i = 0; i < countof(Messages); ++i) { DHUDMessage *probe = Messages[i]; DHUDMessage **prev = &Messages[i]; @@ -484,7 +484,7 @@ DHUDMessage *DBaseStatusBar::DetachMessage (DWORD id) void DBaseStatusBar::DetachAllMessages () { - for (int i = 0; i < countof(Messages); ++i) + for (size_t i = 0; i < countof(Messages); ++i) { DHUDMessage *probe = Messages[i]; @@ -1627,7 +1627,7 @@ void DBaseStatusBar::Serialize (FArchive &arc) } else { - for (int i = 0; i < countof(Messages); ++i) + for (size_t i = 0; i < countof(Messages); ++i) { arc << Messages[i]; } @@ -1639,7 +1639,7 @@ void DBaseStatusBar::ScreenSizeChanged () st_scale.Callback (); SB_state = screen->GetPageCount (); - for (int i = 0; i < countof(Messages); ++i) + for (size_t i = 0; i < countof(Messages); ++i) { DHUDMessage *message = Messages[i]; while (message != NULL) diff --git a/src/g_strife/a_thingstoblowup.cpp b/src/g_strife/a_thingstoblowup.cpp index b2898a235..018f4d589 100644 --- a/src/g_strife/a_thingstoblowup.cpp +++ b/src/g_strife/a_thingstoblowup.cpp @@ -35,7 +35,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GiveQuestItem) PARAM_INT(questitem); // Give one of these quest items to every player in the game - if (questitem >= 0 && questitem < countof(QuestItemClasses)) + if (questitem >= 0 && questitem < (int)countof(QuestItemClasses)) { for (int i = 0; i < MAXPLAYERS; ++i) { diff --git a/src/menu/menu.cpp b/src/menu/menu.cpp index dec0a4241..327632e55 100644 --- a/src/menu/menu.cpp +++ b/src/menu/menu.cpp @@ -352,7 +352,7 @@ void M_SetMenu(FName menu, int param) GameStartupInfo.Episode = -1; GameStartupInfo.PlayerClass = param == -1000? NULL : - param == -1? "Random" : GetPrintableDisplayName(PlayerClasses[param].Type); + param == -1? "Random" : GetPrintableDisplayName(PlayerClasses[param].Type).GetChars(); break; case NAME_Skillmenu: diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 3035749fe..0dbbf93af 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -2621,7 +2621,7 @@ AActor *AActor::TIDHash[128]; void AActor::ClearTIDHashes () { - memset(TIDHash, NULL, sizeof(TIDHash)); + memset(TIDHash, 0, sizeof(TIDHash)); } // diff --git a/src/p_user.cpp b/src/p_user.cpp index 61e9e6f11..a8b630c37 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -420,7 +420,7 @@ IMPLEMENT_CLASS(PClassPlayerPawn) PClassPlayerPawn::PClassPlayerPawn() { - for (int i = 0; i < countof(HexenArmor); ++i) + for (size_t i = 0; i < countof(HexenArmor); ++i) { HexenArmor[i] = 0; } @@ -433,7 +433,7 @@ void PClassPlayerPawn::Derive(PClass *newclass) assert(newclass->IsKindOf(RUNTIME_CLASS(PClassPlayerPawn))); Super::Derive(newclass); PClassPlayerPawn *newp = static_cast(newclass); - int i; + size_t i; newp->DisplayName = DisplayName; newp->SoundClass = SoundClass; diff --git a/src/r_data/sprites.cpp b/src/r_data/sprites.cpp index 6252e9575..3f5b7a522 100644 --- a/src/r_data/sprites.cpp +++ b/src/r_data/sprites.cpp @@ -952,7 +952,7 @@ void R_InitSprites () FString classface = basetype->Face; strcpy (skins[i].name, "Base"); - if (classface.IsEmpty() == NULL || strcmp(classface, "None") == 0) + if (classface.IsEmpty() || strcmp(classface, "None") == 0) { skins[i].face[0] = 'S'; skins[i].face[1] = 'T'; diff --git a/src/r_utility.cpp b/src/r_utility.cpp index b097149f5..c91da86a5 100644 --- a/src/r_utility.cpp +++ b/src/r_utility.cpp @@ -779,7 +779,7 @@ void R_SetupFrame (AActor *actor) { iview->nviewx = camera->x; iview->nviewy = camera->y; - iview->nviewz = camera->player ? camera->player->viewz : camera->z + camera->GetClass()->CameraHeight; + iview->nviewz = camera->player ? camera->player->viewz : camera->z + camera->GetCameraHeight(); viewsector = camera->Sector; r_showviewer = false; } diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index e4aac1a14..bd6b6f1e4 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -2280,7 +2280,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Log) { PARAM_ACTION_PROLOGUE; PARAM_STRING(text); - Printf("%s\n", text); + Printf("%s\n", text.GetChars()); ACTION_SET_RESULT(false); // Prints should never set the result for inventory state chains! return numret; } @@ -2737,7 +2737,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CountdownArg) PARAM_INT(argnum); PARAM_STATE_OPT(state) { state = self->FindState(NAME_Death); } - if (argnum > 0 && argnum < countof(self->args)) + if (argnum > 0 && argnum < (int)countof(self->args)) { if (!self->args[argnum]--) { @@ -3542,7 +3542,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ChangeFlag) } else { - Printf("Unknown flag '%s' in '%s'\n", flagname, cls->TypeName.GetChars()); + Printf("Unknown flag '%s' in '%s'\n", flagname.GetChars(), cls->TypeName.GetChars()); } return 0; } @@ -3598,7 +3598,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckFlag) } else { - Printf("Unknown flag '%s' in '%s'\n", flagname, cls->TypeName.GetChars()); + Printf("Unknown flag '%s' in '%s'\n", flagname.GetChars(), cls->TypeName.GetChars()); } return numret; } @@ -4092,7 +4092,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Teleport) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Turn) { PARAM_ACTION_PROLOGUE; - PARAM_ANGLE_OPT(angle); + PARAM_ANGLE_OPT(angle) { angle = 0; } self->angle += angle; return 0; } diff --git a/src/thingdef/thingdef_expression.cpp b/src/thingdef/thingdef_expression.cpp index 7699750a2..8ef71dec1 100644 --- a/src/thingdef/thingdef_expression.cpp +++ b/src/thingdef/thingdef_expression.cpp @@ -831,7 +831,7 @@ ExpEmit FxMinusSign::Emit(VMFunctionBuilder *build) { assert(ValueType.Type == Operand->ValueType.Type); ExpEmit from = Operand->Emit(build); - assert(from.Konst != 0); + assert(from.Konst == 0); // Do it in-place. if (ValueType == VAL_Int) { @@ -929,7 +929,7 @@ ExpEmit FxUnaryNotBitwise::Emit(VMFunctionBuilder *build) assert(ValueType.Type == Operand->ValueType.Type); assert(ValueType == VAL_Int); ExpEmit from = Operand->Emit(build); - assert(from.Konst != 0); + assert(from.Konst == 0); // Do it in-place. build->Emit(OP_NOT, from.RegNum, from.RegNum, 0); return from; @@ -3507,23 +3507,32 @@ ExpEmit FxActionSpecialCall::Emit(VMFunctionBuilder *build) assert(Self == NULL); unsigned i = 0; - build->Emit(OP_PARAMI, Special); // pass special number + build->Emit(OP_PARAMI, abs(Special)); // pass special number build->Emit(OP_PARAM, 0, REGT_POINTER, 0); // pass self if (ArgList != NULL) { for (; i < ArgList->Size(); ++i) { FxExpression *argex = (*ArgList)[i]; - assert(argex->ValueType == VAL_Int); - if (argex->isConstant()) + if (Special < 0 && i == 0) { - EmitConstantInt(build, argex->EvalExpression(NULL).GetInt()); + assert(argex->ValueType == VAL_Name); + assert(argex->isConstant()); + EmitConstantInt(build, -argex->EvalExpression(NULL).GetName()); } else { - ExpEmit arg(argex->Emit(build)); - build->Emit(OP_PARAM, 0, arg.RegType, arg.RegNum); - arg.Free(build); + assert(argex->ValueType == VAL_Int); + if (argex->isConstant()) + { + EmitConstantInt(build, argex->EvalExpression(NULL).GetInt()); + } + else + { + ExpEmit arg(argex->Emit(build)); + build->Emit(OP_PARAM, 0, arg.RegType, arg.RegNum); + arg.Free(build); + } } } } @@ -3995,11 +4004,11 @@ ExpEmit FxMultiNameState::Emit(VMFunctionBuilder *build) // Find the DecoFindMultiNameState function. If not found, create it and install it // in Actor. VMFunction *callfunc; - PSymbol *sym = RUNTIME_CLASS(AActor)->Symbols.FindSymbol(NAME_DecoNameToClass, false); + PSymbol *sym = RUNTIME_CLASS(AActor)->Symbols.FindSymbol(NAME_DecoFindMultiNameState, false); if (sym == NULL) { - PSymbolVMFunction *symfunc = new PSymbolVMFunction(NAME_DecoNameToClass); - VMNativeFunction *calldec = new VMNativeFunction(DecoFindMultiNameState, NAME_DecoNameToClass); + PSymbolVMFunction *symfunc = new PSymbolVMFunction(NAME_DecoFindMultiNameState); + VMNativeFunction *calldec = new VMNativeFunction(DecoFindMultiNameState, NAME_DecoFindMultiNameState); symfunc->Function = calldec; sym = symfunc; RUNTIME_CLASS(AActor)->Symbols.AddSymbol(sym); diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index 8f4470058..576aa72b1 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -88,7 +88,7 @@ static PClassActor *FindClassTentative(const char *name, PClass *ancestor) assert(cls != NULL); // cls can not be NULL here if (!cls->IsDescendantOf(ancestor)) { - I_Error("%s does not inherit from %s\n", name, ancestor); + I_Error("%s does not inherit from %s\n", name, ancestor->TypeName.GetChars()); } return static_cast(cls); } diff --git a/src/zscript/vmbuilder.cpp b/src/zscript/vmbuilder.cpp index 85e8c0469..4cf613d8f 100644 --- a/src/zscript/vmbuilder.cpp +++ b/src/zscript/vmbuilder.cpp @@ -446,7 +446,7 @@ size_t VMFunctionBuilder::Emit(int opcode, int opa, VM_SHALF opbc) { assert(opcode >= 0 && opcode < NUM_OPS); assert(opa >= 0 && opa <= 255); - assert(opbc >= -32768 && opbc <= 32767); + //assert(opbc >= -32768 && opbc <= 32767); always true due to parameter's width VMOP op; op.op = opcode; op.a = opa; diff --git a/src/zscript/vmdisasm.cpp b/src/zscript/vmdisasm.cpp index 04c3bbb9c..b6531e85b 100644 --- a/src/zscript/vmdisasm.cpp +++ b/src/zscript/vmdisasm.cpp @@ -157,7 +157,7 @@ void VMDumpConstants(FILE *out, const VMScriptFunction *func) { for (j = 0, k = i; j < 4 && k < func->NumKonstA; j++, k += kk) { - mysnprintf(tmp, countof(tmp), "%3d. %p:%d", k, func->KonstA[k], func->KonstATags()[k]); + mysnprintf(tmp, countof(tmp), "%3d. %p:%d", k, func->KonstA[k].v, func->KonstATags()[k]); printf_wrapper(out, "%-20s", tmp); } printf_wrapper(out, "\n"); diff --git a/src/zscript/vmexec.h b/src/zscript/vmexec.h index 71d71f065..b7e3bc374 100644 --- a/src/zscript/vmexec.h +++ b/src/zscript/vmexec.h @@ -1264,7 +1264,7 @@ begin: c = 0; } reg.a[a] = (VM_UBYTE *)reg.a[B] + c; - reg.atag[a] = c == 0 ? reg.atag[B] : ATAG_GENERIC; + reg.atag[a] = c == 0 ? reg.atag[B] : (int)ATAG_GENERIC; NEXTOP; OP(ADDA_RK): ASSERTA(a); ASSERTA(B); ASSERTKD(C); diff --git a/src/zscript/zcc_parser.cpp b/src/zscript/zcc_parser.cpp index 32816ec0c..3b31788db 100644 --- a/src/zscript/zcc_parser.cpp +++ b/src/zscript/zcc_parser.cpp @@ -168,7 +168,8 @@ static void DoParse(const char *filename) failed = false; #ifdef _DEBUG FILE *f = fopen("trace.txt", "w"); - ZCCParseTrace(f, ""); + char prompt = '\0'; + ZCCParseTrace(f, &prompt); #endif ZCCParseState state(sc); @@ -232,12 +233,14 @@ static void DoParse(const char *filename) FString ast = ZCC_PrintAST(state.TopNode); FString astfile = ExtractFileBase(filename, false); astfile << ".ast"; +#ifdef _DEBUG f = fopen(astfile, "w"); if (f != NULL) { fputs(ast.GetChars(), f); fclose(f); } +#endif } CCMD(parse) @@ -255,7 +258,7 @@ static FString ZCCTokenName(int terminal) return "end of file"; } int sc_token; - if (terminal > 0 && terminal < countof(BackTokenMap)) + if (terminal > 0 && terminal < (int)countof(BackTokenMap)) { sc_token = BackTokenMap[terminal]; if (sc_token == 0) diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index 07012e73f..a6c7bd1c5 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -300,13 +300,13 @@ ACTOR Actor native //: Thinker action native A_TransferPointer(int ptr_source, int ptr_recepient, int sourcefield, int recepientfield=AAPTR_DEFAULT, int flags=0); action native A_CopyFriendliness(int ptr_source = AAPTR_MASTER); - action native ACS_NamedExecute(string script, int mapnum=0, int arg1=0, int arg2=0, int arg3=0); - action native ACS_NamedSuspend(string script, int mapnum=0); - action native ACS_NamedTerminate(string script, int mapnum=0); - action native ACS_NamedLockedExecute(string script, int mapnum=0, int arg1=0, int arg2=0, int lock=0); - action native ACS_NamedLockedExecuteDoor(string script, int mapnum=0, int arg1=0, int arg2=0, int lock=0); - action native ACS_NamedExecuteWithResult(string script, int arg1=0, int arg2=0, int arg3=0, int arg4=0); - action native ACS_NamedExecuteAlways(string script, int mapnum=0, int arg1=0, int arg2=0, int arg3=0); + action native ACS_NamedExecute(name script, int mapnum=0, int arg1=0, int arg2=0, int arg3=0); + action native ACS_NamedSuspend(name script, int mapnum=0); + action native ACS_NamedTerminate(name script, int mapnum=0); + action native ACS_NamedLockedExecute(name script, int mapnum=0, int arg1=0, int arg2=0, int lock=0); + action native ACS_NamedLockedExecuteDoor(name script, int mapnum=0, int arg1=0, int arg2=0, int lock=0); + action native ACS_NamedExecuteWithResult(name script, int arg1=0, int arg2=0, int arg3=0, int arg4=0); + action native ACS_NamedExecuteAlways(name script, int mapnum=0, int arg1=0, int arg2=0, int arg3=0); States {