From: scantor Date: Wed, 21 Dec 2011 19:33:16 +0000 (+0000) Subject: Eliminate printf usage in macros. X-Git-Tag: 1.5.1~52 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fxmltooling.git;a=commitdiff_plain;h=5b6e33f9e0f6142b0c444c5f42fe068379dea976 Eliminate printf usage in macros. git-svn-id: https://svn.shibboleth.net/cpp-xmltooling/branches/REL_1@941 de75baf8-a10c-0410-a50a-987c0e22f00f --- 5b6e33f9e0f6142b0c444c5f42fe068379dea976 diff --cc xmltooling/base.h index ff96588,ff96588..4e80091 --- a/xmltooling/base.h +++ b/xmltooling/base.h @@@ -697,10 -697,10 +697,12 @@@ m_##proper = prepareForAssignment(m_##proper,proper); \ } \ void set##proper(int proper) { \ -- char buf##proper[64]; \ -- std::sprintf(buf##proper,"%d",proper); \ -- xmltooling::auto_ptr_XMLCh wide##proper(buf##proper); \ -- set##proper(wide##proper.get()); \ ++ try { \ ++ xmltooling::xstring buf = boost::lexical_cast(proper); \ ++ set##proper(buf.c_str()); \ ++ } \ ++ catch (boost::bad_lexical_cast&) { \ ++ } \ } /** @@@ -1250,10 -1250,10 +1252,12 @@@ } \ XMLTOOLING_DOXYGEN(Sets proper.) \ void set##proper(int proper) { \ -- char buf[64]; \ -- std::sprintf(buf,"%d",proper); \ -- xmltooling::auto_ptr_XMLCh widebuf(buf); \ -- setTextContent(widebuf.get()); \ ++ try { \ ++ xmltooling::xstring buf = boost::lexical_cast(proper); \ ++ setTextContent(buf.c_str()); \ ++ } \ ++ catch (boost::bad_lexical_cast&) { \ ++ } \ } \ XMLTOOLING_DOXYGEN(Sets or clears proper.) \ void set##proper(const XMLCh* proper) { \ diff --cc xmltooling/encryption/Encryption.h index e7e3329,e7e3329..934088b --- a/xmltooling/encryption/Encryption.h +++ b/xmltooling/encryption/Encryption.h @@@ -32,6 -32,6 +32,7 @@@ #include #include ++#include namespace xmlsignature { class XMLTOOL_API KeyInfo;