Author: zoltan
Date: 2005-04-20 10:10:35 -0400 (Wed, 20 Apr 2005)
New Revision: 43332

Modified:
   trunk/mono/mono/mini/ChangeLog
   trunk/mono/mono/mini/aot.c
   trunk/mono/mono/mini/debug-mini.c
   trunk/mono/mono/mini/driver.c
   trunk/mono/mono/mini/mini.c
   trunk/mono/mono/mini/tramp-x86.c
Log:
2005-04-20  Zoltan Varga  <[EMAIL PROTECTED]>

        * mini.c debug-mini.c aot.c tramp-x86.c driver.c: Fix some gcc 4.0
        warnings.


Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog      2005-04-20 14:05:02 UTC (rev 43331)
+++ trunk/mono/mono/mini/ChangeLog      2005-04-20 14:10:35 UTC (rev 43332)
@@ -1,5 +1,8 @@
 2005-04-20  Zoltan Varga  <[EMAIL PROTECTED]>
 
+       * mini.c debug-mini.c aot.c tramp-x86.c driver.c: Fix some gcc 4.0
+       warnings.
+       
        * Makefile.am (MCS): Use -unsafe instead of --unsafe.
 
        * aot.c: Applied patch from "The Software Team" <[EMAIL PROTECTED]>. 
Make AOT compilation

Modified: trunk/mono/mono/mini/aot.c
===================================================================
--- trunk/mono/mono/mini/aot.c  2005-04-20 14:05:02 UTC (rev 43331)
+++ trunk/mono/mono/mini/aot.c  2005-04-20 14:10:35 UTC (rev 43332)
@@ -177,10 +177,9 @@
 
 
 static inline gint32
