tree-wide: Small fixes for various clang-tidy warnings
This commit is contained in:
committed by
Yu Watanabe
parent
2ba910ab06
commit
9a6a8f35eb
+1
-1
@@ -1228,7 +1228,7 @@ int search_and_open(
|
||||
|
||||
assert(path);
|
||||
|
||||
copy = strv_copy((char**) search);
|
||||
copy = strv_copy(search);
|
||||
if (!copy)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
+2
-2
@@ -89,10 +89,10 @@ int ordered_hashmap_ensure_replace(OrderedHashmap **h, const struct hash_ops *ha
|
||||
|
||||
IteratedCache* _hashmap_iterated_cache_new(HashmapBase *h);
|
||||
static inline IteratedCache* hashmap_iterated_cache_new(Hashmap *h) {
|
||||
return (IteratedCache*) _hashmap_iterated_cache_new(HASHMAP_BASE(h));
|
||||
return _hashmap_iterated_cache_new(HASHMAP_BASE(h));
|
||||
}
|
||||
static inline IteratedCache* ordered_hashmap_iterated_cache_new(OrderedHashmap *h) {
|
||||
return (IteratedCache*) _hashmap_iterated_cache_new(HASHMAP_BASE(h));
|
||||
return _hashmap_iterated_cache_new(HASHMAP_BASE(h));
|
||||
}
|
||||
|
||||
int hashmap_put(Hashmap *h, const void *key, void *value);
|
||||
|
||||
@@ -151,7 +151,7 @@ static int add_locales_from_archive(Set *locales) {
|
||||
|
||||
finish:
|
||||
if (p != MAP_FAILED)
|
||||
munmap((void*) p, st.st_size);
|
||||
munmap(p, st.st_size);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -645,7 +645,7 @@ int safe_atod(const char *s, double *ret_d) {
|
||||
return -EINVAL;
|
||||
|
||||
if (ret_d)
|
||||
*ret_d = (double) d;
|
||||
*ret_d = d;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -710,7 +710,7 @@ int parse_ip_port(const char *s, uint16_t *ret) {
|
||||
if (l == 0)
|
||||
return -EINVAL;
|
||||
|
||||
*ret = (uint16_t) l;
|
||||
*ret = l;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ int proc_cmdline_filter_pid1_args(char **argv, char ***ret);
|
||||
int proc_cmdline(char **ret);
|
||||
int proc_cmdline_strv(char ***ret);
|
||||
|
||||
int proc_cmdline_parse(const proc_cmdline_parse_t parse, void *userdata, ProcCmdlineFlags flags);
|
||||
int proc_cmdline_parse(proc_cmdline_parse_t parse, void *userdata, ProcCmdlineFlags flags);
|
||||
|
||||
int proc_cmdline_get_key(const char *parameter, ProcCmdlineFlags flags, char **ret_value);
|
||||
int proc_cmdline_get_bool(const char *key, ProcCmdlineFlags flags, bool *ret);
|
||||
|
||||
@@ -1110,7 +1110,7 @@ int getpwnam_malloc(const char *name, struct passwd **ret) {
|
||||
return -ENOMEM;
|
||||
|
||||
struct passwd *pw = NULL;
|
||||
r = getpwnam_r(name, buf, (char*) buf + ALIGN(sizeof(struct passwd)), (size_t) bufsize, &pw);
|
||||
r = getpwnam_r(name, buf, (char*) buf + ALIGN(sizeof(struct passwd)), bufsize, &pw);
|
||||
if (r == 0) {
|
||||
if (pw) {
|
||||
if (ret)
|
||||
@@ -1151,7 +1151,7 @@ int getpwuid_malloc(uid_t uid, struct passwd **ret) {
|
||||
return -ENOMEM;
|
||||
|
||||
struct passwd *pw = NULL;
|
||||
r = getpwuid_r(uid, buf, (char*) buf + ALIGN(sizeof(struct passwd)), (size_t) bufsize, &pw);
|
||||
r = getpwuid_r(uid, buf, (char*) buf + ALIGN(sizeof(struct passwd)), bufsize, &pw);
|
||||
if (r == 0) {
|
||||
if (pw) {
|
||||
if (ret)
|
||||
@@ -1195,7 +1195,7 @@ int getgrnam_malloc(const char *name, struct group **ret) {
|
||||
return -ENOMEM;
|
||||
|
||||
struct group *gr = NULL;
|
||||
r = getgrnam_r(name, buf, (char*) buf + ALIGN(sizeof(struct group)), (size_t) bufsize, &gr);
|
||||
r = getgrnam_r(name, buf, (char*) buf + ALIGN(sizeof(struct group)), bufsize, &gr);
|
||||
if (r == 0) {
|
||||
if (gr) {
|
||||
if (ret)
|
||||
@@ -1234,7 +1234,7 @@ int getgrgid_malloc(gid_t gid, struct group **ret) {
|
||||
return -ENOMEM;
|
||||
|
||||
struct group *gr = NULL;
|
||||
r = getgrgid_r(gid, buf, (char*) buf + ALIGN(sizeof(struct group)), (size_t) bufsize, &gr);
|
||||
r = getgrgid_r(gid, buf, (char*) buf + ALIGN(sizeof(struct group)), bufsize, &gr);
|
||||
if (r == 0) {
|
||||
if (gr) {
|
||||
if (ret)
|
||||
|
||||
Reference in New Issue
Block a user