Author: cwittich Date: Fri Jun 30 02:32:06 2006 New Revision: 22701
URL: http://svn.reactos.org/svn/reactos?rev=22701&view=rev Log: fixed some warnings (msvc)
Modified: trunk/reactos/base/applications/notepad/dialog.c trunk/reactos/base/applications/notepad/main.c trunk/reactos/base/applications/notepad/settings.c
Modified: trunk/reactos/base/applications/notepad/dialog.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/d... ============================================================================== --- trunk/reactos/base/applications/notepad/dialog.c (original) +++ trunk/reactos/base/applications/notepad/dialog.c Fri Jun 30 02:32:06 2006 @@ -322,6 +322,8 @@ HWND hCombo; OFNOTIFY *pNotify;
+ UNREFERENCED_PARAMETER(wParam); + switch(msg) { case WM_INITDIALOG: @@ -362,11 +364,11 @@
hCombo = GetDlgItem(hDlg, ID_ENCODING); if (hCombo) - Globals.iEncoding = SendMessage(hCombo, CB_GETCURSEL, 0, 0); + Globals.iEncoding = (int) SendMessage(hCombo, CB_GETCURSEL, 0, 0);
hCombo = GetDlgItem(hDlg, ID_EOLN); if (hCombo) - Globals.iEoln = SendMessage(hCombo, CB_GETCURSEL, 0, 0); + Globals.iEoln = (int) SendMessage(hCombo, CB_GETCURSEL, 0, 0); } break; } @@ -453,7 +455,7 @@ printer.nMinPage = 1; /* we really need to calculate number of pages to set nMaxPage and nToPage */ printer.nToPage = 0; - printer.nMaxPage = -1; + printer.nMaxPage = (WORD) -1;
/* Let commdlg manage copy settings */ printer.nCopies = (WORD)PD_USEDEVMODECOPIES; @@ -772,7 +774,7 @@ SendMessage(Globals.hEdit, EM_GETSEL, (WPARAM) &dwStart, (LPARAM) &dwEnd);
nLine = 1; - for (i = 0; pszText[i] && (i < dwStart); i++) + for (i = 0; pszText[i] && (i < (int) dwStart); i++) { if (pszText[i] == '\n') nLine++; @@ -803,10 +805,10 @@ TCHAR buff[MAX_PATH];
GetCaretPos(&point); - line = SendMessage(Globals.hEdit, EM_LINEFROMCHAR, (WPARAM)-1, (LPARAM)0); - ccol = SendMessage(Globals.hEdit, EM_CHARFROMPOS, (WPARAM)0, (LPARAM)MAKELPARAM(point.x, point.y)); + line = (int) SendMessage(Globals.hEdit, EM_LINEFROMCHAR, (WPARAM)-1, (LPARAM)0); + ccol = (int) SendMessage(Globals.hEdit, EM_CHARFROMPOS, (WPARAM)0, (LPARAM)MAKELPARAM(point.x, point.y)); ccol = LOWORD(ccol); - col = ccol - SendMessage(Globals.hEdit, EM_LINEINDEX, (WPARAM)line, (LPARAM)0); + col = ccol - (int) SendMessage(Globals.hEdit, EM_LINEINDEX, (WPARAM)line, (LPARAM)0);
_stprintf(buff, TEXT("%S %d, %S %d"), Globals.szStatusBarLine, line+1, Globals.szStatusBarCol, col+1); SendMessage(Globals.hStatusBar, SB_SETTEXT, (WPARAM) SB_SIMPLEID, (LPARAM)buff);
Modified: trunk/reactos/base/applications/notepad/main.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/m... ============================================================================== --- trunk/reactos/base/applications/notepad/main.c (original) +++ trunk/reactos/base/applications/notepad/main.c Fri Jun 30 02:32:06 2006 @@ -83,7 +83,7 @@ case CMD_ABOUT: DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_ABOUTBOX), Globals.hMainWnd, - AboutDialogProc); + (DLGPROC) AboutDialogProc); break; case CMD_ABOUT_WINE: DIALOG_HelpAboutWine(); break;
@@ -101,7 +101,7 @@ static BOOL NOTEPAD_FindTextAt(FINDREPLACE *pFindReplace, LPCTSTR pszText, int iTextLength, DWORD dwPosition) { BOOL bMatches; - int iTargetLength; + size_t iTargetLength;
iTargetLength = _tcslen(pFindReplace->lpstrFindWhat);
@@ -115,7 +115,7 @@ { if ((dwPosition > 0) && !_istspace(pszText[dwPosition-1])) bMatches = FALSE; - if ((dwPosition < iTextLength - 1) && !_istspace(pszText[dwPosition+1])) + if ((dwPosition < (DWORD) iTextLength - 1) && !_istspace(pszText[dwPosition+1])) bMatches = FALSE; }
@@ -130,14 +130,14 @@ BOOL NOTEPAD_FindNext(FINDREPLACE *pFindReplace, BOOL bReplace, BOOL bShowAlert) { int iTextLength, iTargetLength; - int iAdjustment = 0; + size_t iAdjustment = 0; LPTSTR pszText = NULL; DWORD dwPosition, dwBegin, dwEnd; BOOL bMatches = FALSE; TCHAR szResource[128], szText[128]; BOOL bSuccess;
- iTargetLength = _tcslen(pFindReplace->lpstrFindWhat); + iTargetLength = (int) _tcslen(pFindReplace->lpstrFindWhat);
/* Retrieve the window text */ iTextLength = GetWindowTextLength(Globals.hEdit); @@ -151,7 +151,7 @@ }
SendMessage(Globals.hEdit, EM_GETSEL, (WPARAM) &dwBegin, (LPARAM) &dwEnd); - if (bReplace && ((dwEnd - dwBegin) == iTargetLength)) + if (bReplace && ((dwEnd - dwBegin) == (DWORD) iTargetLength)) { if (NOTEPAD_FindTextAt(pFindReplace, pszText, iTextLength, dwBegin)) { @@ -164,7 +164,7 @@ { /* Find Down */ dwPosition = dwEnd; - while(dwPosition < iTextLength) + while(dwPosition < (DWORD) iTextLength) { bMatches = NOTEPAD_FindTextAt(pFindReplace, pszText, iTextLength, dwPosition); if (bMatches) @@ -189,7 +189,7 @@ { /* Found target */ if (dwPosition > dwBegin) - dwPosition += iAdjustment; + dwPosition += (DWORD) iAdjustment; SendMessage(Globals.hEdit, EM_SETSEL, dwPosition, dwPosition + iTargetLength); SendMessage(Globals.hEdit, EM_SCROLLCARET, 0, 0); bSuccess = TRUE; @@ -263,9 +263,11 @@ /*********************************************************************** * Enable/disable items on the menu based on control state */ -static VOID NOTEPAD_InitMenuPopup(HMENU menu, int index) +static VOID NOTEPAD_InitMenuPopup(HMENU menu, LPARAM index) { int enable; + + UNREFERENCED_PARAMETER(index);
CheckMenuItem(GetMenu(Globals.hMainWnd), CMD_WRAP, MF_BYCOMMAND | (Globals.bWrapLongLines ? MF_CHECKED : MF_UNCHECKED)); @@ -278,7 +280,7 @@ SendMessage(Globals.hEdit, EM_CANUNDO, 0, 0) ? MF_ENABLED : MF_GRAYED); EnableMenuItem(menu, CMD_PASTE, IsClipboardFormatAvailable(CF_TEXT) ? MF_ENABLED : MF_GRAYED); - enable = SendMessage(Globals.hEdit, EM_GETSEL, 0, 0); + enable = (int) SendMessage(Globals.hEdit, EM_GETSEL, 0, 0); enable = (HIWORD(enable) == LOWORD(enable)) ? MF_GRAYED : MF_ENABLED; EnableMenuItem(menu, CMD_CUT, enable); EnableMenuItem(menu, CMD_COPY, enable); @@ -532,7 +534,10 @@ static const WCHAR className[] = {'N','P','C','l','a','s','s',0}; static const WCHAR winName[] = {'N','o','t','e','p','a','d',0};
- aFINDMSGSTRING = RegisterWindowMessage(FINDMSGSTRING); + UNREFERENCED_PARAMETER(prev); + UNREFERENCED_PARAMETER(cmdline); + + aFINDMSGSTRING = (ATOM) RegisterWindowMessage(FINDMSGSTRING);
ZeroMemory(&Globals, sizeof(Globals)); Globals.hInstance = hInstance; @@ -585,5 +590,5 @@ } } SaveSettings(); - return msg.wParam; -} + return (int) msg.wParam; +}
Modified: trunk/reactos/base/applications/notepad/settings.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/s... ============================================================================== --- trunk/reactos/base/applications/notepad/settings.c (original) +++ trunk/reactos/base/applications/notepad/settings.c Fri Jun 30 02:32:06 2006 @@ -187,7 +187,7 @@ pszValueNameT = pszValueName; #endif
- return RegSetValueEx(hKey, pszValueNameT, 0, REG_SZ, (LPBYTE) pszValue, _tcslen(pszValue) * sizeof(*pszValue)) == ERROR_SUCCESS; + return RegSetValueEx(hKey, pszValueNameT, 0, REG_SZ, (LPBYTE) pszValue, (DWORD) _tcslen(pszValue) * sizeof(*pszValue)) == ERROR_SUCCESS; }
void SaveSettings(void)