[kaffe] CVS kaffe (doogie): Fix some -Wtraditional warnings(mostly signed/unsigned type) by adding

Kaffe CVS cvs-commits at kaffe.org
Tue May 31 11:02:46 PDT 2005


PatchSet 6602 
Date: 2005/05/31 17:55:53
Author: doogie
Branch: HEAD
Tag: (none) 
Log:
Fix some -Wtraditional warnings(mostly signed/unsigned type) by adding
either casts or changing types.

Members: 
	ChangeLog:1.4128->1.4129 
	include/jsyscall.h:1.20->1.21 
	kaffe/kaffevm/systems/unix-pthreads/signal.c:1.21->1.22 
	kaffe/kaffevm/systems/unix-pthreads/thread-internal.h:INITIAL->1.40 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c:1.11->1.12 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c:1.4->1.5 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c:1.5->1.6 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c:1.3->1.4 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c:1.5->1.6 
	libraries/clib/classpath/native_state.c:1.2->1.3 
	libraries/clib/io/java_io_VMObjectStreamClass.c:1.1->1.2 
	libraries/clib/native/Method.c:1.43->1.44 
	libraries/clib/native/Object.c:1.15->1.16 
	libraries/clib/net/InetAddressImpl.c:1.32->1.33 
	libraries/clib/net/PlainDatagramSocketImpl.c:1.53->1.54 
	libraries/clib/nio/java_nio_VMDirectByteBuffer.c:1.6->1.7 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4128 kaffe/ChangeLog:1.4129
--- kaffe/ChangeLog:1.4128	Mon May 30 21:15:57 2005
+++ kaffe/ChangeLog	Tue May 31 17:55:53 2005
@@ -1,3 +1,21 @@
+2005-05-31  Adam Heath  <doogie at brainfood.com>
+
+	* include/jsyscall.h, kaffe/kaffevm/systems/unix-pthreads/signal.c,
+	  kaffe/kaffevm/systems/unix-pthreads/thread-internal.h,
+	  libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c,
+	  libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c,
+	  libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c,
+	  libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c,
+	  libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c,
+	  libraries/clib/classpath/native_state.c,
+	  libraries/clib/io/java_io_VMObjectStreamClass.c,
+	  libraries/clib/native/Method.c, libraries/clib/native/Object.c,
+	  libraries/clib/net/InetAddressImpl.c,
+	  libraries/clib/net/PlainDatagramSocketImpl.c,
+	  libraries/clib/nio/java_nio_VMDirectByteBuffer.c:
+	  Fix some -Wtraditional warnings(mostly signed/unsigned type) by
+	  adding either casts or changing types.
+
 2005-05-30  Helmer Kraemer  <hkraemer at freenet.de>
 
 	* libraries/javalib/kaffe/lang/AppClassLoader.java,
Index: kaffe/include/jsyscall.h
diff -u kaffe/include/jsyscall.h:1.20 kaffe/include/jsyscall.h:1.21
--- kaffe/include/jsyscall.h:1.20	Tue May  3 20:43:03 2005
+++ kaffe/include/jsyscall.h	Tue May 31 17:55:49 2005
@@ -69,8 +69,8 @@
 	int	(*_remove)(const char *);
 
 	int	(*_socket)(int, int, int, int *);
-	int	(*_connect)(int, struct sockaddr *, int, int timeout);
-	int	(*_bind)(int, struct sockaddr *, int);
+	int	(*_connect)(int, struct sockaddr *, socklen_t, int timeout);
+	int	(*_bind)(int, struct sockaddr *, socklen_t);
 	int	(*_listen)(int, int);
 	int	(*_accept)(int, struct sockaddr *, socklen_t*, int, int *);
 	int	(*_sockread)(int, void*, size_t, int, ssize_t *);
