]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix compiler warnings.
authorTom Hughes <tom@compton.nu>
Fri, 11 Nov 2005 12:30:36 +0000 (12:30 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 11 Nov 2005 12:30:36 +0000 (12:30 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5083

coregrind/m_debuginfo/dwarf.c
coregrind/m_libcbase.c
coregrind/m_main.c
coregrind/m_signals.c
coregrind/m_ume.c
helgrind/hg_main.c
massif/ms_main.c
memcheck/mac_leakcheck.c

index 1d5cc8022a7dffe946f20d6e0a0635ebd870b3d7..457c86275f87850fed5bacd9b7323e0565c920ab 100644 (file)
@@ -1716,7 +1716,7 @@ static UChar read_UChar ( UChar* data )
    return data[0];
 }
 
-static UChar default_Addr_encoding ()
+static UChar default_Addr_encoding ( void )
 {
    switch (sizeof(Addr)) {
       case 4: return DW_EH_PE_udata4;
index 23901f43a405d1b9ac62f1d7454740e8c012aefe..b420b687133bdad61117e1bc95b44e6d7df2d468 100644 (file)
@@ -382,14 +382,16 @@ void* VG_(memset) ( void *dest, Int c, SizeT sz )
 Int VG_(memcmp) ( const void* s1, const void* s2, SizeT n )
 {
    Int res;
+   const UChar *p1 = s1;
+   const UChar *p2 = s2;
    UChar a0;
    UChar b0;
 
    while (n != 0) {
-      a0 = ((UChar *) s1)[0];
-      b0 = ((UChar *) s2)[0];
-      s1 += 1;
-      s2 += 1;
+      a0 = p1[0];
+      b0 = p2[0];
+      p1 += 1;
+      p2 += 1;
       res = a0 - b0;
       if (res != 0)
          return res;
index ada15bf20b2f50e2c7dc1ae0b4c1aceafed0ba7f..3cb80f71c80bea8d9ea2ca34b56fcb6f554da59b 100644 (file)
@@ -2407,7 +2407,7 @@ Int main(Int argc, HChar **argv, HChar **envp)
      /* Also the assembly helpers. */
      VG_TRACK( new_mem_startup,
                (Addr)&VG_(trampoline_stuff_start),
-               &VG_(trampoline_stuff_end) - &VG_(trampoline_stuff_start),
+               (Addr)&VG_(trampoline_stuff_end) - (Addr)&VG_(trampoline_stuff_start),
                False, /* readable? */
                False, /* writable? */
                True   /* executable? */ );
index b1a043f99340dbc578be22295e19f6fd847898ef..80ab4d4ffcb25b260982228ee89c4f4df923a57e 100644 (file)
@@ -831,7 +831,7 @@ void push_signal_frame ( ThreadId tid, const vki_siginfo_t *siginfo )
                      "delivering signal %d (%s) to thread %d: on ALT STACK (%p-%p; %d bytes)", 
                      sigNo, signame(sigNo), tid, 
                      tst->altstack.ss_sp,
-                     tst->altstack.ss_sp + tst->altstack.ss_size,
+                     (UChar *)tst->altstack.ss_sp + tst->altstack.ss_size,
                      tst->altstack.ss_size );
 
       /* Signal delivery to tools */
index 61d1a53bdc2c86754bb5c06354d25666babfd7d4..6ebd14112c51948f308c4507e52b60221e153459 100644 (file)
@@ -425,8 +425,8 @@ static Int load_ELF(Int fd, const char *name, /*MOD*/struct exeinfo *info)
           maxaddr + ebase > info->exe_end)) {
         VG_(printf)("Executable range %p-%p is outside the\n"
                      "acceptable range %p-%p\n",
-                     (void *)minaddr + ebase, (void *)maxaddr + ebase,
-                     (void *)info->exe_base,  (void *)info->exe_end);
+                     (char *)minaddr + ebase, (char *)maxaddr + ebase,
+                     (char *)info->exe_base,  (char *)info->exe_end);
         return VKI_ENOMEM;
       }
    }
index 0382726011bae2945407e8b7c38f7ed5a403c8c4..9263714e7a810d1a39452c1e05585e1c11913683 100644 (file)
@@ -1345,7 +1345,7 @@ static const Char *pp_MutexState(MutexState st)
    return "???";
 }
 
-static void pp_all_mutexes()
+static void pp_all_mutexes(void)
 {
    Int i;
    Int locks, buckets;
index 3ae8e74394c331fb851d6998da2b2661baf55678..3c3c99dc19d00e8c7e55ba7e4a774cee91123cdf 100644 (file)
@@ -1779,7 +1779,7 @@ static void ms_post_clo_init(void)
    hp_census();
 }
 
-static void ms_pre_clo_init()
+static void ms_pre_clo_init(void)
 { 
    VG_(details_name)            ("Massif");
    VG_(details_version)         (NULL);
index 4a147fd4337b00b0107f448582fea273ad020776..1d9a1261594767cde43d24f622ce9792fe8ee965 100644 (file)
@@ -637,7 +637,7 @@ static void full_report(ThreadId tid)
 }
 
 /* Compute a quick summary of the leak check. */
-static void make_summary()
+static void make_summary(void)
 {
    Int i;