fix many compilation warnings about static variables used by non-static functions
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Mon, 18 Apr 2016 18:59:11 +0300
changeset 1479 8f41aa88aa46
parent 1478 69fe0b81e951
child 1480 79e54c5dead5
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;
^
^
targets/plc_debug.c
targets/plc_main_tail.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;
--- 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{