From: Kevin Day Date: Mon, 17 Apr 2023 02:54:46 +0000 (-0500) Subject: Cleanup: Fix warning regarding private_inline_f_print_write_unlocked() being unused. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=211973ce8d5d31a979ead4d8b0e06f267644c4f5;p=fll 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. --- 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) {