Mercurial > hg > orthanc-stone
changeset 1103:f7759637cdfb broker
integration mainline->broker
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 26 Oct 2019 11:44:38 +0200 |
parents | a9d10e54c536 (current diff) 141593f1aa88 (diff) |
children | 98cdfe5768a4 |
files | Applications/Samples/SingleFrameEditorApplication.h Framework/Toolbox/GenericToolbox.h UnitTestsSources/GenericToolboxTests.cpp |
diffstat | 1 files changed, 15 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/UnitTestsSources/GenericToolboxTests.cpp Sat Oct 26 11:37:40 2019 +0200 +++ b/UnitTestsSources/GenericToolboxTests.cpp Sat Oct 26 11:44:38 2019 +0200 @@ -3762,7 +3762,11 @@ for (double b = DBL_EPSILON; b < DBL_MAX && i < COUNT; ++i, b *= FACTOR) { char txt[1024]; +#if defined(_MSC_VER) + sprintf_s(txt, "%.17f", b); +#else snprintf(txt, sizeof(txt) - 1, "%.17f", b); +#endif double r = 0.0; bool ok = StringToDouble(r, txt); @@ -3802,7 +3806,11 @@ for (double b = -1.0*DBL_EPSILON; b < DBL_MAX && i < COUNT; ++i, b *= FACTOR) { char txt[1024]; +#if defined(_MSC_VER) + sprintf_s(txt, "%.17f", b); +#else snprintf(txt, sizeof(txt) - 1, "%.17f", b); +#endif double r = 0.0; bool ok = StringToDouble(r, txt); @@ -3842,12 +3850,14 @@ { int64_t bi = static_cast<int64_t>(b); char txt[1024]; -#if (defined __clang__) || (defined __GNUC__) || ( (defined _MSC_VER) && (_MSC_VER > 1800) ) +#if defined(_MSC_VER) +# if (_MSC_VER > 1800) + sprintf_s(txt, "%lld", bi); +# else + sprintf_s(txt, "%I64d", bi); +# endif +#else snprintf(txt, sizeof(txt) - 1, "%ld", bi); -#elif (defined _MSC_VER) - snprintf(txt, sizeof(txt) - 1, "%I64d", bi); -#else -#error Please adjust for your platform #endif int64_t r = 0; bool ok = StringToInteger<int64_t>(r, txt);