From: Nicholas Nethercote Date: Tue, 24 Feb 2009 03:07:37 +0000 (+0000) Subject: Remove a number of unused parameters, found with -Wunused-parameter. X-Git-Tag: svn/VALGRIND_3_5_0~929 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5aac956e64430571350cd4493bf6e93879a67014;p=thirdparty%2Fvalgrind.git Remove a number of unused parameters, found with -Wunused-parameter. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9248 --- diff --git a/coregrind/m_debuginfo/readdwarf.c b/coregrind/m_debuginfo/readdwarf.c index 659bab237d..3a23e35544 100644 --- a/coregrind/m_debuginfo/readdwarf.c +++ b/coregrind/m_debuginfo/readdwarf.c @@ -960,8 +960,7 @@ static void read_unitinfo_dwarf2( /*OUT*/UnitInfo* ui, UChar* unitblock_img, UChar* debugabbrev_img, - UChar* debugstr_img, - struct _DebugInfo* di ) + UChar* debugstr_img ) { UInt acode, abcode; ULong atoffs, blklen; @@ -1177,7 +1176,7 @@ void ML_(read_debuginfo_dwarf3) VG_(printf)( "Reading UnitInfo at 0x%lx.....\n", block_img - debug_info_img + 0UL ); read_unitinfo_dwarf2( &ui, block_img, - debug_abbv_img, debug_str_img, di ); + debug_abbv_img, debug_str_img ); if (0) VG_(printf)( " => LINES=0x%llx NAME=%s DIR=%s\n", ui.stmt_list, ui.name, ui.compdir ); diff --git a/coregrind/m_demangle/cplus-dem.c b/coregrind/m_demangle/cplus-dem.c index f69004fffe..e89db663da 100644 --- a/coregrind/m_demangle/cplus-dem.c +++ b/coregrind/m_demangle/cplus-dem.c @@ -371,8 +371,7 @@ demangle_template (struct work_stuff *work, const char **, string *, string *, int, int); static int -arm_pt (struct work_stuff *, const char *, int, const char **, - const char **); +arm_pt (const char *, int, const char **, const char **); static int demangle_class_name (struct work_stuff *, const char **, string *); @@ -2158,7 +2157,7 @@ demangle_template (struct work_stuff *work, const char **mangled, } static int -arm_pt (struct work_stuff *work, const char *mangled, +arm_pt (const char *mangled, int n, const char **anchor, const char **args) { /* Check if ARM template with "__pt__" in it ("parameterized type") */ @@ -2294,7 +2293,7 @@ demangle_arm_hp_template (struct work_stuff *work, const char **mangled, return; } /* ARM template? (Also handles HP cfront extensions) */ - else if (arm_pt (work, *mangled, n, &p, &args)) + else if (arm_pt (*mangled, n, &p, &args)) { int hold_options; string type_str; diff --git a/coregrind/m_main.c b/coregrind/m_main.c index c8f015ef6e..8322da59c4 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -304,8 +304,7 @@ static void early_process_cmd_line_options ( /*OUT*/Int* need_help, /* The main processing for command line options. See comments above on early_process_cmd_line_options. */ -static Bool main_process_cmd_line_options( UInt* client_auxv, - const HChar* toolname ) +static Bool main_process_cmd_line_options( const HChar* toolname ) { // VG_(clo_log_fd) is used by all the messaging. It starts as 2 (stderr) // and we cannot change it until we know what we are changing it to is @@ -1182,7 +1181,6 @@ Int valgrind_main ( Int argc, HChar **argv, HChar **envp ) { HChar* toolname = "memcheck"; // default to Memcheck Int need_help = 0; // 0 = no, 1 = --help, 2 = --help-debug - UInt* client_auxv = NULL; ThreadId tid_main = VG_INVALID_THREADID; Int loglevel, i; Bool logging_to_fd; @@ -1625,7 +1623,7 @@ Int valgrind_main ( Int argc, HChar **argv, HChar **envp ) VG_(debugLog)(1, "main", "(main_) Process Valgrind's command line options, " "setup logging\n"); - logging_to_fd = main_process_cmd_line_options(client_auxv, toolname); + logging_to_fd = main_process_cmd_line_options(toolname); //-------------------------------------------------------------- // Zeroise the millisecond counter by doing a first read of it. diff --git a/coregrind/m_mallocfree.c b/coregrind/m_mallocfree.c index e31a3b7221..c84395aaf7 100644 --- a/coregrind/m_mallocfree.c +++ b/coregrind/m_mallocfree.c @@ -402,25 +402,25 @@ Block* get_predecessor_block ( Block* b ) // Read and write the lower and upper red-zone bytes of a block. static __inline__ -void set_rz_lo_byte ( Arena* a, Block* b, UInt rz_byteno, UByte v ) +void set_rz_lo_byte ( Block* b, UInt rz_byteno, UByte v ) { UByte* b2 = (UByte*)b; b2[hp_overhead_szB() + sizeof(SizeT) + rz_byteno] = v; } static __inline__ -void set_rz_hi_byte ( Arena* a, Block* b, UInt rz_byteno, UByte v ) +void set_rz_hi_byte ( Block* b, UInt rz_byteno, UByte v ) { UByte* b2 = (UByte*)b; b2[get_bszB(b) - sizeof(SizeT) - rz_byteno - 1] = v; } static __inline__ -UByte get_rz_lo_byte ( Arena* a, Block* b, UInt rz_byteno ) +UByte get_rz_lo_byte ( Block* b, UInt rz_byteno ) { UByte* b2 = (UByte*)b; return b2[hp_overhead_szB() + sizeof(SizeT) + rz_byteno]; } static __inline__ -UByte get_rz_hi_byte ( Arena* a, Block* b, UInt rz_byteno ) +UByte get_rz_hi_byte ( Block* b, UInt rz_byteno ) { UByte* b2 = (UByte*)b; return b2[get_bszB(b) - sizeof(SizeT) - rz_byteno - 1]; @@ -888,10 +888,10 @@ Bool blockSane ( Arena* a, Block* b ) // to get_rz_hi_byte(). if (!a->clientmem && is_inuse_block(b)) { for (i = 0; i < a->rz_szB; i++) { - if (get_rz_lo_byte(a, b, i) != + if (get_rz_lo_byte(b, i) != (UByte)(((Addr)b&0xff) ^ REDZONE_LO_MASK)) {BLEAT("redzone-lo");return False;} - if (get_rz_hi_byte(a, b, i) != + if (get_rz_hi_byte(b, i) != (UByte)(((Addr)b&0xff) ^ REDZONE_HI_MASK)) {BLEAT("redzone-hi");return False;} } @@ -1213,8 +1213,8 @@ void mkInuseBlock ( Arena* a, Block* b, SizeT bszB ) set_next_b(b, NULL); // ditto if (!a->clientmem) { for (i = 0; i < a->rz_szB; i++) { - set_rz_lo_byte(a, b, i, (UByte)(((Addr)b&0xff) ^ REDZONE_LO_MASK)); - set_rz_hi_byte(a, b, i, (UByte)(((Addr)b&0xff) ^ REDZONE_HI_MASK)); + set_rz_lo_byte(b, i, (UByte)(((Addr)b&0xff) ^ REDZONE_LO_MASK)); + set_rz_hi_byte(b, i, (UByte)(((Addr)b&0xff) ^ REDZONE_HI_MASK)); } } # ifdef DEBUG_MALLOC diff --git a/coregrind/m_scheduler/scheduler.c b/coregrind/m_scheduler/scheduler.c index 7176f30f73..bcfd53a619 100644 --- a/coregrind/m_scheduler/scheduler.c +++ b/coregrind/m_scheduler/scheduler.c @@ -332,7 +332,7 @@ void VG_(vg_yield)(void) /* Set the standard set of blocked signals, used whenever we're not running a client syscall. */ -static void block_signals(ThreadId tid) +static void block_signals(void) { vki_sigset_t mask; @@ -682,7 +682,7 @@ static UInt run_thread_for_a_while ( ThreadId tid ) handler to longjmp. */ vg_assert(trc == 0); trc = VG_TRC_FAULT_SIGNAL; - block_signals(tid); + block_signals(); } done_this_time = (Int)dispatch_ctr_SAVED - (Int)VG_(dispatch_ctr) - 0; @@ -758,7 +758,7 @@ static UInt run_noredir_translation ( Addr hcode, ThreadId tid ) handler to longjmp. */ vg_assert(argblock[2] == 0); /* next guest IP was not written */ vg_assert(argblock[3] == 0); /* trc was not written */ - block_signals(tid); + block_signals(); retval = VG_TRC_FAULT_SIGNAL; } else { /* store away the guest program counter */ @@ -832,7 +832,7 @@ static void handle_syscall(ThreadId tid) vg_assert(VG_(is_running_thread)(tid)); if (jumped) { - block_signals(tid); + block_signals(); VG_(poll_signals)(tid); } } @@ -888,7 +888,7 @@ VgSchedReturnCode VG_(scheduler) ( ThreadId tid ) print_sched_event(tid, "entering VG_(scheduler)"); /* set the proper running signal mask */ - block_signals(tid); + block_signals(); vg_assert(VG_(is_running_thread)(tid)); diff --git a/coregrind/m_sigframe/sigframe-x86-linux.c b/coregrind/m_sigframe/sigframe-x86-linux.c index 450a1c3ae1..093034885e 100644 --- a/coregrind/m_sigframe/sigframe-x86-linux.c +++ b/coregrind/m_sigframe/sigframe-x86-linux.c @@ -438,7 +438,6 @@ static Bool extend ( ThreadState *tst, Addr addr, SizeT size ) static void build_vg_sigframe(struct vg_sigframe *frame, ThreadState *tst, - const vki_sigset_t *mask, UInt flags, Int sigNo) { @@ -459,7 +458,7 @@ static Addr build_sigframe(ThreadState *tst, Addr esp_top_of_frame, const vki_siginfo_t *siginfo, const struct vki_ucontext *siguc, - void *handler, UInt flags, + UInt flags, const vki_sigset_t *mask, void *restorer) { @@ -507,7 +506,7 @@ static Addr build_sigframe(ThreadState *tst, VG_TRACK( post_mem_write, Vg_CoreSignal, tst->tid, esp, offsetof(struct sigframe, vg) ); - build_vg_sigframe(&frame->vg, tst, mask, flags, sigNo); + build_vg_sigframe(&frame->vg, tst, flags, sigNo); return esp; } @@ -517,7 +516,7 @@ static Addr build_rt_sigframe(ThreadState *tst, Addr esp_top_of_frame, const vki_siginfo_t *siginfo, const struct vki_ucontext *siguc, - void *handler, UInt flags, + UInt flags, const vki_sigset_t *mask, void *restorer) { @@ -570,7 +569,7 @@ static Addr build_rt_sigframe(ThreadState *tst, VG_TRACK( post_mem_write, Vg_CoreSignal, tst->tid, esp, offsetof(struct rt_sigframe, vg) ); - build_vg_sigframe(&frame->vg, tst, mask, flags, sigNo); + build_vg_sigframe(&frame->vg, tst, flags, sigNo); return esp; } @@ -591,10 +590,10 @@ void VG_(sigframe_create)( ThreadId tid, if (flags & VKI_SA_SIGINFO) esp = build_rt_sigframe(tst, esp_top_of_frame, siginfo, siguc, - handler, flags, mask, restorer); + flags, mask, restorer); else esp = build_sigframe(tst, esp_top_of_frame, siginfo, siguc, - handler, flags, mask, restorer); + flags, mask, restorer); /* Set the thread so it will next run the handler. */ /* tst->m_esp = esp; also notify the tool we've updated ESP */ diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c index 0583b0076c..ca07ffe22e 100644 --- a/coregrind/m_syswrap/syswrap-generic.c +++ b/coregrind/m_syswrap/syswrap-generic.c @@ -65,8 +65,7 @@ static void notify_aspacem_of_mmap(Addr a, SizeT len, UInt prot, UInt flags, Int fd, Off64T offset); static -void notify_tool_of_mmap(Addr a, SizeT len, UInt prot, Off64T offset, - ULong di_handle); +void notify_tool_of_mmap(Addr a, SizeT len, UInt prot, ULong di_handle); /* Returns True iff address range is something the client can @@ -167,7 +166,7 @@ ML_(notify_aspacem_and_tool_of_mmap) ( Addr a, SizeT len, UInt prot, UInt flags, Int fd, Off64T offset ) { notify_aspacem_of_mmap(a, len, prot, flags, fd, offset); - notify_tool_of_mmap(a, len, prot, offset, 0/*di_handle*/); + notify_tool_of_mmap(a, len, prot, 0/*di_handle*/); } static @@ -189,8 +188,7 @@ void notify_aspacem_of_mmap(Addr a, SizeT len, UInt prot, } static -void notify_tool_of_mmap(Addr a, SizeT len, UInt prot, Off64T offset, - ULong di_handle) +void notify_tool_of_mmap(Addr a, SizeT len, UInt prot, ULong di_handle) { Bool rr, ww, xx; @@ -504,7 +502,7 @@ static Int fd_count = 0; /* Note the fact that a file descriptor was just closed. */ static -void record_fd_close(ThreadId tid, Int fd) +void record_fd_close(Int fd) { OpenFd *i = allocated_fds; @@ -1917,7 +1915,6 @@ ML_(generic_PRE_sys_mmap) ( ThreadId tid, (Addr)sres.res, /* addr kernel actually assigned */ arg2, /* length */ arg3, /* prot */ - arg6, /* offset */ di_handle /* so the tool can refer to the read debuginfo later, if it wants. */ ); @@ -2692,7 +2689,7 @@ PRE(sys_close) POST(sys_close) { - if (VG_(clo_track_fds)) record_fd_close(tid, ARG1); + if (VG_(clo_track_fds)) record_fd_close(ARG1); } PRE(sys_dup) diff --git a/coregrind/m_syswrap/syswrap-main.c b/coregrind/m_syswrap/syswrap-main.c index 3e6abd231a..8b76ea384f 100644 --- a/coregrind/m_syswrap/syswrap-main.c +++ b/coregrind/m_syswrap/syswrap-main.c @@ -736,7 +736,7 @@ static const SyscallTableEntry* get_syscall_entry ( UInt syscallno ) /* Add and remove signals from mask so that we end up telling the kernel the state we actually want rather than what the client wants. */ -static void sanitize_client_sigmask(ThreadId tid, vki_sigset_t *mask) +static void sanitize_client_sigmask(vki_sigset_t *mask) { VG_(sigdelset)(mask, VKI_SIGKILL); VG_(sigdelset)(mask, VKI_SIGSTOP); @@ -1013,7 +1013,7 @@ void VG_(client_syscall) ( ThreadId tid ) PRINT(" --> [async] ... \n"); mask = tst->sig_mask; - sanitize_client_sigmask(tid, &mask); + sanitize_client_sigmask(&mask); /* Gack. More impedance matching. Copy the possibly modified syscall args back into the guest state. */ diff --git a/coregrind/m_translate.c b/coregrind/m_translate.c index b5f346d14d..2f39f41ea2 100644 --- a/coregrind/m_translate.c +++ b/coregrind/m_translate.c @@ -1547,8 +1547,7 @@ Bool VG_(translate) ( ThreadId tid, VG_(add_to_unredir_transtab)( &vge, nraddr, (Addr)(&tmpbuf[0]), - tmpbuf_used, - do_self_check ); + tmpbuf_used ); } } diff --git a/coregrind/m_transtab.c b/coregrind/m_transtab.c index c051ae76d4..5e67128bba 100644 --- a/coregrind/m_transtab.c +++ b/coregrind/m_transtab.c @@ -1350,8 +1350,7 @@ static Bool sanity_check_redir_tt_tc ( void ) void VG_(add_to_unredir_transtab)( VexGuestExtents* vge, Addr64 entry, AddrH code, - UInt code_len, - Bool is_self_checking ) + UInt code_len ) { Int i, j, code_szQ; HChar *srcP, *dstP; diff --git a/coregrind/pub_core_transtab.h b/coregrind/pub_core_transtab.h index 73f3863f9d..a2c45d8cdd 100644 --- a/coregrind/pub_core_transtab.h +++ b/coregrind/pub_core_transtab.h @@ -83,8 +83,7 @@ extern void VG_(add_to_unredir_transtab)( VexGuestExtents* vge, Addr64 entry, AddrH code, - UInt code_len, - Bool is_self_checking ); + UInt code_len ); extern Bool VG_(search_unredir_transtab) ( /*OUT*/AddrH* result, Addr64 guest_addr ); diff --git a/memcheck/mc_errors.c b/memcheck/mc_errors.c index 33dcc266f3..e7fcd87184 100644 --- a/memcheck/mc_errors.c +++ b/memcheck/mc_errors.c @@ -715,9 +715,8 @@ void MC_(record_cond_error) ( ThreadId tid, UInt otag ) /* --- Called from non-generated code --- */ -/* This is for memory errors in pthread functions, as opposed to pthread API - errors which are found by the core. */ -void MC_(record_core_mem_error) ( ThreadId tid, Bool isAddrErr, Char* msg ) +/* This is for memory errors in signal-related memory. */ +void MC_(record_core_mem_error) ( ThreadId tid, Char* msg ) { VG_(maybe_record_error)( tid, Err_CoreMem, /*addr*/0, msg, /*extra*/NULL ); } diff --git a/memcheck/mc_include.h b/memcheck/mc_include.h index ddc441b979..851929820c 100644 --- a/memcheck/mc_include.h +++ b/memcheck/mc_include.h @@ -79,7 +79,7 @@ typedef void* MC_(new_block) ( ThreadId tid, - Addr p, SizeT size, SizeT align, UInt rzB, + Addr p, SizeT size, SizeT align, Bool is_zeroed, MC_AllocKind kind, VgHashTable table); void MC_(handle_free) ( ThreadId tid, @@ -322,7 +322,7 @@ void MC_(record_freemismatch_error) ( ThreadId tid, MC_Chunk* mc ); void MC_(record_overlap_error) ( ThreadId tid, Char* function, Addr src, Addr dst, SizeT szB ); -void MC_(record_core_mem_error) ( ThreadId tid, Bool isAddrErr, Char* msg ); +void MC_(record_core_mem_error) ( ThreadId tid, Char* msg ); void MC_(record_regparam_error) ( ThreadId tid, Char* msg, UInt otag ); void MC_(record_memparam_error) ( ThreadId tid, Addr a, Bool isAddrErr, Char* msg, UInt otag ); diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index 6363e925df..b36383500a 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -3640,7 +3640,7 @@ void check_mem_is_addressable ( CorePart part, ThreadId tid, Char* s, break; case Vg_CoreSignal: - MC_(record_core_mem_error)( tid, /*isAddrErr*/True, s ); + MC_(record_core_mem_error)( tid, s ); break; default: @@ -4411,7 +4411,6 @@ void MC_(helperc_value_checkN_fail_no_o) ( HWord sz ) { but we took them out because they ranged from not-very-helpful to downright annoying, and they complicated the error data structures. */ static Int mc_get_or_set_vbits_for_client ( - ThreadId tid, Addr a, Addr vbits, SizeT szB, @@ -4983,12 +4982,12 @@ static Bool mc_handle_client_request ( ThreadId tid, UWord* arg, UWord* ret ) case VG_USERREQ__GET_VBITS: *ret = mc_get_or_set_vbits_for_client - ( tid, arg[1], arg[2], arg[3], False /* get them */ ); + ( arg[1], arg[2], arg[3], False /* get them */ ); break; case VG_USERREQ__SET_VBITS: *ret = mc_get_or_set_vbits_for_client - ( tid, arg[1], arg[2], arg[3], True /* set them */ ); + ( arg[1], arg[2], arg[3], True /* set them */ ); break; case VG_USERREQ__COUNT_LEAKS: { /* count leaked bytes */ @@ -5008,10 +5007,10 @@ static Bool mc_handle_client_request ( ThreadId tid, UWord* arg, UWord* ret ) case VG_USERREQ__MALLOCLIKE_BLOCK: { Addr p = (Addr)arg[1]; SizeT sizeB = arg[2]; - UInt rzB = arg[3]; + //UInt rzB = arg[3]; XXX: unused! Bool is_zeroed = (Bool)arg[4]; - MC_(new_block) ( tid, p, sizeB, /*ignored*/0, rzB, is_zeroed, + MC_(new_block) ( tid, p, sizeB, /*ignored*/0, is_zeroed, MC_AllocCustom, MC_(malloc_list) ); return True; } diff --git a/memcheck/mc_malloc_wrappers.c b/memcheck/mc_malloc_wrappers.c index a37288add9..dc4a4bbac3 100644 --- a/memcheck/mc_malloc_wrappers.c +++ b/memcheck/mc_malloc_wrappers.c @@ -183,7 +183,7 @@ static Bool complain_about_silly_args2(SizeT n, SizeT sizeB) /* Allocate memory and note change in memory available */ void* MC_(new_block) ( ThreadId tid, - Addr p, SizeT szB, SizeT alignB, UInt rzB, + Addr p, SizeT szB, SizeT alignB, Bool is_zeroed, MC_AllocKind kind, VgHashTable table) { ExeContext* ec; @@ -233,8 +233,7 @@ void* MC_(malloc) ( ThreadId tid, SizeT n ) return NULL; } else { return MC_(new_block) ( tid, 0, n, VG_(clo_alignment), - MC_MALLOC_REDZONE_SZB, /*is_zeroed*/False, MC_AllocMalloc, - MC_(malloc_list)); + /*is_zeroed*/False, MC_AllocMalloc, MC_(malloc_list)); } } @@ -244,8 +243,7 @@ void* MC_(__builtin_new) ( ThreadId tid, SizeT n ) return NULL; } else { return MC_(new_block) ( tid, 0, n, VG_(clo_alignment), - MC_MALLOC_REDZONE_SZB, /*is_zeroed*/False, MC_AllocNew, - MC_(malloc_list)); + /*is_zeroed*/False, MC_AllocNew, MC_(malloc_list)); } } @@ -255,8 +253,7 @@ void* MC_(__builtin_vec_new) ( ThreadId tid, SizeT n ) return NULL; } else { return MC_(new_block) ( tid, 0, n, VG_(clo_alignment), - MC_MALLOC_REDZONE_SZB, /*is_zeroed*/False, MC_AllocNewVec, - MC_(malloc_list)); + /*is_zeroed*/False, MC_AllocNewVec, MC_(malloc_list)); } } @@ -266,8 +263,7 @@ void* MC_(memalign) ( ThreadId tid, SizeT alignB, SizeT n ) return NULL; } else { return MC_(new_block) ( tid, 0, n, alignB, - MC_MALLOC_REDZONE_SZB, /*is_zeroed*/False, MC_AllocMalloc, - MC_(malloc_list)); + /*is_zeroed*/False, MC_AllocMalloc, MC_(malloc_list)); } } @@ -277,8 +273,7 @@ void* MC_(calloc) ( ThreadId tid, SizeT nmemb, SizeT size1 ) return NULL; } else { return MC_(new_block) ( tid, 0, nmemb*size1, VG_(clo_alignment), - MC_MALLOC_REDZONE_SZB, /*is_zeroed*/True, MC_AllocMalloc, - MC_(malloc_list)); + /*is_zeroed*/True, MC_AllocMalloc, MC_(malloc_list)); } } @@ -659,7 +654,7 @@ void MC_(mempool_alloc)(ThreadId tid, Addr pool, Addr addr, SizeT szB) MC_(record_illegal_mempool_error) ( tid, pool ); } else { check_mempool_sane(mp); - MC_(new_block)(tid, addr, szB, /*ignored*/0, mp->rzB, mp->is_zeroed, + MC_(new_block)(tid, addr, szB, /*ignored*/0, mp->is_zeroed, MC_AllocCustom, mp->chunks); check_mempool_sane(mp); }