From 2f572659f5d86907a3b657ebc3c90f4f6f7f11e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Sat, 18 Dec 2021 20:08:27 +0000 Subject: [PATCH] Docs: Fix a README.developer code example Remove spurious "int". Also prefer "g_string_printf", just for stylistic reasons. --- doc/README.developer | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/README.developer b/doc/README.developer index c022ae0dc3..f24590c4bb 100644 --- a/doc/README.developer +++ b/doc/README.developer @@ -128,7 +128,7 @@ these headers; they are included in . Use that instead. To print fixed width integers you must use the macros provided in . - int uint32_t var; + uint32_t var; printf("var = " PRIu32 "\n", var); Don't use "long" to mean "signed 32-bit integer", and don't use @@ -205,8 +205,8 @@ For GLib routines, and only those, you can choose whichever format style you prefer: uint64_t val = UINT64_C(1); - char *str1 = g_strdup_printf("%" G_GUINT64_FORMAT, val); - char *str2 = g_strdup_printf("%" PRIu64, val); + char *str1 = g_string_printf("%" G_GUINT64_FORMAT, val); + char *str2 = g_string_printf("%" PRIu64, val); These format macros will be the same modulo any GLib bugs.