From db86385cf69fcf7a0a9b040dfe14d59945b5ebb0 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 11 Apr 2016 10:46:30 +0200 Subject: [PATCH] - removed STACK_ARGS. The only reason this even existed was that ZDoom's original VC projects used __fastcall. The CMake generated project do not, they stick to __cdecl. Since no performance gain can be seen by using __fastcall the best course of action is to just remove all traces of it from the source and forget that it ever existed. --- src/c_console.cpp | 6 +-- src/c_cvars.cpp | 2 +- src/d_netinfo.cpp | 4 +- src/dobjtype.cpp | 2 +- src/doomtype.h | 12 ++---- src/g_doomedmap.cpp | 2 +- src/g_shared/a_weapons.cpp | 4 +- src/g_shared/shared_hud.cpp | 2 +- src/hu_scores.cpp | 4 +- src/hu_stuff.h | 4 +- src/nodebuild.cpp | 2 +- src/nodebuild.h | 2 +- src/nodebuild_gl.cpp | 2 +- src/p_acs.cpp | 18 ++++---- src/p_acs.h | 2 +- src/p_effect.cpp | 2 +- src/p_effect.h | 9 +++- src/p_lnspec.cpp | 2 +- src/p_map.cpp | 18 ++++---- src/p_states.cpp | 2 +- src/p_things.cpp | 2 +- src/p_trace.cpp | 24 +++++++++-- src/p_udmf.cpp | 2 +- src/p_user.cpp | 2 +- src/po_man.cpp | 2 +- src/posix/cocoa/i_system.mm | 4 +- src/posix/i_system.h | 4 +- src/posix/sdl/i_main.cpp | 4 +- src/posix/sdl/i_system.cpp | 4 +- src/r_data/sprites.cpp | 2 +- src/r_draw.cpp | 66 +++++++++++++++--------------- src/r_draw.h | 50 +++++++++++----------- src/r_drawt.cpp | 24 +++++------ src/r_main.cpp | 2 +- src/r_main.h | 2 +- src/r_plane.cpp | 4 +- src/r_things.cpp | 4 +- src/r_things.h | 2 +- src/resourcefiles/ancientzip.cpp | 2 +- src/resourcefiles/ancientzip.h | 2 +- src/resourcefiles/resourcefile.cpp | 2 +- src/s_advsound.cpp | 4 +- src/sc_man.cpp | 6 +-- src/sound/i_musicinterns.h | 56 ++++++++++++------------- src/statistics.cpp | 6 +-- src/textures/anim_switches.cpp | 2 +- src/thingdef/thingdef_data.cpp | 6 +-- src/v_draw.cpp | 2 +- src/v_font.cpp | 10 ++--- src/v_palette.cpp | 10 ++--- src/v_text.cpp | 4 +- src/v_video.h | 6 +-- src/win32/i_dijoy.cpp | 2 +- src/win32/i_main.cpp | 4 +- src/win32/i_rawps2.cpp | 2 +- src/win32/i_system.cpp | 4 +- src/win32/i_system.h | 4 +- src/x86.cpp | 2 +- 58 files changed, 231 insertions(+), 210 deletions(-) diff --git a/src/c_console.cpp b/src/c_console.cpp index b86ea0b2cc..2f221e319c 100644 --- a/src/c_console.cpp +++ b/src/c_console.cpp @@ -581,7 +581,7 @@ int VPrintf (int printlevel, const char *format, va_list parms) return PrintString (printlevel, outline.GetChars()); } -int STACK_ARGS Printf (int printlevel, const char *format, ...) +int Printf (int printlevel, const char *format, ...) { va_list argptr; int count; @@ -593,7 +593,7 @@ int STACK_ARGS Printf (int printlevel, const char *format, ...) return count; } -int STACK_ARGS Printf (const char *format, ...) +int Printf (const char *format, ...) { va_list argptr; int count; @@ -605,7 +605,7 @@ int STACK_ARGS Printf (const char *format, ...) return count; } -int STACK_ARGS DPrintf (const char *format, ...) +int DPrintf (const char *format, ...) { va_list argptr; int count; diff --git a/src/c_cvars.cpp b/src/c_cvars.cpp index 6d81bc3f64..1a1b71647d 100644 --- a/src/c_cvars.cpp +++ b/src/c_cvars.cpp @@ -1259,7 +1259,7 @@ void FMaskCVar::DoSet (UCVarValue value, ECVarType type) //////////////////////////////////////////////////////////////////////// -static int STACK_ARGS sortcvars (const void *a, const void *b) +static int sortcvars (const void *a, const void *b) { return strcmp (((*(FBaseCVar **)a))->GetName(), ((*(FBaseCVar **)b))->GetName()); } diff --git a/src/d_netinfo.cpp b/src/d_netinfo.cpp index c20b2aff6c..7a366e2d45 100644 --- a/src/d_netinfo.cpp +++ b/src/d_netinfo.cpp @@ -663,14 +663,14 @@ void D_DoServerInfoChange (BYTE **stream, bool singlebit) } } -static int STACK_ARGS userinfosortfunc(const void *a, const void *b) +static int userinfosortfunc(const void *a, const void *b) { TMap::ConstPair *pair1 = *(TMap::ConstPair **)a; TMap::ConstPair *pair2 = *(TMap::ConstPair **)b; return stricmp(pair1->Key.GetChars(), pair2->Key.GetChars()); } -static int STACK_ARGS namesortfunc(const void *a, const void *b) +static int namesortfunc(const void *a, const void *b) { FName *name1 = (FName *)a; FName *name2 = (FName *)b; diff --git a/src/dobjtype.cpp b/src/dobjtype.cpp index d2df43fded..e707c77110 100644 --- a/src/dobjtype.cpp +++ b/src/dobjtype.cpp @@ -2827,7 +2827,7 @@ bool PClass::ReadValue(FArchive &ar, void *addr) const // //========================================================================== -static int STACK_ARGS cregcmp (const void *a, const void *b) NO_SANITIZE +static int cregcmp (const void *a, const void *b) NO_SANITIZE { const PClass *class1 = *(const PClass **)a; const PClass *class2 = *(const PClass **)b; diff --git a/src/doomtype.h b/src/doomtype.h index fa84824f2b..39c59751d3 100644 --- a/src/doomtype.h +++ b/src/doomtype.h @@ -100,12 +100,6 @@ typedef TMap FClassMap; #endif -#if defined(_MSC_VER) || defined(__WATCOMC__) -#define STACK_ARGS __cdecl -#else -#define STACK_ARGS -#endif - #if defined(_MSC_VER) #define NOVTABLE __declspec(novtable) #else @@ -149,11 +143,11 @@ enum // [RH] This gets used all over; define it here: -int STACK_ARGS Printf (int printlevel, const char *, ...) GCCPRINTF(2,3); -int STACK_ARGS Printf (const char *, ...) GCCPRINTF(1,2); +int Printf (int printlevel, const char *, ...) GCCPRINTF(2,3); +int Printf (const char *, ...) GCCPRINTF(1,2); // [RH] Same here: -int STACK_ARGS DPrintf (const char *, ...) GCCPRINTF(1,2); +int DPrintf (const char *, ...) GCCPRINTF(1,2); extern "C" int mysnprintf(char *buffer, size_t count, const char *format, ...) GCCPRINTF(3,4); extern "C" int myvsnprintf(char *buffer, size_t count, const char *format, va_list argptr) GCCFORMAT(3); diff --git a/src/g_doomedmap.cpp b/src/g_doomedmap.cpp index b18347a0f9..b3aa966c30 100644 --- a/src/g_doomedmap.cpp +++ b/src/g_doomedmap.cpp @@ -100,7 +100,7 @@ static IdMap DoomEdFromMapinfo; FDoomEdMap DoomEdMap; -static int STACK_ARGS sortnums (const void *a, const void *b) +static int sortnums (const void *a, const void *b) { return (*(const FDoomEdMap::Pair**)a)->Key - (*(const FDoomEdMap::Pair**)b)->Key; } diff --git a/src/g_shared/a_weapons.cpp b/src/g_shared/a_weapons.cpp index 971d974de2..adb010d0c8 100644 --- a/src/g_shared/a_weapons.cpp +++ b/src/g_shared/a_weapons.cpp @@ -34,7 +34,7 @@ FWeaponSlots *PlayingKeyConf; TArray Weapons_ntoh; TMap Weapons_hton; -static int STACK_ARGS ntoh_cmp(const void *a, const void *b); +static int ntoh_cmp(const void *a, const void *b); IMPLEMENT_CLASS(PClassWeapon) @@ -1725,7 +1725,7 @@ void P_SetupWeapons_ntohton() // //=========================================================================== -static int STACK_ARGS ntoh_cmp(const void *a, const void *b) +static int ntoh_cmp(const void *a, const void *b) { PClassWeapon *c1 = *(PClassWeapon **)a; PClassWeapon *c2 = *(PClassWeapon **)b; diff --git a/src/g_shared/shared_hud.cpp b/src/g_shared/shared_hud.cpp index 7169cb7dba..36ffdd5b59 100644 --- a/src/g_shared/shared_hud.cpp +++ b/src/g_shared/shared_hud.cpp @@ -379,7 +379,7 @@ static void DrawArmor(ABasicArmor * barmor, AHexenArmor * harmor, int x, int y) //--------------------------------------------------------------------------- static TArray KeyTypes, UnassignedKeyTypes; -static int STACK_ARGS ktcmp(const void * a, const void * b) +static int ktcmp(const void * a, const void * b) { AKey *key1 = (AKey*)GetDefaultByType ( *(PClassActor **)a ); AKey *key2 = (AKey*)GetDefaultByType ( *(PClassActor **)b ); diff --git a/src/hu_scores.cpp b/src/hu_scores.cpp index a971672cde..35e18006d2 100644 --- a/src/hu_scores.cpp +++ b/src/hu_scores.cpp @@ -84,7 +84,7 @@ CVAR (Int, sb_deathmatch_otherplayercolor, CR_GREY, CVAR_ARCHIVE) CVAR (Bool, sb_teamdeathmatch_enable, true, CVAR_ARCHIVE) CVAR (Int, sb_teamdeathmatch_headingcolor, CR_RED, CVAR_ARCHIVE) -int STACK_ARGS comparepoints (const void *arg1, const void *arg2) +int comparepoints (const void *arg1, const void *arg2) { // Compare first be frags/kills, then by name. player_t *p1 = *(player_t **)arg1; @@ -99,7 +99,7 @@ int STACK_ARGS comparepoints (const void *arg1, const void *arg2) return diff; } -int STACK_ARGS compareteams (const void *arg1, const void *arg2) +int compareteams (const void *arg1, const void *arg2) { // Compare first by teams, then by frags, then by name. player_t *p1 = *(player_t **)arg1; diff --git a/src/hu_stuff.h b/src/hu_stuff.h index e829ed1d59..9c3250d735 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -56,7 +56,7 @@ extern bool SB_ForceActive; // Sorting routines -int STACK_ARGS comparepoints(const void *arg1, const void *arg2); -int STACK_ARGS compareteams(const void *arg1, const void *arg2); +int comparepoints(const void *arg1, const void *arg2); +int compareteams(const void *arg1, const void *arg2); #endif diff --git a/src/nodebuild.cpp b/src/nodebuild.cpp index a6609d3317..c56ee697ea 100644 --- a/src/nodebuild.cpp +++ b/src/nodebuild.cpp @@ -253,7 +253,7 @@ void FNodeBuilder::CreateSubsectorsForReal () } } -int STACK_ARGS FNodeBuilder::SortSegs (const void *a, const void *b) +int FNodeBuilder::SortSegs (const void *a, const void *b) { const FPrivSeg *x = ((const USegPtr *)a)->SegPtr; const FPrivSeg *y = ((const USegPtr *)b)->SegPtr; diff --git a/src/nodebuild.h b/src/nodebuild.h index e7380895ef..7e2a61aaac 100644 --- a/src/nodebuild.h +++ b/src/nodebuild.h @@ -299,7 +299,7 @@ private: void PushConnectingGLSeg (int subsector, TArray &segs, vertex_t *v1, vertex_t *v2); int OutputDegenerateSubsector (TArray &segs, int subsector, bool bForward, double lastdot, FPrivSeg *&prev, vertex_t *outVerts); - static int STACK_ARGS SortSegs (const void *a, const void *b); + static int SortSegs (const void *a, const void *b); double InterceptVector (const node_t &splitter, const FPrivSeg &seg); diff --git a/src/nodebuild_gl.cpp b/src/nodebuild_gl.cpp index cdbfeeb043..61bed0727e 100644 --- a/src/nodebuild_gl.cpp +++ b/src/nodebuild_gl.cpp @@ -40,7 +40,7 @@ #include "doomtype.h" #include "nodebuild.h" -static inline void STACK_ARGS Warn (const char *format, ...) +static inline void Warn (const char *format, ...) { } diff --git a/src/p_acs.cpp b/src/p_acs.cpp index bdc13357e7..00b3229b22 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -2507,7 +2507,7 @@ void FBehavior::LoadScriptsDirectory () } } -int STACK_ARGS FBehavior::SortScripts (const void *a, const void *b) +int FBehavior::SortScripts (const void *a, const void *b) { ScriptPtr *ptr1 = (ScriptPtr *)a; ScriptPtr *ptr2 = (ScriptPtr *)b; @@ -9997,7 +9997,7 @@ void ClearProfiles(TArray &profiles) } } -static int STACK_ARGS sort_by_total_instr(const void *a_, const void *b_) +static int sort_by_total_instr(const void *a_, const void *b_) { const ProfileCollector *a = (const ProfileCollector *)a_; const ProfileCollector *b = (const ProfileCollector *)b_; @@ -10007,7 +10007,7 @@ static int STACK_ARGS sort_by_total_instr(const void *a_, const void *b_) return (int)(b->ProfileData->TotalInstr - a->ProfileData->TotalInstr); } -static int STACK_ARGS sort_by_min(const void *a_, const void *b_) +static int sort_by_min(const void *a_, const void *b_) { const ProfileCollector *a = (const ProfileCollector *)a_; const ProfileCollector *b = (const ProfileCollector *)b_; @@ -10015,7 +10015,7 @@ static int STACK_ARGS sort_by_min(const void *a_, const void *b_) return b->ProfileData->MinInstrPerRun - a->ProfileData->MinInstrPerRun; } -static int STACK_ARGS sort_by_max(const void *a_, const void *b_) +static int sort_by_max(const void *a_, const void *b_) { const ProfileCollector *a = (const ProfileCollector *)a_; const ProfileCollector *b = (const ProfileCollector *)b_; @@ -10023,7 +10023,7 @@ static int STACK_ARGS sort_by_max(const void *a_, const void *b_) return b->ProfileData->MaxInstrPerRun - a->ProfileData->MaxInstrPerRun; } -static int STACK_ARGS sort_by_avg(const void *a_, const void *b_) +static int sort_by_avg(const void *a_, const void *b_) { const ProfileCollector *a = (const ProfileCollector *)a_; const ProfileCollector *b = (const ProfileCollector *)b_; @@ -10033,7 +10033,7 @@ static int STACK_ARGS sort_by_avg(const void *a_, const void *b_) return b_avg - a_avg; } -static int STACK_ARGS sort_by_runs(const void *a_, const void *b_) +static int sort_by_runs(const void *a_, const void *b_) { const ProfileCollector *a = (const ProfileCollector *)a_; const ProfileCollector *b = (const ProfileCollector *)b_; @@ -10042,7 +10042,7 @@ static int STACK_ARGS sort_by_runs(const void *a_, const void *b_) } static void ShowProfileData(TArray &profiles, long ilimit, - int (STACK_ARGS *sorter)(const void *, const void *), bool functions) + int (*sorter)(const void *, const void *), bool functions) { static const char *const typelabels[2] = { "script", "function" }; @@ -10113,7 +10113,7 @@ static void ShowProfileData(TArray &profiles, long ilimit, CCMD(acsprofile) { - static int (STACK_ARGS *sort_funcs[])(const void*, const void *) = + static int (*sort_funcs[])(const void*, const void *) = { sort_by_total_instr, sort_by_min, @@ -10126,7 +10126,7 @@ CCMD(acsprofile) TArray ScriptProfiles, FuncProfiles; long limit = 10; - int (STACK_ARGS *sorter)(const void *, const void *) = sort_by_total_instr; + int (*sorter)(const void *, const void *) = sort_by_total_instr; assert(countof(sort_names) == countof(sort_match_len)); diff --git a/src/p_acs.h b/src/p_acs.h index 6a7a8d3a1c..e3c502f7c4 100644 --- a/src/p_acs.h +++ b/src/p_acs.h @@ -361,7 +361,7 @@ private: void LoadScriptsDirectory (); - static int STACK_ARGS SortScripts (const void *a, const void *b); + static int SortScripts (const void *a, const void *b); void UnencryptStrings (); void UnescapeStringTable(BYTE *chunkstart, BYTE *datastart, bool haspadding); int FindStringInChunk (DWORD *chunk, const char *varname) const; diff --git a/src/p_effect.cpp b/src/p_effect.cpp index e5964af8be..db2724a02c 100644 --- a/src/p_effect.cpp +++ b/src/p_effect.cpp @@ -621,7 +621,7 @@ void P_DrawSplash2 (int count, const DVector3 &pos, DAngle angle, int updown, in } } -void P_DrawRailTrail(AActor *source, const DVector3 &start, const DVector3 &end, int color1, int color2, double maxdiff_d, int flags, PClassActor *spawnclass, DAngle angle, int duration, double sparsity, double drift, int SpiralOffset) +void P_DrawRailTrail(AActor *source, const DVector3 &start, TArray &portalhits, const DVector3 &end, int color1, int color2, double maxdiff_d, int flags, PClassActor *spawnclass, DAngle angle, int duration, double sparsity, double drift, int SpiralOffset) { double length, lengthsquared; int steps, i; diff --git a/src/p_effect.h b/src/p_effect.h index fad9012d02..74df5552f7 100644 --- a/src/p_effect.h +++ b/src/p_effect.h @@ -90,7 +90,14 @@ void P_RunEffects (void); void P_RunEffect (AActor *actor, int effects); -void P_DrawRailTrail(AActor *source, const DVector3 &start, const DVector3 &end, int color1, int color2, double maxdiff = 0, int flags = 0, PClassActor *spawnclass = NULL, DAngle angle = 0., int duration = 35, double sparsity = 1.0, double drift = 1.0, int SpiralOffset = 270); +struct SPortalHit +{ + DVector3 HitPos; + DVector3 ContPos; + DVector3 OutDir; +}; + +void P_DrawRailTrail(AActor *source, const DVector3 &start, TArray &portalhits, const DVector3 &end, int color1, int color2, double maxdiff = 0, int flags = 0, PClassActor *spawnclass = NULL, DAngle angle = 0., int duration = 35, double sparsity = 1.0, double drift = 1.0, int SpiralOffset = 270); void P_DrawSplash (int count, const DVector3 &pos, DAngle angle, int kind); void P_DrawSplash2 (int count, const DVector3 &pos, DAngle angle, int updown, int kind); void P_DisconnectEffect (AActor *actor); diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 2d6670b56f..49aac88c5b 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -3551,7 +3551,7 @@ static FLineSpecial LineSpecialNames[] = { #include "actionspecials.h" }; -static int STACK_ARGS lscmp (const void * a, const void * b) +static int lscmp (const void * a, const void * b) { return stricmp( ((FLineSpecial*)a)->name, ((FLineSpecial*)b)->name); } diff --git a/src/p_map.cpp b/src/p_map.cpp index a1ef28cc42..5d01f7af2e 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -4486,12 +4486,6 @@ struct SRailHit DVector3 HitPos; DAngle HitAngle; }; -struct SPortalHit -{ - DVector3 HitPos; - DVector3 ContPos; - DVector3 OutDir; -}; struct RailData { AActor *Caller; @@ -4600,11 +4594,19 @@ void P_RailAttack(FRailParams *p) AActor *puffDefaults = GetDefaultByType(puffclass->GetReplacement()); //Contains all the flags such as FOILINVUL, etc. // disabled because not complete yet. - flags = (puffDefaults->flags6 & MF6_NOTRIGGER) ? 0/*TRACE_ReportPortals*/ : TRACE_PCross | TRACE_Impact /*| TRACE_ReportPortals*/; + flags = (puffDefaults->flags6 & MF6_NOTRIGGER) ? TRACE_ReportPortals : TRACE_PCross | TRACE_Impact | TRACE_ReportPortals; rail_data.StopAtInvul = (puffDefaults->flags3 & MF3_FOILINVUL) ? false : true; rail_data.ThruSpecies = (puffDefaults->flags6 & MF6_MTHRUSPECIES) ? true : false; + + // to make things easier, push the start position and directional vector onto the PortalHits array as its first element + SPortalHit phit = { start, start, vec }; + rail_data.PortalHits.Push(phit); Trace(start, source->Sector, vec, p->distance, MF_SHOOTABLE, ML_BLOCKEVERYTHING, source, trace, flags, ProcessRailHit, &rail_data); + // and push the hit position, too, so that the array contains the entire trace with all transition points. + phit = { trace.HitPos, trace.HitPos, trace.HitVector }; + rail_data.PortalHits.Push(phit); + // Hurt anything the trace hit unsigned int i; FName damagetype = (puffDefaults == NULL || puffDefaults->DamageType == NAME_None) ? FName(NAME_Railgun) : puffDefaults->DamageType; @@ -4707,7 +4709,7 @@ void P_RailAttack(FRailParams *p) } // Draw the slug's trail. - P_DrawRailTrail(source, start, trace.HitPos, p->color1, p->color2, p->maxdiff, p->flags, p->spawnclass, angle, p->duration, p->sparsity, p->drift, p->SpiralOffset); + P_DrawRailTrail(source, start, rail_data.PortalHits, trace.HitPos, p->color1, p->color2, p->maxdiff, p->flags, p->spawnclass, angle, p->duration, p->sparsity, p->drift, p->SpiralOffset); } //========================================================================== diff --git a/src/p_states.cpp b/src/p_states.cpp index 0dea542059..2e61a78440 100644 --- a/src/p_states.cpp +++ b/src/p_states.cpp @@ -451,7 +451,7 @@ FState *FStateDefinitions::FindState(const char * name) // //========================================================================== -static int STACK_ARGS labelcmp(const void *a, const void *b) +static int labelcmp(const void *a, const void *b) { FStateLabel *A = (FStateLabel *)a; FStateLabel *B = (FStateLabel *)b; diff --git a/src/p_things.cpp b/src/p_things.cpp index 1560736a00..4afc5deaf3 100644 --- a/src/p_things.cpp +++ b/src/p_things.cpp @@ -532,7 +532,7 @@ typedef TMap SpawnMap; static SpawnMap SpawnablesFromMapinfo; static SpawnMap ConversationIDsFromMapinfo; -static int STACK_ARGS SpawnableSort(const void *a, const void *b) +static int SpawnableSort(const void *a, const void *b) { return (*((FClassMap::Pair **)a))->Key - (*((FClassMap::Pair **)b))->Key; } diff --git a/src/p_trace.cpp b/src/p_trace.cpp index 7526456e18..bc022535fc 100644 --- a/src/p_trace.cpp +++ b/src/p_trace.cpp @@ -231,7 +231,7 @@ int FTraceInfo::EnterLinePortal(line_t *li, double frac) frac += 1 / MaxDist; double enterdist = MaxDist / frac; - DVector2 enter = newtrace.Start + enterdist * Vec; + DVector3 enter = newtrace.Start + enterdist * Vec; newtrace.ActorMask = ActorMask; newtrace.WallMask = WallMask; @@ -253,6 +253,18 @@ int FTraceInfo::EnterLinePortal(line_t *li, double frac) newtrace.lastfloorportalheight = newtrace.lastceilingportalheight = newtrace.limitz; newtrace.sectorsel = 0; Results->unlinked = true; + + if ((TraceFlags & TRACE_ReportPortals) && TraceCallback != NULL) + { + Results->HitType = TRACE_CrossingPortal; + Results->HitPos = enter; + P_TranslatePortalXY(li, enter.X, enter.Y); + P_TranslatePortalZ(li, enter.Z); + Results->SrcFromTarget = enter; + Results->HitVector = newtrace.Vec; + TraceCallback(*Results, TraceCallbackData); + } + return newtrace.TraceTraverse(ActorMask ? PT_ADDLINES | PT_ADDTHINGS | PT_COMPATIBLE : PT_ADDLINES); } @@ -455,8 +467,11 @@ bool FTraceInfo::LineCheck(intercept_t *in) lastfloorportalheight = fc; if (TraceCallback != NULL) { - // Todo: calculate the intersection point. Results->HitType = TRACE_CrossingPortal; + double hitz = CurSector->SkyBoxes[sector_t::floor]->specialf1; + Results->HitPos = Start + Vec * (hitz - Start.Z) / Vec.Z; + Results->SrcFromTarget = Results->HitPos + CurSector->SkyBoxes[sector_t::floor]->Scale; + Results->HitVector = Vec; TraceCallback(*Results, TraceCallbackData); } } @@ -483,8 +498,11 @@ bool FTraceInfo::LineCheck(intercept_t *in) lastceilingportalheight = fc; if (TraceCallback != NULL) { - // Todo: calculate the intersection point. Results->HitType = TRACE_CrossingPortal; + double hitz = CurSector->SkyBoxes[sector_t::ceiling]->specialf1; + Results->HitPos = Start + Vec * (hitz - Start.Z) / Vec.Z; + Results->SrcFromTarget = Results->HitPos + CurSector->SkyBoxes[sector_t::ceiling]->Scale; + Results->HitVector = Vec; TraceCallback(*Results, TraceCallbackData); } } diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 35ad22f635..017f73cf15 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -294,7 +294,7 @@ void P_ClearUDMFKeys() } } -static int STACK_ARGS udmfcmp(const void *a, const void *b) +static int udmfcmp(const void *a, const void *b) { FUDMFKey *A = (FUDMFKey*)a; FUDMFKey *B = (FUDMFKey*)b; diff --git a/src/p_user.cpp b/src/p_user.cpp index 64c4f3a116..30a849b846 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -540,7 +540,7 @@ void PClassPlayerPawn::DeriveData(PClass *newclass) } } -static int STACK_ARGS intcmp(const void *a, const void *b) +static int intcmp(const void *a, const void *b) { return *(const int *)a - *(const int *)b; } diff --git a/src/po_man.cpp b/src/po_man.cpp index d21141c358..c025ff6c4e 100644 --- a/src/po_man.cpp +++ b/src/po_man.cpp @@ -1469,7 +1469,7 @@ static void IterFindPolySides (FPolyObj *po, side_t *side) // //========================================================================== -static int STACK_ARGS posicmp(const void *a, const void *b) +static int posicmp(const void *a, const void *b) { return (*(const side_t **)a)->linedef->args[1] - (*(const side_t **)b)->linedef->args[1]; } diff --git a/src/posix/cocoa/i_system.mm b/src/posix/cocoa/i_system.mm index 6224228ada..2e27a80028 100644 --- a/src/posix/cocoa/i_system.mm +++ b/src/posix/cocoa/i_system.mm @@ -128,7 +128,7 @@ void I_Quit() extern FILE* Logfile; bool gameisdead; -void STACK_ARGS I_FatalError(const char* const error, ...) +void I_FatalError(const char* const error, ...) { static bool alreadyThrown = false; gameisdead = true; @@ -165,7 +165,7 @@ void STACK_ARGS I_FatalError(const char* const error, ...) } } -void STACK_ARGS I_Error(const char* const error, ...) +void I_Error(const char* const error, ...) { va_list argptr; char errortext[MAX_ERRORTEXT]; diff --git a/src/posix/i_system.h b/src/posix/i_system.h index 5051b19c1b..3754d29e76 100644 --- a/src/posix/i_system.h +++ b/src/posix/i_system.h @@ -104,8 +104,8 @@ void I_Quit (void); void I_Tactile (int on, int off, int total); -void STACK_ARGS I_Error (const char *error, ...) GCCPRINTF(1,2); -void STACK_ARGS I_FatalError (const char *error, ...) GCCPRINTF(1,2); +void I_Error (const char *error, ...) GCCPRINTF(1,2); +void I_FatalError (const char *error, ...) GCCPRINTF(1,2); void addterm (void (*func)(void), const char *name); #define atterm(t) addterm (t, #t) diff --git a/src/posix/sdl/i_main.cpp b/src/posix/sdl/i_main.cpp index 54d2c27059..41497afe34 100644 --- a/src/posix/sdl/i_main.cpp +++ b/src/posix/sdl/i_main.cpp @@ -129,7 +129,7 @@ void popterm () NumTerms--; } -void STACK_ARGS call_terms () +void call_terms () { while (NumTerms > 0) { @@ -138,7 +138,7 @@ void STACK_ARGS call_terms () } } -static void STACK_ARGS NewFailure () +static void NewFailure () { I_FatalError ("Failed to allocate memory from system heap"); } diff --git a/src/posix/sdl/i_system.cpp b/src/posix/sdl/i_system.cpp index 5cf5bf280f..dcefcdbad6 100644 --- a/src/posix/sdl/i_system.cpp +++ b/src/posix/sdl/i_system.cpp @@ -179,7 +179,7 @@ bool gameisdead; void Mac_I_FatalError(const char* errortext); #endif -void STACK_ARGS I_FatalError (const char *error, ...) +void I_FatalError (const char *error, ...) { static bool alreadyThrown = false; gameisdead = true; @@ -216,7 +216,7 @@ void STACK_ARGS I_FatalError (const char *error, ...) } } -void STACK_ARGS I_Error (const char *error, ...) +void I_Error (const char *error, ...) { va_list argptr; char errortext[MAX_ERRORTEXT]; diff --git a/src/r_data/sprites.cpp b/src/r_data/sprites.cpp index 62bb4ba1c4..fbb01b24d5 100644 --- a/src/r_data/sprites.cpp +++ b/src/r_data/sprites.cpp @@ -497,7 +497,7 @@ static const char *skinsoundnames[NUMSKINSOUNDS][2] = }; /* -static int STACK_ARGS skinsorter (const void *a, const void *b) +static int skinsorter (const void *a, const void *b) { return stricmp (((FPlayerSkin *)a)->name, ((FPlayerSkin *)b)->name); } diff --git a/src/r_draw.cpp b/src/r_draw.cpp index 24a48e3b38..c12fce97a4 100644 --- a/src/r_draw.cpp +++ b/src/r_draw.cpp @@ -80,7 +80,7 @@ void (*R_DrawSpanTranslucent)(void); void (*R_DrawSpanMaskedTranslucent)(void); void (*R_DrawSpanAddClamp)(void); void (*R_DrawSpanMaskedAddClamp)(void); -void (STACK_ARGS *rt_map4cols)(int,int,int); +void (*rt_map4cols)(int,int,int); // // R_DrawColumn @@ -984,7 +984,7 @@ int dscount; #ifdef X86_ASM extern "C" void R_SetSpanSource_ASM (const BYTE *flat); -extern "C" void STACK_ARGS R_SetSpanSize_ASM (int xbits, int ybits); +extern "C" void R_SetSpanSize_ASM (int xbits, int ybits); extern "C" void R_SetSpanColormap_ASM (BYTE *colormap); extern "C" BYTE *ds_curcolormap, *ds_cursource, *ds_curtiltedsource; #endif @@ -1493,7 +1493,7 @@ extern "C" void R_SetupDrawSlabC(const BYTE *colormap) slabcolormap = colormap; } -extern "C" void STACK_ARGS R_DrawSlabC(int dx, fixed_t v, int dy, fixed_t vi, const BYTE *vptr, BYTE *p) +extern "C" void R_DrawSlabC(int dx, fixed_t v, int dy, fixed_t vi, const BYTE *vptr, BYTE *p) { int x; const BYTE *colormap = slabcolormap; @@ -1574,53 +1574,53 @@ extern "C" void STACK_ARGS R_DrawSlabC(int dx, fixed_t v, int dy, fixed_t vi, co // wallscan stuff, in C #ifndef X86_ASM -static DWORD STACK_ARGS vlinec1 (); +static DWORD vlinec1 (); static int vlinebits; -DWORD (STACK_ARGS *dovline1)() = vlinec1; -DWORD (STACK_ARGS *doprevline1)() = vlinec1; +DWORD (*dovline1)() = vlinec1; +DWORD (*doprevline1)() = vlinec1; #ifdef X64_ASM extern "C" void vlinetallasm4(); #define dovline4 vlinetallasm4 extern "C" void setupvlinetallasm (int); #else -static void STACK_ARGS vlinec4 (); -void (STACK_ARGS *dovline4)() = vlinec4; +static void vlinec4 (); +void (*dovline4)() = vlinec4; #endif -static DWORD STACK_ARGS mvlinec1(); -static void STACK_ARGS mvlinec4(); +static DWORD mvlinec1(); +static void mvlinec4(); static int mvlinebits; -DWORD (STACK_ARGS *domvline1)() = mvlinec1; -void (STACK_ARGS *domvline4)() = mvlinec4; +DWORD (*domvline1)() = mvlinec1; +void (*domvline4)() = mvlinec4; #else extern "C" { -DWORD STACK_ARGS vlineasm1 (); -DWORD STACK_ARGS prevlineasm1 (); -DWORD STACK_ARGS vlinetallasm1 (); -DWORD STACK_ARGS prevlinetallasm1 (); -void STACK_ARGS vlineasm4 (); -void STACK_ARGS vlinetallasmathlon4 (); -void STACK_ARGS vlinetallasm4 (); -void STACK_ARGS setupvlineasm (int); -void STACK_ARGS setupvlinetallasm (int); +DWORD vlineasm1 (); +DWORD prevlineasm1 (); +DWORD vlinetallasm1 (); +DWORD prevlinetallasm1 (); +void vlineasm4 (); +void vlinetallasmathlon4 (); +void vlinetallasm4 (); +void setupvlineasm (int); +void setupvlinetallasm (int); -DWORD STACK_ARGS mvlineasm1(); -void STACK_ARGS mvlineasm4(); -void STACK_ARGS setupmvlineasm (int); +DWORD mvlineasm1(); +void mvlineasm4(); +void setupmvlineasm (int); } -DWORD (STACK_ARGS *dovline1)() = vlinetallasm1; -DWORD (STACK_ARGS *doprevline1)() = prevlinetallasm1; -void (STACK_ARGS *dovline4)() = vlinetallasm4; +DWORD (*dovline1)() = vlinetallasm1; +DWORD (*doprevline1)() = prevlinetallasm1; +void (*dovline4)() = vlinetallasm4; -DWORD (STACK_ARGS *domvline1)() = mvlineasm1; -void (STACK_ARGS *domvline4)() = mvlineasm4; +DWORD (*domvline1)() = mvlineasm1; +void (*domvline4)() = mvlineasm4; #endif void setupvline (int fracbits) @@ -1660,7 +1660,7 @@ void setupvline (int fracbits) } #if !defined(X86_ASM) -DWORD STACK_ARGS vlinec1 () +DWORD vlinec1 () { DWORD fracstep = dc_iscale; DWORD frac = dc_texturefrac; @@ -1681,7 +1681,7 @@ DWORD STACK_ARGS vlinec1 () return frac; } -void STACK_ARGS vlinec4 () +void vlinec4 () { BYTE *dest = dc_dest; int count = dc_count; @@ -1711,7 +1711,7 @@ void setupmvline (int fracbits) } #if !defined(X86_ASM) -DWORD STACK_ARGS mvlinec1 () +DWORD mvlinec1 () { DWORD fracstep = dc_iscale; DWORD frac = dc_texturefrac; @@ -1736,7 +1736,7 @@ DWORD STACK_ARGS mvlinec1 () return frac; } -void STACK_ARGS mvlinec4 () +void mvlinec4 () { BYTE *dest = dc_dest; int count = dc_count; diff --git a/src/r_draw.h b/src/r_draw.h index 326ce217b2..80dc77768b 100644 --- a/src/r_draw.h +++ b/src/r_draw.h @@ -65,18 +65,18 @@ extern "C" unsigned int horizspans[4]; // Hook in assembler or system specific BLT here. extern void (*R_DrawColumn)(void); -extern DWORD (STACK_ARGS *dovline1) (); -extern DWORD (STACK_ARGS *doprevline1) (); +extern DWORD (*dovline1) (); +extern DWORD (*doprevline1) (); #ifdef X64_ASM #define dovline4 vlinetallasm4 extern "C" void vlinetallasm4(); #else -extern void (STACK_ARGS *dovline4) (); +extern void (*dovline4) (); #endif extern void setupvline (int); -extern DWORD (STACK_ARGS *domvline1) (); -extern void (STACK_ARGS *domvline4) (); +extern DWORD (*domvline1) (); +extern void (*domvline4) (); extern void setupmvline (int); extern void setuptmvline (int); @@ -123,11 +123,11 @@ void R_InitColumnDrawers (); extern "C" { void rt_copy1col_c (int hx, int sx, int yl, int yh); -void STACK_ARGS rt_copy4cols_c (int sx, int yl, int yh); +void rt_copy4cols_c (int sx, int yl, int yh); void rt_shaded1col (int hx, int sx, int yl, int yh); -void STACK_ARGS rt_shaded4cols_c (int sx, int yl, int yh); -void STACK_ARGS rt_shaded4cols_asm (int sx, int yl, int yh); +void rt_shaded4cols_c (int sx, int yl, int yh); +void rt_shaded4cols_asm (int sx, int yl, int yh); void rt_map1col_c (int hx, int sx, int yl, int yh); void rt_add1col (int hx, int sx, int yl, int yh); @@ -141,29 +141,29 @@ void rt_tlateaddclamp1col (int hx, int sx, int yl, int yh); void rt_tlatesubclamp1col (int hx, int sx, int yl, int yh); void rt_tlaterevsubclamp1col (int hx, int sx, int yl, int yh); -void STACK_ARGS rt_map4cols_c (int sx, int yl, int yh); -void STACK_ARGS rt_add4cols_c (int sx, int yl, int yh); -void STACK_ARGS rt_addclamp4cols_c (int sx, int yl, int yh); -void STACK_ARGS rt_subclamp4cols (int sx, int yl, int yh); -void STACK_ARGS rt_revsubclamp4cols (int sx, int yl, int yh); +void rt_map4cols_c (int sx, int yl, int yh); +void rt_add4cols_c (int sx, int yl, int yh); +void rt_addclamp4cols_c (int sx, int yl, int yh); +void rt_subclamp4cols (int sx, int yl, int yh); +void rt_revsubclamp4cols (int sx, int yl, int yh); -void STACK_ARGS rt_tlate4cols (int sx, int yl, int yh); -void STACK_ARGS rt_tlateadd4cols (int sx, int yl, int yh); -void STACK_ARGS rt_tlateaddclamp4cols (int sx, int yl, int yh); -void STACK_ARGS rt_tlatesubclamp4cols (int sx, int yl, int yh); -void STACK_ARGS rt_tlaterevsubclamp4cols (int sx, int yl, int yh); +void rt_tlate4cols (int sx, int yl, int yh); +void rt_tlateadd4cols (int sx, int yl, int yh); +void rt_tlateaddclamp4cols (int sx, int yl, int yh); +void rt_tlatesubclamp4cols (int sx, int yl, int yh); +void rt_tlaterevsubclamp4cols (int sx, int yl, int yh); void rt_copy1col_asm (int hx, int sx, int yl, int yh); void rt_map1col_asm (int hx, int sx, int yl, int yh); -void STACK_ARGS rt_copy4cols_asm (int sx, int yl, int yh); -void STACK_ARGS rt_map4cols_asm1 (int sx, int yl, int yh); -void STACK_ARGS rt_map4cols_asm2 (int sx, int yl, int yh); -void STACK_ARGS rt_add4cols_asm (int sx, int yl, int yh); -void STACK_ARGS rt_addclamp4cols_asm (int sx, int yl, int yh); +void rt_copy4cols_asm (int sx, int yl, int yh); +void rt_map4cols_asm1 (int sx, int yl, int yh); +void rt_map4cols_asm2 (int sx, int yl, int yh); +void rt_add4cols_asm (int sx, int yl, int yh); +void rt_addclamp4cols_asm (int sx, int yl, int yh); } -extern void (STACK_ARGS *rt_map4cols)(int sx, int yl, int yh); +extern void (*rt_map4cols)(int sx, int yl, int yh); #ifdef X86_ASM #define rt_copy1col rt_copy1col_asm @@ -231,7 +231,7 @@ void R_FillSpan (void); #endif extern "C" void R_SetupDrawSlab(const BYTE *colormap); -extern "C" void STACK_ARGS R_DrawSlab(int dx, fixed_t v, int dy, fixed_t vi, const BYTE *vptr, BYTE *p); +extern "C" void R_DrawSlab(int dx, fixed_t v, int dy, fixed_t vi, const BYTE *vptr, BYTE *p); extern "C" int ds_y; extern "C" int ds_x1; diff --git a/src/r_drawt.cpp b/src/r_drawt.cpp index 8a8405370d..b6dd12f32c 100644 --- a/src/r_drawt.cpp +++ b/src/r_drawt.cpp @@ -112,7 +112,7 @@ void rt_copy1col_c (int hx, int sx, int yl, int yh) } // Copies all four spans to the screen starting at sx. -void STACK_ARGS rt_copy4cols_c (int sx, int yl, int yh) +void rt_copy4cols_c (int sx, int yl, int yh) { int *source; int *dest; @@ -180,7 +180,7 @@ void rt_map1col_c (int hx, int sx, int yl, int yh) } // Maps all four spans to the screen starting at sx. -void STACK_ARGS rt_map4cols_c (int sx, int yl, int yh) +void rt_map4cols_c (int sx, int yl, int yh) { BYTE *colormap; BYTE *source; @@ -320,7 +320,7 @@ void rt_tlate1col (int hx, int sx, int yl, int yh) } // Translates all four spans to the screen starting at sx. -void STACK_ARGS rt_tlate4cols (int sx, int yl, int yh) +void rt_tlate4cols (int sx, int yl, int yh) { rt_Translate4cols(dc_translation, yl, yh); rt_map4cols(sx, yl, yh); @@ -361,7 +361,7 @@ void rt_add1col (int hx, int sx, int yl, int yh) } // Adds all four spans to the screen starting at sx without clamping. -void STACK_ARGS rt_add4cols_c (int sx, int yl, int yh) +void rt_add4cols_c (int sx, int yl, int yh) { BYTE *colormap; BYTE *source; @@ -424,7 +424,7 @@ void rt_tlateadd1col (int hx, int sx, int yl, int yh) } // Translates and adds all four spans to the screen starting at sx without clamping. -void STACK_ARGS rt_tlateadd4cols (int sx, int yl, int yh) +void rt_tlateadd4cols (int sx, int yl, int yh) { rt_Translate4cols(dc_translation, yl, yh); rt_add4cols(sx, yl, yh); @@ -462,7 +462,7 @@ void rt_shaded1col (int hx, int sx, int yl, int yh) } // Shades all four spans to the screen starting at sx. -void STACK_ARGS rt_shaded4cols_c (int sx, int yl, int yh) +void rt_shaded4cols_c (int sx, int yl, int yh) { DWORD *fgstart; BYTE *colormap; @@ -543,7 +543,7 @@ void rt_addclamp1col (int hx, int sx, int yl, int yh) } // Adds all four spans to the screen starting at sx with clamping. -void STACK_ARGS rt_addclamp4cols_c (int sx, int yl, int yh) +void rt_addclamp4cols_c (int sx, int yl, int yh) { BYTE *colormap; BYTE *source; @@ -614,7 +614,7 @@ void rt_tlateaddclamp1col (int hx, int sx, int yl, int yh) } // Translates and adds all four spans to the screen starting at sx with clamping. -void STACK_ARGS rt_tlateaddclamp4cols (int sx, int yl, int yh) +void rt_tlateaddclamp4cols (int sx, int yl, int yh) { rt_Translate4cols(dc_translation, yl, yh); rt_addclamp4cols(sx, yl, yh); @@ -656,7 +656,7 @@ void rt_subclamp1col (int hx, int sx, int yl, int yh) } // Subtracts all four spans to the screen starting at sx with clamping. -void STACK_ARGS rt_subclamp4cols (int sx, int yl, int yh) +void rt_subclamp4cols (int sx, int yl, int yh) { BYTE *colormap; BYTE *source; @@ -723,7 +723,7 @@ void rt_tlatesubclamp1col (int hx, int sx, int yl, int yh) } // Translates and subtracts all four spans to the screen starting at sx with clamping. -void STACK_ARGS rt_tlatesubclamp4cols (int sx, int yl, int yh) +void rt_tlatesubclamp4cols (int sx, int yl, int yh) { rt_Translate4cols(dc_translation, yl, yh); rt_subclamp4cols(sx, yl, yh); @@ -765,7 +765,7 @@ void rt_revsubclamp1col (int hx, int sx, int yl, int yh) } // Subtracts all four spans from the screen starting at sx with clamping. -void STACK_ARGS rt_revsubclamp4cols (int sx, int yl, int yh) +void rt_revsubclamp4cols (int sx, int yl, int yh) { BYTE *colormap; BYTE *source; @@ -832,7 +832,7 @@ void rt_tlaterevsubclamp1col (int hx, int sx, int yl, int yh) } // Translates and subtracts all four spans from the screen starting at sx with clamping. -void STACK_ARGS rt_tlaterevsubclamp4cols (int sx, int yl, int yh) +void rt_tlaterevsubclamp4cols (int sx, int yl, int yh) { rt_Translate4cols(dc_translation, yl, yh); rt_revsubclamp4cols(sx, yl, yh); diff --git a/src/r_main.cpp b/src/r_main.cpp index 0a8a635129..8e74527893 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -158,7 +158,7 @@ void (*spanfunc) (void); void (*hcolfunc_pre) (void); void (*hcolfunc_post1) (int hx, int sx, int yl, int yh); void (*hcolfunc_post2) (int hx, int sx, int yl, int yh); -void (STACK_ARGS *hcolfunc_post4) (int sx, int yl, int yh); +void (*hcolfunc_post4) (int sx, int yl, int yh); cycle_t WallCycles, PlaneCycles, MaskedCycles, WallScanCycles; diff --git a/src/r_main.h b/src/r_main.h index e5bd9b9442..5602439c7e 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -117,7 +117,7 @@ extern void (*spanfunc) (void); extern void (*hcolfunc_pre) (void); extern void (*hcolfunc_post1) (int hx, int sx, int yl, int yh); extern void (*hcolfunc_post2) (int hx, int sx, int yl, int yh); -extern void (STACK_ARGS *hcolfunc_post4) (int sx, int yl, int yh); +extern void (*hcolfunc_post4) (int sx, int yl, int yh); void R_InitTextureMapping (); diff --git a/src/r_plane.cpp b/src/r_plane.cpp index e24bbe0b63..087487cd51 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -148,7 +148,7 @@ static DWORD basexfrac, baseyfrac; #ifdef X86_ASM extern "C" void R_SetSpanSource_ASM (const BYTE *flat); -extern "C" void STACK_ARGS R_SetSpanSize_ASM (int xbits, int ybits); +extern "C" void R_SetSpanSize_ASM (int xbits, int ybits); extern "C" void R_SetSpanColormap_ASM (BYTE *colormap); extern "C" void R_SetTiltedSpanSource_ASM (const BYTE *flat); extern "C" BYTE *ds_curcolormap, *ds_cursource, *ds_curtiltedsource; @@ -253,7 +253,7 @@ void R_MapPlane (int y, int x1) //========================================================================== extern "C" { -void STACK_ARGS R_CalcTiltedLighting (fixed_t lval, fixed_t lend, int width) +void R_CalcTiltedLighting (fixed_t lval, fixed_t lend, int width) { fixed_t lstep; BYTE *lightfiller; diff --git a/src/r_things.cpp b/src/r_things.cpp index d2c0dcdb4e..2033423e81 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -1709,13 +1709,13 @@ static drawseg_t **drawsegsorter; static int drawsegsortersize = 0; // Sort vissprites by leftmost column, left to right -static int STACK_ARGS sv_comparex (const void *arg1, const void *arg2) +static int sv_comparex (const void *arg1, const void *arg2) { return (*(vissprite_t **)arg2)->x1 - (*(vissprite_t **)arg1)->x1; } // Sort drawsegs by rightmost column, left to right -static int STACK_ARGS sd_comparex (const void *arg1, const void *arg2) +static int sd_comparex (const void *arg1, const void *arg2) { return (*(drawseg_t **)arg2)->x2 - (*(drawseg_t **)arg1)->x2; } diff --git a/src/r_things.h b/src/r_things.h index c3b0e3fb4c..a80466d5bf 100644 --- a/src/r_things.h +++ b/src/r_things.h @@ -116,7 +116,7 @@ void R_DrawMaskedColumn (const BYTE *column, const FTexture::Span *spans); void R_WallSpriteColumn (void (*drawfunc)(const BYTE *column, const FTexture::Span *spans)); void R_CacheSprite (spritedef_t *sprite); -void R_SortVisSprites (int (STACK_ARGS *compare)(const void *, const void *), size_t first); +void R_SortVisSprites (int (*compare)(const void *, const void *), size_t first); void R_AddSprites (sector_t *sec, int lightlevel, int fakeside); void R_AddPSprites (); void R_DrawSprites (); diff --git a/src/resourcefiles/ancientzip.cpp b/src/resourcefiles/ancientzip.cpp index 2ed6bebd9f..89ae043f8a 100644 --- a/src/resourcefiles/ancientzip.cpp +++ b/src/resourcefiles/ancientzip.cpp @@ -135,7 +135,7 @@ unsigned int FZipExploder::InitTable(TArray &decoder, int numspots) return start; } -int STACK_ARGS FZipExploder::buildercmp(const void *a, const void *b) +int FZipExploder::buildercmp(const void *a, const void *b) { const TableBuilder *v1 = (const TableBuilder *)a; const TableBuilder *v2 = (const TableBuilder *)b; diff --git a/src/resourcefiles/ancientzip.h b/src/resourcefiles/ancientzip.h index 013b81b876..d51e89ca59 100644 --- a/src/resourcefiles/ancientzip.h +++ b/src/resourcefiles/ancientzip.h @@ -31,7 +31,7 @@ class FZipExploder unsigned char ReadBuf[256]; unsigned int bs, be; - static int STACK_ARGS buildercmp(const void *a, const void *b); + static int buildercmp(const void *a, const void *b); void InsertCode(TArray &decoder, unsigned int pos, int bits, unsigned short code, int len, unsigned char value); unsigned int InitTable(TArray &decoder, int numspots); int BuildDecoder(TArray &decoder, TableBuilder *values, int numvals); diff --git a/src/resourcefiles/resourcefile.cpp b/src/resourcefiles/resourcefile.cpp index d686e227ad..c66430a66a 100644 --- a/src/resourcefiles/resourcefile.cpp +++ b/src/resourcefiles/resourcefile.cpp @@ -316,7 +316,7 @@ FResourceFile::~FResourceFile() delete Reader; } -int STACK_ARGS lumpcmp(const void * a, const void * b) +int lumpcmp(const void * a, const void * b) { FResourceLump * rec1 = (FResourceLump *)a; FResourceLump * rec2 = (FResourceLump *)b; diff --git a/src/s_advsound.cpp b/src/s_advsound.cpp index 7995f2655a..6c7bb97dfc 100644 --- a/src/s_advsound.cpp +++ b/src/s_advsound.cpp @@ -199,7 +199,7 @@ extern bool IsFloat (const char *str); // PRIVATE FUNCTION PROTOTYPES --------------------------------------------- -static int STACK_ARGS SortPlayerClasses (const void *a, const void *b); +static int SortPlayerClasses (const void *a, const void *b); static int S_DupPlayerSound (const char *pclass, int gender, int refid, int aliasref); static void S_SavePlayerSound (const char *pclass, int gender, int refid, int lumpnum, bool alias); static void S_RestorePlayerSounds(); @@ -1627,7 +1627,7 @@ void S_ShrinkPlayerSoundLists () DefPlayerClass = S_FindPlayerClass (DefPlayerClassName); } -static int STACK_ARGS SortPlayerClasses (const void *a, const void *b) +static int SortPlayerClasses (const void *a, const void *b) { return stricmp (((const FPlayerClassLookup *)a)->Name, ((const FPlayerClassLookup *)b)->Name); diff --git a/src/sc_man.cpp b/src/sc_man.cpp index 50ec1214e8..dadbae0ed1 100644 --- a/src/sc_man.cpp +++ b/src/sc_man.cpp @@ -940,7 +940,7 @@ int FScanner::GetMessageLine() // //========================================================================== -void STACK_ARGS FScanner::ScriptError (const char *message, ...) +void FScanner::ScriptError (const char *message, ...) { FString composed; @@ -966,7 +966,7 @@ void STACK_ARGS FScanner::ScriptError (const char *message, ...) // //========================================================================== -void STACK_ARGS FScanner::ScriptMessage (const char *message, ...) +void FScanner::ScriptMessage (const char *message, ...) { FString composed; @@ -1038,7 +1038,7 @@ FScriptPosition &FScriptPosition::operator=(const FScriptPosition &other) // //========================================================================== -void STACK_ARGS FScriptPosition::Message (int severity, const char *message, ...) const +void FScriptPosition::Message (int severity, const char *message, ...) const { FString composed; diff --git a/src/sound/i_musicinterns.h b/src/sound/i_musicinterns.h index ead9184c87..861d94927e 100644 --- a/src/sound/i_musicinterns.h +++ b/src/sound/i_musicinterns.h @@ -386,34 +386,34 @@ protected: #ifdef DYN_FLUIDSYNTH enum { FLUID_FAILED = -1, FLUID_OK = 0 }; - fluid_settings_t *(STACK_ARGS *new_fluid_settings)(); - fluid_synth_t *(STACK_ARGS *new_fluid_synth)(fluid_settings_t *); - int (STACK_ARGS *delete_fluid_synth)(fluid_synth_t *); - void (STACK_ARGS *delete_fluid_settings)(fluid_settings_t *); - int (STACK_ARGS *fluid_settings_setnum)(fluid_settings_t *, const char *, double); - int (STACK_ARGS *fluid_settings_setstr)(fluid_settings_t *, const char *, const char *); - int (STACK_ARGS *fluid_settings_setint)(fluid_settings_t *, const char *, int); - int (STACK_ARGS *fluid_settings_getstr)(fluid_settings_t *, const char *, char **); - int (STACK_ARGS *fluid_settings_getint)(fluid_settings_t *, const char *, int *); - void (STACK_ARGS *fluid_synth_set_reverb_on)(fluid_synth_t *, int); - void (STACK_ARGS *fluid_synth_set_chorus_on)(fluid_synth_t *, int); - int (STACK_ARGS *fluid_synth_set_interp_method)(fluid_synth_t *, int, int); - int (STACK_ARGS *fluid_synth_set_polyphony)(fluid_synth_t *, int); - int (STACK_ARGS *fluid_synth_get_polyphony)(fluid_synth_t *); - int (STACK_ARGS *fluid_synth_get_active_voice_count)(fluid_synth_t *); - double (STACK_ARGS *fluid_synth_get_cpu_load)(fluid_synth_t *); - int (STACK_ARGS *fluid_synth_system_reset)(fluid_synth_t *); - int (STACK_ARGS *fluid_synth_noteon)(fluid_synth_t *, int, int, int); - int (STACK_ARGS *fluid_synth_noteoff)(fluid_synth_t *, int, int); - int (STACK_ARGS *fluid_synth_cc)(fluid_synth_t *, int, int, int); - int (STACK_ARGS *fluid_synth_program_change)(fluid_synth_t *, int, int); - int (STACK_ARGS *fluid_synth_channel_pressure)(fluid_synth_t *, int, int); - int (STACK_ARGS *fluid_synth_pitch_bend)(fluid_synth_t *, int, int); - int (STACK_ARGS *fluid_synth_write_float)(fluid_synth_t *, int, void *, int, int, void *, int, int); - int (STACK_ARGS *fluid_synth_sfload)(fluid_synth_t *, const char *, int); - void (STACK_ARGS *fluid_synth_set_reverb)(fluid_synth_t *, double, double, double, double); - void (STACK_ARGS *fluid_synth_set_chorus)(fluid_synth_t *, int, double, double, double, int); - int (STACK_ARGS *fluid_synth_sysex)(fluid_synth_t *, const char *, int, char *, int *, int *, int); + fluid_settings_t *(*new_fluid_settings)(); + fluid_synth_t *(*new_fluid_synth)(fluid_settings_t *); + int (*delete_fluid_synth)(fluid_synth_t *); + void (*delete_fluid_settings)(fluid_settings_t *); + int (*fluid_settings_setnum)(fluid_settings_t *, const char *, double); + int (*fluid_settings_setstr)(fluid_settings_t *, const char *, const char *); + int (*fluid_settings_setint)(fluid_settings_t *, const char *, int); + int (*fluid_settings_getstr)(fluid_settings_t *, const char *, char **); + int (*fluid_settings_getint)(fluid_settings_t *, const char *, int *); + void (*fluid_synth_set_reverb_on)(fluid_synth_t *, int); + void (*fluid_synth_set_chorus_on)(fluid_synth_t *, int); + int (*fluid_synth_set_interp_method)(fluid_synth_t *, int, int); + int (*fluid_synth_set_polyphony)(fluid_synth_t *, int); + int (*fluid_synth_get_polyphony)(fluid_synth_t *); + int (*fluid_synth_get_active_voice_count)(fluid_synth_t *); + double (*fluid_synth_get_cpu_load)(fluid_synth_t *); + int (*fluid_synth_system_reset)(fluid_synth_t *); + int (*fluid_synth_noteon)(fluid_synth_t *, int, int, int); + int (*fluid_synth_noteoff)(fluid_synth_t *, int, int); + int (*fluid_synth_cc)(fluid_synth_t *, int, int, int); + int (*fluid_synth_program_change)(fluid_synth_t *, int, int); + int (*fluid_synth_channel_pressure)(fluid_synth_t *, int, int); + int (*fluid_synth_pitch_bend)(fluid_synth_t *, int, int); + int (*fluid_synth_write_float)(fluid_synth_t *, int, void *, int, int, void *, int, int); + int (*fluid_synth_sfload)(fluid_synth_t *, const char *, int); + void (*fluid_synth_set_reverb)(fluid_synth_t *, double, double, double, double); + void (*fluid_synth_set_chorus)(fluid_synth_t *, int, double, double, double, int); + int (*fluid_synth_sysex)(fluid_synth_t *, const char *, int, char *, int *, int *, int); #ifdef _WIN32 HMODULE FluidSynthDLL; diff --git a/src/statistics.cpp b/src/statistics.cpp index 3676b8678f..5d14bad0a0 100644 --- a/src/statistics.cpp +++ b/src/statistics.cpp @@ -209,7 +209,7 @@ void ReadStatistics() // // ==================================================================== -int STACK_ARGS compare_episode_names(const void *a, const void *b) +int compare_episode_names(const void *a, const void *b) { FStatistics *A = (FStatistics*)a; FStatistics *B = (FStatistics*)b; @@ -217,7 +217,7 @@ int STACK_ARGS compare_episode_names(const void *a, const void *b) return strnatcasecmp(A->epi_header, B->epi_header); } -int STACK_ARGS compare_level_names(const void *a, const void *b) +int compare_level_names(const void *a, const void *b) { FLevelStatistics *A = (FLevelStatistics*)a; FLevelStatistics *B = (FLevelStatistics*)b; @@ -225,7 +225,7 @@ int STACK_ARGS compare_level_names(const void *a, const void *b) return strnatcasecmp(A->name, B->name); } -int STACK_ARGS compare_dates(const void *a, const void *b) +int compare_dates(const void *a, const void *b) { FLevelStatistics *A = (FLevelStatistics*)a; FLevelStatistics *B = (FLevelStatistics*)b; diff --git a/src/textures/anim_switches.cpp b/src/textures/anim_switches.cpp index 104bc2a405..2cde1d0c8f 100644 --- a/src/textures/anim_switches.cpp +++ b/src/textures/anim_switches.cpp @@ -46,7 +46,7 @@ #include "farchive.h" -static int STACK_ARGS SortSwitchDefs (const void *a, const void *b) +static int SortSwitchDefs (const void *a, const void *b) { return (*(FSwitchDef **)a)->PreTexture - (*(FSwitchDef **)b)->PreTexture; } diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index 16fcc9a558..55f20df034 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -557,17 +557,17 @@ PFunction *FindGlobalActionFunction(const char *name) // //========================================================================== -static int STACK_ARGS flagcmp (const void * a, const void * b) +static int flagcmp (const void * a, const void * b) { return stricmp( ((FFlagDef*)a)->name, ((FFlagDef*)b)->name); } -static int STACK_ARGS propcmp(const void * a, const void * b) +static int propcmp(const void * a, const void * b) { return stricmp( (*(FPropertyInfo**)a)->name, (*(FPropertyInfo**)b)->name); } -static int STACK_ARGS funccmp(const void * a, const void * b) +static int funccmp(const void * a, const void * b) { return stricmp( ((AFuncDesc*)a)->Name, ((AFuncDesc*)b)->Name); } diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 6cfb8aa416..0a839eb7f7 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -106,7 +106,7 @@ static int PalFromRGB(uint32 rgb) return LastPal; } -void STACK_ARGS DCanvas::DrawTexture (FTexture *img, double x, double y, int tags_first, ...) +void DCanvas::DrawTexture (FTexture *img, double x, double y, int tags_first, ...) { va_list tags; va_start(tags, tags_first); diff --git a/src/v_font.cpp b/src/v_font.cpp index 775ca38f14..052074d11e 100644 --- a/src/v_font.cpp +++ b/src/v_font.cpp @@ -134,7 +134,7 @@ protected: void LoadBMF (int lump, const BYTE *data); void CreateFontFromPic (FTextureID picnum); - static int STACK_ARGS BMFCompare(const void *a, const void *b); + static int BMFCompare(const void *a, const void *b); enum { @@ -231,7 +231,7 @@ struct TempColorInfo // PRIVATE FUNCTION PROTOTYPES --------------------------------------------- -static int STACK_ARGS TranslationMapCompare (const void *a, const void *b); +static int TranslationMapCompare (const void *a, const void *b); // EXTERNAL DATA DECLARATIONS ---------------------------------------------- @@ -594,7 +594,7 @@ void RecordTextureColors (FTexture *pic, BYTE *usedcolors) // //========================================================================== -static int STACK_ARGS compare (const void *arg1, const void *arg2) +static int compare (const void *arg1, const void *arg2) { if (RPART(GPalette.BaseColors[*((BYTE *)arg1)]) * 299 + GPART(GPalette.BaseColors[*((BYTE *)arg1)]) * 587 + @@ -1360,7 +1360,7 @@ void FSingleLumpFont::LoadBMF(int lump, const BYTE *data) // //========================================================================== -int STACK_ARGS FSingleLumpFont::BMFCompare(const void *a, const void *b) +int FSingleLumpFont::BMFCompare(const void *a, const void *b) { const PalEntry *pa = (const PalEntry *)a; const PalEntry *pb = (const PalEntry *)b; @@ -2474,7 +2474,7 @@ void V_InitFontColors () // //========================================================================== -static int STACK_ARGS TranslationMapCompare (const void *a, const void *b) +static int TranslationMapCompare (const void *a, const void *b) { return int(((const TranslationMap *)a)->Name) - int(((const TranslationMap *)b)->Name); } diff --git a/src/v_palette.cpp b/src/v_palette.cpp index fe6e622f7d..934a57dd3c 100644 --- a/src/v_palette.cpp +++ b/src/v_palette.cpp @@ -64,8 +64,8 @@ FColorMatcher ColorMatcher; /* Current color blending values */ int BlendR, BlendG, BlendB, BlendA; -static int STACK_ARGS sortforremap (const void *a, const void *b); -static int STACK_ARGS sortforremap2 (const void *a, const void *b); +static int sortforremap (const void *a, const void *b); +static int sortforremap2 (const void *a, const void *b); /**************************/ /* Gamma correction stuff */ @@ -222,7 +222,7 @@ void FPalette::MakeGoodRemap () // 256 entries are different. :-) } -static int STACK_ARGS sortforremap (const void *a, const void *b) +static int sortforremap (const void *a, const void *b) { return (*(const DWORD *)a & 0xFFFFFF) - (*(const DWORD *)b & 0xFFFFFF); } @@ -298,7 +298,7 @@ void FPalette::MakeRemap (const DWORD *colors, BYTE *remap, const BYTE *useful, } } -static int STACK_ARGS sortforremap2 (const void *a, const void *b) +static int sortforremap2 (const void *a, const void *b) { const RemappingWork *ap = (const RemappingWork *)a; const RemappingWork *bp = (const RemappingWork *)b; @@ -384,7 +384,7 @@ void InitPalette () R_InitColormaps (); } -extern "C" void STACK_ARGS DoBlending_MMX (const PalEntry *from, PalEntry *to, int count, int r, int g, int b, int a); +extern "C" void DoBlending_MMX (const PalEntry *from, PalEntry *to, int count, int r, int g, int b, int a); extern void DoBlending_SSE2 (const PalEntry *from, PalEntry *to, int count, int r, int g, int b, int a); void DoBlending (const PalEntry *from, PalEntry *to, int count, int r, int g, int b, int a) diff --git a/src/v_text.cpp b/src/v_text.cpp index b2ecb8d2c9..5772b078c0 100644 --- a/src/v_text.cpp +++ b/src/v_text.cpp @@ -52,7 +52,7 @@ // // Write a single character using the given font // -void STACK_ARGS DCanvas::DrawChar (FFont *font, int normalcolor, int x, int y, BYTE character, int tag_first, ...) +void DCanvas::DrawChar (FFont *font, int normalcolor, int x, int y, BYTE character, int tag_first, ...) { if (font == NULL) return; @@ -84,7 +84,7 @@ void STACK_ARGS DCanvas::DrawChar (FFont *font, int normalcolor, int x, int y, B // // Write a string using the given font // -void STACK_ARGS DCanvas::DrawText(FFont *font, int normalcolor, int x, int y, const char *string, int tag_first, ...) +void DCanvas::DrawText(FFont *font, int normalcolor, int x, int y, const char *string, int tag_first, ...) { int w; const BYTE *ch; diff --git a/src/v_video.h b/src/v_video.h index 3af56513cb..693bfa687c 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -246,7 +246,7 @@ public: // 2D Texture drawing bool SetTextureParms(DrawParms *parms, FTexture *img, double x, double y) const; - void STACK_ARGS DrawTexture (FTexture *img, double x, double y, int tags, ...); + void DrawTexture (FTexture *img, double x, double y, int tags, ...); void FillBorder (FTexture *img); // Fills the border around a 4:3 part of the screen on non-4:3 displays void VirtualToRealCoords(double &x, double &y, double &w, double &h, double vwidth, double vheight, bool vbottom=false, bool handleaspect=true) const; @@ -258,8 +258,8 @@ public: #undef DrawText // See WinUser.h for the definition of DrawText as a macro #endif // 2D Text drawing - void STACK_ARGS DrawText (FFont *font, int normalcolor, int x, int y, const char *string, int tag_first, ...); - void STACK_ARGS DrawChar (FFont *font, int normalcolor, int x, int y, BYTE character, int tag_first, ...); + void DrawText (FFont *font, int normalcolor, int x, int y, const char *string, int tag_first, ...); + void DrawChar (FFont *font, int normalcolor, int x, int y, BYTE character, int tag_first, ...); protected: BYTE *Buffer; diff --git a/src/win32/i_dijoy.cpp b/src/win32/i_dijoy.cpp index 04516e481a..0db93b3b49 100644 --- a/src/win32/i_dijoy.cpp +++ b/src/win32/i_dijoy.cpp @@ -227,7 +227,7 @@ protected: FDInputJoystick *EnumDevices(); static BOOL CALLBACK EnumCallback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef); - static int STACK_ARGS NameSort(const void *a, const void *b); + static int NameSort(const void *a, const void *b); static bool IsXInputDevice(const GUID *guid); static bool IsXInputDeviceFast(const GUID *guid); static bool IsXInputDeviceSlow(const GUID *guid); diff --git a/src/win32/i_main.cpp b/src/win32/i_main.cpp index 241e9dae24..7a804dd81f 100644 --- a/src/win32/i_main.cpp +++ b/src/win32/i_main.cpp @@ -199,7 +199,7 @@ void popterm () // //========================================================================== -static void STACK_ARGS call_terms (void) +static void call_terms (void) { while (NumTerms > 0) { @@ -208,7 +208,7 @@ static void STACK_ARGS call_terms (void) } #ifdef _MSC_VER -static int STACK_ARGS NewFailure (size_t size) +static int NewFailure (size_t size) { I_FatalError ("Failed to allocate %d bytes from process heap", size); return 0; diff --git a/src/win32/i_rawps2.cpp b/src/win32/i_rawps2.cpp index f75d648ad6..50de1d0f45 100644 --- a/src/win32/i_rawps2.cpp +++ b/src/win32/i_rawps2.cpp @@ -158,7 +158,7 @@ protected: void DoRegister(); FRawPS2Controller *EnumDevices(); - static int STACK_ARGS DeviceSort(const void *a, const void *b); + static int DeviceSort(const void *a, const void *b); }; // Each entry is an offset to the corresponding data field in the diff --git a/src/win32/i_system.cpp b/src/win32/i_system.cpp index 98eaf669c9..8590bface8 100644 --- a/src/win32/i_system.cpp +++ b/src/win32/i_system.cpp @@ -784,7 +784,7 @@ void I_Quit() // //========================================================================== -void STACK_ARGS I_FatalError(const char *error, ...) +void I_FatalError(const char *error, ...) { static BOOL alreadyThrown = false; gameisdead = true; @@ -824,7 +824,7 @@ void STACK_ARGS I_FatalError(const char *error, ...) // //========================================================================== -void STACK_ARGS I_Error(const char *error, ...) +void I_Error(const char *error, ...) { va_list argptr; char errortext[MAX_ERRORTEXT]; diff --git a/src/win32/i_system.h b/src/win32/i_system.h index 6bee888f2d..a7fca25a68 100644 --- a/src/win32/i_system.h +++ b/src/win32/i_system.h @@ -132,8 +132,8 @@ void I_Quit (void); void I_Tactile (int on, int off, int total); -void STACK_ARGS I_Error (const char *error, ...) GCCPRINTF(1,2); -void STACK_ARGS I_FatalError (const char *error, ...) GCCPRINTF(1,2); +void I_Error (const char *error, ...) GCCPRINTF(1,2); +void I_FatalError (const char *error, ...) GCCPRINTF(1,2); void atterm (void (*func)(void)); void popterm (); diff --git a/src/x86.cpp b/src/x86.cpp index 654ec1c8b0..f6c878da61 100644 --- a/src/x86.cpp +++ b/src/x86.cpp @@ -273,7 +273,7 @@ void DoBlending_MMX2(const PalEntry *from, PalEntry *to, int count, int r, int g #endif #ifdef X86_ASM -extern "C" void STACK_ARGS DoBlending_MMX(const PalEntry *from, PalEntry *to, int count, int r, int g, int b, int a); +extern "C" void DoBlending_MMX(const PalEntry *from, PalEntry *to, int count, int r, int g, int b, int a); #endif void DoBlending_SSE2(const PalEntry *from, PalEntry *to, int count, int r, int g, int b, int a)