tree-wide: make ++/-- usage consistent WRT spacing
Throughout the tree there's spurious use of spaces separating ++ and -- operators from their respective operands. Make ++ and -- operator consistent with the majority of existing uses; discard the spaces.
This commit is contained in:
@@ -198,7 +198,7 @@ int bus_message_dump(sd_bus_message *m, FILE *f, unsigned flags) {
|
||||
else if (type == SD_BUS_TYPE_DICT_ENTRY)
|
||||
fprintf(f, "%sDICT_ENTRY \"%s\" {\n", prefix, contents);
|
||||
|
||||
level ++;
|
||||
level++;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1198,7 +1198,7 @@ struct bus_body_part *message_append_part(sd_bus_message *m) {
|
||||
|
||||
part->memfd = -1;
|
||||
m->body_end = part;
|
||||
m->n_body_parts ++;
|
||||
m->n_body_parts++;
|
||||
|
||||
return part;
|
||||
}
|
||||
@@ -1643,7 +1643,7 @@ int message_append_basic(sd_bus_message *m, char type, const void *p, const void
|
||||
}
|
||||
|
||||
if (type == SD_BUS_TYPE_UNIX_FD)
|
||||
m->n_fds ++;
|
||||
m->n_fds++;
|
||||
|
||||
if (c->enclosing != SD_BUS_TYPE_ARRAY)
|
||||
c->index++;
|
||||
@@ -2387,9 +2387,9 @@ int bus_message_append_ap(
|
||||
|
||||
t = types;
|
||||
if (n_array != (unsigned) -1)
|
||||
n_array --;
|
||||
n_array--;
|
||||
else {
|
||||
types ++;
|
||||
types++;
|
||||
n_struct--;
|
||||
}
|
||||
|
||||
@@ -3866,7 +3866,7 @@ static int build_struct_offsets(
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r == 0 && p[n] != 0) /* except the last item */
|
||||
n_variable ++;
|
||||
n_variable++;
|
||||
n_total++;
|
||||
|
||||
p += n;
|
||||
@@ -4466,9 +4466,9 @@ static int message_read_ap(
|
||||
|
||||
t = types;
|
||||
if (n_array != (unsigned) -1)
|
||||
n_array --;
|
||||
n_array--;
|
||||
else {
|
||||
types ++;
|
||||
types++;
|
||||
n_struct--;
|
||||
}
|
||||
|
||||
|
||||
@@ -337,7 +337,7 @@ static int check_access(sd_bus *bus, sd_bus_message *m, struct vtable_member *c,
|
||||
if (cap == 0)
|
||||
cap = CAP_SYS_ADMIN;
|
||||
else
|
||||
cap --;
|
||||
cap--;
|
||||
|
||||
r = sd_bus_query_sender_privilege(m, cap);
|
||||
if (r < 0)
|
||||
|
||||
@@ -206,7 +206,7 @@ _public_ sd_bus_slot* sd_bus_slot_unref(sd_bus_slot *slot) {
|
||||
assert(slot->n_ref > 0);
|
||||
|
||||
if (slot->n_ref > 1) {
|
||||
slot->n_ref --;
|
||||
slot->n_ref--;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ static void iovec_advance(struct iovec iov[], unsigned *idx, size_t size) {
|
||||
i->iov_base = NULL;
|
||||
i->iov_len = 0;
|
||||
|
||||
(*idx) ++;
|
||||
(*idx)++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ _public_ sd_bus_track* sd_bus_track_unref(sd_bus_track *track) {
|
||||
assert(track->n_ref > 0);
|
||||
|
||||
if (track->n_ref > 1) {
|
||||
track->n_ref --;
|
||||
track->n_ref--;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -530,7 +530,7 @@ static void skip_address_key(const char **p) {
|
||||
*p += strcspn(*p, ",");
|
||||
|
||||
if (**p == ',')
|
||||
(*p) ++;
|
||||
(*p)++;
|
||||
}
|
||||
|
||||
static int parse_unix_address(sd_bus *b, const char **p, char **guid) {
|
||||
@@ -695,7 +695,7 @@ static int parse_exec_address(sd_bus *b, const char **p, char **guid) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
(*p) ++;
|
||||
(*p)++;
|
||||
|
||||
if (ul >= n_argv) {
|
||||
if (!GREEDY_REALLOC0(argv, allocated, ul + 2)) {
|
||||
@@ -1668,7 +1668,7 @@ static int dispatch_wqueue(sd_bus *bus) {
|
||||
* it got full, then all bets are off
|
||||
* anyway. */
|
||||
|
||||
bus->wqueue_size --;
|
||||
bus->wqueue_size--;
|
||||
sd_bus_message_unref(bus->wqueue[0]);
|
||||
memmove(bus->wqueue, bus->wqueue + 1, sizeof(sd_bus_message*) * bus->wqueue_size);
|
||||
bus->windex = 0;
|
||||
@@ -1717,7 +1717,7 @@ static int dispatch_rqueue(sd_bus *bus, bool hint_priority, int64_t priority, sd
|
||||
/* Dispatch a queued message */
|
||||
|
||||
*m = bus->rqueue[0];
|
||||
bus->rqueue_size --;
|
||||
bus->rqueue_size--;
|
||||
memmove(bus->rqueue, bus->rqueue + 1, sizeof(sd_bus_message*) * bus->rqueue_size);
|
||||
return 1;
|
||||
}
|
||||
@@ -1809,7 +1809,7 @@ static int bus_send_internal(sd_bus *bus, sd_bus_message *_m, uint64_t *cookie,
|
||||
if (!GREEDY_REALLOC(bus->wqueue, bus->wqueue_allocated, bus->wqueue_size + 1))
|
||||
return -ENOMEM;
|
||||
|
||||
bus->wqueue[bus->wqueue_size ++] = sd_bus_message_ref(m);
|
||||
bus->wqueue[bus->wqueue_size++] = sd_bus_message_ref(m);
|
||||
}
|
||||
|
||||
finish:
|
||||
@@ -2257,7 +2257,7 @@ static int process_timeout(sd_bus *bus) {
|
||||
|
||||
slot = container_of(c, sd_bus_slot, reply_callback);
|
||||
|
||||
bus->iteration_counter ++;
|
||||
bus->iteration_counter++;
|
||||
|
||||
bus->current_message = m;
|
||||
bus->current_slot = sd_bus_slot_ref(slot);
|
||||
|
||||
@@ -146,7 +146,7 @@ static void dump_mapping_table(void) {
|
||||
}
|
||||
|
||||
printf("%s -> %i/%s\n", strna(m->name), m->code, strna(errno_to_name(m->code)));
|
||||
m ++;
|
||||
m++;
|
||||
}
|
||||
printf("---------------------------\n");
|
||||
}
|
||||
|
||||
@@ -890,7 +890,7 @@ void device_cleanup_tags(sd_device *device) {
|
||||
set_free_free(device->tags);
|
||||
device->tags = NULL;
|
||||
device->property_tags_outdated = true;
|
||||
device->tags_generation ++;
|
||||
device->tags_generation++;
|
||||
}
|
||||
|
||||
void device_cleanup_devlinks(sd_device *device) {
|
||||
@@ -899,7 +899,7 @@ void device_cleanup_devlinks(sd_device *device) {
|
||||
set_free_free(device->devlinks);
|
||||
device->devlinks = NULL;
|
||||
device->property_devlinks_outdated = true;
|
||||
device->devlinks_generation ++;
|
||||
device->devlinks_generation++;
|
||||
}
|
||||
|
||||
void device_remove_tag(sd_device *device, const char *tag) {
|
||||
@@ -908,7 +908,7 @@ void device_remove_tag(sd_device *device, const char *tag) {
|
||||
|
||||
free(set_remove(device->tags, tag));
|
||||
device->property_tags_outdated = true;
|
||||
device->tags_generation ++;
|
||||
device->tags_generation++;
|
||||
}
|
||||
|
||||
static int device_tag(sd_device *device, const char *tag, bool add) {
|
||||
|
||||
@@ -136,7 +136,7 @@ int device_add_property_aux(sd_device *device, const char *_key, const char *_va
|
||||
}
|
||||
|
||||
if (!db) {
|
||||
device->properties_generation ++;
|
||||
device->properties_generation++;
|
||||
device->properties_buf_outdated = true;
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ _public_ int sd_device_new_from_subsystem_sysname(sd_device **ret, const char *s
|
||||
if (name[len] == '/')
|
||||
name[len] = '!';
|
||||
|
||||
len ++;
|
||||
len++;
|
||||
}
|
||||
|
||||
syspath = strjoina("/sys/subsystem/", subsystem, "/devices/", name);
|
||||
@@ -669,7 +669,7 @@ _public_ int sd_device_new_from_device_id(sd_device **ret, const char *id) {
|
||||
return -EINVAL;
|
||||
|
||||
sysname[0] = '\0';
|
||||
sysname ++;
|
||||
sysname++;
|
||||
|
||||
return sd_device_new_from_subsystem_sysname(ret, subsys, sysname);
|
||||
}
|
||||
@@ -971,7 +971,7 @@ static int device_set_sysname(sd_device *device) {
|
||||
pos = strrchr(device->devpath, '/');
|
||||
if (!pos)
|
||||
return -EINVAL;
|
||||
pos ++;
|
||||
pos++;
|
||||
|
||||
/* devpath is not a root directory */
|
||||
if (*pos == '\0' || pos <= device->devpath)
|
||||
@@ -986,7 +986,7 @@ static int device_set_sysname(sd_device *device) {
|
||||
if (sysname[len] == '!')
|
||||
sysname[len] = '/';
|
||||
|
||||
len ++;
|
||||
len++;
|
||||
}
|
||||
|
||||
/* trailing number */
|
||||
@@ -1066,7 +1066,7 @@ int device_add_tag(sd_device *device, const char *tag) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
device->tags_generation ++;
|
||||
device->tags_generation++;
|
||||
device->property_tags_outdated = true;
|
||||
|
||||
return 0;
|
||||
@@ -1086,7 +1086,7 @@ int device_add_devlink(sd_device *device, const char *devlink) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
device->devlinks_generation ++;
|
||||
device->devlinks_generation++;
|
||||
device->property_devlinks_outdated = true;
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -951,7 +951,7 @@ static sd_event_source *source_new(sd_event *e, bool floating, EventSourceType t
|
||||
sd_event_ref(e);
|
||||
|
||||
LIST_PREPEND(sources, e->sources, s);
|
||||
e->n_sources ++;
|
||||
e->n_sources++;
|
||||
|
||||
return s;
|
||||
}
|
||||
@@ -1235,7 +1235,7 @@ _public_ int sd_event_add_child(
|
||||
return r;
|
||||
}
|
||||
|
||||
e->n_enabled_child_sources ++;
|
||||
e->n_enabled_child_sources++;
|
||||
|
||||
r = event_make_signal_data(e, SIGCHLD, NULL);
|
||||
if (r < 0) {
|
||||
|
||||
@@ -291,7 +291,7 @@ static int n_rtqueue = 0;
|
||||
|
||||
static int rtqueue_handler(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata) {
|
||||
last_rtqueue_sigval = si->ssi_int;
|
||||
n_rtqueue ++;
|
||||
n_rtqueue++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "util.h"
|
||||
|
||||
#define GET_CONTAINER(m, i) ((i) < (m)->n_containers ? (struct rtattr*)((uint8_t*)(m)->hdr + (m)->containers[i].offset) : NULL)
|
||||
#define PUSH_CONTAINER(m, new) (m)->container_offsets[(m)->n_containers ++] = (uint8_t*)(new) - (uint8_t*)(m)->hdr;
|
||||
#define PUSH_CONTAINER(m, new) (m)->container_offsets[(m)->n_containers++] = (uint8_t*)(new) - (uint8_t*)(m)->hdr;
|
||||
|
||||
#define RTA_TYPE(rta) ((rta)->rta_type & NLA_TYPE_MASK)
|
||||
#define RTA_FLAGS(rta) ((rta)->rta_type & ~NLA_TYPE_MASK)
|
||||
@@ -467,7 +467,7 @@ int sd_netlink_message_open_container(sd_netlink_message *m, unsigned short type
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
m->containers[m->n_containers ++].offset = r;
|
||||
m->containers[m->n_containers++].offset = r;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -498,7 +498,7 @@ int sd_netlink_message_open_container_union(sd_netlink_message *m, unsigned shor
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
m->containers[m->n_containers ++].offset = r;
|
||||
m->containers[m->n_containers++].offset = r;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -510,7 +510,7 @@ int sd_netlink_message_close_container(sd_netlink_message *m) {
|
||||
assert_return(m->n_containers > 0, -EINVAL);
|
||||
|
||||
m->containers[m->n_containers].type_system = NULL;
|
||||
m->n_containers --;
|
||||
m->n_containers--;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -842,7 +842,7 @@ int sd_netlink_message_enter_container(sd_netlink_message *m, unsigned short typ
|
||||
else
|
||||
size = (size_t)r;
|
||||
|
||||
m->n_containers ++;
|
||||
m->n_containers++;
|
||||
|
||||
r = netlink_container_parse(m,
|
||||
&m->containers[m->n_containers],
|
||||
@@ -850,7 +850,7 @@ int sd_netlink_message_enter_container(sd_netlink_message *m, unsigned short typ
|
||||
container,
|
||||
size);
|
||||
if (r < 0) {
|
||||
m->n_containers --;
|
||||
m->n_containers--;
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -867,7 +867,7 @@ int sd_netlink_message_exit_container(sd_netlink_message *m) {
|
||||
m->containers[m->n_containers].attributes = mfree(m->containers[m->n_containers].attributes);
|
||||
m->containers[m->n_containers].type_system = NULL;
|
||||
|
||||
m->n_containers --;
|
||||
m->n_containers--;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ static int broadcast_groups_get(sd_netlink *nl) {
|
||||
return r;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
for (j = 0; j < sizeof(uint32_t) * 8; j ++) {
|
||||
for (j = 0; j < sizeof(uint32_t) * 8; j++) {
|
||||
uint32_t offset;
|
||||
unsigned group;
|
||||
|
||||
@@ -168,7 +168,7 @@ int socket_broadcast_group_ref(sd_netlink *nl, unsigned group) {
|
||||
|
||||
n_ref = broadcast_group_get_ref(nl, group);
|
||||
|
||||
n_ref ++;
|
||||
n_ref++;
|
||||
|
||||
r = hashmap_ensure_allocated(&nl->broadcast_group_refs, NULL);
|
||||
if (r < 0)
|
||||
@@ -216,7 +216,7 @@ int socket_broadcast_group_unref(sd_netlink *nl, unsigned group) {
|
||||
|
||||
assert(n_ref > 0);
|
||||
|
||||
n_ref --;
|
||||
n_ref--;
|
||||
|
||||
r = broadcast_group_set_ref(nl, group, n_ref);
|
||||
if (r < 0)
|
||||
@@ -444,14 +444,14 @@ int socket_read_message(sd_netlink *rtnl) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
rtnl->rqueue[rtnl->rqueue_size ++] = first;
|
||||
rtnl->rqueue[rtnl->rqueue_size++] = first;
|
||||
first = NULL;
|
||||
|
||||
if (multi_part && (i < rtnl->rqueue_partial_size)) {
|
||||
/* remove the message form the partial read queue */
|
||||
memmove(rtnl->rqueue_partial + i,rtnl->rqueue_partial + i + 1,
|
||||
sizeof(sd_netlink_message*) * (rtnl->rqueue_partial_size - i - 1));
|
||||
rtnl->rqueue_partial_size --;
|
||||
rtnl->rqueue_partial_size--;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -465,7 +465,7 @@ int socket_read_message(sd_netlink *rtnl) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
rtnl->rqueue_partial[rtnl->rqueue_partial_size ++] = first;
|
||||
rtnl->rqueue_partial[rtnl->rqueue_partial_size++] = first;
|
||||
}
|
||||
first = NULL;
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@ static int dispatch_rqueue(sd_netlink *rtnl, sd_netlink_message **message) {
|
||||
|
||||
/* Dispatch a queued message */
|
||||
*message = rtnl->rqueue[0];
|
||||
rtnl->rqueue_size --;
|
||||
rtnl->rqueue_size--;
|
||||
memmove(rtnl->rqueue, rtnl->rqueue + 1, sizeof(sd_netlink_message*) * rtnl->rqueue_size);
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -234,7 +234,7 @@ static int pipe_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata)
|
||||
int *counter = userdata;
|
||||
int r;
|
||||
|
||||
(*counter) --;
|
||||
(*counter)--;
|
||||
|
||||
r = sd_netlink_message_get_errno(m);
|
||||
|
||||
@@ -276,10 +276,10 @@ static void test_pipe(int ifindex) {
|
||||
assert_se(sd_rtnl_message_new_link(rtnl, &m1, RTM_GETLINK, ifindex) >= 0);
|
||||
assert_se(sd_rtnl_message_new_link(rtnl, &m2, RTM_GETLINK, ifindex) >= 0);
|
||||
|
||||
counter ++;
|
||||
counter++;
|
||||
assert_se(sd_netlink_call_async(rtnl, m1, &pipe_handler, &counter, 0, NULL) >= 0);
|
||||
|
||||
counter ++;
|
||||
counter++;
|
||||
assert_se(sd_netlink_call_async(rtnl, m2, &pipe_handler, &counter, 0, NULL) >= 0);
|
||||
|
||||
while (counter > 0) {
|
||||
|
||||
@@ -447,7 +447,7 @@ static int start_threads(sd_resolve *resolve, unsigned extra) {
|
||||
if (r != 0)
|
||||
return -r;
|
||||
|
||||
resolve->n_valid_workers ++;
|
||||
resolve->n_valid_workers++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -657,7 +657,7 @@ static int complete_query(sd_resolve *resolve, sd_resolve_query *q) {
|
||||
assert(q->resolve == resolve);
|
||||
|
||||
q->done = true;
|
||||
resolve->n_done ++;
|
||||
resolve->n_done++;
|
||||
|
||||
resolve->current = sd_resolve_query_ref(q);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user