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:
Vito Caputo 2016-02-22 20:32:04 -08:00
parent c4bcaa4148
commit 313cefa1d9
84 changed files with 222 additions and 222 deletions

View File

@ -77,7 +77,7 @@ static int open_sockets(int *epoll_fd, bool accept) {
if (r < 0)
return r;
count ++;
count++;
}
}
@ -105,7 +105,7 @@ static int open_sockets(int *epoll_fd, bool accept) {
}
assert(fd == SD_LISTEN_FDS_START + count);
count ++;
count++;
}
if (arg_listen)
@ -176,7 +176,7 @@ static int exec_process(const char* name, char **argv, char **env, int start_fd,
if (!envp[n_env])
return log_oom();
n_env ++;
n_env++;
}
}
@ -191,7 +191,7 @@ static int exec_process(const char* name, char **argv, char **env, int start_fd,
if (!envp[n_env])
return log_oom();
n_env ++;
n_env++;
}
if (arg_inetd) {

View File

@ -290,7 +290,7 @@ int verify_units(char **filenames, ManagerRunningAs running_as, bool check_man)
if (r == 0)
r = k;
} else
count ++;
count++;
}
for (i = 0; i < count; i++) {

View File

@ -1004,7 +1004,7 @@ static int find_next(const CalendarSpec *spec, struct tm *tm, usec_t *usec) {
c.tm_hour = c.tm_min = c.tm_sec = tm_usec = 0;
}
if (r < 0 || tm_out_of_bounds(&c, spec->utc)) {
c.tm_year ++;
c.tm_year++;
c.tm_mon = 0;
c.tm_mday = 1;
c.tm_hour = c.tm_min = c.tm_sec = tm_usec = 0;
@ -1015,7 +1015,7 @@ static int find_next(const CalendarSpec *spec, struct tm *tm, usec_t *usec) {
if (r > 0)
c.tm_hour = c.tm_min = c.tm_sec = tm_usec = 0;
if (r < 0 || tm_out_of_bounds(&c, spec->utc)) {
c.tm_mon ++;
c.tm_mon++;
c.tm_mday = 1;
c.tm_hour = c.tm_min = c.tm_sec = tm_usec = 0;
continue;
@ -1031,7 +1031,7 @@ static int find_next(const CalendarSpec *spec, struct tm *tm, usec_t *usec) {
if (r > 0)
c.tm_min = c.tm_sec = tm_usec = 0;
if (r < 0 || tm_out_of_bounds(&c, spec->utc)) {
c.tm_mday ++;
c.tm_mday++;
c.tm_hour = c.tm_min = c.tm_sec = tm_usec = 0;
continue;
}
@ -1040,7 +1040,7 @@ static int find_next(const CalendarSpec *spec, struct tm *tm, usec_t *usec) {
if (r > 0)
c.tm_sec = tm_usec = 0;
if (r < 0 || tm_out_of_bounds(&c, spec->utc)) {
c.tm_hour ++;
c.tm_hour++;
c.tm_min = c.tm_sec = tm_usec = 0;
continue;
}
@ -1051,7 +1051,7 @@ static int find_next(const CalendarSpec *spec, struct tm *tm, usec_t *usec) {
c.tm_sec /= USEC_PER_SEC;
if (r < 0 || tm_out_of_bounds(&c, spec->utc)) {
c.tm_min ++;
c.tm_min++;
c.tm_sec = tm_usec = 0;
continue;
}

View File

@ -63,12 +63,12 @@ int extract_first_word(const char **p, char **ret, const char *separators, Extra
if (!GREEDY_REALLOC(s, allocated, sz+1))
return -ENOMEM;
for (;; (*p) ++, c = **p) {
for (;; (*p)++, c = **p) {
if (c == 0)
goto finish_force_terminate;
else if (strchr(separators, c)) {
if (flags & EXTRACT_DONT_COALESCE_SEPARATORS) {
(*p) ++;
(*p)++;
goto finish_force_next;
}
} else {
@ -81,7 +81,7 @@ int extract_first_word(const char **p, char **ret, const char *separators, Extra
}
}
for (;; (*p) ++, c = **p) {
for (;; (*p)++, c = **p) {
if (backslash) {
if (!GREEDY_REALLOC(s, allocated, sz+7))
return -ENOMEM;
@ -129,7 +129,7 @@ int extract_first_word(const char **p, char **ret, const char *separators, Extra
backslash = false;
} else if (quote) { /* inside either single or double quotes */
for (;; (*p) ++, c = **p) {
for (;; (*p)++, c = **p) {
if (c == 0) {
if (flags & EXTRACT_RELAX)
goto finish_force_terminate;
@ -149,7 +149,7 @@ int extract_first_word(const char **p, char **ret, const char *separators, Extra
}
} else {
for (;; (*p) ++, c = **p) {
for (;; (*p)++, c = **p) {
if (c == 0)
goto finish_force_terminate;
else if ((c == '\'' || c == '"') && (flags & EXTRACT_QUOTES)) {
@ -160,11 +160,11 @@ int extract_first_word(const char **p, char **ret, const char *separators, Extra
break;
} else if (strchr(separators, c)) {
if (flags & EXTRACT_DONT_COALESCE_SEPARATORS) {
(*p) ++;
(*p)++;
goto finish_force_next;
}
/* Skip additional coalesced separators. */
for (;; (*p) ++, c = **p) {
for (;; (*p)++, c = **p) {
if (c == 0)
goto finish_force_terminate;
if (!strchr(separators, c))

View File

@ -352,7 +352,7 @@ static int parse_env_file_internal(
case KEY:
if (strchr(newline, c)) {
state = PRE_KEY;
line ++;
line++;
n_key = 0;
} else if (c == '=') {
state = PRE_VALUE;
@ -376,7 +376,7 @@ static int parse_env_file_internal(
case PRE_VALUE:
if (strchr(newline, c)) {
state = PRE_KEY;
line ++;
line++;
key[n_key] = 0;
if (value)
@ -416,7 +416,7 @@ static int parse_env_file_internal(
case VALUE:
if (strchr(newline, c)) {
state = PRE_KEY;
line ++;
line++;
key[n_key] = 0;
@ -535,7 +535,7 @@ static int parse_env_file_internal(
state = COMMENT_ESCAPE;
else if (strchr(newline, c)) {
state = PRE_KEY;
line ++;
line++;
}
break;
@ -908,7 +908,7 @@ int get_proc_field(const char *filename, const char *pattern, const char *termin
/* Back off one char if there's nothing but whitespace
and zeros */
if (!*t || isspace(*t))
t --;
t--;
}
len = strcspn(t, terminator);

View File

@ -276,8 +276,8 @@ int unbase32hexmem(const char *p, size_t l, bool padding, void **mem, size_t *_l
if (padding) {
/* strip the padding */
while (l > 0 && p[l - 1] == '=' && pad < 7) {
pad ++;
l --;
pad++;
l--;
}
}
@ -505,7 +505,7 @@ int unbase64char(char c) {
if (c == '+')
return offset;
offset ++;
offset++;
if (c == '/')
return offset;
@ -621,9 +621,9 @@ int unbase64mem(const char *p, size_t l, void **mem, size_t *_len) {
/* strip the padding */
if (l > 0 && p[l - 1] == '=')
l --;
l--;
if (l > 0 && p[l - 1] == '=')
l --;
l--;
/* a group of four input bytes needs three output bytes, in case of
padding we need to add two or three extra bytes */

View File

@ -123,7 +123,7 @@ bool hostname_is_valid(const char *s, bool allow_trailing_dot) {
return false;
dot = true;
n_dots ++;
n_dots++;
} else {
if (!hostname_valid_char(*p))
return false;

View File

@ -249,7 +249,7 @@ ssize_t sparse_write(int fd, const void *p, size_t sz, size_t run_length) {
} else if (n > 0)
q += n;
else
q ++;
q++;
}
if (q > w) {

View File

@ -121,7 +121,7 @@ static void bubbleinsert(struct strbuf_node *node,
sizeof(struct strbuf_child_entry) * (node->children_count - left));
node->children[left] = new;
node->children_count ++;
node->children_count++;
}
/* add string, return the index/offset into the buffer */

View File

@ -477,7 +477,7 @@ char *ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigne
}
if (k > x) /* last character was wide and went over quota */
x ++;
x++;
for (j = s + old_length; k < new_length && j > i; ) {
char32_t c;

View File

@ -576,12 +576,12 @@ int parse_timestamp(const char *t, usec_t *usec) {
goto from_tm;
} else if (streq(t, "yesterday")) {
tm.tm_mday --;
tm.tm_mday--;
tm.tm_sec = tm.tm_min = tm.tm_hour = 0;
goto from_tm;
} else if (streq(t, "tomorrow")) {
tm.tm_mday ++;
tm.tm_mday++;
tm.tm_sec = tm.tm_min = tm.tm_hour = 0;
goto from_tm;
}

View File

@ -241,7 +241,7 @@ char *utf8_escape_non_printable(const char *str) {
*(s++) = hexchar((int) *str);
str += 1;
len --;
len--;
}
}
} else {

View File

@ -2237,7 +2237,7 @@ int exec_context_load_environment(Unit *unit, const ExecContext *c, char ***l) {
if (fn[0] == '-') {
ignore = true;
fn ++;
fn++;
}
if (!path_is_absolute(fn)) {

View File

@ -222,7 +222,7 @@ Job* job_install(Job *j) {
*pj = j;
j->installed = true;
j->manager->n_installed_jobs ++;
j->manager->n_installed_jobs++;
log_unit_debug(j->unit,
"Installed new job %s/%s as %u",
j->unit->id, job_type_to_string(j->type), (unsigned) j->id);
@ -856,7 +856,7 @@ int job_finish_and_invalidate(Job *j, JobResult result, bool recursive) {
}
if (result == JOB_FAILED || result == JOB_INVALID)
j->manager->n_failed_jobs ++;
j->manager->n_failed_jobs++;
job_uninstall(j);
job_free(j);

View File

@ -620,7 +620,7 @@ int config_parse_exec(
separate_argv0 = true;
else
break;
f ++;
f++;
}
if (isempty(f)) {
@ -668,7 +668,7 @@ int config_parse_exec(
/* Check explicitly for an unquoted semicolon as
* command separator token. */
if (p[0] == ';' && (!p[1] || strchr(WHITESPACE, p[1]))) {
p ++;
p++;
p += strspn(p, WHITESPACE);
semicolon = true;
break;

View File

@ -1073,7 +1073,7 @@ static int prepare_reexecute(Manager *m, FILE **_f, FDSet **_fds, bool switching
return log_error_errno(r, "Failed to create serialization file: %m");
/* Make sure nothing is really destructed when we shut down */
m->n_reloading ++;
m->n_reloading++;
bus_manager_send_reloading(m, true);
fds = fdset_new();

View File

@ -1137,7 +1137,7 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds) {
* this is already known, so we increase the counter here
* already */
if (serialization)
m->n_reloading ++;
m->n_reloading++;
/* First, enumerate what we can from all config files */
dual_timestamp_get(&m->units_load_start_timestamp);
@ -1171,7 +1171,7 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds) {
if (serialization) {
assert(m->n_reloading > 0);
m->n_reloading --;
m->n_reloading--;
/* Let's wait for the UnitNew/JobNew messages being
* sent, before we notify that the reload is
@ -2231,7 +2231,7 @@ int manager_serialize(Manager *m, FILE *f, FDSet *fds, bool switching_root) {
assert(f);
assert(fds);
m->n_reloading ++;
m->n_reloading++;
fprintf(f, "current-job-id=%"PRIu32"\n", m->current_job_id);
fprintf(f, "taint-usr=%s\n", yes_no(m->taint_usr));
@ -2301,13 +2301,13 @@ int manager_serialize(Manager *m, FILE *f, FDSet *fds, bool switching_root) {
r = unit_serialize(u, f, fds, !switching_root);
if (r < 0) {
m->n_reloading --;
m->n_reloading--;
return r;
}
}
assert(m->n_reloading > 0);
m->n_reloading --;
m->n_reloading--;
if (ferror(f))
return -EIO;
@ -2327,7 +2327,7 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
log_debug("Deserializing state...");
m->n_reloading ++;
m->n_reloading++;
for (;;) {
char line[LINE_MAX], *l;
@ -2495,7 +2495,7 @@ finish:
r = -EIO;
assert(m->n_reloading > 0);
m->n_reloading --;
m->n_reloading--;
return r;
}
@ -2511,23 +2511,23 @@ int manager_reload(Manager *m) {
if (r < 0)
return r;
m->n_reloading ++;
m->n_reloading++;
bus_manager_send_reloading(m, true);
fds = fdset_new();
if (!fds) {
m->n_reloading --;
m->n_reloading--;
return -ENOMEM;
}
r = manager_serialize(m, f, fds, false);
if (r < 0) {
m->n_reloading --;
m->n_reloading--;
return r;
}
if (fseeko(f, 0, SEEK_SET) < 0) {
m->n_reloading --;
m->n_reloading--;
return -errno;
}

View File

@ -942,7 +942,7 @@ static void service_set_state(Service *s, ServiceState state) {
if (ec && exec_context_may_touch_console(ec)) {
Manager *m = UNIT(s)->manager;
m->n_on_console --;
m->n_on_console--;
if (m->n_on_console == 0)
/* unset no_console_output flag, since the console is free */
m->no_console_output = false;

View File

@ -1979,7 +1979,7 @@ static void socket_enter_running(Socket *s, int cfd) {
service = SERVICE(UNIT_DEREF(s->service));
unit_ref_unset(&s->service);
s->n_accepted ++;
s->n_accepted++;
UNIT(service)->no_gc = false;
@ -1990,7 +1990,7 @@ static void socket_enter_running(Socket *s, int cfd) {
goto fail;
cfd = -1;
s->n_connections ++;
s->n_connections++;
r = manager_add_job(UNIT(s)->manager, JOB_START, UNIT(service), JOB_REPLACE, &error, NULL);
if (r < 0)

View File

@ -472,7 +472,7 @@ static int loopback_points_list_detach(MountPoint **head, bool *changed) {
major(root_st.st_dev) != 0 &&
lstat(m->path, &loopback_st) >= 0 &&
root_st.st_dev == loopback_st.st_rdev) {
n_failed ++;
n_failed++;
continue;
}
@ -507,7 +507,7 @@ static int dm_points_list_detach(MountPoint **head, bool *changed) {
if (k >= 0 &&
major(root_st.st_dev) != 0 &&
root_st.st_dev == m->devnum) {
n_failed ++;
n_failed++;
continue;
}

View File

@ -364,7 +364,7 @@ void unit_add_to_gc_queue(Unit *u) {
LIST_PREPEND(gc_queue, u->manager->gc_queue, u);
u->in_gc_queue = true;
u->manager->n_in_gc_queue ++;
u->manager->n_in_gc_queue++;
}
void unit_add_to_dbus_queue(Unit *u) {
@ -1864,13 +1864,13 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
ec = unit_get_exec_context(u);
if (ec && exec_context_may_touch_console(ec)) {
if (UNIT_IS_INACTIVE_OR_FAILED(ns)) {
m->n_on_console --;
m->n_on_console--;
if (m->n_on_console == 0)
/* unset no_console_output flag, since the console is free */
m->no_console_output = false;
} else
m->n_on_console ++;
m->n_on_console++;
}
}

View File

@ -91,7 +91,7 @@ static int frame_callback(Dwfl_Frame *frame, void *userdata) {
}
fprintf(c->f, "#%-2u 0x%016" PRIx64 " %s (%s)\n", c->n_frame, (uint64_t) pc, strna(symbol), strna(fname));
c->n_frame ++;
c->n_frame++;
return DWARF_CB_OK;
}
@ -117,7 +117,7 @@ static int thread_callback(Dwfl_Thread *thread, void *userdata) {
if (dwfl_thread_getframes(thread, frame_callback, c) < 0)
return DWARF_CB_ABORT;
c->n_thread ++;
c->n_thread++;
return DWARF_CB_OK;
}

View File

@ -314,7 +314,7 @@ static int server_init(Server *s, unsigned n_sockets) {
f->fd = fd;
LIST_PREPEND(fifo, s->fifos, f);
f->server = s;
s->n_fifos ++;
s->n_fifos++;
}
r = bus_connect_system_systemd(&s->bus);

View File

@ -434,7 +434,7 @@ static int add_raw_socket(RemoteServer *s, int fd) {
return r;
fd_ = -1;
s->active ++;
s->active++;
return 0;
}
@ -742,7 +742,7 @@ static int setup_microhttpd_server(RemoteServer *s,
goto error;
}
s->active ++;
s->active++;
return 0;
error:

View File

@ -52,7 +52,7 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
/* not enough space */
return pos;
u->entry_state ++;
u->entry_state++;
if (pos + r == size) {
/* exactly one character short, but we don't need it */
@ -76,7 +76,7 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
/* not enough space */
return pos;
u->entry_state ++;
u->entry_state++;
if (r + pos == size) {
/* exactly one character short, but we don't need it */
@ -101,7 +101,7 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
/* not enough space */
return pos;
u->entry_state ++;
u->entry_state++;
if (r + pos == size) {
/* exactly one character short, but we don't need it */
@ -126,7 +126,7 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
/* not enough space */
return pos;
u->entry_state ++;
u->entry_state++;
if (r + pos == size) {
/* exactly one character short, but we don't need it */
@ -156,7 +156,7 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
continue;
}
u->entry_state ++;
u->entry_state++;
} /* fall through */
case ENTRY_TEXT_FIELD:
@ -206,7 +206,7 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
pos += len + 1;
u->field_pos = len + 1;
u->entry_state ++;
u->entry_state++;
} /* fall through */
case ENTRY_BINARY_FIELD_SIZE: {
@ -220,7 +220,7 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
memcpy(buf + pos, &le64, 8);
pos += 8;
u->entry_state ++;
u->entry_state++;
continue;
}
@ -230,8 +230,8 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
return pos;
buf[pos++] = '\n';
u->entry_state ++;
u->entries_sent ++;
u->entry_state++;
u->entries_sent++;
return pos;

View File

@ -217,7 +217,7 @@ int catalog_file_lang(const char* filename, char **lang) {
beg = end - 1;
while (beg > filename && *beg != '.' && *beg != '/' && end - beg < 32)
beg --;
beg--;
if (*beg != '.' || end <= beg + 1)
return 0;

View File

@ -2170,7 +2170,7 @@ static int generic_array_bisect_plus_one(
goto found;
if (r > 0 && idx)
(*idx) ++;
(*idx)++;
return r;

View File

@ -239,13 +239,13 @@ int journal_directory_vacuum(
/* Vacuum corrupted files */
if (q < 1 + 16 + 1 + 16 + 8 + 1) {
n_active_files ++;
n_active_files++;
continue;
}
if (de->d_name[q-1-8-16-1] != '-' ||
de->d_name[q-1-8-16-1-16-1] != '@') {
n_active_files ++;
n_active_files++;
continue;
}
@ -256,7 +256,7 @@ int journal_directory_vacuum(
}
if (sscanf(de->d_name + q-1-8-16-1-16, "%16llx-%16llx.journal~", &realtime, &tmp) != 2) {
n_active_files ++;
n_active_files++;
continue;
}
@ -302,7 +302,7 @@ int journal_directory_vacuum(
list[n_list].realtime = realtime;
list[n_list].seqnum_id = seqnum_id;
list[n_list].have_seqnum = have_seqnum;
n_list ++;
n_list++;
p = NULL;
sum += size;

View File

@ -894,7 +894,7 @@ int journal_file_verify(
goto fail;
}
n_objects ++;
n_objects++;
r = journal_file_object_verify(f, p, o);
if (r < 0) {
@ -991,7 +991,7 @@ int journal_file_verify(
entry_realtime = le64toh(o->entry.realtime);
entry_realtime_set = true;
n_entries ++;
n_entries++;
break;
case OBJECT_DATA_HASH_TABLE:
@ -1131,11 +1131,11 @@ int journal_file_verify(
last_epoch = le64toh(o->tag.epoch);
n_tags ++;
n_tags++;
break;
default:
n_weird ++;
n_weird++;
}
if (p == le64toh(f->header->tail_object_offset)) {

View File

@ -1363,7 +1363,7 @@ static int add_units(sd_journal *j) {
r = sd_journal_add_disjunction(j);
if (r < 0)
return r;
count ++;
count++;
}
}
@ -1383,7 +1383,7 @@ static int add_units(sd_journal *j) {
r = sd_journal_add_disjunction(j);
if (r < 0)
return r;
count ++;
count++;
}
}
@ -1408,7 +1408,7 @@ static int add_units(sd_journal *j) {
r = sd_journal_add_disjunction(j);
if (r < 0)
return r;
count ++;
count++;
}
}
@ -1428,7 +1428,7 @@ static int add_units(sd_journal *j) {
r = sd_journal_add_disjunction(j);
if (r < 0)
return r;
count ++;
count++;
}
}
@ -2181,7 +2181,7 @@ int main(int argc, char *argv[]) {
SD_JOURNAL_FOREACH_FIELD(j, field) {
printf("%s\n", field);
n_shown ++;
n_shown++;
}
r = 0;
@ -2273,7 +2273,7 @@ int main(int argc, char *argv[]) {
else
printf("%.*s\n", (int) size, (const char*) data);
n_shown ++;
n_shown++;
}
r = 0;

View File

@ -63,7 +63,7 @@ static int map_simple_field(const char *field, const char **p, struct iovec **io
(*iov)[*n_iov].iov_base = c;
(*iov)[*n_iov].iov_len = l;
(*n_iov) ++;
(*n_iov)++;
*p = e;
c = NULL;
@ -142,7 +142,7 @@ static int map_string_field_internal(const char *field, const char **p, struct i
(*iov)[*n_iov].iov_base = c;
(*iov)[*n_iov].iov_len = l;
(*n_iov) ++;
(*n_iov)++;
*p = e;
c = NULL;
@ -200,7 +200,7 @@ static int map_generic_field(const char *prefix, const char **p, struct iovec **
}
strcpy(t, "=");
e ++;
e++;
r = map_simple_field(c, &e, iov, n_iov_allocated, n_iov);
if (r < 0)

View File

@ -201,7 +201,7 @@ static void dev_kmsg_record(Server *s, const char *p, size_t l) {
if (*k != ' ')
break;
k ++, l --;
k++, l--;
e = memchr(k, '\n', l);
if (!e)

View File

@ -104,7 +104,7 @@ static void journal_rate_limit_group_free(JournalRateLimitGroup *g) {
LIST_REMOVE(lru, g->parent->lru, g);
LIST_REMOVE(bucket, g->parent->buckets[g->hash % BUCKETS_MAX], g);
g->parent->n_groups --;
g->parent->n_groups--;
}
free(g->id);
@ -168,7 +168,7 @@ static JournalRateLimitGroup* journal_rate_limit_group_new(JournalRateLimit *r,
LIST_PREPEND(lru, r->lru, g);
if (!g->lru_next)
r->lru_tail = g;
r->n_groups ++;
r->n_groups++;
g->parent = r;
return g;

View File

@ -96,7 +96,7 @@ void stdout_stream_free(StdoutStream *s) {
if (s->server) {
assert(s->server->n_stdout_streams > 0);
s->server->n_stdout_streams --;
s->server->n_stdout_streams--;
LIST_REMOVE(stdout_stream, s->server->stdout_streams, s);
if (s->in_notify_queue)
@ -511,7 +511,7 @@ static int stdout_stream_install(Server *s, int fd, StdoutStream **ret) {
stream->server = s;
LIST_PREPEND(stdout_stream, s->stdout_streams, stream);
s->n_stdout_streams ++;
s->n_stdout_streams++;
if (ret)
*ret = stream;

View File

@ -107,7 +107,7 @@ MMapCache* mmap_cache_ref(MMapCache *m) {
assert(m);
assert(m->n_ref > 0);
m->n_ref ++;
m->n_ref++;
return m;
}
@ -361,7 +361,7 @@ MMapCache* mmap_cache_unref(MMapCache *m) {
assert(m->n_ref > 0);
m->n_ref --;
m->n_ref--;
if (m->n_ref == 0)
mmap_cache_free(m);
@ -598,14 +598,14 @@ int mmap_cache_get(
/* Check whether the current context is the right one already */
r = try_context(m, fd, prot, context, keep_always, offset, size, ret);
if (r != 0) {
m->n_hit ++;
m->n_hit++;
return r;
}
/* Search for a matching mmap */
r = find_mmap(m, fd, prot, context, keep_always, offset, size, ret);
if (r != 0) {
m->n_hit ++;
m->n_hit++;
return r;
}

View File

@ -1266,7 +1266,7 @@ static int add_any_file(sd_journal *j, const char *path) {
check_network(j, f->fd);
j->current_invalidate_counter ++;
j->current_invalidate_counter++;
return 0;
@ -1345,7 +1345,7 @@ static void remove_file_real(sd_journal *j, JournalFile *f) {
(void) journal_file_close(f);
j->current_invalidate_counter ++;
j->current_invalidate_counter++;
}
static int dirname_is_machine_id(const char *fn) {
@ -1410,7 +1410,7 @@ static int add_directory(sd_journal *j, const char *prefix, const char *dirname)
}
path = NULL; /* avoid freeing in cleanup */
j->current_invalidate_counter ++;
j->current_invalidate_counter++;
log_debug("Directory %s added.", m->path);
@ -1495,7 +1495,7 @@ static int add_root_directory(sd_journal *j, const char *p, bool missing_ok) {
goto fail;
}
j->current_invalidate_counter ++;
j->current_invalidate_counter++;
log_debug("Root directory %s added.", m->path);
@ -2078,7 +2078,7 @@ _public_ int sd_journal_enumerate_data(sd_journal *j, const void **data, size_t
if (r < 0)
return r;
j->current_field ++;
j->current_field++;
return 1;
}

View File

@ -44,7 +44,7 @@ int main(int argc, char *argv[]) {
printf("%.*s\n", (int) l, (char*) d);
n ++;
n++;
if (n >= 10)
break;
}

View File

@ -34,7 +34,7 @@ static int option_append(uint8_t options[], size_t size, size_t *offset,
if (code != SD_DHCP_OPTION_END)
/* always make sure there is space for an END option */
size --;
size--;
switch (code) {

View File

@ -66,7 +66,7 @@ uint16_t dhcp_packet_checksum(uint8_t *buf, size_t len) {
/* wrap around in one's complement */
sum++;
buf_64 ++;
buf_64++;
}
if (len % sizeof(uint64_t)) {

View File

@ -375,7 +375,7 @@ int deserialize_in_addrs(struct in_addr **ret, const char *string) {
if (r <= 0)
continue;
size ++;
size++;
}
*ret = addresses;

View File

@ -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;
}

View File

@ -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--;
}

View File

@ -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)

View File

@ -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;
}

View File

@ -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)++;
}
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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");
}

View File

@ -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) {

View File

@ -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;

View File

@ -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) {

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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) {

View File

@ -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);

View File

@ -112,7 +112,7 @@ _public_ struct udev_enumerate *udev_enumerate_new(struct udev *udev) {
**/
_public_ struct udev_enumerate *udev_enumerate_ref(struct udev_enumerate *udev_enumerate) {
if (udev_enumerate)
udev_enumerate->refcount ++;
udev_enumerate->refcount++;
return udev_enumerate;
}

View File

@ -542,7 +542,7 @@ static int read_next_mapping(const char* filename,
return 0;
}
(*n) ++;
(*n)++;
l = strstrip(line);
if (l[0] == 0 || l[0] == '#')

View File

@ -180,7 +180,7 @@ static int list_machines(int argc, char *argv[], void *userdata) {
if (l > max_service)
max_service = l;
n_machines ++;
n_machines++;
}
if (r < 0)
return bus_log_parse_error(r);
@ -2236,7 +2236,7 @@ static int list_transfers(int argc, char *argv[], void *userdata) {
if (id > max_id)
max_id = id;
n_transfers ++;
n_transfers++;
}
if (r < 0)
return bus_log_parse_error(r);

View File

@ -34,7 +34,7 @@ static int dhcp4_route_handler(sd_netlink *rtnl, sd_netlink_message *m,
assert(link);
assert(link->dhcp4_messages > 0);
link->dhcp4_messages --;
link->dhcp4_messages--;
r = sd_netlink_message_get_errno(m);
if (r < 0 && r != -EEXIST) {
@ -96,7 +96,7 @@ static int link_set_dhcp_routes(Link *link) {
if (r < 0)
return log_link_warning_errno(link, r, "Could not set host route: %m");
link->dhcp4_messages ++;
link->dhcp4_messages++;
route->family = AF_INET;
route->gw.in = gateway;
@ -110,7 +110,7 @@ static int link_set_dhcp_routes(Link *link) {
return r;
}
link->dhcp4_messages ++;
link->dhcp4_messages++;
}
n = sd_dhcp_lease_get_routes(link->dhcp_lease, &static_routes);
@ -137,7 +137,7 @@ static int link_set_dhcp_routes(Link *link) {
if (r < 0)
return log_link_warning_errno(link, r, "Could not set host route: %m");
link->dhcp4_messages ++;
link->dhcp4_messages++;
}
return 0;

View File

@ -473,7 +473,7 @@ Link *link_unref(Link *link) {
assert(link->n_ref > 0);
link->n_ref --;
link->n_ref--;
if (link->n_ref > 0)
return NULL;
@ -489,7 +489,7 @@ Link *link_ref(Link *link) {
assert(link->n_ref > 0);
link->n_ref ++;
link->n_ref++;
return link;
}
@ -677,7 +677,7 @@ static int route_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata
LINK_STATE_SETTING_ROUTES, LINK_STATE_FAILED,
LINK_STATE_LINGER));
link->link_messages --;
link->link_messages--;
if (IN_SET(link->state, LINK_STATE_FAILED, LINK_STATE_LINGER))
return 1;
@ -713,7 +713,7 @@ static int link_enter_set_routes(Link *link) {
return r;
}
link->link_messages ++;
link->link_messages++;
}
if (link->link_messages == 0) {
@ -755,7 +755,7 @@ static int address_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userda
assert(IN_SET(link->state, LINK_STATE_SETTING_ADDRESSES,
LINK_STATE_FAILED, LINK_STATE_LINGER));
link->link_messages --;
link->link_messages--;
if (IN_SET(link->state, LINK_STATE_FAILED, LINK_STATE_LINGER))
return 1;
@ -882,7 +882,7 @@ static int link_enter_set_addresses(Link *link) {
return r;
}
link->link_messages ++;
link->link_messages++;
}
/* now that we can figure out a default address for the dhcp server,
@ -1852,7 +1852,7 @@ static int netdev_join_handler(sd_netlink *rtnl, sd_netlink_message *m, void *us
assert(link);
assert(link->network);
link->enslaving --;
link->enslaving--;
if (IN_SET(link->state, LINK_STATE_FAILED, LINK_STATE_LINGER))
return 1;
@ -1908,7 +1908,7 @@ static int link_enter_join_netdev(Link *link) {
return r;
}
link->enslaving ++;
link->enslaving++;
}
if (link->network->bridge) {
@ -1929,7 +1929,7 @@ static int link_enter_join_netdev(Link *link) {
return r;
}
link->enslaving ++;
link->enslaving++;
}
HASHMAP_FOREACH(netdev, link->network->stacked_netdevs, i) {
@ -1951,7 +1951,7 @@ static int link_enter_join_netdev(Link *link) {
return r;
}
link->enslaving ++;
link->enslaving++;
}
return 0;
@ -2440,7 +2440,7 @@ network_file_fail:
continue;
}
*prefixlen_str ++ = '\0';
*prefixlen_str++ = '\0';
r = sscanf(prefixlen_str, "%hhu", &prefixlen);
if (r != 1) {
@ -2487,7 +2487,7 @@ network_file_fail:
continue;
}
*prefixlen_str ++ = '\0';
*prefixlen_str++ = '\0';
r = sscanf(prefixlen_str, "%hhu/%hhu/%"SCNu32"/%hhu/"USEC_FMT, &prefixlen, &tos, &priority, &table, &lifetime);
if (r != 5) {

View File

@ -33,7 +33,7 @@ static int ndisc_netlink_handler(sd_netlink *rtnl, sd_netlink_message *m, void *
assert(link);
assert(link->ndisc_messages > 0);
link->ndisc_messages --;
link->ndisc_messages--;
r = sd_netlink_message_get_errno(m);
if (r < 0 && r != -EEXIST) {
@ -99,7 +99,7 @@ static void ndisc_prefix_autonomous_handler(sd_ndisc *nd, const struct in6_addr
return;
}
link->ndisc_messages ++;
link->ndisc_messages++;
}
static void ndisc_prefix_onlink_handler(sd_ndisc *nd, const struct in6_addr *prefix, unsigned prefixlen, unsigned lifetime, void *userdata) {
@ -137,7 +137,7 @@ static void ndisc_prefix_onlink_handler(sd_ndisc *nd, const struct in6_addr *pre
return;
}
link->ndisc_messages ++;
link->ndisc_messages++;
}
static void ndisc_router_handler(sd_ndisc *nd, uint8_t flags, const struct in6_addr *gateway, unsigned lifetime, int pref, void *userdata) {
@ -187,7 +187,7 @@ static void ndisc_router_handler(sd_ndisc *nd, uint8_t flags, const struct in6_a
return;
}
link->ndisc_messages ++;
link->ndisc_messages++;
}
static void ndisc_handler(sd_ndisc *nd, int event, void *userdata) {

View File

@ -375,7 +375,7 @@ int config_parse_arp_ip_target_address(const char *unit,
}
LIST_PREPEND(arp_ip_target, b->arp_ip_targets, buffer);
b->n_arp_ip_targets ++;
b->n_arp_ip_targets++;
buffer = NULL;
}

View File

@ -232,7 +232,7 @@ int setup_veth_extra(
if (r < 0)
return r;
idx ++;
idx++;
}
return 0;

View File

@ -2560,7 +2560,7 @@ static int inner_child(
envp[n_env] = strv_find_prefix(environ, "TERM=");
if (envp[n_env])
n_env ++;
n_env++;
if ((asprintf((char**)(envp + n_env++), "HOME=%s", home ? home: "/root") < 0) ||
(asprintf((char**)(envp + n_env++), "USER=%s", arg_user ? arg_user : "root") < 0) ||

View File

@ -66,7 +66,7 @@ static int count_addresses(sd_bus_message *m, int af, unsigned *ret) {
if (af != AF_UNSPEC && family != af)
continue;
c ++;
c++;
}
if (r < 0)
return r;

View File

@ -90,7 +90,7 @@ static int count_addresses(sd_bus_message *m, int af, const char **canonical) {
if (af != AF_UNSPEC && family != af)
continue;
c ++;
c++;
}
if (r < 0)
return r;

View File

@ -188,7 +188,7 @@ static void bus_method_resolve_hostname_complete(DnsQuery *q) {
if (!canonical)
canonical = dns_resource_record_ref(rr);
added ++;
added++;
}
if (added <= 0) {
@ -418,7 +418,7 @@ static void bus_method_resolve_address_complete(DnsQuery *q) {
if (r < 0)
goto finish;
added ++;
added++;
}
if (added <= 0) {
@ -587,7 +587,7 @@ static void bus_method_resolve_record_complete(DnsQuery *q) {
if (r < 0)
goto finish;
added ++;
added++;
}
if (added <= 0) {
@ -1094,9 +1094,9 @@ static void bus_method_resolve_service_complete(DnsQuery *q) {
}
if ((q->flags & SD_RESOLVED_NO_ADDRESS) == 0) {
q->block_all_complete ++;
q->block_all_complete++;
r = resolve_service_hostname(q, rr, ifindex);
q->block_all_complete --;
q->block_all_complete--;
if (r < 0)
goto finish;

View File

@ -538,7 +538,7 @@ int dns_answer_remove_by_key(DnsAnswer **a, const DnsResourceKey *key) {
dns_resource_record_unref((*a)->items[i].rr);
memmove((*a)->items + i, (*a)->items + i + 1, sizeof(DnsAnswerItem) * ((*a)->n_rrs - i - 1));
(*a)->n_rrs --;
(*a)->n_rrs--;
continue;
} else
@ -624,7 +624,7 @@ int dns_answer_remove_by_rr(DnsAnswer **a, DnsResourceRecord *rm) {
dns_resource_record_unref((*a)->items[i].rr);
memmove((*a)->items + i, (*a)->items + i + 1, sizeof(DnsAnswerItem) * ((*a)->n_rrs - i - 1));
(*a)->n_rrs --;
(*a)->n_rrs--;
continue;
} else

View File

@ -640,7 +640,7 @@ int dns_cache_put(
cache_keys = dns_answer_size(answer);
if (key)
cache_keys ++;
cache_keys++;
/* Make some space for our new entries */
dns_cache_make_space(c, cache_keys);
@ -987,7 +987,7 @@ int dns_cache_export_shared_to_packet(DnsCache *cache, DnsPacket *p) {
if (r < 0)
return r;
ancount ++;
ancount++;
}
}

View File

@ -1469,7 +1469,7 @@ static int dns_packet_read_type_window(DnsPacket *p, Bitmap **types, size_t *sta
return r;
}
bit ++;
bit++;
bitmask >>= 1;
}
}

View File

@ -927,7 +927,7 @@ static int dns_query_cname_redirect(DnsQuery *q, const DnsResourceRecord *cname)
assert(q);
q->n_cname_redirects ++;
q->n_cname_redirects++;
if (q->n_cname_redirects > CNAME_MAX)
return -ELOOP;

View File

@ -120,7 +120,7 @@ DnsServer* dns_server_ref(DnsServer *s) {
return NULL;
assert(s->n_ref > 0);
s->n_ref ++;
s->n_ref++;
return s;
}
@ -130,7 +130,7 @@ DnsServer* dns_server_unref(DnsServer *s) {
return NULL;
assert(s->n_ref > 0);
s->n_ref --;
s->n_ref--;
if (s->n_ref > 0)
return NULL;
@ -290,9 +290,9 @@ void dns_server_packet_lost(DnsServer *s, int protocol, DnsServerFeatureLevel le
if (s->possible_feature_level == level) {
if (protocol == IPPROTO_UDP)
s->n_failed_udp ++;
s->n_failed_udp++;
else if (protocol == IPPROTO_TCP)
s->n_failed_tcp ++;
s->n_failed_tcp++;
}
if (s->resend_timeout > usec)

View File

@ -209,7 +209,7 @@ int dns_transaction_new(DnsTransaction **ret, DnsScope *s, DnsResourceKey *key)
LIST_PREPEND(transactions_by_scope, s->transactions, t);
t->scope = s;
s->manager->n_transactions_total ++;
s->manager->n_transactions_total++;
if (ret)
*ret = t;
@ -1375,7 +1375,7 @@ static int dns_transaction_make_packet_mdns(DnsTransaction *t) {
other->state = DNS_TRANSACTION_PENDING;
other->next_attempt_after = ts;
qdcount ++;
qdcount++;
if (dns_key_is_shared(other->key))
add_known_answers = true;

View File

@ -301,7 +301,7 @@ int manager_etc_hosts_read(Manager *m) {
FOREACH_LINE(line, f, return log_error_errno(errno, "Failed to read /etc/hosts: %m")) {
char *l;
nr ++;
nr++;
l = strstrip(line);
if (isempty(l))

View File

@ -158,7 +158,7 @@ static void write_resolv_conf_server(DnsServer *s, FILE *f, unsigned *count) {
if (*count == MAXNS)
fputs("# Too many DNS servers configured, the following entries may be ignored.\n", f);
(*count) ++;
(*count)++;
fprintf(f, "nameserver %s\n", s->server_string);
}
@ -184,7 +184,7 @@ static void write_resolv_conf_search(
}
(*length) += strlen(domain);
(*count) ++;
(*count)++;
fputc(' ', f);
fputs(domain, f);

View File

@ -1412,7 +1412,7 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
return bus_log_create_error(r);
field = strndupa(assignment, eq - assignment);
eq ++;
eq++;
if (streq(field, "CPUQuota")) {

View File

@ -180,7 +180,7 @@ int dns_label_unescape_suffix(const char *name, const char **label_terminal, cha
unsigned slashes = 0;
for (y = terminal - 1; y >= name && *y == '\\'; y--)
slashes ++;
slashes++;
if (slashes % 2 == 0) {
/* The '.' was not escaped */
@ -192,7 +192,7 @@ int dns_label_unescape_suffix(const char *name, const char **label_terminal, cha
}
}
terminal --;
terminal--;
}
r = dns_label_unescape(&name, dest, sz);
@ -1172,7 +1172,7 @@ int dns_name_skip(const char *a, unsigned n_labels, const char **ret) {
assert(a);
assert(ret);
for (; n_labels > 0; n_labels --) {
for (; n_labels > 0; n_labels--) {
r = dns_name_parent(&a);
if (r < 0)
return r;

View File

@ -997,7 +997,7 @@ static int show_journal(FILE *f,
continue;
}
line ++;
line++;
maybe_print_begin_newline(f, &flags);
r = output_journal(f, j, mode, n_columns, flags, ellipsized);

View File

@ -54,7 +54,7 @@ static void uid_range_coalesce(UidRange **p, unsigned *n) {
if (*n > j+1)
memmove(y, y+1, sizeof(UidRange) * (*n - j -1));
(*n) --;
(*n)--;
j--;
}
}

View File

@ -427,7 +427,7 @@ static int resolve_remote(Connection *c) {
service = strrchr(arg_remote_host, ':');
if (service) {
node = strndupa(arg_remote_host, service - arg_remote_host);
service ++;
service++;
} else {
node = arg_remote_host;
service = "80";

View File

@ -1436,7 +1436,7 @@ static int list_unit_files(int argc, char *argv[], void *userdata) {
};
if (output_show_unit_file(&units[c], strv_skip(argv, 1)))
c ++;
c++;
}
if (r < 0)
@ -6710,11 +6710,11 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
break;
case ARG_FORCE:
arg_force ++;
arg_force++;
break;
case 'f':
arg_force ++;
arg_force++;
break;
case ARG_NO_RELOAD:
@ -7180,7 +7180,7 @@ static int telinit_parse_argv(int argc, char *argv[]) {
arg_action = table[i].to;
optind ++;
optind++;
return 1;
}

View File

@ -220,7 +220,7 @@ int main(int argc, char *argv[]) {
/* Ensure TIME_T_MAX works correctly */
x = (uintmax_t) TIME_T_MAX;
x ++;
x++;
assert((time_t) x < 0);
return 0;