Skip to content

Commit a401325

Browse files
authored
[IMM32] Fix C4334 and C4267 warnings (reactos#9211)
Kill the warnings. JIRA issue: CORE-19268 Add type casts to DWORD.
1 parent 5cef1f6 commit a401325

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎win32ss/user/imm32/candidate.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,6 @@ ImmSetCandidateWindow(
458458
ImmUnlockIMC(hIMC);
459459

460460
Imm32MakeIMENotify(hIMC, hWnd, NI_CONTEXTUPDATED, 0, IMC_SETCANDIDATEPOS,
461-
IMN_SETCANDIDATEPOS, (1 << (BYTE)lpCandidate->dwIndex));
461+
IMN_SETCANDIDATEPOS, (DWORD)(1 << (BYTE)lpCandidate->dwIndex));
462462
return TRUE;
463463
}

‎win32ss/user/imm32/imemenu.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Imm32WriteHBitmapToNode(
127127
break;
128128
default:
129129
nodeExtraSize = sizeof(BITMAPINFOHEADER);
130-
nodeExtraSize += (1 << pBmih->biBitCount) * sizeof(RGBQUAD);
130+
nodeExtraSize += ((DWORD)(1 << pBmih->biBitCount)) * sizeof(RGBQUAD);
131131
break;
132132
}
133133

‎win32ss/user/imm32/install.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,13 @@ Imm32WriteImeLayout(
281281
goto Failure;
282282

283283
/* Write "Ime File" */
284-
cbData = (wcslen(pchFileTitle) + 1) * sizeof(WCHAR);
284+
cbData = (DWORD)((wcslen(pchFileTitle) + 1) * sizeof(WCHAR));
285285
lError = RegSetValueExW(hkeyIME, L"Ime File", 0, REG_SZ, (LPBYTE)pchFileTitle, cbData);
286286
if (IS_ERROR_UNEXPECTEDLY(lError))
287287
goto Failure;
288288

289289
/* Write "Layout Text" */
290-
cbData = (wcslen(pszLayoutText) + 1) * sizeof(WCHAR);
290+
cbData = (DWORD)((wcslen(pszLayoutText) + 1) * sizeof(WCHAR));
291291
lError = RegSetValueExW(hkeyIME, L"Layout Text", 0, REG_SZ, (LPBYTE)pszLayoutText, cbData);
292292
if (IS_ERROR_UNEXPECTEDLY(lError))
293293
goto Failure;
@@ -302,7 +302,7 @@ Imm32WriteImeLayout(
302302
}
303303

304304
/* Write "Layout File" */
305-
cbData = (wcslen(pszLayoutFile) + 1) * sizeof(WCHAR);
305+
cbData = (DWORD)((wcslen(pszLayoutFile) + 1) * sizeof(WCHAR));
306306
lError = RegSetValueExW(hkeyIME, L"Layout File", 0, REG_SZ, (LPBYTE)pszLayoutFile, cbData);
307307
if (IS_ERROR_UNEXPECTEDLY(lError))
308308
goto Failure;
@@ -337,7 +337,7 @@ Imm32WriteImeLayout(
337337
#undef MAX_PRELOAD
338338

339339
/* Write the IME key to the preload number */
340-
cbData = (wcslen(szImeKey) + 1) * sizeof(WCHAR);
340+
cbData = (DWORD)((wcslen(szImeKey) + 1) * sizeof(WCHAR));
341341
lError = RegSetValueExW(hkeyPreload, szPreloadNumber, 0, REG_SZ, (LPBYTE)szImeKey, cbData);
342342
RegCloseKey(hkeyPreload);
343343
return lError == ERROR_SUCCESS;

‎win32ss/user/imm32/keymsg.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ Imm32ProcessRequest(HIMC hIMC, PWND pWnd, DWORD dwCommand, LPVOID pData, BOOL bA
403403
return 0; /* Out of range */
404404
}
405405

406-
dwSize = acbData[bAnsiAPI * 7 + dwCommand - 1];
406+
dwSize = (DWORD)acbData[bAnsiAPI * 7 + dwCommand - 1];
407407
if (pData && IsBadWritePtr(pData, dwSize))
408408
{
409409
ERR("\n");

‎win32ss/user/imm32/win3.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1456,7 +1456,7 @@ WINNLSTranslateMessageJ(
14561456
LPARAM lParam = pCurrent->lParam;
14571457
for (DWORD iCandForm = 0; iCandForm < MAX_CANDIDATEFORM; ++iCandForm)
14581458
{
1459-
if (!(lParam & (1 << iCandForm)))
1459+
if (!(lParam & (DWORD)(1 << iCandForm)))
14601460
continue;
14611461

14621462
CandForm.dwIndex = iCandForm;

0 commit comments

Comments
 (0)