# Remove directories from this list as they are cleaned up.
coccinelle_exclude = [
'src/basic/',
- 'src/libsystemd/',
'src/shared/',
# libc/ has no assert() or systemd-headers so leave it
'src/libc/',
_public_ int sd_bus_creds_get_selinux_context(sd_bus_creds *c, const char **ret) {
assert_return(c, -EINVAL);
+ assert_return(ret, -EINVAL);
if (!(c->mask & SD_BUS_CREDS_SELINUX_CONTEXT))
return -ENODATA;
const char *name;
char *n;
+ assert(ret);
+
/* D-Bus names must not start with a digit. Thus, an name like System.Error.500 would not be legal.
* Let's just return 0 if an unknown errno is encountered, which will cause the caller to fall back
* to BUS_ERROR_FAILED.
}
int bus_message_type_from_string(const char *s, uint8_t *u) {
+ assert(u);
+
if (streq(s, "signal"))
*u = SD_BUS_MESSAGE_SIGNAL;
else if (streq(s, "method_call"))
assert(i);
assert(i->m.f);
+ assert(signature);
+ assert(names);
for (;;) {
size_t l;
static bool names_are_valid(const char *signature, const char **names, names_flags *flags) {
int r;
+ assert(signature);
+ assert(names);
+ assert(flags);
+
if ((*flags & NAMES_FIRST_PART || *flags & NAMES_SINGLE_PART) && **names != '\0')
*flags |= NAMES_PRESENT;
#define SNDBUF_SIZE (8*1024*1024)
static void iovec_advance(struct iovec iov[], unsigned *idx, size_t size) {
+ assert(idx);
while (size > 0) {
struct iovec *i = iov + *idx;
assert(bus);
assert(m);
+ assert(idx);
r = bus_socket_write_message(bus, m, idx);
if (r <= 0)
};
static int enumerator_callback(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *reterr_error) {
+ assert(nodes);
if (object_path_startswith("/value", path))
ASSERT_NOT_NULL(*nodes = strv_new("/value/c", "/value/b", "/value/a"));
}
static int enumerator2_callback(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *reterr_error) {
+ assert(nodes);
if (object_path_startswith("/value/a", path))
ASSERT_NOT_NULL(*nodes = strv_new("/value/a/z", "/value/a/x", "/value/a/y"));
static int enumerator3_callback(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *reterr_error) {
_cleanup_strv_free_ char **v = NULL;
+ assert(nodes);
+
if (!object_path_startswith("/value/b", path))
return 1;
static int happy_finder_object = 0;
static int happy_finder(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *reterr_error) {
+ assert(found);
assert(userdata);
assert(userdata == &c);
static void bpf_stmt(struct sock_filter *ins, unsigned *i,
unsigned short code, unsigned data) {
+ assert(i);
+
ins[(*i)++] = (struct sock_filter) {
.code = code,
.k = data,
static void bpf_jmp(struct sock_filter *ins, unsigned *i,
unsigned short code, unsigned data,
unsigned short jt, unsigned short jf) {
+ assert(i);
+
ins[(*i)++] = (struct sock_filter) {
.code = code,
.jt = jt,
_public_ int sd_event_get_iteration(sd_event *e, uint64_t *ret) {
assert_return(e, -EINVAL);
assert_return(e = event_resolve(e), -ENOPKG);
+ assert_return(ret, -EINVAL);
assert_return(!event_origin_changed(e), -ECHILD);
*ret = e->iteration;
}
void id128_hash_func(const sd_id128_t *p, struct siphash *state) {
+ assert(p);
+
siphash24_compress_typesafe(*p, state);
}
assert(f->header);
assert(first);
assert(idx);
+ POINTER_MAY_BE_NULL(tail);
+ POINTER_MAY_BE_NULL(tidx);
assert(p > 0);
a = tail ? le32toh(*tail) : le64toh(*first);
unsigned n, i, j, k;
usec_t z, x;
+ assert(last_usec);
+
if (!on_tty())
return;
}
static int expected_result(uint64_t needle, const uint64_t *candidates, const uint64_t *offset, size_t n, direction_t direction, uint64_t *ret) {
+ assert(ret);
+
switch (direction) {
case DIRECTION_DOWN:
for (size_t i = 0; i < n; i++) {
}
static int expected_result_next(uint64_t needle, const uint64_t *candidates, const uint64_t *offset, size_t n, direction_t direction, uint64_t *ret) {
+ assert(ret);
+
switch (direction) {
case DIRECTION_DOWN:
for (size_t i = 0; i < n; i++)
int family) {
int r;
+ assert_return(ret, -EINVAL);
+
r = sd_rtnl_message_new_addr(rtnl, ret, RTM_NEWADDR, ifindex, family);
if (r < 0)
return r;