wordpad: Fix some compile-time warnings.
This commit is contained in:
parent
c53b772394
commit
fbfb165d56
|
@ -135,7 +135,7 @@ static LONG twips_to_centmm(int twips)
|
||||||
return MulDiv(twips, 1000, TWIPS_PER_CM);
|
return MulDiv(twips, 1000, TWIPS_PER_CM);
|
||||||
}
|
}
|
||||||
|
|
||||||
LONG centmm_to_twips(int mm)
|
static LONG centmm_to_twips(int mm)
|
||||||
{
|
{
|
||||||
return MulDiv(mm, TWIPS_PER_CM, 1000);
|
return MulDiv(mm, TWIPS_PER_CM, 1000);
|
||||||
}
|
}
|
||||||
|
@ -620,7 +620,7 @@ LRESULT CALLBACK ruler_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw_preview_page(HDC hdc, HDC* hdcSized, FORMATRANGE* lpFr, float ratio, int bmNewWidth, int bmNewHeight, int bmWidth, int bmHeight)
|
static void draw_preview_page(HDC hdc, HDC* hdcSized, FORMATRANGE* lpFr, float ratio, int bmNewWidth, int bmNewHeight, int bmWidth, int bmHeight)
|
||||||
{
|
{
|
||||||
HBITMAP hBitmapScaled = CreateCompatibleBitmap(hdc, bmNewWidth, bmNewHeight);
|
HBITMAP hBitmapScaled = CreateCompatibleBitmap(hdc, bmNewWidth, bmNewHeight);
|
||||||
HPEN hPen;
|
HPEN hPen;
|
||||||
|
@ -800,7 +800,7 @@ LRESULT print_preview(HWND hMainWnd)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_preview(HWND hWnd)
|
static void update_preview(HWND hWnd)
|
||||||
{
|
{
|
||||||
RECT rc;
|
RECT rc;
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ void registry_set_options(HWND hMainWnd)
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
DWORD action;
|
DWORD action;
|
||||||
|
|
||||||
if(registry_get_handle(&hKey, &action, (LPWSTR)key_options) == ERROR_SUCCESS)
|
if(registry_get_handle(&hKey, &action, key_options) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
WINDOWPLACEMENT wp;
|
WINDOWPLACEMENT wp;
|
||||||
DWORD isMaximized;
|
DWORD isMaximized;
|
||||||
|
@ -104,7 +104,7 @@ void registry_read_winrect(RECT* rc)
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
DWORD size = sizeof(RECT);
|
DWORD size = sizeof(RECT);
|
||||||
|
|
||||||
if(registry_get_handle(&hKey, 0, (LPWSTR)key_options) != ERROR_SUCCESS ||
|
if(registry_get_handle(&hKey, 0, key_options) != ERROR_SUCCESS ||
|
||||||
RegQueryValueExW(hKey, var_framerect, 0, NULL, (LPBYTE)rc, &size) !=
|
RegQueryValueExW(hKey, var_framerect, 0, NULL, (LPBYTE)rc, &size) !=
|
||||||
ERROR_SUCCESS || size != sizeof(RECT))
|
ERROR_SUCCESS || size != sizeof(RECT))
|
||||||
{
|
{
|
||||||
|
@ -122,7 +122,7 @@ void registry_read_maximized(DWORD *bMaximized)
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
DWORD size = sizeof(DWORD);
|
DWORD size = sizeof(DWORD);
|
||||||
|
|
||||||
if(registry_get_handle(&hKey, 0, (LPWSTR)key_options) != ERROR_SUCCESS ||
|
if(registry_get_handle(&hKey, 0, key_options) != ERROR_SUCCESS ||
|
||||||
RegQueryValueExW(hKey, var_maximized, 0, NULL, (LPBYTE)bMaximized, &size) !=
|
RegQueryValueExW(hKey, var_maximized, 0, NULL, (LPBYTE)bMaximized, &size) !=
|
||||||
ERROR_SUCCESS || size != sizeof(DWORD))
|
ERROR_SUCCESS || size != sizeof(DWORD))
|
||||||
{
|
{
|
||||||
|
@ -314,7 +314,7 @@ void registry_set_filelist(LPCWSTR newFile, HWND hMainWnd)
|
||||||
for(i = 0; pFiles[i] && i < FILELIST_ENTRIES; i++)
|
for(i = 0; pFiles[i] && i < FILELIST_ENTRIES; i++)
|
||||||
{
|
{
|
||||||
wsprintfW(buffer, var_file, i+1);
|
wsprintfW(buffer, var_file, i+1);
|
||||||
RegSetValueExW(hKey, (LPWSTR)&buffer, 0, REG_SZ, (LPBYTE)pFiles[i],
|
RegSetValueExW(hKey, (LPWSTR)&buffer, 0, REG_SZ, (const BYTE*)pFiles[i],
|
||||||
(lstrlenW(pFiles[i])+1)*sizeof(WCHAR));
|
(lstrlenW(pFiles[i])+1)*sizeof(WCHAR));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -317,7 +317,7 @@ static void populate_size_list(HWND hSizeListWnd)
|
||||||
HDC hdc = GetDC(hMainWnd);
|
HDC hdc = GetDC(hMainWnd);
|
||||||
static const unsigned choices[] = {8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72};
|
static const unsigned choices[] = {8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72};
|
||||||
WCHAR buffer[3];
|
WCHAR buffer[3];
|
||||||
int i;
|
size_t i;
|
||||||
DWORD fontStyle;
|
DWORD fontStyle;
|
||||||
|
|
||||||
ZeroMemory(&fmt, sizeof(fmt));
|
ZeroMemory(&fmt, sizeof(fmt));
|
||||||
|
@ -440,7 +440,7 @@ static void set_font(LPCWSTR wszFaceName)
|
||||||
|
|
||||||
populate_size_list(hSizeListWnd);
|
populate_size_list(hSizeListWnd);
|
||||||
|
|
||||||
SendMessageW(hFontListEditWnd, WM_SETTEXT, 0, (LPARAM)(LPWSTR)wszFaceName);
|
SendMessageW(hFontListEditWnd, WM_SETTEXT, 0, (LPARAM)wszFaceName);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_default_font(void)
|
static void set_default_font(void)
|
||||||
|
@ -478,7 +478,7 @@ static void on_fontlist_modified(LPWSTR wszNewFaceName)
|
||||||
set_font((LPCWSTR) wszNewFaceName);
|
set_font((LPCWSTR) wszNewFaceName);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void add_font(LPCWSTR fontName, DWORD fontType, HWND hListWnd, NEWTEXTMETRICEXW *ntmc)
|
static void add_font(LPCWSTR fontName, DWORD fontType, HWND hListWnd, const NEWTEXTMETRICEXW *ntmc)
|
||||||
{
|
{
|
||||||
COMBOBOXEXITEMW cbItem;
|
COMBOBOXEXITEMW cbItem;
|
||||||
WCHAR buffer[MAX_PATH];
|
WCHAR buffer[MAX_PATH];
|
||||||
|
@ -557,7 +557,7 @@ static void dialog_choose_font(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int CALLBACK enum_font_proc(const LOGFONTW *lpelfe, const TEXTMETRICW *lpntme,
|
static int CALLBACK enum_font_proc(const LOGFONTW *lpelfe, const TEXTMETRICW *lpntme,
|
||||||
DWORD FontType, LPARAM lParam)
|
DWORD FontType, LPARAM lParam)
|
||||||
{
|
{
|
||||||
HWND hListWnd = (HWND) lParam;
|
HWND hListWnd = (HWND) lParam;
|
||||||
|
@ -565,7 +565,7 @@ int CALLBACK enum_font_proc(const LOGFONTW *lpelfe, const TEXTMETRICW *lpntme,
|
||||||
if(SendMessageW(hListWnd, CB_FINDSTRINGEXACT, -1, (LPARAM)lpelfe->lfFaceName) == CB_ERR)
|
if(SendMessageW(hListWnd, CB_FINDSTRINGEXACT, -1, (LPARAM)lpelfe->lfFaceName) == CB_ERR)
|
||||||
{
|
{
|
||||||
|
|
||||||
add_font((LPWSTR)lpelfe->lfFaceName, FontType, hListWnd, (NEWTEXTMETRICEXW*)lpntme);
|
add_font(lpelfe->lfFaceName, FontType, hListWnd, (const NEWTEXTMETRICEXW*)lpntme);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1061,7 +1061,7 @@ static void dialog_viewproperties(void)
|
||||||
{
|
{
|
||||||
PROPSHEETPAGEW psp[2];
|
PROPSHEETPAGEW psp[2];
|
||||||
PROPSHEETHEADERW psh;
|
PROPSHEETHEADERW psh;
|
||||||
int i;
|
size_t i;
|
||||||
HINSTANCE hInstance = (HINSTANCE)GetWindowLongPtr(hMainWnd, GWLP_HINSTANCE);
|
HINSTANCE hInstance = (HINSTANCE)GetWindowLongPtr(hMainWnd, GWLP_HINSTANCE);
|
||||||
LPCPROPSHEETPAGEW ppsp = (LPCPROPSHEETPAGEW)&psp;
|
LPCPROPSHEETPAGEW ppsp = (LPCPROPSHEETPAGEW)&psp;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue