From 868c97def710d56784ed36ceea0b1a48384a5565 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 6 Mar 2012 22:03:49 -0600 Subject: [PATCH] Update: add *_printf functions These help make it slightly easier to use the correct data type when doing printfs on length types. --- level_0/f_strings/c/strings.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/level_0/f_strings/c/strings.h b/level_0/f_strings/c/strings.h index 4eab846..ec60f4d 100644 --- a/level_0/f_strings/c/strings.h +++ b/level_0/f_strings/c/strings.h @@ -61,6 +61,12 @@ extern "C"{ #define string_format_long_long_unsigned "%llu" #endif // _di_string_format_pointers_ +#ifdef _di_f_array_length_printf_ + typedef f_array_length_printf string_format_unsigned; + typedef f_array_length_short_printf string_format_long_unsigned; + typedef f_array_length_long_printf string_format_long_long_unsigned; +#endif // _di_f_array_length_printf_ + // define the basic string type #ifndef _di_f_have_string_ typedef f_autochar *f_string; @@ -83,6 +89,7 @@ extern "C"{ typedef f_u_long f_string_length; #define f_string_length_initialize 0 + #define f_string_length_printf string_format_long_unsigned #define f_new_string_length(status, string, length) status = f_new_array((void **) & string, sizeof(f_string_length), length) #define f_delete_string_length(status, string) status = f_delete((void **) & string) -- 1.8.3.1