util: make the OBJECT_IMPLEMENT_CREATE no longer static by default

Better for consistency with the other functions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2020-09-16 08:28:18 +10:00
parent 325d7e6a43
commit 31800cf870
17 changed files with 19 additions and 1 deletions

View file

@ -46,6 +46,7 @@ _public_
OBJECT_IMPLEMENT_UNREF(ei_device);
#define _cleanup_ei_device_ _cleanup_(ei_device_cleanup)
static
OBJECT_IMPLEMENT_CREATE(ei_device);
static
OBJECT_IMPLEMENT_PARENT(ei_device, ei);

View file

@ -58,6 +58,7 @@ ei_fd_destroy(struct ei_fd *backend)
/* nothing to do here */
}
static
OBJECT_IMPLEMENT_CREATE(ei_fd);
static
OBJECT_IMPLEMENT_UNREF(ei_fd);

View file

@ -53,6 +53,7 @@ ei_portal_destroy(struct ei_portal *portal)
sd_bus_unref(portal->bus);
}
static
OBJECT_IMPLEMENT_CREATE(ei_portal);
static
OBJECT_IMPLEMENT_PARENT(ei_portal, ei);

View file

@ -54,6 +54,7 @@ ei_socket_destroy(struct ei_socket *socket)
{
}
static
OBJECT_IMPLEMENT_CREATE(ei_socket);
static
OBJECT_IMPLEMENT_UNREF(ei_socket);

View file

@ -56,6 +56,7 @@ ei_event_destroy(struct ei_event *event)
ei_device_unref(event->device);
}
static
OBJECT_IMPLEMENT_CREATE(ei_event);
static
OBJECT_IMPLEMENT_REF(ei_event);
@ -82,6 +83,7 @@ ei_destroy(struct ei *ei)
free(ei->name);
}
static
OBJECT_IMPLEMENT_CREATE(ei);
_public_
OBJECT_IMPLEMENT_REF(ei);

View file

@ -49,6 +49,7 @@ eis_client_destroy(struct eis_client *client)
list_remove(&client->link);
}
static
OBJECT_IMPLEMENT_CREATE(eis_client);
static
OBJECT_IMPLEMENT_PARENT(eis_client, eis);

View file

@ -41,6 +41,7 @@ _public_
OBJECT_IMPLEMENT_REF(eis_device);
_public_
OBJECT_IMPLEMENT_UNREF(eis_device);
static
OBJECT_IMPLEMENT_CREATE(eis_device);
static
OBJECT_IMPLEMENT_PARENT(eis_device, eis_client);

View file

@ -49,6 +49,7 @@ eis_event_destroy(struct eis_event *event)
event->client = eis_client_unref(event->client);
}
static
OBJECT_IMPLEMENT_CREATE(eis_event);
struct eis_event *

View file

@ -50,6 +50,7 @@ eis_fd_destroy(struct eis_fd *eis_fd)
{
}
static
OBJECT_IMPLEMENT_CREATE(eis_fd);
static
OBJECT_IMPLEMENT_UNREF(eis_fd);

View file

@ -59,6 +59,7 @@ eis_socket_destroy(struct eis_socket *socket)
}
}
static
OBJECT_IMPLEMENT_CREATE(eis_socket);
static
OBJECT_IMPLEMENT_UNREF(eis_socket);

View file

@ -54,6 +54,7 @@ eis_destroy(struct eis *eis)
sink_unref(eis->sink);
}
static
OBJECT_IMPLEMENT_CREATE(eis);
_public_
OBJECT_IMPLEMENT_REF(eis);

View file

@ -50,6 +50,7 @@ reis_destroy(struct reis *reis)
_public_
OBJECT_IMPLEMENT_UNREF(reis);
static
OBJECT_IMPLEMENT_CREATE(reis);
static int

View file

@ -90,6 +90,7 @@ logger_destroy(struct logger* logger)
free(logger->prefix);
}
static
OBJECT_IMPLEMENT_CREATE(logger);
OBJECT_IMPLEMENT_UNREF(logger);
OBJECT_IMPLEMENT_SETTER(logger, priority, enum logger_priority);

View file

@ -47,6 +47,7 @@ memfile_destroy(struct memfile *memfile)
close(memfile->fd);
}
static
OBJECT_IMPLEMENT_CREATE(memfile);
OBJECT_IMPLEMENT_UNREF(memfile);
OBJECT_IMPLEMENT_REF(memfile);

View file

@ -139,7 +139,7 @@ void type_##_init_object(struct type_ *t, struct object *parent) { \
* which returns an callocated and initialized foo struct.
*/
#define OBJECT_IMPLEMENT_CREATE(type_) \
static inline struct type_ * type_##_create(struct object *parent) { \
struct type_ * type_##_create(struct object *parent) { \
struct type_ *t = calloc(1, sizeof *t); \
assert((intptr_t)t == (intptr_t)&t->object && "field 'object' must be first one in the struct"); \
assert(t != NULL); \

View file

@ -96,6 +96,7 @@ source_destroy(struct source *source)
source->fd = xclose(source->fd);
}
static
OBJECT_IMPLEMENT_CREATE(source);
struct source *
@ -134,6 +135,7 @@ sink_destroy(struct sink *sink)
}
OBJECT_IMPLEMENT_UNREF(sink);
static
OBJECT_IMPLEMENT_CREATE(sink);
int

View file

@ -60,6 +60,7 @@ peck_destroy(struct peck *peck)
logger_unref(peck->logger);
}
static
OBJECT_IMPLEMENT_CREATE(peck);
OBJECT_IMPLEMENT_UNREF(peck);
OBJECT_IMPLEMENT_GETTER(peck, ei, struct ei*);