[gtk-doc/wip/hadess/multilib-conflict] scangobj: Make G_MAXINT appear as such on 32-bit



commit 12f8e2014309403afc3bceabcea5e38b29fe5447
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Sep 4 09:50:15 2018 +0200

    scangobj: Make G_MAXINT appear as such on 32-bit
    
    Don't overwrite the boundaries of integer properties when they match
    both G_MAXINT and G_MAXLONG. This also fixes a memory leak in the
    generated scanobj code.
    
    Closes: #49

 gtkdoc/scangobj.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gtkdoc/scangobj.py b/gtkdoc/scangobj.py
index 237863c..73c23b0 100644
--- a/gtkdoc/scangobj.py
+++ b/gtkdoc/scangobj.py
@@ -690,10 +690,12 @@ describe_unsigned_constant (gsize size, guint64 value)
         else if (value == G_MAXUINT)
           desc = g_strdup ("G_MAXUINT");
       }
-      if (value == (guint64)G_MAXLONG)
-        desc = g_strdup ("G_MAXLONG");
-      else if (value == G_MAXULONG)
-        desc = g_strdup ("G_MAXULONG");
+      if (desc == NULL) {
+        if (value == (guint64)G_MAXLONG)
+          desc = g_strdup ("G_MAXLONG");
+        else if (value == G_MAXULONG)
+          desc = g_strdup ("G_MAXULONG");
+      }
       break;
     case 8:
       if (value == G_MAXINT64)


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