Skip to content

Commit

Permalink
[utils/log] force sign of enum to suppress warning
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao committed Oct 14, 2013
1 parent 0ffbeb1 commit bf683e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion qtcurve-utils/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ _qtcLogV(QtcLogLevel level, const char *fname, int line, const char *func,
const char *fmt, va_list ap)
{
_qtcLogInit();
if (qtcUnlikely(level < log_level || level < 0 || level > QTC_LOG_FORCE))
if (qtcUnlikely(level < log_level || ((int)level) < 0 ||
level > QTC_LOG_FORCE))
return;

static const char *color_codes[] = {
Expand Down
7 changes: 4 additions & 3 deletions qtcurve-utils/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,11 @@ void _qtcLogV(QtcLogLevel level, const char *fname, int line, const char *func,
const char *fmt, va_list ap);

#define qtcLog(__level, fmt, args...) do { \
QtcLogLevel level = (__level); \
if (level < 0 || level > QTC_LOG_FORCE || level < qtcLogLevel) \
unsigned level = (__level); \
if (level > QTC_LOG_FORCE || level < qtcLogLevel) \
break; \
_qtcLog(level, __FILE__, __LINE__, __FUNCTION__, fmt, ##args); \
_qtcLog((QtcLogLevel)level, __FILE__, __LINE__, __FUNCTION__, \
fmt, ##args); \
} while (0)

#define qtcDebug(fmt, args...) \
Expand Down

0 comments on commit bf683e0

Please sign in to comment.