From: Tom Hughes Date: Fri, 11 Nov 2005 12:30:36 +0000 (+0000) Subject: Fix compiler warnings. X-Git-Tag: svn/VALGRIND_3_1_0~149 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=06e2ca6cf1553e5d6b3eec3b74fe52b514cc833e;p=thirdparty%2Fvalgrind.git Fix compiler warnings. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5083 --- diff --git a/coregrind/m_debuginfo/dwarf.c b/coregrind/m_debuginfo/dwarf.c index 1d5cc8022a..457c86275f 100644 --- a/coregrind/m_debuginfo/dwarf.c +++ b/coregrind/m_debuginfo/dwarf.c @@ -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; diff --git a/coregrind/m_libcbase.c b/coregrind/m_libcbase.c index 23901f43a4..b420b68713 100644 --- a/coregrind/m_libcbase.c +++ b/coregrind/m_libcbase.c @@ -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; diff --git a/coregrind/m_main.c b/coregrind/m_main.c index ada15bf20b..3cb80f71c8 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -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? */ ); diff --git a/coregrind/m_signals.c b/coregrind/m_signals.c index b1a043f993..80ab4d4ffc 100644 --- a/coregrind/m_signals.c +++ b/coregrind/m_signals.c @@ -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 */ diff --git a/coregrind/m_ume.c b/coregrind/m_ume.c index 61d1a53bdc..6ebd14112c 100644 --- a/coregrind/m_ume.c +++ b/coregrind/m_ume.c @@ -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; } } diff --git a/helgrind/hg_main.c b/helgrind/hg_main.c index 0382726011..9263714e7a 100644 --- a/helgrind/hg_main.c +++ b/helgrind/hg_main.c @@ -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; diff --git a/massif/ms_main.c b/massif/ms_main.c index 3ae8e74394..3c3c99dc19 100644 --- a/massif/ms_main.c +++ b/massif/ms_main.c @@ -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); diff --git a/memcheck/mac_leakcheck.c b/memcheck/mac_leakcheck.c index 4a147fd433..1d9a126159 100644 --- a/memcheck/mac_leakcheck.c +++ b/memcheck/mac_leakcheck.c @@ -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;