Index: kaffe/kaffe/kaffevm/systems/unix-pthreads/signal.c
diff -u kaffe/kaffe/kaffevm/systems/unix-pthreads/signal.c:1.21 kaffe/kaffe/kaffevm/systems/unix-pthreads/signal.c:1.22
--- kaffe/kaffe/kaffevm/systems/unix-pthreads/signal.c:1.21	Sun Apr 24 13:46:09 2005
+++ kaffe/kaffe/kaffevm/systems/unix-pthreads/signal.c	Tue May 31 17:55:49 2005
@@ -368,7 +368,7 @@
  * value it has detected.
  */
 void
-detectStackBoundaries(jthread_t jtid, int mainThreadStackSize)
+detectStackBoundaries(jthread_t jtid, size_t mainThreadStackSize)
 {
         void *stackPointer;
 
@@ -386,7 +386,7 @@
  */
 
 void
-detectStackBoundaries(jthread_t jtid, int mainThreadStackSize)
+detectStackBoundaries(jthread_t jtid, size_t mainThreadStackSize)
 {
         void *stackPointer;
 
@@ -405,7 +405,7 @@
  */
 
 void
-detectStackBoundaries(jthread_t jtid, int mainThreadStackSize)
+detectStackBoundaries(jthread_t jtid, size_t mainThreadStackSize)
 {
         void *stackPointer;
 
@@ -442,7 +442,7 @@
  * the faulty adress directly.
  */
 void
-detectStackBoundaries(jthread_t jtid, int mainThreadStackSize)
+detectStackBoundaries(jthread_t jtid, size_t mainThreadStackSize)
 {
 	static volatile char *guessPointer;
 	void *handler_segv, *handler_bus;
@@ -504,7 +504,7 @@
  */
 
 void
-detectStackBoundaries(jthread_t jtid, int mainThreadStackSize)
+detectStackBoundaries(jthread_t jtid, size_t mainThreadStackSize)
 {
 #if defined(STACK_GROWS_UP)
 	jtid->stackMin = (void*)(uintp)(&jtid - 0x100);
===================================================================
Checking out kaffe/kaffe/kaffevm/systems/unix-pthreads/thread-internal.h
RCS:  /home/cvs/kaffe/kaffe/kaffe/kaffevm/systems/unix-pthreads/thread-internal.h,v
VERS: 1.40
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/kaffe/kaffevm/systems/unix-pthreads/thread-internal.h	Tue May 31 18:02:44 2005
@@ -0,0 +1,362 @@
+/*
+ * thread-impl.h - pthread based ThreadInterface implementation
+ *
+ * Copyright (c) 1998
+ *      Transvirtual Technologies, Inc.  All rights reserved.
+ *
+ * Copyright (c) 2005
+ *      Kaffe.org contributors.  See ChangeLog for details.
+ *      All rights reserved.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file.
+ */
+
+#ifndef __thread_internal_h
+#define __thread_internal_h
+
+#define __USE_GNU
+#include <pthread.h>
+#include "repsemaphore.h"
+
+#include "gtypes.h"
+#include "threadData.h"
+#include "debug.h"
+
+#if !defined(STACKREDZONE)
+#define STACKREDZONE    8192
+#endif
+
+/* For jthread_get_status */
+#define THREAD_SUSPENDED	0
+#define THREAD_RUNNING		1
+#define THREAD_DEAD		2
+#define THREAD_KILL		3
+
+/* suspend states (these are exclusive) */
+typedef enum {
+  SS_PENDING_SUSPEND =  0x01,  /* suspend signal has been sent, but not handled */
+  SS_SUSPENDED       =  0x02,  /* suspend signal has been handled */
+  SS_PENDING_RESUME  =  0x04   /* resume signal  has been sent */
+} suspend_state_t;
+
+/* blocking states (might be accumulative) */
+typedef enum {
+  BS_THREAD          =  0x01,  /* blocked on tLock (thread system internal) */
+  BS_MUTEX           =  0x02,  /* blocked on a external mutex lock */
+  BS_CV              =  0x04,  /* blocked on a external convar wait */
+  BS_CV_TO           =  0x08,   /* blocked on a external convar timeout wait */
+  BS_SYSCALL         =  0x10  /* blocked on a real blocking syscall */
+} block_state_t;
+
+/*
+ * 'jthread' is our link between native and Java thread objects.
+ * It also serves as a container for our pthread extensions (namely
+ * enumeration, and inter-thread suspend)
+ */
+typedef struct _jthread {
+  threadData		data;
+  /* these are our links to the native pthread implementation */
+  pthread_t             tid;
+  pthread_attr_t        attr;
+
+  /* To release the lock */
+  pthread_mutex_t       suspendLock;
+
+  /* wether this is a daemon thread */
+  int			daemon;
+  int                   interrupting;
+  char                  status;
+
+  /* convars and mutexes aren't useful in signal handlers, semaphores are */
+  repsem_t                 sem;
+
+  /* the following fields hold our extensions */
+  int                   active;         /* are we in our user thread function 'func'? */
+  suspend_state_t       suspendState;   /* are we suspended for a critSection?  */
+  block_state_t         blockState;     /* are we in a Lwait or Llock (can handle signals)? */
+
+  void                  (*func)(void*);  /* this kicks off the user thread func */
+  void                  *stackMin;
+  void                  *stackCur;      /* just useful if blocked or suspended */
+  void                  *stackMax;
+
+  struct _jthread	*next;
+} *jthread_t;
+
+extern pthread_key_t   ntKey;
+
+/**
+ * Returns the current native thread.
+ *
+ */
+jthread_t jthread_current(void);
+
+/**
+ * Attaches the calling thread to the vm.
+ *
+ * @param is_daemon wether the thread is to be treated as a daemon thread
+ *
+ */
+bool jthread_attach_current_thread (bool is_daemon);
+
+/**
+ * Detaches the calling thread from the vm.
+ *
+ */
+bool jthread_detach_current_thread (void);
+
+void jthread_sleep (jlong timeout);
+
+/**
+ * Disable stopping the calling thread.
+ *
+ * Needed to avoid stopping a thread while it holds a lock.
+ */
+void jthread_disable_stop(void);
+
+/**
+ * Enable stopping the calling thread.
+ *
+ * Needed to avoid stopping a thread while it holds a lock.
+ */
+void jthread_enable_stop(void);
+
+/** 
+ * Stop a thread.
+ * 
+ * @param tid the thread to stop.
+ */
+void jthread_stop(UNUSED jthread_t tid);
+
+/**
+ * Interrupt a thread.
+ * 
+ * @param tid the thread to interrupt
+ */
+void jthread_interrupt(jthread_t tid);
+
+/**
+ * Register a function to be called when the all non-daemon threads have exited.
+ * 
+ * @param func the func to execute.
+ */
+void jthread_atexit(void (* func)(void));
+
+/**
+ * Dump some information about a thread to stderr.
+ *
+ * @param tid the thread whose info is to be dumped.
+ */
+void jthread_dumpthreadinfo(UNUSED jthread_t tid);
+
+/**
+ * Return the java.lang.Thread instance attached to a thread
+ *
+ * @param tid the native thread whose corresponding java thread
+ *            is to be returned.
+ * @return the java.lang.Thread instance.
+ */
+threadData *jthread_get_data(jthread_t tid);
+
+/**
+ * Test whether an address is on the stack of the calling thread.
+ *
+ * @param p the address to check
+ *
+ * @return true if address is on the stack
+ *
+ * Needed for locking and for exception handling.
+ */
+bool jthread_on_current_stack(void* p);
+
+/**
+ * Check for room on stack.
+ *
+ * @param left number of bytes that are needed
+ *
+ * @return true if @left bytes are free, otherwise false 
+ *
+ * Needed by intrp in order to implement stack overflow checking.
+ */
+bool jthread_stackcheck(int left);
+
+/**
+ * Extract the range of the stack that's in use.
+ * 
+ * @param tid the thread whose stack is to be examined
+ * @param from storage for the address of the start address
+ * @param len storage for the size of the used range
+ *
+ * @return true if successful, otherwise false
+ *
+ * Needed by the garbage collector.
+ */
+bool jthread_extract_stack(jthread_t tid, void** from, unsigned* len);
+
+/**
+ * Returns the upper bound of the stack of the calling thread.
+ *
+ * Needed by support.c in order to implement stack overflow checking. 
+ */
+void* jthread_stacklimit(void);
+
+/*
+ * Get the current stack limit.
+ */
+void jthread_relaxstack(int yes);
+
+/**
+ * yield.
+ *
+ */
+void jthread_yield (void);
+
+/**
+ * Acquire a spin lock.
+ *
+ */
+void jthread_spinon(UNUSED void *dummy);
+
+/**
+ * Release a spin lock.
+ *
+ */
+void jthread_spinoff(UNUSED void *dummy);
+
+struct _exceptionFrame;
+typedef void (*exchandler_t)(struct _exceptionFrame*);
+
+/**
+ * Initialize handlers for null pointer accesses and div by zero        
+ *
+ */             
+void jthread_initexceptions(exchandler_t _nullHandler,
+			    exchandler_t _floatingHandler,
+			    exchandler_t _stackOverflowHandler);
+
+/**
+ * Initialize the thread subsystem.
+ *
+ */
+struct _Collector;
+void jthread_init(int preemptive,                	/* preemptive scheduling */
+		  int maxpr,                     	/* maximum priority */
+		  int minpr,                     	/* minimum priority */
+		  struct _Collector *collector,
+		  void (*_destructor1)(void*),		/* called when a thread exits */
+		  void (*_onstop)(void),		/* called when a thread is stopped */
+		  void (*_ondeadlock)(void));		/* called when we detect deadlock */
+
+
+/**
+ * Bind the main thread of the vm to a java.lang.Thread instance.
+ *
+ */
+jthread_t jthread_createfirst(size_t, unsigned int, void*);
+
+/**
+ * Create a new native thread.
+ *
+ */
+jthread_t jthread_create (unsigned int pri, void* func, int is_daemon,
+			  void* jlThread, size_t threadStackSize );
+
+
+/**
+ * Set the priority of a native thread.
+ *
+ */
+void jthread_setpriority (jthread_t thread, jint prio);
+
+/**
+ * Called by thread.c when a thread is finished. 
+ * 
+ */
+void jthread_exit ( void );
+
+/**
+ * Destroys the a native thread.
+ *
+ * @param thread the thread to destroy.
+ *
+ * Called when finalizing a java.lang.Thread instance.
+ */
+void jthread_destroy (jthread_t thread);
+
+/**
+ * Lock the special GC mutex. This mutex must be available to anyone doing
+ * some GC sensitive operations (like intra-thread handling and the GC itself).
+ * It may not be handled using the standard scheme as we can neither use fast
+ * lock at some point of the thread handling nor the standard mutex for
+ * the same reason. This call must be available in any circumstances after 
+ * jthread_init.
+ */
+void jthread_lockGC(void);
+
+/**
+ * Unlock the special GC mutex.
+ */
+void jthread_unlockGC(void);
+
+/**
+ * Suspends all threads but the calling one. 
+ *
+ * Currently needed by the garbage collector.
+ */
+void jthread_suspendall (void);
+
+/**
+ * Unsuspends all threads but the calling one. 
+ *
+ * Currently needed by the garbage collector.
+ */
+void jthread_unsuspendall (void);
+
+/**
+ * Call a function once for each active thread.
+ * Caution. This should only be used when all threads
+ * are suspended using jthread_suspendall.
+ */
+void jthread_walkLiveThreads (void(*)(jthread_t,void*), void *);
+
+/**
+ * Call a function once for each active thread.
+ * This is a reentrant version.
+ */
+void jthread_walkLiveThreads_r (void(*)(jthread_t,void*), void *);
+
+/**
+ * Return thread status
+ */
+int jthread_get_status (jthread_t thread);
+
+/**
+ * Specify the blocking state of a file descriptor
+ */
+void jthread_set_blocking (int fd, int blocking);
+
+/**
+ * Check the blocking state of a file descriptor
+ */
+int jthread_is_blocking (int fd);
+
+void jthread_suspend(UNUSED jthread_t jt, UNUSED void *suspender);
+
+void jthread_resume(UNUSED jthread_t jt, UNUSED void *suspender);
+
+jthread_t jthread_from_data(UNUSED threadData *td, UNUSED void *suspender);
+
+jlong jthread_get_usage(UNUSED jthread_t jt);
+
+int jthread_is_interrupted(jthread_t jt);
+
+int jthread_interrupted(jthread_t jt);
+
+void KaffePThread_WaitForResume(int releaseMutex, unsigned int state);
+void KaffePThread_AckAndWaitForResume(jthread_t cur, unsigned int newState);
+int KaffePThread_getSuspendSignal(void);
+
+void detectStackBoundaries(jthread_t jtid, size_t mainThreadStackSize);
+
+#endif /* __thread_impl_h */
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c:1.11 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c:1.12
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c:1.11	Sun Feb 13 22:32:09 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c	Tue May 31 17:55:50 2005
@@ -65,7 +65,7 @@
 {
   /* GDK_A through GDK_Z */
   if (keyCode >= VK_A && keyCode <= VK_Z)
-    return gdk_keyval_to_lower (keyCode);
+    return gdk_keyval_to_lower ((unsigned int) keyCode);
 
   /* GDK_0 through GDK_9 */
   if (keyCode >= VK_0 && keyCode <= VK_9)
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c:1.4 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c:1.5
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c:1.4	Tue Dec 21 08:06:34 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c	Tue May 31 17:55:50 2005
@@ -106,7 +106,7 @@
 
   gdk_threads_enter ();
   list = gtk_container_children (GTK_CONTAINER (ptr));
-  list = g_list_nth (list, i);
+  list = g_list_nth (list, (unsigned int) i);
   gtk_container_remove (GTK_CONTAINER (ptr), GTK_WIDGET (list->data));
   gdk_threads_leave ();
 }
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c:1.5 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c:1.6
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c:1.5	Tue Dec 21 08:06:34 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c	Tue May 31 17:55:50 2005
@@ -144,7 +144,7 @@
   if (key)
     {
       gtk_widget_add_accelerator (GTK_WIDGET (ptr2), "activate",
-				  gtk_menu_get_accel_group (GTK_MENU (menu)), key, 
+				  gtk_menu_get_accel_group (GTK_MENU (menu)), (unsigned int) key, 
 				  (GDK_CONTROL_MASK
 				   | ((shift) ? GDK_SHIFT_MASK : 0)), 
 				  GTK_ACCEL_VISIBLE);
@@ -164,7 +164,7 @@
 
   gdk_threads_enter ();
   list = gtk_container_children (GTK_CONTAINER (ptr));
-  list = g_list_nth (list, i);
+  list = g_list_nth (list, (unsigned int) i);
   gtk_container_remove (GTK_CONTAINER (ptr), GTK_WIDGET (list->data));
   gdk_threads_leave ();
 }
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c:1.3 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c:1.4
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c:1.3	Wed Oct 27 22:15:43 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c	Tue May 31 17:55:50 2005
@@ -101,7 +101,7 @@
 
   buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
   gtk_text_buffer_get_iter_at_offset (buf, &iter, pos);
-  gtk_text_buffer_insert (buf, &iter, str, strlen (str));
+  gtk_text_buffer_insert (buf, &iter, str, (size_t) strlen (str));
 
   gdk_threads_leave ();
 
@@ -134,7 +134,7 @@
   gtk_text_buffer_delete (buf, &startIter, &endIter);
 
   gtk_text_buffer_get_iter_at_offset (buf, &iter, mystart);
-  gtk_text_buffer_insert(buf, &iter, str, strlen (str));
+  gtk_text_buffer_insert(buf, &iter, str, (size_t) strlen (str));
 
   gdk_threads_leave ();
   (*env)->ReleaseStringUTFChars (env, contents, str);
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c:1.5 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c:1.6
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c:1.5	Sun Feb 13 22:32:12 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c	Tue May 31 17:55:50 2005
@@ -479,7 +479,7 @@
       if (text)
 	{
 	  buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
-	  gtk_text_buffer_set_text (buf, str, strlen (str));
+	  gtk_text_buffer_set_text (buf, str, (ssize_t) strlen (str));
 	}
     }
 
Index: kaffe/libraries/clib/classpath/native_state.c
diff -u kaffe/libraries/clib/classpath/native_state.c:1.2 kaffe/libraries/clib/classpath/native_state.c:1.3
--- kaffe/libraries/clib/classpath/native_state.c:1.2	Thu Feb 10 23:07:58 2005
+++ kaffe/libraries/clib/classpath/native_state.c	Tue May 31 17:55:50 2005
@@ -59,7 +59,7 @@
   table = (struct state_table *) malloc (sizeof (struct state_table));
   table->size = size;
   table->head = (struct state_node **) calloc (sizeof (struct state_node *),
-					       table->size);
+					       (size_t) table->size);
   table->hash = hash;
   table->clazz = clazz_g;
 
Index: kaffe/libraries/clib/io/java_io_VMObjectStreamClass.c
diff -u kaffe/libraries/clib/io/java_io_VMObjectStreamClass.c:1.1 kaffe/libraries/clib/io/java_io_VMObjectStreamClass.c:1.2
--- kaffe/libraries/clib/io/java_io_VMObjectStreamClass.c:1.1	Fri Dec  3 21:54:04 2004
+++ kaffe/libraries/clib/io/java_io_VMObjectStreamClass.c	Tue May 31 17:55:51 2005
@@ -114,11 +114,11 @@
   jfieldID fid;
   const char *field_name;
   const char *type_name;
-  int type_len;
+  size_t type_len;
   jmethodID mid;
   jstring name;
   jstring tname;
-  int i;
+  unsigned int i;
 
   fieldClass = (*env)->GetObjectClass(env, field);
 
@@ -210,7 +210,8 @@
     }
   else
     {
-      type_len = -1;
+      /* not needed: not used in the rest of the method */
+      /* type_len = -1; */
       fid = (*env)->GetFieldID(env, declaringClass, field_name, type);
     }
 
Index: kaffe/libraries/clib/native/Method.c
diff -u kaffe/libraries/clib/native/Method.c:1.43 kaffe/libraries/clib/native/Method.c:1.44
--- kaffe/libraries/clib/native/Method.c:1.43	Mon May 30 09:24:03 2005
+++ kaffe/libraries/clib/native/Method.c	Tue May 31 17:55:51 2005
@@ -162,8 +162,8 @@
 	rettype = *METHOD_RET_TYPE(meth);
 
 	for (i = len - 1; i >= 0; i--) {
-		arg = (*env)->GetObjectArrayElement(env, argobj, (unsigned int)i);
-		argc = (*env)->GetObjectArrayElement(env, paramtypes, (unsigned int)i);
+		arg = (*env)->GetObjectArrayElement(env, argobj, i);
+		argc = (*env)->GetObjectArrayElement(env, paramtypes, i);
 		if (!CLASS_IS_PRIMITIVE((Hjava_lang_Class*)argc)) {
 			args[i].l = arg;
 		}
Index: kaffe/libraries/clib/native/Object.c
diff -u kaffe/libraries/clib/native/Object.c:1.15 kaffe/libraries/clib/native/Object.c:1.16
--- kaffe/libraries/clib/native/Object.c:1.15	Wed Apr 20 20:42:46 2005
+++ kaffe/libraries/clib/native/Object.c	Tue May 31 17:55:51 2005
@@ -84,7 +84,7 @@
       /* Clone an array */
       obj = newArray(CLASS_ELEMENT_TYPE(class), ARRAY_SIZE(o));
       memcpy(ARRAY_DATA(obj), ARRAY_DATA(o),
-	     ARRAY_SIZE(o) * TYPE_SIZE(CLASS_ELEMENT_TYPE(class)));
+	     (size_t) ARRAY_SIZE(o) * TYPE_SIZE(CLASS_ELEMENT_TYPE(class)));
     }
   return (obj);
 }
