aboutsummaryrefslogtreecommitdiff
path: root/layer.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-09-24 13:47:43 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-09-24 13:47:43 +0200
commit2e0961e7251bb6a3135012475f2bdca010e2f93d (patch)
tree2b6d1b332e2db9d7a35089b50405478635e591ca /layer.h
parent35230b5fd1b96898d51372f92142e28bae13fb73 (diff)
downloadosc-graphics-2e0961e7251bb6a3135012475f2bdca010e2f93d.tar.gz
use BSD list macros instead of handwritten list primitives
luckily this works thanks to C++ classes being backward compatible to C structs
Diffstat (limited to 'layer.h')
-rw-r--r--layer.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/layer.h b/layer.h
index ce9a417..1bbe7e6 100644
--- a/layer.h
+++ b/layer.h
@@ -2,6 +2,7 @@
#define __HAVE_LAYER_H
#include <string.h>
+#include <bsd/sys/queue.h>
#include <SDL.h>
#include <SDL_thread.h>
@@ -10,7 +11,7 @@ class Layer {
SDL_mutex *mutex;
public:
- Layer *next;
+ SLIST_ENTRY(Layer) layers;
char *name;
@@ -43,7 +44,7 @@ public:
};
class LayerList {
- Layer *head;
+ SLIST_HEAD(layers_head, Layer) head;
SDL_mutex *mutex;
@@ -59,8 +60,9 @@ class LayerList {
}
public:
- LayerList() : head(NULL)
+ LayerList()
{
+ SLIST_INIT(&head);
mutex = SDL_CreateMutex();
}
~LayerList()