Browse Source

Remove empty_string garbage

pull/25/head
galaxyhaxz 7 years ago committed by Anders Jenbo
parent
commit
86f00145f8
  1. 5
      Source/appfat.cpp
  2. 1
      Source/appfat.h
  3. 2
      Source/control.cpp
  4. 4
      Source/diablo.cpp
  5. 10
      Source/init.cpp
  6. 6
      Source/items.cpp
  7. 2
      Source/stores.cpp

5
Source/appfat.cpp

@ -8,7 +8,6 @@ float appfat_cpp_init_value;
char sz_error_buf[256];
int terminating; // weak
int cleanup_thread_id; // weak
char empty_string;
// appfat_cpp_init initializes the C++ runtime of appfat.cpp.
struct appfat_cpp_init {
@ -384,7 +383,7 @@ void __fastcall FileErrDlg(const char *error)
v1 = error;
FreeDlg();
if (!v1)
v1 = &empty_string;
v1 = "";
if (DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_DIALOG3), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)v1) == -1)
TermMsg("FileErrDlg");
TermMsg(0);
@ -406,7 +405,7 @@ BOOL __cdecl InsertCDDlg()
int v0; // edi
ShowCursor(1);
v0 = DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_DIALOG9), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)&empty_string);
v0 = DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_DIALOG9), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)"");
if (v0 == -1)
TermMsg("InsertCDDlg");
ShowCursor(0);

1
Source/appfat.h

@ -5,7 +5,6 @@
extern char sz_error_buf[256];
extern int terminating; // weak
extern int cleanup_thread_id; // weak
extern char empty_string;
char *__fastcall GetErrorStr(int error_code);
void __fastcall TraceErrorDD(int error_code, char *error_buf, int error_buf_len);

2
Source/control.cpp

@ -1007,7 +1007,7 @@ void __cdecl InitControlPan()
chrbtnactive = 0;
chrbtn[3] = 0;
pDurIcons = LoadFileInMem("Items\\DurIcons.CEL", 0);
strcpy(infostr, &empty_string);
strcpy(infostr, "");
ClearPanel();
drawhpflag = TRUE;
drawmanaflag = TRUE;

4
Source/diablo.cpp

@ -500,8 +500,8 @@ void __fastcall diablo_reload_process(HMODULE hModule)
HANDLE hMap; // [esp+2A0h] [ebp-8h]
HWND hWnd; // [esp+2A4h] [ebp-4h]
*Filename = empty_string;
memset(Filename + 1, 0, sizeof(Filename) - 1);
//*Filename = empty_string;
memset(Filename, 0, sizeof(Filename));
// *(_WORD *)&Filename[257] = 0;
// Filename[259] = 0;
GetModuleFileName(hModule, Filename, 0x104u);

10
Source/init.cpp

@ -69,9 +69,9 @@ void __cdecl init_run_office_from_start_menu()
LPITEMIDLIST ppidl; // [esp+100h] [ebp-4h]
if (killed_mom_parent) {
*pszPath = empty_string;
//*pszPath = empty_string;
killed_mom_parent = 0;
memset(pszPath + 1, 0, sizeof(pszPath) - 1);
memset(pszPath, 0, sizeof(pszPath));
// *(_WORD *)&pszPath[253] = 0;
//pszPath[255] = 0;
ppidl = 0;
@ -105,8 +105,8 @@ void __fastcall init_run_office(char *dir)
do {
if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
if (strcmp(FindFileData.cFileName, ".") && strcmp(FindFileData.cFileName, "..")) {
*Directory = empty_string;
memset(Directory + 1, 0, sizeof(Directory) - 1);
//*Directory = empty_string;
memset(Directory, 0, sizeof(Directory));
v3 = *v1 == 0;
// *(_WORD *)&Directory[257] = 0;
//Directory[259] = 0;
@ -118,7 +118,7 @@ void __fastcall init_run_office(char *dir)
}
} else if (!_strcmpi(FindFileData.cFileName, "Microsoft Office Shortcut Bar.lnk")) {
v4 = GetDesktopWindow();
ShellExecute(v4, "open", FindFileData.cFileName, &empty_string, v1, SW_SHOWNORMAL);
ShellExecute(v4, "open", FindFileData.cFileName, "", v1, SW_SHOWNORMAL);
}
} while (FindNextFile(v2, &FindFileData));
FindClose(v2);

