[kaffe] CVS kaffe (dalibor): Fixed compiler warnings in mdGetStackSize

Kaffe CVS cvs-commits at kaffe.org
Wed Apr 28 05:12:07 PDT 2004


PatchSet 4705 
Date: 2004/04/28 12:01:43
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Fixed compiler warnings in mdGetStackSize

2004-04-28  Dalibor Topic  <robilad at kaffe.org>

        * config/i386/beos/md.h,
        config/i386/bsdi/md.h,
        config/i386/dgux/md.h,
        config/i386/freebsd2/md.h,
        config/i386/gnu/md.h,
        config/i386/linux/md.h,
        config/i386/netbsd1/md.h,
        config/i386/nextstep3/md.h,
        config/i386/openbsd2/md.h,
        config/i386/oskit/md.h,
        config/i386/qnx/md.h,
        config/i386/sco3.2v5/md.h,
        config/i386/solaris2/md.h,
        config/i386/univel_svr4/md.h,
        config/sparc/bsdi3/md.h,
        config/sparc/linux/md.h,
        config/sparc/openbsd2/md.h,
        config/sparc/solaris2/md.h,
        config/sparc/sunos4/md.h,
        config/sparc/uxpds/md.h:
        (mdGetStackSize) Changed prototype to return rlim_t.
        Changed return code when no stack size could be
        determined to 0. That fixes a compiler warning.

        * kaffe/kaffevm/thread.c:
        (initNativeThreads) Changed stackSize type to rlim_t.
        Check for 0 as return value from mdGetStackSize.

Members: 
	ChangeLog:1.2281->1.2282 
	config/i386/beos/md.h:1.9->1.10 
	config/i386/bsdi/md.h:1.7->1.8 
	config/i386/dgux/md.h:1.6->1.7 
	config/i386/freebsd2/md.h:1.10->1.11 
	config/i386/gnu/md.h:1.7->1.8 
	config/i386/linux/md.h:1.10->1.11 
	config/i386/netbsd1/md.h:1.6->1.7 
	config/i386/nextstep3/md.h:1.7->1.8 
	config/i386/openbsd2/md.h:1.7->1.8 
	config/i386/oskit/md.h:1.8->1.9 
	config/i386/qnx/md.h:1.9->1.10 
	config/i386/sco3.2v5/md.h:1.7->1.8 
	config/i386/solaris2/md.h:1.7->1.8 
	config/i386/univel_svr4/md.h:1.9->1.10 
	config/sparc/bsdi3/md.h:1.5->1.6 
	config/sparc/linux/md.h:1.7->1.8 
	config/sparc/openbsd2/md.h:1.8->1.9 
	config/sparc/solaris2/md.h:1.5->1.6 
	config/sparc/sunos4/md.h:1.8->1.9 
	config/sparc/uxpds/md.h:1.5->1.6 
	kaffe/kaffevm/thread.c:1.64->1.65 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2281 kaffe/ChangeLog:1.2282
--- kaffe/ChangeLog:1.2281	Tue Apr 27 19:15:11 2004
+++ kaffe/ChangeLog	Wed Apr 28 12:01:43 2004
@@ -1,3 +1,33 @@
+2004-04-28  Dalibor Topic  <robilad at kaffe.org>
+
+	* config/i386/beos/md.h,
+ 	config/i386/bsdi/md.h,
+ 	config/i386/dgux/md.h,
+ 	config/i386/freebsd2/md.h,
+ 	config/i386/gnu/md.h,
+ 	config/i386/linux/md.h,
+ 	config/i386/netbsd1/md.h,
+ 	config/i386/nextstep3/md.h,
+ 	config/i386/openbsd2/md.h,
+ 	config/i386/oskit/md.h,
+ 	config/i386/qnx/md.h,
+ 	config/i386/sco3.2v5/md.h,
+ 	config/i386/solaris2/md.h,
+ 	config/i386/univel_svr4/md.h,
+ 	config/sparc/bsdi3/md.h,
+ 	config/sparc/linux/md.h,
+ 	config/sparc/openbsd2/md.h,
+	config/sparc/solaris2/md.h,
+ 	config/sparc/sunos4/md.h,
+ 	config/sparc/uxpds/md.h:
+	(mdGetStackSize) Changed prototype to return rlim_t.
+	Changed return code when no stack size could be 
+	determined to 0. That fixes a compiler warning.
+
+ 	* kaffe/kaffevm/thread.c:
+	(initNativeThreads) Changed stackSize type to rlim_t.
+	Check for 0 as return value from mdGetStackSize.
+
 2004-04-27  Guilhem Lavaux <guilhem at kaffe.org>
 
 	* config/powerpc/aix/md.h, config/powerpc/darwin/md.h,
