]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic/io-util: move iterator variable declarations into loop headers
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 26 Apr 2021 21:30:45 +0000 (23:30 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 4 May 2021 12:57:49 +0000 (14:57 +0200)
src/basic/io-util.h

index d4bb14fba43704d3b9326c4f3264128df95246b9..ce54ca228bf8558e0e0b6a26ac296f0ad26d2cc4 100644 (file)
@@ -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;