- Fix gdb2 and regexpl warnings under gcc 4.4.0
authorStefan Ginsberg <stefanginsberg@gmail.com>
Sun, 30 Aug 2009 15:35:14 +0000 (15:35 +0000)
committerStefan Ginsberg <stefanginsberg@gmail.com>
Sun, 30 Aug 2009 15:35:14 +0000 (15:35 +0000)
svn path=/trunk/; revision=42968

rosapps/applications/devutils/gdb2/gdb2.cpp
rosapps/applications/sysutils/regexpl/Console.cpp
rosapps/applications/sysutils/regexpl/Console.h
rosapps/applications/sysutils/regexpl/RegistryKey.cpp
rosapps/applications/sysutils/regexpl/RegistryTree.cpp
rosapps/applications/sysutils/regexpl/ShellCommandDeleteValue.cpp
rosapps/applications/sysutils/regexpl/ShellCommandSetValue.cpp
rosapps/applications/sysutils/regexpl/ShellCommandValue.cpp

index f5f9a5a..a70ad4b 100644 (file)
@@ -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
index b907f28..d0b087f 100644 (file)
@@ -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);
index 3cad540..6bca160 100644 (file)
@@ -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;
index 8943205..4bfe861 100644 (file)
@@ -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"),
index 75aaaa6..04e21d3 100644 (file)
@@ -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)))
        {
index 0147a28..6946de1 100644 (file)
@@ -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(".");
   }
 
index 5694a7a..23d7c20 100644 (file)
@@ -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(".");
        }
 
index 4e6e445..e03fb04 100644 (file)
@@ -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(".");
        }