From f30c60c3d7cfc2dbaca7e1ba0abf953b9c3caa63 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Sun, 9 Feb 2014 19:07:15 +0000 Subject: GuVariant is now plain uintptr_t instead of a structure to make it easier to write Haskell bindings --- src/runtime/c/gu/variant.h | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/runtime/c/gu/variant.h') diff --git a/src/runtime/c/gu/variant.h b/src/runtime/c/gu/variant.h index 91665279d..bc9f45315 100644 --- a/src/runtime/c/gu/variant.h +++ b/src/runtime/c/gu/variant.h @@ -33,7 +33,7 @@ * @{ */ -typedef struct GuVariant GuVariant; +typedef uintptr_t GuVariant; void* gu_alloc_variant(uint8_t tag, @@ -84,32 +84,25 @@ struct GuVariantInfo { GuVariantInfo gu_variant_open(GuVariant variant); GuVariant gu_variant_close(GuVariantInfo info); -/** @privatesection */ -struct GuVariant { - uintptr_t p; - /**< @private */ -}; - /** @} */ static inline void* gu_variant_to_ptr(GuVariant variant) { - return (void*)variant.p; + return (void*) variant; } static inline GuVariant gu_variant_from_ptr(const void* p) { - GuVariant v = { (uintptr_t)p }; - return v; + return (uintptr_t) p; } extern const GuVariant gu_null_variant; static inline bool gu_variant_is_null(GuVariant v) { - return ((void*)v.p == NULL); + return ((void*)v == NULL); } -- cgit v1.2.3