]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic/iovec-util: always call the iovec "iovec"
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 23 Oct 2023 12:51:43 +0000 (14:51 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 23 Oct 2023 13:04:08 +0000 (15:04 +0200)
We were using "i", "iov", and "iovec" in variuos places. Let's be
consistent.

src/basic/iovec-util.c
src/basic/iovec-util.h

index 11aa630ae6a0e6a20dbd18730f9034e030899857..5d70657784c9802cbfa16a917fd57b8daba07a11 100644 (file)
@@ -3,24 +3,24 @@
 #include "iovec-util.h"
 #include "string-util.h"
 
-size_t iovec_total_size(const struct iovec *i, size_t n) {
+size_t iovec_total_size(const struct iovec *iovec, size_t n) {
         size_t sum = 0;
 
-        assert(i || n == 0);
+        assert(iovec || n == 0);
 
-        FOREACH_ARRAY(j, i, n)
+        FOREACH_ARRAY(j, iovec, n)
                 sum += j->iov_len;
 
         return sum;
 }
 
-bool iovec_increment(struct iovec *i, size_t n, size_t k) {
-        assert(i || n == 0);
+bool iovec_increment(struct iovec *iovec, size_t n, size_t k) {
+        assert(iovec || n == 0);
 
         /* Returns true if there is nothing else to send (bytes written cover all of the iovec),
          * false if there's still work to do. */
 
-        FOREACH_ARRAY(j, i, n) {
+        FOREACH_ARRAY(j, iovec, n) {
                 size_t sub;
 
                 if (j->iov_len == 0)
@@ -62,12 +62,12 @@ char* set_iovec_string_field_free(struct iovec *iovec, size_t *n_iovec, const ch
         return x;
 }
 
-void iovec_array_free(struct iovec *iov, size_t n) {
-        if (!iov)
+void iovec_array_free(struct iovec *iovec, size_t n) {
+        if (!iovec)
                 return;
 
         for (size_t i = 0; i < n; i++)
-                free(iov[i].iov_base);
+                free(iovec[i].iov_base);
 
-        free(iov);
+        free(iovec);
 }
index 1f652a0ede6d75a04a11858991f4c43e5bda9d7b..9c3134592edf8031aaa11f1441ce79f7ad9520a1 100644 (file)
@@ -8,9 +8,9 @@
 #include "alloc-util.h"
 #include "macro.h"
 
-size_t iovec_total_size(const struct iovec *i, size_t n);
+size_t iovec_total_size(const struct iovec *iovec, size_t n);
 
-bool iovec_increment(struct iovec *i, size_t n, size_t k);
+bool iovec_increment(struct iovec *iovec, size_t n, size_t k);
 
 #define IOVEC_NULL (const struct iovec) {}
 
@@ -38,11 +38,11 @@ static inline void iovec_done_erase(struct iovec *iovec) {
         iovec->iov_len = 0;
 }
 
-static inline bool iovec_is_set(const struct iovec *iov) {
-        return iov && iov->iov_len > 0 && iov->iov_base;
+static inline bool iovec_is_set(const struct iovec *iovec) {
+        return iovec && iovec->iov_len > 0 && iovec->iov_base;
 }
 
 char* set_iovec_string_field(struct iovec *iovec, size_t *n_iovec, const char *field, const char *value);
 char* set_iovec_string_field_free(struct iovec *iovec, size_t *n_iovec, const char *field, char *value);
 
-void iovec_array_free(struct iovec *iov, size_t n);
+void iovec_array_free(struct iovec *iovec, size_t n);