Browse Source

applog - force type checking

nfactor-troky
Kano 12 years ago
parent
commit
8f08a327ca
  1. 10
      cgminer.c
  2. 2
      logging.c
  3. 9
      logging.h

10
cgminer.c

@ -6487,10 +6487,14 @@ static void clean_up(void) @@ -6487,10 +6487,14 @@ static void clean_up(void)
void quit(int status, const char *format, ...)
{
clean_up();
if (format) {
va_list ap;
va_start(ap, format);
vapplog(LOG_ERR, format, ap);
va_end(ap);
}
if (format)
log_error(format);
clean_up();
#if defined(unix)
if (forkpid > 0) {

2
logging.c

@ -53,7 +53,7 @@ void vapplog(int prio, const char *fmt, va_list ap) @@ -53,7 +53,7 @@ void vapplog(int prio, const char *fmt, va_list ap)
log_generic(prio, fmt, ap);
}
void applog(int prio, const char *fmt, ...)
void _applog(int prio, const char *fmt, ...)
{
va_list ap;

9
logging.h

@ -28,7 +28,14 @@ extern int opt_log_level; @@ -28,7 +28,14 @@ extern int opt_log_level;
/* low-level logging functions with priority parameter */
extern void vapplog(int prio, const char *fmt, va_list ap);
extern void applog(int prio, const char *fmt, ...);
extern void _applog(int prio, const char *fmt, ...);
#define applog(prio, fmt, ...) do { \
char *tmp42; \
if (0) \
sprintf(tmp42, fmt, ##__VA_ARGS__); \
else \
_applog(prio, fmt, ##__VA_ARGS__); \
} while (0)
/* high-level logging functions with implicit priority */
extern void log_error(const char *fmt, ...);

Loading…
Cancel
Save