From a356a76c21671845e47e54fb0266609a8c4d411b Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Fri, 19 Jan 2007 09:26:20 +0000 Subject: [PATCH] fix some gcc 4.2 compilation problems and warnings svn path=/trunk/; revision=25528 --- reactos/base/applications/ibrowser/mainframe.cpp | 6 ++++-- reactos/base/applications/ibrowser/utility/utility.h | 9 ++++----- reactos/base/applications/ibrowser/webchild.cpp | 2 +- reactos/base/shell/explorer/dialogs/searchprogram.cpp | 9 ++++++--- reactos/base/shell/explorer/shell/mainframe.cpp | 6 ++++-- reactos/base/shell/explorer/shell/ntobjfs.cpp | 6 ++++-- reactos/base/shell/explorer/shell/webchild.cpp | 2 +- reactos/base/shell/explorer/taskbar/desktopbar.cpp | 6 ++++-- reactos/base/shell/explorer/utility/utility.h | 11 ++++++----- reactos/include/psdk/windef.h | 4 ++-- 10 files changed, 36 insertions(+), 25 deletions(-) diff --git a/reactos/base/applications/ibrowser/mainframe.cpp b/reactos/base/applications/ibrowser/mainframe.cpp index f777dc76bb2..eab4c86794e 100644 --- a/reactos/base/applications/ibrowser/mainframe.cpp +++ b/reactos/base/applications/ibrowser/mainframe.cpp @@ -149,14 +149,16 @@ MainFrameBase::MainFrameBase(HWND hwnd) rbBand.cyMaxChild = 0; rbBand.cyIntegral = btn_hgt; - rbBand.lpText = TEXT("Toolbar"); + TCHAR ToolBarText[] = _T("Toolbar"); + rbBand.lpText = ToolBarText; rbBand.hwndChild = _htoolbar; rbBand.cxMinChild = 0; rbBand.cyMinChild = btn_hgt + 4; rbBand.cx = 182; SendMessage(_hwndrebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand); - rbBand.lpText = TEXT("Address"); + TCHAR AddressText[] = _T("Address"); + rbBand.lpText = AddressText; rbBand.hwndChild = _haddressedit; rbBand.cxMinChild = 0; rbBand.cyMinChild = btn_hgt - 2; diff --git a/reactos/base/applications/ibrowser/utility/utility.h b/reactos/base/applications/ibrowser/utility/utility.h index 56f7fae894a..15b2096b1e4 100644 --- a/reactos/base/applications/ibrowser/utility/utility.h +++ b/reactos/base/applications/ibrowser/utility/utility.h @@ -25,6 +25,10 @@ // Martin Fuchs, 23.07.2003 // + // STL headers for strings and streams +#include +#include +using namespace std; // standard windows headers #define WIN32_LEAN_AND_MEAN @@ -155,11 +159,6 @@ BOOL exists_path(LPCTSTR path); #pragma warning(disable: 4786) // disable warnings about too long debug information symbols #endif - // STL headers for strings and streams -#include -#include -using namespace std; - // containers #include #include diff --git a/reactos/base/applications/ibrowser/webchild.cpp b/reactos/base/applications/ibrowser/webchild.cpp index 76bb8951036..4c7b8f64099 100644 --- a/reactos/base/applications/ibrowser/webchild.cpp +++ b/reactos/base/applications/ibrowser/webchild.cpp @@ -133,7 +133,7 @@ void BrowserNavigator::goto_url(LPCTSTR url) else { _new_url = url; - _browser->Navigate(L"about:blank", NULL, NULL, NULL, NULL); + _browser->Navigate(BStr(L"about:blank"), NULL, NULL, NULL, NULL); } } diff --git a/reactos/base/shell/explorer/dialogs/searchprogram.cpp b/reactos/base/shell/explorer/dialogs/searchprogram.cpp index 55c8c03cc9d..8fa1d60132e 100644 --- a/reactos/base/shell/explorer/dialogs/searchprogram.cpp +++ b/reactos/base/shell/explorer/dialogs/searchprogram.cpp @@ -107,15 +107,18 @@ FindProgramDlg::FindProgramDlg(HWND hwnd) LV_COLUMN column = {LVCF_FMT|LVCF_WIDTH|LVCF_TEXT, LVCFMT_LEFT, 250}; - column.pszText = _T("Name"); + TCHAR lvColName[] = _T("Name"); + column.pszText = lvColName; ListView_InsertColumn(_list_ctrl, 0, &column); column.cx = 300; - column.pszText = _T("Path"); + TCHAR lvColPath[] = _T("Path"); + column.pszText = lvColPath; ListView_InsertColumn(_list_ctrl, 1, &column); column.cx = 400; - column.pszText = _T("Menu Path"); + TCHAR lvColMenuPath[] = _T("Menu Path"); + column.pszText = lvColMenuPath; ListView_InsertColumn(_list_ctrl, 2, &column); ListView_SetExtendedListViewStyleEx(_list_ctrl, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT); diff --git a/reactos/base/shell/explorer/shell/mainframe.cpp b/reactos/base/shell/explorer/shell/mainframe.cpp index 439b28b939b..c6037f2daaf 100644 --- a/reactos/base/shell/explorer/shell/mainframe.cpp +++ b/reactos/base/shell/explorer/shell/mainframe.cpp @@ -865,7 +865,8 @@ MDIMainFrame::MDIMainFrame(HWND hwnd) #endif rbBand.fStyle = RBBS_CHILDEDGE|RBBS_GRIPPERALWAYS|RBBS_HIDETITLE; - rbBand.lpText = TEXT("Extras"); + TCHAR ExtrasBand[] = _T("Extras"); + rbBand.lpText = ExtrasBand; rbBand.hwndChild = _hextrabar; rbBand.cxMinChild = 0; rbBand.cyMinChild = btn_hgt; @@ -874,7 +875,8 @@ MDIMainFrame::MDIMainFrame(HWND hwnd) #ifndef _NO_WIN_FS rbBand.fStyle |= RBBS_BREAK; - rbBand.lpText = TEXT("Drives"); + TCHAR DrivesBand[] = _T("Drives"); + rbBand.lpText = DrivesBand; rbBand.hwndChild = _hdrivebar; rbBand.cxMinChild = 0; rbBand.cyMinChild = btn_hgt; diff --git a/reactos/base/shell/explorer/shell/ntobjfs.cpp b/reactos/base/shell/explorer/shell/ntobjfs.cpp index e22d9ec51e6..4cb3d334894 100644 --- a/reactos/base/shell/explorer/shell/ntobjfs.cpp +++ b/reactos/base/shell/explorer/shell/ntobjfs.cpp @@ -230,12 +230,14 @@ void NtObjDirectory::read_directory(int scan_flags) if (info->name.string_ptr) { info->name.string_ptr[info->name.string_len / sizeof(WCHAR)] = 0; } else { - info->name.string_ptr = TEXT(""); + TCHAR empty_string_ptr[] = _T(""); + info->name.string_ptr = empty_string_ptr; } if (info->type.string_ptr) { info->type.string_ptr[info->type.string_len / sizeof(WCHAR)] = 0; } else { - info->type.string_ptr = TEXT(""); + TCHAR empty_string_ptr[] = _T(""); + info->type.string_ptr = empty_string_ptr; } lstrcpynW(p, info->name.string_ptr, COUNTOF(buffer)); #else diff --git a/reactos/base/shell/explorer/shell/webchild.cpp b/reactos/base/shell/explorer/shell/webchild.cpp index a4e4033df3d..1580e3e2dff 100644 --- a/reactos/base/shell/explorer/shell/webchild.cpp +++ b/reactos/base/shell/explorer/shell/webchild.cpp @@ -133,7 +133,7 @@ void BrowserNavigator::goto_url(LPCTSTR url) else { _new_url = url; - _browser->Navigate(L"about:blank", NULL, NULL, NULL, NULL); + _browser->Navigate(BStr(L"about:blank"), NULL, NULL, NULL, NULL); } } diff --git a/reactos/base/shell/explorer/taskbar/desktopbar.cpp b/reactos/base/shell/explorer/taskbar/desktopbar.cpp index d51c08c6bb6..1fa6e34f10a 100644 --- a/reactos/base/shell/explorer/taskbar/desktopbar.cpp +++ b/reactos/base/shell/explorer/taskbar/desktopbar.cpp @@ -148,13 +148,15 @@ LRESULT DesktopBar::Init(LPCREATESTRUCT pcs) rbBand.cxMinChild = rbBand.cyIntegral * 3; rbBand.fStyle = RBBS_VARIABLEHEIGHT|RBBS_GRIPPERALWAYS|RBBS_HIDETITLE; - rbBand.lpText = TEXT("Quicklaunch"); + TCHAR QuickLaunchBand[] = _T("Quicklaunch"); + rbBand.lpText = QuickLaunchBand; rbBand.hwndChild = _hwndQuickLaunch; rbBand.cx = 250; rbBand.wID = IDW_QUICKLAUNCHBAR; SendMessage(_hwndrebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand); - rbBand.lpText = TEXT("Taskbar"); + TCHAR TaskbarBand[] = _T("Taskbar"); + rbBand.lpText = TaskbarBand; rbBand.hwndChild = _hwndTaskBar; rbBand.cx = 200; //pcs->cx-_taskbar_pos-quicklaunch_width-(notifyarea_width+1); rbBand.wID = IDW_TASKTOOLBAR; diff --git a/reactos/base/shell/explorer/utility/utility.h b/reactos/base/shell/explorer/utility/utility.h index e3de958b6a8..420867e21dc 100644 --- a/reactos/base/shell/explorer/utility/utility.h +++ b/reactos/base/shell/explorer/utility/utility.h @@ -26,6 +26,12 @@ // + // STL headers for strings and streams +#include +#include +using namespace std; + + // standard windows headers #define WIN32_LEAN_AND_MEAN #define WIN32_EXTRA_LEAN @@ -194,11 +200,6 @@ BOOL exists_path(LPCTSTR path); #pragma warning(disable: 4786) // disable warnings about too long debug information symbols #endif - // STL headers for strings and streams -#include -#include -using namespace std; - // containers #include #include diff --git a/reactos/include/psdk/windef.h b/reactos/include/psdk/windef.h index 3d431537f97..82462d92647 100644 --- a/reactos/include/psdk/windef.h +++ b/reactos/include/psdk/windef.h @@ -123,8 +123,8 @@ extern "C" { #endif /* __GNUC__/__WATCOMC__ */ #define MAKEWORD(a,b) ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8))) #define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16))) -#define LOWORD(l) ((WORD)((DWORD)(l))) -#define HIWORD(l) ((WORD)(((DWORD)(l)>>16)&0xFFFF)) +#define LOWORD(l) ((WORD)((DWORD_PTR)(l))) +#define HIWORD(l) ((WORD)(((DWORD_PTR)(l)>>16)&0xFFFF)) #define LOBYTE(w) ((BYTE)(w)) #define HIBYTE(w) ((BYTE)(((WORD)(w)>>8)&0xFF))