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]

3.5 PATCH: Fix Tru64 UNIX V4.0F libjava bootstrap failure in natFileChannelPosix.cc


A mainline bootstrap on alpha-dec-osf4.0f failed in libjava:

gnu/java/nio/channels/natFileChannelImpl.cc: In member function `virtual java::nio::MappedByteBuffer* gnu::java::nio::channels::FileChannelImpl::mapImpl(jchar, jlong, jint)':
gnu/java/nio/channels/natFileChannelImpl.cc:487: error: ISO C++ forbids comparison between pointer and integer
make[3]: *** [gnu/java/nio/channels/natFileChannelImpl.lo] Error 1

The following trivial patch fixes this and allows the bootstrap to get
further (only to trip over PR bootstrap/14602 later).

Ok for mainline?

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University


Mon Mar 15 22:20:12 2004  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* gnu/java/nio/channels/natFileChannelPosix.cc (mapImpl): Cast
	MAP_FAILED to void *.

Index: libjava/gnu/java/nio/channels/natFileChannelPosix.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/nio/channels/natFileChannelPosix.cc,v
retrieving revision 1.2
diff -u -p -r1.2 natFileChannelPosix.cc
--- libjava/gnu/java/nio/channels/natFileChannelPosix.cc	13 Mar 2004 23:07:58 -0000	1.2
+++ libjava/gnu/java/nio/channels/natFileChannelPosix.cc	17 Mar 2004 17:40:33 -0000
@@ -504,7 +504,7 @@ FileChannelImpl::mapImpl (jchar mmode, j
   MappedByteBufferImpl *buf
     = new MappedByteBufferImpl ((RawData *) ((char *) ptr + align),
 				size, mmode == 'r');
-  if (ptr == MAP_FAILED)
+  if (ptr == (void *) MAP_FAILED)
     throw new IOException (JvNewStringLatin1 (strerror (errno)));
   buf->implPtr = reinterpret_cast<RawData*> (ptr);
   buf->implLen = size+align;


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