[compiler-rt] r253770 - Fix -Wpointer-sign warning

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 20 23:26:47 PST 2015


Author: davidxl
Date: Sat Nov 21 01:26:46 2015
New Revision: 253770

URL: http://llvm.org/viewvc/llvm-project?rev=253770&view=rev
Log:
Fix -Wpointer-sign warning

Modified:
    compiler-rt/trunk/lib/profile/InstrProfilingInternal.h
    compiler-rt/trunk/lib/profile/InstrProfilingWriter.c

Modified: compiler-rt/trunk/lib/profile/InstrProfilingInternal.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingInternal.h?rev=253770&r1=253769&r2=253770&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingInternal.h (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingInternal.h Sat Nov 21 01:26:46 2015
@@ -42,7 +42,7 @@ int __llvm_profile_write_buffer_internal
  * This is an internal function not intended to be used externally.
  */
 typedef struct ProfDataIOVec {
-  const char *Data;
+  const void *Data;
   size_t ElmSize;
   size_t NumElm;
 } ProfDataIOVec;

Modified: compiler-rt/trunk/lib/profile/InstrProfilingWriter.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingWriter.c?rev=253770&r1=253769&r2=253770&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingWriter.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingWriter.c Sat Nov 21 01:26:46 2015
@@ -60,11 +60,11 @@ __attribute__((visibility("hidden"))) in
 
   /* Write the data. */
   ProfDataIOVec IOVec[] = {
-      {(const char *)&Header, sizeof(__llvm_profile_header), 1},
-      {(const char *)DataBegin, sizeof(__llvm_profile_data), DataSize},
-      {(const char *)CountersBegin, sizeof(uint64_t), CountersSize},
-      {(const char *)NamesBegin, sizeof(char), NamesSize},
-      {(const char *)Zeroes, sizeof(char), Padding}};
+      {&Header, sizeof(__llvm_profile_header), 1},
+      {DataBegin, sizeof(__llvm_profile_data), DataSize},
+      {CountersBegin, sizeof(uint64_t), CountersSize},
+      {NamesBegin, sizeof(char), NamesSize},
+      {Zeroes, sizeof(char), Padding}};
   if (Writer(IOVec, sizeof(IOVec) / sizeof(ProfDataIOVec), &WriterCtx))
     return -1;
   if (ValueDataBegin) {




More information about the llvm-commits mailing list