]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
64-bit cleanness: lots more replacing of UInt with UWord as necessary.
authorNicholas Nethercote <n.nethercote@gmail.com>
Thu, 4 Nov 2004 18:03:06 +0000 (18:03 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Thu, 4 Nov 2004 18:03:06 +0000 (18:03 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2920

coregrind/vg_execontext.c
coregrind/vg_hashtable.c
coregrind/vg_memory.c
coregrind/vg_mylibc.c
coregrind/vg_scheduler.c
coregrind/vg_signals.c
coregrind/vg_syscalls.c
coregrind/vg_transtab.c
helgrind/hg_main.c
memcheck/mac_needs.c
memcheck/mc_clientreqs.c

index e9e808798be65e3ea7ecb2837a9b4ebbb5007fec..286f946ca9a080da9b6784f977d7a182c80ec398 100644 (file)
@@ -236,7 +236,7 @@ ExeContext* VG_(get_ExeContext2) ( Addr ip, Addr fp,
    Int         i;
    Addr        ips[VG_DEEPEST_BACKTRACE];
    Bool        same;
-   UInt        hash;
+   UWord       hash;
    ExeContext* new_ec;
    ExeContext* list;
 
@@ -254,7 +254,7 @@ ExeContext* VG_(get_ExeContext2) ( Addr ip, Addr fp,
 
    hash = 0;
    for (i = 0; i < VG_(clo_backtrace_size); i++) {
-      hash ^= (UInt)ips[i];
+      hash ^= ips[i];
       hash = (hash << 29) | (hash >> 3);
    }
    hash = hash % VG_N_EC_LISTS;
index 9df208072dd276a41de6b7cbb9bfeb9632031bd4..697891a27e229c4c8b9a6885d7d85a353fa7718d 100644 (file)
@@ -38,7 +38,7 @@
 
 #define VG_N_CHAINS 4999 /* a prime number */
 
-#define VG_CHAIN_NO(aa) (((UInt)(aa)) % VG_N_CHAINS)
+#define VG_CHAIN_NO(aa) (((UWord)(aa)) % VG_N_CHAINS)
 
 /*--------------------------------------------------------------------*/
 /*--- Functions                                                    ---*/
index fad9c8ab36dc81f1e630ebbfbd57086ba4b1295a..8969b4b476e27a3ba62b7d9d21b1a9757e197f57 100644 (file)
@@ -603,7 +603,7 @@ void VG_(unpad_address_space)(void)
 
    while (s && addr <= VG_(valgrind_last)) {
       if (addr < s->addr) {
-         ret = VG_(do_syscall)(__NR_munmap, (UInt)addr, s->addr - addr);
+         ret = VG_(do_syscall)(__NR_munmap, addr, s->addr - addr);
       }
          
       addr = s->addr + s->len;
index 69b75111a3045a72b0144935977fe41a9763ee4e..4d698f58934702ca4f704f21606d1cba98ba9a45 100644 (file)
@@ -73,7 +73,7 @@ Bool VG_(isfullsigset)( vki_sigset_t* set )
    Int i;
    vg_assert(set != NULL);
    for (i = 0; i < _VKI_NSIG_WORDS; i++)
-      if (set->sig[i] != (UInt)(~0x0)) return False;
+      if (set->sig[i] != (UWord)(~0x0)) return False;
    return True;
 }
 
@@ -136,25 +136,22 @@ void VG_(sigdelset_from_set)( vki_sigset_t* dst, vki_sigset_t* src )
 /* The functions sigaction, sigprocmask, sigpending and sigsuspend
    return 0 on success and -1 on error.  
 */
-Int VG_(sigprocmask)( Int how, 
-                       const vki_sigset_t* set, 
-                       vki_sigset_t* oldset)
+Int VG_(sigprocmask)( Int how, const vki_sigset_t* set, vki_sigset_t* oldset)
 {
    Int res 
       = VG_(do_syscall)(__NR_rt_sigprocmask, 
-                       how, (UInt)set, (UInt)oldset, 
+                       how, (UWord)set, (UWord)oldset, 
                        _VKI_NSIG_WORDS * sizeof(UWord));
    return VG_(is_kerror)(res) ? -1 : 0;
 }
 
 
-Int VG_(sigaction) ( Int signum,  
-                      const struct vki_sigaction* act,  
-                      struct vki_sigaction* oldact)
+Int VG_(sigaction) ( Int signum, const struct vki_sigaction* act,  
+                     struct vki_sigaction* oldact)
 {
    Int res
      = VG_(do_syscall)(__NR_rt_sigaction,
-                      signum, (UInt)act, (UInt)oldact, 
+                      signum, (UWord)act, (UWord)oldact, 
                       _VKI_NSIG_WORDS * sizeof(UWord));
    /* VG_(printf)("res = %d\n",res); */
    return VG_(is_kerror)(res) ? -1 : 0;
@@ -185,7 +182,7 @@ Int VG_(signal)(Int signum, void (*sighandler)(Int))
    res = VG_(sigemptyset)( &sa.sa_mask );
    vg_assert(res == 0);
    res = VG_(do_syscall)(__NR_rt_sigaction,
-                        signum, (UInt)(&sa), (UInt)NULL,
+                        signum, (UWord)&sa, (UWord)NULL,
                         _VKI_NSIG_WORDS * sizeof(UWord));
    return VG_(is_kerror)(res) ? -1 : 0;
 }
@@ -575,7 +572,7 @@ VG_(vprintf) ( void(*send)(Char), const Char *format, va_list vargs )
             send('0');
             send('x');
             ret += myvprintf_int64(send, flags, 16, width, 
-                                  (ULong)((UInt)va_arg (vargs, void *)));
+                                  (ULong)((UWord)va_arg (vargs, void *)));
             break;
          case 'x': /* %x */
             if (is_long)
@@ -1638,7 +1635,7 @@ Int VG_(system) ( Char* cmd )
       argv[3] = 0;
 
       (void)VG_(do_syscall)(__NR_execve, 
-                            (UInt)"/bin/sh", (UInt)argv, (UInt)envp);
+                            (UWord)"/bin/sh", (UWord)argv, (UWord)envp);
 
       /* If we're still alive here, execve failed. */
       VG_(exit)(1);
@@ -1690,7 +1687,7 @@ void* VG_(get_memory_from_mmap) ( SizeT nBytes, Char* who )
 
    if (p != ((void*)(-1))) {
       vg_assert((void*)VG_(valgrind_base) <= p && p <= (void*)VG_(valgrind_last));
-      tot_alloc += (UInt)nBytes;
+      tot_alloc += nBytes;
       if (0)
          VG_(printf)(
             "get_memory_from_mmap: %llu tot, %llu req = %p .. %p, caller %s\n",
index c3ffdac301f2cbe1f8fb5688096d0b32f9266796..4c713db09496b3bf21d2d8a48748ee04e8742b35 100644 (file)
@@ -981,7 +981,7 @@ VgSchedReturnCode do_scheduler ( Int* exitcode, ThreadId* last_run_tid )
                   }
                   VG_(nuke_all_threads_except) ( tid );
                   ARCH_INSTR_PTR(VG_(threads)[tid].arch) = 
-                        (UInt)__libc_freeres_wrapper;
+                     __libc_freeres_wrapper;
                   vg_assert(VG_(threads)[tid].status == VgTs_Runnable);
                   goto stage1; /* party on, dudes (but not for much longer :) */
 
@@ -1197,10 +1197,10 @@ void make_thread_jump_to_cancelhdlr ( ThreadId tid )
    /* Set an argument and bogus return address.  The return address will not
       be used, but we still need to have it so that the arg is at the
       correct stack offset. */
-   VGA_(set_arg_and_bogus_ret)(tid, (UInt)PTHREAD_CANCELED, 0xBEADDEEF);
+   VGA_(set_arg_and_bogus_ret)(tid, (UWord)PTHREAD_CANCELED, 0xBEADDEEF);
 
    /* .cancel_pend will hold &thread_exit_wrapper */
-   ARCH_INSTR_PTR(VG_(threads)[tid].arch) = (UInt)VG_(threads)[tid].cancel_pend;
+   ARCH_INSTR_PTR(VG_(threads)[tid].arch) = (UWord)VG_(threads)[tid].cancel_pend;
 
    VG_(proxy_abort_syscall)(tid);
 
@@ -1843,7 +1843,7 @@ void do__apply_in_new_thread ( ThreadId parent_tid,
                               (Addr)&do__apply_in_new_thread_bogusRA);
 
    /* this is where we start */
-   ARCH_INSTR_PTR(VG_(threads)[tid].arch) = (UInt)fn;
+   ARCH_INSTR_PTR(VG_(threads)[tid].arch) = (UWord)fn;
 
    if (VG_(clo_trace_sched)) {
       VG_(sprintf)(msg_buf, "new thread, created by %d", parent_tid );
@@ -2574,7 +2574,7 @@ void do_pthread_getspecific_ptr ( ThreadId tid )
    vg_assert(specifics_ptr == NULL 
              || IS_ALIGNED4_ADDR(specifics_ptr));
 
-   SET_PTHREQ_RETVAL(tid, (UInt)specifics_ptr);
+   SET_PTHREQ_RETVAL(tid, (UWord)specifics_ptr);
 }
 
 
@@ -2926,7 +2926,7 @@ void do_client_request ( ThreadId tid, UInt* arg )
       case VG_USERREQ__MALLOC:
          VG_(sk_malloc_called_by_scheduler) = True;
          SET_PTHREQ_RETVAL(
-            tid, (UInt)SK_(malloc) ( arg[1] ) 
+            tid, (Addr)SK_(malloc) ( arg[1] ) 
          );
          VG_(sk_malloc_called_by_scheduler) = False;
          break;
index 209f619a8da0d0321fc3c82d187355a000b79c56..f0b8343f45ce46214d8d0e62e47894fe748c3c89 100644 (file)
@@ -543,8 +543,8 @@ void VG_(do__NR_sigaction) ( ThreadId tid )
    if (VG_(clo_trace_signals))
       VG_(message)(Vg_DebugExtraMsg, 
          "__NR_sigaction: tid %d, sigNo %d, "
-         "new 0x%x, old 0x%x, new flags 0x%x",
-         tid, signo, (UInt)new_act, (UInt)old_act,
+         "new %p, old %p, new flags 0x%x",
+         tid, signo, (UWord)new_act, (UWord)old_act,
          (UInt)(new_act ? new_act->sa_flags : 0) );
 
    /* Rule out various error conditions.  The aim is to ensure that if
index db96c1f43ab928a927b557b0c7945e83b85b9e42..f7ad5b18060bb8d28f84ba33e8b9c958e1ed00ef 100644 (file)
@@ -1489,7 +1489,7 @@ PRE(sched_setscheduler)
    /* int sched_setscheduler(pid_t pid, int policy, 
       const struct sched_param *p); */
    MAYBE_PRINTF("sched_setscheduler ( %d, %d, %p )\n",arg1,arg2,arg3);
-   if (arg3 != (UInt)NULL)
+   if (arg3 != (UWord)NULL)
       SYSCALL_TRACK( pre_mem_read, tid,
                     "sched_setscheduler(struct sched_param *p)", 
                     arg3, sizeof(struct vki_sched_param));
@@ -1572,7 +1572,7 @@ PRE(sendfile)
    /* ssize_t sendfile(int out_fd, int in_fd, off_t *offset, 
       size_t count) */
    MAYBE_PRINTF("sendfile ( %d, %d, %p, %llu )\n",arg1,arg2,arg3,(ULong)arg4);
-   if (arg3 != (UInt)NULL)
+   if (arg3 != (UWord)NULL)
       SYSCALL_TRACK( pre_mem_write, tid, "sendfile(offset)",
                     arg3, sizeof(vki_off_t) );
 }
@@ -1587,14 +1587,14 @@ PRE(sendfile64)
    /* ssize_t sendfile64(int out_df, int in_fd, loff_t *offset,
       size_t count); */
    MAYBE_PRINTF("sendfile64 ( %d, %d, %p, %llu )\n",arg1,arg2,arg3,(ULong)arg4);
-   if (arg3 != (UInt)NULL)
+   if (arg3 != (UWord)NULL)
       SYSCALL_TRACK( pre_mem_write, tid, "sendfile64(offset)",
                     arg3, sizeof(vki_loff_t) );
 }
 
 POST(sendfile64)
 {
-   if (arg3 != (UInt)NULL ) {
+   if (arg3 != (UWord)NULL ) {
       VG_TRACK( post_mem_write, arg3, sizeof(vki_loff_t) );
    }
 }
@@ -1734,9 +1734,9 @@ PRE(execve)
    MAYBE_PRINTF("execve ( %p(%s), %p, %p )\n", arg1, arg1, arg2, arg3);
 
    SYSCALL_TRACK( pre_mem_read_asciiz, tid, "execve(filename)", arg1 );
-   if (arg2 != (UInt)NULL)
+   if (arg2 != (UWord)NULL)
       pre_argv_envp( arg2, tid, "execve(argv)", "execve(argv[i])" );
-   if (arg3 != (UInt)NULL)
+   if (arg3 != (UWord)NULL)
       pre_argv_envp( arg3, tid, "execve(envp)", "execve(envp[i])" );
 
    /* Erk.  If the exec fails, then the following will have made a
@@ -2517,7 +2517,7 @@ PRE(ipc)
    case 4: /* IPCOP_semtimedop */
       SYSCALL_TRACK( pre_mem_read, tid, "semtimedop(sops)", arg5, 
                     arg3 * sizeof(struct vki_sembuf) );
-      if (arg6 != (UInt)NULL)
+      if (arg6 != (UWord)NULL)
          SYSCALL_TRACK( pre_mem_read, tid, "semtimedop(timeout)", arg6, 
                         sizeof(struct vki_timespec) );
       tst->sys_flags |= MayBlock;
@@ -3112,7 +3112,7 @@ PRE(ioctl)
         // buf pointer only needs to be readable
         struct vki_ifconf *ifc = (struct vki_ifconf *) arg3;
         SYSCALL_TRACK( pre_mem_write,tid, "ioctl(SIOCGIFCONF).ifc_buf",
-                       (Addr)(ifc->vki_ifc_buf), (UInt)(ifc->ifc_len) );
+                       (Addr)(ifc->vki_ifc_buf), ifc->ifc_len );
       }
       break;
    case VKI_SIOCGSTAMP:
@@ -3388,8 +3388,7 @@ PRE(ioctl)
          /* ToDo: don't do any of the following if the structure is invalid */
          struct vki_cdrom_read_audio *cra = (struct vki_cdrom_read_audio *) arg3;
         SYSCALL_TRACK( pre_mem_write, tid, "ioctl(CDROMREADAUDIO).buf",
-                       (Addr)(cra->buf),
-                        (UInt)(cra->nframes * VKI_CD_FRAMESIZE_RAW));
+                       (Addr)cra->buf, cra->nframes * VKI_CD_FRAMESIZE_RAW);
       }
       break;      
    case VKI_CDROMPLAYMSF:
@@ -3730,8 +3729,7 @@ POST(ioctl)
       if (res == 0 && arg3 ) {
         struct vki_ifconf *ifc = (struct vki_ifconf *) arg3;
         if (ifc->vki_ifc_buf != NULL)
-           VG_TRACK( post_mem_write, (Addr)(ifc->vki_ifc_buf), 
-                     (UInt)(ifc->ifc_len) );
+           VG_TRACK( post_mem_write, (Addr)(ifc->vki_ifc_buf), ifc->ifc_len );
       }
       break;
    case VKI_SIOCGSTAMP:
@@ -3885,7 +3883,7 @@ POST(ioctl)
    {
       struct vki_cdrom_read_audio *cra = (struct vki_cdrom_read_audio *) arg3;
       VG_TRACK( post_mem_write, (Addr)(cra->buf),
-                (UInt)(cra->nframes * VKI_CD_FRAMESIZE_RAW));
+                cra->nframes * VKI_CD_FRAMESIZE_RAW);
       break;
    }
       
@@ -4201,14 +4199,14 @@ PRE(nanosleep)
    MAYBE_PRINTF("nanosleep ( %p, %p )\n", arg1,arg2);
    SYSCALL_TRACK( pre_mem_read, tid, "nanosleep(req)", arg1, 
                                         sizeof(struct vki_timespec) );
-   if (arg2 != (UInt)NULL)
+   if (arg2 != (UWord)NULL)
       SYSCALL_TRACK( pre_mem_write, tid, "nanosleep(rem)", arg2, 
                      sizeof(struct vki_timespec) );
 }
 
 POST(nanosleep)
 {
-   if (arg2 != (UInt)NULL && res == -VKI_EINTR)
+   if (arg2 != (UWord)NULL && res == -VKI_EINTR)
       VG_TRACK( post_mem_write, arg2, sizeof(struct vki_timespec) );
 }
 
@@ -4990,7 +4988,7 @@ POST(socketcall)
 
    case VKI_SYS_RECV:
       if (res >= 0 
-         && ((UInt*)arg2)[1] != (UInt)NULL) {
+         && ((UInt*)arg2)[1] != (UWord)NULL) {
         VG_TRACK( post_mem_write, ((UInt*)arg2)[1], /* buf */
                   ((UInt*)arg2)[2]  /* len */ );
       }
@@ -5149,14 +5147,14 @@ PRE(time)
 {
    /* time_t time(time_t *t); */
    MAYBE_PRINTF("time ( %p )\n",arg1);
-   if (arg1 != (UInt)NULL) {
+   if (arg1 != (UWord)NULL) {
       SYSCALL_TRACK( pre_mem_write, tid, "time", arg1, sizeof(vki_time_t) );
    }
 }
 
 POST(time)
 {
-   if (arg1 != (UInt)NULL) {
+   if (arg1 != (UWord)NULL) {
       VG_TRACK( post_mem_write, arg1, sizeof(vki_time_t) );
    }
 }
@@ -5171,7 +5169,7 @@ PRE(times)
 
 POST(times)
 {
-   if (arg1 != (UInt)NULL) {
+   if (arg1 != (UWord)NULL) {
       VG_TRACK( post_mem_write, arg1, sizeof(struct vki_tms) );
    }
 }
@@ -5206,7 +5204,7 @@ PRE(uname)
 
 POST(uname)
 {
-   if (arg1 != (UInt)NULL) {
+   if (arg1 != (UWord)NULL) {
       VG_TRACK( post_mem_write, arg1, sizeof(struct vki_new_utsname) );
    }
 }
@@ -5216,7 +5214,7 @@ PRE(utime)
    /* int utime(const char *filename, struct utimbuf *buf); */
    MAYBE_PRINTF("utime ( %p, %p )\n", arg1,arg2);
    SYSCALL_TRACK( pre_mem_read_asciiz, tid, "utime(filename)", arg1 );
-   if (arg2 != (UInt)NULL)
+   if (arg2 != (UWord)NULL)
       SYSCALL_TRACK( pre_mem_read, tid, "utime(buf)", arg2, 
                     sizeof(struct vki_utimbuf) );
 }
@@ -5322,7 +5320,7 @@ PRE(utimes)
     /* int utimes(const char *filename, struct timeval *tvp); */
     MAYBE_PRINTF("utimes ( %p, %p )\n", arg1,arg2);
     SYSCALL_TRACK( pre_mem_read_asciiz, tid, "utimes(filename)", arg1 );
-    if (arg2 != (UInt)NULL)
+    if (arg2 != (UWord)NULL)
          SYSCALL_TRACK( pre_mem_read, tid, "utimes(tvp)", arg2,
                        sizeof(struct vki_timeval) );
 }
@@ -5332,7 +5330,7 @@ PRE(futex)
     /* int futex(void *futex, int op, int val, const struct timespec *timeout); */
     MAYBE_PRINTF("futex ( %p, %d, %d, %p, %p )\n", arg1,arg2,arg3,arg4,arg5);
     SYSCALL_TRACK( pre_mem_read, tid, "futex(futex)", arg1, sizeof(int) );
-    if (arg2 == VKI_FUTEX_WAIT && arg4 != (UInt)NULL)
+    if (arg2 == VKI_FUTEX_WAIT && arg4 != (UWord)NULL)
        SYSCALL_TRACK( pre_mem_read, tid, "futex(timeout)", arg4,
                       sizeof(struct vki_timespec) );
     if (arg2 == VKI_FUTEX_REQUEUE)
@@ -5405,17 +5403,17 @@ PRE(rt_sigtimedwait)
    /* int sigtimedwait(const  sigset_t  *set,  siginfo_t  *info,
       const struct timespec timeout); */
    MAYBE_PRINTF("sigtimedwait ( %p, %p, timeout )\n", arg1, arg2);
-   if (arg1 != (UInt)NULL) 
+   if (arg1 != (UWord)NULL) 
       SYSCALL_TRACK( pre_mem_read,  tid, "sigtimedwait(set)",  arg1,
                      sizeof(vki_sigset_t));
-   if (arg2 != (UInt)NULL)
+   if (arg2 != (UWord)NULL)
       SYSCALL_TRACK( pre_mem_write, tid, "sigtimedwait(info)", arg2,
                     sizeof(vki_siginfo_t) );
 }
 
 POST(rt_sigtimedwait)
 {
-   if (arg2 != (UInt)NULL)
+   if (arg2 != (UWord)NULL)
       VG_TRACK( post_mem_write, arg2, sizeof(vki_siginfo_t) );
 }
 
@@ -5423,7 +5421,7 @@ PRE(rt_sigqueueinfo)
 {
    /*  long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t *uinfo) */
    MAYBE_PRINTF("rt_sigqueueinfo(%d, %d, %p)\n", arg1, arg2, arg3);
-   if (arg2 != (UInt)NULL)
+   if (arg2 != (UWord)NULL)
       SYSCALL_TRACK( pre_mem_read, tid, "sigqueueinfo(uinfo)", arg3, 
                     sizeof(vki_siginfo_t) );
 }
@@ -5443,11 +5441,11 @@ PRE(sigaltstack)
 {
    /* int sigaltstack(const stack_t *ss, stack_t *oss); */
    MAYBE_PRINTF("sigaltstack ( %p, %p )\n",arg1,arg2);
-   if (arg1 != (UInt)NULL) {
+   if (arg1 != (UWord)NULL) {
       SYSCALL_TRACK( pre_mem_read, tid, "sigaltstack(ss)", 
                     arg1, sizeof(vki_stack_t) );
    }
-   if (arg2 != (UInt)NULL) {
+   if (arg2 != (UWord)NULL) {
       SYSCALL_TRACK( pre_mem_write, tid, "sigaltstack(oss)", 
                     arg2, sizeof(vki_stack_t) );
    }
@@ -5458,7 +5456,7 @@ PRE(sigaltstack)
 
 POST(sigaltstack)
 {
-   if (res == 0 && arg2 != (UInt)NULL)
+   if (res == 0 && arg2 != (UWord)NULL)
       VG_TRACK( post_mem_write, arg2, sizeof(vki_stack_t));
 }
 
@@ -5467,10 +5465,10 @@ PRE(sigaction)
    /* int sigaction(int signum, struct k_sigaction *act, 
       struct k_sigaction *oldact); */
    MAYBE_PRINTF("sigaction ( %d, %p, %p )\n",arg1,arg2,arg3);
-   if (arg2 != (UInt)NULL)
+   if (arg2 != (UWord)NULL)
       SYSCALL_TRACK( pre_mem_read, tid, "sigaction(act)", 
                     arg2, sizeof(struct vki_sigaction));
-   if (arg3 != (UInt)NULL)
+   if (arg3 != (UWord)NULL)
       SYSCALL_TRACK( pre_mem_write, tid, "sigaction(oldact)", 
                     arg3, sizeof(struct vki_sigaction));
 
@@ -5480,7 +5478,7 @@ PRE(sigaction)
 
 POST(sigaction)
 {
-   if (res == 0 && arg3 != (UInt)NULL)
+   if (res == 0 && arg3 != (UWord)NULL)
       VG_TRACK( post_mem_write, arg3, sizeof(struct vki_sigaction));
 }
 
@@ -5492,10 +5490,10 @@ PRE(sigprocmask)
    /* int sigprocmask(int how, k_sigset_t *set, 
       k_sigset_t *oldset); */
    MAYBE_PRINTF("sigprocmask ( %d, %p, %p )\n",arg1,arg2,arg3);
-   if (arg2 != (UInt)NULL)
+   if (arg2 != (UWord)NULL)
       SYSCALL_TRACK( pre_mem_read, tid, "sigprocmask(set)", 
                     arg2, sizeof(vki_sigset_t));
-   if (arg3 != (UInt)NULL)
+   if (arg3 != (UWord)NULL)
       SYSCALL_TRACK( pre_mem_write, tid, "sigprocmask(oldset)", 
                     arg3, sizeof(vki_sigset_t));
 
@@ -5508,7 +5506,7 @@ PRE(sigprocmask)
 
 POST(sigprocmask)
 {
-   if (res == 0 && arg3 != (UInt)NULL)
+   if (res == 0 && arg3 != (UWord)NULL)
       VG_TRACK( post_mem_write, arg3, sizeof(vki_sigset_t));
 }
 
@@ -5588,7 +5586,7 @@ PRE(io_getevents)
    if (arg3 > 0)
       SYSCALL_TRACK( pre_mem_write, tid, "io_getevents(events)",
                      arg4, sizeof(struct vki_io_event)*arg3 );
-   if (arg5 != (UInt)NULL)
+   if (arg5 != (UWord)NULL)
       SYSCALL_TRACK( pre_mem_read, tid, "io_getevents(timeout)",
                      arg5, sizeof(struct vki_timespec));
 }
@@ -5601,7 +5599,7 @@ POST(io_getevents)
       VG_TRACK( post_mem_write, arg4, sizeof(struct vki_io_event)*res );
       for (i = 0; i < res; i++) {
          const struct vki_io_event *vev = ((struct vki_io_event *)arg4) + i;
-         const struct vki_iocb *cb = (struct vki_iocb *)(UInt)vev->obj;
+         const struct vki_iocb *cb = (struct vki_iocb *)(Addr)vev->obj;
 
          switch (cb->aio_lio_opcode) {
          case VKI_IOCB_CMD_PREAD:
index 132f0db8de060cf57286d823ae0744aa87edde06..eaca9729b06e7042ccdf4328615072a8fc031ece 100644 (file)
@@ -238,7 +238,7 @@ void add_tt_entry ( TCEntry* tce )
    UInt i;
    /* VG_(printf)("add_TT_entry orig_addr %p\n", tce->orig_addr); */
    /* Hash to get initial probe point. */
-   i = ((UInt)(tce->orig_addr)) % VG_TT_SIZE;
+   i = tce->orig_addr % VG_TT_SIZE;
    while (True) {
       if (vg_tt[i].orig_addr == tce->orig_addr)
          VG_(core_panic)("add_TT_entry: duplicate");
@@ -266,7 +266,7 @@ TTEntry* search_tt ( Addr orig_addr )
 {
    Int i;
    /* Hash to get initial probe point. */
-   i = ((UInt)orig_addr) % VG_TT_SIZE;
+   i = orig_addr % VG_TT_SIZE;
    while (True) {
       if (vg_tt[i].orig_addr == orig_addr)
          return &vg_tt[i];
index 8200f5ed134eb27fdcbd7323eb113bb92fd03930..6e75bdb350acd0e2691d8976cda624bf87cc7d92 100644 (file)
@@ -240,8 +240,8 @@ typedef struct EC_IP {
 
 static inline UInt packEC(ExeContext *ec)
 {
-   SK_ASSERT(((UInt)ec & ((1 << STATE_BITS)-1)) == 0);
-   return ((UInt)ec) >> STATE_BITS;
+   SK_ASSERT(((UWord)ec & ((1 << STATE_BITS)-1)) == 0);
+   return ((UWord)ec) >> STATE_BITS;
 }
 
 static inline ExeContext *unpackEC(UInt i)
@@ -252,7 +252,7 @@ static inline ExeContext *unpackEC(UInt i)
 /* Lose 2 LSB of IP */
 static inline UInt packIP(Addr ip)
 {
-   return ((UInt)ip) >> STATE_BITS;
+   return ip >> STATE_BITS;
 }
 
 static inline Addr unpackIP(UInt i)
@@ -445,8 +445,8 @@ static Bool tlsIsDisjoint(const ThreadLifeSeg *tls,
 
 static inline UInt packTLS(ThreadLifeSeg *tls)
 {
-   SK_ASSERT(((UInt)tls & ((1 << STATE_BITS)-1)) == 0);
-   return ((UInt)tls) >> STATE_BITS;
+   SK_ASSERT(((UWord)tls & ((1 << STATE_BITS)-1)) == 0);
+   return ((UWord)tls) >> STATE_BITS;
 }
 
 static inline ThreadLifeSeg *unpackTLS(UInt i)
@@ -656,8 +656,8 @@ static inline UInt packLockSet(const LockSet *p)
 {
    UInt id;
 
-   SK_ASSERT(((UInt)p & ((1 << STATE_BITS)-1)) == 0);
-   id = ((UInt)p) >> STATE_BITS;
+   SK_ASSERT(((UWord)p & ((1 << STATE_BITS)-1)) == 0);
+   id = ((UWord)p) >> STATE_BITS;
 
    return id;
 }
@@ -710,7 +710,7 @@ static UInt hash_LockSet_w_wo(const LockSet *ls,
       }
 
       hash = ROTL(hash, 17);
-      hash ^= (UInt)mx->mutexp;
+      hash ^= mx->mutexp;
    }
 
    return hash % LOCKSET_HASH_SZ;
@@ -1348,7 +1348,7 @@ static void pp_all_mutexes()
 /* find or create a Mutex for a program's mutex use */
 static Mutex *get_mutex(Addr mutexp)
 {
-   UInt bucket = ((UInt)mutexp) % M_MUTEX_HASHSZ;
+   UInt bucket = mutexp % M_MUTEX_HASHSZ;
    Mutex *mp;
    
    for(mp = mutex_hash[bucket]; mp != NULL; mp = mp->next)
@@ -2593,10 +2593,10 @@ static void pp_AddrInfo ( Addr a, AddrInfo* ai )
        break;
       case Mallocd:
       case Freed: {
-         UInt delta;
+         SizeT delta;
          UChar* relative;
          if (ai->rwoffset < 0) {
-            delta    = (UInt)(- ai->rwoffset);
+            delta    = (SizeT)(- ai->rwoffset);
             relative = "before";
          } else if (ai->rwoffset >= ai->blksize) {
             delta    = ai->rwoffset - ai->blksize;
@@ -2606,8 +2606,8 @@ static void pp_AddrInfo ( Addr a, AddrInfo* ai )
             relative = "inside";
          }
         VG_(message)(Vg_UserMsg, 
-                     " Address %p is %d bytes %s a block of size %d %s by thread %d",
-                     a, delta, relative, 
+                     " Address %p is %llu bytes %s a block of size %d %s by thread %d",
+                     a, (ULong)delta, relative, 
                      ai->blksize,
                      ai->akind == Mallocd ? "alloc'd" : "freed",
                      ai->lasttid);
index 87b58263bdaf5479bba6bcc6070cbc2f0335b20d..e6231a035559c5435321717b7783855d284dd9e6 100644 (file)
@@ -227,7 +227,7 @@ void MAC_(pp_AddrInfo) ( Addr a, AddrInfo* ai )
          }
          break;
       case Freed: case Mallocd: case UserG: case Mempool: {
-         UInt delta;
+         SizeT delta;
          UChar* relative;
          UChar* kind;
          if (ai->akind == Mempool) {
@@ -236,7 +236,7 @@ void MAC_(pp_AddrInfo) ( Addr a, AddrInfo* ai )
             kind = "block";
          }
          if (ai->rwoffset < 0) {
-            delta    = (UInt)(- ai->rwoffset);
+            delta    = (SizeT)(- ai->rwoffset);
             relative = "before";
          } else if (ai->rwoffset >= ai->blksize) {
             delta    = ai->rwoffset - ai->blksize;
@@ -246,8 +246,8 @@ void MAC_(pp_AddrInfo) ( Addr a, AddrInfo* ai )
             relative = "inside";
          }
          VG_(message)(Vg_UserMsg, 
-            " Address 0x%x is %d bytes %s a %s of size %d %s",
-            a, delta, relative, kind,
+            " Address 0x%x is %llu bytes %s a %s of size %d %s",
+            a, (ULong)delta, relative, kind,
             ai->blksize,
             ai->akind==Mallocd ? "alloc'd" 
                : ai->akind==Freed ? "free'd" 
@@ -412,8 +412,7 @@ static void describe_addr ( Addr a, AddrInfo* ai )
    for the --workaround-gcc296-bugs kludge. */
 static Bool is_just_below_ESP( Addr esp, Addr aa )
 {
-   if ((UInt)esp > (UInt)aa
-       && ((UInt)esp - (UInt)aa) <= VG_GCC296_BUG_STACK_SLOP)
+   if (esp > aa && (esp - aa) <= VG_GCC296_BUG_STACK_SLOP)
       return True;
    else
       return False;
index 5f6df2e2811d7988b1b50dfe0200a6b968d88209..d27541dcb7b614c1bdce64e109dd46ecc20d287a 100644 (file)
@@ -146,7 +146,7 @@ Bool MC_(client_perm_maybe_describe)( Addr a, AddrInfo* ai )
 
          /* OK - maybe it's a mempool, too? */
          mp = (MAC_Mempool*)VG_(HT_get_node)(MAC_(mempool_list),
-                                             (UInt)vg_cgbs[i].start,
+                                             (UWord)vg_cgbs[i].start,
                                              (void*)&d);
          if(mp != NULL) {
             if(mp->chunks != NULL) {
@@ -197,14 +197,14 @@ Bool SK_(handle_client_request) ( ThreadId tid, UInt* arg, UInt* ret )
          ok = MC_(check_writable) ( arg[1], arg[2], &bad_addr );
          if (!ok)
             MC_(record_user_error) ( tid, bad_addr, True );
-         *ret = ok ? (UInt)NULL : bad_addr;
+         *ret = ok ? (UWord)NULL : bad_addr;
         break;
 
       case VG_USERREQ__CHECK_READABLE: /* check readable */
          ok = MC_(check_readable) ( arg[1], arg[2], &bad_addr );
          if (!ok)
             MC_(record_user_error) ( tid, bad_addr, False );
-         *ret = ok ? (UInt)NULL : bad_addr;
+         *ret = ok ? (UWord)NULL : bad_addr;
         break;
 
       case VG_USERREQ__DO_LEAK_CHECK: