aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xquartz/xpr/x-hash.h
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xquartz/xpr/x-hash.h')
-rw-r--r--xorg-server/hw/xquartz/xpr/x-hash.h64
1 files changed, 30 insertions, 34 deletions
diff --git a/xorg-server/hw/xquartz/xpr/x-hash.h b/xorg-server/hw/xquartz/xpr/x-hash.h
index f876b6b71..c4543346a 100644
--- a/xorg-server/hw/xquartz/xpr/x-hash.h
+++ b/xorg-server/hw/xquartz/xpr/x-hash.h
@@ -43,49 +43,45 @@ typedef void (x_hash_foreach_fun) (void *k, void *v, void *data);
/* for X_PFX and X_EXTERN */
#include "x-list.h"
-X_EXTERN x_hash_table *X_PFX (hash_table_new) (x_hash_fun *hash,
- x_compare_fun *compare,
- x_destroy_fun *key_destroy,
- x_destroy_fun *value_destroy);
-X_EXTERN void X_PFX (hash_table_free) (x_hash_table *h);
-
-X_EXTERN unsigned int X_PFX (hash_table_size) (x_hash_table *h);
-
-X_EXTERN void X_PFX (hash_table_insert) (x_hash_table *h, void *k, void *v);
-X_EXTERN void X_PFX (hash_table_replace) (x_hash_table *h, void *k, void *v);
-X_EXTERN void X_PFX (hash_table_remove) (x_hash_table *h, void *k);
-X_EXTERN void *X_PFX (hash_table_lookup) (x_hash_table *h,
- void *k, void **k_ret);
-X_EXTERN void X_PFX (hash_table_foreach) (x_hash_table *h,
- x_hash_foreach_fun *fun,
- void *data);
+X_EXTERN x_hash_table *X_PFX(hash_table_new) (x_hash_fun * hash,
+ x_compare_fun * compare,
+ x_destroy_fun * key_destroy,
+ x_destroy_fun * value_destroy);
+X_EXTERN void X_PFX(hash_table_free) (x_hash_table * h);
+
+X_EXTERN unsigned int X_PFX(hash_table_size) (x_hash_table * h);
+
+X_EXTERN void X_PFX(hash_table_insert) (x_hash_table * h, void *k, void *v);
+X_EXTERN void X_PFX(hash_table_replace) (x_hash_table * h, void *k, void *v);
+X_EXTERN void X_PFX(hash_table_remove) (x_hash_table * h, void *k);
+X_EXTERN void *X_PFX(hash_table_lookup) (x_hash_table * h,
+ void *k, void **k_ret);
+X_EXTERN void X_PFX(hash_table_foreach) (x_hash_table * h,
+ x_hash_foreach_fun * fun, void *data);
/* Conversion between unsigned int (e.g. xp_resource_id) and void pointer */
/* Forward declarations */
-static __inline__ void *
-X_PFX (cvt_uint_to_vptr) (unsigned int val) __attribute__((always_inline));
+static __inline__ void *X_PFX(cvt_uint_to_vptr) (unsigned int val)
+ __attribute__ ((always_inline));
static __inline__ unsigned int
-X_PFX (cvt_vptr_to_uint) (void * val) __attribute__((always_inline));
+ X_PFX(cvt_vptr_to_uint) (void *val) __attribute__ ((always_inline));
/* Implementations */
-static __inline__ void *
-X_PFX (cvt_uint_to_vptr) (unsigned int val)
-{
- return (void*)((unsigned long)(val));
+static __inline__ void *X_PFX(cvt_uint_to_vptr) (unsigned int val) {
+ return (void *) ((unsigned long) (val));
}
static __inline__ unsigned int
-X_PFX (cvt_vptr_to_uint) (void * val)
-{
- size_t sv = (size_t)val;
- unsigned int uv = (unsigned int)sv;
-
- /* If this assert fails, chances are val actually is a pointer,
- or there's been memory corruption */
- assert(sv == uv);
-
- return uv;
+ X_PFX(cvt_vptr_to_uint) (void *val) {
+ size_t sv = (size_t) val;
+ unsigned int uv = (unsigned int) sv;
+
+ /* If this assert fails, chances are val actually is a pointer,
+ or there's been memory corruption */
+ assert(sv == uv);
+
+ return uv;
}
-#endif /* X_HASH_H */
+#endif /* X_HASH_H */