From 6b94e0329841ed8e80dbb55a3f8c2eee41b3168b Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 14 Dec 2011 19:51:25 -0500 Subject: Make refcount declarations uniform. --- libdimension/dimension/refcount.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'libdimension/dimension/refcount.h') diff --git a/libdimension/dimension/refcount.h b/libdimension/dimension/refcount.h index f9f3286..9f6d8b0 100644 --- a/libdimension/dimension/refcount.h +++ b/libdimension/dimension/refcount.h @@ -23,10 +23,11 @@ * Generic reference count implementation. */ -/** - * Reference counter. - */ -typedef unsigned int dmnsn_refcount; +/** @internal The name of the reference count field in all structs. */ +#define DMNSN_REFCOUNT_NAME refcount + +/** @internal Declare a reference count field in a struct. */ +#define DMNSN_REFCOUNT unsigned int DMNSN_REFCOUNT_NAME /** * Increment a reference count. @@ -37,6 +38,6 @@ typedef unsigned int dmnsn_refcount; /* Suppress "address will always evaluate to true" warning */ \ void *testptr = (object); \ if (testptr) { \ - ++(object)->refcount; \ + ++(object)->DMNSN_REFCOUNT_NAME; \ } \ } while (0) -- cgit v1.2.3