[kaffe] CVS kaffe (doogie): Gcc warning fixes.

Kaffe CVS cvs-commits at kaffe.org
Sat Dec 18 23:11:24 PST 2004


PatchSet 5664 
Date: 2004/12/19 06:41:22
Author: doogie
Branch: HEAD
Tag: (none) 
Log:
Gcc warning fixes.

Members: 
	ChangeLog:1.3209->1.3210 
	kaffe/kaffevm/gc.h:1.28->1.29 
	kaffe/kaffevm/kaffe-gc/gc-incremental.h:1.5->1.6 
	kaffe/kaffevm/kaffe-gc/gc-mem.c:1.19->1.20 
	kaffe/kaffevm/kaffe-gc/gc-refs.c:1.6->1.7 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3209 kaffe/ChangeLog:1.3210
--- kaffe/ChangeLog:1.3209	Sun Dec 19 06:37:54 2004
+++ kaffe/ChangeLog	Sun Dec 19 06:41:22 2004
@@ -1,5 +1,11 @@
 2004-12-19  Adam Heath  <doogie at brainfood.com>
 
+	* kaffe/kaffevm/gc.h, kaffe/kaffevm/kaffe-gc/gc-incremental.h,
+	  kaffe/kaffevm/kaffe-gc/gc-mem.c, kaffe/kaffevm/kaffe-gc/gc-refs.c:
+	  Gcc warning fixes.
+
+2004-12-19  Adam Heath  <doogie at brainfood.com>
+
 	* config/i386/jit3-i386.def, kaffe/kaffevm/baseClasses.c,
 	  kaffe/kaffevm/classMethod.c, kaffe/kaffevm/classPool.c,
 	  kaffe/kaffevm/code-analyse.c, kaffe/kaffevm/debug.c,
Index: kaffe/kaffe/kaffevm/gc.h
diff -u kaffe/kaffe/kaffevm/gc.h:1.28 kaffe/kaffe/kaffevm/gc.h:1.29
--- kaffe/kaffe/kaffevm/gc.h:1.28	Thu Oct 21 21:08:47 2004
+++ kaffe/kaffe/kaffevm/gc.h	Sun Dec 19 06:41:29 2004
@@ -169,7 +169,7 @@
     ((G)->ops->rmRef)((Collector*)(G), (addr))
 
 #if !defined(KAFFEH)
-static inline void KGC_markObject(void *g, void *gc_info, void *addr)
+static inline void KGC_markObject(void *g, void *gc_info, const void *addr)
 {
 	if (addr)
 		((Collector*) g)->ops->markObject((Collector*) g, gc_info, addr);
Index: kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.h
diff -u kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.h:1.5 kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.h:1.6
--- kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.h:1.5	Thu Dec 16 06:13:53 2004
+++ kaffe/kaffe/kaffevm/kaffe-gc/gc-incremental.h	Sun Dec 19 06:41:29 2004
@@ -20,7 +20,7 @@
 #define	MAX_HEAPSIZE	(64*1024*1024)
 #define	ALLOC_HEAPSIZE	(1024*1024)
 
-extern uintp gc_block_base;
+extern char * gc_block_base;
 
 /* ------------------------------------------------------------------------ */
 
Index: kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.c
diff -u kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.c:1.19 kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.c:1.20
--- kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.c:1.19	Sun Dec 19 06:25:09 2004
+++ kaffe/kaffe/kaffevm/kaffe-gc/gc-mem.c	Sun Dec 19 06:41:29 2004
@@ -671,7 +671,7 @@
  */
 #define KGC_PRIM_LIST_COUNT 20
 
-uintp gc_block_base = 0;
+char * gc_block_base = NULL;
 static gc_block *gc_prim_freelist[KGC_PRIM_LIST_COUNT+1];
 
 #ifndef PROT_NONE
@@ -980,7 +980,7 @@
 	 */
 	for (;;) {
 		int missed;
-		ptr = sbrk(size);
+		ptr = sbrk((intptr_t)size);
 		if (ptr == (void*)-1) {
 			ptr = 0;
 			break;
@@ -992,7 +992,7 @@
 		DBG(GCSYSALLOC,
 		    dprintf("unaligned sbrk %p, missed %d bytes\n",
 			    ptr, missed));
-		sbrk(-size + missed);
+		sbrk((intptr_t)(-size + missed));
 	}
 	CHECK_OUT_OF_MEMORY(ptr);
 
@@ -1028,7 +1028,7 @@
 #ifdef HAVE_SBRK
 static void pagefree(uintp base UNUSED, size_t size)
 {
-	sbrk(-size);
+	sbrk((intptr_t)-size);
 }
 #else
 static void pagefree(uintp base, size_t size UNUSED)
@@ -1067,9 +1067,9 @@
 	if (!gc_block_base) {
 		nblocks = (gc_heap_limit+gc_pgsize-1)>>gc_pgbits;
 
-		gc_block_base = (uintp) malloc(nblocks * sizeof(gc_block));
+		gc_block_base = malloc(nblocks * sizeof(gc_block));
 		if (!gc_block_base) return 0;
-		memset((void *)gc_block_base, 0, nblocks * sizeof(gc_block));
+		memset(gc_block_base, 0, nblocks * sizeof(gc_block));
 	}
 
 	DBG(GCSYSALLOC, dprintf("pagealloc(%ld)", (long) size));
@@ -1085,7 +1085,7 @@
 	if (gc_mem2block((void *) (heap_addr + size))
 	    > ((gc_block *)gc_block_base) + nblocks
 	    || heap_addr < gc_heap_base) {
-		uintp old_blocks = gc_block_base;
+		char * old_blocks = gc_block_base;
 		int onb = nblocks;
 		int min_nb;	/* minimum size of array to hold heap_addr */
 #if defined(KAFFE_STATS)
@@ -1115,7 +1115,7 @@
 			    onb, nblocks));
 
 		KTHREAD(spinon)(0);
-		gc_block_base = (uintp) realloc((void *) old_blocks,
+		gc_block_base = realloc(old_blocks,
 						nblocks * sizeof(gc_block));
 		if (!gc_block_base) {
 			/* roll back this call */
@@ -1136,7 +1136,7 @@
 			int i;
 			gc_block *b = (gc_block *) gc_block_base;
 			uintp delta = gc_block_base - old_blocks;
-#define R(X) if (X) ((uintp) (X)) += delta
+#define R(X) if (X) X = X + delta
 
 			DBG(GCSYSALLOC,
 			    dprintf("relocating gc_block array\n"));
Index: kaffe/kaffe/kaffevm/kaffe-gc/gc-refs.c
diff -u kaffe/kaffe/kaffevm/kaffe-gc/gc-refs.c:1.6 kaffe/kaffe/kaffevm/kaffe-gc/gc-refs.c:1.7
--- kaffe/kaffe/kaffevm/kaffe-gc/gc-refs.c:1.6	Sun Dec 19 06:25:09 2004
+++ kaffe/kaffe/kaffevm/kaffe-gc/gc-refs.c	Sun Dec 19 06:41:29 2004
@@ -184,7 +184,7 @@
   /* Walk the referenced objects */
   for (i = 0; i < REFOBJHASHSZ; i++) {
     for (robj = refObjects.hash[i]; robj != 0; robj = robj->next) {
-      KGC_markObject(collector, NULL, (void *) robj->mem);
+      KGC_markObject(collector, NULL, robj->mem);
     }
   }
  




More information about the kaffe mailing list