X Tutup
Skip to content

Commit 313cefa

Browse files
author
Vito Caputo
committed
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.
1 parent c4bcaa4 commit 313cefa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+222
-222
lines changed

src/activate/activate.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static int open_sockets(int *epoll_fd, bool accept) {
7777
if (r < 0)
7878
return r;
7979

80-
count ++;
80+
count++;
8181
}
8282
}
8383

@@ -105,7 +105,7 @@ static int open_sockets(int *epoll_fd, bool accept) {
105105
}
106106

107107
assert(fd == SD_LISTEN_FDS_START + count);
108-
count ++;
108+
count++;
109109
}
110110

111111
if (arg_listen)
@@ -176,7 +176,7 @@ static int exec_process(const char* name, char **argv, char **env, int start_fd,
176176
if (!envp[n_env])
177177
return log_oom();
178178

179-
n_env ++;
179+
n_env++;
180180
}
181181
}
182182

@@ -191,7 +191,7 @@ static int exec_process(const char* name, char **argv, char **env, int start_fd,
191191
if (!envp[n_env])
192192
return log_oom();
193193

194-
n_env ++;
194+
n_env++;
195195
}
196196

197197
if (arg_inetd) {

src/analyze/analyze-verify.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ int verify_units(char **filenames, ManagerRunningAs running_as, bool check_man)
290290
if (r == 0)
291291
r = k;
292292
} else
293-
count ++;
293+
count++;
294294
}
295295

