Author: hbelusca
Date: Wed Aug 10 11:42:21 2016
New Revision: 72185
URL:
http://svn.reactos.org/svn/reactos?rev=72185&view=rev
Log:
[INPUT]
- Fix misspelling "Dublicate" -> "Duplicate".
- Use ZeroMemory instead of memset(..., 0, ...).
- Don't hardcode most of the variable types for sizeof.
Modified:
trunk/reactos/dll/cpl/input/input.c
trunk/reactos/dll/cpl/input/input.h
trunk/reactos/dll/cpl/input/input_list.c
trunk/reactos/dll/cpl/input/key_settings_dialog.c
trunk/reactos/dll/cpl/input/layout_list.c
trunk/reactos/dll/cpl/input/locale_list.c
trunk/reactos/dll/cpl/input/settings_page.c
Modified: trunk/reactos/dll/cpl/input/input.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/input.c?rev=…
==============================================================================
--- trunk/reactos/dll/cpl/input/input.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/input.c [iso-8859-1] Wed Aug 10 11:42:21 2016
@@ -29,9 +29,9 @@
static VOID
InitPropSheetPage(PROPSHEETPAGEW *page, WORD idDlg, DLGPROC DlgProc)
{
- memset(page, 0, sizeof(PROPSHEETPAGEW));
+ ZeroMemory(page, sizeof(*page));
- page->dwSize = sizeof(PROPSHEETPAGEW);
+ page->dwSize = sizeof(*page);
page->dwFlags = PSP_DEFAULT;
page->hInstance = hApplet;
page->pszTemplate = MAKEINTRESOURCEW(idDlg);
@@ -49,13 +49,13 @@
LoadStringW(hApplet, IDS_CPLSYSTEMNAME, szCaption, ARRAYSIZE(szCaption));
- memset(&header, 0, sizeof(PROPSHEETHEADER));
+ ZeroMemory(&header, sizeof(header));
- header.dwSize = sizeof(PROPSHEETHEADER);
+ header.dwSize = sizeof(header);
header.dwFlags = PSH_PROPSHEETPAGE;
header.hwndParent = hCPLWindow;
header.hInstance = hApplet;
- header.hIcon = LoadIconW(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM));
+ header.hIcon = LoadIconW(hApplet, MAKEINTRESOURCEW(IDI_CPLSYSTEM));
header.pszCaption = szCaption;
header.nPages = ARRAYSIZE(page);
header.nStartPage = 0;
Modified: trunk/reactos/dll/cpl/input/input.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/input.h?rev=…
==============================================================================
--- trunk/reactos/dll/cpl/input/input.h [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/input.h [iso-8859-1] Wed Aug 10 11:42:21 2016
@@ -73,20 +73,20 @@
static inline WCHAR*
-DublicateString(const WCHAR *pszString)
+DuplicateString(const WCHAR *pszString)
{
- WCHAR *pszDublicate;
+ WCHAR *pszDuplicate;
size_t size;
size = (wcslen(pszString) + 1) * sizeof(WCHAR);
- pszDublicate = (WCHAR*) malloc(size);
- if (pszDublicate != NULL)
+ pszDuplicate = (WCHAR*) malloc(size);
+ if (pszDuplicate != NULL)
{
- StringCbCopyW(pszDublicate, size, pszString);
+ StringCbCopyW(pszDuplicate, size, pszString);
}
- return pszDublicate;
+ return pszDuplicate;
}
static inline DWORD
Modified: trunk/reactos/dll/cpl/input/input_list.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/input_list.c…
==============================================================================
--- trunk/reactos/dll/cpl/input/input_list.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/input_list.c [iso-8859-1] Wed Aug 10 11:42:21 2016
@@ -23,7 +23,7 @@
if (pNew == NULL)
return NULL;
- memset(pNew, 0, sizeof(INPUT_LIST_NODE));
+ ZeroMemory(pNew, sizeof(INPUT_LIST_NODE));
if (pCurrent == NULL)
{
@@ -318,7 +318,7 @@
if (len > 0)
{
szIndicator[len - 1] = 0;
- pInput->pszIndicator = DublicateString(szIndicator);
+ pInput->pszIndicator = DuplicateString(szIndicator);
}
}
@@ -447,7 +447,7 @@
if (len > 0)
{
szIndicator[len - 1] = 0;
- pInput->pszIndicator = DublicateString(szIndicator);
+ pInput->pszIndicator = DuplicateString(szIndicator);
}
}
}
Modified: trunk/reactos/dll/cpl/input/key_settings_dialog.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/key_settings…
==============================================================================
--- trunk/reactos/dll/cpl/input/key_settings_dialog.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/key_settings_dialog.c [iso-8859-1] Wed Aug 10 11:42:21
2016
@@ -23,7 +23,7 @@
{
DWORD dwSize;
- dwSize = sizeof(DWORD);
+ dwSize = sizeof(dwSize);
if (RegQueryValueExW(hKey,
L"Attributes",
@@ -142,7 +142,7 @@
ListView_DeleteAllItems(hwndList);
- memset(&item, 0, sizeof(LV_ITEM));
+ ZeroMemory(&item, sizeof(item));
LoadStringW(hApplet, IDS_SWITCH_BET_INLANG, szBuffer, ARRAYSIZE(szBuffer));
item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE;
@@ -191,7 +191,7 @@
ListView_SetExtendedListViewStyle(hwndList, LVS_EX_FULLROWSELECT);
- memset(&column, 0, sizeof(LV_COLUMN));
+ ZeroMemory(&column, sizeof(column));
column.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
Modified: trunk/reactos/dll/cpl/input/layout_list.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/layout_list.…
==============================================================================
--- trunk/reactos/dll/cpl/input/layout_list.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/layout_list.c [iso-8859-1] Wed Aug 10 11:42:21 2016
@@ -22,13 +22,13 @@
pCurrent = _LayoutList;
- pNew = (LAYOUT_LIST_NODE*) malloc(sizeof(LAYOUT_LIST_NODE));
+ pNew = (LAYOUT_LIST_NODE*)malloc(sizeof(LAYOUT_LIST_NODE));
if (pNew == NULL)
return NULL;
- memset(pNew, 0, sizeof(LAYOUT_LIST_NODE));
-
- pNew->pszName = DublicateString(pszName);
+ ZeroMemory(pNew, sizeof(LAYOUT_LIST_NODE));
+
+ pNew->pszName = DuplicateString(pszName);
if (pNew->pszName == NULL)
{
free(pNew);
Modified: trunk/reactos/dll/cpl/input/locale_list.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/locale_list.…
==============================================================================
--- trunk/reactos/dll/cpl/input/locale_list.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/locale_list.c [iso-8859-1] Wed Aug 10 11:42:21 2016
@@ -22,13 +22,13 @@
pCurrent = _LocaleList;
- pNew = (LOCALE_LIST_NODE*) malloc(sizeof(LOCALE_LIST_NODE));
+ pNew = (LOCALE_LIST_NODE*)malloc(sizeof(LOCALE_LIST_NODE));
if (pNew == NULL)
return NULL;
- memset(pNew, 0, sizeof(LOCALE_LIST_NODE));
+ ZeroMemory(pNew, sizeof(LOCALE_LIST_NODE));
- pNew->pszName = DublicateString(pszName);
+ pNew->pszName = DuplicateString(pszName);
if (pNew->pszName == NULL)
{
free(pNew);
Modified: trunk/reactos/dll/cpl/input/settings_page.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/settings_pag…
==============================================================================
--- trunk/reactos/dll/cpl/input/settings_page.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/settings_page.c [iso-8859-1] Wed Aug 10 11:42:21 2016
@@ -34,9 +34,9 @@
hBmpNew = CreateBitmap(width, height, 1, 1, NULL);
if (hBmpNew)
{
- LOGFONT lf;
-
- if (SystemParametersInfoW(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &lf,
0))
+ LOGFONTW lf;
+
+ if (SystemParametersInfoW(SPI_GETICONTITLELOGFONT, sizeof(lf), &lf, 0))
{
ICONINFO IconInfo;
HFONT hFont;
@@ -143,7 +143,7 @@
}
}
- memset(&item, 0, sizeof(LV_ITEM));
+ ZeroMemory(&item, sizeof(item));
item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
item.pszText = pInputNode->pLocale->pszName;
@@ -202,7 +202,7 @@
ListView_SetExtendedListViewStyle(hwndInputList, LVS_EX_FULLROWSELECT);
- memset(&column, 0, sizeof(LV_COLUMN));
+ ZeroMemory(&column, sizeof(column));
column.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;