[gegl] Bug 655280 - Devel docs badly formatted display +inf or -inf if the default value is more than 7 dig



commit 1cec6e9df81b5fd1d2bd7a184fbfabb4d68518fc
Author: Michael Murà <batolettre gmail com>
Date:   Thu Sep 1 23:56:07 2011 +0200

    Bug 655280 - Devel docs badly formatted
    display +inf or -inf if the default value is more than 7 digits

 tools/operation_reference.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/tools/operation_reference.c b/tools/operation_reference.c
index b7f7998..d720bcc 100644
--- a/tools/operation_reference.c
+++ b/tools/operation_reference.c
@@ -102,12 +102,17 @@ list_properties (GType    type,
 
           if (g_type_is_a (G_PARAM_SPEC_VALUE_TYPE (self[prop_no]), G_TYPE_DOUBLE))
             {
-
-            g_print ("%2.2f", G_PARAM_SPEC_DOUBLE (self[prop_no])->default_value);
-
-            {
+            gdouble default_value = G_PARAM_SPEC_DOUBLE (self[prop_no])->default_value;
             gdouble min = G_PARAM_SPEC_DOUBLE (self[prop_no])->minimum;
             gdouble max = G_PARAM_SPEC_DOUBLE (self[prop_no])->maximum;
+
+            if (default_value<-10000000)
+              g_print ("-inf ");
+            else if (default_value>10000000)
+              g_print ("+inf");
+            else
+              g_print ("%2.2f", default_value);
+
             g_print ("<br/>");
             if (min<-10000000)
               g_print ("-inf ");
@@ -120,7 +125,6 @@ list_properties (GType    type,
               g_print (" +inf");
             else
               g_print ("%2.2f", max);
-            }
 
             }
           else if (g_type_is_a (G_PARAM_SPEC_VALUE_TYPE (self[prop_no]), G_TYPE_INT))



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