Index: kaffe/config/i386/beos/md.h
diff -u kaffe/config/i386/beos/md.h:1.9 kaffe/config/i386/beos/md.h:1.10
--- kaffe/config/i386/beos/md.h:1.9	Tue Apr 27 10:53:50 2004
+++ kaffe/config/i386/beos/md.h	Wed Apr 28 12:01:45 2004
@@ -50,12 +50,12 @@
 #if defined(HAVE_GETRLIMIT)
 #define KAFFEMD_STACKSIZE
 
-static inline size_t mdGetStackSize(void)
+static inline rlim_t mdGetStackSize(void)
 {
   struct rlimit rl;
 
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
-    return -1;
+    return 0;
   else
     return (rl.rlim_max >= RLIM_INFINITY) ? rl.rlim_cur : rl.rlim_max;
 }
Index: kaffe/config/i386/bsdi/md.h
diff -u kaffe/config/i386/bsdi/md.h:1.7 kaffe/config/i386/bsdi/md.h:1.8
--- kaffe/config/i386/bsdi/md.h:1.7	Tue Apr 27 10:53:50 2004
+++ kaffe/config/i386/bsdi/md.h	Wed Apr 28 12:01:45 2004
@@ -70,12 +70,12 @@
 #if defined(HAVE_GETRLIMIT)
 #define KAFFEMD_STACKSIZE
 
-static inline size_t mdGetStackSize(void)
+static inline rlim_t mdGetStackSize(void)
 {
   struct rlimit rl;
 
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
-    return -1;
+    return 0;
   else
     return (rl.rlim_max >= RLIM_INFINITY) ? rl.rlim_cur : rl.rlim_max;
 }
Index: kaffe/config/i386/dgux/md.h
diff -u kaffe/config/i386/dgux/md.h:1.6 kaffe/config/i386/dgux/md.h:1.7
--- kaffe/config/i386/dgux/md.h:1.6	Tue Apr 27 10:53:51 2004
+++ kaffe/config/i386/dgux/md.h	Wed Apr 28 12:01:46 2004
@@ -46,12 +46,12 @@
 #if defined(HAVE_GETRLIMIT)
 #define KAFFEMD_STACKSIZE
 
-static inline size_t mdGetStackSize(void)
+static inline rlim_t mdGetStackSize(void)
 {
   struct rlimit rl;
 
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
-    return -1;
+    return 0;
   else
     return (rl.rlim_max >= RLIM_INFINITY) ? rl.rlim_cur : rl.rlim_max;
 }
Index: kaffe/config/i386/freebsd2/md.h
diff -u kaffe/config/i386/freebsd2/md.h:1.10 kaffe/config/i386/freebsd2/md.h:1.11
--- kaffe/config/i386/freebsd2/md.h:1.10	Tue Apr 27 10:53:51 2004
+++ kaffe/config/i386/freebsd2/md.h	Wed Apr 28 12:01:46 2004
@@ -63,12 +63,12 @@
 #if defined(HAVE_GETRLIMIT)
 #define KAFFEMD_STACKSIZE
 
-static inline size_t mdGetStackSize(void)
+static inline rlim_t mdGetStackSize(void)
 {
   struct rlimit rl;
 
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
-    return -1;
+    return 0;
   else
     return (rl.rlim_max >= RLIM_INFINITY) ? rl.rlim_cur : rl.rlim_max;
 }
Index: kaffe/config/i386/gnu/md.h
diff -u kaffe/config/i386/gnu/md.h:1.7 kaffe/config/i386/gnu/md.h:1.8
--- kaffe/config/i386/gnu/md.h:1.7	Tue Apr 27 10:53:51 2004
+++ kaffe/config/i386/gnu/md.h	Wed Apr 28 12:01:46 2004
@@ -71,12 +71,12 @@
 #if defined(HAVE_GETRLIMIT)
 #define KAFFEMD_STACKSIZE
 
-static inline size_t mdGetStackSize(void)
+static inline rlim_t mdGetStackSize(void)
 {
   struct rlimit rl;
 
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
-    return -1;
+    return 0;
   else
     return (rl.rlim_max >= RLIM_INFINITY) ? rl.rlim_cur : rl.rlim_max;
 }
Index: kaffe/config/i386/linux/md.h
diff -u kaffe/config/i386/linux/md.h:1.10 kaffe/config/i386/linux/md.h:1.11
--- kaffe/config/i386/linux/md.h:1.10	Tue Apr 27 10:53:51 2004
+++ kaffe/config/i386/linux/md.h	Wed Apr 28 12:01:47 2004
@@ -79,12 +79,12 @@
 #if defined(HAVE_GETRLIMIT)
 #define KAFFEMD_STACKSIZE
 
-static inline size_t mdGetStackSize(void)
+static inline rlim_t mdGetStackSize(void)
 {
   struct rlimit rl;
 
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
-    return -1;
+    return 0;
   else
     return (rl.rlim_max >= RLIM_INFINITY) ? rl.rlim_cur : rl.rlim_max;
 }
Index: kaffe/config/i386/netbsd1/md.h
diff -u kaffe/config/i386/netbsd1/md.h:1.6 kaffe/config/i386/netbsd1/md.h:1.7
--- kaffe/config/i386/netbsd1/md.h:1.6	Tue Apr 27 10:53:52 2004
+++ kaffe/config/i386/netbsd1/md.h	Wed Apr 28 12:01:47 2004
@@ -45,12 +45,12 @@
 #if defined(HAVE_GETRLIMIT)
 #define KAFFEMD_STACKSIZE
 
-static inline size_t mdGetStackSize(void)
+static inline rlim_t mdGetStackSize(void)
 {
   struct rlimit rl;
 
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
-    return -1;
+    return 0;
   else
     return (rl.rlim_max >= RLIM_INFINITY) ? rl.rlim_cur : rl.rlim_max;
 }
Index: kaffe/config/i386/nextstep3/md.h
diff -u kaffe/config/i386/nextstep3/md.h:1.7 kaffe/config/i386/nextstep3/md.h:1.8
--- kaffe/config/i386/nextstep3/md.h:1.7	Tue Apr 27 10:53:52 2004
+++ kaffe/config/i386/nextstep3/md.h	Wed Apr 28 12:01:48 2004
@@ -46,12 +46,12 @@
 #if defined(HAVE_GETRLIMIT)
 #define KAFFEMD_STACKSIZE
 
-static inline size_t mdGetStackSize(void)
+static inline rlim_t mdGetStackSize(void)
 {
   struct rlimit rl;
 
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
-    return -1;
+    return 0;
   else
     return (rl.rlim_max >= RLIM_INFINITY) ? rl.rlim_cur : rl.rlim_max;
 }
Index: kaffe/config/i386/openbsd2/md.h
diff -u kaffe/config/i386/openbsd2/md.h:1.7 kaffe/config/i386/openbsd2/md.h:1.8
--- kaffe/config/i386/openbsd2/md.h:1.7	Tue Apr 27 10:53:53 2004
+++ kaffe/config/i386/openbsd2/md.h	Wed Apr 28 12:01:48 2004
@@ -46,12 +46,12 @@
 #if defined(HAVE_GETRLIMIT)
 #define KAFFEMD_STACKSIZE
 
-static inline size_t mdGetStackSize(void)
+static inline rlim_t mdGetStackSize(void)
 {
   struct rlimit rl;
 
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
-    return -1;
+    return 0;
   else
     return (rl.rlim_max >= RLIM_INFINITY) ? rl.rlim_cur : rl.rlim_max;
 }
Index: kaffe/config/i386/oskit/md.h
diff -u kaffe/config/i386/oskit/md.h:1.8 kaffe/config/i386/oskit/md.h:1.9
--- kaffe/config/i386/oskit/md.h:1.8	Tue Apr 27 10:53:53 2004
+++ kaffe/config/i386/oskit/md.h	Wed Apr 28 12:01:48 2004
@@ -56,12 +56,12 @@
 #if defined(HAVE_GETRLIMIT)
 #define KAFFEMD_STACKSIZE
 
-static inline size_t mdGetStackSize(void)
+static inline rlim_t mdGetStackSize(void)
 {
   struct rlimit rl;
 
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
-    return -1;
+    return 0;
   else
     return (rl.rlim_max >= RLIM_INFINITY) ? rl.rlim_cur : rl.rlim_max;
 }
Index: kaffe/config/i386/qnx/md.h
diff -u kaffe/config/i386/qnx/md.h:1.9 kaffe/config/i386/qnx/md.h:1.10
--- kaffe/config/i386/qnx/md.h:1.9	Tue Apr 27 10:53:53 2004
+++ kaffe/config/i386/qnx/md.h	Wed Apr 28 12:01:49 2004
@@ -132,12 +132,12 @@
 #if defined(HAVE_GETRLIMIT)
 #define KAFFEMD_STACKSIZE
 
