|
From: <sv...@va...> - 2005-12-27 15:00:34
|
Author: sewardj
Date: 2005-12-27 15:00:25 +0000 (Tue, 27 Dec 2005)
New Revision: 5451
Log:
Merge r5427 (OSet 64-bit fastcmp bug)
Modified:
branches/VALGRIND_3_1_BRANCH/cachegrind/cg_main.c
branches/VALGRIND_3_1_BRANCH/coregrind/m_oset.c
branches/VALGRIND_3_1_BRANCH/include/pub_tool_oset.h
Modified: branches/VALGRIND_3_1_BRANCH/cachegrind/cg_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_1_BRANCH/cachegrind/cg_main.c 2005-12-27 14:52:02=
UTC (rev 5450)
+++ branches/VALGRIND_3_1_BRANCH/cachegrind/cg_main.c 2005-12-27 15:00:25=
UTC (rev 5451)
@@ -104,9 +104,9 @@
};
=20
// 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 =3D (CodeLoc*)vloc;
CodeLoc* b =3D &(((LineCC*)vcc)->loc);
=20
@@ -174,7 +174,7 @@
/*--- String table operations ---*/
/*------------------------------------------------------------*/
=20
-static Int stringCmp( void* key, void* elem )
+static Word stringCmp( void* key, void* elem )
{
return VG_(strcmp)(*(Char**)key, *(Char**)elem);
}
Modified: branches/VALGRIND_3_1_BRANCH/coregrind/m_oset.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_1_BRANCH/coregrind/m_oset.c 2005-12-27 14:52:02 U=
TC (rev 5450)
+++ branches/VALGRIND_3_1_BRANCH/coregrind/m_oset.c 2005-12-27 15:00:25 U=
TC (rev 5451)
@@ -170,13 +170,13 @@
}
=20
// 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) );
}
=20
// 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 @@
/*--- Insertion ---*/
/*--------------------------------------------------------------------*/
=20
-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 @@
// Returns True if the depth of the tree has grown.
static Bool avl_insert(AvlTree* t, AvlNode* n)
{
- Int cmpres =3D cmp_key_root(t, n);
+ Word cmpres =3D cmp_key_root(t, n);
=20
if (cmpres < 0) {
// Insert into the left subtree.
@@ -462,7 +462,7 @@
// 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 =3D t->root;
=20
if (t->cmp) {
@@ -479,10 +479,10 @@
// 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 =3D *(Int*)k;
+ Word kk =3D *(Word*)k;
while (True) {
if (curr =3D=3D NULL) return NULL;
- cmpres =3D kk - *(Int*)elem_of_node_no_check(curr);
+ cmpres =3D kk - *(Word*)elem_of_node_no_check(curr);
if (cmpres < 0) curr =3D curr->left; else
if (cmpres > 0) curr =3D curr->right; else
return curr;
@@ -531,7 +531,7 @@
static Bool avl_remove(AvlTree* t, AvlNode* n)
{
Bool ch;
- Int cmpres =3D cmp_key_root(t, n);
+ Word cmpres =3D cmp_key_root(t, n);
=20
if (cmpres < 0) {
AvlTree left_subtree;
@@ -614,7 +614,7 @@
// Returns True if the depth of the tree has shrunk.
static Bool avl_removeroot(AvlTree* t)
{
- Int ch;
+ Bool ch;
AvlNode* n;
=20
if (!t->root->left) {
Modified: branches/VALGRIND_3_1_BRANCH/include/pub_tool_oset.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_1_BRANCH/include/pub_tool_oset.h 2005-12-27 14:52=
:02 UTC (rev 5450)
+++ branches/VALGRIND_3_1_BRANCH/include/pub_tool_oset.h 2005-12-27 15:00=
:25 UTC (rev 5451)
@@ -65,9 +65,9 @@
typedef struct _OSet OSet;
typedef struct _OSetNode OSetNode;
=20
-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 );
=20
/*--------------------------------------------------------------------*/
/*--- Creating and destroying OSets and OSet members ---*/
|