Index: kaffe/libraries/clib/net/InetAddressImpl.c
diff -u kaffe/libraries/clib/net/InetAddressImpl.c:1.32 kaffe/libraries/clib/net/InetAddressImpl.c:1.33
--- kaffe/libraries/clib/net/InetAddressImpl.c:1.32	Mon May 30 09:24:03 2005
+++ kaffe/libraries/clib/net/InetAddressImpl.c	Tue May 31 17:55:52 2005
@@ -407,7 +407,7 @@
 #endif
       sain->sin_family = AF_INET;
       sain->sin_port = 0;
-      memcpy(&sain->sin_addr, unhand_byte_array(addr), addr->length);
+      memcpy(&sain->sin_addr, unhand_byte_array(addr), (size_t) addr->length);
       break;
 #if defined(AF_INET6)
     case 16:
@@ -423,7 +423,7 @@
 #endif /* HAVE_STRUCT_SOCKADDR_IN6_SIN6_FLOWINFO */
       memcpy(&sain6->sin6_addr,
 	     unhand_byte_array(addr),
-	     addr->length);
+	     (size_t) addr->length);
 #if defined(HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID)
       sain6->sin6_scope_id = 0;
 #endif /* HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID */
Index: kaffe/libraries/clib/net/PlainDatagramSocketImpl.c
diff -u kaffe/libraries/clib/net/PlainDatagramSocketImpl.c:1.53 kaffe/libraries/clib/net/PlainDatagramSocketImpl.c:1.54
--- kaffe/libraries/clib/net/PlainDatagramSocketImpl.c:1.53	Sat May 14 21:46:54 2005
+++ kaffe/libraries/clib/net/PlainDatagramSocketImpl.c	Tue May 31 17:55:52 2005
@@ -259,7 +259,7 @@
 	}
 
 	rc = KSENDTO(unhand(obj)->native_fd,
-		unhand_array(unhand(pkt)->buffer)->body, unhand(pkt)->length,
+		unhand_array(unhand(pkt)->buffer)->body, (size_t) unhand(pkt)->length,
 		0, (struct sockaddr *)&addr, alen, &bsent);
 
 DBG(NATIVENET,
Index: kaffe/libraries/clib/nio/java_nio_VMDirectByteBuffer.c
diff -u kaffe/libraries/clib/nio/java_nio_VMDirectByteBuffer.c:1.6 kaffe/libraries/clib/nio/java_nio_VMDirectByteBuffer.c:1.7
--- kaffe/libraries/clib/nio/java_nio_VMDirectByteBuffer.c:1.6	Fri Apr  8 06:12:12 2005
+++ kaffe/libraries/clib/nio/java_nio_VMDirectByteBuffer.c	Tue May 31 17:55:53 2005
@@ -151,7 +151,7 @@
 {
   void *buffer;
   
-  buffer = malloc (capacity);
+  buffer = malloc ((size_t) capacity);
 
   if (buffer == NULL)
     {
@@ -194,7 +194,7 @@
    jobject address, jint index, jbyteArray dst, jint dst_offset, jint dst_len)
 {
   jbyte *src = (jbyte *) NIOGetPointer (env, address) + index;
-  memcpy ((*env)->GetByteArrayElements (env, dst, NULL) + dst_offset, src, dst_len);
+  memcpy ((*env)->GetByteArrayElements (env, dst, NULL) + dst_offset, src, (size_t) dst_len);
 }
 
 JNIEXPORT void JNICALL
@@ -204,7 +204,7 @@
 {
   jbyte *dst = (jbyte *) NIOGetPointer (env, address) + dst_offset;
   jbyte *src = (jbyte *) NIOGetPointer (env, address) + src_offset;
-  memmove (dst, src, count);
+  memmove (dst, src, (size_t) count);
 }
 
 JNIEXPORT jobject JNICALL




More information about the kaffe mailing list