Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
7f20778b
Unverified
Commit
7f20778b
authored
Nov 29, 2019
by
Edward Thomson
Committed by
GitHub
Nov 29, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5311 from pks-t/pks/clar-trace-warning
tests: fix compiler warning if tracing is disabled
parents
61038425
1d470a71
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
tests/clar_libgit2_trace.c
+16
-10
No files found.
tests/clar_libgit2_trace.c
View file @
7f20778b
#include "clar_libgit2.h"
#include "clar_libgit2_trace.h"
#if defined(GIT_TRACE)
#include "clar_libgit2.h"
#include "clar_libgit2_timer.h"
#include "trace.h"
struct
method
{
const
char
*
name
;
void
(
*
git_trace_cb
)(
git_trace_level_t
level
,
const
char
*
msg
);
...
...
@@ -32,7 +34,6 @@ static const char *message_prefix(git_trace_level_t level)
}
}
#if defined(GIT_TRACE)
static
void
_git_trace_cb__printf
(
git_trace_level_t
level
,
const
char
*
msg
)
{
printf
(
"%s%s
\n
"
,
message_prefix
(
level
),
msg
);
...
...
@@ -225,15 +226,11 @@ void _cl_trace_cb__event_handler(
}
}
#endif
/*GIT_TRACE*/
/**
* Setup/Enable git_trace() based upon settings user's environment.
*
*/
void
cl_global_trace_register
(
void
)
{
#if defined(GIT_TRACE)
if
(
!
s_trace_loaded
)
_load_trace_params
();
...
...
@@ -246,7 +243,6 @@ void cl_global_trace_register(void)
git_trace_set
(
s_trace_level
,
s_trace_method
->
git_trace_cb
);
cl_trace_register
(
_cl_trace_cb__event_handler
,
NULL
);
#endif
}
/**
...
...
@@ -258,7 +254,6 @@ void cl_global_trace_register(void)
*/
void
cl_global_trace_disable
(
void
)
{
#if defined(GIT_TRACE)
cl_trace_register
(
NULL
,
NULL
);
git_trace_set
(
GIT_TRACE_NONE
,
NULL
);
if
(
s_trace_method
&&
s_trace_method
->
close
)
...
...
@@ -268,5 +263,16 @@ void cl_global_trace_disable(void)
* since we only want to hit the environment variables
* once.
*/
#endif
}
#else
/* GIT_TRACE */
void
cl_global_trace_register
(
void
)
{
}
void
cl_global_trace_disable
(
void
)
{
}
#endif
/* GIT_TRACE*/
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