diff options
Diffstat (limited to 'src/lib/sprintf.C')
-rw-r--r-- | src/lib/sprintf.C | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/lib/sprintf.C b/src/lib/sprintf.C index c50ed3966..2cac40421 100644 --- a/src/lib/sprintf.C +++ b/src/lib/sprintf.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2019 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -70,6 +72,7 @@ struct format_options TYPE_CHAR, TYPE_STRING, TYPE_PTR, + TYPE_DOUBLE, }; types type; @@ -253,6 +256,10 @@ void parse_format_options(format_options& opt, const char*& fmt) opt.type = opt.TYPE_PTR; break; + case 'f': + opt.type = opt.TYPE_DOUBLE; + break; + default: opt.type = opt.TYPE_PERCENT; } @@ -312,6 +319,16 @@ size_t display_string(ConsoleBufferInterface& func, return count; } +size_t display_double(ConsoleBufferInterface& func, + const format_options& f, double number) +{ + // TODO: CQ SW464805 Put in an implementation for double + + size_t count(0); + + return count; +} + size_t display_number(ConsoleBufferInterface& func, const format_options& f, uint64_t number) { @@ -492,6 +509,10 @@ size_t vasprintf(ConsoleBufferInterface& func, const char* fmt, va_list& args) count += display_string(func, f, va_arg(args,const char*)); break; + case format_options::TYPE_DOUBLE: + count += display_double(func, f, va_arg(args,double)); + break; + // All the number cases. default: { |