From 211973ce8d5d31a979ead4d8b0e06f267644c4f5 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 16 Apr 2023 21:54:46 -0500 Subject: [PATCH] Cleanup: Fix warning regarding private_inline_f_print_write_unlocked() being unused. This happens when the functions that call it are disabled via the macro. Wrap this function in the appropriate macro checks. --- level_0/f_print/c/print.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/level_0/f_print/c/print.c b/level_0/f_print/c/print.c index a1fac1f..b510f9d 100644 --- a/level_0/f_print/c/print.c +++ b/level_0/f_print/c/print.c @@ -18,18 +18,20 @@ extern "C" { * @see fwrite_unlocked() * @see ferror_unlocked() */ -static inline f_status_t private_inline_f_print_write_unlocked(const f_string_t string, const f_array_length_t total, const f_file_t file) { +#if !defined(_di_f_print_character_) && !defined(_di_f_print_character_safely_) + static inline f_status_t private_inline_f_print_write_unlocked(const f_string_t string, const f_array_length_t total, const f_file_t file) { - f_array_length_t count = 0; + f_array_length_t count = 0; - do { - count += fwrite_unlocked(string, sizeof(f_char_t), total - count, file.stream); - if (ferror_unlocked(file.stream)) return F_status_set_error(F_output); + do { + count += fwrite_unlocked(string, sizeof(f_char_t), total - count, file.stream); + if (ferror_unlocked(file.stream)) return F_status_set_error(F_output); - } while (count < total); + } while (count < total); - return F_none; -} + return F_none; + } +#endif // !defined(_di_f_print_character_) && !defined(_di_f_print_character_safely_) #ifndef _di_f_print_ f_status_t f_print(const f_string_t string, const f_array_length_t length, const f_file_t file) { -- 1.8.3.1