Add the fixed width C99 types from stdint.h
authorNeil Roberts <neil@linux.intel.com>
Wed, 25 Apr 2012 13:20:09 +0000 (14:20 +0100)
committerNeil Roberts <neil@linux.intel.com>
Wed, 2 May 2012 13:37:57 +0000 (14:37 +0100)
C99 has standard types for fixed width signed and unsigned integers.
This adds types to giscanner to map them to the glib equivalent types.

stdint.h also has other types to specify specify sizes with at least a
certain number of bits, the fastest type with at least some number of
bits, a type big enough to store a pointer and a type containing the
most number of bits. These don't map well to glib types so I have
ignored them.

https://bugzilla.gnome.org/show_bug.cgi?id=674796

giscanner/ast.py

index a78a9f1d8537536597c7fa646efabe5e8037e5f8..cab38070b25617ea25f5fb942e28c56b2fcc5da4 100644 (file)
@@ -265,6 +265,15 @@ type_names['void*'] = TYPE_ANY
 type_names['void'] = TYPE_NONE
 # Also alias the signed one here
 type_names['signed long long'] = TYPE_LONG_LONG
+# C99 stdint exact width types
+type_names['int8_t'] = TYPE_INT8
+type_names['uint8_t'] = TYPE_UINT8
+type_names['int16_t'] = TYPE_INT16
+type_names['uint16_t'] = TYPE_UINT16
+type_names['int32_t'] = TYPE_INT32
+type_names['uint32_t'] = TYPE_UINT32
+type_names['int64_t'] = TYPE_INT64
+type_names['uint64_t'] = TYPE_UINT64
 
 # A few additional GLib type aliases
 type_names['guchar'] = TYPE_UINT8