64-bit cleanness: convert client requests to receive and return UWords.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2921 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/addrcheck/ac_main.c b/addrcheck/ac_main.c
index 296679a..117675c 100644
--- a/addrcheck/ac_main.c
+++ b/addrcheck/ac_main.c
@@ -1160,7 +1160,7 @@
 /*--- Client requests                                      ---*/
 /*------------------------------------------------------------*/
 
-Bool SK_(handle_client_request) ( ThreadId tid, UInt* arg_block, UInt *ret )
+Bool SK_(handle_client_request) ( ThreadId tid, UWord* arg, UWord *ret )
 {
 #define IGNORE(what)                                                    \
    do {                                                                 \
@@ -1172,7 +1172,6 @@
       }                                                                 \
    } while (0)
 
-   UInt* arg = arg_block;
    static Int moans = 3;
 
    /* Overload memcheck client reqs */
@@ -1212,12 +1211,12 @@
          return False;
 
       default:
-         if (MAC_(handle_common_client_requests)(tid, arg_block, ret )) {
+         if (MAC_(handle_common_client_requests)(tid, arg, ret )) {
             return True;
          } else {
             VG_(message)(Vg_UserMsg, 
-                         "Warning: unknown addrcheck client request code %d",
-                         arg[0]);
+                         "Warning: unknown addrcheck client request code %llx",
+                         (ULong)arg[0]);
             return False;
          }
    }
diff --git a/coregrind/toolfuncs.def b/coregrind/toolfuncs.def
index b800770..3891435 100644
--- a/coregrind/toolfuncs.def
+++ b/coregrind/toolfuncs.def
@@ -127,7 +127,7 @@
 ## not recognised.  arg_block[0] holds the request number, any further args
 ## from the request are in arg_block[1..].  'ret' is for the return value...
 ## it should probably be filled, if only with 0.
-Bool, handle_client_request, ThreadId tid, UInt* arg_block, UInt* ret
+Bool, handle_client_request, ThreadId tid, UWord* arg_block, UWord* ret
 
 
 ## ------------------------------------------------------------------
diff --git a/coregrind/vg_scheduler.c b/coregrind/vg_scheduler.c
index 4c713db..7d45e83 100644
--- a/coregrind/vg_scheduler.c
+++ b/coregrind/vg_scheduler.c
@@ -94,7 +94,7 @@
 static Addr __libc_freeres_wrapper;
 
 /* Forwards */
-static void do_client_request ( ThreadId tid, UInt* args );
+static void do_client_request ( ThreadId tid, UWord* args );
 static void scheduler_sanity ( void );
 static void do_pthread_mutex_timedlock_TIMEOUT ( ThreadId tid );
 static void do_pthread_cond_timedwait_TIMEOUT ( ThreadId tid );
@@ -911,8 +911,8 @@
          }
 
          if (trc == VG_TRC_EBP_JMP_CLIENTREQ) {
-            UInt* args = (UInt*)(ARCH_CLREQ_ARGS(VG_(threads)[tid].arch));
-            UInt reqno = args[0];
+            UWord* args = (UWord*)(ARCH_CLREQ_ARGS(VG_(threads)[tid].arch));
+            UWord reqno = args[0];
             /* VG_(printf)("request 0x%x\n", reqno); */
 
             /* Are we really absolutely totally quitting? */
@@ -2874,16 +2874,16 @@
    choose a new thread to run.  
 */
 static
-void do_client_request ( ThreadId tid, UInt* arg )
+void do_client_request ( ThreadId tid, UWord* arg )
 {
-   UInt req_no = arg[0];
+   UWord req_no = arg[0];
 
    if (0)
-      VG_(printf)("req no = 0x%x, arg = %p\n", req_no, arg);
+      VG_(printf)("req no = 0x%llx, arg = %p\n", (ULong)req_no, arg);
    switch (req_no) {
 
       case VG_USERREQ__CLIENT_CALL0: {
-         UInt (*f)(void) = (void*)arg[1];
+         UWord (*f)(void) = (void*)arg[1];
 	 if (f == NULL)
 	    VG_(message)(Vg_DebugMsg, "VG_USERREQ__CLIENT_CALL0: func=%p\n", f);
 	 else
@@ -2891,7 +2891,7 @@
          break;
       }
       case VG_USERREQ__CLIENT_CALL1: {
-         UInt (*f)(UInt) = (void*)arg[1];
+         UWord (*f)(UWord) = (void*)arg[1];
 	 if (f == NULL)
 	    VG_(message)(Vg_DebugMsg, "VG_USERREQ__CLIENT_CALL1: func=%p\n", f);
 	 else
@@ -2899,7 +2899,7 @@
          break;
       }
       case VG_USERREQ__CLIENT_CALL2: {
-         UInt (*f)(UInt, UInt) = (void*)arg[1];
+         UWord (*f)(UWord, UWord) = (void*)arg[1];
 	 if (f == NULL)
 	    VG_(message)(Vg_DebugMsg, "VG_USERREQ__CLIENT_CALL2: func=%p\n", f);
 	 else
@@ -2907,7 +2907,7 @@
          break;
       }
       case VG_USERREQ__CLIENT_CALL3: {
-         UInt (*f)(UInt, UInt, UInt) = (void*)arg[1];
+         UWord (*f)(UWord, UWord, UWord) = (void*)arg[1];
 	 if (f == NULL)
 	    VG_(message)(Vg_DebugMsg, "VG_USERREQ__CLIENT_CALL3: func=%p\n", f);
 	 else
@@ -3213,7 +3213,7 @@
 
       default:
          if (VG_(needs).client_requests) {
-	    UInt ret;
+	    UWord ret;
 
             if (VG_(clo_verbosity) > 2)
                VG_(printf)("client request: code %x,  addr %p,  len %d\n",
diff --git a/helgrind/hg_main.c b/helgrind/hg_main.c
index 6e75bdb..aab4bf5 100644
--- a/helgrind/hg_main.c
+++ b/helgrind/hg_main.c
@@ -3233,7 +3233,7 @@
 /*--- Client requests                                              ---*/
 /*--------------------------------------------------------------------*/
 
-Bool SK_(handle_client_request)(ThreadId tid, UInt *args, UInt *ret)
+Bool SK_(handle_client_request)(ThreadId tid, UWord *args, UWord *ret)
 {
    if (!VG_IS_SKIN_USERREQ('H','G',args[0]))
       return False;
diff --git a/massif/ms_main.c b/massif/ms_main.c
index 9ce8d0e..e475c0f 100644
--- a/massif/ms_main.c
+++ b/massif/ms_main.c
@@ -1128,13 +1128,13 @@
 /*--- Client Requests                                      ---*/
 /*------------------------------------------------------------*/
 
-Bool SK_(handle_client_request) ( ThreadId tid, UInt* argv, UInt* ret )
+Bool SK_(handle_client_request) ( ThreadId tid, UWord* argv, UWord* ret )
 {
    switch (argv[0]) {
    case VG_USERREQ__MALLOCLIKE_BLOCK: {
       void* res;
       void* p         = (void*)argv[1];
-      UInt  sizeB     =        argv[2];
+      SizeT sizeB     =        argv[2];
       *ret            = 0;
       res = new_block( p, sizeB, /*align -- ignored*/0, /*is_zeroed*/False );
       sk_assert(res == p);
diff --git a/memcheck/mac_needs.c b/memcheck/mac_needs.c
index e6231a0..e1ef58a 100644
--- a/memcheck/mac_needs.c
+++ b/memcheck/mac_needs.c
@@ -843,7 +843,7 @@
 /*--- Common client request handling                       ---*/
 /*------------------------------------------------------------*/
 
-Bool MAC_(handle_common_client_requests)(ThreadId tid, UInt* arg, UInt* ret )
+Bool MAC_(handle_common_client_requests)(ThreadId tid, UWord* arg, UWord* ret )
 {
    Char* err  = 
          "The client requests VALGRIND_MALLOCLIKE_BLOCK and\n"
@@ -859,7 +859,7 @@
    
    switch (arg[0]) {
    case VG_USERREQ__COUNT_LEAKS: { /* count leaked bytes */
-      UInt** argp = (UInt**)arg;
+      UWord** argp = (UWord**)arg;
       // MAC_(bytes_leaked) et al were set by the last leak check (or zero
       // if no prior leak checks performed).
       *argp[1] = MAC_(bytes_leaked);
diff --git a/memcheck/mac_shared.h b/memcheck/mac_shared.h
index 88deee5..922c34c 100644
--- a/memcheck/mac_shared.h
+++ b/memcheck/mac_shared.h
@@ -334,7 +334,7 @@
 extern void MAC_(common_fini)         ( void (*leak_check)(void) );
 
 extern Bool MAC_(handle_common_client_requests) ( ThreadId tid, 
-                                                  UInt* arg_block, UInt* ret );
+                                                  UWord* arg_block, UWord* ret );
 
 extern void MAC_(print_malloc_stats) ( void );
 
diff --git a/memcheck/mc_clientreqs.c b/memcheck/mc_clientreqs.c
index d27541d..69ac196 100644
--- a/memcheck/mc_clientreqs.c
+++ b/memcheck/mc_clientreqs.c
@@ -54,7 +54,7 @@
 typedef
    struct {
       Addr          start;
-      UInt          size;
+      SizeT         size;
       ExeContext*   where;
       CGenBlockKind kind;
    } 
@@ -177,7 +177,7 @@
    return False;
 }
 
-Bool SK_(handle_client_request) ( ThreadId tid, UInt* arg, UInt* ret )
+Bool SK_(handle_client_request) ( ThreadId tid, UWord* arg, UWord* ret )
 {
    Int   i;
    Bool  ok;
@@ -274,8 +274,8 @@
             return True;
          } else {
             VG_(message)(Vg_UserMsg, 
-                         "Warning: unknown memcheck client request code %d",
-                         arg[0]);
+                         "Warning: unknown memcheck client request code %llx",
+                         (ULong)arg[0]);
             return False;
          }
    }