-decode_value (char *_ptr, char **rptr)
+decode_value (guint8 *ptr, guint8 **rptr)
 {
-       unsigned char *ptr = (unsigned char *) _ptr;
-       unsigned char b = *ptr;
+       guint8 b = *ptr;
        gint32 len;
        
        if ((b & 0x80) == 0){
@@ -208,7 +207,7 @@
 }
 
 static MonoClass*
-decode_klass_info (MonoAotModule *module, char *buf, char **endbuf)
+decode_klass_info (MonoAotModule *module, guint8 *buf, guint8 **endbuf)
 {
        MonoImage *image;
        MonoClass *klass;
@@ -236,7 +235,7 @@
 }
 
 static MonoClassField*
-decode_field_info (MonoAotModule *module, char *buf, char **endbuf)
+decode_field_info (MonoAotModule *module, guint8 *buf, guint8 **endbuf)
 {
        MonoClass *klass = decode_klass_info (module, buf, &buf);
        guint32 token;
@@ -252,7 +251,7 @@
 }
 
 static inline MonoImage*
-decode_method_ref (MonoAotModule *module, guint32 *token, char *buf, char 
**endbuf)
+decode_method_ref (MonoAotModule *module, guint32 *token, guint8 *buf, guint8 
**endbuf)
 {
        guint32 image_index, value;
        MonoImage *image;
@@ -277,7 +276,7 @@
        guint8 *page_start;
        int pages, err;
 
-       page_start = (char *) (((gssize) (addr)) & ~ (PAGESIZE - 1));
+       page_start = (guint8 *) (((gssize) (addr)) & ~ (PAGESIZE - 1));
        pages = (addr + len - page_start + PAGESIZE - 1) / PAGESIZE;
        err = mprotect (page_start, pages * PAGESIZE, PROT_READ | PROT_WRITE | 
PROT_EXEC);
        g_assert (err == 0);
@@ -556,7 +555,7 @@
 }
 
 static gboolean
-decode_cached_class_info (MonoAotModule *module, MonoCachedClassInfo *info, 
char *buf, char **endbuf)
+decode_cached_class_info (MonoAotModule *module, MonoCachedClassInfo *info, 
guint8 *buf, guint8 **endbuf)
 {
        guint32 flags;
 
@@ -587,9 +586,8 @@
        int i;
        MonoAotModule *aot_module;
        MonoClass *klass = vtable->klass;
-       guint8 *info;
+       guint8 *info, *p;
        MonoCachedClassInfo class_info;
-       char *p;
        gboolean err;
 
        if (MONO_CLASS_IS_INTERFACE (klass) || klass->rank || 
!klass->image->assembly->aot_module)
@@ -604,7 +602,7 @@
        }
 
        info = &aot_module->class_infos [aot_module->class_info_offsets 
[mono_metadata_token_index (klass->type_token) - 1]];
-       p = (char*)info;
+       p = info;
 
        err = decode_cached_class_info (aot_module, &class_info, p, &p);
        if (!err) {
@@ -655,7 +653,7 @@
 mono_aot_get_cached_class_info (MonoClass *klass, MonoCachedClassInfo *res)
 {
        MonoAotModule *aot_module;
-       char *p;
+       guint8 *p;
        gboolean err;
 
        if (MONO_CLASS_IS_INTERFACE (klass) || klass->rank || 
!klass->image->assembly->aot_module)
@@ -669,7 +667,7 @@
                return FALSE;
        }
 
-       p = &aot_module->class_infos [aot_module->class_info_offsets 
[mono_metadata_token_index (klass->type_token) - 1]];
+       p = (guint8*)&aot_module->class_infos [aot_module->class_info_offsets 
[mono_metadata_token_index (klass->type_token) - 1]];
 
        err = decode_cached_class_info (aot_module, res, p, &p);
        if (!err) {
@@ -753,9 +751,9 @@
        int i, pindex, got_index;
        gboolean non_got_patches, keep_patches = TRUE;
        gboolean has_clauses;
-       char *p;
+       guint8 *p;
 
-       p = (char*)info;
+       p = info;
        code_len = decode_value (p, &p);
        used_int_regs = decode_value (p, &p);
 
@@ -1140,7 +1138,7 @@
        MonoAssembly *ass;
        MonoAotModule *aot_module;
 
-       ji = mono_jit_info_table_find (mono_domain_get (), code);
+       ji = mono_jit_info_table_find (mono_domain_get (), (char*)code);
        if (!ji)
                return FALSE;
 
@@ -1285,9 +1283,9 @@
 }
 
 static inline void
-encode_value (gint32 value, char *buf, char **endbuf)
+encode_value (gint32 value, guint8 *buf, guint8 **endbuf)
 {
-       char *p = buf;
+       guint8 *p = buf;
 
        //printf ("ENCODE: %d 0x%x.\n", value, value);
 
@@ -1337,7 +1335,7 @@
 }
 
 static void
-encode_klass_info (MonoAotCompile *cfg, MonoClass *klass, char *buf, char 
**endbuf)
+encode_klass_info (MonoAotCompile *cfg, MonoClass *klass, guint8 *buf, guint8 
**endbuf)
 {
        encode_value (get_image_index (cfg, klass->image), buf, &buf);
        if (!klass->type_token) {
@@ -1357,7 +1355,7 @@
 }
 
 static void
-encode_field_info (MonoAotCompile *cfg, MonoClassField *field, char *buf, char 
**endbuf)
+encode_field_info (MonoAotCompile *cfg, MonoClassField *field, guint8 *buf, 
guint8 **endbuf)
 {
        guint32 token = mono_get_field_token (field);
 
@@ -1368,7 +1366,7 @@
 }
 
 static void
-encode_method_ref (MonoAotCompile *acfg, MonoMethod *method, char *buf, char 
**endbuf)
+encode_method_ref (MonoAotCompile *acfg, MonoMethod *method, guint8 *buf, 
guint8 **endbuf)
 {
        guint32 image_index = get_image_index (acfg, method->klass->image);
        guint32 token = method->token;
@@ -1455,7 +1453,8 @@
        MonoMethod *method;
        FILE *tmpfp;
        int i, j, pindex, byte_index;
-       guint8 *code, *mname, *mname_p;
+       guint8 *code;
+       char *mname, *mname_p;
        int func_alignment = 16;
        GPtrArray *patches;
        MonoJumpInfo *patch_info;
@@ -1561,13 +1560,13 @@
        FILE *tmpfp;
        int i, j, k, pindex, buf_size;
        guint32 debug_info_size;
-       guint8 *code, *mname, *mname_p;
+       guint8 *code;
+       char *mname, *mname_p;
        GPtrArray *patches;
        MonoJumpInfo *patch_info;
        MonoMethodHeader *header;
        guint32 last_offset;
-       char *p, *buf;
-       guint8 *debug_info;
+       guint8 *p, *buf, *debug_info;
 #ifdef MONO_ARCH_HAVE_PIC_AOT
        guint32 first_got_offset;
 #endif
@@ -1843,7 +1842,7 @@
 emit_klass_info (MonoAotCompile *acfg, guint32 token)
 {
        MonoClass *klass = mono_class_get (acfg->image, token);
-       char *p, *buf;
+       guint8 *p, *buf;
        int i, buf_size;
        char *label;
        FILE *tmpfp = acfg->fp;
@@ -2060,10 +2059,9 @@
 mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char 
*aot_options)
 {
        MonoImage *image = ass->image;
-       char *com, *tmpfname, *opts_str;
+       char *com, *tmpfname, *opts_str, *symbol;
        FILE *tmpfp;
        int i;
-       guint8 *symbol;
        MonoAotCompile *acfg;
        MonoCompile **cfgs;
        char *outfile_name, *tmp_outfile_name;

Modified: trunk/mono/mono/mini/debug-mini.c
===================================================================
--- trunk/mono/mono/mini/debug-mini.c   2005-04-20 14:05:02 UTC (rev 43331)
+++ trunk/mono/mono/mini/debug-mini.c   2005-04-20 14:10:35 UTC (rev 43332)
@@ -287,9 +287,9 @@
 }
 
 static inline void
-encode_value (gint32 value, char *buf, char **endbuf)
+encode_value (gint32 value, guint8 *buf, guint8 **endbuf)
 {
-       char *p = buf;
+       guint8 *p = buf;
 
        //printf ("ENCODE: %d 0x%x.\n", value, value);
 
@@ -323,10 +323,9 @@
 }
 
 static inline gint32
-decode_value (char *_ptr, char **rptr)
+decode_value (guint8 *ptr, guint8 **rptr)
 {
-       unsigned char *ptr = (unsigned char *) _ptr;
-       unsigned char b = *ptr;
+       guint8 b = *ptr;
        gint32 len;
        
        if ((b & 0x80) == 0){
@@ -354,7 +353,7 @@
 }
 
 static void
-serialize_variable (MonoDebugVarInfo *var, char *p, char **endbuf)
+serialize_variable (MonoDebugVarInfo *var, guint8 *p, guint8 **endbuf)
 {
        guint32 flags = var->index & MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS;
 
@@ -378,8 +377,7 @@
        MiniDebugMethodInfo *info;
        MonoDebugMethodJitInfo *jit;
        guint32 size, prev_offset, prev_native_offset;
-       char *buf;
-       char *p;
+       guint8 *buf, *p;
        int i;
 
        info = (MiniDebugMethodInfo *) cfg->debug_info;
@@ -424,7 +422,7 @@
 }
 
 static void
-deserialize_variable (MonoDebugVarInfo *var, char *p, char **endbuf)
+deserialize_variable (MonoDebugVarInfo *var, guint8 *p, guint8 **endbuf)
 {
        guint32 flags;
 
@@ -450,7 +448,7 @@
        MonoMethodHeader *header;
        gint32 offset, native_offset, prev_offset, prev_native_offset;
        MonoDebugMethodJitInfo *jit;
-       char *p;
+       guint8 *p;
        int i;
 
        header = mono_method_get_header (method);
@@ -538,7 +536,7 @@
 mono_init_debugger (const char *file, const char *opt_flags)
 {
        MonoDomain *domain;
-       const guchar *error;
+       const char *error;
        int opt;
 
        g_set_prgname (file);

Modified: trunk/mono/mono/mini/driver.c
===================================================================
--- trunk/mono/mono/mini/driver.c       2005-04-20 14:05:02 UTC (rev 43331)
+++ trunk/mono/mono/mini/driver.c       2005-04-20 14:10:35 UTC (rev 43332)
@@ -690,8 +690,8 @@
                        g_print ("Mono JIT compiler version %s, (C) 2002-2005 
Novell, Inc and Contributors. www.mono-project.com\n", VERSION);
                        g_print (info);
                        if (mini_verbose) {
-                               const guchar *cerror;
-                               const guchar *clibpath;
+                               const char *cerror;
+                               const char *clibpath;
                                mono_init ("mono");
                                cerror = mono_check_corlib_version ();
                                clibpath = mono_defaults.corlib? 
mono_image_get_filename (mono_defaults.corlib): "unknown";
@@ -872,7 +872,7 @@
                mono_debug_init_2 (assembly);
 
        if (mono_compile_aot || action == DO_EXEC) {
-               const guchar *error;
+               const char *error;
 
                //mono_set_rootdir ();
 

Modified: trunk/mono/mono/mini/mini.c
===================================================================
--- trunk/mono/mono/mini/mini.c 2005-04-20 14:05:02 UTC (rev 43331)
+++ trunk/mono/mono/mini/mini.c 2005-04-20 14:10:35 UTC (rev 43332)
@@ -2430,7 +2430,7 @@
 handle_stobj (MonoCompile *cfg, MonoBasicBlock *bblock, MonoInst *dest, 
MonoInst *src, const unsigned char *ip, MonoClass *klass, gboolean to_end, 
gboolean native) {
        MonoInst *iargs [3];
        int n;
-       guint32 align = 0;
+       int align = 0;
        MonoMethod *memcpy_method;
 
        g_assert (klass);
@@ -7035,7 +7035,7 @@
        vtype_stack_slots = g_new0 (StackSlotInfo, 256);
        nvtypes = 0;
 
-       offsets = g_new (guint32, m->num_varinfo);
+       offsets = g_new (gint32, m->num_varinfo);
        for (i = 0; i < m->num_varinfo; ++i)
                offsets [i] = -1;
 

Modified: trunk/mono/mono/mini/tramp-x86.c
===================================================================
--- trunk/mono/mono/mini/tramp-x86.c    2005-04-20 14:05:02 UTC (rev 43331)
+++ trunk/mono/mono/mini/tramp-x86.c    2005-04-20 14:10:35 UTC (rev 43332)
@@ -109,7 +109,7 @@
                if ((code [1] == 0xe8)) {
                        if (!mono_running_on_valgrind ()) {
                                MonoJitInfo *ji = 
-                                       mono_jit_info_table_find 
(mono_domain_get (), code);
+                                       mono_jit_info_table_find 
(mono_domain_get (), (char*)code);
                                MonoJitInfo *target_ji = 
                                        mono_jit_info_table_find 
(mono_domain_get (), addr);
 
@@ -231,7 +231,7 @@
 
                        /* Then atomically change the first 4 bytes to a nop as 
well */
                        ops = 0x90909090;
-                       InterlockedExchange ((guint32*)code, ops);
+                       InterlockedExchange ((gint32*)code, ops);
 
 #ifdef HAVE_VALGRIND_MEMCHECK_H
                        /* FIXME: the calltree skin trips on the self modifying 
code above */

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to