fix printing pointers
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@450 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
32b4c0a8fa
commit
b3c54696f8
2 changed files with 13 additions and 11 deletions
16
CHANGES
16
CHANGES
|
@ -7,8 +7,8 @@ _____________________________________
|
||||||
General:
|
General:
|
||||||
- LockPtr added (rs)
|
- LockPtr added (rs)
|
||||||
- ScopeGuard added (pk,rs)
|
- ScopeGuard added (pk,rs)
|
||||||
- improved Makefiles (Thanks to Lukas Fittl, pk)
|
- improved Makefiles (lf,pk)
|
||||||
- several gcc fixes and removed warnings by Lukas Fittl
|
- several gcc fixes and removed warnings by Lukas Fittl (lf)
|
||||||
- tested on 64-bit Linux (pk)
|
- tested on 64-bit Linux (pk)
|
||||||
- MS Visual C++ project files added (pk)
|
- MS Visual C++ project files added (pk)
|
||||||
- now also the ms toolkit 2003 generates a library (pk)
|
- now also the ms toolkit 2003 generates a library (pk)
|
||||||
|
@ -17,12 +17,13 @@ OrderedStatic:
|
||||||
- point operator added (pk)
|
- point operator added (pk)
|
||||||
|
|
||||||
SafeFormat:
|
SafeFormat:
|
||||||
- moved into namespace Loki
|
- moved into namespace Loki (pk)
|
||||||
- %p test disabled due to platform dependent problems (pk)
|
|
||||||
- speed comparison added (pk)
|
|
||||||
- 64 bit problems fixed (Thanks to Zak Kipling)
|
- 64 bit problems fixed (Thanks to Zak Kipling)
|
||||||
- ported to 64-bit Windows, not tested (pk)
|
- ported to 64-bit Windows, not tested (pk)
|
||||||
- Printf/SPrintfing of std::strings added
|
- Printf/SPrintfing of std::strings added (pk)
|
||||||
|
- all warnings removed gcc and msvc (pk)
|
||||||
|
- use snprintf for "p"
|
||||||
|
- test program: speed comparison added (pk)
|
||||||
|
|
||||||
SmallObject:
|
SmallObject:
|
||||||
- added functions to check for memory corruption (rs)
|
- added functions to check for memory corruption (rs)
|
||||||
|
@ -51,7 +52,8 @@ ScopeGuard:
|
||||||
- example added (pk)
|
- example added (pk)
|
||||||
|
|
||||||
|
|
||||||
CVS commits by Rich Sposato (rs) and Peter Kümmel (pk)
|
CVS commits by Rich Sposato (rs), Lukas Fittl (lf)
|
||||||
|
and Peter Kümmel (pk)
|
||||||
|
|
||||||
|
|
||||||
_____________________________________
|
_____________________________________
|
||||||
|
|
|
@ -142,19 +142,19 @@ namespace Loki
|
||||||
|
|
||||||
PrintfState& operator()(void* n) {
|
PrintfState& operator()(void* n) {
|
||||||
if (result_ == -1) return *this; // don't even bother
|
if (result_ == -1) return *this; // don't even bother
|
||||||
PrintUsing_printf(n,"p");
|
PrintUsing_snprintf(n,"p");
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintfState& operator()(double n) {
|
PrintfState& operator()(double n) {
|
||||||
if (result_ == -1) return *this; // don't even bother
|
if (result_ == -1) return *this; // don't even bother
|
||||||
PrintUsing_printf(n,"eEfgG");
|
PrintUsing_snprintf(n,"eEfgG");
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintfState& operator()(long double n) {
|
PrintfState& operator()(long double n) {
|
||||||
if (result_ == -1) return *this; // don't even bother
|
if (result_ == -1) return *this; // don't even bother
|
||||||
PrintUsing_printf(n,"eEfgG");
|
PrintUsing_snprintf(n,"eEfgG");
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -328,7 +328,7 @@ namespace Loki
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Value>
|
template <class Value>
|
||||||
void PrintUsing_printf(Value n, const char* check_fmt_char) {
|
void PrintUsing_snprintf(Value n, const char* check_fmt_char) {
|
||||||
const Char *const fmt = format_ - 1;
|
const Char *const fmt = format_ - 1;
|
||||||
assert(*fmt == '%');
|
assert(*fmt == '%');
|
||||||
// enforce format string validity
|
// enforce format string validity
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue