mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-09-06 18:05:39 +00:00
tests: Use one shared xzalloc implementation
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>
This commit is contained in:
parent
22ea306ce2
commit
2cd82b7692
|
@ -31,17 +31,6 @@
|
||||||
#include "weston-test-client-helper.h"
|
#include "weston-test-client-helper.h"
|
||||||
#include "presentation_timing-client-protocol.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 *
|
static struct presentation *
|
||||||
get_presentation(struct client *client)
|
get_presentation(struct client *client)
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,17 +32,6 @@
|
||||||
#include "../shared/os-compatibility.h"
|
#include "../shared/os-compatibility.h"
|
||||||
#include "weston-test-client-helper.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
|
int
|
||||||
surface_contains(struct surface *surface, int x, int y)
|
surface_contains(struct surface *surface, int x, int y)
|
||||||
{
|
{
|
||||||
|
|
|
@ -101,6 +101,17 @@ struct surface {
|
||||||
void *data;
|
void *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static inline void *
|
||||||
|
xzalloc(size_t size)
|
||||||
|
{
|
||||||
|
void *p;
|
||||||
|
|
||||||
|
p = calloc(1, size);
|
||||||
|
assert(p);
|
||||||
|
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
struct client *
|
struct client *
|
||||||
client_create(int x, int y, int width, int height);
|
client_create(int x, int y, int width, int height);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue