Skip to content

Commit

Permalink
got rid of strlwr.
Browse files Browse the repository at this point in the history
The 3 remaining uses were completely redundant.
  • Loading branch information
coelckers committed Nov 2, 2024
1 parent 6fc2567 commit a899571
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 24 deletions.
11 changes: 0 additions & 11 deletions src/common/platform/posix/i_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,6 @@ bool I_WriteIniFailed (const char* filename);
class FGameTexture;
bool I_SetCursor(FGameTexture *);

static inline char *strlwr(char *str)
{
char *ptr = str;
while(*ptr)
{
*ptr = tolower(*ptr);
++ptr;
}
return str;
}

inline int I_GetNumaNodeCount() { return 1; }
inline int I_GetNumaNodeThreadCount(int numaNode) { return std::max<int>(std::thread::hardware_concurrency(), 1); }
inline void I_SetThreadNumaNode(std::thread &thread, int numaNode) { }
Expand Down
6 changes: 0 additions & 6 deletions src/scripting/decorate/thingdef_parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
#include "v_text.h"
#include "m_argv.h"
#include "v_video.h"
#ifndef _MSC_VER
#include "i_system.h" // for strlwr()
#endif // !_MSC_VER

void ParseOldDecoration(FScanner &sc, EDefinitionType def, PNamespace *ns);
EXTERN_CVAR(Bool, strictdecorate);
Expand Down Expand Up @@ -945,15 +942,12 @@ static void ParseActorProperty(FScanner &sc, Baggage &bag)
"Spawn", "See", "Melee", "Missile", "Pain", "Death", "XDeath", "Burn",
"Ice", "Raise", "Crash", "Crush", "Wound", "Disintegrate", "Heal", NULL };

strlwr (sc.String);

FString propname = sc.String;

if (sc.CheckString ("."))
{
sc.MustGetString ();
propname += '.';
strlwr (sc.String);
propname += sc.String;
}
else
Expand Down
8 changes: 1 addition & 7 deletions src/scripting/decorate/thingdef_states.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
#include "thingdef.h"
#include "codegen.h"
#include "backend/codegen_doom.h"
#ifndef _MSC_VER
#include "i_system.h" // for strlwr()
#endif // !_MSC_VER

//==========================================================================
//***
Expand Down Expand Up @@ -562,11 +559,8 @@ FxExpression *ParseActions(FScanner &sc, FState state, FString statestring, Bagg

FxExpression* ParseAction(FScanner &sc, FState state, FString statestring, Baggage &bag)
{
// Make the action name lowercase
strlwr (sc.String);

FxExpression *call = DoActionSpecials(sc, state, bag);
if (call != NULL)
if (call != nullptr)
{
return call;
}
Expand Down

0 comments on commit a899571

Please sign in to comment.