Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
78732a6d
Commit
78732a6d
authored
May 21, 2018
by
Hugh McMaster
Committed by
Alexandre Julliard
May 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Replace the COUNT_OF macro with ARRAY_SIZE.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5443f0ee
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
19 deletions
+19
-19
about.c
programs/regedit/about.c
+1
-1
edit.c
programs/regedit/edit.c
+5
-5
framewnd.c
programs/regedit/framewnd.c
+8
-8
listview.c
programs/regedit/listview.c
+1
-1
main.c
programs/regedit/main.c
+2
-2
main.h
programs/regedit/main.h
+1
-1
treeview.c
programs/regedit/treeview.c
+1
-1
No files found.
programs/regedit/about.c
View file @
78732a6d
...
...
@@ -29,6 +29,6 @@ void ShowAboutBox(HWND hWnd)
{
WCHAR
title
[
64
];
HICON
icon
=
LoadImageW
(
hInst
,
MAKEINTRESOURCEW
(
IDI_REGEDIT
),
IMAGE_ICON
,
48
,
48
,
LR_SHARED
);
LoadStringW
(
hInst
,
IDS_APP_TITLE
,
title
,
COUNT_OF
(
title
));
LoadStringW
(
hInst
,
IDS_APP_TITLE
,
title
,
ARRAY_SIZE
(
title
));
ShellAboutW
(
hWnd
,
title
,
NULL
,
icon
);
}
programs/regedit/edit.c
View file @
78732a6d
...
...
@@ -54,8 +54,8 @@ static int vmessagebox(HWND hwnd, int buttons, int titleId, int resId, __ms_va_l
WCHAR
*
str
;
int
ret
;
LoadStringW
(
hInst
,
titleId
,
title
,
COUNT_OF
(
title
));
LoadStringW
(
hInst
,
resId
,
fmt
,
COUNT_OF
(
fmt
));
LoadStringW
(
hInst
,
titleId
,
title
,
ARRAY_SIZE
(
title
));
LoadStringW
(
hInst
,
resId
,
fmt
,
ARRAY_SIZE
(
fmt
));
FormatMessageW
(
FORMAT_MESSAGE_FROM_STRING
|
FORMAT_MESSAGE_ALLOCATE_BUFFER
,
fmt
,
0
,
0
,
(
WCHAR
*
)
&
str
,
0
,
&
va_args
);
...
...
@@ -94,7 +94,7 @@ static BOOL change_dword_base(HWND hwndDlg, BOOL toHex)
WCHAR
buf
[
128
];
DWORD
val
;
if
(
!
GetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_DATA
,
buf
,
COUNT_OF
(
buf
)))
return
FALSE
;
if
(
!
GetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_DATA
,
buf
,
ARRAY_SIZE
(
buf
)))
return
FALSE
;
if
(
!
swscanf
(
buf
,
toHex
?
percent_u
:
percent_x
,
&
val
))
return
FALSE
;
wsprintfW
(
buf
,
toHex
?
percent_x
:
percent_u
,
val
);
return
SetDlgItemTextW
(
hwndDlg
,
IDC_VALUE_DATA
,
buf
);
...
...
@@ -244,7 +244,7 @@ BOOL CreateKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPWSTR keyName)
goto
done
;
}
if
(
!
LoadStringW
(
GetModuleHandleW
(
0
),
IDS_NEWKEY
,
newKey
,
COUNT_OF
(
newKey
)))
goto
done
;
if
(
!
LoadStringW
(
GetModuleHandleW
(
0
),
IDS_NEWKEY
,
newKey
,
ARRAY_SIZE
(
newKey
)))
goto
done
;
/* try to find a name for the key being created (maximum = 100 attempts) */
for
(
keyNum
=
1
;
keyNum
<
100
;
keyNum
++
)
{
...
...
@@ -460,7 +460,7 @@ BOOL CreateValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, DWORD valueType, LPW
return
FALSE
;
}
if
(
!
LoadStringW
(
GetModuleHandleW
(
0
),
IDS_NEWVALUE
,
newValue
,
COUNT_OF
(
newValue
)))
goto
done
;
if
(
!
LoadStringW
(
GetModuleHandleW
(
0
),
IDS_NEWVALUE
,
newValue
,
ARRAY_SIZE
(
newValue
)))
goto
done
;
/* try to find a name for the value being created (maximum = 100 attempts) */
for
(
valueNum
=
1
;
valueNum
<
100
;
valueNum
++
)
{
...
...
programs/regedit/framewnd.c
View file @
78732a6d
...
...
@@ -167,7 +167,7 @@ static void update_new_items_and_copy_keyname(HMENU hMenu, WCHAR *keyName)
if
(
!
keyName
)
state
=
MF_GRAYED
;
for
(
i
=
0
;
i
<
COUNT_OF
(
items
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
items
);
i
++
)
EnableMenuItem
(
hMenu
,
items
[
i
],
state
|
MF_BYCOMMAND
);
}
...
...
@@ -469,7 +469,7 @@ static BOOL ImportRegistryFile(HWND hWnd)
InitOpenFileName
(
hWnd
,
&
ofn
);
ofn
.
Flags
|=
OFN_ENABLESIZING
;
LoadStringW
(
hInst
,
IDS_FILEDIALOG_IMPORT_TITLE
,
title
,
COUNT_OF
(
title
));
LoadStringW
(
hInst
,
IDS_FILEDIALOG_IMPORT_TITLE
,
title
,
ARRAY_SIZE
(
title
));
ofn
.
lpstrTitle
=
title
;
if
(
GetOpenFileNameW
(
&
ofn
))
{
if
(
!
import_registry_filename
(
ofn
.
lpstrFile
))
{
...
...
@@ -498,7 +498,7 @@ static BOOL ExportRegistryFile(HWND hWnd)
WCHAR
title
[
128
];
InitOpenFileName
(
hWnd
,
&
ofn
);
LoadStringW
(
hInst
,
IDS_FILEDIALOG_EXPORT_TITLE
,
title
,
COUNT_OF
(
title
));
LoadStringW
(
hInst
,
IDS_FILEDIALOG_EXPORT_TITLE
,
title
,
ARRAY_SIZE
(
title
));
ofn
.
lpstrTitle
=
title
;
ofn
.
Flags
=
OFN_ENABLETEMPLATE
|
OFN_ENABLEHOOK
|
OFN_EXPLORER
|
OFN_HIDEREADONLY
|
OFN_OVERWRITEPROMPT
;
ofn
.
lpfnHook
=
ExportRegistryFile_OFNHookProc
;
...
...
@@ -676,7 +676,7 @@ static INT_PTR CALLBACK addtofavorites_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM w
item
.
mask
=
TVIF_HANDLE
|
TVIF_TEXT
;
item
.
hItem
=
selected
;
item
.
pszText
=
buf
;
item
.
cchTextMax
=
COUNT_OF
(
buf
);
item
.
cchTextMax
=
ARRAY_SIZE
(
buf
);
SendMessageW
(
g_pChildWnd
->
hTreeWnd
,
TVM_GETITEMW
,
0
,
(
LPARAM
)
&
item
);
EnableWindow
(
GetDlgItem
(
hwndDlg
,
IDOK
),
FALSE
);
...
...
@@ -1065,10 +1065,10 @@ LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
CreateWindowExW
(
0
,
szChildClass
,
captionW
,
WS_CHILD
|
WS_VISIBLE
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
hWnd
,
NULL
,
hInst
,
0
);
LoadStringW
(
hInst
,
IDS_EXPAND
,
expandW
,
COUNT_OF
(
expandW
));
LoadStringW
(
hInst
,
IDS_COLLAPSE
,
collapseW
,
COUNT_OF
(
collapseW
));
LoadStringW
(
hInst
,
IDS_EDIT_MODIFY
,
modifyW
,
COUNT_OF
(
modifyW
));
LoadStringW
(
hInst
,
IDS_EDIT_MODIFY_BIN
,
modify_binaryW
,
COUNT_OF
(
modify_binaryW
));
LoadStringW
(
hInst
,
IDS_EXPAND
,
expandW
,
ARRAY_SIZE
(
expandW
));
LoadStringW
(
hInst
,
IDS_COLLAPSE
,
collapseW
,
ARRAY_SIZE
(
collapseW
));
LoadStringW
(
hInst
,
IDS_EDIT_MODIFY
,
modifyW
,
ARRAY_SIZE
(
modifyW
));
LoadStringW
(
hInst
,
IDS_EDIT_MODIFY_BIN
,
modify_binaryW
,
ARRAY_SIZE
(
modify_binaryW
));
break
;
case
WM_COMMAND
:
if
(
!
_CmdWndProc
(
hWnd
,
message
,
wParam
,
lParam
))
...
...
programs/regedit/listview.c
View file @
78732a6d
...
...
@@ -361,7 +361,7 @@ HWND CreateListView(HWND hwndParent, UINT id)
WCHAR
ListView
[]
=
{
'L'
,
'i'
,
's'
,
't'
,
' '
,
'V'
,
'i'
,
'e'
,
'w'
,
0
};
/* prepare strings */
LoadStringW
(
hInst
,
IDS_REGISTRY_VALUE_NOT_SET
,
g_szValueNotSet
,
COUNT_OF
(
g_szValueNotSet
));
LoadStringW
(
hInst
,
IDS_REGISTRY_VALUE_NOT_SET
,
g_szValueNotSet
,
ARRAY_SIZE
(
g_szValueNotSet
));
/* Get the dimensions of the parent window's client area, and create the list view control. */
GetClientRect
(
hwndParent
,
&
rcClient
);
...
...
programs/regedit/main.c
View file @
78732a6d
...
...
@@ -172,8 +172,8 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
}
/* Initialize global strings */
LoadStringW
(
hInstance
,
IDS_APP_TITLE
,
szTitle
,
COUNT_OF
(
szTitle
));
LoadStringW
(
hInstance
,
IDS_REGISTRY_DEFAULT_VALUE
,
g_pszDefaultValueName
,
COUNT_OF
(
g_pszDefaultValueName
));
LoadStringW
(
hInstance
,
IDS_APP_TITLE
,
szTitle
,
ARRAY_SIZE
(
szTitle
));
LoadStringW
(
hInstance
,
IDS_REGISTRY_DEFAULT_VALUE
,
g_pszDefaultValueName
,
ARRAY_SIZE
(
g_pszDefaultValueName
));
/* Store instance handle in our global variable */
hInst
=
hInstance
;
...
...
programs/regedit/main.h
View file @
78732a6d
...
...
@@ -30,7 +30,7 @@
#define SPLIT_WIDTH 5
#define
COUNT_OF(a) (sizeof(a)/sizeof(a[0]
))
#define
ARRAY_SIZE(A) (sizeof(A)/sizeof(*A
))
#define MAX_NEW_KEY_LEN 128
...
...
programs/regedit/treeview.c
View file @
78732a6d
...
...
@@ -521,7 +521,7 @@ HTREEITEM InsertNode(HWND hwndTV, HTREEITEM hItem, LPWSTR name)
item
.
mask
=
TVIF_HANDLE
|
TVIF_TEXT
;
item
.
hItem
=
hNewItem
;
item
.
pszText
=
buf
;
item
.
cchTextMax
=
COUNT_OF
(
buf
);
item
.
cchTextMax
=
ARRAY_SIZE
(
buf
);
if
(
!
TreeView_GetItemW
(
hwndTV
,
&
item
))
continue
;
if
(
lstrcmpW
(
name
,
item
.
pszText
)
==
0
)
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment