[retro-gtk] environment: Sanitize booleans



commit a1aea16eb7ffccee067e2311ad4f61459fb3f651
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Mon Jul 26 12:54:13 2021 +0200

    environment: Sanitize booleans
    
    This ensures we return 0 or 1 for booleans.

 retro-runner/retro-environment.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/retro-runner/retro-environment.c b/retro-runner/retro-environment.c
index 732cc7f..4ad19d5 100644
--- a/retro-runner/retro-environment.c
+++ b/retro-runner/retro-environment.c
@@ -329,7 +329,7 @@ static gboolean
 get_overscan (RetroCore *self,
               bool      *overscan)
 {
-  *overscan = self->overscan;
+  *overscan = !!self->overscan;
 
   retro_debug ("Get overscan: %s", TRUENESS (*overscan));
 
@@ -409,7 +409,7 @@ static gboolean
 get_variable_update (RetroCore *self,
                      bool      *update)
 {
-  *update = retro_core_get_variable_update (self);
+  *update = !!retro_core_get_variable_update (self);
 
   /* We purposefully don't log when no variable update is detected because it's
    * not very useful to debug and it would print on every iteration, causing


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]