From d0226a97343031b56c1f11da82db16470b8fccbf Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 18 Sep 2006 21:31:48 +0000 Subject: [PATCH] simplify remove unused --- stepmania/src/StdString.h | 39 ++++++++------------------------------- 1 file changed, 8 insertions(+), 31 deletions(-) diff --git a/stepmania/src/StdString.h b/stepmania/src/StdString.h index 92b2b350db..8b1d3b8410 100644 --- a/stepmania/src/StdString.h +++ b/stepmania/src/StdString.h @@ -303,19 +303,10 @@ inline void ssadd(std::string& sDst, PCSTR pA) { MakeUpper( pT, nLen ); } -// ----------------------------------------------------------------------------- -// vsprintf/vswprintf or _vsnprintf/_vsnwprintf equivalents. In standard -// builds we can't use _vsnprintf/_vsnwsprintf because they're MS extensions. -// ----------------------------------------------------------------------------- - inline int ssvsprintf(PSTR pA, size_t nCount, PCSTR pFmtA, va_list vl) - { -#if defined(WIN32) - return _vsnprintf(pA, nCount, pFmtA, vl); -#else - return vsnprintf(pA, nCount, pFmtA, vl); -#endif - } +#if defined(WIN32) +#define vsnprintf _vsnprintf +#endif // Now we can define the template (finally!) // ============================================================================= @@ -741,7 +732,7 @@ public: nChars += ((nTry+1) * FMT_BLOCK_SIZE); pBuf = reinterpret_cast(_alloca(sizeof(CT)*nChars)); - nUsed = ssvsprintf(pBuf, nChars-1, szFormat, argList); + nUsed = vsnprintf(pBuf, nChars-1, szFormat, argList); // Ensure proper NULL termination. @@ -770,11 +761,11 @@ public: va_list tmp; va_copy( tmp, argList ); char ignore; - int iNeeded = ssvsprintf( &ignore, 0, szFormat, tmp ); + int iNeeded = vsnprintf( &ignore, 0, szFormat, tmp ); va_end(tmp); char *buf = GetBuffer( iNeeded+1 ); - ssvsprintf( buf, iNeeded+1, szFormat, argList ); + vsnprintf( buf, iNeeded+1, szFormat, argList ); ReleaseBuffer( iNeeded ); return; } @@ -785,7 +776,7 @@ public: { // Grow more than linearly (e.g. 512, 1536, 3072, etc) char *buf = GetBuffer(nChars); - int nUsed = ssvsprintf(buf, nChars-1, szFormat, argList); + int nUsed = vsnprintf(buf, nChars-1, szFormat, argList); if(nUsed == -1) { @@ -834,11 +825,6 @@ public: return this->substr(0, static_cast(nCount)); } - void MakeReverse() - { - std::reverse(this->begin(), this->end()); - } - void ReleaseBuffer(int nNewLen=-1) { RelBuf(nNewLen); @@ -932,16 +918,7 @@ public: // Now typedef our class names based upon this humongous template typedef CStdStr CStdStringA; // a better std::string - -// Define friendly names for some of these functions - - #define CStdString CStdStringA - -// ...and some shorter names for the space-efficient - -#define WUFmtA WUFormatA -#define WUFmtW WUFormatW -#define WUFmt WUFormat +#define CStdString CStdStringA // -----------------------------------------------------------------------------