From: Stefan Ginsberg Date: Sun, 30 Aug 2009 15:35:14 +0000 (+0000) Subject: - Fix gdb2 and regexpl warnings under gcc 4.4.0 X-Git-Tag: ReactOS-0.3.11~937 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=a557cda82cc326ab9a171c12e9bc1b8d02b1d159 - Fix gdb2 and regexpl warnings under gcc 4.4.0 svn path=/trunk/; revision=42968 --- diff --git a/rosapps/applications/devutils/gdb2/gdb2.cpp b/rosapps/applications/devutils/gdb2/gdb2.cpp index f5f9a5af80c..a70ad4b828a 100644 --- a/rosapps/applications/devutils/gdb2/gdb2.cpp +++ b/rosapps/applications/devutils/gdb2/gdb2.cpp @@ -177,6 +177,7 @@ void PrepAndLaunchRedirectedChild(HANDLE hChildStdOut, { PROCESS_INFORMATION pi; STARTUPINFO si; + static CHAR Title[] = "debugged program console"; // Set up the start up info struct. ZeroMemory(&si,sizeof(STARTUPINFO)); @@ -185,7 +186,7 @@ void PrepAndLaunchRedirectedChild(HANDLE hChildStdOut, si.hStdOutput = hChildStdOut; si.hStdInput = hChildStdIn; si.hStdError = hChildStdErr; - si.lpTitle = "debugged program console"; + si.lpTitle = Title; // Use this if you want to hide the child: // si.wShowWindow = SW_HIDE; // Note that dwFlags must include STARTF_USESHOWWINDOW if you want to diff --git a/rosapps/applications/sysutils/regexpl/Console.cpp b/rosapps/applications/sysutils/regexpl/Console.cpp index b907f28ef62..d0b087fbb6c 100644 --- a/rosapps/applications/sysutils/regexpl/Console.cpp +++ b/rosapps/applications/sysutils/regexpl/Console.cpp @@ -220,7 +220,7 @@ unsigned int CConsole::GetTabWidth() return TAB_WIDTH; } -BOOL CConsole::SetTitle(TCHAR *p) +BOOL CConsole::SetTitle(const TCHAR *p) { return SetConsoleTitle(p); } @@ -640,7 +640,7 @@ Paste: m_pchBuffer[dwLastCharOffset] = 0; // terminate string in buffer ret = Write(m_pchBuffer); m_History.AddHistoryLine(m_pchBuffer); - TCHAR *strLF = _T("\n"); + static TCHAR strLF[] = _T("\n"); ret = Write(strLF); break; } @@ -1008,7 +1008,7 @@ void CConsole::BeginScrollingOperation() m_Lines = 0; } -BOOL CConsole::WriteString(TCHAR *pchString, COORD Position) +BOOL CConsole::WriteString(const TCHAR *pchString, COORD Position) { CHAR_INFO ciBuffer[256]; int nSize = _tcslen(pchString); diff --git a/rosapps/applications/sysutils/regexpl/Console.h b/rosapps/applications/sysutils/regexpl/Console.h index 3cad5403dd2..6bca160841b 100644 --- a/rosapps/applications/sysutils/regexpl/Console.h +++ b/rosapps/applications/sysutils/regexpl/Console.h @@ -25,7 +25,7 @@ public: // BOOL SetInputMode(DWORD dwMode); BOOL SetTextAttribute(WORD wAttributes); BOOL GetTextAttribute(WORD& rwAttributes); - BOOL SetTitle(TCHAR *p); + BOOL SetTitle(const TCHAR *p); BOOL Write(const TCHAR *p, DWORD dwChars = 0); CConsole(); virtual ~CConsole(); @@ -38,7 +38,7 @@ private: COORD m_BufferSize; WORD m_wAttributes; SHORT m_Lines; - BOOL WriteString(TCHAR *pchString, COORD Position); + BOOL WriteString(const TCHAR *pchString, COORD Position); BOOL WriteChar(TCHAR ch); BOOL m_blnInsetMode; // TRUE - insert, FALSE - overwrite DWORD m_dwInsertModeCursorHeight; diff --git a/rosapps/applications/sysutils/regexpl/RegistryKey.cpp b/rosapps/applications/sysutils/regexpl/RegistryKey.cpp index 89432053c94..4bfe861c57d 100644 --- a/rosapps/applications/sysutils/regexpl/RegistryKey.cpp +++ b/rosapps/applications/sysutils/regexpl/RegistryKey.cpp @@ -27,7 +27,7 @@ #include "ph.h" #include "RegistryKey.h" -static TCHAR *g_ppszHiveNames[] = +static const TCHAR *g_ppszHiveNames[] = { _T("HKEY_CLASSES_ROOT"), _T("HKEY_CURRENT_USER"), diff --git a/rosapps/applications/sysutils/regexpl/RegistryTree.cpp b/rosapps/applications/sysutils/regexpl/RegistryTree.cpp index 75aaaa66ecf..04e21d3f266 100644 --- a/rosapps/applications/sysutils/regexpl/RegistryTree.cpp +++ b/rosapps/applications/sysutils/regexpl/RegistryTree.cpp @@ -95,7 +95,7 @@ BOOL CRegistryTree::ChangeCurrentKey(const TCHAR *pszRelativePath) GotoRoot(); // This is full absolute path. // split path to key names. - TCHAR *pszSeps = _T("\\"); + const TCHAR *pszSeps = _T("\\"); // Make buffer and copy relative path into it. TCHAR *pszBuffer = new TCHAR[_tcslen(pszRelativePath)+1]; @@ -124,7 +124,7 @@ BOOL CRegistryTree::ChangeCurrentKey(const TCHAR *pszRelativePath) } } - TCHAR *pszNewKey = _tcstok(pszBuffer,pszSeps); + const TCHAR *pszNewKey = _tcstok(pszBuffer,pszSeps); if ((!pszNewKey)&&((*pszRelativePath != _T('\\'))||(*(pszRelativePath+1) != 0))) { diff --git a/rosapps/applications/sysutils/regexpl/ShellCommandDeleteValue.cpp b/rosapps/applications/sysutils/regexpl/ShellCommandDeleteValue.cpp index 0147a28b5f3..6946de1c80e 100644 --- a/rosapps/applications/sysutils/regexpl/ShellCommandDeleteValue.cpp +++ b/rosapps/applications/sysutils/regexpl/ShellCommandDeleteValue.cpp @@ -93,6 +93,7 @@ CheckValueArgument: CRegistryKey Key; TCHAR *pszValueNamePattern; + const TCHAR *pszEmpty = _T(""); const TCHAR *pszPath; if (blnHelp) @@ -115,7 +116,7 @@ CheckValueArgument: } else { - pszValueNamePattern = _T(""); + pszValueNamePattern = (TCHAR*)pszEmpty; pszPath = _T("."); } diff --git a/rosapps/applications/sysutils/regexpl/ShellCommandSetValue.cpp b/rosapps/applications/sysutils/regexpl/ShellCommandSetValue.cpp index 5694a7aec6c..23d7c205cef 100644 --- a/rosapps/applications/sysutils/regexpl/ShellCommandSetValue.cpp +++ b/rosapps/applications/sysutils/regexpl/ShellCommandSetValue.cpp @@ -209,6 +209,7 @@ CheckValueArgument: CRegistryKey Key; TCHAR *pszValueName; + const TCHAR *pszEmpty = _T(""); const TCHAR *pszPath; if (blnHelp) @@ -241,7 +242,7 @@ CheckValueArgument: } else { - pszValueName = _T(""); + pszValueName = (TCHAR*)pszEmpty; pszPath = _T("."); } diff --git a/rosapps/applications/sysutils/regexpl/ShellCommandValue.cpp b/rosapps/applications/sysutils/regexpl/ShellCommandValue.cpp index 4e6e44551db..e03fb04ba1a 100644 --- a/rosapps/applications/sysutils/regexpl/ShellCommandValue.cpp +++ b/rosapps/applications/sysutils/regexpl/ShellCommandValue.cpp @@ -122,6 +122,7 @@ CheckValueArgument: CRegistryKey Key; TCHAR *pchValueName; + const TCHAR *pszEmpty = _T(""); const TCHAR *pszPath; if (blnHelp) @@ -154,7 +155,7 @@ CheckValueArgument: } else { - pchValueName = _T(""); + pchValueName = (TCHAR*)pszEmpty; pszPath = _T("."); }