Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cmp_tool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dominik Loidolt
cmp_tool
Commits
1ed18eb7
Commit
1ed18eb7
authored
1 year ago
by
Dominik Loidolt
Browse files
Options
Downloads
Patches
Plain Diff
Put files only used for debugging under #if (DEBUGLEVEL > 0)
parent
da685091
No related branches found
No related tags found
1 merge request
!29
Adapt to C standard GNU89 with GCC extensions
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
lib/common/cmp_debug.c
+3
-0
3 additions, 0 deletions
lib/common/cmp_debug.c
lib/common/cmp_debug.h
+7
-3
7 additions, 3 deletions
lib/common/cmp_debug.h
lib/common/vsnprintf.c
+3
-0
3 additions, 0 deletions
lib/common/vsnprintf.c
lib/common/vsnprintf.h
+2
-0
2 additions, 0 deletions
lib/common/vsnprintf.h
with
15 additions
and
3 deletions
lib/common/cmp_debug.c
+
3
−
0
View file @
1ed18eb7
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
* @brief compression/decompression debugging printing functions
* @brief compression/decompression debugging printing functions
*/
*/
#if (DEBUGLEVEL > 0)
#ifndef ICU_ASW
#ifndef ICU_ASW
# include <stdio.h>
# include <stdio.h>
...
@@ -85,3 +86,5 @@ void cmp_debug_print_impl(const char *fmt, ...)
...
@@ -85,3 +86,5 @@ void cmp_debug_print_impl(const char *fmt, ...)
cmp_debug_puts
(
print_buffer
);
cmp_debug_puts
(
print_buffer
);
}
}
#endif
/* (DEBUGLEVEL > 0) */
This diff is collapsed.
Click to expand it.
lib/common/cmp_debug.h
+
7
−
3
View file @
1ed18eb7
...
@@ -23,19 +23,23 @@
...
@@ -23,19 +23,23 @@
/* DEBUGLEVEL should be externally defined, usually via the compiler command
/* DEBUGLEVEL should be externally defined, usually via the compiler command
* line. Its value must be a numeric value. */
* line. Its value must be a numeric value. */
#ifndef DEBUGLEVEL
#ifndef DEBUGLEVEL
# ifdef DEBUG
# define DEBUGLEVEL 1
# else
# define DEBUGLEVEL 0
# define DEBUGLEVEL 0
# endif
# endif
#endif
#define PRINT_BUFFER_SIZE 256
#define PRINT_BUFFER_SIZE 256
__extension__
__extension__
#if (
defined(DEBUG) ||
DEBUGLEVEL > 0)
#if (DEBUGLEVEL > 0)
# define debug_print(...) cmp_debug_print_impl(__VA_ARGS__)
# define debug_print(...) cmp_debug_print_impl(__VA_ARGS__)
void
cmp_debug_print_impl
(
const
char
*
fmt
,
...);
#else
#else
# define debug_print(...) do {} while (0)
# define debug_print(...) do {} while (0)
#endif
#endif
void
cmp_debug_print_impl
(
const
char
*
fmt
,
...);
#endif
/* CMP_DEBUG_H */
#endif
/* CMP_DEBUG_H */
This diff is collapsed.
Click to expand it.
lib/common/vsnprintf.c
+
3
−
0
View file @
1ed18eb7
...
@@ -27,6 +27,8 @@
...
@@ -27,6 +27,8 @@
* reentrant!
* reentrant!
*/
*/
#if (DEBUGLEVEL > 0)
#include
<stdbool.h>
#include
<stdbool.h>
#include
<stdint.h>
#include
<stdint.h>
#include
<stddef.h>
#include
<stddef.h>
...
@@ -883,3 +885,4 @@ int my_vsnprintf(char* buffer, size_t count, const char* format, va_list va)
...
@@ -883,3 +885,4 @@ int my_vsnprintf(char* buffer, size_t count, const char* format, va_list va)
return
_vsnprintf
(
_out_buffer
,
buffer
,
count
,
format
,
va
);
return
_vsnprintf
(
_out_buffer
,
buffer
,
count
,
format
,
va
);
}
}
#endif
/* (DEBUGLEVEL > 0) */
This diff is collapsed.
Click to expand it.
lib/common/vsnprintf.h
+
2
−
0
View file @
1ed18eb7
...
@@ -20,6 +20,8 @@
...
@@ -20,6 +20,8 @@
#ifndef VSNPRINTF_H
#ifndef VSNPRINTF_H
#define VSNPRINTF_H
#define VSNPRINTF_H
#if (DEBUGLEVEL > 0)
int
my_vsnprintf
(
char
*
buffer
,
size_t
count
,
const
char
*
format
,
va_list
va
);
int
my_vsnprintf
(
char
*
buffer
,
size_t
count
,
const
char
*
format
,
va_list
va
);
#endif
#endif
/* VSNPRINTF_H */
#endif
/* VSNPRINTF_H */
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