* src/vm/global.h (voidptr): Removed.
authorChristian Thalinger <twisti@complang.tuwien.ac.at>
Fri, 18 Jul 2008 13:39:50 +0000 (15:39 +0200)
committerChristian Thalinger <twisti@complang.tuwien.ac.at>
Fri, 18 Jul 2008 13:39:50 +0000 (15:39 +0200)
* src/vm/jit/patcher-common.c,
src/vm/jit/patcher-common.h,
src/vmcore/class.c,
src/vmcore/class.h,
src/vmcore/classcache.c,
src/vmcore/descriptor.c,
src/vmcore/loader.c: Replaced voidptr with void*.

src/vm/global.h
src/vm/jit/patcher-common.c
src/vm/jit/patcher-common.h
src/vmcore/class.c
src/vmcore/class.h
src/vmcore/classcache.c
src/vmcore/descriptor.c
src/vmcore/loader.c

index 2a09e47c1fdafb958d9fedf361c010c83051c87d..a9ec8c8f9735521260e13f68e49252f7054c9f8c 100644 (file)
@@ -36,7 +36,6 @@
 
 /* additional data types ******************************************************/
 
-typedef void *voidptr;                  /* generic pointer                    */
 typedef void (*functionptr) (void);     /* generic function pointer           */
 typedef u1* methodptr;
 
index 077398ab428397424468c0987f1b07d6156dcce1..84d2e892c6f5acff080cbd7601af6f100108b900 100644 (file)
@@ -175,8 +175,7 @@ static patchref_t *patcher_list_find(codeinfo *code, u1 *pc)
 
 *******************************************************************************/
 
