# HG changeset patch # User Andrey Skvortsov # Date 1460995151 -10800 # Node ID 8f41aa88aa46df98c97fc75a7eea1ee1e8d16e5f # Parent 69fe0b81e9519f20272dcd3e0583e7a973559821 fix many compilation warnings about static variables used by non-static functions [CC] plc_main.c -> plc_main.o /tmp/be/build/plc_main.c:396:40: warning: ?LogBuff? is static but used in inline function ?copy_from_log? which is not static memcpy((char*)buf + remaining, LogBuff[level], size - remaining); ^ /tmp/be/build/plc_main.c:395:22: warning: ?LogBuff? is static but used in inline function ?copy_from_log? which is not static memcpy(buf, &LogBuff[level][buffpos], remaining); ^ ... ^ /tmp/be/build/plc_debugger.c:825:20: warning: ?retain_offset? is static but used in inline function ?BufferIterator? which is not static Retain(retain_offset, size, real_value_p); ^ /tmp/be/build/plc_debugger.c:823:47: warning: ?retain_offset? is static but used in inline function ?BufferIterator? which is not static unsigned int next_retain_offset = retain_offset + size; ^ ^ diff -r 69fe0b81e951 -r 8f41aa88aa46 targets/plc_debug.c --- a/targets/plc_debug.c Mon Apr 18 18:56:51 2016 +0300 +++ b/targets/plc_debug.c Mon Apr 18 18:59:11 2016 +0300 @@ -149,7 +149,7 @@ void Retain(unsigned int offset, unsigned int count, void * p); -inline void BufferIterator(dbgvardsc_t *dsc, int do_debug) +static inline void BufferIterator(dbgvardsc_t *dsc, int do_debug) { void *real_value_p = NULL; void *visible_value_p = NULL; diff -r 69fe0b81e951 -r 8f41aa88aa46 targets/plc_main_tail.c --- a/targets/plc_main_tail.c Mon Apr 18 18:56:51 2016 +0300 +++ b/targets/plc_main_tail.c Mon Apr 18 18:59:11 2016 +0300 @@ -16,7 +16,7 @@ #define LOG_BUFFER_MASK (LOG_BUFFER_SIZE-1) static char LogBuff[LOG_LEVELS][LOG_BUFFER_SIZE] LOG_BUFFER_ATTRS; -void inline copy_to_log(uint8_t level, uint32_t buffpos, void* buf, uint32_t size){ +static void inline copy_to_log(uint8_t level, uint32_t buffpos, void* buf, uint32_t size){ if(buffpos + size < LOG_BUFFER_SIZE){ memcpy(&LogBuff[level][buffpos], buf, size); }else{ @@ -25,7 +25,7 @@ memcpy(LogBuff[level], (char*)buf + remaining, size - remaining); } } -void inline copy_from_log(uint8_t level, uint32_t buffpos, void* buf, uint32_t size){ +static void inline copy_from_log(uint8_t level, uint32_t buffpos, void* buf, uint32_t size){ if(buffpos + size < LOG_BUFFER_SIZE){ memcpy(buf, &LogBuff[level][buffpos], size); }else{