From: Kevin Day Date: Wed, 7 Mar 2012 04:03:49 +0000 (-0600) Subject: Update: add *_printf functions X-Git-Tag: 0.3.x~6 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=868c97def710d56784ed36ceea0b1a48384a5565;p=fll Update: add *_printf functions These help make it slightly easier to use the correct data type when doing printfs on length types. --- 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)