6
Source/items.cpp

@ -100,7 +100,7 @@ const PLStruct PL_Prefix[84] = {
{ "Bountiful", IPL_CHARGES, 3, 3, 9, PLT_STAFF , 0, FALSE, TRUE, 3000, 3000, 3 },
{ "Flaming", IPL_FIREDAM, 1, 10, 7, PLT_WEAP | PLT_STAFF , 0, FALSE, TRUE, 5000, 5000, 2 },
{ "Lightning", IPL_LIGHTDAM, 2, 20, 18, PLT_WEAP | PLT_STAFF , 0, FALSE, TRUE, 10000, 10000, 2 },
{ &empty_string, IPL_INVALID, 0, 0, 0, 0 , 0, FALSE, FALSE, 0, 0, 0 }
{ "", IPL_INVALID, 0, 0, 0, 0 , 0, FALSE, FALSE, 0, 0, 0 }
// clang-format on
};
const PLStruct PL_Suffix[96] = {
@ -201,7 +201,7 @@ const PLStruct PL_Suffix[96] = {
{ "stability", IPL_FASTRECOVER, 2, 2, 10, PLT_ARMO | PLT_MISC, 0, FALSE, TRUE, 4000, 4000, 4 },
{ "harmony", IPL_FASTRECOVER, 3, 3, 20, PLT_ARMO | PLT_MISC, 0, FALSE, TRUE, 8000, 8000, 8 },
{ "blocking", IPL_FASTBLOCK, 1, 1, 5, PLT_SHLD , 0, FALSE, TRUE, 4000, 4000, 4 },
{ &empty_string, IPL_INVALID, 0, 0, 0, 0 , 0, FALSE, FALSE, 0, 0, 0 }
{ "", IPL_INVALID, 0, 0, 0, 0 , 0, FALSE, FALSE, 0, 0, 0 }
// clang-format on
};
const UItemStruct UniqueItemList[91] = {
@ -297,7 +297,7 @@ const UItemStruct UniqueItemList[91] = {
{ "The Bleeder", UITYPE_RING, 2, 4, 8500, IPL_MAGICRES, 20, 20, IPL_MANA, 30, 30, IPL_LIFE_CURSE, 10, 10, IPL_INVCURS, 8, 0, IPL_TOHIT, 0, 0, IPL_TOHIT, 0, 0 },
{ "Constricting Ring", UITYPE_RING, 5, 3, 62000, IPL_ALLRES, 75, 75, IPL_DRAINLIFE, 0, 0, IPL_INVCURS, 14, 0, IPL_TOHIT, 0, 0, IPL_TOHIT, 0, 0, IPL_TOHIT, 0, 0 },
{ "Ring of Engagement", UITYPE_RING, 11, 5, 12476, IPL_GETHIT, 1, 2, IPL_THORNS, 1, 3, IPL_SETAC, 5, 5, IPL_TARGAC, 4, 12, IPL_INVCURS, 13, 0, IPL_TOHIT, 0, 0 },
{ &empty_string, UITYPE_INVALID, 0, 0, 0, IPL_TOHIT, 0, 0, IPL_TOHIT, 0, 0, IPL_TOHIT, 0, 0, IPL_TOHIT, 0, 0, IPL_TOHIT, 0, 0, IPL_TOHIT, 0, 0 }
{ "", UITYPE_INVALID, 0, 0, 0, IPL_TOHIT, 0, 0, IPL_TOHIT, 0, 0, IPL_TOHIT, 0, 0, IPL_TOHIT, 0, 0, IPL_TOHIT, 0, 0, IPL_TOHIT, 0, 0 }
// clang-format on
};

2
Source/stores.cpp

@ -65,7 +65,7 @@ int SStringY[24] = {
char *talkname[9] = {
"Griswold",
"Pepin",
&empty_string,
"",
"Ogden",
"Cain",
"Farnham",

Loading…
Cancel
Save