-static inline size_t mdGetStackSize(void)
+static inline rlim_t mdGetStackSize(void)
 {
   struct rlimit rl;
 
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
-    return -1;
+    return 0;
   else
     return (rl.rlim_max >= RLIM_INFINITY) ? rl.rlim_cur : rl.rlim_max;
 }
Index: kaffe/config/i386/sco3.2v5/md.h
diff -u kaffe/config/i386/sco3.2v5/md.h:1.7 kaffe/config/i386/sco3.2v5/md.h:1.8
--- kaffe/config/i386/sco3.2v5/md.h:1.7	Tue Apr 27 10:53:54 2004
+++ kaffe/config/i386/sco3.2v5/md.h	Wed Apr 28 12:01:49 2004
@@ -49,12 +49,12 @@
 #if defined(HAVE_GETRLIMIT)
 #define KAFFEMD_STACKSIZE
 
-static inline size_t mdGetStackSize(void)
+static inline rlim_t mdGetStackSize(void)
 {
   struct rlimit rl;
 
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
-    return -1;
+    return 0;
   else
     return (rl.rlim_max >= RLIM_INFINITY) ? rl.rlim_cur : rl.rlim_max;
 }
Index: kaffe/config/i386/solaris2/md.h
diff -u kaffe/config/i386/solaris2/md.h:1.7 kaffe/config/i386/solaris2/md.h:1.8
--- kaffe/config/i386/solaris2/md.h:1.7	Tue Apr 27 10:53:54 2004
+++ kaffe/config/i386/solaris2/md.h	Wed Apr 28 12:01:50 2004
@@ -46,12 +46,12 @@
 #if defined(HAVE_GETRLIMIT)
 #define KAFFEMD_STACKSIZE
 
-static inline size_t mdGetStackSize(void)
+static inline rlim_t mdGetStackSize(void)
 {
   struct rlimit rl;
 
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
-    return -1;
+    return 0;
   else
     return (rl.rlim_cur);
 }
Index: kaffe/config/i386/univel_svr4/md.h
diff -u kaffe/config/i386/univel_svr4/md.h:1.9 kaffe/config/i386/univel_svr4/md.h:1.10
--- kaffe/config/i386/univel_svr4/md.h:1.9	Tue Apr 27 10:53:55 2004
+++ kaffe/config/i386/univel_svr4/md.h	Wed Apr 28 12:01:50 2004
@@ -49,12 +49,12 @@
 #if defined(HAVE_GETRLIMIT)
 #define KAFFEMD_STACKSIZE
 
-static inline size_t mdGetStackSize(void)
+static inline rlim_t mdGetStackSize(void)
 {
   struct rlimit rl;
 
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
-    return -1;
+    return 0;
   else
     return (rl.rlim_max >= RLIM_INFINITY) ? rl.rlim_cur : rl.rlim_max;
 }
Index: kaffe/config/sparc/bsdi3/md.h
diff -u kaffe/config/sparc/bsdi3/md.h:1.5 kaffe/config/sparc/bsdi3/md.h:1.6
--- kaffe/config/sparc/bsdi3/md.h:1.5	Tue Apr 27 10:53:55 2004
+++ kaffe/config/sparc/bsdi3/md.h	Wed Apr 28 12:01:50 2004
@@ -34,12 +34,12 @@
 #if defined(HAVE_GETRLIMIT)
 #define KAFFEMD_STACKSIZE
 
-static inline size_t mdGetStackSize(void)
+static inline rlim_t mdGetStackSize(void)
 {
   struct rlimit rl;
 
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
-    return -1;
+    return 0;
   else
     return (rl.rlim_max >= RLIM_INFINITY) ? rl.rlim_cur : rl.rlim_max;
 }
Index: kaffe/config/sparc/linux/md.h
diff -u kaffe/config/sparc/linux/md.h:1.7 kaffe/config/sparc/linux/md.h:1.8
--- kaffe/config/sparc/linux/md.h:1.7	Tue Apr 27 10:53:55 2004
+++ kaffe/config/sparc/linux/md.h	Wed Apr 28 12:01:51 2004
@@ -57,12 +57,12 @@
 #if defined(HAVE_GETRLIMIT)
 #define KAFFEMD_STACKSIZE
 
-static inline size_t mdGetStackSize(void)
+static inline rlim_t mdGetStackSize(void)
 {
   struct rlimit rl;
 
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
-    return -1;
+    return 0;
   else
     return (rl.rlim_max >= RLIM_INFINITY) ? rl.rlim_cur : rl.rlim_max;
 }
Index: kaffe/config/sparc/openbsd2/md.h
diff -u kaffe/config/sparc/openbsd2/md.h:1.8 kaffe/config/sparc/openbsd2/md.h:1.9
--- kaffe/config/sparc/openbsd2/md.h:1.8	Tue Apr 27 10:53:56 2004
+++ kaffe/config/sparc/openbsd2/md.h	Wed Apr 28 12:01:51 2004
@@ -43,12 +43,12 @@
 #if defined(HAVE_GETRLIMIT)
 #define KAFFEMD_STACKSIZE
 
-static inline size_t mdGetStackSize(void)
+static inline rlim_t mdGetStackSize(void)
 {
   struct rlimit rl;
 
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
-    return -1;
+    return 0;
   else
     return (rl.rlim_max >= RLIM_INFINITY) ? rl.rlim_cur : rl.rlim_max;
 }
Index: kaffe/config/sparc/solaris2/md.h
diff -u kaffe/config/sparc/solaris2/md.h:1.5 kaffe/config/sparc/solaris2/md.h:1.6
--- kaffe/config/sparc/solaris2/md.h:1.5	Tue Apr 27 10:53:56 2004
+++ kaffe/config/sparc/solaris2/md.h	Wed Apr 28 12:01:52 2004
@@ -37,12 +37,12 @@
 #if defined(HAVE_GETRLIMIT)
 #define KAFFEMD_STACKSIZE
 
-static inline size_t mdGetStackSize(void)
+static inline rlim_t mdGetStackSize(void)
 {
   struct rlimit rl;
 
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
-    return -1;
+    return 0;
   else
     return rl.rlim_cur;
 }
Index: kaffe/config/sparc/sunos4/md.h
diff -u kaffe/config/sparc/sunos4/md.h:1.8 kaffe/config/sparc/sunos4/md.h:1.9
--- kaffe/config/sparc/sunos4/md.h:1.8	Tue Apr 27 10:53:56 2004
+++ kaffe/config/sparc/sunos4/md.h	Wed Apr 28 12:01:52 2004
@@ -52,12 +52,12 @@
 #if defined(HAVE_GETRLIMIT)
 #define KAFFEMD_STACKSIZE
 
-static inline size_t mdGetStackSize(void)
+static inline rlim_t mdGetStackSize(void)
 {
   struct rlimit rl;
 
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
-    return -1;
+    return 0;
   else
     return rl.rlim_cur;
 }
Index: kaffe/config/sparc/uxpds/md.h
diff -u kaffe/config/sparc/uxpds/md.h:1.5 kaffe/config/sparc/uxpds/md.h:1.6
--- kaffe/config/sparc/uxpds/md.h:1.5	Tue Apr 27 10:53:56 2004
+++ kaffe/config/sparc/uxpds/md.h	Wed Apr 28 12:01:52 2004
@@ -41,12 +41,12 @@
 #if defined(HAVE_GETRLIMIT)
 #define KAFFEMD_STACKSIZE
 
-static inline size_t mdGetStackSize(void)
+static inline rlim_t mdGetStackSize(void)
 {
   struct rlimit rl;
 
   if (getrlimit(RLIMIT_STACK, &rl) < 0)
-    return -1;
+    return 0;
   else
     return (rl.rlim_max >= RLIM_INFINITY) ? rl.rlim_cur : rl.rlim_max;
 }
Index: kaffe/kaffe/kaffevm/thread.c
diff -u kaffe/kaffe/kaffevm/thread.c:1.64 kaffe/kaffe/kaffevm/thread.c:1.65
--- kaffe/kaffe/kaffevm/thread.c:1.64	Sat Apr 24 16:57:35 2004
+++ kaffe/kaffe/kaffevm/thread.c	Wed Apr 28 12:01:53 2004
@@ -680,7 +680,7 @@
 initNativeThreads(int nativestacksize)
 {
 	threadData *thread_data;
-	int stackSize;
+	rlim_t stackSize;
 
 	DBG(INIT, dprintf("initNativeThreads(0x%x)\n", nativestacksize); )
 
@@ -716,7 +716,7 @@
 	 */
 #if defined(KAFFEMD_STACKSIZE)
 	stackSize = mdGetStackSize();
-	if (stackSize < 0)
+	if (stackSize == 0)
 	  {
 	    dprintf("WARNING: Impossible to retrieve the real stack size\n");
 	    dprintf("WARNING: You may experience deadlocks\n");




More information about the kaffe mailing list