2006-10-12 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Thu, 12 Oct 2006 15:41:25 +0000 (15:41 -0000)
committerZoltan Varga <vargaz@gmail.com>
Thu, 12 Oct 2006 15:41:25 +0000 (15:41 -0000)
* metadata.c (mono_type_size): Change the align parameter to guint32 for
consistency with the other _size functions.
(mono_type_stack_size): Ditto.

* class.c object.c icall.c: Fix warnings caused by the above change.

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

mono/metadata/ChangeLog
mono/metadata/class.c
mono/metadata/icall.c
mono/metadata/metadata.c
mono/metadata/metadata.h
mono/metadata/object.c

index b8e8482d1cac6c9fe072bff3f3397567c097feb6..e90c75b52445a44484c2cbeb3c0ac191c56b31dd 100644 (file)
@@ -1,5 +1,11 @@
 2006-10-12  Zoltan Varga  <vargaz@gmail.com>
 
+       * metadata.c (mono_type_size): Change the align parameter to guint32 for
+       consistency with the other _size functions.
+       (mono_type_stack_size): Ditto.
+
+       * class.c object.c icall.c: Fix warnings caused by the above change.
+
        * class.c (mono_class_get_method_from_name_flags): Fix a typo.
 
        * image.c (load_metadata_ptrs): Reenable loading of modules with uncompressed metadata.
index 079bb6ef22b4513d10154c8b9b9be5c893c218aa..6a4405b43dbd842c7c9e6595e2332cd783384ad9 100644 (file)
@@ -1120,7 +1120,7 @@ mono_class_layout_fields (MonoClass *class)
 
                for (pass = 0; pass < passes; ++pass) {
                        for (i = 0; i < top; i++){
-                               int size, align;
+                               guint32 size, align;
 
                                field = &class->fields [i];
 
@@ -1174,7 +1174,7 @@ mono_class_layout_fields (MonoClass *class)
        case TYPE_ATTRIBUTE_EXPLICIT_LAYOUT:
                real_size = 0;
                for (i = 0; i < top; i++) {
-                       int size, align;
+                       guint32 size, align;
 
                        field = &class->fields [i];
 
@@ -1223,7 +1223,7 @@ mono_class_layout_fields (MonoClass *class)
         * Compute static field layout and size
         */
        for (i = 0; i < top; i++){
-               int size, align;
+               guint32 size, align;
 
                field = &class->fields [i];
                        
index 237540275b5df4085a24bd5323c6b7546af9a884..39bc6b926d9a44bd7ec6c32171c2eb353c2a3c44 100644 (file)
@@ -2743,7 +2743,7 @@ ves_icall_InternalExecute (MonoReflectionMethod *method, MonoObject *this, MonoA
                } else if (!strcmp (m->name, "FieldSetter")) {
                        MonoClass *k = this->vtable->klass;
                        MonoString *name;
-                       int size, align;
+                       guint32 size, align;
                        char *str;
                        
                        /* If this is a proxy, then it must be a CBO */
@@ -6143,7 +6143,7 @@ mono_ArgIterator_Setup (MonoArgIterator *iter, char* argsp, char* start)
        if (start) {
                iter->args = start;
        } else {
-               int i, align, arg_size;
+               guint32 i, align, arg_size;
                iter->args = argsp + sizeof (gpointer);
 #ifndef MONO_ARCH_REGPARMS
                for (i = 0; i < iter->sig->sentinelpos; ++i) {
@@ -6160,7 +6160,7 @@ mono_ArgIterator_Setup (MonoArgIterator *iter, char* argsp, char* start)
 static MonoTypedRef
 mono_ArgIterator_IntGetNextArg (MonoArgIterator *iter)
 {
-       gint i, align, arg_size;
+       guint32 i, align, arg_size;
        MonoTypedRef res;
        MONO_ARCH_SAVE_REGS;
 
@@ -6184,7 +6184,7 @@ mono_ArgIterator_IntGetNextArg (MonoArgIterator *iter)
 static MonoTypedRef
 mono_ArgIterator_IntGetNextArgT (MonoArgIterator *iter, MonoType *type)
 {
-       gint i, align, arg_size;
+       guint32 i, align, arg_size;
        MonoTypedRef res;
        MONO_ARCH_SAVE_REGS;
 
index 43a4bb2fb5fc345de8238bcd98429fce679b762c..40229602055a3e3d99d1ae459cefcbf0a4a718cf 100644 (file)
@@ -3153,10 +3153,9 @@ mono_backtrace (int limit)
  *
  * Returns: the number of bytes required to hold an instance of this
  * type in memory
- * FIXME: This should really use 'guint32*' for the align parameter.
  */
 int
-mono_type_size (MonoType *t, gint *align)
+mono_type_size (MonoType *t, guint32 *align)
 {
        if (!t) {
                *align = 1;
@@ -3259,12 +3258,11 @@ mono_type_size (MonoType *t, gint *align)
  *
  * Returns: the number of bytes required to hold an instance of this
  * type on the runtime stack
- * FIXME: This should really use 'guint32*' for the align parameter.
  */
 int
-mono_type_stack_size (MonoType *t, gint *align)
+mono_type_stack_size (MonoType *t, guint32 *align)
 {
-       int tmp;
+       guint32 tmp;
 
        g_assert (t != NULL);
 
index 4fdefd49394832884e208dcc0a49ae0e570c223c..a223ec50f67a1ee10a6ebb0ac9b16694e36e9155 100644 (file)
@@ -438,9 +438,9 @@ MonoType      *mono_type_create_from_typespec  (MonoImage        *image,
                                                guint32           type_spec);
 void           mono_metadata_free_type         (MonoType        *type);
 int            mono_type_size                  (MonoType        *type, 
-                                               int             *alignment);
+                                               guint32             *alignment);
 int            mono_type_stack_size            (MonoType        *type, 
-                                               int             *alignment);
+                                               guint32             *alignment);
 
 gboolean       mono_type_generic_inst_is_valuetype      (MonoType *type);
 gboolean       mono_metadata_generic_class_is_valuetype (MonoGenericClass *gclass);
index ff042bffb3123cb4d0b0c70b446254fcf0c37fbe..2747cbccc2ce4c0b5bdcfb4d0933d1b3d15d0ea6 100644 (file)
@@ -883,8 +883,7 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class)
                if (!(field->type->attrs & FIELD_ATTRIBUTE_LITERAL)) {
                        gint32 special_static = class->no_special_static_fields ? SPECIAL_STATIC_NONE : field_is_special_static (class, field);
                        if (special_static != SPECIAL_STATIC_NONE) {
-                               guint32 size, offset;
-                               int align;
+                               guint32 size, offset, align;
                                size = mono_type_size (field->type, &align);
                                offset = mono_alloc_special_static_data (special_static, size, align);
                                if (!domain->special_static_fields)