Skip to content

Commit

Permalink
refactor: Simplification of output debug messages
Browse files Browse the repository at this point in the history
Close #153.
  • Loading branch information
marktwtn committed May 13, 2019
1 parent a528318 commit 2342bac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
#define __DCURL_MINOR__ 1
#define __DCURL_PATCH__ 0

#if defined(ENABLE_DEBUG)
#define DPRINTF(...) printf(__VA_ARGS__)
#else
#define DPRINTF(...)
#endif

double diff_in_second(struct timespec t1, struct timespec t2);

typedef struct _pow_info PoW_Info;
Expand Down
6 changes: 2 additions & 4 deletions src/implcontext.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ bool registerImplContext(ImplContext *impl_ctx)
bool initializeImplContext(ImplContext *impl_ctx)
{
bool res = impl_ctx->initialize(impl_ctx);
#if defined(ENABLE_DEBUG)
if (res) {
printf(MSG_PREFIX "Implementation %s is initialized successfully\n",
impl_ctx->description);
DPRINTF(MSG_PREFIX "Implementation %s is initialized successfully\n",
impl_ctx->description);
}
#endif
return res;
}

Expand Down

0 comments on commit 2342bac

Please sign in to comment.