Skip to content

Commit 18d7e39

Browse files
authored
[Mono] Fix C4018 warnings round II (#70783)
* Fix C4018 warnings round II * Changes for x86 * Fix more C4018 warnings * Last set of files being fixed within this PR * Address review feedback and fix a build failure * Update upd_locator_t to be in sync with locator_t
1 parent 8558cdc commit 18d7e39

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+239
-281
lines changed

src/mono/mono/component/hot_reload.c

Lines changed: 46 additions & 47 deletions
Large diffs are not rendered by default.

src/mono/mono/eglib/glib.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,6 +1406,8 @@ __CAST_PTRTYPE_TO_UTYPE(gintptr, gulong, ULONG_MAX)
14061406
__CAST_PTRTYPE_TO_STYPE(gintptr, gint, INT_MIN, INT_MAX)
14071407
__CAST_PTRTYPE_TO_UTYPE(gintptr, guint, UINT_MAX)
14081408

1409+
__CAST_PTRTYPE_TO_UTYPE(gintptr, gsize, SIZE_MAX)
1410+
14091411
__CAST_PTRTYPE_TO_STYPE(guintptr, gint32, INT32_MIN, INT32_MAX)
14101412
__CAST_PTRTYPE_TO_UTYPE(guintptr, guint32, UINT32_MAX)
14111413
__CAST_PTRTYPE_TO_STYPE(guintptr, gint16, INT16_MIN, INT16_MAX)
@@ -1443,6 +1445,9 @@ __CAST_STYPE_TO_UTYPE(gssize, guint, UINT_MAX)
14431445
__CAST_STYPE_TO_UTYPE(gssize, gsize, SIZE_MAX)
14441446
__CAST_UTYPE_TO_STYPE(gsize, gssize, PTRDIFF_MIN, PTRDIFF_MAX)
14451447

1448+
__CAST_STYPE_TO_UTYPE(glong, gulong, ULONG_MAX)
1449+
__CAST_UTYPE_TO_STYPE(gulong, glong, LONG_MIN, LONG_MAX)
1450+
14461451
__CAST_STYPE_TO_STYPE(gdouble, gint64, INT64_MIN, INT64_MAX)
14471452
__CAST_STYPE_TO_UTYPE(gdouble, guint64, UINT64_MAX)
14481453
__CAST_STYPE_TO_STYPE(gdouble, gint32, INT32_MIN, INT32_MAX)
@@ -1588,6 +1593,8 @@ __CAST_UTYPE_TO_STYPE(gunichar, gchar, CHAR_MIN, CHAR_MAX)
15881593
#define GINTPTR_TO_INT(v) G_CAST_PTRTYPE_TO_STYPE(gintptr, gint, v)
15891594
#define GINTPTR_TO_UINT(v) G_CAST_PTRTYPE_TO_UTYPE(gintptr, guint, v)
15901595

1596+
#define GINTPTR_TO_SIZE(v) G_CAST_PTRTYPE_TO_UTYPE(gintptr, gsize, v)
1597+
15911598
#define GUINTPTR_TO_INT32(v) G_CAST_PTRTYPE_TO_STYPE(guintptr, gint32, v)
15921599
#define GUINTPTR_TO_UINT32(v) G_CAST_PTRTYPE_TO_UTYPE(guintptr, guint32, v)
15931600

@@ -1624,6 +1631,9 @@ __CAST_UTYPE_TO_STYPE(gunichar, gchar, CHAR_MIN, CHAR_MAX)
16241631
#define GSSIZE_TO_SIZE(v) G_CAST_TYPE_TO_TYPE(gssize, gsize, v)
16251632
#define GSIZE_TO_SSIZE(v) G_CAST_TYPE_TO_TYPE(gsize, gssize, v)
16261633

1634+
#define GLONG_TO_ULONG(v) G_CAST_TYPE_TO_TYPE(glong, gulong, v)
1635+
#define GULONG_TO_LONG(v) G_CAST_TYPE_TO_TYPE(gulong, glong, v)
1636+
16271637
#define GDOUBLE_TO_INT64(v) G_CAST_TYPE_TO_TYPE(gdouble, gint64, v)
16281638
#define GDOUBLE_TO_UINT64(v) G_CAST_TYPE_TO_TYPE(gdouble, guint64, v)
16291639
#define GDOUBLE_TO_INT32(v) G_CAST_TYPE_TO_TYPE(gdouble, gint32, v)

src/mono/mono/metadata/assembly-load-context.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ ves_icall_System_Runtime_Loader_AssemblyLoadContext_InternalGetLoadedAssemblies
300300

301301
MonoArrayHandle res = mono_array_new_handle (mono_class_get_assembly_class (), assemblies->len, error);
302302
goto_if_nok (error, leave);
303-
for (int i = 0; i < assemblies->len; ++i) {
303+
for (guint i = 0; i < assemblies->len; ++i) {
304304
if (!add_assembly_to_array (res, i, (MonoAssembly *)g_ptr_array_index (assemblies, i), error))
305305
goto leave;
306306
}

src/mono/mono/metadata/assembly.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2915,9 +2915,8 @@ mono_assembly_release_gc_roots (MonoAssembly *assembly)
29152915
return;
29162916

29172917
if (assembly_is_dynamic (assembly)) {
2918-
int i;
29192918
MonoDynamicImage *dynimg = (MonoDynamicImage *)assembly->image;
2920-
for (i = 0; i < dynimg->image.module_count; ++i)
2919+
for (guint32 i = 0; i < dynimg->image.module_count; ++i)
29212920
mono_dynamic_image_release_gc_roots ((MonoDynamicImage *)dynimg->image.modules [i]);
29222921
mono_dynamic_image_release_gc_roots (dynimg);
29232922
}

src/mono/mono/metadata/class.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3233,7 +3233,6 @@ search_modules (MonoImage *image, const char *name_space, const char *name, gboo
32333233
MonoTableInfo *file_table = &image->tables [MONO_TABLE_FILE];
32343234
MonoImage *file_image;
32353235
MonoClass *klass;
3236-
int i;
32373236

32383237
error_init (error);
32393238

@@ -3243,8 +3242,8 @@ search_modules (MonoImage *image, const char *name_space, const char *name, gboo
32433242
* Note: image->modules contains the contents of the MODULEREF table, while
32443243
* the real module list is in the FILE table.
32453244
*/
3246-
int rows = table_info_get_rows (file_table);
3247-
for (i = 0; i < rows; i++) {
3245+
guint32 rows = table_info_get_rows (file_table);
3246+
for (guint32 i = 0; i < rows; i++) {
32483247
guint32 cols [MONO_FILE_SIZE];
32493248
mono_metadata_decode_row (file_table, i, cols, MONO_FILE_SIZE);
32503249
if (cols [MONO_FILE_FLAGS] == FILE_CONTAINS_NO_METADATA)

src/mono/mono/metadata/custom-attrs.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,9 @@ find_field_index (MonoClass *klass, MonoClassField *field) {
169169
static guint32
170170
find_property_index (MonoClass *klass, MonoProperty *property)
171171
{
172-
int i;
173172
MonoClassPropertyInfo *info = mono_class_get_property_info (klass);
174173

175-
for (i = 0; i < info->count; ++i) {
174+
for (guint32 i = 0; i < info->count; ++i) {
176175
if (property == &info->properties [i])
177176
return info->first + 1 + i;
178177
}
@@ -185,10 +184,9 @@ find_property_index (MonoClass *klass, MonoProperty *property)
185184
static guint32
186185
find_event_index (MonoClass *klass, MonoEvent *event)
187186
{
188-
int i;
189187
MonoClassEventInfo *info = mono_class_get_event_info (klass);
190188

191-
for (i = 0; i < info->count; ++i) {
189+
for (guint32 i = 0; i < info->count; ++i) {
192190
if (event == &info->events [i])
193191
return info->first + 1 + i;
194192
}
@@ -1631,7 +1629,6 @@ ves_icall_System_Reflection_RuntimeCustomAttributeData_ResolveArgumentsInternal
16311629
MonoReflectionAssembly *assembly = MONO_HANDLE_RAW (assembly_h);
16321630
MonoMethodSignature *sig;
16331631
MonoObjectHandle obj_h, namedarg_h, minfo_h;
1634-
int i;
16351632

16361633
if (len == 0)
16371634
return;
@@ -1658,7 +1655,7 @@ ves_icall_System_Reflection_RuntimeCustomAttributeData_ResolveArgumentsInternal
16581655
goto leave;
16591656

16601657
sig = mono_method_signature_internal (method);
1661-
for (i = 0; i < sig->param_count; ++i) {
1658+
for (guint16 i = 0; i < sig->param_count; ++i) {
16621659
MonoObject *obj;
16631660
MonoObject *typedarg;
16641661
MonoType *t;
@@ -1674,7 +1671,7 @@ ves_icall_System_Reflection_RuntimeCustomAttributeData_ResolveArgumentsInternal
16741671
mono_array_setref_internal (typed_args, i, typedarg);
16751672
}
16761673

1677-
for (i = 0; i < mono_array_length_internal (named_args); ++i) {
1674+
for (guint32 i = 0; i < mono_array_length_internal (named_args); ++i) {
16781675
MonoObject *obj;
16791676
MonoObject *namedarg, *minfo;
16801677

@@ -2761,7 +2758,7 @@ metadata_foreach_custom_attr_from_index (MonoImage *image, guint32 idx, MonoAsse
27612758
return;
27622759
i --;
27632760
gboolean stop_iterating = FALSE;
2764-
int rows = table_info_get_rows (ca);
2761+
guint32 rows = table_info_get_rows (ca);
27652762
while (!stop_iterating && i < rows) {
27662763
if (mono_metadata_decode_row_col (ca, i, MONO_CUSTOM_ATTR_PARENT) != idx)
27672764
break;
@@ -2878,8 +2875,8 @@ init_weak_fields_inner (MonoImage *image, GHashTable *indexes)
28782875

28792876
tdef = &image->tables [MONO_TABLE_CUSTOMATTRIBUTE];
28802877
guint32 parent, field_idx, col, mtoken, idx;
2881-
int rows = table_info_get_rows (tdef);
2882-
for (int i = 0; i < rows; ++i) {
2878+
guint32 rows = table_info_get_rows (tdef);
2879+
for (guint32 i = 0; i < rows; ++i) {
28832880
parent = mono_metadata_decode_row_col (tdef, i, MONO_CUSTOM_ATTR_PARENT);
28842881
if ((parent & MONO_CUSTOM_ATTR_MASK) != MONO_CUSTOM_ATTR_FIELDDEF)
28852882
continue;
@@ -2903,8 +2900,8 @@ init_weak_fields_inner (MonoImage *image, GHashTable *indexes)
29032900
/* Check whenever the assembly references the WeakAttribute type */
29042901
gboolean found = FALSE;
29052902
tdef = &image->tables [MONO_TABLE_TYPEREF];
2906-
int rows = table_info_get_rows (tdef);
2907-
for (int i = 0; i < rows; ++i) {
2903+
guint32 rows = table_info_get_rows (tdef);
2904+
for (guint32 i = 0; i < rows; ++i) {
29082905
guint32 string_offset = mono_metadata_decode_row_col (tdef, i, MONO_TYPEREF_NAME);
29092906
const char *name = mono_metadata_string_heap (image, string_offset);
29102907
if (!strcmp (name, "WeakAttribute")) {

src/mono/mono/metadata/debug-helpers.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ mono_custom_modifiers_get_desc (GString *res, const MonoType *type, gboolean inc
131131
void
132132
mono_type_get_desc (GString *res, MonoType *type, gboolean include_namespace)
133133
{
134-
int i;
135-
136134
switch (type->type) {
137135
case MONO_TYPE_VOID:
138136
g_string_append (res, "void"); break;
@@ -177,7 +175,7 @@ mono_type_get_desc (GString *res, MonoType *type, gboolean include_namespace)
177175
case MONO_TYPE_ARRAY:
178176
mono_type_get_desc (res, &type->data.array->eklass->_byval_arg, include_namespace);
179177
g_string_append_c (res, '[');
180-
for (i = 1; i < type->data.array->rank; ++i)
178+
for (guint8 i = 1; i < type->data.array->rank; ++i)
181179
g_string_append_c (res, ',');
182180
g_string_append_c (res, ']');
183181
break;
@@ -196,7 +194,7 @@ mono_type_get_desc (GString *res, MonoType *type, gboolean include_namespace)
196194
g_string_append (res, "<");
197195
context = &type->data.generic_class->context;
198196
if (context->class_inst) {
199-
for (i = 0; i < context->class_inst->type_argc; ++i) {
197+
for (guint i = 0; i < context->class_inst->type_argc; ++i) {
200198
if (i > 0)
201199
g_string_append (res, ", ");
202200
mono_type_get_desc (res, context->class_inst->type_argv [i], include_namespace);
@@ -205,7 +203,7 @@ mono_type_get_desc (GString *res, MonoType *type, gboolean include_namespace)
205203
if (context->method_inst) {
206204
if (context->class_inst)
207205
g_string_append (res, "; ");
208-
for (i = 0; i < context->method_inst->type_argc; ++i) {
206+
for (guint i = 0; i < context->method_inst->type_argc; ++i) {
209207
if (i > 0)
210208
g_string_append (res, ", ");
211209
mono_type_get_desc (res, context->method_inst->type_argv [i], include_namespace);
@@ -305,9 +303,7 @@ mono_signature_full_name (MonoMethodSignature *sig)
305303
void
306304
mono_ginst_get_desc (GString *str, MonoGenericInst *ginst)
307305
{
308-
int i;
309-
310-
for (i = 0; i < ginst->type_argc; ++i) {
306+
for (guint i = 0; i < ginst->type_argc; ++i) {
311307
if (i > 0)
312308
g_string_append (str, ", ");
313309
mono_type_get_desc (str, ginst->type_argv [i], TRUE);
@@ -599,7 +595,6 @@ mono_method_desc_search_in_image (MonoMethodDesc *desc, MonoImage *image)
599595
MonoClass *klass;
600596
const MonoTableInfo *methods;
601597
MonoMethod *method;
602-
int i;
603598

604599
/* Handle short names for system classes */
605600
if (!desc->name_space && image == mono_defaults.corlib) {
@@ -618,7 +613,7 @@ mono_method_desc_search_in_image (MonoMethodDesc *desc, MonoImage *image)
618613
/* FIXME: Is this call necessary? We don't use its result. */
619614
mono_image_get_table_info (image, MONO_TABLE_TYPEDEF);
620615
methods = mono_image_get_table_info (image, MONO_TABLE_METHOD);
621-
for (i = 0; i < mono_table_info_get_rows (methods); ++i) {
616+
for (guint32 i = 0; i < table_info_get_rows (methods); ++i) {
622617
ERROR_DECL (error);
623618
guint32 token = mono_metadata_decode_row_col (methods, i, MONO_METHOD_NAME);
624619
const char *n = mono_metadata_string_heap (image, token);

src/mono/mono/metadata/debug-mono-ppdb.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ get_pe_debug_info (MonoImage *image, guint8 *out_guid, gint32 *out_age, gint32 *
6666
{
6767
MonoPEDirEntry *debug_dir_entry;
6868
ImageDebugDirectory debug_dir;
69-
int idx;
7069
gboolean guid_found = FALSE;
7170
guint8 *data;
7271

@@ -77,7 +76,7 @@ get_pe_debug_info (MonoImage *image, guint8 *out_guid, gint32 *out_age, gint32 *
7776
return FALSE;
7877

7978
int offset = mono_cli_rva_image_map (image, debug_dir_entry->rva);
80-
for (idx = 0; idx < debug_dir_entry->size / sizeof (ImageDebugDirectory); ++idx) {
79+
for (guint32 idx = 0; idx < debug_dir_entry->size / sizeof (ImageDebugDirectory); ++idx) {
8180
data = (guint8 *) ((ImageDebugDirectory *) (image->raw_data + offset) + idx);
8281
debug_dir.characteristics = read32(data);
8382
debug_dir.time_date_stamp = read32(data + 4);
@@ -362,7 +361,8 @@ mono_ppdb_lookup_location_internal (MonoImage *image, int idx, uint32_t offset,
362361
const char *ptr;
363362
const char *end;
364363
char *docname = NULL;
365-
int size, docidx, iloffset, delta_il, delta_lines, delta_cols, start_line, start_col, adv_line, adv_col;
364+
int size, docidx, delta_lines, delta_cols, start_line, start_col, adv_line, adv_col;
365+
guint32 iloffset;
366366
gboolean first = TRUE, first_non_hidden = TRUE;
367367
MonoDebugSourceLocation *location;
368368

@@ -386,7 +386,7 @@ mono_ppdb_lookup_location_internal (MonoImage *image, int idx, uint32_t offset,
386386
start_line = 0;
387387
start_col = 0;
388388
while (ptr < end) {
389-
delta_il = mono_metadata_decode_value (ptr, &ptr);
389+
guint32 delta_il = mono_metadata_decode_value (ptr, &ptr);
390390
if (!first && delta_il == 0) {
391391
/* document-record */
392392
docidx = mono_metadata_decode_value (ptr, &ptr);
@@ -493,7 +493,7 @@ mono_ppdb_get_seq_points_internal (MonoImage *image, MonoPPDBFile *ppdb, MonoMet
493493
return -1;
494494

495495
MonoTableInfo *methodbody_table = &tables [MONO_TABLE_METHODBODY];
496-
if (G_UNLIKELY (method_idx - 1 >= table_info_get_rows (methodbody_table))) {
496+
if (G_UNLIKELY (GINT_TO_UINT32(method_idx) - 1 >= table_info_get_rows (methodbody_table))) {
497497
char *method_name = mono_method_full_name (method, FALSE);
498498
g_error ("Method idx %d is greater than number of rows (%d) in PPDB MethodDebugInformation table, for method %s in '%s'. Likely a malformed PDB file.",
499499
method_idx - 1, table_info_get_rows (methodbody_table), method_name, image->name);
@@ -625,7 +625,7 @@ mono_ppdb_lookup_locals_internal (MonoImage *image, int method_idx)
625625
guint32 cols [MONO_LOCALSCOPE_SIZE];
626626
guint32 locals_cols [MONO_LOCALVARIABLE_SIZE];
627627

628-
int i, lindex, sindex, locals_idx, locals_end_idx, nscopes, start_scope_idx, scope_idx;
628+
guint32 lindex, locals_idx, locals_end_idx, nscopes, start_scope_idx, scope_idx;
629629

630630
start_scope_idx = mono_metadata_localscope_from_methoddef (image, method_idx);
631631

@@ -651,7 +651,7 @@ mono_ppdb_lookup_locals_internal (MonoImage *image, int method_idx)
651651
// this endpoint becomes locals_end_idx below
652652

653653
// March to the last scope that is in this method
654-
int rows = table_info_get_rows (&tables [MONO_TABLE_LOCALSCOPE]);
654+
guint32 rows = table_info_get_rows (&tables [MONO_TABLE_LOCALSCOPE]);
655655
while (scope_idx <= rows) {
656656
mono_metadata_decode_row (&tables [MONO_TABLE_LOCALSCOPE], scope_idx-1, cols, MONO_LOCALSCOPE_SIZE);
657657
if (cols [MONO_LOCALSCOPE_METHOD] != method_idx)
@@ -680,7 +680,7 @@ mono_ppdb_lookup_locals_internal (MonoImage *image, int method_idx)
680680
res->locals = g_new0 (MonoDebugLocalVar, res->num_locals);
681681

682682
lindex = 0;
683-
for (sindex = 0; sindex < nscopes; ++sindex) {
683+
for (guint32 sindex = 0; sindex < nscopes; ++sindex) {
684684
scope_idx = start_scope_idx + sindex;
685685
mono_metadata_decode_row (&tables [MONO_TABLE_LOCALSCOPE], scope_idx-1, cols, MONO_LOCALSCOPE_SIZE);
686686

@@ -696,7 +696,7 @@ mono_ppdb_lookup_locals_internal (MonoImage *image, int method_idx)
696696

697697
//printf ("Scope: %s %d %d %d-%d\n", mono_method_full_name (method, 1), cols [MONO_LOCALSCOPE_STARTOFFSET], cols [MONO_LOCALSCOPE_LENGTH], locals_idx, locals_end_idx);
698698

699-
for (i = locals_idx; i < locals_end_idx; ++i) {
699+
for (guint32 i = locals_idx; i < locals_end_idx; ++i) {
700700
mono_metadata_decode_row (&tables [MONO_TABLE_LOCALVARIABLE], i - 1, locals_cols, MONO_LOCALVARIABLE_SIZE);
701701

702702
res->locals [lindex].name = g_strdup (mono_metadata_string_heap (image, locals_cols [MONO_LOCALVARIABLE_NAME]));
@@ -743,8 +743,8 @@ mono_ppdb_lookup_locals (MonoDebugMethodInfo *minfo)
743743
* We use this to pass context information to the row locator
744744
*/
745745
typedef struct {
746-
int idx; /* The index that we are trying to locate */
747-
int col_idx; /* The index in the row where idx may be stored */
746+
guint32 idx; /* The index that we are trying to locate */
747+
guint32 col_idx; /* The index in the row where idx may be stored */
748748
MonoTableInfo *t; /* pointer to the table */
749749
guint32 result;
750750
} locator_t;

src/mono/mono/metadata/dynamic-image.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,12 @@ MonoImage *
104104
mono_find_dynamic_image_owner (void *ptr)
105105
{
106106
MonoImage *owner = NULL;
107-
int i;
108107

109108
dynamic_images_lock ();
110109

111110
if (dynamic_images)
112111
{
113-
for (i = 0; !owner && i < dynamic_images->len; ++i) {
112+
for (guint i = 0; !owner && i < dynamic_images->len; ++i) {
114113
MonoImage *image = (MonoImage *)g_ptr_array_index (dynamic_images, i);
115114
if (mono_mempool_contains_addr (image->mempool, ptr))
116115
owner = image;

src/mono/mono/metadata/dynamic-stream.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ mono_dynstream_init (MonoDynamicStream *sh)
2828
}
2929

3030
static void
31-
make_room_in_stream (MonoDynamicStream *stream, int size)
31+
make_room_in_stream (MonoDynamicStream *stream, guint32 size)
3232
{
3333
MONO_REQ_GC_NEUTRAL_MODE;
3434

@@ -60,7 +60,7 @@ mono_dynstream_insert_string (MonoDynamicStream *sh, const char *str)
6060
len = strlen (str) + 1;
6161
idx = sh->index;
6262

63-
make_room_in_stream (sh, (int)(idx + len));
63+
make_room_in_stream (sh, idx + GSIZE_TO_UINT32(len));
6464

6565
/*
6666
* We strdup the string even if we already copy them in sh->data

src/mono/mono/metadata/exception.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,6 @@ mono_error_set_field_missing (MonoError *error, MonoClass *klass, const char *fi
13281328
void
13291329
mono_error_set_method_missing (MonoError *error, MonoClass *klass, const char *method_name, MonoMethodSignature *sig, const char *reason, ...)
13301330
{
1331-
int i;
13321331
char *result;
13331332
GString *res;
13341333

@@ -1361,7 +1360,7 @@ mono_error_set_method_missing (MonoError *error, MonoClass *klass, const char *m
13611360
if (sig) {
13621361
if (sig->generic_param_count) {
13631362
g_string_append_c (res, '<');
1364-
for (i = 0; i < sig->generic_param_count; ++i) {
1363+
for (guint i = 0; i < sig->generic_param_count; ++i) {
13651364
if (i > 0)
13661365
g_string_append (res, ",");
13671366
g_string_append_printf (res, "!%d", i);
@@ -1370,7 +1369,7 @@ mono_error_set_method_missing (MonoError *error, MonoClass *klass, const char *m
13701369
}
13711370

13721371
g_string_append_c (res, '(');
1373-
for (i = 0; i < sig->param_count; ++i) {
1372+
for (guint16 i = 0; i < sig->param_count; ++i) {
13741373
if (i > 0)
13751374
g_string_append_c (res, ',');
13761375
mono_type_get_desc (res, sig->params [i], TRUE);

src/mono/mono/metadata/image-internals.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ MonoImage*
2424
mono_image_loaded_internal (MonoAssemblyLoadContext *alc, const char *name);
2525

2626
MonoImage*
27-
mono_image_load_file_for_image_checked (MonoImage *image, int fileidx, MonoError *error);
27+
mono_image_load_file_for_image_checked (MonoImage *image, uint32_t fileidx, MonoError *error);
2828

2929
MonoImage*
30-
mono_image_load_module_checked (MonoImage *image, int idx, MonoError *error);
30+
mono_image_load_module_checked (MonoImage *image, uint32_t idx, MonoError *error);
3131

3232
MonoImage *
3333
mono_image_open_a_lot (MonoAssemblyLoadContext *alc, const char *fname, MonoImageOpenStatus *status, const MonoImageOpenOptions *options);

0 commit comments

Comments
 (0)