tests: Use one shared xzalloc implementation
authorBryce Harrington <bryce@osg.samsung.com>
Thu, 20 Nov 2014 01:18:36 +0000 (17:18 -0800)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Fri, 28 Nov 2014 13:57:55 +0000 (15:57 +0200)
Since this is an inlined function, move it to a common header file.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
tests/presentation-test.c
tests/weston-test-client-helper.c
tests/weston-test-client-helper.h

index f97e5b3..59cca8e 100644 (file)
 #include "weston-test-client-helper.h"
 #include "presentation_timing-client-protocol.h"
 
-static inline void *
-xzalloc(size_t size)
-{
-       void *p;
-
-       p = calloc(1, size);
-       assert(p);
-
-       return p;
-}
-
 static struct presentation *
 get_presentation(struct client *client)
 {
index eadc29b..e374a96 100644 (file)
 #include "../shared/os-compatibility.h"
 #include "weston-test-client-helper.h"
 
-static inline void *
-xzalloc(size_t size)
-{
-       void *p;
-
-       p = calloc(1, size);
-       assert(p);
-
-       return p;
-}
-
 int
 surface_contains(struct surface *surface, int x, int y)
 {
index 684afc6..2cf3d8f 100644 (file)
@@ -101,6 +101,17 @@ struct surface {
        void *data;
 };
 
+static inline void *
+xzalloc(size_t size)
+{
+        void *p;
+
+        p = calloc(1, size);
+        assert(p);
+
+        return p;
+}
+
 struct client *
 client_create(int x, int y, int width, int height);