tree-wide: minor formatting inconsistency cleanups

This commit is contained in:
Vito Caputo 2016-02-23 09:52:52 -08:00
parent c550f7a9b8
commit 9ed794a32d
46 changed files with 76 additions and 76 deletions

View File

@ -60,7 +60,7 @@
svg(" <text class=\"%s\" x=\"%.03f\" y=\"%.03f\">", (b) ? "left" : "right", SCALE_X * (x) + (b ? 5.0 : -5.0), SCALE_Y * (y) + 14.0); \ svg(" <text class=\"%s\" x=\"%.03f\" y=\"%.03f\">", (b) ? "left" : "right", SCALE_X * (x) + (b ? 5.0 : -5.0), SCALE_Y * (y) + 14.0); \
svg(format, ## __VA_ARGS__); \ svg(format, ## __VA_ARGS__); \
svg("</text>\n"); \ svg("</text>\n"); \
} while(false) } while (false)
static enum dot { static enum dot {
DEP_ALL, DEP_ALL,

View File

@ -50,7 +50,7 @@ uint32_t MurmurHash2 ( const void * key, int len, uint32_t seed )
const unsigned char * data = (const unsigned char *)key; const unsigned char * data = (const unsigned char *)key;
while(len >= 4) while (len >= 4)
{ {
uint32_t k = *(uint32_t*)data; uint32_t k = *(uint32_t*)data;

View File

@ -114,7 +114,7 @@ static void sort_chain(CalendarComponent **c) {
static void fix_year(CalendarComponent *c) { static void fix_year(CalendarComponent *c) {
/* Turns 12 → 2012, 89 → 1989 */ /* Turns 12 → 2012, 89 → 1989 */
while(c) { while (c) {
CalendarComponent *n = c->next; CalendarComponent *n = c->next;
if (c->value >= 0 && c->value < 70) if (c->value >= 0 && c->value < 70)

View File

@ -1248,7 +1248,7 @@ int cg_pid_get_path_shifted(pid_t pid, const char *root, char **cgroup) {
return 0; return 0;
} }
int cg_path_decode_unit(const char *cgroup, char **unit){ int cg_path_decode_unit(const char *cgroup, char **unit) {
char *c, *s; char *c, *s;
size_t n; size_t n;

View File

@ -46,7 +46,7 @@ ssize_t sparse_write(int fd, const void *p, size_t sz, size_t run_length);
char *_s = (char *)(s); \ char *_s = (char *)(s); \
_i->iov_base = _s; \ _i->iov_base = _s; \
_i->iov_len = strlen(_s); \ _i->iov_len = strlen(_s); \
} while(false) } while (false)
static inline size_t IOVEC_TOTAL_SIZE(const struct iovec *i, unsigned n) { static inline size_t IOVEC_TOTAL_SIZE(const struct iovec *i, unsigned n) {
unsigned j; unsigned j;

View File

@ -32,7 +32,7 @@
#define LIST_HEAD_INIT(head) \ #define LIST_HEAD_INIT(head) \
do { \ do { \
(head) = NULL; } \ (head) = NULL; } \
while(false) while (false)
/* Initialize a list item */ /* Initialize a list item */
#define LIST_INIT(name,item) \ #define LIST_INIT(name,item) \
@ -40,7 +40,7 @@
typeof(*(item)) *_item = (item); \ typeof(*(item)) *_item = (item); \
assert(_item); \ assert(_item); \
_item->name##_prev = _item->name##_next = NULL; \ _item->name##_prev = _item->name##_next = NULL; \
} while(false) } while (false)
/* Prepend an item to the list */ /* Prepend an item to the list */
#define LIST_PREPEND(name,head,item) \ #define LIST_PREPEND(name,head,item) \
@ -51,7 +51,7 @@
_item->name##_next->name##_prev = _item; \ _item->name##_next->name##_prev = _item; \
_item->name##_prev = NULL; \ _item->name##_prev = NULL; \
*_head = _item; \ *_head = _item; \
} while(false) } while (false)
/* Append an item to the list */ /* Append an item to the list */
#define LIST_APPEND(name,head,item) \ #define LIST_APPEND(name,head,item) \
@ -59,7 +59,7 @@
typeof(*(head)) *_tail; \ typeof(*(head)) *_tail; \
LIST_FIND_TAIL(name,head,_tail); \ LIST_FIND_TAIL(name,head,_tail); \
LIST_INSERT_AFTER(name,head,_tail,item); \ LIST_INSERT_AFTER(name,head,_tail,item); \
} while(false) } while (false)
/* Remove an item from the list */ /* Remove an item from the list */
#define LIST_REMOVE(name,head,item) \ #define LIST_REMOVE(name,head,item) \
@ -75,7 +75,7 @@
*_head = _item->name##_next; \ *_head = _item->name##_next; \
} \ } \
_item->name##_next = _item->name##_prev = NULL; \ _item->name##_next = _item->name##_prev = NULL; \
} while(false) } while (false)
/* Find the head of the list */ /* Find the head of the list */
#define LIST_FIND_HEAD(name,item,head) \ #define LIST_FIND_HEAD(name,item,head) \
@ -119,7 +119,7 @@
_b->name##_prev = _a; \ _b->name##_prev = _a; \
_a->name##_next = _b; \ _a->name##_next = _b; \
} \ } \
} while(false) } while (false)
/* Insert an item before another one (a = where, b = what) */ /* Insert an item before another one (a = where, b = what) */
#define LIST_INSERT_BEFORE(name,head,a,b) \ #define LIST_INSERT_BEFORE(name,head,a,b) \
@ -145,7 +145,7 @@
_b->name##_next = _a; \ _b->name##_next = _a; \
_a->name##_prev = _b; \ _a->name##_prev = _b; \
} \ } \
} while(false) } while (false)
#define LIST_JUST_US(name,item) \ #define LIST_JUST_US(name,item) \
(!(item)->name##_prev && !(item)->name##_next) \ (!(item)->name##_prev && !(item)->name##_next) \

View File

@ -193,7 +193,7 @@ void log_assert_failed_return(
#ifdef LOG_TRACE #ifdef LOG_TRACE
# define log_trace(...) log_debug(__VA_ARGS__) # define log_trace(...) log_debug(__VA_ARGS__)
#else #else
# define log_trace(...) do {} while(0) # define log_trace(...) do {} while (0)
#endif #endif
/* Structured logging */ /* Structured logging */

View File

@ -224,7 +224,7 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) {
/* We override the glibc assert() here. */ /* We override the glibc assert() here. */
#undef assert #undef assert
#ifdef NDEBUG #ifdef NDEBUG
#define assert(expr) do {} while(false) #define assert(expr) do {} while (false)
#else #else
#define assert(expr) assert_message_se(expr, #expr) #define assert(expr) assert_message_se(expr, #expr)
#endif #endif

View File

@ -505,7 +505,7 @@ int parse_fractional_part_u(const char **p, size_t digits, unsigned *res) {
s = *p; s = *p;
/* accept any number of digits, strtoull is limted to 19 */ /* accept any number of digits, strtoull is limted to 19 */
for(i=0; i < digits; i++,s++) { for (i=0; i < digits; i++,s++) {
if (*s < '0' || *s > '9') { if (*s < '0' || *s > '9') {
if (i == 0) if (i == 0)
return -EINVAL; return -EINVAL;

View File

@ -73,4 +73,4 @@ do { \
assert_not_reached("Unknown format string argument."); \ assert_not_reached("Unknown format string argument."); \
} \ } \
} \ } \
} while(false) } while (false)

View File

@ -281,9 +281,9 @@ EFI_STATUS graphics_splash(UINT8 *content, UINTN len, const EFI_GRAPHICS_OUTPUT_
if (EFI_ERROR(err)) if (EFI_ERROR(err))
goto err; goto err;
if(dib->x < GraphicsOutput->Mode->Info->HorizontalResolution) if (dib->x < GraphicsOutput->Mode->Info->HorizontalResolution)
x_pos = (GraphicsOutput->Mode->Info->HorizontalResolution - dib->x) / 2; x_pos = (GraphicsOutput->Mode->Info->HorizontalResolution - dib->x) / 2;
if(dib->y < GraphicsOutput->Mode->Info->VerticalResolution) if (dib->y < GraphicsOutput->Mode->Info->VerticalResolution)
y_pos = (GraphicsOutput->Mode->Info->VerticalResolution - dib->y) / 2; y_pos = (GraphicsOutput->Mode->Info->VerticalResolution - dib->y) / 2;
uefi_call_wrapper(GraphicsOutput->Blt, 10, GraphicsOutput, uefi_call_wrapper(GraphicsOutput->Blt, 10, GraphicsOutput,

View File

@ -119,7 +119,7 @@ int config_parse_unit_deps(
assert(rvalue); assert(rvalue);
p = rvalue; p = rvalue;
for(;;) { for (;;) {
_cleanup_free_ char *word = NULL, *k = NULL; _cleanup_free_ char *word = NULL, *k = NULL;
int r; int r;
@ -1599,7 +1599,7 @@ int config_parse_service_sockets(
assert(data); assert(data);
p = rvalue; p = rvalue;
for(;;) { for (;;) {
_cleanup_free_ char *word = NULL, *k = NULL; _cleanup_free_ char *word = NULL, *k = NULL;
r = extract_first_word(&p, &word, NULL, 0); r = extract_first_word(&p, &word, NULL, 0);
@ -3361,7 +3361,7 @@ int config_parse_protect_home(
ProtectHome h; ProtectHome h;
h = protect_home_from_string(rvalue); h = protect_home_from_string(rvalue);
if (h < 0){ if (h < 0) {
log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse protect home value, ignoring: %s", rvalue); log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse protect home value, ignoring: %s", rvalue);
return 0; return 0;
} }
@ -3404,7 +3404,7 @@ int config_parse_protect_system(
ProtectSystem s; ProtectSystem s;
s = protect_system_from_string(rvalue); s = protect_system_from_string(rvalue);
if (s < 0){ if (s < 0) {
log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse protect system value, ignoring: %s", rvalue); log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse protect system value, ignoring: %s", rvalue);
return 0; return 0;
} }

View File

@ -431,7 +431,7 @@ finish:
hashmap_free_free(top); hashmap_free_free(top);
hashmap_free_free(bottom); hashmap_free_free(bottom);
HASHMAP_FOREACH_KEY(h, key, drops, i){ HASHMAP_FOREACH_KEY(h, key, drops, i) {
hashmap_free_free(hashmap_remove(drops, key)); hashmap_free_free(hashmap_remove(drops, key));
hashmap_remove(drops, key); hashmap_remove(drops, key);
free(key); free(key);

View File

@ -391,7 +391,7 @@
entry = document.getElementById("tableentry"); entry = document.getElementById("tableentry");
var buf = ""; var buf = "";
for (var key in d){ for (var key in d) {
var data = d[key]; var data = d[key];
if (data == null) if (data == null)

View File

@ -75,7 +75,7 @@ static void close_fd_input(Uploader *u);
curl_easy_strerror(code)); \ curl_easy_strerror(code)); \
cmd; \ cmd; \
} \ } \
} while(0) } while (0)
static size_t output_callback(char *buf, static size_t output_callback(char *buf,
size_t size, size_t size,

View File

@ -50,7 +50,7 @@
*_f = alloca(_fl + 10); \ *_f = alloca(_fl + 10); \
memcpy(*_f, "CODE_FUNC=", 10); \ memcpy(*_f, "CODE_FUNC=", 10); \
memcpy(*_f + 10, _func, _fl); \ memcpy(*_f + 10, _func, _fl); \
} while(false) } while (false)
/* We open a single fd, and we'll share it with the current process, /* We open a single fd, and we'll share it with the current process,
* all its threads, and all its subprocesses. This means we need to * all its threads, and all its subprocesses. This means we need to

View File

@ -97,20 +97,20 @@ static void flush_progress(void) {
fflush(stdout); fflush(stdout);
} }
#define debug(_offset, _fmt, ...) do{ \ #define debug(_offset, _fmt, ...) do { \
flush_progress(); \ flush_progress(); \
log_debug(OFSfmt": " _fmt, _offset, ##__VA_ARGS__); \ log_debug(OFSfmt": " _fmt, _offset, ##__VA_ARGS__); \
} while(0) } while (0)
#define warning(_offset, _fmt, ...) do{ \ #define warning(_offset, _fmt, ...) do { \
flush_progress(); \ flush_progress(); \
log_warning(OFSfmt": " _fmt, _offset, ##__VA_ARGS__); \ log_warning(OFSfmt": " _fmt, _offset, ##__VA_ARGS__); \
} while(0) } while (0)
#define error(_offset, _fmt, ...) do{ \ #define error(_offset, _fmt, ...) do { \
flush_progress(); \ flush_progress(); \
log_error(OFSfmt": " _fmt, (uint64_t)_offset, ##__VA_ARGS__); \ log_error(OFSfmt": " _fmt, (uint64_t)_offset, ##__VA_ARGS__); \
} while(0) } while (0)
static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o) { static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o) {
uint64_t i; uint64_t i;

View File

@ -1407,7 +1407,7 @@ static int server_parse_proc_cmdline(Server *s) {
} }
p = line; p = line;
for(;;) { for (;;) {
_cleanup_free_ char *word = NULL; _cleanup_free_ char *word = NULL;
r = extract_first_word(&p, &word, NULL, 0); r = extract_first_word(&p, &word, NULL, 0);

View File

@ -1063,7 +1063,7 @@ _public_ int sd_journal_test_cursor(sd_journal *j, const char *cursor) {
if (r < 0) if (r < 0)
return r; return r;
for(;;) { for (;;) {
_cleanup_free_ char *item = NULL; _cleanup_free_ char *item = NULL;
unsigned long long ll; unsigned long long ll;
sd_id128_t id; sd_id128_t id;

View File

@ -482,7 +482,7 @@ int deserialize_dhcp_routes(struct sd_dhcp_route **ret, size_t *ret_size, size_t
return -ENOMEM; return -ENOMEM;
entry = strndup(word, len); entry = strndup(word, len);
if(!entry) if (!entry)
return -ENOMEM; return -ENOMEM;
tok = entry; tok = entry;

View File

@ -456,7 +456,7 @@ int sd_ipv4acd_set_callback(sd_ipv4acd *ll, sd_ipv4acd_callback_t cb, void *user
return 0; return 0;
} }
int sd_ipv4acd_set_address(sd_ipv4acd *ll, const struct in_addr *address){ int sd_ipv4acd_set_address(sd_ipv4acd *ll, const struct in_addr *address) {
assert_return(ll, -EINVAL); assert_return(ll, -EINVAL);
assert_return(address, -EINVAL); assert_return(address, -EINVAL);
assert_return(ll->state == IPV4ACD_STATE_INIT, -EBUSY); assert_return(ll->state == IPV4ACD_STATE_INIT, -EBUSY);

View File

@ -181,7 +181,7 @@ int sd_ipv4ll_set_callback(sd_ipv4ll *ll, sd_ipv4ll_callback_t cb, void *userdat
return 0; return 0;
} }
int sd_ipv4ll_get_address(sd_ipv4ll *ll, struct in_addr *address){ int sd_ipv4ll_get_address(sd_ipv4ll *ll, struct in_addr *address) {
assert_return(ll, -EINVAL); assert_return(ll, -EINVAL);
assert_return(address, -EINVAL); assert_return(address, -EINVAL);

View File

@ -145,7 +145,7 @@ static int add_enumerated_to_set(
continue; continue;
} }
if (!object_path_is_valid(*k)){ if (!object_path_is_valid(*k)) {
free(*k); free(*k);
r = -EINVAL; r = -EINVAL;
continue; continue;

View File

@ -528,7 +528,7 @@ static int netlink_message_read_internal(sd_netlink_message *m, unsigned short t
attribute = &m->containers[m->n_containers].attributes[type]; attribute = &m->containers[m->n_containers].attributes[type];
if(!attribute->offset) if (!attribute->offset)
return -ENODATA; return -ENODATA;
rta = (struct rtattr*)((uint8_t *) m->hdr + attribute->offset); rta = (struct rtattr*)((uint8_t *) m->hdr + attribute->offset);
@ -735,7 +735,7 @@ static int netlink_container_parse(sd_netlink_message *m,
_cleanup_free_ struct netlink_attribute *attributes = NULL; _cleanup_free_ struct netlink_attribute *attributes = NULL;
attributes = new0(struct netlink_attribute, count); attributes = new0(struct netlink_attribute, count);
if(!attributes) if (!attributes)
return -ENOMEM; return -ENOMEM;
for (; RTA_OK(rta, rt_len); rta = RTA_NEXT(rta, rt_len)) { for (; RTA_OK(rta, rt_len); rta = RTA_NEXT(rta, rt_len)) {

View File

@ -310,7 +310,7 @@ int machine_load(Machine *m) {
int *ni = NULL; int *ni = NULL;
p = netif; p = netif;
for(;;) { for (;;) {
_cleanup_free_ char *word = NULL; _cleanup_free_ char *word = NULL;
int ifi; int ifi;

View File

@ -1212,7 +1212,7 @@ int match_properties_changed(sd_bus_message *message, void *userdata, sd_bus_err
r = unit_name_from_dbus_path(path, &unit); r = unit_name_from_dbus_path(path, &unit);
if (r == -EINVAL) /* not for a unit */ if (r == -EINVAL) /* not for a unit */
return 0; return 0;
if (r < 0){ if (r < 0) {
log_oom(); log_oom();
return 0; return 0;
} }

View File

@ -37,7 +37,7 @@ int fdb_entry_new_static(Network *const network,
assert(network); assert(network);
/* search entry in hashmap first. */ /* search entry in hashmap first. */
if(section) { if (section) {
fdb_entry = hashmap_get(network->fdb_entries_by_section, UINT_TO_PTR(section)); fdb_entry = hashmap_get(network->fdb_entries_by_section, UINT_TO_PTR(section));
if (fdb_entry) { if (fdb_entry) {
*ret = fdb_entry; *ret = fdb_entry;
@ -141,10 +141,10 @@ int fdb_entry_configure(Link *const link, FdbEntry *const fdb_entry) {
/* remove and FDB entry. */ /* remove and FDB entry. */
void fdb_entry_free(FdbEntry *fdb_entry) { void fdb_entry_free(FdbEntry *fdb_entry) {
if(!fdb_entry) if (!fdb_entry)
return; return;
if(fdb_entry->network) { if (fdb_entry->network) {
LIST_REMOVE(static_fdb_entries, fdb_entry->network->static_fdb_entries, LIST_REMOVE(static_fdb_entries, fdb_entry->network->static_fdb_entries,
fdb_entry); fdb_entry);

View File

@ -165,7 +165,7 @@ static int ipv4ll_address_claimed(sd_ipv4ll *ll, Link *link) {
return 0; return 0;
} }
static void ipv4ll_handler(sd_ipv4ll *ll, int event, void *userdata){ static void ipv4ll_handler(sd_ipv4ll *ll, int event, void *userdata) {
Link *link = userdata; Link *link = userdata;
int r; int r;

View File

@ -1031,7 +1031,7 @@ static int link_set_bridge_fdb(Link *const link) {
LIST_FOREACH(static_fdb_entries, fdb_entry, link->network->static_fdb_entries) { LIST_FOREACH(static_fdb_entries, fdb_entry, link->network->static_fdb_entries) {
r = fdb_entry_configure(link, fdb_entry); r = fdb_entry_configure(link, fdb_entry);
if(r < 0) { if (r < 0) {
log_link_error_errno(link, r, "Failed to add MAC entry to static MAC table: %m"); log_link_error_errno(link, r, "Failed to add MAC entry to static MAC table: %m");
break; break;
} }
@ -1836,7 +1836,7 @@ static int link_joined(Link *link) {
} }
} }
if(link->network->bridge) { if (link->network->bridge) {
r = link_set_bridge(link); r = link_set_bridge(link);
if (r < 0) if (r < 0)
log_link_error_errno(link, r, "Could not set bridge message: %m"); log_link_error_errno(link, r, "Could not set bridge message: %m");

View File

@ -88,7 +88,7 @@ static int netdev_tuntap_add(NetDev *netdev, struct ifreq *ifr) {
assert(t); assert(t);
if(t->user_name) { if (t->user_name) {
user = t->user_name; user = t->user_name;
@ -127,7 +127,7 @@ static int netdev_create_tuntap(NetDev *netdev) {
int r; int r;
r = netdev_fill_tuntap_message(netdev, &ifr); r = netdev_fill_tuntap_message(netdev, &ifr);
if(r < 0) if (r < 0)
return r; return r;
return netdev_tuntap_add(netdev, &ifr); return netdev_tuntap_add(netdev, &ifr);

View File

@ -54,13 +54,13 @@ static int netdev_vxlan_fill_message_create(NetDev *netdev, Link *link, sd_netli
if (r < 0) if (r < 0)
return log_netdev_error_errno(netdev, r, "Could not append IFLA_VXLAN_LINK attribute: %m"); return log_netdev_error_errno(netdev, r, "Could not append IFLA_VXLAN_LINK attribute: %m");
if(v->ttl) { if (v->ttl) {
r = sd_netlink_message_append_u8(m, IFLA_VXLAN_TTL, v->ttl); r = sd_netlink_message_append_u8(m, IFLA_VXLAN_TTL, v->ttl);
if (r < 0) if (r < 0)
return log_netdev_error_errno(netdev, r, "Could not append IFLA_VXLAN_TTL attribute: %m"); return log_netdev_error_errno(netdev, r, "Could not append IFLA_VXLAN_TTL attribute: %m");
} }
if(v->tos) { if (v->tos) {
r = sd_netlink_message_append_u8(m, IFLA_VXLAN_TOS, v->tos); r = sd_netlink_message_append_u8(m, IFLA_VXLAN_TOS, v->tos);
if (r < 0) if (r < 0)
return log_netdev_error_errno(netdev, r, "Could not append IFLA_VXLAN_TOS attribute: %m"); return log_netdev_error_errno(netdev, r, "Could not append IFLA_VXLAN_TOS attribute: %m");
@ -86,7 +86,7 @@ static int netdev_vxlan_fill_message_create(NetDev *netdev, Link *link, sd_netli
if (r < 0) if (r < 0)
return log_netdev_error_errno(netdev, r, "Could not append IFLA_VXLAN_L3MISS attribute: %m"); return log_netdev_error_errno(netdev, r, "Could not append IFLA_VXLAN_L3MISS attribute: %m");
if(v->fdb_ageing) { if (v->fdb_ageing) {
r = sd_netlink_message_append_u32(m, IFLA_VXLAN_AGEING, v->fdb_ageing / USEC_PER_SEC); r = sd_netlink_message_append_u32(m, IFLA_VXLAN_AGEING, v->fdb_ageing / USEC_PER_SEC);
if (r < 0) if (r < 0)
return log_netdev_error_errno(netdev, r, "Could not append IFLA_VXLAN_AGEING attribute: %m"); return log_netdev_error_errno(netdev, r, "Could not append IFLA_VXLAN_AGEING attribute: %m");

View File

@ -561,7 +561,7 @@ static int parse_argv(int argc, char *argv[]) {
case ARG_CAPABILITY: case ARG_CAPABILITY:
case ARG_DROP_CAPABILITY: { case ARG_DROP_CAPABILITY: {
p = optarg; p = optarg;
for(;;) { for (;;) {
_cleanup_free_ char *t = NULL; _cleanup_free_ char *t = NULL;
r = extract_first_word(&p, &t, ",", 0); r = extract_first_word(&p, &t, ",", 0);
@ -3618,7 +3618,7 @@ int main(int argc, char *argv[]) {
/* We failed to wait for the container, or the /* We failed to wait for the container, or the
* container exited abnormally */ * container exited abnormally */
goto finish; goto finish;
else if (r > 0 || container_status == CONTAINER_TERMINATED){ else if (r > 0 || container_status == CONTAINER_TERMINATED) {
/* The container exited with a non-zero /* The container exited with a non-zero
* status, or with zero status and no reboot * status, or with zero status and no reboot
* was requested. */ * was requested. */

View File

@ -59,7 +59,7 @@ int manager_parse_dns_server_string_and_warn(Manager *m, DnsServerType type, con
assert(m); assert(m);
assert(string); assert(string);
for(;;) { for (;;) {
_cleanup_free_ char *word = NULL; _cleanup_free_ char *word = NULL;
r = extract_first_word(&string, &word, NULL, 0); r = extract_first_word(&string, &word, NULL, 0);
@ -114,7 +114,7 @@ int manager_parse_search_domains_and_warn(Manager *m, const char *string) {
assert(m); assert(m);
assert(string); assert(string);
for(;;) { for (;;) {
_cleanup_free_ char *word = NULL; _cleanup_free_ char *word = NULL;
r = extract_first_word(&string, &word, NULL, EXTRACT_QUOTES); r = extract_first_word(&string, &word, NULL, EXTRACT_QUOTES);

View File

@ -38,8 +38,8 @@ static void rewind_dns_packet(DnsPacketRewinder *rewinder) {
dns_packet_rewind(rewinder->packet, rewinder->saved_rindex); dns_packet_rewind(rewinder->packet, rewinder->saved_rindex);
} }
#define INIT_REWINDER(rewinder, p) do { rewinder.packet = p; rewinder.saved_rindex = p->rindex; } while(0) #define INIT_REWINDER(rewinder, p) do { rewinder.packet = p; rewinder.saved_rindex = p->rindex; } while (0)
#define CANCEL_REWINDER(rewinder) do { rewinder.packet = NULL; } while(0) #define CANCEL_REWINDER(rewinder) do { rewinder.packet = NULL; } while (0)
int dns_packet_new(DnsPacket **ret, DnsProtocol protocol, size_t mtu) { int dns_packet_new(DnsPacket **ret, DnsProtocol protocol, size_t mtu) {
DnsPacket *p; DnsPacket *p;

View File

@ -843,7 +843,7 @@ int bus_print_property(const char *name, sd_bus_message *property, bool all) {
if (r < 0) if (r < 0)
return r; return r;
while((r = sd_bus_message_read_basic(property, SD_BUS_TYPE_STRING, &str)) > 0) { while ((r = sd_bus_message_read_basic(property, SD_BUS_TYPE_STRING, &str)) > 0) {
_cleanup_free_ char *escaped = NULL; _cleanup_free_ char *escaped = NULL;
if (first) if (first)

View File

@ -178,7 +178,7 @@ int config_parse_personality(const char *unit, const char *filename, unsigned li
assert(data); \ assert(data); \
\ \
xs = new0(type, 1); \ xs = new0(type, 1); \
if(!xs) \ if (!xs) \
return -ENOMEM; \ return -ENOMEM; \
\ \
*xs = invalid; \ *xs = invalid; \

View File

@ -37,7 +37,7 @@
#include "string-util.h" #include "string-util.h"
#include "strv.h" #include "strv.h"
#define USE(x, y) do{ (x) = (y); (y) = NULL; } while(0) #define USE(x, y) do { (x) = (y); (y) = NULL; } while (0)
int parse_sleep_config(const char *verb, char ***_modes, char ***_states) { int parse_sleep_config(const char *verb, char ***_modes, char ***_states) {

View File

@ -1484,7 +1484,7 @@ static int list_dependencies_print(const char *name, int level, unsigned int bra
printf("%s", draw_special_char(last ? DRAW_TREE_RIGHT : DRAW_TREE_BRANCH)); printf("%s", draw_special_char(last ? DRAW_TREE_RIGHT : DRAW_TREE_BRANCH));
} }
if (arg_full){ if (arg_full) {
printf("%s\n", name); printf("%s\n", name);
return 0; return 0;
} }
@ -6550,7 +6550,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
} }
p = optarg; p = optarg;
for(;;) { for (;;) {
_cleanup_free_ char *type = NULL; _cleanup_free_ char *type = NULL;
r = extract_first_word(&p, &type, ",", 0); r = extract_first_word(&p, &type, ",", 0);
@ -6600,7 +6600,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
return log_oom(); return log_oom();
} else { } else {
p = optarg; p = optarg;
for(;;) { for (;;) {
_cleanup_free_ char *prop = NULL; _cleanup_free_ char *prop = NULL;
r = extract_first_word(&p, &prop, ",", 0); r = extract_first_word(&p, &prop, ",", 0);
@ -6785,7 +6785,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
} }
p = optarg; p = optarg;
for(;;) { for (;;) {
_cleanup_free_ char *s = NULL; _cleanup_free_ char *s = NULL;
r = extract_first_word(&p, &s, ",", 0); r = extract_first_word(&p, &s, ",", 0);

View File

@ -864,7 +864,7 @@ static int set_dependencies_from_rcnd(const LookupPaths *lp, Hashmap *all_servic
} }
service = hashmap_get(all_services, name); service = hashmap_get(all_services, name);
if (!service){ if (!service) {
log_debug("Ignoring %s symlink in %s, not generating %s.", de->d_name, rcnd_table[i].path, name); log_debug("Ignoring %s symlink in %s, not generating %s.", de->d_name, rcnd_table[i].path, name);
continue; continue;
} }

View File

@ -68,10 +68,10 @@ static int test_tunnel_configure(sd_netlink *rtnl) {
/* skip test if module cannot be loaded */ /* skip test if module cannot be loaded */
r = load_module("ipip"); r = load_module("ipip");
if(r < 0) if (r < 0)
return EXIT_TEST_SKIP; return EXIT_TEST_SKIP;
if(getuid() != 0) if (getuid() != 0)
return EXIT_TEST_SKIP; return EXIT_TEST_SKIP;
/* IPIP tunnel */ /* IPIP tunnel */
@ -99,7 +99,7 @@ static int test_tunnel_configure(sd_netlink *rtnl) {
assert_se((m = sd_netlink_message_unref(m)) == NULL); assert_se((m = sd_netlink_message_unref(m)) == NULL);
r = load_module("sit"); r = load_module("sit");
if(r < 0) if (r < 0)
return EXIT_TEST_SKIP; return EXIT_TEST_SKIP;
/* sit */ /* sit */

View File

@ -93,7 +93,7 @@ static void check_stop_unlink(Manager *m, Unit *unit, const char *test_path, con
ts = now(CLOCK_MONOTONIC); ts = now(CLOCK_MONOTONIC);
/* We process events until the service related to the path has been successfully started */ /* We process events until the service related to the path has been successfully started */
while(service->result != SERVICE_SUCCESS || service->state != SERVICE_START) { while (service->result != SERVICE_SUCCESS || service->state != SERVICE_START) {
usec_t n; usec_t n;
int r; int r;

View File

@ -606,7 +606,7 @@ static void test_install_printf(void) {
} else assert_se(t == NULL); \ } else assert_se(t == NULL); \
strcpy(i.name, d1); \ strcpy(i.name, d1); \
strcpy(i.path, d2); \ strcpy(i.path, d2); \
} while(false) } while (false)
expect(i, "%n", "name.service"); expect(i, "%n", "name.service");
expect(i, "%N", "name"); expect(i, "%N", "name");

View File

@ -73,7 +73,7 @@ void probe_smart_media(int mtd_fd, mtd_info_t* info)
for (offset = 0 ; offset < block_size * spare_count ; for (offset = 0 ; offset < block_size * spare_count ;
offset += sector_size) { offset += sector_size) {
lseek(mtd_fd, SEEK_SET, offset); lseek(mtd_fd, SEEK_SET, offset);
if (read(mtd_fd, cis_buffer, SM_SECTOR_SIZE) == SM_SECTOR_SIZE){ if (read(mtd_fd, cis_buffer, SM_SECTOR_SIZE) == SM_SECTOR_SIZE) {
cis_found = 1; cis_found = 1;
break; break;
} }

View File

@ -177,7 +177,7 @@ static bool test_pointers(struct udev_device *dev,
has_mt_coordinates = test_bit(ABS_MT_POSITION_X, bitmask_abs) && test_bit(ABS_MT_POSITION_Y, bitmask_abs); has_mt_coordinates = test_bit(ABS_MT_POSITION_X, bitmask_abs) && test_bit(ABS_MT_POSITION_Y, bitmask_abs);
/* unset has_mt_coordinates if devices claims to have all abs axis */ /* unset has_mt_coordinates if devices claims to have all abs axis */
if(has_mt_coordinates && test_bit(ABS_MT_SLOT, bitmask_abs) && test_bit(ABS_MT_SLOT - 1, bitmask_abs)) if (has_mt_coordinates && test_bit(ABS_MT_SLOT, bitmask_abs) && test_bit(ABS_MT_SLOT - 1, bitmask_abs))
has_mt_coordinates = false; has_mt_coordinates = false;
is_direct = test_bit(INPUT_PROP_DIRECT, bitmask_props); is_direct = test_bit(INPUT_PROP_DIRECT, bitmask_props);
has_touch = test_bit(BTN_TOUCH, bitmask_key); has_touch = test_bit(BTN_TOUCH, bitmask_key);

View File

@ -100,7 +100,7 @@ static int adm_monitor(struct udev *udev, int argc, char *argv[]) {
udev_list_init(udev, &subsystem_match_list, true); udev_list_init(udev, &subsystem_match_list, true);
udev_list_init(udev, &tag_match_list, true); udev_list_init(udev, &tag_match_list, true);
while((c = getopt_long(argc, argv, "pekus:t:h", options, NULL)) >= 0) while ((c = getopt_long(argc, argv, "pekus:t:h", options, NULL)) >= 0)
switch (c) { switch (c) {
case 'p': case 'p':
case 'e': case 'e':

View File

@ -61,7 +61,7 @@ static int adm_test(struct udev *udev, int argc, char *argv[]) {
log_debug("version %s", VERSION); log_debug("version %s", VERSION);
while((c = getopt_long(argc, argv, "a:N:h", options, NULL)) >= 0) while ((c = getopt_long(argc, argv, "a:N:h", options, NULL)) >= 0)
switch (c) { switch (c) {
case 'a': case 'a':
action = optarg; action = optarg;