Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
vkd3d
Manage
Activity
Members
Labels
Plan
Wiki
Bugzilla
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wine
vkd3d
Commits
7be0b64a
Commit
7be0b64a
authored
7 years ago
by
Józef Kucia
Browse files
Options
Downloads
Patches
Plain Diff
libs/vkd3d-common: Add debugstr_a() function.
parent
31c6bfe2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/private/vkd3d_debug.h
+1
-0
1 addition, 0 deletions
include/private/vkd3d_debug.h
libs/vkd3d-common/debug.c
+60
-0
60 additions, 0 deletions
libs/vkd3d-common/debug.c
with
61 additions
and
0 deletions
include/private/vkd3d_debug.h
+
1
−
0
View file @
7be0b64a
...
...
@@ -34,6 +34,7 @@ void vkd3d_dbg_printf(enum vkd3d_dbg_level level, const char *function,
const
char
*
fmt
,
...)
VKD3D_PRINTF_FUNC
(
3
,
4
)
DECLSPEC_HIDDEN
;
const
char
*
vkd3d_dbg_sprintf
(
const
char
*
fmt
,
...)
VKD3D_PRINTF_FUNC
(
1
,
2
)
DECLSPEC_HIDDEN
;
const
char
*
debugstr_a
(
const
char
*
str
)
DECLSPEC_HIDDEN
;
const
char
*
debugstr_w
(
const
WCHAR
*
wstr
)
DECLSPEC_HIDDEN
;
#define VKD3D_DBG_LOG(level) \
...
...
This diff is collapsed.
Click to expand it.
libs/vkd3d-common/debug.c
+
60
−
0
View file @
7be0b64a
...
...
@@ -103,6 +103,66 @@ const char *vkd3d_dbg_sprintf(const char *fmt, ...)
return
buffer
;
}
const
char
*
debugstr_a
(
const
char
*
str
)
{
char
*
buffer
,
*
ptr
;
char
c
;
if
(
!
str
)
return
"(null)"
;
ptr
=
buffer
=
get_buffer
();
*
ptr
++
=
'"'
;
while
((
c
=
*
str
++
)
&&
ptr
<=
buffer
+
VKD3D_DEBUG_BUFFER_SIZE
-
8
)
{
int
escape_char
;
switch
(
c
)
{
case
'"'
:
case
'\\'
:
case
'\n'
:
case
'\r'
:
case
'\t'
:
escape_char
=
c
;
break
;
default:
escape_char
=
0
;
break
;
}
if
(
escape_char
)
{
*
ptr
++
=
'\\'
;
*
ptr
++
=
escape_char
;
continue
;
}
if
(
isprint
(
c
))
{
*
ptr
++
=
c
;
}
else
{
*
ptr
++
=
'\\'
;
sprintf
(
ptr
,
"%02x"
,
c
);
ptr
+=
2
;
}
}
*
ptr
++
=
'"'
;
if
(
c
)
{
*
ptr
++
=
'.'
;
*
ptr
++
=
'.'
;
*
ptr
++
=
'.'
;
}
*
ptr
=
'\0'
;
return
buffer
;
}
const
char
*
debugstr_w
(
const
WCHAR
*
wstr
)
{
char
*
buffer
,
*
ptr
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment