diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 39c2bcac9..671ad9c4d 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,7 @@ March 28, 2007 +- Fixed some const char * -> char * conversions flagged by GCC 4.2.0 in the + Win32-specific code. +- Fixed: The Win32 neterror() should return a const char *. - Adding blinky text to the ENDOOM screen. March 24, 2007 diff --git a/src/i_net.cpp b/src/i_net.cpp index 1ea41f7d8..7c4b38d97 100644 --- a/src/i_net.cpp +++ b/src/i_net.cpp @@ -95,7 +95,7 @@ static sockaddr_in sendaddress[MAXNETNODES]; static BYTE sendplayer[MAXNETNODES]; #ifdef __WIN32__ -char *neterror (void); +const char *neterror (void); #else #define neterror() strerror(errno) #endif @@ -850,7 +850,7 @@ void I_NetCmd (void) } #ifdef __WIN32__ -char *neterror (void) +const char *neterror (void) { static char neterr[16]; int code; diff --git a/src/sound/music_midi_timidity.cpp b/src/sound/music_midi_timidity.cpp index 96374b477..a849ad84b 100644 --- a/src/sound/music_midi_timidity.cpp +++ b/src/sound/music_midi_timidity.cpp @@ -44,6 +44,7 @@ void ChildSigHandler (int signum) #ifdef _WIN32 const char TimiditySong::EventName[] = "TiMidity Killer"; +static char TimidityTitle[] = "TiMidity (ZDoom Launched)"; CVAR (String, timidity_exe, "timidity.exe", CVAR_ARCHIVE|CVAR_GLOBALCONFIG) #else @@ -438,7 +439,7 @@ bool TimiditySong::LaunchTimidity () WriteWavePipe : GetStdHandle (STD_OUTPUT_HANDLE); startup.hStdError = GetStdHandle (STD_ERROR_HANDLE); - startup.lpTitle = "TiMidity (ZDoom Launched)"; + startup.lpTitle = TimidityTitle; startup.wShowWindow = SW_SHOWMINNOACTIVE; if (CreateProcess (NULL, cmdline, NULL, NULL, TRUE, diff --git a/src/win32/eaxedit.cpp b/src/win32/eaxedit.cpp index ab0b5dfc7..cedd40c4a 100644 --- a/src/win32/eaxedit.cpp +++ b/src/win32/eaxedit.cpp @@ -799,14 +799,11 @@ INT_PTR CALLBACK NewEAXProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) if (0 == GetWindowText (GetDlgItem (hDlg, IDC_NEWENVNAME), buff, 32) || S_FindEnvironment (buff) != NULL) { - static CHAR *texts[2] = - { - "That name is already used.", - "Please enter a name." - }; + static CHAR text0[] = "That name is already used."; + static CHAR text1[] = "Please enter a name."; ti.uId = 0; ti.hwnd = GetDlgItem (hDlg, IDC_NEWENVNAME); - ti.lpszText = buff[0] ? texts[0] : texts[1]; + ti.lpszText = buff[0] ? text0 : text1; ShowErrorTip (ToolTip, ti, hDlg, "Bad Name"); return 0; } @@ -820,9 +817,10 @@ INT_PTR CALLBACK NewEAXProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) } if (id1 > 255 || id2 > 255) { + static CHAR text[] = "Please enter a number between 0 and 255."; ti.uId = id1 > 255 ? 1 : 2; ti.hwnd = GetDlgItem (hDlg, IDC_EDITID1 + ti.uId - 1); - ti.lpszText = "Please enter a number between 0 and 255."; + ti.lpszText = text; ShowErrorTip (ToolTip, ti, hDlg, "Bad Value"); } else if (NULL != (rev = S_FindEnvironment (MAKEWORD (id2, id1)))) diff --git a/src/win32/i_crash.cpp b/src/win32/i_crash.cpp index 5997aacb1..fbbfa0ae1 100644 --- a/src/win32/i_crash.cpp +++ b/src/win32/i_crash.cpp @@ -1690,6 +1690,8 @@ static INT_PTR CALLBACK OverviewDlgProc (HWND hDlg, UINT message, WPARAM wParam, static INT_PTR CALLBACK CrashDlgProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { + static CHAR overview[] = "Overview"; + static CHAR details[] = "Details"; HWND edit; TCITEM tcitem; RECT tabrect, tcrect; @@ -1709,14 +1711,14 @@ static INT_PTR CALLBACK CrashDlgProc (HWND hDlg, UINT message, WPARAM wParam, LP // There are two tabs: Overview and Details. Each pane is created from a // dialog template, and the resultant window is stored as the lParam for // the corresponding tab. - tcitem.pszText = "Overview"; + tcitem.pszText = overview; tcitem.lParam = (LPARAM)CreateDialogParam (g_hInst, MAKEINTRESOURCE(IDD_CRASHOVERVIEW), hDlg, OverviewDlgProc, (LPARAM)edit); TabCtrl_InsertItem (edit, 0, &tcitem); TabCtrl_GetItemRect (edit, 0, &tabrect); SetWindowPos ((HWND)tcitem.lParam, HWND_TOP, tcrect.left + 3, tcrect.top + tabrect.bottom + 3, tcrect.right - tcrect.left - 8, tcrect.bottom - tcrect.top - tabrect.bottom - 8, 0); - tcitem.pszText = "Details"; + tcitem.pszText = details; tcitem.lParam = (LPARAM)CreateDialogParam (g_hInst, MAKEINTRESOURCE(IDD_CRASHDETAILS), hDlg, DetailsDlgProc, (LPARAM)edit); TabCtrl_InsertItem (edit, 1, &tcitem); SetWindowPos ((HWND)tcitem.lParam, HWND_TOP, tcrect.left + 3, tcrect.top + tabrect.bottom + 3,