From 78b21a9ac3f975f35ec7b61108531e1495eb91c0 Mon Sep 17 00:00:00 2001 From: cbdev Date: Sun, 12 Jan 2020 17:34:14 +0100 Subject: Rework instance creation --- backends/artnet.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'backends/artnet.c') diff --git a/backends/artnet.c b/backends/artnet.c index 0bd1a32..ed426b0 100644 --- a/backends/artnet.c +++ b/backends/artnet.c @@ -94,23 +94,17 @@ static int artnet_configure(char* option, char* value){ return 1; } -static instance* artnet_instance(){ - artnet_instance_data* data = NULL; - instance* inst = mm_instance(); - if(!inst){ - return NULL; - } - - data = calloc(1, sizeof(artnet_instance_data)); +static int artnet_instance(instance* inst){ + artnet_instance_data* data = calloc(1, sizeof(artnet_instance_data)); if(!data){ LOG("Failed to allocate memory"); - return NULL; + return 1; } data->net = default_net; inst->impl = data; - return inst; + return 0; } static int artnet_configure_instance(instance* inst, char* option, char* value){ -- cgit v1.2.3