pgbackrest.git / summary / log / commit / refs
commit d76da852ee61a396582eba034d49bf8e8e99b7db
Author: David Steele <david@pgbackrest.org>
Date: Sun Jan 11 11:42:27 2026 +0000
Remove unused error parameter from strIdFromZN().
This parameter was made obsolete in 85caeda4.
src/common/type/string.h | 2 +-
src/common/type/stringId.c | 5 ++---
src/common/type/stringId.h | 4 ++--
test/src/module/common/typeStringTest.c | 2 --
4 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/src/common/type/string.h b/src/common/type/string.h
index c6346536f..fefec5bb3 100644
--- a/src/common/type/string.h
+++ b/src/common/type/string.h
@@ -227,7 +227,7 @@ FN_EXTERN String *strSizeFormat(const uint64_t fileSize);
FN_INLINE_ALWAYS StringId
strStrId(const String *const this)
{
- return strIdFromZN(strZ(this), strSize(this), true);
+ return strIdFromZN(strZ(this), strSize(this));
}
// Return a substring given only the start position
diff --git a/src/common/type/stringId.c b/src/common/type/stringId.c
index 1f0a36d16..30c6d904a 100644
--- a/src/common/type/stringId.c
+++ b/src/common/type/stringId.c
@@ -223,12 +223,11 @@ strIdBitFromZN(const StringIdBit bit, const char *const buffer, size_t size)
}
FN_EXTERN StringId
-strIdFromZN(const char *const buffer, const size_t size, const bool error)
+strIdFromZN(const char *const buffer, const size_t size)
{
FUNCTION_TEST_BEGIN();
FUNCTION_TEST_PARAM(VOID, buffer);
FUNCTION_TEST_PARAM(SIZE, size);
- FUNCTION_TEST_PARAM(BOOL, error);
FUNCTION_TEST_END();
StringId result = strIdBitFromZN(stringIdBit5, buffer, size);
@@ -239,7 +238,7 @@ strIdFromZN(const char *const buffer, const size_t size, const bool error)
result = strIdBitFromZN(stringIdBit6, buffer, size);
// Error when 6-bit encoding also fails
- if (result == 0 && error)
+ if (result == 0)
THROW_FMT(FormatError, "'%s' contains invalid characters", buffer);
}
diff --git a/src/common/type/stringId.h b/src/common/type/stringId.h
index 3ee00f3a4..ebbea7cf8 100644
--- a/src/common/type/stringId.h
+++ b/src/common/type/stringId.h
@@ -60,13 +60,13 @@ against each other so the str parameter is included only for documentation purpo
Functions
***********************************************************************************************************************************/
// Convert N chars to StringId
-FN_EXTERN StringId strIdFromZN(const char *buffer, size_t size, bool error);
+FN_EXTERN StringId strIdFromZN(const char *buffer, size_t size);
// Convert zero-terminated string to StringId using strIdFromZN()
FN_INLINE_ALWAYS StringId
strIdFromZ(const char *const str)
{
- return strIdFromZN(str, strlen(str), true);
+ return strIdFromZN(str, strlen(str));
}
// Write StringId to characters without zero-terminating. The buffer at ptr must have enough space to write the entire StringId,
diff --git a/test/src/module/common/typeStringTest.c b/test/src/module/common/typeStringTest.c
index 9238d85fc..2182431e8 100644
--- a/test/src/module/common/typeStringTest.c
+++ b/test/src/module/common/typeStringTest.c
@@ -630,8 +630,6 @@ testRun(void)
TEST_RESULT_UINT(strIdBitFromZN(stringIdBit6, "abC-40MzZ9", 10), TEST_STR6ID10, "6 bits 10 chars");
TEST_RESULT_UINT(strIdBitFromZN(stringIdBit6, "abC-40MzZ9Z", 11), 0, "error on too many chars");
- TEST_RESULT_UINT(strIdFromZN("|B", 2, false), 0, "'|' is invalid for 6-bit encoding in '|B'");
-
// -------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("STRID*()");
[parent: d12aa6fcdab1]