[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: compilation fixes for C++ compilers

Kaffe CVS cvs-commits at kaffe.org
Sun Nov 7 09:25:23 PST 2004


PatchSet 5414 
Date: 2004/11/07 17:21:29
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: compilation fixes for C++ compilers

2004-11-07  Dalibor Topic  <robilad at kaffe.org>

        * libraries/clib/net/PlainDatagramSocket:
        Resynced with GNU Classpath.

        2004-11-04  Torsten Rupp  <rupp at aicas.com>

        * native/jni/java-net/gnu_java_net_PlainDatagramSocketImpl.c:
        Replaced 'this' arguments by 'obj' to make source compatible with
        C++ compilers.

Members: 
	ChangeLog:1.2963->1.2964 
	libraries/clib/net/PlainDatagramSocketImpl.c:1.47->1.48 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2963 kaffe/ChangeLog:1.2964
--- kaffe/ChangeLog:1.2963	Sun Nov  7 16:18:24 2004
+++ kaffe/ChangeLog	Sun Nov  7 17:21:29 2004
@@ -1,5 +1,16 @@
 2004-11-07  Dalibor Topic  <robilad at kaffe.org>
 
+	* libraries/clib/net/PlainDatagramSocket:
+	Resynced with GNU Classpath.
+
+	2004-11-04  Torsten Rupp  <rupp at aicas.com>
+
+        * native/jni/java-net/gnu_java_net_PlainDatagramSocketImpl.c:
+        Replaced 'this' arguments by 'obj' to make source compatible with
+        C++ compilers.
+
+2004-11-07  Dalibor Topic  <robilad at kaffe.org>
+
 	* include/jni.h:
         Resynced with GNU Classpath.
 
Index: kaffe/libraries/clib/net/PlainDatagramSocketImpl.c
diff -u kaffe/libraries/clib/net/PlainDatagramSocketImpl.c:1.47 kaffe/libraries/clib/net/PlainDatagramSocketImpl.c:1.48
--- kaffe/libraries/clib/net/PlainDatagramSocketImpl.c:1.47	Fri Oct 15 19:00:30 2004
+++ kaffe/libraries/clib/net/PlainDatagramSocketImpl.c	Sun Nov  7 17:21:32 2004
@@ -100,23 +100,23 @@
  * Create a datagram socket.
  */
 void
-gnu_java_net_PlainDatagramSocketImpl_datagramSocketCreate(struct Hgnu_java_net_PlainDatagramSocketImpl* this)
+gnu_java_net_PlainDatagramSocketImpl_datagramSocketCreate(struct Hgnu_java_net_PlainDatagramSocketImpl* obj)
 {
 	int fd;
 	int rc;
 
 DBG(NATIVENET,
-	dprintf("datagram_create(%p)\n", this);
+	dprintf("datagram_create(%p)\n", obj);
 )
 
 	rc = KSOCKET(AF_INET, SOCK_DGRAM, 0, &fd);
 	if (rc) {
 		SignalError("java.net.SocketException", SYS_ERROR(rc));
 	}
-	unhand(this)->native_fd = fd;
+	unhand(obj)->native_fd = fd;
 
 DBG(NATIVENET,
-	dprintf("datagram_create(%p) -> fd=%d\n", this, fd);
+	dprintf("datagram_create(%p) -> fd=%d\n", obj, fd);
 )
 
 #if defined(SOL_SOCKET) && defined(SO_BROADCAST)
@@ -133,13 +133,13 @@
  * Bind a port to the socket (IPV4 version).
  */
 void
-gnu_java_net_PlainDatagramSocketImpl_bind(struct Hgnu_java_net_PlainDatagramSocketImpl* this, jint port,
+gnu_java_net_PlainDatagramSocketImpl_bind(struct Hgnu_java_net_PlainDatagramSocketImpl* obj, jint port,
 					  struct Hjava_net_InetAddress* laddr)
 {
 	int r;
 	KaffeSocketAddr addr;
 	int alen;
-	const int fd = unhand(this)->native_fd;
+	const int fd = unhand(obj)->native_fd;
 
 	memset(&addr, 0, sizeof(addr));
 	if (obj_length(unhand(laddr)->addr) == 4) {
@@ -156,7 +156,7 @@
 
 DBG(NATIVENET,
 	dprintf("datagram_bind4(%p, %s, %d)\n", 
-		this, ip2str(addr.addr4.sin_addr.s_addr), port);
+		obj, ip2str(addr.addr4.sin_addr.s_addr), port);
 )
 
 #if defined(HAVE_STRUCT_SOCKADDR_IN6)
@@ -174,7 +174,7 @@
 
 DBG(NATIVENET,
 	dprintf("datagram_bind6(%p, %s, %d)\n", 
-		this, ip62str(&addr.addr6.sin6_addr), port);
+		obj, ip62str(&addr.addr6.sin6_addr), port);
 )		
 #endif /* defined(HAVE_STRUCT_SOCKADDR_IN6) */
 
@@ -205,16 +205,16 @@
 		}
 		port = ntohs(addr.addr4.sin_port);
 	}
-	unhand(this)->localPort = port;
+	unhand(obj)->localPort = port;
 
 DBG(NATIVENET,
 	dprintf("  datagram_bind(%p, %s, -) -> (localPort: %d)\n",
-		this, ip2str(addr.addr4.sin_addr.s_addr), port);
+		obj, ip2str(addr.addr4.sin_addr.s_addr), port);
 )
 }
 
 void
