Remove irritating 'eof:' comments, and some ancient dead code in stringutil.cpp

This commit is contained in:
Brian Cox 2017-04-11 21:29:32 -07:00
parent e653e83058
commit a1e614d694
35 changed files with 33 additions and 182 deletions

View File

@ -150,4 +150,4 @@ bool cCharUtil::PopNextChar( TSTRING::const_iterator& cur,
return f;
}
// eof: charutil.cpp

View File

@ -61,4 +61,4 @@ cCore::cCore()
}
// eof: core.cpp

View File

@ -70,4 +70,4 @@ TSS_BeginStringtable( cCore )
TSS_EndStringtable( cCore )
// eof: corestrings.cpp

View File

@ -97,4 +97,4 @@ TSTRING cDisplayUtil::FormatMultiLineString( const TSTRING& str, int nOffset, in
return( sstr.str() );
}
// eof: displayutil.cpp

View File

@ -244,5 +244,5 @@ tss::mbscount( const_ntmbs_t psz )
return nCount;
}
// eof: ntmbs.cpp

View File

@ -37,4 +37,4 @@
#include "stdcore.h"
// eof: stdcore.cpp

View File

@ -361,151 +361,3 @@ wc16_string cStringUtil::TstrToWstr( const TSTRING& rhs )
cStringUtil::Convert( lhs, rhs );
return lhs;
}
///////////////////////////////////////////////////////////////////////////////
// StringIsInteger -- returns true if the string is a length of at least one
// and contains nothing other than [0-9].
// Used to verify a string is acceptable to pass to atoi()
///////////////////////////////////////////////////////////////////////////////
#ifdef OLDCODE
bool cStringUtil::StringIsInteger(TCHAR* pStr)
{
int len = _tcslen(pStr);
if (len <= 0)
return false;
for (int i = 0; i < len; ++i)
{
if (pStr[i] < _T('0') || pStr[i] > _T('9'))
return false;
}
return true;
}
#endif//OLDCODE
// eof: stringutil.cpp
/*
typedef wchar_t dbchar_t;
typedef char mbchar_t;
class cMBUCS2Cache
{
public:
cMBUCS2Cache();
~cMBUCS2Cache();
bool Convert(dbchar_t& ret, mbchar_t* pMBChar);
// returns false if conversion could not be done
void Add(mbchar_t* pMBchar, int mblen);
// add a mb char def to the chache
protected:
struct Element
{
union
{
Element* mpNext; // points to another Element[256]
dbchar_t mUCS2;
};
enum ElementDefinition { UNDEFINED, UCS2, CONTINUES };
short mElementDefinition;
Element() { mElementDefinition = UNDEFINED; }
~Element() { if (mElementDefinition == CONTINUES) delete mpNext; }
};
Element mTop[256];
};
cMBUCS2Cache::cMBUCS2Cache()
{
}
cMBUCS2Cache::~cMBUCS2Cache()
{
}
// returns false if conversion could not be done
bool cMBUCS2Cache::Convert(dbchar_t& ret, mbchar_t* pMBChar)
{
Element* pNode = mTop;
while (pNode[*pMBChar].mElementDefinition == Element::CONTINUES)
{
pNode = pNode[*pMBChar].mpNext;
++pMBChar;
}
if (pNode[*pMBChar].mElementDefinition == Element::UCS2)
{
ret = pNode[*pMBChar].mUCS2;
return true;
}
return false;
}
// add a mb char def to the chache
void cMBUCS2Cache::Add(mbchar_t* pMBchar, int mblen, dbchar_t ucs2)
{
ASSERT(mblen > 0);
Element* pNode = mTop;
while (mblen > 1);
{
// this ASSERT fails if there is a UCS2 definition for a mbchar
// whose first few bytes are identical to this char
ASSERT(pNode[*pMBchar].mElementDefinition == Element::UNDEFINED ||
pNode[*pMBchar].mElementDefinition == Element::CONTINUES)
if (pNode[*pMBchar].mElementDefinition == Element::UNDEFINED)
{
pNode[*pMBchar].mElementDefinition = Element::CONINUES;
pNode = pNode[*pMBchar].mpNext = new Element[256];
}
else
{
pNode = pNode[*pMBchar].mpNext;
}
--mblen;
++pMBChar;
}
// this assert makes sure everything is sane
ASSERT(pNode[*pMBchar].mElementDefinition == Element::UNDEFINED ||
(pNode[*pMBchar].mElementDefinition == Element::UCS2 && pNode[*pMBchar].mUCS2 == ucs2));
// this assert fails if we attempt to add the same mbchar twice
ASSERT(pNode[*pMBchar].mElementDefinition == Element::UNDEFINED)
pNode[*pMBchar].mElementDefinition = Element::UCS2;
pNode[*pMBchar].mUCS2 = ucs2;
}
*/
/*
static inline const byte* tss_hash_key_convert()( const TCHAR* psz, int* const pcbKeyLen )
{
*pcbKeyLen = sizeof(TCHAR) * _tcslen( psz );
return (byte*)psz;
}
static inline bool tss_hash_key_compare()( const TCHAR* lhs, const TCHAR* rhs )
{
return ( _tcscmp( lhs, rhs ) == 0 );
}
cHashTable< dbchar_t*,
mbchar_t*,
tss_hash_key_convert,
tss_hash_key_compare > ha;
*/

