summaryrefslogtreecommitdiffstats
path: root/libdimension/finish.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-12-24 13:19:38 -0500
committerTavian Barnes <tavianator@gmail.com>2011-12-24 13:19:38 -0500
commita8181915a4aac7a37bdd62705e2eac1067eb1904 (patch)
tree4e90ce29b5fad0d34f268e5ac9d247c3ef034a3f /libdimension/finish.c
parentbabba43cd4d1b9c92a569f19acbe17e429193b01 (diff)
downloaddimension-a8181915a4aac7a37bdd62705e2eac1067eb1904.tar.xz
Use macros to initialize refcounts.
Diffstat (limited to 'libdimension/finish.c')
-rw-r--r--libdimension/finish.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libdimension/finish.c b/libdimension/finish.c
index cd922ff..e5ba88e 100644
--- a/libdimension/finish.c
+++ b/libdimension/finish.c
@@ -30,7 +30,7 @@ dmnsn_new_ambient(dmnsn_color ambient_light)
{
dmnsn_ambient *ambient = dmnsn_malloc(sizeof(dmnsn_ambient));
ambient->ambient = ambient_light;
- ambient->refcount = 1;
+ DMNSN_REFCOUNT_INIT(ambient);
return ambient;
}
@@ -46,9 +46,9 @@ dmnsn_diffuse *
dmnsn_new_diffuse(void)
{
dmnsn_diffuse *diffuse = dmnsn_malloc(sizeof(dmnsn_diffuse));
- diffuse->free_fn = NULL;
- diffuse->ptr = NULL;
- diffuse->refcount = 1;
+ diffuse->free_fn = NULL;
+ diffuse->ptr = NULL;
+ DMNSN_REFCOUNT_INIT(diffuse);
return diffuse;
}
@@ -67,9 +67,9 @@ dmnsn_specular *
dmnsn_new_specular(void)
{
dmnsn_specular *specular = dmnsn_malloc(sizeof(dmnsn_specular));
- specular->free_fn = NULL;
- specular->ptr = NULL;
- specular->refcount = 1;
+ specular->free_fn = NULL;
+ specular->ptr = NULL;
+ DMNSN_REFCOUNT_INIT(specular);
return specular;
}
@@ -88,9 +88,9 @@ dmnsn_reflection *
dmnsn_new_reflection(void)
{
dmnsn_reflection *reflection = dmnsn_malloc(sizeof(dmnsn_reflection));
- reflection->free_fn = NULL;
- reflection->ptr = NULL;
- reflection->refcount = 1;
+ reflection->free_fn = NULL;
+ reflection->ptr = NULL;
+ DMNSN_REFCOUNT_INIT(reflection);
return reflection;
}