mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-03-04 15:51:00 +00:00
[common] option: return NAN when float option doesn't exist
false is not a float value.
This commit is contained in:
parent
5225d2e97f
commit
0c27111260
1 changed files with 2 additions and 1 deletions
|
@ -23,6 +23,7 @@
|
||||||
#include "common/stringutils.h"
|
#include "common/stringutils.h"
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <math.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -799,7 +800,7 @@ float option_get_float(const char * module, const char * name)
|
||||||
if (!o)
|
if (!o)
|
||||||
{
|
{
|
||||||
DEBUG_ERROR("BUG: Failed to get the value for option %s:%s", module, name);
|
DEBUG_ERROR("BUG: Failed to get the value for option %s:%s", module, name);
|
||||||
return false;
|
return NAN;
|
||||||
}
|
}
|
||||||
DEBUG_ASSERT(o->type == OPTION_TYPE_FLOAT);
|
DEBUG_ASSERT(o->type == OPTION_TYPE_FLOAT);
|
||||||
return o->value.x_float;
|
return o->value.x_float;
|
||||||
|
|
Loading…
Add table
Reference in a new issue