View File

@ -47,5 +47,4 @@ cDb::cDb()
}
// eof: db.cpp

View File

@ -38,4 +38,4 @@
#include "stddb.h"
// eof: stddb.cpp

View File

@ -57,4 +57,4 @@ iFCO::~iFCO()
{
}
// eof: fco.cpp

View File

@ -53,4 +53,4 @@ TSS_BeginStringtable( cFCO )
TSS_EndStringtable( cFCO )
// eof: fcostrings.cpp

View File

@ -138,4 +138,4 @@ void cFCOUndefinedProp::Copy(const iFCOProp* rhs)
ThrowAndAssert( INTERNAL_ERROR("fcoundefprop.cpp") );
}
// eof: fcoundefprop.cpp

View File

@ -37,4 +37,4 @@
#include "stdfco.h"
// eof: stdfco.cpp

View File

@ -37,4 +37,4 @@
#include "stdfs.h"
// eof: stdfs.cpp

View File

@ -67,5 +67,5 @@ cSiggen::cSiggen()
TSS_Dependency( cTWCrypto );
}
// eof: siggen.cpp

View File

@ -75,5 +75,5 @@ TSS_BeginStringtable( cSiggen )
TSS_EndStringtable( cSiggen )
// eof: siggenstrings.cpp

View File

@ -37,4 +37,4 @@
//
#include "stdsiggen.h"
// eof: stdsiggen.cpp

View File

@ -37,4 +37,4 @@
//
#include "stdtripwire.h"
// eof: stdtripwire.cpp

View File

@ -69,5 +69,5 @@ cTripwire::cTripwire()
TSS_REGISTER_PKG_ERRORS( tripwire )
}
// eof: tripwire.cpp

View File

@ -37,4 +37,4 @@
//
#include "stdtw.h"
// eof: stdtw.cpp

View File

@ -66,5 +66,5 @@ cTW::cTW()
TSS_REGISTER_PKG_ERRORS( tw )
}
// eof: tw.cpp

View File

@ -249,5 +249,5 @@ TSS_BeginStringtable( cTW )
TSS_EndStringtable( cTW )
// eof: twstrings.cpp

View File

@ -37,4 +37,4 @@
#include "stdtwadmin.h"
// eof: stdtwadmin.cpp

View File

@ -69,4 +69,4 @@ cTWAdmin::cTWAdmin()
TSS_REGISTER_PKG_ERRORS ( twadmin );
}
// eof: twadmin.cpp

View File

@ -38,4 +38,4 @@
#include "stdtwcrypto.h"
// eof: stdtwcrypto.cpp

View File

@ -63,4 +63,4 @@ cTWCrypto::cTWCrypto()
TSS_REGISTER_PKG_ERRORS( twcrypto )
}
// eof: twcrypto.cpp

View File

@ -37,4 +37,4 @@
#include "stdtwparser.h"
// eof: stdtwparser.cpp

View File

@ -37,4 +37,4 @@
#include "stdtwprint.h"
// eof: stdtwprint.cpp

View File

@ -69,4 +69,4 @@ cTWPrint::cTWPrint()
TSS_REGISTER_PKG_ERRORS ( twprint );
}
// eof: twprint.cpp

View File

@ -340,5 +340,5 @@ bool LowASCIILooksLikeUCS2InWchart()
return fOK;
}
// eof: codeconvert_t.cpp

View File

@ -96,5 +96,5 @@ void TestResources()
}
// eof: tss.resources_t.cpp

View File

@ -37,4 +37,4 @@
//
#include "stdtest.h"
// eof: stdtest.cpp

View File

@ -38,4 +38,4 @@
#include "stdutil.h"
// eof: stdutil.cpp

View File

@ -71,4 +71,4 @@ TSS_EndTestSuite( cUtil )
#endif // #ifdef TSS_TEST
// eof: util.cpp

View File

@ -49,4 +49,4 @@ TSS_BeginStringtable( cUtil )
TSS_EndStringtable( cUtil )
// eof: utilstrings.cpp