-gnu_java_net_PlainDatagramSocketImpl_send0(struct Hgnu_java_net_PlainDatagramSocketImpl* this, struct Hjava_net_DatagramPacket* pkt)
+gnu_java_net_PlainDatagramSocketImpl_send0(struct Hgnu_java_net_PlainDatagramSocketImpl* obj, struct Hjava_net_DatagramPacket* pkt)
 {
 	int rc;
 	ssize_t bsent;
@@ -223,7 +223,7 @@
 	
 DBG(NATIVENET,
 	dprintf("datagram_send(%p, %p [%d bytes])\n",
-		this, pkt, unhand(pkt)->length);
+		obj, pkt, unhand(pkt)->length);
 )
 
         memset(&addr, 0, sizeof(addr));
@@ -268,7 +268,7 @@
 	    SignalError("java.net.SocketException", "Unsupported packet internet address");
 	}
 
-	rc = KSENDTO(unhand(this)->native_fd,
+	rc = KSENDTO(unhand(obj)->native_fd,
 		unhand_array(unhand(pkt)->buffer)->body, unhand(pkt)->length,
 		0, (struct sockaddr *)&addr, alen, &bsent);
 
@@ -282,14 +282,14 @@
 }
 
 jint
-gnu_java_net_PlainDatagramSocketImpl_peek(struct Hgnu_java_net_PlainDatagramSocketImpl* this, struct Hjava_net_InetAddress* addr)
+gnu_java_net_PlainDatagramSocketImpl_peek(struct Hgnu_java_net_PlainDatagramSocketImpl* obj, struct Hjava_net_InetAddress* addr)
 {
 	ssize_t r;
 	int rc;
 	KaffeSocketAddr saddr;
 	int alen = sizeof(saddr);
 
-	rc = KRECVFROM(unhand(this)->native_fd,
+	rc = KRECVFROM(unhand(obj)->native_fd,
 		0, 0, MSG_PEEK, (struct sockaddr*)&saddr,
 		&alen, NOTIMEOUT /* timeout */, &r);
 	if (rc) {
@@ -311,7 +311,7 @@
 }
 
 void
-gnu_java_net_PlainDatagramSocketImpl_receive0(struct Hgnu_java_net_PlainDatagramSocketImpl* this, struct Hjava_net_DatagramPacket* pkt)
+gnu_java_net_PlainDatagramSocketImpl_receive0(struct Hgnu_java_net_PlainDatagramSocketImpl* obj, struct Hjava_net_DatagramPacket* pkt)
 {
 	ssize_t r;
 	int rc;
@@ -320,27 +320,27 @@
 	HArrayOfByte *array_address;
 	int to_read, offset;
 
-	assert(this != NULL);
+	assert(obj != NULL);
 	if (pkt == NULL || unhand(pkt)->buffer == NULL)
 		SignalError("java.lang.NullPointerException", "null datagram packet");
 	assert(unhand(pkt)->length <= unhand(unhand(pkt)->buffer)->length);
 
 DBG(NATIVENET,
 	dprintf("datagram_receive(%p, %p [%d bytes])\n",
-		this, pkt, unhand(pkt)->length);
+		obj, pkt, unhand(pkt)->length);
 )
 
 	/* Which port am I receiving from */
-	addr.addr4.sin_port = htons(unhand(this)->localPort);
+	addr.addr4.sin_port = htons(unhand(obj)->localPort);
 
 	/* XXX should assert (unhand(pkt)->length <= unhand_array(unhand(pkt)->buf)->length), no? */
         offset = unhand(pkt)->offset; 
 	to_read = unhand(pkt)->length;
         do { 
-	        rc = KRECVFROM(unhand(this)->native_fd,
+	        rc = KRECVFROM(unhand(obj)->native_fd,
 			       &(unhand_array(unhand(pkt)->buffer)->body)[offset],
 			       (unsigned)to_read, 0, (struct sockaddr*)&addr,
-			       &alen, unhand(this)->timeout, &r);
+			       &alen, unhand(obj)->timeout, &r);
 		switch( rc )
 		{
 		case 0:
@@ -400,7 +400,7 @@
 
 DBG(NATIVENET,
 	dprintf("  datagram_receive(%p, %p) -> from %s:%d; brecv=%ld\n",
-		this, pkt, ip2str(ntohl(addr.addr4.sin_addr.s_addr)),
+		obj, pkt, ip2str(ntohl(addr.addr4.sin_addr.s_addr)),
 		ntohs(addr.addr4.sin_port), (long) r);
 )
 }
@@ -409,17 +409,17 @@
  * Close the socket.
  */
 void
-gnu_java_net_PlainDatagramSocketImpl_datagramSocketClose(struct Hgnu_java_net_PlainDatagramSocketImpl* this)
+gnu_java_net_PlainDatagramSocketImpl_datagramSocketClose(struct Hgnu_java_net_PlainDatagramSocketImpl* obj)
 {
 	int r;
 
 DBG(NATIVENET,
-	dprintf("datagram_close(%p)\n", this);
+	dprintf("datagram_close(%p)\n", obj);
 )
 
-	if (unhand(this)->native_fd != -1) {
-		r = KSOCKCLOSE(unhand(this)->native_fd);
-		unhand(this)->native_fd = -1;
+	if (unhand(obj)->native_fd != -1) {
+		r = KSOCKCLOSE(unhand(obj)->native_fd);
+		unhand(obj)->native_fd = -1;
 		if (r) {
 			SignalError("java.net.SocketException", SYS_ERROR(r));
 		}
@@ -428,7 +428,7 @@
 
 
 void
-gnu_java_net_PlainDatagramSocketImpl_socketSetOption(struct Hgnu_java_net_PlainDatagramSocketImpl* this, jint opt, struct Hjava_lang_Object* arg)
+gnu_java_net_PlainDatagramSocketImpl_socketSetOption(struct Hgnu_java_net_PlainDatagramSocketImpl* obj, jint opt, struct Hjava_lang_Object* arg)
 {
 	struct Hjava_net_InetAddress* addrp;
 	int k, v, r;
@@ -437,7 +437,7 @@
 	for (k = 0; k < sizeof(socketOptions) / sizeof(*socketOptions); k++) {
 		if (opt == socketOptions[k].jopt) {
 			v = unhand((struct Hjava_lang_Integer*)arg)->value;
-			r = KSETSOCKOPT(unhand(this)->native_fd,
+			r = KSETSOCKOPT(unhand(obj)->native_fd,
 				socketOptions[k].level, socketOptions[k].copt,
 				&v, sizeof(v));
 			if (r) {
@@ -459,7 +459,7 @@
 			memcpy(&ia, unhand_byte_array(unhand(addrp)->addr),
 			       sizeof(ia));
 
-			r = KSETSOCKOPT(unhand(this)->native_fd,
+			r = KSETSOCKOPT(unhand(obj)->native_fd,
 					IPPROTO_IP,
 					IP_MULTICAST_IF,
 					&ia,
@@ -488,7 +488,7 @@
 }
 
 jint
-gnu_java_net_PlainDatagramSocketImpl_socketGetOption(struct Hgnu_java_net_PlainDatagramSocketImpl* this, jint opt)
+gnu_java_net_PlainDatagramSocketImpl_socketGetOption(struct Hgnu_java_net_PlainDatagramSocketImpl* obj, jint opt)
 {
 	int k, r, v;
 	int vsize = sizeof(v);
@@ -500,7 +500,7 @@
 	/* Do easy cases */
 	for (k = 0; k < sizeof(socketOptions) / sizeof(*socketOptions); k++) {
 		if (opt == socketOptions[k].jopt) {
-			r = KGETSOCKOPT(unhand(this)->native_fd,
+			r = KGETSOCKOPT(unhand(obj)->native_fd,
 				socketOptions[k].level, socketOptions[k].copt,
 				&v, &vsize);
 			if (r) {
@@ -513,7 +513,7 @@
 
 	switch(opt) {
 	case java_net_SocketOptions_SO_BINDADDR:
-		r = KGETSOCKNAME(unhand(this)->native_fd,
+		r = KGETSOCKNAME(unhand(obj)->native_fd,
 			(struct sockaddr*)&addr, &alen);
 		if (r) {
 			SignalError("java.net.SocketException", SYS_ERROR(r));
@@ -523,7 +523,7 @@
 
 #if defined(IP_MULTICAST_IF)
 	case java_net_SocketOptions_IP_MULTICAST_IF:
-		r = KGETSOCKOPT(unhand(this)->native_fd,
+		r = KGETSOCKOPT(unhand(obj)->native_fd,
 			IPPROTO_IP, IP_MULTICAST_IF, &ia, &ia_len);
 		if (r) {
 			SignalError("java.net.SocketException", SYS_ERROR(r));
@@ -545,7 +545,7 @@
  * Join multicast group
  */
 void
-gnu_java_net_PlainDatagramSocketImpl_join(struct Hgnu_java_net_PlainDatagramSocketImpl* this, struct Hjava_net_InetAddress* laddr)
+gnu_java_net_PlainDatagramSocketImpl_join(struct Hgnu_java_net_PlainDatagramSocketImpl* obj, struct Hjava_net_InetAddress* laddr)
 {
 
 #if defined(IP_ADD_MEMBERSHIP)
@@ -558,16 +558,16 @@
 	       sizeof(ipm.imr_multiaddr));
 	
         iface_addr =
-	  gnu_java_net_PlainDatagramSocketImpl_socketGetOption(this, 
+	  gnu_java_net_PlainDatagramSocketImpl_socketGetOption(obj, 
 	    java_net_SocketOptions_IP_MULTICAST_IF);
 	ipm.imr_interface.s_addr = htonl(iface_addr);
 	
 DBG(NATIVENET,
 	dprintf("datagram_join (%p, %p) => %s\n",
-		this, laddr, ip2str(ipm.imr_interface.s_addr));
+		obj, laddr, ip2str(ipm.imr_interface.s_addr));
    )
 
-	r = KSETSOCKOPT(unhand(this)->native_fd,
+	r = KSETSOCKOPT(unhand(obj)->native_fd,
 		IPPROTO_IP, IP_ADD_MEMBERSHIP, &ipm, sizeof(ipm));
 	if (r) {
 		SignalError("java.io.IOException", SYS_ERROR(r));
@@ -583,7 +583,7 @@
  * leave multicast group
  */
 void
-gnu_java_net_PlainDatagramSocketImpl_leave(struct Hgnu_java_net_PlainDatagramSocketImpl* this, struct Hjava_net_InetAddress* laddr)
+gnu_java_net_PlainDatagramSocketImpl_leave(struct Hgnu_java_net_PlainDatagramSocketImpl* obj, struct Hjava_net_InetAddress* laddr)
 {
 
 #if defined(IP_DROP_MEMBERSHIP)
@@ -596,16 +596,16 @@
 	       sizeof(ipm.imr_multiaddr));
 
         iface_addr = 
-	  gnu_java_net_PlainDatagramSocketImpl_socketGetOption(this, 
+	  gnu_java_net_PlainDatagramSocketImpl_socketGetOption(obj, 
 	    java_net_SocketOptions_IP_MULTICAST_IF);
 	ipm.imr_interface.s_addr = htonl(iface_addr);
 
 DBG(NATIVENET,
 	dprintf("datagram_leave (%p, %p) => %s\n",
-		this, laddr, ip2str(ipm.imr_interface.s_addr));
+		obj, laddr, ip2str(ipm.imr_interface.s_addr));
    )
 
-	r = KSETSOCKOPT(unhand(this)->native_fd,
+	r = KSETSOCKOPT(unhand(obj)->native_fd,
 		IPPROTO_IP, IP_DROP_MEMBERSHIP, &ipm, sizeof(ipm));
 	if (r) {
 		SignalError("java.io.IOException", SYS_ERROR(r));
@@ -621,7 +621,7 @@
  * Join multicast group
  */
 void
-gnu_java_net_PlainDatagramSocketImpl_joinGroup(struct Hgnu_java_net_PlainDatagramSocketImpl* this, struct Hjava_net_SocketAddress *jsa, struct Hjava_net_NetworkInterface *jni)
+gnu_java_net_PlainDatagramSocketImpl_joinGroup(struct Hgnu_java_net_PlainDatagramSocketImpl* obj, struct Hjava_net_SocketAddress *jsa, struct Hjava_net_NetworkInterface *jni)
 {
 
 #if defined(IP_ADD_MEMBERSHIP)
@@ -638,7 +638,7 @@
 
 DBG(NATIVENET,
 	dprintf("  datagram_joinGroup(%p, %p, %p) -> join %s\n",
-		this, jsa, jni, ip2str(ipm.imr_multiaddr.s_addr));
+		obj, jsa, jni, ip2str(ipm.imr_multiaddr.s_addr));
    )
 
 	if( jni && obj_length(unhand(unhand(jni)->inetAddresses)->elementData) != 0)
@@ -652,11 +652,11 @@
 	else
 	{
 	  ipm.imr_interface.s_addr =
-	    gnu_java_net_PlainDatagramSocketImpl_socketGetOption(this, 
+	    gnu_java_net_PlainDatagramSocketImpl_socketGetOption(obj, 
 	      java_net_SocketOptions_IP_MULTICAST_IF);
 	}
 
-	r = KSETSOCKOPT(unhand(this)->native_fd,
+	r = KSETSOCKOPT(unhand(obj)->native_fd,
 			IPPROTO_IP,
 			IP_ADD_MEMBERSHIP,
 			&ipm,
@@ -675,7 +675,7 @@
  * Leave multicast group
  */
 void
-gnu_java_net_PlainDatagramSocketImpl_leaveGroup(struct Hgnu_java_net_PlainDatagramSocketImpl* this, struct Hjava_net_SocketAddress *jsa, struct Hjava_net_NetworkInterface *jni)
+gnu_java_net_PlainDatagramSocketImpl_leaveGroup(struct Hgnu_java_net_PlainDatagramSocketImpl* obj, struct Hjava_net_SocketAddress *jsa, struct Hjava_net_NetworkInterface *jni)
 {
 
 #if defined(IP_ADD_MEMBERSHIP)
@@ -701,11 +701,11 @@
 	else
 	{
 	  ipm.imr_interface.s_addr =
-	    gnu_java_net_PlainDatagramSocketImpl_socketGetOption(this, 
+	    gnu_java_net_PlainDatagramSocketImpl_socketGetOption(obj, 
 	      java_net_SocketOptions_IP_MULTICAST_IF);
 	}
 
-	r = KSETSOCKOPT(unhand(this)->native_fd,
+	r = KSETSOCKOPT(unhand(obj)->native_fd,
 			IPPROTO_IP,
 			IP_DROP_MEMBERSHIP,
 			&ipm,
@@ -724,14 +724,14 @@
  * set multicast-TTL
  */
 void
-gnu_java_net_PlainDatagramSocketImpl_setTTL(struct Hgnu_java_net_PlainDatagramSocketImpl* this, jbool ttl)
+gnu_java_net_PlainDatagramSocketImpl_setTTL(struct Hgnu_java_net_PlainDatagramSocketImpl* obj, jbool ttl)
 {
 
 #if defined(IP_MULTICAST_TTL)
 	int r;
 	unsigned char v = (unsigned char)ttl;
 
-	r = KSETSOCKOPT(unhand(this)->native_fd,
+	r = KSETSOCKOPT(unhand(obj)->native_fd,
 		IPPROTO_IP, IP_MULTICAST_TTL, &v, sizeof(v));
 	if (r) {
 		SignalError("java.io.IOException", SYS_ERROR(r));
@@ -747,7 +747,7 @@
  * get multicast-TTL
  */
 jbyte
-gnu_java_net_PlainDatagramSocketImpl_getTTL(struct Hgnu_java_net_PlainDatagramSocketImpl* this)
+gnu_java_net_PlainDatagramSocketImpl_getTTL(struct Hgnu_java_net_PlainDatagramSocketImpl* obj)
 {
 
 #if defined(IP_MULTICAST_TTL)
@@ -755,7 +755,7 @@
 	int s = 1;
 	int r;
 
-	r = KGETSOCKOPT(unhand(this)->native_fd,
+	r = KGETSOCKOPT(unhand(obj)->native_fd,
 		IPPROTO_IP, IP_MULTICAST_TTL, &v, &s);
 	if (r) {
 		SignalError("java.io.IOException", SYS_ERROR(r));
@@ -767,3 +767,4 @@
 #endif /* defined(IP_MULTICAST_TTL) */
 
 }
+




More information about the kaffe mailing list