MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / consoleStringToNumber

Function consoleStringToNumber

Engine/source/console/compiler.cpp:49–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47{
48
49 F64 consoleStringToNumber(const char *str, StringTableEntry file, U32 line)
50 {
51 F64 val = dAtof(str);
52 if (val != 0)
53 return val;
54 else if (!dStricmp(str, "true"))
55 return 1;
56 else if (!dStricmp(str, "false"))
57 return 0;
58 else if (file)
59 {
60 Con::warnf(ConsoleLogEntry::General, "%s (%d): string always evaluates to 0.", file, line);
61 return 0;
62 }
63 return 0;
64 }
65
66 //------------------------------------------------------------
67

Callers 1

compileMethod · 0.70

Calls 3

dAtofFunction · 0.85
dStricmpFunction · 0.85
warnfFunction · 0.70

Tested by

no test coverage detected