]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Merge r5427 (OSet 64-bit fastcmp bug)
authorJulian Seward <jseward@acm.org>
Tue, 27 Dec 2005 15:00:25 +0000 (15:00 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 27 Dec 2005 15:00:25 +0000 (15:00 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_3_1_BRANCH@5451

cachegrind/cg_main.c
coregrind/m_oset.c
include/pub_tool_oset.h

index 3c9627e1466bfa380349ca742a566c7b2fcb38a4..cd838c2b8fa74181ca2d263ea27e1ddf4e01323e 100644 (file)
@@ -104,9 +104,9 @@ struct _LineCC {
 };
 
 // First compare file, then fn, then line.
-static Int cmp_CodeLoc_LineCC(void *vloc, void *vcc)
+static Word cmp_CodeLoc_LineCC(void *vloc, void *vcc)
 {
-   Int res;
+   Word res;
    CodeLoc* a = (CodeLoc*)vloc;
    CodeLoc* b = &(((LineCC*)vcc)->loc);
 
@@ -174,7 +174,7 @@ static Int  no_debugs           = 0;
 /*--- String table operations                              ---*/
 /*------------------------------------------------------------*/
 
-static Int stringCmp( void* key, void* elem )
+static Word stringCmp( void* key, void* elem )
 {
    return VG_(strcmp)(*(Char**)key, *(Char**)elem);
 }
index 695d45d9b1482f5b1b744f1458e7b03a782a92d2..920b85a00fa29a4fe34b2d47f81c601b0fa19ced 100644 (file)
@@ -170,13 +170,13 @@ void* fast_key_of_node(AvlNode* n)
 }
 
 // Compare the first word of each element.  Inlining is *crucial*.
-static inline Int fast_cmp(void* k, AvlNode* n)
+static inline Word fast_cmp(void* k, AvlNode* n)
 {
-   return ( *(Int*)k - *(Int*)elem_of_node(n) );
+   return ( *(Word*)k - *(Word*)elem_of_node(n) );
 }
 
 // Compare a key and an element.  Inlining is *crucial*.
-static inline Int slow_cmp(AvlTree* t, void* k, AvlNode* n)
+static inline Word slow_cmp(AvlTree* t, void* k, AvlNode* n)
 {
    return t->cmp(k, elem_of_node(n));
 }
@@ -347,7 +347,7 @@ void VG_(OSet_FreeNode)(AvlTree* t, void* e)
 /*--- Insertion                                                    ---*/
 /*--------------------------------------------------------------------*/
 
-static inline Int cmp_key_root(AvlTree* t, AvlNode* n)
+static inline Word cmp_key_root(AvlTree* t, AvlNode* n)
 {
    return t->cmp
           ? slow_cmp(t, slow_key_of_node(t, n), t->root)
@@ -358,7 +358,7 @@ static inline Int cmp_key_root(AvlTree* t, AvlNode* n)
 // Returns True if the depth of the tree has grown.
 static Bool avl_insert(AvlTree* t, AvlNode* n)
 {
-   Int cmpres = cmp_key_root(t, n);
+   Word cmpres = cmp_key_root(t, n);
 
    if (cmpres < 0) {
       // Insert into the left subtree.
@@ -462,7 +462,7 @@ void VG_(OSet_Insert)(AvlTree* t, void* e)
 // Find the *node* in t matching k, or NULL if not found.
 static AvlNode* avl_lookup(AvlTree* t, void* k)
 {
-   Int      cmpres;
+   Word     cmpres;
    AvlNode* curr = t->root;
 
    if (t->cmp) {
@@ -479,10 +479,10 @@ static AvlNode* avl_lookup(AvlTree* t, void* k)
       // elem_of_node because it saves about 10% on lookup time.  This
       // shouldn't be very dangerous because each node will have been
       // checked on insertion.
-      Int kk = *(Int*)k;
+      Word kk = *(Word*)k;
       while (True) {
          if (curr == NULL) return NULL;
-         cmpres = kk - *(Int*)elem_of_node_no_check(curr);
+         cmpres = kk - *(Word*)elem_of_node_no_check(curr);
          if (cmpres < 0) curr = curr->left;  else
          if (cmpres > 0) curr = curr->right; else
          return curr;
@@ -531,7 +531,7 @@ static Bool avl_removeroot(AvlTree* t);
 static Bool avl_remove(AvlTree* t, AvlNode* n)
 {
    Bool ch;
-   Int  cmpres = cmp_key_root(t, n);
+   Word cmpres = cmp_key_root(t, n);
 
    if (cmpres < 0) {
       AvlTree left_subtree;
@@ -614,7 +614,7 @@ static Bool avl_remove(AvlTree* t, AvlNode* n)
 // Returns True if the depth of the tree has shrunk.
 static Bool avl_removeroot(AvlTree* t)
 {
-   Int ch;
+   Bool     ch;
    AvlNode* n;
 
    if (!t->root->left) {
index 9f1882082bd61c514811a9bf98cf0d1c0a79f5cf..67ece913759475e45f90bde45d396b325a55cc76 100644 (file)
@@ -65,9 +65,9 @@
 typedef struct _OSet     OSet;
 typedef struct _OSetNode OSetNode;
 
-typedef Int   (*OSetCmp_t)   ( void* key, void* elem );
-typedef void* (*OSetAlloc_t) ( SizeT szB );
-typedef void  (*OSetFree_t)  ( void* p );
+typedef Word  (*OSetCmp_t)         ( void* key, void* elem );
+typedef void* (*OSetAlloc_t)       ( SizeT szB );
+typedef void  (*OSetFree_t)        ( void* p );
 
 /*--------------------------------------------------------------------*/
 /*--- Creating and destroying OSets and OSet members               ---*/