From f2b02f6b7b266a6f27abb0294dfc56f5b8bd0bf4 Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan.bosch@open-xchange.com>
Date: Tue, 1 Oct 2024 10:21:33 +0200
Subject: [PATCH] lib-sieve: sieve-script - Change sieve_script_cmp() parameter
 names

---
 src/lib-sieve/sieve-script-private.h          |  4 +-
 src/lib-sieve/sieve-script.c                  | 22 +++++-----
 src/lib-sieve/sieve-script.h                  | 10 ++---
 .../storage/file/sieve-file-script.c          | 40 +++++++++----------
 .../storage/ldap/sieve-ldap-script.c          |  8 ++--
 5 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/src/lib-sieve/sieve-script-private.h b/src/lib-sieve/sieve-script-private.h
index 059233f11..1e8455cc8 100644
--- a/src/lib-sieve/sieve-script-private.h
+++ b/src/lib-sieve/sieve-script-private.h
@@ -41,8 +41,8 @@ struct sieve_script_vfuncs {
 	int (*get_size)(const struct sieve_script *script, uoff_t *size_r);
 
 	/* matching */
-	int (*cmp)(const struct sieve_script *script,
-		   const struct sieve_script *other);
+	int (*cmp)(const struct sieve_script *script1,
+		   const struct sieve_script *script2);
 };
 
 struct sieve_script {
diff --git a/src/lib-sieve/sieve-script.c b/src/lib-sieve/sieve-script.c
index dbbe303f7..95052a309 100644
--- a/src/lib-sieve/sieve-script.c
+++ b/src/lib-sieve/sieve-script.c
@@ -353,23 +353,23 @@ int sieve_script_get_stream(struct sieve_script *script,
  * Comparison
  */
 
-int sieve_script_cmp(const struct sieve_script *script,
-		     const struct sieve_script *other)
+int sieve_script_cmp(const struct sieve_script *script1,
+		     const struct sieve_script *script2)
 {
-	if (script == other)
+	if (script1 == script2)
 		return 0;
-	if (script == NULL || other == NULL)
-		return (script == NULL ? -1 : 1);
-	if (script->script_class != other->script_class)
-		return (script->script_class > other->script_class ? 1 : -1);
+	if (script1 == NULL || script2 == NULL)
+		return (script1 == NULL ? -1 : 1);
+	if (script1->script_class != script2->script_class)
+		return (script1->script_class > script2->script_class ? 1 : -1);
 
-	if (script->v.cmp == NULL) {
-		i_assert (script->location != NULL && other->location != NULL);
+	if (script1->v.cmp == NULL) {
+		i_assert (script1->location != NULL && script2->location != NULL);
 
-		return strcmp(script->location, other->location);
+		return strcmp(script1->location, script2->location);
 	}
 
-	return script->v.cmp(script, other);
+	return script1->v.cmp(script1, script2);
 }
 
 unsigned int sieve_script_hash(const struct sieve_script *script)
diff --git a/src/lib-sieve/sieve-script.h b/src/lib-sieve/sieve-script.h
index 25a5736e7..a409eb1a2 100644
--- a/src/lib-sieve/sieve-script.h
+++ b/src/lib-sieve/sieve-script.h
@@ -127,13 +127,13 @@ sieve_file_script_get_path(const struct sieve_script *script) ATTR_PURE;
  * Comparison
  */
 
-int sieve_script_cmp(const struct sieve_script *script,
-		     const struct sieve_script *other);
+int sieve_script_cmp(const struct sieve_script *script1,
+		     const struct sieve_script *script2);
 static inline bool
-sieve_script_equals(const struct sieve_script *script,
-		    const struct sieve_script *other)
+sieve_script_equals(const struct sieve_script *script1,
+		    const struct sieve_script *script2)
 {
-	return (sieve_script_cmp(script, other) == 0);
+	return (sieve_script_cmp(script1, script2) == 0);
 }
 
 unsigned int sieve_script_hash(const struct sieve_script *script);
diff --git a/src/lib-sieve/storage/file/sieve-file-script.c b/src/lib-sieve/storage/file/sieve-file-script.c
index babe5b419..ac2b0eb46 100644
--- a/src/lib-sieve/storage/file/sieve-file-script.c
+++ b/src/lib-sieve/storage/file/sieve-file-script.c
@@ -807,38 +807,38 @@ const char *sieve_file_script_get_path(const struct sieve_script *script)
  */
 
 static int
-sieve_file_script_cmp(const struct sieve_script *script,
-		      const struct sieve_script *other)
+sieve_file_script_cmp(const struct sieve_script *script1,
+		      const struct sieve_script *script2)
 {
-	const struct sieve_file_script *fscript =
-		container_of(script, const struct sieve_file_script, script);
-	const struct sieve_file_script *fother =
-		container_of(other, const struct sieve_file_script, script);
+	const struct sieve_file_script *fscript1 =
+		container_of(script1, const struct sieve_file_script, script);
+	const struct sieve_file_script *fscript2 =
+		container_of(script2, const struct sieve_file_script, script);
 	int ret;
 
-	if (!script->open || !other->open) {
-		struct sieve_storage *storage = script->storage;
-		struct sieve_storage *sother = other->storage;
+	if (!script1->open || !script2->open) {
+		struct sieve_storage *storage1 = script1->storage;
+		struct sieve_storage *storage2 = script2->storage;
 
-		ret = strcmp(storage->location, sother->location);
+		ret = strcmp(storage1->location, storage2->location);
 		if (ret != 0)
 			return ret;
 
-		i_assert(script->name != NULL && other->name != NULL);
-		return strcmp(script->name, other->name);
+		i_assert(script1->name != NULL && script2->name != NULL);
+		return strcmp(script1->name, script2->name);
 	}
 
-	if (major(fscript->st.st_dev) != major(fother->st.st_dev)) {
-		return (major(fscript->st.st_dev) > major(fother->st.st_dev) ?
-			1 : -1);
+	if (major(fscript1->st.st_dev) != major(fscript2->st.st_dev)) {
+		return (major(fscript1->st.st_dev) >
+			major(fscript2->st.st_dev) ? 1 : -1);
 	}
-	if (minor(fscript->st.st_dev) != minor(fother->st.st_dev)) {
-		return (minor(fscript->st.st_dev) > minor(fother->st.st_dev) ?
-			1 : -1);
+	if (minor(fscript1->st.st_dev) != minor(fscript2->st.st_dev)) {
+		return (minor(fscript1->st.st_dev) >
+			minor(fscript2->st.st_dev) ? 1 : -1);
 	}
 
-	if (fscript->st.st_ino != fother->st.st_ino)
-		return (fscript->st.st_ino > fother->st.st_ino ? 1 : -1);
+	if (fscript1->st.st_ino != fscript2->st.st_ino)
+		return (fscript1->st.st_ino > fscript2->st.st_ino ? 1 : -1);
 
 	return 0;
 }
diff --git a/src/lib-sieve/storage/ldap/sieve-ldap-script.c b/src/lib-sieve/storage/ldap/sieve-ldap-script.c
index 374b8d0db..1ee543a5d 100644
--- a/src/lib-sieve/storage/ldap/sieve-ldap-script.c
+++ b/src/lib-sieve/storage/ldap/sieve-ldap-script.c
@@ -263,14 +263,14 @@ sieve_ldap_script_binary_save(struct sieve_script *script,
 }
 
 static int
-sieve_ldap_script_cmp(const struct sieve_script *script,
-		      const struct sieve_script *other)
+sieve_ldap_script_cmp(const struct sieve_script *script1,
+		      const struct sieve_script *script2)
 {
 	int ret;
 
-	i_assert(script->name != NULL && other->name != NULL);
+	i_assert(script1->name != NULL && script2->name != NULL);
 
-	ret = strcmp(script->name, other->name);
+	ret = strcmp(script1->name, script2->name);
 	if (ret != 0)
 		return (ret > 0 ? 1 : -1);
 	return 0;
-- 
GitLab