Fixed cast in target code to remove void* arithmetic warning
authorEdouard Tisserant
Thu, 21 Mar 2013 09:27:55 +0900
changeset 991 afc4963d8f0c
parent 990 7f57b969caed
child 992 72ee7f3e3cf3
Fixed cast in target code to remove void* arithmetic warning
targets/plc_main_tail.c
--- a/targets/plc_main_tail.c	Wed Mar 20 23:47:07 2013 +0100
+++ b/targets/plc_main_tail.c	Thu Mar 21 09:27:55 2013 +0900
@@ -28,7 +28,7 @@
     }else{
         uint32_t remaining = LOG_BUFFER_SIZE - buffpos - 1; 
         memcpy(&LogBuff[level][buffpos], buf, remaining);
-        memcpy(LogBuff[level], buf + remaining, size - remaining);
+        memcpy(LogBuff[level], (char*)buf + remaining, size - remaining);
     }
 }
 void inline copy_from_log(uint8_t level, uint32_t buffpos, void* buf, uint32_t size){
@@ -37,7 +37,7 @@
     }else{
         uint32_t remaining = LOG_BUFFER_SIZE - buffpos; 
         memcpy(buf, &LogBuff[level][buffpos], remaining);
-        memcpy(buf + remaining, LogBuff[level], size - remaining);
+        memcpy((char*)buf + remaining, LogBuff[level], size - remaining);
     }
 }
 
@@ -84,7 +84,7 @@
         }while(AtomicCompareExchange64(
             (long long*)&LogCursor[level],
             (long long)old_cursor,
-            (long long)new_cursor)!=old_cursor);
+            (long long)new_cursor)!=(long long)old_cursor);
 
         copy_to_log(level, buffpos, buf, size);
         copy_to_log(level, (buffpos + size) & LOG_BUFFER_MASK, &tail, sizeof(mTail));