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
0e55ba89
Commit
0e55ba89
authored
7 years ago
by
Józef Kucia
Browse files
Options
Downloads
Patches
Plain Diff
libs/vkd3d-common: Use ARRAY_SIZE() macro.
parent
84889646
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libs/vkd3d-common/debug.c
+6
-5
6 additions, 5 deletions
libs/vkd3d-common/debug.c
with
6 additions
and
5 deletions
libs/vkd3d-common/debug.c
+
6
−
5
View file @
0e55ba89
...
...
@@ -25,6 +25,9 @@
#include
<stdlib.h>
#include
<string.h>
#define VKD3D_DEBUG_BUFFER_COUNT 64
#define VKD3D_DEBUG_BUFFER_SIZE 512
static
const
char
*
debug_level_names
[]
=
{
/* VKD3D_DBG_LEVEL_NONE */
"none"
,
...
...
@@ -46,7 +49,7 @@ static enum vkd3d_dbg_level vkd3d_dbg_get_level(void)
if
(
!
(
vkd3d_debug
=
getenv
(
"VKD3D_DEBUG"
)))
vkd3d_debug
=
""
;
for
(
i
=
0
;
i
<
sizeof
(
debug_level_names
)
/
sizeof
(
*
debug_level_names
);
++
i
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
debug_level_names
);
++
i
)
{
if
(
!
strcmp
(
debug_level_names
[
i
],
vkd3d_debug
))
{
...
...
@@ -67,7 +70,7 @@ void vkd3d_dbg_printf(enum vkd3d_dbg_level level, const char *function, const ch
if
(
vkd3d_dbg_get_level
()
<
level
)
return
;
assert
(
level
<=
sizeof
(
debug_level_names
)
/
sizeof
(
*
debug_level_names
));
assert
(
level
<=
ARRAY_SIZE
(
debug_level_names
));
fprintf
(
stderr
,
"%s:%s: "
,
debug_level_names
[
level
],
function
);
va_start
(
args
,
fmt
);
...
...
@@ -75,11 +78,9 @@ void vkd3d_dbg_printf(enum vkd3d_dbg_level level, const char *function, const ch
va_end
(
args
);
}
#define VKD3D_DEBUG_BUFFER_SIZE 512
static
char
*
get_buffer
(
void
)
{
static
char
buffers
[
64
][
VKD3D_DEBUG_BUFFER_SIZE
];
static
char
buffers
[
VKD3D_DEBUG_BUFFER_COUNT
][
VKD3D_DEBUG_BUFFER_SIZE
];
static
LONG
buffer_index
;
LONG
current_index
;
...
...
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