From c580e026a854141fbf78d81a4a7fab6e0a9518d1 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 6 Jul 2026 12:56:32 -0400 Subject: [PATCH] main.c: all functions except main() are static --- main.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/main.c b/main.c index 9ff48ee..21f1628 100644 --- a/main.c +++ b/main.c @@ -50,7 +50,7 @@ /* Open a conversion descriptor by reference. Wraps the boilerplate * error reporting when iconv_open() fails. */ -int _my_iconv_open(iconv_t* cd, const char *tocode, const char *fromcode) { +static int _my_iconv_open(iconv_t* cd, const char *tocode, const char *fromcode) { *cd = iconv_open(tocode, fromcode); if (*cd == (iconv_t)(-1)) { /* The errno values are standard, but we have no way of knowing @@ -69,7 +69,7 @@ int _my_iconv_open(iconv_t* cd, const char *tocode, const char *fromcode) { /* Close a conversion descriptor by reference. Wraps the boilerplate * error reporting when iconv_close() fails. */ -int _my_iconv_close(iconv_t* cd) { +static int _my_iconv_close(iconv_t* cd) { if (iconv_close(*cd) == -1) { /* The underlying type of iconv_t is unspecified, so we can't * easily print the argument here. */ @@ -83,7 +83,7 @@ int _my_iconv_close(iconv_t* cd) { /* * Ensure that iconv_open() supports the given indicator suffix. */ -int test_iconv_open_supports_suffix(const char* suffix) { +static int test_iconv_open_supports_suffix(const char* suffix) { const char* fromcode = "ASCII"; char* tocode = malloc(strlen(fromcode) + strlen(suffix) + 1); strcpy(tocode, fromcode); @@ -115,7 +115,7 @@ int test_iconv_open_supports_suffix(const char* suffix) { * Check that iconv_open() fails with EINVAL when given a bogus * indicator suffix. */ -int test_iconv_open_does_not_support_invalid_suffix() { +static int test_iconv_open_does_not_support_invalid_suffix() { const char* fromcode = "ASCII"; const char* tocode = "ASCII//INVALID"; @@ -137,7 +137,7 @@ int test_iconv_open_does_not_support_invalid_suffix() { } -int test_iconv_open_does_not_support_invalid_to_codeset() { +static int test_iconv_open_does_not_support_invalid_to_codeset() { const char* fromcode = "ASCII"; const char* tocode = "ASDJFI$@#%t234tWER"; @@ -158,7 +158,7 @@ int test_iconv_open_does_not_support_invalid_to_codeset() { return FAILURE; } -int test_iconv_open_does_not_support_invalid_from_codeset() { +static int test_iconv_open_does_not_support_invalid_from_codeset() { const char* fromcode = "ASDJFI$@#%t234tWER"; const char* tocode = "ASCII"; @@ -188,7 +188,7 @@ int test_iconv_open_does_not_support_invalid_from_codeset() { * Input conversion stopped due to an input byte that does not belong * to the input codeset. */ -int test_iconv_invalid_char_is_eilseq() { +static int test_iconv_invalid_char_is_eilseq() { iconv_t cd; const char* tocode = "ASCII"; @@ -237,7 +237,7 @@ int test_iconv_invalid_char_is_eilseq() { * Input conversion stopped due to an incomplete character or shift * sequence at the end of the input buffer. */ -int test_iconv_incomplete_multibyte_is_einval() { +static int test_iconv_incomplete_multibyte_is_einval() { iconv_t cd; const char* tocode = "UTF-8"; @@ -280,7 +280,7 @@ int test_iconv_incomplete_multibyte_is_einval() { return FAILURE; } -int test_iconv_too_big_is_e2big() { +static int test_iconv_too_big_is_e2big() { iconv_t cd; const char* tocode = "ASCII"; @@ -336,7 +336,7 @@ int test_iconv_too_big_is_e2big() { * This shall not be treated as an error. * -------------------------------------- */ -int test_iconv_ignore_ignores_invalid() { +static int test_iconv_ignore_ignores_invalid() { iconv_t cd; const char* fromcode = "ASCII"; const char* tocode = "ASCII//IGNORE"; @@ -390,7 +390,7 @@ int test_iconv_ignore_ignores_invalid() { * * It is merely implied, but this should not be an error. */ -int test_iconv_untranslatable() { +static int test_iconv_untranslatable() { iconv_t cd; const char* fromcode = "UTF-8"; const char* tocode = "ASCII"; -- 2.53.0