From 16c902bc241e4fac41eaa50314f049c82b58c55a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Stawicki?= Date: Tue, 5 Dec 2017 11:57:41 +0100 Subject: [PATCH] Fixed debug macros compilation errors Change-Id: I4c149b3b8a7a66f765bf4446d4cb7af4a1427356 --- scl/gwes/efl/sclgraphics-efl.cpp | 2 +- scl/include/scldebug.h | 4 ++-- scl/scldebug.cpp | 11 +++++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/scl/gwes/efl/sclgraphics-efl.cpp b/scl/gwes/efl/sclgraphics-efl.cpp index 721a85a..1cc88cb 100644 --- a/scl/gwes/efl/sclgraphics-efl.cpp +++ b/scl/gwes/efl/sclgraphics-efl.cpp @@ -274,7 +274,7 @@ CSCLGraphicsImplEfl::draw_image(sclwindow window, const scldrawctx draw_ctx, scl { SCL_DEBUG(); - scl_assert_return(image_path); + scl_assert_return_null(image_path); CSCLResourceCache *cache = CSCLResourceCache::get_instance(); CSCLWindows *windows = CSCLWindows::get_instance(); diff --git a/scl/include/scldebug.h b/scl/include/scldebug.h index c43ffc7..722441b 100644 --- a/scl/include/scldebug.h +++ b/scl/include/scldebug.h @@ -77,7 +77,7 @@ extern "C" #define SCL_DEBUG_ELAPASED_TIME_END() SCL_DEBUG_ELAPASED_TIME(__FILE__, __LINE__, __FUNCTION__, MEASURE_END); //#define SCL_DEBUG() SCL_DEBUG_TIME(__FILE__, __LINE__, __FUNCTION__ ); -#define SCL_DEBUG() NULL; +#define SCL_DEBUG() #define SCL_DEBUG_START() \ static struct timeval t0;\ @@ -89,7 +89,7 @@ extern "C" gettimeofday(&t1, NULL);\ float etime;\ etime = ((t1.tv_sec * 1000000 + t1.tv_usec) - (t0.tv_sec * 1000000 + t0.tv_usec))/1000000.0;\ - printf("[%-20.20s][%04d][%s] E: " mc_green "%f" mc_normal " (S:%u) \n", __FILE__, __LINE__, __FUNCTION__, etime, (t0.tv_sec * 1000000 + t0.tv_usec) ); + printf("[%-20.20s][%04d][%s] E: " mc_green "%f" mc_normal " (S:%lu) \n", __FILE__, __LINE__, __FUNCTION__, etime, (t0.tv_sec * 1000000 + t0.tv_usec) ); #define IO_TEST diff --git a/scl/scldebug.cpp b/scl/scldebug.cpp index 310fc4b..824b08e 100644 --- a/scl/scldebug.cpp +++ b/scl/scldebug.cpp @@ -46,10 +46,11 @@ float SCL_DEBUG_TIME(const char* fileStr, int line, const char* str) if (strncmp(str, "get_", 4) == 0) { //printf("[%-20.20s]%04d [T:%u][E:" mc_red "%f" mc_normal "]" mc_normal " %s" mc_normal "\n", pFileStr, line, (t1.tv_sec * 1000000 + t1.tv_usec), etime, str); } else { - printf("[%-20.20s]%04d [T:%u][E:" mc_red "%f" mc_normal "]" mc_blue " %s" mc_normal "\n", pFileStr, line, (t1.tv_sec * 1000000 + t1.tv_usec), etime, str); + printf("[%-20.20s]%04d [T:%lu][E:" mc_red "%f" mc_normal "]" mc_blue " %s" mc_normal "\n", pFileStr, line, (t1.tv_sec * 1000000 + t1.tv_usec), etime, str); } t0 = t1; } + return etime; } /* Measure elapased time */ @@ -57,7 +58,7 @@ static float _SCL_DEBUG_ELAPASED_TIME(const char* str, struct timeval t0, struct { float etime; etime = ((t1.tv_sec * 1000000 + t1.tv_usec) - (t0.tv_sec * 1000000 + t0.tv_usec))/1000000.0; - printf("[%s] elap-time = " mc_green "%f" mc_normal " (%u~%u) \n", str, etime, (t0.tv_sec * 1000000 + t0.tv_usec), (t1.tv_sec * 1000000 + t1.tv_usec)); + printf("[%s] elap-time = " mc_green "%f" mc_normal " (%lu~%lu) \n", str, etime, (t0.tv_sec * 1000000 + t0.tv_usec), (t1.tv_sec * 1000000 + t1.tv_usec)); return etime; } @@ -68,16 +69,18 @@ float SCL_DEBUG_ELAPASED_TIME(const char* fileStr, int line, const char* str, in static struct timeval s_tv2; static int s_start_line = 0; static int s_end_line = 0; + float etime = 0.0; if (type == MEASURE_START) { gettimeofday(&s_tv1, NULL); s_start_line = line; - printf("[%-20.20s]%04d [T:%u]" mc_blue " %s" mc_normal "\n", fileStr, line, (s_tv1.tv_sec * 1000000 + s_tv1.tv_usec), str); + printf("[%-20.20s]%04d [T:%lu]" mc_blue " %s" mc_normal "\n", fileStr, line, (s_tv1.tv_sec * 1000000 + s_tv1.tv_usec), str); } else if (type == MEASURE_END) { gettimeofday(&s_tv2, NULL); s_end_line = line; char printStr[100]; snprintf(printStr, 100, "%s(Line:%d~%d)", str, s_start_line, s_end_line); - _SCL_DEBUG_ELAPASED_TIME(printStr, s_tv1, s_tv2); + etime = _SCL_DEBUG_ELAPASED_TIME(printStr, s_tv1, s_tv2); } + return etime; } #endif -- 2.7.4