From: Zbigniew Jędrzejewski-Szmek Date: Mon, 26 Apr 2021 21:30:45 +0000 (+0200) Subject: basic/io-util: move iterator variable declarations into loop headers X-Git-Tag: v249-rc1~302^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f9d1da95a1ad34a56a29953d7b5f7051590cf8d;p=thirdparty%2Fsystemd.git basic/io-util: move iterator variable declarations into loop headers --- diff --git a/src/basic/io-util.h b/src/basic/io-util.h index d4bb14fba43..ce54ca228bf 100644 --- a/src/basic/io-util.h +++ b/src/basic/io-util.h @@ -25,9 +25,9 @@ int fd_wait_for_event(int fd, int event, usec_t timeout); ssize_t sparse_write(int fd, const void *p, size_t sz, size_t run_length); static inline size_t IOVEC_TOTAL_SIZE(const struct iovec *i, size_t n) { - size_t j, r = 0; + size_t r = 0; - for (j = 0; j < n; j++) + for (size_t j = 0; j < n; j++) r += i[j].iov_len; return r;