-void patcher_add_patch_ref(jitdata *jd, functionptr patcher, voidptr ref,
-                           s4 disp)
+void patcher_add_patch_ref(jitdata *jd, functionptr patcher, void* ref, s4 disp)
 {
        codegendata *cd;
        codeinfo    *code;
index a103447976fe3f2bbc01f32f26343b180755e116..7328b5ed897354c037b8e342a8f32251d3a6be3d 100644 (file)
@@ -1,9 +1,7 @@
 /* src/vm/jit/patcher-common.h - architecture independent code patching stuff
 
-   Copyright (C) 2007 R. Grafl, A. Krall, C. Kruegel,
-   C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
-   E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
-   J. Wenninger, Institut f. Computersprachen - TU Wien
+   Copyright (C) 2007, 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
@@ -52,7 +50,7 @@ typedef struct patchref_t {
        ptrint       datap;         /* absolute position in data segment          */
        s4           disp;          /* displacement of ref in the data segment    */
        functionptr  patcher;       /* patcher function to call                   */
-       voidptr      ref;           /* reference passed                           */
+       void*        ref;           /* reference passed                           */
        u8           mcode;         /* machine code to be patched back in         */
        bool         done;          /* XXX preliminary: patch already applied?    */
        listnode_t   linkage;
@@ -68,8 +66,7 @@ void patcher_list_create(codeinfo *code);
 void patcher_list_reset(codeinfo *code);
 void patcher_list_free(codeinfo *code);
 
-void patcher_add_patch_ref(jitdata *jd, functionptr patcher, voidptr ref,
-                           s4 disp);
+void patcher_add_patch_ref(jitdata *jd, functionptr patcher, void* ref, s4 disp);
 
 void patcher_resolve(jitdata* jd);
 
index 7f5479a3344c189b6da749bada50fb92ce2aebcb..b51e3c18c5bda66495a4f31d6cf59d835f2bbc6c 100644 (file)
@@ -624,7 +624,7 @@ static void class_freecpool(classinfo *c)
 {
        u4 idx;
        u4 tag;
-       voidptr info;
+       void* info;
        
        if (c->cptags && c->cpinfos) {
                for (idx = 0; idx < c->cpcount; idx++) {
@@ -662,7 +662,7 @@ static void class_freecpool(classinfo *c)
                MFREE(c->cptags, u1, c->cpcount);
 
        if (c->cpinfos)
-               MFREE(c->cpinfos, voidptr, c->cpcount);
+               MFREE(c->cpinfos, void*, c->cpcount);
 }
 
 
@@ -674,7 +674,7 @@ static void class_freecpool(classinfo *c)
 
 *******************************************************************************/
 
-voidptr class_getconstant(classinfo *c, u4 pos, u4 ctype)
+void* class_getconstant(classinfo *c, u4 pos, u4 ctype)
 {
        /* check index and type of constantpool entry */
        /* (pos == 0 is caught by type comparison) */
@@ -694,7 +694,7 @@ voidptr class_getconstant(classinfo *c, u4 pos, u4 ctype)
        
 *******************************************************************************/
 
-voidptr innerclass_getconstant(classinfo *c, u4 pos, u4 ctype)
+void* innerclass_getconstant(classinfo *c, u4 pos, u4 ctype)
 {
        /* invalid position in constantpool */
 
@@ -2371,7 +2371,7 @@ void class_classref_or_classinfo_println(classref_or_classinfo c)
 void class_showconstantpool (classinfo *c) 
 {
        u4 i;
-       voidptr e;
+       void* e;
 
        printf ("---- dump of constant pool ----\n");
 
index a5bd01031c4178522ba171c613fd2a747cf8aba4..442f090e12541d2eb7a316900485255ec33c225d 100644 (file)
@@ -105,7 +105,7 @@ struct classinfo {                /* class structure                          */
 
        s4          cpcount;          /* number of entries in constant pool       */
        u1         *cptags;           /* constant pool tags                       */
-       voidptr    *cpinfos;          /* pointer to constant pool info structures */
+       void*      *cpinfos;          /* pointer to constant pool info structures */
 
        s4          classrefcount;    /* number of symbolic class references      */
        constant_classref *classrefs; /* table of symbolic class references       */
@@ -354,8 +354,8 @@ void       class_set_packagename(classinfo *c);
 bool       class_load_attributes(classbuffer *cb);
 
 /* retrieve constantpool element */
-voidptr class_getconstant(classinfo *c, u4 pos, u4 ctype);
-voidptr innerclass_getconstant(classinfo *c, u4 pos, u4 ctype);
+void* class_getconstant(classinfo *c, u4 pos, u4 ctype);
+void* innerclass_getconstant(classinfo *c, u4 pos, u4 ctype);
 
 /* frees all resources used by the class */
 void class_free(classinfo *);
index 76fc8255f7b7832f9584e6caa0e101e516d4536b..d48b0ed1cad94514b147f4bb0d654a174cfb624a 100644 (file)
@@ -1139,7 +1139,7 @@ void classcache_free(void)
                }
        }
 
-       MFREE(hashtable_classcache.ptr, voidptr, hashtable_classcache.size);
+       MFREE(hashtable_classcache.ptr, void*, hashtable_classcache.size);
        hashtable_classcache.size = 0;
        hashtable_classcache.entries = 0;
        hashtable_classcache.ptr = NULL;
index 13f7feef158792c04886633f78ac21c960648f4f..db1dcb74e035f8b9cedd4ac71dc4b56ecf7b73d8 100644 (file)
@@ -432,14 +432,14 @@ descriptor_pool_new(classinfo *referer)
        hashsize = CLASSREFHASH_INIT_SIZE;
        pool->classrefhash.size = hashsize;
        pool->classrefhash.entries = 0;
-       pool->classrefhash.ptr = DMNEW(voidptr,hashsize);
+       pool->classrefhash.ptr = DMNEW(void*, hashsize);
        for (slot=0; slot<hashsize; ++slot)
                pool->classrefhash.ptr[slot] = NULL;
 
        hashsize = DESCRIPTORHASH_INIT_SIZE;
        pool->descriptorhash.size = hashsize;
        pool->descriptorhash.entries = 0;
-       pool->descriptorhash.ptr = DMNEW(voidptr,hashsize);
+       pool->descriptorhash.ptr = DMNEW(void*, hashsize);
        for (slot=0; slot<hashsize; ++slot)
                pool->descriptorhash.ptr[slot] = NULL;
 
@@ -1370,10 +1370,10 @@ descriptor_pool_debug_dump(descriptor_pool *pool,FILE *file)
                        }
                }
                else {
-                       while (size >= sizeof(voidptr)) {
-                               fprintf(file,"    %p\n",*((voidptr*)pos));
-                               pos += sizeof(voidptr);
-                               size -= sizeof(voidptr);
+                       while (size >= sizeof(void*)) {
+                               fprintf(file,"    %p\n",*((void**)pos));
+                               pos += sizeof(void*);
+                               size -= sizeof(void*);
                        }
                }
        }
index 3a844d57969bf0b75ef3209e96db28f949c8b247..6be6f3572990baf3e9b178ceb9fee9701e8cd92b 100644 (file)
@@ -544,7 +544,7 @@ static bool load_constantpool(classbuffer *cb, descriptor_pool *descpool)
 
        u4 cpcount;
        u1 *cptags;
-       voidptr *cpinfos;
+       void** cpinfos;
 
        c = cb->clazz;
 
@@ -556,7 +556,7 @@ static bool load_constantpool(classbuffer *cb, descriptor_pool *descpool)
 
        /* allocate memory */
        cptags  = c->cptags  = MNEW(u1, cpcount);
-       cpinfos = c->cpinfos = MNEW(voidptr, cpcount);
+       cpinfos = c->cpinfos = MNEW(void*, cpcount);
 
        if (cpcount < 1) {
                exceptions_throw_classformaterror(c, "Illegal constant pool size");
@@ -565,7 +565,7 @@ static bool load_constantpool(classbuffer *cb, descriptor_pool *descpool)
        
 #if defined(ENABLE_STATISTICS)
        if (opt_stat)
-               count_const_pool_len += (sizeof(u1) + sizeof(voidptr)) * cpcount;
+               count_const_pool_len += (sizeof(u1) + sizeof(void*)) * cpcount;
 #endif
        
        /* initialize constantpool */