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
7ae21483
Commit
7ae21483
authored
Dec 02, 2009
by
Nicolas Le Cam
Committed by
Alexandre Julliard
Dec 21, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Simplify dumpmem function.
parent
35efca6a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
27 deletions
+16
-27
file.c
dlls/kernel32/tests/file.c
+16
-27
No files found.
dlls/kernel32/tests/file.c
View file @
7ae21483
...
...
@@ -702,33 +702,22 @@ static void test_CopyFileW(void)
/*
* Debugging routine to dump a buffer in a hexdump-like fashion.
*/
static
void
dumpmem
(
unsigned
char
*
mem
,
int
len
)
{
int
x
,
y
;
char
buf
[
200
];
int
ln
=
0
;
for
(
x
=
0
;
x
<
len
;
x
+=
16
)
{
ln
+=
sprintf
(
buf
+
ln
,
"%04x: "
,
x
);
for
(
y
=
0
;
y
<
16
;
y
++
)
{
if
((
x
+
y
)
>
len
)
{
ln
+=
sprintf
(
buf
+
ln
,
" "
);
}
else
{
ln
+=
sprintf
(
buf
+
ln
,
"%02hhx "
,
mem
[
x
+
y
]);
}
}
ln
+=
sprintf
(
buf
+
ln
,
"- "
);
for
(
y
=
0
;
y
<
16
;
y
++
)
{
if
((
x
+
y
)
<=
len
)
{
if
(
mem
[
x
+
y
]
<
32
||
mem
[
x
+
y
]
>
127
)
{
ln
+=
sprintf
(
buf
+
ln
,
"."
);
}
else
{
ln
+=
sprintf
(
buf
+
ln
,
"%c"
,
mem
[
x
+
y
]);
}
}
}
sprintf
(
buf
+
ln
,
"
\n
"
);
trace
(
buf
);
ln
=
0
;
static
void
dumpmem
(
unsigned
char
*
mem
,
int
len
)
{
int
x
=
0
;
char
hex
[
49
],
*
p
;
char
txt
[
17
],
*
c
;
while
(
x
<
len
)
{
p
=
hex
;
c
=
txt
;
do
{
p
+=
sprintf
(
p
,
"%02hhx "
,
mem
[
x
]);
*
c
++
=
(
mem
[
x
]
>=
32
&&
mem
[
x
]
<=
127
)
?
mem
[
x
]
:
'.'
;
}
while
(
++
x
%
16
&&
x
<
len
);
*
c
=
'\0'
;
trace
(
"%04x: %-48s- %s
\n
"
,
x
,
hex
,
txt
);
}
}
...
...
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