Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Core/GameEngine/Source/GameNetwork/GameSpy/PeerDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void GameSpyInfo::reset( void )
m_localStagingRoomID = 0;
m_localStagingRoom.reset();
m_gotGroupRoomList = false;
m_localName = "";
m_localName.clear();
m_localProfileID = 0;
m_maxMessagesPerUpdate = 100;
m_disallowAsainText = FALSE;
Expand Down Expand Up @@ -186,7 +186,7 @@ void GameSpyInfo::setGameOptions( void )
req.gameOptions.numPlayers = 0;
req.gameOptions.numObservers = 0;
Int numOpenSlots = 0;
AsciiString playerInfo = "";
AsciiString playerInfo;
for (i=0; i<MAX_SLOTS; ++i)
{
Int wins = 0, losses = 0, profileID = 0;
Expand Down
12 changes: 6 additions & 6 deletions Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,11 @@ class PeerThreadClass : public ThreadClass
m_sawCompleteGameList = FALSE;
m_isConnecting = m_isConnected = false;
m_groupRoomID = m_profileID = 0;
m_nextStagingServer = 1; m_stagingServers.clear();
m_pingStr = ""; m_mapName = ""; m_ladderIP = ""; m_isHosting = false;
m_nextStagingServer = 1;
m_stagingServers.clear();
m_isHosting = false;
for (Int i=0; i<MAX_SLOTS; ++i)
{
m_playerNames[i] = "";
m_playerColors[i] = 0;
m_playerFactions[i] = 0;
m_playerLosses[i] = 0;
Expand Down Expand Up @@ -758,7 +758,7 @@ static void QRServerKeyCallback
t->stopHostingAlready(peer);

#ifdef DEBUG_LOGGING
AsciiString val = "";
AsciiString val;
#define ADD(x) { qr2_buffer_add(buffer, x); val = x; }
#define ADDINT(x) { qr2_buffer_add_int(buffer, x); val.format("%d",x); }
#else
Expand Down Expand Up @@ -852,7 +852,7 @@ static void QRPlayerKeyCallback
#undef ADD
#undef ADDINT
#ifdef DEBUG_LOGGING
AsciiString val = "";
AsciiString val;
#define ADD(x) { qr2_buffer_add(buffer, x); val = x; }
#define ADDINT(x) { qr2_buffer_add_int(buffer, x); val.format("%d",x); }
#else
Expand Down Expand Up @@ -1095,7 +1095,7 @@ static SerialAuthResult doCDKeyAuthentication( PEER peer )
if (!peer)
return retval;

AsciiString s = "";
AsciiString s;
if (GetStringFromRegistry("\\ergc", "", s) && s.isNotEmpty())
{
#ifdef SERVER_DEBUGGING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@ PSPlayerStats GameSpyPSMessageQueueInterface::parsePlayerKVPairs( std::string kv
std::string GameSpyPSMessageQueueInterface::formatPlayerKVPairs( PSPlayerStats stats )
{
char kvbuf[256];
std::string s = "";
std::string s;
PerGeneralMap::iterator it;

ITERATE_OVER(wins);
Expand Down
2 changes: 1 addition & 1 deletion Core/GameEngine/Source/GameNetwork/LANAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ void LANAPI::RequestGameJoin( LANGameInfo *game, UnsignedInt ip /* = 0 */ )
msg.GameToJoin.exeCRC = TheGlobalData->m_exeCRC;
msg.GameToJoin.iniCRC = TheGlobalData->m_iniCRC;

AsciiString s = "";
AsciiString s;
GetStringFromRegistry("\\ergc", "", s);
strlcpy(msg.GameToJoin.serial, s.str(), ARRAY_SIZE(msg.GameToJoin.serial));

Expand Down
4 changes: 1 addition & 3 deletions Core/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -686,9 +686,7 @@ void LANAPI::OnChat( UnicodeString player, UnsignedInt ip, UnicodeString message
switch (format)
{
case LANAPIInterface::LANCHAT_SYSTEM:
unicodeChat = L"";
unicodeChat.concat(message);
unicodeChat.concat(L"");
unicodeChat = message;
index =GadgetListBoxAddEntryText(chatWindow, unicodeChat, chatSystemColor, -1, -1);
break;
case LANAPIInterface::LANCHAT_EMOTE:
Expand Down
1 change: 0 additions & 1 deletion Core/GameEngine/Source/GameNetwork/LANGameInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ void LANDisplayGameList( GameWindow *gameListbox, LANGameInfo *gameList )
while (gameList)
{
UnicodeString txtGName;
txtGName = L"";
if( gameList->isGameInProgress() )
{
txtGName.concat(L"[");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ void StdBIGFileSystem::init() {
AsciiString installPath;
GetStringFromGeneralsRegistry("", "InstallPath", installPath );
//@todo this will need to be ramped up to a crash for release
DEBUG_ASSERTCRASH(installPath != "", ("Be 1337! Go install Generals!"));
if (installPath!="")
DEBUG_ASSERTCRASH(!installPath.isEmpty(), ("Be 1337! Go install Generals!"));
if (!installPath.isEmpty())
loadBigFilesFromDirectory(installPath, "*.big");
#endif
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ void Win32BIGFileSystem::init() {
AsciiString installPath;
GetStringFromGeneralsRegistry("", "InstallPath", installPath );
//@todo this will need to be ramped up to a crash for release
DEBUG_ASSERTCRASH(installPath != "", ("Be 1337! Go install Generals!"));
if (installPath!="")
DEBUG_ASSERTCRASH(!installPath.isEmpty(), ("Be 1337! Go install Generals!"));
if (!installPath.isEmpty())
loadBigFilesFromDirectory(installPath, "*.big");
#endif
}
Expand Down
4 changes: 2 additions & 2 deletions Core/Tools/CRCDiff/KVPair.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

std::string intToString(int val)
{
std::string s = "";
std::string s;
bool neg = (val < 0);
if (val < 0)
{
Expand Down Expand Up @@ -134,7 +134,7 @@ void KVPairClass::readFromFile( const std::string& in, const std::string& delim
FILE *fp = fopen(in.c_str(), "rb");
if (fp)
{
std::string s = "";
std::string s;
fseek(fp, 0, SEEK_END);
int len = ftell(fp);
fseek(fp, 0, SEEK_SET);
Expand Down
2 changes: 1 addition & 1 deletion Core/Tools/CRCDiff/expander.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void Expander::expand( const std::string& input,
else
{
std::string toExpand = it->second;
std::string expanded = "";
std::string expanded;
//DEBUG_LOG(("###### expanding '%s'", toExpand.c_str()));
expand(toExpand, expanded, stripUnknown);
//DEBUG_LOG(("###### expanded '%s'", expanded.c_str()));
Expand Down
4 changes: 2 additions & 2 deletions Core/Tools/Compress/Compress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ void dumpHelp(const char *exe)

int main(int argc, char **argv)
{
std::string inFile = "";
std::string outFile = "";
std::string inFile;
std::string outFile;
CompressionType compressType = CompressionManager::getPreferredCompression();

for (int i=1; i<argc; ++i)
Expand Down
6 changes: 3 additions & 3 deletions Core/Tools/PATCHGET/CHATAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ static void queuePatch(bool mandatory, std::string downloadURL)
std::string fileStr = filePath;
unsigned int slashPos = filePath.find_last_of('/');
std::string fileDir = "patches\\";
std::string fileName = "";
std::string fileName;
if (slashPos == filePath.npos)
{
fileName = filePath;
Expand Down Expand Up @@ -816,7 +816,7 @@ char const * Fetch_String(int id)
/*
** Determine if the string ID requested is valid. If not then return an empty string pointer.
*/
if (id == -1 || id == TXT_NONE) return("");
if (id == -1 || id == TXT_NONE) return "";

/*
** Adjust the 'time stamp' tracking value. This is an artificial value used merely to track
Expand Down Expand Up @@ -859,7 +859,7 @@ char const * Fetch_String(int id)


if (LoadString(Global_instance, id, stringptr, sizeof(_buffers[oldest].String)) == 0) {
return("");
return "";
}

/******
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ class StructureToppleUpdateModuleData : public UpdateModuleData
m_toppleDoneFXList = NULL;
m_toppleFXList = NULL;
m_crushingFXList = NULL;
m_crushingWeaponName.set("");

for (int i = 0; i < ST_PHASE_COUNT; ++i)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class UnitCrateCollideModuleData : public CrateCollideModuleData
UnitCrateCollideModuleData()
{
m_unitCount = 0;
m_unitType = "";
}

static void buildFieldParse(MultiIniFieldParse& p)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void INI::parseAnim2DDefinition( INI* ini )

// item not found, create a new one
animTemplate = TheAnim2DCollection->newTemplate( name );
DEBUG_ASSERTCRASH( animTemplate, ("INI""parseAnim2DDefinition - unable to allocate animation template for '%s'",
DEBUG_ASSERTCRASH( animTemplate, ("INI::parseAnim2DDefinition - unable to allocate animation template for '%s'",
name.str()) );

}
Expand Down
4 changes: 2 additions & 2 deletions Generals/Code/GameEngine/Source/GameClient/LanguageFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void LanguageFilter::filterLine(UnicodeString &line)
wcscpy(buf, line.str());

UnicodeString newLine(line);
UnicodeString token(L"");
UnicodeString token;

while (newLine.nextToken(&token, L" ;,.!?:=\\/><`~()&^%#\n\t")) {
wchar_t *pos = wcsstr(buf, token.str());
Expand Down Expand Up @@ -112,7 +112,7 @@ void LanguageFilter::filterLine(UnicodeString &line)

void LanguageFilter::unHaxor(UnicodeString &word) {
Int len = word.getLength();
UnicodeString newWord(L"");
UnicodeString newWord;
for (Int i = 0; i < len; ++i) {
wchar_t c = word.getCharAt(i);
if ((c == L'p') || (c == L'P')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3354,7 +3354,7 @@ void ParticleSystemManager::xfer( Xfer *xfer )

// ignore destroyed systems and non-saveable systems
if( system->isDestroyed() == TRUE || system->isSaveable() == FALSE ) {
AsciiString mtString = "";
AsciiString mtString;
xfer->xferAsciiString(&mtString); // write null string as key for destroyed system.
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ Object *SpawnBehavior::reclaimOrphanSpawn( void )
//

OrphanData orphanData;
AsciiString prevName = "";
AsciiString prevName;
for (std::vector<AsciiString>::const_iterator tempName = md->m_spawnTemplateNameData.begin();
tempName != md->m_spawnTemplateNameData.end();
++tempName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
// ------------------------------------------------------------------------------------------------
GrantUpgradeCreateModuleData::GrantUpgradeCreateModuleData()
{
m_upgradeName = "";
}

// ------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ Object *CreateCrateDie::createCrate( CrateTemplate const *currentCrateData )
// CreationChance is used for the success of this block, but this block can have any number of potential actual crates
Real multipleCratePick = GameLogicRandomValueReal( 0, 1 );
Real multipleCrateRunningTotal = 0;
AsciiString crateName = "";
AsciiString crateName;

for( crateCreationEntryConstIterator iter = currentCrateData->m_possibleCrates.begin();
iter != currentCrateData->m_possibleCrates.end();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
void parseUpgradePair( INI *ini, void *instance, void *store, const void *userData )
{
upgradePair info;
info.type = "";
info.amount = 0;

const char *token = ini->getNextToken( ini->getSepsColon() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9080,7 +9080,7 @@ void _writeSingleParticleSystem( File *out, ParticleSystemTemplate *templ )
// these were all originally << (feed-operator for streams)
// I might come back and re-write this later, if there are enough complaints. ;-) jkmcd
// in the meantime, move along...
std::string thisEntry = "";
std::string thisEntry;
thisEntry.append(HEADER).append(SEP_SPACE).append(templ->getName().str()).append(SEP_EOL);
thisEntry.append(SEP_HEAD).append(F_PRIORITY).append(EQ_WITH_SPACES).append(ParticlePriorityNames[templ->m_priority]).append(SEP_EOL);
thisEntry.append(SEP_HEAD).append(F_ISONESHOT).append(EQ_WITH_SPACES).append((templ->m_isOneShot ? STR_TRUE : STR_FALSE)).append(SEP_EOL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ const FieldParse CrateTemplate::TheCrateTemplateFieldParseTable[] =

CrateTemplate::CrateTemplate()
{
m_name = "";

m_creationChance = 0;
CLEAR_KINDOFMASK(m_killedByTypeKindof);
m_veterancyLevel = LEVEL_INVALID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,7 @@ void W3DDisplay::gatherDebugStats( void )
// Network outgoing bandwidth stats
// unibuffer.format(L"OUT: 0.0 bytes/sec, 0.0 packets/sec");
// m_displayStrings[NetOutgoing]->setText( unibuffer );
unibuffer.format(L"");
unibuffer.clear();
// unibuffer.format(L"Network not present");
m_displayStrings[NetOutgoing]->setText(unibuffer);
m_displayStrings[NetIncoming]->setText(unibuffer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ void TextureLoadTaskClass::Init(TextureBaseClass* tc,bool high_priority)
{
// Make sure texture has a filename.
REF_PTR_SET(Texture,tc);
//WWASSERT(Texture->Get_Full_Path() != NULL);
//WWASSERT(!Texture->Get_Full_Path().Is_Empty());

Reduction=Texture->Get_Reduction();
HighPriorityRequested=high_priority;
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/Tools/WorldBuilder/src/WHeightMapEdit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2183,7 +2183,7 @@ Bool WorldHeightMapEdit::selectInvalidTeam(void)
}
}

AsciiString report = "";
AsciiString report;
AsciiString line;

#if 0
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/Tools/WorldBuilder/src/WorldBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ void CWorldBuilderApp::OnFileOpen()
#endif

CFileStatus status;
if (m_currentDirectory != "") try {
if (!m_currentDirectory.isEmpty()) try {
if (CFile::GetStatus(m_currentDirectory.str(), status)) {
if (status.m_attribute & CFile::directory) {
::SetCurrentDirectory(m_currentDirectory.str());
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/Tools/WorldBuilder/src/mapobjectprops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ void MapObjectProps::_DictToTeam(void)

void MapObjectProps::_DictToName(void)
{
AsciiString name = "";
AsciiString name;
Bool exists;
if (m_dictToEdit) {
name = m_dictToEdit->getAsciiString(TheKey_objectName, &exists);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ class StructureToppleUpdateModuleData : public UpdateModuleData
m_toppleDoneFXList = NULL;
m_toppleFXList = NULL;
m_crushingFXList = NULL;
m_crushingWeaponName.set("");

for (int i = 0; i < ST_PHASE_COUNT; ++i)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class UnitCrateCollideModuleData : public CrateCollideModuleData
UnitCrateCollideModuleData()
{
m_unitCount = 0;
m_unitType = "";
}

static void buildFieldParse(MultiIniFieldParse& p)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void INI::parseAnim2DDefinition( INI* ini )

// item not found, create a new one
animTemplate = TheAnim2DCollection->newTemplate( name );
DEBUG_ASSERTCRASH( animTemplate, ("INI""parseAnim2DDefinition - unable to allocate animation template for '%s'",
DEBUG_ASSERTCRASH( animTemplate, ("INI::parseAnim2DDefinition - unable to allocate animation template for '%s'",
name.str()) );

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void LanguageFilter::filterLine(UnicodeString &line)
wcscpy(buf, line.str());

UnicodeString newLine(line);
UnicodeString token(L"");
UnicodeString token;

while (newLine.nextToken(&token, L" ;,.!?:=\\/><`~()&^%#\n\t")) {
wchar_t *pos = wcsstr(buf, token.str());
Expand Down Expand Up @@ -112,7 +112,7 @@ void LanguageFilter::filterLine(UnicodeString &line)

void LanguageFilter::unHaxor(UnicodeString &word) {
Int len = word.getLength();
UnicodeString newWord(L"");
UnicodeString newWord;
for (Int i = 0; i < len; ++i) {
wchar_t c = word.getCharAt(i);
if ((c == L'p') || (c == L'P')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3256,7 +3256,7 @@ void ParticleSystemManager::xfer( Xfer *xfer )

// ignore destroyed systems and non-saveable systems
if( system->isDestroyed() == TRUE || system->isSaveable() == FALSE ) {
AsciiString mtString = "";
AsciiString mtString;
xfer->xferAsciiString(&mtString); // write null string as key for destroyed system.
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ Object *SpawnBehavior::reclaimOrphanSpawn( void )
//

OrphanData orphanData;
AsciiString prevName = "";
AsciiString prevName;
for (std::vector<AsciiString>::const_iterator tempName = md->m_spawnTemplateNameData.begin();
tempName != md->m_spawnTemplateNameData.end();
++tempName)
Expand Down
Loading
Loading