Remove a number of unused parameters, found with -Wunused-parameter.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9248 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_debuginfo/readdwarf.c b/coregrind/m_debuginfo/readdwarf.c
index 659bab2..3a23e35 100644
--- a/coregrind/m_debuginfo/readdwarf.c
+++ b/coregrind/m_debuginfo/readdwarf.c
@@ -960,8 +960,7 @@
 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 @@
          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 f69004f..e89db66 100644
--- a/coregrind/m_demangle/cplus-dem.c
+++ b/coregrind/m_demangle/cplus-dem.c
@@ -371,8 +371,7 @@
                    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 @@
 }
 
 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 @@
       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 c8f015e..8322da5 100644
--- a/coregrind/m_main.c
+++ b/coregrind/m_main.c
@@ -304,8 +304,7 @@
 /* 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 @@
 {
    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 @@
    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 e31a3b7..c84395a 100644
--- a/coregrind/m_mallocfree.c
+++ b/coregrind/m_mallocfree.c
@@ -402,25 +402,25 @@
 
 // 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 @@
    // 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 @@
    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 7176f30..bcfd53a 100644
--- a/coregrind/m_scheduler/scheduler.c
+++ b/coregrind/m_scheduler/scheduler.c
@@ -332,7 +332,7 @@
 
 /* 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 @@
          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 @@
          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 @@
    vg_assert(VG_(is_running_thread)(tid));
    
    if (jumped) {
-      block_signals(tid);
+      block_signals();
       VG_(poll_signals)(tid);
    }
 }
@@ -888,7 +888,7 @@
       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 450a1c3..0930348 100644
--- a/coregrind/m_sigframe/sigframe-x86-linux.c
+++ b/coregrind/m_sigframe/sigframe-x86-linux.c
@@ -438,7 +438,6 @@
 
 static void build_vg_sigframe(struct vg_sigframe *frame,
 			      ThreadState *tst,
-			      const vki_sigset_t *mask,
 			      UInt flags,
 			      Int sigNo)
 {
@@ -459,7 +458,7 @@
 			   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 @@
    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 @@
 			      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 @@
    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 @@
 
    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 0583b00..ca07ffe 100644
--- a/coregrind/m_syswrap/syswrap-generic.c
+++ b/coregrind/m_syswrap/syswrap-generic.c
@@ -65,8 +65,7 @@
 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 @@
                                        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 @@
 }
 
 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 @@
 
 /* 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 @@
          (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 @@
 
 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 3e6abd2..8b76ea3 100644
--- a/coregrind/m_syswrap/syswrap-main.c
+++ b/coregrind/m_syswrap/syswrap-main.c
@@ -736,7 +736,7 @@
 /* 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 @@
          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 b5f346d..2f39f41 100644
--- a/coregrind/m_translate.c
+++ b/coregrind/m_translate.c
@@ -1547,8 +1547,7 @@
           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 c051ae7..5e67128 100644
--- a/coregrind/m_transtab.c
+++ b/coregrind/m_transtab.c
@@ -1350,8 +1350,7 @@
 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 73f3863..a2c45d8 100644
--- a/coregrind/pub_core_transtab.h
+++ b/coregrind/pub_core_transtab.h
@@ -83,8 +83,7 @@
 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 33dcc26..e7fcd87 100644
--- a/memcheck/mc_errors.c
+++ b/memcheck/mc_errors.c
@@ -715,9 +715,8 @@
 
 /* --- 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 ddc441b..8519298 100644
--- a/memcheck/mc_include.h
+++ b/memcheck/mc_include.h
@@ -79,7 +79,7 @@
 
 
 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_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 6363e92..b363835 100644
--- a/memcheck/mc_main.c
+++ b/memcheck/mc_main.c
@@ -3640,7 +3640,7 @@
          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 @@
    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 @@
 
       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 @@
       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 a37288a..dc4a4bb 100644
--- a/memcheck/mc_malloc_wrappers.c
+++ b/memcheck/mc_malloc_wrappers.c
@@ -183,7 +183,7 @@
 
 /* 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 @@
       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 @@
       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 @@
       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 @@
       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 @@
       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 @@
       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);
    }