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

Function consoleStringToNumber

Engine/source/console/compiledEval.cpp:284–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282//------------------------------------------------------------
283
284F64 consoleStringToNumber(const char *str, StringTableEntry file, U32 line)
285{
286 F64 val = dAtof(str);
287 if (val != 0)
288 return val;
289 else if (!dStricmp(str, "true"))
290 return 1;
291 else if (!dStricmp(str, "false"))
292 return 0;
293 else if (file)
294 {
295 Con::warnf(ConsoleLogEntry::General, "%s (%d): string always evaluates to 0.", file, line);
296 return 0;
297 }
298 return 0;
299}
300
301//------------------------------------------------------------
302

Callers

nothing calls this directly

Calls 3

dAtofFunction · 0.85
dStricmpFunction · 0.85
warnfFunction · 0.70

Tested by

no test coverage detected