Bugprone argument comment 8 (#37678)

Follow up from https://github.com/systemd/systemd/pull/37556
This commit is contained in:
Yu Watanabe
2025-06-03 10:58:52 +09:00
committed by GitHub
12 changed files with 25 additions and 25 deletions
+4 -4
View File
@@ -688,7 +688,7 @@ static int strv_env_get_n_validated(
int replace_env_full(
const char *format,
size_t n,
size_t length,
char **env,
ReplaceEnvFlags flags,
char **ret,
@@ -714,13 +714,13 @@ int replace_env_full(
assert(format);
if (n == SIZE_MAX)
n = strlen(format);
if (length == SIZE_MAX)
length = strlen(format);
pu = ret_unset_variables ? &unset_variables : NULL;
pb = ret_bad_variables ? &bad_variables : NULL;
for (e = format, i = 0; *e && i < n; e++, i++)
for (e = format, i = 0; *e && i < length; e++, i++)
switch (state) {
case WORD:
+1 -1
View File
@@ -15,7 +15,7 @@ typedef enum ReplaceEnvFlags {
REPLACE_ENV_ALLOW_EXTENDED = 1 << 2,
} ReplaceEnvFlags;
int replace_env_full(const char *format, size_t n, char **env, ReplaceEnvFlags flags, char **ret, char ***ret_unset_variables, char ***ret_bad_variables);
int replace_env_full(const char *format, size_t length, char **env, ReplaceEnvFlags flags, char **ret, char ***ret_unset_variables, char ***ret_bad_variables);
static inline int replace_env(const char *format, char **env, ReplaceEnvFlags flags, char **ret) {
return replace_env_full(format, SIZE_MAX, env, flags, ret, NULL, NULL);
}
+5 -5
View File
@@ -188,10 +188,10 @@ int pipe_eof(int fd) {
return !!(r & POLLHUP);
}
int ppoll_usec_full(struct pollfd *fds, size_t nfds, usec_t timeout, const sigset_t *ss) {
int ppoll_usec_full(struct pollfd *fds, size_t n_fds, usec_t timeout, const sigset_t *ss) {
int r;
assert(fds || nfds == 0);
assert(fds || n_fds == 0);
/* This is a wrapper around ppoll() that does primarily two things:
*
@@ -208,16 +208,16 @@ int ppoll_usec_full(struct pollfd *fds, size_t nfds, usec_t timeout, const sigse
* to handle signals, such as signalfd() or signal handlers. ⚠️ ⚠️ ⚠️
*/
if (nfds == 0 && timeout == 0)
if (n_fds == 0 && timeout == 0)
return 0;
r = ppoll(fds, nfds, timeout == USEC_INFINITY ? NULL : TIMESPEC_STORE(timeout), ss);
r = ppoll(fds, n_fds, timeout == USEC_INFINITY ? NULL : TIMESPEC_STORE(timeout), ss);
if (r < 0)
return -errno;
if (r == 0)
return 0;
for (size_t i = 0, n = r; i < nfds && n > 0; i++) {
for (size_t i = 0, n = r; i < n_fds && n > 0; i++) {
if (fds[i].revents == 0)
continue;
if (fds[i].revents & POLLNVAL)
+3 -3
View File
@@ -15,9 +15,9 @@ static inline int loop_write(int fd, const void *buf, size_t nbytes) {
int pipe_eof(int fd);
int ppoll_usec_full(struct pollfd *fds, size_t nfds, usec_t timeout, const sigset_t *ss) _nonnull_if_nonzero_(1, 2);
_nonnull_if_nonzero_(1, 2) static inline int ppoll_usec(struct pollfd *fds, size_t nfds, usec_t timeout) {
return ppoll_usec_full(fds, nfds, timeout, NULL);
int ppoll_usec_full(struct pollfd *fds, size_t n_fds, usec_t timeout, const sigset_t *ss) _nonnull_if_nonzero_(1, 2);
_nonnull_if_nonzero_(1, 2) static inline int ppoll_usec(struct pollfd *fds, size_t n_fds, usec_t timeout) {
return ppoll_usec_full(fds, n_fds, timeout, NULL);
}
int fd_wait_for_event(int fd, int event, usec_t timeout);
+1 -1
View File
@@ -735,7 +735,7 @@ int acquire_terminal(
.fd = notify,
.events = POLLIN,
},
/* n_pollfds = */ 1,
/* n_fds = */ 1,
left,
&poll_ss);
if (r < 0)
+1 -1
View File
@@ -367,7 +367,7 @@ int uid_map_search_root(pid_t pid, UIDRangeUsernsMode mode, uid_t *ret) {
for (;;) {
uid_t uid_base = UID_INVALID, uid_shift = UID_INVALID;
r = uid_map_read_one(f, &uid_base, &uid_shift, /* ret_uid_range= */ NULL);
r = uid_map_read_one(f, &uid_base, &uid_shift, /* ret_range= */ NULL);
if (r < 0)
return r;