MCPcopy Create free account
hub / github.com/defold/defold / GetBaseInt

Function GetBaseInt

engine/dlib/src/dlib/configfile.cpp:118–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118static int32_t GetBaseInt(HConfigFile config, const char* key, int32_t default_value)
119{
120 const char* tmp = GetBaseString(config, key, 0);
121 if (tmp == 0)
122 return default_value;
123 int l = strlen(tmp);
124 char* end = 0;
125 int32_t ret = strtol(tmp, &end, 10);
126 if (end != (tmp + l) || end == tmp)
127 {
128 dmLogWarning("Unable to convert '%s' to int", tmp);
129 return default_value;
130 }
131 return ret;
132}
133
134static bool GetIntOverride(HConfigFile config, const char* key, int32_t default_value, int32_t* out_value)
135{

Callers 1

ConfigFileGetIntFunction · 0.85

Calls 1

GetBaseStringFunction · 0.85

Tested by

no test coverage detected