From b6c71dc8e729a9d07d33713d74bc72e6fd5d4819 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jul 2011 13:33:11 +0200 Subject: [PATCH 1/1] No need to have difference between win32 and Unix system for log. --- include/xbt/log.h | 21 +++------------------ src/xbt/log.c | 4 ---- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/include/xbt/log.h b/include/xbt/log.h index 8ffe99f9c2..d80ba1ea88 100644 --- a/include/xbt/log.h +++ b/include/xbt/log.h @@ -27,12 +27,8 @@ /* XBT_LOG_MAYDAY: define this to replace the logging facilities with basic printf function. Useful to debug the logging facilities themselves */ -#include "gras_config.h" #undef XBT_LOG_MAYDAY //#define XBT_LOG_MAYDAY -#ifdef _WIN64 - #define XBT_LOG_MAYDAY -#endif #ifndef _XBT_LOG_H_ #define _XBT_LOG_H_ @@ -245,11 +241,9 @@ typedef struct xbt_log_category_s s_xbt_log_category_t, /* * Do NOT access any members of this structure directly. FIXME: move to private? */ -#ifdef _XBT_WIN32 -#define XBT_LOG_BUFF_SIZE 16384 /* Size of the static string in which we build the log string */ -#else + #define XBT_LOG_BUFF_SIZE 2048 /* Size of the static string in which we build the log string */ -#endif + struct xbt_log_category_s { xbt_log_category_t parent; xbt_log_category_t firstChild; @@ -270,11 +264,7 @@ struct xbt_log_event_s { int lineNum; va_list ap; va_list ap_copy; /* need a copy to launch dynamic layouts when the static ones overflowed */ -#ifdef _XBT_WIN32 - char *buffer; -#else char buffer[XBT_LOG_BUFF_SIZE]; -#endif }; /** @@ -393,15 +383,10 @@ extern xbt_log_layout_t xbt_log_default_layout; * code. * Setting the LogEvent's valist member is done inside _log_logEvent. */ -#ifdef _XBT_WIN32 -#include /* calloc */ -#define _XBT_LOG_EV_BUFFER_ZERO() \ - _log_ev.buffer = (char*) calloc(XBT_LOG_BUFF_SIZE + 1, sizeof(char)) -#else + #include /* memset */ #define _XBT_LOG_EV_BUFFER_ZERO() \ memset(_log_ev.buffer, 0, XBT_LOG_BUFF_SIZE) -#endif /* Logging Macros */ diff --git a/src/xbt/log.c b/src/xbt/log.c index e4030ef62a..6915419132 100644 --- a/src/xbt/log.c +++ b/src/xbt/log.c @@ -626,10 +626,6 @@ void _xbt_log_event_log(xbt_log_event_t ev, const char *fmt, ...) } va_end(ev->ap); va_end(ev->ap_copy); - -#ifdef _XBT_WIN32 - free(ev->buffer); -#endif } /* NOTE: -- 2.20.1