Commit 1ac71258 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

imm32: Avoid casts when calling into A/W IME.

parent 6ed4a2e4
...@@ -63,7 +63,7 @@ struct ime ...@@ -63,7 +63,7 @@ struct ime
HWND UIWnd; HWND UIWnd;
/* Function Pointers */ /* Function Pointers */
BOOL (WINAPI *pImeInquire)(IMEINFO *, WCHAR *, DWORD); BOOL (WINAPI *pImeInquire)(IMEINFO *, void *, DWORD);
BOOL (WINAPI *pImeConfigure)(HKL, HWND, DWORD, void *); BOOL (WINAPI *pImeConfigure)(HKL, HWND, DWORD, void *);
BOOL (WINAPI *pImeDestroy)(UINT); BOOL (WINAPI *pImeDestroy)(UINT);
LRESULT (WINAPI *pImeEscape)(HIMC, UINT, void *); LRESULT (WINAPI *pImeEscape)(HIMC, UINT, void *);
...@@ -71,14 +71,14 @@ struct ime ...@@ -71,14 +71,14 @@ struct ime
BOOL (WINAPI *pImeSetActiveContext)(HIMC, BOOL); BOOL (WINAPI *pImeSetActiveContext)(HIMC, BOOL);
UINT (WINAPI *pImeToAsciiEx)(UINT, UINT, const BYTE *, TRANSMSGLIST *, UINT, HIMC); UINT (WINAPI *pImeToAsciiEx)(UINT, UINT, const BYTE *, TRANSMSGLIST *, UINT, HIMC);
BOOL (WINAPI *pNotifyIME)(HIMC, DWORD, DWORD, DWORD); BOOL (WINAPI *pNotifyIME)(HIMC, DWORD, DWORD, DWORD);
BOOL (WINAPI *pImeRegisterWord)(const WCHAR *, DWORD, const WCHAR *); BOOL (WINAPI *pImeRegisterWord)(const void/*TCHAR*/*, DWORD, const void/*TCHAR*/*);
BOOL (WINAPI *pImeUnregisterWord)(const WCHAR *, DWORD, const WCHAR *); BOOL (WINAPI *pImeUnregisterWord)(const void/*TCHAR*/*, DWORD, const void/*TCHAR*/*);
UINT (WINAPI *pImeEnumRegisterWord)(REGISTERWORDENUMPROCW, const WCHAR *, DWORD, const WCHAR *, void *); UINT (WINAPI *pImeEnumRegisterWord)(void */*REGISTERWORDENUMPROCW*/, const void/*TCHAR*/*, DWORD, const void/*TCHAR*/*, void *);
BOOL (WINAPI *pImeSetCompositionString)(HIMC, DWORD, const void *, DWORD, const void *, DWORD); BOOL (WINAPI *pImeSetCompositionString)(HIMC, DWORD, const void/*TCHAR*/*, DWORD, const void/*TCHAR*/*, DWORD);
DWORD (WINAPI *pImeConversionList)(HIMC, const WCHAR *, CANDIDATELIST *, DWORD, UINT); DWORD (WINAPI *pImeConversionList)(HIMC, const void/*TCHAR*/*, CANDIDATELIST*, DWORD, UINT);
BOOL (WINAPI *pImeProcessKey)(HIMC, UINT, LPARAM, const BYTE *); UINT (WINAPI *pImeGetRegisterWordStyle)(UINT, void/*STYLEBUFW*/*);
UINT (WINAPI *pImeGetRegisterWordStyle)(UINT, STYLEBUFW *); BOOL (WINAPI *pImeProcessKey)(HIMC, UINT, LPARAM, const BYTE*);
DWORD (WINAPI *pImeGetImeMenuItems)(HIMC, DWORD, DWORD, IMEMENUITEMINFOW *, IMEMENUITEMINFOW *, DWORD); DWORD (WINAPI *pImeGetImeMenuItems)(HIMC, DWORD, DWORD, void/*IMEMENUITEMINFOW*/*, void/*IMEMENUITEMINFOW*/*, DWORD);
}; };
static HRESULT (WINAPI *pCoRevokeInitializeSpy)(ULARGE_INTEGER cookie); static HRESULT (WINAPI *pCoRevokeInitializeSpy)(ULARGE_INTEGER cookie);
...@@ -934,12 +934,11 @@ UINT WINAPI ImmEnumRegisterWordA( HKL hkl, REGISTERWORDENUMPROCA procA, const ch ...@@ -934,12 +934,11 @@ UINT WINAPI ImmEnumRegisterWordA( HKL hkl, REGISTERWORDENUMPROCA procA, const ch
if (!ime->hIME || !ime->pImeEnumRegisterWord) return 0; if (!ime->hIME || !ime->pImeEnumRegisterWord) return 0;
if (!is_kbd_ime_unicode( ime )) if (!is_kbd_ime_unicode( ime ))
ret = ime->pImeEnumRegisterWord( (REGISTERWORDENUMPROCW)procA, (const WCHAR *)readingA, ret = ime->pImeEnumRegisterWord( procA, readingA, style, stringA, user );
style, (const WCHAR *)stringA, user );
else else
{ {
WCHAR *readingW = strdupAtoW( readingA ), *stringW = strdupAtoW( stringA ); WCHAR *readingW = strdupAtoW( readingA ), *stringW = strdupAtoW( stringA );
ret = ime->pImeEnumRegisterWord( (REGISTERWORDENUMPROCW)procA, readingW, style, stringW, user ); ret = ime->pImeEnumRegisterWord( procA, readingW, style, stringW, user );
HeapFree( GetProcessHeap(), 0, readingW ); HeapFree( GetProcessHeap(), 0, readingW );
HeapFree( GetProcessHeap(), 0, stringW ); HeapFree( GetProcessHeap(), 0, stringW );
} }
...@@ -966,8 +965,7 @@ UINT WINAPI ImmEnumRegisterWordW( HKL hkl, REGISTERWORDENUMPROCW procW, const WC ...@@ -966,8 +965,7 @@ UINT WINAPI ImmEnumRegisterWordW( HKL hkl, REGISTERWORDENUMPROCW procW, const WC
else else
{ {
char *readingA = strdupWtoA( readingW ), *stringA = strdupWtoA( stringW ); char *readingA = strdupWtoA( readingW ), *stringA = strdupWtoA( stringW );
ret = ime->pImeEnumRegisterWord( procW, (const WCHAR *)readingA, style, ret = ime->pImeEnumRegisterWord( procW, readingA, style, stringA, user );
(const WCHAR *)stringA, user );
HeapFree( GetProcessHeap(), 0, readingA ); HeapFree( GetProcessHeap(), 0, readingA );
HeapFree( GetProcessHeap(), 0, stringA ); HeapFree( GetProcessHeap(), 0, stringA );
} }
...@@ -1597,7 +1595,7 @@ DWORD WINAPI ImmGetConversionListA( HKL hkl, HIMC himc, const char *srcA, CANDID ...@@ -1597,7 +1595,7 @@ DWORD WINAPI ImmGetConversionListA( HKL hkl, HIMC himc, const char *srcA, CANDID
if (!ime->hIME || !ime->pImeConversionList) return 0; if (!ime->hIME || !ime->pImeConversionList) return 0;
if (!is_kbd_ime_unicode( ime )) if (!is_kbd_ime_unicode( ime ))
ret = ime->pImeConversionList( himc, (const WCHAR *)srcA, listA, lengthA, flags ); ret = ime->pImeConversionList( himc, srcA, listA, lengthA, flags );
else else
{ {
CANDIDATELIST *listW; CANDIDATELIST *listW;
...@@ -1637,12 +1635,12 @@ DWORD WINAPI ImmGetConversionListW( HKL hkl, HIMC himc, const WCHAR *srcW, CANDI ...@@ -1637,12 +1635,12 @@ DWORD WINAPI ImmGetConversionListW( HKL hkl, HIMC himc, const WCHAR *srcW, CANDI
{ {
CANDIDATELIST *listA; CANDIDATELIST *listA;
char *srcA = strdupWtoA( srcW ); char *srcA = strdupWtoA( srcW );
DWORD lengthA = ime->pImeConversionList( himc, (const WCHAR *)srcA, NULL, 0, flags ); DWORD lengthA = ime->pImeConversionList( himc, srcA, NULL, 0, flags );
if (!(listA = HeapAlloc( GetProcessHeap(), 0, lengthA ))) ret = 0; if (!(listA = HeapAlloc( GetProcessHeap(), 0, lengthA ))) ret = 0;
else else
{ {
ime->pImeConversionList( himc, (const WCHAR *)srcA, listA, lengthA, flags ); ime->pImeConversionList( himc, srcA, listA, lengthA, flags );
ret = convert_candidatelist_AtoW( listA, listW, lengthW ); ret = convert_candidatelist_AtoW( listA, listW, lengthW );
HeapFree( GetProcessHeap(), 0, listA ); HeapFree( GetProcessHeap(), 0, listA );
} }
...@@ -1894,7 +1892,7 @@ UINT WINAPI ImmGetRegisterWordStyleA( HKL hkl, UINT count, STYLEBUFA *styleA ) ...@@ -1894,7 +1892,7 @@ UINT WINAPI ImmGetRegisterWordStyleA( HKL hkl, UINT count, STYLEBUFA *styleA )
if (!ime->hIME || !ime->pImeGetRegisterWordStyle) return 0; if (!ime->hIME || !ime->pImeGetRegisterWordStyle) return 0;
if (!is_kbd_ime_unicode( ime )) if (!is_kbd_ime_unicode( ime ))
ret = ime->pImeGetRegisterWordStyle( count, (STYLEBUFW *)styleA ); ret = ime->pImeGetRegisterWordStyle( count, styleA );
else else
{ {
STYLEBUFW styleW; STYLEBUFW styleW;
...@@ -1923,7 +1921,7 @@ UINT WINAPI ImmGetRegisterWordStyleW( HKL hkl, UINT count, STYLEBUFW *styleW ) ...@@ -1923,7 +1921,7 @@ UINT WINAPI ImmGetRegisterWordStyleW( HKL hkl, UINT count, STYLEBUFW *styleW )
else else
{ {
STYLEBUFA styleA; STYLEBUFA styleA;
ret = ime->pImeGetRegisterWordStyle( count, (STYLEBUFW *)&styleA ); ret = ime->pImeGetRegisterWordStyle( count, &styleA );
MultiByteToWideChar( CP_ACP, 0, styleA.szDescription, -1, styleW->szDescription, 32 ); MultiByteToWideChar( CP_ACP, 0, styleA.szDescription, -1, styleW->szDescription, 32 );
styleW->dwStyle = styleA.dwStyle; styleW->dwStyle = styleA.dwStyle;
} }
...@@ -2148,7 +2146,7 @@ BOOL WINAPI ImmRegisterWordA( HKL hkl, const char *readingA, DWORD style, const ...@@ -2148,7 +2146,7 @@ BOOL WINAPI ImmRegisterWordA( HKL hkl, const char *readingA, DWORD style, const
if (!ime->hIME || !ime->pImeRegisterWord) return FALSE; if (!ime->hIME || !ime->pImeRegisterWord) return FALSE;
if (!is_kbd_ime_unicode( ime )) if (!is_kbd_ime_unicode( ime ))
ret = ime->pImeRegisterWord( (const WCHAR *)readingA, style, (const WCHAR *)stringA ); ret = ime->pImeRegisterWord( readingA, style, stringA );
else else
{ {
WCHAR *readingW = strdupAtoW( readingA ), *stringW = strdupAtoW( stringA ); WCHAR *readingW = strdupAtoW( readingA ), *stringW = strdupAtoW( stringA );
...@@ -2177,7 +2175,7 @@ BOOL WINAPI ImmRegisterWordW( HKL hkl, const WCHAR *readingW, DWORD style, const ...@@ -2177,7 +2175,7 @@ BOOL WINAPI ImmRegisterWordW( HKL hkl, const WCHAR *readingW, DWORD style, const
else else
{ {
char *readingA = strdupWtoA( readingW ), *stringA = strdupWtoA( stringW ); char *readingA = strdupWtoA( readingW ), *stringA = strdupWtoA( stringW );
ret = ime->pImeRegisterWord( (const WCHAR *)readingA, style, (const WCHAR *)stringA ); ret = ime->pImeRegisterWord( readingA, style, stringA );
HeapFree( GetProcessHeap(), 0, readingA ); HeapFree( GetProcessHeap(), 0, readingA );
HeapFree( GetProcessHeap(), 0, stringA ); HeapFree( GetProcessHeap(), 0, stringA );
} }
...@@ -2628,7 +2626,7 @@ BOOL WINAPI ImmUnregisterWordA( HKL hkl, const char *readingA, DWORD style, cons ...@@ -2628,7 +2626,7 @@ BOOL WINAPI ImmUnregisterWordA( HKL hkl, const char *readingA, DWORD style, cons
if (!ime->hIME || !ime->pImeUnregisterWord) return FALSE; if (!ime->hIME || !ime->pImeUnregisterWord) return FALSE;
if (!is_kbd_ime_unicode( ime )) if (!is_kbd_ime_unicode( ime ))
ret = ime->pImeUnregisterWord( (const WCHAR *)readingA, style, (const WCHAR *)stringA ); ret = ime->pImeUnregisterWord( readingA, style, stringA );
else else
{ {
WCHAR *readingW = strdupAtoW( readingA ), *stringW = strdupAtoW( stringA ); WCHAR *readingW = strdupAtoW( readingA ), *stringW = strdupAtoW( stringA );
...@@ -2657,7 +2655,7 @@ BOOL WINAPI ImmUnregisterWordW( HKL hkl, const WCHAR *readingW, DWORD style, con ...@@ -2657,7 +2655,7 @@ BOOL WINAPI ImmUnregisterWordW( HKL hkl, const WCHAR *readingW, DWORD style, con
else else
{ {
char *readingA = strdupWtoA( readingW ), *stringA = strdupWtoA( stringW ); char *readingA = strdupWtoA( readingW ), *stringA = strdupWtoA( stringW );
ret = ime->pImeUnregisterWord( (const WCHAR *)readingA, style, (const WCHAR *)stringA ); ret = ime->pImeUnregisterWord( readingA, style, stringA );
HeapFree( GetProcessHeap(), 0, readingA ); HeapFree( GetProcessHeap(), 0, readingA );
HeapFree( GetProcessHeap(), 0, stringA ); HeapFree( GetProcessHeap(), 0, stringA );
} }
...@@ -2686,8 +2684,7 @@ DWORD WINAPI ImmGetImeMenuItemsA( HIMC himc, DWORD flags, DWORD type, IMEMENUITE ...@@ -2686,8 +2684,7 @@ DWORD WINAPI ImmGetImeMenuItemsA( HIMC himc, DWORD flags, DWORD type, IMEMENUITE
if (!data->immKbd->hIME || !data->immKbd->pImeGetImeMenuItems) return 0; if (!data->immKbd->hIME || !data->immKbd->pImeGetImeMenuItems) return 0;
if (!is_himc_ime_unicode( data ) || (!parentA && !menuA)) if (!is_himc_ime_unicode( data ) || (!parentA && !menuA))
ret = data->immKbd->pImeGetImeMenuItems( himc, flags, type, (IMEMENUITEMINFOW *)parentA, ret = data->immKbd->pImeGetImeMenuItems( himc, flags, type, parentA, menuA, size );
(IMEMENUITEMINFOW *)menuA, size );
else else
{ {
IMEMENUITEMINFOW tmpW, *menuW, *parentW = parentA ? &tmpW : NULL; IMEMENUITEMINFOW tmpW, *menuW, *parentW = parentA ? &tmpW : NULL;
...@@ -2760,8 +2757,7 @@ DWORD WINAPI ImmGetImeMenuItemsW( HIMC himc, DWORD flags, DWORD type, IMEMENUITE ...@@ -2760,8 +2757,7 @@ DWORD WINAPI ImmGetImeMenuItemsW( HIMC himc, DWORD flags, DWORD type, IMEMENUITE
menuA = HeapAlloc( GetProcessHeap(), 0, size ); menuA = HeapAlloc( GetProcessHeap(), 0, size );
} }
ret = data->immKbd->pImeGetImeMenuItems( himc, flags, type, (IMEMENUITEMINFOW *)parentA, ret = data->immKbd->pImeGetImeMenuItems( himc, flags, type, parentA, menuA, size );
(IMEMENUITEMINFOW *)menuA, size );
if (parentW) if (parentW)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment