]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
gcc-3.3 as supplied with SuSE 8.2 ("gcc version 3.3 20030226
authorJulian Seward <jseward@acm.org>
Sun, 18 May 2003 10:05:38 +0000 (10:05 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 18 May 2003 10:05:38 +0000 (10:05 +0000)
(prerelease) (SuSE Linux)") seems to complain about signed-vs-unsigned
comparisons, when -Wall is on.  This commit fixes (most of) those
complaints.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1638

18 files changed:
cachegrind/cg_main.c
coregrind/demangle/cplus-dem.c
coregrind/vg_errcontext.c
coregrind/vg_from_ucode.c
coregrind/vg_intercept.c
coregrind/vg_main.c
coregrind/vg_malloc2.c
coregrind/vg_mylibc.c
coregrind/vg_replace_malloc.c
coregrind/vg_scheduler.c
coregrind/vg_symtab2.c
coregrind/vg_syscalls.c
coregrind/vg_translate.c
coregrind/vg_transtab.c
helgrind/hg_main.c
memcheck/mac_needs.c
memcheck/mc_clientreqs.c
memcheck/mc_replace_strmem.c

index 84f6fb4dc69835889a94418b0113a8ba039f2bce..b5bb940577e65e3bc997e3266dc19a6638e2ac2d 100644 (file)
@@ -1006,7 +1006,7 @@ static cache_t clo_L2_cache = UNDEFINED_CACHE;
  * them. 
  */
 
-static __inline__ void cpuid(Int n, Int *a, Int *b, Int *c, Int *d)
+static __inline__ void cpuid(Int n, UInt *a, UInt *b, UInt *c, UInt *d)
 {
    __asm__ __volatile__ (
     "cpuid"
@@ -1181,7 +1181,8 @@ Int Intel_cache_info(Int level, cache_t* I1c, cache_t* D1c, cache_t* L2c)
 static
 Int AMD_cache_info(cache_t* I1c, cache_t* D1c, cache_t* L2c)
 {
-   Int dummy, model, ext_level;
+   UInt ext_level;
+   Int dummy, model;
    Int I1i, D1i, L2i;
    
    cpuid(0x80000000, &ext_level, &dummy, &dummy, &dummy);
index 4f708e6b6d74535f72143719b4f4a0539339de6f..ed16d24190e93a607c22cbe6be3020037574c240 100644 (file)
@@ -1776,7 +1776,7 @@ demangle_expression (work, mangled, s, tk)
 
          len = strlen (*mangled);
 
-         for (i = 0; i < ARRAY_SIZE (optable); ++i)
+         for (i = 0; i < (size_t)ARRAY_SIZE (optable); ++i)
            {
              size_t l = strlen (optable[i].in);
 
@@ -4683,7 +4683,7 @@ demangle_function_name (work, mangled, declp, scan)
       if (declp->p - declp->b >= 10 /* op$assign_ */
          && memcmp (declp->b + 3, "assign_", 7) == 0)
        {
-         for (i = 0; i < ARRAY_SIZE (optable); i++)
+         for (i = 0; i < (size_t)ARRAY_SIZE (optable); i++)
            {
              int len = declp->p - declp->b - 10;
              if ((int) strlen (optable[i].in) == len
@@ -4699,7 +4699,7 @@ demangle_function_name (work, mangled, declp, scan)
        }
       else
        {
-         for (i = 0; i < ARRAY_SIZE (optable); i++)
+         for (i = 0; i < (size_t)ARRAY_SIZE (optable); i++)
            {
              int len = declp->p - declp->b - 3;
              if ((int) strlen (optable[i].in) == len
@@ -4747,7 +4747,7 @@ demangle_function_name (work, mangled, declp, scan)
       if (declp->b[4] == '\0')
        {
          /* Operator.  */
-         for (i = 0; i < ARRAY_SIZE (optable); i++)
+         for (i = 0; i < (size_t)ARRAY_SIZE (optable); i++)
            {
              if (strlen (optable[i].in) == 2
                  && memcmp (optable[i].in, declp->b + 2, 2) == 0)
@@ -4764,7 +4764,7 @@ demangle_function_name (work, mangled, declp, scan)
          if (declp->b[2] == 'a' && declp->b[5] == '\0')
            {
              /* Assignment.  */
-             for (i = 0; i < ARRAY_SIZE (optable); i++)
+             for (i = 0; i < (size_t)ARRAY_SIZE (optable); i++)
                {
                  if (strlen (optable[i].in) == 3
                      && memcmp (optable[i].in, declp->b + 2, 3) == 0)
index 509215220b08db040e07e9d1f10a43a1368cc288..8b953d75d6278766cbe2d54e795d809ec7119262 100644 (file)
@@ -204,7 +204,7 @@ void construct_error ( Error* err, ThreadState* tst, ErrorKind ekind, Addr a,
 
 void VG_(gen_suppression)(Error* err)
 {
-   UInt        i;
+   Int         i;
    UChar       buf[M_VG_ERRTXT];
    ExeContext* ec      = VG_(get_error_where)(err);
    Int         stop_at = VG_(clo_backtrace_size);
index db3d8bde12907c38724245f778cdaf2952e03506..b285e1db0cef5916d1da1ef302e7df257c28390a 100644 (file)
@@ -164,7 +164,7 @@ void VG_(print_UInstr_histogram)(void)
                      histogram[i].counts, count_pc, 
                      avg_size, size_pc);
 
-         for (j = 0; j < size_pc; j++) VG_(printf)("O");
+         for (j = 0; j < (Int)size_pc; j++) VG_(printf)("O");
          VG_(printf)("\n");
 
       } else {
@@ -1883,7 +1883,7 @@ void VG_(emit_AMD_prefetch_reg) ( Int reg )
  * Searches through compacts first, then non-compacts. */
 Int VG_(helper_offset)(Addr a)
 {
-   Int i;
+   UInt i;
    Char buf[100];
 
    for (i = 0; i < VG_(n_compact_helpers); i++)
index 1d99d33675ffd0641325e64a8c0e8cc273104356..1f810e822d6c79cd99391fd5cda1fb2fc0dc43aa 100644 (file)
@@ -266,8 +266,8 @@ typedef unsigned long int nfds_t;
 
 int VGR_(poll) (struct pollfd *__fds, nfds_t __nfds, int __timeout)
 {
-   unsigned int        ms_now, ms_end;
-   int                 res, i;
+   unsigned int        ms_now, ms_end, i;
+   int                 res;
    struct vki_timespec nanosleep_interval;
 
    __my_pthread_testcancel();
index 2331ec25ec4dc5b783728df8749ad67d7cea20f2..960fa757304f046cdf9e0707fa046201fbd63a9f 100644 (file)
@@ -177,10 +177,12 @@ void VG_(register_noncompact_helper)(Addr a)
 }
 
 /* Allocate offsets in baseBlock for the skin helpers */
-static void assign_helpers_in_baseBlock(UInt n, Int offsets[], Addr addrs[])
+static 
+void assign_helpers_in_baseBlock(UInt n, Int offsets[], Addr addrs[])
 {
-   Int i;
-   for (i = 0; i < n; i++) offsets[i] = alloc_BaB_1_set( addrs[i] );
+   UInt i;
+   for (i = 0; i < n; i++) 
+      offsets[i] = alloc_BaB_1_set( addrs[i] );
 }
 
 Bool VG_(need_to_handle_esp_assignment)(void)
@@ -708,7 +710,7 @@ static void vg_findstack_callback ( Addr start, UInt size,
 static void process_cmd_line_options ( void )
 {
    Char* argv[M_VG_CMDLINE_OPTS];
-   UInt  argc;
+   Int   argc;
    Char* p;
    Char* str;
    Int   i, eventually_logfile_fd, ctr;
@@ -732,7 +734,7 @@ static void process_cmd_line_options ( void )
       envc & envp. It is not fool-proof, but these structures should
       change less often than the libc ones. */
    {
-       UInt* sp;
+       Int* sp;
 
        /* Look for the stack segment by parsing /proc/self/maps and
          looking for a section bracketing VG_(esp_at_startup) which
index bf9c8d0617e8679cabf5f5c6c5186694dcf66597..9b6af79e2145b1ad227daa85e9e394c6ad39a37c 100644 (file)
@@ -629,8 +629,9 @@ void unlinkBlock ( Arena* a, UInt* b, Int listno )
 static
 void splitChunk ( Arena* a, UInt* b, Int b_listno, UInt req_bszW )
 {
-   Int b_bszW, frag_bszW;
-   b_bszW = mk_plain_bszW(get_bszW_lo(b));
+   UInt b_bszW;
+   Int  frag_bszW;
+   b_bszW = (UInt)mk_plain_bszW(get_bszW_lo(b));
    vg_assert(req_bszW < b_bszW);
    frag_bszW = b_bszW - req_bszW;
    vg_assert(frag_bszW >= overhead_szW(a));
index b81e36ce699daf7b17d7a99ce0dd1d90dc5b2f0c..ef06526a024bcb5030e02a7a0642efe7eb712611 100644 (file)
@@ -168,7 +168,7 @@ Bool VG_(kisfullsigset)( vki_ksigset_t* set )
    Int i;
    vg_assert(set != NULL);
    for (i = 0; i < VKI_KNSIG_WORDS; i++)
-      if (set->ws[i] != ~0x0) return False;
+      if (set->ws[i] != (UInt)(~0x0)) return False;
    return True;
 }
 
@@ -664,7 +664,7 @@ UInt VG_(printf) ( const char *format, ... )
 /* A general replacement for sprintf(). */
 UInt VG_(sprintf) ( Char* buf, Char *format, ... )
 {
-   UInt ret;
+   Int ret;
    va_list vargs;
    Char *ptr = buf;
    static void add_to_vg_sprintf_buf ( Char c )
@@ -753,15 +753,18 @@ Long VG_(atoll36) ( UInt base, Char* str )
    vg_assert(base >= 2 && base <= 36);
    if (*str == '-') { str++; neg = True; };
    while (True) {
-      if (*str >= '0' && *str <=('9' - (10 - base))) {
+      if (*str >= '0' 
+          && *str <= (Char)('9' - (10 - base))) {
          n = base*n + (Long)(*str - '0');
       }
       else 
-      if (base > 10 && *str >= 'A' && *str <= ('Z' - (36 - base))) {
+      if (base > 10 && *str >= 'A' 
+          && *str <= (Char)('Z' - (36 - base))) {
          n = base*n + (Long)((*str - 'A') + 10);
       }
       else 
-      if (base > 10 && *str >= 'a' && *str <= ('z' - (36 - base))) {
+      if (base > 10 && *str >= 'a' 
+          && *str <= (Char)('z' - (36 - base))) {
          n = base*n + (Long)((*str - 'a') + 10);
       }
       else {
index 2299fad68e3b0617ffe147546874881bb3778301..28068c2754204d2018f547005a8b048019015231 100644 (file)
@@ -422,7 +422,7 @@ struct mallinfo {
 struct mallinfo mallinfo ( void )
 {
    /* Should really try to return something a bit more meaningful */
-   Int             i;
+   UInt            i;
    struct mallinfo mi;
    UChar*          pmi = (UChar*)(&mi);
    for (i = 0; i < sizeof(mi); i++)
index 04c4933cac95150d738a42ea652bfd9c063a2980..ed4fcba83eb2cc650239af446100eb59768c0de8 100644 (file)
@@ -125,7 +125,7 @@ typedef
       /* File descriptor waited for.  -1 means this slot is not in use */
       Int      fd;
       /* The syscall number the fd is used in. */
-      Int      syscall_no;
+      UInt     syscall_no;
 
       /* False => still waiting for select to tell us the fd is ready
          to go.  True => the fd is ready, but the results have not yet
@@ -1134,7 +1134,8 @@ void poll_for_ready_fds ( void )
 static
 void complete_blocked_syscalls ( void )
 {
-   Int      fd, i, res, syscall_no;
+   Int      fd, i, res;
+   UInt     syscall_no;
    void*    pre_res;
    ThreadId tid;
    Char     msg_buf[100];
@@ -1200,7 +1201,8 @@ void complete_blocked_syscalls ( void )
 static
 void check_for_pthread_cond_timedwait ( void )
 {
-   Int i, now;
+   Int  i;
+   UInt now;
    for (i = 1; i < VG_N_THREADS; i++) {
       if (VG_(threads)[i].status != VgTs_WaitCV)
          continue;
@@ -3621,7 +3623,7 @@ void scheduler_sanity ( void )
          /* 1 */ vg_assert(mx != NULL);
         /* 2 */ vg_assert(mx->__m_count > 0);
          /* 3 */ vg_assert(VG_(is_valid_tid)((ThreadId)mx->__m_owner));
-         /* 4 */ vg_assert(i != (ThreadId)mx->__m_owner); 
+         /* 4 */ vg_assert((UInt)i != (ThreadId)mx->__m_owner); 
       } else 
       if (VG_(threads)[i].status == VgTs_WaitCV) {
          vg_assert(cv != NULL);
index 304e9b97c0310403e7b67a8b6c4a7dd54326b796..3de0293319b690275b1f58df3ab614827847e2fc 100644 (file)
@@ -161,7 +161,8 @@ Int addStr ( SegInfo* si, Char* str )
    static SegInfo* curr_si = NULL;
 
    Char* new_tab;
-   Int   new_sz, i, space_needed;
+   Int   space_needed, i;
+   UInt  new_sz, u;
 
    /* Avoid gratuitous duplication:  if we saw `str' within the last NN,
     * within this segment, return that index.  Saves about 200KB in glibc,
@@ -192,8 +193,8 @@ Int addStr ( SegInfo* si, Char* str )
       if (new_sz == 0) new_sz = 5000;
       new_tab = VG_(arena_malloc)(VG_AR_SYMTAB, new_sz);
       if (si->strtab != NULL) {
-         for (i = 0; i < si->strtab_used; i++)
-            new_tab[i] = si->strtab[i];
+         for (u = 0; u < si->strtab_used; u++)
+            new_tab[u] = si->strtab[u];
          VG_(arena_free)(VG_AR_SYMTAB, si->strtab);
       }
       si->strtab      = new_tab;
@@ -214,7 +215,7 @@ Int addStr ( SegInfo* si, Char* str )
 static __inline__
 void addSym ( SegInfo* si, RiSym* sym )
 {
-   Int    new_sz, i;
+   UInt   new_sz, i;
    RiSym* new_tab;
 
    /* Ignore zero-sized syms. */
@@ -243,7 +244,7 @@ void addSym ( SegInfo* si, RiSym* sym )
 static __inline__
 void addLoc ( SegInfo* si, RiLoc* loc )
 {
-   Int    new_sz, i;
+   UInt   new_sz, i;
    RiLoc* new_tab;
 
    /* Zero-sized locs should have been ignored earlier */
@@ -482,7 +483,7 @@ void canonicaliseSymtab ( SegInfo* si )
    /* Detect and "fix" overlapping address ranges. */
    n_truncated = 0;
 
-   for (i = 0; i < si->symtab_used-1; i++) {
+   for (i = 0; i < ((Int)si->symtab_used) -1; i++) {
 
       vg_assert(si->symtab[i].addr <= si->symtab[i+1].addr);
 
@@ -529,7 +530,7 @@ void canonicaliseSymtab ( SegInfo* si )
       /* It may be that the i+1 entry now needs to be moved further
          along to maintain the address order requirement. */
       j = i+1;
-      while (j < si->symtab_used-1 
+      while (j < ((Int)si->symtab_used)-1 
              && si->symtab[j].addr > si->symtab[j+1].addr) {
          SWAP(RiSym,si->symtab[j],si->symtab[j+1]);
          j++;
@@ -540,7 +541,7 @@ void canonicaliseSymtab ( SegInfo* si )
    if (n_truncated > 0) goto cleanup_more;
 
    /* Ensure relevant postconditions hold. */
-   for (i = 0; i < si->symtab_used-1; i++) {
+   for (i = 0; i < ((Int)si->symtab_used)-1; i++) {
       /* No zero-sized symbols. */
       vg_assert(si->symtab[i].size > 0);
       /* In order. */
@@ -598,7 +599,7 @@ void canonicaliseLoctab ( SegInfo* si )
    }
 
    /* If two adjacent entries overlap, truncate the first. */
-   for (i = 0; i < si->loctab_used-1; i++) {
+   for (i = 0; i < ((Int)si->loctab_used)-1; i++) {
       vg_assert(si->loctab[i].size < 10000);
       if (si->loctab[i].addr + si->loctab[i].size > si->loctab[i+1].addr) {
          /* Do this in signed int32 because the actual .size fields
@@ -618,7 +619,7 @@ void canonicaliseLoctab ( SegInfo* si )
    /* Zap any zero-sized entries resulting from the truncation
       process. */
    j = 0;
-   for (i = 0; i < si->loctab_used; i++) {
+   for (i = 0; i < (Int)si->loctab_used; i++) {
       if (si->loctab[i].size > 0) {
          si->loctab[j] = si->loctab[i];
          j++;
@@ -627,7 +628,7 @@ void canonicaliseLoctab ( SegInfo* si )
    si->loctab_used = j;
 
    /* Ensure relevant postconditions hold. */
-   for (i = 0; i < si->loctab_used-1; i++) {
+   for (i = 0; i < ((Int)si->loctab_used)-1; i++) {
       /* 
       VG_(printf)("%d   (%d) %d 0x%x\n", 
                    i, si->loctab[i+1].confident, 
@@ -1102,7 +1103,7 @@ void read_debuginfo_dwarf2 ( SegInfo* si, UChar* dwarf2, Int dwarf2_sz )
          break;
        }
 
-      if (info.li_length + sizeof (external->li_length) > dwarf2_sz)
+      if (info.li_length + sizeof (external->li_length) > (UInt)dwarf2_sz)
        {
         vg_symerr("DWARF line info appears to be corrupt "
                   "- the section is too small");
@@ -1393,7 +1394,7 @@ Bool vg_read_lib_symbols ( SegInfo* si )
    Int           i;
    Bool          ok;
    Addr          oimage;
-   Int           n_oimage;
+   UInt          n_oimage;
    struct vki_stat stat_buf;
 
    oimage = (Addr)NULL;
@@ -1645,7 +1646,7 @@ Bool vg_read_lib_symbols ( SegInfo* si )
 
          /* Perhaps should start at i = 1; ELF docs suggest that entry
             0 always denotes `unknown symbol'. */
-         for (i = 1; i < o_symtab_sz/sizeof(Elf32_Sym); i++){
+         for (i = 1; i < (Int)(o_symtab_sz/sizeof(Elf32_Sym)); i++){
 #           if 1
            if (VG_(clo_trace_symtab)) {
               VG_(printf)("raw symbol [%d]: ", i);
@@ -2149,7 +2150,7 @@ Bool get_fnname ( Bool demangle, Addr a, Char* buf, Int nbuf,
       len = VG_(sprintf)(buf2, "%c%d",
                         offset < 0 ? '-' : '+',
                         offset < 0 ? -offset : offset);
-      vg_assert(len < sizeof(buf2));
+      vg_assert(len < (Int)sizeof(buf2));
 
       if (len < (end - symend)) {
         Char *cp = buf2;
@@ -2342,7 +2343,7 @@ void VG_(mini_stack_dump) ( ExeContext* ec )
       VG_(message)(Vg_UserMsg, "%s", buf);
       i++;
 
-   } while (i < stop_at && ec->eips[i] != 0);
+   } while (i < (UInt)stop_at && ec->eips[i] != 0);
 }
 
 #undef APPEND
index 00786bafb986567ec65cdee428c0696518ebfd19..57ef09ed77014970f61af52cafe1f97a059fa010 100644 (file)
@@ -1363,7 +1363,7 @@ void VG_(perform_assumed_nonblocking_syscall) ( ThreadId tid )
          MAYBE_PRINTF("close ( %d )\n",arg1);
          /* Detect and negate attempts by the client to close Valgrind's
             logfile fd ... */
-         if (arg1 == VG_(clo_logfile_fd)) {
+         if (arg1 == (UInt)VG_(clo_logfile_fd)) {
             VG_(message)(Vg_UserMsg, 
               "Warning: client attempted to close "
                "Valgrind's logfile fd (%d).", 
@@ -2655,7 +2655,7 @@ void VG_(perform_assumed_nonblocking_syscall) ( ThreadId tid )
                            arg1, arg2 * sizeof(struct pollfd) );
          KERNEL_DO_SYSCALL(tid,res);
          if (!VG_(is_kerror)(res) && res > 0) {
-            Int i;
+            UInt i;
             struct pollfd * arr = (struct pollfd *)arg1;
             for (i = 0; i < arg2; i++)
                VG_TRACK( post_mem_write, (Addr)(&arr[i].revents), 
index 56f94b0ed40fa44d6673a311c048056fc011b639..0010807602f9c3a6be0a55c290ba14f272b10770 100644 (file)
@@ -1662,7 +1662,7 @@ UCodeBlock* vg_ESP_update_pass(UCodeBlock* cb_in)
    UInstr*     u;
    Int         delta = 0;
    UInt        t_ESP = INVALID_TEMPREG;
-   UInt        i;
+   Int         i;
 
    cb = VG_(setup_UCodeBlock)(cb_in);
 
index 5c33fabfa699b67f589e07899f57c2af0eab1694..c35cdcfa5e780b27a9577b2be067e16415311139 100644 (file)
@@ -599,7 +599,7 @@ void VG_(invalidate_translations) ( Addr start, UInt range, Bool unchain_blocks
          /* make sure no other blocks chain to the one we just discarded */
          for(j = 0; j < VG_TC_N_SECTORS; j++) {
             if (vg_tc[j] != NULL)
-               unchain_sector(j, tce->payload, tce->trans_size);
+               unchain_sector(j, (Addr)tce->payload, tce->trans_size);
          }
       }
 
index dc887f57ad098afab33429068628282aac44ba82..e016f1757db0d089b30630e56c4f7efa1da8952d 100644 (file)
@@ -144,7 +144,7 @@ typedef
    struct _HG_Chunk {
       struct _HG_Chunk* next;
       Addr          data;           /* ptr to actual block              */
-      UInt          size;           /* size requested                   */
+      Int           size;           /* size requested                   */
       ExeContext*   where;          /* where it was allocated           */
       ThreadId      tid;            /* allocating thread                */
    }
@@ -642,7 +642,7 @@ static inline Int mutex_cmp(const Mutex *a, const Mutex *b)
 }
 
 struct _LockSet {
-   UInt                      setsize;  /* number of members */
+   Int               setsize;  /* number of members */
    UInt                      hash;     /* hash code */
    LockSet           *next;    /* next in hash chain */
    const Mutex       *mutex[0];        /* locks */
@@ -676,8 +676,7 @@ static inline const LockSet *unpackLockSet(UInt id)
 static 
 void pp_LockSet(const LockSet* p)
 {
-   int i;
-
+   Int i;
    VG_(printf)("{ ");
    for(i = 0; i < p->setsize; i++) {
       const Mutex *mx = p->mutex[i];
@@ -699,7 +698,7 @@ static inline UInt hash_LockSet_w_wo(const LockSet *ls,
                                     const Mutex *with,
                                     const Mutex *without)
 {
-   UInt i;
+   Int  i;
    UInt hash = ls->setsize + (with != NULL) - (without != NULL);
    
    sk_assert(with == NULL || with != without);
@@ -978,7 +977,7 @@ void sanity_check_locksets ( const Char* caller )
            badness = "mismatched hash";
            goto bad;
         }
-        if (ls->hash != i) {
+        if (ls->hash != (UInt)i) {
            badness = "wrong bucket";
            goto bad;
         }
@@ -1956,7 +1955,7 @@ void* SK_(realloc) ( ThreadState* tst, void* p, Int new_size )
 {
    HG_Chunk  *hc;
    HG_Chunk **prev_chunks_next_ptr;
-   UInt       i;
+   Int        i;
 
    /* First try and find the block. */
    hc = (HG_Chunk*)VG_(HT_get_node) ( hg_malloc_list, (UInt)p,
index 1531f38c8da580a1da1a364466d0b417b6933513..874a6da79243670de882a8482a2cffd5c0b4ff40 100644 (file)
@@ -520,7 +520,7 @@ Bool SK_(read_extra_suppression_info) ( Int fd, Char* buf, Int nBuf, Supp *su )
 
 Bool SK_(error_matches_suppression)(Error* err, Supp* su)
 {
-   UInt       su_size;
+   Int        su_size;
    MAC_Error* err_extra = VG_(get_error_extra)(err);
    ErrorKind  ekind     = VG_(get_error_kind )(err);
 
index 1ba3abf5aa5e94e7aeffb580f17e23553aee6033..58c9b0e68aa7c5768697f93a560bd6e4d4d6e176 100644 (file)
@@ -75,7 +75,7 @@ static UInt vg_cgb_search   = 0;   /* Number of searches. */
 static
 Int vg_alloc_client_block ( void )
 {
-   Int        i, sz_new;
+   UInt       i, sz_new;
    CGenBlock* cgbs_new;
 
    vg_cgb_allocs++;
@@ -126,7 +126,7 @@ void MC_(show_client_block_stats) ( void )
 
 Bool MC_(client_perm_maybe_describe)( Addr a, AddrInfo* ai )
 {
-   Int i;
+   UInt i;
    /* VG_(printf)("try to identify %d\n", a); */
 
    /* Perhaps it's a general block ? */
index 4dca7143384b1686355d3f53cba4bbe4178cdf24..cbe1ad8b9189804d7a661f3a4d94ac6ac9d048e8 100644 (file)
@@ -51,8 +51,8 @@ Bool is_overlap ( void* dst, const void* src, UInt len )
 
    if (diff < 0) 
       diff = -diff;
-
-   return (diff < len);
+   /* Now we have diff >= 0, so a cast to UInt is harmless. */
+   return ( ((UInt)diff) < len);
 }
 
 static __inline__