mirror of
https://github.com/synthetos/g2.git
synced 2026-09-24 14:13:49 +08:00
Provide set/get_boolean conveience functions
This commit is contained in:
@@ -452,6 +452,9 @@ stat_t get_float(nvObj_t *nv, const float value); // boilerplate for retrievin
|
||||
stat_t set_float(nvObj_t *nv, float &value); // boilerplate for setting a floating point value w/conversion
|
||||
stat_t set_float_range(nvObj_t *nv, float &value, float low, float high);
|
||||
|
||||
stat_t get_boolean(nvObj_t *nv, const bool value); // boilerplate for retrieving 1 bit integer value
|
||||
stat_t set_boolean(nvObj_t *nv, bool &value); // boilerplate for retrieving 1 bit integer value
|
||||
|
||||
stat_t get_integer(nvObj_t *nv, const int32_t value); // boilerplate for retrieving 8 bit integer value
|
||||
stat_t set_integer(nvObj_t *nv, uint8_t &value, uint8_t low, uint8_t high);
|
||||
stat_t set_int32(nvObj_t *nv, int32_t &value, int32_t low, int32_t high);
|
||||
|
||||
@@ -2041,6 +2041,19 @@ static stat_t _set_int_tests(nvObj_t *nv, int32_t low, int32_t high)
|
||||
return (STAT_OK);
|
||||
}
|
||||
|
||||
stat_t get_boolean(nvObj_t *nv, const bool value)
|
||||
{
|
||||
nv->value_int = value;
|
||||
nv->valuetype = TYPE_BOOLEAN;
|
||||
return STAT_OK;
|
||||
}
|
||||
stat_t set_boolean(nvObj_t *nv, bool &value)
|
||||
{
|
||||
value = !!nv->value_int;
|
||||
nv->valuetype = TYPE_BOOLEAN;
|
||||
return STAT_OK;
|
||||
}
|
||||
|
||||
stat_t get_integer(nvObj_t *nv, const int32_t value)
|
||||
{
|
||||
nv->value_int = value;
|
||||
|
||||
Reference in New Issue
Block a user