The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

u/debug: Export debug_to_num function

authored by

Mateo de Mayo and committed by
Jakob Bornecrantz
a93dc650 84ccf3a7

+21 -12
+18 -12
src/xrt/auxiliary/util/u_debug.c
··· 152 152 } 153 153 154 154 long 155 - debug_get_num_option(const char *name, long _default) 155 + debug_string_to_num(const char *raw, long _default) 156 156 { 157 - const char *raw = os_getenv(name); 158 - long ret; 159 - 160 157 if (raw == NULL) { 161 - ret = _default; 162 - } else { 163 - char *endptr; 158 + return _default; 159 + } 164 160 165 - ret = strtol(raw, &endptr, 0); 166 - // Restore the default value when no digits were found. 167 - if (raw == endptr) { 168 - ret = _default; 169 - } 161 + char *endptr; 162 + long ret = strtol(raw, &endptr, 0); 163 + 164 + // Restore the default value when no digits were found. 165 + if (raw == endptr) { 166 + ret = _default; 170 167 } 168 + 169 + return ret; 170 + } 171 + 172 + long 173 + debug_get_num_option(const char *name, long _default) 174 + { 175 + const char *raw = os_getenv(name); 176 + long ret = debug_string_to_num(raw, _default); 171 177 172 178 if (debug_get_bool_option_print()) { 173 179 U_LOG_RAW("%s=%li (%s)", name, ret, raw == NULL ? "nil" : raw);
+3
src/xrt/auxiliary/util/u_debug.h
··· 39 39 debug_get_bool_option(const char *name, bool _default); 40 40 41 41 long 42 + debug_string_to_num(const char *string, long _default); 43 + 44 + long 42 45 debug_get_num_option(const char *name, long _default); 43 46 44 47 float