296296
for (i = 0; i < count; i++) {

src/basic/calendarspec.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ static int find_next(const CalendarSpec *spec, struct tm *tm, usec_t *usec) {
10041004
c.tm_hour = c.tm_min = c.tm_sec = tm_usec = 0;
10051005
}
10061006
if (r < 0 || tm_out_of_bounds(&c, spec->utc)) {
1007-
c.tm_year ++;
1007+
c.tm_year++;
10081008
c.tm_mon = 0;
10091009
c.tm_mday = 1;
10101010
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) {
10151015
if (r > 0)
10161016
c.tm_hour = c.tm_min = c.tm_sec = tm_usec = 0;
10171017
if (r < 0 || tm_out_of_bounds(&c, spec->utc)) {
1018-
c.tm_mon ++;
1018+
c.tm_mon++;
10191019
c.tm_mday = 1;
10201020
c.tm_hour = c.tm_min = c.tm_sec = tm_usec = 0;
10211021
continue;
@@ -1031,7 +1031,7 @@ static int find_next(const CalendarSpec *spec, struct tm *tm, usec_t *usec) {
10311031
if (r > 0)
10321032
c.tm_min = c.tm_sec = tm_usec = 0;
10331033
if (r < 0 || tm_out_of_bounds(&c, spec->utc)) {
1034-
c.tm_mday ++;
1034+
c.tm_mday++;
10351035
c.tm_hour = c.tm_min = c.tm_sec = tm_usec = 0;
10361036
continue;
10371037
}
@@ -1040,7 +1040,7 @@ static int find_next(const CalendarSpec *spec, struct tm *tm, usec_t *usec) {
10401040
if (r > 0)
10411041
c.tm_sec = tm_usec = 0;
10421042
if (r < 0 || tm_out_of_bounds(&c, spec->utc)) {
1043-
c.tm_hour ++;
1043+
c.tm_hour++;
10441044
c.tm_min = c.tm_sec = tm_usec = 0;
10451045
continue;
10461046
}
@@ -1051,7 +1051,7 @@ static int find_next(const CalendarSpec *spec, struct tm *tm, usec_t *usec) {
10511051
c.tm_sec /= USEC_PER_SEC;
10521052

10531053
if (r < 0 || tm_out_of_bounds(&c, spec->utc)) {
1054-
c.tm_min ++;
1054+
c.tm_min++;
10551055
c.tm_sec = tm_usec = 0;
10561056
continue;
10571057
}

src/basic/extract-word.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ int extract_first_word(const char **p, char **ret, const char *separators, Extra
6363
if (!GREEDY_REALLOC(s, allocated, sz+1))
6464
return -ENOMEM;
6565

66-
for (;; (*p) ++, c = **p) {
66+
for (;; (*p)++, c = **p) {
6767
if (c == 0)
6868
goto finish_force_terminate;
6969
else if (strchr(separators, c)) {
7070
if (flags & EXTRACT_DONT_COALESCE_SEPARATORS) {
71-
(*p) ++;
71+
(*p)++;
7272
goto finish_force_next;
7373
}
7474
} else {
@@ -81,7 +81,7 @@ int extract_first_word(const char **p, char **ret, const char *separators, Extra
8181
}
8282
}
8383

84-
for (;; (*p) ++, c = **p) {
84+
for (;; (*p)++, c = **p) {
8585
if (backslash) {
8686
if (!GREEDY_REALLOC(s, allocated, sz+7))
8787
return -ENOMEM;
@@ -129,7 +129,7 @@ int extract_first_word(const char **p, char **ret, const char *separators, Extra
129129
backslash = false;
130130

131131
} else if (quote) { /* inside either single or double quotes */
132-
for (;; (*p) ++, c = **p) {
132+
for (;; (*p)++, c = **p) {
133133
if (c == 0) {
134134
if (flags & EXTRACT_RELAX)
135135
goto finish_force_terminate;
@@ -149,7 +149,7 @@ int extract_first_word(const char **p, char **ret, const char *separators, Extra
149149
}
150150

151151
} else {
152-
for (;; (*p) ++, c = **p) {
152+
for (;; (*p)++, c = **p) {
153153
if (c == 0)
154154
goto finish_force_terminate;
155155
else if ((c == '\'' || c == '"') && (flags & EXTRACT_QUOTES)) {
@@ -160,11 +160,11 @@ int extract_first_word(const char **p, char **ret, const char *separators, Extra
160160
break;
161161
} else if (strchr(separators, c)) {
162162
if (flags & EXTRACT_DONT_COALESCE_SEPARATORS) {
163-
(*p) ++;
163+
(*p)++;
164164
goto finish_force_next;
165165
}
166166
/* Skip additional coalesced separators. */
167-
for (;; (*p) ++, c = **p) {
167+
for (;; (*p)++, c = **p) {
168168
if (c == 0)
169169
goto finish_force_terminate;
170170
if (!strchr(separators, c))

src/basic/fileio.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ static int parse_env_file_internal(
352352
case KEY:
353353
if (strchr(newline, c)) {
354354
state = PRE_KEY;
355-
line ++;
355+
line++;
356356
n_key = 0;
357357
} else if (c == '=') {
358358
state = PRE_VALUE;
@@ -376,7 +376,7 @@ static int parse_env_file_internal(
376376
case PRE_VALUE:
377377
if (strchr(newline, c)) {
378378
state = PRE_KEY;
379-
line ++;
379+
line++;
380380
key[n_key] = 0;
381381

382382
if (value)
@@ -416,7 +416,7 @@ static int parse_env_file_internal(
416416
case VALUE:
417417
if (strchr(newline, c)) {
418418
state = PRE_KEY;
419-
line ++;
419+
line++;
420420

421421
key[n_key] = 0;
422422

@@ -535,7 +535,7 @@ static int parse_env_file_internal(
535535
state = COMMENT_ESCAPE;
536536
else if (strchr(newline, c)) {
537537
state = PRE_KEY;
538-
line ++;
538+
line++;
539539
}
540540
break;
541541

@@ -908,7 +908,7 @@ int get_proc_field(const char *filename, const char *pattern, const char *termin
908908
/* Back off one char if there's nothing but whitespace
909909
and zeros */
910910
if (!*t || isspace(*t))
911-
t --;
911+
t--;
912912
}
913913

914914
len = strcspn(t, terminator);

src/basic/hexdecoct.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ int unbase32hexmem(const char *p, size_t l, bool padding, void **mem, size_t *_l
276276
if (padding) {
277277
/* strip the padding */
278278
while (l > 0 && p[l - 1] == '=' && pad < 7) {
279-
pad ++;
280-
l --;
279+
pad++;
280+
l--;
281281
}
282282
}
283283

@@ -505,7 +505,7 @@ int unbase64char(char c) {
505505
if (c == '+')
506506
return offset;
507507

508-
offset ++;
508+
offset++;
509509

510510
if (c == '/')
511511
return offset;
@@ -621,9 +621,9 @@ int unbase64mem(const char *p, size_t l, void **mem, size_t *_len) {
621621

622622
/* strip the padding */
623623
if (l > 0 && p[l - 1] == '=')
624-
l --;
624+
l--;
625625
if (l > 0 && p[l - 1] == '=')
626-
l --;
626+
l--;
627627

628628
/* a group of four input bytes needs three output bytes, in case of
629629
padding we need to add two or three extra bytes */

src/basic/hostname-util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ bool hostname_is_valid(const char *s, bool allow_trailing_dot) {
123123
return false;
124124

125125
dot = true;
126-
n_dots ++;
126+
n_dots++;
127127
} else {
128128
if (!hostname_valid_char(*p))
129129
return false;

src/basic/io-util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ ssize_t sparse_write(int fd, const void *p, size_t sz, size_t run_length) {
249249
} else if (n > 0)
250250
q += n;
251251
else
252-
q ++;
252+
q++;
253253
}
254254

255255
if (q > w) {

src/basic/strbuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static void bubbleinsert(struct strbuf_node *node,
121121
sizeof(struct strbuf_child_entry) * (node->children_count - left));
122122
node->children[left] = new;
123123

124-
node->children_count ++;
124+
node->children_count++;
125125
}
126126

127127
/* add string, return the index/offset into the buffer */

src/basic/string-util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ char *ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigne
477477
}
478478

479479
if (k > x) /* last character was wide and went over quota */
480-
x ++;
480+
x++;
481481

482482
for (j = s + old_length; k < new_length && j > i; ) {
483483
char32_t c;

0 commit comments

Comments
 (0)
X Tutup