[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Patch: java problems, llrint() macro truncates result t

From: Juergen Keil
Subject: Re: [Qemu-devel] Patch: java problems, llrint() macro truncates result to 32-bit [was: 0.60 Solaris 9 problems.]
Date: Tue, 14 Sep 2004 15:44:39 +0200 (CEST)

> > The java virtual machine included in Solaris x86
> > does not work
> > for me.  When I start "java", I get:
> Sounds like It'll be some time before I start worrying
> about a lack of JVM. 

Reason for the java VM crash was a buggy llrint() macro in target-i386/exec.h,
it was truncating the result to a 32-bit value, on "_BSD" platforms.

(I'm using the _BSD code on the Solaris platform)

The following patch fixes the problem:

Index: target-i386/exec.h
RCS file: /cvsroot/qemu/qemu/target-i386/exec.h,v
retrieving revision 1.14
diff -u -B -r1.14 exec.h
--- target-i386/exec.h  5 Jul 2004 21:25:17 -0000       1.14
+++ target-i386/exec.h  14 Sep 2004 13:38:34 -0000
@@ -310,12 +314,12 @@
 #define rint rintl
 #if !defined(_BSD)
 extern int lrint(CPU86_LDouble x);
 extern int64_t llrint(CPU86_LDouble x);
-#define lrint(d)               ((int)rint(d))
-#define llrint(d)              ((int)rint(d))
+#define lrint(d)               ((long)rint(d))
+#define llrint(d)              ((long long)rint(d))
 extern CPU86_LDouble fabs(CPU86_LDouble x);
 extern CPU86_LDouble sin(CPU86_LDouble x);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]