MonoType *type = NULL;
MonoAssembly *assembly;
MonoTypeNameParse info;
+ char *temp_str = g_strdup (str);
MONO_ARCH_SAVE_REGS;
- if (!mono_reflection_parse_type (str, &info)) {
+ /* mono_reflection_parse_type() mangles the string */
+ if (!mono_reflection_parse_type (temp_str, &info)) {
g_list_free (info.modifiers);
g_list_free (info.nested);
+ g_free (temp_str);
return NULL;
}
g_list_free (info.modifiers);
g_list_free (info.nested);
+ g_free (temp_str);
+
if (!type)
return NULL;
return mono_type_get_object (mono_domain_get (), type);
}
+#ifdef UNUSED
MonoReflectionType *
mono_type_get (const char *str)
{
g_free (copy);
return type;
}
+#endif
static MonoReflectionType*
ves_icall_type_from_name (MonoString *name,
{
MonoDomain *domain = mono_object_domain (assembly);
MonoString *res;
- char *name = g_build_filename (
- assembly->assembly->basedir,
- assembly->assembly->image->module_name, NULL);
MONO_ARCH_SAVE_REGS;
- res = mono_string_new (domain, name);
- g_free (name);
+ res = mono_string_new (domain, mono_image_get_filename (assembly->assembly->image));
+
return res;
}
ves_icall_System_Text_Encoding_InternalCodePage (gint32 *int_code_page)
{
const char *cset;
- char *p;
+ const char *p;
+ char *c;
char *codepage = NULL;
int code;
int want_name = *int_code_page;
MONO_ARCH_SAVE_REGS;
g_get_charset (&cset);
- p = codepage = strdup (cset);
- for (p = codepage; *p; p++){
- if (isascii (*p) && isalpha (*p))
- *p = tolower (*p);
- if (*p == '-')
- *p = '_';
+ c = codepage = strdup (cset);
+ for (c = codepage; *c; c++){
+ if (isascii (*c) && isalpha (*c))
+ *c = tolower (*c);
+ if (*c == '-')
+ *c = '_';
}
/* g_print ("charset: %s\n", cset); */
prelink_method (klass->methods [i]);
}
+/* These parameters are "readonly" in corlib/System/Char.cs */
static void
-ves_icall_System_Char_GetDataTablePointers (guint8 **category_data, guint8 **numeric_data,
- gdouble **numeric_data_values, guint16 **to_lower_data_low,
- guint16 **to_lower_data_high, guint16 **to_upper_data_low,
- guint16 **to_upper_data_high)
+ves_icall_System_Char_GetDataTablePointers (guint8 const **category_data,
+ guint8 const **numeric_data,
+ gdouble const **numeric_data_values,
+ guint16 const **to_lower_data_low,
+ guint16 const **to_lower_data_high,
+ guint16 const **to_upper_data_low,
+ guint16 const **to_upper_data_high)
{
*category_data = CategoryData;
*numeric_data = NumericData;
static MonoType*
type_from_typename (char *typename)
{
- MonoClass *klass;
+ MonoClass *klass = NULL; /* assignment to shut GCC warning up */
if (!strcmp (typename, "int"))
klass = mono_defaults.int_class;
#define MONO_TYPE_ISSTRUCT(t) (!(t)->byref && (((t)->type == MONO_TYPE_VALUETYPE && !(t)->data.klass->enumtype) || ((t)->type == MONO_TYPE_TYPEDBYREF) || (((t)->type == MONO_TYPE_GENERICINST) && mono_metadata_generic_inst_is_valuetype ((t)->data.generic_inst))))
#define MONO_TYPE_IS_VOID(t) ((t) && ((t)->type == MONO_TYPE_VOID) && !(t)->byref)
#define MONO_TYPE_IS_POINTER(t) ((t) && (((t)->byref || ((t)->type == MONO_TYPE_I) || (t)->type == MONO_TYPE_STRING) || ((t)->type == MONO_TYPE_SZARRAY) || ((t)->type == MONO_TYPE_CLASS) || ((t)->type == MONO_TYPE_CLASS) || ((t)->type == MONO_TYPE_OBJECT) || ((t)->type == MONO_TYPE_ARRAY) || ((t)->type == MONO_TYPE_PTR)))
-#define MONO_TYPE_IS_REFERENCE(t) ((t) && (((t)->type == MONO_TYPE_STRING) || ((t)->type == MONO_TYPE_SZARRAY) || ((t)->type == MONO_TYPE_CLASS) || ((t)->type == MONO_TYPE_OBJECT) || ((t)->type == MONO_TYPE_ARRAY)) || (((t)->type == MONO_TYPE_GENERICINST) && !mono_metadata_generic_inst_is_valuetype ((t)->data.generic_inst)))
+
+#define MONO_TYPE_IS_REFERENCE(t) ((t) && \
+ ((((t)->type == MONO_TYPE_STRING) || \
+ ((t)->type == MONO_TYPE_SZARRAY) || \
+ ((t)->type == MONO_TYPE_CLASS) || \
+ ((t)->type == MONO_TYPE_OBJECT) || \
+ ((t)->type == MONO_TYPE_ARRAY)) || \
+ (((t)->type == MONO_TYPE_GENERICINST) && \
+ !mono_metadata_generic_inst_is_valuetype ((t)->data.generic_inst))))
+
#define MONO_CLASS_IS_INTERFACE(c) ((c->flags & TYPE_ATTRIBUTE_INTERFACE) || (c->byval_arg.type == MONO_TYPE_VAR) || (c->byval_arg.type == MONO_TYPE_MVAR))
typedef struct _MonoClass MonoClass;