HANDLE_FUNCTION_ENTER ();
MONO_HANDLE_DCL (MonoObject, obj);
MonoRealProxyHandle real_proxy;
- HANDLE_FUNCTION_RETURN_VAL (cominterop_object_is_rcw_handle (obj, &real_proxy));
+ gboolean const result = cominterop_object_is_rcw_handle (obj, &real_proxy);
+ HANDLE_FUNCTION_RETURN_VAL (result);
}
static int
HANDLE_FUNCTION_ENTER ();
ERROR_DECL (error);
MONO_HANDLE_DCL (MonoObject, object);
- gpointer ccw_entry = cominterop_get_ccw_checked (object, itf, error);
+ gpointer const ccw_entry = cominterop_get_ccw_checked (object, itf, error);
mono_error_set_pending_exception (error);
HANDLE_FUNCTION_RETURN_VAL (ccw_entry);
}
HANDLE_FUNCTION_ENTER ();
MONO_HANDLE_DCL (MonoObject, object);
- HANDLE_FUNCTION_RETURN_VAL (mono_marshal_free_ccw_handle (object));
+ gboolean const result = mono_marshal_free_ccw_handle (object);
+ HANDLE_FUNCTION_RETURN_VAL (result);
}
/**
{
HANDLE_FUNCTION_ENTER ();
MONO_HANDLE_DCL (MonoObject, object);
- HANDLE_FUNCTION_RETURN_VAL (mono_cominterop_get_com_interface_internal (FALSE, object, ic, error));
+ void* const result = mono_cominterop_get_com_interface_internal (FALSE, object, ic, error);
+ HANDLE_FUNCTION_RETURN_VAL (result);
}
static void*
mono_custom_attrs_from_builders (MonoImage *alloc_img, MonoImage *image, MonoArray* cattrs)
{
HANDLE_FUNCTION_ENTER ();
- HANDLE_FUNCTION_RETURN_VAL (mono_custom_attrs_from_builders_handle (alloc_img, image, MONO_HANDLE_NEW (MonoArray, cattrs)));
+ MonoCustomAttrInfo* const result = mono_custom_attrs_from_builders_handle (alloc_img, image, MONO_HANDLE_NEW (MonoArray, cattrs));
+ HANDLE_FUNCTION_RETURN_VAL (result);
}
static void
HANDLE_FUNCTION_ENTER ();
ERROR_DECL (error);
MONO_HANDLE_DCL (MonoObject, obj);
- MonoCustomAttrInfo *result = mono_reflection_get_custom_attrs_info_checked (obj, error);
+ MonoCustomAttrInfo * const result = mono_reflection_get_custom_attrs_info_checked (obj, error);
mono_error_assert_ok (error);
HANDLE_FUNCTION_RETURN_VAL (result);
}
if (!handle_class)
handle_class = &klass;
- gpointer result = mono_reflection_resolve_object_handle (image, obj, handle_class, context, error);
+ gpointer const result = mono_reflection_resolve_object_handle (image, obj, handle_class, context, error);
HANDLE_FUNCTION_RETURN_VAL (result);
}
#else /* DISABLE_REFLECTION_EMIT */
MONO_RESTORE_WARNING
// Return a non-pointer or non-managed pointer, e.g. gboolean.
+// VAL should be a local variable or at least not use handles in the current frame.
+// i.e. it is "val", not "expr".
#define HANDLE_FUNCTION_RETURN_VAL(VAL) \
CLEAR_ICALL_FRAME; \
return (VAL); \
{
HANDLE_FUNCTION_ENTER ();
MONO_HANDLE_DCL (MonoObject, this_obj);
- HANDLE_FUNCTION_RETURN_VAL (mono_runtime_object_init_handle (this_obj, error));
+ gboolean const result = mono_runtime_object_init_handle (this_obj, error);
+ HANDLE_FUNCTION_RETURN_VAL (result);
}
/* The pseudo algorithm for type initialization from the spec
{
HANDLE_FUNCTION_ENTER ();
MONO_HANDLE_DCL(MonoException, exc);
- char * trace = mono_exception_handle_get_native_backtrace (exc);
+ char * const trace = mono_exception_handle_get_native_backtrace (exc);
HANDLE_FUNCTION_RETURN_VAL (trace);
}
HANDLE_FUNCTION_ENTER (); /* FIXME callers of image_create_token_raw should use handles */
error_init (error);
MONO_HANDLE_DCL (MonoObject, obj);
- guint32 result = mono_image_create_token (assembly, obj, create_methodspec, register_token, error);
+ guint32 const result = mono_image_create_token (assembly, obj, create_methodspec, register_token, error);
HANDLE_FUNCTION_RETURN_VAL (result);
}
{
/* FIXME all callers to string_to_utf8_image_raw should use handles */
HANDLE_FUNCTION_ENTER ();
- char* result = NULL;
error_init (error);
MONO_HANDLE_DCL (MonoString, s);
- result = mono_string_to_utf8_image (image, s, error);
+ char* const result = mono_string_to_utf8_image (image, s, error);
HANDLE_FUNCTION_RETURN_VAL (result);
}
HANDLE_FUNCTION_ENTER ();
error_init (error);
MONO_HANDLE_DCL (MonoReflectionType, ref);
- MonoType *result = mono_reflection_type_handle_mono_type (ref, error);
+ MonoType * const result = mono_reflection_type_handle_mono_type (ref, error);
HANDLE_FUNCTION_RETURN_VAL (result);
}
HANDLE_FUNCTION_ENTER(); /* FIXME callers of mono_type_array_get_and_resolve_raw should use handles */
error_init (error);
MONO_HANDLE_DCL (MonoArray, array);
- MonoType *result = mono_type_array_get_and_resolve (array, idx, error);
+ MonoType * const result = mono_type_array_get_and_resolve (array, idx, error);
HANDLE_FUNCTION_RETURN_VAL (result);
}
ctor_builder_to_signature_raw (MonoImage *image, MonoReflectionCtorBuilder* ctor_raw, MonoError *error) {
HANDLE_FUNCTION_ENTER();
MONO_HANDLE_DCL (MonoReflectionCtorBuilder, ctor);
- MonoMethodSignature *sig = ctor_builder_to_signature (image, ctor, error);
+ MonoMethodSignature * const sig = ctor_builder_to_signature (image, ctor, error);
HANDLE_FUNCTION_RETURN_VAL (sig);
}
/**
HANDLE_FUNCTION_ENTER (); /* FIXME change callers of methodbuilder_to_mono_method_raw to use handles */
error_init (error);
MONO_HANDLE_DCL (MonoReflectionMethodBuilder, mb);
- MonoMethod *result = methodbuilder_to_mono_method (klass, mb, error);
+ MonoMethod * const result = methodbuilder_to_mono_method (klass, mb, error);
HANDLE_FUNCTION_RETURN_VAL (result);
}
{
HANDLE_FUNCTION_ENTER ();
error_init (error);
- MonoObject *res = mono_runtime_try_invoke (mono_defaults.threadpool_perform_wait_callback_method, NULL, NULL, exc, error);
+ MonoObject * const res = mono_runtime_try_invoke (mono_defaults.threadpool_perform_wait_callback_method, NULL, NULL, exc, error);
HANDLE_FUNCTION_RETURN_VAL (res);
}
{
HANDLE_FUNCTION_ENTER ();
MonoExceptionHandle exc = MONO_HANDLE_NEW (MonoException, NULL);
- MonoException *exc_raw = mono_thread_execute_interruption (&exc) ? MONO_HANDLE_RAW (exc) : NULL;
+ MonoException * const exc_raw = mono_thread_execute_interruption (&exc) ? MONO_HANDLE_RAW (exc) : NULL;
HANDLE_FUNCTION_RETURN_VAL (exc_raw);
}