This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

jboolean is an unsigned type


This fixes a bug that goes back many, many years.

Inside the compiler jboolean is an unsigned type, but in the library
jboolean is a signed type.  We got away with this by accident.

I've done a fair bit of testing, and I'm pretty sure this won't break
any BC-compiled programs: none of the signatures change, for example.
It is possible that some CNI programs that hitherto have worked by
accident will break; we'll see.

Andrew.


2010-02-24  Andrew Haley  <aph@redhat.com>

        PR java/40816
        * include/jni_md.h: jboolean is an unsigned type.

Index: include/jni_md.h
===================================================================
--- include/jni_md.h    (revision 157011)
+++ include/jni_md.h    (working copy)
@@ -78,7 +78,7 @@
 typedef int    jshort __attribute__((__mode__(__HI__)));
 typedef int    jint   __attribute__((__mode__(__SI__)));
 typedef int    jlong  __attribute__((__mode__(__DI__)));
-typedef int    jboolean __attribute__((__mode__(__QI__)));
+typedef unsigned int   jboolean __attribute__((__mode__(__QI__)));
 typedef unsigned short jchar __attribute__((__mode__(__HI__)));
 typedef float  jfloat;
 typedef double jdouble;
@@ -99,7 +99,7 @@
 typedef float jfloat;
 typedef double jdouble;
 typedef jint jsize;
-typedef int8_t jboolean;
+typedef uint8_t jboolean;
 typedef uint16_t jchar;
 
 #  else /* JV_HAVE_INTTYPES_H */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]