Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
0c8e555e
Commit
0c8e555e
authored
Jun 18, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jun 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Use the available ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
36449671
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
16 deletions
+15
-16
crashdlg.c
programs/winedbg/crashdlg.c
+6
-7
gdbproxy.c
programs/winedbg/gdbproxy.c
+6
-6
tgt_active.c
programs/winedbg/tgt_active.c
+3
-3
No files found.
programs/winedbg/crashdlg.c
View file @
0c8e555e
...
...
@@ -38,8 +38,8 @@ int msgbox_res_id(HWND hwnd, UINT textId, UINT captionId, UINT uType)
{
WCHAR
caption
[
256
];
WCHAR
text
[
256
];
LoadStringW
(
GetModuleHandleW
(
NULL
),
captionId
,
caption
,
sizeof
(
caption
)
/
sizeof
(
caption
[
0
]
));
LoadStringW
(
GetModuleHandleW
(
NULL
),
textId
,
text
,
sizeof
(
text
)
/
sizeof
(
text
[
0
]
));
LoadStringW
(
GetModuleHandleW
(
NULL
),
captionId
,
caption
,
ARRAY_SIZE
(
caption
));
LoadStringW
(
GetModuleHandleW
(
NULL
),
textId
,
text
,
ARRAY_SIZE
(
text
));
return
MessageBoxW
(
hwnd
,
text
,
caption
,
uType
);
}
...
...
@@ -116,8 +116,7 @@ static void set_message_with_filename(HWND hDlg)
WCHAR
originalText
[
1000
];
WCHAR
newText
[
1000
+
MAX_PROGRAM_NAME_LENGTH
];
GetDlgItemTextW
(
hDlg
,
IDC_STATIC_TXT1
,
originalText
,
sizeof
(
originalText
)
/
sizeof
(
originalText
[
0
]));
GetDlgItemTextW
(
hDlg
,
IDC_STATIC_TXT1
,
originalText
,
ARRAY_SIZE
(
originalText
));
wsprintfW
(
newText
,
originalText
,
g_ProgramName
);
SetDlgItemTextW
(
hDlg
,
IDC_STATIC_TXT1
,
newText
);
}
...
...
@@ -150,11 +149,11 @@ static void save_crash_log( HWND hwnd )
memset
(
&
save
,
0
,
sizeof
(
save
)
);
lstrcpyW
(
path
,
default_name
);
LoadStringW
(
GetModuleHandleW
(
0
),
IDS_TEXT_FILES
,
buffer
,
sizeof
(
buffer
)
/
sizeof
(
buffer
[
0
])
);
LoadStringW
(
GetModuleHandleW
(
0
),
IDS_TEXT_FILES
,
buffer
,
ARRAY_SIZE
(
buffer
)
);
p
=
buffer
+
lstrlenW
(
buffer
)
+
1
;
lstrcpyW
(
p
,
txt_files
);
p
+=
lstrlenW
(
p
)
+
1
;
LoadStringW
(
GetModuleHandleW
(
0
),
IDS_ALL_FILES
,
p
,
sizeof
(
buffer
)
/
sizeof
(
buffer
[
0
]
)
-
(
p
-
buffer
)
);
LoadStringW
(
GetModuleHandleW
(
0
),
IDS_ALL_FILES
,
p
,
ARRAY_SIZE
(
buffer
)
-
(
p
-
buffer
)
);
p
+=
lstrlenW
(
p
)
+
1
;
lstrcpyW
(
p
,
all_files
);
p
+=
lstrlenW
(
p
)
+
1
;
...
...
@@ -189,7 +188,7 @@ static void save_crash_log( HWND hwnd )
}
else
err
=
GetLastError
();
LoadStringW
(
GetModuleHandleW
(
0
),
IDS_SAVE_ERROR
,
buffer
,
sizeof
(
buffer
)
/
sizeof
(
WCHAR
)
);
LoadStringW
(
GetModuleHandleW
(
0
),
IDS_SAVE_ERROR
,
buffer
,
ARRAY_SIZE
(
buffer
)
);
FormatMessageW
(
FORMAT_MESSAGE_ALLOCATE_BUFFER
|
FORMAT_MESSAGE_FROM_SYSTEM
,
NULL
,
err
,
0
,
(
LPWSTR
)
&
p
,
0
,
NULL
);
MessageBoxW
(
0
,
p
,
buffer
,
MB_OK
|
MB_ICONERROR
);
...
...
programs/winedbg/gdbproxy.c
View file @
0c8e555e
...
...
@@ -391,7 +391,7 @@ static void handle_debug_event(struct gdb_context* gdbctx, DEBUG_EVENT* de)
memory_get_string_indirect
(
gdbctx
->
process
,
de
->
u
.
CreateProcessInfo
.
lpImageName
,
de
->
u
.
CreateProcessInfo
.
fUnicode
,
u
.
buffer
,
sizeof
(
u
.
buffer
)
/
sizeof
(
WCHAR
));
u
.
buffer
,
ARRAY_SIZE
(
u
.
buffer
));
dbg_set_process_name
(
gdbctx
->
process
,
u
.
buffer
);
if
(
gdbctx
->
trace
&
GDBPXY_TRC_WIN32_EVENT
)
...
...
@@ -423,7 +423,7 @@ static void handle_debug_event(struct gdb_context* gdbctx, DEBUG_EVENT* de)
memory_get_string_indirect
(
gdbctx
->
process
,
de
->
u
.
LoadDll
.
lpImageName
,
de
->
u
.
LoadDll
.
fUnicode
,
u
.
buffer
,
sizeof
(
u
.
buffer
)
/
sizeof
(
WCHAR
));
u
.
buffer
,
ARRAY_SIZE
(
u
.
buffer
));
if
(
gdbctx
->
trace
&
GDBPXY_TRC_WIN32_EVENT
)
fprintf
(
stderr
,
"%04x:%04x: loads DLL %s @%p (%u<%u>)
\n
"
,
de
->
dwProcessId
,
de
->
dwThreadId
,
...
...
@@ -1146,7 +1146,7 @@ static enum packet_return packet_verbose(struct gdb_context* gdbctx)
if
(
gdbctx
->
trace
&
GDBPXY_TRC_COMMAND
)
fprintf
(
stderr
,
"trying to process a verbose packet %*.*s
\n
"
,
gdbctx
->
in_packet_len
,
gdbctx
->
in_packet_len
,
gdbctx
->
in_packet
);
for
(
i
=
0
;
i
<
sizeof
(
verbose_details
)
/
sizeof
(
verbose_details
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
verbose_details
);
i
++
)
{
if
(
klen
==
verbose_details
[
i
].
len
&&
!
memcmp
(
gdbctx
->
in_packet
,
verbose_details
[
i
].
name
,
verbose_details
[
i
].
len
))
...
...
@@ -1934,11 +1934,11 @@ static BOOL extract_packets(struct gdb_context* gdbctx)
assert
(
plen
);
/* FIXME: should use bsearch if packet_entries was sorted */
for
(
i
=
0
;
i
<
sizeof
(
packet_entries
)
/
sizeof
(
packet_entries
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
packet_entries
);
i
++
)
{
if
(
packet_entries
[
i
].
key
==
gdbctx
->
in_buf
[
1
])
break
;
}
if
(
i
==
sizeof
(
packet_entries
)
/
sizeof
(
packet_entries
[
0
]
))
if
(
i
==
ARRAY_SIZE
(
packet_entries
))
{
if
(
gdbctx
->
trace
&
GDBPXY_TRC_COMMAND_ERROR
)
fprintf
(
stderr
,
"Unknown packet request %*.*s
\n
"
,
...
...
@@ -2178,7 +2178,7 @@ static BOOL gdb_init_context(struct gdb_context* gdbctx, unsigned flags, unsigne
gdbctx
->
in_trap
=
FALSE
;
gdbctx
->
trace
=
/*GDBPXY_TRC_PACKET | GDBPXY_TRC_COMMAND |*/
GDBPXY_TRC_COMMAND_ERROR
|
GDBPXY_TRC_COMMAND_FIXME
|
GDBPXY_TRC_WIN32_EVENT
;
gdbctx
->
process
=
NULL
;
for
(
i
=
0
;
i
<
sizeof
(
gdbctx
->
wine_segs
)
/
sizeof
(
gdbctx
->
wine_segs
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
gdbctx
->
wine_segs
);
i
++
)
gdbctx
->
wine_segs
[
i
]
=
0
;
/* wait for first trap */
...
...
programs/winedbg/tgt_active.c
View file @
0c8e555e
...
...
@@ -360,7 +360,7 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de)
fetch_module_name
(
de
->
u
.
CreateProcessInfo
.
lpImageName
,
de
->
u
.
CreateProcessInfo
.
fUnicode
,
de
->
u
.
CreateProcessInfo
.
lpBaseOfImage
,
u
.
buffer
,
sizeof
(
u
.
buffer
)
/
sizeof
(
WCHAR
),
TRUE
);
u
.
buffer
,
ARRAY_SIZE
(
u
.
buffer
),
TRUE
);
WINE_TRACE
(
"%04x:%04x: create process '%s'/%p @%p (%u<%u>)
\n
"
,
de
->
dwProcessId
,
de
->
dwThreadId
,
...
...
@@ -455,7 +455,7 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de)
fetch_module_name
(
de
->
u
.
LoadDll
.
lpImageName
,
de
->
u
.
LoadDll
.
fUnicode
,
de
->
u
.
LoadDll
.
lpBaseOfDll
,
u
.
buffer
,
sizeof
(
u
.
buffer
)
/
sizeof
(
WCHAR
),
FALSE
);
u
.
buffer
,
ARRAY_SIZE
(
u
.
buffer
),
FALSE
);
WINE_TRACE
(
"%04x:%04x: loads DLL %s @%p (%u<%u>)
\n
"
,
de
->
dwProcessId
,
de
->
dwThreadId
,
...
...
@@ -708,7 +708,7 @@ static const char *get_windows_version(void)
GetVersionExW
(
(
OSVERSIONINFOW
*
)
&
info
);
for
(
i
=
0
;
i
<
sizeof
(
version_table
)
/
sizeof
(
version_table
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
version_table
);
i
++
)
{
if
(
version_table
[
i
].
type
==
info
.
wProductType
&&
version_table
[
i
].
platform
==
info
.
dwPlatformId
&&
...
...
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