removed enum GTypeFundamentals. use macros to provide the constant
authorTim Janik <timj@gtk.org>
Sun, 25 Nov 2001 21:59:53 +0000 (21:59 +0000)
committerTim Janik <timj@src.gnome.org>
Sun, 25 Nov 2001 21:59:53 +0000 (21:59 +0000)
Sun Nov 25 22:33:32 2001  Tim Janik  <timj@gtk.org>

        * gtype.h: removed enum GTypeFundamentals. use macros
        to provide the constant fundamental type IDs, so they
        all return numbers of type GType, and not int.
        sizeof(GTypeFundamentals) < sizeof(GType) problem reported
        and fix sugegsted by Havoc.

docs/reference/glib/tmpl/windows.sgml
docs/reference/gobject/tmpl/gtype.sgml
gobject/ChangeLog
gobject/gtype.h

index 58517f3..774e442 100644 (file)
@@ -96,12 +96,12 @@ included in.
 On non-Windows platforms, expands to nothing.
 </para>
 
-@static: empty or "static". 
+@static: empty or "static".
 @dll_name: the name of the (pointer to the) char array where the DLL name 
    will be stored. If this is used, you must also include 
    <filename>windows.h</filename>. If you need a more complex DLL entry 
    point function, you cannot use this.
-
+<!-- # Unused Parameters # -->
 @static: 
 @dll_name: 
 
index 558118d..fe6ce1c 100644 (file)
@@ -187,11 +187,35 @@ The predefined identifiers of the reserved fundamental types.
 @G_TYPE_BOXED:                         Identifier for the "#GBoxed" type.
 @G_TYPE_PARAM:                         Identifier for the "#GParam" type.
 @G_TYPE_OBJECT:                Identifier for the "#GObject" type.
-@G_TYPE_RESERVED_GLIB_FIRST: 
-@G_TYPE_RESERVED_GLIB_LAST: 
 @G_TYPE_RESERVED_BSE_FIRST:    First fundamental type ID reserved for BSE.
 @G_TYPE_RESERVED_BSE_LAST:     Last fundamental type ID reserved for BSE.
-@G_TYPE_RESERVED_USER_FIRST: 
+@G_TYPE_RESERVED_LAST_FUNDAMENTAL: 
+@G_TYPE_CONSTANT_TYPES: 
+@G_TYPE_CLOSURE: 
+@G_TYPE_VALUE: 
+@G_TYPE_VALUE_ARRAY: 
+@G_TYPE_GSTRING: 
+@G_TYPE_PARAM_CHAR: 
+@G_TYPE_PARAM_UCHAR: 
+@G_TYPE_PARAM_BOOLEAN: 
+@G_TYPE_PARAM_INT: 
+@G_TYPE_PARAM_UINT: 
+@G_TYPE_PARAM_LONG: 
+@G_TYPE_PARAM_ULONG: 
+@G_TYPE_PARAM_INT64: 
+@G_TYPE_PARAM_UINT64: 
+@G_TYPE_PARAM_UNICHAR: 
+@G_TYPE_PARAM_ENUM: 
+@G_TYPE_PARAM_FLAGS: 
+@G_TYPE_PARAM_FLOAT: 
+@G_TYPE_PARAM_DOUBLE: 
+@G_TYPE_PARAM_STRING: 
+@G_TYPE_PARAM_PARAM: 
+@G_TYPE_PARAM_BOXED: 
+@G_TYPE_PARAM_POINTER: 
+@G_TYPE_PARAM_VALUE_ARRAY: 
+@G_TYPE_PARAM_CLOSURE: 
+@G_TYPE_PARAM_OBJECT: 
 
 <!-- ##### STRUCT GTypeInterface ##### -->
 <para>
index 7e8edb2..55fa4cf 100644 (file)
@@ -1,8 +1,15 @@
+Sun Nov 25 22:33:32 2001  Tim Janik  <timj@gtk.org>
+
+       * gtype.h: removed enum GTypeFundamentals. use macros
+       to provide the constant fundamental type IDs, so they
+       all return numbers of type GType, and not int.
+       sizeof(GTypeFundamentals) < sizeof(GType) problem reported
+       and fix sugegsted by Havoc.
+
 2001-11-23  Hans Breuer  <hans@breuer.org>
 
        * gobject.def : updated externals
 
-
 Mon Nov 19 14:35:56 2001  Owen Taylor  <otaylor@redhat.com>
  
        * *.h: Improve the detection of invalid includes by moving
index 3f6599c..b8701ca 100644 (file)
@@ -31,47 +31,44 @@ G_BEGIN_DECLS
  */
 #define G_TYPE_FUNDAMENTAL(type)       (g_type_fundamental (type))
 #define        G_TYPE_FUNDAMENTAL_MAX          (255 << G_TYPE_FUNDAMENTAL_SHIFT)
-#define        G_TYPE_FUNDAMENTAL_SHIFT        (2)
-
 
-/* Constant fundamental types
+/* Constant fundamental types,
+ * introduced by g_type_init().
  */
-typedef enum    /*< skip >*/
-{
-  /* standard types, introduced by g_type_init() */
-  G_TYPE_INVALID               =  0 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_NONE                  =  1 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_INTERFACE             =  2 << G_TYPE_FUNDAMENTAL_SHIFT,
-  
-  /* GLib type IDs */
-  G_TYPE_CHAR                  =  3 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_UCHAR                 =  4 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_BOOLEAN               =  5 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_INT                   =  6 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_UINT                  =  7 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_LONG                  =  8 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_ULONG                 =  9 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_INT64                 = 10 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_UINT64                        = 11 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_ENUM                  = 12 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_FLAGS                 = 13 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_FLOAT                 = 14 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_DOUBLE                        = 15 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_STRING                        = 16 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_POINTER               = 17 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_BOXED                 = 18 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_PARAM                 = 19 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_OBJECT                        = 20 << G_TYPE_FUNDAMENTAL_SHIFT,
-  
-  /* reserved fundamental type ids,
-   * mail gtk-devel-list@redhat.com for reservations
-   */
-  G_TYPE_RESERVED_GLIB_FIRST   = 21 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_RESERVED_GLIB_LAST    = 31 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_RESERVED_BSE_FIRST    = 32 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_RESERVED_BSE_LAST     = 48 << G_TYPE_FUNDAMENTAL_SHIFT,
-  G_TYPE_RESERVED_USER_FIRST   = 49 << G_TYPE_FUNDAMENTAL_SHIFT
-} GTypeFundamentals;
+#define G_TYPE_INVALID                 G_TYPE_MAKE_FUNDAMENTAL (0)
+#define G_TYPE_NONE                    G_TYPE_MAKE_FUNDAMENTAL (1)
+#define G_TYPE_INTERFACE               G_TYPE_MAKE_FUNDAMENTAL (2)
+#define G_TYPE_CHAR                    G_TYPE_MAKE_FUNDAMENTAL (3)
+#define G_TYPE_UCHAR                   G_TYPE_MAKE_FUNDAMENTAL (4)
+#define G_TYPE_BOOLEAN                 G_TYPE_MAKE_FUNDAMENTAL (5)
+#define G_TYPE_INT                     G_TYPE_MAKE_FUNDAMENTAL (6)
+#define G_TYPE_UINT                    G_TYPE_MAKE_FUNDAMENTAL (7)
+#define G_TYPE_LONG                    G_TYPE_MAKE_FUNDAMENTAL (8)
+#define G_TYPE_ULONG                   G_TYPE_MAKE_FUNDAMENTAL (9)
+#define G_TYPE_INT64                   G_TYPE_MAKE_FUNDAMENTAL (10)
+#define G_TYPE_UINT64                  G_TYPE_MAKE_FUNDAMENTAL (11)
+#define G_TYPE_ENUM                    G_TYPE_MAKE_FUNDAMENTAL (12)
+#define G_TYPE_FLAGS                   G_TYPE_MAKE_FUNDAMENTAL (13)
+#define G_TYPE_FLOAT                   G_TYPE_MAKE_FUNDAMENTAL (14)
+#define G_TYPE_DOUBLE                  G_TYPE_MAKE_FUNDAMENTAL (15)
+#define G_TYPE_STRING                  G_TYPE_MAKE_FUNDAMENTAL (16)
+#define G_TYPE_POINTER                 G_TYPE_MAKE_FUNDAMENTAL (17)
+#define G_TYPE_BOXED                   G_TYPE_MAKE_FUNDAMENTAL (18)
+#define G_TYPE_PARAM                   G_TYPE_MAKE_FUNDAMENTAL (19)
+#define G_TYPE_OBJECT                  G_TYPE_MAKE_FUNDAMENTAL (20)
+
+
+/* Reserved fundamental type numbers to create new fundamental
+ * type IDs with G_TYPE_MAKE_FUNDAMENTAL().
+ * Send email to gtk-devel-list@redhat.com for reservations.
+ */
+#define        G_TYPE_FUNDAMENTAL_SHIFT        (2)
+#define        G_TYPE_MAKE_FUNDAMENTAL(x)      ((GType) ((x) << G_TYPE_FUNDAMENTAL_SHIFT))
+#define G_TYPE_RESERVED_GLIB_FIRST     (21)
+#define G_TYPE_RESERVED_GLIB_LAST      (31)
+#define G_TYPE_RESERVED_BSE_FIRST      (32)
+#define G_TYPE_RESERVED_BSE_LAST       (48)
+#define G_TYPE_RESERVED_USER_FIRST     (49)
 
 
 /* Type Checking Macros