From b183df5d5dbc0dbef5ff1bbf3c37bb8169c62092 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Thu, 26 Feb 2004 10:40:11 +0000 Subject: Bruce moved the constructors from number types out of line. --- include/SString.h | 14 ++------------ src/PropSet.cxx | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/include/SString.h b/include/SString.h index 7714d6d50..63930189c 100644 --- a/include/SString.h +++ b/include/SString.h @@ -58,18 +58,8 @@ public: s = StringAllocate(s_ + first, last - first); sSize = sLen = (s) ? strlen(s) : 0; } - SString(int i) : sizeGrowth(sizeGrowthDefault) { - char number[32]; - sprintf(number, "%0d", i); - s = StringAllocate(number); - sSize = sLen = (s) ? strlen(s) : 0; - } - SString(double d, int precision) : sizeGrowth(sizeGrowthDefault) { - char number[32]; - sprintf(number, "%.*f", precision, d); - s = StringAllocate(number); - sSize = sLen = (s) ? strlen(s) : 0; - } + SString(int i); + SString(double d, int precision); ~SString() { delete []s; s = 0; diff --git a/src/PropSet.cxx b/src/PropSet.cxx index a12e074cc..41b2d5eff 100644 --- a/src/PropSet.cxx +++ b/src/PropSet.cxx @@ -76,6 +76,21 @@ bool EqualCaseInsensitive(const char *a, const char *b) { // implementations of the SString members here as well, so // that I can quickly see what effect this has. + +SString::SString(int i) : sizeGrowth(sizeGrowthDefault) { + char number[32]; + sprintf(number, "%0d", i); + s = StringAllocate(number); + sSize = sLen = (s) ? strlen(s) : 0; +} + +SString::SString(double d, int precision) : sizeGrowth(sizeGrowthDefault) { + char number[32]; + sprintf(number, "%.*f", precision, d); + s = StringAllocate(number); + sSize = sLen = (s) ? strlen(s) : 0; +} + bool SString::grow(lenpos_t lenNew) { while (sizeGrowth * 6 < lenNew) { sizeGrowth *= 2; -- cgit v1.2.3