[glib: 1/2] gtypes: add g-i annotations for G_MININT macros. Fixes #1673



commit 0cf55f4fd9a97d4c0ad5ad2094ea74184f2d61c9
Author: Christoph Reiter <creiter src gnome org>
Date:   Fri Feb 1 15:04:57 2019 +0100

    gtypes: add g-i annotations for G_MININT macros. Fixes #1673
    
    They were changed in 6a2cfde2 to reuse the G_MAXINT values but
    parsing nexted macros is currently broken in g-i and results in wrong
    values.
    
    Add value annotations for g-i to override the values.
    
    This also moves the annotations to the macro definitions to have
    everything g-i uses in one place.

 glib/docs.c   | 30 ------------------------------
 glib/gtypes.h | 26 ++++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 30 deletions(-)
---
diff --git a/glib/docs.c b/glib/docs.c
index 93decb109..9a722b8cd 100644
--- a/glib/docs.c
+++ b/glib/docs.c
@@ -208,14 +208,6 @@
  * #G_MAXINT8 (= 127).
  */
 
-/**
- * G_MININT8:
- *
- * The minimum value which can be held in a #gint8.
- *
- * Since: 2.4
- */
-
 /**
  * G_MAXINT8:
  *
@@ -250,14 +242,6 @@
  * %G_GINT16_MODIFIER and/or %G_GINT16_FORMAT.
  */
 
-/**
- * G_MININT16:
- *
- * The minimum value which can be held in a #gint16.
- *
- * Since: 2.4
- */
-
 /**
  * G_MAXINT16:
  *
@@ -337,14 +321,6 @@
  * %G_GINT32_MODIFIER and/or %G_GINT32_FORMAT.
  */
 
-/**
- * G_MININT32:
- *
- * The minimum value which can be held in a #gint32.
- *
- * Since: 2.4
- */
-
 /**
  * G_MAXINT32:
  *
@@ -407,12 +383,6 @@
  * %G_GINT64_MODIFIER and/or %G_GINT64_FORMAT.
  */
 
-/**
- * G_MININT64:
- *
- * The minimum value which can be held in a #gint64.
- */
-
 /**
  * G_MAXINT64:
  *
diff --git a/glib/gtypes.h b/glib/gtypes.h
index f5b369dc5..3eba019be 100644
--- a/glib/gtypes.h
+++ b/glib/gtypes.h
@@ -58,18 +58,44 @@ typedef float   gfloat;
 typedef double  gdouble;
 
 /* Define min and max constants for the fixed size numerical types */
+/**
+ * G_MININT8: (value -128)
+ *
+ * The minimum value which can be held in a #gint8.
+ *
+ * Since: 2.4
+ */
 #define G_MININT8      ((gint8) (-G_MAXINT8 - 1))
 #define G_MAXINT8      ((gint8)  0x7f)
 #define G_MAXUINT8     ((guint8) 0xff)
 
+/**
+ * G_MININT16: (value -32768)
+ *
+ * The minimum value which can be held in a #gint16.
+ *
+ * Since: 2.4
+ */
 #define G_MININT16     ((gint16) (-G_MAXINT16 - 1))
 #define G_MAXINT16     ((gint16)  0x7fff)
 #define G_MAXUINT16    ((guint16) 0xffff)
 
+/**
+ * G_MININT32: (value -2147483648)
+ *
+ * The minimum value which can be held in a #gint32.
+ *
+ * Since: 2.4
+ */
 #define G_MININT32     ((gint32) (-G_MAXINT32 - 1))
 #define G_MAXINT32     ((gint32)  0x7fffffff)
 #define G_MAXUINT32    ((guint32) 0xffffffff)
 
+/**
+ * G_MININT64: (value -9223372036854775808)
+ *
+ * The minimum value which can be held in a #gint64.
+ */
 #define G_MININT64     ((gint64) (-G_MAXINT64 - G_GINT64_CONSTANT(1)))
 #define G_MAXINT64     G_GINT64_CONSTANT(0x7fffffffffffffff)
 #define G_MAXUINT64    G_GUINT64_CONSTANT(0xffffffffffffffff)


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