*
* Copyright 2002-2003 Ximian, Inc (http://www.ximian.com)
* Copyright 2004-2009 Novell, Inc (http://www.novell.com)
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#include "config.h"
#ifndef DISABLE_JIT
mb->code_size = 40;
- mb->code = g_malloc (mb->code_size);
+ mb->code = (unsigned char *)g_malloc (mb->code_size);
+ mb->init_locals = TRUE;
#endif
/* placeholder for the wrapper always at index 1 */
mono_mb_add_data (mb, NULL);
{
/* Realloc the method info into a mempool */
- method = mono_image_alloc0 (image, sizeof (MonoMethodWrapper));
+ method = (MonoMethod *)mono_image_alloc0 (image, sizeof (MonoMethodWrapper));
memcpy (method, mb->method, sizeof (MonoMethodWrapper));
mw = (MonoMethodWrapper*) method;
mw->header = header = (MonoMethodHeader *)
mono_image_alloc0 (image, MONO_SIZEOF_METHOD_HEADER + mb->locals * sizeof (MonoType *));
- header->code = mono_image_alloc (image, mb->pos);
+ header->code = (const unsigned char *)mono_image_alloc (image, mb->pos);
memcpy ((char*)header->code, mb->code, mb->pos);
for (i = 0, l = mb->locals_list; l; l = l->next, i++) {
header->code_size = mb->pos;
header->num_locals = mb->locals;
- header->init_locals = TRUE;
+ header->init_locals = mb->init_locals;
header->num_clauses = mb->num_clauses;
header->clauses = mb->clauses;
method->skip_visibility = mb->skip_visibility;
#endif
- i = g_list_length (mw->method_data);
+ i = g_list_length ((GList *)mw->method_data);
if (i) {
GList *tmp;
void **data;
- l = g_list_reverse (mw->method_data);
+ l = g_list_reverse ((GList *)mw->method_data);
if (method_is_dynamic (method))
- data = g_malloc (sizeof (gpointer) * (i + 1));
+ data = (void **)g_malloc (sizeof (gpointer) * (i + 1));
else
- data = mono_image_alloc (image, sizeof (gpointer) * (i + 1));
+ data = (void **)mono_image_alloc (image, sizeof (gpointer) * (i + 1));
/* store the size in the first element */
data [0] = GUINT_TO_POINTER (i);
i = 1;
#endif
if (mb->param_names) {
- char **param_names = mono_image_alloc0 (image, signature->param_count * sizeof (gpointer));
+ char **param_names = (char **)mono_image_alloc0 (image, signature->param_count * sizeof (gpointer));
for (i = 0; i < signature->param_count; ++i)
param_names [i] = mono_image_strdup (image, mb->param_names [i]);
mw = (MonoMethodWrapper *)mb->method;
/* one O(n) is enough */
- mw->method_data = g_list_prepend (mw->method_data, data);
+ mw->method_data = g_list_prepend ((GList *)mw->method_data, data);
- return g_list_length (mw->method_data);
+ return g_list_length ((GList *)mw->method_data);
}
#ifndef DISABLE_JIT
{
if (mb->pos >= mb->code_size) {
mb->code_size += mb->code_size >> 1;
- mb->code = g_realloc (mb->code, mb->code_size);
+ mb->code = (unsigned char *)g_realloc (mb->code, mb->code_size);
}
mb->code [mb->pos++] = op;
{
if ((mb->pos + 4) >= mb->code_size) {
mb->code_size += mb->code_size >> 1;
- mb->code = g_realloc (mb->code, mb->code_size);
+ mb->code = (unsigned char *)g_realloc (mb->code, mb->code_size);
}
mono_mb_patch_addr (mb, mb->pos, data);
{
if ((mb->pos + 8) >= mb->code_size) {
mb->code_size += mb->code_size >> 1;
- mb->code = g_realloc (mb->code, mb->code_size);
+ mb->code = (unsigned char *)g_realloc (mb->code, mb->code_size);
}
mono_mb_patch_addr (mb, mb->pos, data);
{
if ((mb->pos + 2) >= mb->code_size) {
mb->code_size += mb->code_size >> 1;
- mb->code = g_realloc (mb->code, mb->code_size);
+ mb->code = (unsigned char *)g_realloc (mb->code, mb->code_size);
}
mb->code [mb->pos] = data & 0xff;
{
MonoMethod *ctor = NULL;
- MonoClass *mme = mono_class_from_name (mono_defaults.corlib, exc_nspace, exc_name);
+ MonoClass *mme = mono_class_load_from_name (mono_defaults.corlib, exc_nspace, exc_name);
mono_class_init (mme);
ctor = mono_class_get_method_from_name (mme, ".ctor", 0);
g_assert (ctor);