Skip to content

Commit 49df10c

Browse files
committed
Remove instances of strupr and replace with openw3d version
1 parent 05725eb commit 49df10c

10 files changed

Lines changed: 18 additions & 16 deletions

File tree

Code/Combat/refinerygameobj.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ RefineryGameObj::CnC_Initialize (BaseControllerClass *base)
487487
if (anim_phys_obj != NULL && anim_phys_obj->Peek_Model () != NULL) {
488488

489489
StringClass name = anim_phys_obj->Peek_Model ()->Get_Name ();
490-
::strupr (name.Peek_Buffer ());
490+
name.To_Upper();
491491
if (::strstr (name, "REF_TIB_DUMP") != NULL) {
492492

493493
//

Code/Combat/warfactorygameobj.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ WarFactoryGameObj::CnC_Initialize (BaseControllerClass *base)
398398
if (anim_phys_obj != NULL && anim_phys_obj->Peek_Model () != NULL) {
399399

400400
StringClass name = anim_phys_obj->Peek_Model ()->Get_Name ();
401-
::strupr (name.Peek_Buffer ());
401+
name.To_Upper();
402402
if (::strstr (name, "WEP#CONSTRUCT") != NULL) {
403403

404404
//

Code/Commando/GameSpyBanList.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
#include "sctextobj.h"
5555
#include "ConsoleMode.h"
5656
#include "gamesideservercontrol.h"
57+
#include "wwstring.h"
5758
#include <cstdio>
5859

5960

@@ -212,7 +213,7 @@ bool cGameSpyBanList::Is_User_Banned(const char *nickname, const char *challenge
212213
char *a = strdup(t->Get_Nick_Name());
213214
char *b = strdup(nickname);
214215

215-
_strupr(a); _strupr(b);
216+
openw3d::string_to_upper(a); openw3d::string_to_upper(b);
216217

217218
//
218219
// This code means that you can put a BAN name in as
@@ -343,4 +344,4 @@ void cGameSpyBanList::LoadBans(void) {
343344
BanList->Add_Tail(t);
344345
}
345346
fclose(outf);
346-
}
347+
}

Code/Commando/dlgcncwinscreen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ CNCWinScreenMenuClass::On_Init_Dialog (void)
307307
//
308308
// Strip off the .mix if present.
309309
//
310-
strupr(map_name);
310+
openw3d::string_to_upper(map_name);
311311
char *dot = strstr(map_name, ".MIX");
312312
strcpy(map_name, The_Game()->Get_Map_Name());
313313
if (dot) {
@@ -669,4 +669,4 @@ CNCWinScreenMenuClass::Build_Player_Display_Name (const cPlayer *player, WideStr
669669
#endif
670670

671671
outName = player->Get_Name();
672-
}
672+
}

Code/SControl/servercontrol.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "servercontrol.h"
4242
#include "systimer.h"
4343
#include <limits>
44+
#include "wwstring.h"
4445

4546
/*
4647
** Single instance of server control.
@@ -261,7 +262,7 @@ void ServerControlClass::Parse_Message(void *buffer, int len, unsigned int addre
261262
char text[MAX_SERVER_CONTROL_MESSAGE_SIZE + 1];
262263
memcpy(text, message->Message, MAX_SERVER_CONTROL_MESSAGE_SIZE);
263264
text[MAX_SERVER_CONTROL_MESSAGE_SIZE] = 0;
264-
strupr(text);
265+
openw3d::string_to_upper(text);
265266

266267
switch (message->Type) {
267268
/*
@@ -568,4 +569,4 @@ void ServerControlClass::Set_Welcome_Message(char *message)
568569
memset(WelcomeMessage, 0, sizeof(WelcomeMessage));
569570
strncpy(WelcomeMessage, message, sizeof(WelcomeMessage)-1);
570571
}
571-
}
572+
}

Code/Tools/LightMap/LightMapDoc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1684,7 +1684,7 @@ BOOL LightMapDoc::OnSaveDocument (LPCTSTR pathname)
16841684
strcpy (lightmapdirectory, filename);
16851685

16861686
// Convert filename to uppercase.
1687-
_strupr (filename);
1687+
openw3d::string_to_upper (filename);
16881688

16891689
W3dFile->Open (FileClass::READ);
16901690

Code/Tools/MixViewer/AVAssetSuck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void AVAssetSuckerClass::Thread_Suck(void)
102102
for (int i=0 ; i<filename_list.Count() ; i++) {
103103

104104
strcpy(name, filename_list[i].Peek_Buffer());
105-
strupr(name);
105+
openw3d::string_to_upper(name);
106106

107107
if (strstr(name, ".WAV") == 0) {
108108
if (strstr(name, ".TGA") == 0) {

Code/Tools/MixViewer/MixPatchMaker.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void MixPatchMakerClass::Thread_Make(void)
117117
for (int i=0 ; i<new_filename_list.Count() ; i++) {
118118

119119
strcpy(name, new_filename_list[i].Peek_Buffer());
120-
strupr(name);
120+
openw3d::string_to_upper(name);
121121
bool copy = false;
122122

123123
if (stricmp(name, "STRINGS.TDB") == 0) {
@@ -448,4 +448,4 @@ bool MixPatchMakerClass::Find_File(char *file_name, char *path, char *found_path
448448
}
449449

450450
return(false);
451-
}
451+
}

Code/Tools/max2w3d/util.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,12 @@ void Create_Relative_Path(char *rel_path, const char *curr, const char *full_pat
311311
int curr_len = strlen(curr);
312312
char *up_curr = (char *)malloc(curr_len + 1);
313313
strcpy(up_curr, curr);
314-
_strupr(up_curr);
314+
openw3d::string_to_upper(up_curr);
315315

316316
int full_len = strlen(full_path);
317317
char *up_full = (char *)malloc(full_len + 1);
318318
strcpy(up_full, full_path);
319-
_strupr(up_full);
319+
openw3d::string_to_upper(up_full);
320320

321321
char *rel_p = rel_path;
322322

Code/ww3d2/animatedsoundmgr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ AnimatedSoundMgrClass::Initialize (const char *ini_filename)
223223
// Get the animation name from the section name
224224
//
225225
StringClass animation_name = section->Section;
226-
::strupr (animation_name.Peek_Buffer ());
226+
animation_name.To_Upper();
227227

228228
//
229229
// Allocate a sound list
@@ -354,7 +354,7 @@ AnimatedSoundMgrClass::Find_Sound_List (HAnimClass *anim)
354354
//
355355
// Make the name uppercase
356356
//
357-
::strupr (full_name.Peek_Buffer ());
357+
full_name.To_Upper();
358358

359359
//
360360
// Lookup the sound list for this animation

0 commit comments

Comments
 (0)