mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-08 11:19:17 +02:00
[script] do abs(x) > epsilon instead of x != 0
Fixes a compiler warning.
This commit is contained in:
parent
10b68cecef
commit
0b67fbbdce
1 changed files with 2 additions and 1 deletions
|
|
@ -31,6 +31,7 @@
|
|||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include <math.h>
|
||||
#include <values.h>
|
||||
|
||||
#include "script.h"
|
||||
#include "script-object.h"
|
||||
|
|
@ -285,7 +286,7 @@ bool script_obj_as_bool (script_obj_t *obj)
|
|||
return false;
|
||||
|
||||
case SCRIPT_OBJ_TYPE_FLOAT:
|
||||
if (obj->data.floatpoint) return true;
|
||||
if (fabs (obj->data.floatpoint) > FLT_MIN) return true;
|
||||
return false;
|
||||
|
||||
case SCRIPT_OBJ_TYPE_NULL:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue