[gimp] plug-ins: and in ifs-compose too...



commit a47789fcb80095f4b18b99f607176c36a94d860b
Author: Michael Natterer <mitch gimp org>
Date:   Tue Jul 30 18:37:05 2019 +0200

    plug-ins: and in ifs-compose too...

 plug-ins/ifs-compose/ifs-compose-storage.c | 36 +++++++++++++++++++++---------
 1 file changed, 25 insertions(+), 11 deletions(-)
---
diff --git a/plug-ins/ifs-compose/ifs-compose-storage.c b/plug-ins/ifs-compose/ifs-compose-storage.c
index ce1e5671ea..24705be982 100644
--- a/plug-ins/ifs-compose/ifs-compose-storage.c
+++ b/plug-ins/ifs-compose/ifs-compose-storage.c
@@ -99,31 +99,37 @@ ifsvals_parse_color (GScanner *scanner,
     return G_TOKEN_LEFT_CURLY;
 
   token = g_scanner_get_next_token (scanner);
-  if (token != G_TOKEN_FLOAT)
+  if (token == G_TOKEN_FLOAT)
+    result->r = scanner->value.v_float;
+  else if (token == G_TOKEN_INT)
+    result->r = scanner->value.v_int;
+  else
     return G_TOKEN_FLOAT;
 
-  result->r = scanner->value.v_float;
-
   token = g_scanner_get_next_token (scanner);
   if (token != G_TOKEN_COMMA)
     return G_TOKEN_COMMA;
 
   token = g_scanner_get_next_token (scanner);
-  if (token != G_TOKEN_FLOAT)
+  if (token == G_TOKEN_FLOAT)
+    result->g = scanner->value.v_float;
+  else if (token == G_TOKEN_INT)
+    result->g = scanner->value.v_int;
+  else
     return G_TOKEN_FLOAT;
 
-  result->g = scanner->value.v_float;
-
   token = g_scanner_get_next_token (scanner);
   if (token != G_TOKEN_COMMA)
     return G_TOKEN_COMMA;
 
   token = g_scanner_get_next_token (scanner);
-  if (token != G_TOKEN_FLOAT)
+  if (token == G_TOKEN_FLOAT)
+    result->b = scanner->value.v_float;
+  else if (token == G_TOKEN_INT)
+    result->b = scanner->value.v_int;
+  else
     return G_TOKEN_FLOAT;
 
-  result->b = scanner->value.v_float;
-
   token = g_scanner_get_next_token (scanner);
   if (token != G_TOKEN_RIGHT_CURLY)
     return G_TOKEN_RIGHT_CURLY;
@@ -153,6 +159,11 @@ parse_genuine_float (GScanner *scanner,
       *result = negate ? -scanner->value.v_float : scanner->value.v_float;
       return G_TOKEN_NONE;
     }
+  else if (token == G_TOKEN_INT)
+    {
+      *result = negate ? -scanner->value.v_int : scanner->value.v_int;
+      return G_TOKEN_NONE;
+    }
   else
     return G_TOKEN_FLOAT;
 }
@@ -269,10 +280,13 @@ ifsvals_parse_element (GScanner       *scanner,
 
        case TOKEN_PROB:
          token = g_scanner_get_next_token (scanner);
-         if (token != G_TOKEN_FLOAT)
+         if (token == G_TOKEN_FLOAT)
+            result->prob = scanner->value.v_float;
+          else if (token == G_TOKEN_INT)
+            result->prob = scanner->value.v_int;
+          else
            return G_TOKEN_FLOAT;
 
-         result->prob = scanner->value.v_float;
          break;
 
        default:


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