diff options
-rwxr-xr-x | src/build/citest/autocitest | 4 | ||||
-rw-r--r-- | src/include/util/sprintf.H | 80 |
2 files changed, 48 insertions, 36 deletions
diff --git a/src/build/citest/autocitest b/src/build/citest/autocitest index b93bf405c..156b804ec 100755 --- a/src/build/citest/autocitest +++ b/src/build/citest/autocitest @@ -6,7 +6,7 @@ # # IBM CONFIDENTIAL # -# COPYRIGHT International Business Machines Corp. 2011,2012 +# COPYRIGHT International Business Machines Corp. 2011,2013 # # p1 # @@ -464,7 +464,7 @@ cat $SBXHOME/traceHB.log initfail=0 echo "Shutdown Code = $shutdown_code" -if [ "${shutdown_code}" != "0000000001230000" ] +if [ "${shutdown_code}" != "1230000" ] then echo "**ERROR : System did not initialize and/or shutdown properly**" initfail=1 diff --git a/src/include/util/sprintf.H b/src/include/util/sprintf.H index 776fa090d..1385e9b17 100644 --- a/src/include/util/sprintf.H +++ b/src/include/util/sprintf.H @@ -1,25 +1,25 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/include/util/sprintf.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/util/sprintf.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ #ifndef __UTIL_SPRINTF_H #define __UTIL_SPRINTF_H @@ -125,21 +125,33 @@ namespace Util ALWAYS_INLINE static size_t display(_F& c, _T value) { - size_t length = sizeof(_T) * 2; - subdisplay(c, value, length); - return length; + size_t count = 0; + if (value == 0) + { + c('0'); count++; + } + else + { + count += subdisplay(c, value); + } + return count; } template <typename _F> - static void subdisplay(_F& c, _T value, size_t length) - { - if (length == 0) return; - subdisplay(c, value / 16, length-1); - char nibble = value % 16; - if (nibble >= 0x0a) - c('A' + (nibble - 0x0a)); - else - c('0' + nibble); + static size_t subdisplay(_F& c, _T value) + { + size_t count = 0; + if (value != 0) + { + count += subdisplay(c, value / 16); + char nibble = value % 16; + if (nibble >= 0x0a) + c('A' + (nibble - 0x0a)); + else + c('0' + nibble); + count++; + } + return count; } }; |