Commit 26aa75be by Jeff Sturm Committed by Tom Tromey

jvm.h (_Jv_HashCode): Cast object ptr to `unsigned long' to avoid long long division.

2000-09-06  Jeff Sturm  <jeff.sturm@appnet.com>

	* include/jvm.h (_Jv_HashCode): Cast object ptr to `unsigned long'
	to avoid long long division.

From-SVN: r36215
parent 9579ea7e
2000-09-06 Jeff Sturm <jeff.sturm@appnet.com>
* include/jvm.h (_Jv_HashCode): Cast object ptr to `unsigned long'
to avoid long long division.
2000-09-06 Tom Tromey <tromey@cygnus.com> 2000-09-06 Tom Tromey <tromey@cygnus.com>
* java/lang/reflect/Constructor.java (toString): Use `getName' for * java/lang/reflect/Constructor.java (toString): Use `getName' for
......
...@@ -164,8 +164,9 @@ inline jint ...@@ -164,8 +164,9 @@ inline jint
_Jv_HashCode (jobject obj) _Jv_HashCode (jobject obj)
{ {
// This was chosen to yield relatively well distributed results on // This was chosen to yield relatively well distributed results on
// both 32- and 64-bit architectures. // both 32- and 64-bit architectures. Note 0x7fffffff is prime.
return (jint) ((unsigned long long) obj % 0x7fffffff); // FIXME: we assume sizeof(long) == sizeof(void *).
return (jint) ((unsigned long) obj % 0x7fffffff);
} }
// Return a raw pointer to the elements of an array given the array // Return a raw pointer to the elements of an array given the array
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment