2005-01-30 Zoltan Varga <vargaz@freemail.hu>
authorZoltan Varga <vargaz@gmail.com>
Sun, 30 Jan 2005 10:03:59 +0000 (10:03 -0000)
committerZoltan Varga <vargaz@gmail.com>
Sun, 30 Jan 2005 10:03:59 +0000 (10:03 -0000)
* class.c loader.c security.c loader.h process.c threads.c mono-debug-debugger.c profiler.c marshal.c rand.cpedump.c: Fix 64 bit warnings.

svn path=/trunk/mono/; revision=39787

12 files changed:
mono/metadata/ChangeLog
mono/metadata/class.c
mono/metadata/loader.c
mono/metadata/loader.h
mono/metadata/marshal.c
mono/metadata/mono-debug-debugger.c
mono/metadata/pedump.c
mono/metadata/process.c
mono/metadata/profiler.c
mono/metadata/rand.c
mono/metadata/security.c
mono/metadata/threads.c

index e36c7a9cfe2348ca12d9f38143e62b7a48bc4092..295bdaab690e98fddc13a6c05335a0e7c3043ea9 100644 (file)
@@ -1,3 +1,7 @@
+2005-01-30  Zoltan Varga  <vargaz@freemail.hu>
+
+       * class.c loader.c security.c loader.h process.c threads.c mono-debug-debugger.c profiler.c marshal.c rand.cpedump.c: Fix 64 bit warnings.
+
 2005-01-29  Ben Maurer  <bmaurer@ximian.com>
 
        * loader.c (mono_method_signature): Make this method lazy
index 60e39467ed52fa3d59fe9fc36a725725c51b9abb..68d40cb8584ed8463f2de31958a3af9acb7823f8 100644 (file)
@@ -910,9 +910,9 @@ mono_get_unique_iid (MonoClass *class)
        if (g_hash_table_lookup_extended (iid_hash, str, NULL, &value)) {
                mono_loader_unlock ();
                g_free (str);
-               return (guint)value;
+               return GPOINTER_TO_INT (value);
        } else {
-               g_hash_table_insert (iid_hash, str, (gpointer)iid);
+               g_hash_table_insert (iid_hash, str, GINT_TO_POINTER (iid));
                ++iid;
        }
 
@@ -2745,7 +2745,11 @@ mono_class_name_from_token (MonoImage *image, guint32 type_token, MonoGenericCon
                
        case MONO_TOKEN_TYPE_SPEC:
                return g_strdup_printf ("Typespec 0x%08x", type_token);
+       default:
+               g_assert_not_reached ();
        }
+
+       return NULL;
 }
 
 /**
index 4119e5e5c69c5612db3845f473ea4334fa0f2d3e..f533d4e42247e51f69448be3c6ae924eae0f01b3 100644 (file)
@@ -1254,7 +1254,7 @@ mono_method_signature (MonoMethod *m)
        int idx;
        int size;
        MonoImage* img;
-       gpointer sig;
+       const char *sig;
        
        if (m->signature)
                return m->signature;
index 180752de01001efd58af8af41adfe2da0e977e59..6a2fc69c914b96988b57e0b5215493a41ce2d27d 100644 (file)
@@ -20,6 +20,9 @@ mono_get_method_constrained (MonoImage *image, guint32 token, MonoClass *constra
 void               
 mono_free_method           (MonoMethod *method);
 
+MonoMethodSignature*
+mono_method_get_signature_full (MonoMethod *method, MonoImage *image, guint32 token, MonoGenericContext *context);
+
 MonoMethodSignature* 
 mono_method_get_signature  (MonoMethod *method, MonoImage *image, guint32 token);
 
index 6a950d343adc252518197ab11789f4f1e215fd5c..02bf2608538c49b65df5436a527f82e5f7431f59 100644 (file)
@@ -6738,9 +6738,9 @@ void
 mono_marshal_set_last_error (void)
 {
 #ifdef WIN32
-       TlsSetValue (last_error_tls_id, (gpointer)GetLastError ());
+       TlsSetValue (last_error_tls_id, GINT_TO_POINTER (GetLastError ()));
 #else
-       TlsSetValue (last_error_tls_id, (gpointer)errno);
+       TlsSetValue (last_error_tls_id, GINT_TO_POINTER (errno));
 #endif
 }
 
@@ -6981,7 +6981,7 @@ ves_icall_System_Runtime_InteropServices_Marshal_GetLastWin32Error (void)
 {
        MONO_ARCH_SAVE_REGS;
 
-       return ((guint32)TlsGetValue (last_error_tls_id));
+       return (GPOINTER_TO_INT (TlsGetValue (last_error_tls_id)));
 }
 
 guint32 
index 3f168cce435b231c95c857b25585df37d36a8133..29aa218a562ab730f538c3324a235571372dc799 100644 (file)
@@ -937,7 +937,7 @@ do_write_class (MonoDebuggerSymbolTable *table, MonoClass *klass, MonoDebuggerCl
        *ptr++ = MONO_DEBUGGER_TYPE_KIND_CLASS_INFO;
 
        if (klass->valuetype)
-               base_offset = - sizeof (MonoObject);
+               base_offset = - (int)(sizeof (MonoObject));
 
        WRITE_UINT32 (ptr, klass->instance_size + base_offset);
        *ptr++ = klass->valuetype;
@@ -1113,7 +1113,7 @@ do_write_class (MonoDebuggerSymbolTable *table, MonoClass *klass, MonoDebuggerCl
                WRITE_UINT32 (ptr, write_class (table, klass->interfaces [i]));
 
        if (ptr - old_ptr != data_size) {
-               g_warning (G_STRLOC ": %d,%d,%d", ptr - old_ptr, data_size, sizeof (gpointer));
+               g_warning (G_STRLOC ": %d,%d,%d", (int)(ptr - old_ptr), data_size, (int)sizeof (gpointer));
                if (klass)
                        g_warning (G_STRLOC ": %s.%s", klass->name_space, klass->name);
                g_assert_not_reached ();
index acbc91cf9cbd488bab1ffaae46086fe35d3a0c19..c9cda30f6796fb7a6138ddadbeab05371c14ef8a 100644 (file)
@@ -258,7 +258,7 @@ dsh (const char *label, MonoImage *meta, MonoStreamHeader *sh)
 {
        printf ("%s: 0x%08x - 0x%08x [%d == 0x%08x]\n",
                label,
-               sh->data - meta->raw_metadata, sh->data + sh->size - meta->raw_metadata,
+               (int)(sh->data - meta->raw_metadata), (int)(sh->data + sh->size - meta->raw_metadata),
                sh->size, sh->size);
 }
 
index 5f8357295f6bacdd47433fb9185988b924e62c4b..6a1f6b2696b696be80eee4d93c5690de25b8feb0 100644 (file)
@@ -748,7 +748,7 @@ MonoBoolean ves_icall_System_Diagnostics_Process_Start_internal (MonoString *app
                shell_args = "-c %s";
 #endif
                if (spath != NULL) {
-                       gint dummy;
+                       gsize dummy;
                        gchar *quoted;
 
                        shell_path = mono_unicode_from_external (spath, &dummy);
index 2846e885ae0128dbfced6798e23b0065e8e42e78..3b1deecda7315541be20f7e8514557ee719c6794 100644 (file)
@@ -730,7 +730,7 @@ output_profile (GList *funcs)
                m = method_get_name (p->method);
                printf ("########################\n");
                printf ("% 8.3f ", (double) (p->total * 1000));
-               printf ("%7llu ", p->count);
+               printf ("%7llu ", (unsigned long long)p->count);
                printf ("% 8.3f ", (double) (p->total * 1000)/(double)p->count);
                printf ("  %s\n", m);
 
@@ -738,7 +738,7 @@ output_profile (GList *funcs)
                /* callers */
                output_callers (p);
        }
-       printf ("Total number of calls: %lld\n", total_calls);
+       printf ("Total number of calls: %lld\n", (long long)total_calls);
 }
 
 typedef struct {
index e2f78f78b7db94ab18bea889f88d1752a358cfa1..10bf22a34ea44b66f6ac77e407b2086027d22385 100644 (file)
@@ -198,13 +198,13 @@ ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngInitialize (M
        }
 
        /* if required exception will be thrown in managed code */
-       return ((file < 0) ? NULL : (gpointer) file);
+       return ((file < 0) ? NULL : GINT_TO_POINTER (file));
 }
 
 gpointer 
 ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngGetBytes (gpointer handle, MonoArray *arry)
 {
-       gint file = (gint) handle;
+       gint file = GPOINTER_TO_INT (handle);
        guint32 len = mono_array_length (arry);
        guchar *buf = mono_array_addr (arry, guchar, 0);
 
@@ -242,7 +242,7 @@ void
 ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngClose (gpointer handle) 
 {
        if (!egd)
-               close ((gint) handle);
+               close (GPOINTER_TO_INT (handle));
 }
 
 #endif /* OS definition */
index 6601b5f4080b3fcf04c1d64b8c6248586a38f77d..45fd682a4fcd2c9f4c0f6a0bd8c1a8d77083552a 100644 (file)
@@ -277,7 +277,7 @@ ves_icall_System_Security_Principal_WindowsIdentity_GetCurrentToken (void)
                OpenProcessToken (GetCurrentProcess (), TOKEN_QUERY, &token);
        }
 #else
-       token = (gpointer) geteuid ();
+       token = GINT_TO_POINTER (geteuid ());
 #endif
        return token;
 }
@@ -302,7 +302,7 @@ ves_icall_System_Security_Principal_WindowsIdentity_GetTokenName (gpointer token
                g_free (tu);
        }
 #else 
-       gchar *uname = GetTokenName ((uid_t) token);
+       gchar *uname = GetTokenName ((uid_t) GPOINTER_TO_INT (token));
 
        MONO_ARCH_SAVE_REGS;
 
@@ -374,7 +374,7 @@ ves_icall_System_Security_Principal_WindowsIdentity_GetUserToken (MonoString *us
 #endif
 
        if (result) {
-               token = (gpointer) p->pw_uid;
+               token = GINT_TO_POINTER (p->pw_uid);
        }
 
 #ifdef HAVE_GETPWNAM_R
@@ -520,16 +520,16 @@ ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupId (gpointer
        fbufsize = (size_t) 1024;
 #endif
        fbuf = g_malloc0 (fbufsize);
-       retval = getgrgid_r ((gid_t) group, &grp, fbuf, fbufsize, &g);
+       retval = getgrgid_r ((gid_t) GPOINTER_TO_INT (group), &grp, fbuf, fbufsize, &g);
        result = ((retval == 0) && (g == &grp));
 #else
        /* default to non thread-safe but posix compliant function */
-       g = getgrgid ((gid_t) group);
+       g = getgrgid ((gid_t) GPOINTER_TO_INT (group));
        result = (g != NULL);
 #endif
 
        if (result) {
-               result = IsMemberOf ((uid_t) user, g);
+               result = IsMemberOf ((uid_t) GPOINTER_TO_INT (user), g);
        }
 
 #ifdef HAVE_GETGRGID_R
@@ -581,7 +581,7 @@ ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupName (gpoint
 #endif
 
                if (result) {
-                       result = IsMemberOf ((uid_t) user, g);
+                       result = IsMemberOf ((uid_t) GPOINTER_TO_INT (user), g);
                }
 
 #ifdef HAVE_GETGRNAM_R
index 1d2bfd921b47c56cf57de87d9cbea9201acfcd2a..42026dd2df161e8236c998962af278ea40c4d248 100644 (file)
@@ -224,7 +224,6 @@ static guint32 start_wrapper(void *data)
        guint32 tid;
        MonoThread *thread=start_info->obj;
        MonoObject *start_delegate = start_info->delegate;
-       MonoObject *start_obj = start_info->start_arg;
        
 #ifdef THREAD_DEBUG
        g_message(G_GNUC_PRETTY_FUNCTION ": (%d) Start wrapper",
@@ -475,7 +474,6 @@ mono_thread_exit ()
 HANDLE ves_icall_System_Threading_Thread_Thread_internal(MonoThread *this,
                                                         MonoObject *start)
 {
-       MonoMulticastDelegate *delegate = (MonoMulticastDelegate*)start;
        guint32 (*start_func)(void *);
        struct StartInfo *start_info;
        MonoMethod *im;