Changeset: b0039c01e859 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b0039c01e859
Modified Files:
        gdk/gdk.h
Branch: default
Log Message:

Slight rearrangement of typedefs.


diffs (149 lines):

diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -173,16 +173,66 @@
 typedef enum gdk_return { GDK_FAIL, GDK_SUCCEED } gdk_return;
 
 /* basic GDK types */
-typedef bool msk;
-typedef int8_t bit;
-typedef int8_t bte;
-typedef int16_t sht;
-typedef int64_t lng;
-typedef uint64_t ulng;
+typedef bool msk;              /* one bit Boolean */
+typedef int8_t bit;            /* three-value Boolean (8 bits) */
+typedef int8_t bte;            /* 8 bit signed integer */
+typedef int16_t sht;           /* 16 bit signed integer */
+/* standard type int is used for 32 bit signed integer */
+typedef int64_t lng;           /* 64 bit signed integer */
+typedef uint64_t ulng;         /* 64 bit unsigned integer */
 #ifdef HAVE_HGE
-typedef int128_t hge;
-typedef uint128_t uhge;
+typedef int128_t hge;          /* 128 bit signed integer */
+typedef uint128_t uhge;                /* 128 bit unsigned integer */
 #endif
+typedef int bat;               /* Index into BBP */
+typedef void *ptr;             /* generic pointer */
+typedef float flt;             /* 32 bit floating point */
+typedef double dbl;            /* 64 bit floating point */
+typedef char *str;             /* null terminated UTF-8 string */
+typedef size_t oid;            /* object identifier */
+typedef oid var_t;             /* type used for heap index of var-sized BAT */
+typedef oid BUN;               /* BUN position */
+
+/* The types `oid`, `BUN` and `var_t` are all defined as `size_t`, but
+ * they serve different purposes.  `oid` is the *logical* row number of
+ * a BAT; `BUN` is the *physical* row number of a BAT and is therefore
+ * also used for the total number of rows and the potential capacity of
+ * a BAT; `var_t` is an *offset* into the var-size heap (vheap).  The
+ * difference between the *logical* and *physical* row number is the
+ * value of the head sequence base (`hseqbase`) of the BAT. */
+
+typedef union {
+       uint32_t align;         /* force alignment, only used for equality */
+       uint8_t quad[4] __attribute__((__nonstring__));
+} inet4;                       /* IPv4 internet address */
+
+typedef union {
+#ifdef HAVE_HGE
+       uint128_t align;        /* force alignment, only used for equality */
+#else
+       uint64_t align[2];      /* force alignment, not otherwise used */
+#endif
+       uint8_t hex[16] __attribute__((__nonstring__));
+} inet6;                       /* IPv6 internet address */
+
+#define UUID_SIZE      16      /* size of a UUID */
+#define UUID_STRLEN    36      /* length of string representation */
+
+typedef union {
+#ifdef HAVE_HGE
+       uint128_t h;            /* force alignment, only used for equality */
+#else
+       uint64_t l[2];          /* force alignment, not otherwise used */
+#endif
+       uint8_t u[UUID_SIZE] __attribute__((__nonstring__));
+} uuid;
+
+typedef struct {
+       size_t nitems;
+       uint8_t data[] __attribute__((__nonstring__))
+               __attribute__((__counted_by__(nitems)));
+} blob;
+gdk_export size_t blobsize(size_t nitems) __attribute__((__const__));
 
 #define SIZEOF_LNG             8
 #define LL_CONSTANT(val)       INT64_C(val)
@@ -202,61 +252,12 @@ typedef uint128_t uhge;
 #endif
 
 #define SIZEOF_OID     SIZEOF_SIZE_T
-typedef size_t oid;
 /* macro in the style of <inttypes.h> for formatting oid */
 #define PRIuOID                "zu"
 #define OIDFMT         "%" PRIuOID
 
-typedef int bat;               /* Index into BBP */
-typedef void *ptr;             /* Internal coding of types */
-
 #define SIZEOF_PTR     SIZEOF_VOID_P
-typedef float flt;
-typedef double dbl;
-typedef char *str;
-
-typedef union {
-       uint32_t align;         /* force alignment, only used for equality */
-       uint8_t quad[4] __attribute__((__nonstring__));
-} inet4;
-
-typedef union {
-#ifdef HAVE_HGE
-       uint128_t align;        /* force alignment, only used for equality */
-#else
-       uint64_t align[2];      /* force alignment, not otherwise used */
-#endif
-       uint8_t hex[16] __attribute__((__nonstring__));
-} inet6;
-
-#define UUID_SIZE      16      /* size of a UUID */
-#define UUID_STRLEN    36      /* length of string representation */
-
-typedef union {
-#ifdef HAVE_HGE
-       uint128_t h;            /* force alignment, only used for equality */
-#else
-       uint64_t l[2];          /* force alignment, not otherwise used */
-#endif
-       uint8_t u[UUID_SIZE] __attribute__((__nonstring__));
-} uuid;
-
-typedef struct {
-       size_t nitems;
-       uint8_t data[] __attribute__((__nonstring__))
-               __attribute__((__counted_by__(nitems)));
-} blob;
-gdk_export size_t blobsize(size_t nitems) __attribute__((__const__));
-
-/* The types `oid`, `BUN` and `var_t` are all defined as `size_t`, but
- * they serve different purposes.  `oid` is the *logical* row number of
- * a BAT; `BUN` is the *physical* row number of a BAT and is therefore
- * also used for the total number of rows and the potential capacity of
- * a BAT; `var_t` is an *offset* into the var-size heap (vheap).  The
- * difference between the *logical* and *physical* row number is the
- * value of the head sequence base (`hseqbase`) of the BAT. */
-
-typedef oid var_t;             /* type used for heap index of var-sized BAT */
+
 #define SIZEOF_VAR_T   SIZEOF_OID
 #define VARFMT         OIDFMT
 
@@ -266,7 +267,6 @@ typedef oid var_t;          /* type used for hea
 #define VAR_MAX                ((var_t) INT64_MAX)
 #endif
 
-typedef oid BUN;               /* BUN position */
 #define SIZEOF_BUN     SIZEOF_OID
 #define PRIuBUN                PRIuOID
 #define BUNFMT         OIDFMT
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to