From aa1a36e991d97e8d332ac043ae4987f7ef52d472 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Wed, 23 Sep 2015 15:00:30 -1000 Subject: [PATCH] Printf attribute added --- hecl/blender/BlenderConnection.hpp | 3 +++ hecl/driver/ToolExtract.hpp | 10 +++++----- hecl/include/HECL/HECL.hpp | 15 +++++++++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/hecl/blender/BlenderConnection.hpp b/hecl/blender/BlenderConnection.hpp index f3478bdf2..8f1f2781e 100644 --- a/hecl/blender/BlenderConnection.hpp +++ b/hecl/blender/BlenderConnection.hpp @@ -126,6 +126,9 @@ public: m_parent->m_lock = false; } } +#if __GNUC__ + __attribute__((__format__ (__printf__, 2, 3))) +#endif void format(const char* fmt, ...) { if (!m_parent || !m_parent->m_lock) diff --git a/hecl/driver/ToolExtract.hpp b/hecl/driver/ToolExtract.hpp index 590f52be1..de650a0fb 100644 --- a/hecl/driver/ToolExtract.hpp +++ b/hecl/driver/ToolExtract.hpp @@ -218,7 +218,7 @@ public: if (submessageLen) { if (messageLen > half-submessageLen-1) - HECL::Printf(_S("%.*s... "), half-submessageLen-4, message); + HECL::Printf(_S("%.*s... "), half-int(submessageLen)-4, message); else { HECL::Printf(_S("%s"), message); @@ -246,9 +246,9 @@ public: size_t rem = blocks - filled; HECL::Printf(_S("" BOLD "%3d%% ["), iFactor); for (int b=0 ; b