From: monojenkins Date: Tue, 15 Dec 2015 17:43:22 +0000 (+0000) Subject: Merge pull request #2338 from BogdanovKirill/httpwritefix3 X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mono.git;a=commitdiff_plain;h=564fe71fa8cccb5a6cdbeaf713a2f1eaa7729593;hp=10e5aba1550505184f094cc4329ce6a184551082 Merge pull request #2338 from BogdanovKirill/httpwritefix3 [HttpConnection] Bug fix: HttpListener's "IgnoreWriteExceptions" property value is ignored when "Expect: 100-Continue" header set in request That problem was discussed previously here: https://github.com/mono/mono/pull/2300 I want to offer alternative solution now. --- diff --git a/Makefile.am b/Makefile.am index 14232e66858..d48ca3110e8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -25,13 +25,14 @@ update_submodules: .PHONY: update_submodules EXTRA_DIST= \ - README.md \ - LICENSE \ - autogen.sh \ - mkinstalldirs \ - mono-uninstalled.pc.in \ - winconfig.h \ - external + README.md \ + LICENSE \ + autogen.sh \ + mkinstalldirs \ + mono-uninstalled.pc.in \ + winconfig.h \ + code_of_conduct.md \ + external DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false diff --git a/acceptance-tests/SUBMODULES.json b/acceptance-tests/SUBMODULES.json index 8624aa789e2..e0335f40f7d 100644 --- a/acceptance-tests/SUBMODULES.json +++ b/acceptance-tests/SUBMODULES.json @@ -10,7 +10,7 @@ { "name": "coreclr", "url": "git://github.com/mono/coreclr.git", - "rev": "ffe6263398591cfbd8100070ac8a191ff2080fbb", + "rev": "96cf61f96b42cf9d013e641609cb7787f6e3a71f", "remote-branch": "origin/mono", "branch": "mono", "directory": "coreclr" @@ -18,7 +18,7 @@ { "name": "ms-test-suite", "url": "git@github.com:xamarin/ms-test-suite.git", - "rev": "19f2a7dd44a2bfcf6006fd38033222383e8b81bf", + "rev": "8eb26bd72a38e2c78675db45b13e89237dbdf4f2", "remote-branch": "origin/master", "branch": "master", "directory": "ms-test-suite" diff --git a/code_of_conduct.md b/code_of_conduct.md new file mode 100644 index 00000000000..84bad191c31 --- /dev/null +++ b/code_of_conduct.md @@ -0,0 +1,50 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, and in the interest of +fostering an open and welcoming community, we pledge to respect all people who +contribute through reporting issues, posting feature requests, updating +documentation, submitting pull requests or patches, and other activities. + +We are committed to making participation in this project a harassment-free +experience for everyone, regardless of level of experience, gender, gender +identity and expression, sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, such as physical or electronic + addresses, without explicit permission +* Other unethical or unprofessional conduct + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +By adopting this Code of Conduct, project maintainers commit themselves to +fairly and consistently applying these principles to every aspect of managing +this project. Project maintainers who do not follow or enforce the Code of +Conduct may be permanently removed from the project team. + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting a project maintainer at miguel@xamarin.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. Maintainers are +obligated to maintain confidentiality with regard to the reporter of an +incident. + + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 1.3.0, available at +[http://contributor-covenant.org/version/1/3/0/][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/3/0/ diff --git a/configure.ac b/configure.ac index be1e231bd30..7714b10f254 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # Process this file with autoconf to produce a configure script. #AC_PREREQ([2.62]) -AC_INIT(mono, [4.3.0], +AC_INIT(mono, [4.3.2], [http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono]) AC_CONFIG_SRCDIR([README.md]) @@ -417,7 +417,7 @@ AC_PROG_LD_GNU AM_ICONV() AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h sys/utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h sys/mkdev.h sys/uio.h sys/param.h sys/sysctl.h libproc.h sys/prctl.h) -AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h asm/sigcontext.h sys/inotify.h arpa/inet.h complex.h unwind.h) +AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/ipc.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h asm/sigcontext.h sys/inotify.h arpa/inet.h complex.h unwind.h) AC_CHECK_HEADERS([linux/netlink.h linux/rtnetlink.h], [], [], [#include #include @@ -731,7 +731,7 @@ DISABLED_FEATURES=none AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems. LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug, appdomains, verifier, reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, perfcounters, normalization, assembly_remapping, shared_perfcounters, remoting, - security, sgen_remset, sgen_marksweep_par, sgen_marksweep_fixed, sgen_marksweep_fixed_par, sgen_copying, shared_handles.], + security, sgen_remset, sgen_marksweep_par, sgen_marksweep_fixed, sgen_marksweep_fixed_par, sgen_copying.], [ for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do eval "mono_feature_disable_$feature='yes'" @@ -906,11 +906,6 @@ if test "x$mono_feature_disable_sgen_copying" = "xyes"; then AC_MSG_NOTICE([Disabled major=copying support in SGEN.]) fi -if test "x$mono_feature_disable_shared_handles" = "xyes"; then - AC_DEFINE(DISABLE_SHARED_HANDLES, 1, [Disable inter-process shared handles]) - AC_SUBST(DISABLE_SHARED_HANDLES) -fi - AC_ARG_ENABLE(executables, [ --disable-executables disable the build of the runtime executables], enable_executables=$enableval, enable_executables=yes) AM_CONDITIONAL(DISABLE_EXECUTABLES, test x$enable_executables = xno) @@ -2443,15 +2438,6 @@ if test "x$ac_cv_have_dev_random" = "xno" \ *** variable MONO_EGD_SOCKET to point to the daemon's socket to use that. ***]]) fi - -AC_MSG_CHECKING([if inter-process shared handles are requested]) -# Same as --enable-minimal=shared_handles -AC_ARG_ENABLE(shared-handles, [ --disable-shared-handles disable inter-process shared handles], try_shared_handles=$enableval, try_shared_handles=no) -AC_MSG_RESULT($try_shared_handles) -if test "x$try_shared_handles" != "xyes"; then - AC_DEFINE(DISABLE_SHARED_HANDLES, 1, [Disable inter-process shared handles]) - AC_SUBST(DISABLE_SHARED_HANDLES) -fi AC_ARG_ENABLE(bcl-opt, [ --disable-bcl-opt BCL is compiled with no optimizations (allows accurate BCL debugging)], test_bcl_opt=$enableval, test_bcl_opt=yes) @@ -2725,6 +2711,7 @@ case "$host" in mips*) TARGET=MIPS; arch_target=mips; + with_tls=pthread; ACCESS_UNALIGNED="no" AC_MSG_CHECKING(for mips n32) @@ -3619,7 +3606,7 @@ AC_SUBST(X11) AC_SUBST(GDKX11) AC_SUBST(GTKX11) AC_SUBST(XINERAMA) -AC_DEFINE_UNQUOTED(ARCHITECTURE,"$arch_target",[The architecture this is running on]) +AC_DEFINE_UNQUOTED(MONO_ARCHITECTURE,"$arch_target",[The architecture this is running on]) AC_SUBST(arch_target) AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) diff --git a/data/Makefile.am b/data/Makefile.am index 2cfd5202b65..b5b83fa69f1 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -14,7 +14,8 @@ EXTRA_DIST = \ net_1_1/machine.config \ gdb/mono-gdb.py \ gdb/gdb-python.diff \ - lldb/mono.py + lldb/mono.py \ + lldb/monobt.py pkgconfigdir = $(libdir)/pkgconfig diff --git a/data/lldb/monobt.py b/data/lldb/monobt.py new file mode 100644 index 00000000000..0e4713816d7 --- /dev/null +++ b/data/lldb/monobt.py @@ -0,0 +1,56 @@ +import lldb + +def print_frames(thread, num_frames, current_thread): + # TODO: Make output header similar to bt. + print '%c thread #%i' % ('*' if current_thread else ' ', thread.idx) + + if current_thread: + selected_frame = thread.GetSelectedFrame() + + for frame in thread.frames[:+num_frames]: + pc = str(frame.addr) + fmt = ' %c %s' + var = frame + if pc[0] == '0': + try: + framestr = frame.EvaluateExpression('(char*)mono_pmip((void*)%s)' % pc).summary[1:-1] + var = 'frame #%i: %s%s' % (frame.idx, pc, framestr) + except: + pass + + print fmt % ('*' if current_thread and frame.idx == selected_frame.idx else ' ', var) + +def monobt(debugger, command, result, dict): + opts = {'all_bt': False, 'num_frames': None} + + if command == 'all': + opts['all_bt'] = True + elif command.isdigit(): + opts['num_frames'] = int(command) + elif command != '': + print 'error: monobt [|all]' + return + + target = debugger.GetSelectedTarget() + process = target.process + + if not process.IsValid(): + print 'error: invalid process' + return + + if opts['all_bt']: + for thread in process.threads: + print_frames(thread, len(thread), process.selected_thread == thread) + print '' + else: + thread = process.selected_thread + num_frames = len(thread) if opts['num_frames'] is None else opts['num_frames'] + print_frames(thread, num_frames, True) + + return None + +def __lldb_init_module (debugger, dict): + # This initializer is being run from LLDB in the embedded command interpreter + # Add any commands contained in this module to LLDB + debugger.HandleCommand('command script add -f monobt.monobt monobt') + print '"monobt" command installed' \ No newline at end of file diff --git a/external/referencesource b/external/referencesource index 8259de00d0e..8382c4605d6 160000 --- a/external/referencesource +++ b/external/referencesource @@ -1 +1 @@ -Subproject commit 8259de00d0ea77ecdcbf4bf62a3446f86cf4a1ac +Subproject commit 8382c4605d622d56354e7340bf872caaf36b972a diff --git a/libgc/alloc.c b/libgc/alloc.c index b6bc1832c99..2ffafd441d7 100644 --- a/libgc/alloc.c +++ b/libgc/alloc.c @@ -644,9 +644,17 @@ GC_stop_func stop_func; } } -void (*GC_notify_event) GC_PROTO((GCEventType e)); +void (*GC_notify_event) GC_PROTO((GC_EventType e)); void (*GC_on_heap_resize) GC_PROTO((size_t new_size)); +GC_API void GC_set_on_collection_event (void (*fn) (GC_EventType)) +{ + DCL_LOCK_STATE; + LOCK(); + GC_notify_event = fn; + UNLOCK(); +} + /* Finish up a collection. Assumes lock is held, signals are disabled, */ /* but the world is otherwise running. */ void GC_finish_collection() diff --git a/libgc/finalize.c b/libgc/finalize.c index 5626e872137..39224f94ed6 100644 --- a/libgc/finalize.c +++ b/libgc/finalize.c @@ -313,7 +313,7 @@ typedef struct { GC_hidden_pointer weak_ref; } GCToggleRef; -static int (*GC_toggleref_callback) (GC_PTR obj); +static GC_ToggleRefStatus (*GC_toggleref_callback) (GC_PTR obj); static GCToggleRef *GC_toggleref_array; static int GC_toggleref_array_size; static int GC_toggleref_array_capacity; @@ -326,7 +326,7 @@ GC_process_togglerefs (void) int toggle_ref_counts [3] = { 0, 0, 0 }; for (i = w = 0; i < GC_toggleref_array_size; ++i) { - int res; + GC_ToggleRefStatus res; GCToggleRef r = GC_toggleref_array [i]; GC_PTR obj; @@ -341,14 +341,14 @@ GC_process_togglerefs (void) res = GC_toggleref_callback (obj); ++toggle_ref_counts [res]; switch (res) { - case 0: + case GC_TOGGLE_REF_DROP: break; - case 1: + case GC_TOGGLE_REF_STRONG: GC_toggleref_array [w].strong_ref = obj; GC_toggleref_array [w].weak_ref = (GC_hidden_pointer)NULL; ++w; break; - case 2: + case GC_TOGGLE_REF_WEAK: GC_toggleref_array [w].strong_ref = NULL; GC_toggleref_array [w].weak_ref = HIDE_POINTER (obj); ++w; @@ -370,7 +370,7 @@ GC_process_togglerefs (void) static void (*GC_object_finalized_proc) (GC_PTR obj); void -GC_set_finalizer_notify_proc (void (*proc) (GC_PTR obj)) +GC_set_await_finalize_proc (void (*proc) (GC_PTR obj)) { GC_object_finalized_proc = proc; } @@ -423,17 +423,19 @@ static void GC_clear_togglerefs () -void GC_toggleref_register_callback(int (*proccess_toggleref) (GC_PTR obj)) +void GC_set_toggleref_func(GC_ToggleRefStatus (*proccess_toggleref) (GC_PTR obj)) { GC_toggleref_callback = proccess_toggleref; } -static void +static GC_bool ensure_toggleref_capacity (int capacity) { if (!GC_toggleref_array) { GC_toggleref_array_capacity = 32; GC_toggleref_array = (GCToggleRef *) GC_INTERNAL_MALLOC_IGNORE_OFF_PAGE (GC_toggleref_array_capacity * sizeof (GCToggleRef), NORMAL); + if (!GC_toggleref_array) + return FALSE; } if (GC_toggleref_array_size + capacity >= GC_toggleref_array_capacity) { GCToggleRef *tmp; @@ -442,15 +444,19 @@ ensure_toggleref_capacity (int capacity) GC_toggleref_array_capacity *= 2; tmp = (GCToggleRef *) GC_INTERNAL_MALLOC_IGNORE_OFF_PAGE (GC_toggleref_array_capacity * sizeof (GCToggleRef), NORMAL); + if (!tmp) + return FALSE; memcpy (tmp, GC_toggleref_array, GC_toggleref_array_size * sizeof (GCToggleRef)); GC_INTERNAL_FREE (GC_toggleref_array); GC_toggleref_array = tmp; } + return TRUE; } -void +int GC_toggleref_add (GC_PTR object, int strong_ref) { + int res = GC_SUCCESS; DCL_LOCK_STATE; # ifdef THREADS DISABLE_SIGNALS(); @@ -460,7 +466,10 @@ GC_toggleref_add (GC_PTR object, int strong_ref) if (!GC_toggleref_callback) goto end; - ensure_toggleref_capacity (1); + if (!ensure_toggleref_capacity (1)) { + res = GC_NO_MEMORY; + goto end; + } GC_toggleref_array [GC_toggleref_array_size].strong_ref = strong_ref ? object : NULL; GC_toggleref_array [GC_toggleref_array_size].weak_ref = strong_ref ? (GC_hidden_pointer)NULL : HIDE_POINTER (object); ++GC_toggleref_array_size; @@ -470,6 +479,7 @@ end: UNLOCK(); ENABLE_SIGNALS(); # endif + return res; } diff --git a/libgc/include/gc.h b/libgc/include/gc.h index dd7fb7a86c8..e7929918ad0 100644 --- a/libgc/include/gc.h +++ b/libgc/include/gc.h @@ -104,11 +104,11 @@ typedef enum { GC_EVENT_POST_STOP_WORLD, GC_EVENT_PRE_START_WORLD, GC_EVENT_POST_START_WORLD -} GCEventType; +} GC_EventType; -GC_API void (*GC_notify_event) GC_PROTO((GCEventType event_type)); - /* Invoked at specific points during every collection. - */ +GC_API void GC_set_on_collection_event GC_PROTO((void (*) (GC_EventType))); + /* Set callback invoked at specific points */ + /* during every collection. */ GC_API void (*GC_on_heap_resize) GC_PROTO((size_t new_size)); /* Invoked when the heap grows or shrinks */ @@ -431,7 +431,10 @@ int GC_get_suspend_signal GC_PROTO((void)); /* Return the signal used by the gc to resume threads on posix platforms. */ /* Return -1 otherwise. */ -int GC_get_restart_signal GC_PROTO((void)); +int GC_get_thr_restart_signal GC_PROTO((void)); + +/* Explicitly enable GC_register_my_thread() invocation. */ +GC_API void GC_allow_register_threads GC_PROTO((void)); /* Disable garbage collection. Even GC_gcollect calls will be */ /* ineffective. */ @@ -773,13 +776,21 @@ GC_API int GC_unregister_disappearing_link GC_PROTO((GC_PTR * /* link */)); GC_API int GC_register_long_link GC_PROTO((GC_PTR * /* link */, GC_PTR obj)); GC_API int GC_unregister_long_link GC_PROTO((GC_PTR * /* link */)); +typedef enum { + GC_TOGGLE_REF_DROP, + GC_TOGGLE_REF_STRONG, + GC_TOGGLE_REF_WEAK +} GC_ToggleRefStatus; /* toggleref support */ -GC_API void GC_toggleref_register_callback GC_PROTO((int (*proccess_toggleref) (GC_PTR obj))); -GC_API void GC_toggleref_add (GC_PTR object, int strong_ref); +GC_API void GC_set_toggleref_func GC_PROTO( + (GC_ToggleRefStatus (*proccess_toggleref) (GC_PTR obj))); +GC_API int GC_toggleref_add (GC_PTR object, int strong_ref); + /* Returns GC_SUCCESS if registration succeeded (or no callback */ + /* registered yet), GC_NO_MEMORY if failed for lack of memory. */ /* finalizer callback support */ -GC_API void GC_set_finalizer_notify_proc GC_PROTO((void (*object_finalized) (GC_PTR obj))); +GC_API void GC_set_await_finalize_proc GC_PROTO((void (*object_finalized) (GC_PTR obj))); /* Returns !=0 if GC_invoke_finalizers has something to do. */ @@ -859,6 +870,21 @@ GC_API GC_PTR GC_is_visible GC_PROTO((GC_PTR p)); /* Always returns its argument. */ GC_API GC_PTR GC_is_valid_displacement GC_PROTO((GC_PTR p)); +#define GC_SUCCESS 0 +#define GC_DUPLICATE 1 /* Was already registered. */ +#define GC_NO_MEMORY 2 /* Failure due to lack of memory. */ +#define GC_UNIMPLEMENTED 3 /* Not yet implemented on the platform. */ + +/* Structure representing the base of a thread stack. */ +struct GC_stack_base { + void * mem_base; /* Base of memory stack. */ +}; + +/* Register the current thread, with the indicated stack base. */ +/* Returns GC_SUCCESS on success, GC_DUPLICATE if already registered. */ +/* On some platforms it returns GC_UNIMPLEMENTED. */ +GC_API int GC_register_my_thread GC_PROTO((struct GC_stack_base *)); + /* Returns 1 if the calling thread is registered with the GC, 0 otherwise */ GC_API int GC_thread_is_registered GC_PROTO((void)); @@ -949,7 +975,9 @@ extern void GC_thr_init(void); /* Needed for Solaris/X86 */ #if defined(GC_WIN32_THREADS) && !defined(__CYGWIN32__) && !defined(__CYGWIN__) # include +# ifdef GC_INSIDE_DLL BOOL WINAPI GC_DllMain(HINSTANCE inst, ULONG reason, LPVOID reserved); +# endif /* * All threads must be created using GC_CreateThread, so that they will be diff --git a/libgc/include/private/gc_priv.h b/libgc/include/private/gc_priv.h index 10c095e7d2f..ab77402e4cd 100644 --- a/libgc/include/private/gc_priv.h +++ b/libgc/include/private/gc_priv.h @@ -1214,6 +1214,8 @@ extern long GC_large_alloc_warn_suppressed; extern GC_bool GC_world_stopped; #endif +extern void (*GC_notify_event) GC_PROTO((GC_EventType)); + /* Operations */ # ifndef abs # define abs(x) ((x) < 0? (-(x)) : (x)) diff --git a/libgc/include/private/pthread_support.h b/libgc/include/private/pthread_support.h index 4046a2666b8..bcb89b6a198 100644 --- a/libgc/include/private/pthread_support.h +++ b/libgc/include/private/pthread_support.h @@ -16,6 +16,23 @@ /* We use the allocation lock to protect thread-related data structures. */ +#ifdef THREAD_LOCAL_ALLOC +# if CPP_WORDSZ == 64 && defined(ALIGN_DOUBLE) +# define GRANULARITY 16 +# define NFREELISTS 49 +# else +# define GRANULARITY 8 +# define NFREELISTS 65 +# endif + struct thread_local_freelists { + ptr_t ptrfree_freelists[NFREELISTS]; + ptr_t normal_freelists[NFREELISTS]; +# ifdef GC_GCJ_SUPPORT + ptr_t gcj_freelists[NFREELISTS]; +# endif + }; +#endif + /* The set of all known threads. We intercept thread creation and */ /* joins. */ /* Protected by allocation/GC lock. */ @@ -60,23 +77,12 @@ typedef struct GC_Thread_Rep { /* reclamation of any data it might */ /* reference. */ # ifdef THREAD_LOCAL_ALLOC -# if CPP_WORDSZ == 64 && defined(ALIGN_DOUBLE) -# define GRANULARITY 16 -# define NFREELISTS 49 -# else -# define GRANULARITY 8 -# define NFREELISTS 65 -# endif /* The ith free list corresponds to size i*GRANULARITY */ # define INDEX_FROM_BYTES(n) ((ADD_SLOP(n) + GRANULARITY - 1)/GRANULARITY) # define BYTES_FROM_INDEX(i) ((i) * GRANULARITY - EXTRA_BYTES) # define SMALL_ENOUGH(bytes) (ADD_SLOP(bytes) <= \ (NFREELISTS-1)*GRANULARITY) - ptr_t ptrfree_freelists[NFREELISTS]; - ptr_t normal_freelists[NFREELISTS]; -# ifdef GC_GCJ_SUPPORT - ptr_t gcj_freelists[NFREELISTS]; -# endif + struct thread_local_freelists tlfs; /* Free lists contain either a pointer or a small count */ /* reflecting the number of granules allocated at that */ /* size. */ diff --git a/libgc/misc.c b/libgc/misc.c index 3fa00a8b063..480759c57b9 100644 --- a/libgc/misc.c +++ b/libgc/misc.c @@ -480,7 +480,7 @@ int GC_get_suspend_signal GC_PROTO(()) #endif } -int GC_get_restart_signal GC_PROTO(()) +int GC_get_thr_restart_signal GC_PROTO(()) { #if defined(SIG_THR_RESTART) && defined(GC_PTHREADS) && !defined(GC_MACOSX_THREADS) && !defined(GC_OPENBSD_THREADS) return SIG_THR_RESTART; diff --git a/libgc/pthread_support.c b/libgc/pthread_support.c index a8c8b330a36..623a94e7c8c 100644 --- a/libgc/pthread_support.c +++ b/libgc/pthread_support.c @@ -294,17 +294,17 @@ void GC_init_thread_local(GC_thread p) ABORT("Failed to set thread specific allocation pointers"); } for (i = 1; i < NFREELISTS; ++i) { - p -> ptrfree_freelists[i] = (ptr_t)1; - p -> normal_freelists[i] = (ptr_t)1; + p -> tlfs.ptrfree_freelists[i] = (ptr_t)1; + p -> tlfs.normal_freelists[i] = (ptr_t)1; # ifdef GC_GCJ_SUPPORT - p -> gcj_freelists[i] = (ptr_t)1; + p -> tlfs.gcj_freelists[i] = (ptr_t)1; # endif } /* Set up the size 0 free lists. */ - p -> ptrfree_freelists[0] = (ptr_t)(&size_zero_object); - p -> normal_freelists[0] = (ptr_t)(&size_zero_object); + p -> tlfs.ptrfree_freelists[0] = (ptr_t)(&size_zero_object); + p -> tlfs.normal_freelists[0] = (ptr_t)(&size_zero_object); # ifdef GC_GCJ_SUPPORT - p -> gcj_freelists[0] = (ptr_t)(-1); + p -> tlfs.gcj_freelists[0] = (ptr_t)(-1); # endif } @@ -320,10 +320,10 @@ void GC_destroy_thread_local(GC_thread p) # ifndef HANDLE_FORK GC_ASSERT(GC_getspecific(GC_thread_key) == (void *)p); # endif - return_freelists(p -> ptrfree_freelists, GC_aobjfreelist); - return_freelists(p -> normal_freelists, GC_objfreelist); + return_freelists(p -> tlfs.ptrfree_freelists, GC_aobjfreelist); + return_freelists(p -> tlfs.normal_freelists, GC_objfreelist); # ifdef GC_GCJ_SUPPORT - return_freelists(p -> gcj_freelists, GC_gcjobjfreelist); + return_freelists(p -> tlfs.gcj_freelists, GC_gcjobjfreelist); # endif } @@ -357,7 +357,7 @@ GC_PTR GC_local_malloc(size_t bytes) GC_ASSERT(tsd == (void *)GC_lookup_thread(pthread_self())); UNLOCK(); # endif - my_fl = ((GC_thread)tsd) -> normal_freelists + index; + my_fl = ((GC_thread)tsd) -> tlfs.normal_freelists + index; my_entry = *my_fl; if (EXPECT((word)my_entry >= HBLKSIZE, 1)) { ptr_t next = obj_link(my_entry); @@ -384,7 +384,7 @@ GC_PTR GC_local_malloc_atomic(size_t bytes) } else { int index = INDEX_FROM_BYTES(bytes); ptr_t * my_fl = ((GC_thread)GC_getspecific(GC_thread_key)) - -> ptrfree_freelists + index; + -> tlfs.ptrfree_freelists + index; ptr_t my_entry = *my_fl; if (EXPECT((word)my_entry >= HBLKSIZE, 1)) { @@ -424,7 +424,7 @@ GC_PTR GC_local_gcj_malloc(size_t bytes, } else { int index = INDEX_FROM_BYTES(bytes); ptr_t * my_fl = ((GC_thread)GC_getspecific(GC_thread_key)) - -> gcj_freelists + index; + -> tlfs.gcj_freelists + index; ptr_t my_entry = *my_fl; if (EXPECT((word)my_entry >= HBLKSIZE, 1)) { GC_PTR result = (GC_PTR)my_entry; @@ -463,7 +463,7 @@ GC_PTR GC_local_gcj_malloc(size_t bytes, void * GC_local_gcj_fast_malloc(size_t lw, void * ptr_to_struct_containing_descr) { ptr_t * my_fl = ((GC_thread)GC_getspecific(GC_thread_key)) - -> gcj_freelists + lw; + -> tlfs.gcj_freelists + lw; ptr_t my_entry = *my_fl; GC_ASSERT(GC_gcj_malloc_initialized); @@ -666,12 +666,12 @@ void GC_mark_thread_local_free_lists(void) for (i = 0; i < THREAD_TABLE_SZ; ++i) { for (p = GC_threads[i]; 0 != p; p = p -> next) { for (j = 1; j < NFREELISTS; ++j) { - q = p -> ptrfree_freelists[j]; + q = p -> tlfs.ptrfree_freelists[j]; if ((word)q > HBLKSIZE) GC_set_fl_marks(q); - q = p -> normal_freelists[j]; + q = p -> tlfs.normal_freelists[j]; if ((word)q > HBLKSIZE) GC_set_fl_marks(q); # ifdef GC_GCJ_SUPPORT - q = p -> gcj_freelists[j]; + q = p -> tlfs.gcj_freelists[j]; if ((word)q > HBLKSIZE) GC_set_fl_marks(q); # endif /* GC_GCJ_SUPPORT */ } @@ -1462,13 +1462,18 @@ void * GC_start_routine_head(void * arg, void *base_addr, return me; } -int GC_thread_register_foreign (void *base_addr) +void GC_allow_register_threads (void) +{ + /* No-op for GC pre-v7. */ +} + +int GC_register_my_thread (struct GC_stack_base *sb) { struct start_info si = { 0, }; /* stacked for legibility & locking */ GC_thread me; # ifdef DEBUG_THREADS - GC_printf1( "GC_thread_register_foreign %p\n", &si ); + GC_printf1( "GC_register_my_thread %p\n", &si ); # endif si.flags = FOREIGN_THREAD; @@ -1476,12 +1481,13 @@ int GC_thread_register_foreign (void *base_addr) if (!parallel_initialized) GC_init_parallel(); LOCK(); if (!GC_thr_initialized) GC_thr_init(); - + me = GC_lookup_thread(pthread_self()); UNLOCK(); + if (me != NULL) + return GC_DUPLICATE; - me = GC_start_routine_head(&si, base_addr, NULL, NULL); - - return me != NULL; + (void)GC_start_routine_head(&si, sb -> mem_base, NULL, NULL); + return GC_SUCCESS; } void * GC_start_routine(void * arg) diff --git a/libgc/solaris_threads.c b/libgc/solaris_threads.c index 8ca8fa3b3a2..e67c514c798 100644 --- a/libgc/solaris_threads.c +++ b/libgc/solaris_threads.c @@ -642,10 +642,15 @@ int GC_thread_is_registered (void) return ptr ? 1 : 0; } -int GC_thread_register_foreign (void *base_addr) +void GC_allow_register_threads (void) +{ + /* No-op for GC pre-v7. */ +} + +int GC_register_my_thread (struct GC_stack_base *sb) { /* FIXME: */ - return 0; + return GC_UNIMPLEMENTED; } void GC_register_altstack (void *stack, int stack_size, void *altstack, int altstack_size) diff --git a/libgc/win32_threads.c b/libgc/win32_threads.c index a60363b4d6f..16a6fb6d003 100644 --- a/libgc/win32_threads.c +++ b/libgc/win32_threads.c @@ -85,6 +85,22 @@ int GC_thread_is_registered (void) #endif } +void GC_allow_register_threads (void) +{ + /* No-op for GC pre-v7. */ +} + +int GC_register_my_thread (struct GC_stack_base *sb) +{ +# if defined(GC_DLL) || defined(GC_INSIDE_DLL) + /* Registered by DllMain. */ + return GC_DUPLICATE; +# else + /* TODO: Implement. */ + return GC_UNIMPLEMENTED; +# endif +} + void GC_register_altstack (void *stack, int stack_size, void *altstack, int altstack_size) { } diff --git a/man/mono.1 b/man/mono.1 index a9f8641107d..164ec31fcc3 100644 --- a/man/mono.1 +++ b/man/mono.1 @@ -931,7 +931,12 @@ by setting the option Turns off the garbage collection in Mono. This should be only used for debugging purposes .TP -\fBLVM_COUNT\fR +\fBHTTP_PROXY\fR +(Also \fBhttp_proxy\fR) If set, web requests using the Mono +Class Library will be automatically proxied through the given URL. +Not supported on Windows, Mac OS, iOS or Android. See also \fBNO_PROXY\fR. +.TP +\fBLLVM_COUNT\fR When Mono is compiled with LLVM support, this instructs the runtime to stop using LLVM after the specified number of methods are JITed. This is a tool used in diagnostics to help isolate problems in the @@ -999,7 +1004,12 @@ where V is the architecture number 4, 5, 6, 7 and the options can be currently b .TP \fBMONO_ARM_FORCE_SOFT_FLOAT\fR When Mono is built with a soft float fallback on ARM and this variable is set to -"1", Mono will always emit soft float code, even if a VFP unit is detected. +"1", Mono will always emit soft float code, even if a VFP unit is +detected. +.TP +\fBMONO_DARWIN_WATCHER_MAXFDS\fR +This is a debugging aid used to force limits on the FileSystemWatcher +implementation in Darwin. There is no limit by default. .TP \fBMONO_DISABLE_AIO\fR If set, tells mono NOT to attempt using native asynchronous I/O services. In @@ -1533,6 +1543,13 @@ ftps, smtps...). The default is 'nocheck', which performs no revocation check at all. The other possible values are 'offline', which performs CRL check (not implemented yet) and 'online' which uses OCSP and CRL to verify the revocation status (not implemented yet). +.TP +\fBNO_PROXY\fR +(Also \fBno_proxy\fR) If both \fBHTTP_PROXY\fR and \fBNO_PROXY\fR are +set, \fBNO_PROXY\fR will be treated as a comma-separated list of "bypass" domains +which will not be sent through the proxy. Domains in \fBNO_PROXY\fR may contain +wildcards, as in "*.mono-project.com" or "build????.local". Not supported on +Windows, Mac OS, iOS or Android. .SH ENVIRONMENT VARIABLES FOR DEBUGGING .TP \fBMONO_ASPNET_NODELETE\fR diff --git a/mcs/build/profiles/monotouch_tv.make b/mcs/build/profiles/monotouch_tv.make index 084af615caa..2a36da9c203 100644 --- a/mcs/build/profiles/monotouch_tv.make +++ b/mcs/build/profiles/monotouch_tv.make @@ -5,3 +5,4 @@ PROFILE_MCS_FLAGS += \ NO_THREAD_ABORT=1 NO_THREAD_SUSPEND_RESUME=1 +NO_PROCESS_START=1 diff --git a/mcs/build/profiles/monotouch_tv_runtime.make b/mcs/build/profiles/monotouch_tv_runtime.make index 6ea1b4ab2d6..552442ac129 100644 --- a/mcs/build/profiles/monotouch_tv_runtime.make +++ b/mcs/build/profiles/monotouch_tv_runtime.make @@ -5,3 +5,6 @@ PROFILE_MCS_FLAGS += \ NO_THREAD_ABORT=1 NO_THREAD_SUSPEND_RESUME=1 +# The binding generator (btv) still needs to execute processes, +# so we need a System.dll that can do that. +#NO_PROCESS_START=1 diff --git a/mcs/build/profiles/monotouch_watch.make b/mcs/build/profiles/monotouch_watch.make index 9a68dcf9eb5..8534aaf1f77 100644 --- a/mcs/build/profiles/monotouch_watch.make +++ b/mcs/build/profiles/monotouch_watch.make @@ -5,3 +5,4 @@ PROFILE_MCS_FLAGS += \ NO_THREAD_ABORT=1 NO_THREAD_SUSPEND_RESUME=1 +NO_PROCESS_START=1 diff --git a/mcs/build/profiles/monotouch_watch_runtime.make b/mcs/build/profiles/monotouch_watch_runtime.make index 920042750dd..7b3eb80a551 100644 --- a/mcs/build/profiles/monotouch_watch_runtime.make +++ b/mcs/build/profiles/monotouch_watch_runtime.make @@ -5,3 +5,6 @@ PROFILE_MCS_FLAGS += \ NO_THREAD_ABORT=1 NO_THREAD_SUSPEND_RESUME=1 +# The binding generator (bwatch) still needs to execute processes, +# so we need a System.dll that can do that. +#NO_PROCESS_START=1 diff --git a/mcs/class/Accessibility/Accessibility-net_4_5.csproj b/mcs/class/Accessibility/Accessibility-net_4_5.csproj deleted file mode 100644 index db4118631e9..00000000000 --- a/mcs/class/Accessibility/Accessibility-net_4_5.csproj +++ /dev/null @@ -1,84 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FACE8136-C95A-4788-90B2-DB0ECF7A020A} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Accessibility - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - diff --git a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-net_4_5.csproj b/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-net_4_5.csproj deleted file mode 100644 index 5bc143ac0b4..00000000000 --- a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-net_4_5.csproj +++ /dev/null @@ -1,133 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4399F601-CF0A-4D5B-9FCB-2EFB8A5D982E} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Commons.Xml.Relaxng - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - - - - - - relaxng.rng - - - - diff --git a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-tests-net_4_5.csproj b/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-tests-net_4_5.csproj deleted file mode 100644 index 1eb68a2e10a..00000000000 --- a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-tests-net_4_5.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8017F2F8-5276-411F-A2C8-581BA6C9ED17} - Library - 1699,618,219,169 - bin\Debug\Commons.Xml.Relaxng-tests-net_4_5 - True - False - - Properties - - - Commons.Xml.Relaxng_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {4399F601-CF0A-4D5B-9FCB-2EFB8A5D982E} - Commons.Xml.Relaxng\Commons.Xml.Relaxng-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - - - - - - relaxng.rng - - - - diff --git a/mcs/class/Cscompmgd/Cscompmgd-net_4_5.csproj b/mcs/class/Cscompmgd/Cscompmgd-net_4_5.csproj deleted file mode 100644 index d62e767325a..00000000000 --- a/mcs/class/Cscompmgd/Cscompmgd-net_4_5.csproj +++ /dev/null @@ -1,91 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7CC1624B-EBC8-45E6-A30B-951A31ADC150} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - cscompmgd - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Cscompmgd/Cscompmgd-tests-net_4_5.csproj b/mcs/class/Cscompmgd/Cscompmgd-tests-net_4_5.csproj deleted file mode 100644 index dc9bf77b0cc..00000000000 --- a/mcs/class/Cscompmgd/Cscompmgd-tests-net_4_5.csproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {843703E1-7EE5-4D68-85CD-FBDA426C30F1} - Library - 1699,618,219,169 - bin\Debug\Cscompmgd-tests-net_4_5 - True - False - - Properties - - - Cscompmgd_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {7CC1624B-EBC8-45E6-A30B-951A31ADC150} - Cscompmgd\Cscompmgd-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - - - - - diff --git a/mcs/class/CustomMarshalers/CustomMarshalers-net_4_5.csproj b/mcs/class/CustomMarshalers/CustomMarshalers-net_4_5.csproj deleted file mode 100644 index cc675d2888b..00000000000 --- a/mcs/class/CustomMarshalers/CustomMarshalers-net_4_5.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E957A4A5-677B-44C9-93A7-C11CE514C07B} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - CustomMarshalers - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Collections.Concurrent/System.Collections.Concurrent-net_4_5.csproj b/mcs/class/Facades/System.Collections.Concurrent/System.Collections.Concurrent-net_4_5.csproj deleted file mode 100644 index f85c52d6141..00000000000 --- a/mcs/class/Facades/System.Collections.Concurrent/System.Collections.Concurrent-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {675F041D-3D9F-4195-B713-8BD1CA16E16E} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Collections.Concurrent - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Collections/System.Collections-net_4_5.csproj b/mcs/class/Facades/System.Collections/System.Collections-net_4_5.csproj deleted file mode 100644 index ef3f1ce10a2..00000000000 --- a/mcs/class/Facades/System.Collections/System.Collections-net_4_5.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {64CA4DB7-C8DA-49CC-A114-1C20038A0469} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Collections - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.ComponentModel.Annotations/System.ComponentModel.Annotations-net_4_5.csproj b/mcs/class/Facades/System.ComponentModel.Annotations/System.ComponentModel.Annotations-net_4_5.csproj deleted file mode 100644 index 5a472d8b851..00000000000 --- a/mcs/class/Facades/System.ComponentModel.Annotations/System.ComponentModel.Annotations-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7B94E990-3BC4-44B6-98FF-102A3459AF92} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.ComponentModel.Annotations - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {63EC4158-FFAC-4867-8003-CF6054C8DF0B} - System.ComponentModel.DataAnnotations-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.ComponentModel.EventBasedAsync/System.ComponentModel.EventBasedAsync-net_4_5.csproj b/mcs/class/Facades/System.ComponentModel.EventBasedAsync/System.ComponentModel.EventBasedAsync-net_4_5.csproj deleted file mode 100644 index d58e278e3d5..00000000000 --- a/mcs/class/Facades/System.ComponentModel.EventBasedAsync/System.ComponentModel.EventBasedAsync-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F550AB44-48A5-47F1-8EBB-5BA1CAF3366E} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.ComponentModel.EventBasedAsync - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.ComponentModel/System.ComponentModel-net_4_5.csproj b/mcs/class/Facades/System.ComponentModel/System.ComponentModel-net_4_5.csproj deleted file mode 100644 index ecf9c3564d3..00000000000 --- a/mcs/class/Facades/System.ComponentModel/System.ComponentModel-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A13F59CB-1F71-4ECE-82A1-9A3D6760E5D2} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.ComponentModel - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Diagnostics.Contracts/System.Diagnostics.Contracts-net_4_5.csproj b/mcs/class/Facades/System.Diagnostics.Contracts/System.Diagnostics.Contracts-net_4_5.csproj deleted file mode 100644 index e3fd2804e59..00000000000 --- a/mcs/class/Facades/System.Diagnostics.Contracts/System.Diagnostics.Contracts-net_4_5.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {BDCFB32D-9CCE-4A2F-ABBB-490C3D49BBE0} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Diagnostics.Contracts - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Diagnostics.Debug/System.Diagnostics.Debug-net_4_5.csproj b/mcs/class/Facades/System.Diagnostics.Debug/System.Diagnostics.Debug-net_4_5.csproj deleted file mode 100644 index 9e3361b4f2a..00000000000 --- a/mcs/class/Facades/System.Diagnostics.Debug/System.Diagnostics.Debug-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {37D2FA30-09B8-4E38-982A-1890D7275F42} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Diagnostics.Debug - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Diagnostics.Tools/System.Diagnostics.Tools-net_4_5.csproj b/mcs/class/Facades/System.Diagnostics.Tools/System.Diagnostics.Tools-net_4_5.csproj deleted file mode 100644 index f3b0dfd8b57..00000000000 --- a/mcs/class/Facades/System.Diagnostics.Tools/System.Diagnostics.Tools-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3A324F98-B121-44F2-B1AD-6DC4D3D27A89} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Diagnostics.Tools - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Diagnostics.Tracing/System.Diagnostics.Tracing-net_4_5.csproj b/mcs/class/Facades/System.Diagnostics.Tracing/System.Diagnostics.Tracing-net_4_5.csproj deleted file mode 100644 index f3ae6dfce49..00000000000 --- a/mcs/class/Facades/System.Diagnostics.Tracing/System.Diagnostics.Tracing-net_4_5.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {34C2ACED-602C-41CD-AB40-3813B3420625} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Diagnostics.Tracing - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Dynamic.Runtime/System.Dynamic.Runtime-net_4_5.csproj b/mcs/class/Facades/System.Dynamic.Runtime/System.Dynamic.Runtime-net_4_5.csproj deleted file mode 100644 index ca7f89b1b20..00000000000 --- a/mcs/class/Facades/System.Dynamic.Runtime/System.Dynamic.Runtime-net_4_5.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6E17967A-FBC5-4F44-AE4F-CBE1E70F862E} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Dynamic.Runtime - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Globalization/System.Globalization-net_4_5.csproj b/mcs/class/Facades/System.Globalization/System.Globalization-net_4_5.csproj deleted file mode 100644 index aba8b9f8c7b..00000000000 --- a/mcs/class/Facades/System.Globalization/System.Globalization-net_4_5.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5DF5E924-6F3B-42DB-A3E0-1FB63028F189} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Globalization - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.IO/System.IO-net_4_5.csproj b/mcs/class/Facades/System.IO/System.IO-net_4_5.csproj deleted file mode 100644 index 568f694c82f..00000000000 --- a/mcs/class/Facades/System.IO/System.IO-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {188DBB84-D591-48CC-B8B2-E7E12A0EE0BE} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.IO - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Linq.Expressions/System.Linq.Expressions-net_4_5.csproj b/mcs/class/Facades/System.Linq.Expressions/System.Linq.Expressions-net_4_5.csproj deleted file mode 100644 index 38174e5690c..00000000000 --- a/mcs/class/Facades/System.Linq.Expressions/System.Linq.Expressions-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FD626146-F48C-4E29-9D4C-872FB5AEA5C1} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Linq.Expressions - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Linq.Parallel/System.Linq.Parallel-net_4_5.csproj b/mcs/class/Facades/System.Linq.Parallel/System.Linq.Parallel-net_4_5.csproj deleted file mode 100644 index 71c2a1c3480..00000000000 --- a/mcs/class/Facades/System.Linq.Parallel/System.Linq.Parallel-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F8EB53BB-0BD5-4775-9EE7-2D4C7403B898} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Linq.Parallel - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Linq.Queryable/System.Linq.Queryable-net_4_5.csproj b/mcs/class/Facades/System.Linq.Queryable/System.Linq.Queryable-net_4_5.csproj deleted file mode 100644 index c762099ce90..00000000000 --- a/mcs/class/Facades/System.Linq.Queryable/System.Linq.Queryable-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C2025B80-1555-4CBE-8982-8E0DFCFC9F16} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Linq.Queryable - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Linq/System.Linq-net_4_5.csproj b/mcs/class/Facades/System.Linq/System.Linq-net_4_5.csproj deleted file mode 100644 index d7428755fdf..00000000000 --- a/mcs/class/Facades/System.Linq/System.Linq-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F97C589C-5F94-4C4F-B465-13432ABF4744} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Linq - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Net.NetworkInformation/System.Net.NetworkInformation-net_4_5.csproj b/mcs/class/Facades/System.Net.NetworkInformation/System.Net.NetworkInformation-net_4_5.csproj deleted file mode 100644 index 8e4028e3f82..00000000000 --- a/mcs/class/Facades/System.Net.NetworkInformation/System.Net.NetworkInformation-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A2069635-0635-40BA-B82C-DC458AFB3A9E} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Net.NetworkInformation - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Net.Primitives/System.Net.Primitives-net_4_5.csproj b/mcs/class/Facades/System.Net.Primitives/System.Net.Primitives-net_4_5.csproj deleted file mode 100644 index 6982431f023..00000000000 --- a/mcs/class/Facades/System.Net.Primitives/System.Net.Primitives-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D5541A16-CFFD-4699-BC6D-EE859A38737F} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Net.Primitives - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Net.Requests/System.Net.Requests-net_4_5.csproj b/mcs/class/Facades/System.Net.Requests/System.Net.Requests-net_4_5.csproj deleted file mode 100644 index 2f80022c0d7..00000000000 --- a/mcs/class/Facades/System.Net.Requests/System.Net.Requests-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5DC73C5F-E943-473B-BE4D-0EB115C3F1AF} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Net.Requests - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.ObjectModel/System.ObjectModel-net_4_5.csproj b/mcs/class/Facades/System.ObjectModel/System.ObjectModel-net_4_5.csproj deleted file mode 100644 index a65c450ad6f..00000000000 --- a/mcs/class/Facades/System.ObjectModel/System.ObjectModel-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9A11D4E5-5C4C-471C-9912-AAB6C9851CF9} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.ObjectModel - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Reflection.Emit.ILGeneration/System.Reflection.Emit.ILGeneration-net_4_5.csproj b/mcs/class/Facades/System.Reflection.Emit.ILGeneration/System.Reflection.Emit.ILGeneration-net_4_5.csproj deleted file mode 100644 index 53fece009b3..00000000000 --- a/mcs/class/Facades/System.Reflection.Emit.ILGeneration/System.Reflection.Emit.ILGeneration-net_4_5.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {71E1B60C-1AF2-4AE8-B5F5-118AC38B64DB} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Reflection.Emit.ILGeneration - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Reflection.Emit.Lightweight/System.Reflection.Emit.Lightweight-net_4_5.csproj b/mcs/class/Facades/System.Reflection.Emit.Lightweight/System.Reflection.Emit.Lightweight-net_4_5.csproj deleted file mode 100644 index a1a8005195e..00000000000 --- a/mcs/class/Facades/System.Reflection.Emit.Lightweight/System.Reflection.Emit.Lightweight-net_4_5.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {56035DDD-F2DD-46ED-88EF-DF8636198D36} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Reflection.Emit.Lightweight - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Reflection.Emit/System.Reflection.Emit-net_4_5.csproj b/mcs/class/Facades/System.Reflection.Emit/System.Reflection.Emit-net_4_5.csproj deleted file mode 100644 index 99ca1632177..00000000000 --- a/mcs/class/Facades/System.Reflection.Emit/System.Reflection.Emit-net_4_5.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6ABB9197-8B7B-4566-B42A-5B7A8CDE3D4E} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Reflection.Emit - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Reflection.Extensions/System.Reflection.Extensions-net_4_5.csproj b/mcs/class/Facades/System.Reflection.Extensions/System.Reflection.Extensions-net_4_5.csproj deleted file mode 100644 index ad54afb1761..00000000000 --- a/mcs/class/Facades/System.Reflection.Extensions/System.Reflection.Extensions-net_4_5.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {670D61FE-7031-4734-87FB-E7DC401F7D99} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Reflection.Extensions - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Reflection.Primitives/System.Reflection.Primitives-net_4_5.csproj b/mcs/class/Facades/System.Reflection.Primitives/System.Reflection.Primitives-net_4_5.csproj deleted file mode 100644 index 3b1cf9676a0..00000000000 --- a/mcs/class/Facades/System.Reflection.Primitives/System.Reflection.Primitives-net_4_5.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {080E1A07-4A13-4D86-966E-4BED488972E9} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Reflection.Primitives - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Reflection/System.Reflection-net_4_5.csproj b/mcs/class/Facades/System.Reflection/System.Reflection-net_4_5.csproj deleted file mode 100644 index b40c94ca592..00000000000 --- a/mcs/class/Facades/System.Reflection/System.Reflection-net_4_5.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {00F1AED2-A30C-4FE4-9B8C-1DCB271AD050} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Reflection - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Resources.ResourceManager/System.Resources.ResourceManager-net_4_5.csproj b/mcs/class/Facades/System.Resources.ResourceManager/System.Resources.ResourceManager-net_4_5.csproj deleted file mode 100644 index 9d9d1336886..00000000000 --- a/mcs/class/Facades/System.Resources.ResourceManager/System.Resources.ResourceManager-net_4_5.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4A4281A7-0EBB-4FA4-ABC8-354253A9DDAF} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Resources.ResourceManager - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Runtime.Extensions/System.Runtime.Extensions-net_4_5.csproj b/mcs/class/Facades/System.Runtime.Extensions/System.Runtime.Extensions-net_4_5.csproj deleted file mode 100644 index 0fa1a438047..00000000000 --- a/mcs/class/Facades/System.Runtime.Extensions/System.Runtime.Extensions-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {CD67F8F0-C543-4BBA-AB81-F6A9FCD4BD62} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Runtime.Extensions - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/System.Runtime.InteropServices.WindowsRuntime-net_4_5.csproj b/mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/System.Runtime.InteropServices.WindowsRuntime-net_4_5.csproj deleted file mode 100644 index 65e863116ca..00000000000 --- a/mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/System.Runtime.InteropServices.WindowsRuntime-net_4_5.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {045F952B-9AB3-4DB1-ADBB-D260B4B5E0E1} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Runtime.InteropServices.WindowsRuntime - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Runtime.InteropServices/System.Runtime.InteropServices-net_4_5.csproj b/mcs/class/Facades/System.Runtime.InteropServices/System.Runtime.InteropServices-net_4_5.csproj deleted file mode 100644 index 6562fdf7a94..00000000000 --- a/mcs/class/Facades/System.Runtime.InteropServices/System.Runtime.InteropServices-net_4_5.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {516204B8-800B-4508-8DA1-E103A1985B5A} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Runtime.InteropServices - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Runtime.Numerics/System.Runtime.Numerics-net_4_5.csproj b/mcs/class/Facades/System.Runtime.Numerics/System.Runtime.Numerics-net_4_5.csproj deleted file mode 100644 index 6819ca07c4b..00000000000 --- a/mcs/class/Facades/System.Runtime.Numerics/System.Runtime.Numerics-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {798C666E-FA52-4B49-B8E3-49167F2E0D26} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Runtime.Numerics - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {14631AC9-FDC6-4561-A04C-6913947C939E} - System.Numerics-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Runtime.Serialization.Json/System.Runtime.Serialization.Json-net_4_5.csproj b/mcs/class/Facades/System.Runtime.Serialization.Json/System.Runtime.Serialization.Json-net_4_5.csproj deleted file mode 100644 index 7b202771e3c..00000000000 --- a/mcs/class/Facades/System.Runtime.Serialization.Json/System.Runtime.Serialization.Json-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {66CACE39-45D9-4F11-9606-CEDC9F4FB94E} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Runtime.Serialization.Json - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Runtime.Serialization.Primitives/System.Runtime.Serialization.Primitives-net_4_5.csproj b/mcs/class/Facades/System.Runtime.Serialization.Primitives/System.Runtime.Serialization.Primitives-net_4_5.csproj deleted file mode 100644 index f08f7ca994a..00000000000 --- a/mcs/class/Facades/System.Runtime.Serialization.Primitives/System.Runtime.Serialization.Primitives-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F113ADCC-80CA-4CCC-A59B-3628CB0F534C} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Runtime.Serialization.Primitives - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Runtime.Serialization.Xml/System.Runtime.Serialization.Xml-net_4_5.csproj b/mcs/class/Facades/System.Runtime.Serialization.Xml/System.Runtime.Serialization.Xml-net_4_5.csproj deleted file mode 100644 index b45c1bf0cae..00000000000 --- a/mcs/class/Facades/System.Runtime.Serialization.Xml/System.Runtime.Serialization.Xml-net_4_5.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5EC82F0C-7FAF-44DE-BD77-57CFE2FEB1D5} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Runtime.Serialization.Xml - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Runtime/System.Runtime-net_4_5.csproj b/mcs/class/Facades/System.Runtime/System.Runtime-net_4_5.csproj deleted file mode 100644 index 0f22c82015f..00000000000 --- a/mcs/class/Facades/System.Runtime/System.Runtime-net_4_5.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FE41441F-91F5-48AC-84DA-23056DD7386B} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Runtime - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {81352E26-6AB7-4AA3-8FB1-28A476E82748} - System.ComponentModel.Composition-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Security.Principal/System.Security.Principal-net_4_5.csproj b/mcs/class/Facades/System.Security.Principal/System.Security.Principal-net_4_5.csproj deleted file mode 100644 index 9784c71c394..00000000000 --- a/mcs/class/Facades/System.Security.Principal/System.Security.Principal-net_4_5.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {09F21748-CA1B-49EF-BE06-64542DBDD927} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Security.Principal - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.ServiceModel.Http/System.ServiceModel.Http-net_4_5.csproj b/mcs/class/Facades/System.ServiceModel.Http/System.ServiceModel.Http-net_4_5.csproj deleted file mode 100644 index d249f670c16..00000000000 --- a/mcs/class/Facades/System.ServiceModel.Http/System.ServiceModel.Http-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5FB7CE3D-3BF8-4539-AC0B-37A473DA75C6} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.ServiceModel.Http - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {F2156C09-C377-4945-A690-39CFBF3319B3} - System.ServiceModel-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.ServiceModel.Primitives/System.ServiceModel.Primitives-net_4_5.csproj b/mcs/class/Facades/System.ServiceModel.Primitives/System.ServiceModel.Primitives-net_4_5.csproj deleted file mode 100644 index 4679619b8c7..00000000000 --- a/mcs/class/Facades/System.ServiceModel.Primitives/System.ServiceModel.Primitives-net_4_5.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {339D127E-6EC9-4DC2-A6E9-1306B4AAC18A} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.ServiceModel.Primitives - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {F2156C09-C377-4945-A690-39CFBF3319B3} - System.ServiceModel-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.ServiceModel.Security/System.ServiceModel.Security-net_4_5.csproj b/mcs/class/Facades/System.ServiceModel.Security/System.ServiceModel.Security-net_4_5.csproj deleted file mode 100644 index 5f482981383..00000000000 --- a/mcs/class/Facades/System.ServiceModel.Security/System.ServiceModel.Security-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {EF11BD41-8AF8-4A15-A6B7-344BC9852EF6} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.ServiceModel.Security - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {F2156C09-C377-4945-A690-39CFBF3319B3} - System.ServiceModel-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Text.Encoding.Extensions/System.Text.Encoding.Extensions-net_4_5.sln b/mcs/class/Facades/System.Text.Encoding.Extensions/System.Text.Encoding.Extensions-net_4_5.sln new file mode 100644 index 00000000000..82d6caa3cc9 --- /dev/null +++ b/mcs/class/Facades/System.Text.Encoding.Extensions/System.Text.Encoding.Extensions-net_4_5.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Text.Encoding.Extensions-net_4_5", "System.Text.Encoding.Extensions-net_4_5.csproj", "{DEAA541C-1414-4C17-9DB1-F63F83B0C182}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DEAA541C-1414-4C17-9DB1-F63F83B0C182}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DEAA541C-1414-4C17-9DB1-F63F83B0C182}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DEAA541C-1414-4C17-9DB1-F63F83B0C182}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DEAA541C-1414-4C17-9DB1-F63F83B0C182}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/mcs/class/Facades/System.Text.Encoding/System.Text.Encoding-net_4_5.csproj b/mcs/class/Facades/System.Text.Encoding/System.Text.Encoding-net_4_5.csproj deleted file mode 100644 index ce884f94bc3..00000000000 --- a/mcs/class/Facades/System.Text.Encoding/System.Text.Encoding-net_4_5.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4AB957DC-5A83-40D2-AB0B-DA1583C40181} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Text.Encoding - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Text.RegularExpressions/System.Text.RegularExpressions-net_4_5.csproj b/mcs/class/Facades/System.Text.RegularExpressions/System.Text.RegularExpressions-net_4_5.csproj deleted file mode 100644 index a60fd9fa995..00000000000 --- a/mcs/class/Facades/System.Text.RegularExpressions/System.Text.RegularExpressions-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {189011AC-76B3-4364-B999-A54B72B69DF7} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Text.RegularExpressions - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Threading.Tasks.Parallel/System.Threading.Tasks.Parallel-net_4_5.csproj b/mcs/class/Facades/System.Threading.Tasks.Parallel/System.Threading.Tasks.Parallel-net_4_5.csproj deleted file mode 100644 index 144c5223414..00000000000 --- a/mcs/class/Facades/System.Threading.Tasks.Parallel/System.Threading.Tasks.Parallel-net_4_5.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3FC77F23-AFB8-4FB6-A18F-5E76D6B4A309} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Threading.Tasks.Parallel - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Threading.Tasks/System.Threading.Tasks-net_4_5.csproj b/mcs/class/Facades/System.Threading.Tasks/System.Threading.Tasks-net_4_5.csproj deleted file mode 100644 index fe3002cbc2c..00000000000 --- a/mcs/class/Facades/System.Threading.Tasks/System.Threading.Tasks-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {CA73F804-277A-40B5-A9F7-5E3FD913629B} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Threading.Tasks - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Threading.Timer/System.Threading.Timer-net_4_5.csproj b/mcs/class/Facades/System.Threading.Timer/System.Threading.Timer-net_4_5.csproj deleted file mode 100644 index d2b3fc1b63b..00000000000 --- a/mcs/class/Facades/System.Threading.Timer/System.Threading.Timer-net_4_5.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {93FB6CF4-26B5-4D43-A485-E9A052A82749} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Threading.Timer - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Threading/System.Threading-net_4_5.csproj b/mcs/class/Facades/System.Threading/System.Threading-net_4_5.csproj deleted file mode 100644 index 345389e9160..00000000000 --- a/mcs/class/Facades/System.Threading/System.Threading-net_4_5.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4DE82EEA-1FE0-4D13-B1DA-7221E52CD3EE} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Threading - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Xml.ReaderWriter/System.Xml.ReaderWriter-net_4_5.csproj b/mcs/class/Facades/System.Xml.ReaderWriter/System.Xml.ReaderWriter-net_4_5.csproj deleted file mode 100644 index 876bce7bb57..00000000000 --- a/mcs/class/Facades/System.Xml.ReaderWriter/System.Xml.ReaderWriter-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {32D7A81F-E7B5-4E08-BE4C-2BC0FF902C66} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Xml.ReaderWriter - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Xml.XDocument/System.Xml.XDocument-net_4_5.csproj b/mcs/class/Facades/System.Xml.XDocument/System.Xml.XDocument-net_4_5.csproj deleted file mode 100644 index 9b565e5f3b8..00000000000 --- a/mcs/class/Facades/System.Xml.XDocument/System.Xml.XDocument-net_4_5.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F47D56BD-BA6E-4503-B2FA-435A331338B5} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Xml.XDocument - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {8328796E-8A15-4972-8F1E-2F15E7D57C42} - System.Xml.Linq-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - - - - - diff --git a/mcs/class/Facades/System.Xml.XmlSerializer/System.Xml.XmlSerializer-net_4_5.csproj b/mcs/class/Facades/System.Xml.XmlSerializer/System.Xml.XmlSerializer-net_4_5.csproj deleted file mode 100644 index bbb6f750405..00000000000 --- a/mcs/class/Facades/System.Xml.XmlSerializer/System.Xml.XmlSerializer-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {799C90EA-628C-40EB-8C8C-6EA21B2ECE80} - Library - 1699,1616,1699 - ./../../../class/lib/net_4_5/Facades - True - True - - Properties - - - System.Xml.XmlSerializer - v4.5 - 512 - - - true - true - - - ../../msfinal.pub - - - true - full - 1699,1616,1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1616,1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - - - - - diff --git a/mcs/class/I18N/CJK/I18N.CJK-net_4_5.csproj b/mcs/class/I18N/CJK/I18N.CJK-net_4_5.csproj deleted file mode 100644 index 5cbf46c75a7..00000000000 --- a/mcs/class/I18N/CJK/I18N.CJK-net_4_5.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E1E28FDB-826D-4FEB-B3B9-3FF98BD2E43F} - Library - 1699 - ./../../../class/lib/net_4_5 - True - True - true - Properties - - - I18N.CJK - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;DISABLE_UNSAFE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - DISABLE_UNSAFE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {C337A9A4-3797-4339-AD23-493DF062CD76} - I18N-net_4_5 - - - - - - - - big5.table - - - gb2312.table - - - jis.table - - - ks.table - - - gb18030.table - - - - diff --git a/mcs/class/I18N/CJK/I18N.CJK-tests-net_4_5.csproj b/mcs/class/I18N/CJK/I18N.CJK-tests-net_4_5.csproj deleted file mode 100644 index ba41310f8b4..00000000000 --- a/mcs/class/I18N/CJK/I18N.CJK-tests-net_4_5.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {06AF7FA1-1355-4A2F-8627-2AA11C5B2689} - Library - 1699 - bin\Debug\I18N.CJK-tests-net_4_5 - True - False - true - Properties - - - I18N.CJK_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;DISABLE_UNSAFE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - DISABLE_UNSAFE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {C337A9A4-3797-4339-AD23-493DF062CD76} - Common\I18N-net_4_5 - - - {E1E28FDB-826D-4FEB-B3B9-3FF98BD2E43F} - CJK\I18N.CJK-net_4_5 - - - - - - - - big5.table - - - gb2312.table - - - jis.table - - - ks.table - - - gb18030.table - - - - diff --git a/mcs/class/I18N/Common/I18N-net_4_5.csproj b/mcs/class/I18N/Common/I18N-net_4_5.csproj deleted file mode 100644 index e2a4948a885..00000000000 --- a/mcs/class/I18N/Common/I18N-net_4_5.csproj +++ /dev/null @@ -1,90 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C337A9A4-3797-4339-AD23-493DF062CD76} - Library - 1699 - ./../../../class/lib/net_4_5 - True - True - true - Properties - - - I18N - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;DISABLE_UNSAFE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - DISABLE_UNSAFE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - diff --git a/mcs/class/I18N/MidEast/I18N.MidEast-net_4_5.csproj b/mcs/class/I18N/MidEast/I18N.MidEast-net_4_5.csproj deleted file mode 100644 index 9fd953328cc..00000000000 --- a/mcs/class/I18N/MidEast/I18N.MidEast-net_4_5.csproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C2ADDD2F-602B-4787-8688-F06C3DED0DA5} - Library - 1699 - ./../../../class/lib/net_4_5 - True - True - true - Properties - - - I18N.MidEast - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {C337A9A4-3797-4339-AD23-493DF062CD76} - I18N-net_4_5 - - - - - - - diff --git a/mcs/class/I18N/MidEast/I18N.MidEast-tests-net_4_5.csproj b/mcs/class/I18N/MidEast/I18N.MidEast-tests-net_4_5.csproj deleted file mode 100644 index 3dea5dfd8f4..00000000000 --- a/mcs/class/I18N/MidEast/I18N.MidEast-tests-net_4_5.csproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3537138C-2770-42E5-BFFE-D690889FA603} - Library - 1699 - bin\Debug\I18N.MidEast-tests-net_4_5 - True - False - true - Properties - - - I18N.MidEast_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {C337A9A4-3797-4339-AD23-493DF062CD76} - Common\I18N-net_4_5 - - - {C2ADDD2F-602B-4787-8688-F06C3DED0DA5} - MidEast\I18N.MidEast-net_4_5 - - - - - - - diff --git a/mcs/class/I18N/Other/I18N.Other-net_4_5.csproj b/mcs/class/I18N/Other/I18N.Other-net_4_5.csproj deleted file mode 100644 index cb274ec0ae3..00000000000 --- a/mcs/class/I18N/Other/I18N.Other-net_4_5.csproj +++ /dev/null @@ -1,95 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B77661D6-F5C9-4FB2-8613-06F645D6E227} - Library - 1699 - ./../../../class/lib/net_4_5 - True - True - true - Properties - - - I18N.Other - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {C337A9A4-3797-4339-AD23-493DF062CD76} - I18N-net_4_5 - - - - - - - diff --git a/mcs/class/I18N/Rare/I18N.Rare-net_4_5.csproj b/mcs/class/I18N/Rare/I18N.Rare-net_4_5.csproj deleted file mode 100644 index 1029f770368..00000000000 --- a/mcs/class/I18N/Rare/I18N.Rare-net_4_5.csproj +++ /dev/null @@ -1,123 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {ED2E80E0-D1B2-48D3-8EF9-F20CB9D0FA98} - Library - 1699 - ./../../../class/lib/net_4_5 - True - True - true - Properties - - - I18N.Rare - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {C337A9A4-3797-4339-AD23-493DF062CD76} - I18N-net_4_5 - - - - - - - diff --git a/mcs/class/I18N/West/I18N.West-net_4_5.csproj b/mcs/class/I18N/West/I18N.West-net_4_5.csproj deleted file mode 100644 index 0d49f88bcf5..00000000000 --- a/mcs/class/I18N/West/I18N.West-net_4_5.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C95AC6B1-7D75-40D5-8B6D-F62278587227} - Library - 1699 - ./../../../class/lib/net_4_5 - True - True - true - Properties - - - I18N.West - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {C337A9A4-3797-4339-AD23-493DF062CD76} - I18N-net_4_5 - - - - - - - diff --git a/mcs/class/I18N/West/I18N.West-tests-net_4_5.csproj b/mcs/class/I18N/West/I18N.West-tests-net_4_5.csproj deleted file mode 100644 index 90f2c06065d..00000000000 --- a/mcs/class/I18N/West/I18N.West-tests-net_4_5.csproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FB1F5992-FA12-4ABF-9614-43CC917A588F} - Library - 1699 - bin\Debug\I18N.West-tests-net_4_5 - True - False - true - Properties - - - I18N.West_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {C337A9A4-3797-4339-AD23-493DF062CD76} - Common\I18N-net_4_5 - - - {C95AC6B1-7D75-40D5-8B6D-F62278587227} - West\I18N.West-net_4_5 - - - - - - - diff --git a/mcs/class/IBM.Data.DB2/IBM.Data.DB2-net_4_5.csproj b/mcs/class/IBM.Data.DB2/IBM.Data.DB2-net_4_5.csproj deleted file mode 100644 index 465ee15cdcd..00000000000 --- a/mcs/class/IBM.Data.DB2/IBM.Data.DB2-net_4_5.csproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7A0D9630-19F1-4AC0-951C-D0F1EA609049} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - IBM.Data.DB2 - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - - - - - diff --git a/mcs/class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib-net_4_5.csproj b/mcs/class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib-net_4_5.csproj deleted file mode 100644 index 3bc4cbb9caa..00000000000 --- a/mcs/class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib-net_4_5.csproj +++ /dev/null @@ -1,138 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0B587DBA-BA92-4B92-821A-AA200C612A7E} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - ICSharpCode.SharpZipLib - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Expression.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Expression.cs index ccfc0fa3a0e..ea302826b87 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Expression.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Expression.cs @@ -464,6 +464,7 @@ namespace Microsoft.Build.BuildEngine { List args = new List (); int parens = 0; bool backticks = false; + bool inquotes = false; int start = pos; for (; pos < text.Length; ++pos) { var ch = text [pos]; @@ -476,6 +477,11 @@ namespace Microsoft.Build.BuildEngine { if (backticks) continue; + if (ch == '\"') { + inquotes = !inquotes; + continue; + } + if (ch == '(') { ++parens; continue; @@ -498,7 +504,7 @@ namespace Microsoft.Build.BuildEngine { if (parens != 0) continue; - if (ch == ',') { + if (ch == ',' && !inquotes) { args.Add (text.Substring (start, pos - start)); start = pos + 1; continue; diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/MemberInvocationReference.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/MemberInvocationReference.cs index c2383e50253..3cb27d959fb 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/MemberInvocationReference.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/MemberInvocationReference.cs @@ -32,6 +32,7 @@ using System.Collections.Generic; using System.Reflection; using System.Globalization; using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; using System.Text; namespace Microsoft.Build.BuildEngine @@ -280,7 +281,10 @@ namespace Microsoft.Build.BuildEngine public ITaskItem[] ConvertToITaskItemArray (Project project, ExpressionOptions options) { - throw new NotImplementedException (); + var items = new ITaskItem[1]; + items[0] = new TaskItem (ConvertToString (project, options)); + + return items; } } } \ No newline at end of file diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-net_4_5.csproj b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-net_4_5.csproj deleted file mode 100644 index cbf99b3713c..00000000000 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-net_4_5.csproj +++ /dev/null @@ -1,189 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {54DFC5A7-7C1D-4BA5-A0F7-F0B312E1E076} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Microsoft.Build.Engine - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {DA3B9FEE-8FBD-4587-B760-65420765256A} - Microsoft.Build.Framework-net_4_5 - - - {6E1C7BDE-7B9E-47B0-A7B2-1561822FE922} - Microsoft.Build.Utilities-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-tests-net_4_5.csproj b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-tests-net_4_5.csproj deleted file mode 100644 index 1a8564b4497..00000000000 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-tests-net_4_5.csproj +++ /dev/null @@ -1,122 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {EBF59584-3F6F-4881-B2FF-E4FBE2A4D1F1} - Library - 1699 - bin\Debug\Microsoft.Build.Engine-tests-net_4_5 - True - False - - Properties - - - Microsoft.Build.Engine_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {54DFC5A7-7C1D-4BA5-A0F7-F0B312E1E076} - Microsoft.Build.Engine\Microsoft.Build.Engine-net_4_5 - - - {DA3B9FEE-8FBD-4587-B760-65420765256A} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_4_5 - - - {6E1C7BDE-7B9E-47B0-A7B2-1561822FE922} - Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_4_5 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs index 48aba112fb9..594c0858777 100644 --- a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs +++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs @@ -67,7 +67,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine { void Message (object sender, BuildMessageEventArgs args) { } - + void Warning (object sender, BuildWarningEventArgs args) { } @@ -97,7 +97,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine { Project project; string documentString = ""; - + engine = new Engine (Consts.BinPath); DateTime time = DateTime.Now; @@ -127,7 +127,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine { Project project; string documentString = ""; - + engine = new Engine (Consts.BinPath); DateTime time = DateTime.Now; project = engine.CreateNewProject (); @@ -310,7 +310,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine { string documentString = @" - @@ -353,7 +353,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine { "; - + engine = new Engine (Consts.BinPath); project = engine.CreateNewProject (); project.LoadXml (documentString); @@ -769,12 +769,12 @@ namespace MonoTests.Microsoft.Build.BuildEngine { { Engine engine; Project project; - + string documentString = @" "; - + engine = new Engine (Consts.BinPath); project = engine.CreateNewProject (); project.LoadXml (documentString); @@ -787,15 +787,15 @@ namespace MonoTests.Microsoft.Build.BuildEngine { { Engine engine; Project project; - + string documentString = @" "; - + engine = new Engine (Consts.BinPath); engine.GlobalProperties.SetProperty ("Property", "Value"); - + project = engine.CreateNewProject (); project.LoadXml (documentString); @@ -815,12 +815,12 @@ namespace MonoTests.Microsoft.Build.BuildEngine { { Engine engine; Project project; - + string documentString = @" "; - + engine = new Engine (Consts.BinPath); project = engine.CreateNewProject (); project.LoadXml (documentString); @@ -834,7 +834,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine { { Engine engine; Project project; - + string documentString = @" @@ -842,7 +842,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine { "; - + engine = new Engine (Consts.BinPath); project = engine.CreateNewProject (); project.LoadXml (documentString); @@ -861,7 +861,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine { { Engine engine; Project project; - + string documentString = @" @@ -869,7 +869,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine { "; - + engine = new Engine (Consts.BinPath); project = engine.CreateNewProject (); project.LoadXml (documentString); @@ -914,7 +914,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine { { Engine engine; Project project; - + engine = new Engine (Consts.BinPath); project = engine.CreateNewProject (); @@ -1076,18 +1076,18 @@ namespace MonoTests.Microsoft.Build.BuildEngine { Assert.AreEqual (3, tl.TargetStartedEvents, "A1"); Assert.AreEqual (3, tl.TargetFinishedEvents, "A1"); } - + [Test] public void TestSchemaFile () { Engine engine; Project project; - + string documentString = @" "; - + engine = new Engine (Consts.BinPath); project = engine.CreateNewProject (); project.LoadXml (documentString); @@ -2092,7 +2092,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine { md3 md4 - + ValueProp @@ -2159,7 +2159,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine { Path.Combine ("fr-FR", "Lib2.resources.dll"), "Lib4.dll", "Lib4" + debug_extn }, - + // lib1 new string [] { // lib1 files @@ -2216,7 +2216,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine { Project project = engine.CreateNewProject (); project.Load (Path.Combine (basepath, "Project01.sln.proj")); - + bool result = project.Build (); if (!result) { logger.DumpMessages (); @@ -2373,5 +2373,24 @@ namespace MonoTests.Microsoft.Build.BuildEngine { return project; } + + [Test] + public void CheckCommaInQuotes () + { + string testString = "Test.string.with.Commas"; + string documentString = string.Format (@" + + + {0} + $(TestString.Replace(".",",")) + + ", testString); + + Project project = new Project (); + project.LoadXml (documentString); + + string result = project.EvaluatedProperties ["TestString2"].FinalValue; + Assert.AreEqual (testString.Replace (".", ","), result, "A1"); + } } } diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-net_4_5.csproj b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-net_4_5.csproj deleted file mode 100644 index e9db279a25f..00000000000 --- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-net_4_5.csproj +++ /dev/null @@ -1,150 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DA3B9FEE-8FBD-4587-B760-65420765256A} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Microsoft.Build.Framework - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-tests-net_4_5.csproj b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-tests-net_4_5.csproj deleted file mode 100644 index 20ea844819c..00000000000 --- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-tests-net_4_5.csproj +++ /dev/null @@ -1,97 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6F4A0357-C391-41B0-A1E1-BCA43ED57C90} - Library - 1699 - bin\Debug\Microsoft.Build.Framework-tests-net_4_5 - True - False - - Properties - - - Microsoft.Build.Framework_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {DA3B9FEE-8FBD-4587-B760-65420765256A} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_4_5 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_4_5.csproj b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_4_5.csproj deleted file mode 100644 index dac54afb509..00000000000 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_4_5.csproj +++ /dev/null @@ -1,249 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A76A398F-08C0-4B3D-A624-690717233736} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Microsoft.Build.Tasks.v4.0 - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {B102F27C-1A07-487F-BA5B-D5155D201112} - System.Windows.Forms-net_4_5 - - - {6E1C7BDE-7B9E-47B0-A7B2-1561822FE922} - Microsoft.Build.Utilities-net_4_5 - - - {DA3B9FEE-8FBD-4587-B760-65420765256A} - Microsoft.Build.Framework-net_4_5 - - - {54DFC5A7-7C1D-4BA5-A0F7-F0B312E1E076} - Microsoft.Build.Engine-net_4_5 - - - {73FB1B7E-09F9-4E7F-A63A-C407A93BCA59} - Mono.XBuild.Tasks-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {B102F27C-1A07-487F-BA5B-D5155D201112} - System.Windows.Forms-net_4_5 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_4_x.csproj b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_4_x.csproj index a3479d79693..9bd62c80a9d 100644 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_4_x.csproj +++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_4_x.csproj @@ -162,6 +162,7 @@ + diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-tests-net_4_5.csproj b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-tests-net_4_5.csproj deleted file mode 100644 index ae753160097..00000000000 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-tests-net_4_5.csproj +++ /dev/null @@ -1,129 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {48DFBC3C-F8C1-488E-B1E2-15555551B796} - Library - 1699 - bin\Debug\Microsoft.Build.Tasks-tests-net_4_5 - True - False - - Properties - - - Microsoft.Build.Tasks_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {A76A398F-08C0-4B3D-A624-690717233736} - Microsoft.Build.Tasks\Microsoft.Build.Tasks-net_4_5 - - - {54DFC5A7-7C1D-4BA5-A0F7-F0B312E1E076} - Microsoft.Build.Engine\Microsoft.Build.Engine-net_4_5 - - - {DA3B9FEE-8FBD-4587-B760-65420765256A} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_4_5 - - - {73FB1B7E-09F9-4E7F-A63A-C407A93BCA59} - Mono.XBuild.Tasks\Mono.XBuild.Tasks-net_4_5 - - - {6E1C7BDE-7B9E-47B0-A7B2-1561822FE922} - Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-xbuild_12.csproj b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-xbuild_12.csproj index 92566e79f64..642da43767b 100644 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-xbuild_12.csproj +++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-xbuild_12.csproj @@ -159,6 +159,7 @@ + diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks.dll.sources b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks.dll.sources index 2261d7af65e..8830df5151b 100644 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks.dll.sources +++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks.dll.sources @@ -112,6 +112,7 @@ Microsoft.Build.Tasks/VCBuild.cs Microsoft.Build.Tasks/Warning.cs Microsoft.Build.Tasks/WriteCodeFragment.cs Microsoft.Build.Tasks/WriteLinesToFile.cs +Microsoft.Build.Tasks/XmlPeek.cs Mono.XBuild.Tasks.GenerateResourceInternal/PoResourceReader.cs Mono.XBuild.Tasks.GenerateResourceInternal/PoResourceWriter.cs Mono.XBuild.Tasks.GenerateResourceInternal/TxtResourceReader.cs diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssignProjectConfiguration.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssignProjectConfiguration.cs index 789af4762ae..6fd7954ab42 100644 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssignProjectConfiguration.cs +++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssignProjectConfiguration.cs @@ -87,14 +87,15 @@ namespace Microsoft.Build.Tasks { string config; string guid_str = item.GetMetadata ("Project"); - Guid guid; - if (!TryParseGuid (guid_str, out guid)) { + + Guid guid = Guid.Empty; + if (!string.IsNullOrEmpty(guid_str) && !TryParseGuid (guid_str, out guid)) { Log.LogError ("Project reference '{0}' has invalid or missing guid for metadata 'Project'.", item.ItemSpec); return false; } - if (guidToConfigPlatform.TryGetValue (guid, out config)) { + if (guid != Guid.Empty && guidToConfigPlatform.TryGetValue (guid, out config)) { string [] parts = config.Split (new char [] {'|'}, 2); ITaskItem new_item = new TaskItem (item); diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/XmlPeek.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/XmlPeek.cs new file mode 100644 index 00000000000..1e8cc21d4f3 --- /dev/null +++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/XmlPeek.cs @@ -0,0 +1,371 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +//----------------------------------------------------------------------- +// +// Returns the value specified by XPath. +//----------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Security; +using System.Security.Permissions; +using System.Text; +using System.Xml; +using System.Xml.Xsl; +using System.Xml.XPath; + +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Microsoft.Build.Tasks +{ + /// + /// A task that returns values as specified by XPath Query + /// from an XML file. + /// + public class XmlPeek : TaskExtension + { + #region Members + + /// + /// The XML input as a file path. + /// + private ITaskItem _xmlInputPath; + + /// + /// The XML input as a string. + /// + private string _xmlContent; + + /// + /// The XPath Query. + /// + private string _query; + + /// + /// The results that this task will return. + /// + private ITaskItem[] _result; + + /// + /// The namespaces for XPath query's prefixes. + /// + private string _namespaces; + + #endregion + + #region Properties + + /// + /// The XML input as a file path. + /// + public ITaskItem XmlInputPath { + get { + return _xmlInputPath; + } + + set { + _xmlInputPath = value; + } + } + + /// + /// The XML input as a string. + /// + public string XmlContent { + get { + return _xmlContent; + } + + set { + _xmlContent = value; + } + } + + /// + /// The XPath Query. + /// + public string Query { + get { + if (_query == null) + throw new ArgumentNullException ("Query"); + return _query; + } + + set { + _query = value; + } + } + + /// + /// The results returned by this task. + /// + [Output] + public ITaskItem[] Result { + get { + return _result; + } + } + + /// + /// The namespaces for XPath query's prefixes. + /// + public string Namespaces { + get { + return _namespaces; + } + + set { + _namespaces = value; + } + } + + #endregion + + + internal static bool IsCriticalException (Exception e) + { + if (e is StackOverflowException + || e is OutOfMemoryException + || e is AccessViolationException) { + return true; + } + return false; + } + + /// + /// Executes the XMLPeek task. + /// + /// true if transformation succeeds. + public override bool Execute () + { + XmlInput xmlinput; + if (_query == null) + throw new ArgumentNullException ("Query"); + + try { + xmlinput = new XmlInput (_xmlInputPath, _xmlContent); + } catch (Exception e) { + if (IsCriticalException (e)) { + throw; + } + + Log.LogErrorWithCodeFromResources ("XmlPeek.ArgumentError", e.Message); + return false; + } + + XPathDocument xpathdoc; + try { + // Load the XPath Document + using (XmlReader xr = xmlinput.CreateReader ()) { + xpathdoc = new XPathDocument (xr); + xr.Close (); + } + } catch (Exception e) { + if (IsCriticalException (e)) { + throw; + } + + Log.LogErrorWithCodeFromResources ("XmlPeekPoke.InputFileError", _xmlInputPath.ItemSpec, e.Message); + return false; + } finally { + xmlinput.CloseReader (); + } + + XPathNavigator nav = xpathdoc.CreateNavigator (); + XPathExpression expr = null; + try { + // Create the expression from query + expr = nav.Compile (_query); + } catch (Exception e) { + if (IsCriticalException (e)) { + throw; + } + + Log.LogErrorWithCodeFromResources ("XmlPeekPoke.XPathError", _query, e.Message); + return false; + } + + // Create the namespace manager and parse the input. + XmlNamespaceManager xmlNamespaceManager = new XmlNamespaceManager (nav.NameTable); + + try { + LoadNamespaces (ref xmlNamespaceManager, _namespaces); + } catch (Exception e) { + if (IsCriticalException (e)) { + throw; + } + + Log.LogErrorWithCodeFromResources ("XmlPeek.NamespacesError", e.Message); + return false; + } + + try { + expr.SetContext (xmlNamespaceManager); + } catch (XPathException e) { + Log.LogErrorWithCodeFromResources ("XmlPeek.XPathContextError", e.Message); + return false; + } + + XPathNodeIterator iter = nav.Select (expr); + + List peekValues = new List (); + while (iter.MoveNext ()) { + if (iter.Current.NodeType == XPathNodeType.Attribute + || iter.Current.NodeType == XPathNodeType.Text) { + peekValues.Add (iter.Current.Value); + } else { + peekValues.Add (iter.Current.OuterXml); + } + } + + _result = new ITaskItem[peekValues.Count]; + int i = 0; + foreach (string item in peekValues) { + _result [i++] = new TaskItem (item); + + // This can be logged a lot, so low importance + Log.LogMessageFromResources (MessageImportance.Low, "XmlPeek.Found", item); + } + + if (_result.Length == 0) { + // Logged no more than once per execute of this task + Log.LogMessageFromResources ("XmlPeek.NotFound"); + } + + return true; + } + + /// + /// Loads the namespaces specified at Namespaces parameter to XmlNSManager. + /// + /// The namespace manager to load namespaces to. + /// The namespaces as XML snippet. + private void LoadNamespaces (ref XmlNamespaceManager namespaceManager, string namepaces) + { + XmlDocument doc = new XmlDocument (); + try { + XmlReaderSettings settings = new XmlReaderSettings (); + settings.DtdProcessing = DtdProcessing.Ignore; + + using (XmlReader reader = XmlReader.Create (new StringReader ("" + namepaces + ""), settings)) { + doc.Load (reader); + } + } catch (XmlException xe) { + throw new ArgumentException ("The specified Namespaces attribute is not a well-formed XML fragment.", xe); + } + + XmlNodeList xnl = doc.SelectNodes ("/Namespaces/*[local-name() = 'Namespace']"); + for (int i = 0; i < xnl.Count; i++) { + XmlNode xn = xnl [i]; + + if (xn.Attributes ["Prefix"] == null) { + throw new ArgumentException (string.Format ("The specified Namespaces attribute doesn't have attribute \"{0}\".", "Name")); + } + + if (xn.Attributes ["Uri"] == null) { + throw new ArgumentException (string.Format ("The specified Namespaces attribute doesn't have attribute \"{0}\".", "Uri")); + } + + namespaceManager.AddNamespace (xn.Attributes ["Prefix"].Value, xn.Attributes ["Uri"].Value); + } + } + + /// + /// This class prepares XML input from XMLInputPath and XMLContent parameters + /// + internal class XmlInput + { + /// + /// What XML input type are we at. + /// + private XmlModes _xmlMode; + + /// + /// This either contains the raw Xml or the path to Xml file. + /// + private string _data; + + /// + /// Filestream used to read XML. + /// + private FileStream _fs; + + /// + /// Constructor. + /// Only one parameter should be non null or will throw ArgumentException. + /// + /// The path to XML file or null. + /// The raw XML. + public XmlInput (ITaskItem xmlInputPath, string xmlContent) + { + if (xmlInputPath != null && xmlContent != null) { + throw new ArgumentException ("Only one of XmlContent or XmlInputPaths arguments can be set."); + } else if (xmlInputPath == null && xmlContent == null) { + throw new ArgumentException ("One of XmlContent or XmlInputPaths arguments must be set."); + } + + if (xmlInputPath != null) { + _xmlMode = XmlModes.XmlFile; + _data = xmlInputPath.ItemSpec; + } else { + _xmlMode = XmlModes.Xml; + _data = xmlContent; + } + } + + /// + /// Possible accepted types of XML input. + /// + public enum XmlModes + { + /// + /// If the mode is a XML file. + /// + XmlFile, + + /// + /// If the mode is a raw XML. + /// + Xml + } + + /// + /// Returns the current mode of the XmlInput + /// + public XmlModes XmlMode { + get { + return _xmlMode; + } + } + + /// + /// Creates correct reader based on the input type. + /// + /// The XmlReader object + public XmlReader CreateReader () + { + if (_xmlMode == XmlModes.XmlFile) { + _fs = new FileStream (_data, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); + return XmlReader.Create (_fs); + } else { // xmlModes.Xml + return XmlReader.Create (new StringReader (_data)); + } + } + + /// + /// Closes the reader. + /// + public void CloseReader () + { + if (_fs != null) { + _fs.Close (); + _fs = null; + } + } + } + } +} diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-net_4_5.csproj b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-net_4_5.csproj deleted file mode 100644 index a2bd20288e2..00000000000 --- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-net_4_5.csproj +++ /dev/null @@ -1,130 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6E1C7BDE-7B9E-47B0-A7B2-1561822FE922} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Microsoft.Build.Utilities.v4.0 - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {DA3B9FEE-8FBD-4587-B760-65420765256A} - Microsoft.Build.Framework-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-tests-net_4_5.csproj b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-tests-net_4_5.csproj deleted file mode 100644 index 9348f776a9e..00000000000 --- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-tests-net_4_5.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DD1C0229-22E8-4C95-9CE5-4E656D48D15D} - Library - 1699 - bin\Debug\Microsoft.Build.Utilities-tests-net_4_5 - True - False - - Properties - - - Microsoft.Build.Utilities_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {6E1C7BDE-7B9E-47B0-A7B2-1561822FE922} - Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_4_5 - - - {4E55B240-B470-43B4-ABDA-8C03E7B1BF8E} - Microsoft.Build.Engine\Microsoft.Build.Engine-net_4_0 - - - {DA3B9FEE-8FBD-4587-B760-65420765256A} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TargetDotNetFrameworkVersion.cs b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TargetDotNetFrameworkVersion.cs index df09e1c8ec3..5a050e1a4aa 100644 --- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TargetDotNetFrameworkVersion.cs +++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TargetDotNetFrameworkVersion.cs @@ -48,11 +48,12 @@ namespace Microsoft.Build.Utilities Version451, #endif #if XBUILD_14 - Version453, + Version46, + Version461, #endif #if XBUILD_14 - VersionLatest = Version453 + VersionLatest = Version461 #elif XBUILD_12 VersionLatest = Version451 #else diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolLocationHelper.cs b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolLocationHelper.cs index 64ed0757a90..8806c73e72d 100644 --- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolLocationHelper.cs +++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolLocationHelper.cs @@ -61,41 +61,44 @@ namespace Microsoft.Build.Utilities runningOnDotNet = !string.IsNullOrEmpty (windowsPath) && lib_mono_dir.StartsWith (windowsPath); if (Environment.GetEnvironmentVariable ("TESTING_MONO") != null) { - mono_dir = new string [] { - Path.Combine (lib_mono_dir, "net_1_0"), - Path.Combine (lib_mono_dir, "net_2_0"), - Path.Combine (lib_mono_dir, "net_2_0"), - Path.Combine (lib_mono_dir, "net_3_5"), + mono_dir = new string [] { // TargetDotNetFrameworkVersion: + Path.Combine (lib_mono_dir, "net_1_0"), // Version11 + Path.Combine (lib_mono_dir, "net_2_0"), // Version20 + Path.Combine (lib_mono_dir, "net_2_0"), // Version30 + Path.Combine (lib_mono_dir, "net_3_5"), // Version35 // mono's 4.0 is not an actual framework directory with all tools etc // it's simply reference assemblies. So like .NET we consider 4.5 to // be a complete replacement for 4.0. - Path.Combine (lib_mono_dir, "net_4_x"), - Path.Combine (lib_mono_dir, "net_4_x"), - Path.Combine (lib_mono_dir, "net_4_x"), - Path.Combine (lib_mono_dir, "net_4_x") + Path.Combine (lib_mono_dir, "net_4_x"), // Version40 + Path.Combine (lib_mono_dir, "net_4_x"), // Version45 + Path.Combine (lib_mono_dir, "net_4_x"), // Version451 + Path.Combine (lib_mono_dir, "net_4_x"), // Version46 + Path.Combine (lib_mono_dir, "net_4_x"), // Version461 }; } else if (runningOnDotNet) { mono_dir = new string [] { - Path.Combine (lib_mono_dir, "v1.0.3705"), - Path.Combine (lib_mono_dir, "v2.0.50727"), - Path.Combine (lib_mono_dir, "v2.0.50727"), - Path.Combine (lib_mono_dir, "v3.5"), - Path.Combine (lib_mono_dir, "v4.0.30319"), - Path.Combine (lib_mono_dir, "v4.0.30319"), - Path.Combine (lib_mono_dir, "v4.0.30319"), - Path.Combine (lib_mono_dir, "v4.0.30319") + Path.Combine (lib_mono_dir, "v1.0.3705"), // Version11 + Path.Combine (lib_mono_dir, "v2.0.50727"), // Version20 + Path.Combine (lib_mono_dir, "v2.0.50727"), // Version30 + Path.Combine (lib_mono_dir, "v3.5"), // Version35 + Path.Combine (lib_mono_dir, "v4.0.30319"), // Version40 + Path.Combine (lib_mono_dir, "v4.0.30319"), // Version45 + Path.Combine (lib_mono_dir, "v4.0.30319"), // Version451 + Path.Combine (lib_mono_dir, "v4.0.30319"), // Version46 + Path.Combine (lib_mono_dir, "v4.0.30319"), // Version461 }; } else { mono_dir = new string [] { - Path.Combine (lib_mono_dir, "1.0"), - Path.Combine (lib_mono_dir, "2.0"), - Path.Combine (lib_mono_dir, "2.0"), - Path.Combine (lib_mono_dir, "3.5"), + Path.Combine (lib_mono_dir, "1.0"), // Version11 + Path.Combine (lib_mono_dir, "2.0"), // Version20 + Path.Combine (lib_mono_dir, "2.0"), // Version30 + Path.Combine (lib_mono_dir, "3.5"), // Version35 // see comment above regarding 4.0/4.5 - Path.Combine (lib_mono_dir, "4.5"), - Path.Combine (lib_mono_dir, "4.5"), - Path.Combine (lib_mono_dir, "4.5"), - Path.Combine (lib_mono_dir, "4.5") + Path.Combine (lib_mono_dir, "4.5"), // Version40 + Path.Combine (lib_mono_dir, "4.5"), // Version45 + Path.Combine (lib_mono_dir, "4.5"), // Version451 + Path.Combine (lib_mono_dir, "4.5"), // Version46 + Path.Combine (lib_mono_dir, "4.5"), // Version461 }; } diff --git a/mcs/class/Microsoft.Build/Microsoft.Build-net_4_5.csproj b/mcs/class/Microsoft.Build/Microsoft.Build-net_4_5.csproj deleted file mode 100644 index 63ecb93e959..00000000000 --- a/mcs/class/Microsoft.Build/Microsoft.Build-net_4_5.csproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1379065B-9195-4ED3-95A7-9508211A7A7E} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Microsoft.Build - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;MICROSOFT_BUILD_DLL - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;MICROSOFT_BUILD_DLL - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {54DFC5A7-7C1D-4BA5-A0F7-F0B312E1E076} - Microsoft.Build.Engine-net_4_5 - - - {DA3B9FEE-8FBD-4587-B760-65420765256A} - Microsoft.Build.Framework-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {54DFC5A7-7C1D-4BA5-A0F7-F0B312E1E076} - Microsoft.Build.Engine-net_4_5 - - - {DA3B9FEE-8FBD-4587-B760-65420765256A} - Microsoft.Build.Framework-net_4_5 - - - - - - - diff --git a/mcs/class/Microsoft.Build/Microsoft.Build-tests-net_4_5.csproj b/mcs/class/Microsoft.Build/Microsoft.Build-tests-net_4_5.csproj deleted file mode 100644 index e82e1e5c5b2..00000000000 --- a/mcs/class/Microsoft.Build/Microsoft.Build-tests-net_4_5.csproj +++ /dev/null @@ -1,126 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {328A697E-59B7-442A-AE1E-0D4C49C2D7E0} - Library - 1699 - bin\Debug\Microsoft.Build-tests-net_4_5 - True - False - - Properties - - - Microsoft.Build_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;MICROSOFT_BUILD_DLL - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;MICROSOFT_BUILD_DLL - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {1379065B-9195-4ED3-95A7-9508211A7A7E} - Microsoft.Build\Microsoft.Build-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {54DFC5A7-7C1D-4BA5-A0F7-F0B312E1E076} - Microsoft.Build.Engine\Microsoft.Build.Engine-net_4_5 - - - {DA3B9FEE-8FBD-4587-B760-65420765256A} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_4_5 - - - {6E1C7BDE-7B9E-47B0-A7B2-1561822FE922} - Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_4_5 - - - - - - - diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp-net_4_5.csproj b/mcs/class/Microsoft.CSharp/Microsoft.CSharp-net_4_5.csproj deleted file mode 100644 index f58a89fcde3..00000000000 --- a/mcs/class/Microsoft.CSharp/Microsoft.CSharp-net_4_5.csproj +++ /dev/null @@ -1,114 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D554618C-5D38-413A-82BA-7A70B6FC61A3} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Microsoft.CSharp - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {811AC316-9CC2-497D-A45E-7B6B1E0E481B} - Mono.CSharp-net_4_5 - - - - - - - diff --git a/mcs/class/Microsoft.VisualC/Microsoft.VisualC-net_4_5.csproj b/mcs/class/Microsoft.VisualC/Microsoft.VisualC-net_4_5.csproj deleted file mode 100644 index 880811d83d2..00000000000 --- a/mcs/class/Microsoft.VisualC/Microsoft.VisualC-net_4_5.csproj +++ /dev/null @@ -1,97 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D2B40179-234C-4709-82A2-AE91FA7AD106} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Microsoft.VisualC - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Microsoft.Web.Infrastructure/Microsoft.Web.Infrastructure-net_4_5.csproj b/mcs/class/Microsoft.Web.Infrastructure/Microsoft.Web.Infrastructure-net_4_5.csproj deleted file mode 100644 index 3117b57a0a9..00000000000 --- a/mcs/class/Microsoft.Web.Infrastructure/Microsoft.Web.Infrastructure-net_4_5.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {50DC9191-2D18-4EDB-A929-4ECAB7981A1C} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Microsoft.Web.Infrastructure - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {B489C3DE-3ED3-4EDC-B42B-82B38E101857} - System.Web-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.C5/Mono.C5-net_4_5.csproj b/mcs/class/Mono.C5/Mono.C5-net_4_5.csproj deleted file mode 100644 index 96531f1ac2b..00000000000 --- a/mcs/class/Mono.C5/Mono.C5-net_4_5.csproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4A54C7EC-01F3-4C6E-9181-84F178FD0F97} - Library - 1699,169,219,414,1030,3001,3005,3006 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Mono.C5 - v4.5 - 512 - - - - true - full - 1699,169,219,414,1030,3001,3005,3006 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,169,219,414,1030,3001,3005,3006 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.C5/Mono.C5-tests-net_4_5.csproj b/mcs/class/Mono.C5/Mono.C5-tests-net_4_5.csproj deleted file mode 100644 index 28308f24291..00000000000 --- a/mcs/class/Mono.C5/Mono.C5-tests-net_4_5.csproj +++ /dev/null @@ -1,108 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8D349606-02F4-4AAF-83AF-676A50F6D6B6} - Library - 1699,169,219,414,1030,3001,3005,3006,618,219,169 - bin\Debug\Mono.C5-tests-net_4_5 - True - False - - Properties - - - Mono.C5_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,169,219,414,1030,3001,3005,3006,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699,169,219,414,1030,3001,3005,3006,618,219,169 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {4A54C7EC-01F3-4C6E-9181-84F178FD0F97} - Mono.C5\Mono.C5-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - - - - - diff --git a/mcs/class/Mono.CSharp/Mono.CSharp-net_4_5.csproj b/mcs/class/Mono.CSharp/Mono.CSharp-net_4_5.csproj deleted file mode 100644 index 57e10a97478..00000000000 --- a/mcs/class/Mono.CSharp/Mono.CSharp-net_4_5.csproj +++ /dev/null @@ -1,150 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {811AC316-9CC2-497D-A45E-7B6B1E0E481B} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Mono.CSharp - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.CSharp/Mono.CSharp-net_4_x.csproj b/mcs/class/Mono.CSharp/Mono.CSharp-net_4_x.csproj index 440042170c2..b36796d2439 100644 --- a/mcs/class/Mono.CSharp/Mono.CSharp-net_4_x.csproj +++ b/mcs/class/Mono.CSharp/Mono.CSharp-net_4_x.csproj @@ -25,7 +25,7 @@ full 1699 false - TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE + TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;MONO_FEATURE_THREAD_ABORT prompt 4 @@ -33,7 +33,7 @@ pdbonly 1699 true - NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE + NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;MONO_FEATURE_THREAD_ABORT prompt 4 diff --git a/mcs/class/Mono.CSharp/Mono.CSharp-tests-net_4_5.csproj b/mcs/class/Mono.CSharp/Mono.CSharp-tests-net_4_5.csproj deleted file mode 100644 index 763548037d9..00000000000 --- a/mcs/class/Mono.CSharp/Mono.CSharp-tests-net_4_5.csproj +++ /dev/null @@ -1,91 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {76213E4A-6D78-4274-9EB9-FCE25187E353} - Library - 1699 - bin\Debug\Mono.CSharp-tests-net_4_5 - True - False - - Properties - - - Mono.CSharp_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {811AC316-9CC2-497D-A45E-7B6B1E0E481B} - Mono.CSharp\Mono.CSharp-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Cairo/Mono.Cairo-net_4_5.csproj b/mcs/class/Mono.Cairo/Mono.Cairo-net_4_5.csproj deleted file mode 100644 index 59a40bb97ed..00000000000 --- a/mcs/class/Mono.Cairo/Mono.Cairo-net_4_5.csproj +++ /dev/null @@ -1,136 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C07C4C90-8F45-49A8-8F22-919577916756} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Mono.Cairo - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb-net_4_5.csproj b/mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb-net_4_5.csproj deleted file mode 100644 index 37147f3dd7e..00000000000 --- a/mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb-net_4_5.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9ABB7BB9-5EA1-4081-B205-5658A602C1F5} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Mono.Cecil.Mdb - v4.5 - 512 - - - true - - - ../mono.snk - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;CECIL - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;CECIL - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {F6DD456E-ADE4-419D-997F-41ECA0CE79F7} - Mono.Cecil-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Cecil/Mono.Cecil-net_4_5.csproj b/mcs/class/Mono.Cecil/Mono.Cecil-net_4_5.csproj deleted file mode 100644 index 39726d0122e..00000000000 --- a/mcs/class/Mono.Cecil/Mono.Cecil-net_4_5.csproj +++ /dev/null @@ -1,216 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F6DD456E-ADE4-419D-997F-41ECA0CE79F7} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Mono.Cecil - v4.5 - 512 - - - true - - - ../mono.snk - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.CodeContracts/Mono.CodeContracts-net_4_5.csproj b/mcs/class/Mono.CodeContracts/Mono.CodeContracts-net_4_5.csproj deleted file mode 100644 index b8ca798e51c..00000000000 --- a/mcs/class/Mono.CodeContracts/Mono.CodeContracts-net_4_5.csproj +++ /dev/null @@ -1,473 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5A56819B-A874-42CF-991C-8DD1B97115B3} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Mono.CodeContracts - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {F6DD456E-ADE4-419D-997F-41ECA0CE79F7} - Mono.Cecil-net_4_5 - - - {9ABB7BB9-5EA1-4081-B205-5658A602C1F5} - Mono.Cecil.Mdb-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.CodeContracts/Mono.CodeContracts-tests-net_4_5.csproj b/mcs/class/Mono.CodeContracts/Mono.CodeContracts-tests-net_4_5.csproj deleted file mode 100644 index 8dd45872d95..00000000000 --- a/mcs/class/Mono.CodeContracts/Mono.CodeContracts-tests-net_4_5.csproj +++ /dev/null @@ -1,86 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {ECA3830F-C627-47A4-8F3B-CB9C5172475D} - Library - 1699 - bin\Debug\Mono.CodeContracts-tests-net_4_5 - True - False - - Properties - - - Mono.CodeContracts_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {5A56819B-A874-42CF-991C-8DD1B97115B3} - Mono.CodeContracts\Mono.CodeContracts-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.CompilerServices.SymbolWriter/Mono.CompilerServices.SymbolWriter-net_4_5.csproj b/mcs/class/Mono.CompilerServices.SymbolWriter/Mono.CompilerServices.SymbolWriter-net_4_5.csproj deleted file mode 100644 index 4de73018a51..00000000000 --- a/mcs/class/Mono.CompilerServices.SymbolWriter/Mono.CompilerServices.SymbolWriter-net_4_5.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7980DE5E-4B22-4E00-AD22-7A570D207828} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Mono.CompilerServices.SymbolWriter - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-net_4_5.csproj b/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-net_4_5.csproj deleted file mode 100644 index 37dd83e5749..00000000000 --- a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-net_4_5.csproj +++ /dev/null @@ -1,142 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {41476FBD-C1CB-4B3C-8078-3281EB1E0EAB} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - Mono.Data.Sqlite - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;SQLITE_STANDARD - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;SQLITE_STANDARD - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {AF2BBF50-AB57-4CA1-8EF5-2B54C7418434} - System.Transactions-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - - - - - - SR.resources - - - SQLiteCommand.bmp - - - SQLiteConnection.bmp - - - SQLiteDataAdapter.bmp - - - - diff --git a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-tests-net_4_5.csproj b/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-tests-net_4_5.csproj deleted file mode 100644 index 1d5d64b2cb8..00000000000 --- a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-tests-net_4_5.csproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D322C5A4-B938-4D3C-8309-27535751DFCC} - Library - 1699,618 - bin\Debug\Mono.Data.Sqlite-tests-net_4_5 - True - False - true - Properties - - - Mono.Data.Sqlite_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;SQLITE_STANDARD - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;SQLITE_STANDARD - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {41476FBD-C1CB-4B3C-8078-3281EB1E0EAB} - Mono.Data.Sqlite\Mono.Data.Sqlite-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data\System.Data-net_4_5 - - - {AF2BBF50-AB57-4CA1-8EF5-2B54C7418434} - System.Transactions\System.Transactions-net_4_5 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - - - - - - SR.resources - - - SQLiteCommand.bmp - - - SQLiteConnection.bmp - - - SQLiteDataAdapter.bmp - - - - diff --git a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLite3.cs b/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLite3.cs index d2ef1f63165..6f757238cd4 100644 --- a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLite3.cs +++ b/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLite3.cs @@ -499,6 +499,8 @@ namespace Mono.Data.Sqlite #if !SQLITE_STANDARD int len; return UTF8ToString(UnsafeNativeMethods.sqlite3_column_origin_name_interop(stmt._sqlite_stmt, index, out len), len); +#elif MONOTOUCH + throw new NotImplementedException (); #else return UTF8ToString(UnsafeNativeMethods.sqlite3_column_origin_name(stmt._sqlite_stmt, index), -1); #endif @@ -509,6 +511,8 @@ namespace Mono.Data.Sqlite #if !SQLITE_STANDARD int len; return UTF8ToString(UnsafeNativeMethods.sqlite3_column_database_name_interop(stmt._sqlite_stmt, index, out len), len); +#elif MONOTOUCH + throw new NotImplementedException (); #else return UTF8ToString(UnsafeNativeMethods.sqlite3_column_database_name(stmt._sqlite_stmt, index), -1); #endif @@ -519,6 +523,8 @@ namespace Mono.Data.Sqlite #if !SQLITE_STANDARD int len; return UTF8ToString(UnsafeNativeMethods.sqlite3_column_table_name_interop(stmt._sqlite_stmt, index, out len), len); +#elif MONOTOUCH + throw new NotImplementedException (); #else return UTF8ToString(UnsafeNativeMethods.sqlite3_column_table_name(stmt._sqlite_stmt, index), -1); #endif @@ -923,6 +929,17 @@ namespace Mono.Data.Sqlite return UnsafeNativeMethods.sqlite3_aggregate_context(context, 1); } +#if MONOTOUCH + internal override void SetPassword(byte[] passwordBytes) + { + throw new NotImplementedException (); + } + + internal override void ChangePassword(byte[] newPasswordBytes) + { + throw new NotImplementedException (); + } +#else internal override void SetPassword(byte[] passwordBytes) { int n = UnsafeNativeMethods.sqlite3_key(_sql, passwordBytes, passwordBytes.Length); @@ -934,6 +951,7 @@ namespace Mono.Data.Sqlite int n = UnsafeNativeMethods.sqlite3_rekey(_sql, newPasswordBytes, (newPasswordBytes == null) ? 0 : newPasswordBytes.Length); if (n > 0) throw new SqliteException(n, SQLiteLastError()); } +#endif #if MONOTOUCH SQLiteUpdateCallback update_callback; diff --git a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLite3_UTF16.cs b/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLite3_UTF16.cs index 6ad8762b776..16c7cdf3e66 100644 --- a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLite3_UTF16.cs +++ b/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLite3_UTF16.cs @@ -112,6 +112,8 @@ namespace Mono.Data.Sqlite #if !SQLITE_STANDARD int len; return UTF16ToString(UnsafeNativeMethods.sqlite3_column_origin_name16_interop(stmt._sqlite_stmt, index, out len), len); +#elif MONOTOUCH + throw new NotImplementedException (); #else return UTF16ToString(UnsafeNativeMethods.sqlite3_column_origin_name16(stmt._sqlite_stmt, index), -1); #endif @@ -122,6 +124,8 @@ namespace Mono.Data.Sqlite #if !SQLITE_STANDARD int len; return UTF16ToString(UnsafeNativeMethods.sqlite3_column_database_name16_interop(stmt._sqlite_stmt, index, out len), len); +#elif MONOTOUCH + throw new NotImplementedException (); #else return UTF16ToString(UnsafeNativeMethods.sqlite3_column_database_name16(stmt._sqlite_stmt, index), -1); #endif @@ -132,6 +136,8 @@ namespace Mono.Data.Sqlite #if !SQLITE_STANDARD int len; return UTF16ToString(UnsafeNativeMethods.sqlite3_column_table_name16_interop(stmt._sqlite_stmt, index, out len), len); +#elif MONOTOUCH + throw new NotImplementedException (); #else return UTF16ToString(UnsafeNativeMethods.sqlite3_column_table_name16(stmt._sqlite_stmt, index), -1); #endif diff --git a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/UnsafeNativeMethods.cs b/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/UnsafeNativeMethods.cs index 4b440b951ed..ba16a1763ff 100644 --- a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/UnsafeNativeMethods.cs +++ b/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/UnsafeNativeMethods.cs @@ -200,6 +200,8 @@ namespace Mono.Data.Sqlite #endif internal static extern IntPtr sqlite3_bind_parameter_name(IntPtr stmt, int index); +// Apple does not include those symbols in it's libsqlite3 +#if !MONOTOUCH #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else @@ -213,6 +215,7 @@ namespace Mono.Data.Sqlite [DllImport(SQLITE_DLL)] #endif internal static extern IntPtr sqlite3_column_database_name16(IntPtr stmt, int index); +#endif #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] @@ -242,6 +245,7 @@ namespace Mono.Data.Sqlite #endif internal static extern IntPtr sqlite3_column_name16(IntPtr stmt, int index); +#if !MONOTOUCH #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else @@ -269,6 +273,7 @@ namespace Mono.Data.Sqlite [DllImport(SQLITE_DLL)] #endif internal static extern IntPtr sqlite3_column_table_name16(IntPtr stmt, int index); +#endif // !MONOTOUCH #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] @@ -646,6 +651,7 @@ namespace Mono.Data.Sqlite #endif internal static extern void sqlite3_result_text16(IntPtr context, string strName, int nLen, IntPtr pvReserved); +#if !MONOTOUCH #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else @@ -659,6 +665,7 @@ namespace Mono.Data.Sqlite [DllImport(SQLITE_DLL)] #endif internal static extern int sqlite3_rekey(IntPtr db, byte[] key, int keylen); +#endif #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds-net_4_5.csproj b/mcs/class/Mono.Data.Tds/Mono.Data.Tds-net_4_5.csproj deleted file mode 100644 index e7455ca23ba..00000000000 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds-net_4_5.csproj +++ /dev/null @@ -1,130 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {CB7949AC-5FA7-4FAB-893A-8FAF436BF514} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Mono.Data.Tds - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {D68D4FED-CA32-4800-A628-58BAE485562C} - Mono.Security-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds-tests-net_4_5.csproj b/mcs/class/Mono.Data.Tds/Mono.Data.Tds-tests-net_4_5.csproj deleted file mode 100644 index 4fafd525d7f..00000000000 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds-tests-net_4_5.csproj +++ /dev/null @@ -1,90 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E4210383-92E4-4D94-9BCD-7A1985EC45E1} - Library - 1699 - bin\Debug\Mono.Data.Tds-tests-net_4_5 - True - False - - Properties - - - Mono.Data.Tds_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {CB7949AC-5FA7-4FAB-893A-8FAF436BF514} - Mono.Data.Tds\Mono.Data.Tds-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {018D907D-AF28-4DB2-8D7D-24AB62ED97BC} - System.Net\System.Net-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-net_4_5.csproj b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-net_4_5.csproj deleted file mode 100644 index 6b469d81198..00000000000 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-net_4_5.csproj +++ /dev/null @@ -1,173 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7DFAE255-C562-4F72-8DE4-4D578491A10A} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - Mono.Debugger.Soft - v4.5 - 512 - - - true - - - ../mono.snk - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;MONO_DATACONVERTER_STATIC_METHODS - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;MONO_DATACONVERTER_STATIC_METHODS - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {F6DD456E-ADE4-419D-997F-41ECA0CE79F7} - Mono.Cecil-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-tests-net_4_5.csproj b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-tests-net_4_5.csproj deleted file mode 100644 index 66f61a942dd..00000000000 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-tests-net_4_5.csproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {52B1D397-D4B8-4EF1-98C7-61AD82FD4A58} - Library - 1699 - bin\Debug\Mono.Debugger.Soft-tests-net_4_5 - True - False - - Properties - - - Mono.Debugger.Soft_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {7DFAE255-C562-4F72-8DE4-4D578491A10A} - Mono.Debugger.Soft\Mono.Debugger.Soft-net_4_5 - - - {F6DD456E-ADE4-419D-997F-41ECA0CE79F7} - Mono.Cecil\Mono.Cecil-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Http/Mono.Http-net_4_5.csproj b/mcs/class/Mono.Http/Mono.Http-net_4_5.csproj deleted file mode 100644 index a0c93b3fa7a..00000000000 --- a/mcs/class/Mono.Http/Mono.Http-net_4_5.csproj +++ /dev/null @@ -1,113 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8D430163-3294-4930-B9BA-510385010CE1} - Library - 1699,618 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Mono.Http - v4.5 - 512 - - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,618 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {B489C3DE-3ED3-4EDC-B42B-82B38E101857} - System.Web-net_4_5 - - - {0B587DBA-BA92-4B92-821A-AA200C612A7E} - ICSharpCode.SharpZipLib-net_4_5 - - - {D68D4FED-CA32-4800-A628-58BAE485562C} - Mono.Security-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Management/Mono.Management-net_4_5.csproj b/mcs/class/Mono.Management/Mono.Management-net_4_5.csproj deleted file mode 100644 index 9e4ce31e75c..00000000000 --- a/mcs/class/Mono.Management/Mono.Management-net_4_5.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {38262197-48BD-4D8A-9968-4C6E60C814BB} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Mono.Management - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {85A9B29B-58FF-4FBE-8998-B0A89AC22880} - Mono.Posix-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-net_4_5.csproj b/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-net_4_5.csproj deleted file mode 100644 index 67128673378..00000000000 --- a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-net_4_5.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B96416B1-91AE-466C-BDD0-9A8FF4331E61} - Library - 1699,618 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Mono.Messaging.RabbitMQ - v4.5 - 512 - - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,618 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {1CBEC0FC-5926-42FA-A0CF-A19617FABB78} - System.Messaging-net_4_5 - - - {DDCC93B5-9425-4E9A-95DC-3400D0028508} - Mono.Messaging-net_4_5 - - - {55AA0C89-63D9-438E-A139-3ED9F72AE295} - RabbitMQ.Client-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-tests-net_4_5.csproj b/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-tests-net_4_5.csproj deleted file mode 100644 index 79c81c61d0b..00000000000 --- a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-tests-net_4_5.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B24C3A44-693C-4B91-BF99-A34445844673} - Library - 1699,618,618,219,169 - bin\Debug\Mono.Messaging.RabbitMQ-tests-net_4_5 - True - False - - Properties - - - Mono.Messaging.RabbitMQ_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,618,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699,618,618,219,169 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {B96416B1-91AE-466C-BDD0-9A8FF4331E61} - Mono.Messaging.RabbitMQ\Mono.Messaging.RabbitMQ-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {1CBEC0FC-5926-42FA-A0CF-A19617FABB78} - System.Messaging\System.Messaging-net_4_5 - - - {DDCC93B5-9425-4E9A-95DC-3400D0028508} - Mono.Messaging\Mono.Messaging-net_4_5 - - - {55AA0C89-63D9-438E-A139-3ED9F72AE295} - client\RabbitMQ.Client-net_4_5 - - - False - nunit.mocks.dll - False - - - - - - - diff --git a/mcs/class/Mono.Messaging/Mono.Messaging-net_4_5.csproj b/mcs/class/Mono.Messaging/Mono.Messaging-net_4_5.csproj deleted file mode 100644 index 426d19b3b5b..00000000000 --- a/mcs/class/Mono.Messaging/Mono.Messaging-net_4_5.csproj +++ /dev/null @@ -1,116 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DDCC93B5-9425-4E9A-95DC-3400D0028508} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Mono.Messaging - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Messaging/Mono.Messaging-tests-net_4_5.csproj b/mcs/class/Mono.Messaging/Mono.Messaging-tests-net_4_5.csproj deleted file mode 100644 index 77af52306c3..00000000000 --- a/mcs/class/Mono.Messaging/Mono.Messaging-tests-net_4_5.csproj +++ /dev/null @@ -1,99 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2AFCBA1D-10F6-4A5B-A68C-6817DA966A2D} - Library - 1699,618,219,169 - bin\Debug\Mono.Messaging-tests-net_4_5 - True - False - - Properties - - - Mono.Messaging_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {DDCC93B5-9425-4E9A-95DC-3400D0028508} - Mono.Messaging\Mono.Messaging-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration\System.Configuration-net_4_5 - - - {5854BF27-FC35-44F5-BE59-580900694E32} - System.Messaging\System.Messaging-net_4_0 - - - False - nunit.mocks.dll - False - - - - - - - diff --git a/mcs/class/Mono.Options/Mono.Options-net_4_5.csproj b/mcs/class/Mono.Options/Mono.Options-net_4_5.csproj deleted file mode 100644 index 3d5c2b43fca..00000000000 --- a/mcs/class/Mono.Options/Mono.Options-net_4_5.csproj +++ /dev/null @@ -1,88 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6DAA3E35-6FC9-477B-9D4D-538D9ECE7283} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Mono.Options - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Options/Mono.Options-tests-net_4_5.csproj b/mcs/class/Mono.Options/Mono.Options-tests-net_4_5.csproj deleted file mode 100644 index d07237acfbe..00000000000 --- a/mcs/class/Mono.Options/Mono.Options-tests-net_4_5.csproj +++ /dev/null @@ -1,99 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4B6B2285-AE59-4E3A-8692-1E0479688BA1} - Library - 1699 - bin\Debug\Mono.Options-tests-net_4_5 - True - False - - Properties - - - Mono.Options_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {6DAA3E35-6FC9-477B-9D4D-538D9ECE7283} - Mono.Options\Mono.Options-net_4_5 - - - {85A9B29B-58FF-4FBE-8998-B0A89AC22880} - Mono.Posix\Mono.Posix-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Parallel/Mono.Parallel-net_4_5.csproj b/mcs/class/Mono.Parallel/Mono.Parallel-net_4_5.csproj deleted file mode 100644 index af4fe1ca6fd..00000000000 --- a/mcs/class/Mono.Parallel/Mono.Parallel-net_4_5.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {CA0DDCCE-2190-4D9B-88D6-237682D21BC3} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Mono.Parallel - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;INSIDE_MONO_PARALLEL - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;INSIDE_MONO_PARALLEL - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Parallel/Mono.Parallel-tests-net_4_5.csproj b/mcs/class/Mono.Parallel/Mono.Parallel-tests-net_4_5.csproj deleted file mode 100644 index 837a9e3b6df..00000000000 --- a/mcs/class/Mono.Parallel/Mono.Parallel-tests-net_4_5.csproj +++ /dev/null @@ -1,88 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F408F42C-51DD-4A6F-AEEF-C2EA9F2D9012} - Library - 1699 - bin\Debug\Mono.Parallel-tests-net_4_5 - True - False - - Properties - - - Mono.Parallel_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {CA0DDCCE-2190-4D9B-88D6-237682D21BC3} - Mono.Parallel\Mono.Parallel-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Posix/Mono.Posix-net_4_5.csproj b/mcs/class/Mono.Posix/Mono.Posix-net_4_5.csproj deleted file mode 100644 index 7b483024b40..00000000000 --- a/mcs/class/Mono.Posix/Mono.Posix-net_4_5.csproj +++ /dev/null @@ -1,141 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {85A9B29B-58FF-4FBE-8998-B0A89AC22880} - Library - 1699,618,612 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - Mono.Posix - v4.5 - 512 - - - - true - full - 1699,618,612 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,618,612 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Posix/Mono.Posix-tests-net_4_5.csproj b/mcs/class/Mono.Posix/Mono.Posix-tests-net_4_5.csproj deleted file mode 100644 index a0c5cf12f57..00000000000 --- a/mcs/class/Mono.Posix/Mono.Posix-tests-net_4_5.csproj +++ /dev/null @@ -1,99 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7D57A17D-4F08-46F8-86D4-C54D0B84325F} - Library - 1699,219,618 - bin\Debug\Mono.Posix-tests-net_4_5 - True - False - - Properties - - - Mono.Posix_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,219,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699,219,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {85A9B29B-58FF-4FBE-8998-B0A89AC22880} - Mono.Posix\Mono.Posix-net_4_5 - - - {85A9B29B-58FF-4FBE-8998-B0A89AC22880} - Mono.Posix\Mono.Posix-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System\System-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Posix/Mono.Unix.Native/Stdlib.cs b/mcs/class/Mono.Posix/Mono.Unix.Native/Stdlib.cs index c2e50b8d259..e4c34cba317 100644 --- a/mcs/class/Mono.Posix/Mono.Unix.Native/Stdlib.cs +++ b/mcs/class/Mono.Posix/Mono.Unix.Native/Stdlib.cs @@ -381,6 +381,42 @@ namespace Mono.Unix.Native { internal const string LIBC = "msvcrt"; internal const string MPH = "MonoPosixHelper"; + // It is possible for Mono.Posix and MonoPosixHelper to get out of sync, + // for example if NuGet does something weird. To mitigate this, anyone + // editing Mono.Posix needs to observe two rules: + // 1. When introducing C-interface changes to MonoPosixHelper, update + // the version strings in VersionCheck below and also + // Mono_Unix_VersionString in the C sources. + // 2. Any class which performs a DllImport on Stdlib.MPH needs to call + // Stdlib.VersionCheck in its static constructor. + + [DllImport (Stdlib.MPH, CallingConvention=CallingConvention.Cdecl, + EntryPoint="Mono_Unix_VersionString")] + private static extern IntPtr VersionStringPtr (); + private static bool versionCheckPerformed = false; + internal static void VersionCheck () + { + if (versionCheckPerformed) + return; + + // This string is arbitrary; it matters only that it is unique. + string assemblyVersion = "MonoProject-2015-12-1"; + string nativeVersion = Marshal.PtrToStringAnsi (VersionStringPtr ()); + if (assemblyVersion != nativeVersion) + { + throw new Exception ("Mono.Posix assembly loaded with a different version (\"" + + assemblyVersion + "\") than MonoPosixHelper (\"" + nativeVersion + + "\"). You may need to reinstall Mono.Posix."); + } + + versionCheckPerformed = true; + } + + static Stdlib () + { + VersionCheck (); + } + internal Stdlib () {} #region Declarations diff --git a/mcs/class/Mono.Posix/Mono.Unix/UnixSignal.cs b/mcs/class/Mono.Posix/Mono.Unix/UnixSignal.cs index 883e044aea1..8e4eb5b8463 100644 --- a/mcs/class/Mono.Posix/Mono.Unix/UnixSignal.cs +++ b/mcs/class/Mono.Posix/Mono.Unix/UnixSignal.cs @@ -39,6 +39,11 @@ namespace Mono.Unix { private int signum; private IntPtr signal_info; + static UnixSignal () + { + Stdlib.VersionCheck (); + } + public UnixSignal (Signum signum) { this.signum = NativeConvert.FromSignum (signum); @@ -145,10 +150,12 @@ namespace Mono.Unix { set {Interlocked.Exchange (ref Info->count, value);} } + // signum, count, write_fd, pipecnt, and pipelock are read from a signal handler thread + // count and pipelock are both read and written from the signal handler thread [Map] struct SignalInfo { - public int signum, count, read_fd, write_fd, have_handler, pipecnt; - public IntPtr handler; + public int signum, count, read_fd, write_fd, pipecnt, pipelock, have_handler; + public IntPtr handler; // Backed-up handler to restore when signal unregistered } #region WaitHandle overrides diff --git a/mcs/class/Mono.Posix/Test/Mono.Unix/UnixSignalTest.cs b/mcs/class/Mono.Posix/Test/Mono.Unix/UnixSignalTest.cs index 14613104d9b..d621ad51d45 100644 --- a/mcs/class/Mono.Posix/Test/Mono.Unix/UnixSignalTest.cs +++ b/mcs/class/Mono.Posix/Test/Mono.Unix/UnixSignalTest.cs @@ -456,6 +456,7 @@ namespace MonoTests.Mono.Unix { s.Close (); } + // Create thread that issues many signals from a set of harmless signals static Thread CreateRaiseStormThread (int max) { return new Thread (delegate () { @@ -486,6 +487,7 @@ namespace MonoTests.Mono.Unix { CloseSignals (usignals); } + // Create thread that repeatedly registers then unregisters signal handlers static Thread CreateSignalCreatorThread () { return new Thread (delegate () { @@ -523,6 +525,7 @@ namespace MonoTests.Mono.Unix { CloseSignals (usignals); } + // Create thread that blocks until at least one of the given signals is received static Thread CreateWaitAnyThread (params UnixSignal[] usignals) { return new Thread (delegate () { diff --git a/mcs/class/Mono.Security.Providers.DotNet/Mono.Security.Providers.DotNet-net_4_x.csproj b/mcs/class/Mono.Security.Providers.DotNet/Mono.Security.Providers.DotNet-net_4_x.csproj new file mode 100644 index 00000000000..5199a373e5b --- /dev/null +++ b/mcs/class/Mono.Security.Providers.DotNet/Mono.Security.Providers.DotNet-net_4_x.csproj @@ -0,0 +1,99 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {391EDD2B-85AC-4FCA-B607-AAD6C51E6799} + Library + 1699,1030 + ./../../class/lib/net_4_x + True + True + true + Properties + + + Mono.Security.Providers.DotNet + v4.5 + 512 + + + true + true + + + ../mono.pub + + + true + full + 1699,1030 + false + TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE + prompt + 4 + + + pdbonly + 1699,1030 + true + NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE + prompt + 4 + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + {2CA6026B-2DC8-4C4C-A12C-1E8234049DB7} + corlib-net_4_x + + + {2762E921-91A8-4C87-91E9-BA628013F753} + System-net_4_x + + + {42D59DE7-586F-4ACF-BDD5-E7869E39E3EF} + Mono.Security-net_4_x + + + + + + + diff --git a/mcs/class/Mono.Security.Providers.DotNet/Mono.Security.Providers.DotNet/DotNetSslStreamImpl.cs b/mcs/class/Mono.Security.Providers.DotNet/Mono.Security.Providers.DotNet/DotNetSslStreamImpl.cs index 12fabc8f58f..7453f8d196a 100644 --- a/mcs/class/Mono.Security.Providers.DotNet/Mono.Security.Providers.DotNet/DotNetSslStreamImpl.cs +++ b/mcs/class/Mono.Security.Providers.DotNet/Mono.Security.Providers.DotNet/DotNetSslStreamImpl.cs @@ -33,11 +33,11 @@ using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; using System.Security.Principal; using System.Security.Cryptography; -using Mono.Security.Interface; +using MSI = Mono.Security.Interface; namespace Mono.Security.Providers.DotNet { - class DotNetSslStreamImpl : MonoSslStream + class DotNetSslStreamImpl : MSI.IMonoSslStream { SslStream impl; @@ -59,208 +59,208 @@ namespace Mono.Security.Providers.DotNet userCertificateSelectionCallback); } - public override void AuthenticateAsClient (string targetHost) + public void AuthenticateAsClient (string targetHost) { Impl.AuthenticateAsClient (targetHost); } - public override void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) + public void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) { Impl.AuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation); } - public override IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState) + public IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState) { return Impl.BeginAuthenticateAsClient (targetHost, asyncCallback, asyncState); } - public override IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState) + public IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState) { return Impl.BeginAuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState); } - public override void EndAuthenticateAsClient (IAsyncResult asyncResult) + public void EndAuthenticateAsClient (IAsyncResult asyncResult) { Impl.EndAuthenticateAsClient (asyncResult); } - public override void AuthenticateAsServer (X509Certificate serverCertificate) + public void AuthenticateAsServer (X509Certificate serverCertificate) { Impl.AuthenticateAsServer (serverCertificate); } - public override void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) + public void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) { Impl.AuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation); } - public override IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState) + public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState) { return Impl.BeginAuthenticateAsServer (serverCertificate, asyncCallback, asyncState); } - public override IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState) + public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState) { return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState); } - public override void EndAuthenticateAsServer (IAsyncResult asyncResult) + public void EndAuthenticateAsServer (IAsyncResult asyncResult) { Impl.EndAuthenticateAsServer (asyncResult); } - public override Task AuthenticateAsClientAsync (string targetHost) + public Task AuthenticateAsClientAsync (string targetHost) { return Impl.AuthenticateAsClientAsync (targetHost); } - public override Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) + public Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) { return Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation); } - public override Task AuthenticateAsServerAsync (X509Certificate serverCertificate) + public Task AuthenticateAsServerAsync (X509Certificate serverCertificate) { return Impl.AuthenticateAsServerAsync (serverCertificate); } - public override Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) + public Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation) { return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation); } - public override void Flush () + public void Flush () { Impl.Flush (); } - public override int Read (byte[] buffer, int offset, int count) + public int Read (byte[] buffer, int offset, int count) { return Impl.Read (buffer, offset, count); } - public override void Write (byte[] buffer) + public void Write (byte[] buffer) { Impl.Write (buffer); } - public override void Write (byte[] buffer, int offset, int count) + public void Write (byte[] buffer, int offset, int count) { Impl.Write (buffer, offset, count); } - public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState) + public IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState) { return Impl.BeginRead (buffer, offset, count, asyncCallback, asyncState); } - public override int EndRead (IAsyncResult asyncResult) + public int EndRead (IAsyncResult asyncResult) { return Impl.EndRead (asyncResult); } - public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState) + public IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState) { return Impl.BeginWrite (buffer, offset, count, asyncCallback, asyncState); } - public override void EndWrite (IAsyncResult asyncResult) + public void EndWrite (IAsyncResult asyncResult) { Impl.EndWrite (asyncResult); } - public override TransportContext TransportContext { + public TransportContext TransportContext { get { throw new NotSupportedException (); } } - public override bool IsAuthenticated { + public bool IsAuthenticated { get { return Impl.IsAuthenticated; } } - public override bool IsMutuallyAuthenticated { + public bool IsMutuallyAuthenticated { get { return Impl.IsMutuallyAuthenticated; } } - public override bool IsEncrypted { + public bool IsEncrypted { get { return Impl.IsEncrypted; } } - public override bool IsSigned { + public bool IsSigned { get { return Impl.IsSigned; } } - public override bool IsServer { + public bool IsServer { get { return Impl.IsServer; } } - public override CipherAlgorithmType CipherAlgorithm { + public CipherAlgorithmType CipherAlgorithm { get { return Impl.CipherAlgorithm; } } - public override int CipherStrength { + public int CipherStrength { get { return Impl.CipherStrength; } } - public override HashAlgorithmType HashAlgorithm { + public HashAlgorithmType HashAlgorithm { get { return Impl.HashAlgorithm; } } - public override int HashStrength { + public int HashStrength { get { return Impl.HashStrength; } } - public override ExchangeAlgorithmType KeyExchangeAlgorithm { + public ExchangeAlgorithmType KeyExchangeAlgorithm { get { return Impl.KeyExchangeAlgorithm; } } - public override int KeyExchangeStrength { + public int KeyExchangeStrength { get { return KeyExchangeStrength; } } - public override bool CanRead { + public bool CanRead { get { return Impl.CanRead; } } - public override bool CanTimeout { + public bool CanTimeout { get { return Impl.CanTimeout; } } - public override bool CanWrite { + public bool CanWrite { get { return Impl.CanWrite; } } - public override long Length { + public long Length { get { return Impl.Length; } } - public override long Position { + public long Position { get { return Impl.Position; } } - public override void SetLength (long value) + public void SetLength (long value) { Impl.SetLength (value); } - public override AuthenticatedStream AuthenticatedStream { + public AuthenticatedStream AuthenticatedStream { get { return Impl; } } - public override int ReadTimeout { + public int ReadTimeout { get { return Impl.ReadTimeout; } set { Impl.ReadTimeout = value; } } - public override int WriteTimeout { + public int WriteTimeout { get { return Impl.WriteTimeout; } set { Impl.WriteTimeout = value; } } - public override bool CheckCertRevocationStatus { + public bool CheckCertRevocationStatus { get { return Impl.CheckCertRevocationStatus; } } - public override X509Certificate InternalLocalCertificate { + public X509Certificate InternalLocalCertificate { get { try { return LocalCertificate; @@ -270,15 +270,15 @@ namespace Mono.Security.Providers.DotNet } } - public override X509Certificate LocalCertificate { + public X509Certificate LocalCertificate { get { return Impl.LocalCertificate; } } - public override X509Certificate RemoteCertificate { + public X509Certificate RemoteCertificate { get { return Impl.RemoteCertificate; } } - public override SslProtocols SslProtocol { + public SslProtocols SslProtocol { get { return Impl.SslProtocol; } } @@ -288,7 +288,13 @@ namespace Mono.Security.Providers.DotNet throw new ObjectDisposedException ("MonoSslStream"); } - protected override void Dispose (bool disposing) + public void Dispose () + { + Dispose (true); + GC.SuppressFinalize (this); + } + + protected void Dispose (bool disposing) { if (impl != null && disposing) { impl.Dispose (); diff --git a/mcs/class/Mono.Security.Providers.DotNet/Mono.Security.Providers.DotNet/DotNetTlsProvider.cs b/mcs/class/Mono.Security.Providers.DotNet/Mono.Security.Providers.DotNet/DotNetTlsProvider.cs index 855edfee892..b96f828b90f 100644 --- a/mcs/class/Mono.Security.Providers.DotNet/Mono.Security.Providers.DotNet/DotNetTlsProvider.cs +++ b/mcs/class/Mono.Security.Providers.DotNet/Mono.Security.Providers.DotNet/DotNetTlsProvider.cs @@ -40,6 +40,16 @@ namespace Mono.Security.Providers.DotNet */ public class DotNetTlsProvider : MonoTlsProvider { + static readonly Guid id = new Guid ("3a7b3a26-0dbd-4572-a5b8-fdce766bf0dd"); + + public override Guid ID { + get { return id; } + } + + public override string Name { + get { return "dotnet"; } + } + public override bool SupportsSslStream { get { return true; } } @@ -56,7 +66,7 @@ namespace Mono.Security.Providers.DotNet get { return (SslProtocols)ServicePointManager.SecurityProtocol; } } - public override MonoSslStream CreateSslStream ( + public override IMonoSslStream CreateSslStream ( Stream innerStream, bool leaveInnerStreamOpen, MonoTlsSettings settings = null) { diff --git a/mcs/class/Mono.Security.Providers.NewSystemSource/Mono.Security.Providers.NewSystemSource-net_4_x.csproj b/mcs/class/Mono.Security.Providers.NewSystemSource/Mono.Security.Providers.NewSystemSource-net_4_x.csproj new file mode 100644 index 00000000000..9df975f3276 --- /dev/null +++ b/mcs/class/Mono.Security.Providers.NewSystemSource/Mono.Security.Providers.NewSystemSource-net_4_x.csproj @@ -0,0 +1,124 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {0BB4541F-9B1A-4CBC-BEB1-00B31B37F74E} + Library + 1699,1030 + ./../../class/lib/net_4_x + True + True + true + Properties + + + Mono.Security.Providers.NewSystemSource + v4.5 + 512 + + + true + true + + + ../mono.pub + + + true + full + 1699,1030 + false + TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;SECURITY_DEP;MONO_SECURITY_ALIAS;MONO;FEATURE_PAL;MONO_FEATURE_NEW_TLS;MONO_FEATURE_NEW_SYSTEM_SOURCE;DISABLE_CAS_USE + prompt + 4 + + + pdbonly + 1699,1030 + true + NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;SECURITY_DEP;MONO_SECURITY_ALIAS;MONO;FEATURE_PAL;MONO_FEATURE_NEW_TLS;MONO_FEATURE_NEW_SYSTEM_SOURCE;DISABLE_CAS_USE + prompt + 4 + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {2CA6026B-2DC8-4C4C-A12C-1E8234049DB7} + corlib-net_4_x + + + {2762E921-91A8-4C87-91E9-BA628013F753} + System-net_4_x + + + {42D59DE7-586F-4ACF-BDD5-E7869E39E3EF} + Mono.Security-net_4_x + MonoSecurity + + + + + + diff --git a/mcs/class/Mono.Security.Providers.OldTls/Mono.Security.Providers.OldTls-net_4_x.csproj b/mcs/class/Mono.Security.Providers.OldTls/Mono.Security.Providers.OldTls-net_4_x.csproj new file mode 100644 index 00000000000..7439af9be77 --- /dev/null +++ b/mcs/class/Mono.Security.Providers.OldTls/Mono.Security.Providers.OldTls-net_4_x.csproj @@ -0,0 +1,165 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {E485E885-59B1-4081-BC66-56AAAFD8771A} + Library + 1699,1030 + ./../../class/lib/net_4_x + True + True + true + Properties + + + Mono.Security.Providers.OldTls + v4.5 + 512 + + + true + true + + + ../mono.pub + + + true + full + 1699,1030 + false + TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;SECURITY_DEP + prompt + 4 + + + pdbonly + 1699,1030 + true + NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;SECURITY_DEP + prompt + 4 + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {2CA6026B-2DC8-4C4C-A12C-1E8234049DB7} + corlib-net_4_x + + + {2762E921-91A8-4C87-91E9-BA628013F753} + System-net_4_x + + + {42D59DE7-586F-4ACF-BDD5-E7869E39E3EF} + Mono.Security-net_4_x + + + + + + + diff --git a/mcs/class/Mono.Security.Providers.OldTls/Mono.Security.Providers.OldTls/OldTlsProvider.cs b/mcs/class/Mono.Security.Providers.OldTls/Mono.Security.Providers.OldTls/OldTlsProvider.cs index 5754f4fd87d..9d3aa7c4210 100644 --- a/mcs/class/Mono.Security.Providers.OldTls/Mono.Security.Providers.OldTls/OldTlsProvider.cs +++ b/mcs/class/Mono.Security.Providers.OldTls/Mono.Security.Providers.OldTls/OldTlsProvider.cs @@ -30,12 +30,22 @@ using System.Net.Security; using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; using Mono.Security.Interface; -using Mono.Net.Security; +using MNS = Mono.Net.Security; namespace Mono.Security.Providers.OldTls { public class OldTlsProvider : MonoTlsProvider { + static readonly Guid id = new Guid ("cf8baa0d-c6ed-40ae-b512-dec8d097e9af"); + + public override Guid ID { + get { return id; } + } + + public override string Name { + get { return "old"; } + } + public override bool SupportsSslStream { get { return true; } } @@ -52,12 +62,12 @@ namespace Mono.Security.Providers.OldTls get { return SslProtocols.Tls; } } - public override MonoSslStream CreateSslStream ( + public override IMonoSslStream CreateSslStream ( Stream innerStream, bool leaveInnerStreamOpen, MonoTlsSettings settings = null) { - var impl = new LegacySslStream (innerStream, leaveInnerStreamOpen, this, settings); - return new MonoSslStreamImpl (impl); + var impl = new MNS.LegacySslStream (innerStream, leaveInnerStreamOpen, this, settings); + return new MNS.MonoSslStreamImpl (impl); } public override IMonoTlsContext CreateTlsContext ( diff --git a/mcs/class/Mono.Security.Win32/Mono.Security.Win32-net_4_5.csproj b/mcs/class/Mono.Security.Win32/Mono.Security.Win32-net_4_5.csproj deleted file mode 100644 index 3a711249eaa..00000000000 --- a/mcs/class/Mono.Security.Win32/Mono.Security.Win32-net_4_5.csproj +++ /dev/null @@ -1,94 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1DEB5FAA-15BC-46F1-BAFA-EE6DF0BB6F76} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - Mono.Security.Win32 - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Security/Makefile b/mcs/class/Mono.Security/Makefile index 2bd2f1d7aa4..f9508b9c8a6 100644 --- a/mcs/class/Mono.Security/Makefile +++ b/mcs/class/Mono.Security/Makefile @@ -18,3 +18,7 @@ $(the_libdir_base)bare/System.dll: .NOTPARALLEL: $(the_libdir_base)bare/System.dll EXTRA_DISTFILES = Mono.Security.Interface/README.md + +# +# Update this comment to trigger a build in System +# diff --git a/mcs/class/Mono.Security/Mono.Security-net_4_5.csproj b/mcs/class/Mono.Security/Mono.Security-net_4_5.csproj deleted file mode 100644 index 78fe63079a1..00000000000 --- a/mcs/class/Mono.Security/Mono.Security-net_4_5.csproj +++ /dev/null @@ -1,220 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D68D4FED-CA32-4800-A628-58BAE485562C} - Library - 1699,1030 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - Mono.Security - v4.5 - 512 - - - - true - full - 1699,1030 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,1030 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {91CDF14E-F60F-4AB7-BC9D-5CBD7E669076} - System-bare-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Security/Mono.Security-net_4_x.csproj b/mcs/class/Mono.Security/Mono.Security-net_4_x.csproj index cc51fcf06ec..879cb7e517f 100644 --- a/mcs/class/Mono.Security/Mono.Security-net_4_x.csproj +++ b/mcs/class/Mono.Security/Mono.Security-net_4_x.csproj @@ -80,6 +80,23 @@ + + + + + + + + + + + + + + + + + diff --git a/mcs/class/Mono.Security/Mono.Security-tests-net_4_5.csproj b/mcs/class/Mono.Security/Mono.Security-tests-net_4_5.csproj deleted file mode 100644 index 9f6dd3aab9c..00000000000 --- a/mcs/class/Mono.Security/Mono.Security-tests-net_4_5.csproj +++ /dev/null @@ -1,129 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {823040EA-6C7C-49B1-9CA3-9236C9B629F5} - Library - 1699,1030,169,219,618,672 - bin\Debug\Mono.Security-tests-net_4_5 - True - False - true - Properties - - - Mono.Security_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,1030,169,219,618,672 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699,1030,169,219,618,672 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {D68D4FED-CA32-4800-A628-58BAE485562C} - Mono.Security\Mono.Security-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System\System-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/Alert.cs b/mcs/class/Mono.Security/Mono.Security.Interface/Alert.cs new file mode 100644 index 00000000000..fdd0948a2e9 --- /dev/null +++ b/mcs/class/Mono.Security/Mono.Security.Interface/Alert.cs @@ -0,0 +1,277 @@ +// +// Alert.cs +// +// Author: +// Martin Baulig +// +// Copyright (c) 2015 Xamarin, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +namespace Mono.Security.Interface +{ + #region Enumerations + + public enum AlertLevel : byte + { + Warning = 1, + Fatal = 2 + } + + public enum AlertDescription : byte + { + CloseNotify = 0, + UnexpectedMessage = 10, + BadRecordMAC = 20, + DecryptionFailed_RESERVED = 21, + RecordOverflow = 22, + DecompressionFailure = 30, + HandshakeFailure = 40, + NoCertificate_RESERVED = 41, // should be used in SSL3 + BadCertificate = 42, + UnsupportedCertificate = 43, + CertificateRevoked = 44, + CertificateExpired = 45, + CertificateUnknown = 46, + IlegalParameter = 47, + UnknownCA = 48, + AccessDenied = 49, + DecodeError = 50, + DecryptError = 51, + ExportRestriction = 60, + ProtocolVersion = 70, + InsuficientSecurity = 71, + InternalError = 80, + UserCancelled = 90, + NoRenegotiation = 100, + UnsupportedExtension = 110 + } + + #endregion + + public class Alert + { + #region Fields + + private AlertLevel level; + private AlertDescription description; + + #endregion + + #region Properties + + public AlertLevel Level + { + get { return this.level; } + } + + public AlertDescription Description + { + get { return this.description; } + } + + public string Message + { + get { return Alert.GetAlertMessage(this.description); } + } + + public bool IsWarning + { + get { return this.level == AlertLevel.Warning ? true : false; } + } + + /* + public bool IsFatal + { + get { return this.level == AlertLevel.Fatal ? true : false; } + } + */ + + public bool IsCloseNotify + { + get + { + if (this.IsWarning && + this.description == AlertDescription.CloseNotify) + { + return true; + } + + return false; + } + } + + #endregion + + #region Constructors + + public Alert(AlertDescription description) + { + this.description = description; + this.inferAlertLevel(); + } + + public Alert( + AlertLevel level, + AlertDescription description) + { + this.level = level; + this.description = description; + } + + #endregion + + #region Private Methods + + private void inferAlertLevel() + { + switch (description) + { + case AlertDescription.CloseNotify: + case AlertDescription.NoRenegotiation: + case AlertDescription.UserCancelled: + this.level = AlertLevel.Warning; + break; + + case AlertDescription.AccessDenied: + case AlertDescription.BadCertificate: + case AlertDescription.BadRecordMAC: + case AlertDescription.CertificateExpired: + case AlertDescription.CertificateRevoked: + case AlertDescription.CertificateUnknown: + case AlertDescription.DecodeError: + case AlertDescription.DecompressionFailure: + case AlertDescription.DecryptError: + case AlertDescription.DecryptionFailed_RESERVED: + case AlertDescription.ExportRestriction: + case AlertDescription.HandshakeFailure: + case AlertDescription.IlegalParameter: + case AlertDescription.InsuficientSecurity: + case AlertDescription.InternalError: + case AlertDescription.ProtocolVersion: + case AlertDescription.RecordOverflow: + case AlertDescription.UnexpectedMessage: + case AlertDescription.UnknownCA: + case AlertDescription.UnsupportedCertificate: + case AlertDescription.UnsupportedExtension: + default: + this.level = AlertLevel.Fatal; + break; + } + } + + #endregion + + public override string ToString () + { + return string.Format ("[Alert: {0}:{1}]", Level, Description); + } + + #region Static Methods + + public static string GetAlertMessage(AlertDescription description) + { + #if (DEBUG) + switch (description) + { + case AlertDescription.AccessDenied: + return "An inappropriate message was received."; + + case AlertDescription.BadCertificate: + return "TLSCiphertext decrypted in an invalid way."; + + case AlertDescription.BadRecordMAC: + return "Record with an incorrect MAC."; + + case AlertDescription.CertificateExpired: + return "Certificate has expired or is not currently valid"; + + case AlertDescription.CertificateRevoked: + return "Certificate was revoked by its signer."; + + case AlertDescription.CertificateUnknown: + return "Certificate Unknown."; + + case AlertDescription.CloseNotify: + return "Connection closed"; + + case AlertDescription.DecodeError: + return "A message could not be decoded because some field was out of the specified range or the length of the message was incorrect."; + + case AlertDescription.DecompressionFailure: + return "The decompression function received improper input (e.g. data that would expand to excessive length)."; + + case AlertDescription.DecryptError: + return "TLSCiphertext decrypted in an invalid way: either it wasn`t an even multiple of the block length or its padding values, when checked, weren`t correct."; + + case AlertDescription.DecryptionFailed_RESERVED: + return "Handshake cryptographic operation failed, including being unable to correctly verify a signature, decrypt a key exchange, or validate finished message."; + + case AlertDescription.ExportRestriction: + return "Negotiation not in compliance with export restrictions was detected."; + + case AlertDescription.HandshakeFailure: + return "Unable to negotiate an acceptable set of security parameters given the options available."; + + case AlertDescription.IlegalParameter: + return "A field in the handshake was out of range or inconsistent with other fields."; + + case AlertDescription.InsuficientSecurity: + return "Negotiation has failed specifically because the server requires ciphers more secure than those supported by the client."; + + case AlertDescription.InternalError: + return "Internal error unrelated to the peer or the correctness of the protocol makes it impossible to continue."; + + case AlertDescription.NoRenegotiation: + return "Invalid renegotiation."; + + case AlertDescription.ProtocolVersion: + return "Unsupported protocol version."; + + case AlertDescription.RecordOverflow: + return "Invalid length on TLSCiphertext record or TLSCompressed record."; + + case AlertDescription.UnexpectedMessage: + return "Invalid message received."; + + case AlertDescription.UnknownCA: + return "CA can't be identified as a trusted CA."; + + case AlertDescription.UnsupportedCertificate: + return "Certificate was of an unsupported type."; + + case AlertDescription.UserCancelled: + return "Handshake cancelled by user."; + + case AlertDescription.UnsupportedExtension: + return "Unsupported extension."; + + default: + return ""; + } + #else + return "The authentication or decryption has failed."; + #endif + } + + #endregion + } +} diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/CipherAlgorithmType.cs b/mcs/class/Mono.Security/Mono.Security.Interface/CipherAlgorithmType.cs new file mode 100644 index 00000000000..4a54fa75412 --- /dev/null +++ b/mcs/class/Mono.Security/Mono.Security.Interface/CipherAlgorithmType.cs @@ -0,0 +1,39 @@ +// +// CipherAlgorithmType.cs +// +// Author: +// Martin Baulig +// +// Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +namespace Mono.Security.Interface +{ + public enum CipherAlgorithmType + { + None, + Aes128, + Aes256, + AesGcm128, + AesGcm256 + } +} diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/CipherSuiteCode.cs b/mcs/class/Mono.Security/Mono.Security.Interface/CipherSuiteCode.cs new file mode 100644 index 00000000000..66980df81a6 --- /dev/null +++ b/mcs/class/Mono.Security/Mono.Security.Interface/CipherSuiteCode.cs @@ -0,0 +1,398 @@ +// +// CipherSuiteCode.cs +// +// Author: +// Martin Baulig +// +// Copyright (c) 2015 Xamarin, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +namespace Mono.Security.Interface +{ + /// + /// RFC 2246 A.5 + /// + public enum CipherSuiteCode : ushort + { + TLS_NULL_WITH_NULL_NULL = 0x0000, + TLS_RSA_WITH_NULL_MD5 = 0x0001, + TLS_RSA_WITH_NULL_SHA = 0x0002, + TLS_RSA_EXPORT_WITH_RC4_40_MD5 = 0x0003, + TLS_RSA_WITH_RC4_128_MD5 = 0x0004, + TLS_RSA_WITH_RC4_128_SHA = 0x0005, + TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = 0x0006, + TLS_RSA_WITH_IDEA_CBC_SHA = 0x0007, + TLS_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0008, + TLS_RSA_WITH_DES_CBC_SHA = 0x0009, + TLS_RSA_WITH_3DES_EDE_CBC_SHA = 0x000A, + TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x000B, + TLS_DH_DSS_WITH_DES_CBC_SHA = 0x000C, + TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = 0x000D, + TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x000E, + TLS_DH_RSA_WITH_DES_CBC_SHA = 0x000F, + TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = 0x0010, + TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x0011, + TLS_DHE_DSS_WITH_DES_CBC_SHA = 0x0012, + TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 0x0013, + TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0014, + TLS_DHE_RSA_WITH_DES_CBC_SHA = 0x0015, + TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x0016, + TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 = 0x0017, + TLS_DH_anon_WITH_RC4_128_MD5 = 0x0018, + TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA = 0x0019, + TLS_DH_anon_WITH_DES_CBC_SHA = 0x001A, + TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = 0x001B, + + /* + * Note: The cipher suite values { 0x00, 0x1C } and { 0x00, 0x1D } are reserved to avoid + * collision with Fortezza-based cipher suites in SSL 3. + */ + + /* + * RFC 3268 + */ + TLS_RSA_WITH_AES_128_CBC_SHA = 0x002F, + TLS_DH_DSS_WITH_AES_128_CBC_SHA = 0x0030, + TLS_DH_RSA_WITH_AES_128_CBC_SHA = 0x0031, + TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 0x0032, + TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x0033, + TLS_DH_anon_WITH_AES_128_CBC_SHA = 0x0034, + TLS_RSA_WITH_AES_256_CBC_SHA = 0x0035, + TLS_DH_DSS_WITH_AES_256_CBC_SHA = 0x0036, + TLS_DH_RSA_WITH_AES_256_CBC_SHA = 0x0037, + TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 0x0038, + TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x0039, + TLS_DH_anon_WITH_AES_256_CBC_SHA = 0x003A, + + /* + * RFC 5932 + */ + TLS_RSA_WITH_CAMELLIA_128_CBC_SHA = 0x0041, + TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA = 0x0042, + TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA = 0x0043, + TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA = 0x0044, + TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA = 0x0045, + TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA = 0x0046, + + TLS_RSA_WITH_CAMELLIA_256_CBC_SHA = 0x0084, + TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA = 0x0085, + TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA = 0x0086, + TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA = 0x0087, + TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA = 0x0088, + TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA = 0x0089, + + TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BA, + TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BB, + TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BC, + TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BD, + TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BE, + TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BF, + + TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C0, + TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C1, + TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C2, + TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C3, + TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C4, + TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C5, + + /* + * RFC 4162 + */ + TLS_RSA_WITH_SEED_CBC_SHA = 0x0096, + TLS_DH_DSS_WITH_SEED_CBC_SHA = 0x0097, + TLS_DH_RSA_WITH_SEED_CBC_SHA = 0x0098, + TLS_DHE_DSS_WITH_SEED_CBC_SHA = 0x0099, + TLS_DHE_RSA_WITH_SEED_CBC_SHA = 0x009A, + TLS_DH_anon_WITH_SEED_CBC_SHA = 0x009B, + + /* + * RFC 4279 + */ + TLS_PSK_WITH_RC4_128_SHA = 0x008A, + TLS_PSK_WITH_3DES_EDE_CBC_SHA = 0x008B, + TLS_PSK_WITH_AES_128_CBC_SHA = 0x008C, + TLS_PSK_WITH_AES_256_CBC_SHA = 0x008D, + TLS_DHE_PSK_WITH_RC4_128_SHA = 0x008E, + TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA = 0x008F, + TLS_DHE_PSK_WITH_AES_128_CBC_SHA = 0x0090, + TLS_DHE_PSK_WITH_AES_256_CBC_SHA = 0x0091, + TLS_RSA_PSK_WITH_RC4_128_SHA = 0x0092, + TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA = 0x0093, + TLS_RSA_PSK_WITH_AES_128_CBC_SHA = 0x0094, + TLS_RSA_PSK_WITH_AES_256_CBC_SHA = 0x0095, + + /* + * RFC 4492 + */ + TLS_ECDH_ECDSA_WITH_NULL_SHA = 0xC001, + TLS_ECDH_ECDSA_WITH_RC4_128_SHA = 0xC002, + TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA = 0xC003, + TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA = 0xC004, + TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA = 0xC005, + TLS_ECDHE_ECDSA_WITH_NULL_SHA = 0xC006, + TLS_ECDHE_ECDSA_WITH_RC4_128_SHA = 0xC007, + TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA = 0xC008, + TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = 0xC009, + TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = 0xC00A, + TLS_ECDH_RSA_WITH_NULL_SHA = 0xC00B, + TLS_ECDH_RSA_WITH_RC4_128_SHA = 0xC00C, + TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA = 0xC00D, + TLS_ECDH_RSA_WITH_AES_128_CBC_SHA = 0xC00E, + TLS_ECDH_RSA_WITH_AES_256_CBC_SHA = 0xC00F, + TLS_ECDHE_RSA_WITH_NULL_SHA = 0xC010, + TLS_ECDHE_RSA_WITH_RC4_128_SHA = 0xC011, + TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA = 0xC012, + TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = 0xC013, + TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = 0xC014, + TLS_ECDH_anon_WITH_NULL_SHA = 0xC015, + TLS_ECDH_anon_WITH_RC4_128_SHA = 0xC016, + TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA = 0xC017, + TLS_ECDH_anon_WITH_AES_128_CBC_SHA = 0xC018, + TLS_ECDH_anon_WITH_AES_256_CBC_SHA = 0xC019, + + /* + * RFC 4785 + */ + TLS_PSK_WITH_NULL_SHA = 0x002C, + TLS_DHE_PSK_WITH_NULL_SHA = 0x002D, + TLS_RSA_PSK_WITH_NULL_SHA = 0x002E, + + /* + * RFC 5054 + */ + TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA = 0xC01A, + TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA = 0xC01B, + TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA = 0xC01C, + TLS_SRP_SHA_WITH_AES_128_CBC_SHA = 0xC01D, + TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA = 0xC01E, + TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA = 0xC01F, + TLS_SRP_SHA_WITH_AES_256_CBC_SHA = 0xC020, + TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA = 0xC021, + TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA = 0xC022, + + /* + * RFC 5246 + */ + TLS_RSA_WITH_NULL_SHA256 = 0x003B, + TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x003C, + TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x003D, + TLS_DH_DSS_WITH_AES_128_CBC_SHA256 = 0x003E, + TLS_DH_RSA_WITH_AES_128_CBC_SHA256 = 0x003F, + TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = 0x0040, + TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x0067, + TLS_DH_DSS_WITH_AES_256_CBC_SHA256 = 0x0068, + TLS_DH_RSA_WITH_AES_256_CBC_SHA256 = 0x0069, + TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = 0x006A, + TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x006B, + TLS_DH_anon_WITH_AES_128_CBC_SHA256 = 0x006C, + TLS_DH_anon_WITH_AES_256_CBC_SHA256 = 0x006D, + + /* + * RFC 5288 + */ + TLS_RSA_WITH_AES_128_GCM_SHA256 = 0x009C, + TLS_RSA_WITH_AES_256_GCM_SHA384 = 0x009D, + TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = 0x009E, + TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = 0x009F, + TLS_DH_RSA_WITH_AES_128_GCM_SHA256 = 0x00A0, + TLS_DH_RSA_WITH_AES_256_GCM_SHA384 = 0x00A1, + TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 = 0x00A2, + TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 = 0x00A3, + TLS_DH_DSS_WITH_AES_128_GCM_SHA256 = 0x00A4, + TLS_DH_DSS_WITH_AES_256_GCM_SHA384 = 0x00A5, + TLS_DH_anon_WITH_AES_128_GCM_SHA256 = 0x00A6, + TLS_DH_anon_WITH_AES_256_GCM_SHA384 = 0x00A7, + + /* + * RFC 5289 + */ + TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC023, + TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC024, + TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC025, + TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC026, + TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = 0xC027, + TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = 0xC028, + TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 = 0xC029, + TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 = 0xC02A, + TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02B, + TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02C, + TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02D, + TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02E, + TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 0xC02F, + TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 0xC030, + TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 = 0xC031, + TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 = 0xC032, + + /* + * RFC 5487 + */ + TLS_PSK_WITH_AES_128_GCM_SHA256 = 0x00A8, + TLS_PSK_WITH_AES_256_GCM_SHA384 = 0x00A9, + TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 = 0x00AA, + TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 = 0x00AB, + TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 = 0x00AC, + TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 = 0x00AD, + TLS_PSK_WITH_AES_128_CBC_SHA256 = 0x00AE, + TLS_PSK_WITH_AES_256_CBC_SHA384 = 0x00AF, + TLS_PSK_WITH_NULL_SHA256 = 0x00B0, + TLS_PSK_WITH_NULL_SHA384 = 0x00B1, + TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 = 0x00B2, + TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 = 0x00B3, + TLS_DHE_PSK_WITH_NULL_SHA256 = 0x00B4, + TLS_DHE_PSK_WITH_NULL_SHA384 = 0x00B5, + TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 = 0x00B6, + TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 = 0x00B7, + TLS_RSA_PSK_WITH_NULL_SHA256 = 0x00B8, + TLS_RSA_PSK_WITH_NULL_SHA384 = 0x00B9, + + /* + * RFC 5489 + */ + TLS_ECDHE_PSK_WITH_RC4_128_SHA = 0xC033, + TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA = 0xC034, + TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA = 0xC035, + TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA = 0xC036, + TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 = 0xC037, + TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 = 0xC038, + TLS_ECDHE_PSK_WITH_NULL_SHA = 0xC039, + TLS_ECDHE_PSK_WITH_NULL_SHA256 = 0xC03A, + TLS_ECDHE_PSK_WITH_NULL_SHA384 = 0xC03B, + + /* + * RFC 5746 + */ + TLS_EMPTY_RENEGOTIATION_INFO_SCSV = 0x00FF, + + /* + * RFC 6367 + */ + TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 = 0xC072, + TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 = 0xC073, + TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 = 0xC074, + TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 = 0xC075, + TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0xC076, + TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 = 0xC077, + TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0xC078, + TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 = 0xC079, + + TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC07A, + TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC07B, + TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC07C, + TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC07D, + TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC07E, + TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC07F, + TLS_DHE_DSS_WITH_CAMELLIA_128_GCM_SHA256 = 0xC080, + TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384 = 0xC081, + TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256 = 0xC082, + TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384 = 0xC083, + TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256 = 0xC084, + TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384 = 0xC085, + TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC086, + TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC087, + TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC088, + TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC089, + TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC08A, + TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC08B, + TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC08C, + TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC08D, + + TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 = 0xC08E, + TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 = 0xC08F, + TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 = 0xC090, + TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 = 0xC091, + TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 = 0xC092, + TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 = 0xC093, + TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 = 0xC094, + TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 = 0xC095, + TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 = 0xC096, + TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 = 0xC097, + TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 = 0xC098, + TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 = 0xC099, + TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 = 0xC09A, + TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 = 0xC09B, + + /* + * RFC 6655 + */ + TLS_RSA_WITH_AES_128_CCM = 0xC09C, + TLS_RSA_WITH_AES_256_CCM = 0xC09D, + TLS_DHE_RSA_WITH_AES_128_CCM = 0xC09E, + TLS_DHE_RSA_WITH_AES_256_CCM = 0xC09F, + TLS_RSA_WITH_AES_128_CCM_8 = 0xC0A0, + TLS_RSA_WITH_AES_256_CCM_8 = 0xC0A1, + TLS_DHE_RSA_WITH_AES_128_CCM_8 = 0xC0A2, + TLS_DHE_RSA_WITH_AES_256_CCM_8 = 0xC0A3, + TLS_PSK_WITH_AES_128_CCM = 0xC0A4, + TLS_PSK_WITH_AES_256_CCM = 0xC0A5, + TLS_DHE_PSK_WITH_AES_128_CCM = 0xC0A6, + TLS_DHE_PSK_WITH_AES_256_CCM = 0xC0A7, + TLS_PSK_WITH_AES_128_CCM_8 = 0xC0A8, + TLS_PSK_WITH_AES_256_CCM_8 = 0xC0A9, + TLS_PSK_DHE_WITH_AES_128_CCM_8 = 0xC0AA, + TLS_PSK_DHE_WITH_AES_256_CCM_8 = 0xC0AB, + + /* + * draft-agl-tls-chacha20poly1305-04 + */ + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCC13, + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCC14, + TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCC15, + + /* + * draft-josefsson-salsa20-tls-04 + */ + TLS_RSA_WITH_ESTREAM_SALSA20_SHA1 = 0xE410, + TLS_RSA_WITH_SALSA20_SHA1 = 0xE411, + TLS_ECDHE_RSA_WITH_ESTREAM_SALSA20_SHA1 = 0xE412, + TLS_ECDHE_RSA_WITH_SALSA20_SHA1 = 0xE413, + TLS_ECDHE_ECDSA_WITH_ESTREAM_SALSA20_SHA1 = 0xE414, + TLS_ECDHE_ECDSA_WITH_SALSA20_SHA1 = 0xE415, + TLS_PSK_WITH_ESTREAM_SALSA20_SHA1 = 0xE416, + TLS_PSK_WITH_SALSA20_SHA1 = 0xE417, + TLS_ECDHE_PSK_WITH_ESTREAM_SALSA20_SHA1 = 0xE418, + TLS_ECDHE_PSK_WITH_SALSA20_SHA1 = 0xE419, + TLS_RSA_PSK_WITH_ESTREAM_SALSA20_SHA1 = 0xE41A, + TLS_RSA_PSK_WITH_SALSA20_SHA1 = 0xE41B, + TLS_DHE_PSK_WITH_ESTREAM_SALSA20_SHA1 = 0xE41C, + TLS_DHE_PSK_WITH_SALSA20_SHA1 = 0xE41D, + TLS_DHE_RSA_WITH_ESTREAM_SALSA20_SHA1 = 0xE41E, + TLS_DHE_RSA_WITH_SALSA20_SHA1 = 0xE41F, + + /* + * draft-ietf-tls-downgrade-scsv-00 + */ + TLS_FALLBACK_SCSV = 0x5600, + + /* + public static bool IsScsv (int cipherSuite) + { + switch (cipherSuite) { + case TLS_EMPTY_RENEGOTIATION_INFO_SCSV: + case TLS_FALLBACK_SCSV: + return true, + default: + return false, + } + } + */ + } +} diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/ExchangeAlgorithmType.cs b/mcs/class/Mono.Security/Mono.Security.Interface/ExchangeAlgorithmType.cs new file mode 100644 index 00000000000..c7a70aa6799 --- /dev/null +++ b/mcs/class/Mono.Security/Mono.Security.Interface/ExchangeAlgorithmType.cs @@ -0,0 +1,38 @@ +// +// ExchangeAlgorithmType.cs +// +// Author: +// Martin Baulig +// +// Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +namespace Mono.Security.Interface +{ + public enum ExchangeAlgorithmType + { + None, + Dhe, + Rsa, + EcDhe + } +} diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/HashAlgorithmType.cs b/mcs/class/Mono.Security/Mono.Security.Interface/HashAlgorithmType.cs new file mode 100644 index 00000000000..549e0b6a48e --- /dev/null +++ b/mcs/class/Mono.Security/Mono.Security.Interface/HashAlgorithmType.cs @@ -0,0 +1,44 @@ +// +// HashAlgorithmType.cs +// +// Author: +// Martin Baulig +// +// Copyright (c) 2015 Xamarin, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +namespace Mono.Security.Interface +{ + public enum HashAlgorithmType + { + // These values refer to the @HashAlgorithm enumeration in the TLS 1.2 spec. + None = 0, + Md5 = 1, + Sha1 = 2, + Sha224 = 3, + Sha256 = 4, + Sha384 = 5, + Sha512 = 6, + Unknown = 255, + + // Mono-specific addition, allowing us to reuse it IHashAlgorithm API for TLS 1.0 / 1.1. + Md5Sha1 = 254 + } +} diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/IMonoSslStream.cs b/mcs/class/Mono.Security/Mono.Security.Interface/IMonoSslStream.cs new file mode 100644 index 00000000000..ae7a9297d12 --- /dev/null +++ b/mcs/class/Mono.Security/Mono.Security.Interface/IMonoSslStream.cs @@ -0,0 +1,188 @@ +// +// IMonoSslStream.cs +// +// Author: +// Martin Baulig +// +// Copyright (c) 2015 Xamarin, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using System.IO; +using System.Net; +using System.Net.Security; +using System.Threading.Tasks; +using SSA = System.Security.Authentication; +using System.Security.Cryptography.X509Certificates; +using System.Security.Principal; +using System.Security.Cryptography; +using Mono.Net.Security; + +namespace Mono.Security.Interface +{ + public interface IMonoSslStream : IDisposable + { + void AuthenticateAsClient (string targetHost); + + void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SSA.SslProtocols enabledSslProtocols, bool checkCertificateRevocation); + + IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState); + + IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SSA.SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState); + + void EndAuthenticateAsClient (IAsyncResult asyncResult); + + void AuthenticateAsServer (X509Certificate serverCertificate); + + void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SSA.SslProtocols enabledSslProtocols, bool checkCertificateRevocation); + + IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState); + + IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SSA.SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState); + + void EndAuthenticateAsServer (IAsyncResult asyncResult); + + Task AuthenticateAsClientAsync (string targetHost); + + Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SSA.SslProtocols enabledSslProtocols, bool checkCertificateRevocation); + + Task AuthenticateAsServerAsync (X509Certificate serverCertificate); + + Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SSA.SslProtocols enabledSslProtocols, bool checkCertificateRevocation); + + void Flush (); + + int Read (byte[] buffer, int offset, int count); + + void Write (byte[] buffer); + + void Write (byte[] buffer, int offset, int count); + + IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState); + + int EndRead (IAsyncResult asyncResult); + + IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState); + + void EndWrite (IAsyncResult asyncResult); + + TransportContext TransportContext { + get; + } + + bool IsAuthenticated { + get; + } + + bool IsMutuallyAuthenticated { + get; + } + + bool IsEncrypted { + get; + } + + bool IsSigned { + get; + } + + bool IsServer { + get; + } + + SSA.CipherAlgorithmType CipherAlgorithm { + get; + } + + int CipherStrength { + get; + } + + SSA.HashAlgorithmType HashAlgorithm { + get; + } + + int HashStrength { + get; + } + + SSA.ExchangeAlgorithmType KeyExchangeAlgorithm { + get; + } + + int KeyExchangeStrength { + get; + } + + bool CanRead { + get; + } + + bool CanTimeout { + get; + } + + bool CanWrite { + get; + } + + long Length { + get; + } + + long Position { + get; + } + + void SetLength (long value); + + AuthenticatedStream AuthenticatedStream { + get; + } + + int ReadTimeout { + get; set; + } + + int WriteTimeout { + get; set; + } + + bool CheckCertRevocationStatus { + get; + } + + X509Certificate InternalLocalCertificate { + get; + } + + X509Certificate LocalCertificate { + get; + } + + X509Certificate RemoteCertificate { + get; + } + + SSA.SslProtocols SslProtocol { + get; + } + } +} + diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/MonoSslStream.cs b/mcs/class/Mono.Security/Mono.Security.Interface/MonoSslStream.cs deleted file mode 100644 index 48fc51bf4cc..00000000000 --- a/mcs/class/Mono.Security/Mono.Security.Interface/MonoSslStream.cs +++ /dev/null @@ -1,203 +0,0 @@ -// -// MonoSslStream.cs -// -// Author: -// Martin Baulig -// -// Copyright (c) 2015 Xamarin, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -using System; -using System.IO; -using System.Net; -using System.Net.Security; -using System.Threading.Tasks; -using System.Security.Authentication; -using System.Security.Cryptography.X509Certificates; -using System.Security.Principal; -using System.Security.Cryptography; -using Mono.Net.Security; - -namespace Mono.Security.Interface -{ - public abstract class MonoSslStream : IDisposable - { - public abstract void AuthenticateAsClient (string targetHost); - - public abstract void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation); - - public abstract IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState); - - public abstract IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState); - - public abstract void EndAuthenticateAsClient (IAsyncResult asyncResult); - - public abstract void AuthenticateAsServer (X509Certificate serverCertificate); - - public abstract void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation); - - public abstract IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState); - - public abstract IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState); - - public abstract void EndAuthenticateAsServer (IAsyncResult asyncResult); - - public abstract Task AuthenticateAsClientAsync (string targetHost); - - public abstract Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation); - - public abstract Task AuthenticateAsServerAsync (X509Certificate serverCertificate); - - public abstract Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation); - - public abstract void Flush (); - - public abstract int Read (byte[] buffer, int offset, int count); - - public abstract void Write (byte[] buffer); - - public abstract void Write (byte[] buffer, int offset, int count); - - public abstract IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState); - - public abstract int EndRead (IAsyncResult asyncResult); - - public abstract IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState); - - public abstract void EndWrite (IAsyncResult asyncResult); - - public abstract TransportContext TransportContext { - get; - } - - public abstract bool IsAuthenticated { - get; - } - - public abstract bool IsMutuallyAuthenticated { - get; - } - - public abstract bool IsEncrypted { - get; - } - - public abstract bool IsSigned { - get; - } - - public abstract bool IsServer { - get; - } - - public abstract CipherAlgorithmType CipherAlgorithm { - get; - } - - public abstract int CipherStrength { - get; - } - - public abstract HashAlgorithmType HashAlgorithm { - get; - } - - public abstract int HashStrength { - get; - } - - public abstract ExchangeAlgorithmType KeyExchangeAlgorithm { - get; - } - - public abstract int KeyExchangeStrength { - get; - } - - public abstract bool CanRead { - get; - } - - public abstract bool CanTimeout { - get; - } - - public abstract bool CanWrite { - get; - } - - public abstract long Length { - get; - } - - public abstract long Position { - get; - } - - public abstract void SetLength (long value); - - public abstract AuthenticatedStream AuthenticatedStream { - get; - } - - public abstract int ReadTimeout { - get; set; - } - - public abstract int WriteTimeout { - get; set; - } - - public abstract bool CheckCertRevocationStatus { - get; - } - - public abstract X509Certificate InternalLocalCertificate { - get; - } - - public abstract X509Certificate LocalCertificate { - get; - } - - public abstract X509Certificate RemoteCertificate { - get; - } - - public abstract SslProtocols SslProtocol { - get; - } - - public void Dispose () - { - Dispose (true); - GC.SuppressFinalize (this); - } - - protected virtual void Dispose (bool disposing) - { - } - - ~MonoSslStream () - { - Dispose (false); - } - } -} - diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsConnectionInfo.cs b/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsConnectionInfo.cs index 46501fb9b30..4bc5f436f45 100644 --- a/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsConnectionInfo.cs +++ b/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsConnectionInfo.cs @@ -24,20 +24,35 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; namespace Mono.Security.Interface { public class MonoTlsConnectionInfo { - public short CipherSuiteCode { + public CipherSuiteCode CipherSuiteCode { get; set; } public TlsProtocols ProtocolVersion { get; set; } + + public CipherAlgorithmType CipherAlgorithmType { + get; set; + } + + public HashAlgorithmType HashAlgorithmType { + get; set; + } + + public ExchangeAlgorithmType ExchangeAlgorithmType { + get; set; + } + + public override string ToString () + { + return string.Format ("[MonoTlsConnectionInfo: {0}:{1}]", ProtocolVersion, CipherSuiteCode); + } } } diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs b/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs index dc81e862f2f..b1daa60e1fc 100644 --- a/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs +++ b/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs @@ -72,6 +72,14 @@ namespace Mono.Security.Interface public abstract class MonoTlsProvider { + public abstract Guid ID { + get; + } + + public abstract string Name { + get; + } + #region SslStream /* @@ -96,10 +104,10 @@ namespace Mono.Security.Interface } /* - * Obtain a @MonoSslStream instance. + * Obtain a @IMonoSslStream instance. * */ - public abstract MonoSslStream CreateSslStream ( + public abstract IMonoSslStream CreateSslStream ( Stream innerStream, bool leaveInnerStreamOpen, MonoTlsSettings settings = null); diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsSettings.cs b/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsSettings.cs index 802f78f0aa1..afa21ff1deb 100644 --- a/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsSettings.cs +++ b/mcs/class/Mono.Security/Mono.Security.Interface/MonoTlsSettings.cs @@ -24,6 +24,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; +using System.Threading; using System.Security.Cryptography.X509Certificates; namespace Mono.Security.Interface @@ -93,6 +94,24 @@ namespace Mono.Security.Interface { } + volatile static MonoTlsSettings defaultSettings; + + public static MonoTlsSettings DefaultSettings { + get { + if (defaultSettings == null) + Interlocked.CompareExchange (ref defaultSettings, new MonoTlsSettings (), null); + return defaultSettings; + } + set { + defaultSettings = value ?? new MonoTlsSettings (); + } + } + + public static MonoTlsSettings CopyDefaultSettings () + { + return DefaultSettings.Clone (); + } + #region Private APIs /* @@ -120,6 +139,11 @@ namespace Mono.Security.Interface return copy; } + public MonoTlsSettings Clone () + { + return new MonoTlsSettings (this); + } + MonoTlsSettings (MonoTlsSettings other) { RemoteCertificateValidationCallback = other.RemoteCertificateValidationCallback; diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/TlsException.cs b/mcs/class/Mono.Security/Mono.Security.Interface/TlsException.cs new file mode 100644 index 00000000000..fabf4ee30c0 --- /dev/null +++ b/mcs/class/Mono.Security/Mono.Security.Interface/TlsException.cs @@ -0,0 +1,84 @@ +// +// TlsException.cs +// +// Author: +// Martin Baulig +// +// Copyright (c) 2015 Xamarin, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Text; +using System.Runtime.Serialization; + +namespace Mono.Security.Interface +{ + public sealed class TlsException : Exception + { + #region Fields + + private Alert alert; + + #endregion + + #region Properties + + public Alert Alert { + get { return this.alert; } + } + + #endregion + + #region Constructors + + public TlsException (Alert alert) + : this (alert, alert.Description.ToString()) + { + } + + public TlsException (Alert alert, string message) + : base (message) + { + this.alert = alert; + } + + public TlsException (AlertLevel level, AlertDescription description) + : this (new Alert (level, description)) + { + } + + public TlsException (AlertDescription description) + : this (new Alert (description)) + { + } + + public TlsException (AlertDescription description, string message) + : this (new Alert (description), message) + { + } + + public TlsException (AlertDescription description, string format, params object[] args) + : this (new Alert (description), string.Format (format, args)) + { + } + + #endregion + } +} diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/TlsProtocolCode.cs b/mcs/class/Mono.Security/Mono.Security.Interface/TlsProtocolCode.cs new file mode 100644 index 00000000000..e5a8e09eb9b --- /dev/null +++ b/mcs/class/Mono.Security/Mono.Security.Interface/TlsProtocolCode.cs @@ -0,0 +1,38 @@ +// +// TlsProtocolCode.cs +// +// Author: +// Martin Baulig +// +// Copyright (c) 2015 Xamarin, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +namespace Mono.Security.Interface +{ + public enum TlsProtocolCode : short + { + Tls10 = 0x301, + Tls11 = 0x302, + Tls12 = 0x303 + } +} + diff --git a/mcs/class/Mono.Security/Mono.Security.Interface/TlsProtocols.cs b/mcs/class/Mono.Security/Mono.Security.Interface/TlsProtocols.cs index d3ef9d76b25..614a25a98ad 100644 --- a/mcs/class/Mono.Security/Mono.Security.Interface/TlsProtocols.cs +++ b/mcs/class/Mono.Security/Mono.Security.Interface/TlsProtocols.cs @@ -1,3 +1,29 @@ +// +// TlsProtocols.cs +// +// Author: +// Martin Baulig +// +// Copyright (c) 2015 Xamarin, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + using System; namespace Mono.Security.Interface diff --git a/mcs/class/Mono.Security/Mono.Security.dll.sources b/mcs/class/Mono.Security/Mono.Security.dll.sources index 3847d8d3ce3..7d6e4aaca19 100644 --- a/mcs/class/Mono.Security/Mono.Security.dll.sources +++ b/mcs/class/Mono.Security/Mono.Security.dll.sources @@ -135,13 +135,20 @@ ./Mono.Xml/MiniParser.cs ./Mono.Xml/SecurityParser.cs +./Mono.Security.Interface/Alert.cs ./Mono.Security.Interface/CertificateValidationHelper.cs +./Mono.Security.Interface/CipherAlgorithmType.cs +./Mono.Security.Interface/CipherSuiteCode.cs +./Mono.Security.Interface/ExchangeAlgorithmType.cs +./Mono.Security.Interface/HashAlgorithmType.cs ./Mono.Security.Interface/IBufferOffsetSize.cs ./Mono.Security.Interface/IMonoTlsEventSink.cs ./Mono.Security.Interface/IMonoTlsContext.cs -./Mono.Security.Interface/MonoSslStream.cs +./Mono.Security.Interface/IMonoSslStream.cs ./Mono.Security.Interface/MonoTlsConnectionInfo.cs ./Mono.Security.Interface/MonoTlsProvider.cs ./Mono.Security.Interface/MonoTlsProviderFactory.cs ./Mono.Security.Interface/MonoTlsSettings.cs +./Mono.Security.Interface/TlsException.cs +./Mono.Security.Interface/TlsProtocolCode.cs ./Mono.Security.Interface/TlsProtocols.cs diff --git a/mcs/class/Mono.Security/xammac_Mono.Security.dll.sources b/mcs/class/Mono.Security/xammac_Mono.Security.dll.sources index c0e5f667dbb..4c67ff62a13 100644 --- a/mcs/class/Mono.Security/xammac_Mono.Security.dll.sources +++ b/mcs/class/Mono.Security/xammac_Mono.Security.dll.sources @@ -1,11 +1,18 @@ #include monotouch_Mono.Security.dll.sources +./Mono.Security.Interface/Alert.cs +./Mono.Security.Interface/CipherAlgorithmType.cs +./Mono.Security.Interface/CipherSuiteCode.cs +./Mono.Security.Interface/ExchangeAlgorithmType.cs +./Mono.Security.Interface/HashAlgorithmType.cs ./Mono.Security.Interface/IBufferOffsetSize.cs ./Mono.Security.Interface/IMonoTlsEventSink.cs ./Mono.Security.Interface/IMonoTlsContext.cs -./Mono.Security.Interface/MonoSslStream.cs +./Mono.Security.Interface/IMonoSslStream.cs ./Mono.Security.Interface/MonoTlsConnectionInfo.cs ./Mono.Security.Interface/MonoTlsProvider.cs ./Mono.Security.Interface/MonoTlsProviderFactory.cs ./Mono.Security.Interface/MonoTlsSettings.cs +./Mono.Security.Interface/TlsException.cs +./Mono.Security.Interface/TlsProtocolCode.cs ./Mono.Security.Interface/TlsProtocols.cs diff --git a/mcs/class/Mono.Simd/Mono.Simd-net_4_5.csproj b/mcs/class/Mono.Simd/Mono.Simd-net_4_5.csproj deleted file mode 100644 index 267cff65626..00000000000 --- a/mcs/class/Mono.Simd/Mono.Simd-net_4_5.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DA829B50-E4EF-40B3-9156-F1CB488D1D73} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - Mono.Simd - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.Tasklets/Mono.Tasklets-net_4_5.csproj b/mcs/class/Mono.Tasklets/Mono.Tasklets-net_4_5.csproj deleted file mode 100644 index 0f1cac01080..00000000000 --- a/mcs/class/Mono.Tasklets/Mono.Tasklets-net_4_5.csproj +++ /dev/null @@ -1,84 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {03182F0E-A8A9-42FE-B4BD-915B16DF8B16} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Mono.Tasklets - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.WebBrowser/Mono.WebBrowser-net_4_5.csproj b/mcs/class/Mono.WebBrowser/Mono.WebBrowser-net_4_5.csproj deleted file mode 100644 index 1ef082ee5f0..00000000000 --- a/mcs/class/Mono.WebBrowser/Mono.WebBrowser-net_4_5.csproj +++ /dev/null @@ -1,241 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1D660912-8164-4499-A2D7-A3B2FE742E17} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Mono.WebBrowser - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-net_4_5.csproj b/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-net_4_5.csproj deleted file mode 100644 index b1dbdd2b49b..00000000000 --- a/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-net_4_5.csproj +++ /dev/null @@ -1,103 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {73FB1B7E-09F9-4E7F-A63A-C407A93BCA59} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Mono.XBuild.Tasks - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - - - - - diff --git a/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-tests-net_4_5.csproj b/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-tests-net_4_5.csproj deleted file mode 100644 index d088f091cdc..00000000000 --- a/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-tests-net_4_5.csproj +++ /dev/null @@ -1,81 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2A967FCC-19E4-407D-9187-9D2126768B18} - Library - 1699 - bin\Debug\Mono.XBuild.Tasks-tests-net_4_5 - True - False - - Properties - - - Mono.XBuild.Tasks_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {73FB1B7E-09F9-4E7F-A63A-C407A93BCA59} - Mono.XBuild.Tasks\Mono.XBuild.Tasks-net_4_5 - - - - - - - diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-net_4_5.csproj b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-net_4_5.csproj deleted file mode 100644 index 21a258b0437..00000000000 --- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-net_4_5.csproj +++ /dev/null @@ -1,317 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E6070FFA-2CBA-4C24-99C1-63A4F5052821} - Library - 1699,612 - ./../../class/lib/net_4_5 - True - True - - Properties - - - Novell.Directory.Ldap - v4.5 - 512 - - - - true - full - 1699,612 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,612 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D68D4FED-CA32-4800-A628-58BAE485562C} - Mono.Security-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D68D4FED-CA32-4800-A628-58BAE485562C} - Mono.Security-net_4_5 - - - - - - - - ResultCodeMessages.resources - - - - diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-tests-net_4_5.csproj b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-tests-net_4_5.csproj deleted file mode 100644 index 8c4f23a6d6b..00000000000 --- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-tests-net_4_5.csproj +++ /dev/null @@ -1,81 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE523013-EA6C-449D-B2F2-3414EDFB4406} - Library - 1699 - bin\Debug\Novell.Directory.Ldap-tests-net_4_5 - True - False - - Properties - - - Novell.Directory.Ldap_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {E6070FFA-2CBA-4C24-99C1-63A4F5052821} - Novell.Directory.Ldap\Novell.Directory.Ldap-net_4_5 - - - - - - - diff --git a/mcs/class/PEAPI/PEAPI-net_4_5.csproj b/mcs/class/PEAPI/PEAPI-net_4_5.csproj deleted file mode 100644 index 1af9fa8f70b..00000000000 --- a/mcs/class/PEAPI/PEAPI-net_4_5.csproj +++ /dev/null @@ -1,90 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {127B367D-2E2C-4F7F-A13E-0F7307D96F2D} - Library - 1699,414,618 - ./../../class/lib/net_4_5 - True - True - - Properties - - - PEAPI - v4.5 - 512 - - - - true - full - 1699,414,618 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,414,618 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/RabbitMQ.Client/src/apigen/RabbitMQ.Client.Apigen-net_4_5.csproj b/mcs/class/RabbitMQ.Client/src/apigen/RabbitMQ.Client.Apigen-net_4_5.csproj deleted file mode 100644 index 170672aa23e..00000000000 --- a/mcs/class/RabbitMQ.Client/src/apigen/RabbitMQ.Client.Apigen-net_4_5.csproj +++ /dev/null @@ -1,108 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {71FBB832-7D96-4B79-A7F6-CCC43FE70291} - Library - 1699 - ./../../../../class/lib/net_4_5 - True - True - - Properties - - - RabbitMQ.Client.Apigen - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - diff --git a/mcs/class/RabbitMQ.Client/src/client/RabbitMQ.Client-net_4_5.csproj b/mcs/class/RabbitMQ.Client/src/client/RabbitMQ.Client-net_4_5.csproj deleted file mode 100644 index 02d97bea155..00000000000 --- a/mcs/class/RabbitMQ.Client/src/client/RabbitMQ.Client-net_4_5.csproj +++ /dev/null @@ -1,216 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {55AA0C89-63D9-438E-A139-3ED9F72AE295} - Library - 1699,618 - ./../../../../class/lib/net_4_5 - True - True - - Properties - - - RabbitMQ.Client - v4.5 - 512 - - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,618 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - - - - - diff --git a/mcs/class/System.ComponentModel.Composition.4.5/System.ComponentModel.Composition-net_4_5.csproj b/mcs/class/System.ComponentModel.Composition.4.5/System.ComponentModel.Composition-net_4_5.csproj deleted file mode 100644 index 55921ab322b..00000000000 --- a/mcs/class/System.ComponentModel.Composition.4.5/System.ComponentModel.Composition-net_4_5.csproj +++ /dev/null @@ -1,268 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {81352E26-6AB7-4AA3-8FB1-28A476E82748} - Library - 1699,219,414 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.ComponentModel.Composition - v4.5 - 512 - - - - true - full - 1699,219,414 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;CLR40;USE_ECMA_KEY;FEATURE_REFLECTIONCONTEXT;FEATURE_REFLECTIONFILEIO;FEATURE_SERIALIZATION;FEATURE_SLIMLOCK - prompt - 4 - - - pdbonly - 1699,219,414 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;CLR40;USE_ECMA_KEY;FEATURE_REFLECTIONCONTEXT;FEATURE_REFLECTIONFILEIO;FEATURE_SERIALIZATION;FEATURE_SLIMLOCK - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - - Microsoft.Internal.Strings.resources - - - - diff --git a/mcs/class/System.ComponentModel.DataAnnotations/DataAnnotationsResources.cs b/mcs/class/System.ComponentModel.DataAnnotations/DataAnnotationsResources.cs index 2427cdd39ae..ed196f9e643 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/DataAnnotationsResources.cs +++ b/mcs/class/System.ComponentModel.DataAnnotations/DataAnnotationsResources.cs @@ -3,57 +3,57 @@ namespace System.ComponentModel.DataAnnotations.Resources static class DataAnnotationsResources { public const string ArgumentIsNullOrWhitespace = "The argument '{0}' cannot be null, empty or contain only white space."; - public const string AssociatedMetadataTypeTypeDescriptor_MetadataTypeContainsUnknownProperties = "AssociatedMetadataTypeTypeDescriptor_MetadataTypeContainsUnknownProperties"; - public const string AttributeStore_Unknown_Property = "AttributeStore_Unknown_Property"; - public const string Common_PropertyNotFound = "Common_PropertyNotFound"; + public const string AssociatedMetadataTypeTypeDescriptor_MetadataTypeContainsUnknownProperties = "The associated metadata type for type '{0}' contains the following unknown properties or fields: {1}. Please make sure that the names of these members match the names of the properties on the main type."; + public const string AttributeStore_Unknown_Property = "The type '{0}' does not contain a public property named '{1}'."; + public const string Common_PropertyNotFound = "The property {0}.{1} could not be found."; public const string CompareAttribute_MustMatch = "'{0}' and '{1}' do not match."; - public const string CompareAttribute_UnknownProperty = "CompareAttribute_UnknownProperty"; - public const string CreditCardAttribute_Invalid = "CreditCardAttribute_Invalid"; - public const string CustomValidationAttribute_Method_Must_Return_ValidationResult = "CustomValidationAttribute_Method_Must_Return_ValidationResult"; - public const string CustomValidationAttribute_Method_Not_Found = "CustomValidationAttribute_Method_Not_Found"; - public const string CustomValidationAttribute_Method_Required = "CustomValidationAttribute_Method_Required"; - public const string CustomValidationAttribute_Method_Signature = "CustomValidationAttribute_Method_Signature"; - public const string CustomValidationAttribute_Type_Conversion_Failed = "CustomValidationAttribute_Type_Conversion_Failed"; - public const string CustomValidationAttribute_Type_Must_Be_Public = "CustomValidationAttribute_Type_Must_Be_Public"; + public const string CompareAttribute_UnknownProperty = "Could not find a property named {0}."; + public const string CreditCardAttribute_Invalid = "The {0} field is not a valid credit card number."; + public const string CustomValidationAttribute_Method_Must_Return_ValidationResult = "The CustomValidationAttribute method '{0}' in type '{1}' must return System.ComponentModel.DataAnnotations.ValidationResult. Use System.ComponentModel.DataAnnotations.ValidationResult.Success to represent success."; + public const string CustomValidationAttribute_Method_Not_Found = "The CustomValidationAttribute method '{0}' does not exist in type '{1}' or is not public and static."; + public const string CustomValidationAttribute_Method_Required = "The CustomValidationAttribute.Method was not specified."; + public const string CustomValidationAttribute_Method_Signature = "The CustomValidationAttribute method '{0}' in type '{1}' must match the expected signature: public static ValidationResult {0}(object value, ValidationContext context). The value can be strongly typed. The ValidationContext parameter is optional."; + public const string CustomValidationAttribute_Type_Conversion_Failed = "Could not convert the value of type '{0}' to '{1}' as expected by method {2}.{3}."; + public const string CustomValidationAttribute_Type_Must_Be_Public = "The custom validation type '{0}' must be public."; public const string CustomValidationAttribute_ValidationError = "{0} is not valid."; - public const string CustomValidationAttribute_ValidatorType_Required = "CustomValidationAttribute_ValidatorType_Required"; - public const string DataTypeAttribute_EmptyDataTypeString = "DataTypeAttribute_EmptyDataTypeString"; + public const string CustomValidationAttribute_ValidatorType_Required = "The CustomValidationAttribute.ValidatorType was not specified."; + public const string DataTypeAttribute_EmptyDataTypeString = "The custom DataType string cannot be null or empty."; public const string DisplayAttribute_PropertyNotSet = "The {0} property has not been set. Use the {1} method to get the value."; - public const string EmailAddressAttribute_Invalid = "The {0} field is not a valid email address"; - public const string EnumDataTypeAttribute_TypeCannotBeNull = "EnumDataTypeAttribute_TypeCannotBeNull"; - public const string EnumDataTypeAttribute_TypeNeedsToBeAnEnum = "EnumDataTypeAttribute_TypeNeedsToBeAnEnum"; - public const string FileExtensionsAttribute_Invalid = "FileExtensionsAttribute_Invalid"; - public const string LocalizableString_LocalizationFailed = "Cannot retrieve property '{0}' because localization failed. Type '{1}' is not public or does not contain a public static string property with the name '{2}'."; + public const string EmailAddressAttribute_Invalid = "The {0} field is not a valid e-mail address."; + public const string EnumDataTypeAttribute_TypeCannotBeNull = "The type provided for EnumDataTypeAttribute cannot be null."; + public const string EnumDataTypeAttribute_TypeNeedsToBeAnEnum = "The type '{0}' needs to represent an enumeration type."; + public const string FileExtensionsAttribute_Invalid = "The {0} field only accepts files with the following extensions: {1}"; + public const string LocalizableString_LocalizationFailed = "Cannot retrieve property '{0}' because localization failed. Type '{1}' is not public or does not contain a public static string property with the name '{2}'."; public const string MaxLengthAttribute_InvalidMaxLength = "MaxLengthAttribute must have a Length value that is greater than zero. Use MaxLength() without parameters to indicate that the string or array can have the maximum allowable length."; public const string MaxLengthAttribute_ValidationError = "The field {0} must be a string or array type with a maximum length of '{1}'."; - public const string MetadataTypeAttribute_TypeCannotBeNull = "MetadataTypeAttribute_TypeCannotBeNull"; + public const string MetadataTypeAttribute_TypeCannotBeNull = "MetadataClassType cannot be null."; public const string MinLengthAttribute_InvalidMinLength = "MinLengthAttribute must have a Length value that is zero or greater."; - public const string MinLengthAttribute_ValidationError = "The field {0} must be a string or array type with a minimum length of '{1}'"; - public const string PhoneAttribute_Invalid = "PhoneAttribute_Invalid"; - public const string RangeAttribute_ArbitraryTypeNotIComparable = "RangeAttribute_ArbitraryTypeNotIComparable"; - public const string RangeAttribute_MinGreaterThanMax = "RangeAttribute_MinGreaterThanMax"; - public const string RangeAttribute_Must_Set_Min_And_Max = "RangeAttribute_Must_Set_Min_And_Max"; - public const string RangeAttribute_Must_Set_Operand_Type = "RangeAttribute_Must_Set_Operand_Type"; + public const string MinLengthAttribute_ValidationError = "The field {0} must be a string or array type with a minimum length of '{1}'."; + public const string PhoneAttribute_Invalid = "The {0} field is not a valid phone number."; + public const string RangeAttribute_ArbitraryTypeNotIComparable = "The type {0} must implement {1}."; + public const string RangeAttribute_MinGreaterThanMax = "The maximum value '{0}' must be greater than or equal to the minimum value '{1}'."; + public const string RangeAttribute_Must_Set_Min_And_Max = "The minimum and maximum values must be set."; + public const string RangeAttribute_Must_Set_Operand_Type = "The OperandType must be set when strings are used for minimum and maximum values."; public const string RangeAttribute_ValidationError = "The field {0} must be between {1} and {2}."; - public const string RegexAttribute_ValidationError = "The field {0} must match the regular expression {1}."; + public const string RegexAttribute_ValidationError = "The field {0} must match the regular expression '{1}'."; public const string RegularExpressionAttribute_Empty_Pattern = "The pattern must be set to a valid regular expression."; public const string RequiredAttribute_ValidationError = "The {0} field is required."; - public const string StringLengthAttribute_InvalidMaxLength = "StringLengthAttribute_InvalidMaxLength"; + public const string StringLengthAttribute_InvalidMaxLength = "The maximum length must be a nonnegative integer."; public const string StringLengthAttribute_ValidationError = "The field {0} must be a string with a maximum length of {1}."; - public const string StringLengthAttribute_ValidationErrorIncludingMinimum = "StringLengthAttribute_ValidationErrorIncludingMinimum"; - public const string UIHintImplementation_ControlParameterKeyIsNotAString = "UIHintImplementation_ControlParameterKeyIsNotAString"; - public const string UIHintImplementation_ControlParameterKeyIsNull = "UIHintImplementation_ControlParameterKeyIsNull"; - public const string UIHintImplementation_ControlParameterKeyOccursMoreThanOnce = "UIHintImplementation_ControlParameterKeyOccursMoreThanOnce"; - public const string UIHintImplementation_NeedEvenNumberOfControlParameters = "UIHintImplementation_NeedEvenNumberOfControlParameters"; - public const string UrlAttribute_Invalid = "UrlAttribute_Invalid"; - public const string ValidationAttribute_Cannot_Set_ErrorMessage_And_Resource = "ValidationAttribute_Cannot_Set_ErrorMessage_And_Resource"; - public const string ValidationAttribute_IsValid_NotImplemented = "ValidationAttribute_IsValid_NotImplemented"; - public const string ValidationAttribute_NeedBothResourceTypeAndResourceName = "ValidationAttribute_NeedBothResourceTypeAndResourceName"; - public const string ValidationAttribute_ResourcePropertyNotStringType = "ValidationAttribute_ResourcePropertyNotStringType"; - public const string ValidationAttribute_ResourceTypeDoesNotHaveProperty = "ValidationAttribute_ResourceTypeDoesNotHaveProperty"; + public const string StringLengthAttribute_ValidationErrorIncludingMinimum = "The field {0} must be a string with a minimum length of {2} and a maximum length of {1}."; + public const string UIHintImplementation_ControlParameterKeyIsNotAString = "The key parameter at position {0} with value '{1}' is not a string. Every key control parameter must be a string."; + public const string UIHintImplementation_ControlParameterKeyIsNull = "The key parameter at position {0} is null. Every key control parameter must be a string."; + public const string UIHintImplementation_ControlParameterKeyOccursMoreThanOnce = "The key parameter at position {0} with value '{1}' occurs more than once."; + public const string UIHintImplementation_NeedEvenNumberOfControlParameters = "The number of control parameters must be even."; + public const string UrlAttribute_Invalid = "The {0} field is not a valid fully-qualified http, https, or ftp URL."; + public const string ValidationAttribute_Cannot_Set_ErrorMessage_And_Resource = "Either ErrorMessageString or ErrorMessageResourceName must be set, but not both."; + public const string ValidationAttribute_IsValid_NotImplemented = "IsValid(object value) has not been implemented by this class. The preferred entry point is GetValidationResult() and classes should override IsValid(object value, ValidationContext context)."; + public const string ValidationAttribute_NeedBothResourceTypeAndResourceName = "Both ErrorMessageResourceType and ErrorMessageResourceName need to be set on this attribute."; + public const string ValidationAttribute_ResourcePropertyNotStringType = "The property '{0}' on resource type '{1}' is not a string type."; + public const string ValidationAttribute_ResourceTypeDoesNotHaveProperty = "The resource type '{0}' does not have an accessible static property named '{1}'."; public const string ValidationAttribute_ValidationError = "The field {0} is invalid."; - public const string ValidationContextServiceContainer_ItemAlreadyExists = "ValidationContextServiceContainer_ItemAlreadyExists"; - public const string Validator_InstanceMustMatchValidationContextInstance = "Validator_InstanceMustMatchValidationContextInstance"; - public const string Validator_Property_Value_Wrong_Type = "Validator_Property_Value_Wrong_Type"; + public const string ValidationContextServiceContainer_ItemAlreadyExists = "A service of type '{0}' already exists in the container."; + public const string Validator_InstanceMustMatchValidationContextInstance = "The instance provided must match the ObjectInstance on the ValidationContext supplied."; + public const string Validator_Property_Value_Wrong_Type = "The value for property '{0}' must be of type '{1}'."; } } diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-net_4_5.csproj b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-net_4_5.csproj deleted file mode 100644 index ff8fad57748..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-net_4_5.csproj +++ /dev/null @@ -1,147 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {63EC4158-FFAC-4867-8003-CF6054C8DF0B} - Library - 1699,414 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.ComponentModel.DataAnnotations - v4.5 - 512 - - - - true - full - 1699,414 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,414 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - - - - - diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-tests-net_4_5.csproj b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-tests-net_4_5.csproj deleted file mode 100644 index 30eddfaf2ad..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-tests-net_4_5.csproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D3974636-0E65-4A2C-9FA8-118264995BC1} - Library - 1699 - bin\Debug\System.ComponentModel.DataAnnotations-tests-net_4_5 - True - False - - Properties - - - System.ComponentModel.DataAnnotations_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {63EC4158-FFAC-4867-8003-CF6054C8DF0B} - System.ComponentModel.DataAnnotations\System.ComponentModel.DataAnnotations-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data\System.Data-net_4_5 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - - - - - diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.dll.sources b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.dll.sources index 9bcea0403eb..ddebaf5f6d7 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.dll.sources +++ b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.dll.sources @@ -1,5 +1,6 @@ ../../build/common/Consts.cs Assembly/AssemblyInfo.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/AppSettings.cs ../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/AssociatedMetadataTypeTypeDescriptionProvider.cs ../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs ../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/AssociationAttribute.cs diff --git a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/DisplayAttributeTest.cs b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/DisplayAttributeTest.cs index c9db2ac448d..5096568c169 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/DisplayAttributeTest.cs +++ b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/DisplayAttributeTest.cs @@ -70,7 +70,7 @@ namespace MonoTests.System.ComponentModel.DataAnnotations public class DisplayAttributeTests { const string property_not_set_message = "The {0} property has not been set. Use the Get{0} method to get the value."; - const string localization_failed_message = "Cannot retrieve property '{0}' because localization failed. Type '{1}' is not public or does not contain a public static string property with the name '{2}'."; + const string localization_failed_message = "Cannot retrieve property '{0}' because localization failed. Type '{1}' is not public or does not contain a public static string property with the name '{2}'."; [Test] public void StringProperties_ReturnLiteralValues_Success() diff --git a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/RegularExpressionAttributeTest.cs b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/RegularExpressionAttributeTest.cs index 2462517cffa..bb9852e1fc9 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/RegularExpressionAttributeTest.cs +++ b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/RegularExpressionAttributeTest.cs @@ -56,7 +56,7 @@ namespace MonoTests.System.ComponentModel.DataAnnotations var rea = new RegularExpressionAttributePoker (@"[A-Za-z]"); Assert.AreEqual (@"[A-Za-z]", rea.Pattern, "Patterns not saved correctly."); Assert.AreEqual (null, rea.ErrorMessage, "Error message not null when not yet matched."); - Assert.AreEqual ("The field {0} must match the regular expression {1}.", rea.GetErrorMessageString (), "Error message not valid."); + Assert.AreEqual ("The field {0} must match the regular expression '{1}'.", rea.GetErrorMessageString (), "Error message not valid."); } [Test] @@ -64,7 +64,7 @@ namespace MonoTests.System.ComponentModel.DataAnnotations { var rea = new RegularExpressionAttributePoker (@"[A-Za-z]"); - Assert.AreEqual ("The field MyField must match the regular expression [A-Za-z].", + Assert.AreEqual ("The field MyField must match the regular expression '[A-Za-z]'.", rea.FormatErrorMessage ("MyField"), "Error message not correctly formatted."); diff --git a/mcs/class/System.Configuration.Install/System.Configuration.Install-net_4_5.csproj b/mcs/class/System.Configuration.Install/System.Configuration.Install-net_4_5.csproj deleted file mode 100644 index 270a0e237bc..00000000000 --- a/mcs/class/System.Configuration.Install/System.Configuration.Install-net_4_5.csproj +++ /dev/null @@ -1,106 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E6E1740E-37DD-487C-8947-F1C0612D4738} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Configuration.Install - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - - - - - diff --git a/mcs/class/System.Configuration/System.Configuration-net_4_5.csproj b/mcs/class/System.Configuration/System.Configuration-net_4_5.csproj deleted file mode 100644 index 9b52ce25688..00000000000 --- a/mcs/class/System.Configuration/System.Configuration-net_4_5.csproj +++ /dev/null @@ -1,213 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - Library - 1699,618 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Configuration - v4.5 - 512 - - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,618 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {46F151F2-A422-4A1B-9D29-2E148CE73629} - System-secxml-net_4_5 - - - {21FB091E-0F84-479E-AB16-6503D36852F9} - System.Xml-bare-net_4_5 - - - {B55E59B2-31CA-438B-ADB8-4B9A9A547830} - System.Security-net_4_5 - - - - - - - diff --git a/mcs/class/System.Configuration/System.Configuration-tests-net_4_5.csproj b/mcs/class/System.Configuration/System.Configuration-tests-net_4_5.csproj deleted file mode 100644 index 2ff30ccd8a8..00000000000 --- a/mcs/class/System.Configuration/System.Configuration-tests-net_4_5.csproj +++ /dev/null @@ -1,130 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9A11832B-834C-4518-98E3-0E301CAD589D} - Library - 1699,618 - bin\Debug\System.Configuration-tests-net_4_5 - True - False - - Properties - - - System.Configuration_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration\System.Configuration-net_4_5 - - - {6822DF7D-F859-4F02-9946-F138AA756A0E} - System\System-net_4_5-1 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.XML\System.Xml-net_4_5 - - - {B55E59B2-31CA-438B-ADB8-4B9A9A547830} - System.Security\System.Security-net_4_5 - - - - - - - diff --git a/mcs/class/System.Core/ReferenceSources/SR.cs b/mcs/class/System.Core/ReferenceSources/SR.cs index c52050141f7..e38c5a16763 100644 --- a/mcs/class/System.Core/ReferenceSources/SR.cs +++ b/mcs/class/System.Core/ReferenceSources/SR.cs @@ -100,8 +100,10 @@ partial class SR public const string Cryptography_UnknownEllipticCurve = "Cryptography_UnknownEllipticCurve"; public const string Cryptography_UnknownEllipticCurveAlgorithm = "Cryptography_UnknownEllipticCurveAlgorithm"; public const string Cryptography_UnknownPaddingMode = "Cryptography_UnknownPaddingMode"; + public const string Cryptography_HashAlgorithmNameNullOrEmpty = "Cryptography_HashAlgorithmNameNullOrEmpty"; public const string InvalidOperation_ViewIsNull = "InvalidOperation_ViewIsNull"; public const string ObjectDisposed_ViewAccessorClosed = "ObjectDisposed_ViewAccessorClosed"; public const string NotSupported_MMViewStreamsFixedLength = "NotSupported_MMViewStreamsFixedLength"; + public const string NotSupported_SubclassOverride = "NotSupported_SubclassOverride"; } diff --git a/mcs/class/System.Core/System.Core-net_4_5.csproj b/mcs/class/System.Core/System.Core-net_4_5.csproj deleted file mode 100644 index 2b21409d0c5..00000000000 --- a/mcs/class/System.Core/System.Core-net_4_5.csproj +++ /dev/null @@ -1,407 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - Library - 1699,1720 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - System.Core - v4.5 - 512 - - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;FEATURE_PAL;PFX_LEGACY_3_5;FEATURE_NETCORE;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;FEATURE_PAL;PFX_LEGACY_3_5;FEATURE_NETCORE;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {85A9B29B-58FF-4FBE-8998-B0A89AC22880} - Mono.Posix-net_4_5 - - - - - - - diff --git a/mcs/class/System.Core/System.Core-net_4_x.csproj b/mcs/class/System.Core/System.Core-net_4_x.csproj index 27c7975c9a9..f789945f01b 100644 --- a/mcs/class/System.Core/System.Core-net_4_x.csproj +++ b/mcs/class/System.Core/System.Core-net_4_x.csproj @@ -47,6 +47,8 @@ + + @@ -257,7 +259,6 @@ - diff --git a/mcs/class/System.Core/System.Core-plaincore-net_4_5.csproj b/mcs/class/System.Core/System.Core-plaincore-net_4_5.csproj deleted file mode 100644 index fb9f1488758..00000000000 --- a/mcs/class/System.Core/System.Core-plaincore-net_4_5.csproj +++ /dev/null @@ -1,407 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7503D2B9-9ABB-451B-9193-08223A29603F} - Library - 1699,1720 - ./../../class/lib/net_4_5/plaincore - True - True - true - Properties - - - System.Core - v4.5 - 512 - - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;FEATURE_PAL;PFX_LEGACY_3_5;FEATURE_NETCORE;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;FEATURE_PAL;PFX_LEGACY_3_5;FEATURE_NETCORE;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {85A9B29B-58FF-4FBE-8998-B0A89AC22880} - Mono.Posix-net_4_5 - - - - - - - diff --git a/mcs/class/System.Core/System.Core-plaincore-net_4_x.csproj b/mcs/class/System.Core/System.Core-plaincore-net_4_x.csproj index 8e4141ca05c..ef334979b34 100644 --- a/mcs/class/System.Core/System.Core-plaincore-net_4_x.csproj +++ b/mcs/class/System.Core/System.Core-plaincore-net_4_x.csproj @@ -47,6 +47,8 @@ + + @@ -257,7 +259,6 @@ - diff --git a/mcs/class/System.Core/System.Core-tests-net_4_5.csproj b/mcs/class/System.Core/System.Core-tests-net_4_5.csproj deleted file mode 100644 index c4764d936e8..00000000000 --- a/mcs/class/System.Core/System.Core-tests-net_4_5.csproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A4B33044-86DB-4146-8588-1F9400124B85} - Library - 1699,1720 - bin\Debug\System.Core-tests-net_4_5 - True - False - true - Properties - - - System.Core_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System\System-net_4_5 - - - {85A9B29B-58FF-4FBE-8998-B0A89AC22880} - Mono.Posix\Mono.Posix-net_4_5 - - - - - - - diff --git a/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-net_4_5.csproj b/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-net_4_5.csproj deleted file mode 100644 index 2f317757ba6..00000000000 --- a/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-net_4_5.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9D2DBCBA-6C1E-405B-BCBA-20406EA9501F} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Data.DataSetExtensions - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - - - - - diff --git a/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-tests-net_4_5.csproj b/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-tests-net_4_5.csproj deleted file mode 100644 index 53fc2d1dd8a..00000000000 --- a/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-tests-net_4_5.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {11D5C200-2AF3-49AD-8F72-2E239EB9D5D7} - Library - 1699,219,169 - bin\Debug\System.Data.DataSetExtensions-tests-net_4_5 - True - False - - Properties - - - System.Data.DataSetExtensions_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699,219,169 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {9D2DBCBA-6C1E-405B-BCBA-20406EA9501F} - System.Data.DataSetExtensions\System.Data.DataSetExtensions-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data\System.Data-net_4_5 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {85F119B8-8463-4D6F-9852-DAB8C4070BD5} - System.Web\System.Web-net_4_5-1 - - - - - - - diff --git a/mcs/class/System.Data.Entity/System.Data.Entity-net_4_5.csproj b/mcs/class/System.Data.Entity/System.Data.Entity-net_4_5.csproj deleted file mode 100644 index a4413093251..00000000000 --- a/mcs/class/System.Data.Entity/System.Data.Entity-net_4_5.csproj +++ /dev/null @@ -1,840 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E902CD82-23AC-456B-9F4B-51CC193275F8} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Data.Entity - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {8328796E-8A15-4972-8F1E-2F15E7D57C42} - System.Xml.Linq-net_4_5 - - - {AF2BBF50-AB57-4CA1-8EF5-2B54C7418434} - System.Transactions-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization-net_4_5 - - - {63EC4158-FFAC-4867-8003-CF6054C8DF0B} - System.ComponentModel.DataAnnotations-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - - - - - diff --git a/mcs/class/System.Data.Linq/System.Data.Linq-net_4_5.csproj b/mcs/class/System.Data.Linq/System.Data.Linq-net_4_5.csproj deleted file mode 100644 index 8318ea1d502..00000000000 --- a/mcs/class/System.Data.Linq/System.Data.Linq-net_4_5.csproj +++ /dev/null @@ -1,429 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8AC5471F-9515-4D01-87B9-7974F2CBD6F1} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Data.Linq - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;MONO_STRICT;MONO_DEPLOY - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;MONO_STRICT;MONO_DEPLOY - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization-net_4_5 - - - - - - - - DbLinq.Schema.Dbml.DbmlSchema.xsd - - - - diff --git a/mcs/class/System.Data.Linq/System.Data.Linq-tests-net_4_5.csproj b/mcs/class/System.Data.Linq/System.Data.Linq-tests-net_4_5.csproj deleted file mode 100644 index 369d86a2e1c..00000000000 --- a/mcs/class/System.Data.Linq/System.Data.Linq-tests-net_4_5.csproj +++ /dev/null @@ -1,114 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6A75FB46-8799-403B-A06C-EFF389CB297D} - Library - 1699 - bin\Debug\System.Data.Linq-tests-net_4_5 - True - False - - Properties - - - System.Data.Linq_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;MONO_STRICT;MONO_DEPLOY - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;MONO_STRICT;MONO_DEPLOY - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {8AC5471F-9515-4D01-87B9-7974F2CBD6F1} - System.Data.Linq\System.Data.Linq-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data\System.Data-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_5 - - - - - - - - DbLinq.Schema.Dbml.DbmlSchema.xsd - - - - diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient-net_4_5.csproj b/mcs/class/System.Data.OracleClient/System.Data.OracleClient-net_4_5.csproj deleted file mode 100644 index e2bbd978046..00000000000 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient-net_4_5.csproj +++ /dev/null @@ -1,170 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DB464643-D49E-43CE-B565-FE5446A79FC1} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Data.OracleClient - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {773D8BA7-9A88-49AC-81C9-740436270588} - System.EnterpriseServices-net_4_5 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing-net_4_5 - - - - - - - diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient-tests-net_4_5.csproj b/mcs/class/System.Data.OracleClient/System.Data.OracleClient-tests-net_4_5.csproj deleted file mode 100644 index 8cf60601fb4..00000000000 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient-tests-net_4_5.csproj +++ /dev/null @@ -1,221 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {55B68673-F6AA-4D45-82BB-ADEAAC6C44F0} - Library - 1699,618 - bin\Debug\System.Data.OracleClient-tests-net_4_5 - True - False - - Properties - - - System.Data.OracleClient_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {DB464643-D49E-43CE-B565-FE5446A79FC1} - System.Data.OracleClient\System.Data.OracleClient-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data\System.Data-net_4_5 - - - {773D8BA7-9A88-49AC-81C9-740436270588} - System.EnterpriseServices\System.EnterpriseServices-net_4_5 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing\System.Drawing-net_4_5 - - - - - - - diff --git a/mcs/class/System.Data.Services.Client/System.Data.Services.Client-net_4_5.csproj b/mcs/class/System.Data.Services.Client/System.Data.Services.Client-net_4_5.csproj deleted file mode 100644 index 71ed260fba1..00000000000 --- a/mcs/class/System.Data.Services.Client/System.Data.Services.Client-net_4_5.csproj +++ /dev/null @@ -1,227 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E9B87AE3-9A05-4146-83CC-082BE32D8EB2} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Data.Services.Client - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {8328796E-8A15-4972-8F1E-2F15E7D57C42} - System.Xml.Linq-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {8E6ED7D5-3B08-4A83-905E-8FB4CF0C160D} - WindowsBase-net_4_5 - - - - - - - - System.Data.Services.Client.resources - - - - diff --git a/mcs/class/System.Data.Services/System.Data.Services-net_4_5.csproj b/mcs/class/System.Data.Services/System.Data.Services-net_4_5.csproj deleted file mode 100644 index 9801ed8583e..00000000000 --- a/mcs/class/System.Data.Services/System.Data.Services-net_4_5.csproj +++ /dev/null @@ -1,179 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F3B101A1-2CC5-416E-9C64-AABAB5D4A625} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Data.Services - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {F2156C09-C377-4945-A690-39CFBF3319B3} - System.ServiceModel-net_4_5 - - - {BD4DF654-42EE-40E8-A3F4-8A80959E7879} - System.ServiceModel.Web-net_4_5 - - - {E9B87AE3-9A05-4146-83CC-082BE32D8EB2} - System.Data.Services.Client-net_4_5 - - - {E537F31B-BCB7-4935-ABF3-DF2FAC48DCB3} - System.ServiceModel.Activation-net_4_5 - - - - - - - diff --git a/mcs/class/System.Data.Services/System.Data.Services-tests-net_4_5.csproj b/mcs/class/System.Data.Services/System.Data.Services-tests-net_4_5.csproj deleted file mode 100644 index 7241ba33039..00000000000 --- a/mcs/class/System.Data.Services/System.Data.Services-tests-net_4_5.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A39E95C7-A667-472B-8A53-798974756DBD} - Library - 1699 - bin\Debug\System.Data.Services-tests-net_4_5 - True - False - - Properties - - - System.Data.Services_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {F3B101A1-2CC5-416E-9C64-AABAB5D4A625} - System.Data.Services\System.Data.Services-net_4_5 - - - {F1316A49-176B-4E68-8A5F-1BA718289D46} - System.ServiceModel\System.ServiceModel-net_4_5-1 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/System.Data/ReferenceSources/Res.cs b/mcs/class/System.Data/ReferenceSources/Res.cs index d5d1dc9ba9f..9c13a85f121 100644 --- a/mcs/class/System.Data/ReferenceSources/Res.cs +++ b/mcs/class/System.Data/ReferenceSources/Res.cs @@ -1198,7 +1198,36 @@ public const string Xml_TooManyIsDataSetAtributeInSchema = "Xml_TooManyIsDataSet public const string Xml_UndefinedDatatype = "Xml_UndefinedDatatype"; public const string Xml_ValueOutOfRange = "Xml_ValueOutOfRange"; public const string collectionChangedEventDescr = "collectionChangedEventDescr"; - +public const string DbConnectionString_TransparentNetworkIPResolution = "DbConnectionString_TransparentNetworkIPResolution"; +public const string TCE_NullCspPathSysErr = "TCE_NullCspPathSysErr"; +public const string TCE_NullCspPath = "TCE_NullCspPath"; +public const string TCE_NullCngPathSysErr = "TCE_NullCngPathSysErr"; +public const string TCE_NullCngPath = "TCE_NullCngPath"; +public const string TCE_InvalidCspPathSysErr = "TCE_InvalidCspPathSysErr"; +public const string TCE_InvalidCspPath = "TCE_InvalidCspPath"; +public const string TCE_InvalidCngPathSysErr = "TCE_InvalidCngPathSysErr"; +public const string TCE_InvalidCngPath = "TCE_InvalidCngPath"; +public const string TCE_EmptyCspNameSysErr = "TCE_EmptyCspNameSysErr"; +public const string TCE_EmptyCspName = "TCE_EmptyCspName"; +public const string TCE_EmptyCngNameSysErr = "TCE_EmptyCngNameSysErr"; +public const string TCE_EmptyCngName = "TCE_EmptyCngName"; +public const string TCE_EmptyCspKeyIdSysErr = "TCE_EmptyCspKeyIdSysErr"; +public const string TCE_EmptyCspKeyId = "TCE_EmptyCspKeyId"; +public const string TCE_EmptyCngKeyIdSysErr = "TCE_EmptyCngKeyIdSysErr"; +public const string TCE_EmptyCngKeyId = "TCE_EmptyCngKeyId"; +public const string TCE_InvalidCspNameSysErr = "TCE_InvalidCspNameSysErr"; +public const string TCE_InvalidCspName = "TCE_InvalidCspName"; +public const string TCE_InvalidCspKeyIdSysErr = "TCE_InvalidCspKeyIdSysErr"; +public const string TCE_InvalidCspKeyId = "TCE_InvalidCspKeyId"; +public const string TCE_InvalidCngKeySysErr = "TCE_InvalidCngKeySysErr"; +public const string TCE_InvalidCngKey = "TCE_InvalidCngKey"; +public const string TCE_InvalidCiphertextLengthInEncryptedCEKCsp = "TCE_InvalidCiphertextLengthInEncryptedCEKCsp"; +public const string TCE_InvalidCiphertextLengthInEncryptedCEKCng = "TCE_InvalidCiphertextLengthInEncryptedCEKCng"; +public const string TCE_InvalidSignatureInEncryptedCEKCsp = "TCE_InvalidSignatureInEncryptedCEKCsp"; +public const string TCE_InvalidSignatureInEncryptedCEKCng = "TCE_InvalidSignatureInEncryptedCEKCng"; +public const string TCE_InvalidSignature = "TCE_InvalidSignature"; +public const string GT_Disabled = "GT_Disabled"; +public const string GT_UnsupportedSysTxVersion = "GT_UnsupportedSysTxVersion"; public static string GetString (string name) { diff --git a/mcs/class/System.Data/System.Data-net_4_5.csproj b/mcs/class/System.Data/System.Data-net_4_5.csproj deleted file mode 100644 index 24eb6c3a9fc..00000000000 --- a/mcs/class/System.Data/System.Data-net_4_5.csproj +++ /dev/null @@ -1,555 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - Library - 1699,169,219,414,649 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - System.Data - v4.5 - 512 - - - - true - full - 1699,169,219,414,649 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;PLATFORM_UNIX;USEOFFSET;MONO_PARTIAL_DATA_IMPORT - prompt - 4 - - - pdbonly - 1699,169,219,414,649 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;PLATFORM_UNIX;USEOFFSET;MONO_PARTIAL_DATA_IMPORT - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {14631AC9-FDC6-4561-A04C-6913947C939E} - System.Numerics-net_4_5 - - - {773D8BA7-9A88-49AC-81C9-740436270588} - System.EnterpriseServices-net_4_5 - - - {CB7949AC-5FA7-4FAB-893A-8FAF436BF514} - Mono.Data.Tds-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {AF2BBF50-AB57-4CA1-8EF5-2B54C7418434} - System.Transactions-net_4_5 - - - - - - - diff --git a/mcs/class/System.Data/System.Data-net_4_x.csproj b/mcs/class/System.Data/System.Data-net_4_x.csproj index a0f8a936bb8..23229be5f1c 100644 --- a/mcs/class/System.Data/System.Data-net_4_x.csproj +++ b/mcs/class/System.Data/System.Data-net_4_x.csproj @@ -328,6 +328,8 @@ + + @@ -369,6 +371,7 @@ + diff --git a/mcs/class/System.Data/System.Data-tests-net_4_5.csproj b/mcs/class/System.Data/System.Data-tests-net_4_5.csproj deleted file mode 100644 index f8305301862..00000000000 --- a/mcs/class/System.Data/System.Data-tests-net_4_5.csproj +++ /dev/null @@ -1,240 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F7AED8DB-C8C6-4F47-AC6C-F93B26F90899} - Library - 1699,649,618,169,612,219,168 - bin\Debug\System.Data-tests-net_4_5 - True - False - true - Properties - - - System.Data_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,649,618,169,612,219,168 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699,649,618,169,612,219,168 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data\System.Data-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {773D8BA7-9A88-49AC-81C9-740436270588} - System.EnterpriseServices\System.EnterpriseServices-net_4_5 - - - {CB7949AC-5FA7-4FAB-893A-8FAF436BF514} - Mono.Data.Tds\Mono.Data.Tds-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration\System.Configuration-net_4_5 - - - {AF2BBF50-AB57-4CA1-8EF5-2B54C7418434} - System.Transactions\System.Transactions-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {74084B98-6858-4133-998C-E594D367D8F1} - Mono.Data.Sqlite\Mono.Data.Sqlite-net_4_0 - - - - - - diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs index 7410c36c2a1..4877d434a20 100644 --- a/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs +++ b/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs @@ -1263,20 +1263,29 @@ namespace System.Data.SqlClient throw new ArgumentNullException ("values"); int len = values.Length; - int bigDecimalIndex = command.Tds.ColumnValues.BigDecimalIndex; + var tds = command.Tds; + int columns = Math.Min (len, tds.Columns.Count); - // If a four-byte decimal is stored, then we can't convert to - // a native type. Throw an OverflowException. - if (bigDecimalIndex >= 0 && bigDecimalIndex < len) - throw new OverflowException (); - try { - command.Tds.ColumnValues.CopyTo (0, values, 0, - len > command.Tds.ColumnValues.Count ? command.Tds.ColumnValues.Count : len); - } catch (TdsInternalException ex) { - command.Connection.Close (); - throw SqlException.FromTdsInternalException ((TdsInternalException) ex); + if ((command.CommandBehavior & CommandBehavior.SequentialAccess) != 0) { + for (int i = 0; i < columns; ++i) { + values [i] = tds.GetSequentialColumnValue (i); + } + } else { + int bigDecimalIndex = tds.ColumnValues.BigDecimalIndex; + + // If a four-byte decimal is stored, then we can't convert to + // a native type. Throw an OverflowException. + if (bigDecimalIndex >= 0 && bigDecimalIndex < len) + throw new OverflowException (); + try { + tds.ColumnValues.CopyTo (0, values, 0, columns); + } catch (TdsInternalException ex) { + command.Connection.Close (); + throw SqlException.FromTdsInternalException ((TdsInternalException)ex); + } } - return (len < FieldCount ? len : FieldCount); + + return columns; } diff --git a/mcs/class/System.Data/Test/System.Data/DataViewTest.cs b/mcs/class/System.Data/Test/System.Data/DataViewTest.cs index 123c878050b..4be1824f667 100644 --- a/mcs/class/System.Data/Test/System.Data/DataViewTest.cs +++ b/mcs/class/System.Data/Test/System.Data/DataViewTest.cs @@ -983,6 +983,7 @@ table was set. eventWriter.WriteLine (" add a column with an empty name."); AssertEquals (result.Replace ("\r\n", "\n"), eventWriter.ToString ().Replace ("\r\n", "\n")); + GC.KeepAlive (dv); } public class ComplexEventSequence1View : DataView diff --git a/mcs/class/System.Data/mobile_referencesource.sources b/mcs/class/System.Data/mobile_referencesource.sources index 7dcb976cd39..45ae17e4d6c 100644 --- a/mcs/class/System.Data/mobile_referencesource.sources +++ b/mcs/class/System.Data/mobile_referencesource.sources @@ -66,7 +66,6 @@ MobileStubs.cs ../../../external/referencesource/System.Data/System/Data/Common/ObjectStorage.cs ../../../external/referencesource/System.Data/System/Data/Common/RowUpdatedEventArgs.cs ../../../external/referencesource/System.Data/System/Data/Common/RowUpdatingEventArgs.cs -../../../external/referencesource/System.Data/System/Data/Common/SafeNativeMethods.cs ../../../external/referencesource/System.Data/System/Data/Common/SByteStorage.cs ../../../external/referencesource/System.Data/System/Data/Common/SchemaTableColumn.cs ../../../external/referencesource/System.Data/System/Data/Common/SchemaTableOptionalColumn.cs @@ -191,24 +190,13 @@ MobileStubs.cs ../../../external/referencesource/System.Data/System/Data/PrimaryKeyTypeConverter.cs ../../../external/referencesource/System.Data/System/Data/PropertyCollection.cs ../../../external/referencesource/System.Data/System/Data/ProviderBase/DataReaderContainer.cs -../../../external/referencesource/System.Data/System/Data/ProviderBase/DbBuffer.cs -../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionClosed.cs -../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionFactory.cs -# ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionHelper.cs -../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionInternal.cs ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolAuthenticationContext.cs ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolAuthenticationContextKey.cs -../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPool.cs -../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolGroup.cs -../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolGroupProviderInfo.cs -../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolIdentity.cs ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolOptions.cs ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolProviderInfo.cs ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataCollectionNames.cs ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataColumnNames.cs ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbMetaDataFactory.cs -# ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbParameterCollectionHelper.cs -# ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbParameterHelper.cs ../../../external/referencesource/System.Data/System/Data/ProviderBase/DbReferenceCollection.cs ../../../external/referencesource/System.Data/System/Data/ProviderBase/SchemaMapping.cs ../../../external/referencesource/System.Data/System/Data/ProviderBase/TimeoutTimer.cs diff --git a/mcs/class/System.Design/System.Design-net_4_5.csproj b/mcs/class/System.Design/System.Design-net_4_5.csproj deleted file mode 100644 index c27e1583e5a..00000000000 --- a/mcs/class/System.Design/System.Design-net_4_5.csproj +++ /dev/null @@ -1,438 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D4E6A482-761B-4B41-8B63-C930CA84D268} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Design - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {21892B00-1C9F-44F3-AE4C-A6A9A210CEC7} - System.Web-plainweb-net_4_5 - - - {B102F27C-1A07-487F-BA5B-D5155D201112} - System.Windows.Forms-net_4_5 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing-net_4_5 - - - {FACE8136-C95A-4788-90B2-DB0ECF7A020A} - Accessibility-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - - - - - diff --git a/mcs/class/System.Design/System.Design-tests-net_4_5.csproj b/mcs/class/System.Design/System.Design-tests-net_4_5.csproj deleted file mode 100644 index 76ad3f233ca..00000000000 --- a/mcs/class/System.Design/System.Design-tests-net_4_5.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {AB2530F9-0740-41BF-9276-865F11BCAC7A} - Library - 1699 - bin\Debug\System.Design-tests-net_4_5 - True - False - - Properties - - - System.Design_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {9A747C88-5D5B-41EA-8435-48EAFCFF3C5B} - System.Design\System.Design-net_4_5-1 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing\System.Drawing-net_4_5 - - - {B102F27C-1A07-487F-BA5B-D5155D201112} - System.Windows.Forms\System.Windows.Forms-net_4_5 - - - - - - - diff --git a/mcs/class/System.DirectoryServices.Protocols/System.DirectoryServices.Protocols-net_4_5.csproj b/mcs/class/System.DirectoryServices.Protocols/System.DirectoryServices.Protocols-net_4_5.csproj deleted file mode 100644 index 0fd61b3da9c..00000000000 --- a/mcs/class/System.DirectoryServices.Protocols/System.DirectoryServices.Protocols-net_4_5.csproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {34031168-8F0D-431D-A1DE-044B3D89C7A2} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.DirectoryServices.Protocols - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {EC4E43E7-63C0-4D64-8B7A-E00C097872A5} - System.DirectoryServices-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - - - - - diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices-net_4_5.csproj b/mcs/class/System.DirectoryServices/System.DirectoryServices-net_4_5.csproj deleted file mode 100644 index 9d9d1629290..00000000000 --- a/mcs/class/System.DirectoryServices/System.DirectoryServices-net_4_5.csproj +++ /dev/null @@ -1,223 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {EC4E43E7-63C0-4D64-8B7A-E00C097872A5} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.DirectoryServices - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {E6070FFA-2CBA-4C24-99C1-63A4F5052821} - Novell.Directory.Ldap-net_4_5 - - - - - - - diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices-net_4_x.csproj b/mcs/class/System.DirectoryServices/System.DirectoryServices-net_4_x.csproj index 924e26d9036..c31a24cab6f 100644 --- a/mcs/class/System.DirectoryServices/System.DirectoryServices-net_4_x.csproj +++ b/mcs/class/System.DirectoryServices/System.DirectoryServices-net_4_x.csproj @@ -49,7 +49,7 @@ - + diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices-tests-net_4_5.csproj b/mcs/class/System.DirectoryServices/System.DirectoryServices-tests-net_4_5.csproj deleted file mode 100644 index eac8025c526..00000000000 --- a/mcs/class/System.DirectoryServices/System.DirectoryServices-tests-net_4_5.csproj +++ /dev/null @@ -1,94 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9154855D-9656-4742-9CF0-B70B583EE88F} - Library - 1699,618,219,169 - bin\Debug\System.DirectoryServices-tests-net_4_5 - True - False - - Properties - - - System.DirectoryServices_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {EC4E43E7-63C0-4D64-8B7A-E00C097872A5} - System.DirectoryServices\System.DirectoryServices-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {E6070FFA-2CBA-4C24-99C1-63A4F5052821} - Novell.Directory.Ldap\Novell.Directory.Ldap-net_4_5 - - - - - - - diff --git a/mcs/class/System.Drawing.Design/System.Drawing.Design-net_4_5.csproj b/mcs/class/System.Drawing.Design/System.Drawing.Design-net_4_5.csproj deleted file mode 100644 index 67a17af7382..00000000000 --- a/mcs/class/System.Drawing.Design/System.Drawing.Design-net_4_5.csproj +++ /dev/null @@ -1,108 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DAEBD561-068A-4730-9F8C-98EC20DDEE78} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Drawing.Design - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing-net_4_5 - - - {B102F27C-1A07-487F-BA5B-D5155D201112} - System.Windows.Forms-net_4_5 - - - - - - - diff --git a/mcs/class/System.Drawing/System.Drawing-net_4_5.csproj b/mcs/class/System.Drawing/System.Drawing-net_4_5.csproj deleted file mode 100644 index 4de69385c55..00000000000 --- a/mcs/class/System.Drawing/System.Drawing-net_4_5.csproj +++ /dev/null @@ -1,296 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - System.Drawing - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - - Mono.ico - - - Information.ico - - - Error.ico - - - Warning.ico - - - Question.ico - - - Shield.ico - - - - diff --git a/mcs/class/System.Drawing/System.Drawing-tests-net_4_5.csproj b/mcs/class/System.Drawing/System.Drawing-tests-net_4_5.csproj deleted file mode 100644 index 6b5bd8ef1cc..00000000000 --- a/mcs/class/System.Drawing/System.Drawing-tests-net_4_5.csproj +++ /dev/null @@ -1,208 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6E248AA8-76CF-4FFE-859D-F979E3DE810B} - Library - 1699,618,219,169,1595 - bin\Debug\System.Drawing-tests-net_4_5 - True - False - true - Properties - - - System.Drawing_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,618,219,169,1595 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;TEST - prompt - 4 - - - pdbonly - 1699,618,219,169,1595 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;TEST - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing\System.Drawing-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing\System.Drawing-net_4_5 - - - {2FDBA71E-A6EC-4247-B0BD-BF7A618C0747} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_4_0 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - - - - - - Mono.ico - - - Information.ico - - - Error.ico - - - Warning.ico - - - Question.ico - - - Shield.ico - - - indexed.png - - - - diff --git a/mcs/class/System.Dynamic/System.Dynamic-net_4_5.csproj b/mcs/class/System.Dynamic/System.Dynamic-net_4_5.csproj deleted file mode 100644 index 45682c21471..00000000000 --- a/mcs/class/System.Dynamic/System.Dynamic-net_4_5.csproj +++ /dev/null @@ -1,143 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5F5C22E0-4AD5-4F78-94A7-038F823E1E3D} - Library - 1699,414,169 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - System.Dynamic - v4.5 - 512 - - - - true - full - 1699,414,169 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;CODEPLEX_40 - prompt - 4 - - - pdbonly - 1699,414,169 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;CODEPLEX_40 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices-net_4_5.csproj b/mcs/class/System.EnterpriseServices/System.EnterpriseServices-net_4_5.csproj deleted file mode 100644 index df9e33d6cee..00000000000 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices-net_4_5.csproj +++ /dev/null @@ -1,197 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {773D8BA7-9A88-49AC-81C9-740436270588} - Library - 1699,168,162 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.EnterpriseServices - v4.5 - 512 - - - - true - full - 1699,168,162 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,168,162 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {AF2BBF50-AB57-4CA1-8EF5-2B54C7418434} - System.Transactions-net_4_5 - - - - - - - diff --git a/mcs/class/System.IO.Compression.FileSystem/System.IO.Compression.FileSystem-net_4_5.csproj b/mcs/class/System.IO.Compression.FileSystem/System.IO.Compression.FileSystem-net_4_5.csproj deleted file mode 100644 index 6498849a05b..00000000000 --- a/mcs/class/System.IO.Compression.FileSystem/System.IO.Compression.FileSystem-net_4_5.csproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4124933B-9DE6-4D76-8ABB-AEAE814CFB26} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.IO.Compression.FileSystem - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {BDF04E30-60D9-4279-A1DF-3291328A5AFD} - System.IO.Compression-net_4_5 - - - - - - - diff --git a/mcs/class/System.IO.Compression/System.IO.Compression-net_4_5.csproj b/mcs/class/System.IO.Compression/System.IO.Compression-net_4_5.csproj deleted file mode 100644 index 20e993ac6ed..00000000000 --- a/mcs/class/System.IO.Compression/System.IO.Compression-net_4_5.csproj +++ /dev/null @@ -1,182 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {BDF04E30-60D9-4279-A1DF-3291328A5AFD} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - System.IO.Compression - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/System.IdentityModel.Selectors/System.IdentityModel.Selectors-net_4_5.csproj b/mcs/class/System.IdentityModel.Selectors/System.IdentityModel.Selectors-net_4_5.csproj deleted file mode 100644 index d106a85aa52..00000000000 --- a/mcs/class/System.IdentityModel.Selectors/System.IdentityModel.Selectors-net_4_5.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {AB4F77BB-4340-4A79-9B66-EF5B4221E1F2} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.IdentityModel.Selectors - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {B55E59B2-31CA-438B-ADB8-4B9A9A547830} - System.Security-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization-net_4_5 - - - {F056C062-E467-4989-9366-440E8CD23C0C} - System.IdentityModel-net_4_5 - - - - - - - diff --git a/mcs/class/System.IdentityModel/System.IdentityModel-net_4_5.csproj b/mcs/class/System.IdentityModel/System.IdentityModel-net_4_5.csproj deleted file mode 100644 index 5a14255a3b4..00000000000 --- a/mcs/class/System.IdentityModel/System.IdentityModel-net_4_5.csproj +++ /dev/null @@ -1,243 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F056C062-E467-4989-9366-440E8CD23C0C} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.IdentityModel - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {B4E6806D-1B38-4CEE-8ADB-2D0A4D1AF25F} - System.Web.ApplicationServices-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {B55E59B2-31CA-438B-ADB8-4B9A9A547830} - System.Security-net_4_5 - - - {B489C3DE-3ED3-4EDC-B42B-82B38E101857} - System.Web-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {D68D4FED-CA32-4800-A628-58BAE485562C} - Mono.Security-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization-net_4_5 - - - - - - - diff --git a/mcs/class/System.IdentityModel/System.IdentityModel-tests-net_4_5.csproj b/mcs/class/System.IdentityModel/System.IdentityModel-tests-net_4_5.csproj deleted file mode 100644 index 3099e1b46f3..00000000000 --- a/mcs/class/System.IdentityModel/System.IdentityModel-tests-net_4_5.csproj +++ /dev/null @@ -1,148 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A9AD4247-006F-4885-88E7-AFF48405D1A1} - Library - 1699 - bin\Debug\System.IdentityModel-tests-net_4_5 - True - False - - Properties - - - System.IdentityModel_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {F056C062-E467-4989-9366-440E8CD23C0C} - System.IdentityModel\System.IdentityModel-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {B55E59B2-31CA-438B-ADB8-4B9A9A547830} - System.Security\System.Security-net_4_5 - - - {725FB152-838A-4C6E-8A12-AC47E2DD4CEA} - System.Web\System.Web-net_4_5-2 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration\System.Configuration-net_4_5 - - - {D68D4FED-CA32-4800-A628-58BAE485562C} - Mono.Security\Mono.Security-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_5 - - - {B4E6806D-1B38-4CEE-8ADB-2D0A4D1AF25F} - System.Web.ApplicationServices\System.Web.ApplicationServices-net_4_5 - - - - - - - diff --git a/mcs/class/System.Json.Microsoft/System.Json.Microsoft-net_4_5.csproj b/mcs/class/System.Json.Microsoft/System.Json.Microsoft-net_4_5.csproj deleted file mode 100644 index 8e0e4c9bf0e..00000000000 --- a/mcs/class/System.Json.Microsoft/System.Json.Microsoft-net_4_5.csproj +++ /dev/null @@ -1,131 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3694FAEB-90F5-46E8-AD30-E91FF97B401A} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Json.Microsoft - v4.5 - 512 - - - true - true - - - ../winfx.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;ASPNETMVC;FEATURE_DYNAMIC - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;ASPNETMVC;FEATURE_DYNAMIC - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization-net_4_5 - - - {D554618C-5D38-413A-82BA-7A70B6FC61A3} - Microsoft.CSharp-net_4_5 - - - - - - - - System.Json.Properties.Resources.resources - - - - diff --git a/mcs/class/System.Json.Microsoft/System.Json.Microsoft-tests-net_4_5.csproj b/mcs/class/System.Json.Microsoft/System.Json.Microsoft-tests-net_4_5.csproj deleted file mode 100644 index ffcc4bd1ea6..00000000000 --- a/mcs/class/System.Json.Microsoft/System.Json.Microsoft-tests-net_4_5.csproj +++ /dev/null @@ -1,106 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {BF6DC977-2D12-4FE0-A44C-759FBD4FE7E9} - Library - 1699 - bin\Debug\System.Json.Microsoft-tests-net_4_5 - True - False - - Properties - - - System.Json.Microsoft_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;ASPNETMVC;FEATURE_DYNAMIC - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;ASPNETMVC;FEATURE_DYNAMIC - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {3694FAEB-90F5-46E8-AD30-E91FF97B401A} - System.Json.Microsoft\System.Json.Microsoft-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_5 - - - {D554618C-5D38-413A-82BA-7A70B6FC61A3} - Microsoft.CSharp\Microsoft.CSharp-net_4_5 - - - - - - - - System.Json.Properties.Resources.resources - - - - diff --git a/mcs/class/System.Json/System.Json-net_4_5.csproj b/mcs/class/System.Json/System.Json-net_4_5.csproj deleted file mode 100644 index 7636191abdf..00000000000 --- a/mcs/class/System.Json/System.Json-net_4_5.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A062944C-09A6-4C2C-A2DC-60BB1EB19766} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Json - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/System.Json/System.Json-tests-net_4_5.csproj b/mcs/class/System.Json/System.Json-tests-net_4_5.csproj deleted file mode 100644 index 6993367db97..00000000000 --- a/mcs/class/System.Json/System.Json-tests-net_4_5.csproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C9E9ACC2-4917-4C0C-8734-AD4864EEB7C2} - Library - 1699 - bin\Debug\System.Json-tests-net_4_5 - True - False - - Properties - - - System.Json_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {A062944C-09A6-4C2C-A2DC-60BB1EB19766} - System.Json\System.Json-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/System.Management/System.Management-net_4_5.csproj b/mcs/class/System.Management/System.Management-net_4_5.csproj deleted file mode 100644 index 25ebfeda351..00000000000 --- a/mcs/class/System.Management/System.Management-net_4_5.csproj +++ /dev/null @@ -1,159 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6F650EE0-43D3-4875-92E8-E3FA07E18575} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Management - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {E6E1740E-37DD-487C-8947-F1C0612D4738} - System.Configuration.Install-net_4_5 - - - - - - - diff --git a/mcs/class/System.Messaging/System.Messaging-net_4_5.csproj b/mcs/class/System.Messaging/System.Messaging-net_4_5.csproj deleted file mode 100644 index 88fcd52bb71..00000000000 --- a/mcs/class/System.Messaging/System.Messaging-net_4_5.csproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1CBEC0FC-5926-42FA-A0CF-A19617FABB78} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Messaging - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {E6E1740E-37DD-487C-8947-F1C0612D4738} - System.Configuration.Install-net_4_5 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing-net_4_5 - - - {B102F27C-1A07-487F-BA5B-D5155D201112} - System.Windows.Forms-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {DDCC93B5-9425-4E9A-95DC-3400D0028508} - Mono.Messaging-net_4_5 - - - - - - - - MessageQueue.resx - - - - diff --git a/mcs/class/System.Messaging/System.Messaging-tests-net_4_5.csproj b/mcs/class/System.Messaging/System.Messaging-tests-net_4_5.csproj deleted file mode 100644 index 89863b15216..00000000000 --- a/mcs/class/System.Messaging/System.Messaging-tests-net_4_5.csproj +++ /dev/null @@ -1,124 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E8980B98-13D0-40AF-A452-F26D3482BCA4} - Library - 1699,618,219,169 - bin\Debug\System.Messaging-tests-net_4_5 - True - False - - Properties - - - System.Messaging_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {1CBEC0FC-5926-42FA-A0CF-A19617FABB78} - System.Messaging\System.Messaging-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {E6E1740E-37DD-487C-8947-F1C0612D4738} - System.Configuration.Install\System.Configuration.Install-net_4_5 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing\System.Drawing-net_4_5 - - - {B102F27C-1A07-487F-BA5B-D5155D201112} - System.Windows.Forms\System.Windows.Forms-net_4_5 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {DDCC93B5-9425-4E9A-95DC-3400D0028508} - Mono.Messaging\Mono.Messaging-net_4_5 - - - False - nunit.mocks.dll - False - - - - - - - - MessageQueue.resx - - - - diff --git a/mcs/class/System.Net.Http.Formatting/System.Net.Http.Formatting-net_4_5.csproj b/mcs/class/System.Net.Http.Formatting/System.Net.Http.Formatting-net_4_5.csproj deleted file mode 100644 index d009b7a1ef5..00000000000 --- a/mcs/class/System.Net.Http.Formatting/System.Net.Http.Formatting-net_4_5.csproj +++ /dev/null @@ -1,362 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {BFBE5444-4F21-45CF-929E-C8FBEF302F5E} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Net.Http.Formatting - v4.5 - 512 - - - true - true - - - ../winfx.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;ASPNETMVC - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;ASPNETMVC - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {E36C154B-A0AC-4721-B06A-AFE31D357CE5} - System.Net.Http-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization-net_4_5 - - - {8328796E-8A15-4972-8F1E-2F15E7D57C42} - System.Xml.Linq-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - - - - - - System.Net.Http.Properties.CommonWebApiResources.resources - - - System.Net.Http.Properties.Resources.resources - - - - diff --git a/mcs/class/System.Net.Http.WebRequest/System.Net.Http.WebRequest-net_4_5.csproj b/mcs/class/System.Net.Http.WebRequest/System.Net.Http.WebRequest-net_4_5.csproj deleted file mode 100644 index 30594b94f8f..00000000000 --- a/mcs/class/System.Net.Http.WebRequest/System.Net.Http.WebRequest-net_4_5.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {28DE6988-8E54-4D16-B9B6-4A5BB796FB15} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Net.Http.WebRequest - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {E36C154B-A0AC-4721-B06A-AFE31D357CE5} - System.Net.Http-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/System.Net.Http/System.Net.Http-net_4_5.csproj b/mcs/class/System.Net.Http/System.Net.Http-net_4_5.csproj deleted file mode 100644 index 6571e8f0609..00000000000 --- a/mcs/class/System.Net.Http/System.Net.Http-net_4_5.csproj +++ /dev/null @@ -1,142 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E36C154B-A0AC-4721-B06A-AFE31D357CE5} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Net.Http - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/System.Net.Http/System.Net.Http-tests-net_4_5.csproj b/mcs/class/System.Net.Http/System.Net.Http-tests-net_4_5.csproj deleted file mode 100644 index d18d3875275..00000000000 --- a/mcs/class/System.Net.Http/System.Net.Http-tests-net_4_5.csproj +++ /dev/null @@ -1,122 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {98DA1392-DAD8-4F11-9B88-1E1578FF7670} - Library - 1699 - bin\Debug\System.Net.Http-tests-net_4_5 - True - False - - Properties - - - System.Net.Http_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {E36C154B-A0AC-4721-B06A-AFE31D357CE5} - System.Net.Http\System.Net.Http-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs index 114e78e83c2..baa6dd9f0d2 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs @@ -33,7 +33,7 @@ using System.IO; namespace System.Net.Http { - public class HttpClient : HttpMessageInvoker + public partial class HttpClient : HttpMessageInvoker { static readonly TimeSpan TimeoutDefault = TimeSpan.FromSeconds (100); @@ -44,10 +44,12 @@ namespace System.Net.Http long buffer_size; TimeSpan timeout; +#if !XAMARIN_MODERN public HttpClient () : this (new HttpClientHandler (), true) { } +#endif public HttpClient (HttpMessageHandler handler) : this (handler, true) diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs index 510a2d63d45..7992ecafb20 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs @@ -997,8 +997,8 @@ namespace MonoTests.System.Net.Http public void GetString_Many () { var client = new HttpClient (); - var t1 = client.GetStringAsync ("http://www.google.com"); - var t2 = client.GetStringAsync ("http://www.google.com"); + var t1 = client.GetStringAsync ("http://example.org"); + var t2 = client.GetStringAsync ("http://example.org"); Assert.IsTrue (Task.WaitAll (new [] { t1, t2 }, WaitTimeout)); } diff --git a/mcs/class/System.Net/System.Net-net_4_5.csproj b/mcs/class/System.Net/System.Net-net_4_5.csproj deleted file mode 100644 index 967cf8be4dc..00000000000 --- a/mcs/class/System.Net/System.Net-net_4_5.csproj +++ /dev/null @@ -1,97 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E41631CD-605D-46BE-9D4B-46AAD7EE5599} - Library - 1699,1720 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - System.Net - v4.5 - 512 - - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_5 - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - - - - - diff --git a/mcs/class/System.Numerics/System.Numerics-net_4_5.csproj b/mcs/class/System.Numerics/System.Numerics-net_4_5.csproj deleted file mode 100644 index 182af90fed6..00000000000 --- a/mcs/class/System.Numerics/System.Numerics-net_4_5.csproj +++ /dev/null @@ -1,94 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {14631AC9-FDC6-4561-A04C-6913947C939E} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - System.Numerics - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;MONO - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;MONO - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/System.Numerics/System.Numerics-tests-net_4_5.csproj b/mcs/class/System.Numerics/System.Numerics-tests-net_4_5.csproj deleted file mode 100644 index 1ccaed113d7..00000000000 --- a/mcs/class/System.Numerics/System.Numerics-tests-net_4_5.csproj +++ /dev/null @@ -1,86 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A2E74122-C2B6-4A40-A255-AF54948DA464} - Library - 1699 - bin\Debug\System.Numerics-tests-net_4_5 - True - False - - Properties - - - System.Numerics_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {14631AC9-FDC6-4561-A04C-6913947C939E} - System.Numerics\System.Numerics-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - - - - - diff --git a/mcs/class/System.Reactive.Core/System.Reactive.Core-net_4_5.csproj b/mcs/class/System.Reactive.Core/System.Reactive.Core-net_4_5.csproj deleted file mode 100644 index 35c87f3c706..00000000000 --- a/mcs/class/System.Reactive.Core/System.Reactive.Core-net_4_5.csproj +++ /dev/null @@ -1,186 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4EF3C775-C516-4897-AB1D-DC9F8862A4D9} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Reactive.Core - v4.5 - 512 - - - true - true - - - ../reactive.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {EFA38650-CE13-4BF3-993D-70B238DB1C9E} - System.Reactive.Interfaces-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {EFA38650-CE13-4BF3-993D-70B238DB1C9E} - System.Reactive.Interfaces-net_4_5 - - - - - - - - System.Reactive.Strings_Core.resources - - - - diff --git a/mcs/class/System.Reactive.Debugger/System.Reactive.Debugger-net_4_5.csproj b/mcs/class/System.Reactive.Debugger/System.Reactive.Debugger-net_4_5.csproj deleted file mode 100644 index fff560b2481..00000000000 --- a/mcs/class/System.Reactive.Debugger/System.Reactive.Debugger-net_4_5.csproj +++ /dev/null @@ -1,109 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6A059733-FAF1-4125-8BE6-C58A4E3714CE} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Reactive.Debugger - v4.5 - 512 - - - true - true - - - ../reactive.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {EFA38650-CE13-4BF3-993D-70B238DB1C9E} - System.Reactive.Interfaces-net_4_5 - - - {4EF3C775-C516-4897-AB1D-DC9F8862A4D9} - System.Reactive.Core-net_4_5 - - - {EE831E49-3F84-4A05-9417-A9C8BD36E164} - System.Reactive.Linq-net_4_5 - - - - - - - diff --git a/mcs/class/System.Reactive.Experimental/System.Reactive.Experimental-net_4_5.csproj b/mcs/class/System.Reactive.Experimental/System.Reactive.Experimental-net_4_5.csproj deleted file mode 100644 index e756150294c..00000000000 --- a/mcs/class/System.Reactive.Experimental/System.Reactive.Experimental-net_4_5.csproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1A49E00D-F0FB-430A-A540-1545DD999B36} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Reactive.Experimental - v4.5 - 512 - - - true - true - - - ../reactive.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {EFA38650-CE13-4BF3-993D-70B238DB1C9E} - System.Reactive.Interfaces-net_4_5 - - - {4EF3C775-C516-4897-AB1D-DC9F8862A4D9} - System.Reactive.Core-net_4_5 - - - {EE831E49-3F84-4A05-9417-A9C8BD36E164} - System.Reactive.Linq-net_4_5 - - - - - - - diff --git a/mcs/class/System.Reactive.Interfaces/System.Reactive.Interfaces-net_4_5.csproj b/mcs/class/System.Reactive.Interfaces/System.Reactive.Interfaces-net_4_5.csproj deleted file mode 100644 index 3c8fddc98fc..00000000000 --- a/mcs/class/System.Reactive.Interfaces/System.Reactive.Interfaces-net_4_5.csproj +++ /dev/null @@ -1,119 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {EFA38650-CE13-4BF3-993D-70B238DB1C9E} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Reactive.Interfaces - v4.5 - 512 - - - true - true - - - ../reactive.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/System.Reactive.Linq/System.Reactive.Linq-net_4_5.csproj b/mcs/class/System.Reactive.Linq/System.Reactive.Linq-net_4_5.csproj deleted file mode 100644 index 08d46c105bf..00000000000 --- a/mcs/class/System.Reactive.Linq/System.Reactive.Linq-net_4_5.csproj +++ /dev/null @@ -1,283 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE831E49-3F84-4A05-9417-A9C8BD36E164} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Reactive.Linq - v4.5 - 512 - - - true - true - - - ../reactive.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {4EF3C775-C516-4897-AB1D-DC9F8862A4D9} - System.Reactive.Core-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {EFA38650-CE13-4BF3-993D-70B238DB1C9E} - System.Reactive.Interfaces-net_4_5 - - - {4EF3C775-C516-4897-AB1D-DC9F8862A4D9} - System.Reactive.Core-net_4_5 - - - - - - - - System.Reactive.Strings_Linq.resources - - - - diff --git a/mcs/class/System.Reactive.Observable.Aliases/System.Reactive.Observable.Aliases-net_4_5.csproj b/mcs/class/System.Reactive.Observable.Aliases/System.Reactive.Observable.Aliases-net_4_5.csproj deleted file mode 100644 index a77aa5ce73d..00000000000 --- a/mcs/class/System.Reactive.Observable.Aliases/System.Reactive.Observable.Aliases-net_4_5.csproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {91A70A1D-36C5-49BC-92CC-A04D7C2C6EE1} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Reactive.Observable.Aliases - v4.5 - 512 - - - true - true - - - ../reactive.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {8D27108A-3DD4-46D7-917E-7833A3C4D479} - System.Reactive.Providers-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {EFA38650-CE13-4BF3-993D-70B238DB1C9E} - System.Reactive.Interfaces-net_4_5 - - - {4EF3C775-C516-4897-AB1D-DC9F8862A4D9} - System.Reactive.Core-net_4_5 - - - {EE831E49-3F84-4A05-9417-A9C8BD36E164} - System.Reactive.Linq-net_4_5 - - - {8D27108A-3DD4-46D7-917E-7833A3C4D479} - System.Reactive.Providers-net_4_5 - - - - - - - diff --git a/mcs/class/System.Reactive.PlatformServices/System.Reactive.PlatformServices-net_4_5.csproj b/mcs/class/System.Reactive.PlatformServices/System.Reactive.PlatformServices-net_4_5.csproj deleted file mode 100644 index e26e9a1b9b5..00000000000 --- a/mcs/class/System.Reactive.PlatformServices/System.Reactive.PlatformServices-net_4_5.csproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4C2D4246-D4F5-420B-B1B5-031853AC47F4} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Reactive.PlatformServices - v4.5 - 512 - - - true - true - - - ../reactive.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {EE831E49-3F84-4A05-9417-A9C8BD36E164} - System.Reactive.Linq-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {EFA38650-CE13-4BF3-993D-70B238DB1C9E} - System.Reactive.Interfaces-net_4_5 - - - {4EF3C775-C516-4897-AB1D-DC9F8862A4D9} - System.Reactive.Core-net_4_5 - - - {EE831E49-3F84-4A05-9417-A9C8BD36E164} - System.Reactive.Linq-net_4_5 - - - - - - - - System.Reactive.Strings_PlatformServices.resources - - - - diff --git a/mcs/class/System.Reactive.Providers/System.Reactive.Providers-net_4_5.csproj b/mcs/class/System.Reactive.Providers/System.Reactive.Providers-net_4_5.csproj deleted file mode 100644 index f0d3e043113..00000000000 --- a/mcs/class/System.Reactive.Providers/System.Reactive.Providers-net_4_5.csproj +++ /dev/null @@ -1,128 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8D27108A-3DD4-46D7-917E-7833A3C4D479} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Reactive.Providers - v4.5 - 512 - - - true - true - - - ../reactive.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {EE831E49-3F84-4A05-9417-A9C8BD36E164} - System.Reactive.Linq-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {EFA38650-CE13-4BF3-993D-70B238DB1C9E} - System.Reactive.Interfaces-net_4_5 - - - {4EF3C775-C516-4897-AB1D-DC9F8862A4D9} - System.Reactive.Core-net_4_5 - - - {EE831E49-3F84-4A05-9417-A9C8BD36E164} - System.Reactive.Linq-net_4_5 - - - - - - - - System.Reactive.Strings_Providers.resources - - - - diff --git a/mcs/class/System.Reactive.Runtime.Remoting/System.Reactive.Runtime.Remoting-net_4_5.csproj b/mcs/class/System.Reactive.Runtime.Remoting/System.Reactive.Runtime.Remoting-net_4_5.csproj deleted file mode 100644 index c94dcf33939..00000000000 --- a/mcs/class/System.Reactive.Runtime.Remoting/System.Reactive.Runtime.Remoting-net_4_5.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {895BA5F6-E27F-46C4-B045-58DD0F14BF90} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Reactive.Runtime.Remoting - v4.5 - 512 - - - true - true - - - ../reactive.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {EE831E49-3F84-4A05-9417-A9C8BD36E164} - System.Reactive.Linq-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {EFA38650-CE13-4BF3-993D-70B238DB1C9E} - System.Reactive.Interfaces-net_4_5 - - - {4EF3C775-C516-4897-AB1D-DC9F8862A4D9} - System.Reactive.Core-net_4_5 - - - {EE831E49-3F84-4A05-9417-A9C8BD36E164} - System.Reactive.Linq-net_4_5 - - - - - - - diff --git a/mcs/class/System.Reactive.Windows.Forms/System.Reactive.Windows.Forms-net_4_5.csproj b/mcs/class/System.Reactive.Windows.Forms/System.Reactive.Windows.Forms-net_4_5.csproj deleted file mode 100644 index d7365ef6488..00000000000 --- a/mcs/class/System.Reactive.Windows.Forms/System.Reactive.Windows.Forms-net_4_5.csproj +++ /dev/null @@ -1,119 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E85DF38F-D4F6-4B04-9962-32B0CCC8AC5E} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Reactive.Windows.Forms - v4.5 - 512 - - - true - true - - - ../reactive.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {B102F27C-1A07-487F-BA5B-D5155D201112} - System.Windows.Forms-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {EFA38650-CE13-4BF3-993D-70B238DB1C9E} - System.Reactive.Interfaces-net_4_5 - - - {4EF3C775-C516-4897-AB1D-DC9F8862A4D9} - System.Reactive.Core-net_4_5 - - - {EE831E49-3F84-4A05-9417-A9C8BD36E164} - System.Reactive.Linq-net_4_5 - - - {B102F27C-1A07-487F-BA5B-D5155D201112} - System.Windows.Forms-net_4_5 - - - - - - - diff --git a/mcs/class/System.Reactive.Windows.Threading/System.Reactive.Windows.Threading-net_4_5.csproj b/mcs/class/System.Reactive.Windows.Threading/System.Reactive.Windows.Threading-net_4_5.csproj deleted file mode 100644 index fadb4bbe074..00000000000 --- a/mcs/class/System.Reactive.Windows.Threading/System.Reactive.Windows.Threading-net_4_5.csproj +++ /dev/null @@ -1,128 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FC7ACFC5-81E9-4798-9D7F-067AEAD8A4D4} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Reactive.Windows.Threading - v4.5 - 512 - - - true - true - - - ../reactive.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {8E6ED7D5-3B08-4A83-905E-8FB4CF0C160D} - WindowsBase-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {EFA38650-CE13-4BF3-993D-70B238DB1C9E} - System.Reactive.Interfaces-net_4_5 - - - {4EF3C775-C516-4897-AB1D-DC9F8862A4D9} - System.Reactive.Core-net_4_5 - - - {EE831E49-3F84-4A05-9417-A9C8BD36E164} - System.Reactive.Linq-net_4_5 - - - {8E6ED7D5-3B08-4A83-905E-8FB4CF0C160D} - WindowsBase-net_4_5 - - - - - - - - System.Reactive.Strings_WindowsThreading.resources - - - - diff --git a/mcs/class/System.Runtime.Caching/System.Runtime.Caching-net_4_5.csproj b/mcs/class/System.Runtime.Caching/System.Runtime.Caching-net_4_5.csproj deleted file mode 100644 index 8746abfa6c8..00000000000 --- a/mcs/class/System.Runtime.Caching/System.Runtime.Caching-net_4_5.csproj +++ /dev/null @@ -1,148 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {CB3E9225-3DFF-4930-BFED-1E8AE5319C32} - Library - 1699,414 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Runtime.Caching - v4.5 - 512 - - - - true - full - 1699,414 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,414 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/System.Runtime.Caching/System.Runtime.Caching-tests-net_4_5.csproj b/mcs/class/System.Runtime.Caching/System.Runtime.Caching-tests-net_4_5.csproj deleted file mode 100644 index a66c3cb6c95..00000000000 --- a/mcs/class/System.Runtime.Caching/System.Runtime.Caching-tests-net_4_5.csproj +++ /dev/null @@ -1,105 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {98DDD6B7-792F-4E36-9ED0-141D0727D41F} - Library - 1699 - bin\Debug\System.Runtime.Caching-tests-net_4_5 - True - False - - Properties - - - System.Runtime.Caching_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {CB3E9225-3DFF-4930-BFED-1E8AE5319C32} - System.Runtime.Caching\System.Runtime.Caching-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data\System.Data-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration\System.Configuration-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/System.Runtime.DurableInstancing/System.Runtime.DurableInstancing-net_4_5.csproj b/mcs/class/System.Runtime.DurableInstancing/System.Runtime.DurableInstancing-net_4_5.csproj deleted file mode 100644 index cbb7b1c2157..00000000000 --- a/mcs/class/System.Runtime.DurableInstancing/System.Runtime.DurableInstancing-net_4_5.csproj +++ /dev/null @@ -1,158 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {04DAD425-06C0-481B-9787-D2D4BFF196F5} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Runtime.DurableInstancing - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {8328796E-8A15-4972-8F1E-2F15E7D57C42} - System.Xml.Linq-net_4_5 - - - {AF2BBF50-AB57-4CA1-8EF5-2B54C7418434} - System.Transactions-net_4_5 - - - {9C41A885-1D86-4508-B6F7-155D4B7BF441} - System.ServiceModel.Internals-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization-net_4_5 - - - - - - - diff --git a/mcs/class/System.Runtime.DurableInstancing/System.Runtime.DurableInstancing-tests-net_4_5.csproj b/mcs/class/System.Runtime.DurableInstancing/System.Runtime.DurableInstancing-tests-net_4_5.csproj deleted file mode 100644 index 5b089022e4a..00000000000 --- a/mcs/class/System.Runtime.DurableInstancing/System.Runtime.DurableInstancing-tests-net_4_5.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1EF37C09-E9CB-404B-BAF0-1877456C0799} - Library - 1699 - bin\Debug\System.Runtime.DurableInstancing-tests-net_4_5 - True - False - - Properties - - - System.Runtime.DurableInstancing_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {04DAD425-06C0-481B-9787-D2D4BFF196F5} - System.Runtime.DurableInstancing\System.Runtime.DurableInstancing-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {8328796E-8A15-4972-8F1E-2F15E7D57C42} - System.Xml.Linq\System.Xml.Linq-net_4_5 - - - - - - - diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-net_4_5.csproj b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-net_4_5.csproj deleted file mode 100644 index ad5cb5c30d6..00000000000 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-net_4_5.csproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {AD033C6B-F765-4B4D-B8D0-7C81C4194DAB} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Runtime.Remoting - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {B489C3DE-3ED3-4EDC-B42B-82B38E101857} - System.Web-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {B12AABBC-30D1-4885-BF3F-A53B970F68FB} - System.Runtime.Serialization.Formatters.Soap-net_4_5 - - - - - - - diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-tests-net_4_5.csproj b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-tests-net_4_5.csproj deleted file mode 100644 index 6f7d2059569..00000000000 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-tests-net_4_5.csproj +++ /dev/null @@ -1,120 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {024A9C29-BE48-4A14-8E88-D2B5E2F14ECF} - Library - 1699,618 - bin\Debug\System.Runtime.Remoting-tests-net_4_5 - True - False - - Properties - - - System.Runtime.Remoting_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {AD033C6B-F765-4B4D-B8D0-7C81C4194DAB} - System.Runtime.Remoting\System.Runtime.Remoting-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {85F119B8-8463-4D6F-9852-DAB8C4070BD5} - System.Web\System.Web-net_4_5-1 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {B12AABBC-30D1-4885-BF3F-A53B970F68FB} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_4_5 - - - {AD033C6B-F765-4B4D-B8D0-7C81C4194DAB} - System.Runtime.Remoting\System.Runtime.Remoting-net_4_5 - - - - - - - diff --git a/mcs/class/System.Runtime.Remoting/Test/IpcChannelTest.cs b/mcs/class/System.Runtime.Remoting/Test/IpcChannelTest.cs index 54a4146701f..831c69e72b5 100644 --- a/mcs/class/System.Runtime.Remoting/Test/IpcChannelTest.cs +++ b/mcs/class/System.Runtime.Remoting/Test/IpcChannelTest.cs @@ -28,6 +28,7 @@ namespace MonoTests.Remoting } [Test] + [Ignore ("https://bugzilla.xamarin.com/show_bug.cgi?id=36634")] public void Bug609381 () { string portName = "ipc" + Guid.NewGuid ().ToString ("N"); diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-net_4_5.csproj b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-net_4_5.csproj deleted file mode 100644 index eff509685c0..00000000000 --- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-net_4_5.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B12AABBC-30D1-4885-BF3F-A53B970F68FB} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Runtime.Serialization.Formatters.Soap - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - - - - - diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-tests-net_4_5.csproj b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-tests-net_4_5.csproj deleted file mode 100644 index 3efe2529383..00000000000 --- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-tests-net_4_5.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1013C4B5-DE6B-4861-A579-6EED7452E135} - Library - 1699,618,219,169 - bin\Debug\System.Runtime.Serialization.Formatters.Soap-tests-net_4_5 - True - False - - Properties - - - System.Runtime.Serialization.Formatters.Soap_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {B12AABBC-30D1-4885-BF3F-A53B970F68FB} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_4_5 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - - - - - diff --git a/mcs/class/System.Runtime.Serialization/ReferenceSources/XmlFormatWriterGenerator_static.cs b/mcs/class/System.Runtime.Serialization/ReferenceSources/XmlFormatWriterGenerator_static.cs index 00e39ab6b65..fdbcc77c5ba 100644 --- a/mcs/class/System.Runtime.Serialization/ReferenceSources/XmlFormatWriterGenerator_static.cs +++ b/mcs/class/System.Runtime.Serialization/ReferenceSources/XmlFormatWriterGenerator_static.cs @@ -469,8 +469,13 @@ namespace System.Runtime.Serialization PrimitiveDataContract primitiveContract = PrimitiveDataContract.GetPrimitiveDataContract(memberType); if (primitiveContract != null && !writeXsiType) primitiveContract.XmlFormatContentWriterMethod.Invoke (writer, new object [] {memberValue}); - else - InternalSerialize(XmlFormatGeneratorStatics.InternalSerializeMethod, () => memberValue, memberType, writeXsiType); + else { + // InternalSerialize(XmlFormatGeneratorStatics.InternalSerializeMethod, () => memberValue, memberType, writeXsiType); + var typeHandleValue = Type.GetTypeHandle (memberValue); + var isDeclaredType = typeHandleValue.Equals (CodeInterpreter.ConvertValue (memberValue, memberType, Globals.TypeOfObject)); + + ctx.InternalSerialize (writer, memberValue, isDeclaredType, writeXsiType, DataContract.GetId (memberType.TypeHandle), memberType.TypeHandle); + } } else { @@ -500,22 +505,19 @@ namespace System.Runtime.Serialization if (isNull2) { XmlFormatGeneratorStatics.WriteNullMethod.Invoke (ctx, new object [] {writer, memberType, DataContract.IsTypeSerializable(memberType)}); } else { - InternalSerialize((isNullableOfT ? XmlFormatGeneratorStatics.InternalSerializeMethod : XmlFormatGeneratorStatics.InternalSerializeReferenceMethod), - () => memberValue, memberType, writeXsiType); + var typeHandleValue = Type.GetTypeHandle (memberValue); + var isDeclaredType = typeHandleValue.Equals (CodeInterpreter.ConvertValue (memberValue, memberType, Globals.TypeOfObject)); + if (isNullableOfT) + ctx.InternalSerialize (writer, memberValue, isDeclaredType, writeXsiType, DataContract.GetId (memberType.TypeHandle), memberType.TypeHandle); + else + ctx.InternalSerializeReference (writer, memberValue, isDeclaredType, writeXsiType, DataContract.GetId (memberType.TypeHandle), memberType.TypeHandle); + //InternalSerialize((isNullableOfT ? XmlFormatGeneratorStatics.InternalSerializeMethod : XmlFormatGeneratorStatics.InternalSerializeReferenceMethod), () => memberValue, memberType, writeXsiType); } } } } } - void InternalSerialize (MethodInfo methodInfo, Func memberValue, Type memberType, bool writeXsiType) - { - var v = memberValue (); - var typeHandleValue = Type.GetTypeHandle (v); - var isDeclaredType = typeHandleValue.Equals (CodeInterpreter.ConvertValue (v, memberType, Globals.TypeOfObject)); - methodInfo.Invoke (ctx, new object [] {writer, memberValue != null ? v : null, isDeclaredType, writeXsiType, DataContract.GetId (memberType.TypeHandle), memberType.TypeHandle}); - } - object UnwrapNullableObject(Func memberValue, ref Type memberType, out bool isNull)// Leaves !HasValue on stack { object v = memberValue (); diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-net_4_5.csproj b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-net_4_5.csproj deleted file mode 100644 index d1251b47c82..00000000000 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-net_4_5.csproj +++ /dev/null @@ -1,272 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {08FF4C26-9C12-433D-AE90-43370046387A} - Library - 1699,168,169,219,414 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - System.Runtime.Serialization - v4.5 - 512 - - - - true - full - 1699,168,169,219,414 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NO_DYNAMIC_CODEGEN;NET_3_0 - prompt - 4 - - - pdbonly - 1699,168,169,219,414 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NO_DYNAMIC_CODEGEN;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {9C41A885-1D86-4508-B6F7-155D4B7BF441} - System.ServiceModel.Internals-net_4_5 - - - {643FEEB8-DDEB-4204-9C95-344BAA753C58} - SMDiagnostics-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - - - - - diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-tests-net_4_5.csproj b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-tests-net_4_5.csproj deleted file mode 100644 index 44cfc100138..00000000000 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-tests-net_4_5.csproj +++ /dev/null @@ -1,151 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4EC3A502-D982-45B0-80F5-AC9873D03434} - Library - 1699,168,169,219,414 - bin\Debug\System.Runtime.Serialization-tests-net_4_5 - True - False - - Properties - - - System.Runtime.Serialization_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,168,169,219,414 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;NET_3_0 - prompt - 4 - - - pdbonly - 1699,168,169,219,414 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data\System.Data-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration\System.Configuration-net_4_5 - - - {CB54BC7B-F3CD-43DC-B983-3FFFF41D01E1} - System.ServiceModel\System.ServiceModel-net_4_0-1 - - - {251DB111-FEE1-4080-8411-0AD1CC9BA94B} - System.Web.Services\System.Web.Services-net_4_5 - - - - - - - - mstypes.schema - - - collections.wsdl - - - custom-collections.wsdl - - - - diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization_test.dll.sources b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization_test.dll.sources index 3e9d83e63d7..59c7774eb07 100644 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization_test.dll.sources +++ b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization_test.dll.sources @@ -8,6 +8,7 @@ System.Runtime.Serialization/Bug2843Test.cs System.Runtime.Serialization/Bug3258Test.cs System.Runtime.Serialization/Bug242Test.cs System.Runtime.Serialization/Bug695203Test.cs +System.Runtime.Serialization/Bug36100.cs System.Runtime.Serialization/DataContractResolverTest.cs System.Runtime.Serialization/DataContractSerializerTest_DuplicateQName.cs System.Runtime.Serialization/DataContractSerializerTest_NullableWithDictionary.cs diff --git a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/Bug36100.cs b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/Bug36100.cs new file mode 100644 index 00000000000..0eb5fd5cac8 --- /dev/null +++ b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/Bug36100.cs @@ -0,0 +1,14381 @@ +using System; +using global::System.Runtime.Serialization; +using global::System.Diagnostics; +using global::System.ServiceModel; +using System.IO; +using NUnit.Framework; + +namespace MonoTests.System.Runtime.Serialization +{ + [TestFixture] + public class Bug36100 + { + // This test exposed an issue with our dynamic serializer support and + // would cause problems with static compilation on 64 bit devices in + // FullAOT mode. + [Test] + public void SerializerDynamicInvoke () + { + var a = new DingusSyncData (); + a.Aircraft = new AircraftDTO[] { new AircraftDTO () { } }; + a.AircraftTypes = new AircraftTypeDTO[] { new AircraftTypeDTO () }; + a.Airlines= new AirlineDTO[] { new AirlineDTO () }; + a.Airports= new AirportDTO[] { new AirportDTO() }; + a.Approaches= new ApproachDTO[] { new ApproachDTO() }; + a.ApproachesLegs= new ApproachesLegDTO[] { new ApproachesLegDTO() }; + a.Binaries= new BinaryCatalogDTO[] { new BinaryCatalogDTO() }; + a.Crews= new CrewDTO[] { new CrewDTO() }; + a.Days= new DayDTO[] { new DayDTO() }; + a.EmploymentEvents= new EmploymentEventDTO[] { new EmploymentEventDTO() }; + a.Events= new EventDTO[] { new EventDTO() }; + a.FlightDataInspection = new DataInspection (); + a.GlobalSettings= new GlobalSettingDTO[] { new GlobalSettingDTO() }; + a.Hotels= new HotelDTO[] { new HotelDTO() }; + a.Legs= new LegDTO[] { new LegDTO() }; + a.Notes= new NoteDTO[] { new NoteDTO() }; + a.PayperiodEvents= new PayperiodEventDTO[] { new PayperiodEventDTO() }; + a.PayrollCategories= new PayrollCategoryDTO[] { new PayrollCategoryDTO() }; + a.Payrolls= new PayrollDTO[] { new PayrollDTO() }; + a.Performances= new PerformanceDTO[] { new PerformanceDTO() }; + a.Positions= new PositionDTO[] { new PositionDTO() }; + a.ReglatoryOperationTypes= new ReglatoryOperationTypeDTO[] { new ReglatoryOperationTypeDTO() }; + a.Trips= new TripDTO[] { new TripDTO() }; + a.UserSettings= new UserSettingDTO[] { new UserSettingDTO() }; + + Console.WriteLine ("Size is: {0}", global::System.Runtime.InteropServices.Marshal.SizeOf(typeof(IntPtr))); + using (var ms = new MemoryStream ()) { + DataContractSerializer serializer = new DataContractSerializer (typeof(DingusSyncData)); + serializer.WriteObject (ms, a); + ms.Position = 0; + var b = serializer.ReadObject (ms); + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="DingusSyncData", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class DingusSyncData : object + { + + AircraftDTO[] AircraftField; + + AircraftTypeDTO[] AircraftTypesField; + + AirlineDTO[] AirlinesField; + + AirportDTO[] AirportsField; + + ApproachDTO[] ApproachesField; + + ApproachesLegDTO[] ApproachesLegsField; + + BinaryCatalogDTO[] BinariesField; + + CrewDTO[] CrewsField; + + DayDTO[] DaysField; + + EmploymentEventDTO[] EmploymentEventsField; + + EventDTO[] EventsField; + + DataInspection FlightDataInspectionField; + + GlobalSettingDTO[] GlobalSettingsField; + + HotelDTO[] HotelsField; + + LegDTO[] LegsField; + + NoteDTO[] NotesField; + + PayperiodEventDTO[] PayperiodEventsField; + + PayrollCategoryDTO[] PayrollCategoriesField; + + PayrollDTO[] PayrollsField; + + PerformanceDTO[] PerformancesField; + + PositionDTO[] PositionsField; + + ReglatoryOperationTypeDTO[] ReglatoryOperationTypesField; + + TripDTO[] TripsField; + + UserSettingDTO[] UserSettingsField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public AircraftDTO[] Aircraft + { + get + { + return this.AircraftField; + } + set + { + this.AircraftField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public AircraftTypeDTO[] AircraftTypes + { + get + { + return this.AircraftTypesField; + } + set + { + this.AircraftTypesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public AirlineDTO[] Airlines + { + get + { + return this.AirlinesField; + } + set + { + this.AirlinesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public AirportDTO[] Airports + { + get + { + return this.AirportsField; + } + set + { + this.AirportsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public ApproachDTO[] Approaches + { + get + { + return this.ApproachesField; + } + set + { + this.ApproachesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public ApproachesLegDTO[] ApproachesLegs + { + get + { + return this.ApproachesLegsField; + } + set + { + this.ApproachesLegsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public BinaryCatalogDTO[] Binaries + { + get + { + return this.BinariesField; + } + set + { + this.BinariesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public CrewDTO[] Crews + { + get + { + return this.CrewsField; + } + set + { + this.CrewsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public DayDTO[] Days + { + get + { + return this.DaysField; + } + set + { + this.DaysField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public EmploymentEventDTO[] EmploymentEvents + { + get + { + return this.EmploymentEventsField; + } + set + { + this.EmploymentEventsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public EventDTO[] Events + { + get + { + return this.EventsField; + } + set + { + this.EventsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public DataInspection FlightDataInspection + { + get + { + return this.FlightDataInspectionField; + } + set + { + this.FlightDataInspectionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public GlobalSettingDTO[] GlobalSettings + { + get + { + return this.GlobalSettingsField; + } + set + { + this.GlobalSettingsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public HotelDTO[] Hotels + { + get + { + return this.HotelsField; + } + set + { + this.HotelsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public LegDTO[] Legs + { + get + { + return this.LegsField; + } + set + { + this.LegsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public NoteDTO[] Notes + { + get + { + return this.NotesField; + } + set + { + this.NotesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public PayperiodEventDTO[] PayperiodEvents + { + get + { + return this.PayperiodEventsField; + } + set + { + this.PayperiodEventsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public PayrollCategoryDTO[] PayrollCategories + { + get + { + return this.PayrollCategoriesField; + } + set + { + this.PayrollCategoriesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public PayrollDTO[] Payrolls + { + get + { + return this.PayrollsField; + } + set + { + this.PayrollsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public PerformanceDTO[] Performances + { + get + { + return this.PerformancesField; + } + set + { + this.PerformancesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public PositionDTO[] Positions + { + get + { + return this.PositionsField; + } + set + { + this.PositionsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public ReglatoryOperationTypeDTO[] ReglatoryOperationTypes + { + get + { + return this.ReglatoryOperationTypesField; + } + set + { + this.ReglatoryOperationTypesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public TripDTO[] Trips + { + get + { + return this.TripsField; + } + set + { + this.TripsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public UserSettingDTO[] UserSettings + { + get + { + return this.UserSettingsField; + } + set + { + this.UserSettingsField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="DataInspection", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class DataInspection : object + { + + private int DayCountField; + + private int LegCountField; + + private Nullable MaxTripSequenceEndField; + + private Nullable MinTripSequenceStartField; + + private int TripCountField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int DayCount + { + get + { + return this.DayCountField; + } + set + { + this.DayCountField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int LegCount + { + get + { + return this.LegCountField; + } + set + { + this.LegCountField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable MaxTripSequenceEnd + { + get + { + return this.MaxTripSequenceEndField; + } + set + { + this.MaxTripSequenceEndField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable MinTripSequenceStart + { + get + { + return this.MinTripSequenceStartField; + } + set + { + this.MinTripSequenceStartField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int TripCount + { + get + { + return this.TripCountField; + } + set + { + this.TripCountField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="AircraftDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class AircraftDTO : object + { + + private string aircraftIdField; + + private string aircraftTypeIdField; + + private Nullable createdUtcField; + + private string currentAirlineIdField; + + private Nullable deletedField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string notesField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable payrateField; + + private Nullable previewField; + + private string previousAirlineIdField; + + private string registrationField; + + private string shipNumberField; + + private Nullable syncedField; + + private string tailField; + + private Nullable usePayrateField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string aircraftId + { + get + { + return this.aircraftIdField; + } + set + { + this.aircraftIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string aircraftTypeId + { + get + { + return this.aircraftTypeIdField; + } + set + { + this.aircraftTypeIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string currentAirlineId + { + get + { + return this.currentAirlineIdField; + } + set + { + this.currentAirlineIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notes + { + get + { + return this.notesField; + } + set + { + this.notesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable payrate + { + get + { + return this.payrateField; + } + set + { + this.payrateField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string previousAirlineId + { + get + { + return this.previousAirlineIdField; + } + set + { + this.previousAirlineIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string registration + { + get + { + return this.registrationField; + } + set + { + this.registrationField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string shipNumber + { + get + { + return this.shipNumberField; + } + set + { + this.shipNumberField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string tail + { + get + { + return this.tailField; + } + set + { + this.tailField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable usePayrate + { + get + { + return this.usePayrateField; + } + set + { + this.usePayrateField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="AircraftTypeDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class AircraftTypeDTO : object + { + + private string aircraftTypeIdField; + + private string aselField; + + private string configField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private string iconUrlField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable previewField; + + private Nullable selectableField; + + private Nullable syncedField; + + private string transportField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string aircraftTypeId + { + get + { + return this.aircraftTypeIdField; + } + set + { + this.aircraftTypeIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string asel + { + get + { + return this.aselField; + } + set + { + this.aselField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string config + { + get + { + return this.configField; + } + set + { + this.configField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string iconUrl + { + get + { + return this.iconUrlField; + } + set + { + this.iconUrlField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable selectable + { + get + { + return this.selectableField; + } + set + { + this.selectableField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string transport + { + get + { + return this.transportField; + } + set + { + this.transportField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="AirlineDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class AirlineDTO : object + { + + private string airlineIdField; + + private string airlineNameField; + + private string callSignField; + + private string countryField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private string icaoField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string nameField; + + private string phoneField; + + private Nullable previewField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string airlineId + { + get + { + return this.airlineIdField; + } + set + { + this.airlineIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string airlineName + { + get + { + return this.airlineNameField; + } + set + { + this.airlineNameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string callSign + { + get + { + return this.callSignField; + } + set + { + this.callSignField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string country + { + get + { + return this.countryField; + } + set + { + this.countryField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string icao + { + get + { + return this.icaoField; + } + set + { + this.icaoField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string name + { + get + { + return this.nameField; + } + set + { + this.nameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string phone + { + get + { + return this.phoneField; + } + set + { + this.phoneField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="AirportDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class AirportDTO : object + { + + private string airlineNameField; + + private string airportIdField; + + private string airportNameField; + + private Nullable communicationLevelField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private Nullable dstField; + + private string emailField; + + private string faaField; + + private string iataField; + + private string icaoField; + + private string idField; + + private Nullable lastUpdatedUtcField; + + private Nullable latitudeField; + + private string localityField; + + private string locationField; + + private Nullable longitudeField; + + private Nullable modelVersionField; + + private string nameField; + + private string notesField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private string olsentimezonenameField; + + private string phoneField; + + private string pictureField; + + private Nullable previewField; + + private Nullable privacyLevelField; + + private string regionField; + + private Nullable syncedField; + + private int userIdField; + + private Nullable utcoffsetField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string airlineName + { + get + { + return this.airlineNameField; + } + set + { + this.airlineNameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string airportId + { + get + { + return this.airportIdField; + } + set + { + this.airportIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string airportName + { + get + { + return this.airportNameField; + } + set + { + this.airportNameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable communicationLevel + { + get + { + return this.communicationLevelField; + } + set + { + this.communicationLevelField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable dst + { + get + { + return this.dstField; + } + set + { + this.dstField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string email + { + get + { + return this.emailField; + } + set + { + this.emailField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string faa + { + get + { + return this.faaField; + } + set + { + this.faaField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string iata + { + get + { + return this.iataField; + } + set + { + this.iataField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string icao + { + get + { + return this.icaoField; + } + set + { + this.icaoField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string id + { + get + { + return this.idField; + } + set + { + this.idField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable latitude + { + get + { + return this.latitudeField; + } + set + { + this.latitudeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string locality + { + get + { + return this.localityField; + } + set + { + this.localityField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string location + { + get + { + return this.locationField; + } + set + { + this.locationField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable longitude + { + get + { + return this.longitudeField; + } + set + { + this.longitudeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string name + { + get + { + return this.nameField; + } + set + { + this.nameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notes + { + get + { + return this.notesField; + } + set + { + this.notesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string olsentimezonename + { + get + { + return this.olsentimezonenameField; + } + set + { + this.olsentimezonenameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string phone + { + get + { + return this.phoneField; + } + set + { + this.phoneField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string picture + { + get + { + return this.pictureField; + } + set + { + this.pictureField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable privacyLevel + { + get + { + return this.privacyLevelField; + } + set + { + this.privacyLevelField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string region + { + get + { + return this.regionField; + } + set + { + this.regionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable utcoffset + { + get + { + return this.utcoffsetField; + } + set + { + this.utcoffsetField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="ApproachDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class ApproachDTO : object + { + + private string approachIdField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable previewField; + + private Nullable selectableField; + + private Nullable syncedField; + + private string typeField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string approachId + { + get + { + return this.approachIdField; + } + set + { + this.approachIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable selectable + { + get + { + return this.selectableField; + } + set + { + this.selectableField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string type + { + get + { + return this.typeField; + } + set + { + this.typeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="ApproachesLegDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class ApproachesLegDTO : object + { + + private string approachIdField; + + private string approachesLegsIdField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private Nullable lastUpdatedUtcField; + + private string legIdField; + + private Nullable modelVersionField; + + private Nullable previewField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string approachId + { + get + { + return this.approachIdField; + } + set + { + this.approachIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string approachesLegsId + { + get + { + return this.approachesLegsIdField; + } + set + { + this.approachesLegsIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string legId + { + get + { + return this.legIdField; + } + set + { + this.legIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="BinaryCatalogDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class BinaryCatalogDTO : object + { + + private global::System.Guid RowGuidField; + + private Nullable areaIdField; + + private string binaryCatalogIdField; + + private Nullable contentLengthField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private string filenameField; + + private string folderIdField; + + private Nullable isSecuredField; + + private Nullable lastUpdatedUtcField; + + private Nullable lastWriteTimeUtcField; + + private Nullable modelVersionField; + + private Nullable previewField; + + private Nullable syncedField; + + private string titleField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Guid RowGuid + { + get + { + return this.RowGuidField; + } + set + { + this.RowGuidField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable areaId + { + get + { + return this.areaIdField; + } + set + { + this.areaIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string binaryCatalogId + { + get + { + return this.binaryCatalogIdField; + } + set + { + this.binaryCatalogIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable contentLength + { + get + { + return this.contentLengthField; + } + set + { + this.contentLengthField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string filename + { + get + { + return this.filenameField; + } + set + { + this.filenameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string folderId + { + get + { + return this.folderIdField; + } + set + { + this.folderIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable isSecured + { + get + { + return this.isSecuredField; + } + set + { + this.isSecuredField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastWriteTimeUtc + { + get + { + return this.lastWriteTimeUtcField; + } + set + { + this.lastWriteTimeUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string title + { + get + { + return this.titleField; + } + set + { + this.titleField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="CrewDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class CrewDTO : object + { + + private Nullable communicationLevelField; + + private Nullable createdUtcField; + + private string crewIdField; + + private string crewNameField; + + private string currentAirlineIdField; + + private Nullable deletedField; + + private string emailField; + + private string facebookField; + + private string idField; + + private Nullable lastUpdatedUtcField; + + private string locationField; + + private Nullable modelVersionField; + + private string nameField; + + private string notesField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private string phoneField; + + private string pictureField; + + private string positionField; + + private Nullable previewField; + + private string previousAirlineIdField; + + private Nullable privacyLevelField; + + private Nullable syncedField; + + private string twitterField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable communicationLevel + { + get + { + return this.communicationLevelField; + } + set + { + this.communicationLevelField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string crewId + { + get + { + return this.crewIdField; + } + set + { + this.crewIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string crewName + { + get + { + return this.crewNameField; + } + set + { + this.crewNameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string currentAirlineId + { + get + { + return this.currentAirlineIdField; + } + set + { + this.currentAirlineIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string email + { + get + { + return this.emailField; + } + set + { + this.emailField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string facebook + { + get + { + return this.facebookField; + } + set + { + this.facebookField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string id + { + get + { + return this.idField; + } + set + { + this.idField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string location + { + get + { + return this.locationField; + } + set + { + this.locationField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string name + { + get + { + return this.nameField; + } + set + { + this.nameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notes + { + get + { + return this.notesField; + } + set + { + this.notesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string phone + { + get + { + return this.phoneField; + } + set + { + this.phoneField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string picture + { + get + { + return this.pictureField; + } + set + { + this.pictureField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string position + { + get + { + return this.positionField; + } + set + { + this.positionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string previousAirlineId + { + get + { + return this.previousAirlineIdField; + } + set + { + this.previousAirlineIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable privacyLevel + { + get + { + return this.privacyLevelField; + } + set + { + this.privacyLevelField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string twitter + { + get + { + return this.twitterField; + } + set + { + this.twitterField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="DayDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class DayDTO : object + { + + private Nullable blockField; + + private string calendarIdentifierField; + + private Nullable createdUtcField; + + private Nullable creditField; + + private string dayIdField; + + private Nullable deletedField; + + private Nullable dutyField; + + private Nullable dutyOffField; + + private Nullable dutyOnField; + + private Nullable fDPField; + + private Nullable fDPEndTimeField; + + private Nullable flightTimeField; + + private Nullable grossPayField; + + private string hotelIdField; + + private Nullable instrumentField; + + private Nullable landingsField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private Nullable nightField; + + private Nullable nightLandingsField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable overrideDutyOffField; + + private Nullable overrideDutyOnField; + + private Nullable previewField; + + private Nullable rdpField; + + private Nullable rdpBeginField; + + private Nullable rdpEndField; + + private Nullable scheduleBlockField; + + private Nullable splitDutyField; + + private Nullable splitDutyBeginField; + + private Nullable splitDutyEndField; + + private Nullable syncedField; + + private string tripIdField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable block + { + get + { + return this.blockField; + } + set + { + this.blockField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string calendarIdentifier + { + get + { + return this.calendarIdentifierField; + } + set + { + this.calendarIdentifierField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable credit + { + get + { + return this.creditField; + } + set + { + this.creditField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string dayId + { + get + { + return this.dayIdField; + } + set + { + this.dayIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable duty + { + get + { + return this.dutyField; + } + set + { + this.dutyField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable dutyOff + { + get + { + return this.dutyOffField; + } + set + { + this.dutyOffField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable dutyOn + { + get + { + return this.dutyOnField; + } + set + { + this.dutyOnField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable fDP + { + get + { + return this.fDPField; + } + set + { + this.fDPField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable fDPEndTime + { + get + { + return this.fDPEndTimeField; + } + set + { + this.fDPEndTimeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable flightTime + { + get + { + return this.flightTimeField; + } + set + { + this.flightTimeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable grossPay + { + get + { + return this.grossPayField; + } + set + { + this.grossPayField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string hotelId + { + get + { + return this.hotelIdField; + } + set + { + this.hotelIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable instrument + { + get + { + return this.instrumentField; + } + set + { + this.instrumentField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable landings + { + get + { + return this.landingsField; + } + set + { + this.landingsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable night + { + get + { + return this.nightField; + } + set + { + this.nightField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable nightLandings + { + get + { + return this.nightLandingsField; + } + set + { + this.nightLandingsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable overrideDutyOff + { + get + { + return this.overrideDutyOffField; + } + set + { + this.overrideDutyOffField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable overrideDutyOn + { + get + { + return this.overrideDutyOnField; + } + set + { + this.overrideDutyOnField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable rdp + { + get + { + return this.rdpField; + } + set + { + this.rdpField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable rdpBegin + { + get + { + return this.rdpBeginField; + } + set + { + this.rdpBeginField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable rdpEnd + { + get + { + return this.rdpEndField; + } + set + { + this.rdpEndField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable scheduleBlock + { + get + { + return this.scheduleBlockField; + } + set + { + this.scheduleBlockField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable splitDuty + { + get + { + return this.splitDutyField; + } + set + { + this.splitDutyField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable splitDutyBegin + { + get + { + return this.splitDutyBeginField; + } + set + { + this.splitDutyBeginField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable splitDutyEnd + { + get + { + return this.splitDutyEndField; + } + set + { + this.splitDutyEndField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string tripId + { + get + { + return this.tripIdField; + } + set + { + this.tripIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="EmploymentEventDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class EmploymentEventDTO : object + { + + private string airlineIdField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private string employmentEventIdField; + + private Nullable firstDateField; + + private Nullable lastDateField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private Nullable previewField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string airlineId + { + get + { + return this.airlineIdField; + } + set + { + this.airlineIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string employmentEventId + { + get + { + return this.employmentEventIdField; + } + set + { + this.employmentEventIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable firstDate + { + get + { + return this.firstDateField; + } + set + { + this.firstDateField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastDate + { + get + { + return this.lastDateField; + } + set + { + this.lastDateField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="EventDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class EventDTO : object + { + + private Nullable createdUtcField; + + private Nullable dateRangeField; + + private Nullable deletedField; + + private string eventIdField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable previewField; + + private Nullable syncedField; + + private string urlField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable dateRange + { + get + { + return this.dateRangeField; + } + set + { + this.dateRangeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string eventId + { + get + { + return this.eventIdField; + } + set + { + this.eventIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string url + { + get + { + return this.urlField; + } + set + { + this.urlField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="GlobalSettingDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class GlobalSettingDTO : object + { + + private string DescriptionField; + + private global::System.Guid GlobalSettingIdField; + + private global::System.DateTime LastUpdatedUtcField; + + private string SettingKeyField; + + private string SettingValueField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string Description + { + get + { + return this.DescriptionField; + } + set + { + this.DescriptionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Guid GlobalSettingId + { + get + { + return this.GlobalSettingIdField; + } + set + { + this.GlobalSettingIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.DateTime LastUpdatedUtc + { + get + { + return this.LastUpdatedUtcField; + } + set + { + this.LastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string SettingKey + { + get + { + return this.SettingKeyField; + } + set + { + this.SettingKeyField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string SettingValue + { + get + { + return this.SettingValueField; + } + set + { + this.SettingValueField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="HotelDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class HotelDTO : object + { + + private Nullable communicationLevelField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private string emailField; + + private string hotelIdField; + + private string hotelNameField; + + private Nullable lastUpdatedUtcField; + + private string locationField; + + private Nullable modelVersionField; + + private string nameField; + + private string notesField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private string numberField; + + private string phoneField; + + private string pictureField; + + private Nullable previewField; + + private Nullable privacyLevelField; + + private Nullable ratingsField; + + private string sharedNotesField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable communicationLevel + { + get + { + return this.communicationLevelField; + } + set + { + this.communicationLevelField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string email + { + get + { + return this.emailField; + } + set + { + this.emailField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string hotelId + { + get + { + return this.hotelIdField; + } + set + { + this.hotelIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string hotelName + { + get + { + return this.hotelNameField; + } + set + { + this.hotelNameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string location + { + get + { + return this.locationField; + } + set + { + this.locationField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string name + { + get + { + return this.nameField; + } + set + { + this.nameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notes + { + get + { + return this.notesField; + } + set + { + this.notesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string number + { + get + { + return this.numberField; + } + set + { + this.numberField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string phone + { + get + { + return this.phoneField; + } + set + { + this.phoneField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string picture + { + get + { + return this.pictureField; + } + set + { + this.pictureField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable privacyLevel + { + get + { + return this.privacyLevelField; + } + set + { + this.privacyLevelField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable ratings + { + get + { + return this.ratingsField; + } + set + { + this.ratingsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string sharedNotes + { + get + { + return this.sharedNotesField; + } + set + { + this.sharedNotesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="LegDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class LegDTO : object + { + + private Nullable actualBlockField; + + private string aircraftIdField; + + private string approachIdField; + + private string cabinCrewAIdField; + + private string cabinCrewBIdField; + + private string calendarIdentifierField; + + private string captainIdField; + + private Nullable completedField; + + private Nullable createdUtcField; + + private string dayIdField; + + private Nullable deletedField; + + private string departureAirportIdField; + + private string deptField; + + private string deptGateField; + + private string destField; + + private string destGateField; + + private string destinationAirportIdField; + + private Nullable etaField; + + private string firstOfficerIdField; + + private string flightNumberField; + + private Nullable flightTimeField; + + private Nullable inOOOIField; + + private Nullable instrumentField; + + private Nullable landingsField; + + private Nullable lastUpdatedUtcField; + + private string legIdField; + + private Nullable modelVersionField; + + private Nullable nightField; + + private Nullable nightLandingsField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable offOOOIField; + + private Nullable onOOOIField; + + private string operationTypeIdField; + + private string otherCrewAIdField; + + private string otherCrewBIdField; + + private Nullable outOOOIField; + + private string payIdField; + + private string positionIdField; + + private Nullable previewField; + + private string registrationField; + + private string remarksField; + + private Nullable scheduledBlockField; + + private Nullable scheduledInField; + + private Nullable scheduledOutField; + + private Nullable sequenceField; + + private Nullable syncedField; + + private Nullable taxiTimeInField; + + private Nullable taxiTimeOutField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable actualBlock + { + get + { + return this.actualBlockField; + } + set + { + this.actualBlockField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string aircraftId + { + get + { + return this.aircraftIdField; + } + set + { + this.aircraftIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string approachId + { + get + { + return this.approachIdField; + } + set + { + this.approachIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string cabinCrewAId + { + get + { + return this.cabinCrewAIdField; + } + set + { + this.cabinCrewAIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string cabinCrewBId + { + get + { + return this.cabinCrewBIdField; + } + set + { + this.cabinCrewBIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string calendarIdentifier + { + get + { + return this.calendarIdentifierField; + } + set + { + this.calendarIdentifierField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string captainId + { + get + { + return this.captainIdField; + } + set + { + this.captainIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable completed + { + get + { + return this.completedField; + } + set + { + this.completedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string dayId + { + get + { + return this.dayIdField; + } + set + { + this.dayIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string departureAirportId + { + get + { + return this.departureAirportIdField; + } + set + { + this.departureAirportIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string dept + { + get + { + return this.deptField; + } + set + { + this.deptField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string deptGate + { + get + { + return this.deptGateField; + } + set + { + this.deptGateField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string dest + { + get + { + return this.destField; + } + set + { + this.destField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string destGate + { + get + { + return this.destGateField; + } + set + { + this.destGateField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string destinationAirportId + { + get + { + return this.destinationAirportIdField; + } + set + { + this.destinationAirportIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable eta + { + get + { + return this.etaField; + } + set + { + this.etaField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string firstOfficerId + { + get + { + return this.firstOfficerIdField; + } + set + { + this.firstOfficerIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string flightNumber + { + get + { + return this.flightNumberField; + } + set + { + this.flightNumberField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable flightTime + { + get + { + return this.flightTimeField; + } + set + { + this.flightTimeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable inOOOI + { + get + { + return this.inOOOIField; + } + set + { + this.inOOOIField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable instrument + { + get + { + return this.instrumentField; + } + set + { + this.instrumentField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable landings + { + get + { + return this.landingsField; + } + set + { + this.landingsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string legId + { + get + { + return this.legIdField; + } + set + { + this.legIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable night + { + get + { + return this.nightField; + } + set + { + this.nightField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable nightLandings + { + get + { + return this.nightLandingsField; + } + set + { + this.nightLandingsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable offOOOI + { + get + { + return this.offOOOIField; + } + set + { + this.offOOOIField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable onOOOI + { + get + { + return this.onOOOIField; + } + set + { + this.onOOOIField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string operationTypeId + { + get + { + return this.operationTypeIdField; + } + set + { + this.operationTypeIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string otherCrewAId + { + get + { + return this.otherCrewAIdField; + } + set + { + this.otherCrewAIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string otherCrewBId + { + get + { + return this.otherCrewBIdField; + } + set + { + this.otherCrewBIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable outOOOI + { + get + { + return this.outOOOIField; + } + set + { + this.outOOOIField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string payId + { + get + { + return this.payIdField; + } + set + { + this.payIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string positionId + { + get + { + return this.positionIdField; + } + set + { + this.positionIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string registration + { + get + { + return this.registrationField; + } + set + { + this.registrationField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string remarks + { + get + { + return this.remarksField; + } + set + { + this.remarksField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable scheduledBlock + { + get + { + return this.scheduledBlockField; + } + set + { + this.scheduledBlockField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable scheduledIn + { + get + { + return this.scheduledInField; + } + set + { + this.scheduledInField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable scheduledOut + { + get + { + return this.scheduledOutField; + } + set + { + this.scheduledOutField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable taxiTimeIn + { + get + { + return this.taxiTimeInField; + } + set + { + this.taxiTimeInField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable taxiTimeOut + { + get + { + return this.taxiTimeOutField; + } + set + { + this.taxiTimeOutField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="NoteDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class NoteDTO : object + { + + private Nullable createdUtcField; + + private Nullable deletedField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string note1Field; + + private string noteIdField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable previewField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string note1 + { + get + { + return this.note1Field; + } + set + { + this.note1Field = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string noteId + { + get + { + return this.noteIdField; + } + set + { + this.noteIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="PayperiodEventDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class PayperiodEventDTO : object + { + + private string airlineIdField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private Nullable firstDateField; + + private Nullable lastDateField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string payperiodEventIdField; + + private string periodDescriptionField; + + private Nullable previewField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string airlineId + { + get + { + return this.airlineIdField; + } + set + { + this.airlineIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable firstDate + { + get + { + return this.firstDateField; + } + set + { + this.firstDateField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastDate + { + get + { + return this.lastDateField; + } + set + { + this.lastDateField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string payperiodEventId + { + get + { + return this.payperiodEventIdField; + } + set + { + this.payperiodEventIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string periodDescription + { + get + { + return this.periodDescriptionField; + } + set + { + this.periodDescriptionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="PayrollCategoryDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class PayrollCategoryDTO : object + { + + private Nullable aboveGuaranteeField; + + private Nullable applyRigField; + + private Nullable applyToFlightTimeField; + + private Nullable applyToLegalityField; + + private Nullable applyToPayField; + + private Nullable copyLegField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private Nullable lastUpdatedUtcField; + + private Nullable minimumCreditField; + + private Nullable modelVersionField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable overridePayField; + + private Nullable payrateField; + + private string payrollCategoriesIdField; + + private string plainDescriptionField; + + private Nullable previewField; + + private Nullable rigAField; + + private Nullable rigBField; + + private Nullable selectableField; + + private Nullable setAllLegsField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable aboveGuarantee + { + get + { + return this.aboveGuaranteeField; + } + set + { + this.aboveGuaranteeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable applyRig + { + get + { + return this.applyRigField; + } + set + { + this.applyRigField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable applyToFlightTime + { + get + { + return this.applyToFlightTimeField; + } + set + { + this.applyToFlightTimeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable applyToLegality + { + get + { + return this.applyToLegalityField; + } + set + { + this.applyToLegalityField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable applyToPay + { + get + { + return this.applyToPayField; + } + set + { + this.applyToPayField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable copyLeg + { + get + { + return this.copyLegField; + } + set + { + this.copyLegField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable minimumCredit + { + get + { + return this.minimumCreditField; + } + set + { + this.minimumCreditField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable overridePay + { + get + { + return this.overridePayField; + } + set + { + this.overridePayField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable payrate + { + get + { + return this.payrateField; + } + set + { + this.payrateField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string payrollCategoriesId + { + get + { + return this.payrollCategoriesIdField; + } + set + { + this.payrollCategoriesIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string plainDescription + { + get + { + return this.plainDescriptionField; + } + set + { + this.plainDescriptionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable rigA + { + get + { + return this.rigAField; + } + set + { + this.rigAField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable rigB + { + get + { + return this.rigBField; + } + set + { + this.rigBField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable selectable + { + get + { + return this.selectableField; + } + set + { + this.selectableField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable setAllLegs + { + get + { + return this.setAllLegsField; + } + set + { + this.setAllLegsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="PayrollDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class PayrollDTO : object + { + + private Nullable actualField; + + private Nullable createdUtcField; + + private Nullable creditField; + + private Nullable deletedField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private string payrollCategoriesIdField; + + private string payrollIdField; + + private Nullable previewField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable actual + { + get + { + return this.actualField; + } + set + { + this.actualField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable credit + { + get + { + return this.creditField; + } + set + { + this.creditField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string payrollCategoriesId + { + get + { + return this.payrollCategoriesIdField; + } + set + { + this.payrollCategoriesIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string payrollId + { + get + { + return this.payrollIdField; + } + set + { + this.payrollIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="PerformanceDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class PerformanceDTO : object + { + + private Nullable actualField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private Nullable deviatedField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private string performanceIdField; + + private Nullable plannedFuelField; + + private Nullable previewField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable actual + { + get + { + return this.actualField; + } + set + { + this.actualField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deviated + { + get + { + return this.deviatedField; + } + set + { + this.deviatedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string performanceId + { + get + { + return this.performanceIdField; + } + set + { + this.performanceIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable plannedFuel + { + get + { + return this.plannedFuelField; + } + set + { + this.plannedFuelField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="PositionDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class PositionDTO : object + { + + private Nullable autoNightLandingField; + + private Nullable checkAirmanField; + + private Nullable createdUtcField; + + private Nullable creditLandingField; + + private Nullable deletedField; + + private Nullable ioeField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable pilotFlyingField; + + private Nullable pilotInCommandField; + + private string position1Field; + + private string positionIdField; + + private Nullable previewField; + + private Nullable selectableField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable autoNightLanding + { + get + { + return this.autoNightLandingField; + } + set + { + this.autoNightLandingField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable checkAirman + { + get + { + return this.checkAirmanField; + } + set + { + this.checkAirmanField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable creditLanding + { + get + { + return this.creditLandingField; + } + set + { + this.creditLandingField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable ioe + { + get + { + return this.ioeField; + } + set + { + this.ioeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable pilotFlying + { + get + { + return this.pilotFlyingField; + } + set + { + this.pilotFlyingField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable pilotInCommand + { + get + { + return this.pilotInCommandField; + } + set + { + this.pilotInCommandField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string position1 + { + get + { + return this.position1Field; + } + set + { + this.position1Field = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string positionId + { + get + { + return this.positionIdField; + } + set + { + this.positionIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable selectable + { + get + { + return this.selectableField; + } + set + { + this.selectableField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="ReglatoryOperationTypeDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class ReglatoryOperationTypeDTO : object + { + + private Nullable activeField; + + private Nullable canMixOperationsField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string operationAbvreviationField; + + private string operationDescriptionField; + + private Nullable previewField; + + private string reglatoryOperationTypesIdField; + + private string schemaURLField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable active + { + get + { + return this.activeField; + } + set + { + this.activeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable canMixOperations + { + get + { + return this.canMixOperationsField; + } + set + { + this.canMixOperationsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string operationAbvreviation + { + get + { + return this.operationAbvreviationField; + } + set + { + this.operationAbvreviationField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string operationDescription + { + get + { + return this.operationDescriptionField; + } + set + { + this.operationDescriptionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string reglatoryOperationTypesId + { + get + { + return this.reglatoryOperationTypesIdField; + } + set + { + this.reglatoryOperationTypesIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string schemaURL + { + get + { + return this.schemaURLField; + } + set + { + this.schemaURLField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="TripDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class TripDTO : object + { + + private bool activeField; + + private string calendarIdentifierField; + + private Nullable completedField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable previewField; + + private Nullable seqEndTimeField; + + private Nullable seqStartTimeField; + + private Nullable syncedField; + + private Nullable tafbField; + + private Nullable totalBlockField; + + private Nullable totalCreditField; + + private Nullable totalFlightTimeField; + + private Nullable totalInstrumentField; + + private Nullable totalLandingsField; + + private Nullable totalNightField; + + private Nullable totalNightLandingsField; + + private Nullable totalPayFField; + + private string tripIdField; + + private string tripNumberField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public bool active + { + get + { + return this.activeField; + } + set + { + this.activeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string calendarIdentifier + { + get + { + return this.calendarIdentifierField; + } + set + { + this.calendarIdentifierField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable completed + { + get + { + return this.completedField; + } + set + { + this.completedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable seqEndTime + { + get + { + return this.seqEndTimeField; + } + set + { + this.seqEndTimeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable seqStartTime + { + get + { + return this.seqStartTimeField; + } + set + { + this.seqStartTimeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable tafb + { + get + { + return this.tafbField; + } + set + { + this.tafbField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable totalBlock + { + get + { + return this.totalBlockField; + } + set + { + this.totalBlockField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable totalCredit + { + get + { + return this.totalCreditField; + } + set + { + this.totalCreditField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable totalFlightTime + { + get + { + return this.totalFlightTimeField; + } + set + { + this.totalFlightTimeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable totalInstrument + { + get + { + return this.totalInstrumentField; + } + set + { + this.totalInstrumentField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable totalLandings + { + get + { + return this.totalLandingsField; + } + set + { + this.totalLandingsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable totalNight + { + get + { + return this.totalNightField; + } + set + { + this.totalNightField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable totalNightLandings + { + get + { + return this.totalNightLandingsField; + } + set + { + this.totalNightLandingsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable totalPayF + { + get + { + return this.totalPayFField; + } + set + { + this.totalPayFField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string tripId + { + get + { + return this.tripIdField; + } + set + { + this.tripIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string tripNumber + { + get + { + return this.tripNumberField; + } + set + { + this.tripNumberField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="UserSettingDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class UserSettingDTO : object + { + + private Nullable createdUtcField; + + private Nullable deletedField; + + private string keyField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable previewField; + + private string stringValueField; + + private Nullable syncedField; + + private int userIdField; + + private string userSettingIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string key + { + get + { + return this.keyField; + } + set + { + this.keyField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string stringValue + { + get + { + return this.stringValueField; + } + set + { + this.stringValueField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string userSettingId + { + get + { + return this.userSettingIdField; + } + set + { + this.userSettingIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="DingusSyncResponse", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class DingusSyncResponse : object + { + + DingusSyncData CloudDataField; + + private string StatusField; + + private bool SuccessField; + + private global::System.DateTime SyncDateLineField; + + private long SyncDurationField; + + private global::System.DateTime SyncEndedField; + + private global::System.DateTime SyncStartedField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public DingusSyncData CloudData + { + get + { + return this.CloudDataField; + } + set + { + this.CloudDataField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string Status + { + get + { + return this.StatusField; + } + set + { + this.StatusField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public bool Success + { + get + { + return this.SuccessField; + } + set + { + this.SuccessField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.DateTime SyncDateLine + { + get + { + return this.SyncDateLineField; + } + set + { + this.SyncDateLineField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public long SyncDuration + { + get + { + return this.SyncDurationField; + } + set + { + this.SyncDurationField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.DateTime SyncEnded + { + get + { + return this.SyncEndedField; + } + set + { + this.SyncEndedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.DateTime SyncStarted + { + get + { + return this.SyncStartedField; + } + set + { + this.SyncStartedField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="BinaryTransferResponse", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class BinaryTransferResponse : object + { + + private string ErrorMessageField; + + private bool SuccessField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string ErrorMessage + { + get + { + return this.ErrorMessageField; + } + set + { + this.ErrorMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public bool Success + { + get + { + return this.SuccessField; + } + set + { + this.SuccessField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="SyncStatus", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class SyncStatus : object + { + + EntitySyncState[] SyncStateField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public EntitySyncState[] SyncState + { + get + { + return this.SyncStateField; + } + set + { + this.SyncStateField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="EntitySyncState", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class EntitySyncState : object + { + + private string EntityNameField; + + private Nullable LastUpdatedUtcField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string EntityName + { + get + { + return this.EntityNameField; + } + set + { + this.EntityNameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable LastUpdatedUtc + { + get + { + return this.LastUpdatedUtcField; + } + set + { + this.LastUpdatedUtcField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="TaxiTime", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class TaxiTime : object + { + + private string AirportField; + + private int TaxiInAvgField; + + private int TaxiOutAvgField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string Airport + { + get + { + return this.AirportField; + } + set + { + this.AirportField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int TaxiInAvg + { + get + { + return this.TaxiInAvgField; + } + set + { + this.TaxiInAvgField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int TaxiOutAvg + { + get + { + return this.TaxiOutAvgField; + } + set + { + this.TaxiOutAvgField = value; + } + } + } +} + + +namespace host +{ + public class AppDelegate + { + static void Main () + { + var a = new DingusSyncData (); + a.Aircraft = new AircraftDTO[] { new AircraftDTO () { } }; + a.AircraftTypes = new AircraftTypeDTO[] { new AircraftTypeDTO () }; + a.Airlines= new AirlineDTO[] { new AirlineDTO () }; + a.Airports= new AirportDTO[] { new AirportDTO() }; + a.Approaches= new ApproachDTO[] { new ApproachDTO() }; + a.ApproachesLegs= new ApproachesLegDTO[] { new ApproachesLegDTO() }; + a.Binaries= new BinaryCatalogDTO[] { new BinaryCatalogDTO() }; + a.Crews= new CrewDTO[] { new CrewDTO() }; + a.Days= new DayDTO[] { new DayDTO() }; + a.EmploymentEvents= new EmploymentEventDTO[] { new EmploymentEventDTO() }; + a.Events= new EventDTO[] { new EventDTO() }; + a.FlightDataInspection = new DataInspection (); + a.GlobalSettings= new GlobalSettingDTO[] { new GlobalSettingDTO() }; + a.Hotels= new HotelDTO[] { new HotelDTO() }; + a.Legs= new LegDTO[] { new LegDTO() }; + a.Notes= new NoteDTO[] { new NoteDTO() }; + a.PayperiodEvents= new PayperiodEventDTO[] { new PayperiodEventDTO() }; + a.PayrollCategories= new PayrollCategoryDTO[] { new PayrollCategoryDTO() }; + a.Payrolls= new PayrollDTO[] { new PayrollDTO() }; + a.Performances= new PerformanceDTO[] { new PerformanceDTO() }; + a.Positions= new PositionDTO[] { new PositionDTO() }; + a.ReglatoryOperationTypes= new ReglatoryOperationTypeDTO[] { new ReglatoryOperationTypeDTO() }; + a.Trips= new TripDTO[] { new TripDTO() }; + a.UserSettings= new UserSettingDTO[] { new UserSettingDTO() }; + + Console.WriteLine ("Size is: {0}", global::System.Runtime.InteropServices.Marshal.SizeOf(typeof(IntPtr))); + using (var ms = new MemoryStream ()) { + DataContractSerializer serializer = new DataContractSerializer (typeof(DingusSyncData)); + serializer.WriteObject (ms, a); + ms.Position = 0; + var b = serializer.ReadObject (ms); + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="DingusSyncData", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class DingusSyncData : object + { + + AircraftDTO[] AircraftField; + + AircraftTypeDTO[] AircraftTypesField; + + AirlineDTO[] AirlinesField; + + AirportDTO[] AirportsField; + + ApproachDTO[] ApproachesField; + + ApproachesLegDTO[] ApproachesLegsField; + + BinaryCatalogDTO[] BinariesField; + + CrewDTO[] CrewsField; + + DayDTO[] DaysField; + + EmploymentEventDTO[] EmploymentEventsField; + + EventDTO[] EventsField; + + DataInspection FlightDataInspectionField; + + GlobalSettingDTO[] GlobalSettingsField; + + HotelDTO[] HotelsField; + + LegDTO[] LegsField; + + NoteDTO[] NotesField; + + PayperiodEventDTO[] PayperiodEventsField; + + PayrollCategoryDTO[] PayrollCategoriesField; + + PayrollDTO[] PayrollsField; + + PerformanceDTO[] PerformancesField; + + PositionDTO[] PositionsField; + + ReglatoryOperationTypeDTO[] ReglatoryOperationTypesField; + + TripDTO[] TripsField; + + UserSettingDTO[] UserSettingsField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public AircraftDTO[] Aircraft + { + get + { + return this.AircraftField; + } + set + { + this.AircraftField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public AircraftTypeDTO[] AircraftTypes + { + get + { + return this.AircraftTypesField; + } + set + { + this.AircraftTypesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public AirlineDTO[] Airlines + { + get + { + return this.AirlinesField; + } + set + { + this.AirlinesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public AirportDTO[] Airports + { + get + { + return this.AirportsField; + } + set + { + this.AirportsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public ApproachDTO[] Approaches + { + get + { + return this.ApproachesField; + } + set + { + this.ApproachesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public ApproachesLegDTO[] ApproachesLegs + { + get + { + return this.ApproachesLegsField; + } + set + { + this.ApproachesLegsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public BinaryCatalogDTO[] Binaries + { + get + { + return this.BinariesField; + } + set + { + this.BinariesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public CrewDTO[] Crews + { + get + { + return this.CrewsField; + } + set + { + this.CrewsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public DayDTO[] Days + { + get + { + return this.DaysField; + } + set + { + this.DaysField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public EmploymentEventDTO[] EmploymentEvents + { + get + { + return this.EmploymentEventsField; + } + set + { + this.EmploymentEventsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public EventDTO[] Events + { + get + { + return this.EventsField; + } + set + { + this.EventsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public DataInspection FlightDataInspection + { + get + { + return this.FlightDataInspectionField; + } + set + { + this.FlightDataInspectionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public GlobalSettingDTO[] GlobalSettings + { + get + { + return this.GlobalSettingsField; + } + set + { + this.GlobalSettingsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public HotelDTO[] Hotels + { + get + { + return this.HotelsField; + } + set + { + this.HotelsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public LegDTO[] Legs + { + get + { + return this.LegsField; + } + set + { + this.LegsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public NoteDTO[] Notes + { + get + { + return this.NotesField; + } + set + { + this.NotesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public PayperiodEventDTO[] PayperiodEvents + { + get + { + return this.PayperiodEventsField; + } + set + { + this.PayperiodEventsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public PayrollCategoryDTO[] PayrollCategories + { + get + { + return this.PayrollCategoriesField; + } + set + { + this.PayrollCategoriesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public PayrollDTO[] Payrolls + { + get + { + return this.PayrollsField; + } + set + { + this.PayrollsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public PerformanceDTO[] Performances + { + get + { + return this.PerformancesField; + } + set + { + this.PerformancesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public PositionDTO[] Positions + { + get + { + return this.PositionsField; + } + set + { + this.PositionsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public ReglatoryOperationTypeDTO[] ReglatoryOperationTypes + { + get + { + return this.ReglatoryOperationTypesField; + } + set + { + this.ReglatoryOperationTypesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public TripDTO[] Trips + { + get + { + return this.TripsField; + } + set + { + this.TripsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public UserSettingDTO[] UserSettings + { + get + { + return this.UserSettingsField; + } + set + { + this.UserSettingsField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="DataInspection", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class DataInspection : object + { + + private int DayCountField; + + private int LegCountField; + + private Nullable MaxTripSequenceEndField; + + private Nullable MinTripSequenceStartField; + + private int TripCountField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int DayCount + { + get + { + return this.DayCountField; + } + set + { + this.DayCountField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int LegCount + { + get + { + return this.LegCountField; + } + set + { + this.LegCountField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable MaxTripSequenceEnd + { + get + { + return this.MaxTripSequenceEndField; + } + set + { + this.MaxTripSequenceEndField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable MinTripSequenceStart + { + get + { + return this.MinTripSequenceStartField; + } + set + { + this.MinTripSequenceStartField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int TripCount + { + get + { + return this.TripCountField; + } + set + { + this.TripCountField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="AircraftDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class AircraftDTO : object + { + + private string aircraftIdField; + + private string aircraftTypeIdField; + + private Nullable createdUtcField; + + private string currentAirlineIdField; + + private Nullable deletedField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string notesField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable payrateField; + + private Nullable previewField; + + private string previousAirlineIdField; + + private string registrationField; + + private string shipNumberField; + + private Nullable syncedField; + + private string tailField; + + private Nullable usePayrateField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string aircraftId + { + get + { + return this.aircraftIdField; + } + set + { + this.aircraftIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string aircraftTypeId + { + get + { + return this.aircraftTypeIdField; + } + set + { + this.aircraftTypeIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string currentAirlineId + { + get + { + return this.currentAirlineIdField; + } + set + { + this.currentAirlineIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notes + { + get + { + return this.notesField; + } + set + { + this.notesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable payrate + { + get + { + return this.payrateField; + } + set + { + this.payrateField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string previousAirlineId + { + get + { + return this.previousAirlineIdField; + } + set + { + this.previousAirlineIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string registration + { + get + { + return this.registrationField; + } + set + { + this.registrationField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string shipNumber + { + get + { + return this.shipNumberField; + } + set + { + this.shipNumberField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string tail + { + get + { + return this.tailField; + } + set + { + this.tailField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable usePayrate + { + get + { + return this.usePayrateField; + } + set + { + this.usePayrateField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="AircraftTypeDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class AircraftTypeDTO : object + { + + private string aircraftTypeIdField; + + private string aselField; + + private string configField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private string iconUrlField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable previewField; + + private Nullable selectableField; + + private Nullable syncedField; + + private string transportField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string aircraftTypeId + { + get + { + return this.aircraftTypeIdField; + } + set + { + this.aircraftTypeIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string asel + { + get + { + return this.aselField; + } + set + { + this.aselField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string config + { + get + { + return this.configField; + } + set + { + this.configField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string iconUrl + { + get + { + return this.iconUrlField; + } + set + { + this.iconUrlField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable selectable + { + get + { + return this.selectableField; + } + set + { + this.selectableField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string transport + { + get + { + return this.transportField; + } + set + { + this.transportField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="AirlineDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class AirlineDTO : object + { + + private string airlineIdField; + + private string airlineNameField; + + private string callSignField; + + private string countryField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private string icaoField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string nameField; + + private string phoneField; + + private Nullable previewField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string airlineId + { + get + { + return this.airlineIdField; + } + set + { + this.airlineIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string airlineName + { + get + { + return this.airlineNameField; + } + set + { + this.airlineNameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string callSign + { + get + { + return this.callSignField; + } + set + { + this.callSignField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string country + { + get + { + return this.countryField; + } + set + { + this.countryField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string icao + { + get + { + return this.icaoField; + } + set + { + this.icaoField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string name + { + get + { + return this.nameField; + } + set + { + this.nameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string phone + { + get + { + return this.phoneField; + } + set + { + this.phoneField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="AirportDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class AirportDTO : object + { + + private string airlineNameField; + + private string airportIdField; + + private string airportNameField; + + private Nullable communicationLevelField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private Nullable dstField; + + private string emailField; + + private string faaField; + + private string iataField; + + private string icaoField; + + private string idField; + + private Nullable lastUpdatedUtcField; + + private Nullable latitudeField; + + private string localityField; + + private string locationField; + + private Nullable longitudeField; + + private Nullable modelVersionField; + + private string nameField; + + private string notesField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private string olsentimezonenameField; + + private string phoneField; + + private string pictureField; + + private Nullable previewField; + + private Nullable privacyLevelField; + + private string regionField; + + private Nullable syncedField; + + private int userIdField; + + private Nullable utcoffsetField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string airlineName + { + get + { + return this.airlineNameField; + } + set + { + this.airlineNameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string airportId + { + get + { + return this.airportIdField; + } + set + { + this.airportIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string airportName + { + get + { + return this.airportNameField; + } + set + { + this.airportNameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable communicationLevel + { + get + { + return this.communicationLevelField; + } + set + { + this.communicationLevelField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable dst + { + get + { + return this.dstField; + } + set + { + this.dstField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string email + { + get + { + return this.emailField; + } + set + { + this.emailField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string faa + { + get + { + return this.faaField; + } + set + { + this.faaField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string iata + { + get + { + return this.iataField; + } + set + { + this.iataField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string icao + { + get + { + return this.icaoField; + } + set + { + this.icaoField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string id + { + get + { + return this.idField; + } + set + { + this.idField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable latitude + { + get + { + return this.latitudeField; + } + set + { + this.latitudeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string locality + { + get + { + return this.localityField; + } + set + { + this.localityField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string location + { + get + { + return this.locationField; + } + set + { + this.locationField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable longitude + { + get + { + return this.longitudeField; + } + set + { + this.longitudeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string name + { + get + { + return this.nameField; + } + set + { + this.nameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notes + { + get + { + return this.notesField; + } + set + { + this.notesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string olsentimezonename + { + get + { + return this.olsentimezonenameField; + } + set + { + this.olsentimezonenameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string phone + { + get + { + return this.phoneField; + } + set + { + this.phoneField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string picture + { + get + { + return this.pictureField; + } + set + { + this.pictureField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable privacyLevel + { + get + { + return this.privacyLevelField; + } + set + { + this.privacyLevelField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string region + { + get + { + return this.regionField; + } + set + { + this.regionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable utcoffset + { + get + { + return this.utcoffsetField; + } + set + { + this.utcoffsetField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="ApproachDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class ApproachDTO : object + { + + private string approachIdField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable previewField; + + private Nullable selectableField; + + private Nullable syncedField; + + private string typeField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string approachId + { + get + { + return this.approachIdField; + } + set + { + this.approachIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable selectable + { + get + { + return this.selectableField; + } + set + { + this.selectableField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string type + { + get + { + return this.typeField; + } + set + { + this.typeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="ApproachesLegDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class ApproachesLegDTO : object + { + + private string approachIdField; + + private string approachesLegsIdField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private Nullable lastUpdatedUtcField; + + private string legIdField; + + private Nullable modelVersionField; + + private Nullable previewField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string approachId + { + get + { + return this.approachIdField; + } + set + { + this.approachIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string approachesLegsId + { + get + { + return this.approachesLegsIdField; + } + set + { + this.approachesLegsIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string legId + { + get + { + return this.legIdField; + } + set + { + this.legIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="BinaryCatalogDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class BinaryCatalogDTO : object + { + + private global::System.Guid RowGuidField; + + private Nullable areaIdField; + + private string binaryCatalogIdField; + + private Nullable contentLengthField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private string filenameField; + + private string folderIdField; + + private Nullable isSecuredField; + + private Nullable lastUpdatedUtcField; + + private Nullable lastWriteTimeUtcField; + + private Nullable modelVersionField; + + private Nullable previewField; + + private Nullable syncedField; + + private string titleField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Guid RowGuid + { + get + { + return this.RowGuidField; + } + set + { + this.RowGuidField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable areaId + { + get + { + return this.areaIdField; + } + set + { + this.areaIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string binaryCatalogId + { + get + { + return this.binaryCatalogIdField; + } + set + { + this.binaryCatalogIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable contentLength + { + get + { + return this.contentLengthField; + } + set + { + this.contentLengthField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string filename + { + get + { + return this.filenameField; + } + set + { + this.filenameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string folderId + { + get + { + return this.folderIdField; + } + set + { + this.folderIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable isSecured + { + get + { + return this.isSecuredField; + } + set + { + this.isSecuredField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastWriteTimeUtc + { + get + { + return this.lastWriteTimeUtcField; + } + set + { + this.lastWriteTimeUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string title + { + get + { + return this.titleField; + } + set + { + this.titleField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="CrewDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class CrewDTO : object + { + + private Nullable communicationLevelField; + + private Nullable createdUtcField; + + private string crewIdField; + + private string crewNameField; + + private string currentAirlineIdField; + + private Nullable deletedField; + + private string emailField; + + private string facebookField; + + private string idField; + + private Nullable lastUpdatedUtcField; + + private string locationField; + + private Nullable modelVersionField; + + private string nameField; + + private string notesField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private string phoneField; + + private string pictureField; + + private string positionField; + + private Nullable previewField; + + private string previousAirlineIdField; + + private Nullable privacyLevelField; + + private Nullable syncedField; + + private string twitterField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable communicationLevel + { + get + { + return this.communicationLevelField; + } + set + { + this.communicationLevelField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string crewId + { + get + { + return this.crewIdField; + } + set + { + this.crewIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string crewName + { + get + { + return this.crewNameField; + } + set + { + this.crewNameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string currentAirlineId + { + get + { + return this.currentAirlineIdField; + } + set + { + this.currentAirlineIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string email + { + get + { + return this.emailField; + } + set + { + this.emailField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string facebook + { + get + { + return this.facebookField; + } + set + { + this.facebookField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string id + { + get + { + return this.idField; + } + set + { + this.idField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string location + { + get + { + return this.locationField; + } + set + { + this.locationField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string name + { + get + { + return this.nameField; + } + set + { + this.nameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notes + { + get + { + return this.notesField; + } + set + { + this.notesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string phone + { + get + { + return this.phoneField; + } + set + { + this.phoneField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string picture + { + get + { + return this.pictureField; + } + set + { + this.pictureField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string position + { + get + { + return this.positionField; + } + set + { + this.positionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string previousAirlineId + { + get + { + return this.previousAirlineIdField; + } + set + { + this.previousAirlineIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable privacyLevel + { + get + { + return this.privacyLevelField; + } + set + { + this.privacyLevelField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string twitter + { + get + { + return this.twitterField; + } + set + { + this.twitterField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="DayDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class DayDTO : object + { + + private Nullable blockField; + + private string calendarIdentifierField; + + private Nullable createdUtcField; + + private Nullable creditField; + + private string dayIdField; + + private Nullable deletedField; + + private Nullable dutyField; + + private Nullable dutyOffField; + + private Nullable dutyOnField; + + private Nullable fDPField; + + private Nullable fDPEndTimeField; + + private Nullable flightTimeField; + + private Nullable grossPayField; + + private string hotelIdField; + + private Nullable instrumentField; + + private Nullable landingsField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private Nullable nightField; + + private Nullable nightLandingsField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable overrideDutyOffField; + + private Nullable overrideDutyOnField; + + private Nullable previewField; + + private Nullable rdpField; + + private Nullable rdpBeginField; + + private Nullable rdpEndField; + + private Nullable scheduleBlockField; + + private Nullable splitDutyField; + + private Nullable splitDutyBeginField; + + private Nullable splitDutyEndField; + + private Nullable syncedField; + + private string tripIdField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable block + { + get + { + return this.blockField; + } + set + { + this.blockField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string calendarIdentifier + { + get + { + return this.calendarIdentifierField; + } + set + { + this.calendarIdentifierField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable credit + { + get + { + return this.creditField; + } + set + { + this.creditField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string dayId + { + get + { + return this.dayIdField; + } + set + { + this.dayIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable duty + { + get + { + return this.dutyField; + } + set + { + this.dutyField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable dutyOff + { + get + { + return this.dutyOffField; + } + set + { + this.dutyOffField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable dutyOn + { + get + { + return this.dutyOnField; + } + set + { + this.dutyOnField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable fDP + { + get + { + return this.fDPField; + } + set + { + this.fDPField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable fDPEndTime + { + get + { + return this.fDPEndTimeField; + } + set + { + this.fDPEndTimeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable flightTime + { + get + { + return this.flightTimeField; + } + set + { + this.flightTimeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable grossPay + { + get + { + return this.grossPayField; + } + set + { + this.grossPayField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string hotelId + { + get + { + return this.hotelIdField; + } + set + { + this.hotelIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable instrument + { + get + { + return this.instrumentField; + } + set + { + this.instrumentField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable landings + { + get + { + return this.landingsField; + } + set + { + this.landingsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable night + { + get + { + return this.nightField; + } + set + { + this.nightField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable nightLandings + { + get + { + return this.nightLandingsField; + } + set + { + this.nightLandingsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable overrideDutyOff + { + get + { + return this.overrideDutyOffField; + } + set + { + this.overrideDutyOffField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable overrideDutyOn + { + get + { + return this.overrideDutyOnField; + } + set + { + this.overrideDutyOnField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable rdp + { + get + { + return this.rdpField; + } + set + { + this.rdpField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable rdpBegin + { + get + { + return this.rdpBeginField; + } + set + { + this.rdpBeginField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable rdpEnd + { + get + { + return this.rdpEndField; + } + set + { + this.rdpEndField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable scheduleBlock + { + get + { + return this.scheduleBlockField; + } + set + { + this.scheduleBlockField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable splitDuty + { + get + { + return this.splitDutyField; + } + set + { + this.splitDutyField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable splitDutyBegin + { + get + { + return this.splitDutyBeginField; + } + set + { + this.splitDutyBeginField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable splitDutyEnd + { + get + { + return this.splitDutyEndField; + } + set + { + this.splitDutyEndField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string tripId + { + get + { + return this.tripIdField; + } + set + { + this.tripIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="EmploymentEventDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class EmploymentEventDTO : object + { + + private string airlineIdField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private string employmentEventIdField; + + private Nullable firstDateField; + + private Nullable lastDateField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private Nullable previewField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string airlineId + { + get + { + return this.airlineIdField; + } + set + { + this.airlineIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string employmentEventId + { + get + { + return this.employmentEventIdField; + } + set + { + this.employmentEventIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable firstDate + { + get + { + return this.firstDateField; + } + set + { + this.firstDateField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastDate + { + get + { + return this.lastDateField; + } + set + { + this.lastDateField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="EventDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class EventDTO : object + { + + private Nullable createdUtcField; + + private Nullable dateRangeField; + + private Nullable deletedField; + + private string eventIdField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable previewField; + + private Nullable syncedField; + + private string urlField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable dateRange + { + get + { + return this.dateRangeField; + } + set + { + this.dateRangeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string eventId + { + get + { + return this.eventIdField; + } + set + { + this.eventIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string url + { + get + { + return this.urlField; + } + set + { + this.urlField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="GlobalSettingDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class GlobalSettingDTO : object + { + + private string DescriptionField; + + private global::System.Guid GlobalSettingIdField; + + private global::System.DateTime LastUpdatedUtcField; + + private string SettingKeyField; + + private string SettingValueField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string Description + { + get + { + return this.DescriptionField; + } + set + { + this.DescriptionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Guid GlobalSettingId + { + get + { + return this.GlobalSettingIdField; + } + set + { + this.GlobalSettingIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.DateTime LastUpdatedUtc + { + get + { + return this.LastUpdatedUtcField; + } + set + { + this.LastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string SettingKey + { + get + { + return this.SettingKeyField; + } + set + { + this.SettingKeyField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string SettingValue + { + get + { + return this.SettingValueField; + } + set + { + this.SettingValueField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="HotelDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class HotelDTO : object + { + + private Nullable communicationLevelField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private string emailField; + + private string hotelIdField; + + private string hotelNameField; + + private Nullable lastUpdatedUtcField; + + private string locationField; + + private Nullable modelVersionField; + + private string nameField; + + private string notesField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private string numberField; + + private string phoneField; + + private string pictureField; + + private Nullable previewField; + + private Nullable privacyLevelField; + + private Nullable ratingsField; + + private string sharedNotesField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable communicationLevel + { + get + { + return this.communicationLevelField; + } + set + { + this.communicationLevelField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string email + { + get + { + return this.emailField; + } + set + { + this.emailField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string hotelId + { + get + { + return this.hotelIdField; + } + set + { + this.hotelIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string hotelName + { + get + { + return this.hotelNameField; + } + set + { + this.hotelNameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string location + { + get + { + return this.locationField; + } + set + { + this.locationField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string name + { + get + { + return this.nameField; + } + set + { + this.nameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notes + { + get + { + return this.notesField; + } + set + { + this.notesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string number + { + get + { + return this.numberField; + } + set + { + this.numberField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string phone + { + get + { + return this.phoneField; + } + set + { + this.phoneField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string picture + { + get + { + return this.pictureField; + } + set + { + this.pictureField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable privacyLevel + { + get + { + return this.privacyLevelField; + } + set + { + this.privacyLevelField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable ratings + { + get + { + return this.ratingsField; + } + set + { + this.ratingsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string sharedNotes + { + get + { + return this.sharedNotesField; + } + set + { + this.sharedNotesField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="LegDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class LegDTO : object + { + + private Nullable actualBlockField; + + private string aircraftIdField; + + private string approachIdField; + + private string cabinCrewAIdField; + + private string cabinCrewBIdField; + + private string calendarIdentifierField; + + private string captainIdField; + + private Nullable completedField; + + private Nullable createdUtcField; + + private string dayIdField; + + private Nullable deletedField; + + private string departureAirportIdField; + + private string deptField; + + private string deptGateField; + + private string destField; + + private string destGateField; + + private string destinationAirportIdField; + + private Nullable etaField; + + private string firstOfficerIdField; + + private string flightNumberField; + + private Nullable flightTimeField; + + private Nullable inOOOIField; + + private Nullable instrumentField; + + private Nullable landingsField; + + private Nullable lastUpdatedUtcField; + + private string legIdField; + + private Nullable modelVersionField; + + private Nullable nightField; + + private Nullable nightLandingsField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable offOOOIField; + + private Nullable onOOOIField; + + private string operationTypeIdField; + + private string otherCrewAIdField; + + private string otherCrewBIdField; + + private Nullable outOOOIField; + + private string payIdField; + + private string positionIdField; + + private Nullable previewField; + + private string registrationField; + + private string remarksField; + + private Nullable scheduledBlockField; + + private Nullable scheduledInField; + + private Nullable scheduledOutField; + + private Nullable sequenceField; + + private Nullable syncedField; + + private Nullable taxiTimeInField; + + private Nullable taxiTimeOutField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable actualBlock + { + get + { + return this.actualBlockField; + } + set + { + this.actualBlockField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string aircraftId + { + get + { + return this.aircraftIdField; + } + set + { + this.aircraftIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string approachId + { + get + { + return this.approachIdField; + } + set + { + this.approachIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string cabinCrewAId + { + get + { + return this.cabinCrewAIdField; + } + set + { + this.cabinCrewAIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string cabinCrewBId + { + get + { + return this.cabinCrewBIdField; + } + set + { + this.cabinCrewBIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string calendarIdentifier + { + get + { + return this.calendarIdentifierField; + } + set + { + this.calendarIdentifierField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string captainId + { + get + { + return this.captainIdField; + } + set + { + this.captainIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable completed + { + get + { + return this.completedField; + } + set + { + this.completedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string dayId + { + get + { + return this.dayIdField; + } + set + { + this.dayIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string departureAirportId + { + get + { + return this.departureAirportIdField; + } + set + { + this.departureAirportIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string dept + { + get + { + return this.deptField; + } + set + { + this.deptField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string deptGate + { + get + { + return this.deptGateField; + } + set + { + this.deptGateField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string dest + { + get + { + return this.destField; + } + set + { + this.destField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string destGate + { + get + { + return this.destGateField; + } + set + { + this.destGateField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string destinationAirportId + { + get + { + return this.destinationAirportIdField; + } + set + { + this.destinationAirportIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable eta + { + get + { + return this.etaField; + } + set + { + this.etaField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string firstOfficerId + { + get + { + return this.firstOfficerIdField; + } + set + { + this.firstOfficerIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string flightNumber + { + get + { + return this.flightNumberField; + } + set + { + this.flightNumberField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable flightTime + { + get + { + return this.flightTimeField; + } + set + { + this.flightTimeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable inOOOI + { + get + { + return this.inOOOIField; + } + set + { + this.inOOOIField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable instrument + { + get + { + return this.instrumentField; + } + set + { + this.instrumentField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable landings + { + get + { + return this.landingsField; + } + set + { + this.landingsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string legId + { + get + { + return this.legIdField; + } + set + { + this.legIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable night + { + get + { + return this.nightField; + } + set + { + this.nightField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable nightLandings + { + get + { + return this.nightLandingsField; + } + set + { + this.nightLandingsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable offOOOI + { + get + { + return this.offOOOIField; + } + set + { + this.offOOOIField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable onOOOI + { + get + { + return this.onOOOIField; + } + set + { + this.onOOOIField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string operationTypeId + { + get + { + return this.operationTypeIdField; + } + set + { + this.operationTypeIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string otherCrewAId + { + get + { + return this.otherCrewAIdField; + } + set + { + this.otherCrewAIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string otherCrewBId + { + get + { + return this.otherCrewBIdField; + } + set + { + this.otherCrewBIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable outOOOI + { + get + { + return this.outOOOIField; + } + set + { + this.outOOOIField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string payId + { + get + { + return this.payIdField; + } + set + { + this.payIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string positionId + { + get + { + return this.positionIdField; + } + set + { + this.positionIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string registration + { + get + { + return this.registrationField; + } + set + { + this.registrationField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string remarks + { + get + { + return this.remarksField; + } + set + { + this.remarksField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable scheduledBlock + { + get + { + return this.scheduledBlockField; + } + set + { + this.scheduledBlockField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable scheduledIn + { + get + { + return this.scheduledInField; + } + set + { + this.scheduledInField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable scheduledOut + { + get + { + return this.scheduledOutField; + } + set + { + this.scheduledOutField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable taxiTimeIn + { + get + { + return this.taxiTimeInField; + } + set + { + this.taxiTimeInField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable taxiTimeOut + { + get + { + return this.taxiTimeOutField; + } + set + { + this.taxiTimeOutField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="NoteDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class NoteDTO : object + { + + private Nullable createdUtcField; + + private Nullable deletedField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string note1Field; + + private string noteIdField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable previewField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string note1 + { + get + { + return this.note1Field; + } + set + { + this.note1Field = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string noteId + { + get + { + return this.noteIdField; + } + set + { + this.noteIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="PayperiodEventDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class PayperiodEventDTO : object + { + + private string airlineIdField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private Nullable firstDateField; + + private Nullable lastDateField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string payperiodEventIdField; + + private string periodDescriptionField; + + private Nullable previewField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string airlineId + { + get + { + return this.airlineIdField; + } + set + { + this.airlineIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable firstDate + { + get + { + return this.firstDateField; + } + set + { + this.firstDateField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastDate + { + get + { + return this.lastDateField; + } + set + { + this.lastDateField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string payperiodEventId + { + get + { + return this.payperiodEventIdField; + } + set + { + this.payperiodEventIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string periodDescription + { + get + { + return this.periodDescriptionField; + } + set + { + this.periodDescriptionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="PayrollCategoryDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class PayrollCategoryDTO : object + { + + private Nullable aboveGuaranteeField; + + private Nullable applyRigField; + + private Nullable applyToFlightTimeField; + + private Nullable applyToLegalityField; + + private Nullable applyToPayField; + + private Nullable copyLegField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private Nullable lastUpdatedUtcField; + + private Nullable minimumCreditField; + + private Nullable modelVersionField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable overridePayField; + + private Nullable payrateField; + + private string payrollCategoriesIdField; + + private string plainDescriptionField; + + private Nullable previewField; + + private Nullable rigAField; + + private Nullable rigBField; + + private Nullable selectableField; + + private Nullable setAllLegsField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable aboveGuarantee + { + get + { + return this.aboveGuaranteeField; + } + set + { + this.aboveGuaranteeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable applyRig + { + get + { + return this.applyRigField; + } + set + { + this.applyRigField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable applyToFlightTime + { + get + { + return this.applyToFlightTimeField; + } + set + { + this.applyToFlightTimeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable applyToLegality + { + get + { + return this.applyToLegalityField; + } + set + { + this.applyToLegalityField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable applyToPay + { + get + { + return this.applyToPayField; + } + set + { + this.applyToPayField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable copyLeg + { + get + { + return this.copyLegField; + } + set + { + this.copyLegField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable minimumCredit + { + get + { + return this.minimumCreditField; + } + set + { + this.minimumCreditField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable overridePay + { + get + { + return this.overridePayField; + } + set + { + this.overridePayField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable payrate + { + get + { + return this.payrateField; + } + set + { + this.payrateField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string payrollCategoriesId + { + get + { + return this.payrollCategoriesIdField; + } + set + { + this.payrollCategoriesIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string plainDescription + { + get + { + return this.plainDescriptionField; + } + set + { + this.plainDescriptionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable rigA + { + get + { + return this.rigAField; + } + set + { + this.rigAField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable rigB + { + get + { + return this.rigBField; + } + set + { + this.rigBField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable selectable + { + get + { + return this.selectableField; + } + set + { + this.selectableField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable setAllLegs + { + get + { + return this.setAllLegsField; + } + set + { + this.setAllLegsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="PayrollDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class PayrollDTO : object + { + + private Nullable actualField; + + private Nullable createdUtcField; + + private Nullable creditField; + + private Nullable deletedField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private string payrollCategoriesIdField; + + private string payrollIdField; + + private Nullable previewField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable actual + { + get + { + return this.actualField; + } + set + { + this.actualField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable credit + { + get + { + return this.creditField; + } + set + { + this.creditField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string payrollCategoriesId + { + get + { + return this.payrollCategoriesIdField; + } + set + { + this.payrollCategoriesIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string payrollId + { + get + { + return this.payrollIdField; + } + set + { + this.payrollIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="PerformanceDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class PerformanceDTO : object + { + + private Nullable actualField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private Nullable deviatedField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private string performanceIdField; + + private Nullable plannedFuelField; + + private Nullable previewField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable actual + { + get + { + return this.actualField; + } + set + { + this.actualField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deviated + { + get + { + return this.deviatedField; + } + set + { + this.deviatedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string performanceId + { + get + { + return this.performanceIdField; + } + set + { + this.performanceIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable plannedFuel + { + get + { + return this.plannedFuelField; + } + set + { + this.plannedFuelField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="PositionDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class PositionDTO : object + { + + private Nullable autoNightLandingField; + + private Nullable checkAirmanField; + + private Nullable createdUtcField; + + private Nullable creditLandingField; + + private Nullable deletedField; + + private Nullable ioeField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable pilotFlyingField; + + private Nullable pilotInCommandField; + + private string position1Field; + + private string positionIdField; + + private Nullable previewField; + + private Nullable selectableField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable autoNightLanding + { + get + { + return this.autoNightLandingField; + } + set + { + this.autoNightLandingField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable checkAirman + { + get + { + return this.checkAirmanField; + } + set + { + this.checkAirmanField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable creditLanding + { + get + { + return this.creditLandingField; + } + set + { + this.creditLandingField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable ioe + { + get + { + return this.ioeField; + } + set + { + this.ioeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable pilotFlying + { + get + { + return this.pilotFlyingField; + } + set + { + this.pilotFlyingField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable pilotInCommand + { + get + { + return this.pilotInCommandField; + } + set + { + this.pilotInCommandField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string position1 + { + get + { + return this.position1Field; + } + set + { + this.position1Field = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string positionId + { + get + { + return this.positionIdField; + } + set + { + this.positionIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable selectable + { + get + { + return this.selectableField; + } + set + { + this.selectableField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="ReglatoryOperationTypeDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class ReglatoryOperationTypeDTO : object + { + + private Nullable activeField; + + private Nullable canMixOperationsField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string operationAbvreviationField; + + private string operationDescriptionField; + + private Nullable previewField; + + private string reglatoryOperationTypesIdField; + + private string schemaURLField; + + private Nullable syncedField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable active + { + get + { + return this.activeField; + } + set + { + this.activeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable canMixOperations + { + get + { + return this.canMixOperationsField; + } + set + { + this.canMixOperationsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string operationAbvreviation + { + get + { + return this.operationAbvreviationField; + } + set + { + this.operationAbvreviationField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string operationDescription + { + get + { + return this.operationDescriptionField; + } + set + { + this.operationDescriptionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string reglatoryOperationTypesId + { + get + { + return this.reglatoryOperationTypesIdField; + } + set + { + this.reglatoryOperationTypesIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string schemaURL + { + get + { + return this.schemaURLField; + } + set + { + this.schemaURLField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="TripDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class TripDTO : object + { + + private bool activeField; + + private string calendarIdentifierField; + + private Nullable completedField; + + private Nullable createdUtcField; + + private Nullable deletedField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable previewField; + + private Nullable seqEndTimeField; + + private Nullable seqStartTimeField; + + private Nullable syncedField; + + private Nullable tafbField; + + private Nullable totalBlockField; + + private Nullable totalCreditField; + + private Nullable totalFlightTimeField; + + private Nullable totalInstrumentField; + + private Nullable totalLandingsField; + + private Nullable totalNightField; + + private Nullable totalNightLandingsField; + + private Nullable totalPayFField; + + private string tripIdField; + + private string tripNumberField; + + private int userIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public bool active + { + get + { + return this.activeField; + } + set + { + this.activeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string calendarIdentifier + { + get + { + return this.calendarIdentifierField; + } + set + { + this.calendarIdentifierField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable completed + { + get + { + return this.completedField; + } + set + { + this.completedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable seqEndTime + { + get + { + return this.seqEndTimeField; + } + set + { + this.seqEndTimeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable seqStartTime + { + get + { + return this.seqStartTimeField; + } + set + { + this.seqStartTimeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable tafb + { + get + { + return this.tafbField; + } + set + { + this.tafbField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable totalBlock + { + get + { + return this.totalBlockField; + } + set + { + this.totalBlockField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable totalCredit + { + get + { + return this.totalCreditField; + } + set + { + this.totalCreditField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable totalFlightTime + { + get + { + return this.totalFlightTimeField; + } + set + { + this.totalFlightTimeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable totalInstrument + { + get + { + return this.totalInstrumentField; + } + set + { + this.totalInstrumentField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable totalLandings + { + get + { + return this.totalLandingsField; + } + set + { + this.totalLandingsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable totalNight + { + get + { + return this.totalNightField; + } + set + { + this.totalNightField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable totalNightLandings + { + get + { + return this.totalNightLandingsField; + } + set + { + this.totalNightLandingsField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable totalPayF + { + get + { + return this.totalPayFField; + } + set + { + this.totalPayFField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string tripId + { + get + { + return this.tripIdField; + } + set + { + this.tripIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string tripNumber + { + get + { + return this.tripNumberField; + } + set + { + this.tripNumberField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="UserSettingDTO", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class UserSettingDTO : object + { + + private Nullable createdUtcField; + + private Nullable deletedField; + + private string keyField; + + private Nullable lastUpdatedUtcField; + + private Nullable modelVersionField; + + private string notificationMessageField; + + private Nullable notificationTypeField; + + private Nullable previewField; + + private string stringValueField; + + private Nullable syncedField; + + private int userIdField; + + private string userSettingIdField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable createdUtc + { + get + { + return this.createdUtcField; + } + set + { + this.createdUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable deleted + { + get + { + return this.deletedField; + } + set + { + this.deletedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string key + { + get + { + return this.keyField; + } + set + { + this.keyField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable lastUpdatedUtc + { + get + { + return this.lastUpdatedUtcField; + } + set + { + this.lastUpdatedUtcField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable modelVersion + { + get + { + return this.modelVersionField; + } + set + { + this.modelVersionField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string notificationMessage + { + get + { + return this.notificationMessageField; + } + set + { + this.notificationMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable notificationType + { + get + { + return this.notificationTypeField; + } + set + { + this.notificationTypeField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable preview + { + get + { + return this.previewField; + } + set + { + this.previewField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string stringValue + { + get + { + return this.stringValueField; + } + set + { + this.stringValueField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable synced + { + get + { + return this.syncedField; + } + set + { + this.syncedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int userId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string userSettingId + { + get + { + return this.userSettingIdField; + } + set + { + this.userSettingIdField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="DingusSyncResponse", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class DingusSyncResponse : object + { + + DingusSyncData CloudDataField; + + private string StatusField; + + private bool SuccessField; + + private global::System.DateTime SyncDateLineField; + + private long SyncDurationField; + + private global::System.DateTime SyncEndedField; + + private global::System.DateTime SyncStartedField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public DingusSyncData CloudData + { + get + { + return this.CloudDataField; + } + set + { + this.CloudDataField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string Status + { + get + { + return this.StatusField; + } + set + { + this.StatusField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public bool Success + { + get + { + return this.SuccessField; + } + set + { + this.SuccessField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.DateTime SyncDateLine + { + get + { + return this.SyncDateLineField; + } + set + { + this.SyncDateLineField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public long SyncDuration + { + get + { + return this.SyncDurationField; + } + set + { + this.SyncDurationField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.DateTime SyncEnded + { + get + { + return this.SyncEndedField; + } + set + { + this.SyncEndedField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.DateTime SyncStarted + { + get + { + return this.SyncStartedField; + } + set + { + this.SyncStartedField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="BinaryTransferResponse", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class BinaryTransferResponse : object + { + + private string ErrorMessageField; + + private bool SuccessField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string ErrorMessage + { + get + { + return this.ErrorMessageField; + } + set + { + this.ErrorMessageField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public bool Success + { + get + { + return this.SuccessField; + } + set + { + this.SuccessField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="SyncStatus", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class SyncStatus : object + { + + EntitySyncState[] SyncStateField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public EntitySyncState[] SyncState + { + get + { + return this.SyncStateField; + } + set + { + this.SyncStateField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="EntitySyncState", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class EntitySyncState : object + { + + private string EntityNameField; + + private Nullable LastUpdatedUtcField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string EntityName + { + get + { + return this.EntityNameField; + } + set + { + this.EntityNameField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public Nullable LastUpdatedUtc + { + get + { + return this.LastUpdatedUtcField; + } + set + { + this.LastUpdatedUtcField = value; + } + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("global::System.Runtime.Serialization", "4.0.0.0")] + [global::System.Runtime.Serialization.DataContractAttribute(Name="TaxiTime", Namespace="http://schemas.datacontract.org/2004/07/Dingus.Data.DataContracts")] + public partial class TaxiTime : object + { + + private string AirportField; + + private int TaxiInAvgField; + + private int TaxiOutAvgField; + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string Airport + { + get + { + return this.AirportField; + } + set + { + this.AirportField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int TaxiInAvg + { + get + { + return this.TaxiInAvgField; + } + set + { + this.TaxiInAvgField = value; + } + } + + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int TaxiOutAvg + { + get + { + return this.TaxiOutAvgField; + } + set + { + this.TaxiOutAvgField = value; + } + } + } +} + + + diff --git a/mcs/class/System.Security/System.Security-net_4_5.csproj b/mcs/class/System.Security/System.Security-net_4_5.csproj deleted file mode 100644 index 74704c2295d..00000000000 --- a/mcs/class/System.Security/System.Security-net_4_5.csproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B55E59B2-31CA-438B-ADB8-4B9A9A547830} - Library - 1699,618,414 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Security - v4.5 - 512 - - - - true - full - 1699,618,414 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;SECURITY_DEP - prompt - 4 - - - pdbonly - 1699,618,414 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;SECURITY_DEP - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {46F151F2-A422-4A1B-9D29-2E148CE73629} - System-secxml-net_4_5 - - - {21FB091E-0F84-479E-AB16-6503D36852F9} - System.Xml-bare-net_4_5 - - - {D68D4FED-CA32-4800-A628-58BAE485562C} - Mono.Security-net_4_5 - - - - - - - diff --git a/mcs/class/System.Security/System.Security-tests-net_4_5.csproj b/mcs/class/System.Security/System.Security-tests-net_4_5.csproj deleted file mode 100644 index 9beb057c78c..00000000000 --- a/mcs/class/System.Security/System.Security-tests-net_4_5.csproj +++ /dev/null @@ -1,151 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D49E3075-7A78-4CF1-8300-DF847C9B6796} - Library - 1699,618,414,169,219,1595,168,183,414 - bin\Debug\System.Security-tests-net_4_5 - True - False - - Properties - - - System.Security_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,618,414,169,219,1595,168,183,414 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;SECURITY_DEP - prompt - 4 - - - pdbonly - 1699,618,414,169,219,1595,168,183,414 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;SECURITY_DEP - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {B55E59B2-31CA-438B-ADB8-4B9A9A547830} - System.Security\System.Security-net_4_5 - - - {6822DF7D-F859-4F02-9946-F138AA756A0E} - System\System-net_4_5-1 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.XML\System.Xml-net_4_5 - - - {D68D4FED-CA32-4800-A628-58BAE485562C} - Mono.Security\Mono.Security-net_4_5 - - - - - - - diff --git a/mcs/class/System.ServiceModel.Activation/System.ServiceModel.Activation-net_4_5.csproj b/mcs/class/System.ServiceModel.Activation/System.ServiceModel.Activation-net_4_5.csproj deleted file mode 100644 index 6bd2f56b426..00000000000 --- a/mcs/class/System.ServiceModel.Activation/System.ServiceModel.Activation-net_4_5.csproj +++ /dev/null @@ -1,97 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E537F31B-BCB7-4935-ABF3-DF2FAC48DCB3} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.ServiceModel.Activation - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {0E3CFD7E-2F93-4B5B-B7FA-2AEBE0F850C0} - System.ServiceModel-plainservice-net_4_5 - - - - - - - diff --git a/mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery-net_4_5.csproj b/mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery-net_4_5.csproj deleted file mode 100644 index ad8289903ba..00000000000 --- a/mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery-net_4_5.csproj +++ /dev/null @@ -1,210 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DAF033A4-D1CF-464F-B581-578259BF3F8F} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.ServiceModel.Discovery - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_5;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_5;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization-net_4_5 - - - {F2156C09-C377-4945-A690-39CFBF3319B3} - System.ServiceModel-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {8328796E-8A15-4972-8F1E-2F15E7D57C42} - System.Xml.Linq-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - - - - - diff --git a/mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery-tests-net_4_5.csproj b/mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery-tests-net_4_5.csproj deleted file mode 100644 index 71a64cdca37..00000000000 --- a/mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery-tests-net_4_5.csproj +++ /dev/null @@ -1,130 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {83854968-EA94-4D22-8BFE-AA81557AACFB} - Library - 1699 - bin\Debug\System.ServiceModel.Discovery-tests-net_4_5 - True - False - - Properties - - - System.ServiceModel.Discovery_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;NET_3_5;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;NET_3_5;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {DAF033A4-D1CF-464F-B581-578259BF3F8F} - System.ServiceModel.Discovery\System.ServiceModel.Discovery-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_5 - - - {F1316A49-176B-4E68-8A5F-1BA718289D46} - System.ServiceModel\System.ServiceModel-net_4_5-1 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {8328796E-8A15-4972-8F1E-2F15E7D57C42} - System.Xml.Linq\System.Xml.Linq-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration\System.Configuration-net_4_5 - - - - - - - diff --git a/mcs/class/System.ServiceModel.Routing/System.ServiceModel.Routing-net_4_5.csproj b/mcs/class/System.ServiceModel.Routing/System.ServiceModel.Routing-net_4_5.csproj deleted file mode 100644 index 189f315ada5..00000000000 --- a/mcs/class/System.ServiceModel.Routing/System.ServiceModel.Routing-net_4_5.csproj +++ /dev/null @@ -1,137 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6546230C-B2F4-4F79-8E57-6B4867997D77} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.ServiceModel.Routing - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_5;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_5;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization-net_4_5 - - - {F2156C09-C377-4945-A690-39CFBF3319B3} - System.ServiceModel-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - - - - - diff --git a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-net_4_5.csproj b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-net_4_5.csproj deleted file mode 100644 index 45b579228e5..00000000000 --- a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-net_4_5.csproj +++ /dev/null @@ -1,159 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {BD4DF654-42EE-40E8-A3F4-8A80959E7879} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.ServiceModel.Web - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_5;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_5;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization-net_4_5 - - - {F2156C09-C377-4945-A690-39CFBF3319B3} - System.ServiceModel-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {74D281D8-F725-4D79-B218-2DFCCFD44FA2} - System.Web.Extensions-net_4_5 - - - {E537F31B-BCB7-4935-ABF3-DF2FAC48DCB3} - System.ServiceModel.Activation-net_4_5 - - - - - - - diff --git a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-tests-net_4_5.csproj b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-tests-net_4_5.csproj deleted file mode 100644 index d8e3c21510e..00000000000 --- a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-tests-net_4_5.csproj +++ /dev/null @@ -1,147 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {15DA3E31-1142-4ABB-AC5E-B2FB2B7C50D9} - Library - 1699 - bin\Debug\System.ServiceModel.Web-tests-net_4_5 - True - False - - Properties - - - System.ServiceModel.Web_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;NET_3_5;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;NET_3_5;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {BD4DF654-42EE-40E8-A3F4-8A80959E7879} - System.ServiceModel.Web\System.ServiceModel.Web-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_5 - - - {F1316A49-176B-4E68-8A5F-1BA718289D46} - System.ServiceModel\System.ServiceModel-net_4_5-1 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration\System.Configuration-net_4_5 - - - {74D281D8-F725-4D79-B218-2DFCCFD44FA2} - System.Web.Extensions\System.Web.Extensions-net_4_5 - - - {E537F31B-BCB7-4935-ABF3-DF2FAC48DCB3} - System.ServiceModel.Activation\System.ServiceModel.Activation-net_4_5 - - - - - - - diff --git a/mcs/class/System.ServiceModel/System.ServiceModel-net_4_5.csproj b/mcs/class/System.ServiceModel/System.ServiceModel-net_4_5.csproj deleted file mode 100644 index 66064a57f78..00000000000 --- a/mcs/class/System.ServiceModel/System.ServiceModel-net_4_5.csproj +++ /dev/null @@ -1,1164 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F2156C09-C377-4945-A690-39CFBF3319B3} - Library - 1699,414,169,67,3005,436,219,618 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - System.ServiceModel - v4.5 - 512 - - - - true - full - 1699,414,169,67,3005,436,219,618 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;TRACE;NET_3_0;HAS_ACTIVATION - prompt - 4 - - - pdbonly - 1699,414,169,67,3005,436,219,618 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;TRACE;NET_3_0;HAS_ACTIVATION - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {E537F31B-BCB7-4935-ABF3-DF2FAC48DCB3} - System.ServiceModel.Activation-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {B55E59B2-31CA-438B-ADB8-4B9A9A547830} - System.Security-net_4_5 - - - {F056C062-E467-4989-9366-440E8CD23C0C} - System.IdentityModel-net_4_5 - - - {AB4F77BB-4340-4A79-9B66-EF5B4221E1F2} - System.IdentityModel.Selectors-net_4_5 - - - {AF2BBF50-AB57-4CA1-8EF5-2B54C7418434} - System.Transactions-net_4_5 - - - {1CBEC0FC-5926-42FA-A0CF-A19617FABB78} - System.Messaging-net_4_5 - - - {B489C3DE-3ED3-4EDC-B42B-82B38E101857} - System.Web-net_4_5 - - - {251DB111-FEE1-4080-8411-0AD1CC9BA94B} - System.Web.Services-net_4_5 - - - {D68D4FED-CA32-4800-A628-58BAE485562C} - Mono.Security-net_4_5 - - - {B4E6806D-1B38-4CEE-8ADB-2D0A4D1AF25F} - System.Web.ApplicationServices-net_4_5 - - - - - - - - WS-Addressing.schema - - - ws-addr.xsd - - - - diff --git a/mcs/class/System.ServiceModel/System.ServiceModel-plainservice-net_4_5.csproj b/mcs/class/System.ServiceModel/System.ServiceModel-plainservice-net_4_5.csproj deleted file mode 100644 index 5b759116132..00000000000 --- a/mcs/class/System.ServiceModel/System.ServiceModel-plainservice-net_4_5.csproj +++ /dev/null @@ -1,1160 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0E3CFD7E-2F93-4B5B-B7FA-2AEBE0F850C0} - Library - 1699,414,169,67,3005,436,219,618 - ./../../class/lib/net_4_5/plainservice - True - True - true - Properties - - - System.ServiceModel - v4.5 - 512 - - - - true - full - 1699,414,169,67,3005,436,219,618 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;TRACE;NET_3_0 - prompt - 4 - - - pdbonly - 1699,414,169,67,3005,436,219,618 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;TRACE;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {B55E59B2-31CA-438B-ADB8-4B9A9A547830} - System.Security-net_4_5 - - - {F056C062-E467-4989-9366-440E8CD23C0C} - System.IdentityModel-net_4_5 - - - {AB4F77BB-4340-4A79-9B66-EF5B4221E1F2} - System.IdentityModel.Selectors-net_4_5 - - - {AF2BBF50-AB57-4CA1-8EF5-2B54C7418434} - System.Transactions-net_4_5 - - - {1CBEC0FC-5926-42FA-A0CF-A19617FABB78} - System.Messaging-net_4_5 - - - {B489C3DE-3ED3-4EDC-B42B-82B38E101857} - System.Web-net_4_5 - - - {251DB111-FEE1-4080-8411-0AD1CC9BA94B} - System.Web.Services-net_4_5 - - - {D68D4FED-CA32-4800-A628-58BAE485562C} - Mono.Security-net_4_5 - - - {B4E6806D-1B38-4CEE-8ADB-2D0A4D1AF25F} - System.Web.ApplicationServices-net_4_5 - - - - - - - - WS-Addressing.schema - - - ws-addr.xsd - - - - diff --git a/mcs/class/System.ServiceModel/System.ServiceModel-tests-net_4_5.csproj b/mcs/class/System.ServiceModel/System.ServiceModel-tests-net_4_5.csproj deleted file mode 100644 index 725fa0136bd..00000000000 --- a/mcs/class/System.ServiceModel/System.ServiceModel-tests-net_4_5.csproj +++ /dev/null @@ -1,364 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2642A2D0-D703-4A60-B60D-B64BD12CB01C} - Library - 1699,414,169,67,3005,436,219,618 - bin\Debug\System.ServiceModel-tests-net_4_5 - True - False - true - Properties - - - System.ServiceModel_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,414,169,67,3005,436,219,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;TRACE;NET_3_0;HAS_ACTIVATION - prompt - 4 - - - pdbonly - 1699,414,169,67,3005,436,219,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;TRACE;NET_3_0;HAS_ACTIVATION - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {F1316A49-176B-4E68-8A5F-1BA718289D46} - System.ServiceModel\System.ServiceModel-net_4_5-1 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration\System.Configuration-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data\System.Data-net_4_5 - - - {B55E59B2-31CA-438B-ADB8-4B9A9A547830} - System.Security\System.Security-net_4_5 - - - {F056C062-E467-4989-9366-440E8CD23C0C} - System.IdentityModel\System.IdentityModel-net_4_5 - - - {AB4F77BB-4340-4A79-9B66-EF5B4221E1F2} - System.IdentityModel.Selectors\System.IdentityModel.Selectors-net_4_5 - - - {AF2BBF50-AB57-4CA1-8EF5-2B54C7418434} - System.Transactions\System.Transactions-net_4_5 - - - {1CBEC0FC-5926-42FA-A0CF-A19617FABB78} - System.Messaging\System.Messaging-net_4_5 - - - {725FB152-838A-4C6E-8A12-AC47E2DD4CEA} - System.Web\System.Web-net_4_5-2 - - - {251DB111-FEE1-4080-8411-0AD1CC9BA94B} - System.Web.Services\System.Web.Services-net_4_5 - - - {D68D4FED-CA32-4800-A628-58BAE485562C} - Mono.Security\Mono.Security-net_4_5 - - - {E537F31B-BCB7-4935-ABF3-DF2FAC48DCB3} - System.ServiceModel.Activation\System.ServiceModel.Activation-net_4_5 - - - {B4E6806D-1B38-4CEE-8ADB-2D0A4D1AF25F} - System.Web.ApplicationServices\System.Web.ApplicationServices-net_4_5 - - - - - - - - WS-Addressing.schema - - - ws-addr.xsd - - - - diff --git a/mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/Bug32886Test.cs b/mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/Bug32886Test.cs index 1562ba1ba9b..71c1f554c3b 100644 --- a/mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/Bug32886Test.cs +++ b/mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/Bug32886Test.cs @@ -23,6 +23,7 @@ // THE SOFTWARE. using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; @@ -62,16 +63,24 @@ namespace MonoTests.System.ServiceModel.Dispatcher var client = new TempConvertSoapClient (binding, remoteAddress); var wait = new ManualResetEvent (false); + + Exception error = null; + string result = null; + client.CelsiusToFahrenheitCompleted += delegate (object o, CelsiusToFahrenheitCompletedEventArgs e) { - if (e.Error != null) - throw e.Error; - Assert.AreEqual ("76.1", e.Result, "#1"); - wait.Set (); + try { + error = e.Error; + result = e.Error == null ? e.Result : null; + } finally { + wait.Set (); + } }; client.CelsiusToFahrenheitAsync ("24.5"); - if (!wait.WaitOne (TimeSpan.FromSeconds (20))) - Assert.Fail ("timeout"); + + Assert.IsTrue (wait.WaitOne (TimeSpan.FromSeconds (20)), "timeout"); + Assert.IsNull (error, "#1, inner exception: {0}", error); + Assert.AreEqual ("76.1", result, "#2"); } finally { serviceHost.Close (); } @@ -81,16 +90,16 @@ namespace MonoTests.System.ServiceModel.Dispatcher { public FahrenheitToCelsiusResponse FarenheitToCelsius (FahrenheitToCelsiusRequest request) { - var farenheit = double.Parse (request.Body.Fahrenheit); + var farenheit = double.Parse (request.Body.Fahrenheit, CultureInfo.InvariantCulture); var celsius = ((farenheit - 32) / 9) * 5; - return new FahrenheitToCelsiusResponse (new FahrenheitToCelsiusResponseBody (celsius.ToString ())); + return new FahrenheitToCelsiusResponse (new FahrenheitToCelsiusResponseBody (celsius.ToString (CultureInfo.InvariantCulture))); } public CelsiusToFahrenheitResponse CelsiusToFarenheit (CelsiusToFahrenheitRequest request) { - var celsius = double.Parse (request.Body.Celsius); + var celsius = double.Parse (request.Body.Celsius, CultureInfo.InvariantCulture); var farenheit = ((celsius * 9) / 5) + 32; - return new CelsiusToFahrenheitResponse (new CelsiusToFahrenheitResponseBody (farenheit.ToString ())); + return new CelsiusToFahrenheitResponse (new CelsiusToFahrenheitResponseBody (farenheit.ToString (CultureInfo.InvariantCulture))); } Func farenheitToCelsius; diff --git a/mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/Bug652331Test.cs b/mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/Bug652331Test.cs index cdc68486779..141d8bf3f6b 100644 --- a/mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/Bug652331Test.cs +++ b/mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/Bug652331Test.cs @@ -66,16 +66,24 @@ namespace MonoTests.System.ServiceModel.Dispatcher var client = new Service1Client (binding, remoteAddress); var wait = new ManualResetEvent (false); + + Exception error = null; + object result = null; + client.GetDataCompleted += delegate (object o, GetDataCompletedEventArgs e) { - if (e.Error != null) - throw e.Error; - Assert.AreEqual ("A", ((DataType1) e.Result).Id, "#1"); - wait.Set (); + try { + error = e.Error; + result = e.Error == null ? e.Result : null; + } finally { + wait.Set (); + } }; client.GetDataAsync (); - if (!wait.WaitOne (TimeSpan.FromSeconds (20))) - Assert.Fail ("timeout"); + + Assert.IsTrue (wait.WaitOne (TimeSpan.FromSeconds (20)), "timeout"); + Assert.IsNull (error, "#1, inner exception: {0}", error); + Assert.AreEqual ("A", ((DataType1) result).Id, "#2"); } finally { serviceHost.Close (); } diff --git a/mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/Bug652331_2Test.cs b/mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/Bug652331_2Test.cs index 4d6fca943e6..21559c528a2 100644 --- a/mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/Bug652331_2Test.cs +++ b/mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/Bug652331_2Test.cs @@ -76,58 +76,85 @@ namespace MonoTests.System.ServiceModel.Dispatcher var nestedClient = new Service1Client (binding, remoteAddress); var dbClient = new Service1Client (binding, remoteAddress); - var waits = new ManualResetEvent [4]; - for (int i = 0; i < waits.Length; i++) - waits [i] = new ManualResetEvent (false); - - int passed = 0; - - normalClient.GetDataCompleted += delegate (object o, GetDataCompletedEventArgs e) { - if (e.Error != null) { - Assert.Fail ("Normal failed; error: {0}", e.Error); - throw e.Error; - } - Assert.AreEqual ("A", ((DataType1) e.Result).Id, "Normal"); - Interlocked.Increment (ref passed); - waits [0].Set (); - }; - normalClient.GetDataAsync (); - - collectionClient.GetCollectionDataCompleted += delegate (object sender, GetCollectionDataCompletedEventArgs e) { - if (e.Error != null) { - Assert.Fail ("Collection failed; error: {0}", e.Error); - throw e.Error; - } - Assert.AreEqual ("B,C", ItemsToString (e.Result.Cast ()), "Collection"); - Interlocked.Increment (ref passed); - waits [1].Set (); - }; - collectionClient.GetCollectionDataAsync (); - - nestedClient.GetNestedDataCompleted += delegate (object sender, GetNestedDataCompletedEventArgs e) { - if (e.Error != null) { - Assert.Fail ("Nested failed; error: {0}", e.Error); - throw e.Error; - } - Assert.AreEqual ("D,E", ItemsToString (e.Result.Items.Cast ()), "Nested"); - Interlocked.Increment (ref passed); - waits [2].Set (); - }; - nestedClient.GetNestedDataAsync (); - - dbClient.JSMGetDatabasesCompleted += delegate (object sender, JSMGetDatabasesCompletedEventArgs e) { - waits [3].Set (); - if (e.Error != null) { - throw e.Error; - } - Assert.AreEqual ("databases", e.Result, "Databases"); - Interlocked.Increment (ref passed); - }; - dbClient.JSMGetDatabasesAsync(); - - WaitHandle.WaitAll (waits, TimeSpan.FromMinutes (1)); - if (passed != waits.Length) - Assert.Fail ("Not all tests passed!"); + { + ManualResetEvent wait = new ManualResetEvent (false); + Exception error = null; + object result = null; + + normalClient.GetDataCompleted += delegate (object o, GetDataCompletedEventArgs e) { + try { + error = e.Error; + result = e.Error == null ? e.Result : null; + } finally { + wait.Set (); + } + }; + normalClient.GetDataAsync (); + + Assert.IsTrue (wait.WaitOne (TimeSpan.FromSeconds (20)), "#1 timeout"); + Assert.IsNull (error, "#1.1, inner exception: {0}", error); + Assert.AreEqual ("A", ((DataType1) result).Id, "#1.2"); + } + + { + ManualResetEvent wait = new ManualResetEvent (false); + Exception error = null; + ObservableCollection result = null; + + collectionClient.GetCollectionDataCompleted += delegate (object sender, GetCollectionDataCompletedEventArgs e) { + try { + error = e.Error; + result = e.Error == null ? e.Result : null; + } finally { + wait.Set (); + } + }; + collectionClient.GetCollectionDataAsync (); + + Assert.IsTrue (wait.WaitOne (TimeSpan.FromSeconds (20)), "#2 timeout"); + Assert.IsNull (error, "#2.1, inner exception: {0}", error); + Assert.AreEqual ("B,C", ItemsToString (result.Cast ()), "#2.2"); + } + + { + ManualResetEvent wait = new ManualResetEvent (false); + Exception error = null; + WebServiceMoonlightTest.ServiceReference2.DataType2 result = null; + + nestedClient.GetNestedDataCompleted += delegate (object sender, GetNestedDataCompletedEventArgs e) { + try { + error = e.Error; + result = e.Error == null ? e.Result : null; + } finally { + wait.Set (); + } + }; + nestedClient.GetNestedDataAsync (); + + Assert.IsTrue (wait.WaitOne (TimeSpan.FromSeconds (20)), "#3 timeout"); + Assert.IsNull (error, "#3.1, inner exception: {0}", error); + Assert.AreEqual ("D,E", ItemsToString (result.Items.Cast ()), "#3.2"); + } + + { + ManualResetEvent wait = new ManualResetEvent (false); + Exception error = null; + string result = null; + + dbClient.JSMGetDatabasesCompleted += delegate (object sender, JSMGetDatabasesCompletedEventArgs e) { + try { + error = e.Error; + result = e.Error == null ? e.Result : null; + } finally { + wait.Set (); + } + }; + dbClient.JSMGetDatabasesAsync(); + + Assert.IsTrue (wait.WaitOne (TimeSpan.FromSeconds (20)), "#4 timeout"); + Assert.IsNull (error, "#4.1, inner exception: {0}", error); + Assert.AreEqual ("databases", result, "#4.2"); + } } string ItemsToString (IEnumerable items) diff --git a/mcs/class/System.ServiceProcess/System.ServiceProcess-net_4_5.csproj b/mcs/class/System.ServiceProcess/System.ServiceProcess-net_4_5.csproj deleted file mode 100644 index f4b52225f0a..00000000000 --- a/mcs/class/System.ServiceProcess/System.ServiceProcess-net_4_5.csproj +++ /dev/null @@ -1,120 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FE889BD6-43E6-435E-90CE-A39F65A4AA5A} - Library - 1699,618 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.ServiceProcess - v4.5 - 512 - - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,618 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {E6E1740E-37DD-487C-8947-F1C0612D4738} - System.Configuration.Install-net_4_5 - - - {B102F27C-1A07-487F-BA5B-D5155D201112} - System.Windows.Forms-net_4_5 - - - - - - - diff --git a/mcs/class/System.ServiceProcess/System.ServiceProcess-tests-net_4_5.csproj b/mcs/class/System.ServiceProcess/System.ServiceProcess-tests-net_4_5.csproj deleted file mode 100644 index 0cb2d14e87a..00000000000 --- a/mcs/class/System.ServiceProcess/System.ServiceProcess-tests-net_4_5.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {EE7E6BEB-7814-4A33-AF9A-9B0BFE5BE3B5} - Library - 1699,618 - bin\Debug\System.ServiceProcess-tests-net_4_5 - True - False - - Properties - - - System.ServiceProcess_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {FE889BD6-43E6-435E-90CE-A39F65A4AA5A} - System.ServiceProcess\System.ServiceProcess-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {E6E1740E-37DD-487C-8947-F1C0612D4738} - System.Configuration.Install\System.Configuration.Install-net_4_5 - - - {B102F27C-1A07-487F-BA5B-D5155D201112} - System.Windows.Forms\System.Windows.Forms-net_4_5 - - - - - - - diff --git a/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow-net_4_5.csproj b/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow-net_4_5.csproj deleted file mode 100644 index 3ab5713be9c..00000000000 --- a/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow-net_4_5.csproj +++ /dev/null @@ -1,137 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {19831BAF-44E6-4F3E-B46E-B1BD09398232} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Threading.Tasks.Dataflow - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow-net_4_x.csproj b/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow-net_4_x.csproj index d32383802fd..8a3a31b9e5e 100644 --- a/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow-net_4_x.csproj +++ b/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow-net_4_x.csproj @@ -25,7 +25,7 @@ full 1699 false - TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE + TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONCURRENT_COLLECTIONS prompt 4 @@ -33,7 +33,7 @@ pdbonly 1699 true - NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE + NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONCURRENT_COLLECTIONS prompt 4 @@ -48,52 +48,42 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {19831BAF-44E6-4F3E-B46E-B1BD09398232} - System.Threading.Tasks.Dataflow\System.Threading.Tasks.Dataflow-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - - - - - diff --git a/mcs/class/System.Transactions/System.Transactions-net_4_5.csproj b/mcs/class/System.Transactions/System.Transactions-net_4_5.csproj deleted file mode 100644 index 40c327bbb51..00000000000 --- a/mcs/class/System.Transactions/System.Transactions-net_4_5.csproj +++ /dev/null @@ -1,126 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {AF2BBF50-AB57-4CA1-8EF5-2B54C7418434} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Transactions - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - - - - - diff --git a/mcs/class/System.Transactions/System.Transactions-tests-net_4_5.csproj b/mcs/class/System.Transactions/System.Transactions-tests-net_4_5.csproj deleted file mode 100644 index ba5a47fe201..00000000000 --- a/mcs/class/System.Transactions/System.Transactions-tests-net_4_5.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {869910C7-CB75-4021-8862-ACBBE236B5A5} - Library - 1699,1595 - bin\Debug\System.Transactions-tests-net_4_5 - True - False - - Properties - - - System.Transactions_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,1595 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699,1595 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {AF2BBF50-AB57-4CA1-8EF5-2B54C7418434} - System.Transactions\System.Transactions-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration\System.Configuration-net_4_5 - - - - - - - diff --git a/mcs/class/System.Web.Abstractions/System.Web.Abstractions-net_4_5.csproj b/mcs/class/System.Web.Abstractions/System.Web.Abstractions-net_4_5.csproj deleted file mode 100644 index 786b2f97ed0..00000000000 --- a/mcs/class/System.Web.Abstractions/System.Web.Abstractions-net_4_5.csproj +++ /dev/null @@ -1,95 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {94BD3939-6937-47AA-86CF-5C3E4C59E272} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Web.Abstractions - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {B489C3DE-3ED3-4EDC-B42B-82B38E101857} - System.Web-net_4_5 - - - - - - - diff --git a/mcs/class/System.Web.Abstractions/System.Web.Abstractions-tests-net_4_5.csproj b/mcs/class/System.Web.Abstractions/System.Web.Abstractions-tests-net_4_5.csproj deleted file mode 100644 index cf089f84070..00000000000 --- a/mcs/class/System.Web.Abstractions/System.Web.Abstractions-tests-net_4_5.csproj +++ /dev/null @@ -1,95 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3801922A-8C65-4DC6-8B0C-35E154D9BCA0} - Library - 1699 - bin\Debug\System.Web.Abstractions-tests-net_4_5 - True - False - - Properties - - - System.Web.Abstractions_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {94BD3939-6937-47AA-86CF-5C3E4C59E272} - System.Web.Abstractions\System.Web.Abstractions-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {725FB152-838A-4C6E-8A12-AC47E2DD4CEA} - System.Web\System.Web-net_4_5-2 - - - - - - - diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices-net_4_5.csproj b/mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices-net_4_5.csproj deleted file mode 100644 index da3247ad3c1..00000000000 --- a/mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices-net_4_5.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B4E6806D-1B38-4CEE-8ADB-2D0A4D1AF25F} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Web.ApplicationServices - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;SYSTEM_WEB_APPLICATIONSERVICES - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;SYSTEM_WEB_APPLICATIONSERVICES - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - - - - - diff --git a/mcs/class/System.Web.DynamicData/System.Web.DynamicData-net_4_5.csproj b/mcs/class/System.Web.DynamicData/System.Web.DynamicData-net_4_5.csproj deleted file mode 100644 index 7d05cb40e24..00000000000 --- a/mcs/class/System.Web.DynamicData/System.Web.DynamicData-net_4_5.csproj +++ /dev/null @@ -1,164 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {EAE6491A-1C73-432A-A0C2-60940B6AA2B8} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Web.DynamicData - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {63EC4158-FFAC-4867-8003-CF6054C8DF0B} - System.ComponentModel.DataAnnotations-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {8AC5471F-9515-4D01-87B9-7974F2CBD6F1} - System.Data.Linq-net_4_5 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing-net_4_5 - - - {B489C3DE-3ED3-4EDC-B42B-82B38E101857} - System.Web-net_4_5 - - - {74D281D8-F725-4D79-B218-2DFCCFD44FA2} - System.Web.Extensions-net_4_5 - - - {94BD3939-6937-47AA-86CF-5C3E4C59E272} - System.Web.Abstractions-net_4_5 - - - {A28F2A14-901C-452C-82B6-75ECE5C7E714} - System.Web.Routing-net_4_5 - - - {B4E6806D-1B38-4CEE-8ADB-2D0A4D1AF25F} - System.Web.ApplicationServices-net_4_5 - - - - - - - diff --git a/mcs/class/System.Web.DynamicData/System.Web.DynamicData-tests-net_4_5.csproj b/mcs/class/System.Web.DynamicData/System.Web.DynamicData-tests-net_4_5.csproj deleted file mode 100644 index 6ed5528c431..00000000000 --- a/mcs/class/System.Web.DynamicData/System.Web.DynamicData-tests-net_4_5.csproj +++ /dev/null @@ -1,701 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5CA19741-2C8A-4482-835B-E1E4345A7E14} - Library - 1699 - bin\Debug\System.Web.DynamicData-tests-net_4_5 - True - False - - Properties - - - System.Web.DynamicData_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {EAE6491A-1C73-432A-A0C2-60940B6AA2B8} - System.Web.DynamicData\System.Web.DynamicData-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {63EC4158-FFAC-4867-8003-CF6054C8DF0B} - System.ComponentModel.DataAnnotations\System.ComponentModel.DataAnnotations-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data\System.Data-net_4_5 - - - {8AC5471F-9515-4D01-87B9-7974F2CBD6F1} - System.Data.Linq\System.Data.Linq-net_4_5 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing\System.Drawing-net_4_5 - - - {725FB152-838A-4C6E-8A12-AC47E2DD4CEA} - System.Web\System.Web-net_4_5-2 - - - {74D281D8-F725-4D79-B218-2DFCCFD44FA2} - System.Web.Extensions\System.Web.Extensions-net_4_5 - - - {94BD3939-6937-47AA-86CF-5C3E4C59E272} - System.Web.Abstractions\System.Web.Abstractions-net_4_5 - - - {A28F2A14-901C-452C-82B6-75ECE5C7E714} - System.Web.Routing\System.Web.Routing-net_4_5 - - - {B4E6806D-1B38-4CEE-8ADB-2D0A4D1AF25F} - System.Web.ApplicationServices\System.Web.ApplicationServices-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration\System.Configuration-net_4_5 - - - {337A92C8-EB50-43A9-9435-CB268AC147DC} - SystemWebTestShim\SystemWebTestShim-net_4_5 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - - - - - - MonoTests.WebPages.DynamicData.Content.FilterUserControl.ascx - - - MonoTests.WebPages.DynamicData.Content.FilterUserControl.ascx.cs - - - MonoTests.WebPages.DynamicData.Content.GridViewPager.ascx - - - MonoTests.WebPages.DynamicData.Content.GridViewPager.ascx.cs - - - MonoTests.WebPages.DynamicData.Content.Images.Back.gif - - - MonoTests.WebPages.DynamicData.Content.Images.header_back.gif - - - MonoTests.WebPages.DynamicData.Content.Images.PgFirst.gif - - - MonoTests.WebPages.DynamicData.Content.Images.PgLast.gif - - - MonoTests.WebPages.DynamicData.Content.Images.PgNext.gif - - - MonoTests.WebPages.DynamicData.Content.Images.PgPrev.gif - - - MonoTests.WebPages.DynamicData.Content.Images.plus.gif - - - MonoTests.WebPages.DynamicData.FieldTemplates.Boolean.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Boolean.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Boolean_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Boolean_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Children.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Children.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.CustomColor.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.CustomColor.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.CustomFieldTemplate.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.CustomFieldTemplate.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.DateTime.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.DateTime.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.DateTime_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.DateTime_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Decimal_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Decimal_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.ForeignKey.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.ForeignKey.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.ForeignKey_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.ForeignKey_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Integer_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Integer_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.MultilineText_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.MultilineText_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.MyCustomUIHintTemplate_Text.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.MyCustomUIHintTemplate_Text.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Boolean.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Boolean.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Byte.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Byte[].ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Byte.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Byte[].ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Char.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Char.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.FooEmpty.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.FooEmpty.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.ICollection.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.ICollection.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int16.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int16.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int32.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int32.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int64.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int64.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.MonoTests.Common.FooEmpty.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.MonoTests.Common.FooEmpty.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Object.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Object.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.SByte.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.SByte.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.String.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.String.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Boolean.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Boolean.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Byte.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Byte[].ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Byte.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Byte[].ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Char.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Char.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Collections.Generic.List`1[System.String].ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Collections.Generic.List`1[System.String].ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Collections.ICollection.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Collections.ICollection.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int16.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int16.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int32.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int32.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int64.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int64.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Object.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Object.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.SByte.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.SByte.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.String.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.String.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt16.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt16.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt32.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt32.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt64.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt64.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt16.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt16.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt32.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt32.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt64.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt64.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.PlainControlTemplate.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.PlainControlTemplate.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Text.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Text.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Text_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Text_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.PageTemplates.Details.aspx - - - MonoTests.WebPages.DynamicData.PageTemplates.Details.aspx.cs - - - MonoTests.WebPages.DynamicData.PageTemplates.Edit.aspx - - - MonoTests.WebPages.DynamicData.PageTemplates.Edit.aspx.cs - - - MonoTests.WebPages.DynamicData.PageTemplates.Insert.aspx - - - MonoTests.WebPages.DynamicData.PageTemplates.Insert.aspx.cs - - - MonoTests.WebPages.DynamicData.PageTemplates.List.aspx - - - MonoTests.WebPages.DynamicData.PageTemplates.List.aspx.cs - - - MonoTests.WebPages.DynamicData.PageTemplates.ListDetails.aspx - - - MonoTests.WebPages.DynamicData.PageTemplates.ListDetails.aspx.cs - - - MonoTests.WebPages.DynamicData.web.config - - - MonoTests.WebPages.Global.asax - - - MonoTests.WebPages.ListView_DynamicControl_01.aspx - - - MonoTests.WebPages.ListView_DynamicControl_01.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_02.aspx - - - MonoTests.WebPages.ListView_DynamicControl_02.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_03.aspx - - - MonoTests.WebPages.ListView_DynamicControl_03.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_04.aspx - - - MonoTests.WebPages.ListView_DynamicControl_04.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_05.aspx - - - MonoTests.WebPages.ListView_DynamicControl_05.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_06.aspx - - - MonoTests.WebPages.ListView_DynamicControl_06.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_07.aspx - - - MonoTests.WebPages.ListView_DynamicControl_07.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_08.aspx - - - MonoTests.WebPages.ListView_DynamicControl_08.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_09.aspx - - - MonoTests.WebPages.ListView_DynamicControl_09.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_10.aspx - - - MonoTests.WebPages.ListView_DynamicControl_10.aspx.cs - - - MonoTests.WebPages.DynamicValidator_01.aspx - - - MonoTests.WebPages.DynamicValidator_01.aspx.cs - - - MonoTests.WebPages.DynamicValidator_02.aspx - - - MonoTests.WebPages.DynamicValidator_02.aspx.cs - - - MonoTests.WebPages.Site.css - - - MonoTests.WebPages.Site.master - - - MonoTests.WebPages.Site.master.cs - - - MonoTests.WebPages.web.config.2.0 - - - MonoTests.WebPages.web.config.4.0 - - - MonoTests.WebPages.web.config.4.5 - - - - diff --git a/mcs/class/System.Web.Extensions.Design/System.Web.Extensions.Design-net_4_5.csproj b/mcs/class/System.Web.Extensions.Design/System.Web.Extensions.Design-net_4_5.csproj deleted file mode 100644 index 213425298b6..00000000000 --- a/mcs/class/System.Web.Extensions.Design/System.Web.Extensions.Design-net_4_5.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D1A53FE0-3EE3-43FD-8472-29B6E0FAA21D} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Web.Extensions.Design - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D4E6A482-761B-4B41-8B63-C930CA84D268} - System.Design-net_4_5 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing-net_4_5 - - - {B102F27C-1A07-487F-BA5B-D5155D201112} - System.Windows.Forms-net_4_5 - - - - - - - diff --git a/mcs/class/System.Web.Extensions/System.Web.Extensions-net_4_5.csproj b/mcs/class/System.Web.Extensions/System.Web.Extensions-net_4_5.csproj deleted file mode 100644 index cecbd560681..00000000000 --- a/mcs/class/System.Web.Extensions/System.Web.Extensions-net_4_5.csproj +++ /dev/null @@ -1,292 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {74D281D8-F725-4D79-B218-2DFCCFD44FA2} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - System.Web.Extensions - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_5;SYSTEM_WEB_EXTENSIONS - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;NET_3_5;SYSTEM_WEB_EXTENSIONS - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {B4E6806D-1B38-4CEE-8ADB-2D0A4D1AF25F} - System.Web.ApplicationServices-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {8AC5471F-9515-4D01-87B9-7974F2CBD6F1} - System.Data.Linq-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {B489C3DE-3ED3-4EDC-B42B-82B38E101857} - System.Web-net_4_5 - - - {251DB111-FEE1-4080-8411-0AD1CC9BA94B} - System.Web.Services-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {773D8BA7-9A88-49AC-81C9-740436270588} - System.EnterpriseServices-net_4_5 - - - {F2156C09-C377-4945-A690-39CFBF3319B3} - System.ServiceModel-net_4_5 - - - - - - - - MicrosoftAjax.debug.js - - - MicrosoftAjax.js - - - MicrosoftAjaxTimer.debug.js - - - MicrosoftAjaxTimer.js - - - MicrosoftAjaxWebForms.debug.js - - - MicrosoftAjaxWebForms.js - - - - diff --git a/mcs/class/System.Web.Extensions/System.Web.Extensions-tests-net_4_5.csproj b/mcs/class/System.Web.Extensions/System.Web.Extensions-tests-net_4_5.csproj deleted file mode 100644 index fc69b59e5ad..00000000000 --- a/mcs/class/System.Web.Extensions/System.Web.Extensions-tests-net_4_5.csproj +++ /dev/null @@ -1,257 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F6ACFFDE-B4F0-4622-AA00-6ED634E1BF3E} - Library - 1699,219,169,1591 - bin\Debug\System.Web.Extensions-tests-net_4_5 - True - False - true - Properties - - - System.Web.Extensions_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,219,169,1591 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;NET_3_5;SYSTEM_WEB_EXTENSIONS;SYSTEM_WEB_EXTENSIONS - prompt - 4 - - - pdbonly - 1699,219,169,1591 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;NET_3_5;SYSTEM_WEB_EXTENSIONS;SYSTEM_WEB_EXTENSIONS - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {74D281D8-F725-4D79-B218-2DFCCFD44FA2} - System.Web.Extensions\System.Web.Extensions-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing\System.Drawing-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data\System.Data-net_4_5 - - - {8AC5471F-9515-4D01-87B9-7974F2CBD6F1} - System.Data.Linq\System.Data.Linq-net_4_5 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {725FB152-838A-4C6E-8A12-AC47E2DD4CEA} - System.Web\System.Web-net_4_5-2 - - - {251DB111-FEE1-4080-8411-0AD1CC9BA94B} - System.Web.Services\System.Web.Services-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration\System.Configuration-net_4_5 - - - {773D8BA7-9A88-49AC-81C9-740436270588} - System.EnterpriseServices\System.EnterpriseServices-net_4_5 - - - {F2156C09-C377-4945-A690-39CFBF3319B3} - System.ServiceModel\System.ServiceModel-net_4_5 - - - {B4E6806D-1B38-4CEE-8ADB-2D0A4D1AF25F} - System.Web.ApplicationServices\System.Web.ApplicationServices-net_4_5 - - - {337A92C8-EB50-43A9-9435-CB268AC147DC} - SystemWebTestShim\SystemWebTestShim-net_4_5 - - - - - - - - MicrosoftAjax.debug.js - - - MicrosoftAjax.js - - - MicrosoftAjaxTimer.debug.js - - - MicrosoftAjaxTimer.js - - - MicrosoftAjaxWebForms.debug.js - - - MicrosoftAjaxWebForms.js - - - Web.mono.config - - - profile.config.4.5 - - - profile.config.4.0 - - - profile.config.2.0 - - - ListViewSort.aspx - - - ListViewTest.aspx - - - ListViewTotalRowCount_Bug535701_1.aspx - - - ListViewTotalRowCount_Bug535701_2.aspx - - - ListViewTotalRowCount_Bug604053.aspx - - - MyPage.aspx.cs - - - Global.asax - - - My.ashx - - - MyPage.aspx - - - MyPageWithDerivedMaster.aspx - - - MyPageWithMaster.aspx - - - MyPageWithMasterInvalidPlaceHolder.aspx - - - My.master - - - MyDerived.master - - - - diff --git a/mcs/class/System.Web.Http.SelfHost/System.Web.Http.SelfHost-net_4_5.csproj b/mcs/class/System.Web.Http.SelfHost/System.Web.Http.SelfHost-net_4_5.csproj deleted file mode 100644 index aa1b8ea8aaf..00000000000 --- a/mcs/class/System.Web.Http.SelfHost/System.Web.Http.SelfHost-net_4_5.csproj +++ /dev/null @@ -1,167 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A7DC51E3-AB8D-4FE4-B25F-4C16F3CCCB5C} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Web.Http.SelfHost - v4.5 - 512 - - - true - true - - - ../winfx.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;ASPNETMVC - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;ASPNETMVC - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {E36C154B-A0AC-4721-B06A-AFE31D357CE5} - System.Net.Http-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization-net_4_5 - - - {F2156C09-C377-4945-A690-39CFBF3319B3} - System.ServiceModel-net_4_5 - - - {F056C062-E467-4989-9366-440E8CD23C0C} - System.IdentityModel-net_4_5 - - - {2EFF8684-99DB-4DD6-B3BC-7E7AA42A15FC} - System.Web.Http-net_4_5 - - - {BFBE5444-4F21-45CF-929E-C8FBEF302F5E} - System.Net.Http.Formatting-net_4_5 - - - - - - - diff --git a/mcs/class/System.Web.Http.WebHost/System.Web.Http.WebHost-net_4_5.csproj b/mcs/class/System.Web.Http.WebHost/System.Web.Http.WebHost-net_4_5.csproj deleted file mode 100644 index 7b166273e3d..00000000000 --- a/mcs/class/System.Web.Http.WebHost/System.Web.Http.WebHost-net_4_5.csproj +++ /dev/null @@ -1,167 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {73DBB6D8-132F-4E3B-B437-2F65CBDEF5DE} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Web.Http.WebHost - v4.5 - 512 - - - true - true - - - ../winfx.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;ASPNETMVC - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;ASPNETMVC - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {E36C154B-A0AC-4721-B06A-AFE31D357CE5} - System.Net.Http-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization-net_4_5 - - - {F2156C09-C377-4945-A690-39CFBF3319B3} - System.ServiceModel-net_4_5 - - - {F056C062-E467-4989-9366-440E8CD23C0C} - System.IdentityModel-net_4_5 - - - {2EFF8684-99DB-4DD6-B3BC-7E7AA42A15FC} - System.Web.Http-net_4_5 - - - {BFBE5444-4F21-45CF-929E-C8FBEF302F5E} - System.Net.Http.Formatting-net_4_5 - - - {A28F2A14-901C-452C-82B6-75ECE5C7E714} - System.Web.Routing-net_4_5 - - - {B489C3DE-3ED3-4EDC-B42B-82B38E101857} - System.Web-net_4_5 - - - {50DC9191-2D18-4EDB-A929-4ECAB7981A1C} - Microsoft.Web.Infrastructure-net_4_5 - - - - - - - diff --git a/mcs/class/System.Web.Http/System.Web.Http-net_4_5.csproj b/mcs/class/System.Web.Http/System.Web.Http-net_4_5.csproj deleted file mode 100644 index f5d899c6ea8..00000000000 --- a/mcs/class/System.Web.Http/System.Web.Http-net_4_5.csproj +++ /dev/null @@ -1,394 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2EFF8684-99DB-4DD6-B3BC-7E7AA42A15FC} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Web.Http - v4.5 - 512 - - - true - true - - - ../winfx.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;ASPNETMVC - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;ASPNETMVC - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {E36C154B-A0AC-4721-B06A-AFE31D357CE5} - System.Net.Http-net_4_5 - - - {63EC4158-FFAC-4867-8003-CF6054C8DF0B} - System.ComponentModel.DataAnnotations-net_4_5 - - - {BFBE5444-4F21-45CF-929E-C8FBEF302F5E} - System.Net.Http.Formatting-net_4_5 - - - {CB3E9225-3DFF-4930-BFED-1E8AE5319C32} - System.Runtime.Caching-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization-net_4_5 - - - {8AC5471F-9515-4D01-87B9-7974F2CBD6F1} - System.Data.Linq-net_4_5 - - - - - - - - System.Web.Http.Properties.CommonWebApiResources.resources - - - System.Web.Http.Properties.SRResources.resources - - - - diff --git a/mcs/class/System.Web.Mvc3/System.Web.Mvc3-net_4_5.csproj b/mcs/class/System.Web.Mvc3/System.Web.Mvc3-net_4_5.csproj deleted file mode 100644 index 9aa71a350ae..00000000000 --- a/mcs/class/System.Web.Mvc3/System.Web.Mvc3-net_4_5.csproj +++ /dev/null @@ -1,496 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {AED34264-9E46-4F38-8BBF-6ECB69DE8FD8} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Web.Mvc - v4.5 - 512 - - - true - true - - - ../winfx.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;MONO - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;MONO - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {50DC9191-2D18-4EDB-A929-4ECAB7981A1C} - Microsoft.Web.Infrastructure-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {B489C3DE-3ED3-4EDC-B42B-82B38E101857} - System.Web-net_4_5 - - - {94BD3939-6937-47AA-86CF-5C3E4C59E272} - System.Web.Abstractions-net_4_5 - - - {A28F2A14-901C-452C-82B6-75ECE5C7E714} - System.Web.Routing-net_4_5 - - - {74D281D8-F725-4D79-B218-2DFCCFD44FA2} - System.Web.Extensions-net_4_5 - - - {63EC4158-FFAC-4867-8003-CF6054C8DF0B} - System.ComponentModel.DataAnnotations-net_4_5 - - - {8AC5471F-9515-4D01-87B9-7974F2CBD6F1} - System.Data.Linq-net_4_5 - - - {CB3E9225-3DFF-4930-BFED-1E8AE5319C32} - System.Runtime.Caching-net_4_5 - - - {FF61AB24-4492-47FA-B4D3-8D961113DD08} - System.Web.Razor-net_4_5 - - - {4E601800-644F-49B2-B1C9-60D3489AAC38} - System.Web.WebPages.Razor-net_4_5 - - - {FFDF7B0A-BD62-4E39-8A80-A42B560149C5} - System.Web.WebPages-net_4_5 - - - - - - - - System.Web.Mvc.Resources.MvcResources.resources - - - - diff --git a/mcs/class/System.Web.Razor/System.Web.Razor-net_4_5.csproj b/mcs/class/System.Web.Razor/System.Web.Razor-net_4_5.csproj deleted file mode 100644 index 91c4de825ae..00000000000 --- a/mcs/class/System.Web.Razor/System.Web.Razor-net_4_5.csproj +++ /dev/null @@ -1,252 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FF61AB24-4492-47FA-B4D3-8D961113DD08} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Web.Razor - v4.5 - 512 - - - true - true - - - ../winfx.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;ASPNETWEBPAGES - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;ASPNETWEBPAGES - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - - System.Web.Razor.Resources.RazorResources.resources - - - System.Web.Razor.Common.CommonResources.resources - - - - diff --git a/mcs/class/System.Web.Routing/System.Web.Routing-net_4_5.csproj b/mcs/class/System.Web.Routing/System.Web.Routing-net_4_5.csproj deleted file mode 100644 index da044b1f782..00000000000 --- a/mcs/class/System.Web.Routing/System.Web.Routing-net_4_5.csproj +++ /dev/null @@ -1,99 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A28F2A14-901C-452C-82B6-75ECE5C7E714} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Web.Routing - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {B489C3DE-3ED3-4EDC-B42B-82B38E101857} - System.Web-net_4_5 - - - {94BD3939-6937-47AA-86CF-5C3E4C59E272} - System.Web.Abstractions-net_4_5 - - - - - - - diff --git a/mcs/class/System.Web.Routing/System.Web.Routing-tests-net_4_5.csproj b/mcs/class/System.Web.Routing/System.Web.Routing-tests-net_4_5.csproj deleted file mode 100644 index 9059e20ce6a..00000000000 --- a/mcs/class/System.Web.Routing/System.Web.Routing-tests-net_4_5.csproj +++ /dev/null @@ -1,111 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B98A55A6-32F8-43D4-97EC-04118F2731CB} - Library - 1699 - bin\Debug\System.Web.Routing-tests-net_4_5 - True - False - - Properties - - - System.Web.Routing_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {A28F2A14-901C-452C-82B6-75ECE5C7E714} - System.Web.Routing\System.Web.Routing-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {725FB152-838A-4C6E-8A12-AC47E2DD4CEA} - System.Web\System.Web-net_4_5-2 - - - {94BD3939-6937-47AA-86CF-5C3E4C59E272} - System.Web.Abstractions\System.Web.Abstractions-net_4_5 - - - - - - - diff --git a/mcs/class/System.Web.Services/System.Web.Services-net_4_5.csproj b/mcs/class/System.Web.Services/System.Web.Services-net_4_5.csproj deleted file mode 100644 index a3bddf14269..00000000000 --- a/mcs/class/System.Web.Services/System.Web.Services-net_4_5.csproj +++ /dev/null @@ -1,297 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {251DB111-FEE1-4080-8411-0AD1CC9BA94B} - Library - 1699,168,169,219,414,612,649 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Web.Services - v4.5 - 512 - - - - true - full - 1699,168,169,219,414,612,649 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;MONO_BROKEN_CONFIGURATION_DLL - prompt - 4 - - - pdbonly - 1699,168,169,219,414,612,649 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;MONO_BROKEN_CONFIGURATION_DLL - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {773D8BA7-9A88-49AC-81C9-740436270588} - System.EnterpriseServices-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {21892B00-1C9F-44F3-AE4C-A6A9A210CEC7} - System.Web-plainweb-net_4_5 - - - {EC4E43E7-63C0-4D64-8B7A-E00C097872A5} - System.DirectoryServices-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {D4E6A482-761B-4B41-8B63-C930CA84D268} - System.Design-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - - - - - - wsdl-1.1.xsd - - - wsdl-1.1-soap.xsd - - - web-reference.xsd - - - - diff --git a/mcs/class/System.Web.Services/System.Web.Services-tests-net_4_5.csproj b/mcs/class/System.Web.Services/System.Web.Services-tests-net_4_5.csproj deleted file mode 100644 index 77e797f8d77..00000000000 --- a/mcs/class/System.Web.Services/System.Web.Services-tests-net_4_5.csproj +++ /dev/null @@ -1,147 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D5EB5665-A3B2-462E-8753-2B2BC4C8B313} - Library - 1699,649,169,618 - bin\Debug\System.Web.Services-tests-net_4_5 - True - False - - Properties - - - System.Web.Services_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,649,169,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699,649,169,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {251DB111-FEE1-4080-8411-0AD1CC9BA94B} - System.Web.Services\System.Web.Services-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {773D8BA7-9A88-49AC-81C9-740436270588} - System.EnterpriseServices\System.EnterpriseServices-net_4_5 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {B489C3DE-3ED3-4EDC-B42B-82B38E101857} - System.Web\System.Web-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration\System.Configuration-net_4_5 - - - - - - - - wsdl-1.1.xsd - - - wsdl-1.1-soap.xsd - - - web-reference.xsd - - - - diff --git a/mcs/class/System.Web.WebPages.Deployment/System.Web.WebPages.Deployment-net_4_5.csproj b/mcs/class/System.Web.WebPages.Deployment/System.Web.WebPages.Deployment-net_4_5.csproj deleted file mode 100644 index bf85858c143..00000000000 --- a/mcs/class/System.Web.WebPages.Deployment/System.Web.WebPages.Deployment-net_4_5.csproj +++ /dev/null @@ -1,132 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {CFBE1EF0-4B98-4752-9F6A-4D61CF9DA0EF} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Web.WebPages.Deployment - v4.5 - 512 - - - true - true - - - ../winfx.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;ASPNETWEBPAGES - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;ASPNETWEBPAGES - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {B489C3DE-3ED3-4EDC-B42B-82B38E101857} - System.Web-net_4_5 - - - {50DC9191-2D18-4EDB-A929-4ECAB7981A1C} - Microsoft.Web.Infrastructure-net_4_5 - - - - - - - - System.Web.WebPages.Deployment.Common.CommonResources.resources - - - System.Web.WebPages.Deployment.Resources.ConfigurationResources.resources - - - - diff --git a/mcs/class/System.Web.WebPages.Razor/System.Web.WebPages.Razor-net_4_5.csproj b/mcs/class/System.Web.WebPages.Razor/System.Web.WebPages.Razor-net_4_5.csproj deleted file mode 100644 index 209566383c5..00000000000 --- a/mcs/class/System.Web.WebPages.Razor/System.Web.WebPages.Razor-net_4_5.csproj +++ /dev/null @@ -1,139 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4E601800-644F-49B2-B1C9-60D3489AAC38} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Web.WebPages.Razor - v4.5 - 512 - - - true - true - - - ../winfx.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;ASPNETWEBPAGES - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;ASPNETWEBPAGES - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {B489C3DE-3ED3-4EDC-B42B-82B38E101857} - System.Web-net_4_5 - - - {FFDF7B0A-BD62-4E39-8A80-A42B560149C5} - System.Web.WebPages-net_4_5 - - - {FF61AB24-4492-47FA-B4D3-8D961113DD08} - System.Web.Razor-net_4_5 - - - - - - - - System.Web.WebPages.Razor.Resources.RazorWebResources.resources - - - System.Web.WebPages.Razor.Common.CommonResources.resources - - - - diff --git a/mcs/class/System.Web.WebPages/System.Web.WebPages-net_4_5.csproj b/mcs/class/System.Web.WebPages/System.Web.WebPages-net_4_5.csproj deleted file mode 100644 index 69af11e8dc8..00000000000 --- a/mcs/class/System.Web.WebPages/System.Web.WebPages-net_4_5.csproj +++ /dev/null @@ -1,287 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FFDF7B0A-BD62-4E39-8A80-A42B560149C5} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Web.WebPages - v4.5 - 512 - - - true - true - - - ../winfx.pub - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;ASPNETWEBPAGES - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;ASPNETWEBPAGES - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D554618C-5D38-413A-82BA-7A70B6FC61A3} - Microsoft.CSharp-net_4_5 - - - {50DC9191-2D18-4EDB-A929-4ECAB7981A1C} - Microsoft.Web.Infrastructure-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {63EC4158-FFAC-4867-8003-CF6054C8DF0B} - System.ComponentModel.DataAnnotations-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {8AC5471F-9515-4D01-87B9-7974F2CBD6F1} - System.Data.Linq-net_4_5 - - - {B489C3DE-3ED3-4EDC-B42B-82B38E101857} - System.Web-net_4_5 - - - {CFBE1EF0-4B98-4752-9F6A-4D61CF9DA0EF} - System.Web.WebPages.Deployment-net_4_5 - - - {FF61AB24-4492-47FA-B4D3-8D961113DD08} - System.Web.Razor-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {8328796E-8A15-4972-8F1E-2F15E7D57C42} - System.Xml.Linq-net_4_5 - - - - - - - - System.Web.WebPages.Resources.WebPageResources.resources - - - System.Web.WebPages.Common.CommonResources.resources - - - - diff --git a/mcs/class/System.Web/System.Web-net_4_5.csproj b/mcs/class/System.Web/System.Web-net_4_5.csproj deleted file mode 100644 index 67956ca1ebd..00000000000 --- a/mcs/class/System.Web/System.Web-net_4_5.csproj +++ /dev/null @@ -1,1613 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B489C3DE-3ED3-4EDC-B42B-82B38E101857} - Library - 1699,612,618,618 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - System.Web - v4.5 - 512 - - - - true - full - 1699,612,618,618 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;INSIDE_SYSTEM_WEB;WEBSERVICES_DEP - prompt - 4 - - - pdbonly - 1699,612,618,618 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;INSIDE_SYSTEM_WEB;WEBSERVICES_DEP - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {41476FBD-C1CB-4B3C-8078-3281EB1E0EAB} - Mono.Data.Sqlite-net_4_5 - - - {B4E6806D-1B38-4CEE-8ADB-2D0A4D1AF25F} - System.Web.ApplicationServices-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {773D8BA7-9A88-49AC-81C9-740436270588} - System.EnterpriseServices-net_4_5 - - - {B12AABBC-30D1-4885-BF3F-A53B970F68FB} - System.Runtime.Serialization.Formatters.Soap-net_4_5 - - - {63EC4158-FFAC-4867-8003-CF6054C8DF0B} - System.ComponentModel.DataAnnotations-net_4_5 - - - {251DB111-FEE1-4080-8411-0AD1CC9BA94B} - System.Web.Services-net_4_5 - - - {D4E6A482-761B-4B41-8B63-C930CA84D268} - System.Design-net_4_5 - - - - - - - - TranslationResources.resources - - - WebUIValidation.js - - - folder.gif - - - file.gif - - - computer.gif - - - arrow_minus.gif - - - arrow_noexpand.gif - - - arrow_plus.gif - - - arrow_up.gif - - - arrow_down.gif - - - box_full.gif - - - box_empty.gif - - - box_minus.gif - - - box_noexpand.gif - - - box_plus.gif - - - contact.gif - - - dot_empty.gif - - - dot_full.gif - - - dots.gif - - - inbox.gif - - - star_empty.gif - - - star_full.gif - - - warning.gif - - - TreeView_noexpand.gif - - - TreeView_dash.gif - - - TreeView_dashminus.gif - - - TreeView_dashplus.gif - - - TreeView_i.gif - - - TreeView_l.gif - - - TreeView_lminus.gif - - - TreeView_lplus.gif - - - TreeView_minus.gif - - - TreeView_plus.gif - - - TreeView_r.gif - - - TreeView_rminus.gif - - - TreeView_rplus.gif - - - TreeView_t.gif - - - TreeView_tminus.gif - - - TreeView_tplus.gif - - - transparent.gif - - - webform.js - - - WebUIValidation_2.0.js - - - ErrorTemplateCommon_Top.html - - - DefaultErrorTemplate_CustomErrorDefault.html - - - ErrorTemplateCommon_Bottom.html - - - DefaultErrorTemplate_StandardPage.html - - - HtmlizedExceptionPage_Top.html - - - HtmlizedExceptionPage_FileLongSource.html - - - HtmlizedExceptionPage_FileShortSource.html - - - HtmlizedExceptionPage_CompilerOutput.html - - - GridView.js - - - DetailsView.js - - - TreeView.js - - - Menu.js - - - MenuModern.js - - - - diff --git a/mcs/class/System.Web/System.Web-net_4_x.csproj b/mcs/class/System.Web/System.Web-net_4_x.csproj index bb59ec36a0d..f63b9ab2489 100644 --- a/mcs/class/System.Web/System.Web-net_4_x.csproj +++ b/mcs/class/System.Web/System.Web-net_4_x.csproj @@ -46,8 +46,11 @@ + + + @@ -55,9 +58,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -65,19 +122,307 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -100,6 +445,7 @@ + @@ -120,13 +466,11 @@ - - @@ -155,8 +499,6 @@ - - @@ -168,22 +510,14 @@ - - - - - - - - @@ -215,15 +549,12 @@ - - - @@ -243,8 +574,6 @@ - - @@ -255,8 +584,6 @@ - - @@ -275,16 +602,11 @@ - - - - - @@ -302,13 +624,9 @@ - - - - @@ -326,20 +644,17 @@ - - - @@ -352,7 +667,6 @@ - @@ -361,7 +675,6 @@ - @@ -376,10 +689,8 @@ - - @@ -422,8 +733,6 @@ - - @@ -439,24 +748,17 @@ - - - - - - - @@ -469,8 +771,6 @@ - - @@ -479,12 +779,8 @@ - - - - @@ -494,14 +790,10 @@ - - - - @@ -511,7 +803,6 @@ - @@ -524,7 +815,6 @@ - @@ -572,47 +862,20 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -620,23 +883,17 @@ - - - - - - @@ -644,8 +901,6 @@ - - @@ -654,170 +909,89 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -827,27 +1001,16 @@ - - - - - - - - - - - @@ -856,40 +1019,20 @@ - - - - - - - - - - - - - - - - - - - - @@ -900,16 +1043,10 @@ - - - - - - @@ -917,31 +1054,15 @@ - - - - - - - - - - - - - - - - @@ -951,55 +1072,38 @@ - - - - - - - - - - - - - - - - - @@ -1030,7 +1134,6 @@ - @@ -1040,31 +1143,22 @@ - - - - - - - - - @@ -1077,63 +1171,23 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1142,7 +1196,6 @@ - @@ -1165,8 +1218,6 @@ - - @@ -1185,18 +1236,14 @@ - - - - @@ -1212,9 +1259,7 @@ - - @@ -1230,10 +1275,8 @@ - - @@ -1270,12 +1313,9 @@ - - - @@ -1312,7 +1352,6 @@ - @@ -1320,12 +1359,7 @@ - - - - - @@ -1336,15 +1370,11 @@ - - - - @@ -1358,8 +1388,6 @@ - - diff --git a/mcs/class/System.Web/System.Web-plainweb-net_4_5.csproj b/mcs/class/System.Web/System.Web-plainweb-net_4_5.csproj deleted file mode 100644 index 925358a6fb7..00000000000 --- a/mcs/class/System.Web/System.Web-plainweb-net_4_5.csproj +++ /dev/null @@ -1,1605 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {21892B00-1C9F-44F3-AE4C-A6A9A210CEC7} - Library - 1699,612,618,618 - ./../../class/lib/net_4_5/plainweb - True - True - true - Properties - - - System.Web - v4.5 - 512 - - - - true - full - 1699,612,618,618 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;INSIDE_SYSTEM_WEB - prompt - 4 - - - pdbonly - 1699,612,618,618 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;INSIDE_SYSTEM_WEB - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {41476FBD-C1CB-4B3C-8078-3281EB1E0EAB} - Mono.Data.Sqlite-net_4_5 - - - {B4E6806D-1B38-4CEE-8ADB-2D0A4D1AF25F} - System.Web.ApplicationServices-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {773D8BA7-9A88-49AC-81C9-740436270588} - System.EnterpriseServices-net_4_5 - - - {B12AABBC-30D1-4885-BF3F-A53B970F68FB} - System.Runtime.Serialization.Formatters.Soap-net_4_5 - - - {63EC4158-FFAC-4867-8003-CF6054C8DF0B} - System.ComponentModel.DataAnnotations-net_4_5 - - - - - - - - TranslationResources.resources - - - WebUIValidation.js - - - folder.gif - - - file.gif - - - computer.gif - - - arrow_minus.gif - - - arrow_noexpand.gif - - - arrow_plus.gif - - - arrow_up.gif - - - arrow_down.gif - - - box_full.gif - - - box_empty.gif - - - box_minus.gif - - - box_noexpand.gif - - - box_plus.gif - - - contact.gif - - - dot_empty.gif - - - dot_full.gif - - - dots.gif - - - inbox.gif - - - star_empty.gif - - - star_full.gif - - - warning.gif - - - TreeView_noexpand.gif - - - TreeView_dash.gif - - - TreeView_dashminus.gif - - - TreeView_dashplus.gif - - - TreeView_i.gif - - - TreeView_l.gif - - - TreeView_lminus.gif - - - TreeView_lplus.gif - - - TreeView_minus.gif - - - TreeView_plus.gif - - - TreeView_r.gif - - - TreeView_rminus.gif - - - TreeView_rplus.gif - - - TreeView_t.gif - - - TreeView_tminus.gif - - - TreeView_tplus.gif - - - transparent.gif - - - webform.js - - - WebUIValidation_2.0.js - - - ErrorTemplateCommon_Top.html - - - DefaultErrorTemplate_CustomErrorDefault.html - - - ErrorTemplateCommon_Bottom.html - - - DefaultErrorTemplate_StandardPage.html - - - HtmlizedExceptionPage_Top.html - - - HtmlizedExceptionPage_FileLongSource.html - - - HtmlizedExceptionPage_FileShortSource.html - - - HtmlizedExceptionPage_CompilerOutput.html - - - GridView.js - - - DetailsView.js - - - TreeView.js - - - Menu.js - - - MenuModern.js - - - - diff --git a/mcs/class/System.Web/System.Web-plainweb-net_4_x.csproj b/mcs/class/System.Web/System.Web-plainweb-net_4_x.csproj index 97642fd1e84..df7651cee19 100644 --- a/mcs/class/System.Web/System.Web-plainweb-net_4_x.csproj +++ b/mcs/class/System.Web/System.Web-plainweb-net_4_x.csproj @@ -46,8 +46,11 @@ + + + @@ -55,9 +58,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -65,19 +122,307 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -100,6 +445,7 @@ + @@ -120,13 +466,11 @@ - - @@ -155,8 +499,6 @@ - - @@ -168,22 +510,14 @@ - - - - - - - - @@ -215,15 +549,12 @@ - - - @@ -243,8 +574,6 @@ - - @@ -255,8 +584,6 @@ - - @@ -275,16 +602,11 @@ - - - - - @@ -302,13 +624,9 @@ - - - - @@ -326,20 +644,17 @@ - - - @@ -352,7 +667,6 @@ - @@ -361,7 +675,6 @@ - @@ -376,10 +689,8 @@ - - @@ -422,8 +733,6 @@ - - @@ -439,24 +748,17 @@ - - - - - - - @@ -469,8 +771,6 @@ - - @@ -479,12 +779,8 @@ - - - - @@ -494,14 +790,10 @@ - - - - @@ -511,7 +803,6 @@ - @@ -524,7 +815,6 @@ - @@ -572,47 +862,20 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -620,23 +883,17 @@ - - - - - - @@ -644,8 +901,6 @@ - - @@ -654,170 +909,89 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -827,27 +1001,16 @@ - - - - - - - - - - - @@ -856,40 +1019,20 @@ - - - - - - - - - - - - - - - - - - - - @@ -900,16 +1043,10 @@ - - - - - - @@ -917,31 +1054,15 @@ - - - - - - - - - - - - - - - - @@ -951,55 +1072,38 @@ - - - - - - - - - - - - - - - - - @@ -1030,7 +1134,6 @@ - @@ -1040,31 +1143,22 @@ - - - - - - - - - @@ -1077,63 +1171,23 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1142,7 +1196,6 @@ - @@ -1165,8 +1218,6 @@ - - @@ -1185,18 +1236,14 @@ - - - - @@ -1212,9 +1259,7 @@ - - @@ -1230,10 +1275,8 @@ - - @@ -1270,12 +1313,9 @@ - - - @@ -1312,7 +1352,6 @@ - @@ -1320,12 +1359,7 @@ - - - - - @@ -1336,15 +1370,11 @@ - - - - @@ -1358,8 +1388,6 @@ - - diff --git a/mcs/class/System.Web/System.Web-tests-net_4_5.csproj b/mcs/class/System.Web/System.Web-tests-net_4_5.csproj deleted file mode 100644 index bb9302e4995..00000000000 --- a/mcs/class/System.Web/System.Web-tests-net_4_5.csproj +++ /dev/null @@ -1,1327 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {715EA166-6447-4341-B727-C7AC2084665B} - Library - 1699,612,618,618,219,169,1591 - bin\Debug\System.Web-tests-net_4_5 - True - False - true - Properties - - - System.Web_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,612,618,618,219,169,1591 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;INSIDE_SYSTEM_WEB;WEBSERVICES_DEP;MONOWEB_DEP;SYSTEMCORE_DEP - prompt - 4 - - - pdbonly - 1699,612,618,618,219,169,1591 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;INSIDE_SYSTEM_WEB;WEBSERVICES_DEP;MONOWEB_DEP;SYSTEMCORE_DEP - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {725FB152-838A-4C6E-8A12-AC47E2DD4CEA} - System.Web\System.Web-net_4_5-2 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing\System.Drawing-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data\System.Data-net_4_5 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {773D8BA7-9A88-49AC-81C9-740436270588} - System.EnterpriseServices\System.EnterpriseServices-net_4_5 - - - {B12AABBC-30D1-4885-BF3F-A53B970F68FB} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration\System.Configuration-net_4_5 - - - {41476FBD-C1CB-4B3C-8078-3281EB1E0EAB} - Mono.Data.Sqlite\Mono.Data.Sqlite-net_4_5 - - - {B4E6806D-1B38-4CEE-8ADB-2D0A4D1AF25F} - System.Web.ApplicationServices\System.Web.ApplicationServices-net_4_5 - - - {251DB111-FEE1-4080-8411-0AD1CC9BA94B} - System.Web.Services\System.Web.Services-net_4_5 - - - {4FCA6281-7800-4198-AE09-89EA51D456EB} - Mono.Web\Mono.Web-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {337A92C8-EB50-43A9-9435-CB268AC147DC} - SystemWebTestShim\SystemWebTestShim-net_4_5 - - - - - - - - TranslationResources.resources - - - WebUIValidation.js - - - folder.gif - - - file.gif - - - computer.gif - - - arrow_minus.gif - - - arrow_noexpand.gif - - - arrow_plus.gif - - - arrow_up.gif - - - arrow_down.gif - - - box_full.gif - - - box_empty.gif - - - box_minus.gif - - - box_noexpand.gif - - - box_plus.gif - - - contact.gif - - - dot_empty.gif - - - dot_full.gif - - - dots.gif - - - inbox.gif - - - star_empty.gif - - - star_full.gif - - - warning.gif - - - TreeView_noexpand.gif - - - TreeView_dash.gif - - - TreeView_dashminus.gif - - - TreeView_dashplus.gif - - - TreeView_i.gif - - - TreeView_l.gif - - - TreeView_lminus.gif - - - TreeView_lplus.gif - - - TreeView_minus.gif - - - TreeView_plus.gif - - - TreeView_r.gif - - - TreeView_rminus.gif - - - TreeView_rplus.gif - - - TreeView_t.gif - - - TreeView_tminus.gif - - - TreeView_tplus.gif - - - transparent.gif - - - webform.js - - - WebUIValidation_2.0.js - - - ErrorTemplateCommon_Top.html - - - DefaultErrorTemplate_CustomErrorDefault.html - - - ErrorTemplateCommon_Bottom.html - - - DefaultErrorTemplate_StandardPage.html - - - HtmlizedExceptionPage_Top.html - - - HtmlizedExceptionPage_FileLongSource.html - - - HtmlizedExceptionPage_FileShortSource.html - - - HtmlizedExceptionPage_CompilerOutput.html - - - GridView.js - - - DetailsView.js - - - TreeView.js - - - Menu.js - - - MenuModern.js - - - Global.asax - - - My.ashx - - - My.master - - - MyPage.aspx - - - MyPage.aspx.cs - - - MyPageWithMaster.aspx - - - Web.mono.config - - - Web.mono.config.4.0 - - - sub_map_01.sitemap - - - test_map_01.sitemap - - - test_map_02.sitemap - - - test_map_03.sitemap - - - test_map_04.sitemap - - - test_map_05.sitemap - - - test_map_06.sitemap - - - test_map_07.sitemap - - - test_map_08.sitemap - - - test_map_09.sitemap - - - menuclass.aspx - - - FormView.aspx - - - PostBackMenuTest.aspx - - - PageWithStyleSheet.aspx - - - PageWithTheme.aspx - - - ResolveUrl.ascx - - - ResolveUrl.aspx - - - RunTimeSetTheme.aspx - - - ReadOnlyPropertyBind.aspx - - - ReadOnlyPropertyControl.ascx - - - Theme1.skin - - - Theme2.skin - - - UrlProperty.aspx - - - UrlProperty.ascx - - - UrlProperty.ascx.cs - - - Web.sitemap - - - WizardTest.skin - - - FooterTemplateTest.aspx - - - DataGrid.aspx - - - DetailsViewTemplates.aspx - - - DetailsViewTemplates_2.aspx - - - DetailsViewTemplates_3.aspx - - - DetailsViewDataActions.aspx - - - DetailsViewProperties1.aspx - - - Bluehills.jpg - - - FormViewTest1.aspx - - - FormViewTest1_2.aspx - - - FormViewTest1_3.aspx - - - FormViewTest1_4.aspx - - - FormViewInsertEditDelete.aspx - - - GridViewUpdate.aspx - - - XMLDataSourceTest.xml - - - XMLDataSourceTest.xsl - - - XMLDataSourceTest1.aspx - - - XMLDataSourceTest2.aspx - - - XMLDataSourceTest3.aspx - - - XMLDataSourceTest4.aspx - - - LoginViewTest1.aspx - - - WebControl.config - - - WebLogin.config - - - CallbackTest1.aspx - - - CallbackTest2.aspx - - - EventValidationTest2.aspx - - - EventValidationTest1.aspx - - - ClientScript.js - - - EvalTest.aspx - - - TemplateUserControl.ascx - - - WebMapping.config - - - Mapping.aspx - - - Mapping1.aspx - - - CrossPagePosting1.aspx - - - CrossPagePosting2.aspx - - - MyDerived.master - - - MyPageWithDerivedMaster.aspx - - - MasterTypeTest1.aspx - - - MasterTypeTest2.aspx - - - PageLifecycleTest.aspx - - - PageValidationTest.aspx - - - AsyncPage.aspx - - - PageCultureTest.aspx - - - adapters.browser - - - NoEventValidation.aspx - - - ListControlPage.aspx - - - TextBoxTestlPage.aspx - - - ClearErrorOnError.aspx - - - RedirectOnError.aspx - - - TestCapability.browser - - - PageWithAdapter.aspx - - - InvalidPropertyBind1.aspx - - - InvalidPropertyBind2.aspx - - - InvalidPropertyBind3.aspx - - - InvalidPropertyBind4.aspx - - - ValidPropertyBind1.aspx - - - ValidPropertyBind2.aspx - - - ValidPropertyBind3.aspx - - - ValidPropertyBind4.aspx - - - ValidPropertyBind5.aspx - - - ReadWritePropertyControl.ascx - - - nunitweb_config.xml - - - TemplateControlParsingTest.aspx - - - ContentPlaceHolderInTemplate.aspx - - - ContentPlaceHolderInTemplate.master - - - MissingMasterFile.aspx - - - CustomSectionEmptyCollection.aspx - - - NoDoubleOnInitOnRemoveAdd.aspx - - - NoDoubleOnInitOnRemoveAdd.aspx.cs - - - LoginDisplayRememberMe.aspx - - - NoBindForMethodsWithBindInName.aspx - - - LinkInHeadWithEmbeddedExpression.aspx - - - ExpressionInListControl.aspx - - - ServerSideControlsInScriptBlock.aspx - - - ServerControlInClientSideComment.aspx - - - PreprocessorDirectivesInMarkup.aspx - - - UnquotedAngleBrackets.aspx - - - FullTagsInText.aspx - - - TagsExpressionsAndCommentsInText.aspx - - - NewlineInCodeExpression.aspx - - - DuplicateControlsInClientComment.aspx - - - TagsNestedInClientTag.aspx - - - ConditionalClientComments.aspx - - - OneLetterIdentifierInCodeRender.aspx - - - GlobalResourcesLocalization.aspx - - - TableSections_Bug551666.aspx - - - TableSections_Bug551666.aspx.cs - - - NestedParserFileText.aspx - - - StateFormatter_CorrectConverter.aspx - - - StateFormatter_CollectionConverter.aspx - - - StateFormatter_CollectionConverter.aspx.cs - - - ChangePasswordContainer_FindControl.aspx - - - TagWithExpressionWithinAttribute.aspx - - - CheckBoxList_Bug377703_1.aspx - - - CheckBoxList_Bug377703_2.aspx - - - CheckBoxList_Bug578770.aspx - - - EnumConverter_Bug578586.aspx - - - ButtonColor_Bug325489.aspx - - - SqlDataSource_OnInit_Bug572781.aspx - - - FormViewPagerVisibility.aspx - - - OverridenControlsPropertyAndPostBack_Bug594238.aspx - - - GlobalizationEncodingName.aspx - - - CheckBoxField_Bug595568_0.aspx - - - CheckBoxField_Bug595568_1.aspx - - - CheckBoxField_Bug595568_2.aspx - - - CheckBoxField_Bug595568_5.aspx - - - CheckBoxField_Bug595568_6.aspx - - - CheckBoxField_Bug595568_7.aspx - - - GridView_Bug595567.aspx - - - CheckBoxList_Bug600415.aspx - - - BoundField_Bug646505.aspx - - - BoundField_Bug646505.aspx.cs - - - HtmlTitleCodeRender_Bug662918.aspx - - - App_Code/EnumConverterControl.cs - - - App_Code/MyContainer.cs - - - App_Code/CustomCheckBoxColumn.cs - - - App_GlobalResources/Common.resx - - - App_GlobalResources/Common.fr-FR.resx - - - App_GlobalResources/Resource1.resx - - - - diff --git a/mcs/class/System.Web/System.Web.Util/UrlUtils.cs b/mcs/class/System.Web/System.Web.Util/UrlUtils.cs index 4f07e83f134..e229a913f8f 100644 --- a/mcs/class/System.Web/System.Web.Util/UrlUtils.cs +++ b/mcs/class/System.Web/System.Web.Util/UrlUtils.cs @@ -54,7 +54,7 @@ namespace System.Web.Util { if (path.StartsWith (appvpath)) path = path.Substring (appvpath.Length); - if (path [0] == '/') + if (path.StartsWith("/")) path = path.Length > 1 ? path.Substring (1) : ""; return Canonic (appvpath + "(" + id + ")/" + path); diff --git a/mcs/class/System.Windows.Forms.DataVisualization/System.Windows.Forms.DataVisualization-net_4_5.csproj b/mcs/class/System.Windows.Forms.DataVisualization/System.Windows.Forms.DataVisualization-net_4_5.csproj deleted file mode 100644 index 4ba951056ed..00000000000 --- a/mcs/class/System.Windows.Forms.DataVisualization/System.Windows.Forms.DataVisualization-net_4_5.csproj +++ /dev/null @@ -1,243 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5D72C9D5-37E8-4B93-A634-919A3B251C9B} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Windows.Forms.DataVisualization - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing-net_4_5 - - - {B102F27C-1A07-487F-BA5B-D5155D201112} - System.Windows.Forms-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - - - - - diff --git a/mcs/class/System.Windows.Forms.DataVisualization/System.Windows.Forms.DataVisualization-tests-net_4_5.csproj b/mcs/class/System.Windows.Forms.DataVisualization/System.Windows.Forms.DataVisualization-tests-net_4_5.csproj deleted file mode 100644 index 0df66b02c60..00000000000 --- a/mcs/class/System.Windows.Forms.DataVisualization/System.Windows.Forms.DataVisualization-tests-net_4_5.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {53691FB6-46CA-4725-AA1A-03418AFED79A} - Library - 1699 - bin\Debug\System.Windows.Forms.DataVisualization-tests-net_4_5 - True - False - - Properties - - - System.Windows.Forms.DataVisualization_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {5D72C9D5-37E8-4B93-A634-919A3B251C9B} - System.Windows.Forms.DataVisualization\System.Windows.Forms.DataVisualization-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing\System.Drawing-net_4_5 - - - {B102F27C-1A07-487F-BA5B-D5155D201112} - System.Windows.Forms\System.Windows.Forms-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data\System.Data-net_4_5 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - - - - - diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms-net_4_5.csproj b/mcs/class/System.Windows.Forms/System.Windows.Forms-net_4_5.csproj deleted file mode 100644 index c26d1f958f0..00000000000 --- a/mcs/class/System.Windows.Forms/System.Windows.Forms-net_4_5.csproj +++ /dev/null @@ -1,1199 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B102F27C-1A07-487F-BA5B-D5155D201112} - Library - 1699,618,612,809 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - System.Windows.Forms - v4.5 - 512 - - - - true - full - 1699,618,612,809 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699,618,612,809 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing-net_4_5 - - - {FACE8136-C95A-4788-90B2-DB0ECF7A020A} - Accessibility-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {85A9B29B-58FF-4FBE-8998-B0A89AC22880} - Mono.Posix-net_4_5 - - - {1D660912-8164-4499-A2D7-A3B2FE742E17} - Mono.WebBrowser-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {B12AABBC-30D1-4885-BF3F-A53B970F68FB} - System.Runtime.Serialization.Formatters.Soap-net_4_5 - - - - - - - - System.Windows.Forms.SplitterNS.cur - - - System.Windows.Forms.SplitterWE.cur - - - System.Windows.Forms.NESW.cur - - - System.Windows.Forms.NWSE.cur - - - System.Windows.Forms.DnDNo.cur - - - System.Windows.Forms.DnDCopy.cur - - - System.Windows.Forms.DnDLink.cur - - - System.Windows.Forms.DnDMove.cur - - - keyboards.resources - - - 16_computer.png - - - 32_computer.png - - - computer.png - - - 16_document-open.png - - - 32_document-open.png - - - document-open.png - - - 16_folder.png - - - folder-new.png - - - folder.png - - - 16_folder-remote.png - - - 32_folder-remote.png - - - folder-remote.png - - - go-previous.png - - - go-top.png - - - 22_page-magnifier.png - - - preferences-system-windows.png - - - 16_printer.png - - - 32_printer.png - - - text-x-generic.png - - - 16_user-desktop.png - - - 32_user-desktop.png - - - user-desktop.png - - - 16_user-home.png - - - 32_user-home.png - - - user-home.png - - - 16_dialog-error.png - - - 16_dialog-information.png - - - 16_dialog-warning.png - - - 1-up.png - - - 2-up.png - - - 3-up.png - - - 4-up.png - - - 6-up.png - - - nav_delete.png - - - nav_end.png - - - nav_first.png - - - nav_next.png - - - nav_plus.png - - - nav_previous.png - - - image-missing.png - - - image-x-generic.png - - - System.Windows.Forms.propertygrid-alphabetical.png - - - System.Windows.Forms.propertygrid-categorized.png - - - System.Windows.Forms.propertygrid-propertypages.png - - - System.Windows.Forms.Design.EventsTab.bmp - - - System.Windows.Forms.PropertyGridInternal.PropertiesTab.bmp - - - mono.ico - - - errorProvider.ico - - - - diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms-tests-net_4_5.csproj b/mcs/class/System.Windows.Forms/System.Windows.Forms-tests-net_4_5.csproj deleted file mode 100644 index 3c40c97306e..00000000000 --- a/mcs/class/System.Windows.Forms/System.Windows.Forms-tests-net_4_5.csproj +++ /dev/null @@ -1,312 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B636AE9C-EC26-43BB-B179-29FB9F60A0FA} - Library - 1699,618,612 - bin\Debug\System.Windows.Forms-tests-net_4_5 - True - False - - Properties - - - System.Windows.Forms_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,618,612 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699,618,612 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {B102F27C-1A07-487F-BA5B-D5155D201112} - System.Windows.Forms\System.Windows.Forms-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data\System.Data-net_4_5 - - - {CB1CB976-AA54-4553-B0E7-05665B199EC4} - System.Drawing\System.Drawing-net_4_5 - - - {FACE8136-C95A-4788-90B2-DB0ECF7A020A} - Accessibility\Accessibility-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {B12AABBC-30D1-4885-BF3F-A53B970F68FB} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_4_5 - - - - - - - - a.cur - - - 32x32.ico - - - - diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/XEventQueue.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/XEventQueue.cs index 11391af1a72..11b7ad542c2 100644 --- a/mcs/class/System.Windows.Forms/System.Windows.Forms/XEventQueue.cs +++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/XEventQueue.cs @@ -118,7 +118,7 @@ namespace System.Windows.Forms { return lqueue.Peek (); } } - return xqueue.Peek(); + return xqueue.Peek (); } public bool DispatchIdle { @@ -136,22 +136,30 @@ namespace System.Windows.Forms { private XEvent xevent; public PaintQueue (int size) { - hwnds = new ArrayList(size); - xevent = new XEvent(); + hwnds = new ArrayList (size); + xevent = new XEvent (); xevent.AnyEvent.type = XEventName.Expose; } public int Count { - get { return hwnds.Count; } + get { + lock (hwnds) { + return hwnds.Count; + } + } } public void Enqueue (Hwnd hwnd) { - hwnds.Add(hwnd); + lock (hwnds) { + hwnds.Add (hwnd); + } } public void Remove(Hwnd hwnd) { if (!hwnd.expose_pending && !hwnd.nc_expose_pending) { - hwnds.Remove(hwnd); + lock (hwnds) { + hwnds.Remove (hwnd); + } } } @@ -159,36 +167,38 @@ namespace System.Windows.Forms { Hwnd hwnd; IEnumerator next; - if (hwnds.Count == 0) { - xevent.ExposeEvent.window = IntPtr.Zero; - return xevent; - } - - next = hwnds.GetEnumerator(); - next.MoveNext(); - hwnd = (Hwnd)next.Current; - - // We only remove the event from the queue if we have one expose left since - // a single 'entry in our queue may be for both NC and Client exposed - if ( !(hwnd.nc_expose_pending && hwnd.expose_pending)) { - hwnds.Remove(hwnd); - } - if (hwnd.expose_pending) { - xevent.ExposeEvent.window = hwnd.client_window; + lock (hwnds) { + if (hwnds.Count == 0) { + xevent.ExposeEvent.window = IntPtr.Zero; + return xevent; + } + + next = hwnds.GetEnumerator (); + next.MoveNext (); + hwnd = (Hwnd)next.Current; + + // We only remove the event from the queue if we have one expose left since + // a single 'entry in our queue may be for both NC and Client exposed + if (!(hwnd.nc_expose_pending && hwnd.expose_pending)) { + hwnds.Remove (hwnd); + } + if (hwnd.expose_pending) { + xevent.ExposeEvent.window = hwnd.client_window; #if not - xevent.ExposeEvent.x = hwnd.invalid.X; - xevent.ExposeEvent.y = hwnd.invalid.Y; - xevent.ExposeEvent.width = hwnd.invalid.Width; - xevent.ExposeEvent.height = hwnd.invalid.Height; + xevent.ExposeEvent.x = hwnd.invalid.X; + xevent.ExposeEvent.y = hwnd.invalid.Y; + xevent.ExposeEvent.width = hwnd.invalid.Width; + xevent.ExposeEvent.height = hwnd.invalid.Height; #endif - return xevent; - } else { - xevent.ExposeEvent.window = hwnd.whole_window; - xevent.ExposeEvent.x = hwnd.nc_invalid.X; - xevent.ExposeEvent.y = hwnd.nc_invalid.Y; - xevent.ExposeEvent.width = hwnd.nc_invalid.Width; - xevent.ExposeEvent.height = hwnd.nc_invalid.Height; - return xevent; + return xevent; + } else { + xevent.ExposeEvent.window = hwnd.whole_window; + xevent.ExposeEvent.x = hwnd.nc_invalid.X; + xevent.ExposeEvent.y = hwnd.nc_invalid.Y; + xevent.ExposeEvent.width = hwnd.nc_invalid.Width; + xevent.ExposeEvent.height = hwnd.nc_invalid.Height; + return xevent; + } } } } diff --git a/mcs/class/System.Windows/System.Windows-net_4_5.csproj b/mcs/class/System.Windows/System.Windows-net_4_5.csproj deleted file mode 100644 index 9b5af1f5422..00000000000 --- a/mcs/class/System.Windows/System.Windows-net_4_5.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {050D4277-82D2-4544-A929-EDCBEA5FD69D} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Windows - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/System.XML/System.Xml-bare-net_4_5.csproj b/mcs/class/System.XML/System.Xml-bare-net_4_5.csproj deleted file mode 100644 index 1a53e231ece..00000000000 --- a/mcs/class/System.XML/System.Xml-bare-net_4_5.csproj +++ /dev/null @@ -1,750 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {21FB091E-0F84-479E-AB16-6503D36852F9} - Library - 1699,219,414,649,1717 - ./../../class/lib/net_4_5/bare - True - True - true - Properties - - - System.Xml - v4.5 - 512 - - - - true - full - 1699,219,414,649,1717 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;ASYNC - prompt - 4 - - - pdbonly - 1699,219,414,649,1717 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;ASYNC - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {91CDF14E-F60F-4AB7-BC9D-5CBD7E669076} - System-bare-net_4_5 - - - - - - - diff --git a/mcs/class/System.XML/System.Xml-bare-net_4_x.csproj b/mcs/class/System.XML/System.Xml-bare-net_4_x.csproj index 53a6be689d8..07e626b0933 100644 --- a/mcs/class/System.XML/System.Xml-bare-net_4_x.csproj +++ b/mcs/class/System.XML/System.Xml-bare-net_4_x.csproj @@ -709,6 +709,7 @@ + - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {91CDF14E-F60F-4AB7-BC9D-5CBD7E669076} - System-bare-net_4_5 - - - - - - - diff --git a/mcs/class/System.XML/System.Xml-net_4_x.csproj b/mcs/class/System.XML/System.Xml-net_4_x.csproj index 2f5e7bacb86..cdfb3fdeff8 100644 --- a/mcs/class/System.XML/System.Xml-net_4_x.csproj +++ b/mcs/class/System.XML/System.Xml-net_4_x.csproj @@ -709,6 +709,7 @@ + - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -$(ProjectDir)\..\..\..\mono\msvc\scripts\prepare.exe $(ProjectDir)..\.. xml -$(ProjectDir)\..\..\jay\jay.exe -ct < $(ProjectDir)\..\..\jay\skeleton.cs $(ProjectDir)\System.Xml.XPath\Parser.jay > $(ProjectDir)\System.Xml.XPath\Parser.cs -echo #define XSLT_PATTERN > $(ProjectDir)\Mono.Xml.Xsl\PatternParser.cs -$(ProjectDir)\..\..\jay\jay.exe -ct < $(ProjectDir)\..\..\jay\skeleton.cs $(ProjectDir)\Mono.Xml.Xsl\PatternParser.jay >> $(ProjectDir)\Mono.Xml.Xsl\PatternParser.cs -echo #define XSLT_PATTERN > $(ProjectDir)\Mono.Xml.Xsl\PatternTokenizer.cs -type $(ProjectDir)\System.Xml.XPath\Tokenizer.cs >> $(ProjectDir)\Mono.Xml.Xsl\PatternTokenizer.cs - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/System.XML/System.Xml.Xsl/XslCompiledTransform_Mobile.cs b/mcs/class/System.XML/System.Xml.Xsl/XslCompiledTransform_Mobile.cs index 808fa1ace28..94dcc0285ba 100644 --- a/mcs/class/System.XML/System.Xml.Xsl/XslCompiledTransform_Mobile.cs +++ b/mcs/class/System.XML/System.Xml.Xsl/XslCompiledTransform_Mobile.cs @@ -121,7 +121,9 @@ namespace System.Xml.Xsl public void Transform (IXPathNavigable input, XsltArgumentList arguments, Stream results) { - Transform (input.CreateNavigator (), arguments, results); + using (var sw = new StreamWriter (results)) { + Transform (input.CreateNavigator (), arguments, sw); + } } public void Transform (IXPathNavigable input, XmlWriter results) diff --git a/mcs/class/System.XML/Test/System.Xml.Xsl/XslCompiledTransformTests.cs b/mcs/class/System.XML/Test/System.Xml.Xsl/XslCompiledTransformTests.cs index aa333328d96..3ed7fc3a066 100644 --- a/mcs/class/System.XML/Test/System.Xml.Xsl/XslCompiledTransformTests.cs +++ b/mcs/class/System.XML/Test/System.Xml.Xsl/XslCompiledTransformTests.cs @@ -168,5 +168,31 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-micros // Returns true on .NET and False on mono 2.10.2 Assert.IsTrue (xslCompiledTransform.OutputSettings.Indent, "#1"); } + + [Test] // Bug 36436 + public void TransformWithXmlDocument () + { + XmlDocument doc = new XmlDocument (); + doc.LoadXml (@""); + XmlDocument st = new XmlDocument (); + st.LoadXml (@" + + + + + + + + +"); + XslCompiledTransform xsl = new XslCompiledTransform (); + xsl.Load (st); + + XsltArgumentList args = new XsltArgumentList (); + + MemoryStream mstr = new MemoryStream (); + xsl.Transform (doc, args, mstr); + } } } diff --git a/mcs/class/System.XML/mobile_System.Xml.dll.sources b/mcs/class/System.XML/mobile_System.Xml.dll.sources index 7a992e74ea3..9306044810f 100644 --- a/mcs/class/System.XML/mobile_System.Xml.dll.sources +++ b/mcs/class/System.XML/mobile_System.Xml.dll.sources @@ -108,7 +108,6 @@ ReferenceSources/CodeDom.cs ../../../external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltCompileContext.cs ../../../external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltDebugger.cs ../../../external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltOutput.cs -../../../external/referencesource/System.Xml/InternalApis/NDP_Common/inc/Win8Helpers.cs ../../../external/referencesource/System.Xml/misc/HResults.cs ../../../external/referencesource/System.Xml/misc/InvariantComparer.cs ../../../external/referencesource/System.Xml/misc/PrivilegedConfigurationManager.cs diff --git a/mcs/class/System.Xaml/System.Xaml-net_4_5.csproj b/mcs/class/System.Xaml/System.Xaml-net_4_5.csproj deleted file mode 100644 index 61c63aeef2e..00000000000 --- a/mcs/class/System.Xaml/System.Xaml-net_4_5.csproj +++ /dev/null @@ -1,215 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F574F9BD-1838-4C13-8722-7D6D33DE1781} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Xaml - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/System.Xaml/System.Xaml-tests-net_4_5.csproj b/mcs/class/System.Xaml/System.Xaml-tests-net_4_5.csproj deleted file mode 100644 index e78a6bb00c4..00000000000 --- a/mcs/class/System.Xaml/System.Xaml-tests-net_4_5.csproj +++ /dev/null @@ -1,132 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FDA04C3E-7386-4F45-A7F2-C69DB33B72FF} - Library - 1699 - bin\Debug\System.Xaml-tests-net_4_5 - True - False - - Properties - - - System.Xaml_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {F574F9BD-1838-4C13-8722-7D6D33DE1781} - System.Xaml\System.Xaml-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - - - - - diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq-net_4_5.csproj b/mcs/class/System.Xml.Linq/System.Xml.Linq-net_4_5.csproj deleted file mode 100644 index 9a5bd93fa45..00000000000 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq-net_4_5.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8328796E-8A15-4972-8F1E-2F15E7D57C42} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Xml.Linq - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {08FF4C26-9C12-433D-AE90-43370046387A} - System.Runtime.Serialization-net_4_5 - - - - - - - diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq-tests-net_4_5.csproj b/mcs/class/System.Xml.Linq/System.Xml.Linq-tests-net_4_5.csproj deleted file mode 100644 index fa9c2204a33..00000000000 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq-tests-net_4_5.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {63E33F71-AF79-425B-A8C6-A99998A982AB} - Library - 1699,1720 - bin\Debug\System.Xml.Linq-tests-net_4_5 - True - False - - Properties - - - System.Xml.Linq_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;NET_3_5 - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {8328796E-8A15-4972-8F1E-2F15E7D57C42} - System.Xml.Linq\System.Xml.Linq-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - - - - - diff --git a/mcs/class/System.Xml.Serialization/System.Xml.Serialization-net_4_5.csproj b/mcs/class/System.Xml.Serialization/System.Xml.Serialization-net_4_5.csproj deleted file mode 100644 index da5b1948425..00000000000 --- a/mcs/class/System.Xml.Serialization/System.Xml.Serialization-net_4_5.csproj +++ /dev/null @@ -1,91 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8888F00F-4ADC-4C1E-B542-7A8FA406CD98} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.Xml.Serialization - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {F2156C09-C377-4945-A690-39CFBF3319B3} - System.ServiceModel-net_4_5 - - - - - - - diff --git a/mcs/class/System/Documentation/en/System.Net/WebRequest.xml b/mcs/class/System/Documentation/en/System.Net/WebRequest.xml index fd261142225..9ab8e3c068f 100644 --- a/mcs/class/System/Documentation/en/System.Net/WebRequest.xml +++ b/mcs/class/System/Documentation/en/System.Net/WebRequest.xml @@ -1036,9 +1036,10 @@ public class CreateDefaultExample - - - method reads the current user's Internet Explorer (IE) proxy settings. This process includes the IE options to automatically detect proxy settings, use an automatic configuration script, manual proxy server settings, and advanced manual proxy server settings. + + creates an appropriate proxy object for the current user. + On Windows, the method reads the current user's Internet Explorer (IE) proxy settings. The settings supported on Mono are proxy enabled, proxy URL, and proxy excluded domains. + On UNIX-like systems (but not including Mac OS, iOS, or Android), the method reads the environment variables "MONO_PROXY" (or "mono_proxy") and "NO_PROXY" (or "no_proxy"). See the mono man page for more information. If your application is impersonating several users, you can use the method to retrieve a proxy for each impersonated user. diff --git a/mcs/class/System/Documentation/en/ns-System.Security.Cryptography.xml b/mcs/class/System/Documentation/en/ns-System.Security.Cryptography.xml index 1ca4d6fe4ba..0aff7f512b5 100644 --- a/mcs/class/System/Documentation/en/ns-System.Security.Cryptography.xml +++ b/mcs/class/System/Documentation/en/ns-System.Security.Cryptography.xml @@ -4,7 +4,7 @@ To be added. - The namespace provides cryptographic services, including secure encoding and decoding of data, as well as many other operations, such as hashing, random number generation, and message authentication. For more information, see Cryptographic Services. + The namespace provides cryptographic services, including secure encoding and decoding of data, as well as many other operations, such as hashing, random number generation, and message authentication. For more information, see Cryptographic Services. \ No newline at end of file diff --git a/mcs/class/System/Makefile b/mcs/class/System/Makefile index aef9e5f2b46..5f52ecca391 100644 --- a/mcs/class/System/Makefile +++ b/mcs/class/System/Makefile @@ -23,6 +23,11 @@ TEST_MCS_FLAGS = -r:System.Drawing.dll -r:Mono.Security.dll -r:System.Data -r:Sy $(foreach f, $(TEST_RESOURCES), -resource:$(f),$(notdir $(f))) REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX +ifndef NO_PROCESS_START +REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_PROCESS_START +TEST_MCS_FLAGS += -d:MONO_FEATURE_PROCESS_START +endif + LIB_MCS_FLAGS = -nowarn:618 -d:CONFIGURATION_2_0 $(REFERENCE_SOURCES_FLAGS) -unsafe $(RESOURCE_FILES:%=-resource:%) TEST_MCS_FLAGS += -r:System.Configuration @@ -99,7 +104,7 @@ artifacts = $(system_library_deps) \ .NOTPARALLEL: $(system_library_deps) -$(the_libdir_base)System.dll: $(system_library_deps) +$(the_libdir_base)System.dll: $(system_library_deps) ../Mono.Security/Makefile ifeq (bare/,$(intermediate)) build-bare: @@ -121,7 +126,7 @@ $(the_libdir_base)System.Xml.dll: $(bare_libdir)/System.Xml.dll: (cd ../System.XML; $(MAKE) $@) -$(the_libdir_base)Mono.Security.dll: +$(the_libdir_base)Mono.Security.dll: ../Mono.Security/Makefile (cd ../Mono.Security; $(MAKE)) $(the_libdir_base)System.Configuration.dll: diff --git a/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs b/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs index 5c389a0ea7b..271f500772b 100644 --- a/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs +++ b/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs @@ -387,6 +387,12 @@ namespace Mono.CSharp \s* (?.*)$"; + static readonly Regex RelatedSymbolsRegex = new Regex( + @" + \(Location\ of\ the\ symbol\ related\ to\ previous\ (warning|error)\) + ", + RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.IgnorePatternWhitespace); + private static CompilerError CreateErrorFromString(string error_string) { if (error_string.StartsWith ("BETA")) @@ -399,11 +405,17 @@ namespace Mono.CSharp Regex reg = new Regex (ErrorRegexPattern, RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.IgnorePatternWhitespace); Match match=reg.Match(error_string); if (!match.Success) { - // We had some sort of runtime crash - error.ErrorText = error_string; - error.IsWarning = false; - error.ErrorNumber = ""; - return error; + match = RelatedSymbolsRegex.Match (error_string); + if (!match.Success) { + // We had some sort of runtime crash + error.ErrorText = error_string; + error.IsWarning = false; + error.ErrorNumber = ""; + return error; + } else { + // This line is a continuation of previous warning of error + return null; + } } if (String.Empty != match.Result("${file}")) error.FileName=match.Result("${file}"); diff --git a/mcs/class/System/Mono.Http/NtlmClient.cs b/mcs/class/System/Mono.Http/NtlmClient.cs index 54e85db013e..b40d601b4b1 100644 --- a/mcs/class/System/Mono.Http/NtlmClient.cs +++ b/mcs/class/System/Mono.Http/NtlmClient.cs @@ -40,6 +40,7 @@ using MonoSecurity::Mono.Security.Protocol.Ntlm; using System; using System.Collections; using System.Net; +using System.Runtime.CompilerServices; namespace Mono.Http { @@ -122,14 +123,8 @@ namespace Mono.Http class NtlmClient : IAuthenticationModule { - static Hashtable cache; - - static NtlmClient () - { - cache = new Hashtable (); - } - - public NtlmClient () {} + static readonly ConditionalWeakTable cache = + new ConditionalWeakTable (); public Authorization Authenticate (string challenge, WebRequest webRequest, ICredentials credentials) { @@ -153,12 +148,7 @@ namespace Mono.Http return null; lock (cache) { - NtlmSession ds = (NtlmSession) cache [request]; - if (ds == null) { - ds = new NtlmSession (); - cache.Add (request, ds); - } - + var ds = cache.GetOrCreateValue (request); return ds.Authenticate (header, webRequest, credentials); } } diff --git a/mcs/class/System/Mono.Net.Security/ChainValidationHelper.cs b/mcs/class/System/Mono.Net.Security/ChainValidationHelper.cs index b0470537b50..1f37bc47589 100644 --- a/mcs/class/System/Mono.Net.Security/ChainValidationHelper.cs +++ b/mcs/class/System/Mono.Net.Security/ChainValidationHelper.cs @@ -156,8 +156,11 @@ namespace Mono.Net.Security tlsStream = other.tlsStream; request = other.request; + if (settings == null) + settings = MonoTlsSettings.DefaultSettings; + this.provider = provider; - this.settings = settings = settings.CloneWithValidator (this); + this.settings = settings.CloneWithValidator (this); this.callbackWrapper = callbackWrapper; } @@ -170,6 +173,8 @@ namespace Mono.Net.Security ChainValidationHelper (MonoTlsProvider provider, MonoTlsSettings settings, bool cloneSettings, MonoTlsStream stream, ServerCertValidationCallbackWrapper callbackWrapper) { + if (settings == null) + settings = MonoTlsSettings.CopyDefaultSettings (); if (cloneSettings) settings = settings.CloneWithValidator (this); diff --git a/mcs/class/System/Mono.Net.Security/MonoDefaultTlsProvider.cs b/mcs/class/System/Mono.Net.Security/MonoDefaultTlsProvider.cs index 8fd50fd1a3e..4051b1502dc 100644 --- a/mcs/class/System/Mono.Net.Security/MonoDefaultTlsProvider.cs +++ b/mcs/class/System/Mono.Net.Security/MonoDefaultTlsProvider.cs @@ -60,6 +60,16 @@ namespace Mono.Net.Security.Private */ class MonoDefaultTlsProvider : MonoTlsProviderImpl { + static readonly Guid id = new Guid ("809e77d5-56cc-4da8-b9f0-45e65ba9cceb"); + + public override Guid ID { + get { return id; } + } + + public override string Name { + get { return "legacy"; } + } + public MonoTlsProvider Provider { get { return this; } } diff --git a/mcs/class/System/Mono.Net.Security/MonoSslStreamImpl.cs b/mcs/class/System/Mono.Net.Security/MonoSslStreamImpl.cs index 8418cf8d207..999a8868ab6 100644 --- a/mcs/class/System/Mono.Net.Security/MonoSslStreamImpl.cs +++ b/mcs/class/System/Mono.Net.Security/MonoSslStreamImpl.cs @@ -34,9 +34,9 @@ extern alias MonoSecurity; #endif #if MONO_SECURITY_ALIAS -using MonoSecurity::Mono.Security.Interface; +using MSI = MonoSecurity::Mono.Security.Interface; #else -using Mono.Security.Interface; +using MSI = Mono.Security.Interface; #endif #if MONO_X509_ALIAS using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection; @@ -72,7 +72,7 @@ using System.Security.Cryptography; namespace Mono.Net.Security { - class MonoSslStreamImpl : MonoSslStream + class MonoSslStreamImpl : MSI.IMonoSslStream { IMonoSslStream impl; @@ -88,220 +88,220 @@ namespace Mono.Net.Security this.impl = impl; } - public override void AuthenticateAsClient (string targetHost) + public void AuthenticateAsClient (string targetHost) { Impl.AuthenticateAsClient (targetHost); } - public override void AuthenticateAsClient (string targetHost, XX509CertificateCollection clientCertificates, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation) + public void AuthenticateAsClient (string targetHost, XX509CertificateCollection clientCertificates, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation) { Impl.AuthenticateAsClient (targetHost, clientCertificates, (SslProtocols)enabledSslProtocols, checkCertificateRevocation); } - public override IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState) + public IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState) { return Impl.BeginAuthenticateAsClient (targetHost, asyncCallback, asyncState); } - public override IAsyncResult BeginAuthenticateAsClient (string targetHost, XX509CertificateCollection clientCertificates, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState) + public IAsyncResult BeginAuthenticateAsClient (string targetHost, XX509CertificateCollection clientCertificates, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState) { return Impl.BeginAuthenticateAsClient (targetHost, clientCertificates, (SslProtocols)enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState); } - public override void EndAuthenticateAsClient (IAsyncResult asyncResult) + public void EndAuthenticateAsClient (IAsyncResult asyncResult) { Impl.EndAuthenticateAsClient (asyncResult); } - public override void AuthenticateAsServer (X509Certificate serverCertificate) + public void AuthenticateAsServer (X509Certificate serverCertificate) { Impl.AuthenticateAsServer (serverCertificate); } - public override void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation) + public void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation) { Impl.AuthenticateAsServer (serverCertificate, clientCertificateRequired, (SslProtocols)enabledSslProtocols, checkCertificateRevocation); } - public override IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState) + public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState) { return Impl.BeginAuthenticateAsServer (serverCertificate, asyncCallback, asyncState); } - public override IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState) + public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState) { return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, (SslProtocols)enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState); } - public override void EndAuthenticateAsServer (IAsyncResult asyncResult) + public void EndAuthenticateAsServer (IAsyncResult asyncResult) { Impl.EndAuthenticateAsServer (asyncResult); } - public override Task AuthenticateAsClientAsync (string targetHost) + public Task AuthenticateAsClientAsync (string targetHost) { return Impl.AuthenticateAsClientAsync (targetHost); } - public override Task AuthenticateAsClientAsync (string targetHost, XX509CertificateCollection clientCertificates, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation) + public Task AuthenticateAsClientAsync (string targetHost, XX509CertificateCollection clientCertificates, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation) { return Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, (SslProtocols)enabledSslProtocols, checkCertificateRevocation); } - public override Task AuthenticateAsServerAsync (X509Certificate serverCertificate) + public Task AuthenticateAsServerAsync (X509Certificate serverCertificate) { return Impl.AuthenticateAsServerAsync (serverCertificate); } - public override Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation) + public Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation) { return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, (SslProtocols)enabledSslProtocols, checkCertificateRevocation); } - public override void Flush () + public void Flush () { Impl.Flush (); } - public override int Read (byte[] buffer, int offset, int count) + public int Read (byte[] buffer, int offset, int count) { return Impl.Read (buffer, offset, count); } - public override void Write (byte[] buffer) + public void Write (byte[] buffer) { Impl.Write (buffer); } - public override void Write (byte[] buffer, int offset, int count) + public void Write (byte[] buffer, int offset, int count) { Impl.Write (buffer, offset, count); } - public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState) + public IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState) { return Impl.BeginRead (buffer, offset, count, asyncCallback, asyncState); } - public override int EndRead (IAsyncResult asyncResult) + public int EndRead (IAsyncResult asyncResult) { return Impl.EndRead (asyncResult); } - public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState) + public IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState) { return Impl.BeginWrite (buffer, offset, count, asyncCallback, asyncState); } - public override void EndWrite (IAsyncResult asyncResult) + public void EndWrite (IAsyncResult asyncResult) { Impl.EndWrite (asyncResult); } - public override XTransportContext TransportContext { + public XTransportContext TransportContext { get { return (XTransportContext)(object)Impl.TransportContext; } } - public override bool IsAuthenticated { + public bool IsAuthenticated { get { return Impl.IsAuthenticated; } } - public override bool IsMutuallyAuthenticated { + public bool IsMutuallyAuthenticated { get { return Impl.IsMutuallyAuthenticated; } } - public override bool IsEncrypted { + public bool IsEncrypted { get { return Impl.IsEncrypted; } } - public override bool IsSigned { + public bool IsSigned { get { return Impl.IsSigned; } } - public override bool IsServer { + public bool IsServer { get { return Impl.IsServer; } } - public override XCipherAlgorithmType CipherAlgorithm { + public XCipherAlgorithmType CipherAlgorithm { get { return (XCipherAlgorithmType)Impl.CipherAlgorithm; } } - public override int CipherStrength { + public int CipherStrength { get { return Impl.CipherStrength; } } - public override XHashAlgorithmType HashAlgorithm { + public XHashAlgorithmType HashAlgorithm { get { return (XHashAlgorithmType)Impl.HashAlgorithm; } } - public override int HashStrength { + public int HashStrength { get { return Impl.HashStrength; } } - public override XExchangeAlgorithmType KeyExchangeAlgorithm { + public XExchangeAlgorithmType KeyExchangeAlgorithm { get { return (XExchangeAlgorithmType)Impl.KeyExchangeAlgorithm; } } - public override int KeyExchangeStrength { + public int KeyExchangeStrength { get { return KeyExchangeStrength; } } - public override bool CanRead { + public bool CanRead { get { return Impl.CanRead; } } - public override bool CanTimeout { + public bool CanTimeout { get { return Impl.CanTimeout; } } - public override bool CanWrite { + public bool CanWrite { get { return Impl.CanWrite; } } - public override long Length { + public long Length { get { return Impl.Length; } } - public override long Position { + public long Position { get { return Impl.Position; } } - public override void SetLength (long value) + public void SetLength (long value) { Impl.SetLength (value); } - public override XAuthenticatedStream AuthenticatedStream { + public XAuthenticatedStream AuthenticatedStream { get { return (XAuthenticatedStream)(Stream)Impl.AuthenticatedStream; } } - public override int ReadTimeout { + public int ReadTimeout { get { return Impl.ReadTimeout; } set { Impl.ReadTimeout = value; } } - public override int WriteTimeout { + public int WriteTimeout { get { return Impl.WriteTimeout; } set { Impl.WriteTimeout = value; } } - public override bool CheckCertRevocationStatus { + public bool CheckCertRevocationStatus { get { return Impl.CheckCertRevocationStatus; } } - public override X509Certificate InternalLocalCertificate { + public X509Certificate InternalLocalCertificate { get { return Impl.InternalLocalCertificate; } } - public override X509Certificate LocalCertificate { + public X509Certificate LocalCertificate { get { return Impl.LocalCertificate; } } - public override X509Certificate RemoteCertificate { + public X509Certificate RemoteCertificate { get { return Impl.RemoteCertificate; } } - public override XSslProtocols SslProtocol { + public XSslProtocols SslProtocol { get { return (XSslProtocols)Impl.SslProtocol; } } @@ -311,7 +311,13 @@ namespace Mono.Net.Security throw new ObjectDisposedException ("MonoSslStream"); } - protected override void Dispose (bool disposing) + public void Dispose () + { + Dispose (true); + GC.SuppressFinalize (this); + } + + protected virtual void Dispose (bool disposing) { if (impl != null && disposing) { impl.Dispose (); diff --git a/mcs/class/System/Mono.Net.Security/MonoSslStreamWrapper.cs b/mcs/class/System/Mono.Net.Security/MonoSslStreamWrapper.cs index 24b777c87ad..d04383dced1 100644 --- a/mcs/class/System/Mono.Net.Security/MonoSslStreamWrapper.cs +++ b/mcs/class/System/Mono.Net.Security/MonoSslStreamWrapper.cs @@ -34,9 +34,9 @@ extern alias MonoSecurity; #endif #if MONO_SECURITY_ALIAS -using MonoSecurity::Mono.Security.Interface; +using MSI = MonoSecurity::Mono.Security.Interface; #else -using Mono.Security.Interface; +using MSI = Mono.Security.Interface; #endif #if MONO_X509_ALIAS using XSslProtocols = PrebuiltSystem::System.Security.Authentication.SslProtocols; @@ -65,16 +65,16 @@ namespace Mono.Net.Security.Private { class MonoSslStreamWrapper : IMonoSslStream { - MonoSslStream impl; + MSI.IMonoSslStream impl; - internal MonoSslStream Impl { + internal MSI.IMonoSslStream Impl { get { CheckDisposed (); return impl; } } - public MonoSslStreamWrapper (MonoSslStream impl) + public MonoSslStreamWrapper (MSI.IMonoSslStream impl) { this.impl = impl; } diff --git a/mcs/class/System/Mono.Net.Security/MonoTlsProviderImpl.cs b/mcs/class/System/Mono.Net.Security/MonoTlsProviderImpl.cs index c21341b4f5b..4216e5809f3 100644 --- a/mcs/class/System/Mono.Net.Security/MonoTlsProviderImpl.cs +++ b/mcs/class/System/Mono.Net.Security/MonoTlsProviderImpl.cs @@ -74,7 +74,7 @@ namespace Mono.Net.Security.Private Stream innerStream, bool leaveInnerStreamOpen, MSI.MonoTlsSettings settings); - public override MSI.MonoSslStream CreateSslStream ( + public override MSI.IMonoSslStream CreateSslStream ( Stream innerStream, bool leaveInnerStreamOpen, MSI.MonoTlsSettings settings = null) { diff --git a/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs b/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs index f10f99f5176..db6e66ca283 100644 --- a/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs +++ b/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs @@ -95,9 +95,6 @@ namespace Mono.Net.Security provider = request.TlsProvider ?? MonoTlsProviderFactory.GetProviderInternal (); status = WebExceptionStatus.SecureChannelFailure; - if (settings == null) - settings = new MonoTlsSettings (); - validationHelper = ChainValidationHelper.Create (provider.Provider, ref settings, this); } diff --git a/mcs/class/System/ReferenceSources/SR.cs b/mcs/class/System/ReferenceSources/SR.cs index 0e6a8f67ff3..fe0aedf17c8 100644 --- a/mcs/class/System/ReferenceSources/SR.cs +++ b/mcs/class/System/ReferenceSources/SR.cs @@ -75,6 +75,7 @@ partial class SR public const string Argument_AddingDuplicate = "Argument_AddingDuplicate"; public const string Argument_ImplementIComparable = "Argument_ImplementIComparable"; public const string Argument_InvalidOffLen = "Argument_InvalidOffLen"; + public const string Argument_InvalidThreshold = "Argument_InvalidThreshold"; public const string ExternalLinkedListNode = "ExternalLinkedListNode"; public const string InvalidOperation_CannotRemoveFromStackOrQueue = "InvalidOperation_CannotRemoveFromStackOrQueue"; public const string InvalidOperation_EmptyCollection = "InvalidOperation_EmptyCollection"; @@ -84,6 +85,7 @@ partial class SR public const string InvalidOperation_EnumFailedVersion = "InvalidOperation_EnumFailedVersion"; public const string InvalidOperation_EnumNotStarted = "InvalidOperation_EnumNotStarted"; public const string InvalidOperation_EnumOpCantHappen = "InvalidOperation_EnumOpCantHappen"; + public const string InvalidOperation_HCCountOverflow = "InvalidOperation_HCCountOverflow"; public const string Invalid_Array_Type = "Invalid_Array_Type"; public const string LinkedListEmpty = "LinkedListEmpty"; public const string LinkedListNodeIsAttached = "LinkedListNodeIsAttached"; diff --git a/mcs/class/System/System-bare-net_4_5.csproj b/mcs/class/System/System-bare-net_4_5.csproj deleted file mode 100644 index b45c9942062..00000000000 --- a/mcs/class/System/System-bare-net_4_5.csproj +++ /dev/null @@ -1,1203 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {91CDF14E-F60F-4AB7-BC9D-5CBD7E669076} - Library - 1699,618 - ./../../class/lib/net_4_5/bare - True - True - true - Properties - - - System - v4.5 - 512 - - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX - prompt - 4 - - - pdbonly - 1699,618 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - - - - - - Asterisk.wav - - - Beep.wav - - - Exclamation.wav - - - Hand.wav - - - Question.wav - - - - diff --git a/mcs/class/System/System-bare-net_4_x.csproj b/mcs/class/System/System-bare-net_4_x.csproj index 9e4ca99eef1..1da957bfcc9 100644 --- a/mcs/class/System/System-bare-net_4_x.csproj +++ b/mcs/class/System/System-bare-net_4_x.csproj @@ -25,7 +25,7 @@ full 1699,618 false - TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX + TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME prompt 4 @@ -33,7 +33,7 @@ pdbonly 1699,618 true - NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX + NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME prompt 4 @@ -491,7 +491,9 @@ + + @@ -584,16 +586,39 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -907,7 +932,6 @@ - @@ -1135,6 +1159,7 @@ + diff --git a/mcs/class/System/System-net_4_5.csproj b/mcs/class/System/System-net_4_5.csproj deleted file mode 100644 index 79c57dc0733..00000000000 --- a/mcs/class/System/System-net_4_5.csproj +++ /dev/null @@ -1,1219 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FFAC0B73-D997-493B-9C62-27656CD858BB} - Library - 1699,618 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - System - v4.5 - 512 - - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;SECURITY_DEP;XML_DEP;CONFIGURATION_DEP - prompt - 4 - - - pdbonly - 1699,618 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;SECURITY_DEP;XML_DEP;CONFIGURATION_DEP - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {46F151F2-A422-4A1B-9D29-2E148CE73629} - System-secxml-net_4_5 - PrebuiltSystem - - {D68D4FED-CA32-4800-A628-58BAE485562C} - Mono.Security-net_4_5 - MonoSecurity - - - - - - - Asterisk.wav - - - Beep.wav - - - Exclamation.wav - - - Hand.wav - - - Question.wav - - - - diff --git a/mcs/class/System/System-net_4_x.csproj b/mcs/class/System/System-net_4_x.csproj index d959dbe4255..efd67085844 100644 --- a/mcs/class/System/System-net_4_x.csproj +++ b/mcs/class/System/System-net_4_x.csproj @@ -25,7 +25,7 @@ full 1699,618 false - TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;SECURITY_DEP;XML_DEP;CONFIGURATION_DEP + TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS;MONO_X509_ALIAS;CONFIGURATION_DEP prompt 4 @@ -33,7 +33,7 @@ pdbonly 1699,618 true - NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;SECURITY_DEP;XML_DEP;CONFIGURATION_DEP + NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS;MONO_X509_ALIAS;CONFIGURATION_DEP prompt 4 @@ -491,7 +491,9 @@ + + @@ -584,16 +586,39 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -907,7 +932,6 @@ - @@ -1135,6 +1159,7 @@ + diff --git a/mcs/class/System/System-secxml-net_4_5.csproj b/mcs/class/System/System-secxml-net_4_5.csproj deleted file mode 100644 index 19980849576..00000000000 --- a/mcs/class/System/System-secxml-net_4_5.csproj +++ /dev/null @@ -1,1215 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {46F151F2-A422-4A1B-9D29-2E148CE73629} - Library - 1699,618 - ./../../class/lib/net_4_5/secxml - True - True - true - Properties - - - System - v4.5 - 512 - - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;SECURITY_DEP;XML_DEP - prompt - 4 - - - pdbonly - 1699,618 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;SECURITY_DEP;XML_DEP - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {21FB091E-0F84-479E-AB16-6503D36852F9} - System.Xml-bare-net_4_5 - - - {91CDF14E-F60F-4AB7-BC9D-5CBD7E669076} - System-bare-net_4_5 - PrebuiltSystem - - {D68D4FED-CA32-4800-A628-58BAE485562C} - Mono.Security-net_4_5 - MonoSecurity - - - - - - - Asterisk.wav - - - Beep.wav - - - Exclamation.wav - - - Hand.wav - - - Question.wav - - - - diff --git a/mcs/class/System/System-secxml-net_4_x.csproj b/mcs/class/System/System-secxml-net_4_x.csproj index 904ca651aa3..0b98933187c 100644 --- a/mcs/class/System/System-secxml-net_4_x.csproj +++ b/mcs/class/System/System-secxml-net_4_x.csproj @@ -25,7 +25,7 @@ full 1699,618 false - TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;SECURITY_DEP;XML_DEP + TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS;MONO_X509_ALIAS prompt 4 @@ -33,7 +33,7 @@ pdbonly 1699,618 true - NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;SECURITY_DEP;XML_DEP + NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS;MONO_X509_ALIAS prompt 4 @@ -491,7 +491,9 @@ + + @@ -584,16 +586,39 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -907,7 +932,6 @@ - @@ -1135,6 +1159,7 @@ + diff --git a/mcs/class/System/System-tests-net_4_5.csproj b/mcs/class/System/System-tests-net_4_5.csproj deleted file mode 100644 index eebbf58ede2..00000000000 --- a/mcs/class/System/System-tests-net_4_5.csproj +++ /dev/null @@ -1,617 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3CE9EB07-FC9C-4C80-83E6-28259B947E7F} - Library - 1699,618,672,219,67,169,612 - bin\Debug\System-tests-net_4_5 - True - False - - Properties - - - System_test_net_4_5 - v4.5 - 512 - - - true - full - 1699,618,672,219,67,169,612 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699,618,672,219,67,169,612 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {01A426C8-6E24-4DCF-B6BE-177FF4FBD4BC} - System.Drawing\System.Drawing-net_4_0 - - - {D68D4FED-CA32-4800-A628-58BAE485562C} - Mono.Security\Mono.Security-net_4_5 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.XML\System.Xml-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration\System.Configuration-net_4_5 - - - - - - - - test-uri-props.txt - - - test-uri-props-manual.txt - - - test-uri-relative-props.txt - - - - diff --git a/mcs/class/System/System.Diagnostics/Process.cs b/mcs/class/System/System.Diagnostics/Process.cs index 76f2a7fc1a6..b46bc936c1d 100644 --- a/mcs/class/System/System.Diagnostics/Process.cs +++ b/mcs/class/System/System.Diagnostics/Process.cs @@ -577,6 +577,7 @@ namespace System.Diagnostics { } } +#if MONO_FEATURE_PROCESS_START private StreamReader error_stream=null; bool error_stream_exposed; @@ -648,6 +649,28 @@ namespace System.Diagnostics { start_info = value; } } +#else + [Obsolete ("Process.StandardError is not supported on the current platform.", true)] + public StreamReader StandardError { + get { throw new PlatformNotSupportedException ("Process.StandardError is not supported on the current platform."); } + } + + [Obsolete ("Process.StandardInput is not supported on the current platform.", true)] + public StreamWriter StandardInput { + get { throw new PlatformNotSupportedException ("Process.StandardInput is not supported on the current platform."); } + } + + [Obsolete ("Process.StandardOutput is not supported on the current platform.", true)] + public StreamReader StandardOutput { + get { throw new PlatformNotSupportedException ("Process.StandardOutput is not supported on the current platform."); } + } + + [Obsolete ("Process.StartInfo is not supported on the current platform.", true)] + public ProcessStartInfo StartInfo { + get { throw new PlatformNotSupportedException ("Process.StartInfo is not supported on the current platform."); } + set { throw new PlatformNotSupportedException ("Process.StartInfo is not supported on the current platform."); } + } +#endif // MONO_FEATURE_PROCESS_START /* Returns the process start time in Windows file * times (ticks from DateTime(1/1/1601 00:00 GMT)) @@ -895,6 +918,7 @@ namespace System.Diagnostics { // the process (currently we have none). } +#if MONO_FEATURE_PROCESS_START [MethodImplAttribute(MethodImplOptions.InternalCall)] private extern static bool ShellExecuteEx_internal(ProcessStartInfo startInfo, ref ProcInfo proc_info); @@ -1191,6 +1215,43 @@ namespace System.Diagnostics { psi.UseShellExecute = false; return Start(psi); } +#else + [Obsolete ("Process.Start is not supported on the current platform.", true)] + public bool Start () + { + throw new PlatformNotSupportedException ("Process.Start is not supported on the current platform."); + } + + [Obsolete ("Process.Start is not supported on the current platform.", true)] + public static Process Start (ProcessStartInfo startInfo) + { + throw new PlatformNotSupportedException ("Process.Start is not supported on the current platform."); + } + + [Obsolete ("Process.Start is not supported on the current platform.", true)] + public static Process Start (string fileName) + { + throw new PlatformNotSupportedException ("Process.Start is not supported on the current platform."); + } + + [Obsolete ("Process.Start is not supported on the current platform.", true)] + public static Process Start(string fileName, string arguments) + { + throw new PlatformNotSupportedException ("Process.Start is not supported on the current platform."); + } + + [Obsolete ("Process.Start is not supported on the current platform.", true)] + public static Process Start(string fileName, string username, SecureString password, string domain) + { + throw new PlatformNotSupportedException ("Process.Start is not supported on the current platform."); + } + + [Obsolete ("Process.Start is not supported on the current platform.", true)] + public static Process Start(string fileName, string arguments, string username, SecureString password, string domain) + { + throw new PlatformNotSupportedException ("Process.Start is not supported on the current platform."); + } +#endif // MONO_FEATURE_PROCESS_START public override string ToString() { @@ -1219,11 +1280,13 @@ namespace System.Diagnostics { if (!WaitForExit_internal (process_handle, ms)) return false; +#if MONO_FEATURE_PROCESS_START if (async_output != null && !async_output.IsCompleted) async_output.AsyncWaitHandle.WaitOne (); if (async_error != null && !async_error.IsCompleted) async_error.AsyncWaitHandle.WaitOne (); +#endif // MONO_FEATURE_PROCESS_START OnExited (); @@ -1277,6 +1340,7 @@ namespace System.Diagnostics { cb (this, new DataReceivedEventArgs (str)); } +#if MONO_FEATURE_PROCESS_START [Flags] enum AsyncModes { NoneYet = 0, @@ -1465,6 +1529,31 @@ namespace System.Diagnostics { error_canceled = true; } +#else + [Obsolete ("Process.BeginOutputReadLine is not supported on the current platform.", true)] + public void BeginOutputReadLine () + { + throw new PlatformNotSupportedException ("Process.BeginOutputReadLine is not supported on the current platform."); + } + + [Obsolete ("Process.BeginOutputReadLine is not supported on the current platform.", true)] + public void CancelOutputRead () + { + throw new PlatformNotSupportedException ("Process.BeginOutputReadLine is not supported on the current platform."); + } + + [Obsolete ("Process.BeginOutputReadLine is not supported on the current platform.", true)] + public void BeginErrorReadLine () + { + throw new PlatformNotSupportedException ("Process.BeginOutputReadLine is not supported on the current platform."); + } + + [Obsolete ("Process.BeginOutputReadLine is not supported on the current platform.", true)] + public void CancelErrorRead () + { + throw new PlatformNotSupportedException ("Process.BeginOutputReadLine is not supported on the current platform."); + } +#endif // MONO_FEATURE_PROCESS_START [Category ("Behavior")] [MonitoringDescription ("Raised when this process exits.")] @@ -1497,6 +1586,7 @@ namespace System.Diagnostics { // If this is a call to Dispose, // dispose all managed resources. if (disposing) { +#if MONO_FEATURE_PROCESS_START /* These have open FileStreams on the pipes we are about to close */ if (async_output != null) async_output.Close (); @@ -1518,6 +1608,7 @@ namespace System.Diagnostics { error_stream.Close (); error_stream = null; } +#endif // MONO_FEATURE_PROCESS_START } // Release unmanaged resources diff --git a/mcs/class/System/System.IO/DefaultWatcher.cs b/mcs/class/System/System.IO/DefaultWatcher.cs index d2d8b28d86c..d08e6098416 100644 --- a/mcs/class/System/System.IO/DefaultWatcher.cs +++ b/mcs/class/System/System.IO/DefaultWatcher.cs @@ -43,6 +43,8 @@ namespace System.IO { public bool Enabled; public bool NoWildcards; public DateTime DisabledTime; + + public object FilesLock = new object (); public Hashtable Files; } @@ -211,6 +213,13 @@ namespace System.IO { files = NoStringsArray; } + lock (data.FilesLock) { + IterateAndModifyFilesData (data, directory, dispatch, files); + } + } + + void IterateAndModifyFilesData (DefaultWatcherData data, string directory, bool dispatch, string[] files) + { /* Set all as untested */ foreach (string filename in data.Files.Keys) { FileData fd = (FileData) data.Files [filename]; diff --git a/mcs/class/System/System.IO/KeventWatcher.cs b/mcs/class/System/System.IO/KeventWatcher.cs index 0d2e39ee02b..996e0e9b61f 100644 --- a/mcs/class/System/System.IO/KeventWatcher.cs +++ b/mcs/class/System/System.IO/KeventWatcher.cs @@ -162,6 +162,8 @@ namespace System.IO { class KqueueMonitor : IDisposable { + static bool initialized; + public int Connection { get { return conn; } @@ -171,6 +173,13 @@ namespace System.IO { { this.fsw = fsw; this.conn = -1; + if (!initialized){ + int t; + initialized = true; + var maxenv = Environment.GetEnvironmentVariable ("MONO_DARWIN_WATCHER_MAXFDS"); + if (maxenv != null && Int32.TryParse (maxenv, out t)) + maxFds = t; + } } public void Dispose () @@ -638,7 +647,7 @@ namespace System.IO { const int F_GETPATH = 50; const int __DARWIN_MAXPATHLEN = 1024; static readonly kevent[] emptyEventList = new System.IO.kevent[0]; - const int maxFds = 200; + int maxFds = Int32.MaxValue; FileSystemWatcher fsw; int conn; diff --git a/mcs/class/System/System.Net.Cache/ChangeLog b/mcs/class/System/System.Net.Cache/ChangeLog deleted file mode 100644 index e73f284ec29..00000000000 --- a/mcs/class/System/System.Net.Cache/ChangeLog +++ /dev/null @@ -1,11 +0,0 @@ -2007-11-13 Atsushi Enomoto - - * HttpRequestCachePolicy.cs - HttpCacheAgeControl.cs - HttpRequestCacheLevel.cs - RequestCacheLevel.cs : fixed enum value binary compat to .net. - -2004-09-10 Tim Coleman - * HttpCacheAgeControl.cs HttpRequestCacheLevel.cs HttpRequestCachePolicy.cs - * RequestCacheLevel.cs RequestCachePolicy.cs: - New classes for Fx 2.0 diff --git a/mcs/class/System/System.Net.Cache/HttpCacheAgeControl.cs b/mcs/class/System/System.Net.Cache/HttpCacheAgeControl.cs deleted file mode 100644 index f574237ed17..00000000000 --- a/mcs/class/System/System.Net.Cache/HttpCacheAgeControl.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// System.Net.Cache.HttpCacheAgeControl.cs -// -// Authors: -// Tim Coleman (tim@timcoleman.com) -// -// Copyright (C) Tim Coleman, 2004 -// (c) 2004 Novell, Inc. (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Net.Cache -{ - public enum HttpCacheAgeControl - { - None = 0, - MinFresh = 0x01, - MaxAge = 0x02, - MaxAgeAndMinFresh = 0x03, - MaxStale = 0x04, - MaxAgeAndMaxStale = 0x06, - } -} - diff --git a/mcs/class/System/System.Net.Cache/HttpRequestCacheLevel.cs b/mcs/class/System/System.Net.Cache/HttpRequestCacheLevel.cs deleted file mode 100644 index 9aa816dff54..00000000000 --- a/mcs/class/System/System.Net.Cache/HttpRequestCacheLevel.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// System.Net.Cache.HttpRequestCacheLevel.cs -// -// Authors: -// Tim Coleman (tim@timcoleman.com) -// -// Copyright (C) Tim Coleman, 2004 -// (c) 2004 Novell, Inc. (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Net.Cache -{ - public enum HttpRequestCacheLevel - { - Default = 0x00, - BypassCache = 0x01, - CacheOnly = 0x02, - CacheIfAvailable = 0x03, - Revalidate = 0x04, - Reload = 0x05, - NoCacheNoStore = 0x06, - CacheOrNextCacheOnly = 0x07, - Refresh = 0x08, - } -} - diff --git a/mcs/class/System/System.Net.Cache/HttpRequestCachePolicy.cs b/mcs/class/System/System.Net.Cache/HttpRequestCachePolicy.cs deleted file mode 100644 index d0e28434d25..00000000000 --- a/mcs/class/System/System.Net.Cache/HttpRequestCachePolicy.cs +++ /dev/null @@ -1,140 +0,0 @@ -// -// System.Net.Cache.HttpRequestCachePolicy.cs -// -// Authors: -// Tim Coleman (tim@timcoleman.com) -// -// Copyright (C) Tim Coleman, 2004 -// (c) 2004 Novell, Inc. (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Net.Cache -{ - public class HttpRequestCachePolicy : RequestCachePolicy - { - #region Fields - - DateTime cacheSyncDate; - HttpRequestCacheLevel level = HttpRequestCacheLevel.Default; - TimeSpan maxAge; - TimeSpan maxStale; - TimeSpan minFresh; - - #endregion // Fields - - #region Constructors - - public HttpRequestCachePolicy () - { - } - - public HttpRequestCachePolicy (DateTime cacheSyncDate) - { - this.cacheSyncDate = cacheSyncDate; - } - - public HttpRequestCachePolicy (HttpRequestCacheLevel level) - { - this.level = level; - } - - public HttpRequestCachePolicy (HttpCacheAgeControl cacheAgeControl, TimeSpan ageOrFreshOrStale) - { - switch (cacheAgeControl) { - case HttpCacheAgeControl.MaxAge: - maxAge = ageOrFreshOrStale; - break; - case HttpCacheAgeControl.MaxStale: - maxStale = ageOrFreshOrStale; - break; - case HttpCacheAgeControl.MinFresh: - minFresh = ageOrFreshOrStale; - break; - default: - throw new ArgumentException ("ageOrFreshOrStale"); - } - } - - public HttpRequestCachePolicy (HttpCacheAgeControl cacheAgeControl, TimeSpan maxAge, TimeSpan freshOrStale) - { - this.maxAge = maxAge; - - switch (cacheAgeControl) { - case HttpCacheAgeControl.MaxStale: - maxStale = freshOrStale; - break; - case HttpCacheAgeControl.MinFresh: - minFresh = freshOrStale; - break; - default: - throw new ArgumentException ("freshOrStale"); - } - } - - public HttpRequestCachePolicy (HttpCacheAgeControl cacheAgeControl, TimeSpan maxAge, TimeSpan freshOrStale, DateTime cacheSyncDate) - : this (cacheAgeControl, maxAge, freshOrStale) - { - this.cacheSyncDate = cacheSyncDate; - } - - #endregion // Constructors - - #region Properties - - public DateTime CacheSyncDate { - get { return cacheSyncDate; } - } - - public new HttpRequestCacheLevel Level { - get { return level; } - } - - public TimeSpan MaxAge { - get { return maxAge; } - } - - public TimeSpan MaxStale { - get { return maxStale; } - } - - public TimeSpan MinFresh { - get { return minFresh; } - } - - #endregion // Properties - - #region Methods - - [MonoTODO] - public override string ToString () - { - throw new NotImplementedException (); - } - - #endregion // Methods - } -} - diff --git a/mcs/class/System/System.Net.Cache/RequestCacheLevel.cs b/mcs/class/System/System.Net.Cache/RequestCacheLevel.cs deleted file mode 100644 index 3b78221f39c..00000000000 --- a/mcs/class/System/System.Net.Cache/RequestCacheLevel.cs +++ /dev/null @@ -1,45 +0,0 @@ -// -// System.Net.Cache.RequestCacheLevel.cs -// -// Authors: -// Tim Coleman (tim@timcoleman.com) -// -// Copyright (C) Tim Coleman, 2004 -// (c) 2004 Novell, Inc. (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Net.Cache -{ - public enum RequestCacheLevel - { - Default = 0x00, - BypassCache = 0x01, - CacheOnly = 0x02, - CacheIfAvailable = 0x03, - Revalidate = 0x04, - Reload = 0x05, - NoCacheNoStore = 0x06, - } -} - diff --git a/mcs/class/System/System.Net.Cache/RequestCachePolicy.cs b/mcs/class/System/System.Net.Cache/RequestCachePolicy.cs deleted file mode 100644 index 048319261b9..00000000000 --- a/mcs/class/System/System.Net.Cache/RequestCachePolicy.cs +++ /dev/null @@ -1,76 +0,0 @@ -// -// System.Net.Cache.RequestCachePolicy.cs -// -// Authors: -// Tim Coleman (tim@timcoleman.com) -// -// Copyright (C) Tim Coleman, 2004 -// (c) 2004 Novell, Inc. (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Net.Cache -{ - public class RequestCachePolicy - { - #region Fields - - RequestCacheLevel level = RequestCacheLevel.Default; - - #endregion // Fields - - #region Constructors - - public RequestCachePolicy () - { - } - - public RequestCachePolicy (RequestCacheLevel level) - { - this.level = level; - } - - #endregion // Constructors - - #region Properties - - public RequestCacheLevel Level { - get { return level; } - } - - #endregion // Properties - - #region Methods - - [MonoTODO] - public override string ToString () - { - throw new NotImplementedException (); - } - - #endregion // Methods - } -} - diff --git a/mcs/class/System/System.Net.Mail/SmtpClient.cs b/mcs/class/System/System.Net.Mail/SmtpClient.cs index f4376a2ac3c..69fd3480999 100644 --- a/mcs/class/System/System.Net.Mail/SmtpClient.cs +++ b/mcs/class/System/System.Net.Mail/SmtpClient.cs @@ -1161,7 +1161,7 @@ try { #if SECURITY_DEP var tlsProvider = MonoTlsProviderFactory.GetProviderInternal (); - var settings = new MSI.MonoTlsSettings (); + var settings = MSI.MonoTlsSettings.CopyDefaultSettings (); settings.UseServicePointManagerCallback = true; var sslStream = tlsProvider.CreateSslStream (stream, false, settings); CheckCancellation (); diff --git a/mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs b/mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs index 92a5dfe0a60..2177ecf43c2 100644 --- a/mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs +++ b/mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs @@ -250,6 +250,10 @@ namespace System.Net.NetworkInformation { class LinuxNetworkInterfaceAPI : UnixNetworkInterfaceAPI { + const int AF_INET = 2; + const int AF_INET6 = 10; + const int AF_PACKET = 17; + static void FreeInterfaceAddresses (IntPtr ifap) { #if MONODROID @@ -270,9 +274,6 @@ namespace System.Net.NetworkInformation { public override NetworkInterface [] GetAllNetworkInterfaces () { - const int AF_INET = 2; - const int AF_INET6 = 10; - const int AF_PACKET = 17; var interfaces = new Dictionary (); IntPtr ifap; @@ -406,7 +407,43 @@ namespace System.Net.NetworkInformation { public override IPAddress GetNetMask (IPAddress address) { - throw new NotImplementedException (); + foreach (ifaddrs networkInteface in GetNetworkInterfaces()) { + if (networkInteface.ifa_addr == IntPtr.Zero) + continue; + + var sockaddr = (sockaddr_in)Marshal.PtrToStructure(networkInteface.ifa_addr, typeof(sockaddr_in)); + + if (sockaddr.sin_family != AF_INET) + continue; + + if (!address.Equals(new IPAddress(sockaddr.sin_addr))) + continue; + + var netmask = (sockaddr_in)Marshal.PtrToStructure(networkInteface.ifa_netmask, typeof(sockaddr_in)); + return new IPAddress(netmask.sin_addr); + } + + return null; + } + + private static IEnumerable GetNetworkInterfaces() + { + IntPtr ifap = IntPtr.Zero; + + try { + if (GetInterfaceAddresses(out ifap) != 0) + yield break; + + var next = ifap; + while (next != IntPtr.Zero) { + var addr = (ifaddrs)Marshal.PtrToStructure(next, typeof(ifaddrs)); + yield return addr; + next = addr.ifa_next; + } + } finally { + if (ifap != IntPtr.Zero) + FreeInterfaceAddresses(ifap); + } } } @@ -479,8 +516,10 @@ namespace System.Net.NetworkInformation { return new LinuxNetworkInterfaceAPI (); } +#if !MONODROID if (Environment.OSVersion.Version >= windowsVer51) return new Win32NetworkInterfaceAPI (); +#endif throw new NotImplementedException (); #endif diff --git a/mcs/class/System/System.Net.NetworkInformation/Ping.cs b/mcs/class/System/System.Net.NetworkInformation/Ping.cs index 157b888871d..f18b70c0f9a 100644 --- a/mcs/class/System/System.Net.NetworkInformation/Ping.cs +++ b/mcs/class/System/System.Net.NetworkInformation/Ping.cs @@ -6,6 +6,7 @@ // Atsushi Enomoto (atsushi@ximian.com) // // Copyright (c) 2006-2007 Novell, Inc. (http://www.novell.com) +// Copyright 2015 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -26,6 +27,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // + using System; using System.IO; using System.Text; @@ -43,6 +45,7 @@ namespace System.Net.NetworkInformation { [MonoTODO ("IPv6 support is missing")] public class Ping : Component, IDisposable { +#if !MONOTOUCH [StructLayout(LayoutKind.Sequential)] struct cap_user_header_t { @@ -68,6 +71,7 @@ namespace System.Net.NetworkInformation { #endif }; static readonly string PingBinPath; +#endif const int default_timeout = 4000; // 4 sec. ushort identifier; @@ -84,7 +88,8 @@ namespace System.Net.NetworkInformation { CancellationTokenSource cts; public event PingCompletedEventHandler PingCompleted; - + +#if !MONOTOUCH static Ping () { if (Environment.OSVersion.Platform == PlatformID.Unix) { @@ -106,6 +111,7 @@ namespace System.Net.NetworkInformation { if (PingBinPath == null) PingBinPath = "/bin/ping"; // default, fallback value } +#endif public Ping () { @@ -115,7 +121,8 @@ namespace System.Net.NetworkInformation { rng.GetBytes (randomIdentifier); identifier = (ushort)(randomIdentifier [0] + (randomIdentifier [1] << 8)); } - + +#if !MONOTOUCH [DllImport ("libc", EntryPoint="capget")] static extern int capget (ref cap_user_header_t header, ref cap_user_data_t data); @@ -142,6 +149,7 @@ namespace System.Net.NetworkInformation { canSendPrivileged = false; } } +#endif void IDisposable.Dispose () { @@ -215,11 +223,16 @@ namespace System.Net.NetworkInformation { throw new ArgumentException ("buffer"); // options can be null. +#if MONOTOUCH + throw new InvalidOperationException (); +#else if (canSendPrivileged) return SendPrivileged (address, timeout, buffer, options); return SendUnprivileged (address, timeout, buffer, options); +#endif } +#if !MONOTOUCH private PingReply SendPrivileged (IPAddress address, int timeout, byte [] buffer, PingOptions options) { IPEndPoint target = new IPEndPoint (address, 0); @@ -286,6 +299,7 @@ namespace System.Net.NetworkInformation { private PingReply SendUnprivileged (IPAddress address, int timeout, byte [] buffer, PingOptions options) { +#if MONO_FEATURE_PROCESS_START DateTime sentTime = DateTime.UtcNow; Process ping = new Process (); @@ -325,7 +339,11 @@ namespace System.Net.NetworkInformation { } return new PingReply (address, buffer, options, trip_time, status); +#else + throw new PlatformNotSupportedException ("Ping is not supported on this platform."); +#endif // MONO_FEATURE_PROCESS_START } +#endif // !MONOTOUCH // Async @@ -401,6 +419,7 @@ namespace System.Net.NetworkInformation { worker.CancelAsync (); } +#if !MONOTOUCH // ICMP message class IcmpMessage @@ -534,6 +553,7 @@ namespace System.Net.NetworkInformation { return args.ToString (); } +#endif // !MONOTOUCH public Task SendPingAsync (IPAddress address, int timeout, byte [] buffer) { @@ -592,4 +612,3 @@ namespace System.Net.NetworkInformation { } } } - diff --git a/mcs/class/System/System.Net.Security/SslStream.cs b/mcs/class/System/System.Net.Security/SslStream.cs index 67266618aae..281c6fa7016 100644 --- a/mcs/class/System/System.Net.Security/SslStream.cs +++ b/mcs/class/System/System.Net.Security/SslStream.cs @@ -85,15 +85,23 @@ namespace System.Net.Security public class SslStream : AuthenticatedStream, MNS.IMonoSslStream { - MonoSslStream impl; + MonoTlsProvider provider; + IMonoSslStream impl; - internal MonoSslStream Impl { + internal IMonoSslStream Impl { get { CheckDisposed (); return impl; } } + internal MonoTlsProvider Provider { + get { + CheckDisposed (); + return provider; + } + } + static MonoTlsProvider GetProvider () { return MonoTlsProviderFactory.GetDefaultProvider (); @@ -107,7 +115,7 @@ namespace System.Net.Security public SslStream (Stream innerStream, bool leaveInnerStreamOpen) : base (innerStream, leaveInnerStreamOpen) { - var provider = GetProvider (); + provider = GetProvider (); impl = provider.CreateSslStream (innerStream, leaveInnerStreamOpen); } @@ -119,14 +127,14 @@ namespace System.Net.Security public SslStream (Stream innerStream, bool leaveInnerStreamOpen, RemoteCertificateValidationCallback userCertificateValidationCallback, LocalCertificateSelectionCallback userCertificateSelectionCallback) : base (innerStream, leaveInnerStreamOpen) { - var provider = GetProvider (); - var settings = new MonoTlsSettings (); + provider = GetProvider (); + var settings = MonoTlsSettings.CopyDefaultSettings (); settings.RemoteCertificateValidationCallback = MNS.Private.CallbackHelpers.PublicToMono (userCertificateValidationCallback); settings.ClientCertificateSelectionCallback = MNS.Private.CallbackHelpers.PublicToMono (userCertificateSelectionCallback); impl = provider.CreateSslStream (innerStream, leaveInnerStreamOpen, settings); } - internal SslStream (Stream innerStream, bool leaveInnerStreamOpen, MonoSslStream impl) + internal SslStream (Stream innerStream, bool leaveInnerStreamOpen, IMonoSslStream impl) : base (innerStream, leaveInnerStreamOpen) { this.impl = impl; @@ -331,7 +339,7 @@ namespace System.Net.Security void CheckDisposed () { if (impl == null) - throw new ObjectDisposedException ("MonoSslStream"); + throw new ObjectDisposedException ("SslStream"); } protected override void Dispose (bool disposing) diff --git a/mcs/class/System/System.Net/FtpWebRequest.cs b/mcs/class/System/System.Net/FtpWebRequest.cs index bb900979a48..1fbf80dc7ce 100644 --- a/mcs/class/System/System.Net/FtpWebRequest.cs +++ b/mcs/class/System/System.Net/FtpWebRequest.cs @@ -1168,7 +1168,7 @@ namespace System.Net internal bool ChangeToSSLSocket (ref Stream stream) { #if SECURITY_DEP var provider = MonoTlsProviderFactory.GetProviderInternal (); - var settings = new MSI.MonoTlsSettings (); + var settings = MSI.MonoTlsSettings.CopyDefaultSettings (); settings.UseServicePointManagerCallback = true; var sslStream = provider.CreateSslStream (stream, true, settings); sslStream.AuthenticateAsClient (requestUri.Host, null, SslProtocols.Default, false); diff --git a/mcs/class/System/System.Net/HttpListener.cs b/mcs/class/System/System.Net/HttpListener.cs index 15580d3b705..29afc0fd84b 100644 --- a/mcs/class/System/System.Net/HttpListener.cs +++ b/mcs/class/System/System.Net/HttpListener.cs @@ -122,7 +122,7 @@ namespace System.Net { if (tlsProvider == null) tlsProvider = MonoTlsProviderFactory.GetProviderInternal (); if (tlsSettings == null) - tlsSettings = new MSI.MonoTlsSettings (); + tlsSettings = MSI.MonoTlsSettings.CopyDefaultSettings (); if (tlsSettings.RemoteCertificateValidationCallback == null) tlsSettings.RemoteCertificateValidationCallback = callback; return tlsProvider.CreateSslStream (innerStream, ownsStream, tlsSettings); diff --git a/mcs/class/System/System.Net/HttpListenerRequest.cs b/mcs/class/System/System.Net/HttpListenerRequest.cs index ac59eb51cd3..769195a2b3e 100644 --- a/mcs/class/System/System.Net/HttpListenerRequest.cs +++ b/mcs/class/System/System.Net/HttpListenerRequest.cs @@ -38,6 +38,7 @@ using System.Security.Cryptography.X509Certificates; using System.Text; using System.Security.Authentication.ExtendedProtection; using System.Threading.Tasks; +using System.Net; namespace System.Net { public sealed class HttpListenerRequest @@ -175,7 +176,7 @@ namespace System.Net { host, LocalEndPoint.Port); if (!Uri.TryCreate (base_uri + path, UriKind.Absolute, out url)){ - context.ErrorMessage = "Invalid url: " + base_uri + path; + context.ErrorMessage = WebUtility.HtmlEncode ("Invalid url: " + base_uri + path); return; } diff --git a/mcs/class/System/System.Net/WebRequest.cs b/mcs/class/System/System.Net/WebRequest.cs index efb06fe9aa8..ae1159958aa 100644 --- a/mcs/class/System/System.Net/WebRequest.cs +++ b/mcs/class/System/System.Net/WebRequest.cs @@ -40,6 +40,7 @@ using System.Net.Security; using System.Net.Cache; using System.Security.Principal; using System.Threading.Tasks; +using System.Text.RegularExpressions; #if NET_2_1 using ConfigurationException = System.ArgumentException; @@ -332,6 +333,19 @@ namespace System.Net throw GetMustImplement (); } + // Takes an ArrayList of fileglob-formatted strings and returns an array of Regex-formatted strings + private static string[] CreateBypassList (ArrayList al) + { + string[] result = al.ToArray (typeof (string)) as string[]; + for (int c = 0; c < result.Length; c++) + { + result [c] = "^" + + Regex.Escape (result [c]).Replace (@"\*", ".*").Replace (@"\?", ".") + + "$"; + } + return result; + } + [MonoTODO("Look in other places for proxy config info")] public static IWebProxy GetSystemWebProxy () { @@ -375,7 +389,7 @@ namespace System.Net } } - return new WebProxy (strHttpProxy, bBypassOnLocal, al.ToArray (typeof(string)) as string[]); + return new WebProxy (strHttpProxy, bBypassOnLocal, CreateBypassList (al)); } } else { #endif @@ -425,7 +439,7 @@ namespace System.Net } } - return new WebProxy (uri, bBypassOnLocal, al.ToArray (typeof(string)) as string[]); + return new WebProxy (uri, bBypassOnLocal, CreateBypassList (al)); } catch (UriFormatException) { } } diff --git a/mcs/class/System/System.Runtime.InteropServices/ChangeLog b/mcs/class/System/System.Runtime.InteropServices/ChangeLog deleted file mode 100644 index ca83262d16a..00000000000 --- a/mcs/class/System/System.Runtime.InteropServices/ChangeLog +++ /dev/null @@ -1,9 +0,0 @@ -2007-09-05 Atsushi Enomoto - - * HandleCollector.cs : new file. - -2007-03-12 Raja R Harinath - - * StandardOleMarshalObject.cs: New .net2.0 class. - * DefaultParameterValueAttribute.cs: Move here from corlib. - diff --git a/mcs/class/System/System.Runtime.InteropServices/DefaultParameterValueAttribute.cs b/mcs/class/System/System.Runtime.InteropServices/DefaultParameterValueAttribute.cs deleted file mode 100644 index e8988f0ec88..00000000000 --- a/mcs/class/System/System.Runtime.InteropServices/DefaultParameterValueAttribute.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -// System.Runtime.InteropServices.DefaultParameterValueAttribute.cs -// -// Author: Zoltan Varga (vargaz@gmail.com) -// -// (C) Ximian, Inc. -// - -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Runtime.InteropServices { - [AttributeUsage (AttributeTargets.Parameter)] - public sealed class DefaultParameterValueAttribute : Attribute - { - object value; - - public DefaultParameterValueAttribute (object value) - { - this.value = value; - } - - public object Value { - get { - return value; - } - } - } -} diff --git a/mcs/class/System/System.Runtime.InteropServices/HandleCollector.cs b/mcs/class/System/System.Runtime.InteropServices/HandleCollector.cs deleted file mode 100644 index ff51de2d023..00000000000 --- a/mcs/class/System/System.Runtime.InteropServices/HandleCollector.cs +++ /dev/null @@ -1,98 +0,0 @@ -// -// HandleCollector.cs -// -// Author: Atsushi Enomoto -// -// Copyright (C) 2007 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Runtime.InteropServices -{ - public sealed class HandleCollector - { - int count; - readonly int init, max; - readonly string name; - DateTime previous_collection = DateTime.MinValue; - - public HandleCollector (string name, int initialThreshold) - : this (name, initialThreshold, int.MaxValue) - { - } - - public HandleCollector (string name, int initialThreshold, int maximumThreshold) - { - if (initialThreshold < 0) - throw new ArgumentOutOfRangeException ("initialThreshold", "initialThreshold must not be less than zero"); - if (maximumThreshold < 0) - throw new ArgumentOutOfRangeException ("maximumThreshold", "maximumThreshold must not be less than zero"); - if (maximumThreshold < initialThreshold) - throw new ArgumentException ("maximumThreshold must not be less than initialThreshold"); - - this.name = name; - init = initialThreshold; - max = maximumThreshold; - } - - public int Count { - get { return count; } - } - - public int InitialThreshold { - get { return init; } - } - - public int MaximumThreshold { - get { return max; } - } - - public string Name { - get { return name; } - } - - public void Add () - { -/* NET_3_5 - if (++count >= max) - GC.Collect (GC.MaxGeneration, GCCollectionMode.Forced); - else if (count >= init) - GC.Collect (GC.MaxGeneration, GCCollectionMode.Optimized); -*/ - if (++count >= max) - GC.Collect (GC.MaxGeneration); - else if (count >= init && DateTime.Now - previous_collection > TimeSpan.FromSeconds (5)) { // some arbitrary criteria - GC.Collect (GC.MaxGeneration); - previous_collection = DateTime.Now; - } - } - - public void Remove () - { - if (count == 0) - throw new InvalidOperationException ("Cannot call Remove method when Count is 0"); - count--; - } - } -} - diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/OSX509Certificates.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/OSX509Certificates.cs index e4f47a5d363..184e586471d 100644 --- a/mcs/class/System/System.Security.Cryptography.X509Certificates/OSX509Certificates.cs +++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/OSX509Certificates.cs @@ -61,6 +61,9 @@ namespace System.Security.Cryptography.X509Certificates { [DllImport (CoreFoundationLibrary)] unsafe extern static IntPtr CFDataCreate (IntPtr allocator, byte *bytes, /* CFIndex */ IntPtr length); + [DllImport (CoreFoundationLibrary)] + extern static void CFRetain (IntPtr handle); + [DllImport (CoreFoundationLibrary)] extern static void CFRelease (IntPtr handle); @@ -97,6 +100,18 @@ namespace System.Security.Cryptography.X509Certificates { IntPtr.Zero); } } + + static IntPtr GetCertificate (X509Certificate certificate, out IntPtr dataPtr) + { + var handle = certificate.Handle; + if (handle != IntPtr.Zero) { + dataPtr = IntPtr.Zero; + CFRetain (handle); + return handle; + } + dataPtr = MakeCFData (certificate.GetRawCertData ()); + return SecCertificateCreateWithData (IntPtr.Zero, dataPtr); + } public static SecTrustResult TrustEvaluateSsl (XX509CertificateCollection certificates, XX509CertificateCollection anchors, string host) { @@ -126,19 +141,14 @@ namespace System.Security.Cryptography.X509Certificates { SecTrustResult result = SecTrustResult.Deny; try { - for (int i = 0; i < certCount; i++) - cfDataPtrs [i] = MakeCFData (certificates [i].GetRawCertData ()); - for (int i = 0; i < anchorCount; i++) - cfDataAnchorPtrs [i] = MakeCFData (anchors [i].GetRawCertData ()); - - for (int i = 0; i < certCount; i++){ - secCerts [i] = SecCertificateCreateWithData (IntPtr.Zero, cfDataPtrs [i]); + for (int i = 0; i < certCount; i++) { + secCerts [i] = GetCertificate (certificates [i], out cfDataPtrs [i]); if (secCerts [i] == IntPtr.Zero) return SecTrustResult.Deny; } for (int i = 0; i < anchorCount; i++) { - secCertAnchors [i] = SecCertificateCreateWithData (IntPtr.Zero, cfDataAnchorPtrs [i]); + secCertAnchors [i] = GetCertificate (anchors [i], out cfDataAnchorPtrs [i]); if (secCertAnchors [i] == IntPtr.Zero) return SecTrustResult.Deny; } diff --git a/mcs/class/System/System.dll.sources b/mcs/class/System/System.dll.sources index 1f55b8c861d..369fa12eec8 100644 --- a/mcs/class/System/System.dll.sources +++ b/mcs/class/System/System.dll.sources @@ -222,11 +222,6 @@ System.Net/AuthenticationSchemeSelector.cs System.Net/Authorization.cs System.Net/BasicClient.cs System.Net/BindIPEndPoint.cs -System.Net.Cache/HttpCacheAgeControl.cs -System.Net.Cache/HttpRequestCacheLevel.cs -System.Net.Cache/HttpRequestCachePolicy.cs -System.Net.Cache/RequestCacheLevel.cs -System.Net.Cache/RequestCachePolicy.cs System.Net/ChunkedInputStream.cs System.Net/ChunkStream.cs System.Net.Configuration/AuthenticationModuleElementCollection.cs @@ -553,16 +548,9 @@ System.Threading/ThreadExceptionEventArgs.cs System.Threading/ThreadExceptionEventHandler.cs System.Timers/ElapsedEventArgs.cs System/UriBuilder.cs -System/UriComponents.cs System/Uri.cs -System/UriFormat.cs -System/UriFormatException.cs -System/UriHostNameType.cs System/UriHelper.cs -System/UriIdnScope.cs -System/UriKind.cs System/UriParser.cs -System/UriPartial.cs System/UriTypeConverter.cs System/UriElements.cs System/UriParseComponents.cs @@ -570,8 +558,6 @@ System.Web/AspNetHostingPermissionAttribute.cs System.Web/AspNetHostingPermission.cs System.Web/AspNetHostingPermissionLevel.cs -System.Runtime.InteropServices/DefaultParameterValueAttribute.cs -System.Runtime.InteropServices/HandleCollector.cs System.Runtime.InteropServices/StandardOleMarshalObject.cs System.Runtime.InteropServices.ComTypes/ADVF.cs System.Runtime.InteropServices.ComTypes/DATADIR.cs @@ -1017,6 +1003,11 @@ ReferenceSources/_SslStream.cs ../../../external/referencesource/System/compmod/system/diagnostics/TypedElement.cs ../../../external/referencesource/System/compmod/system/diagnostics/XmlWriterTraceListener.cs +../../../external/referencesource/System/net/System/UriEnumTypes.cs +../../../external/referencesource/System/net/System/URIFormatException.cs +../../../external/referencesource/System/net/System/UriHostNameType.cs +../../../external/referencesource/System/net/System/URIPartial.cs + ../../../external/referencesource/System/net/System/Net/_BufferOffsetSize.cs ../../../external/referencesource/System/net/System/Net/_LazyAsyncResult.cs ../../../external/referencesource/System/net/System/Net/_LoggingObject.cs @@ -1035,12 +1026,17 @@ ReferenceSources/_SslStream.cs ../../../external/referencesource/System/net/System/Net/WebUtility.cs ../../../external/referencesource/System/net/System/Net/WriteStreamClosedEventArgs.cs +../../../external/referencesource/System/net/System/Net/Cache/RequestCachePolicy.cs + +../../../external/referencesource/System/net/System/Net/Sockets/IPProtectionLevel.cs ../../../external/referencesource/System/net/System/Net/Sockets/NetworkStream.cs + ../../../external/referencesource/System/net/System/Net/NetworkInformation/IPInterfaceStatistics.cs ../../../external/referencesource/System/net/System/Net/NetworkInformation/ScopeLevel.cs ../../../external/referencesource/System/net/System/Net/NetworkInformation/UnicastIPAddressInformation.cs -../../../external/referencesource/System/net/System/Net/Sockets/IPProtectionLevel.cs +../../../external/referencesource/System/sys/system/runtime/interopservices/DefaultParameterValueAttribute.cs +../../../external/referencesource/System/sys/system/runtime/interopservices/handlecollector.cs ../../../external/referencesource/System/sys/system/runtime/versioning/FrameworkName.cs diff --git a/mcs/class/System/System/UriComponents.cs b/mcs/class/System/System/UriComponents.cs deleted file mode 100644 index bc5fe6b8cac..00000000000 --- a/mcs/class/System/System/UriComponents.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// System.UriComponents enumeration -// -// Author: -// Sebastien Pouliot -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System { - - [Flags] - public enum UriComponents { - - Scheme = 1, - UserInfo = 2, - Host = 4, - Port = 8, - Path = 16, - Query = 32, - Fragment = 64, - StrongPort = 128, - NormalizedHost = 256, - KeepDelimiter = 0x40000000, - - HostAndPort = Host | StrongPort, - StrongAuthority = Host | UserInfo | StrongPort, - AbsoluteUri = Scheme | UserInfo | Host | Port | Path | Query | Fragment, - PathAndQuery = Path | Query, - HttpRequestUrl = Scheme | Port| Host | Path | Query, - SchemeAndServer = Scheme | Host | Port, - SerializationInfoString = Int32.MinValue - } -} diff --git a/mcs/class/System/System/UriFormat.cs b/mcs/class/System/System/UriFormat.cs deleted file mode 100644 index 67c6eebd145..00000000000 --- a/mcs/class/System/System/UriFormat.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// System.UriFormat enumeration -// -// Author: -// Sebastien Pouliot -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System { - - public enum UriFormat { - - UriEscaped = 1, - Unescaped, - SafeUnescaped, - } -} diff --git a/mcs/class/System/System/UriFormatException.cs b/mcs/class/System/System/UriFormatException.cs deleted file mode 100644 index 6860619ae40..00000000000 --- a/mcs/class/System/System/UriFormatException.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// System.UriFormatException.cs -// -// Author: -// Scott Sanders (scott@stonecobra.com) -// Duncan Mak (duncan@ximian.com) -// -// (C) 2001 Scott Sanders -// (C) 2002 Ximian, Inc. -// Copyright (C) 2005, 2008 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Globalization; -using System.Runtime.Serialization; - -namespace System { - - [Serializable] - public class UriFormatException : FormatException, ISerializable - { - - // Constructors - public UriFormatException () - : base (Locale.GetText ("Invalid URI format")) - { - } - - public UriFormatException (string textString) - : base (textString) - { - } - - public UriFormatException (string textString, Exception e) - : base (textString, e) - { - } - protected UriFormatException (SerializationInfo serializationInfo, StreamingContext streamingContext) - : base (serializationInfo, streamingContext) - { - } - - // Methods - - // This effectively kills the LinkDemand from Exception.GetObjectData (if someone - // use the ISerializable interface to serialize the object). See unit tests. - void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context) - { - base.GetObjectData (info, context); - } - } -} diff --git a/mcs/class/System/System/UriHostNameType.cs b/mcs/class/System/System/UriHostNameType.cs deleted file mode 100644 index fb25a1aa84a..00000000000 --- a/mcs/class/System/System/UriHostNameType.cs +++ /dev/null @@ -1,62 +0,0 @@ -// UriHostNameType.cs -// -// This code was automatically generated from -// ECMA CLI XML Library Specification. -// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)] -// Created: Wed, 5 Sep 2001 06:33:14 UTC -// Source file: AllTypes.xml -// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml -// -// (C) 2001 Ximian, Inc. http://www.ximian.com - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -namespace System { - - - /// - /// - public enum UriHostNameType { - - /// - /// - Unknown = 0, - - /// - /// - Basic = 1, - - /// - /// - Dns = 2, - - /// - /// - IPv4 = 3, - - /// - /// - IPv6 = 4, - } // UriHostNameType - -} // System diff --git a/mcs/class/System/System/UriIdnScope.cs b/mcs/class/System/System/UriIdnScope.cs deleted file mode 100644 index 6c385676a99..00000000000 --- a/mcs/class/System/System/UriIdnScope.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// UriIdnScope.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2007 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -// Net 3.5 type -namespace System -{ - public enum UriIdnScope - { - None, - AllExceptIntranet, - All, - } -} - diff --git a/mcs/class/System/System/UriKind.cs b/mcs/class/System/System/UriKind.cs deleted file mode 100644 index a6ddc2f7b3b..00000000000 --- a/mcs/class/System/System/UriKind.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// System.UriKind enumeration -// -// Author: -// Sebastien Pouliot -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System { - - public enum UriKind { - - RelativeOrAbsolute, - Absolute, - Relative, - } -} diff --git a/mcs/class/System/System/UriPartial.cs b/mcs/class/System/System/UriPartial.cs deleted file mode 100644 index b4ce130fdb2..00000000000 --- a/mcs/class/System/System/UriPartial.cs +++ /dev/null @@ -1,42 +0,0 @@ -// UriPartial.cs -// -// This code was automatically generated from -// ECMA CLI XML Library Specification. -// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)] -// Created: Wed, 5 Sep 2001 06:33:21 UTC -// Source file: AllTypes.xml -// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml -// -// (C) 2001 Ximian, Inc. http://www.ximian.com -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System { - - public enum UriPartial { - - Scheme = 0, - Authority = 1, - Path = 2, - Query - } -} diff --git a/mcs/class/System/Test/Microsoft.CSharp/CSharpCodeProviderTest.cs b/mcs/class/System/Test/Microsoft.CSharp/CSharpCodeProviderTest.cs index 7b988908317..a5899fd28f3 100644 --- a/mcs/class/System/Test/Microsoft.CSharp/CSharpCodeProviderTest.cs +++ b/mcs/class/System/Test/Microsoft.CSharp/CSharpCodeProviderTest.cs @@ -27,6 +27,9 @@ namespace MonoTests.Microsoft.CSharp private static readonly string _sourceLibrary1 = "public class Test1 {}"; private static readonly string _sourceLibrary2 = "public class Test2 {}"; + private static readonly string _sourceLibrary3 = + @"public class Test3 { public void F() { } } + public class Test4 : Test3 { public void F() { } }"; private static readonly string _sourceExecutable = "public class Program { static void Main () { } }"; [SetUp] @@ -547,6 +550,22 @@ namespace MonoTests.Microsoft.CSharp Assert.AreEqual (tempFile, tempFiles[0], "#4"); } + [Test] + public void MultiLineWarningIsReportedAsOneWarning() + { + CompilerParameters options = new CompilerParameters (); + options.GenerateExecutable = false; + options.GenerateInMemory = true; + options.TempFiles = new TempFileCollection (_tempDir); + + ICodeCompiler compiler = _codeProvider.CreateCompiler (); + CompilerResults results = compiler.CompileAssemblyFromSource (options, + _sourceLibrary3); + + // verify compilation was successful + AssertCompileResults (results, true); + } + private static string CreateTempDirectory () { // create a uniquely named zero-byte file diff --git a/mcs/class/System/Test/System.Diagnostics/ProcessStartInfoTest.cs b/mcs/class/System/Test/System.Diagnostics/ProcessStartInfoTest.cs index 53de1f66db4..7612efae6cc 100644 --- a/mcs/class/System/Test/System.Diagnostics/ProcessStartInfoTest.cs +++ b/mcs/class/System/Test/System.Diagnostics/ProcessStartInfoTest.cs @@ -8,6 +8,8 @@ // (c) 2007 Novell, Inc. (http://www.novell.com) // +#if MONO_FEATURE_PROCESS_START + using System; using System.Diagnostics; using System.Text; @@ -62,3 +64,5 @@ namespace MonoTests.System.Diagnostics } } } + +#endif // MONO_FEATURE_PROCESS_START diff --git a/mcs/class/System/Test/System.Diagnostics/ProcessTest.cs b/mcs/class/System/Test/System.Diagnostics/ProcessTest.cs index d4372a1dddd..615b0aed3e6 100644 --- a/mcs/class/System/Test/System.Diagnostics/ProcessTest.cs +++ b/mcs/class/System/Test/System.Diagnostics/ProcessTest.cs @@ -104,6 +104,7 @@ namespace MonoTests.System.Diagnostics } } +#if MONO_FEATURE_PROCESS_START [Test] // Start () public void Start1_FileName_Empty () { @@ -841,7 +842,6 @@ namespace MonoTests.System.Diagnostics Assert.AreEqual (1, exitedCalledCounter); } - ProcessStartInfo GetCrossPlatformStartInfo () { if (RunningOnUnix) { @@ -855,6 +855,7 @@ namespace MonoTests.System.Diagnostics } else return new ProcessStartInfo ("help", ""); } +#endif // MONO_FEATURE_PROCESS_START [Test] public void ProcessName_NotStarted () @@ -876,6 +877,7 @@ namespace MonoTests.System.Diagnostics Assert.IsNull (e.InnerException, "IOE inner exception should be null"); } +#if MONO_FEATURE_PROCESS_START [Test] [NUnit.Framework.Category ("MobileNotWorking")] public void ProcessName_AfterExit () @@ -906,6 +908,7 @@ namespace MonoTests.System.Diagnostics Assert.IsNull (e.InnerException, "IOE inner exception should be null"); } +#endif // MONO_FEATURE_PROCESS_START [Test] public void Handle_ThrowsOnNotStarted () @@ -923,6 +926,7 @@ namespace MonoTests.System.Diagnostics Assert.IsFalse (Process.GetCurrentProcess ().HasExited); } +#if MONO_FEATURE_PROCESS_START [Test] [NUnit.Framework.Category ("MobileNotWorking")] public void DisposeWithDisposedStreams () @@ -952,6 +956,7 @@ namespace MonoTests.System.Diagnostics p.StandardInput.Write ('x'); } } +#endif // MONO_FEATURE_PROCESS_START [Test] public void Modules () { diff --git a/mcs/class/System/Test/System.Net.Mail/SmtpClientTest.cs b/mcs/class/System/Test/System.Net.Mail/SmtpClientTest.cs index 8bba21c0bde..8fa752a4476 100644 --- a/mcs/class/System/Test/System.Net.Mail/SmtpClientTest.cs +++ b/mcs/class/System/Test/System.Net.Mail/SmtpClientTest.cs @@ -392,21 +392,48 @@ namespace MonoTests.System.Net.Mail [Test] public void Deliver_Async () { - var server = new SmtpServer (); - var client = new SmtpClient ("localhost", server.EndPoint.Port); - var msg = new MailMessage ("foo@example.com", "bar@example.com", "hello", "howdydoo\r\n"); - - Thread t = new Thread (server.Run); - t.Start (); - var task = client.SendMailAsync (msg); - t.Join (); + // SmtpClient uses BackgroundWorker and listens for the RunWorkerCompleted + // to mark an async task as completed. The problem is that BackgroundWorker uses + // System.ComponentModel.AsyncOperationManager to get the synchronization + // context, and in monotouch that returns by default a synchronization + // context for the main thread. Since tests are also run on the main thread, + // we'll block the main thread while waiting for the async send to complete, + // while the async completion is waiting for the main thread to process it. + // So instead use a SynchronizationContext that uses the threadpool instead + // of the main thread. + var existing_context = global::System.ComponentModel.AsyncOperationManager.SynchronizationContext; + global::System.ComponentModel.AsyncOperationManager.SynchronizationContext = new ThreadPoolSynchronizationContext (); + try { + var server = new SmtpServer (); + var client = new SmtpClient ("localhost", server.EndPoint.Port); + var msg = new MailMessage ("foo@example.com", "bar@example.com", "hello", "howdydoo\r\n"); + + Thread t = new Thread (server.Run); + t.Start (); + var task = client.SendMailAsync (msg); + t.Join (); + + Assert.AreEqual ("", server.mail_from); + Assert.AreEqual ("", server.rcpt_to); + + Assert.IsTrue (task.Wait (1000)); + Assert.IsTrue (task.IsCompleted, "task"); + } finally { + global::System.ComponentModel.AsyncOperationManager.SynchronizationContext = existing_context; + } + } - Assert.AreEqual ("", server.mail_from); - Assert.AreEqual ("", server.rcpt_to); + internal class ThreadPoolSynchronizationContext : SynchronizationContext + { + public override void Post (SendOrPostCallback d, object state) + { + ThreadPool.QueueUserWorkItem ((v) => d (state)); + } - Assert.IsTrue (task.Wait (1000)); - Assert.IsTrue (task.IsCompleted, "task"); + public override void Send (SendOrPostCallback d, object state) + { + d (state); + } } - } } diff --git a/mcs/class/System/Test/System.Net.NetworkInformation/NetworkInterfaceTest.cs b/mcs/class/System/Test/System.Net.NetworkInformation/NetworkInterfaceTest.cs index f3712dc9f6e..b124403e0dd 100644 --- a/mcs/class/System/Test/System.Net.NetworkInformation/NetworkInterfaceTest.cs +++ b/mcs/class/System/Test/System.Net.NetworkInformation/NetworkInterfaceTest.cs @@ -9,6 +9,7 @@ using NUnit.Framework; using System; using System.Linq; using System.Net; +using System.Net.Sockets; using System.Net.NetworkInformation; namespace MonoTests.System.Net.NetworkInformation @@ -72,6 +73,25 @@ namespace MonoTests.System.Net.NetworkInformation NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces (); Assert.IsTrue (adapters[0].Speed > 0); } - + + [Test] + public void IPv4Mask () + { + NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces (); + foreach (NetworkInterface adapter in adapters) + { + if (adapter.Supports (NetworkInterfaceComponent.IPv4)) + { + IPInterfaceProperties adapterProperties = adapter.GetIPProperties (); + foreach (UnicastIPAddressInformation uni in adapterProperties.UnicastAddresses) + { + if (uni.Address.AddressFamily == AddressFamily.InterNetwork) + { + Assert.IsNotNull (uni.IPv4Mask); + } + } + } + } + } } } diff --git a/mcs/class/System/Test/System.Net/SocketResponder.cs b/mcs/class/System/Test/System.Net/SocketResponder.cs index daa183afa06..af05477fb6b 100644 --- a/mcs/class/System/Test/System.Net/SocketResponder.cs +++ b/mcs/class/System/Test/System.Net/SocketResponder.cs @@ -131,12 +131,16 @@ namespace MonoTests.System.Net } } catch (SocketException ex) { // ignore interruption of blocking call - if (ex.ErrorCode != SOCKET_CLOSED && ex.ErrorCode != SOCKET_INVALID_ARGS) + if (ex.ErrorCode != SOCKET_CLOSED && ex.ErrorCode != SOCKET_INVALID_ARGS && _state != STATE_STOPPED) throw; } catch (ObjectDisposedException ex) { Console.WriteLine (ex); if (_state != STATE_STOPPED) throw; +#if !MONO_FEATURE_THREAD_ABORT + } catch (ThreadInterruptedException) { + break; +#endif #if MOBILE } catch (InvalidOperationException ex) { // This breaks some tests running on Android. The problem is that the stack trace @@ -146,7 +150,15 @@ namespace MonoTests.System.Net Console.WriteLine (ex); #endif } finally { +#if MONO_FEATURE_THREAD_ABORT Thread.Sleep (500); +#else + try { + Thread.Sleep (500); + } catch (ThreadInterruptedException) { + // nothing to do + } +#endif if (listenSocket != null) listenSocket.Close (); } diff --git a/mcs/class/System/mobile_System.dll.sources b/mcs/class/System/mobile_System.dll.sources index 2d502c5b708..d0da0f8faff 100644 --- a/mcs/class/System/mobile_System.dll.sources +++ b/mcs/class/System/mobile_System.dll.sources @@ -28,11 +28,6 @@ System.IO.Compression/DeflateStream.cs System.IO.Compression/GZipStream.cs System.IO/InternalBufferOverflowException.cs System.IO/InvalidDataException.cs -System.Net.Cache/HttpCacheAgeControl.cs -System.Net.Cache/HttpRequestCacheLevel.cs -System.Net.Cache/HttpRequestCachePolicy.cs -System.Net.Cache/RequestCacheLevel.cs -System.Net.Cache/RequestCachePolicy.cs System.Net.Mail/AlternateView.cs System.Net.Mail/AlternateViewCollection.cs System.Net.Mail/Attachment.cs @@ -250,7 +245,6 @@ System.Net.WebSockets/WebSocketException.cs System.Net.WebSockets/WebSocketMessageType.cs System.Net.WebSockets/WebSocketReceiveResult.cs System.Net.WebSockets/WebSocketState.cs -System.Runtime.InteropServices/DefaultParameterValueAttribute.cs System.Security.AccessControl/SemaphoreAccessRule.cs System.Security.AccessControl/SemaphoreAuditRule.cs System.Security.AccessControl/SemaphoreRights.cs @@ -331,20 +325,11 @@ System/Platform.cs System/SRDescriptionAttribute.cs System/Uri.cs System/UriBuilder.cs -System/UriComponents.cs -System/UriFormat.cs -System/UriFormatException.cs System/UriHelper.cs -System/UriHostNameType.cs -System/UriIdnScope.cs -System/UriKind.cs System/UriParser.cs -System/UriPartial.cs System/UriTypeConverter.cs System/UriElements.cs System/UriParseComponents.cs -System.Runtime.InteropServices/DefaultParameterValueAttribute.cs -System.Runtime.InteropServices/HandleCollector.cs System.Windows.Input/ICommand.cs Mono.Net.Security/CallbackHelpers.cs @@ -729,6 +714,11 @@ ReferenceSources/Win32Exception.cs ../../../external/referencesource/System/compmod/system/diagnostics/TraceSwitch.cs ../../../external/referencesource/System/compmod/system/diagnostics/traceutils.cs +../../../external/referencesource/System/net/System/UriEnumTypes.cs +../../../external/referencesource/System/net/System/URIFormatException.cs +../../../external/referencesource/System/net/System/UriHostNameType.cs +../../../external/referencesource/System/net/System/URIPartial.cs + ../../../external/referencesource/System/net/System/Net/_BufferOffsetSize.cs ../../../external/referencesource/System/net/System/Net/_LazyAsyncResult.cs ../../../external/referencesource/System/net/System/Net/_LoggingObject.cs @@ -747,12 +737,16 @@ ReferenceSources/Win32Exception.cs ../../../external/referencesource/System/net/System/Net/WebUtility.cs ../../../external/referencesource/System/net/System/Net/WriteStreamClosedEventArgs.cs +../../../external/referencesource/System/net/System/Net/Cache/RequestCachePolicy.cs + +../../../external/referencesource/System/net/System/Net/Sockets/IPProtectionLevel.cs ../../../external/referencesource/System/net/System/Net/Sockets/NetworkStream.cs ../../../external/referencesource/System/net/System/Net/NetworkInformation/IPInterfaceStatistics.cs ../../../external/referencesource/System/net/System/Net/NetworkInformation/ScopeLevel.cs ../../../external/referencesource/System/net/System/Net/NetworkInformation/UnicastIPAddressInformation.cs -../../../external/referencesource/System/net/System/Net/Sockets/IPProtectionLevel.cs +../../../external/referencesource/System/sys/system/runtime/interopservices/DefaultParameterValueAttribute.cs +../../../external/referencesource/System/sys/system/runtime/interopservices/handlecollector.cs ../../../external/referencesource/System/sys/system/runtime/versioning/FrameworkName.cs diff --git a/mcs/class/System/mobile_static_System.dll.sources b/mcs/class/System/mobile_static_System.dll.sources index ec41d5d60bd..45798be42a0 100644 --- a/mcs/class/System/mobile_static_System.dll.sources +++ b/mcs/class/System/mobile_static_System.dll.sources @@ -80,7 +80,7 @@ MonoTouch/MonoPInvokeCallbackAttribute.cs ../Mono.Security/Mono.Security.Interface/IBufferOffsetSize.cs ../Mono.Security/Mono.Security.Interface/IMonoTlsEventSink.cs ../Mono.Security/Mono.Security.Interface/IMonoTlsContext.cs -../Mono.Security/Mono.Security.Interface/MonoSslStream.cs +../Mono.Security/Mono.Security.Interface/IMonoSslStream.cs ../Mono.Security/Mono.Security.Interface/MonoTlsConnectionInfo.cs ../Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs ../Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.cs diff --git a/mcs/class/System/monodroid_System.dll.sources b/mcs/class/System/monodroid_System.dll.sources index 5a0d854cf45..83fc05a3640 100644 --- a/mcs/class/System/monodroid_System.dll.sources +++ b/mcs/class/System/monodroid_System.dll.sources @@ -77,13 +77,20 @@ System/AndroidPlatform.cs ../Mono.Security/Mono.Security.X509.Extensions/NetscapeCertTypeExtension.cs ../Mono.Security/Mono.Security.X509.Extensions/SubjectAltNameExtension.cs +../Mono.Security/Mono.Security.Interface/Alert.cs ../Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs +../Mono.Security/Mono.Security.Interface/CipherAlgorithmType.cs +../Mono.Security/Mono.Security.Interface/CipherSuiteCode.cs +../Mono.Security/Mono.Security.Interface/ExchangeAlgorithmType.cs +../Mono.Security/Mono.Security.Interface/HashAlgorithmType.cs ../Mono.Security/Mono.Security.Interface/IBufferOffsetSize.cs ../Mono.Security/Mono.Security.Interface/IMonoTlsEventSink.cs ../Mono.Security/Mono.Security.Interface/IMonoTlsContext.cs -../Mono.Security/Mono.Security.Interface/MonoSslStream.cs +../Mono.Security/Mono.Security.Interface/IMonoSslStream.cs ../Mono.Security/Mono.Security.Interface/MonoTlsConnectionInfo.cs ../Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs ../Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.cs ../Mono.Security/Mono.Security.Interface/MonoTlsSettings.cs +../Mono.Security/Mono.Security.Interface/TlsException.cs +../Mono.Security/Mono.Security.Interface/TlsProtocolCode.cs ../Mono.Security/Mono.Security.Interface/TlsProtocols.cs diff --git a/mcs/class/System/monotouch_System.dll.sources b/mcs/class/System/monotouch_System.dll.sources index ec41d5d60bd..91f1bd51de6 100644 --- a/mcs/class/System/monotouch_System.dll.sources +++ b/mcs/class/System/monotouch_System.dll.sources @@ -76,13 +76,20 @@ MonoTouch/MonoPInvokeCallbackAttribute.cs ../Mono.Security/Mono.Security.X509.Extensions/NetscapeCertTypeExtension.cs ../Mono.Security/Mono.Security.X509.Extensions/SubjectAltNameExtension.cs +../Mono.Security/Mono.Security.Interface/Alert.cs ../Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs +../Mono.Security/Mono.Security.Interface/CipherAlgorithmType.cs +../Mono.Security/Mono.Security.Interface/CipherSuiteCode.cs +../Mono.Security/Mono.Security.Interface/ExchangeAlgorithmType.cs +../Mono.Security/Mono.Security.Interface/HashAlgorithmType.cs ../Mono.Security/Mono.Security.Interface/IBufferOffsetSize.cs ../Mono.Security/Mono.Security.Interface/IMonoTlsEventSink.cs ../Mono.Security/Mono.Security.Interface/IMonoTlsContext.cs -../Mono.Security/Mono.Security.Interface/MonoSslStream.cs +../Mono.Security/Mono.Security.Interface/IMonoSslStream.cs ../Mono.Security/Mono.Security.Interface/MonoTlsConnectionInfo.cs ../Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs ../Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.cs ../Mono.Security/Mono.Security.Interface/MonoTlsSettings.cs +../Mono.Security/Mono.Security.Interface/TlsException.cs +../Mono.Security/Mono.Security.Interface/TlsProtocolCode.cs ../Mono.Security/Mono.Security.Interface/TlsProtocols.cs diff --git a/mcs/class/SystemWebTestShim/SystemWebTestShim-net_4_5.csproj b/mcs/class/SystemWebTestShim/SystemWebTestShim-net_4_5.csproj deleted file mode 100644 index fc897a2318f..00000000000 --- a/mcs/class/SystemWebTestShim/SystemWebTestShim-net_4_5.csproj +++ /dev/null @@ -1,95 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {337A92C8-EB50-43A9-9435-CB268AC147DC} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - SystemWebTestShim - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {B489C3DE-3ED3-4EDC-B42B-82B38E101857} - System.Web-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - - - - - diff --git a/mcs/class/WebMatrix.Data/WebMatrix.Data-net_4_5.csproj b/mcs/class/WebMatrix.Data/WebMatrix.Data-net_4_5.csproj deleted file mode 100644 index 6c2a0af3b3d..00000000000 --- a/mcs/class/WebMatrix.Data/WebMatrix.Data-net_4_5.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9732089B-32BB-43FC-BB72-3EE9BBBE796A} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - - Properties - - - WebMatrix.Data - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - - - - - diff --git a/mcs/class/WebMatrix.Data/WebMatrix.Data-tests-net_4_5.csproj b/mcs/class/WebMatrix.Data/WebMatrix.Data-tests-net_4_5.csproj deleted file mode 100644 index 65ab6fc05e3..00000000000 --- a/mcs/class/WebMatrix.Data/WebMatrix.Data-tests-net_4_5.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {22F06C6F-29E9-48BE-AF9B-066C5607C8F7} - Library - 1699 - bin\Debug\WebMatrix.Data-tests-net_4_5 - True - False - - Properties - - - WebMatrix.Data_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {9732089B-32BB-43FC-BB72-3EE9BBBE796A} - WebMatrix.Data\WebMatrix.Data-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {9A33954F-57A8-4D75-B1D8-0F81808A0DD4} - System.Data\System.Data-net_4_5 - - - {41476FBD-C1CB-4B3C-8078-3281EB1E0EAB} - Mono.Data.Sqlite\Mono.Data.Sqlite-net_4_5 - - - {D554618C-5D38-413A-82BA-7A70B6FC61A3} - Microsoft.CSharp\Microsoft.CSharp-net_4_5 - - - - - - - diff --git a/mcs/class/WindowsBase/WindowsBase-net_4_5.csproj b/mcs/class/WindowsBase/WindowsBase-net_4_5.csproj deleted file mode 100644 index 1f9888b3c53..00000000000 --- a/mcs/class/WindowsBase/WindowsBase-net_4_5.csproj +++ /dev/null @@ -1,291 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8E6ED7D5-3B08-4A83-905E-8FB4CF0C160D} - Library - 1699 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - WindowsBase - v4.5 - 512 - - - - true - full - 1699 - false - DEBUG;TRACE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {F574F9BD-1838-4C13-8722-7D6D33DE1781} - System.Xaml-net_4_5 - - - - - - - diff --git a/mcs/class/WindowsBase/WindowsBase-tests-net_4_5.csproj b/mcs/class/WindowsBase/WindowsBase-tests-net_4_5.csproj deleted file mode 100644 index f255d1df11d..00000000000 --- a/mcs/class/WindowsBase/WindowsBase-tests-net_4_5.csproj +++ /dev/null @@ -1,145 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C1439AE1-8420-4D56-98F1-2F98B221485A} - Library - 1699 - bin\Debug\WindowsBase-tests-net_4_5 - True - False - true - Properties - - - WindowsBase_test_net_4_5 - v4.5 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {8E6ED7D5-3B08-4A83-905E-8FB4CF0C160D} - WindowsBase\WindowsBase-net_4_5 - - - {8E6ED7D5-3B08-4A83-905E-8FB4CF0C160D} - WindowsBase\WindowsBase-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {F574F9BD-1838-4C13-8722-7D6D33DE1781} - System.Xaml\System.Xaml-net_4_5 - - - - - - - diff --git a/mcs/class/corlib/Mono/Runtime.cs b/mcs/class/corlib/Mono/Runtime.cs index 80e56a559ac..7a5f9887c63 100644 --- a/mcs/class/corlib/Mono/Runtime.cs +++ b/mcs/class/corlib/Mono/Runtime.cs @@ -59,7 +59,10 @@ namespace Mono { [MethodImplAttribute (MethodImplOptions.InternalCall)] static extern string GetNativeStackTrace (Exception exception); - [MethodImplAttribute (MethodImplOptions.InternalCall)] - public static extern bool SetGCAllowSynchronousMajor (bool flag); + public static bool SetGCAllowSynchronousMajor (bool flag) + { + // No longer used + return true; + } } } diff --git a/mcs/class/corlib/ReferenceSources/DefaultBinder.cs b/mcs/class/corlib/ReferenceSources/DefaultBinder.cs index 9f2a2d68082..074e754b958 100644 --- a/mcs/class/corlib/ReferenceSources/DefaultBinder.cs +++ b/mcs/class/corlib/ReferenceSources/DefaultBinder.cs @@ -36,7 +36,10 @@ namespace System return false; var from = Type.GetTypeCode (source); - switch (Type.GetTypeCode (target)) { + var to = Type.GetTypeCode (target); + if (from == to && source.IsPrimitive) + return true; + switch (to) { case TypeCode.Char: switch (from) { case TypeCode.Byte: @@ -146,4 +149,4 @@ namespace System return st == type || CanConvertPrimitive ((RuntimeType) st, type); } } -} \ No newline at end of file +} diff --git a/mcs/class/corlib/System.IO/Path.cs b/mcs/class/corlib/System.IO/Path.cs index 7945d407406..9ac0e975454 100644 --- a/mcs/class/corlib/System.IO/Path.cs +++ b/mcs/class/corlib/System.IO/Path.cs @@ -289,6 +289,7 @@ namespace System.IO { return fullpath; } +#if !MOBILE // http://msdn.microsoft.com/en-us/library/windows/desktop/aa364963%28v=vs.85%29.aspx [DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] private static extern int GetFullPathName(string path, int numBufferChars, StringBuilder buffer, ref IntPtr lpFilePartOrNull); @@ -341,6 +342,7 @@ namespace System.IO { } return path; } +#endif // insecure - do not call directly internal static string InsecureGetFullPath (string path) @@ -352,11 +354,11 @@ namespace System.IO { string msg = Locale.GetText ("The specified path is not of a legal form (empty)."); throw new ArgumentException (msg); } - +#if !MOBILE // adjust for drives, i.e. a special case for windows if (Environment.IsRunningOnWindows) path = WindowsDriveAdjustment (path); - +#endif // if the supplied path ends with a separator... char end = path [path.Length - 1]; diff --git a/mcs/class/corlib/System.Security.AccessControl/NativeObjectSecurity.cs b/mcs/class/corlib/System.Security.AccessControl/NativeObjectSecurity.cs index 141d0c9d6cb..7e83a6cacf0 100644 --- a/mcs/class/corlib/System.Security.AccessControl/NativeObjectSecurity.cs +++ b/mcs/class/corlib/System.Security.AccessControl/NativeObjectSecurity.cs @@ -203,6 +203,9 @@ namespace System.Security.AccessControl internal virtual int InternalGet (SafeHandle handle, AccessControlSections includeSections) { +#if MOBILE + throw new PlatformNotSupportedException (); +#else if (Environment.OSVersion.Platform != PlatformID.Win32NT) throw new PlatformNotSupportedException (); @@ -214,11 +217,15 @@ namespace System.Security.AccessControl out owner, out group, out dacl, out sacl, out descriptor); }, includeSections); +#endif } internal virtual int InternalGet (string name, AccessControlSections includeSections) { +#if MOBILE + throw new PlatformNotSupportedException (); +#else if (Environment.OSVersion.Platform != PlatformID.Win32NT) throw new PlatformNotSupportedException (); @@ -230,8 +237,20 @@ namespace System.Security.AccessControl out owner, out group, out dacl, out sacl, out descriptor); }, includeSections); +#endif } +#if MOBILE + internal virtual int InternalSet (SafeHandle handle, AccessControlSections includeSections) + { + throw new PlatformNotSupportedException (); + } + + internal virtual int InternalSet (string name, AccessControlSections includeSections) + { + throw new PlatformNotSupportedException (); + } +#else internal virtual int InternalSet (SafeHandle handle, AccessControlSections includeSections) { @@ -399,6 +418,7 @@ namespace System.Security.AccessControl public IntPtr Owner, Group, Sacl, Dacl; } #endregion +#endif } } diff --git a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs index f1c27f3309d..144997e573b 100644 --- a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs +++ b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs @@ -53,42 +53,9 @@ namespace System.Security.Cryptography.X509Certificates { #else public partial class X509Certificate : IDeserializationCallback, ISerializable { #endif - // typedef struct _CERT_CONTEXT { - // DWORD dwCertEncodingType; - // BYTE *pbCertEncoded; - // DWORD cbCertEncoded; - // PCERT_INFO pCertInfo; - // HCERTSTORE hCertStore; - // } CERT_CONTEXT, *PCERT_CONTEXT; - // typedef const CERT_CONTEXT *PCCERT_CONTEXT; - [StructLayout (LayoutKind.Sequential)] - internal struct CertificateContext { - public UInt32 dwCertEncodingType; - public IntPtr pbCertEncoded; - public UInt32 cbCertEncoded; - public IntPtr pCertInfo; - public IntPtr hCertStore; - } - // NOTE: We only define the CryptoAPI structure (from WINCRYPT.H) - // so we don't create any dependencies on Windows DLL in corlib + X509CertificateImpl impl; - private Mono.Security.X509.X509Certificate x509; private bool hideDates; - private byte[] cachedCertificateHash; - - // almost every byte[] returning function has a string equivalent - // sadly the BitConverter insert dash between bytes :-( - private string tostr (byte[] data) - { - if (data != null) { - StringBuilder sb = new StringBuilder (); - for (int i = 0; i < data.Length; i++) - sb.Append (data[i].ToString ("X2")); - return sb.ToString (); - } - else - return null; - } // static methods @@ -133,44 +100,24 @@ namespace System.Security.Cryptography.X509Certificates { public X509Certificate (byte[] data) : this (data, true) { } - + public X509Certificate (IntPtr handle) { if (handle == IntPtr.Zero) throw new ArgumentException ("Invalid handle."); -#if NET_2_1 - // this works on Windows-only so it's of no use for Moonlight - // even more since this ctor is [SecurityCritical] - throw new NotSupportedException (); -#else - InitFromHandle (handle); -#endif - } - [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)] - private void InitFromHandle (IntPtr handle) - { - if (handle != IntPtr.Zero) { - // both Marshal.PtrToStructure and Marshal.Copy use LinkDemand (so they will always success from here) - CertificateContext cc = (CertificateContext) Marshal.PtrToStructure (handle, typeof (CertificateContext)); - byte[] data = new byte [cc.cbCertEncoded]; - Marshal.Copy (cc.pbCertEncoded, data, 0, (int)cc.cbCertEncoded); - x509 = new Mono.Security.X509.X509Certificate (data); - } - // for 1.x IntPtr.Zero results in an "empty" certificate instance + impl = X509Helper.InitFromHandle (handle); } - + public X509Certificate (System.Security.Cryptography.X509Certificates.X509Certificate cert) { if (cert == null) throw new ArgumentNullException ("cert"); - if (cert != null) { - byte[] data = cert.GetRawCertData (); - if (data != null) - x509 = new Mono.Security.X509.X509Certificate (data); - hideDates = false; - } + X509Helper.ThrowIfContextInvalid (cert.impl); + + impl = X509Helper.InitFromCertificate (cert.impl); + hideDates = false; } @@ -181,53 +128,30 @@ namespace System.Security.Cryptography.X509Certificates { if (other == null) { return false; } else { - if (other.x509 == null) { - if (x509 == null) + if (!X509Helper.IsValid (other.impl)) { + if (!X509Helper.IsValid (impl)) return true; throw new CryptographicException (Locale.GetText ("Certificate instance is empty.")); } - byte[] raw = other.x509.RawData; - if (raw != null) { - if (x509 == null) - return false; - if (x509.RawData == null) - return false; - if (raw.Length == x509.RawData.Length) { - for (int i = 0; i < raw.Length; i++) { - if (raw[i] != x509.RawData [i]) - return false; - } - // well no choice must be equals! - return true; - } - else - return false; - } + return X509CertificateImpl.Equals (impl, other.impl); } - return ((x509 == null) || (x509.RawData == null)); } - + // LAMESPEC: This is the equivalent of the "thumbprint" that can be seen // in the certificate viewer of Windows. This is ALWAYS the SHA1 hash of // the certificate (i.e. it has nothing to do with the actual hash // algorithm used to sign the certificate). public virtual byte[] GetCertHash () { - if (x509 == null) - throw new CryptographicException (Locale.GetText ("Certificate instance is empty.")); - // we'll hash the cert only once and only if required - if ((cachedCertificateHash == null) && (x509 != null)) { - SHA1 sha = SHA1.Create (); - cachedCertificateHash = sha.ComputeHash (x509.RawData); - } - return cachedCertificateHash; + X509Helper.ThrowIfContextInvalid (impl); + return impl.GetCertHash (); } public virtual string GetCertHashString () { // must call GetCertHash (not variable) or optimization wont work - return tostr (GetCertHash ()); + return X509Helper.ToHexString (GetCertHash ()); } // strangly there are no DateTime returning function @@ -235,10 +159,9 @@ namespace System.Security.Cryptography.X509Certificates { { if (hideDates) return null; - if (x509 == null) - throw new CryptographicException (Locale.GetText ("Certificate instance is empty.")); + X509Helper.ThrowIfContextInvalid (impl); - return x509.ValidFrom.ToLocalTime ().ToString (); + return impl.GetEffectiveDateString ().ToString (); } // strangly there are no DateTime returning function @@ -246,10 +169,9 @@ namespace System.Security.Cryptography.X509Certificates { { if (hideDates) return null; - if (x509 == null) - throw new CryptographicException (Locale.GetText ("Certificate instance is empty.")); + X509Helper.ThrowIfContextInvalid (impl); - return x509.ValidUntil.ToLocalTime ().ToString (); + return impl.GetExpirationDateString ().ToString (); } // well maybe someday there'll be support for PGP or SPKI ? @@ -260,41 +182,29 @@ namespace System.Security.Cryptography.X509Certificates { public override int GetHashCode () { - if (x509 == null) - return 0; - // the cert hash may not be (yet) calculated - if (cachedCertificateHash == null) - GetCertHash(); - - // return the integer of the first 4 bytes of the cert hash - if ((cachedCertificateHash != null) && (cachedCertificateHash.Length >= 4)) - return ((cachedCertificateHash[0] << 24) |(cachedCertificateHash[1] << 16) | - (cachedCertificateHash[2] << 8) | cachedCertificateHash[3]); - else + if (!X509Helper.IsValid (impl)) return 0; + return impl.GetHashCode (); } [Obsolete ("Use the Issuer property.")] public virtual string GetIssuerName () { - if (x509 == null) - throw new CryptographicException (Locale.GetText ("Certificate instance is empty.")); - return x509.IssuerName; + X509Helper.ThrowIfContextInvalid (impl); + return impl.GetIssuerName (true); } public virtual string GetKeyAlgorithm () { - if (x509 == null) - throw new CryptographicException (Locale.GetText ("Certificate instance is empty.")); - return x509.KeyAlgorithm; + X509Helper.ThrowIfContextInvalid (impl); + return impl.GetKeyAlgorithm (); } public virtual byte[] GetKeyAlgorithmParameters () { - if (x509 == null) - throw new CryptographicException (Locale.GetText ("Certificate instance is empty.")); + X509Helper.ThrowIfContextInvalid (impl); - byte[] kap = x509.KeyAlgorithmParameters; + byte[] kap = impl.GetKeyAlgorithmParameters (); if (kap == null) throw new CryptographicException (Locale.GetText ("Parameters not part of the certificate")); @@ -303,55 +213,50 @@ namespace System.Security.Cryptography.X509Certificates { public virtual string GetKeyAlgorithmParametersString () { - return tostr (GetKeyAlgorithmParameters ()); + return X509Helper.ToHexString (GetKeyAlgorithmParameters ()); } [Obsolete ("Use the Subject property.")] public virtual string GetName () { - if (x509 == null) - throw new CryptographicException (Locale.GetText ("Certificate instance is empty.")); - return x509.SubjectName; + X509Helper.ThrowIfContextInvalid (impl); + return impl.GetSubjectName (true); } public virtual byte[] GetPublicKey () { - if (x509 == null) - throw new CryptographicException (Locale.GetText ("Certificate instance is empty.")); - return x509.PublicKey; + X509Helper.ThrowIfContextInvalid (impl); + return impl.GetPublicKey (); } public virtual string GetPublicKeyString () { - return tostr (GetPublicKey ()); + return X509Helper.ToHexString (GetPublicKey ()); } public virtual byte[] GetRawCertData () { - if (x509 == null) - throw new CryptographicException (Locale.GetText ("Certificate instance is empty.")); - return x509.RawData; + X509Helper.ThrowIfContextInvalid (impl); + return impl.GetRawCertData (); } public virtual string GetRawCertDataString () { - if (x509 == null) - throw new CryptographicException (Locale.GetText ("Certificate instance is empty.")); - return tostr (x509.RawData); + X509Helper.ThrowIfContextInvalid (impl); + return X509Helper.ToHexString (impl.GetRawCertData ()); } public virtual byte[] GetSerialNumber () { - if (x509 == null) - throw new CryptographicException (Locale.GetText ("Certificate instance is empty.")); - return x509.SerialNumber; + X509Helper.ThrowIfContextInvalid (impl); + return impl.GetSerialNumber (); } public virtual string GetSerialNumberString () { byte[] sn = GetSerialNumber (); Array.Reverse (sn); - return tostr (sn); + return X509Helper.ToHexString (sn); } // to please corcompare ;-) @@ -362,18 +267,10 @@ namespace System.Security.Cryptography.X509Certificates { public virtual string ToString (bool fVerbose) { - if (!fVerbose || (x509 == null)) + if (!fVerbose || !X509Helper.IsValid (impl)) return base.ToString (); - string nl = Environment.NewLine; - StringBuilder sb = new StringBuilder (); - sb.AppendFormat ("[Subject]{0} {1}{0}{0}", nl, Subject); - sb.AppendFormat ("[Issuer]{0} {1}{0}{0}", nl, Issuer); - sb.AppendFormat ("[Not Before]{0} {1}{0}{0}", nl, GetEffectiveDateString ()); - sb.AppendFormat ("[Not After]{0} {1}{0}{0}", nl, GetExpirationDateString ()); - sb.AppendFormat ("[Thumbprint]{0} {1}{0}", nl, GetCertHashString ()); - sb.Append (nl); - return sb.ToString (); + return impl.ToString (true); } protected static string FormatDate (DateTime date) diff --git a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate20.cs b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate20.cs index 7d5273ee110..78a71adbd56 100644 --- a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate20.cs +++ b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate20.cs @@ -42,7 +42,7 @@ namespace System.Security.Cryptography.X509Certificates { [ComVisible (true)] [MonoTODO ("X509ContentType.SerializedCert isn't supported (anywhere in the class)")] - public partial class X509Certificate : IDeserializationCallback, ISerializable { + public partial class X509Certificate : IDeserializationCallback, ISerializable, IDisposable { private string issuer_name; private string subject_name; @@ -110,29 +110,31 @@ namespace System.Security.Cryptography.X509Certificates { public string Issuer { get { - if (x509 == null) - throw new CryptographicException (Locale.GetText ("Certificate instance is empty.")); + X509Helper.ThrowIfContextInvalid (impl); if (issuer_name == null) - issuer_name = X501.ToString (x509.GetIssuerName (), true, ", ", true); + issuer_name = impl.GetIssuerName (false); return issuer_name; } } public string Subject { get { - if (x509 == null) - throw new CryptographicException (Locale.GetText ("Certificate instance is empty.")); + X509Helper.ThrowIfContextInvalid (impl); if (subject_name == null) - subject_name = X501.ToString (x509.GetSubjectName (), true, ", ", true); + subject_name = impl.GetSubjectName (false); return subject_name; } } [ComVisible (false)] public IntPtr Handle { - get { return IntPtr.Zero; } + get { + if (X509Helper.IsValid (impl)) + return impl.Handle; + return IntPtr.Zero; + } } @@ -169,25 +171,10 @@ namespace System.Security.Cryptography.X509Certificates { internal byte[] Export (X509ContentType contentType, byte[] password) { - if (x509 == null) - throw new CryptographicException (Locale.GetText ("Certificate instance is empty.")); - try { - switch (contentType) { - case X509ContentType.Cert: - return x509.RawData; - case X509ContentType.Pfx: // this includes Pkcs12 - // TODO - throw new NotSupportedException (); - case X509ContentType.SerializedCert: - // TODO - throw new NotSupportedException (); - default: - string msg = Locale.GetText ("This certificate format '{0}' cannot be exported.", contentType); - throw new CryptographicException (msg); - } - } - finally { + X509Helper.ThrowIfContextInvalid (impl); + return impl.Export (contentType, password); + } finally { // protect password if (password != null) Array.Clear (password, 0, password.Length); @@ -200,59 +187,12 @@ namespace System.Security.Cryptography.X509Certificates { Import (rawData, (string)null, X509KeyStorageFlags.DefaultKeySet); } - private Mono.Security.X509.X509Certificate ImportPkcs12 (byte[] rawData, string password) - { - var pfx = (password == null) ? new Mono.Security.X509.PKCS12 (rawData) : new Mono.Security.X509.PKCS12 (rawData, password); - if (pfx.Certificates.Count == 0) { - // no certificate was found - return null; - } else if (pfx.Keys.Count == 0) { - // no key were found - pick the first certificate - return pfx.Certificates [0]; - } else { - // find the certificate that match the first key - var keypair = (pfx.Keys [0] as AsymmetricAlgorithm); - string pubkey = keypair.ToXmlString (false); - foreach (var c in pfx.Certificates) { - if ((c.RSA != null) && (pubkey == c.RSA.ToXmlString (false))) - return c; - if ((c.DSA != null) && (pubkey == c.DSA.ToXmlString (false))) - return c; - } - return pfx.Certificates [0]; // no match, pick first certificate without keys - } - } - [MonoTODO ("missing KeyStorageFlags support")] [ComVisible (false)] public virtual void Import (byte[] rawData, string password, X509KeyStorageFlags keyStorageFlags) { Reset (); - if (password == null) { - try { - x509 = new Mono.Security.X509.X509Certificate (rawData); - } - catch (Exception e) { - try { - x509 = ImportPkcs12 (rawData, null); - } - catch { - string msg = Locale.GetText ("Unable to decode certificate."); - // inner exception is the original (not second) exception - throw new CryptographicException (msg, e); - } - } - } else { - // try PKCS#12 - try { - x509 = ImportPkcs12 (rawData, password); - } - catch { - // it's possible to supply a (unrequired/unusued) password - // fix bug #79028 - x509 = new Mono.Security.X509.X509Certificate (rawData); - } - } + impl = X509Helper.Import (rawData, password, keyStorageFlags); } [MonoTODO ("SecureString support is incomplete")] @@ -289,18 +229,34 @@ namespace System.Security.Cryptography.X509Certificates { void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context) { + if (!X509Helper.IsValid (impl)) + throw new NullReferenceException (); // will throw a NRE if info is null (just like MS implementation) - info.AddValue ("RawData", x509.RawData); + info.AddValue ("RawData", impl.GetRawCertData ()); + } + + public void Dispose () + { + Dispose (true); + } + + protected virtual void Dispose (bool disposing) + { + if (disposing) + Reset (); } [ComVisible (false)] public virtual void Reset () { - x509 = null; + if (impl != null) { + impl.Dispose (); + impl = null; + } + issuer_name = null; subject_name = null; hideDates = false; - cachedCertificateHash = null; } } } diff --git a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509CertificateImpl.cs b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509CertificateImpl.cs new file mode 100644 index 00000000000..e3dc5b36201 --- /dev/null +++ b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509CertificateImpl.cs @@ -0,0 +1,148 @@ +// +// X509Helpers.cs: X.509 helper and utility functions. +// +// Authors: +// Martin Baulig +// +// Copyright (C) 2015 Xamarin, Inc. (http://www.xamarin.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +namespace System.Security.Cryptography.X509Certificates +{ + internal abstract class X509CertificateImpl : IDisposable + { + public abstract bool IsValid { + get; + } + + public abstract IntPtr Handle { + get; + } + + protected void ThrowIfContextInvalid () + { + if (!IsValid) + throw X509Helper.GetInvalidContextException (); + } + + public abstract X509CertificateImpl Clone (); + + public abstract string GetSubjectSummary (); + + public abstract string GetIssuerName (bool legacyV1Mode); + + public abstract string GetSubjectName (bool legacyV1Mode); + + public abstract byte[] GetRawCertData (); + + public abstract DateTime GetEffectiveDateString (); + + public abstract DateTime GetExpirationDateString (); + + byte[] cachedCertificateHash; + + public byte[] GetCertHash () + { + ThrowIfContextInvalid (); + if (cachedCertificateHash == null) + cachedCertificateHash = GetCertHash (false); + return cachedCertificateHash; + } + + protected abstract byte[] GetCertHash (bool lazy); + + public override int GetHashCode () + { + if (!IsValid) + return 0; + if (cachedCertificateHash == null) + cachedCertificateHash = GetCertHash (true); + // return the integer of the first 4 bytes of the cert hash + if ((cachedCertificateHash != null) && (cachedCertificateHash.Length >= 4)) + return ((cachedCertificateHash [0] << 24) | (cachedCertificateHash [1] << 16) | + (cachedCertificateHash [2] << 8) | cachedCertificateHash [3]); + else + return 0; + } + + public abstract bool Equals (X509CertificateImpl other, out bool result); + + public abstract string GetKeyAlgorithm (); + + public abstract byte[] GetKeyAlgorithmParameters (); + + public abstract byte[] GetPublicKey (); + + public abstract byte[] GetSerialNumber (); + + public abstract byte[] Export (X509ContentType contentType, byte[] password); + + public abstract string ToString (bool full); + + public override bool Equals (object obj) + { + var other = obj as X509CertificateImpl; + if (other == null) + return false; + + if (!IsValid || !other.IsValid) + return false; + + bool result; + if (Equals (other, out result)) + return result; + + var ourRaw = GetRawCertData (); + var theirRaw = other.GetRawCertData (); + + if (ourRaw == null) + return theirRaw == null; + else if (theirRaw == null) + return false; + + if (ourRaw.Length != theirRaw.Length) + return false; + + for (int i = 0; i < ourRaw.Length; i++) { + if (ourRaw [i] != theirRaw [i]) + return false; + } + + return true; + } + + public void Dispose () + { + Dispose (true); + GC.SuppressFinalize (this); + } + + protected virtual void Dispose (bool disposing) + { + cachedCertificateHash = null; + } + + ~X509CertificateImpl () + { + Dispose (false); + } + } +} diff --git a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509CertificateImplMono.cs b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509CertificateImplMono.cs new file mode 100644 index 00000000000..85985c5d303 --- /dev/null +++ b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509CertificateImplMono.cs @@ -0,0 +1,179 @@ +// +// X509CertificateImplMono.cs: X.509 implementation using Mono.Security.X509. +// +// Authors: +// Sebastien Pouliot +// Martin Baulig +// +// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com) +// Copyright (C) 2004-2006 Novell, Inc (http://www.novell.com) +// Copyright (C) 2015 Xamarin, Inc. (http://www.xamarin.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +using System; +using System.Text; +using MX = Mono.Security.X509; + +namespace System.Security.Cryptography.X509Certificates +{ + class X509CertificateImplMono : X509CertificateImpl + { + MX.X509Certificate x509; + + public X509CertificateImplMono (MX.X509Certificate x509) + { + this.x509 = x509; + } + + public override bool IsValid { + get { return x509 != null; } + } + + public override IntPtr Handle { + get { return IntPtr.Zero; } + } + + public override X509CertificateImpl Clone () + { + ThrowIfContextInvalid (); + return new X509CertificateImplMono (x509); + } + + public override string GetIssuerName (bool legacyV1Mode) + { + ThrowIfContextInvalid (); + if (legacyV1Mode) + return x509.IssuerName; + else + return MX.X501.ToString (x509.GetIssuerName (), true, ", ", true); + } + + public override string GetSubjectSummary () + { + ThrowIfContextInvalid (); + return x509.SubjectName; + } + + public override string GetSubjectName (bool legacyV1Mode) + { + ThrowIfContextInvalid (); + if (legacyV1Mode) + return x509.SubjectName; + else + return MX.X501.ToString (x509.GetSubjectName (), true, ", ", true); + } + + public override byte[] GetRawCertData () + { + ThrowIfContextInvalid (); + return x509.RawData; + } + + protected override byte[] GetCertHash (bool lazy) + { + ThrowIfContextInvalid (); + SHA1 sha = SHA1.Create (); + return sha.ComputeHash (x509.RawData); + } + + public override DateTime GetEffectiveDateString () + { + ThrowIfContextInvalid (); + return x509.ValidFrom.ToLocalTime (); + } + + public override DateTime GetExpirationDateString () + { + ThrowIfContextInvalid (); + return x509.ValidUntil.ToLocalTime (); + } + + public override bool Equals (X509CertificateImpl other, out bool result) + { + // Use default implementation + result = false; + return false; + } + + public override string GetKeyAlgorithm () + { + ThrowIfContextInvalid (); + return x509.KeyAlgorithm; + } + + public override byte[] GetKeyAlgorithmParameters () + { + ThrowIfContextInvalid (); + return x509.KeyAlgorithmParameters; + } + + public override byte[] GetPublicKey () + { + ThrowIfContextInvalid (); + return x509.PublicKey; + } + + public override byte[] GetSerialNumber () + { + ThrowIfContextInvalid (); + return x509.SerialNumber; + } + + public override byte[] Export (X509ContentType contentType, byte[] password) + { + ThrowIfContextInvalid (); + + switch (contentType) { + case X509ContentType.Cert: + return GetRawCertData (); + case X509ContentType.Pfx: // this includes Pkcs12 + // TODO + throw new NotSupportedException (); + case X509ContentType.SerializedCert: + // TODO + throw new NotSupportedException (); + default: + string msg = Locale.GetText ("This certificate format '{0}' cannot be exported.", contentType); + throw new CryptographicException (msg); + } + } + + public override string ToString (bool full) + { + ThrowIfContextInvalid (); + + string nl = Environment.NewLine; + StringBuilder sb = new StringBuilder (); + sb.AppendFormat ("[Subject]{0} {1}{0}{0}", nl, GetSubjectName (false)); + sb.AppendFormat ("[Issuer]{0} {1}{0}{0}", nl, GetIssuerName (false)); + sb.AppendFormat ("[Not Before]{0} {1}{0}{0}", nl, GetEffectiveDateString ()); + sb.AppendFormat ("[Not After]{0} {1}{0}{0}", nl, GetExpirationDateString ()); + sb.AppendFormat ("[Thumbprint]{0} {1}{0}", nl, X509Helper.ToHexString (GetCertHash ())); + sb.Append (nl); + return sb.ToString (); + } + + protected override void Dispose (bool disposing) + { + x509 = null; + } + } +} diff --git a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Helper.cs b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Helper.cs new file mode 100644 index 00000000000..dc73f5ad79d --- /dev/null +++ b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Helper.cs @@ -0,0 +1,214 @@ +// +// X509Helpers.cs: X.509 helper and utility functions. +// +// Authors: +// Sebastien Pouliot +// Martin Baulig +// +// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com) +// Copyright (C) 2004-2006 Novell, Inc (http://www.novell.com) +// Copyright (C) 2015 Xamarin, Inc. (http://www.xamarin.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +using System; +using System.Text; +using System.Runtime.InteropServices; +#if !NET_2_1 +using System.Security.Permissions; +#endif +using MX = Mono.Security.X509; + +namespace System.Security.Cryptography.X509Certificates +{ + static partial class X509Helper + { +#if !NET_2_1 + // typedef struct _CERT_CONTEXT { + // DWORD dwCertEncodingType; + // BYTE *pbCertEncoded; + // DWORD cbCertEncoded; + // PCERT_INFO pCertInfo; + // HCERTSTORE hCertStore; + // } CERT_CONTEXT, *PCERT_CONTEXT; + // typedef const CERT_CONTEXT *PCCERT_CONTEXT; + [StructLayout (LayoutKind.Sequential)] + internal struct CertificateContext { + public UInt32 dwCertEncodingType; + public IntPtr pbCertEncoded; + public UInt32 cbCertEncoded; + public IntPtr pCertInfo; + public IntPtr hCertStore; + } + // NOTE: We only define the CryptoAPI structure (from WINCRYPT.H) + // so we don't create any dependencies on Windows DLL in corlib + + [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)] + public static X509CertificateImpl InitFromHandle (IntPtr handle) + { + // both Marshal.PtrToStructure and Marshal.Copy use LinkDemand (so they will always success from here) + CertificateContext cc = (CertificateContext) Marshal.PtrToStructure (handle, typeof (CertificateContext)); + byte[] data = new byte [cc.cbCertEncoded]; + Marshal.Copy (cc.pbCertEncoded, data, 0, (int)cc.cbCertEncoded); + var x509 = new MX.X509Certificate (data); + return new X509CertificateImplMono (x509); + } +#elif !MONOTOUCH && !XAMMAC + public static X509CertificateImpl InitFromHandle (IntPtr handle) + { + throw new NotSupportedException (); + } +#endif + + public static X509CertificateImpl InitFromCertificate (X509CertificateImpl impl) + { + ThrowIfContextInvalid (impl); + var copy = impl.Clone (); + if (copy != null) + return copy; + + var data = impl.GetRawCertData (); + if (data == null) + return null; + + var x509 = new MX.X509Certificate (data); + return new X509CertificateImplMono (x509); + } + + public static bool IsValid (X509CertificateImpl impl) + { + return impl != null && impl.IsValid; + } + + internal static void ThrowIfContextInvalid (X509CertificateImpl impl) + { + if (!IsValid (impl)) + throw GetInvalidContextException (); + } + + internal static Exception GetInvalidContextException () + { + return new CryptographicException (Locale.GetText ("Certificate instance is empty.")); + } + + internal static MX.X509Certificate ImportPkcs12 (byte[] rawData, string password) + { + var pfx = (password == null) ? new MX.PKCS12 (rawData) : new MX.PKCS12 (rawData, password); + if (pfx.Certificates.Count == 0) { + // no certificate was found + return null; + } else if (pfx.Keys.Count == 0) { + // no key were found - pick the first certificate + return pfx.Certificates [0]; + } else { + // find the certificate that match the first key + var keypair = (pfx.Keys [0] as AsymmetricAlgorithm); + string pubkey = keypair.ToXmlString (false); + foreach (var c in pfx.Certificates) { + if ((c.RSA != null) && (pubkey == c.RSA.ToXmlString (false))) + return c; + if ((c.DSA != null) && (pubkey == c.DSA.ToXmlString (false))) + return c; + } + return pfx.Certificates [0]; // no match, pick first certificate without keys + } + } + +#if !MONOTOUCH && !XAMMAC + public static X509CertificateImpl Import (byte[] rawData, string password, X509KeyStorageFlags keyStorageFlags) + { + MX.X509Certificate x509; + if (password == null) { + try { + x509 = new MX.X509Certificate (rawData); + } catch (Exception e) { + try { + x509 = ImportPkcs12 (rawData, null); + } catch { + string msg = Locale.GetText ("Unable to decode certificate."); + // inner exception is the original (not second) exception + throw new CryptographicException (msg, e); + } + } + } else { + // try PKCS#12 + try { + x509 = ImportPkcs12 (rawData, password); + } + catch { + // it's possible to supply a (unrequired/unusued) password + // fix bug #79028 + x509 = new MX.X509Certificate (rawData); + } + } + + return new X509CertificateImplMono (x509); + } +#endif + + public static byte[] Export (X509CertificateImpl impl, X509ContentType contentType, byte[] password) + { + ThrowIfContextInvalid (impl); + return impl.Export (contentType, password); + } + + public static bool Equals (X509CertificateImpl first, X509CertificateImpl second) + { + if (!IsValid (first) || !IsValid (second)) + return false; + + bool result; + if (first.Equals (second, out result)) + return result; + + var firstRaw = first.GetRawCertData (); + var secondRaw = second.GetRawCertData (); + + if (firstRaw == null) + return secondRaw == null; + else if (secondRaw == null) + return false; + + if (firstRaw.Length != secondRaw.Length) + return false; + + for (int i = 0; i < firstRaw.Length; i++) { + if (firstRaw [i] != secondRaw [i]) + return false; + } + + return true; + } + + // almost every byte[] returning function has a string equivalent + // sadly the BitConverter insert dash between bytes :-( + public static string ToHexString (byte[] data) + { + if (data != null) { + StringBuilder sb = new StringBuilder (); + for (int i = 0; i < data.Length; i++) + sb.Append (data[i].ToString ("X2")); + return sb.ToString (); + } + else + return null; + } + } +} diff --git a/mcs/class/corlib/System.Threading/Thread.cs b/mcs/class/corlib/System.Threading/Thread.cs index a2e3f5b685d..7dcb5431760 100644 --- a/mcs/class/corlib/System.Threading/Thread.cs +++ b/mcs/class/corlib/System.Threading/Thread.cs @@ -489,6 +489,24 @@ namespace System.Threading { void ClearAbortReason () { } +#else + [Obsolete ("Thread.Abort is not supported on the current platform.", true)] + public void Abort () + { + throw new PlatformNotSupportedException ("Thread.Abort is not supported on the current platform."); + } + + [Obsolete ("Thread.Abort is not supported on the current platform.", true)] + public void Abort (object stateInfo) + { + throw new PlatformNotSupportedException ("Thread.Abort is not supported on the current platform."); + } + + [Obsolete ("Thread.ResetAbort is not supported on the current platform.", true)] + public static void ResetAbort () + { + throw new PlatformNotSupportedException ("Thread.ResetAbort is not supported on the current platform."); + } #endif // MONO_FEATURE_THREAD_ABORT [MethodImplAttribute (MethodImplOptions.InternalCall)] @@ -724,5 +742,19 @@ namespace System.Threading { res [threads [i]] = new StackTrace ((StackFrame[])stack_frames [i]); return res; } + +#if !MONO_FEATURE_THREAD_SUSPEND_RESUME + [Obsolete ("Thread.Suspend is not supported on the current platform.", true)] + public void Suspend () + { + throw new PlatformNotSupportedException ("Thread.Suspend is not supported on the current platform."); + } + + [Obsolete ("Thread.Resume is not supported on the current platform.", true)] + public void Resume () + { + throw new PlatformNotSupportedException ("Thread.Resume is not supported on the current platform."); + } +#endif } } diff --git a/mcs/class/corlib/System/Delegate.cs b/mcs/class/corlib/System/Delegate.cs index 91eecdccb93..3f655565594 100644 --- a/mcs/class/corlib/System/Delegate.cs +++ b/mcs/class/corlib/System/Delegate.cs @@ -102,17 +102,7 @@ namespace System public MethodInfo Method { get { - if (method_info != null) { - return method_info; - } else { - if (method != IntPtr.Zero) { - if (!method_is_virtual) - method_info = (MethodInfo)MethodBase.GetMethodFromHandleNoGenericCheck (new RuntimeMethodHandle (method)); - else - method_info = GetVirtualMethod_internal (); - } - return method_info; - } + return GetMethodImpl (); } } @@ -511,7 +501,17 @@ namespace System protected virtual MethodInfo GetMethodImpl () { - return Method; + if (method_info != null) { + return method_info; + } else { + if (method != IntPtr.Zero) { + if (!method_is_virtual) + method_info = (MethodInfo)MethodBase.GetMethodFromHandleNoGenericCheck (new RuntimeMethodHandle (method)); + else + method_info = GetVirtualMethod_internal (); + } + return method_info; + } } // This is from ISerializable diff --git a/mcs/class/corlib/System/MulticastDelegate.cs b/mcs/class/corlib/System/MulticastDelegate.cs index 795593d28ce..6a67652037b 100644 --- a/mcs/class/corlib/System/MulticastDelegate.cs +++ b/mcs/class/corlib/System/MulticastDelegate.cs @@ -33,6 +33,7 @@ using System.Collections; using System.Collections.Generic; +using System.Reflection; using System.Runtime.Serialization; using System.Runtime.InteropServices; @@ -125,6 +126,14 @@ namespace System return base.GetHashCode (); } + protected override MethodInfo GetMethodImpl () + { + if (delegates != null) + return delegates [delegates.Length - 1].Method; + + return base.GetMethodImpl (); + } + // // Return, in order of invocation, the invocation list // of a MulticastDelegate @@ -174,6 +183,32 @@ namespace System return ret; } + /* Based on the Boyer–Moore string search algorithm */ + int LastIndexOf (Delegate[] haystack, Delegate[] needle) + { + if (haystack.Length < needle.Length) + return -1; + + if (haystack.Length == needle.Length) { + for (int i = 0; i < haystack.Length; ++i) + if (!haystack [i].Equals (needle [i])) + return -1; + + return 0; + } + + for (int i = haystack.Length - needle.Length, j; i >= 0;) { + for (j = 0; needle [j].Equals (haystack [i]); ++i, ++j) { + if (j == needle.Length - 1) + return i - j; + } + + i -= j + 1; + } + + return -1; + } + protected sealed override Delegate RemoveImpl (Delegate value) { if (value == null) @@ -214,42 +249,23 @@ namespace System return ret; } else { /* wild case : remove MulticastDelegate from MulticastDelegate - * complexity is O(m * n), with n the number of elements in + * complexity is O(m + n), with n the number of elements in * this.delegates and m the number of elements in other.delegates */ - MulticastDelegate ret = AllocDelegateLike_internal (this); - ret.delegates = new Delegate [delegates.Length]; - - /* we should use a set with O(1) lookup complexity - * but HashSet is implemented in System.Core.dll */ - List other_delegates = new List (); - for (int i = 0; i < other.delegates.Length; ++i) - other_delegates.Add (other.delegates [i]); - int idx = delegates.Length; + if (delegates.Equals (other.delegates)) + return null; /* we need to remove elements from the end to the beginning, as * the addition and removal of delegates behaves like a stack */ - for (int i = delegates.Length - 1; i >= 0; --i) { - /* if delegates[i] is not in other_delegates, - * then we can safely add it to ret.delegates - * otherwise we remove it from other_delegates */ - if (!other_delegates.Remove (delegates [i])) - ret.delegates [--idx] = delegates [i]; - } - - /* the elements are at the end of the array, we - * need to move them back to the beginning of it */ - int count = delegates.Length - idx; - Array.Copy (ret.delegates, idx, ret.delegates, 0, count); - - if (count == 0) - return null; + int idx = LastIndexOf (delegates, other.delegates); + if (idx == -1) + return this; - if (count == 1) - return ret.delegates [0]; + MulticastDelegate ret = AllocDelegateLike_internal (this); + ret.delegates = new Delegate [delegates.Length - other.delegates.Length]; - if (count != delegates.Length) - Array.Resize (ref ret.delegates, count); + Array.Copy (delegates, ret.delegates, idx); + Array.Copy (delegates, idx + other.delegates.Length, ret.delegates, idx, delegates.Length - idx - other.delegates.Length); return ret; } diff --git a/mcs/class/corlib/Test/System.Reflection/MethodInfoTest.cs b/mcs/class/corlib/Test/System.Reflection/MethodInfoTest.cs index b8a9de2b3c5..71119b1673a 100644 --- a/mcs/class/corlib/Test/System.Reflection/MethodInfoTest.cs +++ b/mcs/class/corlib/Test/System.Reflection/MethodInfoTest.cs @@ -3,9 +3,11 @@ // // Authors: // Zoltan Varga (vargaz@gmail.com) +// Aleksey Kliger (aleksey@xamarin.com) // // (c) 2003 Ximian, Inc. (http://www.ximian.com) // Copyright (C) 2004 Novell, Inc (http://www.novell.com) +// Copyright (C) 2015 Xamarin, Inc. (http://www.xamarin.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the @@ -52,7 +54,12 @@ namespace MonoTests.System.Reflection [TestFixture] public class MethodInfoTest { +#if MONOTOUCH + // use an existing symbol - so we can build without dlsym. It does not matter that the signature does not match for the test + [DllImport ("libc", EntryPoint="readlink", CharSet=CharSet.Unicode, ExactSpelling=false, PreserveSig=true, SetLastError=true, BestFitMapping=true, ThrowOnUnmappableChar=true)] +#else [DllImport ("libfoo", EntryPoint="foo", CharSet=CharSet.Unicode, ExactSpelling=false, PreserveSig=true, SetLastError=true, BestFitMapping=true, ThrowOnUnmappableChar=true)] +#endif public static extern void dllImportMethod (); [MethodImplAttribute(MethodImplOptions.PreserveSig)] public void preserveSigMethod () @@ -108,8 +115,13 @@ namespace MonoTests.System.Reflection DllImportAttribute attr = (DllImportAttribute)((t.GetMethod ("dllImportMethod").GetCustomAttributes (typeof (DllImportAttribute), true)) [0]); Assert.AreEqual (CallingConvention.Winapi, attr.CallingConvention, "#1"); +#if MONOTOUCH + Assert.AreEqual ("readlink", attr.EntryPoint, "#2"); + Assert.AreEqual ("libc", attr.Value, "#3"); +#else Assert.AreEqual ("foo", attr.EntryPoint, "#2"); Assert.AreEqual ("libfoo", attr.Value, "#3"); +#endif Assert.AreEqual (CharSet.Unicode, attr.CharSet, "#4"); Assert.AreEqual (false, attr.ExactSpelling, "#5"); Assert.AreEqual (true, attr.PreserveSig, "#6"); @@ -283,6 +295,35 @@ namespace MonoTests.System.Reflection Assert.AreEqual (typeof (GBD_D), typeof (GBD_E).GetMethod ("f").GetBaseDefinition ().DeclaringType); } + class GenericBase { + public virtual void f2 () { } + } + + class GenericMid : GenericBase> { + public virtual T f1 () { return default (T); } + } + + class GenericChild : GenericMid { + public override T f1 () { return default (T); } + public override void f2 () { } + } + + [Test] + public void GetBaseDefinition_OpenConstructedBaseType () // 36305 + { + var t = typeof (GenericChild); + + var mi1 = t.GetMethod ("f1"); + var mi1_base = mi1.GetBaseDefinition (); + + Assert.AreEqual (typeof (GenericMid), mi1_base.DeclaringType, "#1"); + + var mi2 = t.GetMethod ("f2"); + var mi2_base = mi2.GetBaseDefinition (); + + Assert.AreEqual (typeof (GenericBase>), mi2_base.DeclaringType, "#2"); + } + class TestInheritedMethodA { private void TestMethod () { diff --git a/mcs/class/corlib/Test/System.Runtime.InteropServices/MarshalTest.cs b/mcs/class/corlib/Test/System.Runtime.InteropServices/MarshalTest.cs index 92675b00f7c..4c38e08ed56 100644 --- a/mcs/class/corlib/Test/System.Runtime.InteropServices/MarshalTest.cs +++ b/mcs/class/corlib/Test/System.Runtime.InteropServices/MarshalTest.cs @@ -805,6 +805,7 @@ namespace MonoTests.System.Runtime.InteropServices } } +#if !MOBILE [DllImport ("kernel32.dll", SetLastError = true)] [PreserveSig] static extern uint GetModuleFileName ( @@ -816,6 +817,7 @@ namespace MonoTests.System.Runtime.InteropServices [MarshalAs (UnmanagedType.U4)] int nSize ); +#endif } #if !NET_2_1 [ComImport()] diff --git a/mcs/class/corlib/Test/System.Security.Cryptography.X509Certificates/X509CapiTest.cs b/mcs/class/corlib/Test/System.Security.Cryptography.X509Certificates/X509CapiTest.cs index 50dfe0e157d..328bbb54a50 100644 --- a/mcs/class/corlib/Test/System.Security.Cryptography.X509Certificates/X509CapiTest.cs +++ b/mcs/class/corlib/Test/System.Security.Cryptography.X509Certificates/X509CapiTest.cs @@ -72,6 +72,7 @@ namespace MonoTests.System.Security.Cryptography.X509Certificates { File.Delete("temp.b64"); } +#if !MOBILE public IntPtr GetHandleEx (byte[] certificate) { CertificateContext cc = new CertificateContext (); @@ -151,6 +152,7 @@ namespace MonoTests.System.Security.Cryptography.X509Certificates { Assert.AreEqual (serial, x509.GetSerialNumber (), "GetSerialNumber"); Assert.AreEqual ("02720006E8", x509.GetSerialNumberString (), "GetSerialNumberString"); } +#endif [Test] [ExpectedException (typeof (ArgumentException))] diff --git a/mcs/class/corlib/Test/System.Threading/ThreadPoolTest.cs b/mcs/class/corlib/Test/System.Threading/ThreadPoolTest.cs index 888b90c9b41..98c939312ea 100644 --- a/mcs/class/corlib/Test/System.Threading/ThreadPoolTest.cs +++ b/mcs/class/corlib/Test/System.Threading/ThreadPoolTest.cs @@ -35,6 +35,25 @@ namespace MonoTests.System.Threading [TestFixture] public class ThreadPoolTests { + int minWorkerThreads; + int minCompletionPortThreads; + int maxWorkerThreads; + int maxCompletionPortThreads; + + [SetUp] + public void SetUp () + { + ThreadPool.GetMinThreads (out minWorkerThreads, out minCompletionPortThreads); + ThreadPool.GetMaxThreads (out maxWorkerThreads, out maxCompletionPortThreads); + } + + [TearDown] + public void TearDown () + { + ThreadPool.SetMinThreads (minWorkerThreads, minCompletionPortThreads); + ThreadPool.SetMaxThreads (maxWorkerThreads, maxCompletionPortThreads); + } + [Test] public void RegisterWaitForSingleObject_InvalidArguments () { @@ -97,5 +116,87 @@ namespace MonoTests.System.Threading ThreadPool.UnsafeQueueUserWorkItem (e, null); Assert.IsTrue (ev.Wait (3000)); } + + [Test] + public void SetAndGetMinThreads () + { + int workerThreads, completionPortThreads; + int workerThreads_new, completionPortThreads_new; + + ThreadPool.GetMinThreads (out workerThreads, out completionPortThreads); + Assert.IsTrue (workerThreads > 0, "#1"); + Assert.IsTrue (completionPortThreads > 0, "#2"); + + workerThreads_new = workerThreads == 1 ? 2 : 1; + completionPortThreads_new = completionPortThreads == 1 ? 2 : 1; + ThreadPool.SetMinThreads (workerThreads_new, completionPortThreads_new); + + ThreadPool.GetMinThreads (out workerThreads, out completionPortThreads); + Assert.IsTrue (workerThreads == workerThreads_new, "#3"); + Assert.IsTrue (completionPortThreads == completionPortThreads_new, "#4"); + } + + [Test] + public void SetAndGetMaxThreads () + { + int cpuCount = Environment.ProcessorCount; + int workerThreads, completionPortThreads; + int workerThreads_new, completionPortThreads_new; + + ThreadPool.GetMaxThreads (out workerThreads, out completionPortThreads); + Assert.IsTrue (workerThreads > 0, "#1"); + Assert.IsTrue (completionPortThreads > 0, "#2"); + + workerThreads_new = workerThreads == cpuCount ? cpuCount + 1 : cpuCount; + completionPortThreads_new = completionPortThreads == cpuCount ? cpuCount + 1 : cpuCount; + ThreadPool.SetMaxThreads (workerThreads_new, completionPortThreads_new); + + ThreadPool.GetMaxThreads (out workerThreads, out completionPortThreads); + Assert.IsTrue (workerThreads == workerThreads_new, "#3"); + Assert.IsTrue (completionPortThreads == completionPortThreads_new, "#4"); + } + + [Test] + public void GetAvailableThreads () + { + ManualResetEvent mre = new ManualResetEvent (false); + DateTime start = DateTime.Now; + int i, workerThreads, completionPortThreads; + + try { + Assert.IsTrue (ThreadPool.SetMaxThreads (Environment.ProcessorCount, Environment.ProcessorCount)); + + while (true) { + ThreadPool.GetAvailableThreads (out workerThreads, out completionPortThreads); + if (workerThreads == 0) + break; + + Console.WriteLine ("workerThreads = {0}, completionPortThreads = {1}", workerThreads, completionPortThreads); + + if ((DateTime.Now - start).TotalSeconds >= 10) + Assert.Fail ("did not reach 0 available threads"); + + ThreadPool.QueueUserWorkItem (GetAvailableThreads_Callback, mre); + Thread.Sleep (1); + } + } finally { + mre.Set (); + } + } + + void GetAvailableThreads_Callback (object state) + { + ManualResetEvent mre = (ManualResetEvent) state; + + if (mre.WaitOne (0)) + return; + + ThreadPool.QueueUserWorkItem (GetAvailableThreads_Callback, mre); + ThreadPool.QueueUserWorkItem (GetAvailableThreads_Callback, mre); + ThreadPool.QueueUserWorkItem (GetAvailableThreads_Callback, mre); + ThreadPool.QueueUserWorkItem (GetAvailableThreads_Callback, mre); + + mre.WaitOne (); + } } } \ No newline at end of file diff --git a/mcs/class/corlib/Test/System/StringComparerTest.cs b/mcs/class/corlib/Test/System/StringComparerTest.cs index ce028bc12af..97c8153bfd5 100644 --- a/mcs/class/corlib/Test/System/StringComparerTest.cs +++ b/mcs/class/corlib/Test/System/StringComparerTest.cs @@ -215,6 +215,20 @@ namespace MonoTests.System StringComparer.Ordinal.GetHashCode (null); } + [Test] + [SetCulture("en-us")] + public void OrdinarCultureSwitch () + { + var cmp1 = StringComparer.OrdinalIgnoreCase; + var h1 = cmp1.GetHashCode ("w"); + + global::System.Threading.Thread.CurrentThread.CurrentCulture = new global::System.Globalization.CultureInfo ("fi"); + + var cmp2 = StringComparer.OrdinalIgnoreCase; + var h2 = cmp2.GetHashCode ("w"); + Assert.AreEqual (h1, h2); + } + private static readonly byte [] _serializedCurrentCulture = new byte [] { 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00, diff --git a/mcs/class/corlib/Test/System/StringTest.cs b/mcs/class/corlib/Test/System/StringTest.cs index 293479eb851..7119236c8aa 100644 --- a/mcs/class/corlib/Test/System/StringTest.cs +++ b/mcs/class/corlib/Test/System/StringTest.cs @@ -92,6 +92,21 @@ public class StringTest } } + [Test] // ctor (Char, Int32) + public void Constructor4_LargeString () + { + try { + var x = new String ('A', int.MaxValue); + if (Environment.Is64BitProcess) { + Assert.AreEqual ('A', x[0]); + Assert.AreEqual ('A', x[int.MaxValue - 1]); + } + else + Assert.Fail ("Expected OutOfMemoryException."); + } catch (OutOfMemoryException) { + } + } + [Test] // ctor (Char [], Int32, Int32) public void Constructor6 () { @@ -2993,10 +3008,16 @@ public class StringTest } [Test] - public void PadLeft_Overflow () + public void PadLeft_LargeString () { try { - "x".PadLeft (int.MaxValue, '-'); + var x = "x".PadLeft (int.MaxValue, '-'); + if (Environment.Is64BitProcess) { + Assert.AreEqual ('-', x[0]); + Assert.AreEqual ('x', x[int.MaxValue - 1]); + } + else + Assert.Fail ("Expected OutOfMemoryException."); } catch (OutOfMemoryException) { } } @@ -3043,10 +3064,16 @@ public class StringTest } [Test] - public void PadRight_Overflow () + public void PadRight_LargeString () { try { - "x".PadRight (int.MaxValue, '-'); + var x = "x".PadRight (int.MaxValue, '-'); + if (Environment.Is64BitProcess) { + Assert.AreEqual ('x', x[0]); + Assert.AreEqual ('-', x[int.MaxValue - 1]); + } + else + Assert.Fail ("Expected OutOfMemoryException."); } catch (OutOfMemoryException) { } } diff --git a/mcs/class/corlib/Test/System/TypeTest.cs b/mcs/class/corlib/Test/System/TypeTest.cs index 61a71406dd6..19dbff4804c 100644 --- a/mcs/class/corlib/Test/System/TypeTest.cs +++ b/mcs/class/corlib/Test/System/TypeTest.cs @@ -212,6 +212,16 @@ namespace MonoTests.System } } + public class GenericIndexers + { + // This class has two indexers that take different + // arguments. GetProperties on all instances of this + // generic type should still have 2 properties, even + // if T and U are instantiated with the same types. + public T this[T t] { get { return t; } } + public U this[U u] { get { return u; } } + } + public class FirstMethodBinder : Binder { public override MethodBase BindToMethod (BindingFlags bindingAttr, MethodBase [] match, ref object [] args, @@ -425,8 +435,25 @@ namespace MonoTests.System public void GetProperties () { // Test hide-by-name-and-signature - Assert.AreEqual (1, typeof (Derived2).GetProperties ().Length); - Assert.AreEqual (typeof (Derived2), typeof (Derived2).GetProperties ()[0].DeclaringType); + Assert.AreEqual (1, typeof (Derived2).GetProperties ().Length, "#1"); + Assert.AreEqual (typeof (Derived2), typeof (Derived2).GetProperties ()[0].DeclaringType, "#2"); + + // For generics, hide-by-name-and-signature works on the unexpanded types. The + // GenericIndexers class has two indexers that take different arguments. + // GetProperties on all instances of this generic type should still have 2 properties, + // even if T and U are instantiated with the same types. + + var ps = typeof (GenericIndexers).GetProperties (); + Assert.AreEqual (2, ps.Length, "#3"); + for (int i = 0; i < ps.Length; i++) { + var p = ps[i]; + + var getterResultType = p.GetGetMethod ().ReturnType; + + var msg = String.Format ("#4-{0}", i); + Assert.AreEqual (typeof (int), getterResultType, msg); + } + } [Test] // GetProperties (BindingFlags) @@ -1527,6 +1554,27 @@ namespace MonoTests.System typeof (long), new Type[0], null), "#2"); } + [Test] + public void GetProperty9_Indexers () + { + + var bindingFlags = BindingFlags.Public | BindingFlags.Instance; + + Type type1 = typeof (List); + var p1 = type1.GetProperty ("Item", bindingFlags, null, typeof (byte), new Type[] { typeof (int) }, null); + Assert.IsNotNull (p1, "#1"); + + Type type2 = typeof (List); + var p2 = type2.GetProperty ("Item", bindingFlags, null, typeof (string), new Type[] { typeof (int) }, null); + Assert.IsNotNull (p2, "#2"); + + Type type3 = typeof (List); + // result type not convertible, make sure we fail. + var p3 = type3.GetProperty ("Item", bindingFlags, null, typeof (string) /*!*/, + new Type[] { typeof (int) }, null); + Assert.IsNull (p3, "#3"); + } + [StructLayout(LayoutKind.Explicit, Pack = 4, Size = 64)] public class Class1 { diff --git a/mcs/class/corlib/corlib-net_4_5.csproj b/mcs/class/corlib/corlib-net_4_5.csproj deleted file mode 100644 index 82e3ed5bab2..00000000000 --- a/mcs/class/corlib/corlib-net_4_5.csproj +++ /dev/null @@ -1,1645 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - Library - 612,618,1699 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - mscorlib - v4.5 - 512 - - - - true - full - 612,618,1699 - false - DEBUG;TRACE;INSIDE_CORLIB;MONO_CULTURE_DATA;LIBC;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY - prompt - 4 - - - pdbonly - 612,618,1699 - true - INSIDE_CORLIB;MONO_CULTURE_DATA;LIBC;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - charinfo.nlp - - - collation.core.bin - - - collation.tailoring.bin - - - collation.cjkCHS.bin - - - collation.cjkCHT.bin - - - collation.cjkJA.bin - - - collation.cjkKO.bin - - - collation.cjkKOlv2.bin - - - - diff --git a/mcs/class/corlib/corlib-net_4_x.csproj b/mcs/class/corlib/corlib-net_4_x.csproj index 201dd817e1d..ddb4b98b3e0 100644 --- a/mcs/class/corlib/corlib-net_4_x.csproj +++ b/mcs/class/corlib/corlib-net_4_x.csproj @@ -25,7 +25,7 @@ full 612,618,1635,1699 false - TRACE;INSIDE_CORLIB;MONO_CULTURE_DATA;LIBC;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY + TRACE;INSIDE_CORLIB;MONO_CULTURE_DATA;LIBC;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME prompt 4 @@ -33,7 +33,7 @@ pdbonly 612,618,1635,1699 true - INSIDE_CORLIB;MONO_CULTURE_DATA;LIBC;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY + INSIDE_CORLIB;MONO_CULTURE_DATA;LIBC;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME prompt 4 @@ -184,6 +184,7 @@ + @@ -294,6 +295,7 @@ + @@ -498,6 +500,7 @@ + @@ -526,6 +529,7 @@ + @@ -550,10 +554,14 @@ + + + + @@ -627,6 +635,7 @@ + @@ -765,6 +774,7 @@ + diff --git a/mcs/class/corlib/corlib-tests-net_4_5.csproj b/mcs/class/corlib/corlib-tests-net_4_5.csproj deleted file mode 100644 index 075795984d4..00000000000 --- a/mcs/class/corlib/corlib-tests-net_4_5.csproj +++ /dev/null @@ -1,588 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DCF26FDD-81D3-463B-B80D-3111DDFFE2D5} - Library - 612,618,1699,168,219,618,672 - bin\Debug\corlib-tests-net_4_5 - True - False - true - Properties - - - corlib_test_net_4_5 - v4.5 - 512 - - - true - full - 612,618,1699,168,219,618,672 - false - DEBUG;TRACE;INSIDE_CORLIB;LIBC;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;MONO_DATACONVERTER_STATIC_METHODS - prompt - 4 - - - pdbonly - 612,618,1699,168,219,618,672 - true - INSIDE_CORLIB;LIBC;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;MONO_DATACONVERTER_STATIC_METHODS - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {E9A655D1-EE99-467A-8F4B-CAC80E0E65BE} - Mono.Posix\Mono.Posix-net_4_0 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - - - - - - Resources.resources - - - - diff --git a/mcs/class/corlib/corlib.dll.sources b/mcs/class/corlib/corlib.dll.sources index 136fc0b6312..89f9fc965b4 100644 --- a/mcs/class/corlib/corlib.dll.sources +++ b/mcs/class/corlib/corlib.dll.sources @@ -732,6 +732,9 @@ System.Security.Cryptography/SHA1CryptoServiceProvider.cs System.Security.Cryptography/TripleDESCryptoServiceProvider.cs System.Security.Cryptography.X509Certificates/X509Certificate.cs System.Security.Cryptography.X509Certificates/X509Certificate20.cs +System.Security.Cryptography.X509Certificates/X509CertificateImpl.cs +System.Security.Cryptography.X509Certificates/X509CertificateImplMono.cs +System.Security.Cryptography.X509Certificates/X509Helper.cs System.Security.Cryptography.X509Certificates/X509ContentType.cs System.Security.Cryptography.X509Certificates/X509KeyStorageFlags.cs System.Security.Permissions/CodeAccessSecurityAttribute.cs diff --git a/mcs/class/monodoc/monodoc-net_4_5.csproj b/mcs/class/monodoc/monodoc-net_4_5.csproj deleted file mode 100644 index d228f88b846..00000000000 --- a/mcs/class/monodoc/monodoc-net_4_5.csproj +++ /dev/null @@ -1,759 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {141D4A4E-C16C-4FF6-9E35-54AF58BE6080} - Library - 618,612,672,809,1699,169,164,162,168,219,618,612 - ./../../class/lib/net_4_5 - True - True - true - Properties - - - monodoc - v4.5 - 512 - - - - true - full - 618,612,672,809,1699,169,164,162,168,219,618,612 - false - DEBUG;TRACE;LEGACY_MODE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - pdbonly - 618,612,672,809,1699,169,164,162,168,219,618,612 - true - LEGACY_MODE;NET_4_0;NET_4_5;MONO;DISABLE_CAS_USE - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {0B587DBA-BA92-4B92-821A-AA200C612A7E} - ICSharpCode.SharpZipLib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - {2951DEC2-4393-4A78-83F9-42EB39CB708F} - System.Xml-net_4_5 - - - {8328796E-8A15-4972-8F1E-2F15E7D57C42} - System.Xml.Linq-net_4_5 - - - {D52A2CEA-245E-4877-950E-3EAC5F541B8E} - System.Configuration-net_4_5 - - - - - - - - monodoc.xml - - - base.css - - - ecmaspec-html-css.xsl - - - ecmaspec-html.xsl - - - ecmaspec.css - - - helper.js - - - home.html - - - Lminus.gif - - - Lplus.gif - - - creativecommons.png - - - mdoc-html-format.xsl - - - mdoc-html-utils.xsl - - - mdoc-sections-css.xsl - - - mdoc-sections.xsl - - - mono-ecma-css.xsl - - - mono-ecma-impl.xsl - - - mono-ecma.css - - - mono-ecma.xsl - - - toc-html.xsl - - - bc_bg.png - - - bc_separator.png - - - error.png - - - hatch.png - - - headerbg.png - - - help.png - - - house.png - - - members.png - - - namespace.png - - - privclass.png - - - privdelegate.png - - - privenumeration.png - - - privevent.png - - - privextension.png - - - privfield.png - - - privinterface.png - - - privmethod.png - - - privproperty.png - - - privstructure.png - - - protclass.png - - - protdelegate.png - - - protenumeration.png - - - protevent.png - - - protextension.png - - - protfield.png - - - protinterface.png - - - protmethod.png - - - protproperty.png - - - protstructure.png - - - pubclass.png - - - pubdelegate.png - - - pubenumeration.png - - - pubevent.png - - - pubextension.png - - - pubfield.png - - - pubinterface.png - - - pubmethod.png - - - pubproperty.png - - - pubstructure.png - - - reference.png - - - treebg.png - - - - diff --git a/mcs/class/monodoc/monodoc-tests-net_4_5.csproj b/mcs/class/monodoc/monodoc-tests-net_4_5.csproj deleted file mode 100644 index 33d3f5abd74..00000000000 --- a/mcs/class/monodoc/monodoc-tests-net_4_5.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {57ABF26A-1779-4FFD-85BB-79F5DBDA2AA6} - Library - 618,612,672,809,1699 - bin\Debug\monodoc-tests-net_4_5 - True - False - - Properties - - - monodoc_test_net_4_5 - v4.5 - 512 - - - true - full - 618,612,672,809,1699 - false - DEBUG;TRACE;LEGACY_MODE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - pdbonly - 618,612,672,809,1699 - true - LEGACY_MODE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib\corlib-net_4_5 - - - {141D4A4E-C16C-4FF6-9E35-54AF58BE6080} - monodoc\monodoc-net_4_5 - - - {5C605B73-19DA-4FB7-AB39-C7EF9A8B19FE} - System\System-net_4_5-2 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core\System.Core-net_4_5 - - - {2534ADE0-05E4-490F-933D-1E39310A0CB9} - System.XML\System.Xml-net_4_5-1 - - - - - - - diff --git a/mcs/docs/Makefile b/mcs/docs/Makefile index b808123cbac..88bddb66268 100644 --- a/mcs/docs/Makefile +++ b/mcs/docs/Makefile @@ -85,12 +85,17 @@ NETDOCS_DIRS = \ $(classdir)/System.Design/$(doc_en) \ $(classdir)/System.DirectoryServices/$(doc_en) \ $(classdir)/System.Drawing/$(doc_en) \ + $(classdir)/System.Json/$(doc_en) \ + $(classdir)/System.Net.Http/$(doc_en) \ $(classdir)/System.Runtime.Remoting/$(doc_en) \ + $(classdir)/System.Runtime.Serialization/$(doc_en) \ $(classdir)/System.Runtime.Serialization.Formatters.Soap/$(doc_en) \ $(classdir)/System.Security/$(doc_en) \ + $(classdir)/System.ServiceModel/$(doc_en) \ $(classdir)/System.Web.Services/$(doc_en) \ $(classdir)/System.Web/$(doc_en) \ $(classdir)/System.XML/$(doc_en) \ + $(classdir)/System.Xml.Linq/$(doc_en) \ $(classdir)/System/$(doc_en) MONO_DIRS = \ diff --git a/mcs/mcs/Makefile b/mcs/mcs/Makefile index ef4f3e3c917..8b93d720fa1 100644 --- a/mcs/mcs/Makefile +++ b/mcs/mcs/Makefile @@ -30,6 +30,10 @@ ifndef NO_THREAD_ABORT REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_THREAD_ABORT endif +ifndef NO_PROCESS_START +REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_PROCESS_START +endif + LOCAL_MCS_FLAGS += $(REFERENCE_SOURCES_FLAGS) PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/4.5 diff --git a/mcs/mcs/driver.cs b/mcs/mcs/driver.cs index 994fdb8afd5..0a11914328a 100644 --- a/mcs/mcs/driver.cs +++ b/mcs/mcs/driver.cs @@ -201,6 +201,7 @@ namespace Mono.CSharp public static string GetPackageFlags (string packages, Report report) { +#if MONO_FEATURE_PROCESS_START ProcessStartInfo pi = new ProcessStartInfo (); pi.FileName = "pkg-config"; pi.RedirectStandardOutput = true; @@ -239,6 +240,9 @@ namespace Mono.CSharp p.Close (); return pkgout; +#else + throw new NotSupportedException ("Process.Start is not supported on this platform."); +#endif // MONO_FEATURE_PROCESS_START } // diff --git a/mcs/mcs/ecore.cs b/mcs/mcs/ecore.cs index ab1d51dbbc9..08bce8a9d70 100644 --- a/mcs/mcs/ecore.cs +++ b/mcs/mcs/ecore.cs @@ -4740,6 +4740,7 @@ namespace Mono.CSharp { // // We have not reached end of parameters list due to params or used default parameters // + bool defaults_ambiguity = false; while (j < candidate_pd.Count && j < best_pd.Count) { var cand_param = candidate_pd.FixedParameters [j]; var best_param = best_pd.FixedParameters [j]; @@ -4747,6 +4748,7 @@ namespace Mono.CSharp { if (cand_param.HasDefaultValue != best_param.HasDefaultValue) return cand_param.HasDefaultValue; + defaults_ambiguity = true; if (candidate_pd.Count == best_pd.Count) { // // LAMESPEC: @@ -4754,27 +4756,30 @@ namespace Mono.CSharp { // void Foo (int i = 0) is better than void Foo (params int[]) for Foo () // void Foo (string[] s, string value = null) is better than Foo (string s, params string[]) for Foo (null) or Foo () // - if (cand_param.HasDefaultValue) { ++j; continue; } - } else { - // - // Neither is better when not all arguments are provided - // - // void Foo (string s, int i = 0) <-> Foo (string s, int i = 0, int i2 = 0) - // void Foo (string s, int i = 0) <-> Foo (string s, byte i = 0) - // void Foo (string s, params int[]) <-> Foo (string s, params byte[]) - // - return false; + + break; } - break; + // + // Neither is better when not all arguments are provided + // + // void Foo (string s, int i = 0) <-> Foo (string s, int i = 0, int i2 = 0) + // void Foo (string s, int i = 0) <-> Foo (string s, byte i = 0) + // void Foo (string s, params int[]) <-> Foo (string s, params byte[]) + // + ++j; } - if (candidate_pd.Count != best_pd.Count) + if (candidate_pd.Count != best_pd.Count) { + if (defaults_ambiguity && best_pd.Count - 1 == j) + return best_pd.HasParams; + return candidate_pd.Count < best_pd.Count; + } // // One is a non-generic method and second is a generic method, then non-generic is better diff --git a/mcs/mcs/expression.cs b/mcs/mcs/expression.cs index 53e1f1b707b..5192cc102a3 100644 --- a/mcs/mcs/expression.cs +++ b/mcs/mcs/expression.cs @@ -101,33 +101,17 @@ namespace Mono.CSharp public class ParenthesizedExpression : ShimExpression { - bool conditional_access_receiver; - public ParenthesizedExpression (Expression expr, Location loc) : base (expr) { this.loc = loc; } - void ResolveConditionalAccessReceiver (ResolveContext rc) - { - if (!rc.HasSet (ResolveContext.Options.DontSetConditionalAccessReceiver) && expr.HasConditionalAccess ()) { - conditional_access_receiver = true; - } - } - protected override Expression DoResolve (ResolveContext rc) { Expression res = null; - ResolveConditionalAccessReceiver (rc); - if (conditional_access_receiver) { - using (rc.Set (ResolveContext.Options.DontSetConditionalAccessReceiver)) { - res = expr.Resolve (rc); - } - } else { - res = expr.Resolve (rc); - } + res = expr.Resolve (rc); var constant = res as Constant; if (constant != null && constant.IsLiteral) { @@ -137,13 +121,6 @@ namespace Mono.CSharp return Constant.CreateConstantFromValue (res.Type, constant.GetValue (), expr.Location); } - if (conditional_access_receiver) { - expr = res; - type = LiftMemberType (rc, res.Type); - eclass = expr.eclass; - return this; - } - return res; } @@ -157,18 +134,6 @@ namespace Mono.CSharp return visitor.Visit (this); } - public override void Emit (EmitContext ec) - { - if (!conditional_access_receiver) - base.Emit (ec); - - var prev = ec.ConditionalAccess; - ec.ConditionalAccess = new ConditionalAccessContext (type, ec.DefineLabel ()); - expr.Emit (ec); - ec.CloseConditionalAccess (type.IsNullableType ? type : null); - ec.ConditionalAccess = prev; - } - public override bool HasConditionalAccess () { return false; @@ -2953,11 +2918,11 @@ namespace Mono.CSharp } lifted.Left = b.left.IsNull ? - b.left : + Nullable.LiftedNull.Create (ltype, b.left.Location) : Convert.ImplicitConversion (rc, lifted.UnwrapLeft ?? b.left, ltype, b.left.Location); lifted.Right = b.right.IsNull ? - b.right : + Nullable.LiftedNull.Create (rtype, b.right.Location) : Convert.ImplicitConversion (rc, lifted.UnwrapRight ?? b.right, rtype, b.right.Location); return lifted.Resolve (rc); @@ -6048,16 +6013,19 @@ namespace Mono.CSharp } right.Emit (ec); - switch (rtype.BuiltinType) { - case BuiltinTypeSpec.Type.SByte: - case BuiltinTypeSpec.Type.Byte: - case BuiltinTypeSpec.Type.Short: - case BuiltinTypeSpec.Type.UShort: - ec.Emit (OpCodes.Conv_I); - break; - case BuiltinTypeSpec.Type.UInt: - ec.Emit (OpCodes.Conv_U); - break; + if (right_const == null) { + switch (rtype.BuiltinType) { + case BuiltinTypeSpec.Type.SByte: + case BuiltinTypeSpec.Type.Byte: + case BuiltinTypeSpec.Type.Short: + case BuiltinTypeSpec.Type.UShort: + case BuiltinTypeSpec.Type.Int: + ec.Emit (OpCodes.Conv_I); + break; + case BuiltinTypeSpec.Type.UInt: + ec.Emit (OpCodes.Conv_U); + break; + } } if (right_const == null && size != 1){ @@ -12598,6 +12566,15 @@ namespace Mono.CSharp ca.Emit (ec, best, arguments, loc); } + public override void FlowAnalysis (FlowAnalysisContext fc) + { + if (interpolations != null) { + foreach (var expr in interpolations) { + expr.FlowAnalysis (fc); + } + } + } + MethodSpec ResolveBestFormatOverload (ResolveContext rc) { var members = MemberCache.FindMembers (rc.BuiltinTypes.String, "Format", true); @@ -12637,6 +12614,11 @@ namespace Mono.CSharp return Convert.ImplicitConversionRequired (rc, expr, rc.BuiltinTypes.Object, expr.Location); } + public override void FlowAnalysis (FlowAnalysisContext fc) + { + Child.FlowAnalysis (fc); + } + public int? ResolveAligment (ResolveContext rc) { var c = Alignment.ResolveLabelConstant (rc); diff --git a/mcs/mcs/nullable.cs b/mcs/mcs/nullable.cs index 210f5cb8ca6..dbfc6b0648d 100644 --- a/mcs/mcs/nullable.cs +++ b/mcs/mcs/nullable.cs @@ -795,7 +795,7 @@ namespace Mono.CSharp.Nullable // // Both operands are bool? types // - if (UnwrapLeft != null && UnwrapRight != null) { + if ((UnwrapLeft != null && !Left.IsNull) && (UnwrapRight != null && !Right.IsNull)) { if (ec.HasSet (BuilderContext.Options.AsyncBody) && Binary.Right.ContainsEmitWithAwait ()) { Left = Left.EmitToField (ec); Right = Right.EmitToField (ec); @@ -861,6 +861,8 @@ namespace Mono.CSharp.Nullable LiftedNull.Create (type, loc).Emit (ec); } else { Left.Emit (ec); + UnwrapRight.Store (ec); + ec.Emit (or ? OpCodes.Brfalse_S : OpCodes.Brtrue_S, load_right); ec.EmitInt (or ? 1 : 0); @@ -869,7 +871,7 @@ namespace Mono.CSharp.Nullable ec.Emit (OpCodes.Br_S, end_label); ec.MarkLabel (load_right); - UnwrapRight.Original.Emit (ec); + UnwrapRight.Load (ec); } } else { // @@ -897,14 +899,14 @@ namespace Mono.CSharp.Nullable LiftedNull.Create (type, loc).Emit (ec); } else { Right.Emit (ec); - ec.Emit (or ? OpCodes.Brfalse_S : OpCodes.Brtrue_S, load_right); + ec.Emit (or ? OpCodes.Brfalse_S : OpCodes.Brtrue_S, load_left); ec.EmitInt (or ? 1 : 0); ec.Emit (OpCodes.Newobj, NullableInfo.GetConstructor (type)); ec.Emit (OpCodes.Br_S, end_label); - ec.MarkLabel (load_right); + ec.MarkLabel (load_left); UnwrapLeft.Load (ec); } @@ -1073,6 +1075,7 @@ namespace Mono.CSharp.Nullable { Expression left, right; Unwrap unwrap; + bool user_conversion_left; public NullCoalescingOperator (Expression left, Expression right) { @@ -1220,6 +1223,7 @@ namespace Mono.CSharp.Nullable return ReducedExpression.Create (right, this, false).Resolve (ec); left = Convert.ImplicitConversion (ec, unwrap ?? left, rtype, loc); + user_conversion_left = left is UserCast; type = rtype; return this; } @@ -1283,10 +1287,14 @@ namespace Mono.CSharp.Nullable // Null check is done on original expression not after expression is converted to // result type. This is in most cases same but when user conversion is involved // we can end up in situation when user operator does the null handling which is - // not what the operator is supposed to do + // not what the operator is supposed to do. + // There is tricky case where cast of left expression is meant to be cast of + // whole source expression (null check is done on it) and cast from right-to-left + // conversion needs to do null check on unconverted source expression. // - var op_expr = left as UserCast; - if (op_expr != null) { + if (user_conversion_left) { + var op_expr = (UserCast) left; + op_expr.Source.Emit (ec); LocalTemporary temp; diff --git a/mcs/nunit24/ConsoleRunner/nunit-console/ConsoleUi.cs b/mcs/nunit24/ConsoleRunner/nunit-console/ConsoleUi.cs index e89d705e83c..072b1efc9c1 100644 --- a/mcs/nunit24/ConsoleRunner/nunit-console/ConsoleUi.cs +++ b/mcs/nunit24/ConsoleRunner/nunit-console/ConsoleUi.cs @@ -158,7 +158,7 @@ namespace NUnit.ConsoleRunner //if ( testRunner != null ) // testRunner.Unload(); - if ( collector.HasExceptions ) + if ( result == null || collector.HasExceptions ) { collector.WriteExceptions(); return UNEXPECTED_ERROR; diff --git a/mcs/tests/gtest-540.cs b/mcs/tests/gtest-540.cs index 7596032d16f..61c94270ef5 100644 --- a/mcs/tests/gtest-540.cs +++ b/mcs/tests/gtest-540.cs @@ -85,6 +85,19 @@ class C if ((true | a) != true) return 65; + + var b4 = true; + if ((b4 & null) != null) + return 100; + + if ((null & b4) != null) + return 101; + + if ((b4 | null) != true) + return 102; + + if ((null | b4) != true) + return 103; return 0; } diff --git a/mcs/tests/gtest-636.cs b/mcs/tests/gtest-636.cs new file mode 100644 index 00000000000..9c44fdf69a9 --- /dev/null +++ b/mcs/tests/gtest-636.cs @@ -0,0 +1,37 @@ +using System; + +class MainClass +{ + public static int Main () + { + var res = XX () | YY(); + if (!res.Value) + return 1; + + if (xx != 1) + return 2; + + if (yy != 1) + return 2; + + return 0; + } + + static int xx; + static bool XX () + { + ++xx; + Console.WriteLine ("XX"); + return true; + } + + static int yy; + static bool? YY () + { + if (xx == 1) + ++yy; + + Console.WriteLine ("YY"); + return true; + } +} diff --git a/mcs/tests/test-643.cs b/mcs/tests/test-643.cs index f7204392ff0..c88ac8885e5 100644 --- a/mcs/tests/test-643.cs +++ b/mcs/tests/test-643.cs @@ -11,7 +11,10 @@ class PointerArithmeticTest } catch (System.OverflowException) {} try { - return CheckSub((short*)(-1), int.MaxValue); + if (IntPtr.Size <= 4) + return CheckSub((short*)(-1), int.MaxValue); + else + return CheckSub((short*)(-1), long.MaxValue); } catch (System.OverflowException) {} CheckSub2((short*)(-1), int.MaxValue); @@ -44,6 +47,14 @@ class PointerArithmeticTest return 102; } + unsafe static int CheckSub(short* ptr, long offset) + { + if (checked(ptr - offset < ptr)) + return 2; + + return 102; + } + unsafe static int CheckSub2(short* ptr, int offset) { short* b = ptr + offset; diff --git a/mcs/tests/test-931.cs b/mcs/tests/test-931.cs new file mode 100644 index 00000000000..7a1f7be472d --- /dev/null +++ b/mcs/tests/test-931.cs @@ -0,0 +1,20 @@ +using System; + +class MainClass +{ + public static implicit operator string (MainClass src) + { + return null; + } + + public static int Main () + { + var obj = new MainClass (); + var s = "x"; + var res = (string) obj ?? s; + if (res != "x") + return 1; + + return 0; + } +} diff --git a/mcs/tests/test-932.cs b/mcs/tests/test-932.cs new file mode 100644 index 00000000000..bd5f48e736b --- /dev/null +++ b/mcs/tests/test-932.cs @@ -0,0 +1,18 @@ +using System; + +class X +{ + static void Main () + { + new X().WriteLine("some text"); + } + + public void WriteLine(string format, ConsoleColor foreColor = ConsoleColor.White, ConsoleColor backColor = ConsoleColor.Black, params object[] args) + { + throw new ApplicationException (); + } + + public void WriteLine(string line, ConsoleColor foreColor = ConsoleColor.White, ConsoleColor backColor = ConsoleColor.Black) + { + } +} diff --git a/mcs/tests/test-async-81.cs b/mcs/tests/test-async-81.cs new file mode 100644 index 00000000000..591711c4209 --- /dev/null +++ b/mcs/tests/test-async-81.cs @@ -0,0 +1,21 @@ +using System; +using System.Threading.Tasks; + +class MainClass +{ + public static void Main () + { + new MainClass ().Foo ().Wait (); + } + + private async Task Foo() + { + await Task.Delay(1); + return 42; + } + + private async Task Bar() + { + Console.WriteLine($"Something {await Foo()}"); + } +} diff --git a/mcs/tests/test-null-operator-21.cs b/mcs/tests/test-null-operator-21.cs new file mode 100644 index 00000000000..bb4d04e2926 --- /dev/null +++ b/mcs/tests/test-null-operator-21.cs @@ -0,0 +1,17 @@ +class X +{ + public object MyChildObject; +} + +interface ISomeInterface +{ +} + +class MainClass +{ + public static void Main () + { + X myObject = null; + var x = (myObject?.MyChildObject is ISomeInterface); + } +} diff --git a/mcs/tests/ver-il-net_4_x.xml b/mcs/tests/ver-il-net_4_x.xml index 7c3e7dc6e5c..d543f197bd7 100644 --- a/mcs/tests/ver-il-net_4_x.xml +++ b/mcs/tests/ver-il-net_4_x.xml @@ -17434,7 +17434,7 @@ - 762 + 1025 7 @@ -19756,6 +19756,22 @@ + + + + 88 + + + 32 + + + 48 + + + 7 + + + @@ -23832,7 +23848,7 @@ - 42 + 43 17 @@ -40265,7 +40281,7 @@ - 206 + 209 7 @@ -40352,7 +40368,7 @@ - 59 + 60 7 @@ -45668,23 +45684,26 @@ - 137 + 170 11 - 27 + 28 - 29 + 30 - 36 + 37 7 + + 31 + @@ -45879,7 +45898,7 @@ 33 - 40 + 43 54 @@ -46186,7 +46205,7 @@ - 15 + 17 7 @@ -47031,7 +47050,7 @@ 7 - 71 + 73 @@ -51840,6 +51859,35 @@ + + + + 10 + + + 60 + + + 7 + + + + + + + 20 + + + 7 + + + 2 + + + 7 + + + @@ -65477,6 +65525,38 @@ + + + + 17 + + + 33 + + + 41 + + + 7 + + + + + 166 + + + 13 + + + + + 224 + + + 13 + + + @@ -69570,6 +69650,21 @@ + + + + 7 + + + + + 28 + + + 7 + + + diff --git a/mcs/tools/mdoc/Makefile b/mcs/tools/mdoc/Makefile index 26e6087462d..9e4538fec1f 100644 --- a/mcs/tools/mdoc/Makefile +++ b/mcs/tools/mdoc/Makefile @@ -195,6 +195,24 @@ check-monodocer-dropns-multi: $(PROGRAM) diff --exclude=.svn -rup Test/en.expected-dropns-multi Test/en.actual + +check-monodocer-dropns-multi-withexisting: $(PROGRAM) + -rm -Rf Test/en.actual + $(MAKE) Test/DocTest-DropNS-classic.dll + $(MAKE) Test/DocTest-DropNS-unified.dll + $(MAKE) Test/DocTest-DropNS-classic-multitest.dll + $(MAKE) Test/DocTest-DropNS-unified-multitest.dll + + # mdoc update to show a pre-existing set of documents + $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic.dll + $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-unified.dll --dropns Test/DocTest-DropNS-unified.dll=MyFramework + + # mdoc update for both classic and unified + $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual $(MULTI-CLASSIC) -multiassembly + $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual $(MULTI-UNIFIED) --dropns Test/DocTest-DropNS-unified.dll=MyFramework --dropns Test/DocTest-DropNS-unified-multitest.dll=MyFramework -multiassembly + + diff --exclude=.svn -rup Test/en.expected-dropns-multi-withexisting Test/en.actual + check-monodocer-dropns-delete: $(PROGRAM) -rm -Rf Test/en.actual rm -Rf Test/DocTest-DropNS-classic-deletetest.dll @@ -399,7 +417,8 @@ check-doc-tools: check-monodocer-since \ check-monodocer-dropns-delete \ check-monodocer-internal-interface \ check-monodocer-enumerations \ - check-monodocer-dropns-multi + check-monodocer-dropns-multi \ + check-monodocer-dropns-multi-withexisting check-doc-tools-update: check-monodocer-since-update \ check-monodocer-importecmadoc-update \ diff --git a/mcs/tools/mdoc/Mono.Documentation/monodocer.cs b/mcs/tools/mdoc/Mono.Documentation/monodocer.cs index 20ab1e69abf..0a031767cce 100644 --- a/mcs/tools/mdoc/Mono.Documentation/monodocer.cs +++ b/mcs/tools/mdoc/Mono.Documentation/monodocer.cs @@ -1668,7 +1668,11 @@ class MDocUpdater : MDocCommand /// The assembly that was either added, or was already present static XmlElement AddAssemblyNameToNode (XmlElement root, ModuleDefinition module) { - Func assemblyFilter = x => x.SelectSingleNode ("AssemblyName").InnerText == module.Assembly.Name.Name; + Func assemblyFilter = x => { + var existingName = x.SelectSingleNode ("AssemblyName"); + return existingName != null && existingName.InnerText == module.Assembly.Name.Name; + }; + return AddAssemblyXmlNode ( root.SelectNodes ("AssemblyInfo").Cast ().ToArray (), assemblyFilter, x => WriteElementText (x, "AssemblyName", module.Assembly.Name.Name), diff --git a/mcs/tools/mdoc/Test/en.expected-dropns-multi-withexisting/MyFramework.MyNamespace/MyClass.xml b/mcs/tools/mdoc/Test/en.expected-dropns-multi-withexisting/MyFramework.MyNamespace/MyClass.xml new file mode 100644 index 00000000000..bca840fcedd --- /dev/null +++ b/mcs/tools/mdoc/Test/en.expected-dropns-multi-withexisting/MyFramework.MyNamespace/MyClass.xml @@ -0,0 +1,136 @@ + + + + + DocTest-DropNS-classic + 0.0.0.0 + + + DocTest-DropNS-unified + 0.0.0.0 + + + DocTest-DropNS-classic-multitest + 0.0.0.0 + + + DocTest-DropNS-unified-multitest + 0.0.0.0 + + + System.Object + + + + To be added. + To be added. + + + + + + Constructor + + 0.0.0.0 + + + 0.0.0.0 + + + DocTest-DropNS-classic + 0.0.0.0 + + + DocTest-DropNS-classic-multitest + 0.0.0.0 + + + DocTest-DropNS-unified + 0.0.0.0 + + + DocTest-DropNS-unified-multitest + 0.0.0.0 + + + + To be added. + To be added. + + + + + + Method + + 0.0.0.0 + + + 0.0.0.0 + + + DocTest-DropNS-classic + 0.0.0.0 + + + DocTest-DropNS-classic-multitest + 0.0.0.0 + + + DocTest-DropNS-unified + 0.0.0.0 + + + DocTest-DropNS-unified-multitest + 0.0.0.0 + + + System.Single + + + + + + To be added. + To be added. + To be added. + To be added. + + + + + + Property + + 0.0.0.0 + + + 0.0.0.0 + + + DocTest-DropNS-classic + 0.0.0.0 + + + DocTest-DropNS-classic-multitest + 0.0.0.0 + + + DocTest-DropNS-unified + 0.0.0.0 + + + DocTest-DropNS-unified-multitest + 0.0.0.0 + + + System.String + + + To be added. + To be added. + To be added. + + + + diff --git a/mcs/tools/mdoc/Test/en.expected-dropns-multi-withexisting/MyFramework.MyNamespace/OnlyInMulti.xml b/mcs/tools/mdoc/Test/en.expected-dropns-multi-withexisting/MyFramework.MyNamespace/OnlyInMulti.xml new file mode 100644 index 00000000000..dbcf1304c82 --- /dev/null +++ b/mcs/tools/mdoc/Test/en.expected-dropns-multi-withexisting/MyFramework.MyNamespace/OnlyInMulti.xml @@ -0,0 +1,40 @@ + + + + + DocTest-DropNS-classic-multitest + 0.0.0.0 + + + DocTest-DropNS-unified-multitest + 0.0.0.0 + + + System.Object + + + + To be added. + To be added. + + + + + + Constructor + + DocTest-DropNS-classic-multitest + 0.0.0.0 + + + DocTest-DropNS-unified-multitest + 0.0.0.0 + + + + To be added. + To be added. + + + + diff --git a/mcs/tools/mdoc/Test/en.expected-dropns-multi-withexisting/index.xml b/mcs/tools/mdoc/Test/en.expected-dropns-multi-withexisting/index.xml new file mode 100644 index 00000000000..6b5124ac28c --- /dev/null +++ b/mcs/tools/mdoc/Test/en.expected-dropns-multi-withexisting/index.xml @@ -0,0 +1,53 @@ + + + + + + System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints) + + + System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true) + + + + + + + System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints) + + + System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true) + + + + + + + System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints) + + + System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true) + + + + + + + System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints) + + + System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true) + + + + + To be added. + To be added. + + + + + + + DocTest-DropNS-classic + diff --git a/mcs/tools/mdoc/Test/en.expected-dropns-multi-withexisting/ns-MyFramework.MyNamespace.xml b/mcs/tools/mdoc/Test/en.expected-dropns-multi-withexisting/ns-MyFramework.MyNamespace.xml new file mode 100644 index 00000000000..74df75af20b --- /dev/null +++ b/mcs/tools/mdoc/Test/en.expected-dropns-multi-withexisting/ns-MyFramework.MyNamespace.xml @@ -0,0 +1,6 @@ + + + To be added. + To be added. + + diff --git a/mcs/tools/mkbundle/mkbundle.cs b/mcs/tools/mkbundle/mkbundle.cs index 4611bf69842..3b3774c5725 100755 --- a/mcs/tools/mkbundle/mkbundle.cs +++ b/mcs/tools/mkbundle/mkbundle.cs @@ -751,6 +751,7 @@ void mono_register_config_for_assembly (const char* assembly_name, cons { Error(String.Format("[Fail] {0}", ret)); } + return; } // on Windows, we have to pipe the output of a diff --git a/mcs/tools/xbuild/Makefile b/mcs/tools/xbuild/Makefile index 5575d4461fc..383d2f53057 100644 --- a/mcs/tools/xbuild/Makefile +++ b/mcs/tools/xbuild/Makefile @@ -55,6 +55,10 @@ install-frameworks: $(INSTALL_DATA) frameworks/net_4.5.1.xml $(DESTDIR)$(NETFRAMEWORK_DIR)/v4.5.1/RedistList/FrameworkList.xml $(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v4.5.2/RedistList $(INSTALL_DATA) frameworks/net_4.5.2.xml $(DESTDIR)$(NETFRAMEWORK_DIR)/v4.5.2/RedistList/FrameworkList.xml + $(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v4.6/RedistList + $(INSTALL_DATA) frameworks/net_4.6.xml $(DESTDIR)$(NETFRAMEWORK_DIR)/v4.6/RedistList/FrameworkList.xml + $(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v4.6.1/RedistList + $(INSTALL_DATA) frameworks/net_4.6.1.xml $(DESTDIR)$(NETFRAMEWORK_DIR)/v4.6.1/RedistList/FrameworkList.xml install-pcl-targets: $(MKINSTALLDIRS) $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.0 @@ -110,6 +114,8 @@ EXTRA_DISTFILES = \ frameworks/net_4.5.xml \ frameworks/net_4.5.1.xml \ frameworks/net_4.5.2.xml \ + frameworks/net_4.6.xml \ + frameworks/net_4.6.1.xml \ targets/Microsoft.Portable.CSharp_4.0.targets \ targets/Microsoft.Portable.CSharp_4.5.targets \ targets/Microsoft.Portable.VisualBasic_4.0.targets \ diff --git a/mcs/tools/xbuild/data/12.0/Microsoft.Common.targets b/mcs/tools/xbuild/data/12.0/Microsoft.Common.targets index 3c27732bf4f..e478140691b 100644 --- a/mcs/tools/xbuild/data/12.0/Microsoft.Common.targets +++ b/mcs/tools/xbuild/data/12.0/Microsoft.Common.targets @@ -328,13 +328,13 @@ + Condition="$(CurrentSolutionConfigurationContents) != '' and ('$(BuildingSolutionFile)' == 'true' or '$(BuildingInsideVisualStudio)' == 'true')"> - + diff --git a/mcs/tools/xbuild/data/14.0/Microsoft.Common.targets b/mcs/tools/xbuild/data/14.0/Microsoft.Common.targets index 094a1383bb7..5ce879ae236 100644 --- a/mcs/tools/xbuild/data/14.0/Microsoft.Common.targets +++ b/mcs/tools/xbuild/data/14.0/Microsoft.Common.targets @@ -314,13 +314,13 @@ + Condition="$(CurrentSolutionConfigurationContents) != '' and ('$(BuildingSolutionFile)' == 'true' or '$(BuildingInsideVisualStudio)' == 'true')"> - + diff --git a/mcs/tools/xbuild/data/2.0/Microsoft.Common.targets b/mcs/tools/xbuild/data/2.0/Microsoft.Common.targets index 079b8e092a2..74c1a9d6d70 100644 --- a/mcs/tools/xbuild/data/2.0/Microsoft.Common.targets +++ b/mcs/tools/xbuild/data/2.0/Microsoft.Common.targets @@ -194,13 +194,13 @@ + Condition="$(CurrentSolutionConfigurationContents) != '' and ('$(BuildingSolutionFile)' == 'true' or '$(BuildingInsideVisualStudio)' == 'true')"> - + diff --git a/mcs/tools/xbuild/data/3.5/Microsoft.Common.targets b/mcs/tools/xbuild/data/3.5/Microsoft.Common.targets index c3f560a5f0e..9ffa41d9233 100644 --- a/mcs/tools/xbuild/data/3.5/Microsoft.Common.targets +++ b/mcs/tools/xbuild/data/3.5/Microsoft.Common.targets @@ -224,13 +224,13 @@ + Condition="$(CurrentSolutionConfigurationContents) != '' and ('$(BuildingSolutionFile)' == 'true' or '$(BuildingInsideVisualStudio)' == 'true')"> - + diff --git a/mcs/tools/xbuild/data/4.0/Microsoft.Common.targets b/mcs/tools/xbuild/data/4.0/Microsoft.Common.targets index 47b6b7f36e0..39bc73e41d0 100644 --- a/mcs/tools/xbuild/data/4.0/Microsoft.Common.targets +++ b/mcs/tools/xbuild/data/4.0/Microsoft.Common.targets @@ -328,13 +328,13 @@ + Condition="$(CurrentSolutionConfigurationContents) != '' and ('$(BuildingSolutionFile)' == 'true' or '$(BuildingInsideVisualStudio)' == 'true')"> - + diff --git a/mcs/tools/xbuild/frameworks/net_4.6.1.xml b/mcs/tools/xbuild/frameworks/net_4.6.1.xml new file mode 100644 index 00000000000..9fa1fda25ed --- /dev/null +++ b/mcs/tools/xbuild/frameworks/net_4.6.1.xml @@ -0,0 +1,3 @@ + + + diff --git a/mcs/tools/xbuild/frameworks/net_4.6.xml b/mcs/tools/xbuild/frameworks/net_4.6.xml new file mode 100644 index 00000000000..a2ba03d987b --- /dev/null +++ b/mcs/tools/xbuild/frameworks/net_4.6.xml @@ -0,0 +1,3 @@ + + + diff --git a/mono/dis/dis-cil.c b/mono/dis/dis-cil.c index 79f68fb8b24..bc40414ba48 100755 --- a/mono/dis/dis-cil.c +++ b/mono/dis/dis-cil.c @@ -56,7 +56,7 @@ disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContainer *conta #endif if (mh->num_clauses) { - trys = g_malloc0 (sizeof (gboolean) * mh->num_clauses); + trys = (gboolean *)g_malloc0 (sizeof (gboolean) * mh->num_clauses); trys [0] = 1; for (i=1; i < mh->num_clauses; ++i) { #define jcl mh->clauses [j] diff --git a/mono/dis/dump.c b/mono/dis/dump.c index db55cef8ef1..d54e382434c 100755 --- a/mono/dis/dump.c +++ b/mono/dis/dump.c @@ -661,14 +661,14 @@ dump_table_methodimpl (MonoImage *m) for (i = 1; i <= t->rows; i++){ guint32 cols [MONO_METHODIMPL_SIZE]; - char *class, *impl, *decl; + char *klass, *impl, *decl; mono_metadata_decode_row (t, i - 1, cols, MONO_METHODIMPL_SIZE); - class = get_typedef (m, cols [MONO_METHODIMPL_CLASS]); + klass = get_typedef (m, cols [MONO_METHODIMPL_CLASS]); impl = get_method (m, method_dor_to_token (cols [MONO_METHODIMPL_BODY]), NULL); decl = get_method (m, method_dor_to_token (cols [MONO_METHODIMPL_DECLARATION]), NULL); - fprintf (output, "%d: %s\n\tdecl: %s\n\timpl: %s\n", i, class, decl, impl); - g_free (class); + fprintf (output, "%d: %s\n\tdecl: %s\n\timpl: %s\n", i, klass, decl, impl); + g_free (klass); g_free (impl); g_free (decl); } diff --git a/mono/dis/get.c b/mono/dis/get.c index c034e8fc71b..de99c35081d 100755 --- a/mono/dis/get.c +++ b/mono/dis/get.c @@ -2222,7 +2222,7 @@ get_encoded_user_string_or_bytearray (const unsigned char *ptr, int len) char *res, *eres, *result; int i; - res = g_malloc ((len >> 1) + 1); + res = (char *)g_malloc ((len >> 1) + 1); /* * I should really use some kind of libunicode here @@ -3137,7 +3137,7 @@ check_ambiguous_genparams (MonoGenericContainer *container) for (i = 0; i < container->type_argc; i++) { MonoGenericParam *param = mono_generic_container_get_param (container, i); - if ((p = g_hash_table_lookup (table, mono_generic_param_info (param)->name))) + if ((p = (gpointer *)g_hash_table_lookup (table, mono_generic_param_info (param)->name))) dup_list = g_slist_prepend (g_slist_prepend (dup_list, GUINT_TO_POINTER (i + 1)), p); else g_hash_table_insert (table, (char*)mono_generic_param_info (param)->name, GUINT_TO_POINTER (i + 1)); diff --git a/mono/dis/main.c b/mono/dis/main.c index 4d4a51cd8e7..6a96e4329e1 100644 --- a/mono/dis/main.c +++ b/mono/dis/main.c @@ -301,7 +301,7 @@ dis_directive_moduleref (MonoImage *m) static void dis_nt_header (MonoImage *m) { - MonoCLIImageInfo *image_info = m->image_info; + MonoCLIImageInfo *image_info = (MonoCLIImageInfo *)m->image_info; if (image_info && image_info->cli_header.nt.pe_stack_reserve != 0x100000) fprintf (output, ".stackreserve 0x%x\n", image_info->cli_header.nt.pe_stack_reserve); } @@ -493,7 +493,7 @@ dis_field_list (MonoImage *m, guint32 start, guint32 end, MonoGenericContainer * if ((crow = mono_metadata_get_constant_index (m, MONO_TOKEN_FIELD_DEF | (i+1), 0))) { mono_metadata_decode_row (&m->tables [MONO_TABLE_CONSTANT], crow-1, const_cols, MONO_CONSTANT_SIZE); - lit = get_constant (m, const_cols [MONO_CONSTANT_TYPE], const_cols [MONO_CONSTANT_VALUE]); + lit = get_constant (m, (MonoTypeEnum)const_cols [MONO_CONSTANT_TYPE], const_cols [MONO_CONSTANT_VALUE]); } else { lit = g_strdup ("not found"); } @@ -800,7 +800,7 @@ dump_cattrs_for_method_params (MonoImage *m, guint32 midx, MonoMethodSignature * if ((crow = mono_metadata_get_constant_index(m, MONO_TOKEN_PARAM_DEF | i, 0))) { guint32 const_cols [MONO_CONSTANT_SIZE]; mono_metadata_decode_row( &m->tables[MONO_TABLE_CONSTANT], crow-1, const_cols, MONO_CONSTANT_SIZE); - lit = get_constant(m, const_cols [MONO_CONSTANT_TYPE], const_cols [MONO_CONSTANT_VALUE]); + lit = get_constant (m, (MonoTypeEnum)const_cols [MONO_CONSTANT_TYPE], const_cols [MONO_CONSTANT_VALUE]); } else { lit = g_strdup ("not found"); @@ -1664,7 +1664,7 @@ setup_filter (MonoImage *image) const char *name = mono_image_get_name (image); for (item = filter_list; item; item = item->next) { - ifilter = item->data; + ifilter = (ImageFilter *)item->data; if (strcmp (ifilter->name, name) == 0) { cur_filter = ifilter; return; @@ -1676,8 +1676,8 @@ setup_filter (MonoImage *image) static int int_cmp (const void *e1, const void *e2) { - const int *i1 = e1; - const int *i2 = e2; + const int *i1 = (const int *)e1; + const int *i2 = (const int *)e2; return *i1 - *i2; } @@ -1720,7 +1720,7 @@ add_filter (const char *name) GList *item; for (item = filter_list; item; item = item->next) { - ifilter = item->data; + ifilter = (ImageFilter *)item->data; if (strcmp (ifilter->name, name) == 0) return ifilter; } @@ -1736,10 +1736,10 @@ add_item (TableFilter *tf, int val) if (tf->count >= tf->size) { if (!tf->size) { tf->size = 8; - tf->elems = g_malloc (sizeof (int) * tf->size); + tf->elems = (int *)g_malloc (sizeof (int) * tf->size); } else { tf->size *= 2; - tf->elems = g_realloc (tf->elems, sizeof (int) * tf->size); + tf->elems = (int *)g_realloc (tf->elems, sizeof (int) * tf->size); } } tf->elems [tf->count++] = val; @@ -1752,7 +1752,7 @@ sort_filter_elems (void) GList *item; for (item = filter_list; item; item = item->next) { - ifilter = item->data; + ifilter = (ImageFilter *)item->data; qsort (ifilter->types.elems, ifilter->types.count, sizeof (int), int_cmp); qsort (ifilter->fields.elems, ifilter->fields.count, sizeof (int), int_cmp); qsort (ifilter->methods.elems, ifilter->methods.count, sizeof (int), int_cmp); @@ -1913,7 +1913,7 @@ monodis_assembly_search_hook (MonoAssemblyName *aname, gpointer user_data) GList *tmp; for (tmp = loaded_assemblies; tmp; tmp = tmp->next) { - MonoAssembly *ass = tmp->data; + MonoAssembly *ass = (MonoAssembly *)tmp->data; if (mono_assembly_names_equal (aname, &ass->aname)) return ass; } @@ -2000,7 +2000,7 @@ main (int argc, char *argv []) * If we just have one file, use the corlib version it requires. */ if (!input_files->next) { - char *filename = input_files->data; + char *filename = (char *)input_files->data; mono_init_from_assembly (argv [0], filename); @@ -2011,7 +2011,7 @@ main (int argc, char *argv []) mono_init (argv [0]); for (l = input_files; l; l = l->next) - disassemble_file (l->data); + disassemble_file ((const char *)l->data); } return 0; diff --git a/mono/io-layer/Makefile.am b/mono/io-layer/Makefile.am index 47e31071494..b963eb6a053 100644 --- a/mono/io-layer/Makefile.am +++ b/mono/io-layer/Makefile.am @@ -12,7 +12,6 @@ libwapiincludedir = $(includedir)/mono-$(API_VER)/mono/io-layer OTHER_H = \ access.h \ - collection.h \ context.h \ error.h \ events.h \ @@ -39,8 +38,6 @@ OTHER_H = \ OTHER_SRC = \ access.h \ - collection.c \ - collection.h \ context.c \ context.h \ error.c \ @@ -61,8 +58,6 @@ OTHER_SRC = \ macros.h \ messages.c \ messages.h \ - misc.c \ - misc-private.h \ mutexes.c \ mutexes.h \ mutex-private.h \ diff --git a/mono/io-layer/collection.c b/mono/io-layer/collection.c deleted file mode 100644 index e7315904d16..00000000000 --- a/mono/io-layer/collection.c +++ /dev/null @@ -1,131 +0,0 @@ -/* - * collection.c: Garbage collection for handles - * - * Author: - * Dick Porter (dick@ximian.com) - * - * (C) 2004-2006 Novell, Inc. - */ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#if 0 -// #define DEBUG(...) g_message(__VA_ARGS__) -#else -#define DEBUG(...) -#endif - -static pthread_t collection_thread_id; - -static gpointer collection_thread (gpointer unused G_GNUC_UNUSED) -{ - struct timespec sleepytime; - - sleepytime.tv_sec = _WAPI_HANDLE_COLLECTION_UPDATE_INTERVAL; - sleepytime.tv_nsec = 0; - - while (_wapi_has_shut_down == FALSE) { - nanosleep (&sleepytime, NULL); - - //_wapi_handle_dump (); - _wapi_handle_update_refs (); - } - - pthread_exit (NULL); - - return(NULL); -} - -void _wapi_collection_init (void) -{ - pthread_attr_t attr; - int ret; - int set_stacksize = 0; - - retry: - ret = pthread_attr_init (&attr); - g_assert (ret == 0); - -#if defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE) - if (set_stacksize == 0) { - ret = pthread_attr_setstacksize (&attr, MAX (65536, PTHREAD_STACK_MIN)); - g_assert (ret == 0); - } else if (set_stacksize == 1) { - ret = pthread_attr_setstacksize (&attr, 131072); - g_assert (ret == 0); - } -#endif - - ret = pthread_create (&collection_thread_id, &attr, collection_thread, - NULL); - if (ret != 0 && set_stacksize < 2) { - set_stacksize++; - goto retry; - } - if (ret != 0) { - g_error ("%s: Couldn't create handle collection thread: %s", - __func__, g_strerror (ret)); - } -} - -void _wapi_handle_collect (void) -{ - guint32 count = _wapi_shared_layout->collection_count; - int i, thr_ret; - - if (!_wapi_shm_enabled ()) - return; - - DEBUG ("%s: (%d) Starting a collection", __func__, _wapi_getpid ()); - - /* Become the collection master */ - thr_ret = _wapi_handle_lock_shared_handles (); - g_assert (thr_ret == 0); - - thr_ret = _wapi_shm_sem_lock (_WAPI_SHARED_SEM_FILESHARE); - g_assert (thr_ret == 0); - - DEBUG ("%s: (%d) Master set", __func__, _wapi_getpid ()); - - /* If count has changed, someone else jumped in as master */ - if (count == _wapi_shared_layout->collection_count) { - guint32 too_old = (guint32)(time(NULL) & 0xFFFFFFFF) - _WAPI_HANDLE_COLLECTION_EXPIRED_INTERVAL; - - for (i = 0; i < _WAPI_HANDLE_INITIAL_COUNT; i++) { - struct _WapiHandleShared *data; - - data = &_wapi_shared_layout->handles[i]; - if (data->timestamp < too_old) { - DEBUG ("%s: (%d) Deleting handle 0x%x", __func__, _wapi_getpid (), i); - memset (&_wapi_shared_layout->handles[i], '\0', sizeof(struct _WapiHandleShared)); - } - } - - for (i = 0; i < _wapi_fileshare_layout->hwm; i++) { - struct _WapiFileShare *file_share = &_wapi_fileshare_layout->share_info[i]; - - if (file_share->timestamp < too_old) { - memset (file_share, '\0', - sizeof(struct _WapiFileShare)); - } - } - - InterlockedIncrement ((gint32 *)&_wapi_shared_layout->collection_count); - } - - thr_ret = _wapi_shm_sem_unlock (_WAPI_SHARED_SEM_FILESHARE); - g_assert (thr_ret == 0); - - _wapi_handle_unlock_shared_handles (); - - DEBUG ("%s: (%d) Collection done", __func__, _wapi_getpid ()); -} diff --git a/mono/io-layer/collection.h b/mono/io-layer/collection.h deleted file mode 100644 index 95831d3f60c..00000000000 --- a/mono/io-layer/collection.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * collection.h: Garbage collection for handles - * - * Author: - * Dick Porter (dick@ximian.com) - * - * (C) 2004 Novell, Inc. - */ - -#ifndef _WAPI_COLLECTION_H_ -#define _WAPI_COLLECTION_H_ - -#include - -G_BEGIN_DECLS - -#define _WAPI_HANDLE_COLLECTION_UPDATE_INTERVAL 10 -#define _WAPI_HANDLE_COLLECTION_EXPIRED_INTERVAL 60 - -#include - -extern void _wapi_collection_init (void); -extern void _wapi_handle_collect (void); - -G_END_DECLS - -#endif /* _WAPI_COLLECTION_H_ */ diff --git a/mono/io-layer/error.c b/mono/io-layer/error.c index e45fff4bcdd..6d40dd3b5cc 100644 --- a/mono/io-layer/error.c +++ b/mono/io-layer/error.c @@ -14,6 +14,7 @@ #include #include "mono/io-layer/wapi.h" +#include "mono/utils/mono-once.h" static pthread_key_t error_key; static mono_once_t error_key_once=MONO_ONCE_INIT; diff --git a/mono/io-layer/event-private.h b/mono/io-layer/event-private.h index 5b3ec44b193..25df9111656 100644 --- a/mono/io-layer/event-private.h +++ b/mono/io-layer/event-private.h @@ -14,8 +14,6 @@ #include #include -#include - extern struct _WapiHandleOps _wapi_event_ops; extern struct _WapiHandleOps _wapi_namedevent_ops; diff --git a/mono/io-layer/events.c b/mono/io-layer/events.c index ac8068d41a4..3ad606bcebc 100644 --- a/mono/io-layer/events.c +++ b/mono/io-layer/events.c @@ -15,11 +15,9 @@ #include #include #include -#include - #include +#include -#include #if 0 #define DEBUG(...) g_message(__VA_ARGS__) #else @@ -90,11 +88,9 @@ static mono_once_t event_ops_once=MONO_ONCE_INIT; static void event_ops_init (void) { _wapi_handle_register_capabilities (WAPI_HANDLE_EVENT, - WAPI_HANDLE_CAP_WAIT | - WAPI_HANDLE_CAP_SIGNAL); + (WapiHandleCapability)(WAPI_HANDLE_CAP_WAIT | WAPI_HANDLE_CAP_SIGNAL)); _wapi_handle_register_capabilities (WAPI_HANDLE_NAMEDEVENT, - WAPI_HANDLE_CAP_WAIT | - WAPI_HANDLE_CAP_SIGNAL); + (WapiHandleCapability)(WAPI_HANDLE_CAP_WAIT | WAPI_HANDLE_CAP_SIGNAL)); } static void event_signal(gpointer handle) diff --git a/mono/io-layer/handles-private.h b/mono/io-layer/handles-private.h index c5d4fbeb70e..4f20de02d41 100644 --- a/mono/io-layer/handles-private.h +++ b/mono/io-layer/handles-private.h @@ -17,8 +17,6 @@ #include #include -#include -#include #include #include @@ -32,7 +30,6 @@ extern struct _WapiHandleUnshared *_wapi_private_handles []; extern struct _WapiHandleSharedLayout *_wapi_shared_layout; -extern struct _WapiFileShareLayout *_wapi_fileshare_layout; extern guint32 _wapi_fd_reserve; extern mono_mutex_t *_wapi_global_signal_mutex; @@ -79,8 +76,8 @@ extern gboolean _wapi_handle_count_signalled_handles (guint32 numhandles, guint32 *lowest); extern void _wapi_handle_unlock_handles (guint32 numhandles, gpointer *handles); -extern int _wapi_handle_timedwait_signal (struct timespec *timeout, gboolean poll, gboolean *alerted); -extern int _wapi_handle_timedwait_signal_handle (gpointer handle, struct timespec *timeout, gboolean alertable, gboolean poll, gboolean *alerted); +extern int _wapi_handle_timedwait_signal (guint32 timeout, gboolean poll, gboolean *alerted); +extern int _wapi_handle_timedwait_signal_handle (gpointer handle, guint32 timeout, gboolean alertable, gboolean poll, gboolean *alerted); extern gboolean _wapi_handle_get_or_set_share (guint64 device, guint64 inode, guint32 new_sharemode, guint32 new_access, @@ -90,7 +87,6 @@ extern gboolean _wapi_handle_get_or_set_share (guint64 device, guint64 inode, extern void _wapi_handle_check_share (struct _WapiFileShare *share_info, int fd); extern void _wapi_handle_dump (void); -extern void _wapi_handle_update_refs (void); extern void _wapi_handle_foreach (WapiHandleType type, gboolean (*on_each)(gpointer test, gpointer user), gpointer user_data); @@ -141,9 +137,9 @@ static inline void _wapi_handle_set_signal_state (gpointer handle, /* The condition the global signal cond is waiting on is the signalling of * _any_ handle. So lock it before setting the signalled state. */ - thr_ret = mono_mutex_lock (_wapi_global_signal_mutex); + thr_ret = mono_os_mutex_lock (_wapi_global_signal_mutex); if (thr_ret != 0) - g_warning ("Bad call to mono_mutex_lock result %d for global signal mutex", thr_ret); + g_warning ("Bad call to mono_os_mutex_lock result %d for global signal mutex", thr_ret); g_assert (thr_ret == 0); /* This function _must_ be called with @@ -171,9 +167,9 @@ static inline void _wapi_handle_set_signal_state (gpointer handle, g_warning ("Bad call to pthread_cond_broadcast result %d for handle %p", thr_ret, handle); g_assert (thr_ret == 0); - thr_ret = mono_mutex_unlock (_wapi_global_signal_mutex); + thr_ret = mono_os_mutex_unlock (_wapi_global_signal_mutex); if (thr_ret != 0) - g_warning ("Bad call to mono_mutex_unlock result %d for global signal mutex", thr_ret); + g_warning ("Bad call to mono_os_mutex_unlock result %d for global signal mutex", thr_ret); g_assert (thr_ret == 0); } else { handle_data->signalled=state; @@ -227,7 +223,7 @@ static inline int _wapi_handle_lock_signal_mutex (void) g_message ("%s: lock global signal mutex", __func__); #endif - return(mono_mutex_lock (_wapi_global_signal_mutex)); + return(mono_os_mutex_lock (_wapi_global_signal_mutex)); } /* the parameter makes it easier to call from a pthread cleanup handler */ @@ -237,7 +233,7 @@ static inline int _wapi_handle_unlock_signal_mutex (void *unused) g_message ("%s: unlock global signal mutex", __func__); #endif - return(mono_mutex_unlock (_wapi_global_signal_mutex)); + return(mono_os_mutex_unlock (_wapi_global_signal_mutex)); } static inline int _wapi_handle_lock_handle (gpointer handle) @@ -258,7 +254,7 @@ static inline int _wapi_handle_lock_handle (gpointer handle) return(0); } - return(mono_mutex_lock (&_WAPI_PRIVATE_HANDLES(idx).signal_mutex)); + return(mono_os_mutex_lock (&_WAPI_PRIVATE_HANDLES(idx).signal_mutex)); } static inline int _wapi_handle_trylock_handle (gpointer handle) @@ -280,7 +276,7 @@ static inline int _wapi_handle_trylock_handle (gpointer handle) return(0); } - ret = mono_mutex_trylock (&_WAPI_PRIVATE_HANDLES(idx).signal_mutex); + ret = mono_os_mutex_trylock (&_WAPI_PRIVATE_HANDLES(idx).signal_mutex); if (ret != 0) { _wapi_handle_unref (handle); } @@ -306,7 +302,7 @@ static inline int _wapi_handle_unlock_handle (gpointer handle) return(0); } - ret = mono_mutex_unlock (&_WAPI_PRIVATE_HANDLES(idx).signal_mutex); + ret = mono_os_mutex_unlock (&_WAPI_PRIVATE_HANDLES(idx).signal_mutex); _wapi_handle_unref (handle); diff --git a/mono/io-layer/handles.c b/mono/io-layer/handles.c index 14fa71c9a74..f92b6566d8c 100644 --- a/mono/io-layer/handles.c +++ b/mono/io-layer/handles.c @@ -38,14 +38,13 @@ #include #include #include -#include #include -#include #include -#include +#include #include #include +#include #undef DEBUG_REFS #if 0 @@ -56,7 +55,7 @@ static void (*_wapi_handle_ops_get_close_func (WapiHandleType type))(gpointer, gpointer); -static WapiHandleCapability handle_caps[WAPI_HANDLE_COUNT]={0}; +static WapiHandleCapability handle_caps[WAPI_HANDLE_COUNT] = { (WapiHandleCapability)0 }; static struct _WapiHandleOps *handle_ops[WAPI_HANDLE_COUNT]={ NULL, &_wapi_file_ops, @@ -126,11 +125,6 @@ static guint32 _wapi_private_handle_slot_count = 0; struct _WapiHandleSharedLayout *_wapi_shared_layout = NULL; -/* - * If SHM is enabled, this will point to shared memory, otherwise it will be NULL. - */ -struct _WapiFileShareLayout *_wapi_fileshare_layout = NULL; - /* * If SHM is disabled, this will point to a hash of _WapiFileShare structures, otherwise * it will be NULL. We use this instead of _wapi_fileshare_layout to avoid allocating a @@ -139,8 +133,8 @@ struct _WapiFileShareLayout *_wapi_fileshare_layout = NULL; static GHashTable *file_share_hash; static mono_mutex_t file_share_hash_mutex; -#define file_share_hash_lock() mono_mutex_lock (&file_share_hash_mutex) -#define file_share_hash_unlock() mono_mutex_unlock (&file_share_hash_mutex) +#define file_share_hash_lock() mono_os_mutex_lock (&file_share_hash_mutex) +#define file_share_hash_unlock() mono_os_mutex_unlock (&file_share_hash_mutex) guint32 _wapi_fd_reserve; @@ -208,12 +202,11 @@ static void handle_cleanup (void) _wapi_shm_semaphores_remove (); - _wapi_shm_detach (WAPI_SHM_DATA); - _wapi_shm_detach (WAPI_SHM_FILESHARE); + g_free (_wapi_shared_layout); if (file_share_hash) { g_hash_table_destroy (file_share_hash); - mono_mutex_destroy (&file_share_hash_mutex); + mono_os_mutex_destroy (&file_share_hash_mutex); } for (i = 0; i < _WAPI_PRIVATE_MAX_SLOTS; ++i) @@ -257,22 +250,12 @@ wapi_init (void) } while(_wapi_fd_reserve > _wapi_private_handle_count); _wapi_shm_semaphores_init (); - - _wapi_shared_layout = _wapi_shm_attach (WAPI_SHM_DATA); + + _wapi_shared_layout = (_WapiHandleSharedLayout *)g_malloc0 (sizeof (_WapiHandleSharedLayout)); g_assert (_wapi_shared_layout != NULL); - - if (_wapi_shm_enabled ()) { - /* This allocates a 4mb array, so do it only if SHM is enabled */ - _wapi_fileshare_layout = _wapi_shm_attach (WAPI_SHM_FILESHARE); - g_assert (_wapi_fileshare_layout != NULL); - } - -#if !defined (DISABLE_SHARED_HANDLES) - if (_wapi_shm_enabled ()) - _wapi_collection_init (); -#endif + _wapi_io_init (); - mono_mutex_init (&scan_mutex); + mono_os_mutex_init (&scan_mutex); _wapi_global_signal_handle = _wapi_handle_new (WAPI_HANDLE_EVENT, NULL); @@ -373,7 +356,7 @@ static void _wapi_handle_init (struct _WapiHandleUnshared *handle, thr_ret = pthread_cond_init (&handle->signal_cond, NULL); g_assert (thr_ret == 0); - thr_ret = mono_mutex_init (&handle->signal_mutex); + thr_ret = mono_os_mutex_init (&handle->signal_mutex); g_assert (thr_ret == 0); if (handle_specific != NULL) { @@ -505,7 +488,7 @@ _wapi_handle_new (WapiHandleType type, gpointer handle_specific) g_assert(!_WAPI_FD_HANDLE(type)); - thr_ret = mono_mutex_lock (&scan_mutex); + thr_ret = mono_os_mutex_lock (&scan_mutex); g_assert (thr_ret == 0); while ((handle_idx = _wapi_handle_new_internal (type, handle_specific)) == 0) { @@ -522,7 +505,7 @@ _wapi_handle_new (WapiHandleType type, gpointer handle_specific) _wapi_private_handle_slot_count ++; } - thr_ret = mono_mutex_unlock (&scan_mutex); + thr_ret = mono_os_mutex_unlock (&scan_mutex); g_assert (thr_ret == 0); if (handle_idx == 0) { @@ -544,7 +527,6 @@ _wapi_handle_new (WapiHandleType type, gpointer handle_specific) ref = _wapi_handle_new_shared (type, handle_specific); if (ref == 0) { - _wapi_handle_collect (); ref = _wapi_handle_new_shared (type, handle_specific); if (ref == 0) { /* FIXME: grow the arrays */ @@ -586,7 +568,7 @@ gpointer _wapi_handle_new_from_offset (WapiHandleType type, guint32 offset, InterlockedExchange ((gint32 *)&shared->timestamp, now); } - thr_ret = mono_mutex_lock (&scan_mutex); + thr_ret = mono_os_mutex_lock (&scan_mutex); g_assert (thr_ret == 0); for (i = SLOT_INDEX (0); i < _wapi_private_handle_slot_count; i++) { @@ -604,7 +586,7 @@ gpointer _wapi_handle_new_from_offset (WapiHandleType type, guint32 offset, } first_pass_done: - thr_ret = mono_mutex_unlock (&scan_mutex); + thr_ret = mono_os_mutex_unlock (&scan_mutex); g_assert (thr_ret == 0); if (handle != INVALID_HANDLE_VALUE) { @@ -633,7 +615,7 @@ first_pass_done: goto done; } - thr_ret = mono_mutex_lock (&scan_mutex); + thr_ret = mono_os_mutex_lock (&scan_mutex); g_assert (thr_ret == 0); while ((handle_idx = _wapi_handle_new_internal (type, NULL)) == 0) { @@ -646,7 +628,7 @@ first_pass_done: _wapi_private_handle_slot_count ++; } - thr_ret = mono_mutex_unlock (&scan_mutex); + thr_ret = mono_os_mutex_unlock (&scan_mutex); g_assert (thr_ret == 0); /* Make sure we left the space for fd mappings */ @@ -670,7 +652,7 @@ init_handles_slot (int idx) { int thr_ret; - thr_ret = mono_mutex_lock (&scan_mutex); + thr_ret = mono_os_mutex_lock (&scan_mutex); g_assert (thr_ret == 0); if (_wapi_private_handles [idx] == NULL) { @@ -679,7 +661,7 @@ init_handles_slot (int idx) g_assert (_wapi_private_handles [idx]); } - thr_ret = mono_mutex_unlock (&scan_mutex); + thr_ret = mono_os_mutex_unlock (&scan_mutex); g_assert (thr_ret == 0); } @@ -786,7 +768,7 @@ _wapi_handle_foreach (WapiHandleType type, guint32 i, k; int thr_ret; - thr_ret = mono_mutex_lock (&scan_mutex); + thr_ret = mono_os_mutex_lock (&scan_mutex); g_assert (thr_ret == 0); for (i = SLOT_INDEX (0); i < _wapi_private_handle_slot_count; i++) { @@ -803,7 +785,7 @@ _wapi_handle_foreach (WapiHandleType type, } } - thr_ret = mono_mutex_unlock (&scan_mutex); + thr_ret = mono_os_mutex_unlock (&scan_mutex); g_assert (thr_ret == 0); } @@ -828,7 +810,7 @@ gpointer _wapi_search_handle (WapiHandleType type, gboolean found = FALSE; int thr_ret; - thr_ret = mono_mutex_lock (&scan_mutex); + thr_ret = mono_os_mutex_lock (&scan_mutex); g_assert (thr_ret == 0); for (i = SLOT_INDEX (0); !found && i < _wapi_private_handle_slot_count; i++) { @@ -853,7 +835,7 @@ gpointer _wapi_search_handle (WapiHandleType type, } } - thr_ret = mono_mutex_unlock (&scan_mutex); + thr_ret = mono_os_mutex_unlock (&scan_mutex); g_assert (thr_ret == 0); if (!found && search_shared && _WAPI_SHARED_HANDLE (type)) { @@ -959,11 +941,6 @@ gint32 _wapi_search_handle_namespace (WapiHandleType type, DEBUG ("%s: Lookup for handle named [%s] type %s", __func__, utf8_name, _wapi_handle_typename[type]); - /* Do a handle collection before starting to look, so that any - * stale cruft gets removed - */ - _wapi_handle_collect (); - thr_ret = _wapi_handle_lock_shared_handles (); g_assert (thr_ret == 0); @@ -1097,7 +1074,7 @@ static void _wapi_handle_unref_full (gpointer handle, gboolean ignore_private_bu g_assert (thr_ret == 0); } - thr_ret = mono_mutex_lock (&scan_mutex); + thr_ret = mono_os_mutex_lock (&scan_mutex); DEBUG ("%s: Destroying handle %p", __func__, handle); @@ -1115,7 +1092,7 @@ static void _wapi_handle_unref_full (gpointer handle, gboolean ignore_private_bu * now, but pthreads doesn't have a * "unlock_and_destroy" atomic function. */ - thr_ret = mono_mutex_destroy (&_WAPI_PRIVATE_HANDLES(idx).signal_mutex); + thr_ret = mono_os_mutex_destroy (&_WAPI_PRIVATE_HANDLES(idx).signal_mutex); /*WARNING gross hack to make cleanup not crash when exiting without the whole runtime teardown.*/ if (thr_ret == EBUSY && ignore_private_busy_handles) { early_exit = TRUE; @@ -1150,7 +1127,7 @@ static void _wapi_handle_unref_full (gpointer handle, gboolean ignore_private_bu } } - thr_ret = mono_mutex_unlock (&scan_mutex); + thr_ret = mono_os_mutex_unlock (&scan_mutex); g_assert (thr_ret == 0); if (early_exit) @@ -1498,48 +1475,8 @@ void _wapi_handle_unlock_handles (guint32 numhandles, gpointer *handles) } } -static int timedwait_signal_poll_cond (pthread_cond_t *cond, mono_mutex_t *mutex, struct timespec *timeout, gboolean alertable) -{ - struct timespec fake_timeout; - int ret; - - if (!alertable) { - /* - * pthread_cond_(timed)wait() can return 0 even if the condition was not - * signalled. This happens at least on Darwin. We surface this, i.e., we - * get spurious wake-ups. - * - * http://pubs.opengroup.org/onlinepubs/007908775/xsh/pthread_cond_wait.html - */ - if (timeout) - ret=mono_cond_timedwait (cond, mutex, timeout); - else - ret=mono_cond_wait (cond, mutex); - } else { - _wapi_calc_timeout (&fake_timeout, 100); - - if (timeout != NULL && ((fake_timeout.tv_sec > timeout->tv_sec) || - (fake_timeout.tv_sec == timeout->tv_sec && - fake_timeout.tv_nsec > timeout->tv_nsec))) { - /* Real timeout is less than 100ms time */ - ret=mono_cond_timedwait (cond, mutex, timeout); - } else { - ret=mono_cond_timedwait (cond, mutex, &fake_timeout); - - /* Mask the fake timeout, this will cause - * another poll if the cond was not really signaled - */ - if (ret==ETIMEDOUT) { - ret=0; - } - } - } - - return(ret); -} - int -_wapi_handle_timedwait_signal (struct timespec *timeout, gboolean poll, gboolean *alerted) +_wapi_handle_timedwait_signal (guint32 timeout, gboolean poll, gboolean *alerted) { return _wapi_handle_timedwait_signal_handle (_wapi_global_signal_handle, timeout, TRUE, poll, alerted); } @@ -1562,16 +1499,15 @@ signal_handle_and_unref (gpointer handle) cond = &_WAPI_PRIVATE_HANDLES (idx).signal_cond; mutex = &_WAPI_PRIVATE_HANDLES (idx).signal_mutex; - mono_mutex_lock (mutex); - mono_cond_broadcast (cond); - mono_mutex_unlock (mutex); + mono_os_mutex_lock (mutex); + mono_os_cond_broadcast (cond); + mono_os_mutex_unlock (mutex); _wapi_handle_unref (handle); } int -_wapi_handle_timedwait_signal_handle (gpointer handle, struct timespec *timeout, - gboolean alertable, gboolean poll, gboolean *alerted) +_wapi_handle_timedwait_signal_handle (gpointer handle, guint32 timeout, gboolean alertable, gboolean poll, gboolean *alerted) { DEBUG ("%s: waiting for %p (type %s)", __func__, handle, _wapi_handle_typename[_wapi_handle_type (handle)]); @@ -1586,13 +1522,8 @@ _wapi_handle_timedwait_signal_handle (gpointer handle, struct timespec *timeout, if (WAPI_SHARED_HANDLE_DATA(handle).signalled == TRUE) { return (0); } - if (timeout != NULL) { - struct timespec fake_timeout; - _wapi_calc_timeout (&fake_timeout, 100); - - if ((fake_timeout.tv_sec > timeout->tv_sec) || - (fake_timeout.tv_sec == timeout->tv_sec && - fake_timeout.tv_nsec > timeout->tv_nsec)) { + if (timeout != INFINITE) { + if (timeout < 100) { /* FIXME: Real timeout is less than * 100ms time, but is it really worth * calculating to the exact ms? @@ -1625,14 +1556,33 @@ _wapi_handle_timedwait_signal_handle (gpointer handle, struct timespec *timeout, cond = &_WAPI_PRIVATE_HANDLES (idx).signal_cond; mutex = &_WAPI_PRIVATE_HANDLES (idx).signal_mutex; - if (poll) { - /* This is needed when waiting for process handles */ - res = timedwait_signal_poll_cond (cond, mutex, timeout, alertable); + if (!poll) { + res = mono_os_cond_timedwait (cond, mutex, timeout); } else { - if (timeout) - res = mono_cond_timedwait (cond, mutex, timeout); - else - res = mono_cond_wait (cond, mutex); + /* This is needed when waiting for process handles */ + if (!alertable) { + /* + * pthread_cond_(timed)wait() can return 0 even if the condition was not + * signalled. This happens at least on Darwin. We surface this, i.e., we + * get spurious wake-ups. + * + * http://pubs.opengroup.org/onlinepubs/007908775/xsh/pthread_cond_wait.html + */ + res = mono_os_cond_timedwait (cond, mutex, timeout); + } else { + if (timeout < 100) { + /* Real timeout is less than 100ms time */ + res = mono_os_cond_timedwait (cond, mutex, timeout); + } else { + res = mono_os_cond_timedwait (cond, mutex, 100); + + /* Mask the fake timeout, this will cause + * another poll if the cond was not really signaled + */ + if (res == ETIMEDOUT) + res = 0; + } + } } if (alertable) { @@ -1650,21 +1600,17 @@ _wapi_handle_timedwait_signal_handle (gpointer handle, struct timespec *timeout, void _wapi_free_share_info (_WapiFileShare *share_info) { - if (!_wapi_shm_enabled ()) { - file_share_hash_lock (); - g_hash_table_remove (file_share_hash, share_info); - file_share_hash_unlock (); - /* The hashtable dtor frees share_info */ - } else { - memset (share_info, '\0', sizeof(struct _WapiFileShare)); - } + file_share_hash_lock (); + g_hash_table_remove (file_share_hash, share_info); + file_share_hash_unlock (); + /* The hashtable dtor frees share_info */ } static gint wapi_share_info_equal (gconstpointer ka, gconstpointer kb) { - const _WapiFileShare *s1 = ka; - const _WapiFileShare *s2 = kb; + const _WapiFileShare *s1 = (const _WapiFileShare *)ka; + const _WapiFileShare *s2 = (const _WapiFileShare *)kb; return (s1->device == s2->device && s1->inode == s2->inode) ? 1 : 0; } @@ -1672,7 +1618,7 @@ wapi_share_info_equal (gconstpointer ka, gconstpointer kb) static guint wapi_share_info_hash (gconstpointer data) { - const _WapiFileShare *s = data; + const _WapiFileShare *s = (const _WapiFileShare *)data; return s->inode; } @@ -1685,8 +1631,7 @@ gboolean _wapi_handle_get_or_set_share (guint64 device, guint64 inode, struct _WapiFileShare **share_info) { struct _WapiFileShare *file_share; - guint32 now = (guint32)(time(NULL) & 0xFFFFFFFF); - int thr_ret, i, first_unused = -1; + int thr_ret; gboolean exists = FALSE; /* Prevents entries from expiring under us as we search @@ -1698,110 +1643,46 @@ gboolean _wapi_handle_get_or_set_share (guint64 device, guint64 inode, thr_ret = _wapi_shm_sem_lock (_WAPI_SHARED_SEM_FILESHARE); g_assert (thr_ret == 0); - if (!_wapi_shm_enabled ()) { - _WapiFileShare tmp; + _WapiFileShare tmp; - /* - * Instead of allocating a 4MB array, we use a hash table to keep track of this - * info. This is needed even if SHM is disabled, to track sharing inside - * the current process. - */ - if (!file_share_hash) { - file_share_hash = g_hash_table_new_full (wapi_share_info_hash, wapi_share_info_equal, NULL, g_free); - mono_mutex_init_recursive (&file_share_hash_mutex); - } - - tmp.device = device; - tmp.inode = inode; + /* + * Instead of allocating a 4MB array, we use a hash table to keep track of this + * info. This is needed even if SHM is disabled, to track sharing inside + * the current process. + */ + if (!file_share_hash) { + file_share_hash = g_hash_table_new_full (wapi_share_info_hash, wapi_share_info_equal, NULL, g_free); + mono_os_mutex_init_recursive (&file_share_hash_mutex); + } - file_share_hash_lock (); + tmp.device = device; + tmp.inode = inode; - file_share = g_hash_table_lookup (file_share_hash, &tmp); - if (file_share) { - *old_sharemode = file_share->sharemode; - *old_access = file_share->access; - *share_info = file_share; - - InterlockedIncrement ((gint32 *)&file_share->handle_refs); - exists = TRUE; - } else { - file_share = g_new0 (_WapiFileShare, 1); - - file_share->device = device; - file_share->inode = inode; - file_share->opened_by_pid = _wapi_getpid (); - file_share->sharemode = new_sharemode; - file_share->access = new_access; - file_share->handle_refs = 1; - *share_info = file_share; + file_share_hash_lock (); - g_hash_table_insert (file_share_hash, file_share, file_share); - } + file_share = (_WapiFileShare *)g_hash_table_lookup (file_share_hash, &tmp); + if (file_share) { + *old_sharemode = file_share->sharemode; + *old_access = file_share->access; + *share_info = file_share; - file_share_hash_unlock (); + InterlockedIncrement ((gint32 *)&file_share->handle_refs); + exists = TRUE; } else { - /* If a linear scan gets too slow we'll have to fit a hash - * table onto the shared mem backing store - */ - *share_info = NULL; - for (i = 0; i <= _wapi_fileshare_layout->hwm; i++) { - file_share = &_wapi_fileshare_layout->share_info[i]; + file_share = g_new0 (_WapiFileShare, 1); - /* Make a note of an unused slot, in case we need to - * store share info - */ - if (first_unused == -1 && file_share->handle_refs == 0) { - first_unused = i; - continue; - } - - if (file_share->handle_refs == 0) { - continue; - } - - if (file_share->device == device && - file_share->inode == inode) { - *old_sharemode = file_share->sharemode; - *old_access = file_share->access; - *share_info = file_share; - - /* Increment the reference count while we - * still have sole access to the shared area. - * This makes the increment atomic wrt - * collections - */ - InterlockedIncrement ((gint32 *)&file_share->handle_refs); - - exists = TRUE; - break; - } - } - - if (!exists) { - if (i == _WAPI_FILESHARE_SIZE && first_unused == -1) { - /* No more space */ - } else { - if (first_unused == -1) { - file_share = &_wapi_fileshare_layout->share_info[++i]; - _wapi_fileshare_layout->hwm = i; - } else { - file_share = &_wapi_fileshare_layout->share_info[first_unused]; - } - - file_share->device = device; - file_share->inode = inode; - file_share->opened_by_pid = _wapi_getpid (); - file_share->sharemode = new_sharemode; - file_share->access = new_access; - file_share->handle_refs = 1; - *share_info = file_share; - } - } + file_share->device = device; + file_share->inode = inode; + file_share->opened_by_pid = _wapi_getpid (); + file_share->sharemode = new_sharemode; + file_share->access = new_access; + file_share->handle_refs = 1; + *share_info = file_share; - if (*share_info != NULL) { - InterlockedExchange ((gint32 *)&(*share_info)->timestamp, now); - } + g_hash_table_insert (file_share_hash, file_share, file_share); } + + file_share_hash_unlock (); thr_ret = _wapi_shm_sem_unlock (_WAPI_SHARED_SEM_FILESHARE); @@ -1928,7 +1809,7 @@ void _wapi_handle_dump (void) guint32 i, k; int thr_ret; - thr_ret = mono_mutex_lock (&scan_mutex); + thr_ret = mono_os_mutex_lock (&scan_mutex); g_assert (thr_ret == 0); for(i = SLOT_INDEX (0); i < _wapi_private_handle_slot_count; i++) { @@ -1952,7 +1833,7 @@ void _wapi_handle_dump (void) } } - thr_ret = mono_mutex_unlock (&scan_mutex); + thr_ret = mono_os_mutex_unlock (&scan_mutex); g_assert (thr_ret == 0); } @@ -1962,57 +1843,3 @@ static void _wapi_shared_details (gpointer handle_info) g_print ("offset: 0x%x", shared->offset); } - -void _wapi_handle_update_refs (void) -{ - guint32 i, k; - int thr_ret; - guint32 now = (guint32)(time (NULL) & 0xFFFFFFFF); - - thr_ret = _wapi_handle_lock_shared_handles (); - g_assert (thr_ret == 0); - - /* Prevent file share entries racing with us */ - thr_ret = _wapi_shm_sem_lock (_WAPI_SHARED_SEM_FILESHARE); - g_assert(thr_ret == 0); - - thr_ret = mono_mutex_lock (&scan_mutex); - - for(i = SLOT_INDEX (0); i < _wapi_private_handle_slot_count; i++) { - if (_wapi_private_handles [i]) { - for (k = SLOT_OFFSET (0); k < _WAPI_HANDLE_INITIAL_COUNT; k++) { - struct _WapiHandleUnshared *handle = &_wapi_private_handles [i][k]; - - if (_WAPI_SHARED_HANDLE(handle->type)) { - struct _WapiHandleShared *shared_data; - - DEBUG ("%s: (%d) handle 0x%x is SHARED (%s)", __func__, _wapi_getpid (), i * _WAPI_HANDLE_INITIAL_COUNT + k, _wapi_handle_typename[handle->type]); - - shared_data = &_wapi_shared_layout->handles[handle->u.shared.offset]; - - DEBUG ("%s: (%d) Updating timestamp of handle 0x%x", __func__, _wapi_getpid (), handle->u.shared.offset); - - InterlockedExchange ((gint32 *)&shared_data->timestamp, now); - } else if (handle->type == WAPI_HANDLE_FILE) { - struct _WapiHandle_file *file_handle = &handle->u.file; - - DEBUG ("%s: (%d) handle 0x%x is FILE", __func__, _wapi_getpid (), i * _WAPI_HANDLE_INITIAL_COUNT + k); - - g_assert (file_handle->share_info != NULL); - - DEBUG ("%s: (%d) Inc refs on fileshare 0x%x", __func__, _wapi_getpid (), (file_handle->share_info - &_wapi_fileshare_layout->share_info[0]) / sizeof(struct _WapiFileShare)); - - InterlockedExchange ((gint32 *)&file_handle->share_info->timestamp, now); - } - } - } - } - - thr_ret = mono_mutex_unlock (&scan_mutex); - g_assert (thr_ret == 0); - - thr_ret = _wapi_shm_sem_unlock (_WAPI_SHARED_SEM_FILESHARE); - - _wapi_handle_unlock_shared_handles (); -} - diff --git a/mono/io-layer/io-portability.c b/mono/io-layer/io-portability.c index b9674955380..8838c304e9c 100644 --- a/mono/io-layer/io-portability.c +++ b/mono/io-layer/io-portability.c @@ -30,8 +30,6 @@ #include #include -#include - #undef DEBUG int _wapi_open (const char *pathname, int flags, mode_t mode) diff --git a/mono/io-layer/io.c b/mono/io-layer/io.c index 685a8227491..e06a61aa9d5 100644 --- a/mono/io-layer/io.c +++ b/mono/io-layer/io.c @@ -43,6 +43,7 @@ #include #include #include +#include #if 0 #define DEBUG(...) g_message(__VA_ARGS__) @@ -1453,14 +1454,6 @@ static gboolean share_check (struct stat *statbuf, guint32 sharemode, share_info) == TRUE) { return (TRUE); } - - /* Still violating. It's possible that a process crashed - * while still holding a file handle, and that a non-mono - * process has the file open. (For example, C-c mcs while - * editing a source file.) As a last resort, run a handle - * collection, which will remove stale share entries. - */ - _wapi_handle_collect (); return(share_allows_open (statbuf, sharemode, fileaccess, share_info)); } @@ -1493,7 +1486,7 @@ static gboolean share_check (struct stat *statbuf, guint32 sharemode, gpointer CreateFile(const gunichar2 *name, guint32 fileaccess, guint32 sharemode, WapiSecurityAttributes *security, guint32 createmode, guint32 attrs, - gpointer template G_GNUC_UNUSED) + gpointer template_ G_GNUC_UNUSED) { struct _WapiHandle_file file_handle = {0}; gpointer handle; @@ -1507,7 +1500,7 @@ gpointer CreateFile(const gunichar2 *name, guint32 fileaccess, mode_t perms=0666; gchar *filename; int fd, ret; - int handle_type; + WapiHandleType handle_type; struct stat statbuf; mono_once (&io_ops_once, io_ops_init); @@ -2178,7 +2171,7 @@ gpointer GetStdHandle(WapiStdHandle stdhandle) handle = GINT_TO_POINTER (fd); - thr_ret = mono_mutex_lock (&stdhandle_mutex); + thr_ret = mono_os_mutex_lock (&stdhandle_mutex); g_assert (thr_ret == 0); ok = _wapi_lookup_handle (handle, WAPI_HANDLE_CONSOLE, @@ -2197,7 +2190,7 @@ gpointer GetStdHandle(WapiStdHandle stdhandle) } done: - thr_ret = mono_mutex_unlock (&stdhandle_mutex); + thr_ret = mono_os_mutex_unlock (&stdhandle_mutex); g_assert (thr_ret == 0); return(handle); @@ -3705,7 +3698,7 @@ append_to_mountpoint (LinuxMountInfoParseState *state) if (state->mountpoint_allocated) { if (state->mountpoint_index >= state->allocated_size) { guint32 newsize = (state->allocated_size << 1) + 1; - gchar *newbuf = g_malloc0 (newsize * sizeof (gchar)); + gchar *newbuf = (gchar *)g_malloc0 (newsize * sizeof (gchar)); memcpy (newbuf, state->mountpoint_allocated, state->mountpoint_index); g_free (state->mountpoint_allocated); @@ -3716,7 +3709,7 @@ append_to_mountpoint (LinuxMountInfoParseState *state) } else { if (state->mountpoint_index >= GET_LOGICAL_DRIVE_STRINGS_MOUNTPOINT_BUFFER) { state->allocated_size = (state->mountpoint_index << 1) + 1; - state->mountpoint_allocated = g_malloc0 (state->allocated_size * sizeof (gchar)); + state->mountpoint_allocated = (gchar *)g_malloc0 (state->allocated_size * sizeof (gchar)); memcpy (state->mountpoint_allocated, state->mountpoint, state->mountpoint_index); state->mountpoint_allocated [state->mountpoint_index++] = ch; } else @@ -4282,5 +4275,5 @@ GetVolumeInformation (const gunichar2 *path, gunichar2 *volumename, int volumesi void _wapi_io_init (void) { - mono_mutex_init (&stdhandle_mutex); + mono_os_mutex_init (&stdhandle_mutex); } diff --git a/mono/io-layer/io.h b/mono/io-layer/io.h index 12a1310d967..4c5a492b95b 100644 --- a/mono/io-layer/io.h +++ b/mono/io-layer/io.h @@ -177,7 +177,7 @@ extern gboolean WriteFile(gpointer handle, gconstpointer buffer, extern gboolean FlushFileBuffers(gpointer handle); extern gboolean SetEndOfFile(gpointer handle); extern guint32 SetFilePointer(gpointer handle, gint32 movedistance, - gint32 *highmovedistance, WapiSeekMethod method); + gint32 *highmovedistance, guint32 method); extern WapiFileType GetFileType(gpointer handle); extern guint32 GetFileSize(gpointer handle, guint32 *highsize); extern gboolean GetFileTime(gpointer handle, WapiFileTime *create_time, diff --git a/mono/io-layer/messages.c b/mono/io-layer/messages.c index 1b052dbaca7..9c5bd31e06a 100644 --- a/mono/io-layer/messages.c +++ b/mono/io-layer/messages.c @@ -15,7 +15,6 @@ #include #include -#include #include #include @@ -1831,7 +1830,7 @@ find_msg (guint32 id, ErrorDesc *base, int n) ErrorDesc d, *result; d.id = id; - result = mono_binary_search (&d, base, n, sizeof (ErrorDesc), msg_compare); + result = (ErrorDesc *)mono_binary_search (&d, base, n, sizeof (ErrorDesc), msg_compare); if (result == NULL) return NULL; return result->txt; diff --git a/mono/io-layer/misc-private.h b/mono/io-layer/misc-private.h deleted file mode 100644 index 60e8cd827b2..00000000000 --- a/mono/io-layer/misc-private.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * misc-private.h: Miscellaneous internal support functions - * - * Author: - * Dick Porter (dick@ximian.com) - * - * (C) 2002 Ximian, Inc. - */ - -#ifndef _WAPI_MISC_PRIVATE_H_ -#define _WAPI_MISC_PRIVATE_H_ - -#include -#include -#include - -extern void _wapi_calc_timeout(struct timespec *timeout, guint32 ms); - -#endif /* _WAPI_MISC_PRIVATE_H_ */ diff --git a/mono/io-layer/misc.c b/mono/io-layer/misc.c deleted file mode 100644 index 82835cc52b9..00000000000 --- a/mono/io-layer/misc.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * misc.c: Miscellaneous internal support functions - * - * Author: - * Dick Porter (dick@ximian.com) - * - * (C) 2002 Ximian, Inc. - */ - -#include -#include -#include -#include -#include - -#include "misc-private.h" - -void _wapi_calc_timeout(struct timespec *timeout, guint32 ms) -{ - struct timeval now; - div_t ms_divvy, overflow_divvy; - - gettimeofday (&now, NULL); - - ms_divvy = div (ms, 1000); - overflow_divvy = div ((now.tv_usec / 1000) + ms_divvy.rem, 1000); - - timeout->tv_sec = now.tv_sec + ms_divvy.quot + overflow_divvy.quot; - timeout->tv_nsec = overflow_divvy.rem * 1000000; -} diff --git a/mono/io-layer/mutexes.c b/mono/io-layer/mutexes.c index 56bd23a3f94..e1a4539a0b1 100644 --- a/mono/io-layer/mutexes.c +++ b/mono/io-layer/mutexes.c @@ -15,10 +15,9 @@ #include #include -#include #include #include -#include +#include #if 0 #define DEBUG(...) g_message(__VA_ARGS__) @@ -92,13 +91,9 @@ static mono_once_t mutex_ops_once=MONO_ONCE_INIT; static void mutex_ops_init (void) { _wapi_handle_register_capabilities (WAPI_HANDLE_MUTEX, - WAPI_HANDLE_CAP_WAIT | - WAPI_HANDLE_CAP_SIGNAL | - WAPI_HANDLE_CAP_OWN); + (WapiHandleCapability)(WAPI_HANDLE_CAP_WAIT | WAPI_HANDLE_CAP_SIGNAL | WAPI_HANDLE_CAP_OWN)); _wapi_handle_register_capabilities (WAPI_HANDLE_NAMEDMUTEX, - WAPI_HANDLE_CAP_WAIT | - WAPI_HANDLE_CAP_SIGNAL | - WAPI_HANDLE_CAP_OWN); + (WapiHandleCapability)(WAPI_HANDLE_CAP_WAIT | WAPI_HANDLE_CAP_SIGNAL | WAPI_HANDLE_CAP_OWN)); } static void mutex_signal(gpointer handle) diff --git a/mono/io-layer/process-private.h b/mono/io-layer/process-private.h index 86a8cf3137d..ddd6e863f36 100644 --- a/mono/io-layer/process-private.h +++ b/mono/io-layer/process-private.h @@ -13,6 +13,8 @@ #include #include +#include + /* There doesn't seem to be a defined symbol for this */ #define _WAPI_PROCESS_CURRENT (gpointer)0xFFFFFFFF diff --git a/mono/io-layer/processes.c b/mono/io-layer/processes.c index 96e72675c6a..851ffaffb6e 100644 --- a/mono/io-layer/processes.c +++ b/mono/io-layer/processes.c @@ -83,7 +83,6 @@ #include #include #include -#include #include #include #include @@ -91,9 +90,10 @@ #include #include #include -#include +#include #include #include +#include /* The process' environment strings */ #if defined(__APPLE__) @@ -1037,7 +1037,7 @@ gboolean CreateProcess (const gunichar2 *appname, const gunichar2 *cmdline, mono_process = (struct MonoProcess *) g_malloc0 (sizeof (struct MonoProcess)); mono_process->pid = pid; mono_process->handle_count = 1; - if (MONO_SEM_INIT (&mono_process->exit_sem, 0) != 0) { + if (mono_os_sem_init (&mono_process->exit_sem, 0) != 0) { /* If we can't create the exit semaphore, we just don't add anything * to our list of mono processes. Waiting on the process will return * immediately. */ @@ -1051,10 +1051,10 @@ gboolean CreateProcess (const gunichar2 *appname, const gunichar2 *cmdline, process_handle_data->mono_process = mono_process; - mono_mutex_lock (&mono_processes_mutex); + mono_os_mutex_lock (&mono_processes_mutex); mono_process->next = mono_processes; mono_processes = mono_process; - mono_mutex_unlock (&mono_processes_mutex); + mono_os_mutex_unlock (&mono_processes_mutex); } if (process_info != NULL) { @@ -1137,8 +1137,7 @@ wapi_processes_init (void) WapiHandle_process process_handle = {0}; _wapi_handle_register_capabilities (WAPI_HANDLE_PROCESS, - WAPI_HANDLE_CAP_WAIT | - WAPI_HANDLE_CAP_SPECIAL_WAIT); + (WapiHandleCapability)(WAPI_HANDLE_CAP_WAIT | WAPI_HANDLE_CAP_SPECIAL_WAIT)); process_handle.id = pid; @@ -1148,6 +1147,8 @@ wapi_processes_init (void) current_process = _wapi_handle_new (WAPI_HANDLE_PROCESS, &process_handle); g_assert (current_process); + + mono_os_mutex_init (&mono_processes_mutex); } gpointer @@ -1829,7 +1830,7 @@ gboolean EnumProcessModules (gpointer process, gpointer *modules, } for (i = 0; i < count; i++) { - free_procmodule (g_slist_nth_data (mods, i)); + free_procmodule ((WapiProcModule *)g_slist_nth_data (mods, i)); } g_slist_free (mods); g_free (proc_name); @@ -2585,10 +2586,10 @@ mono_processes_cleanup (void) if (mp->pid == 0 && mp->handle) { /* This process has exited and we need to remove the artifical ref * on the handle */ - mono_mutex_lock (&mono_processes_mutex); + mono_os_mutex_lock (&mono_processes_mutex); unref_handle = mp->handle; mp->handle = NULL; - mono_mutex_unlock (&mono_processes_mutex); + mono_os_mutex_unlock (&mono_processes_mutex); if (unref_handle) _wapi_handle_unref (unref_handle); } @@ -2600,7 +2601,7 @@ mono_processes_cleanup (void) * asynchronously. The handler requires that the mono_processes list * remain valid. */ - mono_mutex_lock (&mono_processes_mutex); + mono_os_mutex_lock (&mono_processes_mutex); mp = mono_processes; while (mp) { @@ -2631,13 +2632,13 @@ mono_processes_cleanup (void) * they have the 'finished' flag set, which means the sigchld handler is done * accessing them. */ - mp = l->data; - MONO_SEM_DESTROY (&mp->exit_sem); + mp = (MonoProcess *)l->data; + mono_os_sem_destroy (&mp->exit_sem); g_free (mp); } g_slist_free (finished); - mono_mutex_unlock (&mono_processes_mutex); + mono_os_mutex_unlock (&mono_processes_mutex); DEBUG ("%s done", __func__); @@ -2689,7 +2690,7 @@ MONO_SIGNAL_HANDLER_FUNC (static, mono_sigchld_signal_handler, (int _dummy, sigi if (p) { p->pid = 0; /* this pid doesn't exist anymore, clear it */ p->status = status; - MONO_SEM_POST (&p->exit_sem); + mono_os_sem_post (&p->exit_sem); mono_memory_barrier (); /* Mark this as freeable, the pointer becomes invalid afterwards */ p->freeable = TRUE; @@ -2759,12 +2760,11 @@ process_wait (gpointer handle, guint32 timeout, gboolean alertable) if (timeout != INFINITE) { DEBUG ("%s (%p, %u): waiting on semaphore for %li ms...", __func__, handle, timeout, (timeout - (now - start))); - - ret = MONO_SEM_TIMEDWAIT_ALERTABLE (&mp->exit_sem, (timeout - (now - start)), alertable); + ret = mono_os_sem_timedwait (&mp->exit_sem, (timeout - (now - start)), alertable ? MONO_SEM_FLAGS_ALERTABLE : MONO_SEM_FLAGS_NONE); } else { DEBUG ("%s (%p, %u): waiting on semaphore forever...", __func__, handle, timeout); - ret = MONO_SEM_WAIT_ALERTABLE (&mp->exit_sem, alertable); + ret = mono_os_sem_wait (&mp->exit_sem, alertable ? MONO_SEM_FLAGS_ALERTABLE : MONO_SEM_FLAGS_NONE); } if (ret == -1 && errno != EINTR && errno != ETIMEDOUT) { @@ -2775,7 +2775,7 @@ process_wait (gpointer handle, guint32 timeout, gboolean alertable) if (ret == 0) { /* Success, process has exited */ - MONO_SEM_POST (&mp->exit_sem); + mono_os_sem_post (&mp->exit_sem); break; } diff --git a/mono/io-layer/processes.h b/mono/io-layer/processes.h index c2b78d44387..a5ff917f4df 100644 --- a/mono/io-layer/processes.h +++ b/mono/io-layer/processes.h @@ -107,13 +107,13 @@ typedef struct _WapiShellExecuteInfo WapiShellExecuteInfo; struct _WapiShellExecuteInfo { guint32 cbSize; - WapiShellExecuteInfoFlags fMask; + gulong fMask; gpointer hwnd; const gunichar2 *lpVerb; const gunichar2 *lpFile; const gunichar2 *lpParameters; const gunichar2 *lpDirectory; - WapiShellExecuteShowFlags nShow; + gulong nShow; gpointer hInstApp; gpointer lpIDList; const gunichar2 *lpClass; diff --git a/mono/io-layer/semaphores.c b/mono/io-layer/semaphores.c index 44518304632..01179f4d182 100644 --- a/mono/io-layer/semaphores.c +++ b/mono/io-layer/semaphores.c @@ -19,11 +19,9 @@ #include #include -#include #include #include - -#include +#include #if 0 #define DEBUG(...) g_message(__VA_ARGS__) @@ -89,11 +87,9 @@ static mono_once_t sem_ops_once=MONO_ONCE_INIT; static void sem_ops_init (void) { _wapi_handle_register_capabilities (WAPI_HANDLE_SEM, - WAPI_HANDLE_CAP_WAIT | - WAPI_HANDLE_CAP_SIGNAL); + (WapiHandleCapability)(WAPI_HANDLE_CAP_WAIT | WAPI_HANDLE_CAP_SIGNAL)); _wapi_handle_register_capabilities (WAPI_HANDLE_NAMEDSEM, - WAPI_HANDLE_CAP_WAIT | - WAPI_HANDLE_CAP_SIGNAL); + (WapiHandleCapability)(WAPI_HANDLE_CAP_WAIT | WAPI_HANDLE_CAP_SIGNAL)); } static void sema_signal(gpointer handle) diff --git a/mono/io-layer/shared.c b/mono/io-layer/shared.c index f8539039cad..64a8b330d44 100644 --- a/mono/io-layer/shared.c +++ b/mono/io-layer/shared.c @@ -7,879 +7,49 @@ * (C) 2002-2006 Novell, Inc. */ - #include #include -#include -#include -#include -#include -#include -#include -#include - -#if defined(HAVE_SYS_SEM_H) && !(defined(__native_client__) && defined(__GLIBC__)) -# include -#else -# define DISABLE_SHARED_HANDLES -#endif - -#ifndef DISABLE_SHARED_HANDLES -# include -# include -# ifdef HAVE_SYS_UTSNAME_H -# include -# endif -#endif -#include #include #include -#include +#include #define DEBUGLOG(...) //#define DEBUGLOG(...) g_message(__VA_ARGS__); -// Semaphores used when no-shared-memory use is in use - static mono_mutex_t noshm_sems[_WAPI_SHARED_SEM_COUNT]; -static gpointer wapi_storage [16]; - -static void -noshm_semaphores_init (void) -{ - int i; - - for (i = 0; i < _WAPI_SHARED_SEM_COUNT; i++) - mono_mutex_init (&noshm_sems [i]); -} - -static int -noshm_sem_lock (int sem) -{ - int ret; - - DEBUGLOG ("%s: locking nosem %d", __func__, sem); - - ret = mono_mutex_lock (&noshm_sems[sem]); - - return ret; -} - -static int -noshm_sem_trylock (int sem) -{ - int ret; - - DEBUGLOG ("%s: trying to lock nosem %d", __func__, sem); - - ret = mono_mutex_trylock (&noshm_sems[sem]); - - return ret; -} - -static int -noshm_sem_unlock (int sem) -{ - int ret; - - DEBUGLOG ("%s: unlocking nosem %d", __func__, sem); - - ret = mono_mutex_unlock (&noshm_sems[sem]); - - return ret; -} - -#ifdef DISABLE_SHARED_HANDLES void _wapi_shm_semaphores_init (void) { - noshm_semaphores_init (); -} - -void -_wapi_shm_semaphores_remove (void) -{ - /* Nothing */ -} - -int -_wapi_shm_sem_lock (int sem) -{ - return noshm_sem_lock (sem); -} - -int -_wapi_shm_sem_trylock (int sem) -{ - return noshm_sem_trylock (sem); -} - -int -_wapi_shm_sem_unlock (int sem) -{ - return noshm_sem_unlock (sem); -} - -gpointer -_wapi_shm_attach (_wapi_shm_t type) -{ - gpointer res; - - switch(type) { - case WAPI_SHM_DATA: - res = g_malloc0 (sizeof(struct _WapiHandleSharedLayout)); - break; - case WAPI_SHM_FILESHARE: - res = g_malloc0 (sizeof(struct _WapiFileShareLayout)); - break; - default: - g_error ("Invalid type in _wapi_shm_attach ()"); - return NULL; - } - - wapi_storage [type] = res; - return res; -} - -void -_wapi_shm_detach (_wapi_shm_t type) -{ - g_free (wapi_storage [type]); -} - -gboolean -_wapi_shm_enabled_internal (void) -{ - return FALSE; -} - -#else /* DISABLE_SHARED_HANDLES */ - -/* - * Use POSIX shared memory if possible, it is simpler, and it has the advantage that - * writes to the shared area does not need to be written to disk, avoiding spinning up - * the disk every x secs on laptops. - */ -#ifdef HAVE_SHM_OPEN -#define USE_SHM 1 -#endif - -static gboolean _wapi_shm_disabled = TRUE; - -static gchar * -_wapi_shm_base_name (_wapi_shm_t type) -{ - gchar *name = NULL; - gchar machine_name[256]; - const gchar *fake_name; - struct utsname ubuf; - int ret; - int len; - - ret = uname (&ubuf); - if (ret == -1) { - ubuf.machine[0] = '\0'; - ubuf.sysname[0] = '\0'; - } else { - g_strdelimit (ubuf.sysname, "/", '_'); - g_strdelimit (ubuf.machine, "/", '_'); - } - - fake_name = g_getenv ("MONO_SHARED_HOSTNAME"); - if (fake_name == NULL) { - if (gethostname(machine_name, sizeof(machine_name)) != 0) - machine_name[0] = '\0'; - } else { - len = MIN (strlen (fake_name), sizeof (machine_name) - 1); - strncpy (machine_name, fake_name, len); - machine_name [len] = '\0'; - } - - switch (type) { - case WAPI_SHM_DATA: - name = g_strdup_printf ("shared_data-%s-%s-%s-%d-%d-%d", - machine_name, ubuf.sysname, - ubuf.machine, - (int) sizeof(struct _WapiHandleShared), - _WAPI_HANDLE_VERSION, 0); - break; - - case WAPI_SHM_FILESHARE: - name = g_strdup_printf ("shared_fileshare-%s-%s-%s-%d-%d-%d", - machine_name, ubuf.sysname, - ubuf.machine, - (int) sizeof(struct _WapiFileShare), - _WAPI_HANDLE_VERSION, 0); - break; - } - - return name; -} - -#ifdef USE_SHM - -static gchar *_wapi_shm_shm_name (_wapi_shm_t type) -{ - char *base_name = _wapi_shm_base_name (type); - - /* Also add the uid to avoid permission problems */ - char *res = g_strdup_printf ("/mono-shared-%d-%s", getuid (), base_name); - - g_free (base_name); - - return res; -} - -static int -_wapi_shm_open (const char *filename, int size) -{ - int fd; - - fd = shm_open (filename, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR|S_IRGRP); - if (fd == -1) - /* Maybe /dev/shm is not mounted */ - return -1; - if (ftruncate (fd, size) != 0) { - perror ("_wapi_shm_open (): ftruncate ()"); - g_assert_not_reached (); - } - - return fd; -} - -#endif - -static gchar * -_wapi_shm_file (_wapi_shm_t type) -{ - static gchar file[_POSIX_PATH_MAX]; - gchar *name = NULL, *filename; - const gchar *wapi_dir; - - name = _wapi_shm_base_name (type); - - /* I don't know how nfs affects mmap. If mmap() of files on - * nfs mounts breaks, then there should be an option to set - * the directory. - */ - wapi_dir = g_getenv ("MONO_SHARED_DIR"); - if (wapi_dir == NULL) { - filename = g_build_filename (g_get_home_dir (), ".wapi", name, - NULL); - } else { - filename = g_build_filename (wapi_dir, ".wapi", name, NULL); - } - g_free (name); - - g_snprintf (file, _POSIX_PATH_MAX, "%s", filename); - g_free (filename); - - return file; -} - -static int -_wapi_shm_file_open (const gchar *filename, guint32 wanted_size) -{ - int fd; - struct stat statbuf; - int ret, tries = 0; - gboolean created = FALSE; - mode_t oldmask; - gchar *dir; - - /* No need to check if the dir already exists or check - * mkdir() errors, because on any error the open() call will - * report the problem. - */ - dir = g_path_get_dirname (filename); - mkdir (dir, 0755); - g_free (dir); - -try_again: - if (tries++ > 10) { - /* Just give up */ - return (-1); - } else if (tries > 5) { - /* Break out of a loop */ - unlink (filename); - } - - /* Make sure future processes can open the shared data files */ - oldmask = umask (066); - - /* No O_CREAT yet, because we need to initialise the file if - * we have to create it. - */ - fd = open (filename, O_RDWR, 0600); - umask (oldmask); - - if (fd == -1 && errno == ENOENT) { - /* OK, its up to us to create it. O_EXCL to avoid a - * race condition where two processes can - * simultaneously try and create the file - */ - oldmask = umask (066); - fd = open (filename, O_CREAT|O_EXCL|O_RDWR, 0600); - umask (oldmask); - - if (fd == -1 && errno == EEXIST) { - /* It's possible that the file was created in - * between finding it didn't exist, and trying - * to create it. Just try opening it again - */ - goto try_again; - } else if (fd == -1) { - g_critical ("%s: shared file [%s] open error: %s", - __func__, filename, g_strerror (errno)); - return -1; - } else { - /* We created the file, so we need to expand - * the file. - * - * (wanted_size-1, because we're about to - * write the other byte to actually expand the - * file.) - */ - if (lseek (fd, wanted_size-1, SEEK_SET) == -1) { - g_critical ("%s: shared file [%s] lseek error: %s", __func__, filename, g_strerror (errno)); - close (fd); - unlink (filename); - return -1; - } - - do { - ret = write (fd, "", 1); - } while (ret == -1 && errno == EINTR); - - if (ret == -1) { - g_critical ("%s: shared file [%s] write error: %s", __func__, filename, g_strerror (errno)); - close (fd); - unlink (filename); - return -1; - } - - created = TRUE; - - /* The contents of the file is set to all - * zero, because it is opened up with lseek, - * so we don't need to do any more - * initialisation here - */ - } - } else if (fd == -1) { - g_critical ("%s: shared file [%s] open error: %s", __func__, - filename, g_strerror (errno)); - return -1; - } - - /* Use stat to find the file size (instead of hard coding it) - * because we can expand the file later if needed (for more - * handles or scratch space.) - */ - if (fstat (fd, &statbuf) == -1) { - g_critical ("%s: fstat error: %s", __func__, - g_strerror (errno)); - if (created == TRUE) { - unlink (filename); - } - close (fd); - return -1; - } - - if (statbuf.st_size < wanted_size) { - close (fd); - if (created == TRUE) { - g_critical ("%s: shared file [%s] is not big enough! (found %ld, need %d bytes)", __func__, filename, (long)statbuf.st_size, wanted_size); - unlink (filename); - return -1; - } else { - /* We didn't create it, so just try opening it again */ - _wapi_handle_spin (100); - goto try_again; - } - } - - return fd; -} - -gboolean -_wapi_shm_enabled_internal (void) -{ - static gboolean env_checked; - - if (!env_checked) { - if (g_getenv ("MONO_ENABLE_SHM")) - _wapi_shm_disabled = FALSE; - env_checked = TRUE; - } - - return !_wapi_shm_disabled; -} - -/* - * _wapi_shm_attach: - * @success: Was it a success - * - * Attach to the shared memory file or create it if it did not exist. - * Returns the memory area the file was mmapped to. - */ -gpointer -_wapi_shm_attach (_wapi_shm_t type) -{ - gpointer shm_seg; - int fd; - struct stat statbuf; - gchar *filename = _wapi_shm_file (type), *shm_name; - guint32 size; - - switch(type) { - case WAPI_SHM_DATA: - size = sizeof(struct _WapiHandleSharedLayout); - break; - - case WAPI_SHM_FILESHARE: - size = sizeof(struct _WapiFileShareLayout); - break; - default: - g_error ("Invalid type in _wapi_shm_attach ()"); - return NULL; - } - - if (!_wapi_shm_enabled ()) { - wapi_storage [type] = g_malloc0 (size); - return wapi_storage [type]; - } - -#ifdef USE_SHM - shm_name = _wapi_shm_shm_name (type); - fd = _wapi_shm_open (shm_name, size); - g_free (shm_name); -#else - fd = -1; -#endif - - /* Fall back to files if POSIX shm fails (for example, because /dev/shm is not mounted */ - if (fd == -1) - fd = _wapi_shm_file_open (filename, size); - if (fd == -1) { - g_critical ("%s: shared file [%s] open error", __func__, - filename); - return NULL; - } - - if (fstat (fd, &statbuf)==-1) { - g_critical ("%s: fstat error: %s", __func__, - g_strerror (errno)); - close (fd); - return NULL; - } - - shm_seg = mmap (NULL, statbuf.st_size, PROT_READ|PROT_WRITE, - MAP_SHARED, fd, 0); - if (shm_seg == MAP_FAILED) { - shm_seg = mmap (NULL, statbuf.st_size, PROT_READ|PROT_WRITE, - MAP_PRIVATE, fd, 0); - if (shm_seg == MAP_FAILED) { - g_critical ("%s: mmap error: %s", __func__, g_strerror (errno)); - close (fd); - return NULL; - } - } - - close (fd); - return shm_seg; -} - -void -_wapi_shm_detach (_wapi_shm_t type) -{ - if (!_wapi_shm_enabled ()) - g_free (wapi_storage [type]); -} - -static void -shm_semaphores_init (void) -{ - key_t key; - key_t oldkey; - int thr_ret; - struct _WapiHandleSharedLayout *tmp_shared; - gchar *ftmp; - gchar *filename; - - /* - * Yet more barmy API - this union is a well-defined parameter - * in a syscall, yet I still have to define it here as it - * doesn't appear in a header - */ - union semun { - int val; - struct semid_ds *buf; - ushort *array; - } defs; - ushort def_vals[_WAPI_SHARED_SEM_COUNT]; int i; - int retries = 0; - - for (i = 0; i < _WAPI_SHARED_SEM_COUNT; i++) { - def_vals[i] = 1; - } - - /* - * Process count must start at '0' - the 1 for all the others - * sets the semaphore to "unlocked" - */ - def_vals[_WAPI_SHARED_SEM_PROCESS_COUNT] = 0; - - defs.array = def_vals; - - /* - *Temporarily attach the shared data so we can read the - * semaphore key. We release this mapping and attach again - * after getting the semaphores to avoid a race condition - * where a terminating process can delete the shared files - * between a new process attaching the file and getting access - * to the semaphores (which increments the process count, - * preventing destruction of the shared data...) - */ - tmp_shared = _wapi_shm_attach (WAPI_SHM_DATA); - g_assert (tmp_shared != NULL); - -#ifdef USE_SHM - ftmp=_wapi_shm_shm_name (WAPI_SHM_DATA); - filename = g_build_filename ("/dev/shm", ftmp, NULL); - g_assert (filename!=NULL); - key = ftok (filename, 'M'); - g_free (ftmp); - g_free (filename); -#else - key = ftok ( _wapi_shm_file (WAPI_SHM_DATA), 'M'); -#endif - -again: - retries++; - oldkey = tmp_shared->sem_key; - - if (oldkey == 0) { - DEBUGLOG ("%s: Creating with new key (0x%x)", __func__, key); - - /* - * The while loop attempts to make some sense of the - * bonkers 'think of a random number' method of - * picking a key without collision with other - * applications - */ - while ((_wapi_sem_id = semget (key, _WAPI_SHARED_SEM_COUNT, - IPC_CREAT | IPC_EXCL | 0600)) == -1) { - if (errno == ENOMEM) { - g_error ("%s: semget error: %s", __func__, - g_strerror (errno)); - } else if (errno == ENOSPC) { - g_error ("%s: semget error: %s. Try deleting some semaphores with ipcs and ipcrm\nor increase the maximum number of semaphore in the system.", __func__, g_strerror (errno)); - } else if (errno != EEXIST) { - if (retries > 3) - g_warning ("%s: semget error: %s key 0x%x - trying again", __func__, - g_strerror (errno), key); - } - - key++; - DEBUGLOG ("%s: Got (%s), trying with new key (0x%x)", __func__, g_strerror (errno), key); - } - /* - * Got a semaphore array, so initialise it and install - * the key into the shared memory - */ - - if (semctl (_wapi_sem_id, 0, SETALL, defs) == -1) { - if (retries > 3) - g_warning ("%s: semctl init error: %s - trying again", __func__, g_strerror (errno)); - - /* - * Something went horribly wrong, so try - * getting a new set from scratch - */ - semctl (_wapi_sem_id, 0, IPC_RMID); - goto again; - } - - if (InterlockedCompareExchange (&tmp_shared->sem_key, - key, 0) != 0) { - /* - * Someone else created one and installed the - * key while we were working, so delete the - * array we created and fall through to the - * 'key already known' case. - */ - semctl (_wapi_sem_id, 0, IPC_RMID); - oldkey = tmp_shared->sem_key; - } else { - /* - * We've installed this semaphore set's key into - * the shared memory - */ - goto done; - } - } - - DEBUGLOG ("%s: Trying with old key 0x%x", __func__, oldkey); - - _wapi_sem_id = semget (oldkey, _WAPI_SHARED_SEM_COUNT, 0600); - if (_wapi_sem_id == -1) { - if (retries > 3) - g_warning ("%s: semget error opening old key 0x%x (%s) - trying again", - __func__, oldkey,g_strerror (errno)); - - /* - * Someone must have deleted the semaphore set, so - * blow away the bad key and try again - */ - InterlockedCompareExchange (&tmp_shared->sem_key, 0, oldkey); - - goto again; - } - - done: - /* Increment the usage count of this semaphore set */ - thr_ret = _wapi_shm_sem_lock (_WAPI_SHARED_SEM_PROCESS_COUNT_LOCK); - g_assert (thr_ret == 0); - - DEBUGLOG ("%s: Incrementing the process count (%d)", __func__, _wapi_getpid ()); - - /* - * We only ever _unlock_ this semaphore, letting the kernel - * restore (ie decrement) this unlock when this process exits. - * We lock another semaphore around it so we can serialise - * access when we're testing the value of this semaphore when - * we exit cleanly, so we can delete the whole semaphore set. - */ - _wapi_shm_sem_unlock (_WAPI_SHARED_SEM_PROCESS_COUNT); - - DEBUGLOG ("%s: Process count is now %d (%d)", __func__, semctl (_wapi_sem_id, _WAPI_SHARED_SEM_PROCESS_COUNT, GETVAL), _wapi_getpid ()); - - _wapi_shm_sem_unlock (_WAPI_SHARED_SEM_PROCESS_COUNT_LOCK); - - if (_wapi_shm_disabled) - g_free (tmp_shared); - else - munmap (tmp_shared, sizeof(struct _WapiHandleSharedLayout)); -} - -static void -shm_semaphores_remove (void) -{ - int thr_ret; - int proc_count; - gchar *shm_name; - - DEBUGLOG ("%s: Checking process count (%d)", __func__, _wapi_getpid ()); - - thr_ret = _wapi_shm_sem_lock (_WAPI_SHARED_SEM_PROCESS_COUNT_LOCK); - g_assert (thr_ret == 0); - - proc_count = semctl (_wapi_sem_id, _WAPI_SHARED_SEM_PROCESS_COUNT, - GETVAL); - - g_assert (proc_count > 0); - if (proc_count == 1) { - /* - * Just us, so blow away the semaphores and the shared - * files - */ - DEBUGLOG ("%s: Removing semaphores! (%d)", __func__, _wapi_getpid ()); - - semctl (_wapi_sem_id, 0, IPC_RMID); -#ifdef USE_SHM - shm_name = _wapi_shm_shm_name (WAPI_SHM_DATA); - shm_unlink (shm_name); - g_free (shm_name); - - shm_name = _wapi_shm_shm_name (WAPI_SHM_FILESHARE); - shm_unlink (shm_name); - g_free (shm_name); -#endif - unlink (_wapi_shm_file (WAPI_SHM_DATA)); - unlink (_wapi_shm_file (WAPI_SHM_FILESHARE)); - } else { - /* - * "else" clause, because there's no point unlocking - * the semaphore if we've just blown it away... - */ - _wapi_shm_sem_unlock (_WAPI_SHARED_SEM_PROCESS_COUNT_LOCK); - } -} - -static int -shm_sem_lock (int sem) -{ - struct sembuf ops; - int ret; - - DEBUGLOG ("%s: locking sem %d", __func__, sem); - - ops.sem_num = sem; - ops.sem_op = -1; - ops.sem_flg = SEM_UNDO; - - retry: - do { - ret = semop (_wapi_sem_id, &ops, 1); - } while (ret == -1 && errno == EINTR); - - if (ret == -1) { - /* - * EINVAL covers the case when the semaphore was - * deleted before we started the semop - */ - if (errno == EIDRM || errno == EINVAL) { - /* - * Someone blew away this semaphore set, so - * get a new one and try again - */ - DEBUGLOG ("%s: Reinitialising the semaphores!", __func__); - - _wapi_shm_semaphores_init (); - goto retry; - } - - /* Turn this into a pthreads-style return value */ - ret = errno; - } - - DEBUGLOG ("%s: returning %d (%s)", __func__, ret, g_strerror (ret)); - - return ret; -} - -static int -shm_sem_trylock (int sem) -{ - struct sembuf ops; - int ret; - - DEBUGLOG ("%s: trying to lock sem %d", __func__, sem); - - ops.sem_num = sem; - ops.sem_op = -1; - ops.sem_flg = IPC_NOWAIT | SEM_UNDO; - - retry: - do { - ret = semop (_wapi_sem_id, &ops, 1); - } while (ret == -1 && errno == EINTR); - - if (ret == -1) { - /* - * EINVAL covers the case when the semaphore was - * deleted before we started the semop - */ - if (errno == EIDRM || errno == EINVAL) { - /* - * Someone blew away this semaphore set, so - * get a new one and try again - */ - DEBUGLOG ("%s: Reinitialising the semaphores!", __func__); - - _wapi_shm_semaphores_init (); - goto retry; - } - - /* Turn this into a pthreads-style return value */ - ret = errno; - } - - if (ret == EAGAIN) { - /* But pthreads uses this code instead */ - ret = EBUSY; - } - - DEBUGLOG ("%s: returning %d (%s)", __func__, ret, g_strerror (ret)); - - return ret; -} - -static int -shm_sem_unlock (int sem) -{ - struct sembuf ops; - int ret; - - DEBUGLOG ("%s: unlocking sem %d", __func__, sem); - - ops.sem_num = sem; - ops.sem_op = 1; - ops.sem_flg = SEM_UNDO; - - retry: - do { - ret = semop (_wapi_sem_id, &ops, 1); - } while (ret == -1 && errno == EINTR); - - if (ret == -1) { - /* EINVAL covers the case when the semaphore was - * deleted before we started the semop - */ - if (errno == EIDRM || errno == EINVAL) { - /* Someone blew away this semaphore set, so - * get a new one and try again (we can't just - * assume that the semaphore is now unlocked) - */ - DEBUGLOG ("%s: Reinitialising the semaphores!", __func__); - - _wapi_shm_semaphores_init (); - goto retry; - } - - /* Turn this into a pthreads-style return value */ - ret = errno; - } - - DEBUGLOG ("%s: returning %d (%s)", __func__, ret, g_strerror (ret)); - - return ret; -} - -void -_wapi_shm_semaphores_init (void) -{ - if (!_wapi_shm_enabled ()) - noshm_semaphores_init (); - else - shm_semaphores_init (); + for (i = 0; i < _WAPI_SHARED_SEM_COUNT; i++) + mono_os_mutex_init (&noshm_sems [i]); } void _wapi_shm_semaphores_remove (void) { - if (!_wapi_shm_disabled) - shm_semaphores_remove (); + /* Nothing */ } int _wapi_shm_sem_lock (int sem) { - if (_wapi_shm_disabled) - return noshm_sem_lock (sem); - else - return shm_sem_lock (sem); + DEBUGLOG ("%s: locking nosem %d", __func__, sem); + return mono_os_mutex_lock (&noshm_sems[sem]); } int _wapi_shm_sem_trylock (int sem) { - if (_wapi_shm_disabled) - return noshm_sem_trylock (sem); - else - return shm_sem_trylock (sem); + DEBUGLOG ("%s: trying to lock nosem %d", __func__, sem); + return mono_os_mutex_trylock (&noshm_sems[sem]); } int _wapi_shm_sem_unlock (int sem) { - if (_wapi_shm_disabled) - return noshm_sem_unlock (sem); - else - return shm_sem_unlock (sem); + DEBUGLOG ("%s: unlocking nosem %d", __func__, sem); + return mono_os_mutex_unlock (&noshm_sems[sem]); } -#endif /* !DISABLE_SHARED_HANDLES */ diff --git a/mono/io-layer/shared.h b/mono/io-layer/shared.h index 5f66a732e6d..4807adc5a8e 100644 --- a/mono/io-layer/shared.h +++ b/mono/io-layer/shared.h @@ -10,30 +10,10 @@ #ifndef _WAPI_SHARED_H_ #define _WAPI_SHARED_H_ -#include - -typedef enum { - WAPI_SHM_DATA, - WAPI_SHM_FILESHARE -} _wapi_shm_t; - -extern gpointer _wapi_shm_attach (_wapi_shm_t type); -extern void _wapi_shm_detach (_wapi_shm_t type); -extern gboolean _wapi_shm_enabled_internal (void); extern void _wapi_shm_semaphores_init (void); extern void _wapi_shm_semaphores_remove (void); extern int _wapi_shm_sem_lock (int sem); extern int _wapi_shm_sem_trylock (int sem); extern int _wapi_shm_sem_unlock (int sem); -static inline gboolean -_wapi_shm_enabled (void) -{ -#ifdef DISABLE_SHARED_HANDLES - return FALSE; -#else - return _wapi_shm_enabled_internal (); -#endif -} - #endif /* _WAPI_SHARED_H_ */ diff --git a/mono/io-layer/sockets.c b/mono/io-layer/sockets.c index c5279448570..54c8798637c 100644 --- a/mono/io-layer/sockets.c +++ b/mono/io-layer/sockets.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -840,10 +841,10 @@ guint32 _wapi_socket(int domain, int type, int protocol, void *unused, * https://bugzilla.novell.com/show_bug.cgi?id=MONO53992 */ { - int ret, true = 1; + int ret, true_ = 1; - ret = setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, &true, - sizeof (true)); + ret = setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, &true_, + sizeof (true_)); if (ret == -1) { int errnum = errno; @@ -1164,7 +1165,7 @@ WSAIoctl (guint32 fd, gint32 command, } if (i_len > 0) { - buffer = g_memdup (input, i_len); + buffer = (char *)g_memdup (input, i_len); } ret = ioctl (fd, command, buffer); diff --git a/mono/io-layer/sockets.h b/mono/io-layer/sockets.h index 13ae9961477..d634ae956ec 100644 --- a/mono/io-layer/sockets.h +++ b/mono/io-layer/sockets.h @@ -72,7 +72,7 @@ typedef struct #define SIO_KEEPALIVE_VALS 0x98000004 typedef gboolean (*WapiDisconnectExFn)(guint32, WapiOverlapped *, guint32, - WapiTransmitFileFlags); + guint32); typedef gboolean (*WapiTransmitFileFn)(guint32, gpointer, guint32, guint32, WapiOverlapped *, WapiTransmitFileBuffers *, diff --git a/mono/io-layer/thread-private.h b/mono/io-layer/thread-private.h index 3ea1af11978..3cf5535c5b8 100644 --- a/mono/io-layer/thread-private.h +++ b/mono/io-layer/thread-private.h @@ -13,7 +13,6 @@ #include #include #include -#include /* There doesn't seem to be a defined symbol for this */ #define _WAPI_THREAD_CURRENT (gpointer)0xFFFFFFFE diff --git a/mono/io-layer/versioninfo.c b/mono/io-layer/versioninfo.c index 2dc95f32615..8a147e1f2e4 100644 --- a/mono/io-layer/versioninfo.c +++ b/mono/io-layer/versioninfo.c @@ -901,7 +901,7 @@ VerQueryValue (gconstpointer datablock, const gunichar2 *subblock, gpointer *buf string_value != NULL && string_value_len != 0) { *buffer = string_value; - *len = unicode_chars (string_value) + 1; /* Include trailing null */ + *len = unicode_chars ((const gunichar2 *)string_value) + 1; /* Include trailing null */ ret = TRUE; goto done; } diff --git a/mono/io-layer/wait.c b/mono/io-layer/wait.c index 42fc96fe4fb..2d94e91d4fd 100644 --- a/mono/io-layer/wait.c +++ b/mono/io-layer/wait.c @@ -15,9 +15,6 @@ #include #include #include -#include - -#include #if 0 #define DEBUG(...) g_message(__VA_ARGS__) @@ -92,7 +89,6 @@ guint32 WaitForSingleObjectEx(gpointer handle, guint32 timeout, gboolean alertable) { guint32 ret, waited; - struct timespec abstime; int thr_ret; gboolean apc_pending = FALSE; gpointer current_thread = wapi_get_current_thread_handle (); @@ -164,10 +160,6 @@ guint32 WaitForSingleObjectEx(gpointer handle, guint32 timeout, ret = WAIT_TIMEOUT; goto done; } - /* Have to wait for it */ - if (timeout != INFINITE) { - _wapi_calc_timeout (&abstime, timeout); - } do { /* Check before waiting on the condition, just in case @@ -182,7 +174,7 @@ guint32 WaitForSingleObjectEx(gpointer handle, guint32 timeout, goto done; } - waited = _wapi_handle_timedwait_signal_handle (handle, timeout == INFINITE ? NULL : &abstime, alertable, FALSE, &apc_pending); + waited = _wapi_handle_timedwait_signal_handle (handle, timeout, alertable, FALSE, &apc_pending); if(waited==0 && !apc_pending) { /* Condition was signalled, so hopefully @@ -262,7 +254,6 @@ guint32 SignalObjectAndWait(gpointer signal_handle, gpointer wait, guint32 timeout, gboolean alertable) { guint32 ret, waited; - struct timespec abstime; int thr_ret; gboolean apc_pending = FALSE; gpointer current_thread = wapi_get_current_thread_handle (); @@ -340,11 +331,6 @@ guint32 SignalObjectAndWait(gpointer signal_handle, gpointer wait, goto done; } - /* Have to wait for it */ - if (timeout != INFINITE) { - _wapi_calc_timeout (&abstime, timeout); - } - do { /* Check before waiting on the condition, just in case */ @@ -357,7 +343,7 @@ guint32 SignalObjectAndWait(gpointer signal_handle, gpointer wait, goto done; } - waited = _wapi_handle_timedwait_signal_handle (wait, timeout == INFINITE ? NULL : &abstime, alertable, FALSE, &apc_pending); + waited = _wapi_handle_timedwait_signal_handle (wait, timeout, alertable, FALSE, &apc_pending); if (waited==0 && !apc_pending) { /* Condition was signalled, so hopefully @@ -456,7 +442,6 @@ guint32 WaitForMultipleObjectsEx(guint32 numobjects, gpointer *handles, { gboolean duplicate = FALSE, bogustype = FALSE, done; guint32 count, lowest; - struct timespec abstime; guint i; guint32 ret; int thr_ret; @@ -551,10 +536,6 @@ guint32 WaitForMultipleObjectsEx(guint32 numobjects, gpointer *handles, /* Have to wait for some or all handles to become signalled */ - if(timeout!=INFINITE) { - _wapi_calc_timeout (&abstime, timeout); - } - for (i = 0; i < numobjects; i++) { /* Add a reference, as we need to ensure the handle wont * disappear from under us while we're waiting in the loop @@ -595,7 +576,7 @@ guint32 WaitForMultipleObjectsEx(guint32 numobjects, gpointer *handles, if (!done) { /* Enter the wait */ - ret = _wapi_handle_timedwait_signal (timeout == INFINITE ? NULL : &abstime, poll, &apc_pending); + ret = _wapi_handle_timedwait_signal (timeout, poll, &apc_pending); } else { /* No need to wait */ ret = 0; diff --git a/mono/io-layer/wapi-private.h b/mono/io-layer/wapi-private.h index ee228b070f9..e01cdf6804c 100644 --- a/mono/io-layer/wapi-private.h +++ b/mono/io-layer/wapi-private.h @@ -14,9 +14,12 @@ #include #include +#include #include #include +#include + /* Increment this whenever an incompatible change is made to the * shared handle structure. */ @@ -171,7 +174,7 @@ struct _WapiHandleSharedLayout struct _WapiHandleShared handles[_WAPI_HANDLE_INITIAL_COUNT]; }; -#define _WAPI_FILESHARE_SIZE 102400 +typedef struct _WapiHandleSharedLayout _WapiHandleSharedLayout; struct _WapiFileShare { @@ -189,15 +192,6 @@ struct _WapiFileShare typedef struct _WapiFileShare _WapiFileShare; -struct _WapiFileShareLayout -{ - guint32 hwm; - - struct _WapiFileShare share_info[_WAPI_FILESHARE_SIZE]; -}; - - - #define _WAPI_HANDLE_INVALID (gpointer)-1 #endif /* _WAPI_PRIVATE_H_ */ diff --git a/mono/io-layer/wapi.h b/mono/io-layer/wapi.h index c2a89920c34..c6cbecd49c5 100644 --- a/mono/io-layer/wapi.h +++ b/mono/io-layer/wapi.h @@ -31,6 +31,4 @@ #include #include -#include - #endif /* _WAPI_WAPI_H_ */ diff --git a/mono/io-layer/wapi_glob.c b/mono/io-layer/wapi_glob.c index 31c7f6d9411..88864821be4 100644 --- a/mono/io-layer/wapi_glob.c +++ b/mono/io-layer/wapi_glob.c @@ -266,8 +266,9 @@ globextend(const gchar *path, wapi_glob_t *pglob, size_t *limitp) const gchar *p; newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs); - pathv = pglob->gl_pathv ? realloc((char *)pglob->gl_pathv, newsize) : - malloc(newsize); + /* FIXME: Can just use realloc(). */ + pathv = (char **)(pglob->gl_pathv ? realloc((char *)pglob->gl_pathv, newsize) : + malloc(newsize)); if (pathv == NULL) { if (pglob->gl_pathv) { free(pglob->gl_pathv); @@ -288,7 +289,7 @@ globextend(const gchar *path, wapi_glob_t *pglob, size_t *limitp) ; len = (size_t)(p - path); *limitp += len; - if ((copy = malloc(len)) != NULL) { + if ((copy = (char *)malloc(len)) != NULL) { if (g_Ctoc(path, copy, len)) { free(copy); return(WAPI_GLOB_NOSPACE); diff --git a/mono/io-layer/wthreads.c b/mono/io-layer/wthreads.c index aac5bbeaacd..5245f6df906 100644 --- a/mono/io-layer/wthreads.c +++ b/mono/io-layer/wthreads.c @@ -23,14 +23,13 @@ #include #include #include -#include #include #include #include #include -#include #include +#include #ifdef HAVE_VALGRIND_MEMCHECK_H #include diff --git a/mono/metadata/appdomain.c b/mono/metadata/appdomain.c index 0e57d84fb44..89c163c83ee 100644 --- a/mono/metadata/appdomain.c +++ b/mono/metadata/appdomain.c @@ -237,8 +237,8 @@ mono_runtime_init (MonoDomain *domain, MonoThreadStartCB start_cb, mono_install_assembly_refonly_preload_hook (mono_domain_assembly_preload, GUINT_TO_POINTER (TRUE)); mono_install_assembly_search_hook (mono_domain_assembly_search, GUINT_TO_POINTER (FALSE)); mono_install_assembly_refonly_search_hook (mono_domain_assembly_search, GUINT_TO_POINTER (TRUE)); - mono_install_assembly_postload_search_hook ((void*)mono_domain_assembly_postload_search, GUINT_TO_POINTER (FALSE)); - mono_install_assembly_postload_refonly_search_hook ((void*)mono_domain_assembly_postload_search, GUINT_TO_POINTER (TRUE)); + mono_install_assembly_postload_search_hook ((MonoAssemblySearchFunc)mono_domain_assembly_postload_search, GUINT_TO_POINTER (FALSE)); + mono_install_assembly_postload_refonly_search_hook ((MonoAssemblySearchFunc)mono_domain_assembly_postload_search, GUINT_TO_POINTER (TRUE)); mono_install_assembly_load_hook (mono_domain_fire_assembly_load, NULL); mono_install_lookup_dynamic_token (mono_reflection_lookup_dynamic_token); @@ -647,7 +647,7 @@ ves_icall_System_AppDomain_GetData (MonoAppDomain *ad, MonoString *name) else if (!strcmp (str, "FORCE_CACHE_INSTALL")) o = (MonoObject *)add->setup->shadow_copy_files; else - o = mono_g_hash_table_lookup (add->env, name); + o = (MonoObject *)mono_g_hash_table_lookup (add->env, name); mono_domain_unlock (add); g_free (str); @@ -731,7 +731,7 @@ start_element (GMarkupParseContext *context, gpointer user_data, GError **error) { - RuntimeConfig *runtime_config = user_data; + RuntimeConfig *runtime_config = (RuntimeConfig *)user_data; if (strcmp (element_name, "runtime") == 0) { runtime_config->runtime_count++; @@ -764,7 +764,7 @@ end_element (GMarkupParseContext *context, gpointer user_data, GError **error) { - RuntimeConfig *runtime_config = user_data; + RuntimeConfig *runtime_config = (RuntimeConfig *)user_data; if (strcmp (element_name, "runtime") == 0) runtime_config->runtime_count--; else if (strcmp (element_name, "assemblyBinding") == 0) @@ -774,7 +774,7 @@ end_element (GMarkupParseContext *context, static void parse_error (GMarkupParseContext *context, GError *error, gpointer user_data) { - RuntimeConfig *state = user_data; + RuntimeConfig *state = (RuntimeConfig *)user_data; const gchar *msg; const gchar *filename; @@ -827,7 +827,7 @@ mono_set_private_bin_path_from_config (MonoDomain *domain) if (len > 3 && text [0] == '\xef' && text [1] == (gchar) '\xbb' && text [2] == '\xbf') offset = 3; /* Skip UTF-8 BOM */ - context = g_markup_parse_context_new (&mono_parser, 0, &runtime_config, NULL); + context = g_markup_parse_context_new (&mono_parser, (GMarkupParseFlags)0, &runtime_config, NULL); if (g_markup_parse_context_parse (context, text + offset, len - offset, NULL)) g_markup_parse_context_end_parse (context, NULL); g_markup_parse_context_free (context); @@ -878,7 +878,7 @@ ves_icall_System_AppDomain_GetAssemblies (MonoAppDomain *ad, MonoBoolean refonly /* Need to skip internal assembly builders created by remoting */ mono_domain_assemblies_lock (domain); for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) { - ass = tmp->data; + ass = (MonoAssembly *)tmp->data; if (refonly != ass->ref_only) continue; if (ass->corlib_internal) @@ -889,7 +889,7 @@ ves_icall_System_AppDomain_GetAssemblies (MonoAppDomain *ad, MonoBoolean refonly res = mono_array_new (domain, System_Reflection_Assembly, assemblies->len); for (i = 0; i < assemblies->len; ++i) { - ass = g_ptr_array_index (assemblies, i); + ass = (MonoAssembly *)g_ptr_array_index (assemblies, i); mono_array_setref (res, i, mono_assembly_get_object (domain, ass)); } @@ -1142,7 +1142,7 @@ set_domain_search_path (MonoDomain *domain) if (domain->search_path) g_strfreev (domain->search_path); - tmp = g_malloc ((npaths + 1) * sizeof (gchar *)); + tmp = (gchar **)g_malloc ((npaths + 1) * sizeof (gchar *)); tmp [npaths] = NULL; *tmp = mono_string_to_utf8_checked (setup->application_base, &error); @@ -1521,7 +1521,7 @@ shadow_copy_create_ini (const char *shadow, const char *filename) if (!u16_ini) { return FALSE; } - handle = CreateFile (u16_ini, GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, + handle = (void **)CreateFile (u16_ini, GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, CREATE_NEW, FileAttributes_Normal, NULL); g_free (u16_ini); if (handle == INVALID_HANDLE_VALUE) { @@ -1864,7 +1864,7 @@ mono_domain_assembly_search (MonoAssemblyName *aname, mono_domain_assemblies_lock (domain); for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) { - ass = tmp->data; + ass = (MonoAssembly *)tmp->data; /* Dynamic assemblies can't match here in MS.NET */ if (assembly_is_dynamic (ass) || refonly != ass->ref_only || !mono_assembly_names_equal (aname, &ass->aname)) continue; @@ -2221,7 +2221,7 @@ deregister_reflection_info_roots_from_list (MonoImage *image) GSList *list = image->reflection_info_unregister_classes; while (list) { - MonoClass *klass = list->data; + MonoClass *klass = (MonoClass *)list->data; mono_class_free_ref_info (klass); @@ -2238,7 +2238,7 @@ deregister_reflection_info_roots (MonoDomain *domain) mono_domain_assemblies_lock (domain); for (list = domain->domain_assemblies; list; list = list->next) { - MonoAssembly *assembly = list->data; + MonoAssembly *assembly = (MonoAssembly *)list->data; MonoImage *image = assembly->image; int i; @@ -2310,11 +2310,11 @@ unload_thread_main (void *arg) * the collection there won't be any more remsets. */ for (i = 0; i < domain->class_vtable_array->len; ++i) - zero_static_data (g_ptr_array_index (domain->class_vtable_array, i)); + zero_static_data ((MonoVTable *)g_ptr_array_index (domain->class_vtable_array, i)); mono_gc_collect (0); #endif for (i = 0; i < domain->class_vtable_array->len; ++i) - clear_cached_vtable (g_ptr_array_index (domain->class_vtable_array, i)); + clear_cached_vtable ((MonoVTable *)g_ptr_array_index (domain->class_vtable_array, i)); deregister_reflection_info_roots (domain); mono_assembly_cleanup_domain_bindings (domain->domain_id); @@ -2408,9 +2408,9 @@ mono_domain_try_unload (MonoDomain *domain, MonoObject **exc) /* printf ("UNLOAD STARTING FOR %s (%p) IN THREAD 0x%x.\n", domain->friendly_name, domain, mono_native_thread_id_get ()); */ /* Atomically change our state to UNLOADING */ - prev_state = InterlockedCompareExchange ((gint32*)&domain->state, - MONO_APPDOMAIN_UNLOADING_START, - MONO_APPDOMAIN_CREATED); + prev_state = (MonoAppDomainState)InterlockedCompareExchange ((gint32*)&domain->state, + MONO_APPDOMAIN_UNLOADING_START, + MONO_APPDOMAIN_CREATED); if (prev_state != MONO_APPDOMAIN_CREATED) { switch (prev_state) { case MONO_APPDOMAIN_UNLOADING_START: diff --git a/mono/metadata/assembly.c b/mono/metadata/assembly.c index 3ea11123186..a3916463b69 100644 --- a/mono/metadata/assembly.c +++ b/mono/metadata/assembly.c @@ -37,7 +37,7 @@ #include #include #include -#include +#include #ifndef HOST_WIN32 #include @@ -182,8 +182,8 @@ mono_set_corlib_data (void *data, size_t size) static char* unquote (const char *str); /* This protects loaded_assemblies and image->references */ -#define mono_assemblies_lock() mono_mutex_lock (&assemblies_mutex) -#define mono_assemblies_unlock() mono_mutex_unlock (&assemblies_mutex) +#define mono_assemblies_lock() mono_os_mutex_lock (&assemblies_mutex) +#define mono_assemblies_unlock() mono_os_mutex_unlock (&assemblies_mutex) static mono_mutex_t assemblies_mutex; /* If defined, points to the bundled assembly information */ @@ -208,7 +208,7 @@ encode_public_tok (const guchar *token, gint32 len) gchar *res; int i; - res = g_malloc (len * 2 + 1); + res = (gchar *)g_malloc (len * 2 + 1); for (i = 0; i < len; i++) { res [i * 2] = allowed [token [i] >> 4]; res [i * 2 + 1] = allowed [token [i] & 0xF]; @@ -752,20 +752,20 @@ mono_assemblies_init (void) check_path_env (); check_extra_gac_path_env (); - mono_mutex_init_recursive (&assemblies_mutex); - mono_mutex_init (&assembly_binding_mutex); + mono_os_mutex_init_recursive (&assemblies_mutex); + mono_os_mutex_init (&assembly_binding_mutex); } static void mono_assembly_binding_lock (void) { - mono_locks_mutex_acquire (&assembly_binding_mutex, AssemblyBindingLock); + mono_locks_os_acquire (&assembly_binding_mutex, AssemblyBindingLock); } static void mono_assembly_binding_unlock (void) { - mono_locks_mutex_release (&assembly_binding_mutex, AssemblyBindingLock); + mono_locks_os_release (&assembly_binding_mutex, AssemblyBindingLock); } gboolean @@ -791,7 +791,7 @@ mono_assembly_fill_assembly_name (MonoImage *image, MonoAssemblyName *aname) aname->revision = cols [MONO_ASSEMBLY_REV_NUMBER]; aname->hash_alg = cols [MONO_ASSEMBLY_HASH_ALG]; if (cols [MONO_ASSEMBLY_PUBLIC_KEY]) { - guchar* token = g_malloc (8); + guchar* token = (guchar *)g_malloc (8); gchar* encoded; const gchar* pkey; int len; @@ -1116,7 +1116,7 @@ mono_assembly_load_reference (MonoImage *image, int index) * a non loaded reference using the ReflectionOnly api */ if (!reference) - reference = REFERENCE_MISSING; + reference = (MonoAssembly *)REFERENCE_MISSING; } else { /* we first try without setting the basedir: this can eventually result in a ResolveAssembly * event which is the MS .net compatible behaviour (the assemblyresolve_event3.cs test has been fixed @@ -1157,7 +1157,7 @@ mono_assembly_load_reference (MonoImage *image, int index) mono_assemblies_lock (); if (reference == NULL) { /* Flag as not found */ - reference = REFERENCE_MISSING; + reference = (MonoAssembly *)REFERENCE_MISSING; } if (!image->references [index]) { @@ -1937,10 +1937,10 @@ parse_public_key (const gchar *key, gchar** pubkey, gboolean *is_ecma) /* Encode the size of the blob */ offset = 0; if (keylen <= 127) { - arr = g_malloc (keylen + 1); + arr = (gchar *)g_malloc (keylen + 1); arr [offset++] = keylen; } else { - arr = g_malloc (keylen + 2); + arr = (gchar *)g_malloc (keylen + 2); arr [offset++] = 0x80; /* 10bs */ arr [offset++] = keylen; } @@ -2547,7 +2547,7 @@ mono_assembly_load_publisher_policy (MonoAssemblyName *aname) if (strstr (aname->name, ".dll")) { len = strlen (aname->name) - 4; - name = g_malloc (len); + name = (gchar *)g_malloc (len); strncpy (name, aname->name, len); } else name = g_strdup (aname->name); @@ -2613,7 +2613,7 @@ search_binding_loaded (MonoAssemblyName *aname) GSList *tmp; for (tmp = loaded_assembly_bindings; tmp; tmp = tmp->next) { - MonoAssemblyBindingInfo *info = tmp->data; + MonoAssemblyBindingInfo *info = (MonoAssemblyBindingInfo *)tmp->data; if (assembly_binding_maps_name (info, aname)) return info; } @@ -2668,12 +2668,12 @@ assembly_binding_info_parsed (MonoAssemblyBindingInfo *info, void *user_data) return; for (tmp = domain->assembly_bindings; tmp; tmp = tmp->next) { - info_tmp = tmp->data; + info_tmp = (MonoAssemblyBindingInfo *)tmp->data; if (strcmp (info->name, info_tmp->name) == 0 && info_versions_equal (info, info_tmp)) return; } - info_copy = mono_mempool_alloc0 (domain->mp, sizeof (MonoAssemblyBindingInfo)); + info_copy = (MonoAssemblyBindingInfo *)mono_mempool_alloc0 (domain->mp, sizeof (MonoAssemblyBindingInfo)); memcpy (info_copy, info, sizeof (MonoAssemblyBindingInfo)); if (info->name) info_copy->name = mono_mempool_strdup (domain->mp, info->name); @@ -2721,7 +2721,7 @@ get_per_domain_assembly_binding_info (MonoDomain *domain, MonoAssemblyName *anam info = NULL; for (list = domain->assembly_bindings; list; list = list->next) { - info = list->data; + info = (MonoAssemblyBindingInfo *)list->data; if (info && !strcmp (aname->name, info->name) && info_major_minor_in_range (info, aname)) break; info = NULL; @@ -2787,7 +2787,7 @@ mono_assembly_apply_binding (MonoAssemblyName *aname, MonoAssemblyName *dest_nam info2 = get_per_domain_assembly_binding_info (domain, aname); if (info2) { - info = g_memdup (info2, sizeof (MonoAssemblyBindingInfo)); + info = (MonoAssemblyBindingInfo *)g_memdup (info2, sizeof (MonoAssemblyBindingInfo)); info->name = g_strdup (info2->name); info->culture = g_strdup (info2->culture); info->domain_id = domain->domain_id; @@ -2858,7 +2858,7 @@ mono_assembly_load_from_gac (MonoAssemblyName *aname, gchar *filename, MonoImag if (strstr (aname->name, ".dll")) { len = strlen (filename) - 4; - name = g_malloc (len); + name = (gchar *)g_malloc (len); strncpy (name, aname->name, len); } else { name = g_strdup (aname->name); @@ -3173,7 +3173,7 @@ mono_assembly_close_except_image_pools (MonoAssembly *assembly) assembly->image = NULL; for (tmp = assembly->friend_assembly_names; tmp; tmp = tmp->next) { - MonoAssemblyName *fname = tmp->data; + MonoAssemblyName *fname = (MonoAssemblyName *)tmp->data; mono_assembly_name_free (fname); g_free (fname); } @@ -3248,11 +3248,11 @@ mono_assemblies_cleanup (void) { GSList *l; - mono_mutex_destroy (&assemblies_mutex); - mono_mutex_destroy (&assembly_binding_mutex); + mono_os_mutex_destroy (&assemblies_mutex); + mono_os_mutex_destroy (&assembly_binding_mutex); for (l = loaded_assembly_bindings; l; l = l->next) { - MonoAssemblyBindingInfo *info = l->data; + MonoAssemblyBindingInfo *info = (MonoAssemblyBindingInfo *)l->data; mono_assembly_binding_info_free (info); g_free (info); @@ -3274,7 +3274,7 @@ mono_assembly_cleanup_domain_bindings (guint32 domain_id) iter = &loaded_assembly_bindings; while (*iter) { GSList *l = *iter; - MonoAssemblyBindingInfo *info = l->data; + MonoAssemblyBindingInfo *info = (MonoAssemblyBindingInfo *)l->data; if (info->domain_id == domain_id) { *iter = l->next; diff --git a/mono/metadata/attach.c b/mono/metadata/attach.c index cea84bc86ef..4f5024a72f0 100644 --- a/mono/metadata/attach.c +++ b/mono/metadata/attach.c @@ -99,10 +99,6 @@ static gboolean stop_receiver_thread; static gboolean needs_to_start, started; -#define agent_lock() mono_mutex_lock (&agent_mutex) -#define agent_unlock() mono_mutex_unlock (&agent_mutex) -static mono_mutex_t agent_mutex; - static void transport_connect (void); static guint32 WINAPI receiver_thread (void *arg); @@ -156,7 +152,7 @@ decode_string_value (guint8 *buf, guint8 **endbuf, guint8 *limit) g_assert (length < (1 << 16)); - s = g_malloc (length + 1); + s = (char *)g_malloc (length + 1); g_assert (p + length <= limit); memcpy (s, p, length); @@ -184,8 +180,6 @@ mono_attach_parse_options (char *options) void mono_attach_init (void) { - mono_mutex_init_recursive (&agent_mutex); - config.enabled = TRUE; } @@ -530,7 +524,7 @@ receiver_thread (void *arg) content_len = decode_int (p, &p, p_end); /* Read message body */ - body = g_malloc (content_len); + body = (guint8 *)g_malloc (content_len); res = read (conn_fd, body, content_len); p = body; diff --git a/mono/metadata/boehm-gc.c b/mono/metadata/boehm-gc.c index 666f6381ebc..0bd92412414 100644 --- a/mono/metadata/boehm-gc.c +++ b/mono/metadata/boehm-gc.c @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #if HAVE_BOEHM_GC @@ -64,8 +64,8 @@ static MonoGCFinalizerCallbacks fin_callbacks; /* GC Handles */ static mono_mutex_t handle_section; -#define lock_handles(handles) mono_mutex_lock (&handle_section) -#define unlock_handles(handles) mono_mutex_unlock (&handle_section) +#define lock_handles(handles) mono_os_mutex_lock (&handle_section) +#define unlock_handles(handles) mono_os_mutex_unlock (&handle_section) typedef struct { guint32 *bitmap; @@ -196,6 +196,7 @@ mono_gc_base_init (void) GC_finalizer_notifier = mono_gc_finalize_notify; GC_init_gcj_malloc (5, NULL); + GC_allow_register_threads (); if ((env = g_getenv ("MONO_GC_PARAMS"))) { char **ptr, **opts = g_strsplit (env, ",", -1); @@ -234,11 +235,11 @@ mono_gc_base_init (void) memset (&cb, 0, sizeof (cb)); cb.thread_register = boehm_thread_register; cb.thread_unregister = boehm_thread_unregister; - cb.mono_method_is_critical = (gpointer)mono_runtime_is_critical_method; + cb.mono_method_is_critical = (gboolean (*)(void *))mono_runtime_is_critical_method; mono_threads_init (&cb, sizeof (MonoThreadInfo)); - mono_mutex_init (&mono_gc_lock); - mono_mutex_init_recursive (&handle_section); + mono_os_mutex_init (&mono_gc_lock); + mono_os_mutex_init_recursive (&handle_section); mono_thread_info_attach (&dummy); @@ -370,8 +371,6 @@ mono_gc_is_gc_thread (void) return GC_thread_is_registered (); } -extern int GC_thread_register_foreign (void *base_addr); - gboolean mono_gc_register_thread (void *baseptr) { @@ -381,13 +380,15 @@ mono_gc_register_thread (void *baseptr) static void* boehm_thread_register (MonoThreadInfo* info, void *baseptr) { - if (mono_gc_is_gc_thread()) - return info; -#if !defined(HOST_WIN32) - return GC_thread_register_foreign (baseptr) ? info : NULL; -#else - return NULL; -#endif + struct GC_stack_base sb; + int res; + + /* TODO: use GC_get_stack_base instead of baseptr. */ + sb.mem_base = baseptr; + res = GC_register_my_thread (&sb); + if (res == GC_UNIMPLEMENTED) + return NULL; /* Cannot happen with GC v7+. */ + return info; } static void @@ -404,7 +405,7 @@ boehm_thread_unregister (MonoThreadInfo *p) gboolean mono_object_is_alive (MonoObject* o) { - return GC_is_marked ((gpointer)o); + return GC_is_marked ((ptr_t)o); } int @@ -416,7 +417,7 @@ mono_gc_walk_heap (int flags, MonoGCReferences callback, void *data) static gint64 gc_start_time; static void -on_gc_notification (GCEventType event) +on_gc_notification (GC_EventType event) { MonoGCEvent e = (MonoGCEvent)event; @@ -495,7 +496,7 @@ on_gc_heap_resize (size_t new_size) void mono_gc_enable_events (void) { - GC_notify_event = on_gc_notification; + GC_set_on_collection_event (on_gc_notification); GC_on_heap_resize = on_gc_heap_resize; } @@ -550,14 +551,14 @@ mono_gc_weak_link_remove (void **link_addr, gboolean track) static gpointer reveal_link (gpointer link_addr) { - void **link_a = link_addr; + void **link_a = (void **)link_addr; return REVEAL_POINTER (*link_a); } static MonoObject * mono_gc_weak_link_get (void **link_addr) { - MonoObject *obj = GC_call_with_alloc_lock (reveal_link, link_addr); + MonoObject *obj = (MonoObject *)GC_call_with_alloc_lock (reveal_link, link_addr); if (obj == (MonoObject *) -1) return NULL; return obj; @@ -628,16 +629,16 @@ mono_gc_alloc_obj (MonoVTable *vtable, size_t size) MonoObject *obj; if (!vtable->klass->has_references) { - obj = GC_MALLOC_ATOMIC (size); + obj = (MonoObject *)GC_MALLOC_ATOMIC (size); obj->vtable = vtable; obj->synchronisation = NULL; memset ((char *) obj + sizeof (MonoObject), 0, size - sizeof (MonoObject)); } else if (vtable->gc_descr != GC_NO_DESCRIPTOR) { - obj = GC_GCJ_MALLOC (size, vtable); + obj = (MonoObject *)GC_GCJ_MALLOC (size, vtable); } else { - obj = GC_MALLOC (size); + obj = (MonoObject *)GC_MALLOC (size); obj->vtable = vtable; } @@ -654,16 +655,16 @@ mono_gc_alloc_vector (MonoVTable *vtable, size_t size, uintptr_t max_length) MonoArray *obj; if (!vtable->klass->has_references) { - obj = GC_MALLOC_ATOMIC (size); + obj = (MonoArray *)GC_MALLOC_ATOMIC (size); obj->obj.vtable = vtable; obj->obj.synchronisation = NULL; memset ((char *) obj + sizeof (MonoObject), 0, size - sizeof (MonoObject)); } else if (vtable->gc_descr != GC_NO_DESCRIPTOR) { - obj = GC_GCJ_MALLOC (size, vtable); + obj = (MonoArray *)GC_GCJ_MALLOC (size, vtable); } else { - obj = GC_MALLOC (size); + obj = (MonoArray *)GC_MALLOC (size); obj->obj.vtable = vtable; } @@ -682,16 +683,16 @@ mono_gc_alloc_array (MonoVTable *vtable, size_t size, uintptr_t max_length, uint MonoArray *obj; if (!vtable->klass->has_references) { - obj = GC_MALLOC_ATOMIC (size); + obj = (MonoArray *)GC_MALLOC_ATOMIC (size); obj->obj.vtable = vtable; obj->obj.synchronisation = NULL; memset ((char *) obj + sizeof (MonoObject), 0, size - sizeof (MonoObject)); } else if (vtable->gc_descr != GC_NO_DESCRIPTOR) { - obj = GC_GCJ_MALLOC (size, vtable); + obj = (MonoArray *)GC_GCJ_MALLOC (size, vtable); } else { - obj = GC_MALLOC (size); + obj = (MonoArray *)GC_MALLOC (size); obj->obj.vtable = vtable; } @@ -710,7 +711,7 @@ mono_gc_alloc_array (MonoVTable *vtable, size_t size, uintptr_t max_length, uint void * mono_gc_alloc_string (MonoVTable *vtable, size_t size, gint32 len) { - MonoString *obj = GC_MALLOC_ATOMIC (size); + MonoString *obj = (MonoString *)GC_MALLOC_ATOMIC (size); obj->object.vtable = vtable; obj->object.synchronisation = NULL; @@ -769,7 +770,7 @@ mono_gc_wbarrier_generic_store (gpointer ptr, MonoObject* value) void mono_gc_wbarrier_generic_store_atomic (gpointer ptr, MonoObject *value) { - InterlockedWritePointer (ptr, value); + InterlockedWritePointer ((volatile gpointer *)ptr, value); } void @@ -805,7 +806,7 @@ mono_gc_get_suspend_signal (void) int mono_gc_get_restart_signal (void) { - return GC_get_restart_signal (); + return GC_get_thr_restart_signal (); } #if defined(USE_COMPILER_TLS) && defined(__linux__) && (defined(__i386__) || defined(__x86_64__)) @@ -924,11 +925,17 @@ create_allocator (int atype, int tls_key, gboolean slowpath) mono_mb_emit_byte (mb, 0x0D); /* CEE_MONO_TLS */ mono_mb_emit_i4 (mb, tls_key); if (atype == ATYPE_FREEPTR || atype == ATYPE_FREEPTR_FOR_BOX || atype == ATYPE_STRING) - mono_mb_emit_icon (mb, G_STRUCT_OFFSET (struct GC_Thread_Rep, ptrfree_freelists)); + mono_mb_emit_icon (mb, G_STRUCT_OFFSET (struct GC_Thread_Rep, tlfs) + + G_STRUCT_OFFSET (struct thread_local_freelists, + ptrfree_freelists)); else if (atype == ATYPE_NORMAL) - mono_mb_emit_icon (mb, G_STRUCT_OFFSET (struct GC_Thread_Rep, normal_freelists)); + mono_mb_emit_icon (mb, G_STRUCT_OFFSET (struct GC_Thread_Rep, tlfs) + + G_STRUCT_OFFSET (struct thread_local_freelists, + normal_freelists)); else if (atype == ATYPE_GCJ) - mono_mb_emit_icon (mb, G_STRUCT_OFFSET (struct GC_Thread_Rep, gcj_freelists)); + mono_mb_emit_icon (mb, G_STRUCT_OFFSET (struct GC_Thread_Rep, tlfs) + + G_STRUCT_OFFSET (struct thread_local_freelists, + gcj_freelists)); else g_assert_not_reached (); mono_mb_emit_byte (mb, MONO_CEE_ADD); @@ -1141,7 +1148,7 @@ mono_gc_get_managed_allocator_by_type (int atype, gboolean slowpath) return res; res = create_allocator (atype, TLS_KEY_BOEHM_GC_THREAD, slowpath); - mono_mutex_lock (&mono_gc_lock); + mono_os_mutex_lock (&mono_gc_lock); if (cache [atype]) { mono_free_method (res); res = cache [atype]; @@ -1149,7 +1156,7 @@ mono_gc_get_managed_allocator_by_type (int atype, gboolean slowpath) mono_memory_barrier (); cache [atype] = res; } - mono_mutex_unlock (&mono_gc_lock); + mono_os_mutex_unlock (&mono_gc_lock); return res; } @@ -1347,7 +1354,7 @@ mono_gc_register_for_finalization (MonoObject *obj, void *user_data) g_assert (GC_base (obj) == (char*)obj - offset); #endif - GC_REGISTER_FINALIZER_NO_ORDER ((char*)obj - offset, user_data, GUINT_TO_POINTER (offset), NULL, NULL); + GC_REGISTER_FINALIZER_NO_ORDER ((char*)obj - offset, (GC_finalization_proc)user_data, GUINT_TO_POINTER (offset), NULL, NULL); } #ifndef HOST_WIN32 @@ -1420,23 +1427,19 @@ mono_gc_make_root_descr_user (MonoGCRootMarkFunc marker) return NULL; } -gboolean -mono_gc_set_allow_synchronous_major (gboolean flag) -{ - return flag; -} /* Toggleref support */ void mono_gc_toggleref_add (MonoObject *object, mono_bool strong_ref) { - GC_toggleref_add ((GC_PTR)object, (int)strong_ref); + if (GC_toggleref_add ((GC_PTR)object, (int)strong_ref) != GC_SUCCESS) + g_error ("GC_toggleref_add failed\n"); } void mono_gc_toggleref_register_callback (MonoToggleRefStatus (*proccess_toggleref) (MonoObject *obj)) { - GC_toggleref_register_callback ((int (*) (GC_PTR obj)) proccess_toggleref); + GC_set_toggleref_func ((GC_ToggleRefStatus (*) (GC_PTR obj)) proccess_toggleref); } /* Test support code */ @@ -1445,7 +1448,7 @@ static MonoToggleRefStatus test_toggleref_callback (MonoObject *obj) { static MonoClassField *mono_toggleref_test_field; - int status = MONO_TOGGLE_REF_DROP; + MonoToggleRefStatus status = MONO_TOGGLE_REF_DROP; if (!mono_toggleref_test_field) { mono_toggleref_test_field = mono_class_get_field_from_name (mono_object_get_class (obj), "__test"); @@ -1485,7 +1488,7 @@ mono_gc_register_finalizer_callbacks (MonoGCFinalizerCallbacks *callbacks) fin_callbacks = *callbacks; - GC_set_finalizer_notify_proc ((void (*) (GC_PTR))fin_notifier); + GC_set_await_finalize_proc ((void (*) (GC_PTR))fin_notifier); } #define BITMAP_SIZE (sizeof (*((HandleData *)NULL)->bitmap) * CHAR_BIT) @@ -1521,12 +1524,12 @@ handle_data_alloc_entries (HandleData *handles) { handles->size = 32; if (MONO_GC_HANDLE_TYPE_IS_WEAK (handles->type)) { - handles->entries = g_malloc0 (sizeof (*handles->entries) * handles->size); - handles->domain_ids = g_malloc0 (sizeof (*handles->domain_ids) * handles->size); + handles->entries = (void **)g_malloc0 (sizeof (*handles->entries) * handles->size); + handles->domain_ids = (guint16 *)g_malloc0 (sizeof (*handles->domain_ids) * handles->size); } else { - handles->entries = mono_gc_alloc_fixed (sizeof (*handles->entries) * handles->size, NULL, MONO_ROOT_SOURCE_GC_HANDLE, "gc handles table"); + handles->entries = (void **)mono_gc_alloc_fixed (sizeof (*handles->entries) * handles->size, NULL, MONO_ROOT_SOURCE_GC_HANDLE, "gc handles table"); } - handles->bitmap = g_malloc0 (handles->size / CHAR_BIT); + handles->bitmap = (guint32 *)g_malloc0 (handles->size / CHAR_BIT); } static gint @@ -1563,7 +1566,7 @@ handle_data_grow (HandleData *handles, gboolean track) guint32 new_size = handles->size * 2; /* always double: we memset to 0 based on this below */ /* resize and copy the bitmap */ - new_bitmap = g_malloc0 (new_size / CHAR_BIT); + new_bitmap = (guint32 *)g_malloc0 (new_size / CHAR_BIT); memcpy (new_bitmap, handles->bitmap, handles->size / CHAR_BIT); g_free (handles->bitmap); handles->bitmap = new_bitmap; @@ -1573,8 +1576,8 @@ handle_data_grow (HandleData *handles, gboolean track) gpointer *entries; guint16 *domain_ids; gint i; - domain_ids = g_malloc0 (sizeof (*handles->domain_ids) * new_size); - entries = g_malloc0 (sizeof (*handles->entries) * new_size); + domain_ids = (guint16 *)g_malloc0 (sizeof (*handles->domain_ids) * new_size); + entries = (void **)g_malloc0 (sizeof (*handles->entries) * new_size); memcpy (domain_ids, handles->domain_ids, sizeof (*handles->domain_ids) * handles->size); for (i = 0; i < handles->size; ++i) { MonoObject *obj = mono_gc_weak_link_get (&(handles->entries [i])); @@ -1591,7 +1594,7 @@ handle_data_grow (HandleData *handles, gboolean track) handles->domain_ids = domain_ids; } else { gpointer *entries; - entries = mono_gc_alloc_fixed (sizeof (*handles->entries) * new_size, NULL, MONO_ROOT_SOURCE_GC_HANDLE, "gc handles table"); + entries = (void **)mono_gc_alloc_fixed (sizeof (*handles->entries) * new_size, NULL, MONO_ROOT_SOURCE_GC_HANDLE, "gc handles table"); mono_gc_memmove_aligned (entries, handles->entries, sizeof (*handles->entries) * handles->size); mono_gc_free_fixed (handles->entries); handles->entries = entries; @@ -1709,7 +1712,7 @@ mono_gchandle_get_target (guint32 gchandle) if (MONO_GC_HANDLE_TYPE_IS_WEAK (handles->type)) { obj = mono_gc_weak_link_get (&handles->entries [slot]); } else { - obj = handles->entries [slot]; + obj = (MonoObject *)handles->entries [slot]; } } else { /* print a warning? */ @@ -1731,7 +1734,7 @@ mono_gchandle_set_target (guint32 gchandle, MonoObject *obj) lock_handles (handles); if (slot < handles->size && slot_occupied (handles, slot)) { if (MONO_GC_HANDLE_TYPE_IS_WEAK (handles->type)) { - old_obj = handles->entries [slot]; + old_obj = (MonoObject *)handles->entries [slot]; if (handles->entries [slot]) mono_gc_weak_link_remove (&handles->entries [slot], handles->type == HANDLE_WEAK_TRACK); if (obj) @@ -1778,7 +1781,7 @@ mono_gchandle_is_in_domain (guint32 gchandle, MonoDomain *domain) result = domain->domain_id == handles->domain_ids [slot]; } else { MonoObject *obj; - obj = handles->entries [slot]; + obj = (MonoObject *)handles->entries [slot]; if (obj == NULL) result = TRUE; else diff --git a/mono/metadata/class-internals.h b/mono/metadata/class-internals.h index a7f74547498..84a4c9090ae 100644 --- a/mono/metadata/class-internals.h +++ b/mono/metadata/class-internals.h @@ -66,7 +66,7 @@ struct _MonoMethod { guint16 flags; /* method flags */ guint16 iflags; /* method implementation flags */ guint32 token; - MonoClass *klass; + MonoClass *klass; /* To what class does this method belong */ MonoMethodSignature *signature; /* name is useful mostly for debugging */ const char *name; @@ -528,7 +528,7 @@ struct _MonoMethodInflated { */ struct _MonoGenericClass { MonoClass *container_class; /* the generic type definition */ - MonoGenericContext context; /* a context that contains the type instantiation doesn't contain any method instantiation */ + MonoGenericContext context; /* a context that contains the type instantiation doesn't contain any method instantiation */ /* FIXME: Only the class_inst member of "context" is ever used, so this field could be replaced with just a monogenericinst */ guint is_dynamic : 1; /* We're a MonoDynamicGenericClass */ guint is_tb_open : 1; /* This is the fully open instantiation for a type_builder. Quite ugly, but it's temporary.*/ MonoClass *cached_class; /* if present, the MonoClass corresponding to the instantiation. */ @@ -570,13 +570,6 @@ struct _MonoGenericParam { * sharing. */ MonoType *gshared_constraint; - /* - * If owner is NULL, or owner is 'owned' by this gparam, - * then this is the image whose mempool this struct was allocated from. - * The second case happens for gparams created in - * mono_reflection_initialize_generic_parameter (). - */ - MonoImage *image; }; /* Additional details about a MonoGenericParam */ @@ -609,33 +602,87 @@ struct _MonoGenericContainer { the generic container of the containing class. */ MonoGenericContainer *parent; /* the generic type definition or the generic method definition corresponding to this container */ + /* Union rules: If is_anonymous, image field is valid; else if is_method, method field is valid; else klass is valid. */ union { MonoClass *klass; MonoMethod *method; + MonoImage *image; } owner; - int type_argc : 31; + int type_argc : 29; // Per the ECMA spec, this value is capped at 16 bits /* If true, we're a generic method, otherwise a generic type definition. */ /* Invariant: parent != NULL => is_method */ - int is_method : 1; + int is_method : 1; + /* If true, this container has no associated class/method and only the image is known. This can happen: + 1. For the special anonymous containers kept by MonoImage. + 2. During container creation via the mono_metadata_load_generic_params path-- in this case the caller + sets the owner, so temporarily while load_generic_params is completing the container is anonymous. + 3. When user code creates a generic parameter via SRE, but has not yet set an owner. */ + int is_anonymous : 1; + /* If false, all params in this container are full-size. If true, all params are just param structs. */ + /* This field is always == to the is_anonymous field, except in "temporary" cases (2) and (3) above. */ + /* TODO: Merge GenericParam and GenericParamFull, remove this field. Benefit is marginal. */ + int is_small_param : 1; /* Our type parameters. */ MonoGenericParamFull *type_params; - - /* - * For owner-less containers created by SRE, the image the container was - * allocated from. - */ - MonoImage *image; }; -#define mono_generic_container_get_param(gc, i) ((MonoGenericParam *) ((gc)->type_params + (i))) -#define mono_generic_container_get_param_info(gc, i) (&((gc)->type_params + (i))->info) +static inline MonoGenericParam * +mono_generic_container_get_param (MonoGenericContainer *gc, int i) +{ + return (MonoGenericParam *) &gc->type_params [i]; +} + +static inline MonoGenericParamInfo * +mono_generic_container_get_param_info (MonoGenericContainer *gc, int i) +{ + return &gc->type_params [i].info; +} + +static inline MonoGenericContainer * +mono_generic_param_owner (MonoGenericParam *p) +{ + return p->owner; +} + +static inline int +mono_generic_param_num (MonoGenericParam *p) +{ + return p->num; +} + +static inline gboolean +mono_generic_param_is_fullsize (MonoGenericParam *p) +{ + return !mono_generic_param_owner (p)->is_small_param; +} + +static inline MonoGenericParamInfo * +mono_generic_param_info (MonoGenericParam *p) +{ + if (mono_generic_param_is_fullsize (p)) + return &((MonoGenericParamFull *) p)->info; + return NULL; +} -#define mono_generic_param_owner(p) ((p)->owner) -#define mono_generic_param_num(p) ((p)->num) -#define mono_generic_param_info(p) (mono_generic_param_owner (p) ? &((MonoGenericParamFull *) p)->info : NULL) -#define mono_generic_param_name(p) (((mono_generic_param_owner (p) || (p)->gshared_constraint)) ? ((MonoGenericParamFull *) p)->info.name : NULL) -#define mono_type_get_generic_param_owner(t) (mono_generic_param_owner ((t)->data.generic_param)) -#define mono_type_get_generic_param_num(t) (mono_generic_param_num ((t)->data.generic_param)) +static inline const char * +mono_generic_param_name (MonoGenericParam *p) +{ + if (mono_generic_param_is_fullsize (p)) + return ((MonoGenericParamFull *) p)->info.name; + return NULL; +} + +static inline MonoGenericContainer * +mono_type_get_generic_param_owner (MonoType *t) +{ + return mono_generic_param_owner (t->data.generic_param); +} + +static inline int +mono_type_get_generic_param_num (MonoType *t) +{ + return mono_generic_param_num (t->data.generic_param); +} /* * Class information which might be cached by the runtime in the AOT file for @@ -1416,4 +1463,13 @@ mono_field_from_token_checked (MonoImage *image, uint32_t token, MonoClass **ret gpointer mono_ldtoken_checked (MonoImage *image, guint32 token, MonoClass **handle_class, MonoGenericContext *context, MonoError *error); +MonoClass * +mono_class_from_generic_parameter_internal (MonoGenericParam *param); + +MonoImage * +get_image_for_generic_param (MonoGenericParam *param); + +char * +make_generic_name_string (MonoImage *image, int num); + #endif /* __MONO_METADATA_CLASS_INTERNALS_H__ */ diff --git a/mono/metadata/class.c b/mono/metadata/class.c index 548554a1987..4d74e17e60e 100644 --- a/mono/metadata/class.c +++ b/mono/metadata/class.c @@ -43,6 +43,7 @@ #include #include #include +#include MonoStats mono_stats; @@ -103,13 +104,13 @@ typedef gboolean (*gclass_record_func) (MonoClass*, void*); static inline void classes_lock (void) { - mono_locks_acquire (&classes_mutex, ClassesLock); + mono_locks_os_acquire (&classes_mutex, ClassesLock); } static inline void classes_unlock (void) { - mono_locks_release (&classes_mutex, ClassesLock); + mono_locks_os_release (&classes_mutex, ClassesLock); } /* @@ -222,7 +223,7 @@ mono_class_from_typeref_checked (MonoImage *image, guint32 type_token, MonoError if (enclosing->nested_classes_inited && enclosing->ext) { /* Micro-optimization: don't scan the metadata tables if enclosing is already inited */ for (tmp = enclosing->ext->nested_classes; tmp; tmp = tmp->next) { - res = tmp->data; + res = (MonoClass *)tmp->data; if (strcmp (res->name, name) == 0) return res; } @@ -298,17 +299,17 @@ MonoArrayType * mono_dup_array_type (MonoImage *image, MonoArrayType *a) { if (image) { - a = mono_image_memdup (image, a, sizeof (MonoArrayType)); + a = (MonoArrayType *)mono_image_memdup (image, a, sizeof (MonoArrayType)); if (a->sizes) - a->sizes = mono_image_memdup (image, a->sizes, a->numsizes * sizeof (int)); + a->sizes = (int *)mono_image_memdup (image, a->sizes, a->numsizes * sizeof (int)); if (a->lobounds) - a->lobounds = mono_image_memdup (image, a->lobounds, a->numlobounds * sizeof (int)); + a->lobounds = (int *)mono_image_memdup (image, a->lobounds, a->numlobounds * sizeof (int)); } else { - a = g_memdup (a, sizeof (MonoArrayType)); + a = (MonoArrayType *)g_memdup (a, sizeof (MonoArrayType)); if (a->sizes) - a->sizes = g_memdup (a->sizes, a->numsizes * sizeof (int)); + a->sizes = (int *)g_memdup (a->sizes, a->numsizes * sizeof (int)); if (a->lobounds) - a->lobounds = g_memdup (a->lobounds, a->numlobounds * sizeof (int)); + a->lobounds = (int *)g_memdup (a->lobounds, a->numlobounds * sizeof (int)); } return a; } @@ -1109,7 +1110,7 @@ mono_class_inflate_generic_method_full_checked (MonoMethod *method, MonoClass *k // check cache mono_image_set_lock (set); - cached = g_hash_table_lookup (set->gmethod_cache, iresult); + cached = (MonoMethodInflated *)g_hash_table_lookup (set->gmethod_cache, iresult); mono_image_set_unlock (set); if (cached) { @@ -1184,7 +1185,7 @@ mono_class_inflate_generic_method_full_checked (MonoMethod *method, MonoClass *k // check cache mono_image_set_lock (set); - cached = g_hash_table_lookup (set->gmethod_cache, iresult); + cached = (MonoMethodInflated *)g_hash_table_lookup (set->gmethod_cache, iresult); if (!cached) { g_hash_table_insert (set->gmethod_cache, iresult, iresult); iresult->owner = set; @@ -1264,7 +1265,7 @@ mono_method_get_generic_container (MonoMethod *method) if (!method->is_generic) return NULL; - container = mono_image_property_lookup (method->klass->image, method, MONO_METHOD_PROP_GENERIC_CONTAINER); + container = (MonoGenericContainer *)mono_image_property_lookup (method->klass->image, method, MONO_METHOD_PROP_GENERIC_CONTAINER); g_assert (container); return container; @@ -1453,7 +1454,7 @@ mono_class_setup_basic_field_info (MonoClass *klass) klass->field.count = gtd->field.count; } - klass->fields = mono_class_alloc0 (klass, sizeof (MonoClassField) * top); + klass->fields = (MonoClassField *)mono_class_alloc0 (klass, sizeof (MonoClassField) * top); /* * Fetch all the field information. @@ -2191,7 +2192,7 @@ mono_class_setup_methods (MonoClass *klass) /* The + 1 makes this always non-NULL to pass the check in mono_class_setup_methods () */ count = gklass->method.count; - methods = mono_class_alloc0 (klass, sizeof (MonoMethod*) * (count + 1)); + methods = (MonoMethod **)mono_class_alloc0 (klass, sizeof (MonoMethod*) * (count + 1)); for (i = 0; i < count; i++) { methods [i] = mono_class_inflate_generic_method_full_checked ( @@ -2229,7 +2230,7 @@ mono_class_setup_methods (MonoClass *klass) count += klass->interface_count * count_generic; } - methods = mono_class_alloc0 (klass, sizeof (MonoMethod*) * count); + methods = (MonoMethod **)mono_class_alloc0 (klass, sizeof (MonoMethod*) * count); sig = mono_metadata_signature_alloc (klass->image, klass->rank); sig->ret = &mono_defaults.void_class->byval_arg; @@ -2299,7 +2300,7 @@ mono_class_setup_methods (MonoClass *klass) MonoError error; count = klass->method.count; - methods = mono_class_alloc (klass, sizeof (MonoMethod*) * count); + methods = (MonoMethod **)mono_class_alloc (klass, sizeof (MonoMethod*) * count); for (i = 0; i < count; ++i) { int idx = mono_metadata_translate_token_index (klass->image, MONO_TABLE_METHOD, klass->method.first + i + 1); methods [i] = mono_get_method_checked (klass->image, MONO_TOKEN_METHOD_DEF | idx, klass, NULL, &error); @@ -2517,7 +2518,7 @@ mono_class_setup_properties (MonoClass *klass) return; } - properties = mono_class_alloc0 (klass, sizeof (MonoProperty) * count); + properties = (MonoProperty *)mono_class_alloc0 (klass, sizeof (MonoProperty) * count); for (i = first; i < last; ++i) { mono_metadata_decode_table_row (klass->image, MONO_TABLE_PROPERTY, i, cols, MONO_PROPERTY_SIZE); properties [i - first].parent = klass; @@ -2660,7 +2661,7 @@ mono_class_setup_events (MonoClass *klass) } } - events = mono_class_alloc0 (klass, sizeof (MonoEvent) * count); + events = (MonoEvent *)mono_class_alloc0 (klass, sizeof (MonoEvent) * count); for (i = first; i < last; ++i) { MonoEvent *event = &events [i - first]; @@ -2703,7 +2704,7 @@ mono_class_setup_events (MonoClass *klass) } else { while (event->other [n]) n++; - event->other = g_realloc (event->other, (n + 2) * sizeof (MonoMethod*)); + event->other = (MonoMethod **)g_realloc (event->other, (n + 2) * sizeof (MonoMethod*)); } event->other [n] = method; /* NULL terminated */ @@ -2881,8 +2882,8 @@ mono_class_get_implemented_interfaces (MonoClass *klass, MonoError *error) static int compare_interface_ids (const void *p_key, const void *p_element) { - const MonoClass *key = p_key; - const MonoClass *element = *(MonoClass**) p_element; + const MonoClass *key = (const MonoClass *)p_key; + const MonoClass *element = *(const MonoClass **)p_element; return (key->interface_id - element->interface_id); } @@ -2890,7 +2891,7 @@ compare_interface_ids (const void *p_key, const void *p_element) { /*FIXME verify all callers if they should switch to mono_class_interface_offset_with_variance*/ int mono_class_interface_offset (MonoClass *klass, MonoClass *itf) { - MonoClass **result = mono_binary_search ( + MonoClass **result = (MonoClass **)mono_binary_search ( itf, klass->interfaces_packed, klass->interface_offsets_count, @@ -2983,7 +2984,7 @@ print_implemented_interfaces (MonoClass *klass) { mono_error_cleanup (&error); } else if (ifaces) { for (i = 0; i < ifaces->len; i++) { - MonoClass *ic = g_ptr_array_index (ifaces, i); + MonoClass *ic = (MonoClass *)g_ptr_array_index (ifaces, i); printf (" [UIID %d] interface %s\n", ic->interface_id, ic->name); printf (" [%03d][UUID %03d][SLOT %03d][SIZE %03d] interface %s.%s\n", i, ic->interface_id, @@ -3135,7 +3136,7 @@ get_implicit_generic_array_interfaces (MonoClass *klass, int *num, int *is_enume ++real_count; } - interfaces = g_malloc0 (sizeof (MonoClass*) * real_count); + interfaces = (MonoClass **)g_malloc0 (sizeof (MonoClass*) * real_count); interfaces [0] = valuetype_types [0]; if (valuetype_types [1]) interfaces [nifaces] = valuetype_types [1]; @@ -3175,7 +3176,7 @@ get_implicit_generic_array_interfaces (MonoClass *klass, int *num, int *is_enume if (valuetype_types [1]) ++real_count; } - interfaces = g_malloc0 (sizeof (MonoClass*) * real_count); + interfaces = (MonoClass **)g_malloc0 (sizeof (MonoClass*) * real_count); if (MONO_CLASS_IS_INTERFACE (eclass)) { interfaces [0] = mono_defaults.object_class; j = nifaces; @@ -3528,7 +3529,7 @@ setup_interface_offsets (MonoClass *klass, int cur_slot, gboolean overwrite) if (ifaces) { num_ifaces += ifaces->len; for (i = 0; i < ifaces->len; ++i) { - ic = g_ptr_array_index (ifaces, i); + ic = (MonoClass *)g_ptr_array_index (ifaces, i); if (max_iid < ic->interface_id) max_iid = ic->interface_id; } @@ -3550,8 +3551,8 @@ setup_interface_offsets (MonoClass *klass, int cur_slot, gboolean overwrite) } klass->max_interface_id = max_iid; /* compute vtable offset for interfaces */ - interfaces_full = g_malloc0 (sizeof (MonoClass*) * num_ifaces); - interface_offsets_full = g_malloc (sizeof (int) * num_ifaces); + interfaces_full = (MonoClass **)g_malloc0 (sizeof (MonoClass*) * num_ifaces); + interface_offsets_full = (int *)g_malloc (sizeof (int) * num_ifaces); for (i = 0; i < num_ifaces; i++) { interface_offsets_full [i] = -1; @@ -3565,7 +3566,7 @@ setup_interface_offsets (MonoClass *klass, int cur_slot, gboolean overwrite) if (ifaces) { for (i = 0; i < ifaces->len; ++i) { int io; - ic = g_ptr_array_index (ifaces, i); + ic = (MonoClass *)g_ptr_array_index (ifaces, i); /*Force the sharing of interface offsets between parent and subtypes.*/ io = mono_class_interface_offset (k, ic); @@ -3580,7 +3581,7 @@ setup_interface_offsets (MonoClass *klass, int cur_slot, gboolean overwrite) if (ifaces) { for (i = 0; i < ifaces->len; ++i) { int count; - ic = g_ptr_array_index (ifaces, i); + ic = (MonoClass *)g_ptr_array_index (ifaces, i); if (set_interface_and_offset (num_ifaces, interfaces_full, interface_offsets_full, ic, cur_slot, FALSE)) continue; count = count_virtual_methods (ic); @@ -3668,13 +3669,13 @@ setup_interface_offsets (MonoClass *klass, int cur_slot, gboolean overwrite) uint8_t *bitmap; int bsize; klass->interface_offsets_count = interface_offsets_count; - klass->interfaces_packed = mono_class_alloc (klass, sizeof (MonoClass*) * interface_offsets_count); - klass->interface_offsets_packed = mono_class_alloc (klass, sizeof (guint16) * interface_offsets_count); + klass->interfaces_packed = (MonoClass **)mono_class_alloc (klass, sizeof (MonoClass*) * interface_offsets_count); + klass->interface_offsets_packed = (guint16 *)mono_class_alloc (klass, sizeof (guint16) * interface_offsets_count); bsize = (sizeof (guint8) * ((max_iid + 1) >> 3)) + (((max_iid + 1) & 7)? 1 :0); #ifdef COMPRESSED_INTERFACE_BITMAP bitmap = g_malloc0 (bsize); #else - bitmap = mono_class_alloc0 (klass, bsize); + bitmap = (uint8_t *)mono_class_alloc0 (klass, bsize); #endif for (i = 0; i < interface_offsets_count; i++) { int id = interfaces_full [i]->interface_id; @@ -4268,7 +4269,7 @@ verify_class_overrides (MonoClass *klass, MonoMethod **overrides, int onum) } if (!mono_class_is_assignable_from_slow (decl->klass, klass)) { - mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Method overrides a class or interface that extended or implemented by this type")); + mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Method overrides a class or interface that is not extended or implemented by this type")); return FALSE; } @@ -4327,7 +4328,7 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o return; } else if (ifaces) { for (i = 0; i < ifaces->len; i++) { - MonoClass *ic = g_ptr_array_index (ifaces, i); + MonoClass *ic = (MonoClass *)g_ptr_array_index (ifaces, i); max_vtsize += ic->method.count; } g_ptr_array_free (ifaces, TRUE); @@ -4358,7 +4359,7 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o ++cur_slot; } - vtable = alloca (sizeof (gpointer) * max_vtsize); + vtable = (MonoMethod **)alloca (sizeof (gpointer) * max_vtsize); memset (vtable, 0, sizeof (gpointer) * max_vtsize); /* printf ("METAINIT %s.%s\n", klass->name_space, klass->name); */ @@ -4382,7 +4383,7 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o return; } - tmp = mono_class_alloc0 (klass, sizeof (gpointer) * gklass->vtable_size); + tmp = (MonoMethod **)mono_class_alloc0 (klass, sizeof (gpointer) * gklass->vtable_size); klass->vtable_size = gklass->vtable_size; for (i = 0; i < gklass->vtable_size; ++i) if (gklass->vtable [i]) { @@ -4531,7 +4532,7 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o for (im_index = 0; im_index < ic->method.count; im_index++) { MonoMethod *im = ic->methods [im_index]; int im_slot = ic_offset + im->slot; - MonoMethod *override_im = (override_map != NULL) ? g_hash_table_lookup (override_map, im) : NULL; + MonoMethod *override_im = (override_map != NULL) ? (MonoMethod *)g_hash_table_lookup (override_map, im) : NULL; if (im->flags & METHOD_ATTRIBUTE_STATIC) continue; @@ -4546,7 +4547,7 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o // First look for a suitable method among the class methods for (l = virt_methods; l; l = l->next) { - cm = l->data; + cm = (MonoMethod *)l->data; TRACE_INTERFACE_VTABLE (printf (" For slot %d ('%s'.'%s':'%s'), trying method '%s'.'%s':'%s'... [EXPLICIT IMPLEMENTATION = %d][SLOT IS NULL = %d]", im_slot, ic->name_space, ic->name, im->name, cm->klass->name_space, cm->klass->name, cm->name, interface_is_explicitly_implemented_by_class, (vtable [im_slot] == NULL))); if (check_interface_method_override (klass, im, cm, TRUE, interface_is_explicitly_implemented_by_class, (vtable [im_slot] == NULL))) { TRACE_INTERFACE_VTABLE (printf ("[check ok]: ASSIGNING")); @@ -4621,7 +4622,7 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o TRACE_INTERFACE_VTABLE (print_vtable_full (klass, vtable, cur_slot, first_non_interface_slot, "AFTER SETTING UP INTERFACE METHODS", FALSE)); for (l = virt_methods; l; l = l->next) { - cm = l->data; + cm = (MonoMethod *)l->data; /* * If the method is REUSE_SLOT, we must check in the * base class for a method to override. @@ -4724,7 +4725,7 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o if (vtable [i]) { TRACE_INTERFACE_VTABLE (printf ("checking slot %d method %s[%p] for overrides\n", i, mono_method_full_name (vtable [i], 1), vtable [i])); - cm = g_hash_table_lookup (override_map, vtable [i]); + cm = (MonoMethod *)g_hash_table_lookup (override_map, vtable [i]); if (cm) vtable [i] = cm; } @@ -4768,7 +4769,7 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o mono_memory_barrier (); klass->vtable = klass->parent->vtable; } else { - MonoMethod **tmp = mono_class_alloc0 (klass, sizeof (gpointer) * klass->vtable_size); + MonoMethod **tmp = (MonoMethod **)mono_class_alloc0 (klass, sizeof (gpointer) * klass->vtable_size); memcpy (tmp, vtable, sizeof (gpointer) * klass->vtable_size); mono_memory_barrier (); klass->vtable = tmp; @@ -4953,12 +4954,12 @@ generic_array_methods (MonoClass *klass) } } list = g_list_reverse (list); - generic_array_method_info = mono_image_alloc (mono_defaults.corlib, sizeof (GenericArrayMethodInfo) * count_generic); + generic_array_method_info = (GenericArrayMethodInfo *)mono_image_alloc (mono_defaults.corlib, sizeof (GenericArrayMethodInfo) * count_generic); i = 0; for (tmp = list; tmp; tmp = tmp->next) { const char *mname, *iname; gchar *name; - MonoMethod *m = tmp->data; + MonoMethod *m = (MonoMethod *)tmp->data; const char *ireadonlylist_prefix = "InternalArray__IReadOnlyList_"; const char *ireadonlycollection_prefix = "InternalArray__IReadOnlyCollection_"; @@ -4982,7 +4983,7 @@ generic_array_methods (MonoClass *klass) g_assert_not_reached (); } - name = mono_image_alloc (mono_defaults.corlib, strlen (iname) + strlen (mname) + 1); + name = (gchar *)mono_image_alloc (mono_defaults.corlib, strlen (iname) + strlen (mname) + 1); strcpy (name, iname); strcpy (name + strlen (iname), mname); generic_array_method_info [i].name = name; @@ -5021,7 +5022,7 @@ concat_two_strings_with_zero (MonoImage *image, const char *s1, const char *s2) { int null_length = strlen ("(null)"); int len = (s1 ? strlen (s1) : null_length) + (s2 ? strlen (s2) : null_length) + 2; - char *s = mono_image_alloc (image, len); + char *s = (char *)mono_image_alloc (image, len); int result; result = g_snprintf (s, len, "%s%c%s", s1 ? s1 : "(null)", '\0', s2 ? s2 : "(null)"); @@ -5449,11 +5450,14 @@ mono_class_setup_mono_type (MonoClass *klass) klass->valuetype = 0; klass->enumtype = 0; } else if (!strcmp (name, "Object")) { - klass->this_arg.type = klass->byval_arg.type = MONO_TYPE_OBJECT; + klass->byval_arg.type = MONO_TYPE_OBJECT; + klass->this_arg.type = MONO_TYPE_OBJECT; } else if (!strcmp (name, "String")) { - klass->this_arg.type = klass->byval_arg.type = MONO_TYPE_STRING; + klass->byval_arg.type = MONO_TYPE_STRING; + klass->this_arg.type = MONO_TYPE_STRING; } else if (!strcmp (name, "TypedReference")) { - klass->this_arg.type = klass->byval_arg.type = MONO_TYPE_TYPEDBYREF; + klass->byval_arg.type = MONO_TYPE_TYPEDBYREF; + klass->this_arg.type = MONO_TYPE_TYPEDBYREF; } } @@ -5535,7 +5539,8 @@ mono_class_setup_mono_type (MonoClass *klass) break; } } - klass->this_arg.type = klass->byval_arg.type = t; + klass->byval_arg.type = (MonoTypeEnum)t; + klass->this_arg.type = (MonoTypeEnum)t; } if (MONO_CLASS_IS_INTERFACE (klass)) @@ -5677,7 +5682,7 @@ mono_class_setup_supertypes (MonoClass *klass) int ms; MonoClass **supertypes; - mono_atomic_load_acquire (supertypes, void*, &klass->supertypes); + mono_atomic_load_acquire (supertypes, MonoClass **, &klass->supertypes); if (supertypes) return; @@ -5689,16 +5694,19 @@ mono_class_setup_supertypes (MonoClass *klass) klass->idepth = 1; ms = MAX (MONO_DEFAULT_SUPERTABLE_SIZE, klass->idepth); - supertypes = mono_class_alloc0 (klass, sizeof (MonoClass *) * ms); + supertypes = (MonoClass **)mono_class_alloc0 (klass, sizeof (MonoClass *) * ms); if (klass->parent) { - supertypes [klass->idepth - 1] = klass; - memcpy (supertypes, klass->parent->supertypes, klass->parent->idepth * sizeof (gpointer)); + CHECKED_METADATA_WRITE_PTR ( supertypes [klass->idepth - 1] , klass ); + + int supertype_idx; + for (supertype_idx = 0; supertype_idx < klass->parent->idepth; supertype_idx++) + CHECKED_METADATA_WRITE_PTR ( supertypes [supertype_idx] , klass->parent->supertypes [supertype_idx] ); } else { - supertypes [0] = klass; + CHECKED_METADATA_WRITE_PTR ( supertypes [0] , klass ); } - mono_atomic_store_release (&klass->supertypes, supertypes); + CHECKED_METADATA_WRITE_PTR_ATOMIC ( klass->supertypes , supertypes ); } static gboolean @@ -5775,7 +5783,7 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError mono_loader_lock (); - if ((klass = mono_internal_hash_table_lookup (&image->class_cache, GUINT_TO_POINTER (type_token)))) { + if ((klass = (MonoClass *)mono_internal_hash_table_lookup (&image->class_cache, GUINT_TO_POINTER (type_token)))) { mono_loader_unlock (); mono_loader_assert_no_error (); return klass; @@ -5786,7 +5794,7 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError name = mono_metadata_string_heap (image, cols [MONO_TYPEDEF_NAME]); nspace = mono_metadata_string_heap (image, cols [MONO_TYPEDEF_NAMESPACE]); - klass = mono_image_alloc0 (image, sizeof (MonoClass)); + klass = (MonoClass *)mono_image_alloc0 (image, sizeof (MonoClass)); klass->name = name; klass->name_space = nspace; @@ -5808,6 +5816,7 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError if (klass->generic_container) { klass->is_generic = 1; klass->generic_container->owner.klass = klass; + klass->generic_container->is_anonymous = FALSE; // Owner class is now known, container is no longer anonymous context = &klass->generic_container->context; } @@ -5977,7 +5986,7 @@ parent_failure: return NULL; } -/** is klass Nullable? */ +/** Is klass a Nullable ginst? */ gboolean mono_class_is_nullable (MonoClass *klass) { @@ -6037,7 +6046,7 @@ mono_generic_class_get_class (MonoGenericClass *gclass) return gclass->cached_class; } - klass = mono_image_set_alloc0 (gclass->owner, sizeof (MonoClass)); + klass = (MonoClass *)mono_image_set_alloc0 (gclass->owner, sizeof (MonoClass)); gklass = gclass->container_class; @@ -6062,7 +6071,8 @@ mono_generic_class_get_class (MonoGenericClass *gclass) klass->is_inflated = 1; klass->generic_class = gclass; - klass->this_arg.type = klass->byval_arg.type = MONO_TYPE_GENERICINST; + klass->byval_arg.type = MONO_TYPE_GENERICINST; + klass->this_arg.type = klass->byval_arg.type; klass->this_arg.data.generic_class = klass->byval_arg.data.generic_class = gclass; klass->this_arg.byref = TRUE; klass->enumtype = gklass->enumtype; @@ -6117,42 +6127,83 @@ mono_generic_class_get_class (MonoGenericClass *gclass) return klass; } +static MonoImage * +get_image_for_container (MonoGenericContainer *container) +{ + MonoImage *result; + if (container->is_anonymous) { + result = container->owner.image; + } else { + MonoClass *klass; + if (container->is_method) { + MonoMethod *method = container->owner.method; + g_assert_checked (method); + klass = method->klass; + } else { + klass = container->owner.klass; + } + g_assert_checked (klass); + result = klass->image; + } + g_assert (result); + return result; +} + +MonoImage * +get_image_for_generic_param (MonoGenericParam *param) +{ + MonoGenericContainer *container = mono_generic_param_owner (param); + g_assert_checked (container); + return get_image_for_container (container); +} + +// Make a string in the designated image consisting of a single integer. +#define INT_STRING_SIZE 16 +char * +make_generic_name_string (MonoImage *image, int num) +{ + char *name = (char *)mono_image_alloc0 (image, INT_STRING_SIZE); + g_snprintf (name, INT_STRING_SIZE, "%d", num); + return name; +} + +// This is called by mono_class_from_generic_parameter_internal when a new class must be created. +// pinfo is derived from param by the caller for us. static MonoClass* -make_generic_param_class (MonoGenericParam *param, MonoImage *image, gboolean is_mvar, MonoGenericParamInfo *pinfo) +make_generic_param_class (MonoGenericParam *param, MonoGenericParamInfo *pinfo) { MonoClass *klass, **ptr; int count, pos, i; MonoGenericContainer *container = mono_generic_param_owner (param); + g_assert_checked (container); - if (!image) - /* FIXME: */ - image = mono_defaults.corlib; + MonoImage *image = get_image_for_container (container); + gboolean is_mvar = container->is_method; + gboolean is_anonymous = container->is_anonymous; - klass = mono_image_alloc0 (image, sizeof (MonoClass)); + klass = (MonoClass *)mono_image_alloc0 (image, sizeof (MonoClass)); classes_size += sizeof (MonoClass); if (pinfo) { - klass->name = pinfo->name; + CHECKED_METADATA_WRITE_PTR_EXEMPT ( klass->name , pinfo->name ); } else { int n = mono_generic_param_num (param); - klass->name = mono_image_alloc0 (image, 16); - sprintf ((char*)klass->name, "%d", n); + CHECKED_METADATA_WRITE_PTR_LOCAL ( klass->name , make_generic_name_string (image, n) ); } - if (container) { - if (is_mvar) { - MonoMethod *omethod = container->owner.method; - klass->name_space = (omethod && omethod->klass) ? omethod->klass->name_space : ""; - } else { - MonoClass *oklass = container->owner.klass; - klass->name_space = oklass ? oklass->name_space : ""; - } + if (is_anonymous) { + CHECKED_METADATA_WRITE_PTR_EXEMPT ( klass->name_space , "" ); + } else if (is_mvar) { + MonoMethod *omethod = container->owner.method; + CHECKED_METADATA_WRITE_PTR_EXEMPT ( klass->name_space , (omethod && omethod->klass) ? omethod->klass->name_space : "" ); } else { - klass->name_space = ""; + MonoClass *oklass = container->owner.klass; + CHECKED_METADATA_WRITE_PTR_EXEMPT ( klass->name_space , oklass ? oklass->name_space : "" ); } mono_profiler_class_event (klass, MONO_PROFILE_START_LOAD); + // Count non-NULL items in pinfo->constraints count = 0; if (pinfo) for (ptr = pinfo->constraints; ptr && *ptr; ptr++, count++) @@ -6160,30 +6211,33 @@ make_generic_param_class (MonoGenericParam *param, MonoImage *image, gboolean is pos = 0; if ((count > 0) && !MONO_CLASS_IS_INTERFACE (pinfo->constraints [0])) { - klass->parent = pinfo->constraints [0]; + CHECKED_METADATA_WRITE_PTR ( klass->parent , pinfo->constraints [0] ); pos++; - } else if (pinfo && pinfo->flags & GENERIC_PARAMETER_ATTRIBUTE_VALUE_TYPE_CONSTRAINT) - klass->parent = mono_class_from_name (mono_defaults.corlib, "System", "ValueType"); - else - klass->parent = mono_defaults.object_class; - + } else if (pinfo && pinfo->flags & GENERIC_PARAMETER_ATTRIBUTE_VALUE_TYPE_CONSTRAINT) { + CHECKED_METADATA_WRITE_PTR ( klass->parent , mono_class_from_name (mono_defaults.corlib, "System", "ValueType") ); + } else { + CHECKED_METADATA_WRITE_PTR ( klass->parent , mono_defaults.object_class ); + } if (count - pos > 0) { klass->interface_count = count - pos; - klass->interfaces = mono_image_alloc0 (image, sizeof (MonoClass *) * (count - pos)); + CHECKED_METADATA_WRITE_PTR_LOCAL ( klass->interfaces , (MonoClass **)mono_image_alloc0 (image, sizeof (MonoClass *) * (count - pos)) ); klass->interfaces_inited = TRUE; for (i = pos; i < count; i++) - klass->interfaces [i - pos] = pinfo->constraints [i]; + CHECKED_METADATA_WRITE_PTR ( klass->interfaces [i - pos] , pinfo->constraints [i] ); } - klass->image = image; + CHECKED_METADATA_WRITE_PTR_EXEMPT ( klass->image , image ); klass->inited = TRUE; - klass->cast_class = klass->element_class = klass; + CHECKED_METADATA_WRITE_PTR_LOCAL ( klass->cast_class , klass ); + CHECKED_METADATA_WRITE_PTR_LOCAL ( klass->element_class , klass ); klass->flags = TYPE_ATTRIBUTE_PUBLIC; - klass->this_arg.type = klass->byval_arg.type = is_mvar ? MONO_TYPE_MVAR : MONO_TYPE_VAR; - klass->this_arg.data.generic_param = klass->byval_arg.data.generic_param = param; + klass->byval_arg.type = is_mvar ? MONO_TYPE_MVAR : MONO_TYPE_VAR; + klass->this_arg.type = klass->byval_arg.type; + CHECKED_METADATA_WRITE_PTR ( klass->this_arg.data.generic_param , param ); + CHECKED_METADATA_WRITE_PTR ( klass->byval_arg.data.generic_param , param ); klass->this_arg.byref = TRUE; /* We don't use type_token for VAR since only classes can use it (not arrays, pointer, VARs, etc) */ @@ -6216,24 +6270,31 @@ make_generic_param_class (MonoGenericParam *param, MonoImage *image, gboolean is #define FAST_CACHE_SIZE 16 /* + * get_anon_gparam_class and set_anon_gparam_class are helpers for mono_class_from_generic_parameter_internal. + * The latter will sometimes create MonoClasses for anonymous generic params. To prevent this being wasteful, + * we cache the MonoClasses. + * FIXME: It would be better to instead cache anonymous MonoGenericParams, and allow anonymous params to point directly to classes using the pklass field. * LOCKING: Takes the image lock depending on @take_lock. */ static MonoClass * -get_anon_gparam_class (MonoGenericParam *param, gboolean is_mvar, gboolean take_lock) +get_anon_gparam_class (MonoGenericParam *param, gboolean take_lock) { int n = mono_generic_param_num (param); - MonoImage *image = param->image; + MonoImage *image = get_image_for_generic_param (param); + gboolean is_mvar = mono_generic_param_owner (param)->is_method; MonoClass *klass = NULL; GHashTable *ht; g_assert (image); + // For params with a small num and no constraints, we use a "fast" cache which does simple num lookup in an array. + // For high numbers or constraints we have to use pointer hashes. if (param->gshared_constraint) { ht = is_mvar ? image->mvar_cache_constrained : image->var_cache_constrained; if (ht) { if (take_lock) mono_image_lock (image); - klass = g_hash_table_lookup (ht, param); + klass = (MonoClass *)g_hash_table_lookup (ht, param); if (take_lock) mono_image_unlock (image); } @@ -6250,7 +6311,7 @@ get_anon_gparam_class (MonoGenericParam *param, gboolean is_mvar, gboolean take_ if (ht) { if (take_lock) mono_image_lock (image); - klass = g_hash_table_lookup (ht, GINT_TO_POINTER (n)); + klass = (MonoClass *)g_hash_table_lookup (ht, GINT_TO_POINTER (n)); if (take_lock) mono_image_unlock (image); } @@ -6262,10 +6323,11 @@ get_anon_gparam_class (MonoGenericParam *param, gboolean is_mvar, gboolean take_ * LOCKING: Image lock (param->image) must be held */ static void -set_anon_gparam_class (MonoGenericParam *param, gboolean is_mvar, MonoClass *klass) +set_anon_gparam_class (MonoGenericParam *param, MonoClass *klass) { int n = mono_generic_param_num (param); - MonoImage *image = param->image; + MonoImage *image = get_image_for_generic_param (param); + gboolean is_mvar = mono_generic_param_owner (param)->is_method; g_assert (image); @@ -6284,11 +6346,11 @@ set_anon_gparam_class (MonoGenericParam *param, gboolean is_mvar, MonoClass *kla if (is_mvar) { /* Requires locking to avoid droping an already published class */ if (!image->mvar_cache_fast) - image->mvar_cache_fast = mono_image_alloc0 (image, sizeof (MonoClass*) * FAST_CACHE_SIZE); + image->mvar_cache_fast = (MonoClass **)mono_image_alloc0 (image, sizeof (MonoClass*) * FAST_CACHE_SIZE); image->mvar_cache_fast [n] = klass; } else { if (!image->var_cache_fast) - image->var_cache_fast = mono_image_alloc0 (image, sizeof (MonoClass*) * FAST_CACHE_SIZE); + image->var_cache_fast = (MonoClass **)mono_image_alloc0 (image, sizeof (MonoClass*) * FAST_CACHE_SIZE); image->var_cache_fast [n] = klass; } } else { @@ -6312,66 +6374,71 @@ set_anon_gparam_class (MonoGenericParam *param, gboolean is_mvar, MonoClass *kla * LOCKING: Acquires the image lock (@image). */ MonoClass * -mono_class_from_generic_parameter (MonoGenericParam *param, MonoImage *image, gboolean is_mvar) +mono_class_from_generic_parameter_internal (MonoGenericParam *param) { - MonoGenericContainer *container = mono_generic_param_owner (param); - MonoGenericParamInfo *pinfo = NULL; + MonoImage *image = get_image_for_generic_param (param); + MonoGenericParamInfo *pinfo = mono_generic_param_info (param); MonoClass *klass, *klass2; - if (container) { - pinfo = mono_generic_param_info (param); + // If a klass already exists for this object and is cached, return it. + if (pinfo) // Non-anonymous klass = pinfo->pklass; - } else { - image = NULL; - klass = get_anon_gparam_class (param, is_mvar, TRUE); - } + else // Anonymous + klass = get_anon_gparam_class (param, TRUE); + if (klass) return klass; - if (!image && container) { - if (is_mvar) { - MonoMethod *method = container->owner.method; - image = (method && method->klass) ? method->klass->image : NULL; - } else { - MonoClass *klass = container->owner.klass; - // FIXME: 'klass' should not be null - // But, monodis creates GenericContainers without associating a owner to it - image = klass ? klass->image : NULL; - } - } - - klass = make_generic_param_class (param, image, is_mvar, pinfo); + // Create a new klass + klass = make_generic_param_class (param, pinfo); + // Now we need to cache the klass we created. + // But since we wait to grab the lock until after creating the klass, we need to check to make sure + // another thread did not get in and cache a klass ahead of us. In that case, return their klass + // and allow our newly-created klass object to just leak. mono_memory_barrier (); - if (!image) //FIXME is this only needed by monodis? Can't we fix monodis instead of having this hack? - image = mono_defaults.corlib; - mono_image_lock (image); - if (container) + + // Here "klass2" refers to the klass potentially created by the other thread. + if (pinfo) // Repeat check from above klass2 = pinfo->pklass; else - klass2 = get_anon_gparam_class (param, is_mvar, FALSE); + klass2 = get_anon_gparam_class (param, FALSE); if (klass2) { klass = klass2; } else { - if (container) + // Cache here + if (pinfo) pinfo->pklass = klass; else - set_anon_gparam_class (param, is_mvar, klass); + set_anon_gparam_class (param, klass); } mono_image_unlock (image); /* FIXME: Should this go inside 'make_generic_param_klass'? */ if (klass2) - mono_profiler_class_loaded (klass2, MONO_PROFILE_FAILED); + mono_profiler_class_loaded (klass2, MONO_PROFILE_FAILED); // Alert profiler about botched class create else mono_profiler_class_loaded (klass, MONO_PROFILE_OK); return klass; } +/** + * mono_class_from_generic_parameter: + * @param: Parameter to find/construct a class for. + * @arg2: Is ignored. + * @arg3: Is ignored. + */ +MonoClass * +mono_class_from_generic_parameter (MonoGenericParam *param, MonoImage *arg2 G_GNUC_UNUSED, gboolean arg3 G_GNUC_UNUSED) +{ + return mono_class_from_generic_parameter_internal (param); +} + + MonoClass * mono_ptr_class_get (MonoType *type) { @@ -6385,14 +6452,14 @@ mono_ptr_class_get (MonoType *type) mono_image_lock (image); if (image->ptr_cache) { - if ((result = g_hash_table_lookup (image->ptr_cache, el_class))) { + if ((result = (MonoClass *)g_hash_table_lookup (image->ptr_cache, el_class))) { mono_image_unlock (image); return result; } } mono_image_unlock (image); - result = mono_image_alloc0 (image, sizeof (MonoClass)); + result = (MonoClass *)mono_image_alloc0 (image, sizeof (MonoClass)); classes_size += sizeof (MonoClass); @@ -6412,7 +6479,8 @@ mono_ptr_class_get (MonoType *type) result->cast_class = result->element_class = el_class; result->blittable = TRUE; - result->this_arg.type = result->byval_arg.type = MONO_TYPE_PTR; + result->byval_arg.type = MONO_TYPE_PTR; + result->this_arg.type = result->byval_arg.type; result->this_arg.data.type = result->byval_arg.data.type = &result->element_class->byval_arg; result->this_arg.byref = TRUE; @@ -6421,7 +6489,7 @@ mono_ptr_class_get (MonoType *type) mono_image_lock (image); if (image->ptr_cache) { MonoClass *result2; - if ((result2 = g_hash_table_lookup (image->ptr_cache, el_class))) { + if ((result2 = (MonoClass *)g_hash_table_lookup (image->ptr_cache, el_class))) { mono_image_unlock (image); mono_profiler_class_loaded (result, MONO_PROFILE_FAILED); return result2; @@ -6450,7 +6518,7 @@ mono_fnptr_class_get (MonoMethodSignature *sig) if (!ptr_hash) ptr_hash = g_hash_table_new (mono_aligned_addr_hash, NULL); - if ((result = g_hash_table_lookup (ptr_hash, sig))) { + if ((result = (MonoClass *)g_hash_table_lookup (ptr_hash, sig))) { mono_loader_unlock (); return result; } @@ -6470,7 +6538,8 @@ mono_fnptr_class_get (MonoMethodSignature *sig) result->cast_class = result->element_class = result; result->blittable = TRUE; - result->this_arg.type = result->byval_arg.type = MONO_TYPE_FNPTR; + result->byval_arg.type = MONO_TYPE_FNPTR; + result->this_arg.type = result->byval_arg.type; result->this_arg.data.method = result->byval_arg.data.method = sig; result->this_arg.byref = TRUE; result->blittable = TRUE; @@ -6539,10 +6608,9 @@ mono_class_from_mono_type (MonoType *type) return type->data.klass; case MONO_TYPE_GENERICINST: return mono_generic_class_get_class (type->data.generic_class); - case MONO_TYPE_VAR: - return mono_class_from_generic_parameter (type->data.generic_param, NULL, FALSE); case MONO_TYPE_MVAR: - return mono_class_from_generic_parameter (type->data.generic_param, NULL, TRUE); + case MONO_TYPE_VAR: + return mono_class_from_generic_parameter_internal (type->data.generic_param); default: g_warning ("mono_class_from_mono_type: implement me 0x%02x\n", type->type); g_assert_not_reached (); @@ -6637,11 +6705,11 @@ mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded) * from mono_class_from_mono_type (), mono_array_new (), * Array:CreateInstance (), etc, so use a separate cache + a separate lock. */ - mono_mutex_lock (&image->szarray_cache_lock); + mono_os_mutex_lock (&image->szarray_cache_lock); if (!image->szarray_cache) image->szarray_cache = g_hash_table_new (mono_aligned_addr_hash, NULL); - klass = g_hash_table_lookup (image->szarray_cache, eclass); - mono_mutex_unlock (&image->szarray_cache_lock); + klass = (MonoClass *)g_hash_table_lookup (image->szarray_cache, eclass); + mono_os_mutex_unlock (&image->szarray_cache_lock); if (klass) return klass; @@ -6652,9 +6720,9 @@ mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded) if (!image->array_cache) image->array_cache = g_hash_table_new (mono_aligned_addr_hash, NULL); - if ((rootlist = list = g_hash_table_lookup (image->array_cache, eclass))) { + if ((rootlist = list = (GSList *)g_hash_table_lookup (image->array_cache, eclass))) { for (; list; list = list->next) { - klass = list->data; + klass = (MonoClass *)list->data; if ((klass->rank == rank) && (klass->byval_arg.type == (((rank > 1) || bounded) ? MONO_TYPE_ARRAY : MONO_TYPE_SZARRAY))) { mono_loader_unlock (); return klass; @@ -6673,12 +6741,12 @@ mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded) mono_class_init (parent); } - klass = mono_image_alloc0 (image, sizeof (MonoClass)); + klass = (MonoClass *)mono_image_alloc0 (image, sizeof (MonoClass)); klass->image = image; klass->name_space = eclass->name_space; nsize = strlen (eclass->name); - name = g_malloc (nsize + 2 + rank + 1); + name = (char *)g_malloc (nsize + 2 + rank + 1); memcpy (name, eclass->name, nsize); name [nsize] = '['; if (rank > 1) @@ -6759,7 +6827,7 @@ mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded) klass->element_class = eclass; if ((rank > 1) || bounded) { - MonoArrayType *at = mono_image_alloc0 (image, sizeof (MonoArrayType)); + MonoArrayType *at = (MonoArrayType *)mono_image_alloc0 (image, sizeof (MonoArrayType)); klass->byval_arg.type = MONO_TYPE_ARRAY; klass->byval_arg.data.array = at; at->eklass = eclass; @@ -6780,14 +6848,14 @@ mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded) if (rank == 1 && !bounded) { MonoClass *prev_class; - mono_mutex_lock (&image->szarray_cache_lock); - prev_class = g_hash_table_lookup (image->szarray_cache, eclass); + mono_os_mutex_lock (&image->szarray_cache_lock); + prev_class = (MonoClass *)g_hash_table_lookup (image->szarray_cache, eclass); if (prev_class) /* Someone got in before us */ klass = prev_class; else g_hash_table_insert (image->szarray_cache, eclass, klass); - mono_mutex_unlock (&image->szarray_cache_lock); + mono_os_mutex_unlock (&image->szarray_cache_lock); } else { list = g_slist_append (rootlist, klass); g_hash_table_insert (image->array_cache, eclass, list); @@ -7073,7 +7141,7 @@ mono_class_get_field_default_value (MonoClassField *field, MonoTypeEnum *def_typ mono_class_alloc_ext (klass); - def_values = mono_class_alloc0 (klass, sizeof (MonoFieldDefaultValue) * klass->field.count); + def_values = (MonoFieldDefaultValue *)mono_class_alloc0 (klass, sizeof (MonoFieldDefaultValue) * klass->field.count); mono_image_lock (klass->image); mono_memory_barrier (); @@ -7092,8 +7160,8 @@ mono_class_get_field_default_value (MonoClassField *field, MonoTypeEnum *def_typ g_assert (!(field->type->attrs & FIELD_ATTRIBUTE_HAS_FIELD_RVA)); mono_metadata_decode_row (&field->parent->image->tables [MONO_TABLE_CONSTANT], cindex - 1, constant_cols, MONO_CONSTANT_SIZE); - klass->ext->field_def_values [field_index].def_type = constant_cols [MONO_CONSTANT_TYPE]; - klass->ext->field_def_values [field_index].data = (gpointer)mono_metadata_blob_heap (field->parent->image, constant_cols [MONO_CONSTANT_VALUE]); + klass->ext->field_def_values [field_index].def_type = (MonoTypeEnum)constant_cols [MONO_CONSTANT_TYPE]; + klass->ext->field_def_values [field_index].data = (const char *)mono_metadata_blob_heap (field->parent->image, constant_cols [MONO_CONSTANT_VALUE]); } *def_type = klass->ext->field_def_values [field_index].def_type; @@ -7142,8 +7210,8 @@ mono_class_get_property_default_value (MonoProperty *property, MonoTypeEnum *def return NULL; mono_metadata_decode_row (&klass->image->tables [MONO_TABLE_CONSTANT], cindex - 1, constant_cols, MONO_CONSTANT_SIZE); - *def_type = constant_cols [MONO_CONSTANT_TYPE]; - return (gpointer)mono_metadata_blob_heap (klass->image, constant_cols [MONO_CONSTANT_VALUE]); + *def_type = (MonoTypeEnum)constant_cols [MONO_CONSTANT_TYPE]; + return (const char *)mono_metadata_blob_heap (klass->image, constant_cols [MONO_CONSTANT_VALUE]); } guint32 @@ -7376,7 +7444,7 @@ mono_class_get_checked (MonoImage *image, guint32 type_token, MonoError *error) mono_error_set_bad_image (error, image,"Bad token table for dynamic image: %x", table); return NULL; } - klass = mono_lookup_dynamic_token (image, type_token, NULL); /*FIXME proper error handling*/ + klass = (MonoClass *)mono_lookup_dynamic_token (image, type_token, NULL); /*FIXME proper error handling*/ goto done; } @@ -7427,7 +7495,7 @@ mono_type_get_checked (MonoImage *image, guint32 type_token, MonoGenericContext //FIXME: this will not fix the very issue for which mono_type_get_full exists -but how to do it then? if (image_is_dynamic (image)) - return mono_class_get_type (mono_lookup_dynamic_token (image, type_token, context)); + return mono_class_get_type ((MonoClass *)mono_lookup_dynamic_token (image, type_token, context)); if ((type_token & 0xff000000) != MONO_TOKEN_TYPE_SPEC) { MonoClass *klass = mono_class_get_checked (image, type_token, error); @@ -7522,7 +7590,7 @@ mono_image_init_name_cache (MonoImage *image) nspace = mono_metadata_string_heap (image, cols [MONO_TYPEDEF_NAMESPACE]); nspace_index = cols [MONO_TYPEDEF_NAMESPACE]; - nspace_table = g_hash_table_lookup (name_cache2, GUINT_TO_POINTER (nspace_index)); + nspace_table = (GHashTable *)g_hash_table_lookup (name_cache2, GUINT_TO_POINTER (nspace_index)); if (!nspace_table) { nspace_table = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (the_name_cache, (char*)nspace, nspace_table); @@ -7550,7 +7618,7 @@ mono_image_init_name_cache (MonoImage *image) nspace = mono_metadata_string_heap (image, cols [MONO_EXP_TYPE_NAMESPACE]); nspace_index = cols [MONO_EXP_TYPE_NAMESPACE]; - nspace_table = g_hash_table_lookup (name_cache2, GUINT_TO_POINTER (nspace_index)); + nspace_table = (GHashTable *)g_hash_table_lookup (name_cache2, GUINT_TO_POINTER (nspace_index)); if (!nspace_table) { nspace_table = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (the_name_cache, (char*)nspace, nspace_table); @@ -7586,7 +7654,7 @@ mono_image_add_to_name_cache (MonoImage *image, const char *nspace, mono_image_lock (image); name_cache = image->name_cache; - if (!(nspace_table = g_hash_table_lookup (name_cache, nspace))) { + if (!(nspace_table = (GHashTable *)g_hash_table_lookup (name_cache, nspace))) { nspace_table = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (name_cache, (char *)nspace, (char *)nspace_table); } @@ -7794,7 +7862,7 @@ mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, cons mono_image_init_name_cache (image); mono_image_lock (image); - nspace_table = g_hash_table_lookup (image->name_cache, name_space); + nspace_table = (GHashTable *)g_hash_table_lookup (image->name_cache, name_space); if (nspace_table) token = GPOINTER_TO_UINT (g_hash_table_lookup (nspace_table, name)); @@ -8327,7 +8395,7 @@ mono_class_implement_interface_slow (MonoClass *target, MonoClass *candidate) /*A TypeBuilder can have more interfaces on tb->interfaces than on candidate->interfaces*/ if (image_is_dynamic (candidate->image) && !candidate->wastypebuilder) { - MonoReflectionTypeBuilder *tb = mono_class_get_ref_info (candidate); + MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)mono_class_get_ref_info (candidate); int j; if (tb && tb->interfaces) { for (j = mono_array_length (tb->interfaces) - 1; j >= 0; --j) { @@ -8988,16 +9056,18 @@ mono_class_get_fields (MonoClass* klass, gpointer *iter) return NULL; /* start from the first */ if (klass->field.count) { - return *iter = &klass->fields [0]; + *iter = &klass->fields [0]; + return &klass->fields [0]; } else { /* no fields */ return NULL; } } - field = *iter; + field = (MonoClassField *)*iter; field++; if (field < &klass->fields [klass->field.count]) { - return *iter = field; + *iter = field; + return field; } return NULL; } @@ -9038,7 +9108,7 @@ mono_class_get_methods (MonoClass* klass, gpointer *iter) return NULL; } } - method = *iter; + method = (MonoMethod **)*iter; method++; if (method < &klass->methods [klass->method.count]) { *iter = method; @@ -9072,7 +9142,7 @@ mono_class_get_virtual_methods (MonoClass* klass, gpointer *iter) /* start from the first */ method = &klass->methods [0]; } else { - method = *iter; + method = (MonoMethod **)*iter; method++; } while (method < &klass->methods [klass->method.count]) { @@ -9143,16 +9213,18 @@ mono_class_get_properties (MonoClass* klass, gpointer *iter) mono_class_setup_properties (klass); /* start from the first */ if (klass->ext->property.count) { - return *iter = &klass->ext->properties [0]; + *iter = &klass->ext->properties [0]; + return (MonoProperty *)*iter; } else { /* no fields */ return NULL; } } - property = *iter; + property = (MonoProperty *)*iter; property++; if (property < &klass->ext->properties [klass->ext->property.count]) { - return *iter = property; + *iter = property; + return (MonoProperty *)*iter; } return NULL; } @@ -9179,16 +9251,18 @@ mono_class_get_events (MonoClass* klass, gpointer *iter) mono_class_setup_events (klass); /* start from the first */ if (klass->ext->event.count) { - return *iter = &klass->ext->events [0]; + *iter = &klass->ext->events [0]; + return (MonoEvent *)*iter; } else { /* no fields */ return NULL; } } - event = *iter; + event = (MonoEvent *)*iter; event++; if (event < &klass->ext->events [klass->ext->event.count]) { - return *iter = event; + *iter = event; + return (MonoEvent *)*iter; } return NULL; } @@ -9231,7 +9305,7 @@ mono_class_get_interfaces (MonoClass* klass, gpointer *iter) return NULL; } } - iface = *iter; + iface = (MonoClass **)*iter; iface++; if (iface < &klass->interfaces [klass->interface_count]) { *iter = iface; @@ -9319,17 +9393,17 @@ mono_class_get_nested_types (MonoClass* klass, gpointer *iter) /* start from the first */ if (klass->ext && klass->ext->nested_classes) { *iter = klass->ext->nested_classes; - return klass->ext->nested_classes->data; + return (MonoClass *)klass->ext->nested_classes->data; } else { /* no nested types */ return NULL; } } - item = *iter; + item = (GList *)*iter; item = item->next; if (item) { *iter = item; - return item->data; + return (MonoClass *)item->data; } return NULL; } @@ -9461,7 +9535,7 @@ mono_field_get_rva (MonoClassField *field) if (!klass->ext || !klass->ext->field_def_values) { mono_class_alloc_ext (klass); - field_def_values = mono_class_alloc0 (klass, sizeof (MonoFieldDefaultValue) * klass->field.count); + field_def_values = (MonoFieldDefaultValue *)mono_class_alloc0 (klass, sizeof (MonoFieldDefaultValue) * klass->field.count); mono_image_lock (klass->image); if (!klass->ext->field_def_values) @@ -9800,7 +9874,7 @@ mono_class_get_exception_data (MonoClass *klass) void mono_classes_init (void) { - mono_mutex_init (&classes_mutex); + mono_os_mutex_init (&classes_mutex); mono_counters_register ("Inflated methods size", MONO_COUNTER_GENERICS | MONO_COUNTER_INT, &inflated_methods_size); @@ -9825,7 +9899,7 @@ mono_classes_cleanup (void) if (global_interface_bitset) mono_bitset_free (global_interface_bitset); global_interface_bitset = NULL; - mono_mutex_destroy (&classes_mutex); + mono_os_mutex_destroy (&classes_mutex); } /** @@ -9854,19 +9928,19 @@ mono_class_get_exception_for_failure (MonoClass *klass) return ex; } case MONO_EXCEPTION_MISSING_METHOD: { - char *class_name = exception_data; + char *class_name = (char *)exception_data; char *assembly_name = class_name + strlen (class_name) + 1; return mono_get_exception_missing_method (class_name, assembly_name); } case MONO_EXCEPTION_MISSING_FIELD: { - char *class_name = exception_data; + char *class_name = (char *)exception_data; char *member_name = class_name + strlen (class_name) + 1; return mono_get_exception_missing_field (class_name, member_name); } case MONO_EXCEPTION_FILE_NOT_FOUND: { - char *msg_format = exception_data; + char *msg_format = (char *)exception_data; char *assembly_name = msg_format + strlen (msg_format) + 1; char *msg = g_strdup_printf (msg_format, assembly_name); MonoException *ex; @@ -9878,7 +9952,7 @@ mono_class_get_exception_for_failure (MonoClass *klass) return ex; } case MONO_EXCEPTION_BAD_IMAGE: { - return mono_get_exception_bad_image_format (exception_data); + return mono_get_exception_bad_image_format ((const char *)exception_data); } default: { MonoLoaderError *error; @@ -9983,16 +10057,16 @@ can_access_internals (MonoAssembly *accessing, MonoAssembly* accessed) mono_assembly_load_friends (accessed); for (tmp = accessed->friend_assembly_names; tmp; tmp = tmp->next) { - MonoAssemblyName *friend = tmp->data; + MonoAssemblyName *friend_ = (MonoAssemblyName *)tmp->data; /* Be conservative with checks */ - if (!friend->name) + if (!friend_->name) continue; - if (strcmp (accessing->aname.name, friend->name)) + if (strcmp (accessing->aname.name, friend_->name)) continue; - if (friend->public_key_token [0]) { + if (friend_->public_key_token [0]) { if (!accessing->aname.public_key_token [0]) continue; - if (!mono_public_tokens_are_equal (friend->public_key_token, accessing->aname.public_key_token)) + if (!mono_public_tokens_are_equal (friend_->public_key_token, accessing->aname.public_key_token)) continue; } return TRUE; @@ -10424,7 +10498,7 @@ mono_class_alloc_ext (MonoClass *klass) if (klass->ext) return; - ext = mono_class_alloc0 (klass, sizeof (MonoClassExt)); + ext = (MonoClassExt *)mono_class_alloc0 (klass, sizeof (MonoClassExt)); mono_image_lock (klass->image); mono_memory_barrier (); if (!klass->ext) @@ -10456,7 +10530,7 @@ mono_class_setup_interfaces (MonoClass *klass, MonoError *error) /* generic IList, ICollection, IEnumerable */ interface_count = mono_defaults.generic_ireadonlylist_class ? 2 : 1; - interfaces = mono_image_alloc0 (klass->image, sizeof (MonoClass*) * interface_count); + interfaces = (MonoClass **)mono_image_alloc0 (klass->image, sizeof (MonoClass*) * interface_count); args [0] = &klass->element_class->byval_arg; interfaces [0] = mono_class_bind_generic_parameters ( @@ -10625,16 +10699,18 @@ mono_class_get_fields_lazy (MonoClass* klass, gpointer *iter) return NULL; /* start from the first */ if (klass->field.count) { - return *iter = &klass->fields [0]; + *iter = &klass->fields [0]; + return (MonoClassField *)*iter; } else { /* no fields */ return NULL; } } - field = *iter; + field = (MonoClassField *)*iter; field++; if (field < &klass->fields [klass->field.count]) { - return *iter = field; + *iter = field; + return (MonoClassField *)*iter; } return NULL; } diff --git a/mono/metadata/cominterop.c b/mono/metadata/cominterop.c index 7ac6667914d..9c4c8e60d37 100644 --- a/mono/metadata/cominterop.c +++ b/mono/metadata/cominterop.c @@ -75,8 +75,8 @@ enum { #undef OPDEF /* This mutex protects the various cominterop related caches in MonoImage */ -#define mono_cominterop_lock() mono_mutex_lock (&cominterop_mutex) -#define mono_cominterop_unlock() mono_mutex_unlock (&cominterop_mutex) +#define mono_cominterop_lock() mono_os_mutex_lock (&cominterop_mutex) +#define mono_cominterop_unlock() mono_os_mutex_unlock (&cominterop_mutex) static mono_mutex_t cominterop_mutex; /* STDCALL on windows, CDECL everywhere else to work with XPCOM and MainWin COM */ @@ -322,7 +322,7 @@ cominterop_get_method_interface (MonoMethod* method) for (i = 0; i < ifaces->len; ++i) { int j, offset; gboolean found = FALSE; - ic = g_ptr_array_index (ifaces, i); + ic = (MonoClass *)g_ptr_array_index (ifaces, i); offset = mono_class_interface_offset (method->klass, ic); for (j = 0; j < ic->method.count; ++j) { if (method->klass->vtable [j + offset] == method) { @@ -443,7 +443,7 @@ cominterop_com_visible (MonoClass* klass) int i; for (i = 0; i < ifaces->len; ++i) { MonoClass *ic = NULL; - ic = g_ptr_array_index (ifaces, i); + ic = (MonoClass *)g_ptr_array_index (ifaces, i); if (MONO_CLASS_IS_IMPORT (ic)) visible = TRUE; @@ -532,7 +532,7 @@ mono_cominterop_init (void) { const char* com_provider_env; - mono_mutex_init_recursive (&cominterop_mutex); + mono_os_mutex_init_recursive (&cominterop_mutex); com_provider_env = g_getenv ("MONO_COM"); if (com_provider_env && !strcmp(com_provider_env, "MS")) @@ -564,7 +564,7 @@ mono_cominterop_init (void) void mono_cominterop_cleanup (void) { - mono_mutex_destroy (&cominterop_mutex); + mono_os_mutex_destroy (&cominterop_mutex); } void @@ -1640,7 +1640,8 @@ ves_icall_System_ComObject_ReleaseInterfaces (MonoComObject* obj) g_hash_table_foreach_remove (obj->itf_hash, cominterop_rcw_interface_finalizer, NULL); g_hash_table_destroy (obj->itf_hash); ves_icall_System_Runtime_InteropServices_Marshal_ReleaseInternal (obj->iunknown); - obj->itf_hash = obj->iunknown = NULL; + obj->iunknown = NULL; + obj->itf_hash = NULL; mono_cominterop_unlock (); } } @@ -1661,7 +1662,8 @@ cominterop_rcw_finalizer (gpointer key, gpointer value, gpointer user_data) } if (proxy->com_object->iunknown) ves_icall_System_Runtime_InteropServices_Marshal_ReleaseInternal (proxy->com_object->iunknown); - proxy->com_object->itf_hash = proxy->com_object->iunknown = NULL; + proxy->com_object->iunknown = NULL; + proxy->com_object->itf_hash = NULL; } mono_gchandle_free (gchandle); @@ -1764,7 +1766,7 @@ cominterop_get_ccw_object (MonoCCWInterface* ccw_entry, gboolean verify) return NULL; if (verify) { - ccw = g_hash_table_lookup (ccw_interface_hash, ccw_entry); + ccw = (MonoCCW *)g_hash_table_lookup (ccw_interface_hash, ccw_entry); } else { ccw = ccw_entry->ccw; @@ -1838,12 +1840,12 @@ cominterop_get_ccw (MonoObject* object, MonoClass* itf) if (!ccw_interface_hash) ccw_interface_hash = g_hash_table_new (mono_aligned_addr_hash, NULL); - ccw_list = g_hash_table_lookup (ccw_hash, GINT_TO_POINTER (mono_object_hash (object))); + ccw_list = (GList *)g_hash_table_lookup (ccw_hash, GINT_TO_POINTER (mono_object_hash (object))); mono_cominterop_unlock (); ccw_list_item = ccw_list; while (ccw_list_item) { - MonoCCW* ccw_iter = ccw_list_item->data; + MonoCCW* ccw_iter = (MonoCCW *)ccw_list_item->data; if (mono_gchandle_get_target (ccw_iter->gc_handle) == object) { ccw = ccw_iter; break; @@ -1913,11 +1915,11 @@ cominterop_get_ccw (MonoObject* object, MonoClass* itf) iface = NULL; } - ccw_entry = g_hash_table_lookup (ccw->vtable_hash, itf); + ccw_entry = (MonoCCWInterface *)g_hash_table_lookup (ccw->vtable_hash, itf); if (!ccw_entry) { int vtable_index = method_count-1+start_slot; - vtable = mono_image_alloc0 (klass->image, sizeof (gpointer)*(method_count+start_slot)); + vtable = (void **)mono_image_alloc0 (klass->image, sizeof (gpointer)*(method_count+start_slot)); memcpy (vtable, iunknown, sizeof (iunknown)); if (start_slot == 7) memcpy (vtable+3, idispatch, sizeof (idispatch)); @@ -2055,7 +2057,7 @@ mono_marshal_free_ccw (MonoObject* object) /* need to cache orig list address to remove from hash_table if empty */ mono_cominterop_lock (); - ccw_list = ccw_list_orig = g_hash_table_lookup (ccw_hash, GINT_TO_POINTER (mono_object_hash (object))); + ccw_list = ccw_list_orig = (GList *)g_hash_table_lookup (ccw_hash, GINT_TO_POINTER (mono_object_hash (object))); mono_cominterop_unlock (); if (!ccw_list) @@ -2063,7 +2065,7 @@ mono_marshal_free_ccw (MonoObject* object) ccw_list_item = ccw_list; while (ccw_list_item) { - MonoCCW* ccw_iter = ccw_list_item->data; + MonoCCW* ccw_iter = (MonoCCW *)ccw_list_item->data; MonoObject* handle_target = mono_gchandle_get_target (ccw_iter->gc_handle); /* Looks like the GC NULLs the weakref handle target before running the @@ -2072,7 +2074,7 @@ mono_marshal_free_ccw (MonoObject* object) */ gboolean destroy_ccw = !handle_target || handle_target == object; if (!handle_target) { - MonoCCWInterface* ccw_entry = g_hash_table_lookup (ccw_iter->vtable_hash, mono_class_get_iunknown_class ()); + MonoCCWInterface* ccw_entry = (MonoCCWInterface *)g_hash_table_lookup (ccw_iter->vtable_hash, mono_class_get_iunknown_class ()); if (!(ccw_entry && object == cominterop_get_ccw_object (ccw_entry, FALSE))) destroy_ccw = FALSE; } @@ -2350,7 +2352,7 @@ cominterop_ccw_queryinterface (MonoCCWInterface* ccwe, guint8* riid, gpointer* p if (cominterop_class_guid_equal (riid, mono_class_get_iunknown_class ())) { *ppv = cominterop_get_ccw (object, mono_class_get_iunknown_class ()); /* remember to addref on QI */ - cominterop_ccw_addref (*ppv); + cominterop_ccw_addref ((MonoCCWInterface *)*ppv); return MONO_S_OK; } @@ -2361,7 +2363,7 @@ cominterop_ccw_queryinterface (MonoCCWInterface* ccwe, guint8* riid, gpointer* p *ppv = cominterop_get_ccw (object, mono_class_get_idispatch_class ()); /* remember to addref on QI */ - cominterop_ccw_addref (*ppv); + cominterop_ccw_addref ((MonoCCWInterface *)*ppv); return MONO_S_OK; } @@ -2378,7 +2380,7 @@ cominterop_ccw_queryinterface (MonoCCWInterface* ccwe, guint8* riid, gpointer* p if (ifaces) { for (i = 0; i < ifaces->len; ++i) { MonoClass *ic = NULL; - ic = g_ptr_array_index (ifaces, i); + ic = (MonoClass *)g_ptr_array_index (ifaces, i); if (cominterop_class_guid_equal (riid, ic)) { itf = ic; break; @@ -2395,7 +2397,7 @@ cominterop_ccw_queryinterface (MonoCCWInterface* ccwe, guint8* riid, gpointer* p if (itf) { *ppv = cominterop_get_ccw (object, itf); /* remember to addref on QI */ - cominterop_ccw_addref (*ppv); + cominterop_ccw_addref ((MonoCCWInterface *)*ppv); return MONO_S_OK; } @@ -2619,7 +2621,7 @@ mono_string_to_bstr (MonoString *string_obj) if (com_provider == MONO_COM_DEFAULT) { int slen = mono_string_length (string_obj); /* allocate len + 1 utf16 characters plus 4 byte integer for length*/ - char *ret = g_malloc ((slen + 1) * sizeof(gunichar2) + sizeof(guint32)); + char *ret = (char *)g_malloc ((slen + 1) * sizeof(gunichar2) + sizeof(guint32)); if (ret == NULL) return NULL; memcpy (ret + sizeof(guint32), mono_string_chars (string_obj), slen * sizeof(gunichar2)); @@ -2653,13 +2655,13 @@ mono_string_from_bstr (gpointer bstr) return mono_string_new_utf16 (mono_domain_get (), bstr, SysStringLen (bstr)); #else if (com_provider == MONO_COM_DEFAULT) { - return mono_string_new_utf16 (mono_domain_get (), bstr, *((guint32 *)bstr - 1) / sizeof(gunichar2)); + return mono_string_new_utf16 (mono_domain_get (), (const mono_unichar2 *)bstr, *((guint32 *)bstr - 1) / sizeof(gunichar2)); } else if (com_provider == MONO_COM_MS && init_com_provider_ms ()) { MonoString* str = NULL; glong written = 0; gunichar2* utf16 = NULL; - utf16 = g_ucs4_to_utf16 (bstr, sys_string_len_ms (bstr), NULL, &written, NULL); + utf16 = g_ucs4_to_utf16 ((const gunichar *)bstr, sys_string_len_ms (bstr), NULL, &written, NULL); str = mono_string_new_utf16 (mono_domain_get (), utf16, written); g_free (utf16); return str; @@ -2681,7 +2683,7 @@ mono_free_bstr (gpointer bstr) if (com_provider == MONO_COM_DEFAULT) { g_free (((char *)bstr) - 4); } else if (com_provider == MONO_COM_MS && init_com_provider_ms ()) { - sys_free_string_ms (bstr); + sys_free_string_ms ((gunichar *)bstr); } else { g_assert_not_reached (); } @@ -3017,8 +3019,8 @@ mono_marshal_safearray_begin (gpointer safearray, MonoArray **result, gpointer * *indices = g_malloc (dim * sizeof(int)); - sizes = alloca (dim * sizeof(uintptr_t)); - bounds = alloca (dim * sizeof(intptr_t)); + sizes = (uintptr_t *)alloca (dim * sizeof(uintptr_t)); + bounds = (intptr_t *)alloca (dim * sizeof(intptr_t)); for (i=0; ivtable->klass->rank; *indices = g_malloc (dim * sizeof (int)); - bounds = alloca (dim * sizeof (SAFEARRAYBOUND)); + bounds = (SAFEARRAYBOUND *)alloca (dim * sizeof (SAFEARRAYBOUND)); (*(int*)empty) = (max_array_length == 0); if (dim > 1) { @@ -3183,7 +3185,7 @@ void mono_marshal_safearray_set_value (gpointer safearray, gpointer indices, gpo cominterop_raise_hr_exception (hr); #else if (com_provider == MONO_COM_MS && init_com_provider_ms ()) { - int hr = safe_array_put_element_ms (safearray, indices, value); + int hr = safe_array_put_element_ms (safearray, (glong *)indices, (void **)value); if (hr < 0) { cominterop_raise_hr_exception (hr); } diff --git a/mono/metadata/console-unix.c b/mono/metadata/console-unix.c index 9629857be70..0ac3b3981f1 100644 --- a/mono/metadata/console-unix.c +++ b/mono/metadata/console-unix.c @@ -344,19 +344,19 @@ console_set_signal_handlers () memset (&sigwinch, 0, sizeof (struct sigaction)); // Continuing - sigcont.sa_handler = (void *) sigcont_handler; + sigcont.sa_handler = (void (*)(int)) sigcont_handler; sigcont.sa_flags = 0; sigemptyset (&sigcont.sa_mask); sigaction (SIGCONT, &sigcont, &save_sigcont); // Interrupt handler - sigint.sa_handler = (void *) sigint_handler; + sigint.sa_handler = (void (*)(int)) sigint_handler; sigint.sa_flags = 0; sigemptyset (&sigint.sa_mask); sigaction (SIGINT, &sigint, &save_sigint); // Window size changed - sigwinch.sa_handler = (void *) sigwinch_handler; + sigwinch.sa_handler = (void (*)(int)) sigwinch_handler; sigwinch.sa_flags = 0; sigemptyset (&sigwinch.sa_mask); sigaction (SIGWINCH, &sigwinch, &save_sigwinch); diff --git a/mono/metadata/debug-helpers.c b/mono/metadata/debug-helpers.c index f55443001b4..f89de87218e 100644 --- a/mono/metadata/debug-helpers.c +++ b/mono/metadata/debug-helpers.c @@ -1031,7 +1031,7 @@ mono_class_describe_statics (MonoClass* klass) if (!vtable) return; - if (!(addr = mono_vtable_get_static_field_data (vtable))) + if (!(addr = (const char *)mono_vtable_get_static_field_data (vtable))) return; for (p = klass; p != NULL; p = p->parent) { diff --git a/mono/metadata/debug-mono-ppdb.c b/mono/metadata/debug-mono-ppdb.c index 560f6bd035b..46cf3468e5d 100644 --- a/mono/metadata/debug-mono-ppdb.c +++ b/mono/metadata/debug-mono-ppdb.c @@ -88,7 +88,7 @@ get_pe_debug_guid (MonoImage *image, guint8 *out_guid, gint32 *out_age, gint32 * static void doc_free (gpointer key) { - MonoDebugSourceInfo *info = key; + MonoDebugSourceInfo *info = (MonoDebugSourceInfo *)key; g_free (info->source_file); g_free (info); @@ -111,7 +111,7 @@ mono_ppdb_load_file (MonoImage *image, const guint8 *raw_contents, int size) } else { /* ppdb files drop the .exe/.dll extension */ filename = mono_image_get_filename (image); - if (strlen (filename) > 4 && (!strcmp (filename + strlen (filename) - 4, ".exe"))) { + if (strlen (filename) > 4 && (!strcmp (filename + strlen (filename) - 4, ".exe") || !strcmp (filename + strlen (filename) - 4, ".dll"))) { s = g_strdup (filename); s [strlen (filename) - 4] = '\0'; ppdb_filename = g_strdup_printf ("%s.pdb", s); @@ -176,7 +176,7 @@ mono_ppdb_lookup_method (MonoDebugHandle *handle, MonoMethod *method) mono_debugger_lock (); - minfo = g_hash_table_lookup (ppdb->method_hash, method); + minfo = (MonoDebugMethodInfo *)g_hash_table_lookup (ppdb->method_hash, method); if (minfo) { mono_debugger_unlock (); return minfo; @@ -208,7 +208,7 @@ get_docinfo (MonoPPDBFile *ppdb, MonoImage *image, int docidx) MonoDebugSourceInfo *res, *cached; mono_debugger_lock (); - cached = g_hash_table_lookup (ppdb->doc_hash, GUINT_TO_POINTER (docidx)); + cached = (MonoDebugSourceInfo *)g_hash_table_lookup (ppdb->doc_hash, GUINT_TO_POINTER (docidx)); mono_debugger_unlock (); if (cached) return cached; @@ -246,7 +246,7 @@ get_docinfo (MonoPPDBFile *ppdb, MonoImage *image, int docidx) res->hash = (guint8*)mono_metadata_blob_heap (image, cols [MONO_DOCUMENT_HASH]); mono_debugger_lock (); - cached = g_hash_table_lookup (ppdb->doc_hash, GUINT_TO_POINTER (docidx)); + cached = (MonoDebugSourceInfo *)g_hash_table_lookup (ppdb->doc_hash, GUINT_TO_POINTER (docidx)); if (!cached) { g_hash_table_insert (ppdb->doc_hash, GUINT_TO_POINTER (docidx), res); } else { @@ -518,7 +518,7 @@ mono_ppdb_lookup_locals (MonoDebugMethodInfo *minfo) scope_idx = start_scope_idx; mono_metadata_decode_row (&tables [MONO_TABLE_LOCALSCOPE], scope_idx-1, cols, MONO_LOCALSCOPE_SIZE); locals_idx = cols [MONO_LOCALSCOPE_VARIABLELIST]; - while (TRUE) { + while (scope_idx == tables [MONO_TABLE_LOCALSCOPE].rows) { mono_metadata_decode_row (&tables [MONO_TABLE_LOCALSCOPE], scope_idx-1, cols, MONO_LOCALSCOPE_SIZE); if (cols [MONO_LOCALSCOPE_METHOD] != method_idx) break; @@ -526,9 +526,7 @@ mono_ppdb_lookup_locals (MonoDebugMethodInfo *minfo) } nscopes = scope_idx - start_scope_idx; if (scope_idx == tables [MONO_TABLE_LOCALSCOPE].rows) { - // FIXME: - g_assert_not_reached (); - locals_end_idx = -1; + locals_end_idx = tables [MONO_TABLE_LOCALVARIABLE].rows; } else { locals_end_idx = cols [MONO_LOCALSCOPE_VARIABLELIST]; } @@ -546,8 +544,7 @@ mono_ppdb_lookup_locals (MonoDebugMethodInfo *minfo) locals_idx = cols [MONO_LOCALSCOPE_VARIABLELIST]; if (scope_idx == tables [MONO_TABLE_LOCALSCOPE].rows) { - // FIXME: - g_assert_not_reached (); + locals_end_idx = tables [MONO_TABLE_LOCALVARIABLE].rows; } else { locals_end_idx = mono_metadata_decode_row_col (&tables [MONO_TABLE_LOCALSCOPE], scope_idx-1 + 1, MONO_LOCALSCOPE_VARIABLELIST); } diff --git a/mono/metadata/debug-mono-symfile.c b/mono/metadata/debug-mono-symfile.c index 39c348cd7be..8df4c0f9026 100644 --- a/mono/metadata/debug-mono-symfile.c +++ b/mono/metadata/debug-mono-symfile.c @@ -147,7 +147,7 @@ mono_debug_open_mono_symbols (MonoDebugHandle *handle, const uint8_t *raw_conten if (raw_contents != NULL) { unsigned char *p; symfile->raw_contents_size = size; - symfile->raw_contents = p = g_malloc (size); + symfile->raw_contents = p = (unsigned char *)g_malloc (size); memcpy (p, raw_contents, size); symfile->filename = g_strdup_printf ("LoadedFromMemory"); symfile->was_loaded_from_memory = TRUE; @@ -163,7 +163,7 @@ mono_debug_open_mono_symbols (MonoDebugHandle *handle, const uint8_t *raw_conten g_warning ("stat of %s failed: %s", symfile->filename, g_strerror (errno)); } else { - symfile->raw_contents = mono_file_map (symfile->raw_contents_size, MONO_MMAP_READ|MONO_MMAP_PRIVATE, mono_file_map_fd (f), 0, &symfile->raw_contents_handle); + symfile->raw_contents = (const unsigned char *)mono_file_map (symfile->raw_contents_size, MONO_MMAP_READ|MONO_MMAP_PRIVATE, mono_file_map_fd (f), 0, &symfile->raw_contents_handle); } mono_file_map_close (f); @@ -444,7 +444,7 @@ get_source_info (MonoSymbolFile *symfile, int index) { MonoDebugSourceInfo *info; - info = g_hash_table_lookup (symfile->source_hash, GUINT_TO_POINTER (index)); + info = (MonoDebugSourceInfo *)g_hash_table_lookup (symfile->source_hash, GUINT_TO_POINTER (index)); if (!info) { int offset = read32(&(symfile->offset_table->_source_table_offset)) + (index - 1) * sizeof (MonoSymbolFileSourceEntry); @@ -454,10 +454,10 @@ get_source_info (MonoSymbolFile *symfile, int index) info = g_new0 (MonoDebugSourceInfo, 1); info->source_file = read_string (ptr, &ptr); - info->guid = g_malloc0 (16); + info->guid = (guint8 *)g_malloc0 (16); memcpy (info->guid, ptr, 16); ptr += 16; - info->hash = g_malloc0 (16); + info->hash = (guint8 *)g_malloc0 (16); memcpy (info->hash, ptr, 16); ptr += 16; g_hash_table_insert (symfile->source_hash, GUINT_TO_POINTER (index), info); @@ -478,7 +478,7 @@ method_get_lnt_flags (MonoDebugMethodInfo *minfo) guint32 flags; if ((symfile = minfo->handle->symfile) == NULL) - return FALSE; + return (LineNumberTableFlags)0; ptr = symfile->raw_contents + minfo->data_offset; @@ -497,7 +497,7 @@ method_get_lnt_flags (MonoDebugMethodInfo *minfo) read_leb128 (ptr, &ptr); flags = read_leb128 (ptr, &ptr); - return flags; + return (LineNumberTableFlags)flags; } /* @@ -635,7 +635,7 @@ mono_debug_symfile_get_seq_points (MonoDebugMethodInfo *minfo, char **source_fil *source_file_list = g_ptr_array_new (); if (source_files) - *source_files = g_malloc (il_offset_array->len * sizeof (int)); + *source_files = (int *)g_malloc (il_offset_array->len * sizeof (int)); for (i = 0; i < il_offset_array->len; ++i) { file = GPOINTER_TO_UINT (g_ptr_array_index (source_file_array, i)); @@ -744,7 +744,7 @@ mono_debug_symfile_lookup_method (MonoDebugHandle *handle, MonoMethod *method) mono_debugger_lock (); - minfo = g_hash_table_lookup (symfile->method_hash, method); + minfo = (MonoDebugMethodInfo *)g_hash_table_lookup (symfile->method_hash, method); if (minfo) { mono_debugger_unlock (); return minfo; @@ -753,7 +753,7 @@ mono_debug_symfile_lookup_method (MonoDebugHandle *handle, MonoMethod *method) first_ie = (MonoSymbolFileMethodEntry *) (symfile->raw_contents + read32(&(symfile->offset_table->_method_table_offset))); - ie = mono_binary_search (GUINT_TO_POINTER (mono_method_get_token (method)), first_ie, + ie = (MonoSymbolFileMethodEntry *)mono_binary_search (GUINT_TO_POINTER (mono_method_get_token (method)), first_ie, read32(&(symfile->offset_table->_method_count)), sizeof (MonoSymbolFileMethodEntry), compare_method); @@ -823,7 +823,7 @@ mono_debug_symfile_lookup_locals (MonoDebugMethodInfo *minfo) for (i = 0; i < num_locals; ++i) { res->locals [i].index = read_leb128 (p, &p); len = read_leb128 (p, &p); - res->locals [i].name = g_malloc (len + 1); + res->locals [i].name = (char *)g_malloc (len + 1); memcpy (res->locals [i].name, p, len); res->locals [i].name [len] = '\0'; p += len; diff --git a/mono/metadata/domain-internals.h b/mono/metadata/domain-internals.h index effa3d851c8..2159f50f0e6 100644 --- a/mono/metadata/domain-internals.h +++ b/mono/metadata/domain-internals.h @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -285,7 +284,7 @@ struct _MonoDomain { * i.e. if both are taken by the same thread, the loader lock * must taken first. */ - mono_mutex_t lock; + MonoCoopMutex lock; MonoMemPool *mp; MonoCodeManager *code_mp; /* @@ -421,10 +420,10 @@ typedef struct { const AssemblyVersionSet version_sets [4]; } MonoRuntimeInfo; -#define mono_domain_assemblies_lock(domain) mono_locks_acquire(&(domain)->assemblies_lock, DomainAssembliesLock) -#define mono_domain_assemblies_unlock(domain) mono_locks_release(&(domain)->assemblies_lock, DomainAssembliesLock) -#define mono_domain_jit_code_hash_lock(domain) mono_locks_acquire(&(domain)->jit_code_hash_lock, DomainJitCodeHashLock) -#define mono_domain_jit_code_hash_unlock(domain) mono_locks_release(&(domain)->jit_code_hash_lock, DomainJitCodeHashLock) +#define mono_domain_assemblies_lock(domain) mono_locks_os_acquire(&(domain)->assemblies_lock, DomainAssembliesLock) +#define mono_domain_assemblies_unlock(domain) mono_locks_os_release(&(domain)->assemblies_lock, DomainAssembliesLock) +#define mono_domain_jit_code_hash_lock(domain) mono_locks_os_acquire(&(domain)->jit_code_hash_lock, DomainJitCodeHashLock) +#define mono_domain_jit_code_hash_unlock(domain) mono_locks_os_release(&(domain)->jit_code_hash_lock, DomainJitCodeHashLock) typedef MonoDomain* (*MonoLoadFunc) (const char *filename, const char *runtime_version); diff --git a/mono/metadata/domain.c b/mono/metadata/domain.c index 85d89d579fc..a485b71c969 100644 --- a/mono/metadata/domain.c +++ b/mono/metadata/domain.c @@ -93,14 +93,9 @@ static gboolean debug_domain_unload; gboolean mono_dont_free_domains; -#define mono_appdomains_lock() do { \ - MONO_TRY_BLOCKING; \ - mono_mutex_lock (&appdomains_mutex); \ - MONO_FINISH_TRY_BLOCKING; \ -} while (0); - -#define mono_appdomains_unlock() mono_mutex_unlock (&appdomains_mutex) -static mono_mutex_t appdomains_mutex; +#define mono_appdomains_lock() mono_coop_mutex_lock (&appdomains_mutex) +#define mono_appdomains_unlock() mono_coop_mutex_unlock (&appdomains_mutex) +static MonoCoopMutex appdomains_mutex; static MonoDomain *mono_root_domain = NULL; @@ -182,7 +177,7 @@ lock_free_mempool_free (LockFreeMempool *mp) chunk = mp->chunks; while (chunk) { - next = chunk->prev; + next = (LockFreeMempoolChunk *)chunk->prev; mono_vfree (chunk, mono_pagesize ()); chunk = next; } @@ -201,9 +196,9 @@ lock_free_mempool_chunk_new (LockFreeMempool *mp, int len) size = mono_pagesize (); while (size - sizeof (LockFreeMempoolChunk) < len) size += mono_pagesize (); - chunk = mono_valloc (0, size, MONO_MMAP_READ|MONO_MMAP_WRITE); + chunk = (LockFreeMempoolChunk *)mono_valloc (0, size, MONO_MMAP_READ|MONO_MMAP_WRITE); g_assert (chunk); - chunk->mem = ALIGN_PTR_TO ((char*)chunk + sizeof (LockFreeMempoolChunk), 16); + chunk->mem = (guint8 *)ALIGN_PTR_TO ((char*)chunk + sizeof (LockFreeMempoolChunk), 16); chunk->size = ((char*)chunk + size) - (char*)chunk->mem; chunk->pos = 0; @@ -346,7 +341,7 @@ domain_id_alloc (MonoDomain *domain) int id = -1, i; if (!appdomains_list) { appdomain_list_size = 2; - appdomains_list = mono_gc_alloc_fixed (appdomain_list_size * sizeof (void*), MONO_GC_DESCRIPTOR_NULL, MONO_ROOT_SOURCE_DOMAIN, "domains list"); + appdomains_list = (MonoDomain **)mono_gc_alloc_fixed (appdomain_list_size * sizeof (void*), MONO_GC_DESCRIPTOR_NULL, MONO_ROOT_SOURCE_DOMAIN, "domains list"); } for (i = appdomain_next; i < appdomain_list_size; ++i) { if (!appdomains_list [i]) { @@ -368,7 +363,7 @@ domain_id_alloc (MonoDomain *domain) if (new_size >= (1 << 16)) g_assert_not_reached (); id = appdomain_list_size; - new_list = mono_gc_alloc_fixed (new_size * sizeof (void*), MONO_GC_DESCRIPTOR_NULL, MONO_ROOT_SOURCE_DOMAIN, "domains list"); + new_list = (MonoDomain **)mono_gc_alloc_fixed (new_size * sizeof (void*), MONO_GC_DESCRIPTOR_NULL, MONO_ROOT_SOURCE_DOMAIN, "domains list"); memcpy (new_list, appdomains_list, appdomain_list_size * sizeof (void*)); mono_gc_free_fixed (appdomains_list); appdomains_list = new_list; @@ -412,9 +407,9 @@ mono_domain_create (void) * running the corlib test suite. * To solve this, we pass a NULL descriptor, and don't register roots. */ - domain = mono_gc_alloc_fixed (sizeof (MonoDomain), NULL, MONO_ROOT_SOURCE_DOMAIN, "domain object"); + domain = (MonoDomain *)mono_gc_alloc_fixed (sizeof (MonoDomain), NULL, MONO_ROOT_SOURCE_DOMAIN, "domain object"); #else - domain = mono_gc_alloc_fixed (sizeof (MonoDomain), domain_gc_desc, MONO_ROOT_SOURCE_DOMAIN, "domain object"); + domain = (MonoDomain *)mono_gc_alloc_fixed (sizeof (MonoDomain), domain_gc_desc, MONO_ROOT_SOURCE_DOMAIN, "domain object"); mono_gc_register_root ((char*)&(domain->MONO_DOMAIN_FIRST_GC_TRACKED), G_STRUCT_OFFSET (MonoDomain, MONO_DOMAIN_LAST_GC_TRACKED) - G_STRUCT_OFFSET (MonoDomain, MONO_DOMAIN_FIRST_GC_TRACKED), MONO_GC_DESCRIPTOR_NULL, MONO_ROOT_SOURCE_DOMAIN, "misc domain fields"); #endif domain->shadow_serial = shadow_serial; @@ -443,10 +438,11 @@ mono_domain_create (void) domain->finalizable_objects_hash = g_hash_table_new (mono_aligned_addr_hash, NULL); domain->ftnptrs_hash = g_hash_table_new (mono_aligned_addr_hash, NULL); - mono_mutex_init_recursive (&domain->lock); - mono_mutex_init_recursive (&domain->assemblies_lock); - mono_mutex_init_recursive (&domain->jit_code_hash_lock); - mono_mutex_init_recursive (&domain->finalizable_objects_hash_lock); + mono_coop_mutex_init_recursive (&domain->lock); + + mono_os_mutex_init_recursive (&domain->assemblies_lock); + mono_os_mutex_init_recursive (&domain->jit_code_hash_lock); + mono_os_mutex_init_recursive (&domain->finalizable_objects_hash_lock); domain->method_rgctx_hash = NULL; @@ -522,7 +518,7 @@ mono_init_internal (const char *filename, const char *exe_filename, const char * MONO_FAST_TLS_INIT (tls_appdomain); mono_native_tls_alloc (&appdomain_thread_id, NULL); - mono_mutex_init_recursive (&appdomains_mutex); + mono_coop_mutex_init_recursive (&appdomains_mutex); mono_metadata_init (); mono_images_init (); @@ -944,7 +940,7 @@ mono_cleanup (void) mono_metadata_cleanup (); mono_native_tls_free (appdomain_thread_id); - mono_mutex_destroy (&appdomains_mutex); + mono_coop_mutex_destroy (&appdomains_mutex); #ifndef HOST_WIN32 wapi_cleanup (); @@ -1039,7 +1035,7 @@ mono_domain_foreach (MonoDomainFunc func, gpointer user_data) */ mono_appdomains_lock (); size = appdomain_list_size; - copy = mono_gc_alloc_fixed (appdomain_list_size * sizeof (void*), MONO_GC_DESCRIPTOR_NULL, MONO_ROOT_SOURCE_DOMAIN, "temporary domains list"); + copy = (MonoDomain **)mono_gc_alloc_fixed (appdomain_list_size * sizeof (void*), MONO_GC_DESCRIPTOR_NULL, MONO_ROOT_SOURCE_DOMAIN, "temporary domains list"); memcpy (copy, appdomains_list, appdomain_list_size * sizeof (void*)); mono_appdomains_unlock (); @@ -1067,7 +1063,7 @@ mono_domain_assembly_open (MonoDomain *domain, const char *name) mono_domain_assemblies_lock (domain); for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) { - ass = tmp->data; + ass = (MonoAssembly *)tmp->data; if (strcmp (name, ass->aname.name) == 0) { mono_domain_assemblies_unlock (domain); return ass; @@ -1091,7 +1087,7 @@ mono_domain_assembly_open (MonoDomain *domain, const char *name) static void unregister_vtable_reflection_type (MonoVTable *vtable) { - MonoObject *type = vtable->type; + MonoObject *type = (MonoObject *)vtable->type; if (type->vtable->klass != mono_defaults.monotype_class) MONO_GC_UNREGISTER_ROOT_IF_MOVING (vtable->type); @@ -1146,7 +1142,7 @@ mono_domain_free (MonoDomain *domain, gboolean force) if (domain->class_vtable_array) { int i; for (i = 0; i < domain->class_vtable_array->len; ++i) - unregister_vtable_reflection_type (g_ptr_array_index (domain->class_vtable_array, i)); + unregister_vtable_reflection_type ((MonoVTable *)g_ptr_array_index (domain->class_vtable_array, i)); } if (domain->type_hash) { @@ -1159,7 +1155,7 @@ mono_domain_free (MonoDomain *domain, gboolean force) } for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) { - MonoAssembly *ass = tmp->data; + MonoAssembly *ass = (MonoAssembly *)tmp->data; mono_assembly_release_gc_roots (ass); } @@ -1172,7 +1168,7 @@ mono_domain_free (MonoDomain *domain, gboolean force) /* Close dynamic assemblies first, since they have no ref count */ for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) { - MonoAssembly *ass = tmp->data; + MonoAssembly *ass = (MonoAssembly *)tmp->data; if (!ass->image || !image_is_dynamic (ass->image)) continue; mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Unloading domain %s[%p], assembly %s[%p], ref_count=%d", domain->friendly_name, domain, ass->aname.name, ass, ass->ref_count); @@ -1181,7 +1177,7 @@ mono_domain_free (MonoDomain *domain, gboolean force) } for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) { - MonoAssembly *ass = tmp->data; + MonoAssembly *ass = (MonoAssembly *)tmp->data; if (!ass) continue; if (!ass->image || image_is_dynamic (ass->image)) @@ -1192,7 +1188,7 @@ mono_domain_free (MonoDomain *domain, gboolean force) } for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) { - MonoAssembly *ass = tmp->data; + MonoAssembly *ass = (MonoAssembly *)tmp->data; if (ass) mono_assembly_close_finish (ass); } @@ -1291,10 +1287,12 @@ mono_domain_free (MonoDomain *domain, gboolean force) domain->method_to_dyn_method = NULL; } - mono_mutex_destroy (&domain->finalizable_objects_hash_lock); - mono_mutex_destroy (&domain->assemblies_lock); - mono_mutex_destroy (&domain->jit_code_hash_lock); - mono_mutex_destroy (&domain->lock); + mono_os_mutex_destroy (&domain->finalizable_objects_hash_lock); + mono_os_mutex_destroy (&domain->assemblies_lock); + mono_os_mutex_destroy (&domain->jit_code_hash_lock); + + mono_coop_mutex_destroy (&domain->lock); + domain->setup = NULL; mono_gc_deregister_root ((char*)&(domain->MONO_DOMAIN_FIRST_GC_TRACKED)); @@ -1574,7 +1572,7 @@ mono_domain_add_class_static_data (MonoDomain *domain, MonoClass *klass, gpointe next = GPOINTER_TO_INT (domain->static_data_array [0]); if (next >= size) { /* 'data' is allocated by alloc_fixed */ - gpointer *new_array = mono_gc_alloc_fixed (sizeof (gpointer) * (size * 2), MONO_GC_ROOT_DESCR_FOR_FIXED (size * 2), MONO_ROOT_SOURCE_DOMAIN, "static field list"); + gpointer *new_array = (gpointer *)mono_gc_alloc_fixed (sizeof (gpointer) * (size * 2), MONO_GC_ROOT_DESCR_FOR_FIXED (size * 2), MONO_ROOT_SOURCE_DOMAIN, "static field list"); mono_gc_memmove_aligned (new_array, domain->static_data_array, sizeof (gpointer) * size); size *= 2; new_array [1] = GINT_TO_POINTER (size); @@ -1583,7 +1581,7 @@ mono_domain_add_class_static_data (MonoDomain *domain, MonoClass *klass, gpointe } } else { int size = 32; - gpointer *new_array = mono_gc_alloc_fixed (sizeof (gpointer) * size, MONO_GC_ROOT_DESCR_FOR_FIXED (size), MONO_ROOT_SOURCE_DOMAIN, "static field list"); + gpointer *new_array = (gpointer *)mono_gc_alloc_fixed (sizeof (gpointer) * size, MONO_GC_ROOT_DESCR_FOR_FIXED (size), MONO_ROOT_SOURCE_DOMAIN, "static field list"); next = 2; new_array [0] = GINT_TO_POINTER (next); new_array [1] = GINT_TO_POINTER (size); @@ -1817,7 +1815,7 @@ app_config_parse (const char *exe_filename) app_config = g_new0 (AppConfigInfo, 1); - context = g_markup_parse_context_new (&mono_parser, 0, app_config, NULL); + context = g_markup_parse_context_new (&mono_parser, (GMarkupParseFlags)0, app_config, NULL); if (g_markup_parse_context_parse (context, text, len, NULL)) { g_markup_parse_context_end_parse (context, NULL); } @@ -1967,13 +1965,11 @@ mono_get_aot_cache_config (void) void mono_domain_lock (MonoDomain *domain) { - MONO_TRY_BLOCKING; - mono_locks_acquire (&(domain)->lock, DomainLock); - MONO_FINISH_TRY_BLOCKING; + mono_locks_coop_acquire (&domain->lock, DomainLock); } void mono_domain_unlock (MonoDomain *domain) { - mono_locks_release (&(domain)->lock, DomainLock); + mono_locks_coop_release (&domain->lock, DomainLock); } diff --git a/mono/metadata/exception.c b/mono/metadata/exception.c index 6a37cc89562..3c70edb3ac9 100644 --- a/mono/metadata/exception.c +++ b/mono/metadata/exception.c @@ -849,7 +849,7 @@ mono_exception_get_native_backtrace (MonoException *exc) for (i = 0; i < len; ++i) { gpointer ip = mono_array_get (arr, gpointer, i); - MonoJitInfo *ji = mono_jit_info_table_find (mono_domain_get (), ip); + MonoJitInfo *ji = mono_jit_info_table_find (mono_domain_get (), (char *)ip); if (ji) { char *msg = mono_debug_print_stack_frame (mono_jit_info_get_method (ji), (char*)ip - (char*)ji->code_start, domain); g_string_append_printf (text, "%s\n", msg); diff --git a/mono/metadata/file-io.c b/mono/metadata/file-io.c index c4364a11437..69c67eabc4f 100644 --- a/mono/metadata/file-io.c +++ b/mono/metadata/file-io.c @@ -190,7 +190,7 @@ static void convert_win32_file_attribute_data (const WIN32_FILE_ATTRIBUTE_DATA * static guint32 convert_attrs(MonoFileAttributes attrs) { if(attrs & FileAttributes_Encrypted) { - attrs |= FILE_ATTRIBUTE_ENCRYPTED; + attrs = (MonoFileAttributes)(attrs | FILE_ATTRIBUTE_ENCRYPTED); } return(attrs); @@ -324,7 +324,7 @@ get_filesystem_entries (const gunichar2 *path, gchar *utf8_path = NULL, *utf8_result, *full_name; gint32 attributes; - mask = convert_attrs (mask); + mask = convert_attrs ((MonoFileAttributes)mask); attributes = get_file_attributes (path); if (attributes != -1) { if ((attributes & FILE_ATTRIBUTE_DIRECTORY) == 0) { @@ -415,7 +415,7 @@ ves_icall_System_IO_MonoIO_GetFileSystemEntries (MonoString *path, result = mono_array_new (domain, mono_defaults.string_class, names->len); for (i = 0; i < names->len; i++) { - mono_array_setref (result, i, mono_string_new (domain, g_ptr_array_index (names, i))); + mono_array_setref (result, i, mono_string_new (domain, (const char *)g_ptr_array_index (names, i))); g_free (g_ptr_array_index (names, i)); } g_ptr_array_free (names, TRUE); @@ -499,7 +499,7 @@ ves_icall_System_IO_MonoIO_FindFirst (MonoString *path, MonoString * ves_icall_System_IO_MonoIO_FindNext (gpointer handle, gint32 *result_attr, gint32 *error) { - IncrementalFind *ifh = handle; + IncrementalFind *ifh = (IncrementalFind *)handle; WIN32_FIND_DATA data; MonoString *result; @@ -520,7 +520,7 @@ ves_icall_System_IO_MonoIO_FindNext (gpointer handle, gint32 *result_attr, gint3 int ves_icall_System_IO_MonoIO_FindClose (gpointer handle) { - IncrementalFind *ifh = handle; + IncrementalFind *ifh = (IncrementalFind *)handle; gint32 error; MONO_PREPARE_BLOCKING; @@ -705,7 +705,7 @@ ves_icall_System_IO_MonoIO_SetFileAttributes (MonoString *path, gint32 attrs, *error=ERROR_SUCCESS; ret=SetFileAttributes (mono_string_chars (path), - convert_attrs (attrs)); + convert_attrs ((MonoFileAttributes)attrs)); if(ret==FALSE) { *error=GetLastError (); } @@ -803,8 +803,8 @@ ves_icall_System_IO_MonoIO_Open (MonoString *filename, gint32 mode, } } - ret=CreateFile (chars, convert_access (access_mode), - convert_share (share), NULL, convert_mode (mode), + ret=CreateFile (chars, convert_access ((MonoFileAccess)access_mode), + convert_share ((MonoFileShare)share), NULL, convert_mode ((MonoFileMode)mode), attributes, NULL); if(ret==INVALID_HANDLE_VALUE) { *error=GetLastError (); @@ -905,7 +905,7 @@ ves_icall_System_IO_MonoIO_Seek (HANDLE handle, gint64 offset, gint32 origin, offset_hi = offset >> 32; offset = SetFilePointer (handle, (gint32) (offset & 0xFFFFFFFF), &offset_hi, - convert_seekorigin (origin)); + convert_seekorigin ((MonoSeekOrigin)origin)); if(offset==INVALID_SET_FILE_POINTER) { *error=GetLastError (); diff --git a/mono/metadata/file-mmap-posix.c b/mono/metadata/file-mmap-posix.c index 3de44d7a1db..aca3e7fb49c 100644 --- a/mono/metadata/file-mmap-posix.c +++ b/mono/metadata/file-mmap-posix.c @@ -36,6 +36,8 @@ #include #include #include +#include +#include typedef struct { int kind; @@ -88,7 +90,7 @@ enum { #endif static int mmap_init_state; -static mono_mutex_t named_regions_mutex; +static MonoCoopMutex named_regions_mutex; static GHashTable *named_regions; @@ -115,14 +117,14 @@ retry: if (InterlockedCompareExchange (&mmap_init_state, 1, 0) != 0) goto retry; named_regions = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL); - mono_mutex_init (&named_regions_mutex); + mono_coop_mutex_init (&named_regions_mutex); mono_atomic_store_release (&mmap_init_state, 2); break; case 1: do { - g_usleep (1000); /* Been init'd by other threads, this is very rare. */ + mono_thread_info_sleep (1, NULL); /* Been init'd by other threads, this is very rare. */ } while (mmap_init_state != 2); break; case 2: @@ -136,13 +138,13 @@ static void named_regions_lock (void) { file_mmap_init (); - mono_mutex_lock (&named_regions_mutex); + mono_coop_mutex_lock (&named_regions_mutex); } static void named_regions_unlock (void) { - mono_mutex_unlock (&named_regions_mutex); + mono_coop_mutex_unlock (&named_regions_mutex); } @@ -340,7 +342,7 @@ open_memory_map (MonoString *mapName, int mode, gint64 *capacity, int access, in *error = COULD_NOT_MAP_MEMORY; goto done; } - file_name = alloca (alloc_size); + file_name = (char *)alloca (alloc_size); strcpy (file_name, tmp_dir); strcat (file_name, MONO_ANON_FILE_TEMPLATE); @@ -389,7 +391,7 @@ mono_mmap_open_file (MonoString *path, int mode, MonoString *mapName, gint64 *ca *error = FILE_ALREADY_EXISTS; handle = NULL; } else { - handle = open_file_map (path, -1, mode, capacity, access, options, error); + handle = (MmapHandle *)open_file_map (path, -1, mode, capacity, access, options, error); if (handle) { handle->name = g_strdup (c_mapName); g_hash_table_insert (named_regions, handle->name, handle); @@ -409,7 +411,7 @@ mono_mmap_open_handle (void *input_fd, MonoString *mapName, gint64 *capacity, in { MmapHandle *handle; if (!mapName) { - handle = open_file_map (NULL, GPOINTER_TO_INT (input_fd), FILE_MODE_OPEN, capacity, access, options, error); + handle = (MmapHandle *)open_file_map (NULL, GPOINTER_TO_INT (input_fd), FILE_MODE_OPEN, capacity, access, options, error); } else { char *c_mapName = mono_string_to_utf8 (mapName); @@ -420,7 +422,7 @@ mono_mmap_open_handle (void *input_fd, MonoString *mapName, gint64 *capacity, in handle = NULL; } else { //XXX we're exploiting wapi HANDLE == FD equivalence. THIS IS FRAGILE, create a _wapi_handle_to_fd call - handle = open_file_map (NULL, GPOINTER_TO_INT (input_fd), FILE_MODE_OPEN, capacity, access, options, error); + handle = (MmapHandle *)open_file_map (NULL, GPOINTER_TO_INT (input_fd), FILE_MODE_OPEN, capacity, access, options, error); handle->name = g_strdup (c_mapName); g_hash_table_insert (named_regions, handle->name, handle); } @@ -434,7 +436,7 @@ mono_mmap_open_handle (void *input_fd, MonoString *mapName, gint64 *capacity, in void mono_mmap_close (void *mmap_handle) { - MmapHandle *handle = mmap_handle; + MmapHandle *handle = (MmapHandle *)mmap_handle; named_regions_lock (); --handle->ref_count; @@ -452,7 +454,7 @@ mono_mmap_close (void *mmap_handle) void mono_mmap_configure_inheritability (void *mmap_handle, gboolean inheritability) { - MmapHandle *h = mmap_handle; + MmapHandle *h = (MmapHandle *)mmap_handle; int fd, flags; fd = h->fd; @@ -467,7 +469,7 @@ mono_mmap_configure_inheritability (void *mmap_handle, gboolean inheritability) void mono_mmap_flush (void *mmap_handle) { - MmapInstance *h = mmap_handle; + MmapInstance *h = (MmapInstance *)mmap_handle; if (h) msync (h->address, h->length, MS_SYNC); @@ -477,7 +479,7 @@ int mono_mmap_map (void *handle, gint64 offset, gint64 *size, int access, void **mmap_handle, void **base_address) { gint64 mmap_offset = 0; - MmapHandle *fh = handle; + MmapHandle *fh = (MmapHandle *)handle; MmapInstance res = { 0 }; size_t eff_size = *size; struct stat buf = { 0 }; @@ -516,7 +518,7 @@ gboolean mono_mmap_unmap (void *mmap_handle) { int res = 0; - MmapInstance *h = mmap_handle; + MmapInstance *h = (MmapInstance *)mmap_handle; res = mono_file_unmap (h->address, h->free_handle); diff --git a/mono/metadata/gc-internals.h b/mono/metadata/gc-internals.h index 465c92b9c6e..bc9edcbe3ad 100644 --- a/mono/metadata/gc-internals.h +++ b/mono/metadata/gc-internals.h @@ -17,8 +17,8 @@ #include #include -#define mono_domain_finalizers_lock(domain) mono_mutex_lock (&(domain)->finalizable_objects_hash_lock); -#define mono_domain_finalizers_unlock(domain) mono_mutex_unlock (&(domain)->finalizable_objects_hash_lock); +#define mono_domain_finalizers_lock(domain) mono_os_mutex_lock (&(domain)->finalizable_objects_hash_lock); +#define mono_domain_finalizers_unlock(domain) mono_os_mutex_unlock (&(domain)->finalizable_objects_hash_lock); /* Register a memory area as a conservatively scanned GC root */ #define MONO_GC_REGISTER_ROOT_PINNING(x,src,msg) mono_gc_register_root ((char*)&(x), sizeof(x), MONO_GC_DESCRIPTOR_NULL, (src), (msg)) @@ -80,7 +80,6 @@ gpointer ves_icall_System_GCHandle_GetAddrOfPinnedObject (guint32 handle); void ves_icall_System_GC_register_ephemeron_array (MonoObject *array); MonoObject *ves_icall_System_GC_get_ephemeron_tombstone (void); -MonoBoolean ves_icall_Mono_Runtime_SetGCAllowSynchronousMajor (MonoBoolean flag); extern void mono_gc_init (void); extern void mono_gc_base_init (void); @@ -111,9 +110,6 @@ void mono_gchandle_set_target (guint32 gchandle, MonoObject *obj); /*Ephemeron functionality. Sgen only*/ gboolean mono_gc_ephemeron_array_add (MonoObject *obj); -/* To disable synchronous, evacuating collections - concurrent SGen only */ -gboolean mono_gc_set_allow_synchronous_major (gboolean flag); - MonoBoolean mono_gc_GCHandle_CheckCurrentDomain (guint32 gchandle); diff --git a/mono/metadata/gc.c b/mono/metadata/gc.c index 18f3b655cad..e0f12d34b55 100644 --- a/mono/metadata/gc.c +++ b/mono/metadata/gc.c @@ -31,13 +31,14 @@ #include /* for mono_delegate_free_ftnptr () */ #include #include -#include +#include #include #include #include #include #include #include +#include #ifndef HOST_WIN32 #include @@ -56,17 +57,17 @@ gboolean log_finalizers = FALSE; gboolean mono_do_not_finalize = FALSE; gchar **mono_do_not_finalize_class_names = NULL; -#define mono_finalizer_lock() mono_mutex_lock (&finalizer_mutex) -#define mono_finalizer_unlock() mono_mutex_unlock (&finalizer_mutex) -static mono_mutex_t finalizer_mutex; -static mono_mutex_t reference_queue_mutex; +#define mono_finalizer_lock() mono_coop_mutex_lock (&finalizer_mutex) +#define mono_finalizer_unlock() mono_coop_mutex_unlock (&finalizer_mutex) +static MonoCoopMutex finalizer_mutex; +static MonoCoopMutex reference_queue_mutex; static GSList *domains_to_finalize= NULL; static MonoMList *threads_to_finalize = NULL; static gboolean finalizer_thread_exited; /* Uses finalizer_mutex */ -static mono_cond_t exited_cond; +static MonoCoopCond exited_cond; static MonoInternalThread *gc_thread; @@ -150,7 +151,7 @@ mono_gc_run_finalize (void *obj, void *data) #ifndef HAVE_SGEN_GC mono_domain_finalizers_lock (domain); - o2 = g_hash_table_lookup (domain->finalizable_objects_hash, o); + o2 = (MonoObject *)g_hash_table_lookup (domain->finalizable_objects_hash, o); mono_domain_finalizers_unlock (domain); @@ -160,7 +161,7 @@ mono_gc_run_finalize (void *obj, void *data) #endif /* make sure the finalizer is not called again if the object is resurrected */ - object_register_finalizer (obj, NULL); + object_register_finalizer ((MonoObject *)obj, NULL); if (log_finalizers) g_log ("mono-gc-finalizers", G_LOG_LEVEL_MESSAGE, "<%s at %p> Registered finalizer as processed.", o->vtable->klass->name, o); @@ -240,7 +241,7 @@ mono_gc_run_finalize (void *obj, void *data) domain->finalize_runtime_invoke = mono_compile_method (invoke); } - runtime_invoke = domain->finalize_runtime_invoke; + runtime_invoke = (RuntimeInvokeFunction)domain->finalize_runtime_invoke; mono_runtime_class_init (o->vtable); @@ -334,11 +335,8 @@ object_register_finalizer (MonoObject *obj, void (*callback)(void *, void*)) * end up running them while or after the domain is being cleared, so * the objects will not be valid anymore. */ - if (!mono_domain_is_unloading (domain)) { - MONO_TRY_BLOCKING; + if (!mono_domain_is_unloading (domain)) mono_gc_register_for_finalization (obj, callback); - MONO_FINISH_TRY_BLOCKING; - } #endif } @@ -540,10 +538,6 @@ ves_icall_System_GC_get_ephemeron_tombstone (void) return mono_domain_get ()->ephemeron_tombstone; } -#define mono_allocator_lock() mono_mutex_lock (&allocator_section) -#define mono_allocator_unlock() mono_mutex_unlock (&allocator_section) -static mono_mutex_t allocator_section; - MonoObject * ves_icall_System_GCHandle_GetTarget (guint32 handle) { @@ -607,22 +601,13 @@ ves_icall_System_GCHandle_GetAddrOfPinnedObject (guint32 handle) return NULL; } -MonoBoolean -ves_icall_Mono_Runtime_SetGCAllowSynchronousMajor (MonoBoolean flag) -{ - return mono_gc_set_allow_synchronous_major (flag); -} - MonoBoolean mono_gc_GCHandle_CheckCurrentDomain (guint32 gchandle) { return mono_gchandle_is_in_domain (gchandle, mono_domain_get ()); } -#ifdef MONO_HAS_SEMAPHORES -static MonoSemType finalizer_sem; -#endif -static HANDLE finalizer_event; +static MonoCoopSem finalizer_sem; static volatile gboolean finished=FALSE; void @@ -635,11 +620,7 @@ mono_gc_finalize_notify (void) if (mono_gc_is_null ()) return; -#ifdef MONO_HAS_SEMAPHORES - MONO_SEM_POST (&finalizer_sem); -#else - SetEvent (finalizer_event); -#endif + mono_coop_sem_post (&finalizer_sem); } #ifdef HAVE_BOEHM_GC @@ -724,18 +705,13 @@ finalizer_thread (gpointer unused) g_assert (mono_domain_get () == mono_get_root_domain ()); mono_gc_set_skip_thread (TRUE); - MONO_PREPARE_BLOCKING; if (wait) { - /* An alertable wait is required so this thread can be suspended on windows */ -#ifdef MONO_HAS_SEMAPHORES - MONO_SEM_WAIT_ALERTABLE (&finalizer_sem, TRUE); -#else - WaitForSingleObjectEx (finalizer_event, INFINITE, TRUE); -#endif + /* An alertable wait is required so this thread can be suspended on windows */ + mono_coop_sem_wait (&finalizer_sem, MONO_SEM_FLAGS_ALERTABLE); } wait = TRUE; - MONO_FINISH_BLOCKING; + mono_gc_set_skip_thread (FALSE); mono_threads_perform_thread_dump (); @@ -747,7 +723,7 @@ finalizer_thread (gpointer unused) if (domains_to_finalize) { mono_finalizer_lock (); if (domains_to_finalize) { - DomainFinalizationReq *req = domains_to_finalize->data; + DomainFinalizationReq *req = (DomainFinalizationReq *)domains_to_finalize->data; domains_to_finalize = g_slist_remove (domains_to_finalize, req); mono_finalizer_unlock (); @@ -766,21 +742,18 @@ finalizer_thread (gpointer unused) reference_queue_proccess_all (); -#ifdef MONO_HAS_SEMAPHORES /* Avoid posting the pending done event until there are pending finalizers */ - if (MONO_SEM_TIMEDWAIT (&finalizer_sem, 0) == 0) + if (mono_coop_sem_timedwait (&finalizer_sem, 0, MONO_SEM_FLAGS_NONE) == 0) { /* Don't wait again at the start of the loop */ wait = FALSE; - else - SetEvent (pending_done_event); -#else + } else { SetEvent (pending_done_event); -#endif + } } mono_finalizer_lock (); finalizer_thread_exited = TRUE; - mono_cond_signal (&exited_cond); + mono_coop_cond_signal (&exited_cond); mono_finalizer_unlock (); return 0; @@ -799,10 +772,8 @@ mono_gc_init_finalizer_thread (void) void mono_gc_init (void) { - mono_mutex_init_recursive (&allocator_section); - - mono_mutex_init_recursive (&finalizer_mutex); - mono_mutex_init_recursive (&reference_queue_mutex); + mono_coop_mutex_init_recursive (&finalizer_mutex); + mono_coop_mutex_init_recursive (&reference_queue_mutex); mono_counters_register ("Minor GC collections", MONO_COUNTER_GC | MONO_COUNTER_UINT, &gc_stats.minor_gc_count); mono_counters_register ("Major GC collections", MONO_COUNTER_GC | MONO_COUNTER_UINT, &gc_stats.major_gc_count); @@ -816,15 +787,11 @@ mono_gc_init (void) gc_disabled = TRUE; return; } - - finalizer_event = CreateEvent (NULL, FALSE, FALSE, NULL); - g_assert (finalizer_event); + pending_done_event = CreateEvent (NULL, TRUE, FALSE, NULL); g_assert (pending_done_event); - mono_cond_init (&exited_cond, 0); -#ifdef MONO_HAS_SEMAPHORES - MONO_SEM_INIT (&finalizer_sem, 0); -#endif + mono_coop_cond_init (&exited_cond); + mono_coop_sem_init (&finalizer_sem, 0); #ifndef LAZY_GC_THREAD_CREATION mono_gc_init_finalizer_thread (); @@ -859,12 +826,10 @@ mono_gc_cleanup (void) break; else timeout = end_ticks - current_ticks; - MONO_PREPARE_BLOCKING; mono_finalizer_lock (); if (!finalizer_thread_exited) - mono_cond_timedwait_ms (&exited_cond, &finalizer_mutex, timeout); + mono_coop_cond_timedwait (&exited_cond, &finalizer_mutex, timeout); mono_finalizer_unlock (); - MONO_FINISH_BLOCKING; } if (!finalizer_thread_exited) { @@ -899,6 +864,7 @@ mono_gc_cleanup (void) mono_thread_join (GUINT_TO_POINTER (gc_thread->tid)); } + g_assert (finalizer_thread_exited); } gc_thread = NULL; mono_gc_base_cleanup (); @@ -906,9 +872,8 @@ mono_gc_cleanup (void) mono_reference_queue_cleanup (); - mono_mutex_destroy (&allocator_section); - mono_mutex_destroy (&finalizer_mutex); - mono_mutex_destroy (&reference_queue_mutex); + mono_coop_mutex_destroy (&finalizer_mutex); + mono_coop_mutex_destroy (&reference_queue_mutex); } gboolean @@ -967,7 +932,7 @@ ref_list_remove_element (RefQueueEntry **prev, RefQueueEntry *element) /* Guard if head is changed concurrently. */ while (*prev != element) prev = &(*prev)->next; - } while (prev && InterlockedCompareExchangePointer ((void*)prev, element->next, element) != element); + } while (prev && InterlockedCompareExchangePointer ((volatile gpointer *)prev, element->next, element) != element); } static void @@ -978,7 +943,7 @@ ref_list_push (RefQueueEntry **head, RefQueueEntry *value) current = *head; value->next = current; STORE_STORE_FENCE; /*Must make sure the previous store is visible before the CAS. */ - } while (InterlockedCompareExchangePointer ((void*)head, value, current) != current); + } while (InterlockedCompareExchangePointer ((volatile gpointer *)head, value, current) != current); } static void @@ -1007,7 +972,7 @@ reference_queue_proccess_all (void) reference_queue_proccess (queue); restart: - mono_mutex_lock (&reference_queue_mutex); + mono_coop_mutex_lock (&reference_queue_mutex); for (iter = &ref_queues; *iter;) { queue = *iter; if (!queue->should_be_deleted) { @@ -1015,14 +980,14 @@ restart: continue; } if (queue->queue) { - mono_mutex_unlock (&reference_queue_mutex); + mono_coop_mutex_unlock (&reference_queue_mutex); reference_queue_proccess (queue); goto restart; } *iter = queue->next; g_free (queue); } - mono_mutex_unlock (&reference_queue_mutex); + mono_coop_mutex_unlock (&reference_queue_mutex); } static void @@ -1076,10 +1041,10 @@ mono_gc_reference_queue_new (mono_reference_queue_callback callback) MonoReferenceQueue *res = g_new0 (MonoReferenceQueue, 1); res->callback = callback; - mono_mutex_lock (&reference_queue_mutex); + mono_coop_mutex_lock (&reference_queue_mutex); res->next = ref_queues; ref_queues = res; - mono_mutex_unlock (&reference_queue_mutex); + mono_coop_mutex_unlock (&reference_queue_mutex); return res; } diff --git a/mono/metadata/icall-def.h b/mono/metadata/icall-def.h index 489b5ded65b..88fb2539e83 100644 --- a/mono/metadata/icall-def.h +++ b/mono/metadata/icall-def.h @@ -46,7 +46,6 @@ ICALL(COMPROX_2, "FindProxy", ves_icall_Mono_Interop_ComInteropProxy_FindProxy) ICALL_TYPE(RUNTIME, "Mono.Runtime", RUNTIME_1) ICALL(RUNTIME_1, "GetDisplayName", ves_icall_Mono_Runtime_GetDisplayName) ICALL(RUNTIME_12, "GetNativeStackTrace", ves_icall_Mono_Runtime_GetNativeStackTrace) -ICALL(RUNTIME_13, "SetGCAllowSynchronousMajor", ves_icall_Mono_Runtime_SetGCAllowSynchronousMajor) #ifndef PLATFORM_RO_FS ICALL_TYPE(KPAIR, "Mono.Security.Cryptography.KeyPairPersistence", KPAIR_1) diff --git a/mono/metadata/icall.c b/mono/metadata/icall.c index 1b36b74bc69..eaecf5b2027 100644 --- a/mono/metadata/icall.c +++ b/mono/metadata/icall.c @@ -6,10 +6,11 @@ * Paolo Molaro (lupus@ximian.com) * Patrik Torstensson (patrik.torstensson@labs2.com) * Marek Safar (marek.safar@gmail.com) + * Aleksey Kliger (aleksey@xamarin.com) * * Copyright 2001-2003 Ximian, Inc (http://www.ximian.com) * Copyright 2004-2009 Novell, Inc (http://www.novell.com) - * Copyright 2011-2014 Xamarin Inc (http://www.xamarin.com). + * Copyright 2011-2015 Xamarin Inc (http://www.xamarin.com). */ #include @@ -89,7 +90,7 @@ #include #include #include -#include +#include #include #if defined (HOST_WIN32) @@ -134,7 +135,7 @@ ves_icall_System_Array_GetValueImpl (MonoArray *arr, guint32 pos) if (ac->element_class->valuetype) return mono_value_box (arr->obj.vtable->domain, ac->element_class, ea); else - return *ea; + return (MonoObject *)*ea; } ICALL_EXPORT MonoObject * @@ -544,7 +545,7 @@ ves_icall_System_Array_CreateInstanceImpl (MonoReflectionType *type, MonoArray * aklass = mono_bounded_array_class_get (klass, mono_array_length (lengths), bounded); - sizes = alloca (aklass->rank * sizeof(intptr_t) * 2); + sizes = (uintptr_t *)alloca (aklass->rank * sizeof(intptr_t) * 2); for (i = 0; i < aklass->rank; ++i) { sizes [i] = mono_array_get (lengths, guint32, i); if (bounds) @@ -592,7 +593,7 @@ ves_icall_System_Array_CreateInstanceImpl64 (MonoReflectionType *type, MonoArray aklass = mono_bounded_array_class_get (klass, mono_array_length (lengths), bounded); - sizes = alloca (aklass->rank * sizeof(intptr_t) * 2); + sizes = (uintptr_t *)alloca (aklass->rank * sizeof(intptr_t) * 2); for (i = 0; i < aklass->rank; ++i) { sizes [i] = mono_array_get (lengths, guint64, i); if (bounds) @@ -770,7 +771,7 @@ ves_icall_System_Array_SetGenericValueImpl (MonoArray *arr, guint32 pos, gpointe if (MONO_TYPE_IS_REFERENCE (&ec->byval_arg)) { g_assert (esize == sizeof (gpointer)); - mono_gc_wbarrier_generic_store (ea, *(gpointer*)value); + mono_gc_wbarrier_generic_store (ea, *(MonoObject **)value); } else { g_assert (ec->inited); g_assert (esize == mono_class_value_size (ec, NULL)); @@ -1158,10 +1159,10 @@ ves_icall_ModuleBuilder_RegisterToken (MonoReflectionModuleBuilder *mb, MonoObje ICALL_EXPORT MonoObject* ves_icall_ModuleBuilder_GetRegisteredToken (MonoReflectionModuleBuilder *mb, guint32 token) { - gpointer obj; + MonoObject *obj; mono_loader_lock (); - obj = mono_g_hash_table_lookup (mb->dynamic_image->tokens, GUINT_TO_POINTER (token)); + obj = (MonoObject *)mono_g_hash_table_lookup (mb->dynamic_image->tokens, GUINT_TO_POINTER (token)); mono_loader_unlock (); return obj; @@ -1170,7 +1171,7 @@ ves_icall_ModuleBuilder_GetRegisteredToken (MonoReflectionModuleBuilder *mb, gui static gboolean get_caller (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data) { - MonoMethod **dest = data; + MonoMethod **dest = (MonoMethod **)data; /* skip unmanaged frames */ if (!managed) @@ -1190,7 +1191,7 @@ get_caller (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer dat static gboolean get_executing (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data) { - MonoMethod **dest = data; + MonoMethod **dest = (MonoMethod **)data; /* skip unmanaged frames */ if (!managed) @@ -1208,7 +1209,7 @@ get_executing (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer static gboolean get_caller_no_reflection (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data) { - MonoMethod **dest = data; + MonoMethod **dest = (MonoMethod **)data; /* skip unmanaged frames */ if (!managed) @@ -1780,9 +1781,9 @@ ves_icall_MonoField_SetValueInternal (MonoReflectionField *field, MonoObject *ob */ nullable = mono_object_new (mono_domain_get (), nklass); - mono_nullable_init (mono_object_unbox (nullable), value, nklass); + mono_nullable_init ((guint8 *)mono_object_unbox (nullable), value, nklass); - v = mono_object_unbox (nullable); + v = (gchar *)mono_object_unbox (nullable); } else if (gclass->container_class->valuetype && (v != NULL)) @@ -2030,8 +2031,8 @@ typedef struct { static void fill_iface_array (gpointer key, gpointer value, gpointer user_data) { - FillIfaceArrayData *data = user_data; - MonoClass *ic = key; + FillIfaceArrayData *data = (FillIfaceArrayData *)user_data; + MonoClass *ic = (MonoClass *)key; MonoType *ret = &ic->byval_arg, *inflated = NULL; if (!mono_error_ok (data->error)) @@ -2324,7 +2325,7 @@ ves_icall_MonoType_GetGenericArguments (MonoReflectionType *type, MonoBoolean ru MonoGenericContainer *container = klass->generic_container; res = create_type_array (domain, runtimeTypeArray, container->type_argc); for (i = 0; i < container->type_argc; ++i) { - pklass = mono_class_from_generic_parameter (mono_generic_container_get_param (container, i), klass->image, FALSE); + pklass = mono_class_from_generic_parameter_internal (mono_generic_container_get_param (container, i)); mono_array_setref (res, i, mono_type_get_object (domain, &pklass->byval_arg)); } } else if (klass->generic_class) { @@ -2373,7 +2374,7 @@ ves_icall_Type_GetGenericTypeDefinition_impl (MonoReflectionType *type) tb = mono_class_get_ref_info (generic_class); if (generic_class->wastypebuilder && tb) - return tb; + return (MonoReflectionType *)tb; else return mono_type_get_object (mono_object_domain (type), &generic_class->byval_arg); } @@ -2394,7 +2395,7 @@ ves_icall_Type_MakeGenericType (MonoReflectionType *type, MonoArray *type_array) types = g_new0 (MonoType *, count); for (i = 0; i < count; i++) { - MonoReflectionType *t = mono_array_get (type_array, gpointer, i); + MonoReflectionType *t = (MonoReflectionType *)mono_array_get (type_array, gpointer, i); types [i] = t->type; } @@ -2445,7 +2446,7 @@ ves_icall_Type_GetGenericParameterAttributes (MonoReflectionType *type) { g_assert (IS_MONOTYPE (type)); g_assert (is_generic_parameter (type->type)); - return mono_generic_param_info (type->type->data.generic_param)->flags; + return (GenericParameterAttributes)mono_generic_param_info (type->type->data.generic_param)->flags; } ICALL_EXPORT MonoArray * @@ -2562,7 +2563,7 @@ ves_icall_MonoMethod_GetPInvoke (MonoReflectionMethod *method, int* flags, MonoS if (image_is_dynamic (image)) { MonoReflectionMethodAux *method_aux = - g_hash_table_lookup (((MonoDynamicImage*)image)->method_aux_hash, method->method); + (MonoReflectionMethodAux *)g_hash_table_lookup (((MonoDynamicImage*)image)->method_aux_hash, method->method); if (method_aux) { import = method_aux->dllentry; scope = method_aux->dll; @@ -2617,7 +2618,7 @@ ves_icall_MonoMethod_GetGenericMethodDefinition (MonoReflectionMethod *method) * the dynamic case as well ? */ mono_image_lock ((MonoImage*)image); - res = mono_g_hash_table_lookup (image->generic_def_objects, imethod); + res = (MonoReflectionMethod *)mono_g_hash_table_lookup (image->generic_def_objects, imethod); mono_image_unlock ((MonoImage*)image); if (res) @@ -2678,8 +2679,7 @@ ves_icall_MonoMethod_GetGenericArguments (MonoReflectionMethod *method) for (i = 0; i < count; i++) { MonoGenericContainer *container = mono_method_get_generic_container (method->method); MonoGenericParam *param = mono_generic_container_get_param (container, i); - MonoClass *pklass = mono_class_from_generic_parameter ( - param, method->method->klass->image, TRUE); + MonoClass *pklass = mono_class_from_generic_parameter_internal (param); mono_array_setref (res, i, mono_type_get_object (domain, &pklass->byval_arg)); } @@ -2765,7 +2765,7 @@ ves_icall_InternalInvoke (MonoReflectionMethod *method, MonoObject *this_arg, Mo uintptr_t *lengths; intptr_t *lower_bounds; pcount = mono_array_length (params); - lengths = alloca (sizeof (uintptr_t) * pcount); + lengths = (uintptr_t *)alloca (sizeof (uintptr_t) * pcount); /* Note: the synthetized array .ctors have int32 as argument type */ for (i = 0; i < pcount; ++i) lengths [i] = *(int32_t*) ((char*)mono_array_get (params, gpointer, i) + sizeof (MonoObject)); @@ -2788,7 +2788,7 @@ ves_icall_InternalInvoke (MonoReflectionMethod *method, MonoObject *this_arg, Mo } else { g_assert (pcount == (m->klass->rank * 2)); /* The arguments are lower-bound-length pairs */ - lower_bounds = g_alloca (sizeof (intptr_t) * pcount); + lower_bounds = (intptr_t *)g_alloca (sizeof (intptr_t) * pcount); for (i = 0; i < pcount / 2; ++i) { lower_bounds [i] = *(int32_t*) ((char*)mono_array_get (params, gpointer, (i * 2)) + sizeof (MonoObject)); @@ -2836,7 +2836,7 @@ ves_icall_InternalExecute (MonoReflectionMethod *method, MonoObject *this_arg, M if (field_klass->valuetype) result = mono_value_box (domain, field_klass, (char *)this_arg + field->offset); else - result = *((gpointer *)((char *)this_arg + field->offset)); + result = (MonoObject *)*((gpointer *)((char *)this_arg + field->offset)); out_args = mono_array_new (domain, mono_defaults.object_class, 1); mono_gc_wbarrier_generic_store (outArgs, (MonoObject*) out_args); @@ -2872,7 +2872,7 @@ ves_icall_InternalExecute (MonoReflectionMethod *method, MonoObject *this_arg, M MonoClassField* field = mono_class_get_field_from_name (k, str); if (field) { MonoClass *field_klass = mono_class_from_mono_type (field->type); - MonoObject *val = mono_array_get (params, gpointer, 2); + MonoObject *val = (MonoObject *)mono_array_get (params, gpointer, 2); if (field_klass->valuetype) { size = mono_type_size (field->type, &align); @@ -2967,19 +2967,19 @@ write_enum_value (char *mem, int type, guint64 value) } case MONO_TYPE_U2: case MONO_TYPE_I2: { - guint16 *p = (void*)mem; + guint16 *p = (guint16 *)mem; *p = value; break; } case MONO_TYPE_U4: case MONO_TYPE_I4: { - guint32 *p = (void*)mem; + guint32 *p = (guint32 *)mem; *p = value; break; } case MONO_TYPE_U8: case MONO_TYPE_I8: { - guint64 *p = (void*)mem; + guint64 *p = (guint64 *)mem; *p = value; break; } @@ -3479,7 +3479,7 @@ ves_icall_Type_GetMethodsByName (MonoReflectionType *type, MonoString *name, gui res = mono_array_new_specific (array_vtable, method_array->len); for (i = 0; i < method_array->len; ++i) { - MonoMethod *method = g_ptr_array_index (method_array, i); + MonoMethod *method = (MonoMethod *)g_ptr_array_index (method_array, i); mono_array_setref (res, i, mono_method_get_object (domain, method, refklass)); } @@ -3567,6 +3567,17 @@ property_hash (gconstpointer data) return g_str_hash (prop->name); } +static gboolean +method_declaring_signatures_equal (MonoMethod *method1, MonoMethod *method2) +{ + if (method1->is_inflated) + method1 = ((MonoMethodInflated*) method1)->declaring; + if (method2->is_inflated) + method2 = ((MonoMethodInflated*) method2)->declaring; + + return mono_metadata_signature_equal (mono_method_signature (method1), mono_method_signature (method2)); +} + static gboolean property_equal (MonoProperty *prop1, MonoProperty *prop2) { @@ -3574,10 +3585,26 @@ property_equal (MonoProperty *prop1, MonoProperty *prop2) if (!g_str_equal (prop1->name, prop2->name)) return FALSE; - if (prop1->get && prop2->get && !mono_metadata_signature_equal (mono_method_signature (prop1->get), mono_method_signature (prop2->get))) + /* If we see a property in a generic method, we want to + compare the generic signatures, not the inflated signatures + because we might conflate two properties that were + distinct: + + class Foo { + public T this[T t] { getter { return t; } } // method 1 + public U this[U u] { getter { return u; } } // method 2 + } + + If we see int Foo::Item[int] we need to know if + the indexer came from method 1 or from method 2, and we + shouldn't conflate them. (Bugzilla 36283) + */ + if (prop1->get && prop2->get && !method_declaring_signatures_equal (prop1->get, prop2->get)) return FALSE; - if (prop1->set && prop2->set && !mono_metadata_signature_equal (mono_method_signature (prop1->set), mono_method_signature (prop2->set))) + + if (prop1->set && prop2->set && !method_declaring_signatures_equal (prop1->set, prop2->set)) return FALSE; + return TRUE; } @@ -5011,7 +5038,7 @@ ves_icall_System_Reflection_Assembly_GetTypes (MonoReflectionAssembly *assembly, ex_count = 0; for (i = 0; i < len; i++) { - MonoReflectionType *t = mono_array_get (res, gpointer, i); + MonoReflectionType *t = (MonoReflectionType *)mono_array_get (res, gpointer, i); MonoClass *klass; if (t) { @@ -5038,7 +5065,7 @@ ves_icall_System_Reflection_Assembly_GetTypes (MonoReflectionAssembly *assembly, exl = mono_array_new (domain, mono_defaults.exception_class, length); /* Types for which mono_class_get_checked () succeeded */ for (i = 0, tmp = list; tmp; i++, tmp = tmp->next) { - MonoException *exc = mono_class_get_exception_for_failure (tmp->data); + MonoException *exc = mono_class_get_exception_for_failure ((MonoClass *)tmp->data); mono_array_setref (exl, i, exc); } /* Types for which it don't */ @@ -5230,12 +5257,12 @@ ves_icall_System_Reflection_Module_ResolveTypeToken (MonoImage *image, guint32 t if (image_is_dynamic (image)) { if ((table == MONO_TABLE_TYPEDEF) || (table == MONO_TABLE_TYPEREF)) { - klass = mono_lookup_dynamic_token_class (image, token, FALSE, NULL, NULL); + klass = (MonoClass *)mono_lookup_dynamic_token_class (image, token, FALSE, NULL, NULL); return klass ? &klass->byval_arg : NULL; } init_generic_context_from_args (&context, type_args, method_args); - klass = mono_lookup_dynamic_token_class (image, token, FALSE, NULL, &context); + klass = (MonoClass *)mono_lookup_dynamic_token_class (image, token, FALSE, NULL, &context); return klass ? &klass->byval_arg : NULL; } @@ -5276,7 +5303,7 @@ ves_icall_System_Reflection_Module_ResolveMethodToken (MonoImage *image, guint32 if (image_is_dynamic (image)) { if (table == MONO_TABLE_METHOD) - return mono_lookup_dynamic_token_class (image, token, FALSE, NULL, NULL); + return (MonoMethod *)mono_lookup_dynamic_token_class (image, token, FALSE, NULL, NULL); if ((table == MONO_TABLE_MEMBERREF) && !(mono_memberref_is_method (image, token))) { *resolve_error = ResolveTokenError_BadTable; @@ -5284,7 +5311,7 @@ ves_icall_System_Reflection_Module_ResolveMethodToken (MonoImage *image, guint32 } init_generic_context_from_args (&context, type_args, method_args); - return mono_lookup_dynamic_token_class (image, token, FALSE, NULL, &context); + return (MonoMethod *)mono_lookup_dynamic_token_class (image, token, FALSE, NULL, &context); } if ((index <= 0) || (index > image->tables [table].rows)) { @@ -5317,7 +5344,7 @@ ves_icall_System_Reflection_Module_ResolveStringToken (MonoImage *image, guint32 } if (image_is_dynamic (image)) - return mono_lookup_dynamic_token_class (image, token, FALSE, NULL, NULL); + return (MonoString *)mono_lookup_dynamic_token_class (image, token, FALSE, NULL, NULL); if ((index <= 0) || (index >= image->heap_us.size)) { *error = ResolveTokenError_OutOfRange; @@ -5349,7 +5376,7 @@ ves_icall_System_Reflection_Module_ResolveFieldToken (MonoImage *image, guint32 if (image_is_dynamic (image)) { if (table == MONO_TABLE_FIELD) - return mono_lookup_dynamic_token_class (image, token, FALSE, NULL, NULL); + return (MonoClassField *)mono_lookup_dynamic_token_class (image, token, FALSE, NULL, NULL); if (mono_memberref_is_method (image, token)) { *resolve_error = ResolveTokenError_BadTable; @@ -5357,7 +5384,7 @@ ves_icall_System_Reflection_Module_ResolveFieldToken (MonoImage *image, guint32 } init_generic_context_from_args (&context, type_args, method_args); - return mono_lookup_dynamic_token_class (image, token, FALSE, NULL, &context); + return (MonoClassField *)mono_lookup_dynamic_token_class (image, token, FALSE, NULL, &context); } if ((index <= 0) || (index > image->tables [table].rows)) { @@ -5759,7 +5786,7 @@ ves_icall_Remoting_RealProxy_GetTransparentProxy (MonoObject *this_obj, MonoStri tp->custom_type_info = (mono_object_isinst (this_obj, mono_defaults.iremotingtypeinfo_class) != NULL); tp->remote_class = mono_remote_class (domain, class_name, klass); - res->vtable = mono_remote_class_vtable (domain, tp->remote_class, rp); + res->vtable = (MonoVTable *)mono_remote_class_vtable (domain, tp->remote_class, rp); return res; } @@ -6094,7 +6121,7 @@ ves_icall_System_Environment_GetLogicalDrives (void) if (size > initial_size) { if (ptr != buf) g_free (ptr); - ptr = g_malloc0 ((size + 1) * sizeof (gunichar2)); + ptr = (gunichar2 *)g_malloc0 ((size + 1) * sizeof (gunichar2)); initial_size = size; size++; } @@ -6461,7 +6488,7 @@ get_bundled_app_config (void) return NULL; len = config_file_path_length - config_ext_length; - module = g_malloc0 (len + 1); + module = (gchar *)g_malloc0 (len + 1); memcpy (module, config_file_path, len); // Get the config file from the module name app_config = mono_config_string_for_assembly_file (module); @@ -6525,7 +6552,7 @@ ves_icall_get_resources_ptr (MonoReflectionAssembly *assembly, gpointer *result, *result = NULL; *size = 0; image = assembly->assembly->image; - entry = mono_image_lookup_resource (image, MONO_PE_RESOURCE_ID_ASPNET_STRING, 0, NULL); + entry = (MonoPEResourceDataEntry *)mono_image_lookup_resource (image, MONO_PE_RESOURCE_ID_ASPNET_STRING, 0, NULL); if (!entry) return FALSE; @@ -6593,6 +6620,7 @@ ICALL_EXPORT MonoReflectionMethod * ves_icall_MonoMethod_get_base_method (MonoReflectionMethod *m, gboolean definition) { MonoClass *klass, *parent; + MonoGenericContext *generic_inst = NULL; MonoMethod *method = m->method; MonoMethod *result = NULL; int slot; @@ -6610,21 +6638,75 @@ ves_icall_MonoMethod_get_base_method (MonoReflectionMethod *m, gboolean definiti return m; klass = method->klass; - if (klass->generic_class) + if (klass->generic_class) { + generic_inst = mono_class_get_context (klass); klass = klass->generic_class->container_class; + } if (definition) { /* At the end of the loop, klass points to the eldest class that has this virtual function slot. */ for (parent = klass->parent; parent != NULL; parent = parent->parent) { + /* on entry, klass is either a plain old non-generic class and generic_inst == NULL + or klass is the generic container class and generic_inst is the instantiation. + + when we go to the parent, if the parent is an open constructed type, we need to + replace the type parameters by the definitions from the generic_inst, and then take it + apart again into the klass and the generic_inst. + + For cases like this: + class C : B { + public override void Foo () { ... } + } + class B : A> { + public override void Foo () { ... } + } + class A { + public virtual void Foo () { ... } + } + + if at each iteration the parent isn't open, we can skip inflating it. if at some + iteration the parent isn't generic (after possible inflation), we set generic_inst to + NULL; + */ + MonoGenericContext *parent_inst = NULL; + if (mono_class_is_open_constructed_type (mono_class_get_type (parent))) { + MonoError error; + parent = mono_class_inflate_generic_class_checked (parent, generic_inst, &error); + mono_error_raise_exception(&error); + } + if (parent->generic_class) { + parent_inst = mono_class_get_context (parent); + parent = parent->generic_class->container_class; + } + mono_class_setup_vtable (parent); if (parent->vtable_size <= slot) break; klass = parent; + generic_inst = parent_inst; } } else { klass = klass->parent; if (!klass) return m; + if (mono_class_is_open_constructed_type (mono_class_get_type (klass))) { + MonoError error; + klass = mono_class_inflate_generic_class_checked (klass, generic_inst, &error); + mono_error_raise_exception(&error); + + generic_inst = NULL; + } + if (klass->generic_class) { + generic_inst = mono_class_get_context (klass); + klass = klass->generic_class->container_class; + } + + } + + if (generic_inst) { + MonoError error; + klass = mono_class_inflate_generic_class_checked (klass, generic_inst, &error); + mono_error_raise_exception(&error); } if (klass == method->klass) @@ -6772,7 +6854,7 @@ ICALL_EXPORT MonoObject* mono_TypedReference_ToObject (MonoTypedRef* tref) { if (MONO_TYPE_IS_REFERENCE (tref->type)) { - MonoObject** objp = tref->value; + MonoObject** objp = (MonoObject **)tref->value; return *objp; } @@ -7266,19 +7348,19 @@ mono_icall_init (void) #endif icall_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); - mono_mutex_init (&icall_mutex); + mono_os_mutex_init (&icall_mutex); } static void mono_icall_lock (void) { - mono_locks_mutex_acquire (&icall_mutex, IcallLock); + mono_locks_os_acquire (&icall_mutex, IcallLock); } static void mono_icall_unlock (void) { - mono_locks_mutex_release (&icall_mutex, IcallLock); + mono_locks_os_release (&icall_mutex, IcallLock); } void @@ -7287,7 +7369,7 @@ mono_icall_cleanup (void) g_hash_table_destroy (icall_hash); g_hash_table_destroy (jit_icall_hash_name); g_hash_table_destroy (jit_icall_hash_addr); - mono_mutex_destroy (&icall_mutex); + mono_os_mutex_destroy (&icall_mutex); } void @@ -7313,7 +7395,7 @@ compare_method_imap (const void *key, const void *elem) static gpointer find_method_icall (const IcallTypeDesc *imap, const char *name) { - const guint16 *nameslot = mono_binary_search (name, icall_names_idx + imap->first_icall, icall_desc_num_icalls (imap), sizeof (icall_names_idx [0]), compare_method_imap); + const guint16 *nameslot = (const guint16 *)mono_binary_search (name, icall_names_idx + imap->first_icall, icall_desc_num_icalls (imap), sizeof (icall_names_idx [0]), compare_method_imap); if (!nameslot) return NULL; return (gpointer)icall_functions [(nameslot - &icall_names_idx [0])]; @@ -7329,7 +7411,7 @@ compare_class_imap (const void *key, const void *elem) static const IcallTypeDesc* find_class_icalls (const char *name) { - const guint16 *nameslot = mono_binary_search (name, icall_type_names_idx, Icall_type_num, sizeof (icall_type_names_idx [0]), compare_class_imap); + const guint16 *nameslot = (const guint16 *)mono_binary_search (name, icall_type_names_idx, Icall_type_num, sizeof (icall_type_names_idx [0]), compare_class_imap); if (!nameslot) return NULL; return &icall_type_descs [nameslot - &icall_type_names_idx [0]]; @@ -7588,48 +7670,48 @@ mono_lookup_icall_symbol (MonoMethod *m) } static MonoType* -type_from_typename (char *typename) +type_from_typename (char *type_name) { MonoClass *klass = NULL; /* assignment to shut GCC warning up */ - if (!strcmp (typename, "int")) + if (!strcmp (type_name, "int")) klass = mono_defaults.int_class; - else if (!strcmp (typename, "ptr")) + else if (!strcmp (type_name, "ptr")) klass = mono_defaults.int_class; - else if (!strcmp (typename, "void")) + else if (!strcmp (type_name, "void")) klass = mono_defaults.void_class; - else if (!strcmp (typename, "int32")) + else if (!strcmp (type_name, "int32")) klass = mono_defaults.int32_class; - else if (!strcmp (typename, "uint32")) + else if (!strcmp (type_name, "uint32")) klass = mono_defaults.uint32_class; - else if (!strcmp (typename, "int8")) + else if (!strcmp (type_name, "int8")) klass = mono_defaults.sbyte_class; - else if (!strcmp (typename, "uint8")) + else if (!strcmp (type_name, "uint8")) klass = mono_defaults.byte_class; - else if (!strcmp (typename, "int16")) + else if (!strcmp (type_name, "int16")) klass = mono_defaults.int16_class; - else if (!strcmp (typename, "uint16")) + else if (!strcmp (type_name, "uint16")) klass = mono_defaults.uint16_class; - else if (!strcmp (typename, "long")) + else if (!strcmp (type_name, "long")) klass = mono_defaults.int64_class; - else if (!strcmp (typename, "ulong")) + else if (!strcmp (type_name, "ulong")) klass = mono_defaults.uint64_class; - else if (!strcmp (typename, "float")) + else if (!strcmp (type_name, "float")) klass = mono_defaults.single_class; - else if (!strcmp (typename, "double")) + else if (!strcmp (type_name, "double")) klass = mono_defaults.double_class; - else if (!strcmp (typename, "object")) + else if (!strcmp (type_name, "object")) klass = mono_defaults.object_class; - else if (!strcmp (typename, "obj")) + else if (!strcmp (type_name, "obj")) klass = mono_defaults.object_class; - else if (!strcmp (typename, "string")) + else if (!strcmp (type_name, "string")) klass = mono_defaults.string_class; - else if (!strcmp (typename, "bool")) + else if (!strcmp (type_name, "bool")) klass = mono_defaults.boolean_class; - else if (!strcmp (typename, "boolean")) + else if (!strcmp (type_name, "boolean")) klass = mono_defaults.boolean_class; else { - g_error ("%s", typename); + g_error ("%s", type_name); g_assert_not_reached (); } return &klass->byval_arg; @@ -7648,7 +7730,7 @@ mono_create_icall_signature (const char *sigstr) MonoImage *corlib = mono_defaults.corlib; mono_image_lock (corlib); - res = g_hash_table_lookup (corlib->helper_signatures, sigstr); + res = (MonoMethodSignature *)g_hash_table_lookup (corlib->helper_signatures, sigstr); mono_image_unlock (corlib); if (res) @@ -7682,7 +7764,7 @@ mono_create_icall_signature (const char *sigstr) g_strfreev (parts); mono_image_lock (corlib); - res2 = g_hash_table_lookup (corlib->helper_signatures, sigstr); + res2 = (MonoMethodSignature *)g_hash_table_lookup (corlib->helper_signatures, sigstr); if (res2) res = res2; /*Value is allocated in the image pool*/ else @@ -7699,7 +7781,7 @@ mono_find_jit_icall_by_name (const char *name) g_assert (jit_icall_hash_name); mono_icall_lock (); - info = g_hash_table_lookup (jit_icall_hash_name, name); + info = (MonoJitICallInfo *)g_hash_table_lookup (jit_icall_hash_name, name); mono_icall_unlock (); return info; } @@ -7711,7 +7793,7 @@ mono_find_jit_icall_by_addr (gconstpointer addr) g_assert (jit_icall_hash_addr); mono_icall_lock (); - info = g_hash_table_lookup (jit_icall_hash_addr, (gpointer)addr); + info = (MonoJitICallInfo *)g_hash_table_lookup (jit_icall_hash_addr, (gpointer)addr); mono_icall_unlock (); return info; @@ -7741,7 +7823,7 @@ mono_lookup_jit_icall_symbol (const char *name) const char *res = NULL; mono_icall_lock (); - info = g_hash_table_lookup (jit_icall_hash_name, name); + info = (MonoJitICallInfo *)g_hash_table_lookup (jit_icall_hash_name, name); if (info) res = info->c_symbol; mono_icall_unlock (); diff --git a/mono/metadata/image-internals.h b/mono/metadata/image-internals.h index 3bfd9553dcc..e5211176d8e 100644 --- a/mono/metadata/image-internals.h +++ b/mono/metadata/image-internals.h @@ -4,28 +4,9 @@ #ifndef __MONO_METADATA_IMAGE_INTERNALS_H__ #define __MONO_METADATA_IMAGE_INTERNALS_H__ -#ifdef CHECKED_BUILD - #include -#include - -typedef struct -{ - MonoImage *image; - MonoImageSet *image_set; -} MonoMemPoolOwner; - -static MonoMemPoolOwner mono_mempool_no_owner = {NULL,NULL}; - -static gboolean -check_mempool_owner_eq (MonoMemPoolOwner a, MonoMemPoolOwner b) -{ - return a.image == b.image && a.image_set == b.image_set; -} - -MonoMemPoolOwner -mono_find_mempool_owner (void *ptr); -#endif /* CHECKED_BUILD */ +MonoImage * +mono_find_image_owner (void *ptr); #endif /* __MONO_METADATA_IMAGE_INTERNALS_H__ */ diff --git a/mono/metadata/image.c b/mono/metadata/image.c index 158831256dc..fbbf58f6b3e 100644 --- a/mono/metadata/image.c +++ b/mono/metadata/image.c @@ -79,8 +79,8 @@ static GHashTable *get_loaded_images_by_name_hash (gboolean refonly) static gboolean debug_assembly_unload = FALSE; -#define mono_images_lock() if (mutex_inited) mono_mutex_lock (&images_mutex) -#define mono_images_unlock() if (mutex_inited) mono_mutex_unlock (&images_mutex) +#define mono_images_lock() if (mutex_inited) mono_os_mutex_lock (&images_mutex) +#define mono_images_unlock() if (mutex_inited) mono_os_mutex_unlock (&images_mutex) static gboolean mutex_inited; static mono_mutex_t images_mutex; @@ -114,7 +114,7 @@ mono_remove_image_unload_hook (MonoImageUnloadFunc func, gpointer user_data) ImageUnloadHook *hook; for (l = image_unload_hooks; l; l = l->next) { - hook = l->data; + hook = (ImageUnloadHook *)l->data; if (hook->func == func && hook->user_data == user_data) { g_free (hook); @@ -131,7 +131,7 @@ mono_image_invoke_unload_hook (MonoImage *image) ImageUnloadHook *hook; for (l = image_unload_hooks; l; l = l->next) { - hook = l->data; + hook = (ImageUnloadHook *)l->data; hook->func (image, hook->user_data); } @@ -149,7 +149,7 @@ mono_install_image_loader (const MonoImageLoader *loader) guint32 mono_cli_rva_image_map (MonoImage *image, guint32 addr) { - MonoCLIImageInfo *iinfo = image->image_info; + MonoCLIImageInfo *iinfo = (MonoCLIImageInfo *)image->image_info; const int top = iinfo->cli_section_count; MonoSectionTable *tables = iinfo->cli_section_tables; int i; @@ -185,7 +185,7 @@ mono_cli_rva_image_map (MonoImage *image, guint32 addr) char * mono_image_rva_map (MonoImage *image, guint32 addr) { - MonoCLIImageInfo *iinfo = image->image_info; + MonoCLIImageInfo *iinfo = (MonoCLIImageInfo *)image->image_info; const int top = iinfo->cli_section_count; MonoSectionTable *tables = iinfo->cli_section_tables; int i; @@ -222,7 +222,7 @@ mono_image_rva_map (MonoImage *image, guint32 addr) void mono_images_init (void) { - mono_mutex_init_recursive (&images_mutex); + mono_os_mutex_init_recursive (&images_mutex); int hash_idx; for(hash_idx = 0; hash_idx < IMAGES_HASH_COUNT; hash_idx++) @@ -246,7 +246,7 @@ mono_images_cleanup (void) GHashTableIter iter; MonoImage *image; - mono_mutex_destroy (&images_mutex); + mono_os_mutex_destroy (&images_mutex); // If an assembly image is still loaded at shutdown, this could indicate managed code is still running. // Reflection-only images being still loaded doesn't indicate anything as harmful, so we don't check for it. @@ -274,7 +274,7 @@ mono_images_cleanup (void) int mono_image_ensure_section_idx (MonoImage *image, int section) { - MonoCLIImageInfo *iinfo = image->image_info; + MonoCLIImageInfo *iinfo = (MonoCLIImageInfo *)image->image_info; MonoSectionTable *sect; g_return_val_if_fail (section < iinfo->cli_section_count, FALSE); @@ -309,7 +309,7 @@ mono_image_ensure_section_idx (MonoImage *image, int section) int mono_image_ensure_section (MonoImage *image, const char *section) { - MonoCLIImageInfo *ii = image->image_info; + MonoCLIImageInfo *ii = (MonoCLIImageInfo *)image->image_info; int i; for (i = 0; i < ii->cli_section_count; i++){ @@ -697,7 +697,7 @@ mono_image_load_module (MonoImage *image, int idx) static gpointer class_key_extract (gpointer value) { - MonoClass *klass = value; + MonoClass *klass = (MonoClass *)value; return GUINT_TO_POINTER (klass->type_token); } @@ -705,7 +705,7 @@ class_key_extract (gpointer value) static gpointer* class_next_value (gpointer value) { - MonoClass *klass = value; + MonoClass *klass = (MonoClass *)value; return (gpointer*)&klass->next_class_cache; } @@ -713,8 +713,8 @@ class_next_value (gpointer value) void mono_image_init (MonoImage *image) { - mono_mutex_init_recursive (&image->lock); - mono_mutex_init_recursive (&image->szarray_cache_lock); + mono_os_mutex_init_recursive (&image->lock); + mono_os_mutex_init_recursive (&image->szarray_cache_lock); image->mempool = mono_mempool_new_size (INITIAL_IMAGE_SIZE); mono_internal_hash_table_init (&image->class_cache, @@ -894,7 +894,7 @@ pe_image_load_pe_data (MonoImage *image) MonoMSDOSHeader msdos; gint32 offset = 0; - iinfo = image->image_info; + iinfo = (MonoCLIImageInfo *)image->image_info; header = &iinfo->cli_header; #ifdef HOST_WIN32 @@ -963,7 +963,7 @@ pe_image_load_cli_data (MonoImage *image) MonoCLIImageInfo *iinfo; MonoDotNetHeader *header; - iinfo = image->image_info; + iinfo = (MonoCLIImageInfo *)image->image_info; header = &iinfo->cli_header; /* Load the CLI header */ @@ -1034,12 +1034,12 @@ do_mono_image_load (MonoImage *image, MonoImageOpenStatus *status, mono_image_init (image); - iinfo = image->image_info; + iinfo = (MonoCLIImageInfo *)image->image_info; header = &iinfo->cli_header; if (!image->metadata_only) { for (l = image_loaders; l; l = l->next) { - MonoImageLoader *loader = l->data; + MonoImageLoader *loader = (MonoImageLoader *)l->data; if (loader->match (image)) { image->loader = loader; break; @@ -1062,7 +1062,7 @@ do_mono_image_load (MonoImage *image, MonoImageOpenStatus *status, if (!mono_image_load_pe_data (image)) goto invalid_image; } else { - image->loader = &pe_loader; + image->loader = (MonoImageLoader*)&pe_loader; } if (care_about_cli == FALSE) { @@ -1091,7 +1091,7 @@ done: invalid_image: if (errors) { - MonoVerifyInfo *info = errors->data; + MonoVerifyInfo *info = (MonoVerifyInfo *)errors->data; g_warning ("Could not load image %s due to %s", image->name, info->message); mono_free_verify_list (errors); } @@ -1127,11 +1127,11 @@ do_mono_image_open (const char *fname, MonoImageOpenStatus *status, image = g_new0 (MonoImage, 1); image->raw_buffer_used = TRUE; image->raw_data_len = mono_file_map_size (filed); - image->raw_data = mono_file_map (image->raw_data_len, MONO_MMAP_READ|MONO_MMAP_PRIVATE, mono_file_map_fd (filed), 0, &image->raw_data_handle); + image->raw_data = (char *)mono_file_map (image->raw_data_len, MONO_MMAP_READ|MONO_MMAP_PRIVATE, mono_file_map_fd (filed), 0, &image->raw_data_handle); #if defined(HAVE_MMAP) && !defined (HOST_WIN32) if (!image->raw_data) { image->fileio_used = TRUE; - image->raw_data = mono_file_map_fileio (image->raw_data_len, MONO_MMAP_READ|MONO_MMAP_PRIVATE, mono_file_map_fd (filed), 0, &image->raw_data_handle); + image->raw_data = (char *)mono_file_map_fileio (image->raw_data_len, MONO_MMAP_READ|MONO_MMAP_PRIVATE, mono_file_map_fd (filed), 0, &image->raw_data_handle); } #endif if (!image->raw_data) { @@ -1170,9 +1170,9 @@ mono_image_loaded_full (const char *name, gboolean refonly) MonoImage *res; mono_images_lock (); - res = g_hash_table_lookup (get_loaded_images_hash (refonly), name); + res = (MonoImage *)g_hash_table_lookup (get_loaded_images_hash (refonly), name); if (!res) - res = g_hash_table_lookup (get_loaded_images_by_name_hash (refonly), name); + res = (MonoImage *)g_hash_table_lookup (get_loaded_images_by_name_hash (refonly), name); mono_images_unlock (); return res; @@ -1200,12 +1200,12 @@ typedef struct { static void find_by_guid (gpointer key, gpointer val, gpointer user_data) { - GuidData *data = user_data; + GuidData *data = (GuidData *)user_data; MonoImage *image; if (data->res) return; - image = val; + image = (MonoImage *)val; if (strcmp (data->guid, mono_image_get_guid (image)) == 0) data->res = image; } @@ -1237,7 +1237,7 @@ register_image (MonoImage *image) GHashTable *loaded_images = get_loaded_images_hash (image->ref_only); mono_images_lock (); - image2 = g_hash_table_lookup (loaded_images, image->name); + image2 = (MonoImage *)g_hash_table_lookup (loaded_images, image->name); if (image2) { /* Somebody else beat us to it */ @@ -1270,7 +1270,7 @@ mono_image_open_from_data_internal (char *data, guint32 data_len, gboolean need_ } datac = data; if (need_copy) { - datac = g_try_malloc (data_len); + datac = (char *)g_try_malloc (data_len); if (!datac) { if (status) *status = MONO_IMAGE_ERROR_ERRNO; @@ -1429,7 +1429,7 @@ mono_image_open_full (const char *fname, MonoImageOpenStatus *status, gboolean r * the same image, we discard all but the first copy. */ mono_images_lock (); - image = g_hash_table_lookup (loaded_images, absfname); + image = (MonoImage *)g_hash_table_lookup (loaded_images, absfname); g_free (absfname); if (image) { // Image already loaded @@ -1669,7 +1669,7 @@ mono_image_close_except_pools (MonoImage *image) loaded_images = get_loaded_images_hash (image->ref_only); loaded_images_by_name = get_loaded_images_by_name_hash (image->ref_only); - image2 = g_hash_table_lookup (loaded_images, image->name); + image2 = (MonoImage *)g_hash_table_lookup (loaded_images, image->name); if (image == image2) { /* This is not true if we are called from mono_image_open () */ g_hash_table_remove (loaded_images, image->name); @@ -1740,7 +1740,7 @@ mono_image_close_except_pools (MonoImage *image) if (image->raw_data_allocated) { /* FIXME: do we need this? (image is disposed anyway) */ /* image->raw_metadata and cli_sections might lie inside image->raw_data */ - MonoCLIImageInfo *ii = image->image_info; + MonoCLIImageInfo *ii = (MonoCLIImageInfo *)image->image_info; if ((image->raw_metadata > image->raw_data) && (image->raw_metadata <= (image->raw_data + image->raw_data_len))) @@ -1829,7 +1829,7 @@ mono_image_close_except_pools (MonoImage *image) mono_bitset_free (image->interface_bitset); } if (image->image_info){ - MonoCLIImageInfo *ii = image->image_info; + MonoCLIImageInfo *ii = (MonoCLIImageInfo *)image->image_info; if (ii->cli_section_tables) g_free (ii->cli_section_tables); @@ -1847,8 +1847,8 @@ mono_image_close_except_pools (MonoImage *image) if (image->modules_loaded) g_free (image->modules_loaded); - mono_mutex_destroy (&image->szarray_cache_lock); - mono_mutex_destroy (&image->lock); + mono_os_mutex_destroy (&image->szarray_cache_lock); + mono_os_mutex_destroy (&image->lock); /*g_print ("destroy image %p (dynamic: %d)\n", image, image->dynamic);*/ if (image_is_dynamic (image)) { @@ -2049,7 +2049,7 @@ mono_image_lookup_resource (MonoImage *image, guint32 res_id, guint32 lang_id, g mono_image_ensure_section_idx (image, MONO_SECTION_RSRC); - info=image->image_info; + info = (MonoCLIImageInfo *)image->image_info; if(info==NULL) { return(NULL); } @@ -2122,7 +2122,7 @@ mono_image_get_entry_point (MonoImage *image) const char* mono_image_get_resource (MonoImage *image, guint32 offset, guint32 *size) { - MonoCLIImageInfo *iinfo = image->image_info; + MonoCLIImageInfo *iinfo = (MonoCLIImageInfo *)image->image_info; MonoCLIHeader *ch = &iinfo->cli_cli_header; const char* data; @@ -2212,7 +2212,7 @@ done: const char* mono_image_get_strong_name (MonoImage *image, guint32 *size) { - MonoCLIImageInfo *iinfo = image->image_info; + MonoCLIImageInfo *iinfo = (MonoCLIImageInfo *)image->image_info; MonoPEDirEntry *de = &iinfo->cli_cli_header.ch_strong_name; const char* data; @@ -2240,7 +2240,7 @@ mono_image_get_strong_name (MonoImage *image, guint32 *size) guint32 mono_image_strong_name_position (MonoImage *image, guint32 *size) { - MonoCLIImageInfo *iinfo = image->image_info; + MonoCLIImageInfo *iinfo = (MonoCLIImageInfo *)image->image_info; MonoPEDirEntry *de = &iinfo->cli_cli_header.ch_strong_name; guint32 pos; @@ -2384,7 +2384,7 @@ mono_image_is_dynamic (MonoImage *image) gboolean mono_image_has_authenticode_entry (MonoImage *image) { - MonoCLIImageInfo *iinfo = image->image_info; + MonoCLIImageInfo *iinfo = (MonoCLIImageInfo *)image->image_info; MonoDotNetHeader *header = &iinfo->cli_header; MonoPEDirEntry *de = &header->datadir.pe_certificate_table; // the Authenticode "pre" (non ASN.1) header is 8 bytes long @@ -2441,7 +2441,7 @@ g_list_prepend_image (MonoImage *image, GList *list, gpointer data) { GList *new_list; - new_list = mono_image_alloc (image, sizeof (GList)); + new_list = (GList *)mono_image_alloc (image, sizeof (GList)); new_list->data = data; new_list->prev = list ? list->prev : NULL; new_list->next = list; @@ -2459,7 +2459,7 @@ g_slist_append_image (MonoImage *image, GSList *list, gpointer data) { GSList *new_list; - new_list = mono_image_alloc (image, sizeof (GSList)); + new_list = (GSList *)mono_image_alloc (image, sizeof (GSList)); new_list->data = data; new_list->next = NULL; @@ -2469,13 +2469,13 @@ g_slist_append_image (MonoImage *image, GSList *list, gpointer data) void mono_image_lock (MonoImage *image) { - mono_locks_acquire (&image->lock, ImageDataLock); + mono_locks_os_acquire (&image->lock, ImageDataLock); } void mono_image_unlock (MonoImage *image) { - mono_locks_release (&image->lock, ImageDataLock); + mono_locks_os_release (&image->lock, ImageDataLock); } @@ -2538,51 +2538,24 @@ mono_image_append_class_to_reflection_info_set (MonoClass *klass) mono_image_unlock (image); } -#if CHECKED_BUILD - -// These are support for the mempool reference tracking feature in checked-build, but live in image.c due to use of static variables of this file. - -// Given an image and a pointer, return the mempool owner if it is either this image or one of its imagesets. -static MonoMemPoolOwner -check_for_mempool_owner (void *ptr, MonoImage *image) -{ - if (mono_mempool_contains_addr (image->mempool, ptr)) - { - MonoMemPoolOwner owner = {image, NULL}; - return owner; - } - - GSList *l; - for (l = image->image_sets; l; l = l->next) { - MonoImageSet *set = l->data; - - if (mono_mempool_contains_addr (set->mempool, ptr)) - { - MonoMemPoolOwner owner = {NULL, set}; - return owner; - } - } - - return mono_mempool_no_owner; -} +// This is support for the mempool reference tracking feature in checked-build, but lives in image.c due to use of static variables of this file. /** - * mono_find_mempool_owner: + * mono_find_image_owner: * - * Find the image or imageset, if any, which a given pointer is located in the memory of. + * Find the image, if any, which a given pointer is located in the memory of. */ -MonoMemPoolOwner -mono_find_mempool_owner (void *ptr) +MonoImage * +mono_find_image_owner (void *ptr) { mono_images_lock (); - MonoMemPoolOwner owner = mono_mempool_no_owner; - gboolean searching = TRUE; + MonoImage *owner = NULL; // Iterate over both by-path image hashes const int hash_candidates[] = {IMAGES_HASH_PATH, IMAGES_HASH_PATH_REFONLY}; int hash_idx; - for (hash_idx = 0; searching && hash_idx < G_N_ELEMENTS (hash_candidates); hash_idx++) + for (hash_idx = 0; !owner && hash_idx < G_N_ELEMENTS (hash_candidates); hash_idx++) { GHashTable *target = loaded_images_hashes [hash_candidates [hash_idx]]; GHashTableIter iter; @@ -2590,14 +2563,12 @@ mono_find_mempool_owner (void *ptr) // Iterate over images within a hash g_hash_table_iter_init (&iter, target); - while (searching && g_hash_table_iter_next(&iter, NULL, (gpointer *)&image)) + while (!owner && g_hash_table_iter_next(&iter, NULL, (gpointer *)&image)) { mono_image_lock (image); - owner = check_for_mempool_owner (ptr, image); + if (mono_mempool_contains_addr (image->mempool, ptr)) + owner = image; mono_image_unlock (image); - - // Continue searching if null owner returned - searching = check_mempool_owner_eq (owner, mono_mempool_no_owner); } } @@ -2605,5 +2576,3 @@ mono_find_mempool_owner (void *ptr) return owner; } - -#endif diff --git a/mono/metadata/jit-info.c b/mono/metadata/jit-info.c index 06375a49773..33dd5471c5f 100644 --- a/mono/metadata/jit-info.c +++ b/mono/metadata/jit-info.c @@ -90,7 +90,7 @@ jit_info_table_new_chunk (void) MonoJitInfoTable * mono_jit_info_table_new (MonoDomain *domain) { - MonoJitInfoTable *table = g_malloc0 (MONO_SIZEOF_JIT_INFO_TABLE + sizeof (MonoJitInfoTableChunk*)); + MonoJitInfoTable *table = (MonoJitInfoTable *)g_malloc0 (MONO_SIZEOF_JIT_INFO_TABLE + sizeof (MonoJitInfoTableChunk*)); table->domain = domain; table->num_chunks = 1; @@ -197,7 +197,7 @@ jit_info_table_chunk_index (MonoJitInfoTableChunk *chunk, MonoThreadHazardPointe while (left < right) { int pos = (left + right) / 2; - MonoJitInfo *ji = get_hazardous_pointer((gpointer volatile*)&chunk->data [pos], hp, JIT_INFO_HAZARD_INDEX); + MonoJitInfo *ji = (MonoJitInfo *)get_hazardous_pointer((gpointer volatile*)&chunk->data [pos], hp, JIT_INFO_HAZARD_INDEX); gint8 *code_end = (gint8*)ji->code_start + ji->code_size; if (addr < code_end) @@ -230,7 +230,7 @@ jit_info_table_find (MonoJitInfoTable *table, MonoThreadHazardPointers *hp, gint MonoJitInfoTableChunk *chunk = table->chunks [chunk_pos]; while (pos < chunk->num_elements) { - ji = get_hazardous_pointer ((gpointer volatile*)&chunk->data [pos], hp, JIT_INFO_HAZARD_INDEX); + ji = (MonoJitInfo *)get_hazardous_pointer ((gpointer volatile*)&chunk->data [pos], hp, JIT_INFO_HAZARD_INDEX); ++pos; @@ -288,7 +288,7 @@ mono_jit_info_table_find_internal (MonoDomain *domain, char *addr, gboolean try_ table by a hazard pointer and make sure that the pointer is still there after we've made it hazardous, we don't have to worry about the writer freeing the table. */ - table = get_hazardous_pointer ((gpointer volatile*)&domain->jit_info_table, hp, JIT_INFO_TABLE_HAZARD_INDEX); + table = (MonoJitInfoTable *)get_hazardous_pointer ((gpointer volatile*)&domain->jit_info_table, hp, JIT_INFO_TABLE_HAZARD_INDEX); ji = jit_info_table_find (table, hp, (gint8*)addr); if (hp) @@ -300,7 +300,7 @@ mono_jit_info_table_find_internal (MonoDomain *domain, char *addr, gboolean try_ /* Maybe its an AOT module */ if (try_aot && mono_get_root_domain () && mono_get_root_domain ()->aot_modules) { - table = get_hazardous_pointer ((gpointer volatile*)&mono_get_root_domain ()->aot_modules, hp, JIT_INFO_TABLE_HAZARD_INDEX); + table = (MonoJitInfoTable *)get_hazardous_pointer ((gpointer volatile*)&mono_get_root_domain ()->aot_modules, hp, JIT_INFO_TABLE_HAZARD_INDEX); module_ji = jit_info_table_find (table, hp, (gint8*)addr); if (module_ji) ji = jit_info_find_in_aot_func (domain, module_ji->d.image, addr); @@ -370,7 +370,7 @@ jit_info_table_realloc (MonoJitInfoTable *old) int required_size; int num_chunks; int new_chunk, new_element; - MonoJitInfoTable *new; + MonoJitInfoTable *result; /* number of needed places for elements needed */ required_size = (int)((long)num_elements * JIT_INFO_TABLE_FILL_RATIO_DENOM / JIT_INFO_TABLE_FILL_RATIO_NOM); @@ -381,12 +381,12 @@ jit_info_table_realloc (MonoJitInfoTable *old) } g_assert (num_chunks > 0); - new = g_malloc (MONO_SIZEOF_JIT_INFO_TABLE + sizeof (MonoJitInfoTableChunk*) * num_chunks); - new->domain = old->domain; - new->num_chunks = num_chunks; + result = (MonoJitInfoTable *)g_malloc (MONO_SIZEOF_JIT_INFO_TABLE + sizeof (MonoJitInfoTableChunk*) * num_chunks); + result->domain = old->domain; + result->num_chunks = num_chunks; for (i = 0; i < num_chunks; ++i) - new->chunks [i] = jit_info_table_new_chunk (); + result->chunks [i] = jit_info_table_new_chunk (); new_chunk = 0; new_element = 0; @@ -398,9 +398,9 @@ jit_info_table_realloc (MonoJitInfoTable *old) for (j = 0; j < chunk_num_elements; ++j) { if (!IS_JIT_INFO_TOMBSTONE (chunk->data [j])) { g_assert (new_chunk < num_chunks); - new->chunks [new_chunk]->data [new_element] = chunk->data [j]; + result->chunks [new_chunk]->data [new_element] = chunk->data [j]; if (++new_element >= JIT_INFO_TABLE_FILLED_NUM_ELEMENTS) { - new->chunks [new_chunk]->num_elements = new_element; + result->chunks [new_chunk]->num_elements = new_element; ++new_chunk; new_element = 0; } @@ -410,18 +410,18 @@ jit_info_table_realloc (MonoJitInfoTable *old) if (new_chunk < num_chunks) { g_assert (new_chunk == num_chunks - 1); - new->chunks [new_chunk]->num_elements = new_element; - g_assert (new->chunks [new_chunk]->num_elements > 0); + result->chunks [new_chunk]->num_elements = new_element; + g_assert (result->chunks [new_chunk]->num_elements > 0); } for (i = 0; i < num_chunks; ++i) { - MonoJitInfoTableChunk *chunk = new->chunks [i]; + MonoJitInfoTableChunk *chunk = result->chunks [i]; MonoJitInfo *ji = chunk->data [chunk->num_elements - 1]; - new->chunks [i]->last_code_end = (gint8*)ji->code_start + ji->code_size; + result->chunks [i]->last_code_end = (gint8*)ji->code_start + ji->code_size; } - return new; + return result; } static void @@ -450,7 +450,7 @@ jit_info_table_split_chunk (MonoJitInfoTableChunk *chunk, MonoJitInfoTableChunk static MonoJitInfoTable* jit_info_table_copy_and_split_chunk (MonoJitInfoTable *table, MonoJitInfoTableChunk *chunk) { - MonoJitInfoTable *new_table = g_malloc (MONO_SIZEOF_JIT_INFO_TABLE + MonoJitInfoTable *new_table = (MonoJitInfoTable *)g_malloc (MONO_SIZEOF_JIT_INFO_TABLE + sizeof (MonoJitInfoTableChunk*) * (table->num_chunks + 1)); int i, j; @@ -477,28 +477,28 @@ jit_info_table_copy_and_split_chunk (MonoJitInfoTable *table, MonoJitInfoTableCh static MonoJitInfoTableChunk* jit_info_table_purify_chunk (MonoJitInfoTableChunk *old) { - MonoJitInfoTableChunk *new = jit_info_table_new_chunk (); + MonoJitInfoTableChunk *result = jit_info_table_new_chunk (); int i, j; j = 0; for (i = 0; i < old->num_elements; ++i) { if (!IS_JIT_INFO_TOMBSTONE (old->data [i])) - new->data [j++] = old->data [i]; + result->data [j++] = old->data [i]; } - new->num_elements = j; - if (new->num_elements > 0) - new->last_code_end = (gint8*)new->data [j - 1]->code_start + new->data [j - 1]->code_size; + result->num_elements = j; + if (result->num_elements > 0) + result->last_code_end = (gint8*)result->data [j - 1]->code_start + result->data [j - 1]->code_size; else - new->last_code_end = old->last_code_end; + result->last_code_end = old->last_code_end; - return new; + return result; } static MonoJitInfoTable* jit_info_table_copy_and_purify_chunk (MonoJitInfoTable *table, MonoJitInfoTableChunk *chunk) { - MonoJitInfoTable *new_table = g_malloc (MONO_SIZEOF_JIT_INFO_TABLE + MonoJitInfoTable *new_table = (MonoJitInfoTable *)g_malloc (MONO_SIZEOF_JIT_INFO_TABLE + sizeof (MonoJitInfoTableChunk*) * table->num_chunks); int i, j; @@ -690,10 +690,10 @@ jit_info_table_remove (MonoJitInfoTable *table, MonoJitInfo *ji) gpointer start = ji->code_start; int chunk_pos, pos; - chunk_pos = jit_info_table_index (table, start); + chunk_pos = jit_info_table_index (table, (gint8 *)start); g_assert (chunk_pos < table->num_chunks); - pos = jit_info_table_chunk_index (table->chunks [chunk_pos], NULL, start); + pos = jit_info_table_chunk_index (table->chunks [chunk_pos], NULL, (gint8 *)start); do { chunk = table->chunks [chunk_pos]; diff --git a/mono/metadata/loader.c b/mono/metadata/loader.c index b99d6a00b11..0566fe2d102 100644 --- a/mono/metadata/loader.c +++ b/mono/metadata/loader.c @@ -56,7 +56,8 @@ MonoDefaults mono_defaults; * See domain-internals.h for locking policy in combination with the * domain lock. */ -static mono_mutex_t loader_mutex, global_loader_data_mutex; +static MonoCoopMutex loader_mutex; +static mono_mutex_t global_loader_data_mutex; static gboolean loader_lock_inited; /* Statistics */ @@ -82,13 +83,13 @@ static void dllmap_cleanup (void); static void global_loader_data_lock (void) { - mono_locks_acquire (&global_loader_data_mutex, LoaderGlobalDataLock); + mono_locks_os_acquire (&global_loader_data_mutex, LoaderGlobalDataLock); } static void global_loader_data_unlock (void) { - mono_locks_release (&global_loader_data_mutex, LoaderGlobalDataLock); + mono_locks_os_release (&global_loader_data_mutex, LoaderGlobalDataLock); } void @@ -97,8 +98,8 @@ mono_loader_init () static gboolean inited; if (!inited) { - mono_mutex_init_recursive (&loader_mutex); - mono_mutex_init_recursive (&global_loader_data_mutex); + mono_coop_mutex_init_recursive (&loader_mutex); + mono_os_mutex_init_recursive (&global_loader_data_mutex); loader_lock_inited = TRUE; mono_native_tls_alloc (&loader_error_thread_id, NULL); @@ -126,8 +127,8 @@ mono_loader_cleanup (void) mono_native_tls_free (loader_error_thread_id); mono_native_tls_free (loader_lock_nest_id); - mono_mutex_destroy (&loader_mutex); - mono_mutex_destroy (&global_loader_data_mutex); + mono_coop_mutex_destroy (&loader_mutex); + mono_os_mutex_destroy (&global_loader_data_mutex); loader_lock_inited = FALSE; } @@ -460,7 +461,7 @@ field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass, MonoTableInfo *tables = image->tables; MonoType *sig_type; guint32 cols[6]; - guint32 nindex, class; + guint32 nindex, class_index; const char *fname; const char *ptr; guint32 idx = mono_metadata_token_index (token); @@ -469,16 +470,16 @@ field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass, mono_metadata_decode_row (&tables [MONO_TABLE_MEMBERREF], idx-1, cols, MONO_MEMBERREF_SIZE); nindex = cols [MONO_MEMBERREF_CLASS] >> MONO_MEMBERREF_PARENT_BITS; - class = cols [MONO_MEMBERREF_CLASS] & MONO_MEMBERREF_PARENT_MASK; + class_index = cols [MONO_MEMBERREF_CLASS] & MONO_MEMBERREF_PARENT_MASK; fname = mono_metadata_string_heap (image, cols [MONO_MEMBERREF_NAME]); if (!mono_verifier_verify_memberref_field_signature (image, cols [MONO_MEMBERREF_SIGNATURE], NULL)) { - mono_error_set_bad_image (error, image, "Bad field '%s' signature 0x%08x", class, token); + mono_error_set_bad_image (error, image, "Bad field '%s' signature 0x%08x", class_index, token); return NULL; } - switch (class) { + switch (class_index) { case MONO_MEMBERREF_PARENT_TYPEDEF: klass = mono_class_get_checked (image, MONO_TOKEN_TYPE_DEF | nindex, error); break; @@ -489,7 +490,7 @@ field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass, klass = mono_class_get_and_inflate_typespec_checked (image, MONO_TOKEN_TYPE_SPEC | nindex, context, error); break; default: - mono_error_set_bad_image (error, image, "Bad field field '%s' signature 0x%08x", class, token); + mono_error_set_bad_image (error, image, "Bad field field '%s' signature 0x%08x", class_index, token); } if (!klass) @@ -500,21 +501,21 @@ field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass, /* we may want to check the signature here... */ if (*ptr++ != 0x6) { - mono_error_set_field_load (error, klass, fname, "Bad field signature class token %08x field name %s token %08x", class, fname, token); + mono_error_set_field_load (error, klass, fname, "Bad field signature class token %08x field name %s token %08x", class_index, fname, token); return NULL; } /* FIXME: This needs a cache, especially for generic instances, since * mono_metadata_parse_type () allocates everything from a mempool. */ - sig_type = find_cached_memberref_sig (image, cols [MONO_MEMBERREF_SIGNATURE]); + sig_type = (MonoType *)find_cached_memberref_sig (image, cols [MONO_MEMBERREF_SIGNATURE]); if (!sig_type) { sig_type = mono_metadata_parse_type (image, MONO_PARSE_TYPE, 0, ptr, &ptr); if (sig_type == NULL) { mono_error_set_field_load (error, klass, fname, "Could not parse field '%s' signature %08x", fname, token); return NULL; } - sig_type = cache_memberref_sig (image, cols [MONO_MEMBERREF_SIGNATURE], sig_type); + sig_type = (MonoType *)cache_memberref_sig (image, cols [MONO_MEMBERREF_SIGNATURE], sig_type); } mono_class_init (klass); /*FIXME is this really necessary?*/ @@ -561,7 +562,7 @@ mono_field_from_token_checked (MonoImage *image, guint32 token, MonoClass **retk MonoClass *handle_class; *retklass = NULL; - result = mono_lookup_dynamic_token_class (image, token, TRUE, &handle_class, context); + result = (MonoClassField *)mono_lookup_dynamic_token_class (image, token, TRUE, &handle_class, context); // This checks the memberref type as well if (!result || handle_class != mono_defaults.fieldhandle_class) { mono_error_set_bad_image (error, image, "Bad field token 0x%08x", token); @@ -571,7 +572,7 @@ mono_field_from_token_checked (MonoImage *image, guint32 token, MonoClass **retk return result; } - if ((field = mono_conc_hashtable_lookup (image->field_cache, GUINT_TO_POINTER (token)))) { + if ((field = (MonoClassField *)mono_conc_hashtable_lookup (image->field_cache, GUINT_TO_POINTER (token)))) { *retklass = field->parent; return field; } @@ -814,7 +815,7 @@ inflate_generic_signature_checked (MonoImage *image, MonoMethodSignature *sig, M if (!context) return sig; - res = g_malloc0 (MONO_SIZEOF_METHOD_SIGNATURE + ((gint32)sig->param_count) * sizeof (MonoType*)); + res = (MonoMethodSignature *)g_malloc0 (MONO_SIZEOF_METHOD_SIGNATURE + ((gint32)sig->param_count) * sizeof (MonoType*)); res->param_count = sig->param_count; res->sentinelpos = -1; res->ret = mono_class_inflate_generic_type_checked (sig->ret, context, error); @@ -874,7 +875,7 @@ inflate_generic_header (MonoMethodHeader *header, MonoGenericContext *context) { MonoMethodHeader *res; int i; - res = g_malloc0 (MONO_SIZEOF_METHOD_HEADER + sizeof (gpointer) * header->num_locals); + res = (MonoMethodHeader *)g_malloc0 (MONO_SIZEOF_METHOD_HEADER + sizeof (gpointer) * header->num_locals); res->code = header->code; res->code_size = header->code_size; res->max_stack = header->max_stack; @@ -885,7 +886,7 @@ inflate_generic_header (MonoMethodHeader *header, MonoGenericContext *context) for (i = 0; i < header->num_locals; ++i) res->locals [i] = mono_class_inflate_generic_type (header->locals [i], context); if (res->num_clauses) { - res->clauses = g_memdup (header->clauses, sizeof (MonoExceptionClause) * res->num_clauses); + res->clauses = (MonoExceptionClause *)g_memdup (header->clauses, sizeof (MonoExceptionClause) * res->num_clauses); for (i = 0; i < header->num_clauses; ++i) { MonoExceptionClause *clause = &res->clauses [i]; if (clause->flags != MONO_EXCEPTION_CLAUSE_NONE) @@ -950,14 +951,14 @@ mono_method_get_signature_checked (MonoMethod *method, MonoImage *image, guint32 mono_metadata_decode_row (&image->tables [MONO_TABLE_MEMBERREF], idx-1, cols, MONO_MEMBERREF_SIZE); sig_idx = cols [MONO_MEMBERREF_SIGNATURE]; - sig = find_cached_memberref_sig (image, sig_idx); + sig = (MonoMethodSignature *)find_cached_memberref_sig (image, sig_idx); if (!sig) { if (!mono_verifier_verify_memberref_method_signature (image, sig_idx, NULL)) { - guint32 class = cols [MONO_MEMBERREF_CLASS] & MONO_MEMBERREF_PARENT_MASK; + guint32 klass = cols [MONO_MEMBERREF_CLASS] & MONO_MEMBERREF_PARENT_MASK; const char *fname = mono_metadata_string_heap (image, cols [MONO_MEMBERREF_NAME]); //FIXME include the verification error - mono_error_set_bad_image (error, image, "Bad method signature class token 0x%08x field name %s token 0x%08x", class, fname, token); + mono_error_set_bad_image (error, image, "Bad method signature class token 0x%08x field name %s token 0x%08x", klass, fname, token); return NULL; } @@ -968,14 +969,14 @@ mono_method_get_signature_checked (MonoMethod *method, MonoImage *image, guint32 if (!sig) return NULL; - sig = cache_memberref_sig (image, sig_idx, sig); + sig = (MonoMethodSignature *)cache_memberref_sig (image, sig_idx, sig); } /* FIXME: we probably should verify signature compat in the dynamic case too*/ if (!mono_verifier_is_sig_compatible (image, method, sig)) { - guint32 class = cols [MONO_MEMBERREF_CLASS] & MONO_MEMBERREF_PARENT_MASK; + guint32 klass = cols [MONO_MEMBERREF_CLASS] & MONO_MEMBERREF_PARENT_MASK; const char *fname = mono_metadata_string_heap (image, cols [MONO_MEMBERREF_NAME]); - mono_error_set_bad_image (error, image, "Incompatible method signature class token 0x%08x field name %s token 0x%08x", class, fname, token); + mono_error_set_bad_image (error, image, "Incompatible method signature class token 0x%08x field name %s token 0x%08x", klass, fname, token); return NULL; } } @@ -1040,7 +1041,7 @@ method_from_memberref (MonoImage *image, guint32 idx, MonoGenericContext *typesp MonoMethod *method = NULL; MonoTableInfo *tables = image->tables; guint32 cols[6]; - guint32 nindex, class, sig_idx; + guint32 nindex, class_index, sig_idx; const char *mname; MonoMethodSignature *sig; const char *ptr; @@ -1049,7 +1050,7 @@ method_from_memberref (MonoImage *image, guint32 idx, MonoGenericContext *typesp mono_metadata_decode_row (&tables [MONO_TABLE_MEMBERREF], idx-1, cols, 3); nindex = cols [MONO_MEMBERREF_CLASS] >> MONO_MEMBERREF_PARENT_BITS; - class = cols [MONO_MEMBERREF_CLASS] & MONO_MEMBERREF_PARENT_MASK; + class_index = cols [MONO_MEMBERREF_CLASS] & MONO_MEMBERREF_PARENT_MASK; /*g_print ("methodref: 0x%x 0x%x %s\n", class, nindex, mono_metadata_string_heap (m, cols [MONO_MEMBERREF_NAME]));*/ @@ -1061,9 +1062,9 @@ method_from_memberref (MonoImage *image, guint32 idx, MonoGenericContext *typesp * method into a cache. */ if (used_context) - *used_context = class == MONO_MEMBERREF_PARENT_TYPESPEC; + *used_context = class_index == MONO_MEMBERREF_PARENT_TYPESPEC; - switch (class) { + switch (class_index) { case MONO_MEMBERREF_PARENT_TYPEREF: klass = mono_class_from_typeref_checked (image, MONO_TOKEN_TYPE_REF | nindex, error); if (!klass) @@ -1089,7 +1090,7 @@ method_from_memberref (MonoImage *image, guint32 idx, MonoGenericContext *typesp return method; } default: - mono_error_set_bad_image (error, image, "Memberref parent unknown: class: %d, index %d", class, nindex); + mono_error_set_bad_image (error, image, "Memberref parent unknown: class: %d, index %d", class_index, nindex); goto fail; } @@ -1106,16 +1107,16 @@ method_from_memberref (MonoImage *image, guint32 idx, MonoGenericContext *typesp ptr = mono_metadata_blob_heap (image, sig_idx); mono_metadata_decode_blob_size (ptr, &ptr); - sig = find_cached_memberref_sig (image, sig_idx); + sig = (MonoMethodSignature *)find_cached_memberref_sig (image, sig_idx); if (!sig) { sig = mono_metadata_parse_method_signature_full (image, NULL, 0, ptr, NULL, error); if (sig == NULL) goto fail; - sig = cache_memberref_sig (image, sig_idx, sig); + sig = (MonoMethodSignature *)cache_memberref_sig (image, sig_idx, sig); } - switch (class) { + switch (class_index) { case MONO_MEMBERREF_PARENT_TYPEREF: case MONO_MEMBERREF_PARENT_TYPEDEF: method = find_method (klass, NULL, mname, sig, klass, error); @@ -1137,7 +1138,7 @@ method_from_memberref (MonoImage *image, guint32 idx, MonoGenericContext *typesp break; } default: - mono_error_set_bad_image (error, image,"Memberref parent unknown: class: %d, index %d", class, nindex); + mono_error_set_bad_image (error, image,"Memberref parent unknown: class: %d, index %d", class_index, nindex); goto fail; } @@ -1331,7 +1332,7 @@ mono_dllmap_insert (MonoImage *assembly, const char *dll, const char *func, cons mono_loader_init (); if (!assembly) { - entry = g_malloc0 (sizeof (MonoDllMap)); + entry = (MonoDllMap *)g_malloc0 (sizeof (MonoDllMap)); entry->dll = dll? g_strdup (dll): NULL; entry->target = tdll? g_strdup (tdll): NULL; entry->func = func? g_strdup (func): NULL; @@ -1342,7 +1343,7 @@ mono_dllmap_insert (MonoImage *assembly, const char *dll, const char *func, cons global_dll_map = entry; global_loader_data_unlock (); } else { - entry = mono_image_alloc0 (assembly, sizeof (MonoDllMap)); + entry = (MonoDllMap *)mono_image_alloc0 (assembly, sizeof (MonoDllMap)); entry->dll = dll? mono_image_strdup (assembly, dll): NULL; entry->target = tdll? mono_image_strdup (assembly, tdll): NULL; entry->func = func? mono_image_strdup (assembly, func): NULL; @@ -1389,7 +1390,7 @@ cached_module_load (const char *name, int flags, char **err) global_loader_data_lock (); if (!global_module_map) global_module_map = g_hash_table_new (g_str_hash, g_str_equal); - res = g_hash_table_lookup (global_module_map, name); + res = (MonoDl *)g_hash_table_lookup (global_module_map, name); if (res) { global_loader_data_unlock (); return res; @@ -1445,7 +1446,7 @@ mono_lookup_pinvoke_call (MonoMethod *method, const char **exc_class, const char if (image_is_dynamic (method->klass->image)) { MonoReflectionMethodAux *method_aux = - g_hash_table_lookup ( + (MonoReflectionMethodAux *)g_hash_table_lookup ( ((MonoDynamicImage*)method->klass->image)->method_aux_hash, method); if (!method_aux) return NULL; @@ -1476,8 +1477,8 @@ mono_lookup_pinvoke_call (MonoMethod *method, const char **exc_class, const char image->pinvoke_scopes = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); image->pinvoke_scope_filenames = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); } - module = g_hash_table_lookup (image->pinvoke_scopes, new_scope); - found_name = g_hash_table_lookup (image->pinvoke_scope_filenames, new_scope); + module = (MonoDl *)g_hash_table_lookup (image->pinvoke_scopes, new_scope); + found_name = (char *)g_hash_table_lookup (image->pinvoke_scope_filenames, new_scope); mono_image_unlock (image); if (module) cached = TRUE; @@ -1865,7 +1866,7 @@ mono_get_method_from_token (MonoImage *image, guint32 token, MonoClass *klass, if (image_is_dynamic (image)) { MonoClass *handle_class; - result = mono_lookup_dynamic_token_class (image, token, TRUE, &handle_class, context); + result = (MonoMethod *)mono_lookup_dynamic_token_class (image, token, TRUE, &handle_class, context); mono_loader_assert_no_error (); // This checks the memberref type as well @@ -1942,6 +1943,7 @@ mono_get_method_from_token (MonoImage *image, guint32 token, MonoClass *klass, if (generic_container) { result->is_generic = TRUE; generic_container->owner.method = result; + generic_container->is_anonymous = FALSE; // Method is now known, container is no longer anonymous /*FIXME put this before the image alloc*/ if (!mono_metadata_load_generic_param_constraints_checked (image, token, generic_container, error)) return NULL; @@ -2010,11 +2012,11 @@ mono_get_method_checked (MonoImage *image, guint32 token, MonoClass *klass, Mono if (mono_metadata_token_table (token) == MONO_TABLE_METHOD) { if (!image->method_cache) image->method_cache = g_hash_table_new (NULL, NULL); - result = g_hash_table_lookup (image->method_cache, GINT_TO_POINTER (mono_metadata_token_index (token))); + result = (MonoMethod *)g_hash_table_lookup (image->method_cache, GINT_TO_POINTER (mono_metadata_token_index (token))); } else if (!image_is_dynamic (image)) { if (!image->methodref_cache) image->methodref_cache = g_hash_table_new (NULL, NULL); - result = g_hash_table_lookup (image->methodref_cache, GINT_TO_POINTER (token)); + result = (MonoMethod *)g_hash_table_lookup (image->methodref_cache, GINT_TO_POINTER (token)); } mono_image_unlock (image); @@ -2031,9 +2033,9 @@ mono_get_method_checked (MonoImage *image, guint32 token, MonoClass *klass, Mono MonoMethod *result2 = NULL; if (mono_metadata_token_table (token) == MONO_TABLE_METHOD) - result2 = g_hash_table_lookup (image->method_cache, GINT_TO_POINTER (mono_metadata_token_index (token))); + result2 = (MonoMethod *)g_hash_table_lookup (image->method_cache, GINT_TO_POINTER (mono_metadata_token_index (token))); else if (!image_is_dynamic (image)) - result2 = g_hash_table_lookup (image->methodref_cache, GINT_TO_POINTER (token)); + result2 = (MonoMethod *)g_hash_table_lookup (image->methodref_cache, GINT_TO_POINTER (token)); if (result2) { mono_image_unlock (image); @@ -2229,7 +2231,7 @@ mono_method_get_param_names (MonoMethod *method, const char **names) if (image_is_dynamic (klass->image)) { MonoReflectionMethodAux *method_aux = - g_hash_table_lookup ( + (MonoReflectionMethodAux *)g_hash_table_lookup ( ((MonoDynamicImage*)method->klass->image)->method_aux_hash, method); if (method_aux && method_aux->param_names) { for (i = 0; i < mono_method_signature (method)->param_count; ++i) @@ -2244,7 +2246,7 @@ mono_method_get_param_names (MonoMethod *method, const char **names) mono_image_lock (klass->image); if (klass->image->wrapper_param_names) - pnames = g_hash_table_lookup (klass->image->wrapper_param_names, method); + pnames = (char **)g_hash_table_lookup (klass->image->wrapper_param_names, method); mono_image_unlock (klass->image); if (pnames) { @@ -2320,7 +2322,7 @@ mono_method_get_marshal_info (MonoMethod *method, MonoMarshalSpec **mspecs) if (image_is_dynamic (method->klass->image)) { MonoReflectionMethodAux *method_aux = - g_hash_table_lookup ( + (MonoReflectionMethodAux *)g_hash_table_lookup ( ((MonoDynamicImage*)method->klass->image)->method_aux_hash, method); if (method_aux && method_aux->param_marshall) { MonoMarshalSpec **dyn_specs = method_aux->param_marshall; @@ -2375,7 +2377,7 @@ mono_method_has_marshal_info (MonoMethod *method) if (image_is_dynamic (method->klass->image)) { MonoReflectionMethodAux *method_aux = - g_hash_table_lookup ( + (MonoReflectionMethodAux *)g_hash_table_lookup ( ((MonoDynamicImage*)method->klass->image)->method_aux_hash, method); MonoMarshalSpec **dyn_specs = method_aux->param_marshall; if (dyn_specs) { @@ -2420,7 +2422,7 @@ mono_method_get_wrapper_data (MonoMethod *method, guint32 id) if (method->is_inflated) method = ((MonoMethodInflated *) method)->declaring; - data = ((MonoMethodWrapper *)method)->method_data; + data = (void **)((MonoMethodWrapper *)method)->method_data; g_assert (data != NULL); g_assert (id <= GPOINTER_TO_UINT (*data)); return data [id]; @@ -2434,7 +2436,7 @@ typedef struct { static gboolean stack_walk_adapter (MonoStackFrameInfo *frame, MonoContext *ctx, gpointer data) { - StackWalkUserData *d = data; + StackWalkUserData *d = (StackWalkUserData *)data; switch (frame->type) { case FRAME_TYPE_DEBUGGER_INVOKE: @@ -2474,7 +2476,7 @@ typedef struct { static gboolean async_stack_walk_adapter (MonoStackFrameInfo *frame, MonoContext *ctx, gpointer data) { - AsyncStackWalkUserData *d = data; + AsyncStackWalkUserData *d = (AsyncStackWalkUserData *)data; switch (frame->type) { case FRAME_TYPE_DEBUGGER_INVOKE: @@ -2515,7 +2517,7 @@ mono_stack_walk_async_safe (MonoStackWalkAsyncSafe func, void *initial_sig_conte static gboolean last_managed (MonoMethod *m, gint no, gint ilo, gboolean managed, gpointer data) { - MonoMethod **dest = data; + MonoMethod **dest = (MonoMethod **)data; *dest = m; /*g_print ("In %s::%s [%d] [%d]\n", m->klass->name, m->name, no, ilo);*/ @@ -2540,10 +2542,7 @@ static gboolean loader_lock_track_ownership = FALSE; void mono_loader_lock (void) { - MONO_TRY_BLOCKING; - mono_locks_acquire (&loader_mutex, LoaderLock); - MONO_FINISH_TRY_BLOCKING; - + mono_locks_coop_acquire (&loader_mutex, LoaderLock); if (G_UNLIKELY (loader_lock_track_ownership)) { mono_native_tls_set_value (loader_lock_nest_id, GUINT_TO_POINTER (GPOINTER_TO_UINT (mono_native_tls_get_value (loader_lock_nest_id)) + 1)); } @@ -2552,7 +2551,7 @@ mono_loader_lock (void) void mono_loader_unlock (void) { - mono_locks_release (&loader_mutex, LoaderLock); + mono_locks_coop_release (&loader_mutex, LoaderLock); if (G_UNLIKELY (loader_lock_track_ownership)) { mono_native_tls_set_value (loader_lock_nest_id, GUINT_TO_POINTER (GPOINTER_TO_UINT (mono_native_tls_get_value (loader_lock_nest_id)) - 1)); } @@ -2671,7 +2670,7 @@ mono_method_signature_checked (MonoMethod *m, MonoError *error) if (can_cache_signature) { mono_image_lock (img); - signature = g_hash_table_lookup (img->method_signatures, sig); + signature = (MonoMethodSignature *)g_hash_table_lookup (img->method_signatures, sig); mono_image_unlock (img); } @@ -2689,7 +2688,7 @@ mono_method_signature_checked (MonoMethod *m, MonoError *error) if (can_cache_signature) { mono_image_lock (img); - sig2 = g_hash_table_lookup (img->method_signatures, sig); + sig2 = (MonoMethodSignature *)g_hash_table_lookup (img->method_signatures, sig); if (!sig2) g_hash_table_insert (img->method_signatures, (gpointer)sig, signature); mono_image_unlock (img); @@ -2715,7 +2714,7 @@ mono_method_signature_checked (MonoMethod *m, MonoError *error) if (m->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) signature->pinvoke = 1; else if (m->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) { - MonoCallConvention conv = 0; + MonoCallConvention conv = (MonoCallConvention)0; MonoMethodPInvoke *piinfo = (MonoMethodPInvoke *)m; signature->pinvoke = 1; @@ -2866,7 +2865,7 @@ mono_method_get_header (MonoMethod *method) container = mono_method_get_generic_container (method); if (!container) container = method->klass->generic_container; - header = mono_metadata_parse_mh_full (img, container, loc); + header = mono_metadata_parse_mh_full (img, container, (const char *)loc); return header; } diff --git a/mono/metadata/locales.c b/mono/metadata/locales.c index 26732679cac..52e97eaca1e 100644 --- a/mono/metadata/locales.c +++ b/mono/metadata/locales.c @@ -60,8 +60,8 @@ static const RegionInfoEntry* region_info_entry_from_lcid (int lcid); static int culture_lcid_locator (const void *a, const void *b) { - const int *lcid = a; - const CultureInfoEntry *bb = b; + const int *lcid = (const int *)a; + const CultureInfoEntry *bb = (const CultureInfoEntry *)b; return *lcid - bb->lcid; } @@ -69,8 +69,8 @@ culture_lcid_locator (const void *a, const void *b) static int culture_name_locator (const void *a, const void *b) { - const char *aa = a; - const CultureInfoNameEntry *bb = b; + const char *aa = (const char *)a; + const CultureInfoNameEntry *bb = (const CultureInfoNameEntry *)b; int ret; ret = strcmp (aa, idx2string (bb->name)); @@ -81,8 +81,8 @@ culture_name_locator (const void *a, const void *b) static int region_name_locator (const void *a, const void *b) { - const char *aa = a; - const RegionInfoNameEntry *bb = b; + const char *aa = (const char *)a; + const RegionInfoNameEntry *bb = (const RegionInfoNameEntry *)b; int ret; ret = strcmp (aa, idx2string (bb->name)); @@ -167,7 +167,7 @@ ves_icall_System_Globalization_CalendarData_fill_calendar_data (MonoCalendarData char *n; n = mono_string_to_utf8 (name); - ne = mono_binary_search (n, culture_name_entries, NUM_CULTURE_ENTRIES, + ne = (const CultureInfoNameEntry *)mono_binary_search (n, culture_name_entries, NUM_CULTURE_ENTRIES, sizeof (CultureInfoNameEntry), culture_name_locator); g_free (n); if (ne == NULL) { @@ -317,7 +317,7 @@ culture_info_entry_from_lcid (int lcid) { const CultureInfoEntry *ci; - ci = mono_binary_search (&lcid, culture_entries, NUM_CULTURE_ENTRIES, sizeof (CultureInfoEntry), culture_lcid_locator); + ci = (const CultureInfoEntry *)mono_binary_search (&lcid, culture_entries, NUM_CULTURE_ENTRIES, sizeof (CultureInfoEntry), culture_lcid_locator); return ci; } @@ -328,7 +328,7 @@ region_info_entry_from_lcid (int lcid) const RegionInfoEntry *entry; const CultureInfoEntry *ne; - ne = mono_binary_search (&lcid, culture_entries, NUM_CULTURE_ENTRIES, sizeof (CultureInfoEntry), culture_lcid_locator); + ne = (const CultureInfoEntry *)mono_binary_search (&lcid, culture_entries, NUM_CULTURE_ENTRIES, sizeof (CultureInfoEntry), culture_lcid_locator); if (ne == NULL) return FALSE; @@ -509,7 +509,7 @@ ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_name ( char *n; n = mono_string_to_utf8 (name); - ne = mono_binary_search (n, culture_name_entries, NUM_CULTURE_ENTRIES, + ne = (const CultureInfoNameEntry *)mono_binary_search (n, culture_name_entries, NUM_CULTURE_ENTRIES, sizeof (CultureInfoNameEntry), culture_name_locator); if (ne == NULL) { @@ -557,7 +557,7 @@ ves_icall_System_Globalization_RegionInfo_construct_internal_region_from_name (M char *n; n = mono_string_to_utf8 (name); - ne = mono_binary_search (n, region_name_entries, NUM_REGION_ENTRIES, + ne = (const RegionInfoNameEntry *)mono_binary_search (n, region_name_entries, NUM_REGION_ENTRIES, sizeof (RegionInfoNameEntry), region_name_locator); if (ne == NULL) { @@ -666,12 +666,12 @@ int ves_icall_System_Threading_Thread_current_lcid (void) return(0x007F); } -MonoString *ves_icall_System_String_InternalReplace_Str_Comp (MonoString *this_obj, MonoString *old, MonoString *new, MonoCompareInfo *comp) +MonoString *ves_icall_System_String_InternalReplace_Str_Comp (MonoString *this_obj, MonoString *old, MonoString *new_, MonoCompareInfo *comp) { /* Do a normal ascii string compare and replace, as we only * know the invariant locale if we dont have ICU */ - return(string_invariant_replace (this_obj, old, new)); + return(string_invariant_replace (this_obj, old, new_)); } static gint32 string_invariant_compare_char (gunichar2 c1, gunichar2 c2, diff --git a/mono/metadata/lock-tracer.c b/mono/metadata/lock-tracer.c index ab39f393b58..f0d2bca6ed4 100644 --- a/mono/metadata/lock-tracer.c +++ b/mono/metadata/lock-tracer.c @@ -31,8 +31,10 @@ * * To log more kind of locks just do the following: * - add an entry into the RuntimeLocks enum - * - change mono_mutex_lock(mutex) to mono_locks_acquire (mutex, LockName) - * - change mono_mutex_unlock to mono_locks_release (mutex, LockName) + * - change mono_os_mutex_lock(mutex) to mono_locks_os_acquire (mutex, LockName) + * - change mono_os_mutex_unlock(mutex) to mono_locks_os_release (mutex, LockName) + * - change mono_coop_mutex_lock(mutex) to mono_locks_coop_acquire (mutex, LockName) + * - change mono_coop_mutex_unlock(mutex) to mono_locks_coop_release (mutex, LockName) * - change the decoder to understand the new lock kind. * * TODO: @@ -71,7 +73,7 @@ mono_locks_tracer_init (void) Dl_info info; int res; char *name; - mono_mutex_init_recursive (&tracer_lock); + mono_os_mutex_init_recursive (&tracer_lock); if (!g_getenv ("MONO_ENABLE_LOCK_TRACER")) return; name = g_strdup_printf ("locks.%d", getpid ()); diff --git a/mono/metadata/lock-tracer.h b/mono/metadata/lock-tracer.h index 7c49bf4f597..ee4ab341950 100644 --- a/mono/metadata/lock-tracer.h +++ b/mono/metadata/lock-tracer.h @@ -4,7 +4,8 @@ /*This is a private header*/ #include -#include "mono/utils/mono-compiler.h" +#include "mono/utils/mono-os-mutex.h" +#include "mono/utils/mono-coop-mutex.h" G_BEGIN_DECLS @@ -39,25 +40,30 @@ void mono_locks_lock_released (RuntimeLocks kind, gpointer lock); #endif -#define mono_locks_acquire(LOCK, NAME) do { \ - mono_mutex_lock (LOCK); \ - mono_locks_lock_acquired (NAME, LOCK); \ -} while (0) - -#define mono_locks_release(LOCK, NAME) do { \ - mono_locks_lock_released (NAME, LOCK); \ - mono_mutex_unlock (LOCK); \ -} while (0) - -#define mono_locks_mutex_acquire(LOCK, NAME) do { \ - mono_mutex_lock (LOCK); \ - mono_locks_lock_acquired (NAME, LOCK); \ -} while (0) - -#define mono_locks_mutex_release(LOCK, NAME) do { \ - mono_locks_lock_released (NAME, LOCK); \ - mono_mutex_unlock (LOCK); \ -} while (0) +#define mono_locks_os_acquire(LOCK,NAME) \ + do { \ + mono_os_mutex_lock (LOCK); \ + mono_locks_lock_acquired (NAME, LOCK); \ + } while (0) + +#define mono_locks_os_release(LOCK,NAME) \ + do { \ + mono_locks_lock_released (NAME, LOCK); \ + mono_os_mutex_unlock (LOCK); \ + } while (0) + +#define mono_locks_coop_acquire(LOCK,NAME) \ + do { \ + mono_coop_mutex_lock (LOCK); \ + mono_locks_lock_acquired (NAME, LOCK); \ + } while (0) + +#define mono_locks_coop_release(LOCK,NAME) \ + do { \ + mono_locks_lock_released (NAME, LOCK); \ + mono_coop_mutex_unlock (LOCK); \ + } while (0) + G_END_DECLS #endif /* __MONO_METADATA_LOCK_TRACER_H__ */ diff --git a/mono/metadata/marshal.c b/mono/metadata/marshal.c index 0e2d8fb6285..83043417540 100644 --- a/mono/metadata/marshal.c +++ b/mono/metadata/marshal.c @@ -66,8 +66,8 @@ enum { * The marshal lock is a non-recursive complex lock that sits below the domain lock in the * runtime locking latice. Which means it can take simple locks suck as the image lock. */ -#define mono_marshal_lock() mono_locks_acquire (&marshal_mutex, MarshalLock) -#define mono_marshal_unlock() mono_locks_release (&marshal_mutex, MarshalLock) +#define mono_marshal_lock() mono_locks_os_acquire (&marshal_mutex, MarshalLock) +#define mono_marshal_unlock() mono_locks_os_release (&marshal_mutex, MarshalLock) static mono_mutex_t marshal_mutex; static gboolean marshal_mutex_initialized; @@ -187,7 +187,7 @@ mono_marshal_init (void) if (!module_initialized) { module_initialized = TRUE; - mono_mutex_init_recursive (&marshal_mutex); + mono_os_mutex_init_recursive (&marshal_mutex); marshal_mutex_initialized = TRUE; register_icall (ves_icall_System_Threading_Thread_ResetAbort, "ves_icall_System_Threading_Thread_ResetAbort", "void", TRUE); @@ -257,7 +257,7 @@ mono_marshal_cleanup (void) mono_native_tls_free (load_type_info_tls_id); mono_native_tls_free (last_error_tls_id); - mono_mutex_destroy (&marshal_mutex); + mono_os_mutex_destroy (&marshal_mutex); marshal_mutex_initialized = FALSE; } @@ -436,7 +436,7 @@ mono_ftnptr_to_delegate (MonoClass *klass, gpointer ftn) else d = NULL; } else { - d = g_hash_table_lookup (delegate_hash_table, ftn); + d = (MonoDelegate *)g_hash_table_lookup (delegate_hash_table, ftn); mono_marshal_unlock (); } if (d == NULL) { @@ -502,11 +502,11 @@ mono_delegate_free_ftnptr (MonoDelegate *delegate) void **method_data; MonoMethod *method; - ji = mono_jit_info_table_find (mono_domain_get (), mono_get_addr_from_ftnptr (ptr)); + ji = mono_jit_info_table_find (mono_domain_get (), (char *)mono_get_addr_from_ftnptr (ptr)); g_assert (ji); method = mono_jit_info_get_method (ji); - method_data = ((MonoMethodWrapper*)method)->method_data; + method_data = (void **)((MonoMethodWrapper*)method)->method_data; /*the target gchandle is the first entry after size and the wrapper itself.*/ gchandle = GPOINTER_TO_UINT (method_data [2]); @@ -580,9 +580,9 @@ mono_array_to_lparray (MonoArray *array) break; case MONO_TYPE_CLASS: nativeArraySize = array->max_length; - nativeArray = malloc(sizeof(gpointer) * nativeArraySize); + nativeArray = (void **)malloc(sizeof(gpointer) * nativeArraySize); for(i = 0; i < nativeArraySize; ++i) - nativeArray[i] = ves_icall_System_Runtime_InteropServices_Marshal_GetIUnknownForObjectInternal(((gpointer*)array->vector)[i]); + nativeArray[i] = ves_icall_System_Runtime_InteropServices_Marshal_GetIUnknownForObjectInternal(((MonoObject **)array->vector)[i]); return nativeArray; case MONO_TYPE_U1: case MONO_TYPE_BOOLEAN: @@ -647,7 +647,7 @@ mono_byvalarray_to_array (MonoArray *arr, gpointer native_arr, MonoClass *elclas guint16 *ut; glong items_written; - ut = g_utf8_to_utf16 (native_arr, elnum, NULL, &items_written, &error); + ut = g_utf8_to_utf16 ((const gchar *)native_arr, elnum, NULL, &items_written, &error); if (!error) { memcpy (mono_array_addr (arr, guint16, 0), ut, items_written * sizeof (guint16)); @@ -847,7 +847,7 @@ mono_string_builder_to_utf8 (MonoStringBuilder *sb) return NULL; } else { guint len = mono_string_builder_capacity (sb) + 1; - gchar *res = mono_marshal_alloc (len * sizeof (gchar)); + gchar *res = (gchar *)mono_marshal_alloc (len * sizeof (gchar)); g_assert (str_len < len); memcpy (res, tmp, str_len * sizeof (gchar)); res[str_len] = '\0'; @@ -882,7 +882,7 @@ mono_string_builder_to_utf16 (MonoStringBuilder *sb) if (len == 0) len = 1; - gunichar2 *str = mono_marshal_alloc ((len + 1) * sizeof (gunichar2)); + gunichar2 *str = (gunichar2 *)mono_marshal_alloc ((len + 1) * sizeof (gunichar2)); str[len] = '\0'; if (len == 0) @@ -1798,7 +1798,7 @@ emit_struct_conv_full (MonoMethodBuilder *mb, MonoClass *klass, gboolean to_obje if (ftype->attrs & FIELD_ATTRIBUTE_STATIC) continue; - ntype = mono_type_to_unmanaged (ftype, info->fields [i].mspec, TRUE, klass->unicode, &conv); + ntype = (MonoMarshalNative)mono_type_to_unmanaged (ftype, info->fields [i].mspec, TRUE, klass->unicode, &conv); if (last_field) { msize = klass->instance_size - info->fields [i].field->offset; @@ -1977,7 +1977,7 @@ emit_struct_conv_full (MonoMethodBuilder *mb, MonoClass *klass, gboolean to_obje static void emit_struct_conv (MonoMethodBuilder *mb, MonoClass *klass, gboolean to_object) { - emit_struct_conv_full (mb, klass, to_object, -1); + emit_struct_conv_full (mb, klass, to_object, (MonoMarshalNative)-1); } static void @@ -2225,7 +2225,7 @@ mono_marshal_get_string_to_ptr_conv (MonoMethodPInvoke *piinfo, MonoMarshalSpec case MONO_NATIVE_BSTR: return MONO_MARSHAL_CONV_STR_BSTR; default: - return -1; + return (MonoMarshalConv)-1; } } @@ -2245,7 +2245,7 @@ mono_marshal_get_stringbuilder_to_ptr_conv (MonoMethodPInvoke *piinfo, MonoMarsh return MONO_MARSHAL_CONV_SB_LPTSTR; break; default: - return -1; + return (MonoMarshalConv)-1; } } @@ -2268,7 +2268,7 @@ mono_marshal_get_ptr_to_string_conv (MonoMethodPInvoke *piinfo, MonoMarshalSpec case MONO_NATIVE_BSTR: return MONO_MARSHAL_CONV_BSTR_STR; default: - return -1; + return (MonoMarshalConv)-1; } } @@ -2294,7 +2294,7 @@ mono_marshal_get_ptr_to_stringbuilder_conv (MonoMethodPInvoke *piinfo, MonoMarsh return MONO_MARSHAL_CONV_LPTSTR_SB; break; default: - return -1; + return (MonoMarshalConv)-1; } } @@ -2358,7 +2358,7 @@ mono_marshal_find_in_cache (GHashTable *cache, gpointer key) MonoMethod *res; mono_marshal_lock (); - res = g_hash_table_lookup (cache, key); + res = (MonoMethod *)g_hash_table_lookup (cache, key); mono_marshal_unlock (); return res; } @@ -2392,13 +2392,13 @@ mono_mb_create_and_cache_full (GHashTable *cache, gpointer key, *out_found = FALSE; mono_marshal_lock (); - res = g_hash_table_lookup (cache, key); + res = (MonoMethod *)g_hash_table_lookup (cache, key); mono_marshal_unlock (); if (!res) { MonoMethod *newm; newm = mono_mb_create_method (mb, sig, max_stack); mono_marshal_lock (); - res = g_hash_table_lookup (cache, key); + res = (MonoMethod *)g_hash_table_lookup (cache, key); if (!res) { res = newm; g_hash_table_insert (cache, key, res); @@ -2489,7 +2489,7 @@ mono_marshal_get_wrapper_info (MonoMethod *wrapper) { g_assert (wrapper->wrapper_type); - return mono_method_get_wrapper_data (wrapper, 1); + return (WrapperInfo *)mono_method_get_wrapper_data (wrapper, 1); } /* @@ -2506,7 +2506,7 @@ mono_marshal_set_wrapper_info (MonoMethod *method, WrapperInfo *info) if (method->wrapper_type == MONO_WRAPPER_NONE || method->wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD) return; - datav = ((MonoMethodWrapper *)method)->method_data; + datav = (void **)((MonoMethodWrapper *)method)->method_data; datav [1] = info; } @@ -2515,7 +2515,7 @@ mono_wrapper_info_create (MonoMethodBuilder *mb, WrapperSubtype subtype) { WrapperInfo *info; - info = mono_image_alloc0 (mb->method->klass->image, sizeof (WrapperInfo)); + info = (WrapperInfo *)mono_image_alloc0 (mb->method->klass->image, sizeof (WrapperInfo)); info->subtype = subtype; return info; } @@ -2595,7 +2595,7 @@ check_generic_wrapper_cache (GHashTable *cache, MonoMethod *orig_method, gpointe /* Cache it */ mono_memory_barrier (); mono_marshal_lock (); - res = g_hash_table_lookup (cache, key); + res = (MonoMethod *)g_hash_table_lookup (cache, key); if (!res) { g_hash_table_insert (cache, key, inst); res = inst; @@ -2619,7 +2619,7 @@ cache_generic_wrapper (GHashTable *cache, MonoMethod *orig_method, MonoMethod *d g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */ mono_memory_barrier (); mono_marshal_lock (); - res = g_hash_table_lookup (cache, key); + res = (MonoMethod *)g_hash_table_lookup (cache, key); if (!res) { g_hash_table_insert (cache, key, inst); res = inst; @@ -2653,7 +2653,7 @@ check_generic_delegate_wrapper_cache (GHashTable *cache, MonoMethod *orig_method /* Cache it */ mono_memory_barrier (); mono_marshal_lock (); - res = g_hash_table_lookup (cache, orig_method->klass); + res = (MonoMethod *)g_hash_table_lookup (cache, orig_method->klass); if (!res) { g_hash_table_insert (cache, orig_method->klass, inst); res = inst; @@ -2678,7 +2678,7 @@ cache_generic_delegate_wrapper (GHashTable *cache, MonoMethod *orig_method, Mono mono_memory_barrier (); mono_marshal_lock (); - res = g_hash_table_lookup (cache, orig_method->klass); + res = (MonoMethod *)g_hash_table_lookup (cache, orig_method->klass); if (!res) { g_hash_table_insert (cache, orig_method->klass, inst); res = inst; @@ -2790,7 +2790,7 @@ mono_delegate_end_invoke (MonoDelegate *delegate, gpointer *params) msg = mono_method_call_message_new (method, params, NULL, NULL, NULL); - ares = mono_array_get (msg->args, gpointer, sig->param_count - 1); + ares = (MonoAsyncResult *)mono_array_get (msg->args, gpointer, sig->param_count - 1); if (ares == NULL) { mono_raise_exception (mono_exception_from_name_msg (mono_defaults.corlib, "System.Runtime.Remoting", "RemotingException", "The async result object is null or of an unexpected type.")); return NULL; @@ -3017,7 +3017,7 @@ sig_to_rgctx_sig (MonoMethodSignature *sig) MonoMethodSignature *res; int i; - res = g_malloc (MONO_SIZEOF_METHOD_SIGNATURE + (sig->param_count + 1) * sizeof (MonoType*)); + res = (MonoMethodSignature *)g_malloc (MONO_SIZEOF_METHOD_SIGNATURE + (sig->param_count + 1) * sizeof (MonoType*)); memcpy (res, sig, MONO_SIZEOF_METHOD_SIGNATURE); res->param_count = sig->param_count + 1; for (i = 0; i < sig->param_count; ++i) @@ -3130,7 +3130,7 @@ mono_marshal_get_delegate_invoke_internal (MonoMethod *method, gboolean callvirt cache = *cache_ptr; key.sig = invoke_sig; key.pointer = target_method; - res = g_hash_table_lookup (cache, &key); + res = (MonoMethod *)g_hash_table_lookup (cache, &key); mono_marshal_unlock (); if (res) return res; @@ -3455,7 +3455,7 @@ lookup_string_ctor_signature (MonoMethodSignature *sig) mono_marshal_lock (); callsig = NULL; for (item = strsig_list; item; item = item->next) { - cs = item->data; + cs = (CtorSigPair *)item->data; /* mono_metadata_signature_equal () is safe to call with the marshal lock * because it is lock-free. */ @@ -3590,7 +3590,7 @@ static void emit_invoke_call (MonoMethodBuilder *mb, MonoMethod *method, MonoMethodSignature *sig, MonoMethodSignature *callsig, int loc_res, - gboolean virtual, gboolean need_direct_wrapper) + gboolean virtual_, gboolean need_direct_wrapper) { static MonoString *string_dummy = NULL; int i; @@ -3603,7 +3603,7 @@ emit_invoke_call (MonoMethodBuilder *mb, MonoMethod *method, string_dummy = mono_string_new_wrapper ("dummy"); } - if (virtual) { + if (virtual_) { g_assert (sig->hasthis); g_assert (method->flags & METHOD_ATTRIBUTE_VIRTUAL); } @@ -3703,7 +3703,7 @@ handle_enum: } } - if (virtual) { + if (virtual_) { mono_mb_emit_op (mb, CEE_CALLVIRT, method); } else if (need_direct_wrapper) { mono_mb_emit_op (mb, CEE_CALL, method); @@ -3786,7 +3786,7 @@ handle_enum: static void emit_runtime_invoke_body (MonoMethodBuilder *mb, MonoClass *target_klass, MonoMethod *method, MonoMethodSignature *sig, MonoMethodSignature *callsig, - gboolean virtual, gboolean need_direct_wrapper) + gboolean virtual_, gboolean need_direct_wrapper) { gint32 labels [16]; MonoExceptionClause *clause; @@ -3821,12 +3821,12 @@ emit_runtime_invoke_body (MonoMethodBuilder *mb, MonoClass *target_klass, MonoMe */ labels [1] = mono_mb_get_label (mb); emit_thread_force_interrupt_checkpoint (mb); - emit_invoke_call (mb, method, sig, callsig, loc_res, virtual, need_direct_wrapper); + emit_invoke_call (mb, method, sig, callsig, loc_res, virtual_, need_direct_wrapper); labels [2] = mono_mb_emit_branch (mb, CEE_LEAVE); /* Add a try clause around the call */ - clause = mono_image_alloc0 (target_klass->image, sizeof (MonoExceptionClause)); + clause = (MonoExceptionClause *)mono_image_alloc0 (target_klass->image, sizeof (MonoExceptionClause)); clause->flags = MONO_EXCEPTION_CLAUSE_NONE; clause->data.catch_class = mono_defaults.exception_class; clause->try_offset = labels [1]; @@ -3855,7 +3855,7 @@ emit_runtime_invoke_body (MonoMethodBuilder *mb, MonoClass *target_klass, MonoMe */ mono_mb_patch_branch (mb, labels [0]); emit_thread_force_interrupt_checkpoint (mb); - emit_invoke_call (mb, method, sig, callsig, loc_res, virtual, need_direct_wrapper); + emit_invoke_call (mb, method, sig, callsig, loc_res, virtual_, need_direct_wrapper); mono_mb_emit_ldloc (mb, 0); mono_mb_emit_byte (mb, CEE_RET); @@ -3875,7 +3875,7 @@ emit_runtime_invoke_body (MonoMethodBuilder *mb, MonoClass *target_klass, MonoMe * first argument (after 'this'). */ MonoMethod * -mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual, gboolean pass_rgctx) +mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual_, gboolean pass_rgctx) { MonoMethodSignature *sig, *csig, *callsig; MonoMethodBuilder *mb; @@ -3901,14 +3901,14 @@ mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual, gboolean finalize_signature->hasthis = 1; } - if (virtual) + if (virtual_) need_direct_wrapper = TRUE; /* * Use a separate cache indexed by methods to speed things up and to avoid the * boundless mempool growth caused by the signature_dup stuff below. */ - if (virtual) + if (virtual_) cache = get_cache (&method->klass->image->runtime_invoke_vcall_cache, mono_aligned_addr_hash, NULL); else cache = get_cache (&mono_method_get_wrapper_cache (method)->runtime_invoke_direct_cache, mono_aligned_addr_hash, NULL); @@ -3975,7 +3975,7 @@ mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual, gboolean /* from mono_marshal_find_in_cache */ mono_marshal_lock (); - res = g_hash_table_lookup (cache, callsig); + res = (MonoMethod *)g_hash_table_lookup (cache, callsig); mono_marshal_unlock (); if (res) { @@ -4005,7 +4005,7 @@ mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual, gboolean csig->call_convention = MONO_CALL_C; #endif - name = mono_signature_to_name (callsig, pass_rgctx ? (virtual ? "runtime_invoke_virtual_rgctx" : "runtime_invoke_rgctx") : (virtual ? "runtime_invoke_virtual" : "runtime_invoke")); + name = mono_signature_to_name (callsig, pass_rgctx ? (virtual_ ? "runtime_invoke_virtual_rgctx" : "runtime_invoke_rgctx") : (virtual_ ? "runtime_invoke_virtual" : "runtime_invoke")); mb = mono_mb_new (target_klass, name, MONO_WRAPPER_RUNTIME_INVOKE); g_free (name); @@ -4016,20 +4016,20 @@ mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual, gboolean param_names [3] = "method"; mono_mb_set_param_names (mb, param_names); - emit_runtime_invoke_body (mb, target_klass, method, sig, callsig, virtual, need_direct_wrapper); + emit_runtime_invoke_body (mb, target_klass, method, sig, callsig, virtual_, need_direct_wrapper); #endif if (need_direct_wrapper) { #ifndef DISABLE_JIT mb->skip_visibility = 1; #endif - info = mono_wrapper_info_create (mb, virtual ? WRAPPER_SUBTYPE_RUNTIME_INVOKE_VIRTUAL : WRAPPER_SUBTYPE_RUNTIME_INVOKE_DIRECT); + info = mono_wrapper_info_create (mb, virtual_ ? WRAPPER_SUBTYPE_RUNTIME_INVOKE_VIRTUAL : WRAPPER_SUBTYPE_RUNTIME_INVOKE_DIRECT); info->d.runtime_invoke.method = method; res = mono_mb_create_and_cache_full (cache, method, mb, csig, sig->param_count + 16, info, NULL); } else { /* taken from mono_mb_create_and_cache */ mono_marshal_lock (); - res = g_hash_table_lookup (cache, callsig); + res = (MonoMethod *)g_hash_table_lookup (cache, callsig); mono_marshal_unlock (); info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_RUNTIME_INVOKE_NORMAL); @@ -4042,7 +4042,7 @@ mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual, gboolean newm = mono_mb_create (mb, csig, sig->param_count + 16, info); mono_marshal_lock (); - res = g_hash_table_lookup (cache, callsig); + res = (MonoMethod *)g_hash_table_lookup (cache, callsig); if (!res) { GHashTable *direct_cache; res = newm; @@ -4129,7 +4129,7 @@ mono_marshal_get_runtime_invoke_dynamic (void) pos = mono_mb_emit_branch (mb, CEE_LEAVE); - clause = mono_image_alloc0 (mono_defaults.corlib, sizeof (MonoExceptionClause)); + clause = (MonoExceptionClause *)mono_image_alloc0 (mono_defaults.corlib, sizeof (MonoExceptionClause)); clause->flags = MONO_EXCEPTION_CLAUSE_FILTER; clause->try_len = mono_mb_get_label (mb); @@ -6007,7 +6007,7 @@ emit_marshal_array (EmitMarshalContext *m, int argnum, MonoType *t, conv = mono_marshal_get_stringbuilder_to_ptr_conv (m->piinfo, spec); } else - conv = -1; + conv = (MonoMarshalConv)-1; if (is_string && conv == -1) { char *msg = g_strdup_printf ("string/stringbuilder marshalling conversion %d not implemented", encoding); @@ -6083,7 +6083,7 @@ emit_marshal_array (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_emit_stloc (mb, 1); /* emit valuetype conversion code */ - emit_struct_conv_full (mb, eklass, FALSE, eklass == mono_defaults.char_class ? encoding : -1); + emit_struct_conv_full (mb, eklass, FALSE, eklass == mono_defaults.char_class ? encoding : (MonoMarshalNative)-1); } mono_mb_emit_add_to_local (mb, index_var, 1); @@ -6228,7 +6228,7 @@ emit_marshal_array (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_emit_stloc (mb, 1); /* emit valuetype conversion code */ - emit_struct_conv_full (mb, eklass, TRUE, eklass == mono_defaults.char_class ? encoding : -1); + emit_struct_conv_full (mb, eklass, TRUE, eklass == mono_defaults.char_class ? encoding : (MonoMarshalNative)-1); } if (need_free) { @@ -6328,7 +6328,7 @@ emit_marshal_array (EmitMarshalContext *m, int argnum, MonoType *t, conv = mono_marshal_get_ptr_to_stringbuilder_conv (m->piinfo, spec, &need_free); } else - conv = -1; + conv = (MonoMarshalConv)-1; mono_marshal_load_type_info (eklass); @@ -6491,7 +6491,7 @@ emit_marshal_array (EmitMarshalContext *m, int argnum, MonoType *t, conv = mono_marshal_get_stringbuilder_to_ptr_conv (m->piinfo, spec); } else - conv = -1; + conv = (MonoMarshalConv)-1; mono_marshal_load_type_info (eklass); @@ -6573,7 +6573,7 @@ emit_marshal_array (EmitMarshalContext *m, int argnum, MonoType *t, MonoClass *eklass; guint32 label1, label2, label3; int index_var, src, dest, esize; - MonoMarshalConv conv = -1; + MonoMarshalConv conv = (MonoMarshalConv)-1; gboolean is_string = FALSE; g_assert (!t->byref); @@ -7131,8 +7131,8 @@ mono_marshal_emit_native_wrapper (MonoImage *image, MonoMethodBuilder *mb, MonoM } /* we first do all conversions */ - tmp_locals = alloca (sizeof (int) * sig->param_count); - m.orig_conv_args = alloca (sizeof (int) * (sig->param_count + 1)); + tmp_locals = (int *)alloca (sizeof (int) * sig->param_count); + m.orig_conv_args = (int *)alloca (sizeof (int) * (sig->param_count + 1)); for (i = 0; i < sig->param_count; i ++) { tmp_locals [i] = emit_marshal (&m, i + param_shift, sig->params [i], mspecs [i + 1], 0, &csig->params [i], MARSHAL_ACTION_CONV_IN); @@ -7755,7 +7755,7 @@ mono_marshal_emit_managed_wrapper (MonoMethodBuilder *mb, MonoMethodSignature *i } /* we first do all conversions */ - tmp_locals = alloca (sizeof (int) * sig->param_count); + tmp_locals = (int *)alloca (sizeof (int) * sig->param_count); for (i = 0; i < sig->param_count; i ++) { MonoType *t = sig->params [i]; @@ -8874,7 +8874,7 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method) this_local = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); taken_local = mono_mb_add_local (mb, &mono_defaults.boolean_class->byval_arg); - clause = mono_image_alloc0 (method->klass->image, sizeof (MonoExceptionClause)); + clause = (MonoExceptionClause *)mono_image_alloc0 (method->klass->image, sizeof (MonoExceptionClause)); clause->flags = MONO_EXCEPTION_CLAUSE_FINALLY; #endif @@ -9517,7 +9517,7 @@ mono_marshal_get_virtual_stelemref_wrappers (int *nwrappers) int i; *nwrappers = STELEMREF_KIND_COUNT; - res = g_malloc0 (STELEMREF_KIND_COUNT * sizeof (MonoMethod*)); + res = (MonoMethod **)g_malloc0 (STELEMREF_KIND_COUNT * sizeof (MonoMethod*)); for (i = 0; i < STELEMREF_KIND_COUNT; ++i) res [i] = get_virtual_stelemref_wrapper (i); return res; @@ -10062,7 +10062,7 @@ mono_marshal_string_to_utf16_copy (MonoString *s) if (s == NULL) { return NULL; } else { - gunichar2 *res = mono_marshal_alloc ((mono_string_length (s) * 2) + 2); + gunichar2 *res = (gunichar2 *)mono_marshal_alloc ((mono_string_length (s) * 2) + 2); memcpy (res, mono_string_chars (s), mono_string_length (s) * 2); res [mono_string_length (s)] = 0; return res; @@ -10420,7 +10420,7 @@ ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni (MonoString gunichar2 *res = ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal ((mono_string_length (string) + 1) * 2); #else - gunichar2 *res = g_malloc ((mono_string_length (string) + 1) * 2); + gunichar2 *res = (gunichar2 *)g_malloc ((mono_string_length (string) + 1) * 2); #endif memcpy (res, mono_string_chars (string), mono_string_length (string) * 2); res [mono_string_length (string)] = 0; @@ -10619,7 +10619,7 @@ ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerIn static gboolean mono_marshal_is_loading_type_info (MonoClass *klass) { - GSList *loads_list = mono_native_tls_get_value (load_type_info_tls_id); + GSList *loads_list = (GSList *)mono_native_tls_get_value (load_type_info_tls_id); return g_slist_find (loads_list, klass) != NULL; } @@ -10660,7 +10660,7 @@ mono_marshal_load_type_info (MonoClass* klass) * under initialization in a TLS list. */ g_assert (!mono_marshal_is_loading_type_info (klass)); - loads_list = mono_native_tls_get_value (load_type_info_tls_id); + loads_list = (GSList *)mono_native_tls_get_value (load_type_info_tls_id); loads_list = g_slist_prepend (loads_list, klass); mono_native_tls_set_value (load_type_info_tls_id, loads_list); @@ -10676,7 +10676,7 @@ mono_marshal_load_type_info (MonoClass* klass) layout = klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK; /* The mempool is protected by the loader lock */ - info = mono_image_alloc0 (klass->image, MONO_SIZEOF_MARSHAL_TYPE + sizeof (MonoMarshalField) * count); + info = (MonoMarshalType *)mono_image_alloc0 (klass->image, MONO_SIZEOF_MARSHAL_TYPE + sizeof (MonoMarshalField) * count); info->num_fields = count; /* Try to find a size for this type in metadata */ @@ -10767,7 +10767,7 @@ mono_marshal_load_type_info (MonoClass* klass) mono_marshal_load_type_info (klass->element_class); } - loads_list = mono_native_tls_get_value (load_type_info_tls_id); + loads_list = (GSList *)mono_native_tls_get_value (load_type_info_tls_id); loads_list = g_slist_remove (loads_list, klass); mono_native_tls_set_value (load_type_info_tls_id, loads_list); @@ -11103,7 +11103,7 @@ mono_marshal_free_asany (MonoObject *o, gpointer ptr, MonoMarshalNative string_e } if (!((param_attrs & PARAM_ATTRIBUTE_OUT) && !(param_attrs & PARAM_ATTRIBUTE_IN))) { - mono_struct_delete_old (klass, ptr); + mono_struct_delete_old (klass, (char *)ptr); } mono_marshal_free (ptr); @@ -11297,7 +11297,7 @@ mono_marshal_get_thunk_invoke_wrapper (MonoMethod *method) } /* try */ - clause = mono_image_alloc0 (image, sizeof (MonoExceptionClause)); + clause = (MonoExceptionClause *)mono_image_alloc0 (image, sizeof (MonoExceptionClause)); clause->try_offset = mono_mb_get_label (mb); /* push method's args */ diff --git a/mono/metadata/mempool.c b/mono/metadata/mempool.c index 0cc8ca036c1..abbdbdbace3 100644 --- a/mono/metadata/mempool.c +++ b/mono/metadata/mempool.c @@ -107,7 +107,7 @@ mono_mempool_new_size (int initial_size) initial_size = MONO_MEMPOOL_MINSIZE; #endif - pool = g_malloc (initial_size); + pool = (MonoMemPool *)g_malloc (initial_size); pool->next = NULL; pool->pos = (guint8*)pool + SIZEOF_MEM_POOL; // Start after header @@ -202,11 +202,11 @@ mono_backtrace (int size) static gboolean inited; if (!inited) { - mono_mutex_init_recursive (&mempool_tracing_lock); + mono_os_mutex_init_recursive (&mempool_tracing_lock); inited = TRUE; } - mono_mutex_lock (&mempool_tracing_lock); + mono_os_mutex_lock (&mempool_tracing_lock); g_print ("Allocating %d bytes\n", size); symbols = backtrace (array, BACKTRACE_DEPTH); names = backtrace_symbols (array, symbols); @@ -214,7 +214,7 @@ mono_backtrace (int size) g_print ("\t%s\n", names [i]); } free (names); - mono_mutex_unlock (&mempool_tracing_lock); + mono_os_mutex_unlock (&mempool_tracing_lock); } #endif @@ -277,7 +277,7 @@ mono_mempool_alloc (MonoMemPool *pool, guint size) // (In individual allocation mode, the constant will be 0 and this path will always be taken) if (size >= MONO_MEMPOOL_PREFER_INDIVIDUAL_ALLOCATION_SIZE) { guint new_size = SIZEOF_MEM_POOL + size; - MonoMemPool *np = g_malloc (new_size); + MonoMemPool *np = (MonoMemPool *)g_malloc (new_size); np->next = pool->next; np->size = new_size; @@ -289,7 +289,7 @@ mono_mempool_alloc (MonoMemPool *pool, guint size) } else { // Notice: any unused memory at the end of the old head becomes simply abandoned in this case until the mempool is freed (see Bugzilla #35136) guint new_size = get_next_size (pool, size); - MonoMemPool *np = g_malloc (new_size); + MonoMemPool *np = (MonoMemPool *)g_malloc (new_size); np->next = pool->next; np->size = new_size; @@ -373,7 +373,7 @@ mono_mempool_strdup (MonoMemPool *pool, return NULL; l = strlen (s); - res = mono_mempool_alloc (pool, l + 1); + res = (char *)mono_mempool_alloc (pool, l + 1); memcpy (res, s, l + 1); return res; diff --git a/mono/metadata/metadata-internals.h b/mono/metadata/metadata-internals.h index 710cdf0b502..30c3fb07a60 100644 --- a/mono/metadata/metadata-internals.h +++ b/mono/metadata/metadata-internals.h @@ -389,6 +389,11 @@ struct _MonoImage { /* The loader used to load this image */ MonoImageLoader *loader; + // Containers for MonoGenericParams associated with this image but not with any specific class or method. Created on demand. + // This could happen, for example, for MonoTypes associated with TypeSpec table entries. + MonoGenericContainer *anonymous_generic_class_container; + MonoGenericContainer *anonymous_generic_method_container; + /* * No other runtime locks must be taken while holding this lock. * It's meant to be used only to mutate and query structures part of this image. @@ -899,5 +904,14 @@ mono_method_get_wrapper_cache (MonoMethod *method); MonoType* mono_metadata_parse_type_checked (MonoImage *m, MonoGenericContainer *container, short opt_attrs, gboolean transient, const char *ptr, const char **rptr, MonoError *error); +MonoGenericContainer * +get_anonymous_container_for_image (MonoImage *image, gboolean is_mvar); + +char * +mono_image_set_description (MonoImageSet *); + +MonoImageSet * +mono_find_image_set_owner (void *ptr); + #endif /* __MONO_METADATA_INTERNALS_H__ */ diff --git a/mono/metadata/metadata-verify.c b/mono/metadata/metadata-verify.c index 1a1597f6ca7..65f3bba5686 100644 --- a/mono/metadata/metadata-verify.c +++ b/mono/metadata/metadata-verify.c @@ -332,7 +332,7 @@ bounds_check_virtual_address (VerifyContext *ctx, guint32 rva, guint32 size) return FALSE; if (ctx->stage > STAGE_PE) { - MonoCLIImageInfo *iinfo = ctx->image->image_info; + MonoCLIImageInfo *iinfo = (MonoCLIImageInfo *)ctx->image->image_info; const int top = iinfo->cli_section_count; MonoSectionTable *tables = iinfo->cli_section_tables; int i; @@ -689,7 +689,7 @@ verify_resources_table (VerifyContext *ctx) static DataDirectory get_data_dir (VerifyContext *ctx, int idx) { - MonoCLIImageInfo *iinfo = ctx->image->image_info; + MonoCLIImageInfo *iinfo = (MonoCLIImageInfo *)ctx->image->image_info; MonoPEDirEntry *entry= &iinfo->cli_header.datadir.pe_export_table; DataDirectory res; @@ -1069,7 +1069,7 @@ search_sorted_table (VerifyContext *ctx, int table, int column, guint32 coded_to base = tinfo->base; VERIFIER_DEBUG ( printf ("looking token %x table %d col %d rsize %d roff %d\n", coded_token, table, column, locator.col_size, locator.col_offset) ); - res = mono_binary_search (&locator, base, tinfo->rows, tinfo->row_size, token_locator); + res = (const char *)mono_binary_search (&locator, base, tinfo->rows, tinfo->row_size, token_locator); if (!res) return -1; @@ -1787,7 +1787,7 @@ get_enum_by_encoded_name (VerifyContext *ctx, const char **_ptr, const char *end return NULL; } - enum_name = g_memdup (str_start, str_len + 1); + enum_name = (char *)g_memdup (str_start, str_len + 1); enum_name [str_len] = 0; type = mono_reflection_type_from_name (enum_name, ctx->image); if (!type) { @@ -1881,7 +1881,7 @@ handle_enum: } else if (etype == 0x50 || etype == MONO_TYPE_CLASS) { klass = mono_defaults.systemtype_class; } else if ((etype >= MONO_TYPE_BOOLEAN && etype <= MONO_TYPE_STRING) || etype == 0x51) { - simple_type.type = etype == 0x51 ? MONO_TYPE_OBJECT : etype; + simple_type.type = etype == 0x51 ? MONO_TYPE_OBJECT : (MonoTypeEnum)etype; klass = mono_class_from_mono_type (&simple_type); } else FAIL (ctx, g_strdup_printf ("CustomAttribute: Invalid array element type %x", etype)); @@ -1986,7 +1986,7 @@ is_valid_cattr_content (VerifyContext *ctx, MonoMethod *ctor, const char *ptr, g FAIL (ctx, g_strdup_printf ("CustomAttribute: Not enough space for named parameter %d type", i)); if (kind >= MONO_TYPE_BOOLEAN && kind <= MONO_TYPE_STRING) { - simple_type.type = kind; + simple_type.type = (MonoTypeEnum)kind; type = &simple_type; } else if (kind == MONO_TYPE_ENUM) { MonoClass *klass = get_enum_by_encoded_name (ctx, &ptr, end); @@ -2010,7 +2010,7 @@ is_valid_cattr_content (VerifyContext *ctx, MonoMethod *ctor, const char *ptr, g } else if (etype == 0x50 || etype == MONO_TYPE_CLASS) { klass = mono_defaults.systemtype_class; } else if ((etype >= MONO_TYPE_BOOLEAN && etype <= MONO_TYPE_STRING) || etype == 0x51) { - simple_type.type = etype == 0x51 ? MONO_TYPE_OBJECT : etype; + simple_type.type = etype == 0x51 ? MONO_TYPE_OBJECT : (MonoTypeEnum)etype; klass = mono_class_from_mono_type (&simple_type); } else FAIL (ctx, g_strdup_printf ("CustomAttribute: Invalid array element type %x", etype)); @@ -3487,7 +3487,7 @@ verify_exportedtype_table (VerifyContext *ctx) static void verify_manifest_resource_table (VerifyContext *ctx) { - MonoCLIImageInfo *iinfo = ctx->image->image_info; + MonoCLIImageInfo *iinfo = (MonoCLIImageInfo *)ctx->image->image_info; MonoCLIHeader *ch = &iinfo->cli_cli_header; MonoTableInfo *table = &ctx->image->tables [MONO_TABLE_MANIFESTRESOURCE]; guint32 data [MONO_MANIFEST_SIZE], impl_table, token, resources_size; @@ -3662,15 +3662,15 @@ typedef struct { static guint typedef_hash (gconstpointer _key) { - const TypeDefUniqueId *key = _key; + const TypeDefUniqueId *key = (const TypeDefUniqueId *)_key; return g_str_hash (key->name) ^ g_str_hash (key->name_space) ^ key->resolution_scope; /*XXX better salt the int key*/ } static gboolean typedef_equals (gconstpointer _a, gconstpointer _b) { - const TypeDefUniqueId *a = _a; - const TypeDefUniqueId *b = _b; + const TypeDefUniqueId *a = (const TypeDefUniqueId *)_a; + const TypeDefUniqueId *b = (const TypeDefUniqueId *)_b; return !strcmp (a->name, b->name) && !strcmp (a->name_space, b->name_space) && a->resolution_scope == b->resolution_scope; } @@ -3878,7 +3878,7 @@ cleanup_context_checked (VerifyContext *ctx, MonoError *error) { g_free (ctx->sections); if (ctx->errors) { - MonoVerifyInfo *info = ctx->errors->data; + MonoVerifyInfo *info = (MonoVerifyInfo *)ctx->errors->data; mono_error_set_bad_image (error, ctx->image, "%s", info->message); mono_free_verify_list (ctx->errors); } diff --git a/mono/metadata/metadata.c b/mono/metadata/metadata.c index 1f74ab9debc..e50ad0288c9 100644 --- a/mono/metadata/metadata.c +++ b/mono/metadata/metadata.c @@ -28,6 +28,7 @@ #include "abi-details.h" #include #include +#include /* Auxiliary structure used for caching inflated signatures */ typedef struct { @@ -1332,19 +1333,19 @@ mono_metadata_parse_array_internal (MonoImage *m, MonoGenericContainer *containe if (!etype) return NULL; - array = transient ? g_malloc0 (sizeof (MonoArrayType)) : mono_image_alloc0 (m, sizeof (MonoArrayType)); + array = transient ? (MonoArrayType *)g_malloc0 (sizeof (MonoArrayType)) : (MonoArrayType *)mono_image_alloc0 (m, sizeof (MonoArrayType)); array->eklass = mono_class_from_mono_type (etype); array->rank = mono_metadata_decode_value (ptr, &ptr); array->numsizes = mono_metadata_decode_value (ptr, &ptr); if (array->numsizes) - array->sizes = transient ? g_malloc0 (sizeof (int) * array->numsizes) : mono_image_alloc0 (m, sizeof (int) * array->numsizes); + array->sizes = transient ? (int *)g_malloc0 (sizeof (int) * array->numsizes) : (int *)mono_image_alloc0 (m, sizeof (int) * array->numsizes); for (i = 0; i < array->numsizes; ++i) array->sizes [i] = mono_metadata_decode_value (ptr, &ptr); array->numlobounds = mono_metadata_decode_value (ptr, &ptr); if (array->numlobounds) - array->lobounds = transient ? g_malloc0 (sizeof (int) * array->numlobounds) : mono_image_alloc0 (m, sizeof (int) * array->numlobounds); + array->lobounds = transient ? (int *)g_malloc0 (sizeof (int) * array->numlobounds) : (int *)mono_image_alloc0 (m, sizeof (int) * array->numlobounds); for (i = 0; i < array->numlobounds; ++i) array->lobounds [i] = mono_metadata_decode_signed_value (ptr, &ptr); @@ -1492,10 +1493,14 @@ mono_generic_inst_equal_full (const MonoGenericInst *a, const MonoGenericInst *b { int i; -#ifndef MONO_SMALL_CONFIG - if (a->id && b->id) { + // An optimization: if the ids of two insts are the same, we know they are the same inst and don't check contents. + // Furthermore, because we perform early de-duping, if the ids differ, we know the contents differ. +#ifndef MONO_SMALL_CONFIG // Optimization does not work in MONO_SMALL_CONFIG: There are no IDs + if (a->id && b->id) { // "id 0" means "object has no id"-- de-duping hasn't been performed yet, must check contents. if (a->id == b->id) return TRUE; + // In signature-comparison mode id equality implies object equality, but this is not true for inequality. + // Two separate objects could have signature-equavalent contents. if (!signature_only) return FALSE; } @@ -1557,7 +1562,7 @@ mono_metadata_init (void) for (i = 0; i < NBUILTIN_TYPES (); ++i) g_hash_table_insert (type_cache, (gpointer) &builtin_types [i], (gpointer) &builtin_types [i]); - mono_mutex_init_recursive (&image_sets_mutex); + mono_os_mutex_init_recursive (&image_sets_mutex); } /** @@ -1573,7 +1578,7 @@ mono_metadata_cleanup (void) type_cache = NULL; g_ptr_array_free (image_sets, TRUE); image_sets = NULL; - mono_mutex_destroy (&image_sets_mutex); + mono_os_mutex_destroy (&image_sets_mutex); } /** @@ -1611,7 +1616,7 @@ mono_metadata_parse_type_internal (MonoImage *m, MonoGenericContainer *container gboolean byref = FALSE; gboolean pinned = FALSE; const char *tmp_ptr; - int count = 0; + int count = 0; // Number of mod arguments gboolean found; /* @@ -1645,20 +1650,20 @@ mono_metadata_parse_type_internal (MonoImage *m, MonoGenericContainer *container } } - if (count) { + if (count) { // There are mods, so the MonoType will be of nonstandard size. int size; size = MONO_SIZEOF_TYPE + ((gint32)count) * sizeof (MonoCustomMod); - type = transient ? g_malloc0 (size) : mono_image_alloc0 (m, size); + type = transient ? (MonoType *)g_malloc0 (size) : (MonoType *)mono_image_alloc0 (m, size); type->num_mods = count; if (count > 64) g_warning ("got more than 64 modifiers in type"); - } else { + } else { // The type is of standard size, so we can allocate it on the stack. type = &stype; memset (type, 0, MONO_SIZEOF_TYPE); } - /* Parse pinned, byref and custom modifiers */ + /* Iterate again, but now parse pinned, byref and custom modifiers */ found = TRUE; count = 0; while (found) { @@ -1694,6 +1699,7 @@ mono_metadata_parse_type_internal (MonoImage *m, MonoGenericContainer *container if (rptr) *rptr = ptr; + // Possibly we can return an already-allocated type instead of the one we decoded if (!type->num_mods && !transient) { /* no need to free type here, because it is on the stack */ if ((type->type == MONO_TYPE_CLASS || type->type == MONO_TYPE_VALUETYPE) && !type->pinned && !type->attrs) { @@ -1722,15 +1728,15 @@ mono_metadata_parse_type_internal (MonoImage *m, MonoGenericContainer *container } } /* No need to use locking since nobody is modifying the hash table */ - if ((cached = g_hash_table_lookup (type_cache, type))) { + if ((cached = (MonoType *)g_hash_table_lookup (type_cache, type))) { return cached; } } /* printf ("%x %x %c %s\n", type->attrs, type->num_mods, type->pinned ? 'p' : ' ', mono_type_full_name (type)); */ - if (type == &stype) { - type = transient ? g_malloc (MONO_SIZEOF_TYPE) : mono_image_alloc (m, MONO_SIZEOF_TYPE); + if (type == &stype) { // Type was allocated on the stack, so we need to copy it to safety + type = transient ? (MonoType *)g_malloc (MONO_SIZEOF_TYPE) : (MonoType *)mono_image_alloc (m, MONO_SIZEOF_TYPE); memcpy (type, &stype, MONO_SIZEOF_TYPE); } return type; @@ -1859,7 +1865,7 @@ mono_metadata_parse_signature (MonoImage *image, guint32 token) const char *ptr; if (image_is_dynamic (image)) - return mono_lookup_dynamic_token (image, token, NULL); + return (MonoMethodSignature *)mono_lookup_dynamic_token (image, token, NULL); g_assert (mono_metadata_token_table(token) == MONO_TABLE_STANDALONESIG); @@ -1891,7 +1897,7 @@ mono_metadata_signature_alloc (MonoImage *m, guint32 nparams) { MonoMethodSignature *sig; - sig = mono_image_alloc0 (m, MONO_SIZEOF_METHOD_SIGNATURE + ((gint32)nparams) * sizeof (MonoType*)); + sig = (MonoMethodSignature *)mono_image_alloc0 (m, MONO_SIZEOF_METHOD_SIGNATURE + ((gint32)nparams) * sizeof (MonoType*)); sig->param_count = nparams; sig->sentinelpos = -1; @@ -1908,11 +1914,11 @@ mono_metadata_signature_dup_internal_with_padding (MonoImage *image, MonoMemPool sigsize += MONO_SIZEOF_TYPE; if (image) { - ret = mono_image_alloc (image, sigsize); + ret = (MonoMethodSignature *)mono_image_alloc (image, sigsize); } else if (mp) { - ret = mono_mempool_alloc (mp, sigsize); + ret = (MonoMethodSignature *)mono_mempool_alloc (mp, sigsize); } else { - ret = g_malloc (sigsize); + ret = (MonoMethodSignature *)g_malloc (sigsize); } memcpy (ret, sig, sig_header_size - padding); @@ -2182,8 +2188,8 @@ mono_metadata_free_inflated_signature (MonoMethodSignature *sig) static gboolean inflated_method_equal (gconstpointer a, gconstpointer b) { - const MonoMethodInflated *ma = a; - const MonoMethodInflated *mb = b; + const MonoMethodInflated *ma = (const MonoMethodInflated *)a; + const MonoMethodInflated *mb = (const MonoMethodInflated *)b; if (ma->declaring != mb->declaring) return FALSE; return mono_metadata_generic_context_equal (&ma->context, &mb->context); @@ -2192,15 +2198,15 @@ inflated_method_equal (gconstpointer a, gconstpointer b) static guint inflated_method_hash (gconstpointer a) { - const MonoMethodInflated *ma = a; + const MonoMethodInflated *ma = (const MonoMethodInflated *)a; return (mono_metadata_generic_context_hash (&ma->context) ^ mono_aligned_addr_hash (ma->declaring)); } static gboolean inflated_signature_equal (gconstpointer a, gconstpointer b) { - const MonoInflatedMethodSignature *sig1 = a; - const MonoInflatedMethodSignature *sig2 = b; + const MonoInflatedMethodSignature *sig1 = (const MonoInflatedMethodSignature *)a; + const MonoInflatedMethodSignature *sig2 = (const MonoInflatedMethodSignature *)b; /* sig->sig is assumed to be canonized */ if (sig1->sig != sig2->sig) @@ -2212,7 +2218,7 @@ inflated_signature_equal (gconstpointer a, gconstpointer b) static guint inflated_signature_hash (gconstpointer a) { - const MonoInflatedMethodSignature *sig = a; + const MonoInflatedMethodSignature *sig = (const MonoInflatedMethodSignature *)a; /* sig->sig is assumed to be canonized */ return mono_metadata_generic_context_hash (&sig->context) ^ mono_aligned_addr_hash (sig->sig); @@ -2288,43 +2294,9 @@ retry: goto retry; case MONO_TYPE_FNPTR: return signature_in_image (type->data.method, image); - case MONO_TYPE_VAR: { - MonoGenericContainer *container = mono_type_get_generic_param_owner (type); - if (container) { - g_assert (!container->is_method); - /* - * FIXME: The following check is here solely - * for monodis, which uses the internal - * function - * mono_metadata_load_generic_params(). The - * caller of that function needs to fill in - * owner->klass or owner->method of the - * returned struct, but monodis doesn't do - * that. The image unloading depends on that, - * however, so a crash results without this - * check. - */ - if (!container->owner.klass) - return container->image == image; - return container->owner.klass->image == image; - } else { - return type->data.generic_param->image == image; - } - } - case MONO_TYPE_MVAR: { - MonoGenericContainer *container = mono_type_get_generic_param_owner (type); - if (type->data.generic_param->image == image) - return TRUE; - if (container) { - g_assert (container->is_method); - if (!container->owner.method) - /* RefEmit created generic param whose method is not finished */ - return container->image == image; - return container->owner.method->klass->image == image; - } else { - return type->data.generic_param->image == image; - } - } + case MONO_TYPE_VAR: + case MONO_TYPE_MVAR: + return image == get_image_for_generic_param (type->data.generic_param); default: /* At this point, we should've avoided all potential allocations in mono_class_from_mono_type () */ return image == mono_class_from_mono_type (type)->image; @@ -2334,13 +2306,13 @@ retry: static inline void image_sets_lock (void) { - mono_mutex_lock (&image_sets_mutex); + mono_os_mutex_lock (&image_sets_mutex); } static inline void image_sets_unlock (void) { - mono_mutex_unlock (&image_sets_mutex); + mono_os_mutex_unlock (&image_sets_mutex); } /* @@ -2355,11 +2327,12 @@ get_image_set (MonoImage **images, int nimages) MonoImageSet *set; GSList *l; - /* Common case */ + /* Common case: Image set contains corlib only. If we've seen that case before, we cached the set. */ if (nimages == 1 && images [0] == mono_defaults.corlib && mscorlib_image_set) return mscorlib_image_set; /* Happens with empty generic instances */ + // FIXME: Is corlib the correct thing to return here? If so, why? This may be an artifact of generic instances previously defaulting to allocating from corlib. if (nimages == 0) return mscorlib_image_set; @@ -2368,43 +2341,51 @@ get_image_set (MonoImage **images, int nimages) if (!image_sets) image_sets = g_ptr_array_new (); + // Before we go on, we should check to see whether a MonoImageSet with these images already exists. + // We can search the referred-by imagesets of any one of our images to do this. Arbitrarily pick one here: if (images [0] == mono_defaults.corlib && nimages > 1) - l = images [1]->image_sets; + l = images [1]->image_sets; // Prefer not to search the imagesets of corlib-- that will be a long list. else l = images [0]->image_sets; set = NULL; - for (; l; l = l->next) { - set = l->data; + while (l) // Iterate over selected list, looking for an imageset with members equal to our target one + { + set = (MonoImageSet *)l->data; - if (set->nimages == nimages) { + if (set->nimages == nimages) { // Member count differs, this can't be it + // Compare all members to all members-- order might be different for (j = 0; j < nimages; ++j) { for (k = 0; k < nimages; ++k) if (set->images [k] == images [j]) - break; + break; // Break on match + + // If we iterated all the way through set->images, images[j] was *not* found. if (k == nimages) - /* Not found */ - break; + break; // Break on "image not found" } + + // If we iterated all the way through images without breaking, all items in images were found in set->images if (j == nimages) - /* Found */ - break; + break; // Break on "found a set with equal members" } + + l = l->next; } + // If we iterated all the way through l without breaking, the imageset does not already exist and we shuold create it if (!l) { - /* Not found */ set = g_new0 (MonoImageSet, 1); set->nimages = nimages; set->images = g_new0 (MonoImage*, nimages); - mono_mutex_init_recursive (&set->lock); + mono_os_mutex_init_recursive (&set->lock); for (i = 0; i < nimages; ++i) set->images [i] = images [i]; set->gclass_cache = g_hash_table_new_full (mono_generic_class_hash, mono_generic_class_equal, NULL, (GDestroyNotify)free_generic_class); set->ginst_cache = g_hash_table_new_full (mono_metadata_generic_inst_hash, mono_metadata_generic_inst_equal, NULL, (GDestroyNotify)free_generic_inst); set->gmethod_cache = g_hash_table_new_full (inflated_method_hash, inflated_method_equal, NULL, (GDestroyNotify)free_inflated_method); set->gsignature_cache = g_hash_table_new_full (inflated_signature_hash, inflated_signature_equal, NULL, (GDestroyNotify)free_inflated_signature); - + for (i = 0; i < nimages; ++i) set->images [i]->image_sets = g_slist_prepend (set->images [i]->image_sets, set); @@ -2445,20 +2426,20 @@ delete_image_set (MonoImageSet *set) if (set->mempool) mono_mempool_destroy (set->mempool); g_free (set->images); - mono_mutex_destroy (&set->lock); + mono_os_mutex_destroy (&set->lock); g_free (set); } void mono_image_set_lock (MonoImageSet *set) { - mono_mutex_lock (&set->lock); + mono_os_mutex_lock (&set->lock); } void mono_image_set_unlock (MonoImageSet *set) { - mono_mutex_unlock (&set->lock); + mono_os_mutex_unlock (&set->lock); } gpointer @@ -2503,6 +2484,24 @@ mono_image_set_strdup (MonoImageSet *set, const char *s) return res; } +// Get a descriptive string for a MonoImageSet +// Callers are obligated to free buffer with g_free after use +char * +mono_image_set_description (MonoImageSet *set) +{ + GString *result = g_string_new (NULL); + int img; + g_string_append (result, "["); + for (img = 0; img < set->nimages; img++) + { + if (img > 0) + g_string_append (result, ", "); + g_string_append (result, set->images[img]->name); + } + g_string_append (result, "]"); + return g_string_free (result, FALSE); +} + /* * Structure used by the collect_..._images functions to store the image list. */ @@ -2637,48 +2636,13 @@ retry: case MONO_TYPE_FNPTR: //return signature_in_image (type->data.method, image); g_assert_not_reached (); - case MONO_TYPE_VAR: { - MonoGenericContainer *container = mono_type_get_generic_param_owner (type); - if (container) { - g_assert (!container->is_method); - /* - * FIXME: The following check is here solely - * for monodis, which uses the internal - * function - * mono_metadata_load_generic_params(). The - * caller of that function needs to fill in - * owner->klass or owner->method of the - * returned struct, but monodis doesn't do - * that. The image unloading depends on that, - * however, so a crash results without this - * check. - */ - if (!container->owner.klass) - add_image (container->image, data); - else - add_image (container->owner.klass->image, data); - } else { - add_image (type->data.generic_param->image, data); - } - } + case MONO_TYPE_VAR: + case MONO_TYPE_MVAR: + { + MonoImage *image = get_image_for_generic_param (type->data.generic_param); + add_image (image, data); break; - case MONO_TYPE_MVAR: { - MonoGenericContainer *container = mono_type_get_generic_param_owner (type); - if (type->data.generic_param->image) - add_image (type->data.generic_param->image, data); - if (container) { - if (!container->owner.method) { - /* RefEmit created generic param whose method is not finished */ - add_image (container->image, data); - } else { - g_assert (container->is_method); - add_image (container->owner.method->klass->image, data); - } - } else { - add_image (type->data.generic_param->image, data); - } } - break; case MONO_TYPE_CLASS: case MONO_TYPE_VALUETYPE: add_image (mono_class_from_mono_type (type)->image, data); @@ -2696,8 +2660,8 @@ typedef struct { static gboolean steal_gclass_in_image (gpointer key, gpointer value, gpointer data) { - MonoGenericClass *gclass = key; - CleanForImageUserData *user_data = data; + MonoGenericClass *gclass = (MonoGenericClass *)key; + CleanForImageUserData *user_data = (CleanForImageUserData *)data; g_assert (gclass_in_image (gclass, user_data->image)); @@ -2708,8 +2672,8 @@ steal_gclass_in_image (gpointer key, gpointer value, gpointer data) static gboolean steal_ginst_in_image (gpointer key, gpointer value, gpointer data) { - MonoGenericInst *ginst = key; - CleanForImageUserData *user_data = data; + MonoGenericInst *ginst = (MonoGenericInst *)key; + CleanForImageUserData *user_data = (CleanForImageUserData *)data; // This doesn't work during corlib compilation //g_assert (ginst_in_image (ginst, user_data->image)); @@ -2721,8 +2685,8 @@ steal_ginst_in_image (gpointer key, gpointer value, gpointer data) static gboolean inflated_method_in_image (gpointer key, gpointer value, gpointer data) { - MonoImage *image = data; - MonoMethodInflated *method = key; + MonoImage *image = (MonoImage *)data; + MonoMethodInflated *method = (MonoMethodInflated *)key; // FIXME: // https://bugzilla.novell.com/show_bug.cgi?id=458168 @@ -2736,8 +2700,8 @@ inflated_method_in_image (gpointer key, gpointer value, gpointer data) static gboolean inflated_signature_in_image (gpointer key, gpointer value, gpointer data) { - MonoImage *image = data; - MonoInflatedMethodSignature *sig = key; + MonoImage *image = (MonoImage *)data; + MonoInflatedMethodSignature *sig = (MonoInflatedMethodSignature *)key; return signature_in_image (sig->sig, image) || (sig->context.class_inst && ginst_in_image (sig->context.class_inst, image)) || @@ -2747,8 +2711,8 @@ inflated_signature_in_image (gpointer key, gpointer value, gpointer data) static void check_gmethod (gpointer key, gpointer value, gpointer data) { - MonoMethodInflated *method = key; - MonoImage *image = data; + MonoMethodInflated *method = (MonoMethodInflated *)key; + MonoImage *image = (MonoImage *)data; if (method->context.class_inst) g_assert (!ginst_in_image (method->context.class_inst, image)); @@ -2773,7 +2737,7 @@ check_image_sets (MonoImage *image) return; for (i = 0; i < image_sets->len; ++i) { - MonoImageSet *set = g_ptr_array_index (image_sets, i); + MonoImageSet *set = (MonoImageSet *)g_ptr_array_index (image_sets, i); if (!g_slist_find (l, set)) { g_hash_table_foreach (set->gmethod_cache, check_gmethod, image); @@ -2799,7 +2763,7 @@ mono_metadata_clean_for_image (MonoImage *image) /* Collect the items to delete */ /* delete_image_set () modifies the lists so make a copy */ for (l = image->image_sets; l; l = l->next) { - MonoImageSet *set = l->data; + MonoImageSet *set = (MonoImageSet *)l->data; mono_image_set_lock (set); g_hash_table_foreach_steal (set->gclass_cache, steal_gclass_in_image, &gclass_data); @@ -2811,15 +2775,15 @@ mono_metadata_clean_for_image (MonoImage *image) /* Delete the removed items */ for (l = ginst_data.list; l; l = l->next) - free_generic_inst (l->data); + free_generic_inst ((MonoGenericInst *)l->data); for (l = gclass_data.list; l; l = l->next) - free_generic_class (l->data); + free_generic_class ((MonoGenericClass *)l->data); g_slist_free (ginst_data.list); g_slist_free (gclass_data.list); /* delete_image_set () modifies the lists so make a copy */ set_list = g_slist_copy (image->image_sets); for (l = set_list; l; l = l->next) { - MonoImageSet *set = l->data; + MonoImageSet *set = (MonoImageSet *)l->data; delete_image_set (set); } @@ -2905,7 +2869,7 @@ mono_metadata_get_inflated_signature (MonoMethodSignature *sig, MonoGenericConte mono_image_set_lock (set); - res = g_hash_table_lookup (set->gsignature_cache, &helper); + res = (MonoInflatedMethodSignature *)g_hash_table_lookup (set->gsignature_cache, &helper); if (!res) { res = g_new0 (MonoInflatedMethodSignature, 1); res->sig = sig; @@ -2956,7 +2920,7 @@ mono_metadata_get_generic_inst (int type_argc, MonoType **type_argv) break; is_open = (i < type_argc); - ginst = g_alloca (size); + ginst = (MonoGenericInst *)g_alloca (size); memset (ginst, 0, sizeof (MonoGenericInst)); ginst->is_open = is_open; ginst->type_argc = type_argc; @@ -2972,9 +2936,9 @@ mono_metadata_get_generic_inst (int type_argc, MonoType **type_argv) mono_image_set_lock (set); - ginst = g_hash_table_lookup (set->ginst_cache, ginst); + ginst = (MonoGenericInst *)g_hash_table_lookup (set->ginst_cache, ginst); if (!ginst) { - ginst = mono_image_set_alloc0 (set, size); + ginst = (MonoGenericInst *)mono_image_set_alloc0 (set, size); #ifndef MONO_SMALL_CONFIG ginst->id = ++next_generic_inst_id; #endif @@ -3016,12 +2980,11 @@ mono_metadata_lookup_generic_class (MonoClass *container_class, MonoGenericInst MonoImageSet *set; CollectData data; + memset (&helper, 0, sizeof(helper)); // act like g_new0 helper.container_class = container_class; helper.context.class_inst = inst; - helper.context.method_inst = NULL; helper.is_dynamic = is_dynamic; /* We use this in a hash lookup, which does not attempt to downcast the pointer */ helper.is_tb_open = is_tb_open; - helper.cached_class = NULL; collect_data_init (&data); @@ -3033,7 +2996,7 @@ mono_metadata_lookup_generic_class (MonoClass *container_class, MonoGenericInst mono_image_set_lock (set); - gclass = g_hash_table_lookup (set->gclass_cache, &helper); + gclass = (MonoGenericClass *)g_hash_table_lookup (set->gclass_cache, &helper); /* A tripwire just to keep us honest */ g_assert (!helper.cached_class); @@ -3195,7 +3158,36 @@ select_container (MonoGenericContainer *gc, MonoTypeEnum type) return gc; } -/* +MonoGenericContainer * +get_anonymous_container_for_image (MonoImage *image, gboolean is_mvar) +{ + MonoGenericContainer **container_pointer; + if (is_mvar) + container_pointer = &image->anonymous_generic_method_container; + else + container_pointer = &image->anonymous_generic_class_container; + MonoGenericContainer *result = *container_pointer; + + // This container has never been created; make it now. + if (!result) + { + // Note this is never deallocated anywhere-- it exists for the lifetime of the image it's allocated from + result = (MonoGenericContainer *)mono_image_alloc0 (image, sizeof (MonoGenericContainer)); + result->owner.image = image; + result->is_anonymous = TRUE; + result->is_small_param = TRUE; + result->is_method = is_mvar; + + // If another thread already made a container, use that and leak this new one. + // (Technically it would currently be safe to just assign instead of CASing.) + MonoGenericContainer *exchange = (MonoGenericContainer *)InterlockedCompareExchangePointer ((volatile gpointer *)container_pointer, result, NULL); + if (exchange) + result = exchange; + } + return result; +} + +/* * mono_metadata_parse_generic_param: * @generic_container: Our MonoClass's or MonoMethod's MonoGenericContainer; * see mono_metadata_parse_type_full() for details. @@ -3214,12 +3206,24 @@ mono_metadata_parse_generic_param (MonoImage *m, MonoGenericContainer *generic_c generic_container = select_container (generic_container, type); if (!generic_container) { + gboolean is_mvar = FALSE; + switch (type) + { + case MONO_TYPE_VAR: + break; + case MONO_TYPE_MVAR: + is_mvar = TRUE; + break; + default: + g_error ("Cerating generic param object with invalid MonoType"); // This is not a generic param + } + /* Create dummy MonoGenericParam */ MonoGenericParam *param; - param = mono_image_alloc0 (m, sizeof (MonoGenericParam)); + param = (MonoGenericParam *)mono_image_alloc0 (m, sizeof (MonoGenericParam)); param->num = index; - param->image = m; + param->owner = get_anonymous_container_for_image (m, is_mvar); return param; } @@ -3251,7 +3255,7 @@ mono_metadata_get_shared_type (MonoType *type) MonoType *cached; /* No need to use locking since nobody is modifying the hash table */ - if ((cached = g_hash_table_lookup (type_cache, type))) + if ((cached = (MonoType *)g_hash_table_lookup (type_cache, type))) return cached; switch (type->type){ @@ -3365,7 +3369,7 @@ do_mono_metadata_parse_type (MonoType *type, MonoImage *m, MonoGenericContainer { mono_error_init (error); - type->type = mono_metadata_decode_value (ptr, &ptr); + type->type = (MonoTypeEnum)mono_metadata_decode_value (ptr, &ptr); switch (type->type){ case MONO_TYPE_VOID: @@ -3548,7 +3552,7 @@ parse_section_data (MonoImage *m, int *num_clauses, const unsigned char *ptr) int i; *num_clauses = is_fat ? sect_data_len / 24: sect_data_len / 12; /* we could just store a pointer if we don't need to byteswap */ - clauses = g_malloc0 (sizeof (MonoExceptionClause) * (*num_clauses)); + clauses = (MonoExceptionClause *)g_malloc0 (sizeof (MonoExceptionClause) * (*num_clauses)); for (i = 0; i < *num_clauses; ++i) { MonoExceptionClause *ec = &clauses [i]; guint32 tof_value; @@ -3699,7 +3703,7 @@ mono_metadata_parse_mh_full (MonoImage *m, MonoGenericContainer *container, cons switch (format) { case METHOD_HEADER_TINY_FORMAT: - mh = g_malloc0 (MONO_SIZEOF_METHOD_HEADER); + mh = (MonoMethodHeader *)g_malloc0 (MONO_SIZEOF_METHOD_HEADER); ptr++; mh->max_stack = 8; mh->is_transient = TRUE; @@ -3757,7 +3761,7 @@ mono_metadata_parse_mh_full (MonoImage *m, MonoGenericContainer *container, cons g_warning ("wrong signature for locals blob"); locals_ptr++; len = mono_metadata_decode_value (locals_ptr, &locals_ptr); - mh = g_malloc0 (MONO_SIZEOF_METHOD_HEADER + len * sizeof (MonoType*) + num_clauses * sizeof (MonoExceptionClause)); + mh = (MonoMethodHeader *)g_malloc0 (MONO_SIZEOF_METHOD_HEADER + len * sizeof (MonoType*) + num_clauses * sizeof (MonoExceptionClause)); mh->num_locals = len; for (i = 0; i < len; ++i) { mh->locals [i] = mono_metadata_parse_type_internal (m, container, @@ -3766,7 +3770,7 @@ mono_metadata_parse_mh_full (MonoImage *m, MonoGenericContainer *container, cons goto fail; } } else { - mh = g_malloc0 (MONO_SIZEOF_METHOD_HEADER + num_clauses * sizeof (MonoExceptionClause)); + mh = (MonoMethodHeader *)g_malloc0 (MONO_SIZEOF_METHOD_HEADER + num_clauses * sizeof (MonoExceptionClause)); } mh->code = code; mh->code_size = code_size; @@ -3913,7 +3917,7 @@ mono_method_header_get_clauses (MonoMethodHeader *header, MonoMethod *method, gp *clause = *sc; return TRUE; } - sc = *iter; + sc = (MonoExceptionClause *)*iter; sc++; if (sc < header->clauses + header->num_clauses) { *iter = sc; @@ -4245,7 +4249,7 @@ mono_metadata_interfaces_from_typedef_full (MonoImage *meta, guint32 index, Mono if (heap_alloc_result) result = g_new0 (MonoClass*, pos - start); else - result = mono_image_alloc0 (meta, sizeof (MonoClass*) * (pos - start)); + result = (MonoClass **)mono_image_alloc0 (meta, sizeof (MonoClass*) * (pos - start)); pos = start; while (pos < tdef->rows) { @@ -4931,12 +4935,8 @@ mono_metadata_generic_param_equal_internal (MonoGenericParam *p1, MonoGenericPar * image B gets that generic inst from the cache, image A is * unloaded, so the inst is deleted, but image B still retains * a pointer to it. - * - * The AOT runtime doesn't set the image when it's decoding - * types, so we only compare it when the owner is NULL. */ - if (mono_generic_param_owner (p1) == mono_generic_param_owner (p2) && - (mono_generic_param_owner (p1) || p1->image == p2->image)) + if (mono_generic_param_owner (p1) == mono_generic_param_owner (p2)) return TRUE; /* @@ -5014,6 +5014,7 @@ mono_metadata_fnptr_equal (MonoMethodSignature *s1, MonoMethodSignature *s2, gbo * mono_metadata_type_equal: * @t1: a type * @t2: another type + * @signature_only: If true, treat ginsts as equal which are instantiated separately but have equal positional value * * Determine if @t1 and @t2 represent the same type. * Returns: #TRUE if @t1 and @t2 are equal. @@ -5156,7 +5157,7 @@ mono_metadata_type_dup (MonoImage *image, const MonoType *o) if (o->num_mods) sizeof_o += o->num_mods * sizeof (MonoCustomMod); - r = image ? mono_image_alloc0 (image, sizeof_o) : g_malloc (sizeof_o); + r = image ? (MonoType *)mono_image_alloc0 (image, sizeof_o) : (MonoType *)g_malloc (sizeof_o); memcpy (r, o, sizeof_o); @@ -5574,7 +5575,7 @@ mono_type_create_from_typespec_checked (MonoImage *image, guint32 type_spec, Mon mono_error_init (error); mono_image_lock (image); - type = g_hash_table_lookup (image->typespec_cache, GUINT_TO_POINTER (type_spec)); + type = (MonoType *)g_hash_table_lookup (image->typespec_cache, GUINT_TO_POINTER (type_spec)); mono_image_unlock (image); if (type) return type; @@ -5599,7 +5600,7 @@ mono_type_create_from_typespec_checked (MonoImage *image, guint32 type_spec, Mon mono_metadata_free_type (type); mono_image_lock (image); - type = g_hash_table_lookup (image->typespec_cache, GUINT_TO_POINTER (type_spec)); + type = (MonoType *)g_hash_table_lookup (image->typespec_cache, GUINT_TO_POINTER (type_spec)); /* We might leak some data in the image mempool if found */ if (!type) { g_hash_table_insert (image->typespec_cache, GUINT_TO_POINTER (type_spec), type2); @@ -5617,7 +5618,7 @@ mono_image_strndup (MonoImage *image, const char *data, guint len) char *res; if (!image) return g_strndup (data, len); - res = mono_image_alloc (image, len + 1); + res = (char *)mono_image_alloc (image, len + 1); memcpy (res, data, len); res [len] = 0; return res; @@ -5643,12 +5644,12 @@ mono_metadata_parse_marshal_spec_full (MonoImage *image, MonoImage *parent_image /* fixme: this is incomplete, but I cant find more infos in the specs */ if (image) - res = mono_image_alloc0 (image, sizeof (MonoMarshalSpec)); + res = (MonoMarshalSpec *)mono_image_alloc0 (image, sizeof (MonoMarshalSpec)); else res = g_new0 (MonoMarshalSpec, 1); len = mono_metadata_decode_value (ptr, &ptr); - res->native = *ptr++; + res->native = (MonoMarshalNative)*ptr++; if (res->native == MONO_NATIVE_LPARRAY) { res->data.array_data.param_num = -1; @@ -5656,7 +5657,7 @@ mono_metadata_parse_marshal_spec_full (MonoImage *image, MonoImage *parent_image res->data.array_data.elem_mult = -1; if (ptr - start <= len) - res->data.array_data.elem_type = *ptr++; + res->data.array_data.elem_type = (MonoMarshalNative)*ptr++; if (ptr - start <= len) res->data.array_data.param_num = mono_metadata_decode_value (ptr, &ptr); if (ptr - start <= len) @@ -5703,10 +5704,10 @@ mono_metadata_parse_marshal_spec_full (MonoImage *image, MonoImage *parent_image } if (res->native == MONO_NATIVE_SAFEARRAY) { - res->data.safearray_data.elem_type = 0; + res->data.safearray_data.elem_type = (MonoMarshalVariant)0; res->data.safearray_data.num_elem = 0; if (ptr - start <= len) - res->data.safearray_data.elem_type = *ptr++; + res->data.safearray_data.elem_type = (MonoMarshalVariant)*ptr++; if (ptr - start <= len) res->data.safearray_data.num_elem = *ptr++; } @@ -6097,9 +6098,9 @@ get_constraints (MonoImage *image, int owner, MonoClass ***constraints, MonoGene } if (!found) return TRUE; - res = mono_image_alloc0 (image, sizeof (MonoClass*) * (found + 1)); + res = (MonoClass **)mono_image_alloc0 (image, sizeof (MonoClass*) * (found + 1)); for (i = 0, tmp = cons; i < found; ++i, tmp = tmp->next) { - res [i] = tmp->data; + res [i] = (MonoClass *)tmp->data; } g_slist_free (cons); *constraints = res; @@ -6211,11 +6212,12 @@ mono_metadata_load_generic_params (MonoImage *image, guint32 token, MonoGenericC mono_metadata_decode_row (tdef, i - 1, cols, MONO_GENERICPARAM_SIZE); params = NULL; n = 0; - container = mono_image_alloc0 (image, sizeof (MonoGenericContainer)); - container->image = image; + container = (MonoGenericContainer *)mono_image_alloc0 (image, sizeof (MonoGenericContainer)); + container->owner.image = image; // Temporarily mark as anonymous, but this will be overriden by caller + container->is_anonymous = TRUE; do { n++; - params = g_realloc (params, sizeof (MonoGenericParamFull) * n); + params = (MonoGenericParamFull *)g_realloc (params, sizeof (MonoGenericParamFull) * n); memset (¶ms [n - 1], 0, sizeof (MonoGenericParamFull)); params [n - 1].param.owner = container; params [n - 1].param.num = cols [MONO_GENERICPARAM_NUMBER]; @@ -6230,7 +6232,7 @@ mono_metadata_load_generic_params (MonoImage *image, guint32 token, MonoGenericC } while (cols [MONO_GENERICPARAM_OWNER] == owner); container->type_argc = n; - container->type_params = mono_image_alloc0 (image, sizeof (MonoGenericParamFull) * n); + container->type_params = (MonoGenericParamFull *)mono_image_alloc0 (image, sizeof (MonoGenericParamFull) * n); memcpy (container->type_params, params, sizeof (MonoGenericParamFull) * n); g_free (params); container->parent = parent_container; @@ -6480,7 +6482,7 @@ mono_signature_get_params (MonoMethodSignature *sig, gpointer *iter) return NULL; } } - type = *iter; + type = (MonoType **)*iter; type++; if (type < &sig->params [sig->param_count]) { *iter = type; @@ -6638,3 +6640,32 @@ mono_method_get_wrapper_cache (MonoMethod *method) return &method->klass->image->wrapper_caches; } } + +// This is support for the mempool reference tracking feature in checked-build, but lives in metadata.c due to use of static variables of this file. + +/** + * mono_find_image_set_owner: + * + * Find the imageset, if any, which a given pointer is located in the memory of. + */ +MonoImageSet * +mono_find_image_set_owner (void *ptr) +{ + MonoImageSet *owner = NULL; + int i; + + image_sets_lock (); + + if (image_sets) + { + for (i = 0; !owner && i < image_sets->len; ++i) { + MonoImageSet *set = (MonoImageSet *)g_ptr_array_index (image_sets, i); + if (mono_mempool_contains_addr (set->mempool, ptr)) + owner = set; + } + } + + image_sets_unlock (); + + return owner; +} diff --git a/mono/metadata/method-builder.c b/mono/metadata/method-builder.c index 234598d4962..23f8d599095 100644 --- a/mono/metadata/method-builder.c +++ b/mono/metadata/method-builder.c @@ -67,7 +67,7 @@ mono_mb_new_base (MonoClass *klass, MonoWrapperType type) #ifndef DISABLE_JIT mb->code_size = 40; - mb->code = g_malloc (mb->code_size); + mb->code = (unsigned char *)g_malloc (mb->code_size); #endif /* placeholder for the wrapper always at index 1 */ mono_mb_add_data (mb, NULL); @@ -155,7 +155,7 @@ mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, in { /* 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; @@ -168,7 +168,7 @@ mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, in 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++) { @@ -197,15 +197,15 @@ mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, in 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; @@ -232,7 +232,7 @@ mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, in #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]); @@ -257,9 +257,9 @@ mono_mb_add_data (MonoMethodBuilder *mb, gpointer data) 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 @@ -299,7 +299,7 @@ mono_mb_emit_byte (MonoMethodBuilder *mb, guint8 op) { 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; @@ -322,7 +322,7 @@ mono_mb_emit_i4 (MonoMethodBuilder *mb, gint32 data) { 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); @@ -334,7 +334,7 @@ mono_mb_emit_i8 (MonoMethodBuilder *mb, gint64 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); @@ -347,7 +347,7 @@ mono_mb_emit_i2 (MonoMethodBuilder *mb, gint16 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; diff --git a/mono/metadata/monitor.c b/mono/metadata/monitor.c index f86c4233baf..0c1d28130af 100644 --- a/mono/metadata/monitor.c +++ b/mono/metadata/monitor.c @@ -76,8 +76,8 @@ struct _MonitorArray { MonoThreadsSync monitors [MONO_ZERO_LEN_ARRAY]; }; -#define mono_monitor_allocator_lock() mono_mutex_lock (&monitor_mutex) -#define mono_monitor_allocator_unlock() mono_mutex_unlock (&monitor_mutex) +#define mono_monitor_allocator_lock() mono_os_mutex_lock (&monitor_mutex) +#define mono_monitor_allocator_unlock() mono_os_mutex_unlock (&monitor_mutex) static mono_mutex_t monitor_mutex; static MonoThreadsSync *monitor_freelist; static MonitorArray *monitor_allocated; @@ -248,7 +248,7 @@ lock_word_new_flat (gint32 owner) void mono_monitor_init (void) { - mono_mutex_init_recursive (&monitor_mutex); + mono_os_mutex_init_recursive (&monitor_mutex); } void @@ -257,11 +257,11 @@ mono_monitor_cleanup (void) MonoThreadsSync *mon; /* MonitorArray *marray, *next = NULL; */ - /*mono_mutex_destroy (&monitor_mutex);*/ + /*mono_os_mutex_destroy (&monitor_mutex);*/ /* The monitors on the freelist don't have weak links - mark them */ - for (mon = monitor_freelist; mon; mon = mon->data) - mon->wait_list = (gpointer)-1; + for (mon = monitor_freelist; mon; mon = (MonoThreadsSync *)mon->data) + mon->wait_list = (GSList *)-1; /* * FIXME: This still crashes with sgen (async_read.exe) @@ -319,7 +319,7 @@ mono_locks_dump (gboolean include_untaken) int used = 0, on_freelist = 0, to_recycle = 0, total = 0, num_arrays = 0; MonoThreadsSync *mon; MonitorArray *marray; - for (mon = monitor_freelist; mon; mon = mon->data) + for (mon = monitor_freelist; mon; mon = (MonoThreadsSync *)mon->data) on_freelist++; for (marray = monitor_allocated; marray; marray = marray->next) { total += marray->num_monitors; @@ -330,7 +330,7 @@ mono_locks_dump (gboolean include_untaken) if (i < marray->num_monitors - 1) to_recycle++; } else { - if (!monitor_is_on_freelist (mon->data)) { + if (!monitor_is_on_freelist ((MonoThreadsSync *)mon->data)) { MonoObject *holder = (MonoObject *)mono_gchandle_get_target ((guint32)mon->data); if (mon_status_get_owner (mon->status)) { g_print ("Lock %p in object %p held by thread %d, nest level: %d\n", @@ -378,39 +378,39 @@ mon_finalize (MonoThreadsSync *mon) static MonoThreadsSync * mon_new (gsize id) { - MonoThreadsSync *new; + MonoThreadsSync *new_; if (!monitor_freelist) { MonitorArray *marray; int i; /* see if any sync block has been collected */ - new = NULL; + new_ = NULL; for (marray = monitor_allocated; marray; marray = marray->next) { for (i = 0; i < marray->num_monitors; ++i) { if (mono_gchandle_get_target ((guint32)marray->monitors [i].data) == NULL) { - new = &marray->monitors [i]; - if (new->wait_list) { + new_ = &marray->monitors [i]; + if (new_->wait_list) { /* Orphaned events left by aborted threads */ - while (new->wait_list) { + while (new_->wait_list) { LOCK_DEBUG (g_message (G_GNUC_PRETTY_FUNCTION ": (%d): Closing orphaned event %d", mono_thread_info_get_small_id (), new->wait_list->data)); - CloseHandle (new->wait_list->data); - new->wait_list = g_slist_remove (new->wait_list, new->wait_list->data); + CloseHandle (new_->wait_list->data); + new_->wait_list = g_slist_remove (new_->wait_list, new_->wait_list->data); } } - mono_gchandle_free ((guint32)new->data); - new->data = monitor_freelist; - monitor_freelist = new; + mono_gchandle_free ((guint32)new_->data); + new_->data = monitor_freelist; + monitor_freelist = new_; } } /* small perf tweak to avoid scanning all the blocks */ - if (new) + if (new_) break; } /* need to allocate a new array of monitors */ if (!monitor_freelist) { MonitorArray *last; LOCK_DEBUG (g_message ("%s: allocating more monitors: %d", __func__, array_size)); - marray = g_malloc0 (sizeof (MonoArray) + array_size * sizeof (MonoThreadsSync)); + marray = (MonitorArray *)g_malloc0 (MONO_SIZEOF_MONO_ARRAY + array_size * sizeof (MonoThreadsSync)); marray->num_monitors = array_size; array_size *= 2; /* link into the freelist */ @@ -433,18 +433,18 @@ mon_new (gsize id) } } - new = monitor_freelist; - monitor_freelist = new->data; + new_ = monitor_freelist; + monitor_freelist = (MonoThreadsSync *)new_->data; - new->status = mon_status_set_owner (0, id); - new->status = mon_status_init_entry_count (new->status); - new->nest = 1; - new->data = NULL; + new_->status = mon_status_set_owner (0, id); + new_->status = mon_status_init_entry_count (new_->status); + new_->nest = 1; + new_->data = NULL; #ifndef DISABLE_PERFCOUNTERS mono_perfcounters->gc_sync_blocks++; #endif - return new; + return new_; } static MonoThreadsSync* @@ -493,7 +493,7 @@ mono_monitor_inflate_owned (MonoObject *obj, int id) nlw = lock_word_new_inflated (mon); mono_memory_write_barrier (); - tmp_lw.sync = InterlockedCompareExchangePointer ((gpointer*)&obj->synchronisation, nlw.sync, old_lw.sync); + tmp_lw.sync = (MonoThreadsSync *)InterlockedCompareExchangePointer ((gpointer*)&obj->synchronisation, nlw.sync, old_lw.sync); if (tmp_lw.sync != old_lw.sync) { /* Someone else inflated the lock in the meantime */ discard_mon (mon); @@ -536,7 +536,7 @@ mono_monitor_inflate (MonoObject *obj) mon->nest = lock_word_get_nest (old_lw); } mono_memory_write_barrier (); - tmp_lw.sync = InterlockedCompareExchangePointer ((gpointer*)&obj->synchronisation, nlw.sync, old_lw.sync); + tmp_lw.sync = (MonoThreadsSync *)InterlockedCompareExchangePointer ((gpointer*)&obj->synchronisation, nlw.sync, old_lw.sync); if (tmp_lw.sync == old_lw.sync) { /* Successfully inflated the lock */ return; @@ -592,7 +592,7 @@ mono_object_hash (MonoObject* obj) LockWord old_lw; lw = lock_word_new_thin_hash (hash); - old_lw.sync = InterlockedCompareExchangePointer ((gpointer*)&obj->synchronisation, lw.sync, NULL); + old_lw.sync = (MonoThreadsSync *)InterlockedCompareExchangePointer ((gpointer*)&obj->synchronisation, lw.sync, NULL); if (old_lw.sync == NULL) { return hash; } @@ -707,7 +707,7 @@ mono_monitor_exit_flat (MonoObject *obj, LockWord old_lw) else new_lw.lock_word = 0; - tmp_lw.sync = InterlockedCompareExchangePointer ((gpointer*)&obj->synchronisation, new_lw.sync, old_lw.sync); + tmp_lw.sync = (MonoThreadsSync *)InterlockedCompareExchangePointer ((gpointer*)&obj->synchronisation, new_lw.sync, old_lw.sync); if (old_lw.sync != tmp_lw.sync) { /* Someone inflated the lock in the meantime */ mono_monitor_exit_inflated (obj); @@ -896,7 +896,7 @@ retry_contended: * We have to obey a stop/suspend request even if * allow_interruption is FALSE to avoid hangs at shutdown. */ - if (!mono_thread_test_state (mono_thread_internal_current (), (ThreadState_StopRequested|ThreadState_SuspendRequested))) { + if (!mono_thread_test_state (mono_thread_internal_current (), (MonoThreadState)(ThreadState_StopRequested | ThreadState_SuspendRequested))) { if (ms != INFINITE) { now = mono_msec_ticks (); if (now < then) { @@ -981,7 +981,7 @@ mono_monitor_try_enter_internal (MonoObject *obj, guint32 ms, gboolean allow_int } else { LockWord nlw, old_lw; nlw = lock_word_increment_nest (lw); - old_lw.sync = InterlockedCompareExchangePointer ((gpointer*)&obj->synchronisation, nlw.sync, lw.sync); + old_lw.sync = (MonoThreadsSync *)InterlockedCompareExchangePointer ((gpointer*)&obj->synchronisation, nlw.sync, lw.sync); if (old_lw.sync != lw.sync) { /* Someone else inflated it in the meantime */ g_assert (lock_word_is_inflated (old_lw)); diff --git a/mono/metadata/mono-basic-block.c b/mono/metadata/mono-basic-block.c index a62c39868d1..53c74e8cf5b 100644 --- a/mono/metadata/mono-basic-block.c +++ b/mono/metadata/mono-basic-block.c @@ -295,11 +295,11 @@ bb_liveness (MonoSimpleBasicBlock *bb) } while (mark_stack->len > 0) { - MonoSimpleBasicBlock *block = g_ptr_array_remove_index_fast (mark_stack, mark_stack->len - 1); + MonoSimpleBasicBlock *block = (MonoSimpleBasicBlock *)g_ptr_array_remove_index_fast (mark_stack, mark_stack->len - 1); block->dead = FALSE; for (tmp = block->out_bb; tmp; tmp = tmp->next) { - MonoSimpleBasicBlock *to = tmp->data; + MonoSimpleBasicBlock *to = (MonoSimpleBasicBlock *)tmp->data; if (to->dead) g_ptr_array_add (mark_stack, to); } diff --git a/mono/metadata/mono-config.c b/mono/metadata/mono-config.c index e29fe9d0fcc..e9aab32a48d 100644 --- a/mono/metadata/mono-config.c +++ b/mono/metadata/mono-config.c @@ -166,9 +166,9 @@ static void start_element (GMarkupParseContext *context, gpointer user_data, GError **error) { - ParseState *state = user_data; + ParseState *state = (ParseState *)user_data; if (!state->current) { - state->current = g_hash_table_lookup (config_handlers, element_name); + state->current = (MonoParseHandler *)g_hash_table_lookup (config_handlers, element_name); if (state->current && state->current->init) state->user_data = state->current->init (state->assembly); } @@ -181,7 +181,7 @@ static void end_element (GMarkupParseContext *context, gpointer user_data, GError **error) { - ParseState *state = user_data; + ParseState *state = (ParseState *)user_data; if (state->current) { if (state->current->end) state->current->end (state->user_data, element_name); @@ -200,7 +200,7 @@ static void parse_text (GMarkupParseContext *context, gpointer user_data, GError **error) { - ParseState *state = user_data; + ParseState *state = (ParseState *)user_data; if (state->current && state->current->text) state->current->text (state->user_data, text, text_len); } @@ -218,7 +218,7 @@ static void parse_error (GMarkupParseContext *context, GError *error, gpointer user_data) { - ParseState *state = user_data; + ParseState *state = (ParseState *)user_data; const gchar *msg; const gchar *filename; @@ -267,7 +267,7 @@ dllmap_start (gpointer user_data, const gchar **attribute_values) { int i; - DllInfo *info = user_data; + DllInfo *info = (DllInfo *)user_data; if (strcmp (element_name, "dllmap") == 0) { g_free (info->dll); @@ -284,7 +284,7 @@ dllmap_start (gpointer user_data, size_t libdir_len = strlen (libdir); char *result; - result = g_malloc (libdir_len-strlen("$mono_libdir")+strlen(attribute_values[i])+1); + result = (char *)g_malloc (libdir_len-strlen("$mono_libdir")+strlen(attribute_values[i])+1); strncpy (result, attribute_names[i], p-attribute_values[i]); strcat (result, libdir); strcat (result, p+strlen("$mono_libdir")); @@ -327,7 +327,7 @@ dllmap_start (gpointer user_data, static void dllmap_finish (gpointer user_data) { - DllInfo *info = user_data; + DllInfo *info = (DllInfo *)user_data; g_free (info->dll); g_free (info->target); @@ -448,7 +448,7 @@ mono_config_parse_xml_with_context (ParseState *state, const char *text, gsize l if (!inited) mono_config_init (); - context = g_markup_parse_context_new (&mono_parser, 0, state, NULL); + context = g_markup_parse_context_new (&mono_parser, (GMarkupParseFlags)0, state, NULL); if (g_markup_parse_context_parse (context, text, len, NULL)) { g_markup_parse_context_end_parse (context, NULL); } @@ -668,7 +668,7 @@ mono_get_machine_config (void) static void assembly_binding_end (gpointer user_data, const char *element_name) { - ParserUserData *pud = user_data; + ParserUserData *pud = (ParserUserData *)user_data; if (!strcmp (element_name, "dependentAssembly")) { if (pud->info_parsed && pud->info) { @@ -689,7 +689,7 @@ publisher_policy_start (gpointer user_data, MonoAssemblyBindingInfo *info; int n; - pud = user_data; + pud = (ParserUserData *)user_data; info = pud->info; if (!strcmp (element_name, "dependentAssembly")) { info->name = NULL; diff --git a/mono/metadata/mono-debug.c b/mono/metadata/mono-debug.c index 04b5d647be1..09c55b3bcc8 100644 --- a/mono/metadata/mono-debug.c +++ b/mono/metadata/mono-debug.c @@ -100,7 +100,7 @@ lookup_data_table (MonoDomain *domain) { MonoDebugDataTable *table; - table = g_hash_table_lookup (data_table_hash, domain); + table = (MonoDebugDataTable *)g_hash_table_lookup (data_table_hash, domain); if (!table) { g_error ("lookup_data_table () failed for %p\n", domain); g_assert (table); @@ -137,7 +137,7 @@ mono_debug_init (MonoDebugFormat format) mono_debug_initialized = TRUE; mono_debug_format = format; - mono_mutex_init_recursive (&debugger_lock_mutex); + mono_os_mutex_init_recursive (&debugger_lock_mutex); mono_debugger_lock (); @@ -197,7 +197,7 @@ mono_debug_domain_unload (MonoDomain *domain) mono_debugger_lock (); - table = g_hash_table_lookup (data_table_hash, domain); + table = (MonoDebugDataTable *)g_hash_table_lookup (data_table_hash, domain); if (!table) { g_warning (G_STRLOC ": unloading unknown domain %p / %d", domain, mono_domain_get_id (domain)); @@ -216,7 +216,7 @@ mono_debug_domain_unload (MonoDomain *domain) static MonoDebugHandle * mono_debug_get_image (MonoImage *image) { - return g_hash_table_lookup (mono_debug_handles, image); + return (MonoDebugHandle *)g_hash_table_lookup (mono_debug_handles, image); } void @@ -444,7 +444,7 @@ mono_debug_add_method (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoDoma (25 + sizeof (gpointer)) * (1 + jit->num_params + jit->num_locals); if (max_size > BUFSIZ) - ptr = oldptr = g_malloc (max_size); + ptr = oldptr = (guint8 *)g_malloc (max_size); else ptr = oldptr = buffer; @@ -482,9 +482,9 @@ mono_debug_add_method (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoDoma total_size = size + sizeof (MonoDebugMethodAddress); if (method_is_dynamic (method)) { - address = g_malloc0 (total_size); + address = (MonoDebugMethodAddress *)g_malloc0 (total_size); } else { - address = mono_mempool_alloc (table->mp, total_size); + address = (MonoDebugMethodAddress *)mono_mempool_alloc (table->mp, total_size); } address->code_start = jit->code_start; @@ -515,7 +515,7 @@ mono_debug_remove_method (MonoMethod *method, MonoDomain *domain) table = lookup_data_table (domain); - address = g_hash_table_lookup (table->method_address_hash, method); + address = (MonoDebugMethodAddress *)g_hash_table_lookup (table->method_address_hash, method); if (address) g_free (address); @@ -579,7 +579,7 @@ read_variable (MonoDebugVarInfo *var, guint8 *ptr, guint8 **rptr) var->size = read_leb128 (ptr, &ptr); var->begin_scope = read_leb128 (ptr, &ptr); var->end_scope = read_leb128 (ptr, &ptr); - READ_UNALIGNED (gpointer, ptr, var->type); + READ_UNALIGNED (MonoType *, ptr, var->type); ptr += sizeof (gpointer); *rptr = ptr; } @@ -655,7 +655,7 @@ find_method (MonoMethod *method, MonoDomain *domain) MonoDebugMethodAddress *address; table = lookup_data_table (domain); - address = g_hash_table_lookup (table->method_address_hash, method); + address = (MonoDebugMethodAddress *)g_hash_table_lookup (table->method_address_hash, method); if (!address) return NULL; @@ -775,6 +775,20 @@ mono_debug_lookup_source_location (MonoMethod *method, guint32 address, MonoDoma return location; } +MonoDebugSourceLocation * +mono_debug_method_lookup_location (MonoDebugMethodInfo *minfo, int il_offset) +{ + MonoDebugSourceLocation *location; + + mono_debugger_lock (); + if (minfo->handle->ppdb) + location = mono_ppdb_lookup_location (minfo, il_offset); + else + location = mono_debug_symfile_lookup_location (minfo, il_offset); + mono_debugger_unlock (); + return location; +} + /* * mono_debug_lookup_locals: * @@ -947,14 +961,14 @@ void mono_debugger_lock (void) { g_assert (mono_debug_initialized); - mono_mutex_lock (&debugger_lock_mutex); + mono_os_mutex_lock (&debugger_lock_mutex); } void mono_debugger_unlock (void) { g_assert (mono_debug_initialized); - mono_mutex_unlock (&debugger_lock_mutex); + mono_os_mutex_unlock (&debugger_lock_mutex); } /** diff --git a/mono/metadata/mono-debug.h b/mono/metadata/mono-debug.h index c2134bb2e03..8885e521bad 100644 --- a/mono/metadata/mono-debug.h +++ b/mono/metadata/mono-debug.h @@ -185,6 +185,9 @@ mono_debug_add_delegate_trampoline (void* code, int size); MONO_API MonoDebugLocalsInfo* mono_debug_lookup_locals (MonoMethod *method); +MonoDebugSourceLocation * +mono_debug_method_lookup_location (MonoDebugMethodInfo *minfo, int il_offset); + /* * Line number support. */ diff --git a/mono/metadata/mono-hash.c b/mono/metadata/mono-hash.c index bbfa757212b..aaff73db581 100644 --- a/mono/metadata/mono-hash.c +++ b/mono/metadata/mono-hash.c @@ -173,7 +173,7 @@ typedef struct { static void* do_rehash (void *_data) { - RehashData *data = _data; + RehashData *data = (RehashData *)_data; MonoGHashTable *hash = data->hash; int current_size, i; Slot **table; @@ -425,17 +425,17 @@ mono_g_hash_table_insert_replace (MonoGHashTable *hash, gpointer key, gpointer v if (replace){ if (hash->key_destroy_func != NULL) (*hash->key_destroy_func)(s->key); - s->key = key; + s->key = (MonoObject *)key; } if (hash->value_destroy_func != NULL) (*hash->value_destroy_func) (s->value); - s->value = value; + s->value = (MonoObject *)value; return; } } s = new_slot (hash); - s->key = key; - s->value = value; + s->key = (MonoObject *)key; + s->value = (MonoObject *)value; s->next = hash->table [hashcode]; hash->table [hashcode] = s; hash->in_use++; diff --git a/mono/metadata/mono-perfcounters.c b/mono/metadata/mono-perfcounters.c index 2cc6a65a254..e622308066a 100644 --- a/mono/metadata/mono-perfcounters.c +++ b/mono/metadata/mono-perfcounters.c @@ -153,8 +153,8 @@ enum { }; static mono_mutex_t perfctr_mutex; -#define perfctr_lock() mono_mutex_lock (&perfctr_mutex) -#define perfctr_unlock() mono_mutex_unlock (&perfctr_mutex) +#define perfctr_lock() mono_os_mutex_lock (&perfctr_mutex) +#define perfctr_unlock() mono_os_mutex_unlock (&perfctr_mutex) typedef struct { char reserved [16]; @@ -359,9 +359,9 @@ load_sarea_for_pid (int pid) perfctr_lock (); if (pid_to_shared_area == NULL) pid_to_shared_area = g_hash_table_new (NULL, NULL); - data = g_hash_table_lookup (pid_to_shared_area, GINT_TO_POINTER (pid)); + data = (ExternalSArea *)g_hash_table_lookup (pid_to_shared_area, GINT_TO_POINTER (pid)); if (!data) { - area = mono_shared_area_for_pid (GINT_TO_POINTER (pid)); + area = (MonoSharedArea *)mono_shared_area_for_pid (GINT_TO_POINTER (pid)); if (area) { data = g_new (ExternalSArea, 1); data->sarea = area; @@ -369,7 +369,7 @@ load_sarea_for_pid (int pid) g_hash_table_insert (pid_to_shared_area, GINT_TO_POINTER (pid), data); } } else { - area = data->sarea; + area = (MonoSharedArea *)data->sarea; data->refcount ++; } perfctr_unlock (); @@ -380,7 +380,7 @@ static void unref_pid_unlocked (int pid) { ExternalSArea *data; - data = g_hash_table_lookup (pid_to_shared_area, GINT_TO_POINTER (pid)); + data = (ExternalSArea *)g_hash_table_lookup (pid_to_shared_area, GINT_TO_POINTER (pid)); if (data) { data->refcount--; if (!data->refcount) { @@ -537,9 +537,9 @@ mono_perfcounters_init (void) d_offset += 7; d_offset &= ~7; - mono_mutex_init_recursive (&perfctr_mutex); + mono_os_mutex_init_recursive (&perfctr_mutex); - shared_area = mono_shared_area (); + shared_area = (MonoSharedArea *)mono_shared_area (); shared_area->counters_start = G_STRUCT_OFFSET (MonoSharedArea, counters); shared_area->counters_size = sizeof (MonoPerfCounters); shared_area->data_start = d_offset; @@ -645,7 +645,7 @@ typedef struct { static gboolean category_search (SharedHeader *header, void *data) { - CatSearch *search = data; + CatSearch *search = (CatSearch *)data; if (header->ftype == FTYPE_CATEGORY) { SharedCategory *cat = (SharedCategory*)header; if (mono_string_compare_ascii (search->name, cat->name) == 0) { @@ -669,7 +669,7 @@ find_custom_category (MonoString *name) static gboolean category_collect (SharedHeader *header, void *data) { - GSList **list = data; + GSList **list = (GSList **)data; if (header->ftype == FTYPE_CATEGORY) { *list = g_slist_prepend (*list, header); } @@ -718,7 +718,7 @@ typedef struct { static gboolean instance_search (SharedHeader *header, void *data) { - InstanceSearch *search = data; + InstanceSearch *search = (InstanceSearch *)data; if (header->ftype == FTYPE_INSTANCE) { SharedInstance *ins = (SharedInstance*)header; if (search->cat_offset == ins->category_offset) { @@ -890,7 +890,7 @@ network_cleanup (ImplVtable *vtable) if (vtable == NULL) return; - narg = vtable->arg; + narg = (NetworkVtableArg *)vtable->arg; if (narg == NULL) return; @@ -1219,7 +1219,7 @@ static gint64 custom_writable_update (ImplVtable *vtable, MonoBoolean do_incr, gint64 value) { /* FIXME: check writability */ - guint64 *ptr = vtable->arg; + guint64 *ptr = (guint64 *)vtable->arg; if (ptr) { if (do_incr) { /* FIXME: we need to do this atomically */ @@ -1304,7 +1304,7 @@ custom_get_impl (SharedCategory *cat, MonoString* counter, MonoString* instance, g_free (name); if (!inst) return NULL; - return custom_vtable (scounter, inst, custom_get_value_address (scounter, inst)); + return custom_vtable (scounter, inst, (char *)custom_get_value_address (scounter, inst)); } static const CategoryDesc* @@ -1361,7 +1361,7 @@ mono_perfcounter_get_impl (MonoString* category, MonoString* counter, MonoString MonoBoolean mono_perfcounter_get_sample (void *impl, MonoBoolean only_value, MonoCounterSample *sample) { - ImplVtable *vtable = impl; + ImplVtable *vtable = (ImplVtable *)impl; if (vtable && vtable->sample) return vtable->sample (vtable, only_value, sample); return FALSE; @@ -1370,7 +1370,7 @@ mono_perfcounter_get_sample (void *impl, MonoBoolean only_value, MonoCounterSamp gint64 mono_perfcounter_update_value (void *impl, MonoBoolean do_incr, gint64 value) { - ImplVtable *vtable = impl; + ImplVtable *vtable = (ImplVtable *)impl; if (vtable && vtable->update) return vtable->update (vtable, do_incr, value); return 0; @@ -1379,7 +1379,7 @@ mono_perfcounter_update_value (void *impl, MonoBoolean do_incr, gint64 value) void mono_perfcounter_free_data (void *impl) { - ImplVtable *vtable = impl; + ImplVtable *vtable = (ImplVtable *)impl; if (vtable && vtable->cleanup) vtable->cleanup (vtable); g_free (impl); @@ -1596,7 +1596,7 @@ mono_perfcounter_category_names (MonoString *machine) mono_array_setref (res, i, mono_string_new (domain, cdesc->name)); } for (tmp = custom_categories; tmp; tmp = tmp->next) { - SharedCategory *scat = tmp->data; + SharedCategory *scat = (SharedCategory *)tmp->data; mono_array_setref (res, i, mono_string_new (domain, scat->name)); i++; } @@ -1674,7 +1674,7 @@ get_string_array_of_strings (void **array, int count) MonoDomain *domain = mono_domain_get (); MonoArray * res = mono_array_new (mono_domain_get (), mono_get_string_class (), count); for (i = 0; i < count; ++i) { - char* p = array[i]; + char* p = (char *)array[i]; mono_array_setref (res, i, mono_string_new (domain, p)); } @@ -1753,7 +1753,7 @@ get_custom_instances (MonoString *category) int i = 0; MonoArray *array = mono_array_new (mono_domain_get (), mono_get_string_class (), g_slist_length (list)); for (tmp = list; tmp; tmp = tmp->next) { - SharedInstance *inst = tmp->data; + SharedInstance *inst = (SharedInstance *)tmp->data; mono_array_setref (array, i, mono_string_new (mono_domain_get (), inst->instance_name)); i++; } @@ -1802,7 +1802,7 @@ mono_perfcounter_foreach_shared_item (SharedHeader *header, gpointer data) SharedCategory *cat; SharedCounter *counter; SharedInstance *inst; - PerfCounterForeachData *foreach_data = data; + PerfCounterForeachData *foreach_data = (PerfCounterForeachData *)data; if (header->ftype == FTYPE_CATEGORY) { cat = (SharedCategory*)header; diff --git a/mono/metadata/mono-ptr-array.h b/mono/metadata/mono-ptr-array.h index 8ecac986610..00b3b09c392 100644 --- a/mono/metadata/mono-ptr-array.h +++ b/mono/metadata/mono-ptr-array.h @@ -34,7 +34,9 @@ typedef struct { (ARRAY).capacity = MAX (INITIAL_SIZE, MONO_PTR_ARRAY_MAX_ON_STACK); \ (ARRAY).source = SOURCE; \ (ARRAY).msg = MSG; \ - (ARRAY).data = INITIAL_SIZE > MONO_PTR_ARRAY_MAX_ON_STACK ? mono_gc_alloc_fixed (sizeof (void*) * INITIAL_SIZE, mono_gc_make_root_descr_all_refs (INITIAL_SIZE), SOURCE, MSG) : g_newa (void*, MONO_PTR_ARRAY_MAX_ON_STACK); \ + (ARRAY).data = INITIAL_SIZE > MONO_PTR_ARRAY_MAX_ON_STACK \ + ? (void **)mono_gc_alloc_fixed (sizeof (void*) * INITIAL_SIZE, mono_gc_make_root_descr_all_refs (INITIAL_SIZE), SOURCE, MSG) \ + : g_newa (void*, MONO_PTR_ARRAY_MAX_ON_STACK); \ } while (0) #define mono_ptr_array_destroy(ARRAY) do {\ @@ -44,8 +46,8 @@ typedef struct { #define mono_ptr_array_append(ARRAY, VALUE) do { \ if ((ARRAY).size >= (ARRAY).capacity) {\ - void *__tmp = mono_gc_alloc_fixed (sizeof (void*) * (ARRAY).capacity * 2, mono_gc_make_root_descr_all_refs ((ARRAY).capacity * 2), (ARRAY).source, (ARRAY).msg); \ - mono_gc_memmove_aligned (__tmp, (ARRAY).data, (ARRAY).capacity * sizeof (void*)); \ + void **__tmp = (void **)mono_gc_alloc_fixed (sizeof (void*) * (ARRAY).capacity * 2, mono_gc_make_root_descr_all_refs ((ARRAY).capacity * 2), (ARRAY).source, (ARRAY).msg); \ + mono_gc_memmove_aligned ((void *)__tmp, (ARRAY).data, (ARRAY).capacity * sizeof (void*)); \ if ((ARRAY).capacity > MONO_PTR_ARRAY_MAX_ON_STACK) \ mono_gc_free_fixed ((ARRAY).data); \ (ARRAY).data = __tmp; \ diff --git a/mono/metadata/mono-security.c b/mono/metadata/mono-security.c index c5024b86a73..6dfa3d846ce 100644 --- a/mono/metadata/mono-security.c +++ b/mono/metadata/mono-security.c @@ -153,7 +153,7 @@ GetTokenName (uid_t uid) #else fbufsize = MONO_SYSCONF_DEFAULT_SIZE; #endif - fbuf = g_malloc0 (fbufsize); + fbuf = (gchar *)g_malloc0 (fbufsize); retval = getpwuid_r (uid, &pwd, fbuf, fbufsize, &p); result = ((retval == 0) && (p == &pwd)); #else @@ -220,7 +220,7 @@ IsDefaultGroup (uid_t user, gid_t group) fbufsize = MONO_SYSCONF_DEFAULT_SIZE; #endif - fbuf = g_malloc0 (fbufsize); + fbuf = (gchar *)g_malloc0 (fbufsize); retval = getpwuid_r (user, &pwd, fbuf, fbufsize, &p); result = ((retval == 0) && (p == &pwd)); #else @@ -359,7 +359,7 @@ ves_icall_System_Security_Principal_WindowsIdentity_GetUserToken (MonoString *us fbufsize = MONO_SYSCONF_DEFAULT_SIZE; #endif - fbuf = g_malloc0 (fbufsize); + fbuf = (gchar *)g_malloc0 (fbufsize); retval = getpwnam_r (utf8_name, &pwd, fbuf, fbufsize, &p); result = ((retval == 0) && (p == &pwd)); #else @@ -500,7 +500,7 @@ ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupId (gpointer #else fbufsize = MONO_SYSCONF_DEFAULT_SIZE; #endif - fbuf = g_malloc0 (fbufsize); + fbuf = (gchar *)g_malloc0 (fbufsize); retval = getgrgid_r ((gid_t) GPOINTER_TO_INT (group), &grp, fbuf, fbufsize, &g); result = ((retval == 0) && (g == &grp)); #else @@ -547,7 +547,7 @@ ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupName (gpoint #else size_t fbufsize = MONO_SYSCONF_DEFAULT_SIZE; #endif - fbuf = g_malloc0 (fbufsize); + fbuf = (gchar *)g_malloc0 (fbufsize); retval = getgrnam_r (utf8_groupname, &grp, fbuf, fbufsize, &g); result = ((retval == 0) && (g == &grp)); #else diff --git a/mono/metadata/null-gc.c b/mono/metadata/null-gc.c index 773410ad7b6..e5c16e1e9a4 100644 --- a/mono/metadata/null-gc.c +++ b/mono/metadata/null-gc.c @@ -528,12 +528,6 @@ mono_gc_register_altstack (gpointer stack, gint32 stack_size, gpointer altstack, { } -gboolean -mono_gc_set_allow_synchronous_major (gboolean flag) -{ - return TRUE; -} - gboolean mono_gc_is_null (void) { diff --git a/mono/metadata/object-internals.h b/mono/metadata/object-internals.h index eb9e1c61a8c..d36dfc72072 100644 --- a/mono/metadata/object-internals.h +++ b/mono/metadata/object-internals.h @@ -12,6 +12,7 @@ #include "mono/utils/mono-error.h" #include "mono/utils/mono-stack-unwinding.h" #include "mono/utils/mono-tls.h" +#include "mono/utils/mono-coop-mutex.h" #if 1 #ifdef __GNUC__ @@ -163,6 +164,8 @@ struct _MonoArray { double vector [MONO_ZERO_LEN_ARRAY]; }; +#define MONO_SIZEOF_MONO_ARRAY (sizeof (MonoArray) - MONO_ZERO_LEN_ARRAY * sizeof (double)) + struct _MonoString { MonoObject object; int32_t length; @@ -406,7 +409,7 @@ struct _MonoInternalThread { gpointer appdomain_refs; /* This is modified using atomic ops, so keep it a gint32 */ gint32 interruption_requested; - mono_mutex_t *synch_cs; + MonoCoopMutex *synch_cs; MonoBoolean threadpool_thread; MonoBoolean thread_interrupt_requested; int stack_size; diff --git a/mono/metadata/object.c b/mono/metadata/object.c index 938289bd8f8..a28c6f15d9d 100644 --- a/mono/metadata/object.c +++ b/mono/metadata/object.c @@ -59,8 +59,8 @@ static char * mono_string_to_utf8_internal (MonoMemPool *mp, MonoImage *image, MonoString *s, gboolean ignore_error, MonoError *error); -#define ldstr_lock() mono_mutex_lock (&ldstr_section) -#define ldstr_unlock() mono_mutex_unlock (&ldstr_section) +#define ldstr_lock() mono_os_mutex_lock (&ldstr_section) +#define ldstr_unlock() mono_os_mutex_unlock (&ldstr_section) static mono_mutex_t ldstr_section; void @@ -76,7 +76,7 @@ mono_runtime_object_init (MonoObject *this_obj) g_error ("Could not lookup zero argument constructor for class %s", mono_type_get_full_name (klass)); if (method->klass->valuetype) - this_obj = mono_object_unbox (this_obj); + this_obj = (MonoObject *)mono_object_unbox (this_obj); mono_runtime_invoke (method, this_obj, NULL, NULL); } @@ -108,25 +108,23 @@ typedef struct MonoNativeThreadId initializing_tid; guint32 waiting_count; gboolean done; - mono_mutex_t initialization_section; + MonoCoopMutex initialization_section; } TypeInitializationLock; /* for locking access to type_initialization_hash and blocked_thread_hash */ -static mono_mutex_t type_initialization_section; +static MonoCoopMutex type_initialization_section; static inline void mono_type_initialization_lock (void) { /* The critical sections protected by this lock in mono_runtime_class_init_full () can block */ - MONO_PREPARE_BLOCKING; - mono_mutex_lock (&type_initialization_section); - MONO_FINISH_BLOCKING; + mono_coop_mutex_lock (&type_initialization_section); } static inline void mono_type_initialization_unlock (void) { - mono_mutex_unlock (&type_initialization_section); + mono_coop_mutex_unlock (&type_initialization_section); } static void @@ -134,15 +132,13 @@ mono_type_init_lock (TypeInitializationLock *lock) { MONO_REQ_GC_NEUTRAL_MODE; - MONO_TRY_BLOCKING; - mono_mutex_lock (&lock->initialization_section); - MONO_FINISH_TRY_BLOCKING; + mono_coop_mutex_lock (&lock->initialization_section); } static void mono_type_init_unlock (TypeInitializationLock *lock) { - mono_mutex_unlock (&lock->initialization_section); + mono_coop_mutex_unlock (&lock->initialization_section); } /* from vtable to lock */ @@ -192,10 +188,10 @@ mono_thread_get_main (void) void mono_type_initialization_init (void) { - mono_mutex_init_recursive (&type_initialization_section); + mono_coop_mutex_init_recursive (&type_initialization_section); type_initialization_hash = g_hash_table_new (NULL, NULL); blocked_thread_hash = g_hash_table_new (NULL, NULL); - mono_mutex_init_recursive (&ldstr_section); + mono_os_mutex_init_recursive (&ldstr_section); } void @@ -205,11 +201,11 @@ mono_type_initialization_cleanup (void) /* This is causing race conditions with * mono_release_type_locks */ - mono_mutex_destroy (&type_initialization_section); + mono_coop_mutex_destroy (&type_initialization_section); g_hash_table_destroy (type_initialization_hash); type_initialization_hash = NULL; #endif - mono_mutex_destroy (&ldstr_section); + mono_os_mutex_destroy (&ldstr_section); g_hash_table_destroy (blocked_thread_hash); blocked_thread_hash = NULL; @@ -241,7 +237,7 @@ get_type_init_exception_for_vtable (MonoVTable *vtable) ex = NULL; mono_domain_lock (domain); if (domain->type_init_exception_hash) - ex = mono_g_hash_table_lookup (domain->type_init_exception_hash, klass); + ex = (MonoException *)mono_g_hash_table_lookup (domain->type_init_exception_hash, klass); mono_domain_unlock (domain); if (!ex) { @@ -342,7 +338,7 @@ mono_runtime_class_init_full (MonoVTable *vtable, gboolean raise_exception) mono_raise_exception (get_type_init_exception_for_vtable (vtable)); return get_type_init_exception_for_vtable (vtable); } - lock = g_hash_table_lookup (type_initialization_hash, vtable); + lock = (TypeInitializationLock *)g_hash_table_lookup (type_initialization_hash, vtable); if (lock == NULL) { /* This thread will get to do the initialization */ if (mono_domain_get () != domain) { @@ -356,8 +352,8 @@ mono_runtime_class_init_full (MonoVTable *vtable, gboolean raise_exception) return mono_get_exception_appdomain_unloaded (); } } - lock = g_malloc (sizeof(TypeInitializationLock)); - mono_mutex_init_recursive (&lock->initialization_section); + lock = (TypeInitializationLock *)g_malloc (sizeof (TypeInitializationLock)); + mono_coop_mutex_init_recursive (&lock->initialization_section); lock->initializing_tid = tid; lock->waiting_count = 1; lock->done = FALSE; @@ -440,7 +436,7 @@ mono_runtime_class_init_full (MonoVTable *vtable, gboolean raise_exception) g_hash_table_remove (blocked_thread_hash, GUINT_TO_POINTER (tid)); --lock->waiting_count; if (lock->waiting_count == 0) { - mono_mutex_destroy (&lock->initialization_section); + mono_coop_mutex_destroy (&lock->initialization_section); g_hash_table_remove (type_initialization_hash, vtable); g_free (lock); } @@ -477,7 +473,7 @@ gboolean release_type_locks (gpointer key, gpointer value, gpointer user) mono_type_init_unlock (lock); --lock->waiting_count; if (lock->waiting_count == 0) { - mono_mutex_destroy (&lock->initialization_section); + mono_coop_mutex_destroy (&lock->initialization_section); g_free (lock); return TRUE; } @@ -695,7 +691,7 @@ compute_class_bitmap (MonoClass *klass, gsize *bitmap, int size, int offset, int max_size = klass->instance_size / sizeof (gpointer); if (max_size > size) { g_assert (offset <= 0); - bitmap = g_malloc0 ((max_size + BITMAP_EL_SIZE - 1) / BITMAP_EL_SIZE * sizeof (gsize)); + bitmap = (gsize *)g_malloc0 ((max_size + BITMAP_EL_SIZE - 1) / BITMAP_EL_SIZE * sizeof (gsize)); size = max_size; } @@ -1113,7 +1109,7 @@ mono_method_get_imt_slot (MonoMethod *method) sig = mono_method_signature (method); hashes_count = sig->param_count + 4; - hashes_start = malloc (hashes_count * sizeof (guint32)); + hashes_start = (guint32 *)malloc (hashes_count * sizeof (guint32)); hashes = hashes_start; if (! MONO_CLASS_IS_INTERFACE (method->klass)) { @@ -1175,7 +1171,7 @@ add_imt_builder_entry (MonoImtBuilderEntry **imt_builder, MonoMethod *method, gu return; } - entry = g_malloc0 (sizeof (MonoImtBuilderEntry)); + entry = (MonoImtBuilderEntry *)g_malloc0 (sizeof (MonoImtBuilderEntry)); entry->key = method; entry->value.vtable_slot = vtable_slot; entry->next = imt_builder [imt_slot]; @@ -1265,7 +1261,7 @@ imt_sort_slot_entries (MonoImtBuilderEntry *entries) { MONO_REQ_GC_NEUTRAL_MODE; int number_of_entries = entries->children + 1; - MonoImtBuilderEntry **sorted_array = malloc (sizeof (MonoImtBuilderEntry*) * number_of_entries); + MonoImtBuilderEntry **sorted_array = (MonoImtBuilderEntry **)malloc (sizeof (MonoImtBuilderEntry*) * number_of_entries); GPtrArray *result = g_ptr_array_new (); MonoImtBuilderEntry *current_entry; int i; @@ -1330,7 +1326,7 @@ build_imt_slots (MonoClass *klass, MonoVTable *vt, MonoDomain *domain, gpointer* int i; GSList *list_item; guint32 imt_collisions_bitmap = 0; - MonoImtBuilderEntry **imt_builder = calloc (MONO_IMT_SIZE, sizeof (MonoImtBuilderEntry*)); + MonoImtBuilderEntry **imt_builder = (MonoImtBuilderEntry **)calloc (MONO_IMT_SIZE, sizeof (MonoImtBuilderEntry*)); int method_count = 0; gboolean record_method_count_for_max_collisions = FALSE; gboolean has_generic_virtual = FALSE, has_variant_iface = FALSE; @@ -1381,7 +1377,7 @@ build_imt_slots (MonoClass *klass, MonoVTable *vt, MonoDomain *domain, gpointer* int interface_offset = klass->vtable_size; for (list_item = extra_interfaces; list_item != NULL; list_item=list_item->next) { - MonoClass* iface = list_item->data; + MonoClass* iface = (MonoClass *)list_item->data; int method_slot_in_interface; for (method_slot_in_interface = 0; method_slot_in_interface < iface->method.count; method_slot_in_interface++) { MonoMethod *method = mono_class_get_method_by_index (iface, method_slot_in_interface); @@ -1533,7 +1529,7 @@ init_thunk_free_lists (MonoDomain *domain) if (domain->thunk_free_lists) return; - domain->thunk_free_lists = mono_domain_alloc0 (domain, sizeof (gpointer) * NUM_FREE_LISTS); + domain->thunk_free_lists = (MonoThunkFreeList **)mono_domain_alloc0 (domain, sizeof (gpointer) * NUM_FREE_LISTS); } static int @@ -1606,7 +1602,7 @@ mono_method_alloc_generic_virtual_thunk (MonoDomain *domain, int size) } generic_virtual_thunks_size += size; - p = mono_domain_code_reserve (domain, size); + p = (guint32 *)mono_domain_code_reserve (domain, size); *p = size; mono_domain_lock (domain); @@ -1626,7 +1622,7 @@ invalidate_generic_virtual_thunk (MonoDomain *domain, gpointer code) { MONO_REQ_GC_NEUTRAL_MODE; - guint32 *p = code; + guint32 *p = (guint32 *)code; MonoThunkFreeList *l = (MonoThunkFreeList*)(p - 1); gboolean found = FALSE; @@ -1696,7 +1692,7 @@ get_generic_virtual_entries (MonoDomain *domain, gpointer *vtable_slot) if (!domain->generic_virtual_cases) domain->generic_virtual_cases = g_hash_table_new (mono_aligned_addr_hash, NULL); - list = g_hash_table_lookup (domain->generic_virtual_cases, vtable_slot); + list = (GenericVirtualCase *)g_hash_table_lookup (domain->generic_virtual_cases, vtable_slot); entries = NULL; for (; list; list = list->next) { @@ -1753,7 +1749,7 @@ mono_method_add_generic_virtual_invocation (MonoDomain *domain, MonoVTable *vtab domain->generic_virtual_cases = g_hash_table_new (mono_aligned_addr_hash, NULL); /* Check whether the case was already added */ - list = g_hash_table_lookup (domain->generic_virtual_cases, vtable_slot); + list = (GenericVirtualCase *)g_hash_table_lookup (domain->generic_virtual_cases, vtable_slot); gvc = list; while (gvc) { if (gvc->method == method) @@ -1763,11 +1759,11 @@ mono_method_add_generic_virtual_invocation (MonoDomain *domain, MonoVTable *vtab /* If not found, make a new one */ if (!gvc) { - gvc = mono_domain_alloc (domain, sizeof (GenericVirtualCase)); + gvc = (GenericVirtualCase *)mono_domain_alloc (domain, sizeof (GenericVirtualCase)); gvc->method = method; gvc->code = code; gvc->count = 0; - gvc->next = g_hash_table_lookup (domain->generic_virtual_cases, vtable_slot); + gvc->next = (GenericVirtualCase *)g_hash_table_lookup (domain->generic_virtual_cases, vtable_slot); g_hash_table_insert (domain->generic_virtual_cases, vtable_slot, gvc); @@ -1779,7 +1775,7 @@ mono_method_add_generic_virtual_invocation (MonoDomain *domain, MonoVTable *vtab } if (++gvc->count == THUNK_THRESHOLD) { - gpointer *old_thunk = *vtable_slot; + gpointer *old_thunk = (void **)*vtable_slot; gpointer vtable_trampoline = NULL; gpointer imt_trampoline = NULL; @@ -2168,7 +2164,7 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *klass, gboolean if (klass != mono_defaults.monotype_class) { /*FIXME check for OOM*/ vt->type = mono_type_get_object (domain, &klass->byval_arg); - if (mono_object_get_class (vt->type) != mono_defaults.monotype_class) + if (mono_object_get_class ((MonoObject *)vt->type) != mono_defaults.monotype_class) /* This is unregistered in unregister_vtable_reflection_type() in domain.c. */ @@ -2207,7 +2203,7 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *klass, gboolean /* this is a bounded memory retention issue: may want to * handle it differently when we'll have a rcu-like system. */ - runtime_info = mono_image_alloc0 (klass->image, MONO_SIZEOF_CLASS_RUNTIME_INFO + new_size * sizeof (gpointer)); + runtime_info = (MonoClassRuntimeInfo *)mono_image_alloc0 (klass->image, MONO_SIZEOF_CLASS_RUNTIME_INFO + new_size * sizeof (gpointer)); runtime_info->max_domain = new_size - 1; /* copy the stuff from the older info */ if (old_info) { @@ -2222,7 +2218,7 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *klass, gboolean if (klass == mono_defaults.monotype_class) { /*FIXME check for OOM*/ vt->type = mono_type_get_object (domain, &klass->byval_arg); - if (mono_object_get_class (vt->type) != mono_defaults.monotype_class) + if (mono_object_get_class ((MonoObject *)vt->type) != mono_defaults.monotype_class) /* This is unregistered in unregister_vtable_reflection_type() in domain.c. */ @@ -2295,7 +2291,7 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono g_assert (mono_error_ok (&error)); /*FIXME do proper error handling*/ if (ifaces) { for (i = 0; i < ifaces->len; ++i) { - MonoClass *ic = g_ptr_array_index (ifaces, i); + MonoClass *ic = (MonoClass *)g_ptr_array_index (ifaces, i); /*FIXME test for interfaces with variant generic arguments*/ if (MONO_CLASS_IMPLEMENTS_INTERFACE (klass, ic->interface_id)) continue; /* interface implemented by the class */ @@ -2354,9 +2350,9 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono pvt->max_interface_id = max_interface_id; bsize = sizeof (guint8) * (max_interface_id/8 + 1 ); #ifdef COMPRESSED_INTERFACE_BITMAP - bitmap = g_malloc0 (bsize); + bitmap = (uint8_t *)g_malloc0 (bsize); #else - bitmap = mono_domain_alloc0 (domain, bsize); + bitmap = (uint8_t *)mono_domain_alloc0 (domain, bsize); #endif for (i = 0; i < klass->interface_offsets_count; ++i) { @@ -2373,7 +2369,7 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono /* Create trampolines for the methods of the interfaces */ for (list_item = extra_interfaces; list_item != NULL; list_item=list_item->next) { - interf = list_item->data; + interf = (MonoClass *)list_item->data; bitmap [interf->interface_id >> 3] |= (1 << (interf->interface_id & 7)); @@ -2486,18 +2482,18 @@ create_remote_class_key (MonoRemoteClass *remote_class, MonoClass *extra_class) if (remote_class == NULL) { if (extra_class->flags & TYPE_ATTRIBUTE_INTERFACE) { - key = g_malloc (sizeof(gpointer) * 3); + key = (void **)g_malloc (sizeof(gpointer) * 3); key [0] = GINT_TO_POINTER (2); key [1] = mono_defaults.marshalbyrefobject_class; key [2] = extra_class; } else { - key = g_malloc (sizeof(gpointer) * 2); + key = (void **)g_malloc (sizeof(gpointer) * 2); key [0] = GINT_TO_POINTER (1); key [1] = extra_class; } } else { if (extra_class != NULL && (extra_class->flags & TYPE_ATTRIBUTE_INTERFACE)) { - key = g_malloc (sizeof(gpointer) * (remote_class->interface_count + 3)); + key = (void **)g_malloc (sizeof(gpointer) * (remote_class->interface_count + 3)); key [0] = GINT_TO_POINTER (remote_class->interface_count + 2); key [1] = remote_class->proxy_class; @@ -2513,7 +2509,7 @@ create_remote_class_key (MonoRemoteClass *remote_class, MonoClass *extra_class) key [j] = extra_class; } else { // Replace the old class. The interface list is the same - key = g_malloc (sizeof(gpointer) * (remote_class->interface_count + 2)); + key = (void **)g_malloc (sizeof(gpointer) * (remote_class->interface_count + 2)); key [0] = GINT_TO_POINTER (remote_class->interface_count + 1); key [1] = extra_class != NULL ? extra_class : remote_class->proxy_class; for (i = 0; i < remote_class->interface_count; i++) @@ -2535,7 +2531,7 @@ copy_remote_class_key (MonoDomain *domain, gpointer *key) MONO_REQ_GC_NEUTRAL_MODE int key_size = (GPOINTER_TO_UINT (key [0]) + 1) * sizeof (gpointer); - gpointer *mp_key = mono_domain_alloc (domain, key_size); + gpointer *mp_key = (gpointer *)mono_domain_alloc (domain, key_size); memcpy (mp_key, key, key_size); @@ -2564,7 +2560,7 @@ mono_remote_class (MonoDomain *domain, MonoString *class_name, MonoClass *proxy_ key = create_remote_class_key (NULL, proxy_class); mono_domain_lock (domain); - rc = g_hash_table_lookup (domain->proxy_vtable_hash, key); + rc = (MonoRemoteClass *)g_hash_table_lookup (domain->proxy_vtable_hash, key); if (rc) { g_free (key); @@ -2584,12 +2580,12 @@ mono_remote_class (MonoDomain *domain, MonoString *class_name, MonoClass *proxy_ key = mp_key; if (proxy_class->flags & TYPE_ATTRIBUTE_INTERFACE) { - rc = mono_domain_alloc (domain, MONO_SIZEOF_REMOTE_CLASS + sizeof(MonoClass*)); + rc = (MonoRemoteClass *)mono_domain_alloc (domain, MONO_SIZEOF_REMOTE_CLASS + sizeof(MonoClass*)); rc->interface_count = 1; rc->interfaces [0] = proxy_class; rc->proxy_class = mono_defaults.marshalbyrefobject_class; } else { - rc = mono_domain_alloc (domain, MONO_SIZEOF_REMOTE_CLASS); + rc = (MonoRemoteClass *)mono_domain_alloc (domain, MONO_SIZEOF_REMOTE_CLASS); rc->interface_count = 0; rc->proxy_class = proxy_class; } @@ -2620,7 +2616,7 @@ clone_remote_class (MonoDomain *domain, MonoRemoteClass* remote_class, MonoClass gpointer* key, *mp_key; key = create_remote_class_key (remote_class, extra_class); - rc = g_hash_table_lookup (domain->proxy_vtable_hash, key); + rc = (MonoRemoteClass *)g_hash_table_lookup (domain->proxy_vtable_hash, key); if (rc != NULL) { g_free (key); return rc; @@ -2632,7 +2628,7 @@ clone_remote_class (MonoDomain *domain, MonoRemoteClass* remote_class, MonoClass if (extra_class->flags & TYPE_ATTRIBUTE_INTERFACE) { int i,j; - rc = mono_domain_alloc (domain, MONO_SIZEOF_REMOTE_CLASS + sizeof(MonoClass*) * (remote_class->interface_count + 1)); + rc = (MonoRemoteClass *)mono_domain_alloc (domain, MONO_SIZEOF_REMOTE_CLASS + sizeof(MonoClass*) * (remote_class->interface_count + 1)); rc->proxy_class = remote_class->proxy_class; rc->interface_count = remote_class->interface_count + 1; @@ -2647,7 +2643,7 @@ clone_remote_class (MonoDomain *domain, MonoRemoteClass* remote_class, MonoClass rc->interfaces [j] = extra_class; } else { // Replace the old class. The interface array is the same - rc = mono_domain_alloc (domain, MONO_SIZEOF_REMOTE_CLASS + sizeof(MonoClass*) * remote_class->interface_count); + rc = (MonoRemoteClass *)mono_domain_alloc (domain, MONO_SIZEOF_REMOTE_CLASS + sizeof(MonoClass*) * remote_class->interface_count); rc->proxy_class = extra_class; rc->interface_count = remote_class->interface_count; if (rc->interface_count > 0) @@ -2733,7 +2729,7 @@ mono_upgrade_remote_class (MonoDomain *domain, MonoObject *proxy_object, MonoCla if (redo_vtable) { tproxy->remote_class = clone_remote_class (domain, remote_class, klass); - proxy_object->vtable = mono_remote_class_vtable (domain, tproxy->remote_class, tproxy->rp); + proxy_object->vtable = (MonoVTable *)mono_remote_class_vtable (domain, tproxy->remote_class, tproxy->rp); } mono_domain_unlock (domain); @@ -2954,10 +2950,10 @@ mono_method_get_unmanaged_thunk (MonoMethod *method) gpointer res; - MONO_PREPARE_RESET_BLOCKING + MONO_PREPARE_RESET_BLOCKING; method = mono_marshal_get_thunk_invoke_wrapper (method); res = mono_compile_method (method); - MONO_FINISH_RESET_BLOCKING + MONO_FINISH_RESET_BLOCKING; return res; } @@ -3027,7 +3023,7 @@ handle_enum: case MONO_TYPE_CLASS: case MONO_TYPE_OBJECT: case MONO_TYPE_ARRAY: - mono_gc_wbarrier_generic_store (dest, deref_pointer? *(gpointer*)value: value); + mono_gc_wbarrier_generic_store (dest, deref_pointer ? *(MonoObject **)value : (MonoObject *)value); return; case MONO_TYPE_FNPTR: case MONO_TYPE_PTR: { @@ -3149,7 +3145,7 @@ mono_field_get_addr (MonoObject *obj, MonoVTable *vt, MonoClassField *field) mono_domain_lock (vt->domain); addr = g_hash_table_lookup (vt->domain->special_static_fields, field); mono_domain_unlock (vt->domain); - src = mono_get_special_static_data (GPOINTER_TO_UINT (addr)); + src = (guint8 *)mono_get_special_static_data (GPOINTER_TO_UINT (addr)); } else { src = (guint8*)mono_vtable_get_static_field_data (vt) + field->offset; } @@ -4300,7 +4296,7 @@ mono_runtime_invoke_array (MonoMethod *method, void *obj, MonoArray *params, gboolean has_byref_nullables = FALSE; if (NULL != params) { - pa = alloca (sizeof (gpointer) * mono_array_length (params)); + pa = (void **)alloca (sizeof (gpointer) * mono_array_length (params)); for (i = 0; i < mono_array_length (params); i++) { MonoType *t = sig->params [i]; @@ -4405,7 +4401,7 @@ mono_runtime_invoke_array (MonoMethod *method, void *obj, MonoArray *params, } #endif if (method->klass->valuetype) - o = mono_object_unbox (obj); + o = (MonoObject *)mono_object_unbox ((MonoObject *)obj); else o = obj; } else if (method->klass->valuetype) { @@ -4413,7 +4409,7 @@ mono_runtime_invoke_array (MonoMethod *method, void *obj, MonoArray *params, } mono_runtime_invoke (method, o, pa, exc); - return obj; + return (MonoObject *)obj; } else { if (mono_class_is_nullable (method->klass)) { MonoObject *nullable; @@ -4421,7 +4417,7 @@ mono_runtime_invoke_array (MonoMethod *method, void *obj, MonoArray *params, /* Convert the unboxed vtype into a Nullable structure */ nullable = mono_object_new (mono_domain_get (), method->klass); - mono_nullable_init (mono_object_unbox (nullable), mono_value_box (mono_domain_get (), method->klass->cast_class, obj), method->klass); + mono_nullable_init ((guint8 *)mono_object_unbox (nullable), mono_value_box (mono_domain_get (), method->klass->cast_class, obj), method->klass); obj = mono_object_unbox (nullable); } @@ -4517,7 +4513,7 @@ mono_object_new_pinned (MonoDomain *domain, MonoClass *klass) return NULL; #ifdef HAVE_SGEN_GC - return mono_gc_alloc_pinned_obj (vtable, mono_class_instance_size (klass)); + return (MonoObject *)mono_gc_alloc_pinned_obj (vtable, mono_class_instance_size (klass)); #else return mono_object_new_specific (vtable); #endif @@ -4569,7 +4565,7 @@ mono_object_new_alloc_specific (MonoVTable *vtable) { MONO_REQ_GC_UNSAFE_MODE; - MonoObject *o = mono_gc_alloc_obj (vtable, vtable->klass->instance_size); + MonoObject *o = (MonoObject *)mono_gc_alloc_obj (vtable, vtable->klass->instance_size); if (G_UNLIKELY (vtable->klass->has_finalize)) mono_object_register_finalizer (o); @@ -4582,7 +4578,7 @@ mono_object_new_fast (MonoVTable *vtable) { MONO_REQ_GC_UNSAFE_MODE; - return mono_gc_alloc_obj (vtable, vtable->klass->instance_size); + return (MonoObject *)mono_gc_alloc_obj (vtable, vtable->klass->instance_size); } /** @@ -4665,7 +4661,7 @@ mono_object_clone (MonoObject *obj) if (obj->vtable->klass->rank) return (MonoObject*)mono_array_clone ((MonoArray*)obj); - o = mono_gc_alloc_obj (obj->vtable, size); + o = (MonoObject *)mono_gc_alloc_obj (obj->vtable, size); /* If the object doesn't contain references this will do a simple memmove. */ mono_gc_wbarrier_object_copy (o, obj); @@ -4747,7 +4743,7 @@ mono_array_clone_in_domain (MonoDomain *domain, MonoArray *array) return o; } - sizes = alloca (klass->rank * sizeof(intptr_t) * 2); + sizes = (uintptr_t *)alloca (klass->rank * sizeof(intptr_t) * 2); size = mono_array_element_size (klass); for (i = 0; i < klass->rank; ++i) { sizes [i] = array->bounds [i].length; @@ -4815,9 +4811,9 @@ mono_array_calc_byte_len (MonoClass *klass, uintptr_t len, uintptr_t *res) if (CHECK_MUL_OVERFLOW_UN (byte_len, len)) return FALSE; byte_len *= len; - if (CHECK_ADD_OVERFLOW_UN (byte_len, sizeof (MonoArray))) + if (CHECK_ADD_OVERFLOW_UN (byte_len, MONO_SIZEOF_MONO_ARRAY)) return FALSE; - byte_len += sizeof (MonoArray); + byte_len += MONO_SIZEOF_MONO_ARRAY; *res = byte_len; @@ -4887,9 +4883,9 @@ mono_array_new_full (MonoDomain *domain, MonoClass *array_class, uintptr_t *leng */ vtable = mono_class_vtable_full (domain, array_class, TRUE); if (bounds_size) - o = mono_gc_alloc_array (vtable, byte_len, len, bounds_size); + o = (MonoObject *)mono_gc_alloc_array (vtable, byte_len, len, bounds_size); else - o = mono_gc_alloc_vector (vtable, byte_len, len); + o = (MonoObject *)mono_gc_alloc_vector (vtable, byte_len, len); array = (MonoArray*)o; bounds = array->bounds; @@ -4952,7 +4948,7 @@ mono_array_new_specific (MonoVTable *vtable, uintptr_t n) mono_gc_out_of_memory (MONO_ARRAY_MAX_SIZE); return NULL; } - o = mono_gc_alloc_vector (vtable, byte_len, n); + o = (MonoObject *)mono_gc_alloc_vector (vtable, byte_len, n); ao = (MonoArray*)o; return ao; @@ -5041,7 +5037,7 @@ mono_string_new_size (MonoDomain *domain, gint32 len) vtable = mono_class_vtable (domain, mono_defaults.string_class); g_assert (vtable); - s = mono_gc_alloc_string (vtable, size, len); + s = (MonoString *)mono_gc_alloc_string (vtable, size, len); return s; } @@ -5161,7 +5157,7 @@ mono_value_box (MonoDomain *domain, MonoClass *klass, gpointer value) g_assert (klass->valuetype); if (mono_class_is_nullable (klass)) - return mono_nullable_box (value, klass); + return mono_nullable_box ((guint8 *)value, klass); vtable = mono_class_vtable (domain, klass); if (!vtable) @@ -5283,7 +5279,7 @@ mono_object_get_size (MonoObject* o) return sizeof (MonoString) + 2 * mono_string_length ((MonoString*) o) + 2; } else if (o->vtable->rank) { MonoArray *array = (MonoArray*)o; - size_t size = sizeof (MonoArray) + mono_array_element_size (klass) * mono_array_length (array); + size_t size = MONO_SIZEOF_MONO_ARRAY + mono_array_element_size (klass) * mono_array_length (array); if (array->bounds) { size += 3; size &= ~3; @@ -5430,10 +5426,10 @@ str_lookup (MonoDomain *domain, gpointer user_data) { MONO_REQ_GC_UNSAFE_MODE; - LDStrInfo *info = user_data; + LDStrInfo *info = (LDStrInfo *)user_data; if (info->res || domain == info->orig_domain) return; - info->res = mono_g_hash_table_lookup (domain->ldstr_table, info->ins); + info->res = (MonoString *)mono_g_hash_table_lookup (domain->ldstr_table, info->ins); } #ifdef HAVE_SGEN_GC @@ -5446,7 +5442,7 @@ mono_string_get_pinned (MonoString *str) int size; MonoString *news; size = sizeof (MonoString) + 2 * (mono_string_length (str) + 1); - news = mono_gc_alloc_pinned_obj (((MonoObject*)str)->vtable, size); + news = (MonoString *)mono_gc_alloc_pinned_obj (((MonoObject*)str)->vtable, size); if (news) { memcpy (mono_string_chars (news), mono_string_chars (str), mono_string_length (str) * 2); news->length = mono_string_length (str); @@ -5470,7 +5466,7 @@ mono_string_is_interned_lookup (MonoString *str, int insert) domain = ((MonoObject *)str)->vtable->domain; ldstr_table = domain->ldstr_table; ldstr_lock (); - res = mono_g_hash_table_lookup (ldstr_table, str); + res = (MonoString *)mono_g_hash_table_lookup (ldstr_table, str); if (res) { ldstr_unlock (); return res; @@ -5481,7 +5477,7 @@ mono_string_is_interned_lookup (MonoString *str, int insert) s = mono_string_get_pinned (str); if (s) { ldstr_lock (); - res = mono_g_hash_table_lookup (ldstr_table, str); + res = (MonoString *)mono_g_hash_table_lookup (ldstr_table, str); if (res) { ldstr_unlock (); return res; @@ -5555,7 +5551,7 @@ mono_ldstr (MonoDomain *domain, MonoImage *image, guint32 idx) MONO_REQ_GC_UNSAFE_MODE; if (image->dynamic) { - MonoString *str = mono_lookup_dynamic_token (image, MONO_TOKEN_STRING | idx, NULL); + MonoString *str = (MonoString *)mono_lookup_dynamic_token (image, MONO_TOKEN_STRING | idx, NULL); return str; } else { if (!mono_verifier_verify_string_signature (image, idx, NULL)) @@ -5595,7 +5591,7 @@ mono_ldstr_metadata_sig (MonoDomain *domain, const char* sig) } #endif ldstr_lock (); - interned = mono_g_hash_table_lookup (domain->ldstr_table, o); + interned = (MonoString *)mono_g_hash_table_lookup (domain->ldstr_table, o); ldstr_unlock (); if (interned) return interned; /* o will get garbage collected */ @@ -5603,7 +5599,7 @@ mono_ldstr_metadata_sig (MonoDomain *domain, const char* sig) o = mono_string_get_pinned (o); if (o) { ldstr_lock (); - interned = mono_g_hash_table_lookup (domain->ldstr_table, o); + interned = (MonoString *)mono_g_hash_table_lookup (domain->ldstr_table, o); if (!interned) { mono_g_hash_table_insert (domain->ldstr_table, o, o); interned = o; @@ -5671,7 +5667,7 @@ mono_string_to_utf8_checked (MonoString *s, MonoError *error) /* g_utf16_to_utf8 may not be able to complete the convertion (e.g. NULL values were found, #335488) */ if (s->length > written) { /* allocate the total length and copy the part of the string that has been converted */ - char *as2 = g_malloc0 (s->length); + char *as2 = (char *)g_malloc0 (s->length); memcpy (as2, as, written); g_free (as); as = as2; @@ -5708,7 +5704,7 @@ mono_string_to_utf8_ignore (MonoString *s) /* g_utf16_to_utf8 may not be able to complete the convertion (e.g. NULL values were found, #335488) */ if (s->length > written) { /* allocate the total length and copy the part of the string that has been converted */ - char *as2 = g_malloc0 (s->length); + char *as2 = (char *)g_malloc0 (s->length); memcpy (as2, as, written); g_free (as); as = as2; @@ -5765,7 +5761,7 @@ mono_string_to_utf16 (MonoString *s) if (s == NULL) return NULL; - as = g_malloc ((s->length * 2) + 2); + as = (char *)g_malloc ((s->length * 2) + 2); as [(s->length * 2)] = '\0'; as [(s->length * 2) + 1] = '\0'; @@ -5884,9 +5880,9 @@ mono_string_to_utf8_internal (MonoMemPool *mp, MonoImage *image, MonoString *s, len = strlen (r) + 1; if (mp) - mp_s = mono_mempool_alloc (mp, len); + mp_s = (char *)mono_mempool_alloc (mp, len); else - mp_s = mono_image_alloc (image, len); + mp_s = (char *)mono_image_alloc (image, len); memcpy (mp_s, r, len); @@ -6036,7 +6032,7 @@ mono_runtime_capture_context (MonoDomain *domain) domain->capture_context_method = mono_compile_method (method); } - runtime_invoke = domain->capture_context_runtime_invoke; + runtime_invoke = (RuntimeInvokeFunction)domain->capture_context_runtime_invoke; return runtime_invoke (NULL, NULL, NULL, domain->capture_context_method); } @@ -6064,7 +6060,7 @@ mono_async_result_new (MonoDomain *domain, HANDLE handle, MonoObject *state, gpo /* note: result may be null if the flow is suppressed */ } - res->data = data; + res->data = (void **)data; MONO_OBJECT_SETREF (res, object_data, object_data); MONO_OBJECT_SETREF (res, async_state, state); if (handle != NULL) @@ -6172,7 +6168,7 @@ mono_message_init (MonoDomain *domain, for (i = 0, j = 0; i < sig->param_count; i++) { if (sig->params [i]->byref) { if (out_args) { - MonoObject* arg = mono_array_get (out_args, gpointer, j); + MonoObject* arg = (MonoObject *)mono_array_get (out_args, gpointer, j); mono_array_setref (this_obj->args, i, arg); j++; } @@ -6281,7 +6277,7 @@ mono_message_invoke (MonoObject *target, MonoMethodMessage *msg, for (i = 0, j = 0; i < sig->param_count; i++) { if (sig->params [i]->byref) { MonoObject* arg; - arg = mono_array_get (msg->args, gpointer, i); + arg = (MonoObject *)mono_array_get (msg->args, gpointer, i); mono_array_setref (*out_args, j, arg); j++; } @@ -6447,10 +6443,10 @@ mono_delegate_ctor (MonoObject *this_obj, MonoObject *target, gpointer addr) g_assert (addr); - ji = mono_jit_info_table_find (domain, mono_get_addr_from_ftnptr (addr)); + ji = mono_jit_info_table_find (domain, (char *)mono_get_addr_from_ftnptr (addr)); /* Shared code */ if (!ji && domain != mono_get_root_domain ()) - ji = mono_jit_info_table_find (mono_get_root_domain (), mono_get_addr_from_ftnptr (addr)); + ji = mono_jit_info_table_find (mono_get_root_domain (), (char *)mono_get_addr_from_ftnptr (addr)); if (ji) { method = mono_jit_info_get_method (ji); g_assert (!method->klass->generic_container); @@ -6546,7 +6542,7 @@ mono_method_return_message_restore (MonoMethod *method, gpointer *params, MonoAr if (j >= out_len) mono_raise_exception (mono_get_exception_execution_engine ("The proxy call returned an incorrect number of output arguments")); - arg = mono_array_get (out_args, gpointer, j); + arg = (char *)mono_array_get (out_args, gpointer, j); type = pt->type; g_assert (type != MONO_TYPE_VOID); diff --git a/mono/metadata/opcodes.c b/mono/metadata/opcodes.c index e534d33b422..6cfbe5cbcce 100644 --- a/mono/metadata/opcodes.c +++ b/mono/metadata/opcodes.c @@ -72,19 +72,19 @@ mono_opcode_value (const mono_byte **ip, const mono_byte *end) const mono_byte *p = *ip; if (p >= end) - return -1; + return (MonoOpcodeEnum)-1; if (*p == 0xfe) { ++p; if (p >= end) - return -1; - res = *p + MONO_PREFIX1_OFFSET; + return (MonoOpcodeEnum)-1; + res = (MonoOpcodeEnum)(*p + MONO_PREFIX1_OFFSET); } else if (*p == MONO_CUSTOM_PREFIX) { ++p; if (p >= end) - return -1; - res = *p + MONO_CUSTOM_PREFIX_OFFSET; + return (MonoOpcodeEnum)-1; + res = (MonoOpcodeEnum)(*p + MONO_CUSTOM_PREFIX_OFFSET); } else { - res = *p; + res = (MonoOpcodeEnum)*p; } *ip = p; return res; diff --git a/mono/metadata/pedump.c b/mono/metadata/pedump.c index e2e3fdff79f..eacaa657785 100644 --- a/mono/metadata/pedump.c +++ b/mono/metadata/pedump.c @@ -333,7 +333,7 @@ dump_methoddef (MonoImage *metadata, guint32 token) static void dump_dotnet_iinfo (MonoImage *image) { - MonoCLIImageInfo *iinfo = image->image_info; + MonoCLIImageInfo *iinfo = (MonoCLIImageInfo *)image->image_info; dump_dotnet_header (&iinfo->cli_header); dump_sections (iinfo); @@ -385,7 +385,7 @@ dump_verify_info (MonoImage *image, int flags) } for (tmp = errors; tmp; tmp = tmp->next) { - MonoVerifyInfo *info = tmp->data; + MonoVerifyInfo *info = (MonoVerifyInfo *)tmp->data; g_print ("%s: %s\n", desc [info->status], info->message); if (info->status == MONO_VERIFY_ERROR) { count++; @@ -504,7 +504,7 @@ verify_image_file (const char *fname) invalid_image: for (tmp = errors; tmp; tmp = tmp->next) { - MonoVerifyInfo *info = tmp->data; + MonoVerifyInfo *info = (MonoVerifyInfo *)tmp->data; g_print ("%s: %s\n", desc [info->status], info->message); if (info->status == MONO_VERIFY_ERROR) count++; @@ -610,7 +610,7 @@ pedump_assembly_search_hook (MonoAssemblyName *aname, gpointer user_data) GList *tmp; for (tmp = loaded_assemblies; tmp; tmp = tmp->next) { - MonoAssembly *ass = tmp->data; + MonoAssembly *ass = (MonoAssembly *)tmp->data; if (mono_assembly_names_equal (aname, &ass->aname)) return ass; } diff --git a/mono/metadata/process.c b/mono/metadata/process.c index 53e762d0a28..24d33ee89c8 100644 --- a/mono/metadata/process.c +++ b/mono/metadata/process.c @@ -464,7 +464,7 @@ static GPtrArray* get_domain_assemblies (MonoDomain *domain) assemblies = g_ptr_array_new (); mono_domain_assemblies_lock (domain); for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) { - MonoAssembly *ass = tmp->data; + MonoAssembly *ass = (MonoAssembly *)tmp->data; if (ass->image->fileio_used) continue; g_ptr_array_add (assemblies, ass); @@ -522,7 +522,7 @@ MonoArray *ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject if (assemblies) { for (i = 0; i < assembly_count; i++) { - MonoAssembly *ass = g_ptr_array_index (assemblies, i); + MonoAssembly *ass = (MonoAssembly *)g_ptr_array_index (assemblies, i); MonoObject *module = get_process_module (ass, proc_class); mono_array_setref (temp_arr, num_added++, module); } @@ -623,9 +623,9 @@ MonoBoolean ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (MonoPr gboolean ret; shellex.cbSize = sizeof(SHELLEXECUTEINFO); - shellex.fMask = SEE_MASK_FLAG_DDEWAIT | SEE_MASK_NOCLOSEPROCESS | SEE_MASK_UNICODE; - shellex.nShow = proc_start_info->window_style; - shellex.nShow = (shellex.nShow == 0) ? 1 : (shellex.nShow == 1 ? 0 : shellex.nShow); + shellex.fMask = (gulong)(SEE_MASK_FLAG_DDEWAIT | SEE_MASK_NOCLOSEPROCESS | SEE_MASK_UNICODE); + shellex.nShow = (gulong)proc_start_info->window_style; + shellex.nShow = (gulong)((shellex.nShow == 0) ? 1 : (shellex.nShow == 1 ? 0 : shellex.nShow)); if (proc_start_info->filename != NULL) { @@ -649,7 +649,7 @@ MonoBoolean ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (MonoPr if (proc_start_info->error_dialog) { shellex.hwnd = proc_start_info->error_dialog_parent_handle; } else { - shellex.fMask |= SEE_MASK_FLAG_NO_UI; + shellex.fMask = (gulong)(shellex.fMask | SEE_MASK_FLAG_NO_UI); } ret = ShellExecuteEx (&shellex); @@ -771,7 +771,12 @@ MonoBoolean ves_icall_System_Diagnostics_Process_CreateProcess_internal (MonoPro if (process_info->username) { logon_flags = process_info->load_user_profile ? LOGON_WITH_PROFILE : 0; - ret=CreateProcessWithLogonW (mono_string_chars (process_info->username), process_info->domain ? mono_string_chars (process_info->domain) : NULL, process_info->password, logon_flags, shell_path, cmd? mono_string_chars (cmd): NULL, creation_flags, env_vars, dir, &startinfo, &procinfo); + ret = CreateProcessWithLogonW ( + mono_string_chars (process_info->username), + process_info->domain ? mono_string_chars (process_info->domain) : NULL, + (const gunichar2 *)process_info->password, logon_flags, shell_path, + cmd ? mono_string_chars (cmd) : NULL, + creation_flags, env_vars, dir, &startinfo, &procinfo); } else { ret=CreateProcess (shell_path, cmd? mono_string_chars (cmd): NULL, NULL, NULL, TRUE, creation_flags, env_vars, dir, &startinfo, &procinfo); } @@ -1063,7 +1068,7 @@ ves_icall_System_Diagnostics_Process_GetProcessData (int pid, gint32 data_type, MonoProcessError perror; guint64 res; - res = mono_process_get_data_with_error (GINT_TO_POINTER (pid), data_type, &perror); + res = mono_process_get_data_with_error (GINT_TO_POINTER (pid), (MonoProcessData)data_type, &perror); if (error) *error = perror; return res; diff --git a/mono/metadata/profiler.c b/mono/metadata/profiler.c index 435e4671a2b..af9ac55ec7c 100644 --- a/mono/metadata/profiler.c +++ b/mono/metadata/profiler.c @@ -109,8 +109,8 @@ struct _ProfilerDesc { static ProfilerDesc *prof_list = NULL; -#define mono_profiler_coverage_lock() mono_mutex_lock (&profiler_coverage_mutex) -#define mono_profiler_coverage_unlock() mono_mutex_unlock (&profiler_coverage_mutex) +#define mono_profiler_coverage_lock() mono_os_mutex_lock (&profiler_coverage_mutex) +#define mono_profiler_coverage_unlock() mono_os_mutex_unlock (&profiler_coverage_mutex) static mono_mutex_t profiler_coverage_mutex; /* this is directly accessible to other mono libs. @@ -134,7 +134,7 @@ mono_profiler_install (MonoProfiler *prof, MonoProfileFunc callback) { ProfilerDesc *desc = g_new0 (ProfilerDesc, 1); if (!prof_list) - mono_mutex_init_recursive (&profiler_coverage_mutex); + mono_os_mutex_init_recursive (&profiler_coverage_mutex); desc->profiler = prof; desc->shutdown_callback = callback; desc->next = prof_list; @@ -159,11 +159,11 @@ void mono_profiler_set_events (MonoProfileFlags events) { ProfilerDesc *prof; - MonoProfileFlags value = 0; + MonoProfileFlags value = (MonoProfileFlags)0; if (prof_list) prof_list->events = events; for (prof = prof_list; prof; prof = prof->next) - value |= prof->events; + value = (MonoProfileFlags)(value | prof->events); mono_profiler_events = value; } @@ -813,7 +813,7 @@ mono_profiler_shutdown (void) prof->shutdown_callback (prof->profiler); } - mono_profiler_set_events (0); + mono_profiler_set_events ((MonoProfileFlags)0); } void @@ -1018,7 +1018,7 @@ mono_profiler_coverage_alloc (MonoMethod *method, int entries) if (!coverage_hash) coverage_hash = g_hash_table_new (NULL, NULL); - res = g_malloc0 (sizeof (MonoProfileCoverageInfo) + sizeof (void*) * 2 * entries); + res = (MonoProfileCoverageInfo *)g_malloc0 (sizeof (MonoProfileCoverageInfo) + sizeof (void*) * 2 * entries); res->entries = entries; @@ -1040,7 +1040,7 @@ mono_profiler_coverage_free (MonoMethod *method) return; } - info = g_hash_table_lookup (coverage_hash, method); + info = (MonoProfileCoverageInfo *)g_hash_table_lookup (coverage_hash, method); if (info) { g_free (info); g_hash_table_remove (coverage_hash, method); @@ -1073,7 +1073,7 @@ mono_profiler_coverage_get (MonoProfiler *prof, MonoMethod *method, MonoProfileC mono_profiler_coverage_lock (); if (coverage_hash) - info = g_hash_table_lookup (coverage_hash, method); + info = (MonoProfileCoverageInfo *)g_hash_table_lookup (coverage_hash, method); mono_profiler_coverage_unlock (); if (!info) @@ -1240,7 +1240,7 @@ mono_profiler_load (const char *desc) gboolean res = FALSE; if (col != NULL) { - mname = g_memdup (desc, col - desc + 1); + mname = (char *)g_memdup (desc, col - desc + 1); mname [col - desc] = 0; } else { mname = g_strdup (desc); diff --git a/mono/metadata/reflection-internals.h b/mono/metadata/reflection-internals.h index dc8141bbdbf..54eee9f0c73 100644 --- a/mono/metadata/reflection-internals.h +++ b/mono/metadata/reflection-internals.h @@ -14,4 +14,7 @@ mono_custom_attrs_get_attr_checked (MonoCustomAttrInfo *ainfo, MonoClass *attr_k char* mono_identifier_unescape_type_name_chars (char* identifier); +MonoImage * +mono_find_dynamic_image_owner (void *ptr); + #endif /* __MONO_METADATA_REFLECTION_INTERNALS_H__ */ diff --git a/mono/metadata/reflection.c b/mono/metadata/reflection.c index 3d34adb29f1..4f1f6d84054 100644 --- a/mono/metadata/reflection.c +++ b/mono/metadata/reflection.c @@ -194,7 +194,7 @@ static MonoMethod * inflate_method (MonoReflectionType *type, MonoObject *obj); static guint32 create_typespec (MonoDynamicImage *assembly, MonoType *type); static void init_type_builder_generics (MonoObject *type); -#define RESOLVE_TYPE(type) do { type = (void*)mono_reflection_type_resolve_user_types ((MonoReflectionType*)type); } while (0) +#define RESOLVE_TYPE(type) do { type = (MonoObject *)mono_reflection_type_resolve_user_types ((MonoReflectionType*)type); } while (0) #define RESOLVE_ARRAY_TYPE_ELEMENT(array, index) do { \ MonoReflectionType *__type = mono_array_get (array, MonoReflectionType*, index); \ __type = mono_reflection_type_resolve_user_types (__type); \ @@ -215,18 +215,61 @@ static void init_type_builder_generics (MonoObject *type); #define ADDP_IS_GREATER_OR_OVF(a, b, c) (((a) + (b) > (c)) || CHECK_ADDP_OVERFLOW_UN (a, b)) #define ADD_IS_GREATER_OR_OVF(a, b, c) (((a) + (b) > (c)) || CHECK_ADD4_OVERFLOW_UN (a, b)) +// The dynamic images list is only needed to support the mempool reference tracking feature in checked-build. +static GPtrArray *dynamic_images; +static mono_mutex_t dynamic_images_mutex; + +static inline void +dynamic_images_lock (void) +{ + mono_os_mutex_lock (&dynamic_images_mutex); +} + +static inline void +dynamic_images_unlock (void) +{ + mono_os_mutex_unlock (&dynamic_images_mutex); +} + +/** + * mono_find_dynamic_image_owner: + * + * Find the dynamic image, if any, which a given pointer is located in the memory of. + */ +MonoImage * +mono_find_dynamic_image_owner (void *ptr) +{ + MonoImage *owner = NULL; + int i; + + dynamic_images_lock (); + + if (dynamic_images) + { + for (i = 0; !owner && i < dynamic_images->len; ++i) { + MonoImage *image = (MonoImage *)g_ptr_array_index (dynamic_images, i); + if (mono_mempool_contains_addr (image->mempool, ptr)) + owner = image; + } + } + + dynamic_images_unlock (); + + return owner; +} void mono_reflection_init (void) { + mono_os_mutex_init (&dynamic_images_mutex); } static inline void dynamic_image_lock (MonoDynamicImage *image) { - MONO_TRY_BLOCKING; + MONO_PREPARE_BLOCKING; mono_image_lock ((MonoImage*)image); - MONO_FINISH_TRY_BLOCKING; + MONO_FINISH_BLOCKING; } static inline void @@ -253,7 +296,7 @@ lookup_dyn_token (MonoDynamicImage *assembly, guint32 token) MonoObject *obj; dynamic_image_lock (assembly); - obj = mono_g_hash_table_lookup (assembly->tokens, GUINT_TO_POINTER (token)); + obj = (MonoObject *)mono_g_hash_table_lookup (assembly->tokens, GUINT_TO_POINTER (token)); dynamic_image_unlock (assembly); return obj; @@ -264,7 +307,7 @@ sigbuffer_init (SigBuffer *buf, int size) { MONO_REQ_GC_NEUTRAL_MODE; - buf->buf = g_malloc (size); + buf->buf = (char *)g_malloc (size); buf->p = buf->buf; buf->end = buf->buf + size; } @@ -276,7 +319,7 @@ sigbuffer_make_room (SigBuffer *buf, int size) if (buf->end - buf->p < size) { int new_size = buf->end - buf->buf + size + 32; - char *p = g_realloc (buf->buf, new_size); + char *p = (char *)g_realloc (buf->buf, new_size); size = buf->p - buf->buf; buf->buf = p; buf->p = p + size; @@ -392,7 +435,7 @@ alloc_table (MonoDynamicTable *table, guint nrows) table->alloc_rows *= 2; } - table->values = g_renew (guint32, table->values, (table->alloc_rows) * table->columns); + table->values = (guint32 *)g_renew (guint32, table->values, (table->alloc_rows) * table->columns); } } @@ -411,7 +454,7 @@ make_room_in_stream (MonoDynamicStream *stream, int size) stream->alloc_size *= 2; } - stream->data = g_realloc (stream->data, stream->alloc_size); + stream->data = (char *)g_realloc (stream->data, stream->alloc_size); } static guint32 @@ -462,7 +505,7 @@ string_heap_init (MonoDynamicStream *sh) sh->index = 0; sh->alloc_size = 4096; - sh->data = g_malloc (4096); + sh->data = (char *)g_malloc (4096); sh->hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); string_heap_insert (sh, ""); } @@ -556,7 +599,7 @@ add_to_blob_cached (MonoDynamicImage *assembly, char *b1, int s1, char *b2, int char *copy; gpointer oldkey, oldval; - copy = g_malloc (s1+s2); + copy = (char *)g_malloc (s1+s2); memcpy (copy, b1, s1); memcpy (copy + s1, b2, s2); if (g_hash_table_lookup_extended (assembly->blob_cache, copy, &oldkey, &oldval)) { @@ -1287,12 +1330,12 @@ lookup_custom_attr (MonoImage *image, gpointer member) MonoCustomAttrInfo* res; - res = mono_image_property_lookup (image, member, MONO_PROP_DYNAMIC_CATTR); + res = (MonoCustomAttrInfo *)mono_image_property_lookup (image, member, MONO_PROP_DYNAMIC_CATTR); if (!res) return NULL; - res = g_memdup (res, MONO_SIZEOF_CUSTOM_ATTR_INFO + sizeof (MonoCustomAttrEntry) * res->num_attrs); + res = (MonoCustomAttrInfo *)g_memdup (res, MONO_SIZEOF_CUSTOM_ATTR_INFO + sizeof (MonoCustomAttrEntry) * res->num_attrs); res->cached = 0; return res; } @@ -1338,7 +1381,7 @@ mono_custom_attrs_from_builders (MonoImage *alloc_img, MonoImage *image, MonoArr } count -= not_visible; - ainfo = image_g_malloc0 (alloc_img, MONO_SIZEOF_CUSTOM_ATTR_INFO + sizeof (MonoCustomAttrEntry) * count); + ainfo = (MonoCustomAttrInfo *)image_g_malloc0 (alloc_img, MONO_SIZEOF_CUSTOM_ATTR_INFO + sizeof (MonoCustomAttrEntry) * count); ainfo->image = image; ainfo->num_attrs = count; @@ -1347,7 +1390,7 @@ mono_custom_attrs_from_builders (MonoImage *alloc_img, MonoImage *image, MonoArr for (i = 0; i < count; ++i) { cattr = (MonoReflectionCustomAttr*)mono_array_get (cattrs, gpointer, i); if (custom_attr_visible (image, cattr)) { - unsigned char *saved = mono_image_alloc (image, mono_array_length (cattr->data)); + unsigned char *saved = (unsigned char *)mono_image_alloc (image, mono_array_length (cattr->data)); memcpy (saved, mono_array_addr (cattr->data, char, 0), mono_array_length (cattr->data)); ainfo->attrs [index].ctor = cattr->ctor->method; ainfo->attrs [index].data = saved; @@ -1376,7 +1419,7 @@ mono_save_custom_attrs (MonoImage *image, void *obj, MonoArray *cattrs) ainfo = mono_custom_attrs_from_builders (image, image, cattrs); mono_loader_lock (); - tmp = mono_image_property_lookup (image, obj, MONO_PROP_DYNAMIC_CATTR); + tmp = (MonoCustomAttrInfo *)mono_image_property_lookup (image, obj, MONO_PROP_DYNAMIC_CATTR); if (tmp) mono_custom_attrs_free (tmp); mono_image_property_insert (image, obj, MONO_PROP_DYNAMIC_CATTR, ainfo); @@ -1780,7 +1823,7 @@ mono_image_get_method_info (MonoReflectionMethodBuilder *mb, MonoDynamicImage *a guint32 owner = MONO_TYPEORMETHOD_METHOD | (mb->table_idx << MONO_TYPEORMETHOD_BITS); mono_image_get_generic_param_info ( - mono_array_get (mb->generic_params, gpointer, i), owner, assembly); + (MonoReflectionGenericParam *)mono_array_get (mb->generic_params, gpointer, i), owner, assembly); } } @@ -1913,7 +1956,7 @@ field_encode_signature (MonoDynamicImage *assembly, MonoReflectionFieldBuilder * } static guint32 -encode_constant (MonoDynamicImage *assembly, MonoObject *val, guint32 *ret_type) +encode_constant (MonoDynamicImage *assembly, MonoObject *val, MonoTypeEnum *ret_type) { MONO_REQ_GC_UNSAFE_MODE; @@ -1923,7 +1966,7 @@ encode_constant (MonoDynamicImage *assembly, MonoObject *val, guint32 *ret_type) char* buf; guint32 idx = 0, len = 0, dummy = 0; - buf = g_malloc (64); + buf = (char *)g_malloc (64); if (!val) { *ret_type = MONO_TYPE_CLASS; len = 4; @@ -2118,7 +2161,7 @@ mono_image_get_field_info (MonoReflectionFieldBuilder *fb, MonoDynamicImage *ass values [MONO_FIELD_LAYOUT_OFFSET] = fb->offset; } if (fb->attrs & FIELD_ATTRIBUTE_LITERAL) { - guint32 field_type = 0; + MonoTypeEnum field_type = (MonoTypeEnum)0; table = &assembly->tables [MONO_TABLE_CONSTANT]; table->rows ++; alloc_table (table, table->rows); @@ -2247,7 +2290,7 @@ mono_image_get_property_info (MonoReflectionPropertyBuilder *pb, MonoDynamicImag values [MONO_METHOD_SEMA_ASSOCIATION] = (pb->table_idx << MONO_HAS_SEMANTICS_BITS) | MONO_HAS_SEMANTICS_PROPERTY; } if (pb->attrs & PROPERTY_ATTRIBUTE_HAS_DEFAULT) { - guint32 field_type = 0; + MonoTypeEnum field_type = (MonoTypeEnum)0; table = &assembly->tables [MONO_TABLE_CONSTANT]; table->rows ++; alloc_table (table, table->rows); @@ -2345,7 +2388,7 @@ encode_constraints (MonoReflectionGenericParam *gparam, guint32 owner, MonoDynam } for (i = 0; i < num_constraints; i++) { - MonoReflectionType *constraint = mono_array_get ( + MonoReflectionType *constraint = (MonoReflectionType *)mono_array_get ( gparam->iface_constraints, gpointer, i); table_idx = table->next_idx ++; @@ -2557,9 +2600,9 @@ mono_image_typedef_or_ref_full (MonoDynamicImage *assembly, MonoType *type, gboo */ if ((klass->image == &assembly->image) && (type->type != MONO_TYPE_VAR) && (type->type != MONO_TYPE_MVAR)) { - MonoReflectionTypeBuilder *tb = mono_class_get_ref_info (klass); + MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)mono_class_get_ref_info (klass); token = MONO_TYPEDEFORREF_TYPEDEF | (tb->table_idx << MONO_TYPEDEFORREF_BITS); - register_dyn_token (assembly, token, mono_class_get_ref_info (klass)); + register_dyn_token (assembly, token, (MonoObject *)mono_class_get_ref_info (klass)); return token; } @@ -2582,7 +2625,7 @@ mono_image_typedef_or_ref_full (MonoDynamicImage *assembly, MonoType *type, gboo token = MONO_TYPEDEFORREF_TYPEREF | (table->next_idx << MONO_TYPEDEFORREF_BITS); /* typeref */ g_hash_table_insert (assembly->typeref, type, GUINT_TO_POINTER(token)); table->next_idx ++; - register_dyn_token (assembly, token, mono_class_get_ref_info (klass)); + register_dyn_token (assembly, token, (MonoObject *)mono_class_get_ref_info (klass)); return token; } @@ -3069,7 +3112,7 @@ mono_reflection_method_on_tb_inst_get_handle (MonoReflectionMethodOnTypeBuilderI type_argv = g_new0 (MonoType *, count); for (i = 0; i < count; i++) { - MonoReflectionType *garg = mono_array_get (m->method_args, gpointer, i); + MonoReflectionType *garg = (MonoReflectionType *)mono_array_get (m->method_args, gpointer, i); type_argv [i] = mono_reflection_type_get_handle (garg); } ginst = mono_metadata_get_generic_inst (count, type_argv); @@ -3332,7 +3375,7 @@ add_custom_modifiers (MonoDynamicImage *assembly, MonoType *type, MonoArray *mod return mono_metadata_type_dup (NULL, type); len = MONO_SIZEOF_TYPE + ((gint32)count) * sizeof (MonoCustomMod); - t = g_malloc (len); + t = (MonoType *)g_malloc (len); memcpy (t, type, MONO_SIZEOF_TYPE); t->num_mods = count; @@ -3534,7 +3577,7 @@ mono_image_get_array_token (MonoDynamicImage *assembly, MonoReflectionArrayMetho name = mono_string_to_utf8 (m->name); nparams = mono_array_length (m->parameters); - sig = g_malloc0 (MONO_SIZEOF_METHOD_SIGNATURE + sizeof (MonoType*) * nparams); + sig = (MonoMethodSignature *)g_malloc0 (MONO_SIZEOF_METHOD_SIGNATURE + sizeof (MonoType*) * nparams); sig->hasthis = 1; sig->sentinelpos = -1; sig->call_convention = reflection_cc_to_file (m->call_conv); @@ -3545,7 +3588,7 @@ mono_image_get_array_token (MonoDynamicImage *assembly, MonoReflectionArrayMetho sig->params [i] = mono_type_array_get_and_resolve (m->parameters, i); for (tmp = assembly->array_methods; tmp; tmp = tmp->next) { - am = tmp->data; + am = (ArrayMethod *)tmp->data; if (strcmp (name, am->name) == 0 && mono_metadata_type_equal (am->parent, mtype) && mono_metadata_signature_equal (am->sig, sig)) { @@ -3937,7 +3980,7 @@ mono_image_fill_export_table_from_class (MonoDomain *domain, MonoClass *klass, GList *tmp; for (tmp = klass->ext->nested_classes; tmp; tmp = tmp->next) - mono_image_fill_export_table_from_class (domain, tmp->data, module_index, table->next_idx - 1, assembly); + mono_image_fill_export_table_from_class (domain, (MonoClass *)tmp->data, module_index, table->next_idx - 1, assembly); } return res; @@ -4060,16 +4103,16 @@ mono_image_fill_export_table_from_type_forwarders (MonoReflectionAssemblyBuilder static int compare_constants (const void *a, const void *b) { - const guint32 *a_values = a; - const guint32 *b_values = b; + const guint32 *a_values = (const guint32 *)a; + const guint32 *b_values = (const guint32 *)b; return a_values [MONO_CONSTANT_PARENT] - b_values [MONO_CONSTANT_PARENT]; } static int compare_semantics (const void *a, const void *b) { - const guint32 *a_values = a; - const guint32 *b_values = b; + const guint32 *a_values = (const guint32 *)a; + const guint32 *b_values = (const guint32 *)b; int assoc = a_values [MONO_METHOD_SEMA_ASSOCIATION] - b_values [MONO_METHOD_SEMA_ASSOCIATION]; if (assoc) return assoc; @@ -4079,8 +4122,8 @@ compare_semantics (const void *a, const void *b) static int compare_custom_attrs (const void *a, const void *b) { - const guint32 *a_values = a; - const guint32 *b_values = b; + const guint32 *a_values = (const guint32 *)a; + const guint32 *b_values = (const guint32 *)b; return a_values [MONO_CUSTOM_ATTR_PARENT] - b_values [MONO_CUSTOM_ATTR_PARENT]; } @@ -4088,8 +4131,8 @@ compare_custom_attrs (const void *a, const void *b) static int compare_field_marshal (const void *a, const void *b) { - const guint32 *a_values = a; - const guint32 *b_values = b; + const guint32 *a_values = (const guint32 *)a; + const guint32 *b_values = (const guint32 *)b; return a_values [MONO_FIELD_MARSHAL_PARENT] - b_values [MONO_FIELD_MARSHAL_PARENT]; } @@ -4097,8 +4140,8 @@ compare_field_marshal (const void *a, const void *b) static int compare_nested (const void *a, const void *b) { - const guint32 *a_values = a; - const guint32 *b_values = b; + const guint32 *a_values = (const guint32 *)a; + const guint32 *b_values = (const guint32 *)b; return a_values [MONO_NESTED_CLASS_NESTED] - b_values [MONO_NESTED_CLASS_NESTED]; } @@ -4120,8 +4163,8 @@ compare_genericparam (const void *a, const void *b) static int compare_declsecurity_attrs (const void *a, const void *b) { - const guint32 *a_values = a; - const guint32 *b_values = b; + const guint32 *a_values = (const guint32 *)a; + const guint32 *b_values = (const guint32 *)b; return a_values [MONO_DECL_SECURITY_PARENT] - b_values [MONO_DECL_SECURITY_PARENT]; } @@ -4129,8 +4172,8 @@ compare_declsecurity_attrs (const void *a, const void *b) static int compare_interface_impl (const void *a, const void *b) { - const guint32 *a_values = a; - const guint32 *b_values = b; + const guint32 *a_values = (const guint32 *)a; + const guint32 *b_values = (const guint32 *)b; int klass = a_values [MONO_INTERFACEIMPL_CLASS] - b_values [MONO_INTERFACEIMPL_CLASS]; if (klass) @@ -4180,7 +4223,7 @@ build_compressed_metadata (MonoDynamicImage *assembly) qsort (assembly->gen_params->pdata, assembly->gen_params->len, sizeof (gpointer), compare_genericparam); for (i = 0; i < assembly->gen_params->len; i++){ - GenericParamTableEntry *entry = g_ptr_array_index (assembly->gen_params, i); + GenericParamTableEntry *entry = (GenericParamTableEntry *)g_ptr_array_index (assembly->gen_params, i); write_generic_param_entry (assembly, entry); } @@ -4242,7 +4285,7 @@ build_compressed_metadata (MonoDynamicImage *assembly) heapt_size += 3; heapt_size &= ~3; meta_size += heapt_size; - meta->raw_metadata = g_malloc0 (meta_size); + meta->raw_metadata = (char *)g_malloc0 (meta_size); p = (unsigned char*)meta->raw_metadata; /* the metadata signature */ *p++ = 'B'; *p++ = 'S'; *p++ = 'J'; *p++ = 'B'; @@ -4515,7 +4558,7 @@ fixup_cattrs (MonoDynamicImage *assembly) if ((type & MONO_CUSTOM_ATTR_TYPE_MASK) == MONO_CUSTOM_ATTR_TYPE_METHODDEF) { idx = type >> MONO_CUSTOM_ATTR_TYPE_BITS; token = mono_metadata_make_token (MONO_TABLE_METHOD, idx); - ctor = mono_g_hash_table_lookup (assembly->remapped_tokens, GUINT_TO_POINTER (token)); + ctor = (MonoObject *)mono_g_hash_table_lookup (assembly->remapped_tokens, GUINT_TO_POINTER (token)); g_assert (ctor); if (!strcmp (ctor->vtable->klass->name, "MonoCMethod")) { @@ -4654,7 +4697,7 @@ load_public_key (MonoArray *pkey, MonoDynamicImage *assembly) { token = mono_image_add_stream_data (&assembly->blob, blob_size, b - blob_size); mono_image_add_stream_data (&assembly->blob, mono_array_addr (pkey, char, 0), len); - assembly->public_key = g_malloc (len); + assembly->public_key = (guint8 *)g_malloc (len); memcpy (assembly->public_key, mono_array_addr (pkey, char, 0), len); assembly->public_key_len = len; @@ -4670,7 +4713,7 @@ load_public_key (MonoArray *pkey, MonoDynamicImage *assembly) { g_warning ("Invalid public key length: %d bits (total: %d)", (int)MONO_PUBLIC_KEY_BIT_SIZE (len), (int)len); assembly->strong_name_size = MONO_DEFAULT_PUBLIC_KEY_LENGTH; /* to be safe */ } - assembly->strong_name = g_malloc0 (assembly->strong_name_size); + assembly->strong_name = (char *)g_malloc0 (assembly->strong_name_size); return token; } @@ -4835,7 +4878,7 @@ mono_image_build_metadata (MonoReflectionModuleBuilder *moduleb) collect_types (&types, type); } - mono_ptr_array_sort (types, (gpointer)compare_types_by_table_idx); + mono_ptr_array_sort (types, (int (*)(const void *, const void *))compare_types_by_table_idx); table = &assembly->tables [MONO_TABLE_TYPEDEF]; table->rows += mono_ptr_array_size (types); alloc_table (table, table->rows); @@ -4845,16 +4888,16 @@ mono_image_build_metadata (MonoReflectionModuleBuilder *moduleb) * so load_class_names () needs to touch fewer pages. */ for (i = 0; i < mono_ptr_array_size (types); ++i) { - MonoReflectionTypeBuilder *tb = mono_ptr_array_get (types, i); + MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)mono_ptr_array_get (types, i); string_heap_insert_mstring (&assembly->sheap, tb->nspace); } for (i = 0; i < mono_ptr_array_size (types); ++i) { - MonoReflectionTypeBuilder *tb = mono_ptr_array_get (types, i); + MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)mono_ptr_array_get (types, i); string_heap_insert_mstring (&assembly->sheap, tb->name); } for (i = 0; i < mono_ptr_array_size (types); ++i) { - MonoReflectionTypeBuilder *type = mono_ptr_array_get (types, i); + MonoReflectionTypeBuilder *type = (MonoReflectionTypeBuilder *)mono_ptr_array_get (types, i); mono_image_get_type_info (domain, type, assembly); } @@ -4889,7 +4932,7 @@ mono_image_build_metadata (MonoReflectionModuleBuilder *moduleb) } for (i = 0; i < mono_ptr_array_size (types); ++i) { - MonoReflectionTypeBuilder *type = mono_ptr_array_get (types, i); + MonoReflectionTypeBuilder *type = (MonoReflectionTypeBuilder *)mono_ptr_array_get (types, i); if (type->methods) { for (j = 0; j < type->num_methods; ++j) { MonoReflectionMethodBuilder *mb = mono_array_get ( @@ -5245,7 +5288,7 @@ mono_image_register_token (MonoDynamicImage *assembly, guint32 token, MonoObject MonoObject *prev; dynamic_image_lock (assembly); - prev = mono_g_hash_table_lookup (assembly->tokens, GUINT_TO_POINTER (token)); + prev = (MonoObject *)mono_g_hash_table_lookup (assembly->tokens, GUINT_TO_POINTER (token)); if (prev) { /* There could be multiple MethodInfo objects with the same token */ //g_assert (prev == obj); @@ -5271,7 +5314,7 @@ create_dynamic_mono_image (MonoDynamicAssembly *assembly, char *assembly_name, c #if HAVE_BOEHM_GC /* The MonoGHashTable's need GC tracking */ - image = GC_MALLOC (sizeof (MonoDynamicImage)); + image = (MonoDynamicImage *)GC_MALLOC (sizeof (MonoDynamicImage)); #else image = g_new0 (MonoDynamicImage, 1); #endif @@ -5338,6 +5381,15 @@ create_dynamic_mono_image (MonoDynamicAssembly *assembly, char *assembly_name, c mono_profiler_module_loaded (&image->image, MONO_PROFILE_OK); + dynamic_images_lock (); + + if (!dynamic_images) + dynamic_images = g_ptr_array_new (); + + g_ptr_array_add (dynamic_images, image); + + dynamic_images_unlock (); + return image; } #endif @@ -5368,6 +5420,7 @@ mono_dynamic_image_release_gc_roots (MonoDynamicImage *image) release_hashtable (&image->methodspec); } +// Free dynamic image pass one: Free resources but not image itself void mono_dynamic_image_free (MonoDynamicImage *image) { @@ -5406,7 +5459,7 @@ mono_dynamic_image_free (MonoDynamicImage *image) g_list_free (di->array_methods); if (di->gen_params) { for (i = 0; i < di->gen_params->len; i++) { - GenericParamTableEntry *entry = g_ptr_array_index (di->gen_params, i); + GenericParamTableEntry *entry = (GenericParamTableEntry *)g_ptr_array_index (di->gen_params, i); mono_gc_deregister_root ((char*) &entry->gparam); g_free (entry); } @@ -5438,8 +5491,16 @@ mono_dynamic_image_free (MonoDynamicImage *image) for (i = 0; i < MONO_TABLE_NUM; ++i) { g_free (di->tables [i].values); } -} + dynamic_images_lock (); + + if (dynamic_images) + g_ptr_array_remove (dynamic_images, di); + + dynamic_images_unlock (); +} + +// Free dynamic image pass two: Free image itself (might never get called in some debug modes) void mono_dynamic_image_free_image (MonoDynamicImage *image) { @@ -5472,7 +5533,7 @@ mono_image_basic_init (MonoReflectionAssemblyBuilder *assemblyb) #if HAVE_BOEHM_GC /* assembly->assembly.image might be GC allocated */ - assembly = assemblyb->dynamic_assembly = GC_MALLOC (sizeof (MonoDynamicAssembly)); + assembly = assemblyb->dynamic_assembly = (MonoDynamicAssembly *)GC_MALLOC (sizeof (MonoDynamicAssembly)); #else assembly = assemblyb->dynamic_assembly = g_new0 (MonoDynamicAssembly, 1); #endif @@ -5771,13 +5832,13 @@ assembly_add_win32_resources (MonoDynamicImage *assembly, MonoReflectionAssembly } /* Directory structure */ size += mono_array_length (assemblyb->win32_resources) * 256; - p = buf = g_malloc (size); + p = buf = (char *)g_malloc (size); resource_tree_encode (tree, p, p, &p); g_assert (p - buf <= size); - assembly->win32_res = g_malloc (p - buf); + assembly->win32_res = (char *)g_malloc (p - buf); assembly->win32_res_size = p - buf; memcpy (assembly->win32_res, buf, p - buf); @@ -6254,15 +6315,15 @@ typedef struct { static gboolean reflected_equal (gconstpointer a, gconstpointer b) { - const ReflectedEntry *ea = a; - const ReflectedEntry *eb = b; + const ReflectedEntry *ea = (const ReflectedEntry *)a; + const ReflectedEntry *eb = (const ReflectedEntry *)b; return (ea->item == eb->item) && (ea->refclass == eb->refclass); } static guint reflected_hash (gconstpointer a) { - const ReflectedEntry *ea = a; + const ReflectedEntry *ea = (const ReflectedEntry *)a; return mono_aligned_addr_hash (ea->item); } @@ -6275,7 +6336,7 @@ reflected_hash (gconstpointer a) { mono_domain_lock (domain); \ if (!domain->refobject_hash) \ domain->refobject_hash = mono_g_hash_table_new_type (reflected_hash, reflected_equal, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_DOMAIN, "domain reflection objects table"); \ - if ((_obj = mono_g_hash_table_lookup (domain->refobject_hash, &e))) { \ + if ((_obj = (t)mono_g_hash_table_lookup (domain->refobject_hash, &e))) { \ mono_domain_unlock (domain); \ return _obj; \ } \ @@ -6288,7 +6349,7 @@ reflected_hash (gconstpointer a) { #define FREE_REFENTRY(entry) g_free ((entry)) #define REFENTRY_REQUIRES_CLEANUP #else -#define ALLOC_REFENTRY mono_mempool_alloc (domain->mp, sizeof (ReflectedEntry)) +#define ALLOC_REFENTRY (ReflectedEntry *)mono_mempool_alloc (domain->mp, sizeof (ReflectedEntry)) /* FIXME: */ #define FREE_REFENTRY(entry) #endif @@ -6302,7 +6363,7 @@ reflected_hash (gconstpointer a) { mono_domain_lock (domain); \ if (!domain->refobject_hash) \ domain->refobject_hash = mono_g_hash_table_new_type (reflected_hash, reflected_equal, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_DOMAIN, "domain reflection objects table"); \ - _obj = mono_g_hash_table_lookup (domain->refobject_hash, &pe); \ + _obj = (t)mono_g_hash_table_lookup (domain->refobject_hash, &pe); \ if (!_obj) { \ ReflectedEntry *e = ALLOC_REFENTRY; \ e->item = (p); \ @@ -6649,7 +6710,7 @@ mono_type_get_object (MonoDomain *domain, MonoType *type) if (type == &klass->byval_arg && !image_is_dynamic (klass->image)) { MonoVTable *vtable = mono_class_try_get_vtable (domain, klass); if (vtable && vtable->type) - return vtable->type; + return (MonoReflectionType *)vtable->type; } mono_loader_lock (); /*FIXME mono_class_init and mono_class_vtable acquire it*/ @@ -6657,7 +6718,7 @@ mono_type_get_object (MonoDomain *domain, MonoType *type) if (!domain->type_hash) domain->type_hash = mono_g_hash_table_new_type ((GHashFunc)mono_metadata_type_hash, (GCompareFunc)mono_metadata_type_equal, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_DOMAIN, "domain reflection types table"); - if ((res = mono_g_hash_table_lookup (domain->type_hash, type))) { + if ((res = (MonoReflectionType *)mono_g_hash_table_lookup (domain->type_hash, type))) { mono_domain_unlock (domain); mono_loader_unlock (); return res; @@ -6714,7 +6775,7 @@ mono_type_get_object (MonoDomain *domain, MonoType *type) if (is_type_done && !type->byref) { mono_domain_unlock (domain); mono_loader_unlock (); - return mono_class_get_ref_info (klass); + return (MonoReflectionType *)mono_class_get_ref_info (klass); } } /* This is stored in vtables/JITted code so it has to be pinned */ @@ -7034,7 +7095,7 @@ mono_param_get_objects_internal (MonoDomain *domain, MonoMethod *method, MonoCla /* Build MonoType for the type from the Constant Table */ if (!type) type = g_new0 (MonoType, 1); - type->type = types [i]; + type->type = (MonoTypeEnum)types [i]; type->data.klass = NULL; if (types [i] == MONO_TYPE_CLASS) type->data.klass = mono_defaults.object_class; @@ -7240,7 +7301,7 @@ get_default_param_value_blobs (MonoMethod *method, char **blobs, guint32 *types) MonoReflectionMethodAux *aux; if (method->is_inflated) method = ((MonoMethodInflated*)method)->declaring; - aux = g_hash_table_lookup (((MonoDynamicImage*)method->klass->image)->method_aux_hash, method); + aux = (MonoReflectionMethodAux *)g_hash_table_lookup (((MonoDynamicImage*)method->klass->image)->method_aux_hash, method); if (aux && aux->param_defaults) { memcpy (blobs, &(aux->param_defaults [1]), methodsig->param_count * sizeof (char*)); memcpy (types, &(aux->param_default_types [1]), methodsig->param_count * sizeof (guint32)); @@ -7276,7 +7337,7 @@ get_default_param_value_blobs (MonoMethod *method, char **blobs, guint32 *types) } mono_metadata_decode_row (constt, crow - 1, const_cols, MONO_CONSTANT_SIZE); - blobs [paramseq - 1] = (gpointer) mono_metadata_blob_heap (image, const_cols [MONO_CONSTANT_VALUE]); + blobs [paramseq - 1] = (char *)mono_metadata_blob_heap (image, const_cols [MONO_CONSTANT_VALUE]); types [paramseq - 1] = const_cols [MONO_CONSTANT_TYPE]; } @@ -7786,19 +7847,19 @@ mono_reflection_get_type_internal (MonoImage *rootimage, MonoImage* image, MonoT char *nested_name, *nested_nspace; gboolean match = TRUE; - lastp = strrchr (mod->data, '.'); + lastp = strrchr ((const char *)mod->data, '.'); if (lastp) { /* Nested classes can have namespaces */ int nspace_len; nested_name = g_strdup (lastp + 1); nspace_len = lastp - (char*)mod->data; - nested_nspace = g_malloc (nspace_len + 1); + nested_nspace = (char *)g_malloc (nspace_len + 1); memcpy (nested_nspace, mod->data, nspace_len); nested_nspace [nspace_len] = '\0'; } else { - nested_name = mod->data; + nested_name = (char *)mod->data; nested_nspace = NULL; } @@ -7841,7 +7902,7 @@ mono_reflection_get_type_internal (MonoImage *rootimage, MonoImage* image, MonoT int i; for (i = 0; i < info->type_arguments->len; i++) { - MonoTypeNameParse *subinfo = g_ptr_array_index (info->type_arguments, i); + MonoTypeNameParse *subinfo = (MonoTypeNameParse *)g_ptr_array_index (info->type_arguments, i); type_args [i] = _mono_reflection_get_type_from_info (subinfo, rootimage, ignorecase); if (!type_args [i]) { @@ -7983,7 +8044,7 @@ mono_reflection_free_type_info (MonoTypeNameParse *info) int i; for (i = 0; i < info->type_arguments->len; i++) { - MonoTypeNameParse *subinfo = g_ptr_array_index (info->type_arguments, i); + MonoTypeNameParse *subinfo = (MonoTypeNameParse *)g_ptr_array_index (info->type_arguments, i); mono_reflection_free_type_info (subinfo); /*We free the subinfo since it is allocated by _mono_reflection_parse_type*/ @@ -8126,7 +8187,7 @@ load_cattr_enum_type (MonoImage *image, const char *p, const char **end, MonoErr mono_error_init (error); - n = g_memdup (p, slen + 1); + n = (char *)g_memdup (p, slen + 1); n [slen] = 0; t = mono_reflection_type_from_name (n, image); if (!t) { @@ -8154,7 +8215,7 @@ handle_enum: case MONO_TYPE_U1: case MONO_TYPE_I1: case MONO_TYPE_BOOLEAN: { - MonoBoolean *bval = g_malloc (sizeof (MonoBoolean)); + MonoBoolean *bval = (MonoBoolean *)g_malloc (sizeof (MonoBoolean)); *bval = *p; *end = p + 1; return bval; @@ -8162,7 +8223,7 @@ handle_enum: case MONO_TYPE_CHAR: case MONO_TYPE_U2: case MONO_TYPE_I2: { - guint16 *val = g_malloc (sizeof (guint16)); + guint16 *val = (guint16 *)g_malloc (sizeof (guint16)); *val = read16 (p); *end = p + 2; return val; @@ -8174,7 +8235,7 @@ handle_enum: case MONO_TYPE_R4: case MONO_TYPE_U4: case MONO_TYPE_I4: { - guint32 *val = g_malloc (sizeof (guint32)); + guint32 *val = (guint32 *)g_malloc (sizeof (guint32)); *val = read32 (p); *end = p + 4; return val; @@ -8185,13 +8246,13 @@ handle_enum: #endif case MONO_TYPE_U8: case MONO_TYPE_I8: { - guint64 *val = g_malloc (sizeof (guint64)); + guint64 *val = (guint64 *)g_malloc (sizeof (guint64)); *val = read64 (p); *end = p + 8; return val; } case MONO_TYPE_R8: { - double *val = g_malloc (sizeof (double)); + double *val = (double *)g_malloc (sizeof (double)); readr8 (p, val); *end = p + 8; return val; @@ -8204,7 +8265,7 @@ handle_enum: MonoClass *k = t->data.klass; if (mono_is_corlib_image (k->image) && strcmp (k->name_space, "System") == 0 && strcmp (k->name, "DateTime") == 0){ - guint64 *val = g_malloc (sizeof (guint64)); + guint64 *val = (guint64 *)g_malloc (sizeof (guint64)); *val = read64 (p); *end = p + 8; return val; @@ -8230,7 +8291,7 @@ handle_enum: } handle_type: slen = mono_metadata_decode_value (p, &p); - n = g_memdup (p, slen + 1); + n = (char *)g_memdup (p, slen + 1); n [slen] = 0; t = mono_reflection_type_from_name (n, image); if (!t) { @@ -8270,7 +8331,7 @@ handle_type: if (etype == 0x51) /* See Partition II, Appendix B3 */ etype = MONO_TYPE_OBJECT; - simple_type.type = etype; + simple_type.type = (MonoTypeEnum)etype; tklass = mono_class_from_mono_type (&simple_type); } goto handle_enum; @@ -8278,7 +8339,7 @@ handle_type: char *n; MonoType *t; slen = mono_metadata_decode_value (p, &p); - n = g_memdup (p, slen + 1); + n = (char *)g_memdup (p, slen + 1); n [slen] = 0; t = mono_reflection_type_from_name (n, image); if (!t) { @@ -8292,7 +8353,7 @@ handle_type: subc = mono_class_from_mono_type (t); } else if (subt >= MONO_TYPE_BOOLEAN && subt <= MONO_TYPE_R8) { MonoType simple_type = {{0}}; - simple_type.type = subt; + simple_type.type = (MonoTypeEnum)subt; subc = mono_class_from_mono_type (&simple_type); } else { g_error ("Unknown type 0x%02x for object type encoding in custom attr", subt); @@ -8370,7 +8431,7 @@ handle_type: case MONO_TYPE_STRING: case MONO_TYPE_SZARRAY: for (i = 0; i < alen; i++) { - MonoObject *item = load_cattr_value (image, &tklass->byval_arg, p, &p, error); + MonoObject *item = (MonoObject *)load_cattr_value (image, &tklass->byval_arg, p, &p, error); if (!mono_error_ok (error)) return NULL; mono_array_setref (arr, i, item); @@ -8546,7 +8607,7 @@ create_custom_attr (MonoImage *image, MonoMethod *method, const guchar *data, gu memset (params, 0, sizeof (void*) * sig->param_count); } else { /* Allocate using GC so it gets GC tracking */ - params = mono_gc_alloc_fixed (sig->param_count * sizeof (void*), MONO_GC_DESCRIPTOR_NULL, MONO_ROOT_SOURCE_REFLECTION, "custom attribute parameters"); + params = (void **)mono_gc_alloc_fixed (sig->param_count * sizeof (void*), MONO_GC_DESCRIPTOR_NULL, MONO_ROOT_SOURCE_REFLECTION, "custom attribute parameters"); } /* skip prolog */ @@ -8576,7 +8637,7 @@ create_custom_attr (MonoImage *image, MonoMethod *method, const guchar *data, gu gint type_len; char *type_name; type_len = mono_metadata_decode_blob_size (named, &named); - type_name = g_malloc (type_len + 1); + type_name = (char *)g_malloc (type_len + 1); memcpy (type_name, named, type_len); type_name [type_len] = 0; named += type_len; @@ -8584,7 +8645,7 @@ create_custom_attr (MonoImage *image, MonoMethod *method, const guchar *data, gu g_free (type_name); } name_len = mono_metadata_decode_blob_size (named, &named); - name = g_malloc (name_len + 1); + name = (char *)g_malloc (name_len + 1); memcpy (name, named, name_len); name [name_len] = 0; named += name_len; @@ -8716,8 +8777,8 @@ mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *meth return; } - obj = type_is_reference (mono_method_signature (method)->params [i]) ? - val : mono_value_box (domain, mono_class_from_mono_type (mono_method_signature (method)->params [i]), val); + obj = (MonoObject *)(type_is_reference (mono_method_signature (method)->params [i]) ? + val : mono_value_box (domain, mono_class_from_mono_type (mono_method_signature (method)->params [i]), val)); mono_array_setref (typedargs, i, obj); if (!type_is_reference (mono_method_signature (method)->params [i])) @@ -8747,7 +8808,7 @@ mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *meth if (ADDP_IS_GREATER_OR_OVF ((const guchar*)named, type_len, data + len)) goto fail; - type_name = g_malloc (type_len + 1); + type_name = (char *)g_malloc (type_len + 1); memcpy (type_name, named, type_len); type_name [type_len] = 0; named += type_len; @@ -8757,7 +8818,7 @@ mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *meth name_len = mono_metadata_decode_blob_size (named, &named); if (ADDP_IS_GREATER_OR_OVF ((const guchar*)named, name_len, data + len)) goto fail; - name = g_malloc (name_len + 1); + name = (char *)g_malloc (name_len + 1); memcpy (name, named, name_len); name [name_len] = 0; named += name_len; @@ -8782,7 +8843,7 @@ mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *meth return; } - obj = type_is_reference (field->type) ? val : mono_value_box (domain, mono_class_from_mono_type (field->type), val); + obj = (MonoObject *)(type_is_reference (field->type) ? val : mono_value_box (domain, mono_class_from_mono_type (field->type), val)); mono_array_setref (namedargs, j, obj); if (!type_is_reference (field->type)) g_free (val); @@ -8811,7 +8872,7 @@ mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *meth return; } - obj = type_is_reference (prop_type) ? val : mono_value_box (domain, mono_class_from_mono_type (prop_type), val); + obj = (MonoObject *)(type_is_reference (prop_type) ? val : mono_value_box (domain, mono_class_from_mono_type (prop_type), val)); mono_array_setref (namedargs, j, obj); if (!type_is_reference (prop_type)) g_free (val); @@ -8852,7 +8913,7 @@ mono_reflection_resolve_custom_attribute_data (MonoReflectionMethod *ref_method, if (!mono_class_init (method->klass)) mono_raise_exception (mono_class_get_exception_for_failure (method->klass)); - mono_reflection_create_custom_attr_data_args (image, method, data, len, &typedargs, &namedargs, &arginfo, &error); + mono_reflection_create_custom_attr_data_args (image, method, (const guchar *)data, len, &typedargs, &namedargs, &arginfo, &error); if (!mono_error_ok (&error)) mono_error_raise_exception (&error); if (mono_loader_get_last_error ()) @@ -9003,7 +9064,7 @@ mono_custom_attrs_from_index (MonoImage *image, guint32 idx) len = g_list_length (list); if (!len) return NULL; - ainfo = g_malloc0 (MONO_SIZEOF_CUSTOM_ATTR_INFO + sizeof (MonoCustomAttrEntry) * len); + ainfo = (MonoCustomAttrInfo *)g_malloc0 (MONO_SIZEOF_CUSTOM_ATTR_INFO + sizeof (MonoCustomAttrEntry) * len); ainfo->num_attrs = len; ainfo->image = image; for (i = len, tmp = list; i != 0; --i, tmp = tmp->next) { @@ -9196,7 +9257,7 @@ mono_custom_attrs_from_param (MonoMethod *method, guint32 param) MonoCustomAttrInfo *res, *ainfo; int size; - aux = g_hash_table_lookup (((MonoDynamicImage*)method->klass->image)->method_aux_hash, method); + aux = (MonoReflectionMethodAux *)g_hash_table_lookup (((MonoDynamicImage*)method->klass->image)->method_aux_hash, method); if (!aux || !aux->param_cattr) return NULL; @@ -9205,7 +9266,7 @@ mono_custom_attrs_from_param (MonoMethod *method, guint32 param) if (!ainfo) return NULL; size = MONO_SIZEOF_CUSTOM_ATTR_INFO + sizeof (MonoCustomAttrEntry) * ainfo->num_attrs; - res = g_malloc0 (size); + res = (MonoCustomAttrInfo *)g_malloc0 (size); memcpy (res, ainfo, size); return res; } @@ -9617,7 +9678,7 @@ mono_reflection_type_get_handle (MonoReflectionType* ref) count = mono_array_length (gclass->type_arguments); types = g_new0 (MonoType*, count); for (i = 0; i < count; ++i) { - MonoReflectionType *t = mono_array_get (gclass->type_arguments, gpointer, i); + MonoReflectionType *t = (MonoReflectionType *)mono_array_get (gclass->type_arguments, gpointer, i); types [i] = mono_reflection_type_get_handle (t); if (!types[i]) { g_free (types); @@ -9681,7 +9742,7 @@ parameters_to_signature (MonoImage *image, MonoArray *parameters) { count = parameters? mono_array_length (parameters): 0; - sig = image_g_malloc0 (image, MONO_SIZEOF_METHOD_SIGNATURE + sizeof (MonoType*) * count); + sig = (MonoMethodSignature *)image_g_malloc0 (image, MONO_SIZEOF_METHOD_SIGNATURE + sizeof (MonoType*) * count); sig->param_count = count; sig->sentinelpos = -1; /* FIXME */ for (i = 0; i < count; ++i) @@ -9871,7 +9932,7 @@ encode_cattr_value (MonoAssembly *assembly, char *buffer, char *p, char **retbuf if ((p-buffer) + 10 >= *buflen) { char *newbuf; *buflen *= 2; - newbuf = g_realloc (buffer, *buflen); + newbuf = (char *)g_realloc (buffer, *buflen); p = newbuf + (p-buffer); buffer = newbuf; } @@ -9927,7 +9988,7 @@ handle_enum: char *newbuf; *buflen *= 2; *buflen += slen; - newbuf = g_realloc (buffer, *buflen); + newbuf = (char *)g_realloc (buffer, *buflen); p = newbuf + (p-buffer); buffer = newbuf; } @@ -9951,7 +10012,7 @@ handle_type: char *newbuf; *buflen *= 2; *buflen += slen; - newbuf = g_realloc (buffer, *buflen); + newbuf = (char *)g_realloc (buffer, *buflen); p = newbuf + (p-buffer); buffer = newbuf; } @@ -10053,7 +10114,7 @@ handle_type: char *newbuf; *buflen *= 2; *buflen += slen; - newbuf = g_realloc (buffer, *buflen); + newbuf = (char *)g_realloc (buffer, *buflen); p = newbuf + (p-buffer); buffer = newbuf; } @@ -10125,7 +10186,7 @@ encode_named_val (MonoReflectionAssembly *assembly, char *buffer, char *p, char char *newbuf; *buflen *= 2; *buflen += len; - newbuf = g_realloc (buffer, *buflen); + newbuf = (char *)g_realloc (buffer, *buflen); p = newbuf + (p-buffer); buffer = newbuf; } @@ -10172,7 +10233,7 @@ mono_reflection_get_custom_attrs_blob (MonoReflectionAssembly *assembly, MonoObj g_assert (mono_array_length (ctorArgs) == sig->param_count); buflen = 256; - p = buffer = g_malloc (buflen); + p = buffer = (char *)g_malloc (buflen); /* write the prolog */ *p++ = 1; *p++ = 0; @@ -10193,7 +10254,7 @@ mono_reflection_get_custom_attrs_blob (MonoReflectionAssembly *assembly, MonoObj MonoType *ptype; char *pname; - prop = mono_array_get (properties, gpointer, i); + prop = (MonoObject *)mono_array_get (properties, gpointer, i); get_prop_name_and_type (prop, &pname, &ptype); *p++ = 0x54; /* PROPERTY signature */ encode_named_val (assembly, buffer, p, &buffer, &p, &buflen, ptype, pname, (MonoObject*)mono_array_get (propValues, gpointer, i)); @@ -10207,7 +10268,7 @@ mono_reflection_get_custom_attrs_blob (MonoReflectionAssembly *assembly, MonoObj MonoType *ftype; char *fname; - field = mono_array_get (fields, gpointer, i); + field = (MonoObject *)mono_array_get (fields, gpointer, i); get_field_name_and_type (field, &fname, &ftype); *p++ = 0x53; /* FIELD signature */ encode_named_val (assembly, buffer, p, &buffer, &p, &buflen, ftype, fname, (MonoObject*)mono_array_get (fieldValues, gpointer, i)); @@ -10268,7 +10329,7 @@ mono_reflection_setup_internal_class (MonoReflectionTypeBuilder *tb) return; } - klass = mono_image_alloc0 (&tb->module->dynamic_image->image, sizeof (MonoClass)); + klass = (MonoClass *)mono_image_alloc0 (&tb->module->dynamic_image->image, sizeof (MonoClass)); klass->image = &tb->module->dynamic_image->image; @@ -10385,16 +10446,16 @@ mono_reflection_create_generic_class (MonoReflectionTypeBuilder *tb) g_assert (tb->generic_container && (tb->generic_container->owner.klass == klass)); - klass->generic_container = mono_image_alloc0 (klass->image, sizeof (MonoGenericContainer)); + klass->generic_container = (MonoGenericContainer *)mono_image_alloc0 (klass->image, sizeof (MonoGenericContainer)); klass->generic_container->owner.klass = klass; klass->generic_container->type_argc = count; - klass->generic_container->type_params = mono_image_alloc0 (klass->image, sizeof (MonoGenericParamFull) * count); + klass->generic_container->type_params = (MonoGenericParamFull *)mono_image_alloc0 (klass->image, sizeof (MonoGenericParamFull) * count); klass->is_generic = 1; for (i = 0; i < count; i++) { - MonoReflectionGenericParam *gparam = mono_array_get (tb->generic_params, gpointer, i); + MonoReflectionGenericParam *gparam = (MonoReflectionGenericParam *)mono_array_get (tb->generic_params, gpointer, i); MonoGenericParamFull *param = (MonoGenericParamFull *) mono_reflection_type_get_handle ((MonoReflectionType*)gparam)->data.generic_param; klass->generic_container->type_params [i] = *param; /*Make sure we are a diferent type instance */ @@ -10465,11 +10526,11 @@ mono_marshal_spec_from_builder (MonoImage *image, MonoAssembly *assembly, MonoMarshalSpec *res; res = image_g_new0 (image, MonoMarshalSpec, 1); - res->native = minfo->type; + res->native = (MonoMarshalNative)minfo->type; switch (minfo->type) { case MONO_NATIVE_LPARRAY: - res->data.array_data.elem_type = minfo->eltype; + res->data.array_data.elem_type = (MonoMarshalNative)minfo->eltype; if (minfo->has_size) { res->data.array_data.param_num = minfo->param_num; res->data.array_data.num_elem = minfo->count; @@ -10654,9 +10715,9 @@ reflection_methodbuilder_to_mono_method (MonoClass *klass, } } - header = image_g_malloc0 (image, MONO_SIZEOF_METHOD_HEADER + num_locals * sizeof (MonoType*)); + header = (MonoMethodHeader *)image_g_malloc0 (image, MONO_SIZEOF_METHOD_HEADER + num_locals * sizeof (MonoType*)); header->code_size = code_size; - header->code = image_g_malloc (image, code_size); + header->code = (const unsigned char *)image_g_malloc (image, code_size); memcpy ((char*)header->code, code, code_size); header->max_stack = max_stack; header->init_locals = rmb->init_locals; @@ -10688,6 +10749,7 @@ reflection_methodbuilder_to_mono_method (MonoClass *klass, container->type_argc = count; container->type_params = image_g_new0 (image, MonoGenericParamFull, count); container->owner.method = m; + container->is_anonymous = FALSE; // Method is now known, container is no longer anonymous m->is_generic = TRUE; mono_method_set_generic_container (m, container); @@ -10754,7 +10816,8 @@ reflection_methodbuilder_to_mono_method (MonoClass *klass, if (pb->attrs & PARAM_ATTRIBUTE_HAS_DEFAULT) { MonoDynamicImage *assembly; - guint32 idx, def_type, len; + guint32 idx, len; + MonoTypeEnum def_type; char *p; const char *p2; @@ -10768,7 +10831,7 @@ reflection_methodbuilder_to_mono_method (MonoClass *klass, p = assembly->blob.data + idx; len = mono_metadata_decode_blob_size (p, &p2); len += p2 - p; - method_aux->param_defaults [i] = image_g_malloc (image, len); + method_aux->param_defaults [i] = (uint8_t *)image_g_malloc (image, len); method_aux->param_default_types [i] = def_type; memcpy ((gpointer)method_aux->param_defaults [i], p, len); } @@ -10999,7 +11062,7 @@ mono_reflection_bind_generic_method_parameters (MonoReflectionMethod *rmethod, M type_argv = g_new0 (MonoType *, count); for (i = 0; i < count; i++) { - MonoReflectionType *garg = mono_array_get (types, gpointer, i); + MonoReflectionType *garg = (MonoReflectionType *)mono_array_get (types, gpointer, i); type_argv [i] = mono_reflection_type_get_handle (garg); } ginst = mono_metadata_get_generic_inst (count, type_argv); @@ -11144,7 +11207,7 @@ mono_reflection_generic_class_initialize (MonoReflectionGenericClass *type, Mono dgclass->field_generic_types = mono_image_set_new0 (gclass->owner, MonoType*, dgclass->count_fields); for (i = 0; i < dgclass->count_fields; i++) { - MonoObject *obj = mono_array_get (fields, gpointer, i); + MonoObject *obj = (MonoObject *)mono_array_get (fields, gpointer, i); MonoClassField *field, *inflated_field = NULL; if (!strcmp (obj->vtable->klass->name, "FieldBuilder")) @@ -11227,7 +11290,7 @@ fix_partial_generic_class (MonoClass *klass) if (klass->method.count != gklass->method.count) { klass->method.count = gklass->method.count; - klass->methods = mono_image_alloc (klass->image, sizeof (MonoMethod*) * (klass->method.count + 1)); + klass->methods = (MonoMethod **)mono_image_alloc (klass->image, sizeof (MonoMethod*) * (klass->method.count + 1)); for (i = 0; i < klass->method.count; i++) { MonoError error; @@ -11239,7 +11302,7 @@ fix_partial_generic_class (MonoClass *klass) if (klass->interface_count && klass->interface_count != gklass->interface_count) { klass->interface_count = gklass->interface_count; - klass->interfaces = mono_image_alloc (klass->image, sizeof (MonoClass*) * gklass->interface_count); + klass->interfaces = (MonoClass **)mono_image_alloc (klass->image, sizeof (MonoClass*) * gklass->interface_count); klass->interfaces_packed = NULL; /*make setup_interface_offsets happy*/ for (i = 0; i < gklass->interface_count; ++i) { @@ -11282,7 +11345,7 @@ ensure_generic_class_runtime_vtable (MonoClass *klass) static void ensure_runtime_vtable (MonoClass *klass) { - MonoReflectionTypeBuilder *tb = mono_class_get_ref_info (klass); + MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)mono_class_get_ref_info (klass); int i, num, j; if (!image_is_dynamic (klass->image) || (!tb && !klass->generic_class) || klass->wastypebuilder) @@ -11294,7 +11357,7 @@ ensure_runtime_vtable (MonoClass *klass) num = tb->ctors? mono_array_length (tb->ctors): 0; num += tb->num_methods; klass->method.count = num; - klass->methods = mono_image_alloc (klass->image, sizeof (MonoMethod*) * num); + klass->methods = (MonoMethod **)mono_image_alloc (klass->image, sizeof (MonoMethod*) * num); num = tb->ctors? mono_array_length (tb->ctors): 0; for (i = 0; i < num; ++i) klass->methods [i] = ctorbuilder_to_mono_method (klass, mono_array_get (tb->ctors, MonoReflectionCtorBuilder*, i)); @@ -11305,7 +11368,7 @@ ensure_runtime_vtable (MonoClass *klass) if (tb->interfaces) { klass->interface_count = mono_array_length (tb->interfaces); - klass->interfaces = mono_image_alloc (klass->image, sizeof (MonoClass*) * klass->interface_count); + klass->interfaces = (MonoClass **)mono_image_alloc (klass->image, sizeof (MonoClass*) * klass->interface_count); for (i = 0; i < klass->interface_count; ++i) { MonoType *iface = mono_type_array_get_and_resolve (tb->interfaces, i); klass->interfaces [i] = mono_class_from_mono_type (iface); @@ -11438,7 +11501,7 @@ mono_reflection_get_dynamic_overrides (MonoClass *klass, MonoMethod ***overrides static void typebuilder_setup_fields (MonoClass *klass, MonoError *error) { - MonoReflectionTypeBuilder *tb = mono_class_get_ref_info (klass); + MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)mono_class_get_ref_info (klass); MonoReflectionFieldBuilder *fb; MonoClassField *field; MonoImage *image = klass->image; @@ -11480,7 +11543,7 @@ typebuilder_setup_fields (MonoClass *klass, MonoError *error) for (i = 0; i < klass->field.count; ++i) { MonoArray *rva_data; - fb = mono_array_get (tb->fields, gpointer, i); + fb = (MonoReflectionFieldBuilder *)mono_array_get (tb->fields, gpointer, i); field = &klass->fields [i]; field->name = mono_string_to_utf8_image (image, fb->name, error); if (!mono_error_ok (error)) @@ -11495,7 +11558,7 @@ typebuilder_setup_fields (MonoClass *klass, MonoError *error) if ((fb->attrs & FIELD_ATTRIBUTE_HAS_FIELD_RVA) && (rva_data = fb->rva_data)) { char *base = mono_array_addr (rva_data, char, 0); size_t size = mono_array_length (rva_data); - char *data = mono_image_alloc (klass->image, size); + char *data = (char *)mono_image_alloc (klass->image, size); memcpy (data, base, size); klass->ext->field_def_values [i].data = data; } @@ -11516,7 +11579,7 @@ typebuilder_setup_fields (MonoClass *klass, MonoError *error) p = assembly->blob.data + idx; len = mono_metadata_decode_blob_size (p, &p2); len += p2 - p; - klass->ext->field_def_values [i].data = mono_image_alloc (image, len); + klass->ext->field_def_values [i].data = (const char *)mono_image_alloc (image, len); memcpy ((gpointer)klass->ext->field_def_values [i].data, p, len); } } @@ -11528,7 +11591,7 @@ typebuilder_setup_fields (MonoClass *klass, MonoError *error) static void typebuilder_setup_properties (MonoClass *klass, MonoError *error) { - MonoReflectionTypeBuilder *tb = mono_class_get_ref_info (klass); + MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)mono_class_get_ref_info (klass); MonoReflectionPropertyBuilder *pb; MonoImage *image = klass->image; MonoProperty *properties; @@ -11569,7 +11632,7 @@ typebuilder_setup_properties (MonoClass *klass, MonoError *error) p = assembly->blob.data + idx; len = mono_metadata_decode_blob_size (p, &p2); len += p2 - p; - klass->ext->prop_def_values [i].data = mono_image_alloc (image, len); + klass->ext->prop_def_values [i].data = (const char *)mono_image_alloc (image, len); memcpy ((gpointer)klass->ext->prop_def_values [i].data, p, len); } } @@ -11612,7 +11675,7 @@ mono_reflection_event_builder_get_event_info (MonoReflectionTypeBuilder *tb, Mon static void typebuilder_setup_events (MonoClass *klass, MonoError *error) { - MonoReflectionTypeBuilder *tb = mono_class_get_ref_info (klass); + MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)mono_class_get_ref_info (klass); MonoReflectionEventBuilder *eb; MonoImage *image = klass->image; MonoEvent *events; @@ -11704,7 +11767,7 @@ mono_reflection_create_runtime_class (MonoReflectionTypeBuilder *tb) check_array_for_usertypes (tb->interfaces); if (tb->fields) { for (i = 0; i < mono_array_length (tb->fields); ++i) { - MonoReflectionFieldBuilder *fb = mono_array_get (tb->fields, gpointer, i); + MonoReflectionFieldBuilder *fb = (MonoReflectionFieldBuilder *)mono_array_get (tb->fields, gpointer, i); if (fb) { RESOLVE_TYPE (fb->type); check_array_for_usertypes (fb->modreq); @@ -11716,7 +11779,7 @@ mono_reflection_create_runtime_class (MonoReflectionTypeBuilder *tb) } if (tb->methods) { for (i = 0; i < mono_array_length (tb->methods); ++i) { - MonoReflectionMethodBuilder *mb = mono_array_get (tb->methods, gpointer, i); + MonoReflectionMethodBuilder *mb = (MonoReflectionMethodBuilder *)mono_array_get (tb->methods, gpointer, i); if (mb) { RESOLVE_TYPE (mb->rtype); check_array_for_usertypes (mb->return_modreq); @@ -11733,7 +11796,7 @@ mono_reflection_create_runtime_class (MonoReflectionTypeBuilder *tb) } if (tb->ctors) { for (i = 0; i < mono_array_length (tb->ctors); ++i) { - MonoReflectionCtorBuilder *mb = mono_array_get (tb->ctors, gpointer, i); + MonoReflectionCtorBuilder *mb = (MonoReflectionCtorBuilder *)mono_array_get (tb->ctors, gpointer, i); if (mb) { check_array_for_usertypes (mb->parameters); if (mb->param_modreq) @@ -11882,25 +11945,26 @@ mono_reflection_initialize_generic_parameter (MonoReflectionGenericParam *gparam if (!gparam->mbuilder->generic_container) { MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)gparam->mbuilder->type; MonoClass *klass = mono_class_from_mono_type (mono_reflection_type_get_handle ((MonoReflectionType*)tb)); - gparam->mbuilder->generic_container = mono_image_alloc0 (klass->image, sizeof (MonoGenericContainer)); + gparam->mbuilder->generic_container = (MonoGenericContainer *)mono_image_alloc0 (klass->image, sizeof (MonoGenericContainer)); gparam->mbuilder->generic_container->is_method = TRUE; /* * Cannot set owner.method, since the MonoMethod is not created yet. * Set the image field instead, so type_in_image () works. */ - gparam->mbuilder->generic_container->image = klass->image; + gparam->mbuilder->generic_container->is_anonymous = TRUE; + gparam->mbuilder->generic_container->owner.image = klass->image; } param->param.owner = gparam->mbuilder->generic_container; } else if (gparam->tbuilder) { if (!gparam->tbuilder->generic_container) { MonoClass *klass = mono_class_from_mono_type (mono_reflection_type_get_handle ((MonoReflectionType*)gparam->tbuilder)); - gparam->tbuilder->generic_container = mono_image_alloc0 (klass->image, sizeof (MonoGenericContainer)); + gparam->tbuilder->generic_container = (MonoGenericContainer *)mono_image_alloc0 (klass->image, sizeof (MonoGenericContainer)); gparam->tbuilder->generic_container->owner.klass = klass; } param->param.owner = gparam->tbuilder->generic_container; } - pklass = mono_class_from_generic_parameter ((MonoGenericParam *) param, image, gparam->mbuilder != NULL); + pklass = mono_class_from_generic_parameter_internal ((MonoGenericParam *) param); gparam->type.type = &pklass->byval_arg; @@ -11979,7 +12043,7 @@ static MonoReferenceQueue *dynamic_method_queue; static void free_dynamic_method (void *dynamic_method) { - DynamicMethodReleaseData *data = dynamic_method; + DynamicMethodReleaseData *data = (DynamicMethodReleaseData *)dynamic_method; MonoDomain *domain = data->domain; MonoMethod *method = data->handle; guint32 dis_link; @@ -12134,7 +12198,7 @@ mono_reflection_lookup_signature (MonoImage *image, MonoMethod *method, guint32 mono_error_init (error); - sig = g_hash_table_lookup (((MonoDynamicImage*)image)->vararg_aux_hash, GUINT_TO_POINTER (token)); + sig = (MonoMethodSignature *)g_hash_table_lookup (((MonoDynamicImage*)image)->vararg_aux_hash, GUINT_TO_POINTER (token)); if (sig) return sig; @@ -12183,7 +12247,7 @@ static void ensure_complete_type (MonoClass *klass) { if (image_is_dynamic (klass->image) && !klass->wastypebuilder && mono_class_get_ref_info (klass)) { - MonoReflectionTypeBuilder *tb = mono_class_get_ref_info (klass); + MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)mono_class_get_ref_info (klass); mono_domain_try_type_resolve (mono_domain_get (), NULL, (MonoObject*)tb); @@ -12232,7 +12296,7 @@ resolve_object (MonoImage *image, MonoObject *obj, MonoClass **handle_class, Mon result = ((MonoReflectionMethod*)obj)->method; if (context) { MonoError error; - result = mono_class_inflate_generic_method_checked (result, context, &error); + result = mono_class_inflate_generic_method_checked ((MonoMethod *)result, context, &error); g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */ } *handle_class = mono_defaults.methodhandle_class; @@ -12258,7 +12322,7 @@ resolve_object (MonoImage *image, MonoObject *obj, MonoClass **handle_class, Mon } if (context) { MonoError error; - result = mono_class_inflate_generic_method_checked (result, context, &error); + result = mono_class_inflate_generic_method_checked ((MonoMethod *)result, context, &error); g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */ } *handle_class = mono_defaults.methodhandle_class; @@ -12274,7 +12338,7 @@ resolve_object (MonoImage *image, MonoObject *obj, MonoClass **handle_class, Mon } if (context) { MonoError error; - result = mono_class_inflate_generic_method_checked (result, context, &error); + result = mono_class_inflate_generic_method_checked ((MonoMethod *)result, context, &error); g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */ } *handle_class = mono_defaults.methodhandle_class; @@ -12430,7 +12494,7 @@ resolve_object (MonoImage *image, MonoObject *obj, MonoClass **handle_class, Mon result = mono_reflection_method_on_tb_inst_get_handle (m); if (context) { MonoError error; - result = mono_class_inflate_generic_method_checked (result, context, &error); + result = mono_class_inflate_generic_method_checked ((MonoMethod *)result, context, &error); g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */ } } else { diff --git a/mono/metadata/remoting.c b/mono/metadata/remoting.c index 22ab5cc7a6e..cbe8b3add94 100644 --- a/mono/metadata/remoting.c +++ b/mono/metadata/remoting.c @@ -86,14 +86,14 @@ static inline void remoting_lock (void) { g_assert (remoting_mutex_inited); - mono_mutex_lock (&remoting_mutex); + mono_os_mutex_lock (&remoting_mutex); } static inline void remoting_unlock (void) { g_assert (remoting_mutex_inited); - mono_mutex_unlock (&remoting_mutex); + mono_os_mutex_unlock (&remoting_mutex); } /* @@ -134,7 +134,7 @@ get_cache_full (GHashTable **var, GHashFunc hash_func, GCompareFunc equal_func, void mono_remoting_init (void) { - mono_mutex_init (&remoting_mutex); + mono_os_mutex_init (&remoting_mutex); remoting_mutex_inited = TRUE; } @@ -266,7 +266,7 @@ mono_marshal_remoting_find_in_cache (MonoMethod *method, int wrapper_type) mono_marshal_lock_internal (); if (mono_method_get_wrapper_cache (method)->remoting_invoke_cache) - wrps = g_hash_table_lookup (mono_method_get_wrapper_cache (method)->remoting_invoke_cache, method); + wrps = (MonoRemotingMethods *)g_hash_table_lookup (mono_method_get_wrapper_cache (method)->remoting_invoke_cache, method); if (wrps) { switch (wrapper_type) { @@ -297,7 +297,7 @@ mono_remoting_mb_create_and_cache (MonoMethod *key, MonoMethodBuilder *mb, cache = get_cache_full (&mono_method_get_wrapper_cache (key)->remoting_invoke_cache, mono_aligned_addr_hash, NULL, NULL, g_free); mono_marshal_lock_internal (); - wrps = g_hash_table_lookup (cache, key); + wrps = (MonoRemotingMethods *)g_hash_table_lookup (cache, key); if (!wrps) { wrps = g_new0 (MonoRemotingMethods, 1); g_hash_table_insert (cache, key, wrps); @@ -361,7 +361,7 @@ mono_remoting_wrapper (MonoMethod *method, gpointer *params) } else { /* runtime_invoke expects a boxed instance */ if (mono_class_is_nullable (mono_class_from_mono_type (sig->params [i]))) - mparams[i] = mono_nullable_box (params [i], klass); + mparams[i] = mono_nullable_box ((guint8 *)params [i], klass); else mparams[i] = params [i]; } @@ -469,7 +469,7 @@ mono_marshal_xdomain_copy_out_value (MonoObject *src, MonoObject *dst) if (mt == MONO_MARSHAL_COPY) { int i, len = mono_array_length ((MonoArray *)dst); for (i = 0; i < len; i++) { - MonoObject *item = mono_array_get ((MonoArray *)src, gpointer, i); + MonoObject *item = (MonoObject *)mono_array_get ((MonoArray *)src, gpointer, i); mono_array_setref ((MonoArray *)dst, i, mono_marshal_xdomain_copy_value (item)); } } else { @@ -564,7 +564,7 @@ mono_marshal_check_domain_image (gint32 domain_id, MonoImage *image) mono_domain_assemblies_lock (domain); for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) { - ass = tmp->data; + ass = (MonoAssembly *)tmp->data; if (ass->image == image) break; } @@ -629,7 +629,7 @@ mono_marshal_get_xappdomain_dispatch (MonoMethod *method, int *marshal_types, in /* try */ - main_clause = mono_image_alloc0 (method->klass->image, sizeof (MonoExceptionClause)); + main_clause = (MonoExceptionClause *)mono_image_alloc0 (method->klass->image, sizeof (MonoExceptionClause)); main_clause->try_offset = mono_mb_get_label (mb); /* Clean the call context */ @@ -880,7 +880,7 @@ mono_marshal_get_xappdomain_invoke (MonoMethod *method) /* Count the number of parameters that need to be serialized */ - marshal_types = alloca (sizeof (int) * sig->param_count); + marshal_types = (int *)alloca (sizeof (int) * sig->param_count); complex_count = complex_out_count = 0; for (i = 0; i < sig->param_count; i++) { MonoType *ptype = sig->params[i]; @@ -2006,7 +2006,7 @@ mono_marshal_xdomain_copy_value (MonoObject *val) if (mt == MONO_MARSHAL_COPY) { int i, len = mono_array_length (acopy); for (i = 0; i < len; i++) { - MonoObject *item = mono_array_get (acopy, gpointer, i); + MonoObject *item = (MonoObject *)mono_array_get (acopy, gpointer, i); mono_array_setref (acopy, i, mono_marshal_xdomain_copy_value (item)); } } diff --git a/mono/metadata/security-core-clr.c b/mono/metadata/security-core-clr.c index 6ec8cbe1ea8..de9ec6a79c9 100644 --- a/mono/metadata/security-core-clr.c +++ b/mono/metadata/security-core-clr.c @@ -332,7 +332,7 @@ mono_security_core_clr_check_override (MonoClass *klass, MonoMethod *override, M static gboolean get_caller_no_reflection_related (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data) { - MonoMethod **dest = data; + MonoMethod **dest = (MonoMethod **)data; const char *ns; /* skip unmanaged frames */ @@ -436,7 +436,7 @@ typedef struct { static gboolean get_caller_of_elevated_trust_code (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data) { - ElevatedTrustCookie *cookie = data; + ElevatedTrustCookie *cookie = (ElevatedTrustCookie *)data; /* skip unmanaged frames and wrappers */ if (!managed || (m->wrapper_type != MONO_WRAPPER_NONE)) @@ -917,7 +917,7 @@ mono_security_core_clr_level_from_cinfo (MonoCustomAttrInfo *cinfo, MonoImage *i if (cinfo && mono_custom_attrs_has_attr (cinfo, security_critical_attribute ())) level = MONO_SECURITY_CORE_CLR_CRITICAL; - return level; + return (MonoSecurityCoreCLRLevel)level; } /* diff --git a/mono/metadata/seq-points-data.c b/mono/metadata/seq-points-data.c index b8b1bcdb6f4..b6b59407129 100644 --- a/mono/metadata/seq-points-data.c +++ b/mono/metadata/seq-points-data.c @@ -372,7 +372,7 @@ mono_seq_point_data_init (SeqPointData *data, int entry_capacity) { data->entry_count = 0; data->entry_capacity = entry_capacity; - data->entries = g_malloc (sizeof (SeqPointDataEntry) * entry_capacity); + data->entries = (SeqPointDataEntry *)g_malloc (sizeof (SeqPointDataEntry) * entry_capacity); } void @@ -402,7 +402,7 @@ mono_seq_point_data_read (SeqPointData *data, char *path) fsize = ftell(f); fseek(f, 0, SEEK_SET); - buffer_orig = buffer = g_malloc(fsize + 1); + buffer_orig = buffer = (guint8 *)g_malloc (fsize + 1); fread(buffer_orig, fsize, 1, f); fclose(f); @@ -438,7 +438,7 @@ mono_seq_point_data_write (SeqPointData *data, char *path) // Add size of entry_count and native_base_offsets size += 4 + data->entry_count * 4; - buffer_orig = buffer = g_malloc (size); + buffer_orig = buffer = (guint8 *)g_malloc (size); encode_var_int (buffer, &buffer, data->entry_count); diff --git a/mono/metadata/seq-points-data.h b/mono/metadata/seq-points-data.h index babdea43c86..3f72f3f338a 100644 --- a/mono/metadata/seq-points-data.h +++ b/mono/metadata/seq-points-data.h @@ -28,7 +28,7 @@ typedef struct { } SeqPoint; typedef struct MonoSeqPointInfo { - int dummy[0]; + int dummy [1]; } MonoSeqPointInfo; typedef struct { diff --git a/mono/metadata/sgen-bridge.c b/mono/metadata/sgen-bridge.c index 67e6a05bf30..5e4fa165ab0 100644 --- a/mono/metadata/sgen-bridge.c +++ b/mono/metadata/sgen-bridge.c @@ -151,8 +151,8 @@ sgen_bridge_processing_stw_step (void) static gboolean is_bridge_object_dead (GCObject *obj, void *data) { - SgenHashTable *table = data; - unsigned char *value = sgen_hash_table_lookup (table, obj); + SgenHashTable *table = (SgenHashTable *)data; + unsigned char *value = (unsigned char *)sgen_hash_table_lookup (table, obj); if (!value) return FALSE; return !*value; @@ -216,8 +216,8 @@ free_callback_data (SgenBridgeProcessor *processor) static int compare_xrefs (const void *a_ptr, const void *b_ptr) { - const MonoGCBridgeXRef *a = a_ptr; - const MonoGCBridgeXRef *b = b_ptr; + const MonoGCBridgeXRef *a = (const MonoGCBridgeXRef *)a_ptr; + const MonoGCBridgeXRef *b = (const MonoGCBridgeXRef *)b_ptr; if (a->src_scc_index < b->src_scc_index) return -1; @@ -309,7 +309,7 @@ sgen_compare_bridge_processor_results (SgenBridgeProcessor *a, SgenBridgeProcess gboolean new_entry; g_assert (scc->num_objs > 0); - a_scc_index_ptr = sgen_hash_table_lookup (&obj_to_a_scc, scc->objs [0]); + a_scc_index_ptr = (int *)sgen_hash_table_lookup (&obj_to_a_scc, scc->objs [0]); g_assert (a_scc_index_ptr); a_scc_index = *a_scc_index_ptr; @@ -319,7 +319,7 @@ sgen_compare_bridge_processor_results (SgenBridgeProcessor *a, SgenBridgeProcess g_assert (a_scc->num_objs == scc->num_objs); for (j = 1; j < scc->num_objs; ++j) { - a_scc_index_ptr = sgen_hash_table_lookup (&obj_to_a_scc, scc->objs [j]); + a_scc_index_ptr = (int *)sgen_hash_table_lookup (&obj_to_a_scc, scc->objs [j]); g_assert (a_scc_index_ptr); g_assert (*a_scc_index_ptr == a_scc_index); } @@ -339,8 +339,8 @@ sgen_compare_bridge_processor_results (SgenBridgeProcessor *a, SgenBridgeProcess */ xrefs_alloc_size = a->num_xrefs * sizeof (MonoGCBridgeXRef); - a_xrefs = sgen_alloc_internal_dynamic (xrefs_alloc_size, INTERNAL_MEM_BRIDGE_DEBUG, TRUE); - b_xrefs = sgen_alloc_internal_dynamic (xrefs_alloc_size, INTERNAL_MEM_BRIDGE_DEBUG, TRUE); + a_xrefs = (MonoGCBridgeXRef *)sgen_alloc_internal_dynamic (xrefs_alloc_size, INTERNAL_MEM_BRIDGE_DEBUG, TRUE); + b_xrefs = (MonoGCBridgeXRef *)sgen_alloc_internal_dynamic (xrefs_alloc_size, INTERNAL_MEM_BRIDGE_DEBUG, TRUE); memcpy (a_xrefs, a->api_xrefs, xrefs_alloc_size); for (i = 0; i < b->num_xrefs; ++i) { @@ -349,11 +349,11 @@ sgen_compare_bridge_processor_results (SgenBridgeProcessor *a, SgenBridgeProcess g_assert (xref->src_scc_index != xref->dst_scc_index); - scc_index_ptr = sgen_hash_table_lookup (&b_scc_to_a_scc, GINT_TO_POINTER (xref->src_scc_index)); + scc_index_ptr = (int *)sgen_hash_table_lookup (&b_scc_to_a_scc, GINT_TO_POINTER (xref->src_scc_index)); g_assert (scc_index_ptr); b_xrefs [i].src_scc_index = *scc_index_ptr; - scc_index_ptr = sgen_hash_table_lookup (&b_scc_to_a_scc, GINT_TO_POINTER (xref->dst_scc_index)); + scc_index_ptr = (int *)sgen_hash_table_lookup (&b_scc_to_a_scc, GINT_TO_POINTER (xref->dst_scc_index)); g_assert (scc_index_ptr); b_xrefs [i].dst_scc_index = *scc_index_ptr; } diff --git a/mono/metadata/sgen-client-mono.h b/mono/metadata/sgen-client-mono.h index ab0cedf6ad6..71906968539 100644 --- a/mono/metadata/sgen-client-mono.h +++ b/mono/metadata/sgen-client-mono.h @@ -90,7 +90,7 @@ struct _SgenClientThreadInfo { #include "utils/mono-counters.h" #include "utils/mono-logger-internals.h" #include "utils/mono-time.h" -#include "utils/mono-semaphore.h" +#include "utils/mono-os-semaphore.h" #include "metadata/sgen-bridge-internals.h" extern void mono_sgen_register_moved_object (void *obj, void *destination); @@ -114,7 +114,7 @@ sgen_mono_array_size (GCVTable vtable, MonoArray *array, mword *bounds_size, mwo else element_size = vtable->klass->sizes.element_size; - size_without_bounds = size = sizeof (MonoArray) + element_size * mono_array_length_fast (array); + size_without_bounds = size = MONO_SIZEOF_MONO_ARRAY + element_size * mono_array_length_fast (array); if (G_UNLIKELY (array->bounds)) { size += sizeof (mono_array_size_t) - 1; @@ -401,7 +401,7 @@ sgen_client_binary_protocol_block_free (gpointer addr, size_t size) } static void G_GNUC_UNUSED -sgen_client_binary_protocol_block_set_state (gpointer addr, size_t size, int old, int new) +sgen_client_binary_protocol_block_set_state (gpointer addr, size_t size, int old, int new_) { } @@ -560,6 +560,11 @@ sgen_client_binary_protocol_global_remset (gpointer ptr, gpointer value, gpointe #endif } +static void G_GNUC_UNUSED +sgen_client_binary_protocol_mod_union_remset (gpointer obj, gpointer ptr, gpointer value, gpointer value_vtable) +{ +} + static void G_GNUC_UNUSED sgen_client_binary_protocol_ptr_update (gpointer ptr, gpointer old_value, gpointer new_value, gpointer vtable, size_t size) { @@ -694,9 +699,9 @@ extern MonoNativeTlsKey thread_info_key; typedef MonoSemType SgenSemaphore; -#define SGEN_SEMAPHORE_INIT(sem,initial) MONO_SEM_INIT ((sem), (initial)) -#define SGEN_SEMAPHORE_POST(sem) MONO_SEM_POST ((sem)) -#define SGEN_SEMAPHORE_WAIT(sem) MONO_SEM_WAIT ((sem)) +#define SGEN_SEMAPHORE_INIT(sem,initial) mono_os_sem_init ((sem), (initial)) +#define SGEN_SEMAPHORE_POST(sem) mono_os_sem_post ((sem)) +#define SGEN_SEMAPHORE_WAIT(sem) mono_os_sem_wait ((sem), MONO_SEM_FLAGS_NONE) gboolean sgen_has_critical_method (void); gboolean sgen_is_critical_method (MonoMethod *method); diff --git a/mono/metadata/sgen-mono.c b/mono/metadata/sgen-mono.c index 2783e1af8fa..f6ae431afde 100644 --- a/mono/metadata/sgen-mono.c +++ b/mono/metadata/sgen-mono.c @@ -376,7 +376,7 @@ get_array_fill_vtable (void) klass.element_class = mono_defaults.byte_class; klass.rank = 1; - klass.instance_size = sizeof (MonoArray); + klass.instance_size = MONO_SIZEOF_MONO_ARRAY; klass.sizes.element_size = 1; klass.name = "array_filler_type"; @@ -395,7 +395,7 @@ sgen_client_array_fill_range (char *start, size_t size) { MonoArray *o; - if (size < sizeof (MonoArray)) { + if (size < MONO_SIZEOF_MONO_ARRAY) { memset (start, 0, size); return FALSE; } @@ -403,9 +403,9 @@ sgen_client_array_fill_range (char *start, size_t size) o = (MonoArray*)start; o->obj.vtable = (MonoVTable*)get_array_fill_vtable (); /* Mark this as not a real object */ - o->obj.synchronisation = GINT_TO_POINTER (-1); + o->obj.synchronisation = (MonoThreadsSync *)GINT_TO_POINTER (-1); o->bounds = NULL; - o->max_length = (mono_array_size_t)(size - sizeof (MonoArray)); + o->max_length = (mono_array_size_t)(size - MONO_SIZEOF_MONO_ARRAY); return TRUE; } @@ -413,10 +413,10 @@ sgen_client_array_fill_range (char *start, size_t size) void sgen_client_zero_array_fill_header (void *p, size_t size) { - if (size >= sizeof (MonoArray)) { - memset (p, 0, sizeof (MonoArray)); + if (size >= MONO_SIZEOF_MONO_ARRAY) { + memset (p, 0, MONO_SIZEOF_MONO_ARRAY); } else { - static guint8 zeros [sizeof (MonoArray)]; + static guint8 zeros [MONO_SIZEOF_MONO_ARRAY]; SGEN_ASSERT (0, !memcmp (p, zeros, size), "TLAB segment must be zeroed out."); } @@ -519,7 +519,7 @@ mono_gc_register_for_finalization (MonoObject *obj, void *user_data) static gboolean object_in_domain_predicate (MonoObject *obj, void *user_data) { - MonoDomain *domain = user_data; + MonoDomain *domain = (MonoDomain *)user_data; if (mono_object_domain (obj) == domain) { SGEN_LOG (5, "Unregistering finalizer for object: %p (%s)", obj, sgen_client_vtable_get_name (SGEN_LOAD_VTABLE (obj))); return TRUE; @@ -717,7 +717,7 @@ mono_gc_ephemeron_array_add (MonoObject *obj) LOCK_GC; - node = sgen_alloc_internal (INTERNAL_MEM_EPHEMERON_LINK); + node = (EphemeronLinkNode *)sgen_alloc_internal (INTERNAL_MEM_EPHEMERON_LINK); if (!node) { UNLOCK_GC; return FALSE; @@ -973,7 +973,7 @@ mono_gc_alloc_fixed (size_t size, MonoGCDescriptor descr, MonoGCRootSource sourc void *res = calloc (1, size); if (!res) return NULL; - if (!mono_gc_register_root (res, size, descr, source, msg)) { + if (!mono_gc_register_root ((char *)res, size, descr, source, msg)) { free (res); res = NULL; } @@ -983,7 +983,7 @@ mono_gc_alloc_fixed (size_t size, MonoGCDescriptor descr, MonoGCRootSource sourc void mono_gc_free_fixed (void* addr) { - mono_gc_deregister_root (addr); + mono_gc_deregister_root ((char *)addr); free (addr); } @@ -1168,7 +1168,7 @@ create_allocator (int atype, gboolean slowpath) mono_mb_patch_short_branch (mb, pos); - clause = mono_image_alloc0 (mono_defaults.corlib, sizeof (MonoExceptionClause)); + clause = (MonoExceptionClause *)mono_image_alloc0 (mono_defaults.corlib, sizeof (MonoExceptionClause)); clause->try_offset = mono_mb_get_label (mb); /* vtable->klass->sizes.element_size */ @@ -1185,7 +1185,7 @@ create_allocator (int atype, gboolean slowpath) mono_mb_emit_ldarg (mb, 1); mono_mb_emit_byte (mb, CEE_MUL_OVF_UN); /* + sizeof (MonoArray) */ - mono_mb_emit_icon (mb, sizeof (MonoArray)); + mono_mb_emit_icon (mb, MONO_SIZEOF_MONO_ARRAY); mono_mb_emit_byte (mb, CEE_ADD_OVF_UN); mono_mb_emit_stloc (mb, size_var); @@ -1602,7 +1602,7 @@ sgen_client_cardtable_scan_object (GCObject *obj, mword block_obj_size, guint8 * MonoArray *arr = (MonoArray*)obj; guint8 *card_data, *card_base; guint8 *card_data_end; - char *obj_start = sgen_card_table_align_pointer (obj); + char *obj_start = (char *)sgen_card_table_align_pointer (obj); mword bounds_size; mword obj_size = sgen_mono_array_size (vt, arr, &bounds_size, sgen_vtable_get_descriptor (vt)); /* We don't want to scan the bounds entries at the end of multidimensional arrays */ @@ -1675,13 +1675,14 @@ LOOP_HEAD: HEAVY_STAT (++los_array_cards); for (; elem < card_end; elem += SIZEOF_VOID_P) { - gpointer new, old = *(gpointer*)elem; + GCObject *new_; + gpointer old = *(gpointer*)elem; if ((mod_union && old) || G_UNLIKELY (sgen_ptr_in_nursery (old))) { HEAVY_STAT (++los_array_remsets); copy_func ((GCObject**)elem, ctx.queue); - new = *(gpointer*)elem; - if (G_UNLIKELY (sgen_ptr_in_nursery (new))) - sgen_add_to_global_remset (elem, new); + new_ = *(GCObject **)elem; + if (G_UNLIKELY (sgen_ptr_in_nursery (new_))) + sgen_add_to_global_remset (elem, new_); } } } @@ -1951,7 +1952,7 @@ precisely_report_roots_from (GCRootReport *report, void** start_root, void** end } return; case ROOT_DESC_COMPLEX: { - gsize *bitmap_data = sgen_get_complex_descriptor_bitmap (desc); + gsize *bitmap_data = (gsize *)sgen_get_complex_descriptor_bitmap (desc); gsize bwords = (*bitmap_data) - 1; void **start_run = start_root; bitmap_data++; @@ -1989,7 +1990,7 @@ report_registered_roots_by_type (int root_type) void **start_root; RootRecord *root; report.count = 0; - SGEN_HASH_TABLE_FOREACH (&roots_hash [root_type], start_root, root) { + SGEN_HASH_TABLE_FOREACH (&roots_hash [root_type], void **, start_root, RootRecord *, root) { SGEN_LOG (6, "Precise root scan %p-%p (desc: %p)", start_root, root->end_root, (void*)root->root_desc); precisely_report_roots_from (&report, start_root, (void**)root->end_root, root->root_desc); } SGEN_HASH_TABLE_FOREACH_END; @@ -2112,7 +2113,7 @@ collect_references (HeapWalkInfo *hwi, GCObject *obj, size_t size) static void walk_references (GCObject *start, size_t size, void *data) { - HeapWalkInfo *hwi = data; + HeapWalkInfo *hwi = (HeapWalkInfo *)data; hwi->called = 0; hwi->count = 0; collect_references (hwi, start, size); @@ -2320,13 +2321,13 @@ static void *scan_area_arg_start, *scan_area_arg_end; void mono_gc_conservatively_scan_area (void *start, void *end) { - sgen_conservatively_pin_objects_from (start, end, scan_area_arg_start, scan_area_arg_end, PIN_TYPE_STACK); + sgen_conservatively_pin_objects_from ((void **)start, (void **)end, scan_area_arg_start, scan_area_arg_end, PIN_TYPE_STACK); } void* mono_gc_scan_object (void *obj, void *gc_data) { - ScanCopyContext *ctx = gc_data; + ScanCopyContext *ctx = (ScanCopyContext *)gc_data; ctx->ops->copy_or_mark_object ((GCObject**)&obj, ctx->queue); return obj; } @@ -2365,13 +2366,13 @@ sgen_client_scan_thread_data (void *start_nursery, void *end_nursery, gboolean p g_assert (info->client_info.suspend_done); SGEN_LOG (3, "Scanning thread %p, range: %p-%p, size: %zd, pinned=%zd", info, info->client_info.stack_start, info->client_info.stack_end, (char*)info->client_info.stack_end - (char*)info->client_info.stack_start, sgen_get_pinned_count ()); if (mono_gc_get_gc_callbacks ()->thread_mark_func && !conservative_stack_mark) { - mono_gc_get_gc_callbacks ()->thread_mark_func (info->client_info.runtime_data, aligned_stack_start, info->client_info.stack_end, precise, &ctx); + mono_gc_get_gc_callbacks ()->thread_mark_func (info->client_info.runtime_data, (guint8 *)aligned_stack_start, (guint8 *)info->client_info.stack_end, precise, &ctx); } else if (!precise) { if (!conservative_stack_mark) { fprintf (stderr, "Precise stack mark not supported - disabling.\n"); conservative_stack_mark = TRUE; } - sgen_conservatively_pin_objects_from (aligned_stack_start, info->client_info.stack_end, start_nursery, end_nursery, PIN_TYPE_STACK); + sgen_conservatively_pin_objects_from ((void **)aligned_stack_start, (void **)info->client_info.stack_end, start_nursery, end_nursery, PIN_TYPE_STACK); } if (!precise) { @@ -2387,7 +2388,7 @@ sgen_client_scan_thread_data (void *start_nursery, void *end_nursery, gboolean p // We force a spill of all registers into the stack and pass a chunk of data into sgen. MonoThreadUnwindState *state = &info->client_info.info.thread_saved_state [SELF_SUSPEND_STATE_INDEX]; if (state && state->gc_stackdata) { - sgen_conservatively_pin_objects_from (state->gc_stackdata, (void**)((char*)state->gc_stackdata + state->gc_stackdata_size), + sgen_conservatively_pin_objects_from ((void **)state->gc_stackdata, (void**)((char*)state->gc_stackdata + state->gc_stackdata_size), start_nursery, end_nursery, PIN_TYPE_STACK); } } @@ -2604,7 +2605,7 @@ sgen_client_metadata_for_object (GCObject *obj) gboolean mono_gchandle_is_in_domain (guint32 gchandle, MonoDomain *domain) { - MonoDomain *gchandle_domain = sgen_gchandle_get_metadata (gchandle); + MonoDomain *gchandle_domain = (MonoDomain *)sgen_gchandle_get_metadata (gchandle); return domain->domain_id == gchandle_domain->domain_id; } @@ -2623,14 +2624,14 @@ mono_gchandle_free_domain (MonoDomain *unloading) static gpointer null_link_if_in_domain (gpointer hidden, GCHandleType handle_type, int max_generation, gpointer user) { - MonoDomain *unloading_domain = user; + MonoDomain *unloading_domain = (MonoDomain *)user; MonoDomain *obj_domain; gboolean is_weak = MONO_GC_HANDLE_TYPE_IS_WEAK (handle_type); if (MONO_GC_HANDLE_IS_OBJECT_POINTER (hidden)) { - MonoObject *obj = MONO_GC_REVEAL_POINTER (hidden, is_weak); + MonoObject *obj = (MonoObject *)MONO_GC_REVEAL_POINTER (hidden, is_weak); obj_domain = mono_object_domain (obj); } else { - obj_domain = MONO_GC_REVEAL_POINTER (hidden, is_weak); + obj_domain = (MonoDomain *)MONO_GC_REVEAL_POINTER (hidden, is_weak); } if (unloading_domain->domain_id == obj_domain->domain_id) return NULL; @@ -2642,7 +2643,7 @@ sgen_null_links_for_domain (MonoDomain *domain) { guint type; for (type = HANDLE_TYPE_MIN; type < HANDLE_TYPE_MAX; ++type) - sgen_gchandle_iterate (type, GENERATION_OLD, null_link_if_in_domain, domain); + sgen_gchandle_iterate ((GCHandleType)type, GENERATION_OLD, null_link_if_in_domain, domain); } void @@ -2687,12 +2688,6 @@ sgen_client_ensure_weak_gchandles_accessible (void) mono_gc_wait_for_bridge_processing (); } -gboolean -mono_gc_set_allow_synchronous_major (gboolean flag) -{ - return sgen_set_allow_synchronous_major (flag); -} - void* mono_gc_invoke_with_gc_lock (MonoGCLockedCallbackFunc func, void *data) { @@ -2840,7 +2835,7 @@ sgen_client_init (void) cb.thread_detach = sgen_thread_detach; cb.thread_unregister = sgen_thread_unregister; cb.thread_attach = sgen_thread_attach; - cb.mono_method_is_critical = (gpointer)is_critical_method; + cb.mono_method_is_critical = (gboolean (*)(void *))is_critical_method; cb.mono_thread_in_critical_region = thread_in_critical_region; mono_threads_init (&cb, sizeof (SgenThreadInfo)); diff --git a/mono/metadata/sgen-new-bridge.c b/mono/metadata/sgen-new-bridge.c index 65981ccc665..20fdb460add 100644 --- a/mono/metadata/sgen-new-bridge.c +++ b/mono/metadata/sgen-new-bridge.c @@ -199,7 +199,7 @@ dyn_array_ensure_capacity (DynArray *da, int capacity, int elem_size) while (capacity > da->capacity) da->capacity *= 2; - new_data = sgen_alloc_internal_dynamic (elem_size * da->capacity, INTERNAL_MEM_BRIDGE_DATA, TRUE); + new_data = (char *)sgen_alloc_internal_dynamic (elem_size * da->capacity, INTERNAL_MEM_BRIDGE_DATA, TRUE); memcpy (new_data, da->data, elem_size * da->size); if (old_capacity > 0) sgen_free_internal_dynamic (da->data, elem_size * old_capacity, INTERNAL_MEM_BRIDGE_DATA); @@ -276,7 +276,7 @@ dyn_array_int_empty (DynIntArray *da) static void dyn_array_int_add (DynIntArray *da, int x) { - int *p = dyn_array_add (&da->array, sizeof (int)); + int *p = (int *)dyn_array_add (&da->array, sizeof (int)); *p = x; } @@ -374,13 +374,13 @@ dyn_array_ptr_add (DynPtrArray *da, void *ptr) void *ptr0 = da->array.data; void **p0; dyn_array_init (&da->array); - p0 = dyn_array_add (&da->array, sizeof (void*)); + p0 = (void **)dyn_array_add (&da->array, sizeof (void*)); *p0 = ptr0; - p = dyn_array_add (&da->array, sizeof (void*)); + p = (void **)dyn_array_add (&da->array, sizeof (void*)); } else #endif { - p = dyn_array_add (&da->array, sizeof (void*)); + p = (void **)dyn_array_add (&da->array, sizeof (void*)); } *p = ptr; } @@ -431,7 +431,7 @@ dyn_array_scc_size (DynSCCArray *da) static SCC* dyn_array_scc_add (DynSCCArray *da) { - return dyn_array_add (&da->array, sizeof (SCC)); + return (SCC *)dyn_array_add (&da->array, sizeof (SCC)); } static SCC* @@ -497,7 +497,7 @@ class_kind (MonoClass *klass) static HashEntry* get_hash_entry (MonoObject *obj, gboolean *existing) { - HashEntry *entry = sgen_hash_table_lookup (&hash_table, obj); + HashEntry *entry = (HashEntry *)sgen_hash_table_lookup (&hash_table, obj); HashEntry new_entry; if (entry) { @@ -515,7 +515,7 @@ get_hash_entry (MonoObject *obj, gboolean *existing) sgen_hash_table_replace (&hash_table, obj, &new_entry, NULL); - return sgen_hash_table_lookup (&hash_table, obj); + return (HashEntry *)sgen_hash_table_lookup (&hash_table, obj); } static void @@ -532,7 +532,7 @@ free_data (void) int total_srcs = 0; int max_srcs = 0; - SGEN_HASH_TABLE_FOREACH (&hash_table, obj, entry) { + SGEN_HASH_TABLE_FOREACH (&hash_table, MonoObject *, obj, HashEntry *, entry) { int entry_size = dyn_array_ptr_size (&entry->srcs); total_srcs += entry_size; if (entry_size > max_srcs) @@ -647,10 +647,10 @@ dfs1 (HashEntry *obj_entry) char *start; ++dfs1_passes; - obj_entry = dyn_array_ptr_pop (&dfs_stack); + obj_entry = (HashEntry *)dyn_array_ptr_pop (&dfs_stack); if (obj_entry) { /* obj_entry needs to be expanded */ - src = dyn_array_ptr_pop (&dfs_stack); + src = (HashEntry *)dyn_array_ptr_pop (&dfs_stack); if (src) g_assert (!src->v.dfs1.forwarded_to); @@ -686,8 +686,8 @@ dfs1 (HashEntry *obj_entry) */ #ifdef OPTIMIZATION_FORWARD if (!obj_entry->is_bridge && num_links == 1) { - HashEntry *dst_entry = dyn_array_ptr_pop (&dfs_stack); - HashEntry *obj_entry_again = dyn_array_ptr_pop (&dfs_stack); + HashEntry *dst_entry = (HashEntry *)dyn_array_ptr_pop (&dfs_stack); + HashEntry *obj_entry_again = (HashEntry *)dyn_array_ptr_pop (&dfs_stack); g_assert (obj_entry_again == obj_entry); g_assert (!dst_entry->v.dfs1.forwarded_to); if (obj_entry != dst_entry) { @@ -709,7 +709,7 @@ dfs1 (HashEntry *obj_entry) } else { /* obj_entry needs to be finished */ - obj_entry = dyn_array_ptr_pop (&dfs_stack); + obj_entry = (HashEntry *)dyn_array_ptr_pop (&dfs_stack); //g_print ("finish %s\n", sgen_safe_name (obj_entry->obj)); register_finishing_time (obj_entry, ++current_time); @@ -838,7 +838,7 @@ dfs2 (HashEntry *entry) dyn_array_ptr_push (&dfs_stack, entry); do { - entry = dyn_array_ptr_pop (&dfs_stack); + entry = (HashEntry *)dyn_array_ptr_pop (&dfs_stack); ++dfs2_passes; if (entry->v.dfs2.scc_index >= 0) { @@ -910,7 +910,7 @@ dump_graph (void) MonoObject *obj; HashEntry *entry; size_t prefix_len = strlen (dump_prefix); - char *filename = alloca(prefix_len + 64); + char *filename = (char *)alloca (prefix_len + 64); FILE *file; int edge_id = 0; @@ -931,7 +931,7 @@ dump_graph (void) "\n"); fprintf (file, "\n"); - SGEN_HASH_TABLE_FOREACH (&hash_table, obj, entry) { + SGEN_HASH_TABLE_FOREACH (&hash_table, MonoObject *, obj, HashEntry *, entry) { MonoVTable *vt = SGEN_LOAD_VTABLE (obj); fprintf (file, "\n", obj, vt->klass->name_space, vt->klass->name, entry->is_bridge ? "true" : "false"); @@ -939,10 +939,10 @@ dump_graph (void) fprintf (file, "\n"); fprintf (file, "\n"); - SGEN_HASH_TABLE_FOREACH (&hash_table, obj, entry) { + SGEN_HASH_TABLE_FOREACH (&hash_table, MonoObject *, obj, HashEntry *, entry) { int i; for (i = 0; i < dyn_array_ptr_size (&entry->srcs); ++i) { - HashEntry *src = dyn_array_ptr_get (&entry->srcs, i); + HashEntry *src = (HashEntry *)dyn_array_ptr_get (&entry->srcs, i); fprintf (file, "\n", edge_id++, sgen_hash_table_key_for_value_pointer (src), obj); } } SGEN_HASH_TABLE_FOREACH_END; @@ -1017,13 +1017,13 @@ processing_stw_step (void) */ bridge_count = dyn_array_ptr_size (®istered_bridges); for (i = 0; i < bridge_count ; ++i) - register_bridge_object (dyn_array_ptr_get (®istered_bridges, i)); + register_bridge_object ((MonoObject *)dyn_array_ptr_get (®istered_bridges, i)); for (i = 0; i < bridge_count; ++i) - dfs1 (get_hash_entry (dyn_array_ptr_get (®istered_bridges, i), NULL)); + dfs1 (get_hash_entry ((MonoObject *)dyn_array_ptr_get (®istered_bridges, i), NULL)); /* Remove all forwarded objects. */ - SGEN_HASH_TABLE_FOREACH (&hash_table, obj, entry) { + SGEN_HASH_TABLE_FOREACH (&hash_table, MonoObject *, obj, HashEntry *, entry) { if (entry->v.dfs1.forwarded_to) { g_assert (dyn_array_ptr_size (&entry->srcs) == 0); SGEN_HASH_TABLE_FOREACH_REMOVE (TRUE); @@ -1066,10 +1066,10 @@ processing_build_callback_data (int generation) /* alloc and fill array of all entries */ - all_entries = sgen_alloc_internal_dynamic (sizeof (HashEntry*) * hash_table.num_entries, INTERNAL_MEM_BRIDGE_DATA, TRUE); + all_entries = (HashEntry **)sgen_alloc_internal_dynamic (sizeof (HashEntry*) * hash_table.num_entries, INTERNAL_MEM_BRIDGE_DATA, TRUE); j = 0; - SGEN_HASH_TABLE_FOREACH (&hash_table, obj, entry) { + SGEN_HASH_TABLE_FOREACH (&hash_table, MonoObject *, obj, HashEntry *, entry) { g_assert (entry->v.dfs1.finishing_time > 0); all_entries [j++] = entry; fist_pass_links += dyn_array_ptr_size (&entry->srcs); @@ -1080,7 +1080,7 @@ processing_build_callback_data (int generation) /* sort array according to decreasing finishing time */ qsort_hash_entries (all_entries, hash_table.num_entries); - SGEN_HASH_TABLE_FOREACH (&hash_table, obj, entry) { + SGEN_HASH_TABLE_FOREACH (&hash_table, MonoObject *, obj, HashEntry *, entry) { entry->v.dfs2.scc_index = -1; } SGEN_HASH_TABLE_FOREACH_END; @@ -1231,7 +1231,7 @@ processing_build_callback_data (int generation) max_sccs_links = MAX (max_sccs_links, dyn_array_int_size (&scc->XREFS)); } - api_sccs = sgen_alloc_internal_dynamic (sizeof (MonoGCBridgeSCC*) * num_sccs, INTERNAL_MEM_BRIDGE_DATA, TRUE); + api_sccs = (MonoGCBridgeSCC **)sgen_alloc_internal_dynamic (sizeof (MonoGCBridgeSCC*) * num_sccs, INTERNAL_MEM_BRIDGE_DATA, TRUE); num_xrefs = 0; j = 0; for (i = 0; i < dyn_array_scc_size (&sccs); ++i) { @@ -1239,7 +1239,7 @@ processing_build_callback_data (int generation) if (!scc->num_bridge_entries) continue; - api_sccs [j] = sgen_alloc_internal_dynamic (sizeof (MonoGCBridgeSCC) + sizeof (MonoObject*) * scc->num_bridge_entries, INTERNAL_MEM_BRIDGE_DATA, TRUE); + api_sccs [j] = (MonoGCBridgeSCC *)sgen_alloc_internal_dynamic (sizeof (MonoGCBridgeSCC) + sizeof (MonoObject*) * scc->num_bridge_entries, INTERNAL_MEM_BRIDGE_DATA, TRUE); api_sccs [j]->is_alive = FALSE; api_sccs [j]->num_objs = scc->num_bridge_entries; scc->num_bridge_entries = 0; @@ -1248,14 +1248,14 @@ processing_build_callback_data (int generation) num_xrefs += dyn_array_int_size (&scc->XREFS); } - SGEN_HASH_TABLE_FOREACH (&hash_table, obj, entry) { + SGEN_HASH_TABLE_FOREACH (&hash_table, MonoObject *, obj, HashEntry *, entry) { if (entry->is_bridge) { SCC *scc = dyn_array_scc_get_ptr (&sccs, entry->v.dfs2.scc_index); api_sccs [scc->api_index]->objs [scc->num_bridge_entries++] = sgen_hash_table_key_for_value_pointer (entry); } } SGEN_HASH_TABLE_FOREACH_END; - api_xrefs = sgen_alloc_internal_dynamic (sizeof (MonoGCBridgeXRef) * num_xrefs, INTERNAL_MEM_BRIDGE_DATA, TRUE); + api_xrefs = (MonoGCBridgeXRef *)sgen_alloc_internal_dynamic (sizeof (MonoGCBridgeXRef) * num_xrefs, INTERNAL_MEM_BRIDGE_DATA, TRUE); j = 0; for (i = 0; i < dyn_array_scc_size (&sccs); ++i) { int k; @@ -1364,7 +1364,7 @@ describe_pointer (GCObject *obj) } } - entry = sgen_hash_table_lookup (&hash_table, obj); + entry = (HashEntry *)sgen_hash_table_lookup (&hash_table, obj); if (!entry) return; diff --git a/mono/metadata/sgen-old-bridge.c b/mono/metadata/sgen-old-bridge.c index 63b39f4946a..83f991d5b86 100644 --- a/mono/metadata/sgen-old-bridge.c +++ b/mono/metadata/sgen-old-bridge.c @@ -147,7 +147,7 @@ dyn_array_ensure_capacity (DynArray *da, int capacity, int elem_size) while (capacity > da->capacity) da->capacity *= 2; - new_data = sgen_alloc_internal_dynamic (elem_size * da->capacity, INTERNAL_MEM_BRIDGE_DATA, TRUE); + new_data = (char *)sgen_alloc_internal_dynamic (elem_size * da->capacity, INTERNAL_MEM_BRIDGE_DATA, TRUE); memcpy (new_data, da->data, elem_size * da->size); sgen_free_internal_dynamic (da->data, elem_size * old_capacity, INTERNAL_MEM_BRIDGE_DATA); da->data = new_data; @@ -193,7 +193,7 @@ dyn_array_int_set_size (DynIntArray *da, int size) static void dyn_array_int_add (DynIntArray *da, int x) { - int *p = dyn_array_add (&da->array, sizeof (int)); + int *p = (int *)dyn_array_add (&da->array, sizeof (int)); *p = x; } @@ -258,7 +258,7 @@ dyn_array_ptr_get (DynPtrArray *da, int x) static void dyn_array_ptr_add (DynPtrArray *da, void *ptr) { - void **p = dyn_array_add (&da->array, sizeof (void*)); + void **p = (void **)dyn_array_add (&da->array, sizeof (void*)); *p = ptr; } @@ -298,7 +298,7 @@ dyn_array_scc_size (DynSCCArray *da) static SCC* dyn_array_scc_add (DynSCCArray *da) { - return dyn_array_add (&da->array, sizeof (SCC)); + return (SCC *)dyn_array_add (&da->array, sizeof (SCC)); } static SCC* @@ -408,7 +408,7 @@ class_kind (MonoClass *klass) static HashEntry* get_hash_entry (GCObject *obj, gboolean *existing) { - HashEntry *entry = sgen_hash_table_lookup (&hash_table, obj); + HashEntry *entry = (HashEntry *)sgen_hash_table_lookup (&hash_table, obj); HashEntry new_entry; if (entry) { @@ -428,7 +428,7 @@ get_hash_entry (GCObject *obj, gboolean *existing) sgen_hash_table_replace (&hash_table, obj, &new_entry, NULL); - return sgen_hash_table_lookup (&hash_table, obj); + return (HashEntry *)sgen_hash_table_lookup (&hash_table, obj); } static void @@ -445,7 +445,7 @@ free_data (void) int total_srcs = 0; int max_srcs = 0; - SGEN_HASH_TABLE_FOREACH (&hash_table, obj, entry) { + SGEN_HASH_TABLE_FOREACH (&hash_table, GCObject *, obj, HashEntry *, entry) { int entry_size = dyn_array_ptr_size (&entry->srcs); total_srcs += entry_size; if (entry_size > max_srcs) @@ -516,11 +516,11 @@ dfs1 (HashEntry *obj_entry) GCObject *obj; ++dfs1_passes; - obj_entry = dyn_array_ptr_pop (&dfs_stack); + obj_entry = (HashEntry *)dyn_array_ptr_pop (&dfs_stack); if (obj_entry) { char *start; mword desc; - src = dyn_array_ptr_pop (&dfs_stack); + src = (HashEntry *)dyn_array_ptr_pop (&dfs_stack); obj = obj_entry->obj; desc = sgen_obj_get_descriptor_safe (obj); @@ -544,7 +544,7 @@ dfs1 (HashEntry *obj_entry) start = (char*)obj; #include "sgen/sgen-scan-object.h" } else { - obj_entry = dyn_array_ptr_pop (&dfs_stack); + obj_entry = (HashEntry *)dyn_array_ptr_pop (&dfs_stack); //g_print ("finish %s\n", sgen_safe_name (obj_entry->obj)); register_finishing_time (obj_entry, current_time++); @@ -592,7 +592,7 @@ dfs2 (HashEntry *entry) dyn_array_ptr_push (&dfs_stack, entry); do { - entry = dyn_array_ptr_pop (&dfs_stack); + entry = (HashEntry *)dyn_array_ptr_pop (&dfs_stack); ++dfs2_passes; if (entry->scc_index >= 0) { @@ -663,10 +663,10 @@ processing_stw_step (void) */ bridge_count = dyn_array_ptr_size (®istered_bridges); for (i = 0; i < bridge_count ; ++i) - register_bridge_object (dyn_array_ptr_get (®istered_bridges, i)); + register_bridge_object ((GCObject *)dyn_array_ptr_get (®istered_bridges, i)); for (i = 0; i < bridge_count; ++i) - dfs1 (get_hash_entry (dyn_array_ptr_get (®istered_bridges, i), NULL)); + dfs1 (get_hash_entry ((GCObject *)dyn_array_ptr_get (®istered_bridges, i), NULL)); SGEN_TV_GETTIME (atv); step_2 = SGEN_TV_ELAPSED (btv, atv); @@ -700,10 +700,10 @@ processing_build_callback_data (int generation) /* alloc and fill array of all entries */ - all_entries = sgen_alloc_internal_dynamic (sizeof (HashEntry*) * hash_table.num_entries, INTERNAL_MEM_BRIDGE_DATA, TRUE); + all_entries = (HashEntry **)sgen_alloc_internal_dynamic (sizeof (HashEntry*) * hash_table.num_entries, INTERNAL_MEM_BRIDGE_DATA, TRUE); j = 0; - SGEN_HASH_TABLE_FOREACH (&hash_table, obj, entry) { + SGEN_HASH_TABLE_FOREACH (&hash_table, GCObject *, obj, HashEntry *, entry) { g_assert (entry->finishing_time >= 0); all_entries [j++] = entry; fist_pass_links += dyn_array_ptr_size (&entry->srcs); @@ -795,7 +795,7 @@ processing_build_callback_data (int generation) max_sccs_links = MAX (max_sccs_links, dyn_array_int_size (&scc->xrefs)); } - api_sccs = sgen_alloc_internal_dynamic (sizeof (MonoGCBridgeSCC*) * num_sccs, INTERNAL_MEM_BRIDGE_DATA, TRUE); + api_sccs = (MonoGCBridgeSCC **)sgen_alloc_internal_dynamic (sizeof (MonoGCBridgeSCC*) * num_sccs, INTERNAL_MEM_BRIDGE_DATA, TRUE); num_xrefs = 0; j = 0; for (i = 0; i < dyn_array_scc_size (&sccs); ++i) { @@ -803,7 +803,7 @@ processing_build_callback_data (int generation) if (!scc->num_bridge_entries) continue; - api_sccs [j] = sgen_alloc_internal_dynamic (sizeof (MonoGCBridgeSCC) + sizeof (MonoObject*) * scc->num_bridge_entries, INTERNAL_MEM_BRIDGE_DATA, TRUE); + api_sccs [j] = (MonoGCBridgeSCC *)sgen_alloc_internal_dynamic (sizeof (MonoGCBridgeSCC) + sizeof (MonoObject*) * scc->num_bridge_entries, INTERNAL_MEM_BRIDGE_DATA, TRUE); api_sccs [j]->is_alive = FALSE; api_sccs [j]->num_objs = scc->num_bridge_entries; scc->num_bridge_entries = 0; @@ -812,14 +812,14 @@ processing_build_callback_data (int generation) num_xrefs += dyn_array_int_size (&scc->xrefs); } - SGEN_HASH_TABLE_FOREACH (&hash_table, obj, entry) { + SGEN_HASH_TABLE_FOREACH (&hash_table, GCObject *, obj, HashEntry *, entry) { if (entry->is_bridge) { SCC *scc = dyn_array_scc_get_ptr (&sccs, entry->scc_index); api_sccs [scc->api_index]->objs [scc->num_bridge_entries++] = (MonoObject*)entry->obj; } } SGEN_HASH_TABLE_FOREACH_END; - api_xrefs = sgen_alloc_internal_dynamic (sizeof (MonoGCBridgeXRef) * num_xrefs, INTERNAL_MEM_BRIDGE_DATA, TRUE); + api_xrefs = (MonoGCBridgeXRef *)sgen_alloc_internal_dynamic (sizeof (MonoGCBridgeXRef) * num_xrefs, INTERNAL_MEM_BRIDGE_DATA, TRUE); j = 0; for (i = 0; i < dyn_array_scc_size (&sccs); ++i) { int k; @@ -923,7 +923,7 @@ describe_pointer (GCObject *obj) } } - entry = sgen_hash_table_lookup (&hash_table, obj); + entry = (HashEntry *)sgen_hash_table_lookup (&hash_table, obj); if (!entry) return; diff --git a/mono/metadata/sgen-os-posix.c b/mono/metadata/sgen-os-posix.c index dbf2eddb1c7..2a8b7ad10f4 100644 --- a/mono/metadata/sgen-os-posix.c +++ b/mono/metadata/sgen-os-posix.c @@ -246,7 +246,7 @@ sgen_os_init (void) g_error ("failed sigaction"); } - sinfo.sa_handler = (void*) restart_handler; + sinfo.sa_handler = (void (*)(int))restart_handler; if (sigaction (restart_signal_num, &sinfo, NULL) != 0) { g_error ("failed sigaction"); } diff --git a/mono/metadata/sgen-stw.c b/mono/metadata/sgen-stw.c index 1d23bc63732..651dbb59de1 100644 --- a/mono/metadata/sgen-stw.c +++ b/mono/metadata/sgen-stw.c @@ -103,7 +103,7 @@ is_ip_in_managed_allocator (MonoDomain *domain, gpointer ip) * missing methods (#13951). To work around this, we disable the AOT fallback. For this to work, the JIT needs * to register the jit info for all GC critical methods after they are JITted/loaded. */ - ji = mono_jit_info_table_find_internal (domain, ip, FALSE, FALSE); + ji = mono_jit_info_table_find_internal (domain, (char *)ip, FALSE, FALSE); if (!ji) return FALSE; @@ -367,7 +367,7 @@ update_sgen_info (SgenThreadInfo *info) char *stack_start; /* Once we remove the old suspend code, we should move sgen to directly access the state in MonoThread */ - info->client_info.stopped_domain = mono_thread_info_tls_get (info, TLS_KEY_DOMAIN); + info->client_info.stopped_domain = (MonoDomain *)mono_thread_info_tls_get (info, TLS_KEY_DOMAIN); info->client_info.stopped_ip = (gpointer) MONO_CONTEXT_GET_IP (&mono_thread_info_get_suspend_state (info)->ctx); stack_start = (char*)MONO_CONTEXT_GET_SP (&mono_thread_info_get_suspend_state (info)->ctx) - REDZONE_SIZE; diff --git a/mono/metadata/sgen-tarjan-bridge.c b/mono/metadata/sgen-tarjan-bridge.c index 10cf234c426..e6bd1f17aa7 100644 --- a/mono/metadata/sgen-tarjan-bridge.c +++ b/mono/metadata/sgen-tarjan-bridge.c @@ -88,7 +88,7 @@ dyn_array_ensure_capacity (DynArray *da, int capacity, int elem_size) while (capacity > da->capacity) da->capacity *= 2; - new_data = sgen_alloc_internal_dynamic (elem_size * da->capacity, INTERNAL_MEM_BRIDGE_DATA, TRUE); + new_data = (char *)sgen_alloc_internal_dynamic (elem_size * da->capacity, INTERNAL_MEM_BRIDGE_DATA, TRUE); if (da->data) { memcpy (new_data, da->data, elem_size * da->size); sgen_free_internal_dynamic (da->data, elem_size * old_capacity, INTERNAL_MEM_BRIDGE_DATA); @@ -137,7 +137,7 @@ dyn_array_ptr_get (DynPtrArray *da, int x) static void dyn_array_ptr_add (DynPtrArray *da, void *ptr) { - void **p = dyn_array_add (&da->array, sizeof (void*)); + void **p = (void **)dyn_array_add (&da->array, sizeof (void*)); *p = ptr; } @@ -276,7 +276,7 @@ static int object_data_count; static ObjectBucket* new_object_bucket (void) { - ObjectBucket *res = sgen_alloc_internal (INTERNAL_MEM_TARJAN_OBJ_BUCKET); + ObjectBucket *res = (ObjectBucket *)sgen_alloc_internal (INTERNAL_MEM_TARJAN_OBJ_BUCKET); res->next_data = &res->data [0]; return res; } @@ -340,7 +340,7 @@ static int color_data_count; static ColorBucket* new_color_bucket (void) { - ColorBucket *res = sgen_alloc_internal (INTERNAL_MEM_TARJAN_OBJ_BUCKET); + ColorBucket *res = (ColorBucket *)sgen_alloc_internal (INTERNAL_MEM_TARJAN_OBJ_BUCKET); res->next_data = &res->data [0]; return res; } @@ -724,7 +724,7 @@ reduce_color (void) if (size == 0) color = NULL; else if (size == 1) { - color = dyn_array_ptr_get (&color_merge_array, 0); + color = (ColorData *)dyn_array_ptr_get (&color_merge_array, 0); } else color = new_color (FALSE); @@ -740,7 +740,7 @@ create_scc (ScanData *data) ColorData *color_data = NULL; for (i = dyn_array_ptr_size (&loop_stack) - 1; i >= 0; --i) { - ScanData *other = dyn_array_ptr_get (&loop_stack, i); + ScanData *other = (ScanData *)dyn_array_ptr_get (&loop_stack, i); found_bridge |= other->is_bridge; if (found_bridge || other == data) break; @@ -769,7 +769,7 @@ create_scc (ScanData *data) } while (dyn_array_ptr_size (&loop_stack) > 0) { - ScanData *other = dyn_array_ptr_pop (&loop_stack); + ScanData *other = (ScanData *)dyn_array_ptr_pop (&loop_stack); #if DUMP_GRAPH printf ("\tmember %s (%p) index %d low-index %d color %p state %d\n", safe_name_bridge (other->obj), other->obj, other->index, other->low_index, other->color, other->state); @@ -797,7 +797,7 @@ create_scc (ScanData *data) g_assert (found); for (i = 0; i < dyn_array_ptr_size (&color_merge_array); ++i) { - ColorData *cd = dyn_array_ptr_get (&color_merge_array, i); + ColorData *cd = (ColorData *)dyn_array_ptr_get (&color_merge_array, i); g_assert (cd->visited); cd->visited = FALSE; } @@ -814,7 +814,7 @@ dfs (void) dyn_array_ptr_set_size (&color_merge_array, 0); while (dyn_array_ptr_size (&scan_stack) > 0) { - ScanData *data = dyn_array_ptr_pop (&scan_stack); + ScanData *data = (ScanData *)dyn_array_ptr_pop (&scan_stack); /** * Ignore finished objects on stack, they happen due to loops. For example: @@ -963,12 +963,12 @@ processing_stw_step (void) bridge_count = dyn_array_ptr_size (®istered_bridges); for (i = 0; i < bridge_count ; ++i) - register_bridge_object (dyn_array_ptr_get (®istered_bridges, i)); + register_bridge_object ((GCObject *)dyn_array_ptr_get (®istered_bridges, i)); setup_time = step_timer (&curtime); for (i = 0; i < bridge_count; ++i) { - ScanData *sd = find_data (dyn_array_ptr_get (®istered_bridges, i)); + ScanData *sd = find_data ((GCObject *)dyn_array_ptr_get (®istered_bridges, i)); if (sd->state == INITIAL) { dyn_array_ptr_push (&scan_stack, sd); dfs (); @@ -999,7 +999,7 @@ gather_xrefs (ColorData *color) { int i; for (i = 0; i < dyn_array_ptr_size (&color->other_colors); ++i) { - ColorData *src = dyn_array_ptr_get (&color->other_colors, i); + ColorData *src = (ColorData *)dyn_array_ptr_get (&color->other_colors, i); if (src->visited) continue; src->visited = TRUE; @@ -1015,7 +1015,7 @@ reset_xrefs (ColorData *color) { int i; for (i = 0; i < dyn_array_ptr_size (&color->other_colors); ++i) { - ColorData *src = dyn_array_ptr_get (&color->other_colors, i); + ColorData *src = (ColorData *)dyn_array_ptr_get (&color->other_colors, i); if (!src->visited) continue; src->visited = FALSE; @@ -1049,7 +1049,7 @@ processing_build_callback_data (int generation) #endif /* This is a straightforward translation from colors to the bridge callback format. */ - api_sccs = sgen_alloc_internal_dynamic (sizeof (MonoGCBridgeSCC*) * num_colors_with_bridges, INTERNAL_MEM_BRIDGE_DATA, TRUE); + api_sccs = (MonoGCBridgeSCC **)sgen_alloc_internal_dynamic (sizeof (MonoGCBridgeSCC*) * num_colors_with_bridges, INTERNAL_MEM_BRIDGE_DATA, TRUE); api_index = xref_count = 0; for (cur = root_color_bucket; cur; cur = cur->next) { @@ -1059,14 +1059,14 @@ processing_build_callback_data (int generation) if (!bridges) continue; - api_sccs [api_index] = sgen_alloc_internal_dynamic (sizeof (MonoGCBridgeSCC) + sizeof (MonoObject*) * bridges, INTERNAL_MEM_BRIDGE_DATA, TRUE); + api_sccs [api_index] = (MonoGCBridgeSCC *)sgen_alloc_internal_dynamic (sizeof (MonoGCBridgeSCC) + sizeof (MonoObject*) * bridges, INTERNAL_MEM_BRIDGE_DATA, TRUE); api_sccs [api_index]->is_alive = FALSE; api_sccs [api_index]->num_objs = bridges; cd->api_index = api_index; for (j = 0; j < bridges; ++j) - api_sccs [api_index]->objs [j] = dyn_array_ptr_get (&cd->bridges, j); + api_sccs [api_index]->objs [j] = (MonoObject *)dyn_array_ptr_get (&cd->bridges, j); api_index++; } } @@ -1095,7 +1095,7 @@ processing_build_callback_data (int generation) dump_color_table (" after xref pass", TRUE); #endif - api_xrefs = sgen_alloc_internal_dynamic (sizeof (MonoGCBridgeXRef) * xref_count, INTERNAL_MEM_BRIDGE_DATA, TRUE); + api_xrefs = (MonoGCBridgeXRef *)sgen_alloc_internal_dynamic (sizeof (MonoGCBridgeXRef) * xref_count, INTERNAL_MEM_BRIDGE_DATA, TRUE); api_index = 0; for (cur = root_color_bucket; cur; cur = cur->next) { ColorData *src; @@ -1105,7 +1105,7 @@ processing_build_callback_data (int generation) continue; for (j = 0; j < dyn_array_ptr_size (&src->other_colors); ++j) { - ColorData *dest = dyn_array_ptr_get (&src->other_colors, j); + ColorData *dest = (ColorData *)dyn_array_ptr_get (&src->other_colors, j); g_assert (dyn_array_ptr_size (&dest->bridges)); /* We flattened the color graph, so this must never happen. */ api_xrefs [api_index].src_scc_index = src->api_index; diff --git a/mono/metadata/sgen-toggleref.c b/mono/metadata/sgen-toggleref.c index 9622c7599dd..d9afbfa868d 100644 --- a/mono/metadata/sgen-toggleref.c +++ b/mono/metadata/sgen-toggleref.c @@ -142,7 +142,7 @@ ensure_toggleref_capacity (int capacity) { if (!toggleref_array) { toggleref_array_capacity = 32; - toggleref_array = sgen_alloc_internal_dynamic ( + toggleref_array = (MonoGCToggleRef *)sgen_alloc_internal_dynamic ( toggleref_array_capacity * sizeof (MonoGCToggleRef), INTERNAL_MEM_TOGGLEREF_DATA, TRUE); @@ -153,7 +153,7 @@ ensure_toggleref_capacity (int capacity) while (toggleref_array_capacity < toggleref_array_size + capacity) toggleref_array_capacity *= 2; - tmp = sgen_alloc_internal_dynamic ( + tmp = (MonoGCToggleRef *)sgen_alloc_internal_dynamic ( toggleref_array_capacity * sizeof (MonoGCToggleRef), INTERNAL_MEM_TOGGLEREF_DATA, TRUE); @@ -210,7 +210,7 @@ static MonoToggleRefStatus test_toggleref_callback (MonoObject *obj) { static MonoClassField *mono_toggleref_test_field; - int status = MONO_TOGGLE_REF_DROP; + MonoToggleRefStatus status = MONO_TOGGLE_REF_DROP; if (!mono_toggleref_test_field) { mono_toggleref_test_field = mono_class_get_field_from_name (mono_object_get_class (obj), "__test"); diff --git a/mono/metadata/socket-io.c b/mono/metadata/socket-io.c index 0b2efc361d2..55c766fbe09 100644 --- a/mono/metadata/socket-io.c +++ b/mono/metadata/socket-io.c @@ -648,19 +648,19 @@ ves_icall_System_Net_Sockets_Socket_Socket_internal (MonoObject *this_obj, gint3 *error = 0; - sock_family=convert_family(family); + sock_family = convert_family ((MonoAddressFamily)family); if(sock_family==-1) { *error = WSAEAFNOSUPPORT; return(NULL); } - sock_proto=convert_proto(proto); + sock_proto = convert_proto ((MonoProtocolType)proto); if(sock_proto==-1) { *error = WSAEPROTONOSUPPORT; return(NULL); } - sock_type=convert_type(type); + sock_type = convert_type ((MonoSocketType)type); if(sock_type==-1) { *error = WSAESOCKTNOSUPPORT; return(NULL); @@ -690,7 +690,10 @@ ves_icall_System_Net_Sockets_Socket_Close_internal (SOCKET sock, gint32 *error) /* Clear any pending work item from this socket if the underlying * polling system does not notify when the socket is closed */ mono_threadpool_ms_io_remove_socket (GPOINTER_TO_INT (sock)); + + MONO_PREPARE_BLOCKING; closesocket(sock); + MONO_FINISH_BLOCKING; } gint32 @@ -964,12 +967,12 @@ ves_icall_System_Net_Sockets_Socket_LocalEndPoint_internal (SOCKET sock, gint32 *error = 0; - salen = get_sockaddr_size (convert_family (af)); + salen = get_sockaddr_size (convert_family ((MonoAddressFamily)af)); if (salen == 0) { *error = WSAEAFNOSUPPORT; return NULL; } - sa = (salen <= 128) ? alloca (salen) : g_malloc0 (salen); + sa = (salen <= 128) ? (gchar *)alloca (salen) : (gchar *)g_malloc0 (salen); MONO_PREPARE_BLOCKING; @@ -1002,12 +1005,12 @@ ves_icall_System_Net_Sockets_Socket_RemoteEndPoint_internal (SOCKET sock, gint32 *error = 0; - salen = get_sockaddr_size (convert_family (af)); + salen = get_sockaddr_size (convert_family ((MonoAddressFamily)af)); if (salen == 0) { *error = WSAEAFNOSUPPORT; return NULL; } - sa = (salen <= 128) ? alloca (salen) : g_malloc0 (salen); + sa = (salen <= 128) ? (gchar *)alloca (salen) : (gchar *)g_malloc0 (salen); /* Note: linux returns just 2 for AF_UNIX. Always. */ MONO_PREPARE_BLOCKING; @@ -1057,7 +1060,7 @@ create_sockaddr_from_object(MonoObject *saddr_obj, socklen_t *sa_size, gint32 *e mono_raise_exception (mono_exception_from_name(mono_get_corlib (), "System", "SystemException")); } - family = convert_family (mono_array_get (data, guint8, 0) + (mono_array_get (data, guint8, 1) << 8)); + family = convert_family ((MonoAddressFamily)(mono_array_get (data, guint8, 0) + (mono_array_get (data, guint8, 1) << 8))); if (family == AF_INET) { struct sockaddr_in *sa; guint16 port; @@ -1230,7 +1233,7 @@ ves_icall_System_Net_Sockets_Socket_Poll_internal (SOCKET sock, gint mode, } if (ret == -1 && errno == EINTR) { - if (mono_thread_test_state (thread, ThreadState_AbortRequested | ThreadState_StopRequested)) { + if (mono_thread_test_state (thread, (MonoThreadState)(ThreadState_AbortRequested | ThreadState_StopRequested))) { g_free (pfds); return FALSE; } @@ -1332,8 +1335,8 @@ ves_icall_System_Net_Sockets_Socket_Disconnect_internal (SOCKET sock, MonoBoolea * pointers to functions in managed objects that still works * on 64bit platforms. */ - ret = WSAIoctl (sock, SIO_GET_EXTENSION_FUNCTION_POINTER, (void *)&disco_guid, sizeof(GUID), - (void *)&_wapi_disconnectex, sizeof(void *), &output_bytes, NULL, NULL); + ret = WSAIoctl (sock, SIO_GET_EXTENSION_FUNCTION_POINTER, (gchar *)&disco_guid, sizeof(GUID), + (gchar *)&_wapi_disconnectex, sizeof(void *), &output_bytes, NULL, NULL); MONO_FINISH_BLOCKING; @@ -1353,8 +1356,8 @@ ves_icall_System_Net_Sockets_Socket_Disconnect_internal (SOCKET sock, MonoBoolea * For an explanation of why this is done, you can read * the article at http://www.codeproject.com/internet/jbsocketserver3.asp */ - ret = WSAIoctl (sock, SIO_GET_EXTENSION_FUNCTION_POINTER, (void *)&trans_guid, sizeof(GUID), - (void *)&_wapi_transmitfile, sizeof(void *), &output_bytes, NULL, NULL); + ret = WSAIoctl (sock, SIO_GET_EXTENSION_FUNCTION_POINTER, (gchar *)&trans_guid, sizeof(GUID), + (gchar *)&_wapi_transmitfile, sizeof(void *), &output_bytes, NULL, NULL); MONO_FINISH_BLOCKING; @@ -1817,7 +1820,7 @@ ves_icall_System_Net_Sockets_Socket_Select_internal (MonoArray **sockets, gint32 } if (ret == -1 && errno == EINTR) { - if (mono_thread_test_state (thread, ThreadState_AbortRequested | ThreadState_StopRequested)) { + if (mono_thread_test_state (thread, (MonoThreadState)(ThreadState_AbortRequested | ThreadState_StopRequested))) { g_free (pfds); *sockets = NULL; return; @@ -1921,7 +1924,7 @@ ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal (SOCKET sock, g #endif { - ret = convert_sockopt_level_and_name (level, name, &system_level, &system_name); + ret = convert_sockopt_level_and_name ((MonoSocketOptionLevel)level, (MonoSocketOptionName)name, &system_level, &system_name); } if(ret==-1) { @@ -2051,7 +2054,7 @@ ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr_internal (SOCKET sock, g *error = 0; - ret=convert_sockopt_level_and_name(level, name, &system_level, + ret=convert_sockopt_level_and_name((MonoSocketOptionLevel)level, (MonoSocketOptionName)name, &system_level, &system_name); if(ret==-1) { *error = WSAENOPROTOOPT; @@ -2167,7 +2170,7 @@ ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal (SOCKET sock, gint3 sol_ipv6 = mono_networking_get_ipv6_protocol (); sol_ip = mono_networking_get_ip_protocol (); - ret=convert_sockopt_level_and_name(level, name, &system_level, + ret=convert_sockopt_level_and_name((MonoSocketOptionLevel)level, (MonoSocketOptionName)name, &system_level, &system_name); #if !defined(SO_EXCLUSIVEADDRUSE) && defined(SO_REUSEADDR) @@ -2218,7 +2221,7 @@ ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal (SOCKET sock, gint3 * Get group address */ field = mono_class_get_field_from_name (obj_val->vtable->klass, "group"); - address = *(gpointer *)(((char *)obj_val) + field->offset); + address = *(MonoObject **)(((char *)obj_val) + field->offset); if(address) { mreq6.ipv6mr_multiaddr = ipaddress_to_struct_in6_addr (address); @@ -2257,7 +2260,7 @@ ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal (SOCKET sock, gint3 * those :-( */ field = mono_class_get_field_from_name (obj_val->vtable->klass, "group"); - address = *(gpointer *)(((char *)obj_val) + field->offset); + address = *(MonoObject **)(((char *)obj_val) + field->offset); /* address might not be defined and if so, set the address to ADDR_ANY. */ @@ -2266,7 +2269,7 @@ ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal (SOCKET sock, gint3 } field = mono_class_get_field_from_name (obj_val->vtable->klass, "local"); - address = *(gpointer *)(((char *)obj_val) + field->offset); + address = *(MonoObject **)(((char *)obj_val) + field->offset); #ifdef HAVE_STRUCT_IP_MREQN if(address) { diff --git a/mono/metadata/threadpool-ms-io-poll.c b/mono/metadata/threadpool-ms-io-poll.c index f7ae6246f2f..4adae56791b 100644 --- a/mono/metadata/threadpool-ms-io-poll.c +++ b/mono/metadata/threadpool-ms-io-poll.c @@ -74,7 +74,7 @@ poll_register_fd (gint fd, gint events, gboolean is_new) poll_fds_capacity *= 2; g_assert (poll_fds_size <= poll_fds_capacity); - poll_fds = g_renew (mono_pollfd, poll_fds, poll_fds_capacity); + poll_fds = (mono_pollfd *)g_renew (mono_pollfd, poll_fds, poll_fds_capacity); } POLL_INIT_FD (&poll_fds [poll_fds_size - 1], fd, poll_event); diff --git a/mono/metadata/threadpool-ms-io.c b/mono/metadata/threadpool-ms-io.c index 6ac26ed033c..3c931eb7b3d 100644 --- a/mono/metadata/threadpool-ms-io.c +++ b/mono/metadata/threadpool-ms-io.c @@ -92,8 +92,8 @@ typedef struct { ThreadPoolIOUpdate updates [UPDATES_CAPACITY]; gint updates_size; - mono_mutex_t updates_lock; - mono_cond_t updates_cond; + MonoCoopMutex updates_lock; + MonoCoopCond updates_cond; #if !defined(HOST_WIN32) gint wakeup_pipes [2]; @@ -203,12 +203,12 @@ static void filter_jobs_for_domain (gpointer key, gpointer value, gpointer user_data) { FilterSockaresForDomainData *data; - MonoMList *list = value, *element; + MonoMList *list = (MonoMList *)value, *element; MonoDomain *domain; MonoGHashTable *states; g_assert (user_data); - data = user_data; + data = (FilterSockaresForDomainData *)user_data; domain = data->domain; states = data->states; @@ -259,7 +259,7 @@ wait_callback (gint fd, gint events, gpointer user_data) gint operations; g_assert (user_data); - states = user_data; + states = (MonoGHashTable *)user_data; mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_THREADPOOL, "io threadpool: cal fd %3d, events = %2s | %2s | %3s", fd, (events & EVENT_IN) ? "RD" : "..", (events & EVENT_OUT) ? "WR" : "..", (events & EVENT_ERR) ? "ERR" : "..."); @@ -316,7 +316,7 @@ selector_thread (gpointer data) gint i, j; gint res; - mono_mutex_lock (&threadpool_io->updates_lock); + mono_coop_mutex_lock (&threadpool_io->updates_lock); for (i = 0; i < threadpool_io->updates_size; ++i) { ThreadPoolIOUpdate *update = &threadpool_io->updates [i]; @@ -399,14 +399,14 @@ selector_thread (gpointer data) } } - mono_cond_broadcast (&threadpool_io->updates_cond); + mono_coop_cond_broadcast (&threadpool_io->updates_cond); if (threadpool_io->updates_size > 0) { threadpool_io->updates_size = 0; memset (&threadpool_io->updates, 0, UPDATES_CAPACITY * sizeof (ThreadPoolIOUpdate)); } - mono_mutex_unlock (&threadpool_io->updates_lock); + mono_coop_mutex_unlock (&threadpool_io->updates_lock); mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_THREADPOOL, "io threadpool: wai"); @@ -432,7 +432,7 @@ update_get_new (void) /* we wait for updates to be applied in the selector_thread and we loop * as long as none are available. if it happends too much, then we need * to increase UPDATES_CAPACITY */ - mono_cond_wait (&threadpool_io->updates_cond, &threadpool_io->updates_lock); + mono_coop_cond_wait (&threadpool_io->updates_cond, &threadpool_io->updates_lock); } g_assert (threadpool_io->updates_size < UPDATES_CAPACITY); @@ -506,9 +506,9 @@ initialize (void) threadpool_io = g_new0 (ThreadPoolIO, 1); g_assert (threadpool_io); - mono_mutex_init_recursive (&threadpool_io->updates_lock); - mono_cond_init (&threadpool_io->updates_cond, 0); - mono_gc_register_root ((void*)&threadpool_io->updates [0], sizeof (threadpool_io->updates), MONO_GC_DESCRIPTOR_NULL, MONO_ROOT_SOURCE_THREAD_POOL, "i/o thread pool updates list"); + mono_coop_mutex_init (&threadpool_io->updates_lock); + mono_coop_cond_init (&threadpool_io->updates_cond); + mono_gc_register_root ((char *)&threadpool_io->updates [0], sizeof (threadpool_io->updates), MONO_GC_DESCRIPTOR_NULL, MONO_ROOT_SOURCE_THREAD_POOL, "i/o thread pool updates list"); threadpool_io->updates_size = 0; @@ -541,8 +541,8 @@ cleanup (void) while (io_selector_running) g_usleep (1000); - mono_mutex_destroy (&threadpool_io->updates_lock); - mono_cond_destroy (&threadpool_io->updates_cond); + mono_coop_mutex_destroy (&threadpool_io->updates_lock); + mono_coop_cond_destroy (&threadpool_io->updates_cond); threadpool_io->backend.cleanup (); @@ -583,7 +583,7 @@ ves_icall_System_IOSelector_Add (gpointer handle, MonoIOSelectorJob *job) mono_lazy_initialize (&io_status, initialize); - mono_mutex_lock (&threadpool_io->updates_lock); + mono_coop_mutex_lock (&threadpool_io->updates_lock); update = update_get_new (); update->type = UPDATE_ADD; @@ -593,7 +593,7 @@ ves_icall_System_IOSelector_Add (gpointer handle, MonoIOSelectorJob *job) selector_thread_wakeup (); - mono_mutex_unlock (&threadpool_io->updates_lock); + mono_coop_mutex_unlock (&threadpool_io->updates_lock); } void @@ -610,7 +610,7 @@ mono_threadpool_ms_io_remove_socket (int fd) if (!mono_lazy_is_initialized (&io_status)) return; - mono_mutex_lock (&threadpool_io->updates_lock); + mono_coop_mutex_lock (&threadpool_io->updates_lock); update = update_get_new (); update->type = UPDATE_REMOVE_SOCKET; @@ -619,9 +619,9 @@ mono_threadpool_ms_io_remove_socket (int fd) selector_thread_wakeup (); - mono_cond_wait (&threadpool_io->updates_cond, &threadpool_io->updates_lock); + mono_coop_cond_wait (&threadpool_io->updates_cond, &threadpool_io->updates_lock); - mono_mutex_unlock (&threadpool_io->updates_lock); + mono_coop_mutex_unlock (&threadpool_io->updates_lock); } void @@ -632,7 +632,7 @@ mono_threadpool_ms_io_remove_domain_jobs (MonoDomain *domain) if (!mono_lazy_is_initialized (&io_status)) return; - mono_mutex_lock (&threadpool_io->updates_lock); + mono_coop_mutex_lock (&threadpool_io->updates_lock); update = update_get_new (); update->type = UPDATE_REMOVE_DOMAIN; @@ -641,9 +641,9 @@ mono_threadpool_ms_io_remove_domain_jobs (MonoDomain *domain) selector_thread_wakeup (); - mono_cond_wait (&threadpool_io->updates_cond, &threadpool_io->updates_lock); + mono_coop_cond_wait (&threadpool_io->updates_cond, &threadpool_io->updates_lock); - mono_mutex_unlock (&threadpool_io->updates_lock); + mono_coop_mutex_unlock (&threadpool_io->updates_lock); } #else diff --git a/mono/metadata/threadpool-ms.c b/mono/metadata/threadpool-ms.c index fd6fe24d461..17936001106 100644 --- a/mono/metadata/threadpool-ms.c +++ b/mono/metadata/threadpool-ms.c @@ -49,6 +49,8 @@ #define MONITOR_INTERVAL 100 // ms #define MONITOR_MINIMAL_LIFETIME 60 * 1000 // ms +#define WORKER_CREATION_MAX_PER_SEC 10 + /* The exponent to apply to the gain. 1.0 means to use linear gain, * higher values will enhance large moves and damp small ones. * default: 2.0 */ @@ -125,12 +127,16 @@ typedef struct { ThreadPoolCounter counters; GPtrArray *domains; // ThreadPoolDomain* [] - mono_mutex_t domains_lock; + MonoCoopMutex domains_lock; GPtrArray *working_threads; // ThreadPoolWorkingThread* [] gint32 parked_threads_count; - mono_cond_t parked_threads_cond; - mono_mutex_t active_threads_lock; /* protect access to working_threads and parked_threads */ + MonoCoopCond parked_threads_cond; + MonoCoopMutex active_threads_lock; /* protect access to working_threads and parked_threads */ + + guint32 worker_creation_current_second; + guint32 worker_creation_current_count; + MonoCoopMutex worker_creation_lock; gint32 heuristic_completions; guint32 heuristic_sample_start; @@ -138,7 +144,7 @@ typedef struct { guint32 heuristic_last_adjustment; // ms guint32 heuristic_adjustment_interval; // ms ThreadPoolHillClimbing heuristic_hill_climbing; - mono_mutex_t heuristic_lock; + MonoCoopMutex heuristic_lock; gint32 limit_worker_min; gint32 limit_worker_max; @@ -248,15 +254,18 @@ initialize (void) g_assert (threadpool); threadpool->domains = g_ptr_array_new (); - mono_mutex_init_recursive (&threadpool->domains_lock); + mono_coop_mutex_init (&threadpool->domains_lock); threadpool->parked_threads_count = 0; - mono_cond_init (&threadpool->parked_threads_cond, NULL); + mono_coop_cond_init (&threadpool->parked_threads_cond); threadpool->working_threads = g_ptr_array_new (); - mono_mutex_init_recursive (&threadpool->active_threads_lock); + mono_coop_mutex_init (&threadpool->active_threads_lock); + + threadpool->worker_creation_current_second = -1; + mono_coop_mutex_init (&threadpool->worker_creation_lock); threadpool->heuristic_adjustment_interval = 10; - mono_mutex_init (&threadpool->heuristic_lock); + mono_coop_mutex_init (&threadpool->heuristic_lock); mono_rand_open (); @@ -295,7 +304,12 @@ initialize (void) threads_count = mono_cpu_count () * threads_per_cpu; threadpool->limit_worker_min = threadpool->limit_io_min = threads_count; + +#if defined (PLATFORM_ANDROID) || defined (HOST_IOS) + threadpool->limit_worker_max = threadpool->limit_io_max = CLAMP (threads_count * 100, MIN (threads_count, 200), MAX (threads_count, 200)); +#else threadpool->limit_worker_max = threadpool->limit_io_max = threads_count * 100; +#endif threadpool->counters._.max_working = threadpool->limit_worker_min; @@ -315,23 +329,19 @@ cleanup (void) * cleaning up only if the runtime is shutting down */ g_assert (mono_runtime_is_shutting_down ()); - MONO_PREPARE_BLOCKING; while (monitor_status != MONITOR_STATUS_NOT_RUNNING) - g_usleep (1000); - MONO_FINISH_BLOCKING; + mono_thread_info_sleep (1, NULL); - MONO_PREPARE_BLOCKING; - mono_mutex_lock (&threadpool->active_threads_lock); - MONO_FINISH_BLOCKING; + mono_coop_mutex_lock (&threadpool->active_threads_lock); /* stop all threadpool->working_threads */ for (i = 0; i < threadpool->working_threads->len; ++i) worker_kill ((ThreadPoolWorkingThread*) g_ptr_array_index (threadpool->working_threads, i)); /* unpark all threadpool->parked_threads */ - mono_cond_broadcast (&threadpool->parked_threads_cond); + mono_coop_cond_broadcast (&threadpool->parked_threads_cond); - mono_mutex_unlock (&threadpool->active_threads_lock); + mono_coop_mutex_unlock (&threadpool->active_threads_lock); } void @@ -371,6 +381,7 @@ mono_threadpool_ms_enqueue_work_item (MonoDomain *domain, MonoObject *work_item) } } +/* LOCKING: threadpool->domains_lock must be held */ static void domain_add (ThreadPoolDomain *tpdomain) { @@ -378,31 +389,25 @@ domain_add (ThreadPoolDomain *tpdomain) g_assert (tpdomain); - mono_mutex_lock (&threadpool->domains_lock); len = threadpool->domains->len; for (i = 0; i < len; ++i) { if (g_ptr_array_index (threadpool->domains, i) == tpdomain) break; } + if (i == len) g_ptr_array_add (threadpool->domains, tpdomain); - mono_mutex_unlock (&threadpool->domains_lock); } +/* LOCKING: threadpool->domains_lock must be held */ static gboolean domain_remove (ThreadPoolDomain *tpdomain) { - gboolean res; - g_assert (tpdomain); - - mono_mutex_lock (&threadpool->domains_lock); - res = g_ptr_array_remove (threadpool->domains, tpdomain); - mono_mutex_unlock (&threadpool->domains_lock); - - return res; + return g_ptr_array_remove (threadpool->domains, tpdomain); } +/* LOCKING: threadpool->domains_lock must be held */ static ThreadPoolDomain * domain_get (MonoDomain *domain, gboolean create) { @@ -411,20 +416,18 @@ domain_get (MonoDomain *domain, gboolean create) g_assert (domain); - mono_mutex_lock (&threadpool->domains_lock); for (i = 0; i < threadpool->domains->len; ++i) { - ThreadPoolDomain *tmp = g_ptr_array_index (threadpool->domains, i); - if (tmp->domain == domain) { - tpdomain = tmp; - break; - } + tpdomain = (ThreadPoolDomain *)g_ptr_array_index (threadpool->domains, i); + if (tpdomain->domain == domain) + return tpdomain; } - if (!tpdomain && create) { + + if (create) { tpdomain = g_new0 (ThreadPoolDomain, 1); tpdomain->domain = domain; domain_add (tpdomain); } - mono_mutex_unlock (&threadpool->domains_lock); + return tpdomain; } @@ -434,31 +437,28 @@ domain_free (ThreadPoolDomain *tpdomain) g_free (tpdomain); } +/* LOCKING: threadpool->domains_lock must be held */ static gboolean domain_any_has_request (void) { - gboolean res = FALSE; guint i; - mono_mutex_lock (&threadpool->domains_lock); for (i = 0; i < threadpool->domains->len; ++i) { - ThreadPoolDomain *tmp = g_ptr_array_index (threadpool->domains, i); - if (tmp->outstanding_request > 0) { - res = TRUE; - break; - } + ThreadPoolDomain *tmp = (ThreadPoolDomain *)g_ptr_array_index (threadpool->domains, i); + if (tmp->outstanding_request > 0) + return TRUE; } - mono_mutex_unlock (&threadpool->domains_lock); - return res; + + return FALSE; } +/* LOCKING: threadpool->domains_lock must be held */ static ThreadPoolDomain * domain_get_next (ThreadPoolDomain *current) { ThreadPoolDomain *tpdomain = NULL; guint len; - mono_mutex_lock (&threadpool->domains_lock); len = threadpool->domains->len; if (len > 0) { guint i, current_idx = -1; @@ -472,23 +472,23 @@ domain_get_next (ThreadPoolDomain *current) g_assert (current_idx >= 0); } for (i = current_idx + 1; i < len + current_idx + 1; ++i) { - ThreadPoolDomain *tmp = g_ptr_array_index (threadpool->domains, i % len); + ThreadPoolDomain *tmp = (ThreadPoolDomain *)g_ptr_array_index (threadpool->domains, i % len); if (tmp->outstanding_request > 0) { tpdomain = tmp; break; } } } - mono_mutex_unlock (&threadpool->domains_lock); + return tpdomain; } static void worker_wait_interrupt (gpointer data) { - mono_mutex_lock (&threadpool->active_threads_lock); - mono_cond_signal (&threadpool->parked_threads_cond); - mono_mutex_unlock (&threadpool->active_threads_lock); + mono_coop_mutex_lock (&threadpool->active_threads_lock); + mono_coop_cond_signal (&threadpool->parked_threads_cond); + mono_coop_mutex_unlock (&threadpool->active_threads_lock); } /* return TRUE if timeout, FALSE otherwise (worker unpark or interrupt) */ @@ -501,9 +501,7 @@ worker_park (void) mono_gc_set_skip_thread (TRUE); - MONO_PREPARE_BLOCKING; - - mono_mutex_lock (&threadpool->active_threads_lock); + mono_coop_mutex_lock (&threadpool->active_threads_lock); if (!mono_runtime_is_shutting_down ()) { static gpointer rand_handle = NULL; @@ -524,7 +522,7 @@ worker_park (void) if (interrupted) goto done; - if (mono_cond_timedwait_ms (&threadpool->parked_threads_cond, &threadpool->active_threads_lock, rand_next (rand_handle, 5 * 1000, 60 * 1000)) != 0) + if (mono_coop_cond_timedwait (&threadpool->parked_threads_cond, &threadpool->active_threads_lock, rand_next ((void **)rand_handle, 5 * 1000, 60 * 1000)) != 0) timeout = TRUE; mono_thread_info_uninstall_interrupt (&interrupted); @@ -534,9 +532,7 @@ done: threadpool->parked_threads_count -= 1; } - mono_mutex_unlock (&threadpool->active_threads_lock); - - MONO_FINISH_BLOCKING; + mono_coop_mutex_unlock (&threadpool->active_threads_lock); mono_gc_set_skip_thread (FALSE); @@ -552,16 +548,12 @@ worker_try_unpark (void) mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try unpark worker", mono_native_thread_id_get ()); - MONO_PREPARE_BLOCKING; - - mono_mutex_lock (&threadpool->active_threads_lock); + mono_coop_mutex_lock (&threadpool->active_threads_lock); if (threadpool->parked_threads_count > 0) { - mono_cond_signal (&threadpool->parked_threads_cond); + mono_coop_cond_signal (&threadpool->parked_threads_cond); res = TRUE; } - mono_mutex_unlock (&threadpool->active_threads_lock); - - MONO_FINISH_BLOCKING; + mono_coop_mutex_unlock (&threadpool->active_threads_lock); mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try unpark worker, success? %s", mono_native_thread_id_get (), res ? "yes" : "no"); @@ -594,23 +586,21 @@ worker_thread (gpointer data) mono_thread_set_name_internal (thread, mono_string_new (mono_domain_get (), "Threadpool worker"), FALSE); - MONO_PREPARE_BLOCKING; - mono_mutex_lock (&threadpool->active_threads_lock); + mono_coop_mutex_lock (&threadpool->active_threads_lock); g_ptr_array_add (threadpool->working_threads, thread); - mono_mutex_unlock (&threadpool->active_threads_lock); - MONO_FINISH_BLOCKING; + mono_coop_mutex_unlock (&threadpool->active_threads_lock); previous_tpdomain = NULL; - mono_mutex_lock (&threadpool->domains_lock); + mono_coop_mutex_lock (&threadpool->domains_lock); while (!mono_runtime_is_shutting_down ()) { tpdomain = NULL; if ((thread->state & (ThreadState_StopRequested | ThreadState_SuspendRequested)) != 0) { - mono_mutex_unlock (&threadpool->domains_lock); + mono_coop_mutex_unlock (&threadpool->domains_lock); mono_thread_interruption_checkpoint (); - mono_mutex_lock (&threadpool->domains_lock); + mono_coop_mutex_lock (&threadpool->domains_lock); } if (retire || !(tpdomain = domain_get_next (previous_tpdomain))) { @@ -621,9 +611,9 @@ worker_thread (gpointer data) counter._.parked ++; }); - mono_mutex_unlock (&threadpool->domains_lock); + mono_coop_mutex_unlock (&threadpool->domains_lock); timeout = worker_park (); - mono_mutex_lock (&threadpool->domains_lock); + mono_coop_mutex_lock (&threadpool->domains_lock); COUNTER_ATOMIC (counter, { counter._.working ++; @@ -649,7 +639,7 @@ worker_thread (gpointer data) g_assert (tpdomain->domain->threadpool_jobs >= 0); tpdomain->domain->threadpool_jobs ++; - mono_mutex_unlock (&threadpool->domains_lock); + mono_coop_mutex_unlock (&threadpool->domains_lock); mono_thread_push_appdomain_ref (tpdomain->domain); if (mono_domain_set (tpdomain->domain, FALSE)) { @@ -660,7 +650,7 @@ worker_thread (gpointer data) else if (res && *(MonoBoolean*) mono_object_unbox (res) == FALSE) retire = TRUE; - mono_thread_clr_state (thread , ~ThreadState_Background); + mono_thread_clr_state (thread, (MonoThreadState)~ThreadState_Background); if (!mono_thread_test_state (thread , ThreadState_Background)) ves_icall_System_Threading_Thread_SetState (thread, ThreadState_Background); @@ -668,7 +658,7 @@ worker_thread (gpointer data) } mono_thread_pop_appdomain_ref (); - mono_mutex_lock (&threadpool->domains_lock); + mono_coop_mutex_lock (&threadpool->domains_lock); tpdomain->domain->threadpool_jobs --; g_assert (tpdomain->domain->threadpool_jobs >= 0); @@ -685,13 +675,11 @@ worker_thread (gpointer data) previous_tpdomain = tpdomain; } - mono_mutex_unlock (&threadpool->domains_lock); + mono_coop_mutex_unlock (&threadpool->domains_lock); - MONO_PREPARE_BLOCKING; - mono_mutex_lock (&threadpool->active_threads_lock); + mono_coop_mutex_lock (&threadpool->active_threads_lock); g_ptr_array_remove_fast (threadpool->working_threads, thread); - mono_mutex_unlock (&threadpool->active_threads_lock); - MONO_FINISH_BLOCKING; + mono_coop_mutex_unlock (&threadpool->active_threads_lock); COUNTER_ATOMIC (counter, { counter._.working--; @@ -706,29 +694,56 @@ worker_try_create (void) { ThreadPoolCounter counter; MonoInternalThread *thread; + gint32 now; + + mono_coop_mutex_lock (&threadpool->worker_creation_lock); mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker", mono_native_thread_id_get ()); + if ((now = mono_100ns_ticks () / 10 / 1000 / 1000) == 0) { + g_warning ("failed to get 100ns ticks"); + } else { + if (threadpool->worker_creation_current_second != now) { + threadpool->worker_creation_current_second = now; + threadpool->worker_creation_current_count = 0; + } else { + g_assert (threadpool->worker_creation_current_count <= WORKER_CREATION_MAX_PER_SEC); + if (threadpool->worker_creation_current_count == WORKER_CREATION_MAX_PER_SEC) { + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker, failed: maximum number of worker created per second reached, current count = %d", + mono_native_thread_id_get (), threadpool->worker_creation_current_count); + mono_coop_mutex_unlock (&threadpool->worker_creation_lock); + return FALSE; + } + } + } + COUNTER_ATOMIC (counter, { - if (counter._.working >= counter._.max_working) + if (counter._.working >= counter._.max_working) { + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker, failed: maximum number of working threads reached", + mono_native_thread_id_get ()); + mono_coop_mutex_unlock (&threadpool->worker_creation_lock); return FALSE; + } counter._.working ++; counter._.active ++; }); if ((thread = mono_thread_create_internal (mono_get_root_domain (), worker_thread, NULL, TRUE, 0)) != NULL) { - mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker, created %p", - mono_native_thread_id_get (), thread->tid); + threadpool->worker_creation_current_count += 1; + + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker, created %p, now = %d count = %d", mono_native_thread_id_get (), thread->tid, now, threadpool->worker_creation_current_count); + mono_coop_mutex_unlock (&threadpool->worker_creation_lock); return TRUE; } - mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker, failed", mono_native_thread_id_get ()); + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker, failed: could not create thread", mono_native_thread_id_get ()); COUNTER_ATOMIC (counter, { counter._.working --; counter._.active --; }); + mono_coop_mutex_unlock (&threadpool->worker_creation_lock); return FALSE; } @@ -745,11 +760,11 @@ worker_request (MonoDomain *domain) if (mono_runtime_is_shutting_down ()) return FALSE; - mono_mutex_lock (&threadpool->domains_lock); + mono_coop_mutex_lock (&threadpool->domains_lock); /* synchronize check with worker_thread */ if (mono_domain_is_unloading (domain)) { - mono_mutex_unlock (&threadpool->domains_lock); + mono_coop_mutex_unlock (&threadpool->domains_lock); return FALSE; } @@ -760,7 +775,7 @@ worker_request (MonoDomain *domain) mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] request worker, domain = %p, outstanding_request = %d", mono_native_thread_id_get (), tpdomain->domain, tpdomain->outstanding_request); - mono_mutex_unlock (&threadpool->domains_lock); + mono_coop_mutex_unlock (&threadpool->domains_lock); if (threadpool->suspended) return FALSE; @@ -794,8 +809,10 @@ monitor_should_keep_running (void) if (mono_runtime_is_shutting_down ()) { should_keep_running = FALSE; } else { + mono_coop_mutex_lock (&threadpool->domains_lock); if (!domain_any_has_request ()) should_keep_running = FALSE; + mono_coop_mutex_unlock (&threadpool->domains_lock); if (!should_keep_running) { if (last_should_keep_running == -1 || mono_100ns_ticks () - last_should_keep_running < MONITOR_MINIMAL_LIFETIME * 1000 * 10) { @@ -882,25 +899,41 @@ monitor_thread (void) if (threadpool->suspended) continue; - if (mono_runtime_is_shutting_down () || !domain_any_has_request ()) + if (mono_runtime_is_shutting_down ()) continue; - MONO_PREPARE_BLOCKING; - mono_mutex_lock (&threadpool->active_threads_lock); + mono_coop_mutex_lock (&threadpool->domains_lock); + if (!domain_any_has_request ()) { + mono_coop_mutex_unlock (&threadpool->domains_lock); + continue; + } + mono_coop_mutex_unlock (&threadpool->domains_lock); + + + mono_coop_mutex_lock (&threadpool->active_threads_lock); for (i = 0; i < threadpool->working_threads->len; ++i) { - thread = g_ptr_array_index (threadpool->working_threads, i); + thread = (MonoInternalThread *)g_ptr_array_index (threadpool->working_threads, i); if ((thread->state & ThreadState_WaitSleepJoin) == 0) { all_waitsleepjoin = FALSE; break; } } - mono_mutex_unlock (&threadpool->active_threads_lock); - MONO_FINISH_BLOCKING; + mono_coop_mutex_unlock (&threadpool->active_threads_lock); if (all_waitsleepjoin) { ThreadPoolCounter counter; - COUNTER_ATOMIC (counter, { counter._.max_working ++; }); - hill_climbing_force_change (counter._.max_working, TRANSITION_STARVATION); + gboolean limit_worker_max_reached = FALSE; + + COUNTER_ATOMIC (counter, { + if (counter._.max_working >= threadpool->limit_worker_max) { + limit_worker_max_reached = TRUE; + break; + } + counter._.max_working ++; + }); + + if (!limit_worker_max_reached) + hill_climbing_force_change (counter._.max_working, TRANSITION_STARVATION); } threadpool->cpu_usage = mono_cpu_usage (threadpool->cpu_usage_state); @@ -1249,7 +1282,7 @@ heuristic_adjust (void) { g_assert (threadpool); - if (mono_mutex_trylock (&threadpool->heuristic_lock) == 0) { + if (mono_coop_mutex_trylock (&threadpool->heuristic_lock) == 0) { gint32 completions = InterlockedExchange (&threadpool->heuristic_completions, 0); guint32 sample_end = mono_msec_ticks (); guint32 sample_duration = sample_end - threadpool->heuristic_sample_start; @@ -1270,7 +1303,7 @@ heuristic_adjust (void) threadpool->heuristic_last_adjustment = mono_msec_ticks (); } - mono_mutex_unlock (&threadpool->heuristic_lock); + mono_coop_mutex_unlock (&threadpool->heuristic_lock); } } @@ -1439,12 +1472,16 @@ mono_threadpool_ms_resume (void) void ves_icall_System_Threading_ThreadPool_GetAvailableThreadsNative (gint32 *worker_threads, gint32 *completion_port_threads) { + ThreadPoolCounter counter; + if (!worker_threads || !completion_port_threads) return; mono_lazy_initialize (&status, initialize); - *worker_threads = threadpool->limit_worker_max; + counter.as_gint64 = COUNTER_READ (); + + *worker_threads = MAX (0, threadpool->limit_worker_max - counter._.active); *completion_port_threads = threadpool->limit_io_max; } @@ -1482,8 +1519,8 @@ ves_icall_System_Threading_ThreadPool_SetMinThreadsNative (gint32 worker_threads if (completion_port_threads <= 0 || completion_port_threads > threadpool->limit_io_max) return FALSE; - threadpool->limit_worker_max = worker_threads; - threadpool->limit_io_max = completion_port_threads; + threadpool->limit_worker_min = worker_threads; + threadpool->limit_io_min = completion_port_threads; return TRUE; } diff --git a/mono/metadata/threads.c b/mono/metadata/threads.c index 588cafd10fc..9e7e8ff34af 100644 --- a/mono/metadata/threads.c +++ b/mono/metadata/threads.c @@ -128,11 +128,11 @@ typedef struct { /* Controls access to the 'threads' hash table */ static void mono_threads_lock (void); static void mono_threads_unlock (void); -static mono_mutex_t threads_mutex; +static MonoCoopMutex threads_mutex; /* Controls access to the 'joinable_threads' hash table */ -#define joinable_threads_lock() mono_mutex_lock (&joinable_threads_mutex) -#define joinable_threads_unlock() mono_mutex_unlock (&joinable_threads_mutex) +#define joinable_threads_lock() mono_os_mutex_lock (&joinable_threads_mutex) +#define joinable_threads_unlock() mono_os_mutex_unlock (&joinable_threads_mutex) static mono_mutex_t joinable_threads_mutex; /* Holds current status of static data heap */ @@ -204,14 +204,13 @@ static gboolean mono_thread_resume (MonoInternalThread* thread); static void abort_thread_internal (MonoInternalThread *thread, gboolean can_raise_exception, gboolean install_async_abort); static void suspend_thread_internal (MonoInternalThread *thread, gboolean interrupt); static void self_suspend_internal (MonoInternalThread *thread); -static gboolean resume_thread_internal (MonoInternalThread *thread); static MonoException* mono_thread_execute_interruption (); static void ref_stack_destroy (gpointer rs); /* Spin lock for InterlockedXXX 64 bit functions */ -#define mono_interlocked_lock() mono_mutex_lock (&interlocked_mutex) -#define mono_interlocked_unlock() mono_mutex_unlock (&interlocked_mutex) +#define mono_interlocked_lock() mono_os_mutex_lock (&interlocked_mutex) +#define mono_interlocked_unlock() mono_os_mutex_unlock (&interlocked_mutex) static mono_mutex_t interlocked_mutex; /* global count of thread interruptions requested */ @@ -227,15 +226,13 @@ static gint32 managed_thread_id_counter = 0; static void mono_threads_lock (void) { - MONO_TRY_BLOCKING; - mono_locks_acquire (&threads_mutex, ThreadsLock); - MONO_FINISH_TRY_BLOCKING; + mono_locks_coop_acquire (&threads_mutex, ThreadsLock); } static void mono_threads_unlock (void) { - mono_locks_release (&threads_mutex, ThreadsLock); + mono_locks_coop_release (&threads_mutex, ThreadsLock); } @@ -349,19 +346,19 @@ static gboolean handle_remove(MonoInternalThread *thread) static void ensure_synch_cs_set (MonoInternalThread *thread) { - mono_mutex_t *synch_cs; + MonoCoopMutex *synch_cs; if (thread->synch_cs != NULL) { return; } - synch_cs = g_new0 (mono_mutex_t, 1); - mono_mutex_init_recursive (synch_cs); + synch_cs = g_new0 (MonoCoopMutex, 1); + mono_coop_mutex_init_recursive (synch_cs); if (InterlockedCompareExchangePointer ((gpointer *)&thread->synch_cs, synch_cs, NULL) != NULL) { /* Another thread must have installed this CS */ - mono_mutex_destroy (synch_cs); + mono_coop_mutex_destroy (synch_cs); g_free (synch_cs); } } @@ -374,15 +371,13 @@ lock_thread (MonoInternalThread *thread) g_assert (thread->synch_cs); - MONO_TRY_BLOCKING; - mono_mutex_lock (thread->synch_cs); - MONO_FINISH_TRY_BLOCKING; + mono_coop_mutex_lock (thread->synch_cs); } static inline void unlock_thread (MonoInternalThread *thread) { - mono_mutex_unlock (thread->synch_cs); + mono_coop_mutex_unlock (thread->synch_cs); } /* @@ -554,7 +549,7 @@ get_current_thread_ptr_for_domain (MonoDomain *domain, MonoInternalThread *threa mono_domain_unlock (domain); g_assert (offset); - return get_thread_static_data (thread, offset); + return (MonoThread **)get_thread_static_data (thread, offset); } static void @@ -592,8 +587,8 @@ create_internal_thread (void) vt = mono_class_vtable (mono_get_root_domain (), mono_defaults.internal_thread_class); thread = (MonoInternalThread*)mono_gc_alloc_mature (vt); - thread->synch_cs = g_new0 (mono_mutex_t, 1); - mono_mutex_init_recursive (thread->synch_cs); + thread->synch_cs = g_new0 (MonoCoopMutex, 1); + mono_coop_mutex_init_recursive (thread->synch_cs); thread->apartment_state = ThreadApartmentState_Unknown; thread->managed_id = get_next_managed_thread_id (); @@ -816,10 +811,8 @@ create_thread (MonoThread *thread, MonoInternalThread *internal, StartInfo *star */ create_flags = CREATE_SUSPENDED; - MONO_PREPARE_BLOCKING; thread_handle = mono_threads_create_thread ((LPTHREAD_START_ROUTINE)start_wrapper, start_info, stack_size, create_flags, &tid); - MONO_FINISH_BLOCKING; if (thread_handle == NULL) { /* The thread couldn't be created, so throw an exception */ @@ -851,9 +844,7 @@ create_thread (MonoThread *thread, MonoInternalThread *internal, StartInfo *star if (!handle_store (thread, FALSE)) return FALSE; - MONO_PREPARE_BLOCKING; mono_thread_info_resume (tid); - MONO_FINISH_BLOCKING; if (internal->start_notify) { /* @@ -912,7 +903,7 @@ mono_thread_create_internal (MonoDomain *domain, gpointer func, gpointer arg, gb MONO_OBJECT_SETREF (thread, internal_thread, internal); start_info = g_new0 (StartInfo, 1); - start_info->func = func; + start_info->func = (guint32 (*)(void *))func; start_info->obj = thread; start_info->start_arg = arg; @@ -1087,7 +1078,7 @@ ves_icall_System_Threading_Thread_ConstructInternalThread (MonoThread *this_obj) internal->state = ThreadState_Unstarted; - InterlockedCompareExchangePointer ((gpointer)&this_obj->internal_thread, internal, NULL); + InterlockedCompareExchangePointer ((volatile gpointer *)&this_obj->internal_thread, internal, NULL); } HANDLE @@ -1155,9 +1146,9 @@ ves_icall_System_Threading_InternalThread_Thread_free_internal (MonoInternalThre CloseHandle (thread); if (this_obj->synch_cs) { - mono_mutex_t *synch_cs = this_obj->synch_cs; + MonoCoopMutex *synch_cs = this_obj->synch_cs; this_obj->synch_cs = NULL; - mono_mutex_destroy (synch_cs); + mono_coop_mutex_destroy (synch_cs); g_free (synch_cs); } @@ -1183,9 +1174,7 @@ ves_icall_System_Threading_Thread_Sleep_internal(gint32 ms) mono_thread_set_state (thread, ThreadState_WaitSleepJoin); - MONO_PREPARE_BLOCKING res = mono_thread_info_sleep (ms, &alerted); - MONO_FINISH_BLOCKING mono_thread_clr_state (thread, ThreadState_WaitSleepJoin); @@ -1929,7 +1918,7 @@ MonoObject* ves_icall_System_Threading_Interlocked_CompareExchange_T (MonoObject **location, MonoObject *value, MonoObject *comparand) { MonoObject *res; - res = InterlockedCompareExchangePointer ((gpointer *)location, value, comparand); + res = (MonoObject *)InterlockedCompareExchangePointer ((volatile gpointer *)location, value, comparand); mono_gc_wbarrier_generic_nostore (location); return res; } @@ -1938,7 +1927,7 @@ MonoObject* ves_icall_System_Threading_Interlocked_Exchange_T (MonoObject **location, MonoObject *value) { MonoObject *res; - res = InterlockedExchangePointer ((gpointer *)location, value); + res = (MonoObject *)InterlockedExchangePointer ((volatile gpointer *)location, value); mono_gc_wbarrier_generic_nostore (location); return res; } @@ -1987,9 +1976,9 @@ ves_icall_System_Threading_Thread_MemoryBarrier (void) } void -ves_icall_System_Threading_Thread_ClrState (MonoInternalThread* this, guint32 state) +ves_icall_System_Threading_Thread_ClrState (MonoInternalThread* this_obj, guint32 state) { - mono_thread_clr_state (this, state); + mono_thread_clr_state (this_obj, (MonoThreadState)state); if (state & ThreadState_Background) { /* If the thread changes the background mode, the main thread has to @@ -2001,9 +1990,9 @@ ves_icall_System_Threading_Thread_ClrState (MonoInternalThread* this, guint32 st } void -ves_icall_System_Threading_Thread_SetState (MonoInternalThread* this, guint32 state) +ves_icall_System_Threading_Thread_SetState (MonoInternalThread* this_obj, guint32 state) { - mono_thread_set_state (this, state); + mono_thread_set_state (this_obj, (MonoThreadState)state); if (state & ThreadState_Background) { /* If the thread changes the background mode, the main thread has to @@ -2015,15 +2004,15 @@ ves_icall_System_Threading_Thread_SetState (MonoInternalThread* this, guint32 st } guint32 -ves_icall_System_Threading_Thread_GetState (MonoInternalThread* this) +ves_icall_System_Threading_Thread_GetState (MonoInternalThread* this_obj) { guint32 state; - LOCK_THREAD (this); + LOCK_THREAD (this_obj); - state = this->state; + state = this_obj->state; - UNLOCK_THREAD (this); + UNLOCK_THREAD (this_obj); return state; } @@ -2031,7 +2020,7 @@ ves_icall_System_Threading_Thread_GetState (MonoInternalThread* this) void ves_icall_System_Threading_Thread_Interrupt_internal (MonoThread *this_obj) { MonoInternalThread *current; - gboolean throw; + gboolean throw_; MonoInternalThread *thread = this_obj->internal_thread; LOCK_THREAD (thread); @@ -2039,11 +2028,11 @@ void ves_icall_System_Threading_Thread_Interrupt_internal (MonoThread *this_obj) current = mono_thread_internal_current (); thread->thread_interrupt_requested = TRUE; - throw = current != thread && (thread->state & ThreadState_WaitSleepJoin); + throw_ = current != thread && (thread->state & ThreadState_WaitSleepJoin); UNLOCK_THREAD (thread); - if (throw) { + if (throw_) { abort_thread_internal (thread, TRUE, FALSE); } } @@ -2051,18 +2040,18 @@ void ves_icall_System_Threading_Thread_Interrupt_internal (MonoThread *this_obj) void mono_thread_current_check_pending_interrupt () { MonoInternalThread *thread = mono_thread_internal_current (); - gboolean throw = FALSE; + gboolean throw_ = FALSE; LOCK_THREAD (thread); if (thread->thread_interrupt_requested) { - throw = TRUE; + throw_ = TRUE; thread->thread_interrupt_requested = FALSE; } UNLOCK_THREAD (thread); - if (throw) { + if (throw_) { mono_raise_exception (mono_get_exception_thread_interrupted ()); } } @@ -2097,15 +2086,15 @@ ves_icall_System_Threading_Thread_Abort (MonoInternalThread *thread, MonoObject } thread->abort_exc = NULL; - UNLOCK_THREAD (thread); - THREAD_DEBUG (g_message ("%s: (%"G_GSIZE_FORMAT") Abort requested for %p (%"G_GSIZE_FORMAT")", __func__, mono_native_thread_id_get (), thread, (gsize)thread->tid)); /* During shutdown, we can't wait for other threads */ if (!shutting_down) /* Make sure the thread is awake */ mono_thread_resume (thread); - + + UNLOCK_THREAD (thread); + abort_thread_internal (thread, TRUE, TRUE); } @@ -2222,14 +2211,12 @@ ves_icall_System_Threading_Thread_Suspend (MonoThread *this_obj) } } +/* LOCKING: LOCK_THREAD(thread) must be held */ static gboolean mono_thread_resume (MonoInternalThread *thread) { - LOCK_THREAD (thread); - if ((thread->state & ThreadState_SuspendRequested) != 0) { thread->state &= ~ThreadState_SuspendRequested; - UNLOCK_THREAD (thread); return TRUE; } @@ -2238,19 +2225,32 @@ mono_thread_resume (MonoInternalThread *thread) (thread->state & ThreadState_Aborted) != 0 || (thread->state & ThreadState_Stopped) != 0) { - UNLOCK_THREAD (thread); return FALSE; } - return resume_thread_internal (thread); + UNLOCK_THREAD (thread); + + /* Awake the thread */ + if (!mono_thread_info_resume (thread_get_tid (thread))) + return FALSE; + + LOCK_THREAD (thread); + + thread->state &= ~ThreadState_Suspended; + + return TRUE; } void ves_icall_System_Threading_Thread_Resume (MonoThread *thread) { - if (!thread->internal_thread || !mono_thread_resume (thread->internal_thread)) { + if (!thread->internal_thread) { mono_set_pending_exception (mono_get_exception_thread_state ("Thread has not been started, or is dead.")); - return; + } else { + LOCK_THREAD (thread->internal_thread); + if (!mono_thread_resume (thread->internal_thread)) + mono_set_pending_exception (mono_get_exception_thread_state ("Thread has not been started, or is dead.")); + UNLOCK_THREAD (thread->internal_thread); } } @@ -2381,19 +2381,19 @@ ves_icall_System_Threading_Thread_VolatileReadFloat (void *ptr) gint8 ves_icall_System_Threading_Volatile_Read1 (void *ptr) { - return InterlockedRead8 (ptr); + return InterlockedRead8 ((volatile gint8 *)ptr); } gint16 ves_icall_System_Threading_Volatile_Read2 (void *ptr) { - return InterlockedRead16 (ptr); + return InterlockedRead16 ((volatile gint16 *)ptr); } gint32 ves_icall_System_Threading_Volatile_Read4 (void *ptr) { - return InterlockedRead (ptr); + return InterlockedRead ((volatile gint32 *)ptr); } gint64 @@ -2408,13 +2408,13 @@ ves_icall_System_Threading_Volatile_Read8 (void *ptr) return val; } #endif - return InterlockedRead64 (ptr); + return InterlockedRead64 ((volatile gint64 *)ptr); } void * ves_icall_System_Threading_Volatile_ReadIntPtr (void *ptr) { - return InterlockedReadPointer (ptr); + return InterlockedReadPointer ((volatile gpointer *)ptr); } double @@ -2432,7 +2432,7 @@ ves_icall_System_Threading_Volatile_ReadDouble (void *ptr) } #endif - u.ival = InterlockedRead64 (ptr); + u.ival = InterlockedRead64 ((volatile gint64 *)ptr); return u.fval; } @@ -2442,7 +2442,7 @@ ves_icall_System_Threading_Volatile_ReadFloat (void *ptr) { IntFloatUnion u; - u.ival = InterlockedRead (ptr); + u.ival = InterlockedRead ((volatile gint32 *)ptr); return u.fval; } @@ -2450,7 +2450,7 @@ ves_icall_System_Threading_Volatile_ReadFloat (void *ptr) MonoObject* ves_icall_System_Threading_Volatile_Read_T (void *ptr) { - return InterlockedReadPointer (ptr); + return (MonoObject *)InterlockedReadPointer ((volatile gpointer *)ptr); } void @@ -2504,19 +2504,19 @@ ves_icall_System_Threading_Thread_VolatileWriteFloat (void *ptr, float value) void ves_icall_System_Threading_Volatile_Write1 (void *ptr, gint8 value) { - InterlockedWrite8 (ptr, value); + InterlockedWrite8 ((volatile gint8 *)ptr, value); } void ves_icall_System_Threading_Volatile_Write2 (void *ptr, gint16 value) { - InterlockedWrite16 (ptr, value); + InterlockedWrite16 ((volatile gint16 *)ptr, value); } void ves_icall_System_Threading_Volatile_Write4 (void *ptr, gint32 value) { - InterlockedWrite (ptr, value); + InterlockedWrite ((volatile gint32 *)ptr, value); } void @@ -2531,13 +2531,13 @@ ves_icall_System_Threading_Volatile_Write8 (void *ptr, gint64 value) } #endif - InterlockedWrite64 (ptr, value); + InterlockedWrite64 ((volatile gint64 *)ptr, value); } void ves_icall_System_Threading_Volatile_WriteIntPtr (void *ptr, void *value) { - InterlockedWritePointer (ptr, value); + InterlockedWritePointer ((volatile gpointer *)ptr, value); } void @@ -2556,7 +2556,7 @@ ves_icall_System_Threading_Volatile_WriteDouble (void *ptr, double value) u.fval = value; - InterlockedWrite64 (ptr, u.ival); + InterlockedWrite64 ((volatile gint64 *)ptr, u.ival); } void @@ -2566,7 +2566,7 @@ ves_icall_System_Threading_Volatile_WriteFloat (void *ptr, float value) u.fval = value; - InterlockedWrite (ptr, u.ival); + InterlockedWrite ((volatile gint32 *)ptr, u.ival); } void @@ -2620,9 +2620,10 @@ mono_thread_init_tls (void) void mono_thread_init (MonoThreadStartCB start_cb, MonoThreadAttachCB attach_cb) { - mono_mutex_init_recursive(&threads_mutex); - mono_mutex_init_recursive(&interlocked_mutex); - mono_mutex_init_recursive(&joinable_threads_mutex); + mono_coop_mutex_init_recursive (&threads_mutex); + + mono_os_mutex_init_recursive(&interlocked_mutex); + mono_os_mutex_init_recursive(&joinable_threads_mutex); background_change_event = CreateEvent (NULL, TRUE, FALSE, NULL); g_assert(background_change_event != NULL); @@ -2663,10 +2664,10 @@ void mono_thread_cleanup (void) * critical sections can be locked when mono_thread_cleanup is * called. */ - mono_mutex_destroy (&threads_mutex); - mono_mutex_destroy (&interlocked_mutex); - mono_mutex_destroy (&delayed_free_table_mutex); - mono_mutex_destroy (&small_id_mutex); + mono_coop_mutex_destroy (&threads_mutex); + mono_os_mutex_destroy (&interlocked_mutex); + mono_os_mutex_destroy (&delayed_free_table_mutex); + mono_os_mutex_destroy (&small_id_mutex); CloseHandle (background_change_event); #endif @@ -2872,7 +2873,7 @@ remove_and_abort_threads (gpointer key, gpointer value, gpointer user) { struct wait_data *wait=(struct wait_data *)user; MonoNativeThreadId self = mono_native_thread_id_get (); - MonoInternalThread *thread = value; + MonoInternalThread *thread = (MonoInternalThread *)value; HANDLE handle; if (wait->num >= MAXIMUM_WAIT_OBJECTS) @@ -3175,7 +3176,7 @@ static gboolean thread_dump_requested; static gboolean collect_frame (MonoStackFrameInfo *frame, MonoContext *ctx, gpointer data) { - ThreadDumpUserData *ud = data; + ThreadDumpUserData *ud = (ThreadDumpUserData *)data; if (ud->nframes < ud->max_frames) { memcpy (&ud->frames [ud->nframes], frame, sizeof (MonoStackFrameInfo)); @@ -3189,7 +3190,7 @@ collect_frame (MonoStackFrameInfo *frame, MonoContext *ctx, gpointer data) static SuspendThreadResult get_thread_dump (MonoThreadInfo *info, gpointer ud) { - ThreadDumpUserData *user_data = ud; + ThreadDumpUserData *user_data = (ThreadDumpUserData *)ud; MonoInternalThread *thread = user_data->thread; #if 0 @@ -3217,8 +3218,8 @@ typedef struct { static void collect_thread (gpointer key, gpointer value, gpointer user) { - CollectThreadsUserData *ud = user; - MonoInternalThread *thread = value; + CollectThreadsUserData *ud = (CollectThreadsUserData *)user; + MonoInternalThread *thread = (MonoInternalThread *)value; if (ud->nthreads < ud->max_threads) ud->threads [ud->nthreads ++] = thread; @@ -3446,7 +3447,7 @@ ref_stack_new (gint initial_size) static void ref_stack_destroy (gpointer ptr) { - RefStack *rs = ptr; + RefStack *rs = (RefStack *)ptr; if (rs != NULL) { g_free (rs->refs); @@ -3460,7 +3461,7 @@ ref_stack_push (RefStack *rs, gpointer ptr) g_assert (rs != NULL); if (rs->bottom >= rs->allocated) { - rs->refs = g_realloc (rs->refs, rs->allocated * 2 * sizeof (gpointer) + 1); + rs->refs = (void **)g_realloc (rs->refs, rs->allocated * 2 * sizeof (gpointer) + 1); rs->allocated <<= 1; rs->refs [rs->allocated] = NULL; } @@ -3509,7 +3510,7 @@ mono_thread_push_appdomain_ref (MonoDomain *domain) SPIN_LOCK (thread->lock_thread_id); if (thread->appdomain_refs == NULL) thread->appdomain_refs = ref_stack_new (16); - ref_stack_push (thread->appdomain_refs, domain); + ref_stack_push ((RefStack *)thread->appdomain_refs, domain); SPIN_UNLOCK (thread->lock_thread_id); } } @@ -3522,7 +3523,7 @@ mono_thread_pop_appdomain_ref (void) if (thread) { /* printf ("POP REF: %"G_GSIZE_FORMAT" -> %s.\n", (gsize)thread->tid, ((MonoDomain*)(thread->appdomain_refs->data))->friendly_name); */ SPIN_LOCK (thread->lock_thread_id); - ref_stack_pop (thread->appdomain_refs); + ref_stack_pop ((RefStack *)thread->appdomain_refs); SPIN_UNLOCK (thread->lock_thread_id); } } @@ -3532,7 +3533,7 @@ mono_thread_internal_has_appdomain_ref (MonoInternalThread *thread, MonoDomain * { gboolean res; SPIN_LOCK (thread->lock_thread_id); - res = ref_stack_find (thread->appdomain_refs, domain); + res = ref_stack_find ((RefStack *)thread->appdomain_refs, domain); SPIN_UNLOCK (thread->lock_thread_id); return res; } @@ -3703,10 +3704,10 @@ static MonoBitSet *context_reference_bitmaps [NUM_STATIC_DATA_IDX]; static void mark_slots (void *addr, MonoBitSet **bitmaps, MonoGCMarkFunc mark_func, void *gc_data) { - gpointer *static_data = addr; + gpointer *static_data = (gpointer *)addr; for (int i = 0; i < NUM_STATIC_DATA_IDX; ++i) { - void **ptr = static_data [i]; + void **ptr = (void **)static_data [i]; if (!ptr) continue; @@ -3756,7 +3757,7 @@ mono_alloc_static_data (gpointer **static_data_ptr, guint32 offset, gboolean thr ctx_desc = mono_gc_make_root_descr_user (mark_ctx_slots); } - static_data = mono_gc_alloc_fixed (static_data_size [0], threadlocal ? tls_desc : ctx_desc, + static_data = (void **)mono_gc_alloc_fixed (static_data_size [0], threadlocal ? tls_desc : ctx_desc, threadlocal ? MONO_ROOT_SOURCE_THREAD_STATIC : MONO_ROOT_SOURCE_CONTEXT_STATIC, threadlocal ? "managed thread-static variables" : "managed context-static variables"); *static_data_ptr = static_data; @@ -3876,7 +3877,7 @@ context_adjust_static_data (MonoAppContext *ctx) static void alloc_thread_static_data_helper (gpointer key, gpointer value, gpointer user) { - MonoInternalThread *thread = value; + MonoInternalThread *thread = (MonoInternalThread *)value; guint32 offset = GPOINTER_TO_UINT (user); mono_alloc_static_data (&(thread->static_data), offset, TRUE); @@ -4030,8 +4031,8 @@ typedef struct { static void free_thread_static_data_helper (gpointer key, gpointer value, gpointer user) { - MonoInternalThread *thread = value; - OffsetSize *data = user; + MonoInternalThread *thread = (MonoInternalThread *)value; + OffsetSize *data = (OffsetSize *)user; int idx = ACCESS_SPECIAL_STATIC_OFFSET (data->offset, index); int off = ACCESS_SPECIAL_STATIC_OFFSET (data->offset, offset); char *ptr; @@ -4056,7 +4057,7 @@ free_context_static_data_helper (gpointer key, gpointer value, gpointer user) return TRUE; // Remove this key/value pair } - OffsetSize *data = user; + OffsetSize *data = (OffsetSize *)user; int idx = ACCESS_SPECIAL_STATIC_OFFSET (data->offset, index); int off = ACCESS_SPECIAL_STATIC_OFFSET (data->offset, offset); char *ptr; @@ -4113,7 +4114,7 @@ do_free_special_slot (guint32 offset, guint32 size) static void do_free_special (gpointer key, gpointer value, gpointer data) { - MonoClassField *field = key; + MonoClassField *field = (MonoClassField *)key; guint32 offset = GPOINTER_TO_UINT (value); gint32 align; guint32 size; @@ -4522,7 +4523,7 @@ mono_jit_info_match (MonoJitInfo *ji, gpointer ip) static gboolean last_managed (MonoStackFrameInfo *frame, MonoContext *ctx, gpointer data) { - MonoJitInfo **dest = data; + MonoJitInfo **dest = (MonoJitInfo **)data; *dest = frame->ji; return TRUE; } @@ -4546,7 +4547,7 @@ typedef struct { static SuspendThreadResult abort_thread_critical (MonoThreadInfo *info, gpointer ud) { - AbortThreadData *data = ud; + AbortThreadData *data = (AbortThreadData *)ud; MonoInternalThread *thread = data->thread; MonoJitInfo *ji = NULL; gboolean protected_wrapper; @@ -4626,7 +4627,7 @@ typedef struct{ static SuspendThreadResult suspend_thread_critical (MonoThreadInfo *info, gpointer ud) { - SuspendThreadData *data = ud; + SuspendThreadData *data = (SuspendThreadData *)ud; MonoInternalThread *thread = data->thread; MonoJitInfo *ji = NULL; gboolean protected_wrapper; @@ -4644,7 +4645,7 @@ suspend_thread_critical (MonoThreadInfo *info, gpointer ud) if (InterlockedCompareExchange (&thread->interruption_requested, 1, 0) == 0) InterlockedIncrement (&thread_interruption_requested); if (data->interrupt) - data->interrupt_token = mono_thread_info_prepare_interrupt (thread->thread_info); + data->interrupt_token = mono_thread_info_prepare_interrupt ((MonoThreadInfo *)thread->thread_info); if (mono_thread_notify_pending_exc_fn && !running_managed) /* The JIT will notify the thread about the interruption */ @@ -4687,20 +4688,6 @@ self_suspend_internal (MonoInternalThread *thread) mono_thread_info_end_self_suspend (); } -/*This is called with @thread synch_cs held and it must release it*/ -static gboolean -resume_thread_internal (MonoInternalThread *thread) -{ - UNLOCK_THREAD (thread); - /* Awake the thread */ - if (!mono_thread_info_resume (thread_get_tid (thread))) - return FALSE; - LOCK_THREAD (thread); - thread->state &= ~ThreadState_Suspended; - UNLOCK_THREAD (thread); - return TRUE; -} - /* * mono_thread_is_foreign: @@ -4714,7 +4701,7 @@ resume_thread_internal (MonoInternalThread *thread) mono_bool mono_thread_is_foreign (MonoThread *thread) { - MonoThreadInfo *info = thread->internal_thread->thread_info; + MonoThreadInfo *info = (MonoThreadInfo *)thread->internal_thread->thread_info; return info->runtime_thread == FALSE; } diff --git a/mono/metadata/verify.c b/mono/metadata/verify.c index 5a4a9a02c0d..e9af9516a1b 100644 --- a/mono/metadata/verify.c +++ b/mono/metadata/verify.c @@ -409,10 +409,10 @@ mono_type_is_enum_type (MonoType *type) * */ static gboolean -mono_type_is_value_type (MonoType *type, const char *namespace, const char *name) +mono_type_is_value_type (MonoType *type, const char *namespace_, const char *name) { return type->type == MONO_TYPE_VALUETYPE && - !strcmp (namespace, type->data.klass->name_space) && + !strcmp (namespace_, type->data.klass->name_space) && !strcmp (name, type->data.klass->name); } @@ -941,7 +941,7 @@ verifier_load_field (VerifyContext *ctx, int token, MonoClass **out_klass, const MonoClass *klass = NULL; if (ctx->method->wrapper_type != MONO_WRAPPER_NONE) { - field = mono_method_get_wrapper_data (ctx->method, (guint32)token); + field = (MonoClassField *)mono_method_get_wrapper_data (ctx->method, (guint32)token); klass = field ? field->parent : NULL; } else { if (!IS_FIELD_DEF_OR_REF (token) || !token_bounds_check (ctx->image, token)) { @@ -978,7 +978,7 @@ verifier_load_method (VerifyContext *ctx, int token, const char *opcode) { if (ctx->method->wrapper_type != MONO_WRAPPER_NONE) { - method = mono_method_get_wrapper_data (ctx->method, (guint32)token); + method = (MonoMethod *)mono_method_get_wrapper_data (ctx->method, (guint32)token); } else { MonoError error; if (!IS_METHOD_DEF_OR_REF_OR_SPEC (token) || !token_bounds_check (ctx->image, token)) { @@ -1006,7 +1006,7 @@ verifier_load_type (VerifyContext *ctx, int token, const char *opcode) { MonoType* type; if (ctx->method->wrapper_type != MONO_WRAPPER_NONE) { - MonoClass *klass = mono_method_get_wrapper_data (ctx->method, (guint32)token); + MonoClass *klass = (MonoClass *)mono_method_get_wrapper_data (ctx->method, (guint32)token); type = klass ? &klass->byval_arg : NULL; } else { MonoError error; @@ -1175,7 +1175,7 @@ mono_free_verify_list (GSList *list) GSList *tmp; for (tmp = list; tmp; tmp = tmp->next) { - info = tmp->data; + info = (MonoVerifyInfoExtended *)tmp->data; g_free (info->info.message); g_free (info); } @@ -2444,11 +2444,11 @@ recursive_boxed_constraint_type_check (VerifyContext *ctx, MonoType *type, MonoC if (mono_type_is_generic_argument (constraint_type)) { MonoGenericParam *param = get_generic_param (ctx, constraint_type); - MonoClass **class; + MonoClass **klass; if (!param) return FALSE; - for (class = mono_generic_param_info (param)->constraints; class && *class; ++class) { - if (recursive_boxed_constraint_type_check (ctx, type, *class, recursion_level - 1)) + for (klass = mono_generic_param_info (param)->constraints; klass && *klass; ++klass) { + if (recursive_boxed_constraint_type_check (ctx, type, *klass, recursion_level - 1)) return TRUE; } } @@ -2476,13 +2476,13 @@ is_compatible_boxed_valuetype (VerifyContext *ctx, MonoType *type, MonoType *can if (mono_type_is_generic_argument (candidate)) { MonoGenericParam *param = get_generic_param (ctx, candidate); - MonoClass **class; + MonoClass **klass; if (!param) return FALSE; - for (class = mono_generic_param_info (param)->constraints; class && *class; ++class) { + for (klass = mono_generic_param_info (param)->constraints; klass && *klass; ++klass) { /*256 should be enough since there can't be more than 255 generic arguments.*/ - if (recursive_boxed_constraint_type_check (ctx, type, *class, 256)) + if (recursive_boxed_constraint_type_check (ctx, type, *klass, 256)) return TRUE; } } @@ -3148,7 +3148,7 @@ do_ret (VerifyContext *ctx) * TODO handle calling .ctor outside one or calling the .ctor for other class but super */ static void -do_invoke_method (VerifyContext *ctx, int method_token, gboolean virtual) +do_invoke_method (VerifyContext *ctx, int method_token, gboolean virtual_) { MonoError error; int param_count, i; @@ -3158,10 +3158,10 @@ do_invoke_method (VerifyContext *ctx, int method_token, gboolean virtual) gboolean virt_check_this = FALSE; gboolean constrained = ctx->prefix_set & PREFIX_CONSTRAINED; - if (!(method = verifier_load_method (ctx, method_token, virtual ? "callvirt" : "call"))) + if (!(method = verifier_load_method (ctx, method_token, virtual_ ? "callvirt" : "call"))) return; - if (virtual) { + if (virtual_) { CLEAR_PREFIX (ctx, PREFIX_CONSTRAINED); if (method->klass->valuetype) // && !constrained ??? @@ -3209,10 +3209,10 @@ do_invoke_method (VerifyContext *ctx, int method_token, gboolean virtual) } if (stack_slot_is_managed_mutability_pointer (value)) - CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Cannot use a readonly pointer as argument of %s at 0x%04x", virtual ? "callvirt" : "call", ctx->ip_offset)); + CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Cannot use a readonly pointer as argument of %s at 0x%04x", virtual_ ? "callvirt" : "call", ctx->ip_offset)); if ((ctx->prefix_set & PREFIX_TAIL) && stack_slot_is_managed_pointer (value)) { - ADD_VERIFY_ERROR (ctx, g_strdup_printf ("Cannot pass a byref argument to a tail %s at 0x%04x", virtual ? "callvirt" : "call", ctx->ip_offset)); + ADD_VERIFY_ERROR (ctx, g_strdup_printf ("Cannot pass a byref argument to a tail %s at 0x%04x", virtual_ ? "callvirt" : "call", ctx->ip_offset)); return; } } @@ -3244,7 +3244,7 @@ do_invoke_method (VerifyContext *ctx, int method_token, gboolean virtual) if (virt_check_this && !stack_slot_is_this_pointer (value) && !(method->klass->valuetype || stack_slot_is_boxed_value (value))) CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Cannot use the call opcode with a non-final virtual method on an object different than the 'this' pointer at 0x%04x", ctx->ip_offset)); - if (constrained && virtual) { + if (constrained && virtual_) { if (!stack_slot_is_managed_pointer (value)) CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Object is not a managed pointer for a constrained call at 0x%04x", ctx->ip_offset)); if (!mono_metadata_type_equal_full (mono_type_get_type_byval (value->type), mono_type_get_underlying_type (ctx->constrained_type), TRUE)) @@ -3255,10 +3255,10 @@ do_invoke_method (VerifyContext *ctx, int method_token, gboolean virtual) if (stack_slot_is_managed_pointer (value) && !mono_class_from_mono_type (value->type)->valuetype) CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Cannot call a reference type using a managed pointer to the this arg at 0x%04x", ctx->ip_offset)); - if (!virtual && mono_class_from_mono_type (value->type)->valuetype && !method->klass->valuetype && !stack_slot_is_boxed_value (value)) + if (!virtual_ && mono_class_from_mono_type (value->type)->valuetype && !method->klass->valuetype && !stack_slot_is_boxed_value (value)) CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Cannot call a valuetype baseclass at 0x%04x", ctx->ip_offset)); - if (virtual && mono_class_from_mono_type (value->type)->valuetype && !stack_slot_is_boxed_value (value)) + if (virtual_ && mono_class_from_mono_type (value->type)->valuetype && !stack_slot_is_boxed_value (value)) CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Cannot use a valuetype with callvirt at 0x%04x", ctx->ip_offset)); if (method->klass->valuetype && (stack_slot_is_boxed_value (value) || !stack_slot_is_managed_pointer (value))) @@ -3627,7 +3627,7 @@ do_load_token (VerifyContext *ctx, int token) if (ctx->method->wrapper_type != MONO_WRAPPER_NONE) { handle = mono_method_get_wrapper_data (ctx->method, token); - handle_class = mono_method_get_wrapper_data (ctx->method, token + 1); + handle_class = (MonoClass *)mono_method_get_wrapper_data (ctx->method, token + 1); if (handle_class == mono_defaults.typehandle_class) handle = &((MonoClass*)handle)->byval_arg; } else { @@ -4353,19 +4353,19 @@ do_switch (VerifyContext *ctx, int count, const unsigned char *data) } static void -do_load_function_ptr (VerifyContext *ctx, guint32 token, gboolean virtual) +do_load_function_ptr (VerifyContext *ctx, guint32 token, gboolean virtual_) { ILStackDesc *top; MonoMethod *method; - if (virtual && !check_underflow (ctx, 1)) + if (virtual_ && !check_underflow (ctx, 1)) return; - if (!virtual && !check_overflow (ctx)) + if (!virtual_ && !check_overflow (ctx)) return; if (ctx->method->wrapper_type != MONO_WRAPPER_NONE) { - method = mono_method_get_wrapper_data (ctx->method, (guint32)token); + method = (MonoMethod *)mono_method_get_wrapper_data (ctx->method, (guint32)token); if (!method) { ADD_VERIFY_ERROR2 (ctx, g_strdup_printf ("Invalid token %x for ldftn at 0x%04x", token, ctx->ip_offset), MONO_EXCEPTION_BAD_IMAGE); return; @@ -4376,14 +4376,14 @@ do_load_function_ptr (VerifyContext *ctx, guint32 token, gboolean virtual) return; } - if (!(method = verifier_load_method (ctx, token, virtual ? "ldvirtfrn" : "ldftn"))) + if (!(method = verifier_load_method (ctx, token, virtual_ ? "ldvirtfrn" : "ldftn"))) return; } if (mono_method_is_constructor (method)) CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Cannot use ldftn with a constructor at 0x%04x", ctx->ip_offset)); - if (virtual) { + if (virtual_) { ILStackDesc *top = stack_pop (ctx); if (stack_slot_get_type (top) != TYPE_COMPLEX || top->type->type == MONO_TYPE_VALUETYPE) @@ -4886,7 +4886,7 @@ mono_method_verify (MonoMethod *method, int level) memset(ctx.code, 0, sizeof (ILCodeDesc) * ctx.header->code_size); ctx.num_locals = ctx.header->num_locals; - ctx.locals = g_memdup (ctx.header->locals, sizeof (MonoType*) * ctx.header->num_locals); + ctx.locals = (MonoType **)g_memdup (ctx.header->locals, sizeof (MonoType*) * ctx.header->num_locals); _MEM_ALLOC (sizeof (MonoType*) * ctx.header->num_locals); if (ctx.num_locals > 0 && !ctx.header->init_locals) @@ -5988,7 +5988,7 @@ cleanup: g_slist_free (ctx.funptrs); for (tmp = ctx.exception_types; tmp; tmp = tmp->next) - mono_metadata_free_type (tmp->data); + mono_metadata_free_type ((MonoType *)tmp->data); g_slist_free (ctx.exception_types); for (i = 0; i < ctx.num_locals; ++i) { @@ -6137,15 +6137,15 @@ verify_class_for_overlapping_reference_fields (MonoClass *klass) static guint field_hash (gconstpointer key) { - const MonoClassField *field = key; + const MonoClassField *field = (const MonoClassField *)key; return g_str_hash (field->name) ^ mono_metadata_type_hash (field->type); /**/ } static gboolean field_equals (gconstpointer _a, gconstpointer _b) { - const MonoClassField *a = _a; - const MonoClassField *b = _b; + const MonoClassField *a = (const MonoClassField *)_a; + const MonoClassField *b = (const MonoClassField *)_b; return !strcmp (a->name, b->name) && mono_metadata_type_equal (a->type, b->type); } diff --git a/mono/mini/Makefile.am.in b/mono/mini/Makefile.am.in index d9fa2e2c9c3..348cfcf6f8d 100755 --- a/mono/mini/Makefile.am.in +++ b/mono/mini/Makefile.am.in @@ -147,7 +147,7 @@ endif if LOADED_LLVM lib_LTLIBRARIES += libmono-llvm.la -libmono_llvm_la_SOURCES = mini-llvm.c mini-llvm-cpp.cpp +libmono_llvm_la_SOURCES = mini-llvm.c mini-llvm-cpp.cpp llvm-jit.cpp libmono_llvm_la_LIBADD = $(GLIB_LIBS) $(LLVM_LIBS) $(LLVM_LDFLAGS) if PLATFORM_DARWIN libmono_llvm_la_LDFLAGS=-Wl,-undefined -Wl,suppress -Wl,-flat_namespace @@ -363,7 +363,8 @@ else llvm_sources = \ mini-llvm.c \ mini-llvm-loaded.c \ - mini-llvm-cpp.cpp + mini-llvm-cpp.cpp \ + llvm-jit.cpp endif endif diff --git a/mono/mini/abcremoval.c b/mono/mini/abcremoval.c index 45d5394a667..fddbef9d9cb 100644 --- a/mono/mini/abcremoval.c +++ b/mono/mini/abcremoval.c @@ -62,8 +62,8 @@ static int verbose_level; (r)->next = NULL;\ } while (0) -#define MONO_NEGATED_RELATION(r) ((~(r))&MONO_ANY_RELATION) -#define MONO_SYMMETRIC_RELATION(r) (((r)&MONO_EQ_RELATION)|(((r)&MONO_LT_RELATION)<<1)|((r&MONO_GT_RELATION)>>1)) +#define MONO_NEGATED_RELATION(r) ((MonoValueRelation)((~(r))&MONO_ANY_RELATION)) +#define MONO_SYMMETRIC_RELATION(r) ((MonoValueRelation)(((r)&MONO_EQ_RELATION)|(((r)&MONO_LT_RELATION)<<1)|((r&MONO_GT_RELATION)>>1))) @@ -905,7 +905,7 @@ evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *are current_context = father_context; while (current_context != last_context) { - current_context->status |= recursive_status; + current_context->status = (MonoRelationsEvaluationStatus)(current_context->status | recursive_status); current_context = current_context->father; } } else { @@ -1029,7 +1029,7 @@ add_non_null (MonoVariableRelationsEvaluationArea *area, MonoCompile *cfg, int r { MonoAdditionalVariableRelation *rel; - rel = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoAdditionalVariableRelation)); + rel = (MonoAdditionalVariableRelation *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoAdditionalVariableRelation)); rel->variable = reg; rel->relation.relation = MONO_GT_RELATION; rel->relation.related_value.type = MONO_CONSTANT_SUMMARIZED_VALUE; @@ -1106,7 +1106,7 @@ process_block (MonoCompile *cfg, MonoBasicBlock *bb, MonoVariableRelationsEvalua /* We can derive additional relations from the bounds check */ if (ins->opcode != OP_NOP) { - rel = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoAdditionalVariableRelation)); + rel = (MonoAdditionalVariableRelation *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoAdditionalVariableRelation)); rel->variable = index_var; rel->relation.relation = MONO_LT_RELATION; rel->relation.related_value.type = MONO_VARIABLE_SUMMARIZED_VALUE; @@ -1117,7 +1117,7 @@ process_block (MonoCompile *cfg, MonoBasicBlock *bb, MonoVariableRelationsEvalua check_relations = g_slist_append_mempool (cfg->mempool, check_relations, rel); - rel = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoAdditionalVariableRelation)); + rel = (MonoAdditionalVariableRelation *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoAdditionalVariableRelation)); rel->variable = index_var; rel->relation.relation = MONO_GE_RELATION; rel->relation.related_value.type = MONO_CONSTANT_SUMMARIZED_VALUE; @@ -1193,7 +1193,7 @@ process_block (MonoCompile *cfg, MonoBasicBlock *bb, MonoVariableRelationsEvalua } for (l = check_relations; l; l = l->next) - remove_change_from_evaluation_area (l->data); + remove_change_from_evaluation_area ((MonoAdditionalVariableRelation *)l->data); remove_change_from_evaluation_area (&(additional_relations.relation1)); remove_change_from_evaluation_area (&(additional_relations.relation2)); @@ -1224,10 +1224,10 @@ type_to_value_kind (MonoType *type) return MONO_UNSIGNED_INTEGER_VALUE_SIZE_4; break; case MONO_TYPE_I: - return SIZEOF_VOID_P; + return (MonoIntegerValueKind)SIZEOF_VOID_P; break; case MONO_TYPE_U: - return (MONO_UNSIGNED_VALUE_FLAG|SIZEOF_VOID_P); + return (MonoIntegerValueKind)(MONO_UNSIGNED_VALUE_FLAG | SIZEOF_VOID_P); break; case MONO_TYPE_I8: return MONO_INTEGER_VALUE_SIZE_8; @@ -1275,7 +1275,7 @@ mono_perform_abc_removal (MonoCompile *cfg) mono_mempool_alloc (cfg->mempool, sizeof (MonoRelationsEvaluationContext) * (cfg->next_vreg)); area.variable_value_kind = (MonoIntegerValueKind *) mono_mempool_alloc (cfg->mempool, sizeof (MonoIntegerValueKind) * (cfg->next_vreg)); - area.defs = mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * cfg->next_vreg); + area.defs = (MonoInst **)mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * cfg->next_vreg); for (i = 0; i < cfg->next_vreg; i++) { area.variable_value_kind [i] = MONO_UNKNOWN_INTEGER_VALUE; area.relations [i].relation = MONO_EQ_RELATION; diff --git a/mono/mini/alias-analysis.c b/mono/mini/alias-analysis.c index c260dae2c7a..f40070aeb38 100644 --- a/mono/mini/alias-analysis.c +++ b/mono/mini/alias-analysis.c @@ -40,7 +40,7 @@ is_long_stack_size (int type) static gboolean lower_load (MonoCompile *cfg, MonoInst *load, MonoInst *ldaddr) { - MonoInst *var = ldaddr->inst_p0; + MonoInst *var = (MonoInst *)ldaddr->inst_p0; MonoType *type = &var->klass->byval_arg; int replaced_op = mono_type_to_load_membase (cfg, type); @@ -70,7 +70,7 @@ lower_load (MonoCompile *cfg, MonoInst *load, MonoInst *ldaddr) static gboolean lower_store (MonoCompile *cfg, MonoInst *store, MonoInst *ldaddr) { - MonoInst *var = ldaddr->inst_p0; + MonoInst *var = (MonoInst *)ldaddr->inst_p0; MonoType *type = &var->klass->byval_arg; int replaced_op = mono_type_to_store_membase (cfg, type); @@ -101,7 +101,7 @@ lower_store (MonoCompile *cfg, MonoInst *store, MonoInst *ldaddr) static gboolean lower_store_imm (MonoCompile *cfg, MonoInst *store, MonoInst *ldaddr) { - MonoInst *var = ldaddr->inst_p0; + MonoInst *var = (MonoInst *)ldaddr->inst_p0; MonoType *type = &var->klass->byval_arg; int store_op = mono_type_to_store_membase (cfg, type); if (store_op == OP_STOREV_MEMBASE || store_op == OP_STOREX_MEMBASE) @@ -195,7 +195,7 @@ handle_instruction: case OP_LOADR8_MEMBASE: if (ins->inst_offset != 0) continue; - tmp = g_hash_table_lookup (addr_loads, GINT_TO_POINTER (ins->sreg1)); + tmp = (MonoInst *)g_hash_table_lookup (addr_loads, GINT_TO_POINTER (ins->sreg1)); if (tmp) { if (cfg->verbose_level > 2) { printf ("Found candidate load:"); mono_print_ins (ins); } if (lower_load (cfg, ins, tmp)) { @@ -216,7 +216,7 @@ handle_instruction: case OP_STOREV_MEMBASE: if (ins->inst_offset != 0) continue; - tmp = g_hash_table_lookup (addr_loads, GINT_TO_POINTER (ins->dreg)); + tmp = (MonoInst *)g_hash_table_lookup (addr_loads, GINT_TO_POINTER (ins->dreg)); if (tmp) { if (cfg->verbose_level > 2) { printf ("Found candidate store:"); mono_print_ins (ins); } if (lower_store (cfg, ins, tmp)) { @@ -232,7 +232,7 @@ handle_instruction: case OP_STOREI8_MEMBASE_IMM: if (ins->inst_offset != 0) continue; - tmp = g_hash_table_lookup (addr_loads, GINT_TO_POINTER (ins->dreg)); + tmp = (MonoInst *)g_hash_table_lookup (addr_loads, GINT_TO_POINTER (ins->dreg)); if (tmp) { if (cfg->verbose_level > 2) { printf ("Found candidate store-imm:"); mono_print_ins (ins); } needs_dce |= lower_store_imm (cfg, ins, tmp); @@ -240,7 +240,7 @@ handle_instruction: break; case OP_CHECK_THIS: case OP_NOT_NULL: - tmp = g_hash_table_lookup (addr_loads, GINT_TO_POINTER (ins->sreg1)); + tmp = (MonoInst *)g_hash_table_lookup (addr_loads, GINT_TO_POINTER (ins->sreg1)); if (tmp) { if (cfg->verbose_level > 2) { printf ("Found null check over local: "); mono_print_ins (ins); } NULLIFY_INS (ins); diff --git a/mono/mini/aot-compiler.c b/mono/mini/aot-compiler.c index 49fb87c222d..20a63a6c927 100644 --- a/mono/mini/aot-compiler.c +++ b/mono/mini/aot-compiler.c @@ -251,8 +251,8 @@ typedef struct { gboolean jit_used, llvm_used; } MonoPltEntry; -#define mono_acfg_lock(acfg) mono_mutex_lock (&((acfg)->mutex)) -#define mono_acfg_unlock(acfg) mono_mutex_unlock (&((acfg)->mutex)) +#define mono_acfg_lock(acfg) mono_os_mutex_lock (&((acfg)->mutex)) +#define mono_acfg_unlock(acfg) mono_os_mutex_unlock (&((acfg)->mutex)) /* This points to the current acfg in LLVM mode */ static MonoAotCompile *llvm_acfg; @@ -1858,7 +1858,7 @@ arch_emit_imt_thunk (MonoAotCompile *acfg, int offset, int *tramp_size) const int kSizeOfMove = 7; #if defined(__default_codegen__) - code = buf = g_malloc (256); + code = buf = (guint8 *)g_malloc (256); #elif defined(__native_client_codegen__) buf_alloc = g_malloc (256 + kNaClAlignment + kSizeOfMove); buf = ((guint)buf_alloc + kNaClAlignment) & ~kNaClAlignmentMask; @@ -2252,7 +2252,7 @@ stream_init (MonoDynamicStream *sh) { sh->index = 0; sh->alloc_size = 4096; - sh->data = g_malloc (4096); + sh->data = (char *)g_malloc (4096); /* So offsets are > 0 */ sh->data [0] = 0; @@ -2272,7 +2272,7 @@ make_room_in_stream (MonoDynamicStream *stream, int size) stream->alloc_size *= 2; } - stream->data = g_realloc (stream->data, stream->alloc_size); + stream->data = (char *)g_realloc (stream->data, stream->alloc_size); } static guint32 @@ -2342,7 +2342,7 @@ emit_offset_table (MonoAotCompile *acfg, const char *symbol, int noffsets, int g index_offsets = g_new0 (guint32, ngroups); buf_size = noffsets * 4; - p = buf = g_malloc0 (buf_size); + p = buf = (guint8 *)g_malloc0 (buf_size); current_offset = 0; for (i = 0; i < noffsets; ++i) { @@ -2367,7 +2367,7 @@ emit_offset_table (MonoAotCompile *acfg, const char *symbol, int noffsets, int g index_entry_size = 4; buf_size = (data_p - data_buf) + (ngroups * 4) + 16; - p = buf = g_malloc0 (buf_size); + p = buf = (guint8 *)g_malloc0 (buf_size); /* Emit the header */ encode_int (noffsets, p, &p); @@ -2427,7 +2427,7 @@ find_typespec_for_class (MonoAotCompile *acfg, MonoClass *klass) /* FIXME: Search referenced images as well */ if (!acfg->typespec_classes) { - acfg->typespec_classes = mono_mempool_alloc0 (acfg->mempool, sizeof (MonoClass*) * len); + acfg->typespec_classes = (MonoClass **)mono_mempool_alloc0 (acfg->mempool, sizeof (MonoClass*) * len); for (i = 0; i < len; ++i) { MonoError error; acfg->typespec_classes [i] = mono_class_get_and_inflate_typespec_checked (acfg->image, MONO_TOKEN_TYPE_SPEC | (i + 1), NULL, &error); @@ -2505,23 +2505,24 @@ encode_klass_ref_inner (MonoAotCompile *acfg, MonoClass *klass, guint8 *buf, gui MonoGenericParam *par = klass->byval_arg.data.generic_param; encode_value (MONO_AOT_TYPEREF_VAR, p, &p); - encode_value (klass->byval_arg.type, p, &p); - encode_value (mono_type_get_generic_param_num (&klass->byval_arg), p, &p); - - encode_value (container ? 1 : 0, p, &p); - if (container) { - encode_value (container->is_method, p, &p); - g_assert (!par->gshared_constraint); - if (container->is_method) - encode_method_ref (acfg, container->owner.method, p, &p); - else - encode_klass_ref (acfg, container->owner.klass, p, &p); + + encode_value (par->gshared_constraint ? 1 : 0, p, &p); + if (par->gshared_constraint) { + MonoGSharedGenericParam *gpar = (MonoGSharedGenericParam*)par; + encode_type (acfg, par->gshared_constraint, p, &p); + encode_klass_ref (acfg, mono_class_from_generic_parameter (gpar->parent, NULL, klass->byval_arg.type == MONO_TYPE_MVAR), p, &p); } else { - encode_value (par->gshared_constraint ? 1 : 0, p, &p); - if (par->gshared_constraint) { - MonoGSharedGenericParam *gpar = (MonoGSharedGenericParam*)par; - encode_type (acfg, par->gshared_constraint, p, &p); - encode_klass_ref (acfg, mono_class_from_generic_parameter (gpar->parent, NULL, klass->byval_arg.type == MONO_TYPE_MVAR), p, &p); + encode_value (klass->byval_arg.type, p, &p); + encode_value (mono_type_get_generic_param_num (&klass->byval_arg), p, &p); + + encode_value (container->is_anonymous ? 0 : 1, p, &p); + + if (!container->is_anonymous) { + encode_value (container->is_method, p, &p); + if (container->is_method) + encode_method_ref (acfg, container->owner.method, p, &p); + else + encode_klass_ref (acfg, container->owner.klass, p, &p); } } } else if (klass->byval_arg.type == MONO_TYPE_PTR) { @@ -2568,7 +2569,7 @@ encode_klass_ref (MonoAotCompile *acfg, MonoClass *klass, guint8 *buf, guint8 ** guint8 *buf2, *p; if (!offset) { - buf2 = g_malloc (1024); + buf2 = (guint8 *)g_malloc (1024); p = buf2; encode_klass_ref_inner (acfg, klass, p, &p); @@ -2926,7 +2927,7 @@ encode_method_ref (MonoAotCompile *acfg, MonoMethod *method, guint8 *buf, guint8 * encode that. * Obtain the token from information recorded by the JIT. */ - ji = g_hash_table_lookup (acfg->token_info_hash, method); + ji = (MonoJumpInfoToken *)g_hash_table_lookup (acfg->token_info_hash, method); if (ji) { image_index = get_image_index (acfg, ji->image); g_assert (image_index < MAX_IMAGE_INDEX); @@ -2963,7 +2964,7 @@ encode_method_ref (MonoAotCompile *acfg, MonoMethod *method, guint8 *buf, guint8 } else if (token == 0) { /* This might be a method of a constructed type like int[,].Set */ /* Obtain the token from information recorded by the JIT */ - ji = g_hash_table_lookup (acfg->token_info_hash, method); + ji = (MonoJumpInfoToken *)g_hash_table_lookup (acfg->token_info_hash, method); if (ji) { image_index = get_image_index (acfg, ji->image); g_assert (image_index < MAX_IMAGE_INDEX); @@ -3058,7 +3059,6 @@ is_plt_patch (MonoJumpInfo *patch_info) case MONO_PATCH_INFO_JIT_ICALL_ADDR: case MONO_PATCH_INFO_ICALL_ADDR: case MONO_PATCH_INFO_RGCTX_FETCH: - case MONO_PATCH_INFO_LLVM_IMT_TRAMPOLINE: return TRUE; default: return FALSE; @@ -3101,7 +3101,7 @@ get_plt_entry (MonoAotCompile *acfg, MonoJumpInfo *patch_info) if (!acfg->patch_to_plt_entry [patch_info->type]) acfg->patch_to_plt_entry [patch_info->type] = g_hash_table_new (mono_patch_info_hash, mono_patch_info_equal); - res = g_hash_table_lookup (acfg->patch_to_plt_entry [patch_info->type], patch_info); + res = (MonoPltEntry *)g_hash_table_lookup (acfg->patch_to_plt_entry [patch_info->type], patch_info); if (!acfg->llvm && patch_info->type == MONO_PATCH_INFO_METHOD && (patch_info->data.method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)) { /* @@ -3118,7 +3118,7 @@ get_plt_entry (MonoAotCompile *acfg, MonoJumpInfo *patch_info) new_ji = mono_patch_info_dup_mp (acfg->mempool, patch_info); - res = mono_mempool_alloc0 (acfg->mempool, sizeof (MonoPltEntry)); + res = (MonoPltEntry *)mono_mempool_alloc0 (acfg->mempool, sizeof (MonoPltEntry)); res->plt_offset = acfg->plt_offset; res->ji = new_ji; res->symbol = get_plt_symbol (acfg, res->plt_offset, patch_info); @@ -3270,8 +3270,8 @@ add_extra_method (MonoAotCompile *acfg, MonoMethod *method) static void add_jit_icall_wrapper (gpointer key, gpointer value, gpointer user_data) { - MonoAotCompile *acfg = user_data; - MonoJitICallInfo *callinfo = value; + MonoAotCompile *acfg = (MonoAotCompile *)user_data; + MonoJitICallInfo *callinfo = (MonoJitICallInfo *)value; MonoMethod *wrapper; char *name; @@ -3297,9 +3297,9 @@ get_runtime_invoke_sig (MonoMethodSignature *sig) } static MonoMethod* -get_runtime_invoke (MonoAotCompile *acfg, MonoMethod *method, gboolean virtual) +get_runtime_invoke (MonoAotCompile *acfg, MonoMethod *method, gboolean virtual_) { - return mono_marshal_get_runtime_invoke (method, virtual, acfg->aot_opts.llvm_only && mono_method_needs_static_rgctx_invoke (method, TRUE)); + return mono_marshal_get_runtime_invoke (method, virtual_, acfg->aot_opts.llvm_only && mono_method_needs_static_rgctx_invoke (method, TRUE)); } static gboolean @@ -3863,7 +3863,7 @@ add_wrappers (MonoAotCompile *acfg) /* From load_cattr_value () in reflection.c */ slen = mono_metadata_decode_value (p, &p); - n = g_memdup (p, slen + 1); + n = (char *)g_memdup (p, slen + 1); n [slen] = 0; t = mono_reflection_type_from_name (n, acfg->image); g_assert (t); @@ -3890,7 +3890,7 @@ add_wrappers (MonoAotCompile *acfg) named += 1; name_len = mono_metadata_decode_blob_size (named, &named); - name = g_malloc (name_len + 1); + name = (char *)g_malloc (name_len + 1); memcpy (name, named, name_len); name [name_len] = 0; named += name_len; @@ -3901,7 +3901,7 @@ add_wrappers (MonoAotCompile *acfg) /* load_cattr_value (), string case */ g_assert (*named != (char)0xff); slen = mono_metadata_decode_value (named, &named); - export_name = g_malloc (slen + 1); + export_name = (char *)g_malloc (slen + 1); memcpy (export_name, named, slen); export_name [slen] = 0; named += slen; @@ -4453,7 +4453,7 @@ add_generic_instances (MonoAotCompile *acfg) /* Add types of args/locals */ for (i = 0; i < acfg->methods->len; ++i) { - method = g_ptr_array_index (acfg->methods, i); + method = (MonoMethod *)g_ptr_array_index (acfg->methods, i); add_types_from_method_header (acfg, method); } @@ -4483,24 +4483,39 @@ add_generic_instances (MonoAotCompile *acfg) if (klass) add_instances_of (acfg, klass, insts, ninsts, TRUE); - /* Add an instance of LongEnumEqualityComparer which is created by EqualityComparer for enums */ + /* Add instances of EnumEqualityComparer which are created by EqualityComparer for enums */ { MonoClass *enum_comparer; - MonoGenericContext ctx; - MonoType *args [16]; + MonoType *insts [16]; + int ninsts; + + ninsts = 0; + insts [ninsts ++] = &mono_defaults.int32_class->byval_arg; + insts [ninsts ++] = &mono_defaults.uint32_class->byval_arg; + insts [ninsts ++] = &mono_defaults.uint16_class->byval_arg; + insts [ninsts ++] = &mono_defaults.byte_class->byval_arg; + enum_comparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "EnumEqualityComparer`1"); + g_assert (enum_comparer); + add_instances_of (acfg, enum_comparer, insts, ninsts, FALSE); - enum_comparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "LongEnumEqualityComparer`1"); + ninsts = 0; + insts [ninsts ++] = &mono_defaults.int16_class->byval_arg; + enum_comparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "ShortEnumEqualityComparer`1"); g_assert (enum_comparer); + add_instances_of (acfg, enum_comparer, insts, ninsts, FALSE); - memset (&ctx, 0, sizeof (ctx)); - args [0] = &mono_defaults.int64_class->byval_arg; - ctx.class_inst = mono_metadata_get_generic_inst (1, args); - add_generic_class (acfg, mono_class_inflate_generic_class (enum_comparer, &ctx), FALSE, "EqualityComparer"); + ninsts = 0; + insts [ninsts ++] = &mono_defaults.sbyte_class->byval_arg; + enum_comparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "SByteEnumEqualityComparer`1"); + g_assert (enum_comparer); + add_instances_of (acfg, enum_comparer, insts, ninsts, FALSE); - memset (&ctx, 0, sizeof (ctx)); - args [0] = &mono_defaults.uint64_class->byval_arg; - ctx.class_inst = mono_metadata_get_generic_inst (1, args); - add_generic_class (acfg, mono_class_inflate_generic_class (enum_comparer, &ctx), FALSE, "EqualityComparer"); + enum_comparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "LongEnumEqualityComparer`1"); + g_assert (enum_comparer); + ninsts = 0; + insts [ninsts ++] = &mono_defaults.int64_class->byval_arg; + insts [ninsts ++] = &mono_defaults.uint64_class->byval_arg; + add_instances_of (acfg, enum_comparer, insts, ninsts, FALSE); } /* Add instances of the array generic interfaces for primitive types */ @@ -4615,7 +4630,7 @@ static gboolean is_direct_callable (MonoAotCompile *acfg, MonoMethod *method, MonoJumpInfo *patch_info) { if ((patch_info->type == MONO_PATCH_INFO_METHOD) && (patch_info->data.method->klass->image == acfg->image)) { - MonoCompile *callee_cfg = g_hash_table_lookup (acfg->method_to_cfg, patch_info->data.method); + MonoCompile *callee_cfg = (MonoCompile *)g_hash_table_lookup (acfg->method_to_cfg, patch_info->data.method); if (callee_cfg) { gboolean direct_callable = TRUE; @@ -4667,7 +4682,7 @@ get_pinvoke_import (MonoAotCompile *acfg, MonoMethod *method) guint32 im_cols [MONO_IMPLMAP_SIZE]; char *import; - import = g_hash_table_lookup (acfg->method_to_pinvoke_import, method); + import = (char *)g_hash_table_lookup (acfg->method_to_pinvoke_import, method); if (import != NULL) return import; @@ -4727,7 +4742,7 @@ compute_line_numbers (MonoMethod *method, int code_size, MonoDebugMethodJitInfo ln_array = g_new0 (MonoDebugLineNumberEntry, debug_info->num_line_numbers); memcpy (ln_array, debug_info->line_numbers, debug_info->num_line_numbers * sizeof (MonoDebugLineNumberEntry)); - qsort (ln_array, debug_info->num_line_numbers, sizeof (MonoDebugLineNumberEntry), (gpointer)compare_lne); + qsort (ln_array, debug_info->num_line_numbers, sizeof (MonoDebugLineNumberEntry), (int (*)(const void *, const void *))compare_lne); native_to_il_offset = g_new0 (int, code_size + 1); @@ -4848,7 +4863,7 @@ emit_and_reloc_code (MonoAotCompile *acfg, MonoMethod *method, guint8 *code, gui for (i = 0; i < code_len; i += INST_LEN) { patch_info = NULL; for (pindex = start_index; pindex < patches->len; ++pindex) { - patch_info = g_ptr_array_index (patches, pindex); + patch_info = (MonoJumpInfo *)g_ptr_array_index (patches, pindex); if (patch_info->ip.i >= i) break; } @@ -4882,7 +4897,7 @@ emit_and_reloc_code (MonoAotCompile *acfg, MonoMethod *method, guint8 *code, gui } case MONO_PATCH_INFO_OBJC_SELECTOR_REF: { int code_size, index; - char *selector = (void*)patch_info->data.target; + char *selector = (char *)patch_info->data.target; if (!acfg->objc_selector_to_index) acfg->objc_selector_to_index = g_hash_table_new (g_str_hash, g_str_equal); @@ -4914,7 +4929,7 @@ emit_and_reloc_code (MonoAotCompile *acfg, MonoMethod *method, guint8 *code, gui external_call = FALSE; if ((patch_info->type == MONO_PATCH_INFO_METHOD) && (patch_info->data.method->klass->image == acfg->image)) { if (!got_only && is_direct_callable (acfg, method, patch_info)) { - MonoCompile *callee_cfg = g_hash_table_lookup (acfg->method_to_cfg, patch_info->data.method); + MonoCompile *callee_cfg = (MonoCompile *)g_hash_table_lookup (acfg->method_to_cfg, patch_info->data.method); //printf ("DIRECT: %s %s\n", method ? mono_method_full_name (method, TRUE) : "", mono_method_full_name (callee_cfg->method, TRUE)); direct_call = TRUE; direct_call_target = callee_cfg->asm_symbol; @@ -4997,7 +5012,7 @@ emit_and_reloc_code (MonoAotCompile *acfg, MonoMethod *method, guint8 *code, gui /* Find next patch */ patch_info = NULL; for (pindex = start_index; pindex < patches->len; ++pindex) { - patch_info = g_ptr_array_index (patches, pindex); + patch_info = (MonoJumpInfo *)g_ptr_array_index (patches, pindex); if (patch_info->ip.i >= i) break; } @@ -5088,7 +5103,7 @@ get_debug_sym (MonoMethod *method, const char *prefix, GHashTable *cache) #endif len = strlen (name1); - name2 = malloc (strlen (prefix) + len + 16); + name2 = (char *)malloc (strlen (prefix) + len + 16); memcpy (name2, prefix, strlen (prefix)); j = strlen (prefix); for (i = 0; i < len; ++i) { @@ -5111,7 +5126,7 @@ get_debug_sym (MonoMethod *method, const char *prefix, GHashTable *cache) count = 0; while (TRUE) { - cached_method = g_hash_table_lookup (cache, name2); + cached_method = (MonoMethod *)g_hash_table_lookup (cache, name2); if (!(cached_method && cached_method != method)) break; sprintf (name2 + j, "_%d", count); @@ -5166,7 +5181,7 @@ emit_method_code (MonoAotCompile *acfg, MonoCompile *cfg) emit_label (acfg, debug_sym); } - export_name = g_hash_table_lookup (acfg->export_names, method); + export_name = (char *)g_hash_table_lookup (acfg->export_names, method); if (export_name) { /* Emit a global symbol for the method */ emit_global_inner (acfg, export_name, TRUE); @@ -5278,7 +5293,7 @@ encode_patch (MonoAotCompile *acfg, MonoJumpInfo *patch_info, guint8 *buf, guint ex_class = mono_class_from_name (mono_defaults.exception_class->image, - "System", patch_info->data.target); + "System", (const char *)patch_info->data.target); g_assert (ex_class); encode_klass_ref (acfg, ex_class, p, &p); break; @@ -5324,7 +5339,7 @@ encode_patch (MonoAotCompile *acfg, MonoJumpInfo *patch_info, guint8 *buf, guint */ offset = GPOINTER_TO_UINT (g_hash_table_lookup (acfg->method_blob_hash, entry->method)); if (!offset) { - buf2 = g_malloc (1024); + buf2 = (guint8 *)g_malloc (1024); p2 = buf2; encode_method_ref (acfg, entry->method, p2, &p2); @@ -5348,10 +5363,6 @@ encode_patch (MonoAotCompile *acfg, MonoJumpInfo *patch_info, guint8 *buf, guint case MONO_PATCH_INFO_SEQ_POINT_INFO: case MONO_PATCH_INFO_AOT_MODULE: break; - case MONO_PATCH_INFO_LLVM_IMT_TRAMPOLINE: - encode_method_ref (acfg, patch_info->data.imt_tramp->method, p, &p); - encode_value (patch_info->data.imt_tramp->vt_offset, p, &p); - break; case MONO_PATCH_INFO_SIGNATURE: encode_signature (acfg, (MonoMethodSignature*)patch_info->data.target, p, &p); break; @@ -5369,15 +5380,15 @@ encode_patch (MonoAotCompile *acfg, MonoJumpInfo *patch_info, guint8 *buf, guint encode_method_ref (acfg, info->method, p, &p); encode_value (info->num_entries, p, &p); for (i = 0; i < info->num_entries; ++i) { - MonoRuntimeGenericContextInfoTemplate *template = &info->entries [i]; + MonoRuntimeGenericContextInfoTemplate *template_ = &info->entries [i]; - encode_value (template->info_type, p, &p); - switch (mini_rgctx_info_type_to_patch_info_type (template->info_type)) { + encode_value (template_->info_type, p, &p); + switch (mini_rgctx_info_type_to_patch_info_type (template_->info_type)) { case MONO_PATCH_INFO_CLASS: - encode_klass_ref (acfg, mono_class_from_mono_type (template->data), p, &p); + encode_klass_ref (acfg, mono_class_from_mono_type ((MonoType *)template_->data), p, &p); break; case MONO_PATCH_INFO_FIELD: - encode_field_info (acfg, template->data, p, &p); + encode_field_info (acfg, (MonoClassField *)template_->data, p, &p); break; default: g_assert_not_reached (); @@ -5387,7 +5398,7 @@ encode_patch (MonoAotCompile *acfg, MonoJumpInfo *patch_info, guint8 *buf, guint break; } case MONO_PATCH_INFO_LDSTR_LIT: { - const char *s = patch_info->data.target; + const char *s = (const char *)patch_info->data.target; int len = strlen (s); encode_value (len, p, &p); @@ -5419,7 +5430,7 @@ encode_patch_list (MonoAotCompile *acfg, GPtrArray *patches, int n_patches, gboo encode_value (n_patches, p, &p); for (pindex = 0; pindex < patches->len; ++pindex) { - patch_info = g_ptr_array_index (patches, pindex); + patch_info = (MonoJumpInfo *)g_ptr_array_index (patches, pindex); if (patch_info->type == MONO_PATCH_INFO_NONE || patch_info->type == MONO_PATCH_INFO_BB) /* Nothing to do */ @@ -5460,7 +5471,7 @@ emit_method_info (MonoAotCompile *acfg, MonoCompile *cfg) /**********************/ buf_size = (patches->len < 1000) ? 40960 : 40960 + (patches->len * 64); - p = buf = g_malloc (buf_size); + p = buf = (guint8 *)g_malloc (buf_size); if (mono_class_get_cctor (method->klass)) encode_klass_ref (acfg, method->klass, p, &p); @@ -5472,7 +5483,7 @@ emit_method_info (MonoAotCompile *acfg, MonoCompile *cfg) n_patches = 0; for (pindex = 0; pindex < patches->len; ++pindex) { - patch_info = g_ptr_array_index (patches, pindex); + patch_info = (MonoJumpInfo *)g_ptr_array_index (patches, pindex); if ((patch_info->type == MONO_PATCH_INFO_GOT_OFFSET) || (patch_info->type == MONO_PATCH_INFO_NONE)) { @@ -5579,7 +5590,7 @@ emit_exception_debug_info (MonoAotCompile *acfg, MonoCompile *cfg, gboolean stor buf_size = header->num_clauses * 256 + debug_info_size + 2048 + seq_points_size + cfg->gc_map_size; - p = buf = g_malloc (buf_size); + p = buf = (guint8 *)g_malloc (buf_size); use_unwind_ops = cfg->unwind_ops != NULL; @@ -5680,7 +5691,7 @@ emit_exception_debug_info (MonoAotCompile *acfg, MonoCompile *cfg, gboolean stor guint8 *buf2, *p2; int len; - buf2 = g_malloc (4096); + buf2 = (guint8 *)g_malloc (4096); p2 = buf2; encode_klass_ref (acfg, ei->data.catch_class, p2, &p2); len = p2 - buf2; @@ -5751,7 +5762,7 @@ emit_exception_debug_info (MonoAotCompile *acfg, MonoCompile *cfg, gboolean stor * Need to encode jinfo->method too, since it is not equal to 'method' * when using generic sharing. */ - buf2 = g_malloc (4096); + buf2 = (guint8 *)g_malloc (4096); p2 = buf2; encode_method_ref (acfg, jinfo->d.method, p2, &p2); len = p2 - buf2; @@ -5815,7 +5826,7 @@ emit_klass_info (MonoAotCompile *acfg, guint32 token) buf_size = 16; - p = buf = g_malloc (buf_size); + p = buf = (guint8 *)g_malloc (buf_size); /* Mark as unusable */ encode_value (-1, p, &p); @@ -5827,7 +5838,7 @@ emit_klass_info (MonoAotCompile *acfg, guint32 token) } buf_size = 10240 + (klass->vtable_size * 16); - p = buf = g_malloc (buf_size); + p = buf = (guint8 *)g_malloc (buf_size); g_assert (klass); @@ -5965,7 +5976,7 @@ emit_plt (MonoAotCompile *acfg) */ continue; - plt_entry = g_hash_table_lookup (acfg->plt_offset_to_entry, GUINT_TO_POINTER (i)); + plt_entry = (MonoPltEntry *)g_hash_table_lookup (acfg->plt_offset_to_entry, GUINT_TO_POINTER (i)); debug_sym = plt_entry->debug_sym; @@ -6019,7 +6030,7 @@ emit_plt (MonoAotCompile *acfg) if (i == 0) continue; - plt_entry = g_hash_table_lookup (acfg->plt_offset_to_entry, GUINT_TO_POINTER (i)); + plt_entry = (MonoPltEntry *)g_hash_table_lookup (acfg->plt_offset_to_entry, GUINT_TO_POINTER (i)); /* Skip plt entries not actually called by LLVM code */ if (!plt_entry->llvm_used) @@ -6128,7 +6139,7 @@ emit_trampoline_full (MonoAotCompile *acfg, int got_offset, MonoTrampInfo *info, g_ptr_array_sort (patches, compare_patches); buf_size = patches->len * 128 + 128; - buf = g_malloc (buf_size); + buf = (guint8 *)g_malloc (buf_size); p = buf; encode_patch_list (acfg, patches, patches->len, FALSE, got_offset, p, &p); @@ -6184,7 +6195,7 @@ emit_trampolines (MonoAotCompile *acfg) char symbol [256]; char end_symbol [256]; int i, tramp_got_offset; - MonoAotTrampoline ntype; + int ntype; #ifdef MONO_ARCH_HAVE_FULL_AOT_TRAMPOLINES int tramp_type; #endif @@ -6216,7 +6227,7 @@ emit_trampolines (MonoAotCompile *acfg) if (tramp_type == MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD) continue; #endif - mono_arch_create_generic_trampoline (tramp_type, &info, acfg->aot_opts.use_trampolines_page? 2: TRUE); + mono_arch_create_generic_trampoline ((MonoTrampolineType)tramp_type, &info, acfg->aot_opts.use_trampolines_page? 2: TRUE); emit_trampoline (acfg, acfg->got_offset, info); } @@ -6255,7 +6266,7 @@ emit_trampolines (MonoAotCompile *acfg) GSList *l = mono_arch_get_trampolines (TRUE); while (l) { - MonoTrampInfo *info = l->data; + MonoTrampInfo *info = (MonoTrampInfo *)l->data; emit_trampoline (acfg, acfg->got_offset, info); l = l->next; @@ -6286,7 +6297,7 @@ emit_trampolines (MonoAotCompile *acfg) /* delegate_invoke_impl trampolines */ l = mono_arch_get_delegate_invoke_impls (); while (l) { - MonoTrampInfo *info = l->data; + MonoTrampInfo *info = (MonoTrampInfo *)l->data; emit_trampoline (acfg, acfg->got_offset, info); l = l->next; @@ -6467,7 +6478,7 @@ add_readonly_value (MonoAotOptions *opts, const char *val) exit (1); } rdv = g_new0 (ReadOnlyValue, 1); - rdv->name = g_malloc0 (tval - val + 1); + rdv->name = (char *)g_malloc0 (tval - val + 1); memcpy (rdv->name, val, tval - val); tval++; fval++; @@ -6583,7 +6594,7 @@ mono_aot_parse_options (const char *aot_options, MonoAotOptions *opts) args = mono_aot_split_options (aot_options ? aot_options : ""); for (int i = 0; i < args->len; ++i) { - const char *arg = g_ptr_array_index (args, i); + const char *arg = (const char *)g_ptr_array_index (args, i); if (str_begins_with (arg, "outfile=")) { opts->outfile = g_strdup (arg + strlen ("outfile=")); @@ -6735,10 +6746,10 @@ add_token_info_hash (gpointer key, gpointer value, gpointer user_data) { MonoMethod *method = (MonoMethod*)key; MonoJumpInfoToken *ji = (MonoJumpInfoToken*)value; - MonoAotCompile *acfg = user_data; + MonoAotCompile *acfg = (MonoAotCompile *)user_data; MonoJumpInfoToken *new_ji; - new_ji = mono_mempool_alloc0 (acfg->mempool, sizeof (MonoJumpInfoToken)); + new_ji = (MonoJumpInfoToken *)mono_mempool_alloc0 (acfg->mempool, sizeof (MonoJumpInfoToken)); new_ji->image = ji->image; new_ji->token = ji->token; g_hash_table_insert (acfg->token_info_hash, method, new_ji); @@ -6913,13 +6924,13 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method) */ flags = JIT_FLAG_AOT; if (mono_aot_mode_is_full (&acfg->aot_opts)) - flags |= JIT_FLAG_FULL_AOT; + flags = (JitFlags)(flags | JIT_FLAG_FULL_AOT); if (acfg->llvm) - flags |= JIT_FLAG_LLVM; + flags = (JitFlags)(flags | JIT_FLAG_LLVM); if (acfg->aot_opts.llvm_only) - flags |= JIT_FLAG_LLVM_ONLY | JIT_FLAG_EXPLICIT_NULL_CHECKS; + flags = (JitFlags)(flags | JIT_FLAG_LLVM_ONLY | JIT_FLAG_EXPLICIT_NULL_CHECKS); if (acfg->aot_opts.no_direct_calls) - flags |= JIT_FLAG_NO_DIRECT_ICALLS; + flags = (JitFlags)(flags | JIT_FLAG_NO_DIRECT_ICALLS); cfg = mini_method_compile (method, acfg->opts, mono_get_root_domain (), flags, 0, index); mono_loader_clear_error (); @@ -7135,7 +7146,7 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method) unwind_ops = NULL; for (l = cfg->unwind_ops; l; l = l->next) { - op = mono_mempool_alloc (acfg->mempool, sizeof (MonoUnwindOp)); + op = (MonoUnwindOp *)mono_mempool_alloc (acfg->mempool, sizeof (MonoUnwindOp)); memcpy (op, l->data, sizeof (MonoUnwindOp)); unwind_ops = g_slist_prepend_mempool (acfg->mempool, unwind_ops, op); } @@ -7149,17 +7160,17 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method) int i; sig = mono_method_signature (method); - args = mono_mempool_alloc (acfg->mempool, sizeof (MonoInst*) * (sig->param_count + sig->hasthis)); + args = (MonoInst **)mono_mempool_alloc (acfg->mempool, sizeof (MonoInst*) * (sig->param_count + sig->hasthis)); for (i = 0; i < sig->param_count + sig->hasthis; ++i) { - args [i] = mono_mempool_alloc (acfg->mempool, sizeof (MonoInst)); + args [i] = (MonoInst *)mono_mempool_alloc (acfg->mempool, sizeof (MonoInst)); memcpy (args [i], cfg->args [i], sizeof (MonoInst)); } cfg->args = args; header = mono_method_get_header (method); - locals = mono_mempool_alloc (acfg->mempool, sizeof (MonoInst*) * header->num_locals); + locals = (MonoInst **)mono_mempool_alloc (acfg->mempool, sizeof (MonoInst*) * header->num_locals); for (i = 0; i < header->num_locals; ++i) { - locals [i] = mono_mempool_alloc (acfg->mempool, sizeof (MonoInst)); + locals [i] = (MonoInst *)mono_mempool_alloc (acfg->mempool, sizeof (MonoInst)); memcpy (locals [i], cfg->locals [i], sizeof (MonoInst)); } cfg->locals = locals; @@ -7207,15 +7218,15 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method) static void compile_thread_main (gpointer *user_data) { - MonoDomain *domain = user_data [0]; - MonoAotCompile *acfg = user_data [1]; - GPtrArray *methods = user_data [2]; + MonoDomain *domain = (MonoDomain *)user_data [0]; + MonoAotCompile *acfg = (MonoAotCompile *)user_data [1]; + GPtrArray *methods = (GPtrArray *)user_data [2]; int i; mono_thread_attach (domain); for (i = 0; i < methods->len; ++i) - compile_method (acfg, g_ptr_array_index (methods, i)); + compile_method (acfg, (MonoMethod *)g_ptr_array_index (methods, i)); } static void @@ -7359,9 +7370,9 @@ mono_aot_get_direct_call_symbol (MonoJumpInfoType type, gconstpointer data) if (llvm_acfg->aot_opts.direct_icalls) { if (type == MONO_PATCH_INFO_JIT_ICALL_ADDR) { /* Call to a C function implementing a jit icall */ - sym = mono_lookup_jit_icall_symbol (data); + sym = mono_lookup_jit_icall_symbol ((const char *)data); } else if (type == MONO_PATCH_INFO_ICALL_ADDR) { - MonoMethod *method = (gpointer)data; + MonoMethod *method = (MonoMethod *)data; if (!(method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)) sym = mono_lookup_icall_symbol (method); } @@ -7374,7 +7385,7 @@ mono_aot_get_direct_call_symbol (MonoJumpInfoType type, gconstpointer data) char* mono_aot_get_plt_symbol (MonoJumpInfoType type, gconstpointer data) { - MonoJumpInfo *ji = mono_mempool_alloc (llvm_acfg->mempool, sizeof (MonoJumpInfo)); + MonoJumpInfo *ji = (MonoJumpInfo *)mono_mempool_alloc (llvm_acfg->mempool, sizeof (MonoJumpInfo)); MonoPltEntry *plt_entry; const char *sym = NULL; @@ -7387,9 +7398,9 @@ mono_aot_get_plt_symbol (MonoJumpInfoType type, gconstpointer data) if (llvm_acfg->aot_opts.direct_icalls) { if (type == MONO_PATCH_INFO_JIT_ICALL_ADDR) { /* Call to a C function implementing a jit icall */ - sym = mono_lookup_jit_icall_symbol (data); + sym = mono_lookup_jit_icall_symbol ((const char *)data); } else if (type == MONO_PATCH_INFO_ICALL_ADDR) { - MonoMethod *method = (gpointer)data; + MonoMethod *method = (MonoMethod *)data; if (!(method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)) sym = mono_lookup_icall_symbol (method); } @@ -7879,7 +7890,7 @@ mono_aot_method_hash (MonoMethod *method) ginst = ((MonoMethodInflated*)method)->context.method_inst; hashes_count = sig->param_count + 5 + (class_ginst ? class_ginst->type_argc : 0) + (ginst ? ginst->type_argc : 0); - hashes_start = g_malloc0 (hashes_count * sizeof (guint32)); + hashes_start = (guint32 *)g_malloc0 (hashes_count * sizeof (guint32)); hashes = hashes_start; /* Some wrappers are assigned to random classes */ @@ -8030,14 +8041,14 @@ emit_extra_methods (MonoAotCompile *acfg) /* Emit method info */ nmethods = 0; for (i = 0; i < acfg->extra_methods->len; ++i) { - MonoMethod *method = g_ptr_array_index (acfg->extra_methods, i); - MonoCompile *cfg = g_hash_table_lookup (acfg->method_to_cfg, method); + MonoMethod *method = (MonoMethod *)g_ptr_array_index (acfg->extra_methods, i); + MonoCompile *cfg = (MonoCompile *)g_hash_table_lookup (acfg->method_to_cfg, method); if (!cfg) continue; buf_size = 10240; - p = buf = g_malloc (buf_size); + p = buf = (guint8 *)g_malloc (buf_size); nmethods ++; @@ -8062,8 +8073,8 @@ emit_extra_methods (MonoAotCompile *acfg) chain_lengths = g_new0 (int, table_size); max_chain_length = 0; for (i = 0; i < acfg->extra_methods->len; ++i) { - MonoMethod *method = g_ptr_array_index (acfg->extra_methods, i); - MonoCompile *cfg = g_hash_table_lookup (acfg->method_to_cfg, method); + MonoMethod *method = (MonoMethod *)g_ptr_array_index (acfg->extra_methods, i); + MonoCompile *cfg = (MonoCompile *)g_hash_table_lookup (acfg->method_to_cfg, method); guint32 key, value; if (!cfg) @@ -8078,11 +8089,11 @@ emit_extra_methods (MonoAotCompile *acfg) chain_lengths [hash] ++; max_chain_length = MAX (max_chain_length, chain_lengths [hash]); - new_entry = mono_mempool_alloc0 (acfg->mempool, sizeof (HashEntry)); + new_entry = (HashEntry *)mono_mempool_alloc0 (acfg->mempool, sizeof (HashEntry)); new_entry->key = key; new_entry->value = value; - entry = g_ptr_array_index (table, hash); + entry = (HashEntry *)g_ptr_array_index (table, hash); if (entry == NULL) { new_entry->index = hash; g_ptr_array_index (table, hash) = new_entry; @@ -8099,11 +8110,11 @@ emit_extra_methods (MonoAotCompile *acfg) //printf ("MAX: %d\n", max_chain_length); buf_size = table->len * 12 + 4; - p = buf = g_malloc (buf_size); + p = buf = (guint8 *)g_malloc (buf_size); encode_int (table_size, p, &p); for (i = 0; i < table->len; ++i) { - HashEntry *entry = g_ptr_array_index (table, i); + HashEntry *entry = (HashEntry *)g_ptr_array_index (table, i); if (entry == NULL) { encode_int (0, p, &p); @@ -8137,10 +8148,10 @@ emit_extra_methods (MonoAotCompile *acfg) * This is used by mono_aot_find_jit_info (). */ buf_size = acfg->extra_methods->len * 8 + 4; - p = buf = g_malloc (buf_size); + p = buf = (guint8 *)g_malloc (buf_size); encode_int (acfg->extra_methods->len, p, &p); for (i = 0; i < acfg->extra_methods->len; ++i) { - MonoMethod *method = g_ptr_array_index (acfg->extra_methods, i); + MonoMethod *method = (MonoMethod *)g_ptr_array_index (acfg->extra_methods, i); encode_int (get_method_index (acfg, method), p, &p); encode_int (info_offsets [i], p, &p); @@ -8296,7 +8307,7 @@ emit_class_name_table (MonoAotCompile *acfg) new_entry = g_new0 (ClassNameTableEntry, 1); new_entry->token = token; - entry = g_ptr_array_index (table, hash); + entry = (ClassNameTableEntry *)g_ptr_array_index (table, hash); if (entry == NULL) { new_entry->index = hash; g_ptr_array_index (table, hash) = new_entry; @@ -8312,14 +8323,14 @@ emit_class_name_table (MonoAotCompile *acfg) /* Emit the table */ buf_size = table->len * 4 + 4; - p = buf = g_malloc0 (buf_size); + p = buf = (guint8 *)g_malloc0 (buf_size); /* FIXME: Optimize memory usage */ g_assert (table_size < 65000); encode_int16 (table_size, p, &p); g_assert (table->len < 65000); for (i = 0; i < table->len; ++i) { - ClassNameTableEntry *entry = g_ptr_array_index (table, i); + ClassNameTableEntry *entry = (ClassNameTableEntry *)g_ptr_array_index (table, i); if (entry == NULL) { encode_int16 (0, p, &p); @@ -8364,7 +8375,7 @@ emit_image_table (MonoAotCompile *acfg) buf_size += strlen (image->assembly_name) + strlen (image->guid) + (aname->culture ? strlen (aname->culture) : 1) + strlen ((char*)aname->public_key_token) + 4; } - buf = p = g_malloc0 (buf_size); + buf = p = (guint8 *)g_malloc0 (buf_size); encode_int (acfg->image_table->len, p, &p); for (i = 0; i < acfg->image_table->len; i++) { MonoImage *image = (MonoImage*)g_ptr_array_index (acfg->image_table, i); @@ -8415,7 +8426,7 @@ emit_got_info (MonoAotCompile *acfg, gboolean llvm) acfg->plt_got_offset_base = acfg->got_offset; first_plt_got_patch = info->got_patches->len; for (i = 1; i < acfg->plt_offset; ++i) { - MonoPltEntry *plt_entry = g_hash_table_lookup (acfg->plt_offset_to_entry, GUINT_TO_POINTER (i)); + MonoPltEntry *plt_entry = (MonoPltEntry *)g_hash_table_lookup (acfg->plt_offset_to_entry, GUINT_TO_POINTER (i)); g_ptr_array_add (info->got_patches, plt_entry->ji); @@ -8438,16 +8449,16 @@ emit_got_info (MonoAotCompile *acfg, gboolean llvm) /* Encode info required to decode shared GOT entries */ buf_size = info->got_patches->len * 128; - p = buf = mono_mempool_alloc (acfg->mempool, buf_size); - got_info_offsets = mono_mempool_alloc (acfg->mempool, info->got_patches->len * sizeof (guint32)); + p = buf = (guint8 *)mono_mempool_alloc (acfg->mempool, buf_size); + got_info_offsets = (guint32 *)mono_mempool_alloc (acfg->mempool, info->got_patches->len * sizeof (guint32)); if (!llvm) { - acfg->plt_got_info_offsets = mono_mempool_alloc (acfg->mempool, acfg->plt_offset * sizeof (guint32)); + acfg->plt_got_info_offsets = (guint32 *)mono_mempool_alloc (acfg->mempool, acfg->plt_offset * sizeof (guint32)); /* Unused */ if (acfg->plt_offset) acfg->plt_got_info_offsets [0] = 0; } for (i = 0; i < info->got_patches->len; ++i) { - MonoJumpInfo *ji = g_ptr_array_index (info->got_patches, i); + MonoJumpInfo *ji = (MonoJumpInfo *)g_ptr_array_index (info->got_patches, i); guint8 *p2; p = buf; @@ -8533,7 +8544,7 @@ emit_globals (MonoAotCompile *acfg) for (i = 0; i < table_size; ++i) g_ptr_array_add (table, NULL); for (i = 0; i < acfg->globals->len; ++i) { - char *name = g_ptr_array_index (acfg->globals, i); + char *name = (char *)g_ptr_array_index (acfg->globals, i); hash = mono_metadata_str_hash (name) % table_size; @@ -8541,7 +8552,7 @@ emit_globals (MonoAotCompile *acfg) new_entry = g_new0 (GlobalsTableEntry, 1); new_entry->value = i; - entry = g_ptr_array_index (table, hash); + entry = (GlobalsTableEntry *)g_ptr_array_index (table, hash); if (entry == NULL) { new_entry->index = hash; g_ptr_array_index (table, hash) = new_entry; @@ -8565,7 +8576,7 @@ emit_globals (MonoAotCompile *acfg) g_assert (table_size < 65000); emit_int16 (acfg, table_size); for (i = 0; i < table->len; ++i) { - GlobalsTableEntry *entry = g_ptr_array_index (table, i); + GlobalsTableEntry *entry = (GlobalsTableEntry *)g_ptr_array_index (table, i); if (entry == NULL) { emit_int16 (acfg, 0); @@ -8581,7 +8592,7 @@ emit_globals (MonoAotCompile *acfg) /* Emit the names */ for (i = 0; i < acfg->globals->len; ++i) { - char *name = g_ptr_array_index (acfg->globals, i); + char *name = (char *)g_ptr_array_index (acfg->globals, i); sprintf (symbol, "name_%d", i); emit_section_change (acfg, RODATA_SECT, 1); @@ -8603,7 +8614,7 @@ emit_globals (MonoAotCompile *acfg) emit_pointer (acfg, symbol); for (i = 0; i < acfg->globals->len; ++i) { - char *name = g_ptr_array_index (acfg->globals, i); + char *name = (char *)g_ptr_array_index (acfg->globals, i); sprintf (symbol, "name_%d", i); emit_pointer (acfg, symbol); @@ -8929,7 +8940,7 @@ emit_dwarf_info (MonoAotCompile *acfg) sprintf (symbol2, "%sme_%x", acfg->temp_prefix, i); - mono_dwarf_writer_emit_method (acfg->dwarf, cfg, cfg->method, cfg->asm_symbol, symbol2, cfg->asm_debug_symbol, cfg->jit_info->code_start, cfg->jit_info->code_size, cfg->args, cfg->locals, cfg->unwind_ops, mono_debug_find_method (cfg->jit_info->d.method, mono_domain_get ())); + mono_dwarf_writer_emit_method (acfg->dwarf, cfg, cfg->method, cfg->asm_symbol, symbol2, cfg->asm_debug_symbol, (guint8 *)cfg->jit_info->code_start, cfg->jit_info->code_size, cfg->args, cfg->locals, cfg->unwind_ops, mono_debug_find_method (cfg->jit_info->d.method, mono_domain_get ())); } #endif } @@ -9042,7 +9053,7 @@ compile_methods (MonoAotCompile *acfg) methods = g_new0 (MonoMethod*, methods_len); //memcpy (methods, g_ptr_array_index (acfg->methods, 0), sizeof (MonoMethod*) * methods_len); for (i = 0; i < methods_len; ++i) - methods [i] = g_ptr_array_index (acfg->methods, i); + methods [i] = (MonoMethod *)g_ptr_array_index (acfg->methods, i); i = 0; while (i < methods_len) { frag = g_ptr_array_new (); @@ -9058,7 +9069,7 @@ compile_methods (MonoAotCompile *acfg) user_data [1] = acfg; user_data [2] = frag; - handle = mono_threads_create_thread ((gpointer)compile_thread_main, user_data, 0, 0, NULL); + handle = mono_threads_create_thread ((LPTHREAD_START_ROUTINE)compile_thread_main, user_data, 0, 0, NULL); g_ptr_array_add (threads, handle); } g_free (methods); @@ -9073,7 +9084,7 @@ compile_methods (MonoAotCompile *acfg) /* Compile methods added by compile_method () or all methods if nthreads == 0 */ for (i = methods_len; i < acfg->methods->len; ++i) { /* This can new methods to acfg->methods */ - compile_method (acfg, g_ptr_array_index (acfg->methods, i)); + compile_method (acfg, (MonoMethod *)g_ptr_array_index (acfg->methods, i)); } } @@ -9303,7 +9314,7 @@ acfg_create (MonoAssembly *ass, guint32 opts) acfg->klass_blob_hash = g_hash_table_new (NULL, NULL); acfg->method_blob_hash = g_hash_table_new (NULL, NULL); acfg->plt_entry_debug_sym_cache = g_hash_table_new (g_str_hash, g_str_equal); - mono_mutex_init_recursive (&acfg->mutex); + mono_os_mutex_init_recursive (&acfg->mutex); init_got_info (&acfg->got_info); init_got_info (&acfg->llvm_got_info); @@ -9537,44 +9548,44 @@ add_preinit_got_slots (MonoAotCompile *acfg) * during method initialization etc. */ - ji = mono_mempool_alloc0 (acfg->mempool, sizeof (MonoJumpInfo)); + ji = (MonoJumpInfo *)mono_mempool_alloc0 (acfg->mempool, sizeof (MonoJumpInfo)); ji->type = MONO_PATCH_INFO_IMAGE; ji->data.image = acfg->image; get_got_offset (acfg, FALSE, ji); get_got_offset (acfg, TRUE, ji); - ji = mono_mempool_alloc0 (acfg->mempool, sizeof (MonoJumpInfo)); + ji = (MonoJumpInfo *)mono_mempool_alloc0 (acfg->mempool, sizeof (MonoJumpInfo)); ji->type = MONO_PATCH_INFO_MSCORLIB_GOT_ADDR; get_got_offset (acfg, FALSE, ji); get_got_offset (acfg, TRUE, ji); - ji = mono_mempool_alloc0 (acfg->mempool, sizeof (MonoJumpInfo)); + ji = (MonoJumpInfo *)mono_mempool_alloc0 (acfg->mempool, sizeof (MonoJumpInfo)); ji->type = MONO_PATCH_INFO_GC_CARD_TABLE_ADDR; get_got_offset (acfg, FALSE, ji); get_got_offset (acfg, TRUE, ji); - ji = mono_mempool_alloc0 (acfg->mempool, sizeof (MonoJumpInfo)); + ji = (MonoJumpInfo *)mono_mempool_alloc0 (acfg->mempool, sizeof (MonoJumpInfo)); ji->type = MONO_PATCH_INFO_GC_NURSERY_START; get_got_offset (acfg, FALSE, ji); get_got_offset (acfg, TRUE, ji); - ji = mono_mempool_alloc0 (acfg->mempool, sizeof (MonoJumpInfo)); + ji = (MonoJumpInfo *)mono_mempool_alloc0 (acfg->mempool, sizeof (MonoJumpInfo)); ji->type = MONO_PATCH_INFO_JIT_TLS_ID; get_got_offset (acfg, FALSE, ji); get_got_offset (acfg, TRUE, ji); - ji = mono_mempool_alloc0 (acfg->mempool, sizeof (MonoJumpInfo)); + ji = (MonoJumpInfo *)mono_mempool_alloc0 (acfg->mempool, sizeof (MonoJumpInfo)); ji->type = MONO_PATCH_INFO_AOT_MODULE; get_got_offset (acfg, FALSE, ji); get_got_offset (acfg, TRUE, ji); - ji = mono_mempool_alloc0 (acfg->mempool, sizeof (MonoJumpInfo)); + ji = (MonoJumpInfo *)mono_mempool_alloc0 (acfg->mempool, sizeof (MonoJumpInfo)); ji->type = MONO_PATCH_INFO_GC_NURSERY_BITS; get_got_offset (acfg, FALSE, ji); get_got_offset (acfg, TRUE, ji); for (i = 0; i < sizeof (preinited_jit_icalls) / sizeof (char*); ++i) { - ji = mono_mempool_alloc0 (acfg->mempool, sizeof (MonoAotCompile)); + ji = (MonoJumpInfo *)mono_mempool_alloc0 (acfg->mempool, sizeof (MonoAotCompile)); ji->type = MONO_PATCH_INFO_INTERNAL_METHOD; ji->data.name = preinited_jit_icalls [i]; get_got_offset (acfg, FALSE, ji); @@ -9653,13 +9664,13 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options) aot_printerrf (acfg, "The soft-debug AOT option requires the --debug option.\n"); return 1; } - acfg->flags |= MONO_AOT_FILE_FLAG_DEBUG; + acfg->flags = (MonoAotFileFlags)(acfg->flags | MONO_AOT_FILE_FLAG_DEBUG); } if (mono_use_llvm || acfg->aot_opts.llvm) { acfg->llvm = TRUE; acfg->aot_opts.asm_writer = TRUE; - acfg->flags |= MONO_AOT_FILE_FLAG_WITH_LLVM; + acfg->flags = (MonoAotFileFlags)(acfg->flags | MONO_AOT_FILE_FLAG_WITH_LLVM); if (acfg->aot_opts.soft_debug) { aot_printerrf (acfg, "The 'soft-debug' option is not supported when compiling with LLVM.\n"); @@ -9688,10 +9699,10 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options) } if (mono_aot_mode_is_full (&acfg->aot_opts)) - acfg->flags |= MONO_AOT_FILE_FLAG_FULL_AOT; + acfg->flags = (MonoAotFileFlags)(acfg->flags | MONO_AOT_FILE_FLAG_FULL_AOT); if (mono_threads_is_coop_enabled ()) - acfg->flags |= MONO_AOT_FILE_FLAG_SAFEPOINTS; + acfg->flags = (MonoAotFileFlags)(acfg->flags | MONO_AOT_FILE_FLAG_SAFEPOINTS); if (acfg->aot_opts.instances_logfile_path) { acfg->instances_logfile = fopen (acfg->aot_opts.instances_logfile_path, "w"); @@ -9718,9 +9729,9 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options) arch_init (acfg); if (acfg->llvm && acfg->thumb_mixed) - acfg->flags |= MONO_AOT_FILE_FLAG_LLVM_THUMB; + acfg->flags = (MonoAotFileFlags)(acfg->flags | MONO_AOT_FILE_FLAG_LLVM_THUMB); if (acfg->aot_opts.llvm_only) - acfg->flags |= MONO_AOT_FILE_FLAG_LLVM_ONLY; + acfg->flags = (MonoAotFileFlags)(acfg->flags | MONO_AOT_FILE_FLAG_LLVM_ONLY); acfg->assembly_name_sym = g_strdup (acfg->image->assembly->aname.name); /* Get rid of characters which cannot occur in symbols */ diff --git a/mono/mini/aot-runtime.c b/mono/mini/aot-runtime.c index bb6d72f607a..57d53d55ea4 100644 --- a/mono/mini/aot-runtime.c +++ b/mono/mini/aot-runtime.c @@ -155,8 +155,8 @@ typedef struct { } TrampolinePage; static GHashTable *aot_modules; -#define mono_aot_lock() mono_mutex_lock (&aot_mutex) -#define mono_aot_unlock() mono_mutex_unlock (&aot_mutex) +#define mono_aot_lock() mono_os_mutex_lock (&aot_mutex) +#define mono_aot_unlock() mono_os_mutex_unlock (&aot_mutex) static mono_mutex_t aot_mutex; /* @@ -201,8 +201,8 @@ static GHashTable *aot_jit_icall_hash; #define USE_PAGE_TRAMPOLINES 0 #endif -#define mono_aot_page_lock() mono_mutex_lock (&aot_page_mutex) -#define mono_aot_page_unlock() mono_mutex_unlock (&aot_page_mutex) +#define mono_aot_page_lock() mono_os_mutex_lock (&aot_page_mutex) +#define mono_aot_page_unlock() mono_os_mutex_unlock (&aot_page_mutex) static mono_mutex_t aot_page_mutex; static MonoAotModule *mscorlib_aot_module; @@ -222,13 +222,13 @@ decode_patches (MonoAotModule *amodule, MonoMemPool *mp, int n_patches, gboolean static inline void amodule_lock (MonoAotModule *amodule) { - mono_mutex_lock (&amodule->mutex); + mono_os_mutex_lock (&amodule->mutex); } static inline void amodule_unlock (MonoAotModule *amodule) { - mono_mutex_unlock (&amodule->mutex); + mono_os_mutex_unlock (&amodule->mutex); } /* @@ -471,69 +471,65 @@ decode_klass_ref (MonoAotModule *module, guint8 *buf, guint8 **endbuf) break; } case MONO_AOT_TYPEREF_VAR: { - MonoType *t; + MonoType *t = NULL; MonoGenericContainer *container = NULL; - int type = decode_value (p, &p); - int num = decode_value (p, &p); - gboolean has_container = decode_value (p, &p); - MonoType *gshared_constraint = NULL; - char *par_name = NULL; - - t = NULL; - if (has_container) { - gboolean is_method = decode_value (p, &p); - - if (is_method) { - MonoMethod *method_def; - g_assert (type == MONO_TYPE_MVAR); - method_def = decode_resolve_method_ref (module, p, &p); - if (!method_def) - return NULL; + gboolean has_constraint = decode_value (p, &p); - container = mono_method_get_generic_container (method_def); - } else { - MonoClass *class_def; - g_assert (type == MONO_TYPE_VAR); - class_def = decode_klass_ref (module, p, &p); - if (!class_def) - return NULL; + if (has_constraint) { + MonoClass *par_klass; + MonoType *gshared_constraint; - container = class_def->generic_container; - } - } else { - gboolean has_gshared_constraint = decode_value (p, &p); - if (has_gshared_constraint) { - MonoClass *par_klass; + gshared_constraint = decode_type (module, p, &p); + if (!gshared_constraint) + return NULL; - gshared_constraint = decode_type (module, p, &p); - if (!gshared_constraint) - return NULL; + par_klass = decode_klass_ref (module, p, &p); + if (!par_klass) + return NULL; - par_klass = decode_klass_ref (module, p, &p); - if (!par_klass) - return NULL; + t = mini_get_shared_gparam (&par_klass->byval_arg, gshared_constraint); + klass = mono_class_from_mono_type (t); + } else { + int type = decode_value (p, &p); + int num = decode_value (p, &p); + gboolean is_not_anonymous = decode_value (p, &p); + + if (is_not_anonymous) { + gboolean is_method = decode_value (p, &p); + + if (is_method) { + MonoMethod *method_def; + g_assert (type == MONO_TYPE_MVAR); + method_def = decode_resolve_method_ref (module, p, &p); + if (!method_def) + return NULL; + + container = mono_method_get_generic_container (method_def); + } else { + MonoClass *class_def; + g_assert (type == MONO_TYPE_VAR); + class_def = decode_klass_ref (module, p, &p); + if (!class_def) + return NULL; - t = mini_get_shared_gparam (&par_klass->byval_arg, gshared_constraint); + container = class_def->generic_container; + } + } else { + // We didn't decode is_method, so we have to infer it from type enum. + container = get_anonymous_container_for_image (module->assembly->image, type == MONO_TYPE_MVAR); } - } - if (t) { - klass = mono_class_from_mono_type (t); - } else { t = g_new0 (MonoType, 1); - t->type = type; - if (container) { + t->type = (MonoTypeEnum)type; + if (is_not_anonymous) { t->data.generic_param = mono_generic_container_get_param (container, num); - g_assert (gshared_constraint == NULL); } else { /* Anonymous */ MonoGenericParam *par = (MonoGenericParam*)mono_image_alloc0 (module->assembly->image, sizeof (MonoGenericParamFull)); + par->owner = container; par->num = num; - par->gshared_constraint = gshared_constraint; - par->image = module->assembly->image; t->data.generic_param = par; - if (par_name) - ((MonoGenericParamFull*)par)->info.name = par_name; + ((MonoGenericParamFull*)par)->info.name = make_generic_name_string (module->assembly->image, num); } // FIXME: Maybe use types directly to avoid // the overhead of creating MonoClass-es @@ -603,7 +599,7 @@ decode_type (MonoAotModule *module, guint8 *buf, guint8 **endbuf) guint8 *p = buf; MonoType *t; - t = g_malloc0 (sizeof (MonoType)); + t = (MonoType *)g_malloc0 (sizeof (MonoType)); while (TRUE) { if (*p == MONO_TYPE_PINNED) { @@ -617,7 +613,7 @@ decode_type (MonoAotModule *module, guint8 *buf, guint8 **endbuf) } } - t->type = *p; + t->type = (MonoTypeEnum)*p; ++p; switch (t->type) { @@ -686,13 +682,13 @@ decode_type (MonoAotModule *module, guint8 *buf, guint8 **endbuf) array->numsizes = decode_value (p, &p); if (array->numsizes) - array->sizes = g_malloc0 (sizeof (int) * array->numsizes); + array->sizes = (int *)g_malloc0 (sizeof (int) * array->numsizes); for (i = 0; i < array->numsizes; ++i) array->sizes [i] = decode_value (p, &p); array->numlobounds = decode_value (p, &p); if (array->numlobounds) - array->lobounds = g_malloc0 (sizeof (int) * array->numlobounds); + array->lobounds = (int *)g_malloc0 (sizeof (int) * array->numlobounds); for (i = 0; i < array->numlobounds; ++i) array->lobounds [i] = decode_value (p, &p); t->data.array = array; @@ -738,7 +734,7 @@ decode_signature_with_target (MonoAotModule *module, MonoMethodSignature *target param_count = decode_value (p, &p); if (target && param_count != target->param_count) return NULL; - sig = g_malloc0 (MONO_SIZEOF_METHOD_SIGNATURE + param_count * sizeof (MonoType *)); + sig = (MonoMethodSignature *)g_malloc0 (MONO_SIZEOF_METHOD_SIGNATURE + param_count * sizeof (MonoType *)); sig->param_count = param_count; sig->sentinelpos = -1; sig->hasthis = hasthis; @@ -1122,9 +1118,17 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod g_assert_not_reached (); break; } - if (target && wrapper != target) - return FALSE; - ref->method = wrapper; + if (target) { + /* + * Due to the way mini_get_shared_method () works, we could end up with + * multiple copies of the same wrapper. + */ + if (wrapper->klass != target->klass) + return FALSE; + ref->method = target; + } else { + ref->method = wrapper; + } } else { /* * These wrappers are associated with a signature, not with a method. @@ -1134,7 +1138,7 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod return FALSE; if (wrapper_type == MONO_WRAPPER_DELEGATE_INVOKE) { - subtype = decode_value (p, &p); + subtype = (WrapperSubtype)decode_value (p, &p); info = mono_marshal_get_wrapper_info (target); if (info) { if (info->subtype != subtype) @@ -1598,7 +1602,7 @@ find_symbol (MonoDl *module, gpointer *globals, const char *name, gpointer *valu #endif /* The first entry points to the hash */ - table = globals [0]; + table = (guint16 *)globals [0]; globals ++; table_size = table [0]; @@ -1659,7 +1663,7 @@ check_usable (MonoAssembly *assembly, MonoAotFileInfo *info, char **out_msg) } build_info = mono_get_runtime_build_info (); - if (strlen (info->runtime_version) > 0 && strcmp (info->runtime_version, build_info)) { + if (strlen ((const char *)info->runtime_version) > 0 && strcmp (info->runtime_version, build_info)) { msg = g_strdup_printf ("compiled against runtime version '%s' while this runtime has version '%s'", info->runtime_version, build_info); usable = FALSE; } @@ -1706,7 +1710,7 @@ check_usable (MonoAssembly *assembly, MonoAotFileInfo *info, char **out_msg) usable = FALSE; } - blob = info->blob; + blob = (guint8 *)info->blob; if (info->gc_name_index != -1) { char *gc_name = (char*)&blob [info->gc_name_index]; @@ -1800,7 +1804,7 @@ init_amodule_got (MonoAotModule *amodule) amodule->shared_got [i] = amodule->assembly->image; } else if (ji->type == MONO_PATCH_INFO_MSCORLIB_GOT_ADDR) { if (mono_defaults.corlib) { - MonoAotModule *mscorlib_amodule = mono_defaults.corlib->aot_module; + MonoAotModule *mscorlib_amodule = (MonoAotModule *)mono_defaults.corlib->aot_module; if (mscorlib_amodule) amodule->shared_got [i] = mscorlib_amodule->got; @@ -1857,7 +1861,7 @@ load_aot_module (MonoAssembly *assembly, gpointer user_data) mono_aot_lock (); if (static_aot_modules) - info = g_hash_table_lookup (static_aot_modules, assembly->aname.name); + info = (MonoAotFileInfo *)g_hash_table_lookup (static_aot_modules, assembly->aname.name); else info = NULL; mono_aot_unlock (); @@ -1868,7 +1872,7 @@ load_aot_module (MonoAssembly *assembly, gpointer user_data) /* Statically linked AOT module */ aot_name = g_strdup_printf ("%s", assembly->aname.name); mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "Found statically linked AOT module '%s'.\n", aot_name); - globals = info->globals; + globals = (void **)info->globals; } else { if (enable_aot_cache) sofile = aot_cache_load_module (assembly, &aot_name); @@ -1882,7 +1886,7 @@ load_aot_module (MonoAssembly *assembly, gpointer user_data) mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT module '%s' not found: %s\n", aot_name, err); g_free (err); - aot_name = g_strdup_printf ("%s/mono/aot-cache/%s/%s%s", mono_assembly_getrootdir(), ARCHITECTURE, g_path_get_basename (assembly->image->name), MONO_SOLIB_EXT); + aot_name = g_strdup_printf ("%s/mono/aot-cache/%s/%s%s", mono_assembly_getrootdir(), MONO_ARCHITECTURE, g_path_get_basename (assembly->image->name), MONO_SOLIB_EXT); sofile = mono_dl_open (aot_name, MONO_DL_LAZY, &err); if (!sofile) { mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT module '%s' not found: %s\n", aot_name, err); @@ -1941,7 +1945,7 @@ load_aot_module (MonoAssembly *assembly, gpointer user_data) g_assert (info->long_align == align_int64); g_assert (info->generic_tramp_num == MONO_TRAMPOLINE_NUM); - blob = info->blob; + blob = (guint8 *)info->blob; amodule = g_new0 (MonoAotModule, 1); amodule->aot_name = aot_name; @@ -1949,8 +1953,8 @@ load_aot_module (MonoAssembly *assembly, gpointer user_data) memcpy (&amodule->info, info, sizeof (*info)); - amodule->got = amodule->info.jit_got; - amodule->llvm_got = amodule->info.llvm_got; + amodule->got = (void **)amodule->info.jit_got; + amodule->llvm_got = (void **)amodule->info.llvm_got; amodule->globals = globals; amodule->sofile = sofile; amodule->method_to_code = g_hash_table_new (mono_aligned_addr_hash, NULL); @@ -1958,14 +1962,14 @@ load_aot_module (MonoAssembly *assembly, gpointer user_data) amodule->blob = blob; amodule->shared_got = g_new0 (gpointer, info->nshared_got_entries); - mono_mutex_init_recursive (&amodule->mutex); + mono_os_mutex_init_recursive (&amodule->mutex); /* Read image table */ { guint32 table_len, i; char *table = NULL; - table = info->image_table; + table = (char *)info->image_table; g_assert (table); table_len = *(guint32*)table; @@ -1987,7 +1991,7 @@ load_aot_module (MonoAssembly *assembly, gpointer user_data) memcpy (aname->public_key_token, table, strlen (table) + 1); table += strlen (table) + 1; - table = ALIGN_PTR_TO (table, 8); + table = (char *)ALIGN_PTR_TO (table, 8); aname->flags = *(guint32*)table; table += 4; aname->major = *(guint32*)table; @@ -2001,38 +2005,38 @@ load_aot_module (MonoAssembly *assembly, gpointer user_data) } } - amodule->jit_code_start = info->jit_code_start; - amodule->jit_code_end = info->jit_code_end; - amodule->method_info_offsets = info->method_info_offsets; - amodule->ex_info_offsets = info->ex_info_offsets; - amodule->class_info_offsets = info->class_info_offsets; - amodule->class_name_table = info->class_name_table; - amodule->extra_method_table = info->extra_method_table; - amodule->extra_method_info_offsets = info->extra_method_info_offsets; - amodule->unbox_trampolines = info->unbox_trampolines; - amodule->unbox_trampolines_end = info->unbox_trampolines_end; - amodule->unbox_trampoline_addresses = info->unbox_trampoline_addresses; - amodule->unwind_info = info->unwind_info; + amodule->jit_code_start = (guint8 *)info->jit_code_start; + amodule->jit_code_end = (guint8 *)info->jit_code_end; + amodule->method_info_offsets = (guint32 *)info->method_info_offsets; + amodule->ex_info_offsets = (guint32 *)info->ex_info_offsets; + amodule->class_info_offsets = (guint32 *)info->class_info_offsets; + amodule->class_name_table = (guint16 *)info->class_name_table; + amodule->extra_method_table = (guint32 *)info->extra_method_table; + amodule->extra_method_info_offsets = (guint32 *)info->extra_method_info_offsets; + amodule->unbox_trampolines = (guint32 *)info->unbox_trampolines; + amodule->unbox_trampolines_end = (guint32 *)info->unbox_trampolines_end; + amodule->unbox_trampoline_addresses = (guint32 *)info->unbox_trampoline_addresses; + amodule->unwind_info = (guint8 *)info->unwind_info; amodule->mem_begin = amodule->jit_code_start; - amodule->mem_end = info->mem_end; - amodule->plt = info->plt; - amodule->plt_end = info->plt_end; - amodule->mono_eh_frame = info->mono_eh_frame; - amodule->trampolines [MONO_AOT_TRAMP_SPECIFIC] = info->specific_trampolines; - amodule->trampolines [MONO_AOT_TRAMP_STATIC_RGCTX] = info->static_rgctx_trampolines; - amodule->trampolines [MONO_AOT_TRAMP_IMT_THUNK] = info->imt_thunks; - amodule->trampolines [MONO_AOT_TRAMP_GSHAREDVT_ARG] = info->gsharedvt_arg_trampolines; + amodule->mem_end = (guint8 *)info->mem_end; + amodule->plt = (guint8 *)info->plt; + amodule->plt_end = (guint8 *)info->plt_end; + amodule->mono_eh_frame = (guint8 *)info->mono_eh_frame; + amodule->trampolines [MONO_AOT_TRAMP_SPECIFIC] = (guint8 *)info->specific_trampolines; + amodule->trampolines [MONO_AOT_TRAMP_STATIC_RGCTX] = (guint8 *)info->static_rgctx_trampolines; + amodule->trampolines [MONO_AOT_TRAMP_IMT_THUNK] = (guint8 *)info->imt_thunks; + amodule->trampolines [MONO_AOT_TRAMP_GSHAREDVT_ARG] = (guint8 *)info->gsharedvt_arg_trampolines; if (!strcmp (assembly->aname.name, "mscorlib")) mscorlib_aot_module = amodule; /* Compute method addresses */ - amodule->methods = g_malloc0 (amodule->info.nmethods * sizeof (gpointer)); + amodule->methods = (void **)g_malloc0 (amodule->info.nmethods * sizeof (gpointer)); for (i = 0; i < amodule->info.nmethods; ++i) { void *addr = NULL; if (amodule->info.llvm_get_method) { - gpointer (*get_method) (int) = amodule->info.llvm_get_method; + gpointer (*get_method) (int) = (gpointer (*)(int))amodule->info.llvm_get_method; addr = get_method (i); } @@ -2159,14 +2163,14 @@ mono_aot_register_module (gpointer *aot_info) { gpointer *globals; char *aname; - MonoAotFileInfo *info = (gpointer)aot_info; + MonoAotFileInfo *info = (MonoAotFileInfo *)aot_info; g_assert (info->version == MONO_AOT_FILE_VERSION); - globals = info->globals; + globals = (void **)info->globals; g_assert (globals); - aname = info->assembly_name; + aname = (char *)info->assembly_name; /* This could be called before startup */ if (aot_modules) @@ -2184,8 +2188,8 @@ mono_aot_register_module (gpointer *aot_info) void mono_aot_init (void) { - mono_mutex_init_recursive (&aot_mutex); - mono_mutex_init_recursive (&aot_page_mutex); + mono_os_mutex_init_recursive (&aot_mutex); + mono_os_mutex_init_recursive (&aot_page_mutex); aot_modules = g_hash_table_new (NULL, NULL); #ifndef __native_client__ @@ -2258,7 +2262,7 @@ mono_aot_get_method_from_vt_slot (MonoDomain *domain, MonoVTable *vtable, int sl { int i; MonoClass *klass = vtable->klass; - MonoAotModule *amodule = klass->image->aot_module; + MonoAotModule *amodule = (MonoAotModule *)klass->image->aot_module; guint8 *info, *p; MonoCachedClassInfo class_info; gboolean err; @@ -2293,7 +2297,7 @@ mono_aot_get_method_from_vt_slot (MonoDomain *domain, MonoVTable *vtable, int sl gboolean mono_aot_get_cached_class_info (MonoClass *klass, MonoCachedClassInfo *res) { - MonoAotModule *amodule = klass->image->aot_module; + MonoAotModule *amodule = (MonoAotModule *)klass->image->aot_module; guint8 *p; gboolean err; @@ -2322,7 +2326,7 @@ mono_aot_get_cached_class_info (MonoClass *klass, MonoCachedClassInfo *res) gboolean mono_aot_get_class_from_name (MonoImage *image, const char *name_space, const char *name, MonoClass **klass) { - MonoAotModule *amodule = image->aot_module; + MonoAotModule *amodule = (MonoAotModule *)image->aot_module; guint16 *table, *entry; guint16 table_size; guint32 hash; @@ -2343,9 +2347,9 @@ mono_aot_get_class_from_name (MonoImage *image, const char *name_space, const ch /* First look in the cache */ if (!amodule->name_cache) amodule->name_cache = g_hash_table_new (g_str_hash, g_str_equal); - nspace_table = g_hash_table_lookup (amodule->name_cache, name_space); + nspace_table = (GHashTable *)g_hash_table_lookup (amodule->name_cache, name_space); if (nspace_table) { - *klass = g_hash_table_lookup (nspace_table, name); + *klass = (MonoClass *)g_hash_table_lookup (nspace_table, name); if (*klass) { amodule_unlock (amodule); return TRUE; @@ -2396,7 +2400,7 @@ mono_aot_get_class_from_name (MonoImage *image, const char *name_space, const ch /* Add to cache */ if (*klass) { amodule_lock (amodule); - nspace_table = g_hash_table_lookup (amodule->name_cache, name_space); + nspace_table = (GHashTable *)g_hash_table_lookup (amodule->name_cache, name_space); if (!nspace_table) { nspace_table = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (amodule->name_cache, (char*)name_space2, nspace_table); @@ -2429,10 +2433,10 @@ compute_llvm_code_range (MonoAotModule *amodule, guint8 **code_start, guint8 **c gint32 *table; if (amodule->info.llvm_get_method) { - gpointer (*get_method) (int) = amodule->info.llvm_get_method; + gpointer (*get_method) (int) = (gpointer (*)(int))amodule->info.llvm_get_method; - *code_start = get_method (-1); - *code_end = get_method (-2); + *code_start = (guint8 *)get_method (-1); + *code_end = (guint8 *)get_method (-2); g_assert (*code_end > *code_start); return; @@ -2449,14 +2453,14 @@ compute_llvm_code_range (MonoAotModule *amodule, guint8 **code_start, guint8 **c g_assert (version == 3); p ++; p ++; - p = ALIGN_PTR_TO (p, 4); + p = (guint8 *)ALIGN_PTR_TO (p, 4); fde_count = *(guint32*)p; p += 4; table = (gint32*)p; if (fde_count > 0) { - *code_start = amodule->methods [table [0]]; + *code_start = (guint8 *)amodule->methods [table [0]]; *code_end = (guint8*)amodule->methods [table [(fde_count - 1) * 2]] + table [fde_count * 2]; } else { *code_start = NULL; @@ -2509,7 +2513,7 @@ decode_llvm_mono_eh_frame (MonoAotModule *amodule, MonoDomain *domain, MonoLLVMFDEInfo info; if (!amodule->mono_eh_frame) { - jinfo = mono_domain_alloc0_lock_free (domain, mono_jit_info_size (flags, num_clauses, 0)); + jinfo = (MonoJitInfo *)mono_domain_alloc0_lock_free (domain, mono_jit_info_size (flags, num_clauses, 0)); mono_jit_info_init (jinfo, method, code, code_len, flags, num_clauses, 0); memcpy (jinfo->clauses, clauses, num_clauses * sizeof (MonoJitExceptionInfo)); return jinfo; @@ -2527,7 +2531,7 @@ decode_llvm_mono_eh_frame (MonoAotModule *amodule, MonoDomain *domain, p ++; /* func_encoding = *p; */ p ++; - p = ALIGN_PTR_TO (p, 4); + p = (guint8 *)ALIGN_PTR_TO (p, 4); fde_count = *(guint32*)p; p += 4; @@ -2544,12 +2548,12 @@ decode_llvm_mono_eh_frame (MonoAotModule *amodule, MonoDomain *domain, /* The table contains method index/fde offset pairs */ g_assert (table [(pos * 2)] != -1); - code1 = amodule->methods [table [(pos * 2)]]; + code1 = (guint8 *)amodule->methods [table [(pos * 2)]]; if (pos + 1 == fde_count) { code2 = amodule->llvm_code_end; } else { g_assert (table [(pos + 1) * 2] != -1); - code2 = amodule->methods [table [(pos + 1) * 2]]; + code2 = (guint8 *)amodule->methods [table [(pos + 1) * 2]]; } if (code < code1) @@ -2560,13 +2564,13 @@ decode_llvm_mono_eh_frame (MonoAotModule *amodule, MonoDomain *domain, break; } - code_start = amodule->methods [table [(pos * 2)]]; + code_start = (guint8 *)amodule->methods [table [(pos * 2)]]; if (pos + 1 == fde_count) { /* The +1 entry in the table contains the length of the last method */ int len = table [(pos + 1) * 2]; code_end = code_start + len; } else { - code_end = amodule->methods [table [(pos + 1) * 2]]; + code_end = (guint8 *)amodule->methods [table [(pos + 1) * 2]]; } if (!code_len) code_len = code_end - code_start; @@ -2604,7 +2608,7 @@ decode_llvm_mono_eh_frame (MonoAotModule *amodule, MonoDomain *domain, * allocate a new JI. */ jinfo = - mono_domain_alloc0_lock_free (domain, mono_jit_info_size (flags, ei_len + nested_len, 0)); + (MonoJitInfo *)mono_domain_alloc0_lock_free (domain, mono_jit_info_size (flags, ei_len + nested_len, 0)); mono_jit_info_init (jinfo, method, code, code_len, flags, ei_len + nested_len, 0); jinfo->unwind_info = mono_cache_unwind_info (info.unw_info, info.unw_info_len); @@ -2631,7 +2635,7 @@ decode_llvm_mono_eh_frame (MonoAotModule *amodule, MonoDomain *domain, jei->handler_start = ei [i].handler_start; jei->clause_index = clause_index; - if (is_thumb_code (amodule, jei->try_start)) { + if (is_thumb_code (amodule, (guint8 *)jei->try_start)) { jei->try_start = (void*)((mgreg_t)jei->try_start & ~1); jei->try_end = (void*)((mgreg_t)jei->try_end & ~1); /* Make sure we transition to thumb when a handler starts */ @@ -2719,18 +2723,18 @@ decode_exception_debug_info (MonoAotModule *amodule, MonoDomain *domain, unwind_info = decode_value (p, &p); } if (has_generic_jit_info) - flags |= JIT_INFO_HAS_GENERIC_JIT_INFO; + flags = (MonoJitInfoFlags)(flags | JIT_INFO_HAS_GENERIC_JIT_INFO); if (has_try_block_holes) { num_holes = decode_value (p, &p); - flags |= JIT_INFO_HAS_TRY_BLOCK_HOLES; + flags = (MonoJitInfoFlags)(flags | JIT_INFO_HAS_TRY_BLOCK_HOLES); try_holes_info_size = sizeof (MonoTryBlockHoleTableJitInfo) + num_holes * sizeof (MonoTryBlockHoleJitInfo); } else { num_holes = try_holes_info_size = 0; } if (has_arch_eh_jit_info) { - flags |= JIT_INFO_HAS_ARCH_EH_INFO; + flags = (MonoJitInfoFlags)(flags | JIT_INFO_HAS_ARCH_EH_INFO); /* Overwrite the original code_len which includes alignment padding */ code_len = decode_value (p, &p); } @@ -2787,7 +2791,7 @@ decode_exception_debug_info (MonoAotModule *amodule, MonoDomain *domain, g_free (nesting); } else { len = mono_jit_info_size (flags, num_clauses, num_holes); - jinfo = alloc0_jit_info_data (domain, len, async); + jinfo = (MonoJitInfo *)alloc0_jit_info_data (domain, len, async); mono_jit_info_init (jinfo, method, code, code_len, flags, num_clauses, num_holes); for (i = 0; i < jinfo->num_clauses; ++i) { @@ -2872,7 +2876,7 @@ decode_exception_debug_info (MonoAotModule *amodule, MonoDomain *domain, gi->nlocs = decode_value (p, &p); if (gi->nlocs) { - gi->locations = alloc0_jit_info_data (domain, gi->nlocs * sizeof (MonoDwarfLocListEntry), async); + gi->locations = (MonoDwarfLocListEntry *)alloc0_jit_info_data (domain, gi->nlocs * sizeof (MonoDwarfLocListEntry), async); for (i = 0; i < gi->nlocs; ++i) { MonoDwarfLocListEntry *entry = &gi->locations [i]; @@ -2965,12 +2969,12 @@ mono_aot_get_unwind_info (MonoJitInfo *ji, guint32 *unwind_info_len) { MonoAotModule *amodule; guint8 *p; - guint8 *code = ji->code_start; + guint8 *code = (guint8 *)ji->code_start; if (ji->async) - amodule = ji->d.aot_info; + amodule = (MonoAotModule *)ji->d.aot_info; else - amodule = jinfo_get_method (ji)->klass->image->aot_module; + amodule = (MonoAotModule *)jinfo_get_method (ji)->klass->image->aot_module; g_assert (amodule); g_assert (ji->from_aot); @@ -2978,7 +2982,7 @@ mono_aot_get_unwind_info (MonoJitInfo *ji, guint32 *unwind_info_len) /* ji belongs to a different aot module than amodule */ mono_aot_lock (); g_assert (ji_to_amodule); - amodule = g_hash_table_lookup (ji_to_amodule, ji); + amodule = (MonoAotModule *)g_hash_table_lookup (ji_to_amodule, ji); g_assert (amodule); g_assert (amodule_contains_code_addr (amodule, code)); mono_aot_unlock (); @@ -3059,7 +3063,7 @@ mono_aot_find_jit_info (MonoDomain *domain, MonoImage *image, gpointer addr) int pos, left, right, code_len; int method_index, table_len; guint32 token; - MonoAotModule *amodule = image->aot_module; + MonoAotModule *amodule = (MonoAotModule *)image->aot_module; MonoMethod *method = NULL; MonoJitInfo *jinfo; guint8 *code, *ex_info, *p; @@ -3079,7 +3083,7 @@ mono_aot_find_jit_info (MonoDomain *domain, MonoImage *image, gpointer addr) /* FIXME: */ return NULL; - if (!amodule_contains_code_addr (amodule, addr)) + if (!amodule_contains_code_addr (amodule, (guint8 *)addr)) return NULL; async = mono_thread_info_is_async_context (); @@ -3115,20 +3119,20 @@ mono_aot_find_jit_info (MonoDomain *domain, MonoImage *image, gpointer addr) /* Binary search in the sorted_methods table */ methods = amodule->sorted_methods; methods_len = amodule->sorted_methods_len; - code = addr; + code = (guint8 *)addr; left = 0; right = methods_len; while (TRUE) { pos = (left + right) / 2; - code1 = methods [pos]; + code1 = (guint8 *)methods [pos]; if (pos + 1 == methods_len) { if (code1 >= amodule->jit_code_start && code1 < amodule->jit_code_end) code2 = amodule->jit_code_end; else code2 = amodule->llvm_code_end; } else { - code2 = methods [pos + 1]; + code2 = (guint8 *)methods [pos + 1]; } if (code < code1) @@ -3158,7 +3162,7 @@ mono_aot_find_jit_info (MonoDomain *domain, MonoImage *image, gpointer addr) } } - code = amodule->methods [method_index]; + code = (guint8 *)amodule->methods [method_index]; ex_info = &amodule->blob [mono_aot_get_offset (amodule->ex_info_offsets, method_index)]; if (pos == methods_len - 1) { @@ -3176,7 +3180,7 @@ mono_aot_find_jit_info (MonoDomain *domain, MonoImage *image, gpointer addr) if (!async) { if (amodule->extra_methods) { amodule_lock (amodule); - method = g_hash_table_lookup (amodule->extra_methods, GUINT_TO_POINTER (method_index)); + method = (MonoMethod *)g_hash_table_lookup (amodule->extra_methods, GUINT_TO_POINTER (method_index)); amodule_unlock (amodule); } else { method = NULL; @@ -3244,7 +3248,7 @@ mono_aot_find_jit_info (MonoDomain *domain, MonoImage *image, gpointer addr) len = old_table[0].method_index; else len = 1; - new_table = alloc0_jit_info_data (domain, (len + 1) * sizeof (JitInfoMap), async); + new_table = (JitInfoMap *)alloc0_jit_info_data (domain, (len + 1) * sizeof (JitInfoMap), async); if (old_table) memcpy (new_table, old_table, len * sizeof (JitInfoMap)); new_table [0].method_index = len + 1; @@ -3252,7 +3256,7 @@ mono_aot_find_jit_info (MonoDomain *domain, MonoImage *image, gpointer addr) new_table [len].jinfo = jinfo; /* Publish it */ mono_memory_barrier (); - if (InterlockedCompareExchangePointer ((gpointer)&amodule->async_jit_info_table, new_table, old_table) == old_table) + if (InterlockedCompareExchangePointer ((volatile gpointer *)&amodule->async_jit_info_table, new_table, old_table) == old_table) break; } } else { @@ -3325,7 +3329,7 @@ decode_patch (MonoAotModule *aot_module, MonoMemPool *mp, MonoJumpInfo *ji, guin goto cleanup; break; case MONO_PATCH_INFO_DELEGATE_TRAMPOLINE: - ji->data.del_tramp = mono_mempool_alloc0 (mp, sizeof (MonoDelegateClassMethodPair)); + ji->data.del_tramp = (MonoDelegateClassMethodPair *)mono_mempool_alloc0 (mp, sizeof (MonoDelegateClassMethodPair)); ji->data.del_tramp->klass = decode_klass_ref (aot_module, p, &p); if (!ji->data.del_tramp->klass) goto cleanup; @@ -3349,9 +3353,9 @@ decode_patch (MonoAotModule *aot_module, MonoMemPool *mp, MonoJumpInfo *ji, guin goto cleanup; break; case MONO_PATCH_INFO_SWITCH: - ji->data.table = mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoBBTable)); + ji->data.table = (MonoJumpInfoBBTable *)mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoBBTable)); ji->data.table->table_size = decode_value (p, &p); - table = mono_domain_alloc (mono_domain_get (), sizeof (gpointer) * ji->data.table->table_size); + table = (void **)mono_domain_alloc (mono_domain_get (), sizeof (gpointer) * ji->data.table->table_size); ji->data.table->table = (MonoBasicBlock**)table; for (i = 0; i < ji->data.table->table_size; i++) table [i] = (gpointer)(gssize)decode_value (p, &p); @@ -3427,13 +3431,13 @@ decode_patch (MonoAotModule *aot_module, MonoMemPool *mp, MonoJumpInfo *ji, guin offset = decode_value (p, &p); val = decode_value (p, &p); - entry = mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoRgctxEntry)); + entry = (MonoJumpInfoRgctxEntry *)mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoRgctxEntry)); p2 = aot_module->blob + offset; entry->method = decode_resolve_method_ref (aot_module, p2, &p2); entry->in_mrgctx = ((val & 1) > 0) ? TRUE : FALSE; - entry->info_type = (val >> 1) & 0xff; - entry->data = mono_mempool_alloc0 (mp, sizeof (MonoJumpInfo)); - entry->data->type = (val >> 9) & 0xff; + entry->info_type = (MonoRgctxInfoType)((val >> 1) & 0xff); + entry->data = (MonoJumpInfo *)mono_mempool_alloc0 (mp, sizeof (MonoJumpInfo)); + entry->data->type = (MonoJumpInfoType)((val >> 9) & 0xff); res = decode_patch (aot_module, mp, entry->data, p, &p); if (!res) @@ -3445,15 +3449,6 @@ decode_patch (MonoAotModule *aot_module, MonoMemPool *mp, MonoJumpInfo *ji, guin case MONO_PATCH_INFO_AOT_MODULE: case MONO_PATCH_INFO_MSCORLIB_GOT_ADDR: break; - case MONO_PATCH_INFO_LLVM_IMT_TRAMPOLINE: { - MonoJumpInfoImtTramp *imt_tramp = mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoImtTramp)); - - imt_tramp->method = decode_resolve_method_ref (aot_module, p, &p); - imt_tramp->vt_offset = decode_value (p, &p); - - ji->data.imt_tramp = imt_tramp; - break; - } case MONO_PATCH_INFO_SIGNATURE: ji->data.target = decode_signature (aot_module, p, &p); break; @@ -3461,7 +3456,7 @@ decode_patch (MonoAotModule *aot_module, MonoMemPool *mp, MonoJumpInfo *ji, guin ji->data.target = GINT_TO_POINTER (decode_value (p, &p)); break; case MONO_PATCH_INFO_GSHAREDVT_CALL: { - MonoJumpInfoGSharedVtCall *info = mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoGSharedVtCall)); + MonoJumpInfoGSharedVtCall *info = (MonoJumpInfoGSharedVtCall *)mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoGSharedVtCall)); info->sig = decode_signature (aot_module, p, &p); g_assert (info->sig); info->method = decode_resolve_method_ref (aot_module, p, &p); @@ -3471,29 +3466,29 @@ decode_patch (MonoAotModule *aot_module, MonoMemPool *mp, MonoJumpInfo *ji, guin break; } case MONO_PATCH_INFO_GSHAREDVT_METHOD: { - MonoGSharedVtMethodInfo *info = mono_mempool_alloc0 (mp, sizeof (MonoGSharedVtMethodInfo)); + MonoGSharedVtMethodInfo *info = (MonoGSharedVtMethodInfo *)mono_mempool_alloc0 (mp, sizeof (MonoGSharedVtMethodInfo)); int i; info->method = decode_resolve_method_ref (aot_module, p, &p); g_assert (info->method); info->num_entries = decode_value (p, &p); info->count_entries = info->num_entries; - info->entries = mono_mempool_alloc0 (mp, sizeof (MonoRuntimeGenericContextInfoTemplate) * info->num_entries); + info->entries = (MonoRuntimeGenericContextInfoTemplate *)mono_mempool_alloc0 (mp, sizeof (MonoRuntimeGenericContextInfoTemplate) * info->num_entries); for (i = 0; i < info->num_entries; ++i) { - MonoRuntimeGenericContextInfoTemplate *template = &info->entries [i]; + MonoRuntimeGenericContextInfoTemplate *template_ = &info->entries [i]; - template->info_type = decode_value (p, &p); - switch (mini_rgctx_info_type_to_patch_info_type (template->info_type)) { + template_->info_type = (MonoRgctxInfoType)decode_value (p, &p); + switch (mini_rgctx_info_type_to_patch_info_type (template_->info_type)) { case MONO_PATCH_INFO_CLASS: { MonoClass *klass = decode_klass_ref (aot_module, p, &p); if (!klass) goto cleanup; - template->data = &klass->byval_arg; + template_->data = &klass->byval_arg; break; } case MONO_PATCH_INFO_FIELD: - template->data = decode_field_info (aot_module, p, &p); - if (!template->data) + template_->data = decode_field_info (aot_module, p, &p); + if (!template_->data) goto cleanup; break; default: @@ -3508,7 +3503,7 @@ decode_patch (MonoAotModule *aot_module, MonoMemPool *mp, MonoJumpInfo *ji, guin int len = decode_value (p, &p); char *s; - s = mono_mempool_alloc0 (mp, len + 1); + s = (char *)mono_mempool_alloc0 (mp, len + 1); memcpy (s, p, len + 1); p += len + 1; @@ -3516,7 +3511,7 @@ decode_patch (MonoAotModule *aot_module, MonoMemPool *mp, MonoJumpInfo *ji, guin break; } case MONO_PATCH_INFO_VIRT_METHOD: { - MonoJumpInfoVirtMethod *info = mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoVirtMethod)); + MonoJumpInfoVirtMethod *info = (MonoJumpInfoVirtMethod *)mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoVirtMethod)); info->klass = decode_klass_ref (aot_module, p, &p); g_assert (info->klass); @@ -3562,18 +3557,18 @@ decode_patches (MonoAotModule *amodule, MonoMemPool *mp, int n_patches, gboolean if (llvm) { got = amodule->llvm_got; - got_info_offsets = amodule->info.llvm_got_info_offsets; + got_info_offsets = (guint32 *)amodule->info.llvm_got_info_offsets; } else { got = amodule->got; - got_info_offsets = amodule->info.got_info_offsets; + got_info_offsets = (guint32 *)amodule->info.got_info_offsets; } - patches = mono_mempool_alloc0 (mp, sizeof (MonoJumpInfo) * n_patches); + patches = (MonoJumpInfo *)mono_mempool_alloc0 (mp, sizeof (MonoJumpInfo) * n_patches); for (i = 0; i < n_patches; ++i) { guint8 *p = amodule->blob + mono_aot_get_offset (got_info_offsets, got_offsets [i]); ji = &patches [i]; - ji->type = decode_value (p, &p); + ji->type = (MonoJumpInfoType)decode_value (p, &p); /* See load_method () for SFLDA */ if (got && got [got_offsets [i]] && ji->type != MONO_PATCH_INFO_SFLDA) { @@ -3599,7 +3594,7 @@ load_patch_info (MonoAotModule *amodule, MonoMemPool *mp, int n_patches, p = buf; - *got_slots = g_malloc (sizeof (guint32) * n_patches); + *got_slots = (guint32 *)g_malloc (sizeof (guint32) * n_patches); for (pindex = 0; pindex < n_patches; ++pindex) { (*got_slots)[pindex] = decode_value (p, &p); } @@ -3630,7 +3625,7 @@ register_jump_target_got_slot (MonoDomain *domain, MonoMethod *method, gpointer mono_domain_lock (domain); if (!info->jump_target_got_slot_hash) info->jump_target_got_slot_hash = g_hash_table_new (NULL, NULL); - list = g_hash_table_lookup (info->jump_target_got_slot_hash, method); + list = (GSList *)g_hash_table_lookup (info->jump_target_got_slot_hash, method); list = g_slist_prepend (list, got_slot); g_hash_table_insert (info->jump_target_got_slot_hash, method, list); mono_domain_unlock (domain); @@ -3670,8 +3665,8 @@ load_method (MonoDomain *domain, MonoAotModule *amodule, MonoImage *image, MonoM /* * Obtain the method address by calling a generated function in the LLVM module. */ - gpointer (*get_method) (int) = amodule->info.llvm_get_method; - code = get_method (method_index); + gpointer (*get_method) (int) = (gpointer (*)(int))amodule->info.llvm_get_method; + code = (guint8 *)get_method (method_index); } if (!code) { @@ -3688,7 +3683,7 @@ load_method (MonoDomain *domain, MonoAotModule *amodule, MonoImage *image, MonoM } return NULL; } - code = amodule->methods [method_index]; + code = (guint8 *)amodule->methods [method_index]; } info = &amodule->blob [mono_aot_get_offset (amodule->method_info_offsets, method_index)]; @@ -3815,7 +3810,7 @@ find_aot_method_in_amodule (MonoAotModule *amodule, MonoMethod *method, guint32 amodule_lock (amodule); if (!amodule->method_ref_to_method) amodule->method_ref_to_method = g_hash_table_new (NULL, NULL); - m = g_hash_table_lookup (amodule->method_ref_to_method, p); + m = (MonoMethod *)g_hash_table_lookup (amodule->method_ref_to_method, p); amodule_unlock (amodule); if (!m) { m = decode_resolve_method_ref_with_target (amodule, method, p, &p); @@ -3883,8 +3878,8 @@ find_aot_method (MonoMethod *method, MonoAotModule **out_amodule) guint32 hash = mono_aot_method_hash (method); /* Try the method's module first */ - *out_amodule = method->klass->image->aot_module; - index = find_aot_method_in_amodule (method->klass->image->aot_module, method, hash); + *out_amodule = (MonoAotModule *)method->klass->image->aot_module; + index = find_aot_method_in_amodule ((MonoAotModule *)method->klass->image->aot_module, method, hash); if (index != 0xffffff) return index; @@ -3903,7 +3898,7 @@ find_aot_method (MonoMethod *method, MonoAotModule **out_amodule) index = 0xffffff; for (i = 0; i < modules->len; ++i) { - MonoAotModule *amodule = g_ptr_array_index (modules, i); + MonoAotModule *amodule = (MonoAotModule *)g_ptr_array_index (modules, i); if (amodule != method->klass->image->aot_module) index = find_aot_method_in_amodule (amodule, method, hash); @@ -3937,7 +3932,7 @@ init_llvm_method (MonoAotModule *amodule, guint32 method_index, MonoMethod *meth MonoJitInfo *jinfo = NULL; guint8 *code, *info; - code = amodule->methods [method_index]; + code = (guint8 *)amodule->methods [method_index]; info = &amodule->blob [mono_aot_get_offset (amodule->method_info_offsets, method_index)]; p = info; @@ -4034,7 +4029,7 @@ init_llvm_method (MonoAotModule *amodule, guint32 method_index, MonoMethod *meth void mono_aot_init_llvm_method (gpointer aot_module, guint32 method_index) { - MonoAotModule *amodule = aot_module; + MonoAotModule *amodule = (MonoAotModule *)aot_module; gboolean res; // FIXME: Handle failure @@ -4043,20 +4038,20 @@ mono_aot_init_llvm_method (gpointer aot_module, guint32 method_index) } void -mono_aot_init_gshared_method_this (gpointer aot_module, guint32 method_index, MonoObject *this) +mono_aot_init_gshared_method_this (gpointer aot_module, guint32 method_index, MonoObject *this_obj) { - MonoAotModule *amodule = aot_module; + MonoAotModule *amodule = (MonoAotModule *)aot_module; gboolean res; MonoClass *klass; MonoGenericContext *context; MonoMethod *method; // FIXME: - g_assert (this); - klass = this->vtable->klass; + g_assert (this_obj); + klass = this_obj->vtable->klass; amodule_lock (amodule); - method = g_hash_table_lookup (amodule->extra_methods, GUINT_TO_POINTER (method_index)); + method = (MonoMethod *)g_hash_table_lookup (amodule->extra_methods, GUINT_TO_POINTER (method_index)); amodule_unlock (amodule); g_assert (method); @@ -4070,7 +4065,7 @@ mono_aot_init_gshared_method_this (gpointer aot_module, guint32 method_index, Mo void mono_aot_init_gshared_method_rgctx (gpointer aot_module, guint32 method_index, MonoMethodRuntimeGenericContext *rgctx) { - MonoAotModule *amodule = aot_module; + MonoAotModule *amodule = (MonoAotModule *)aot_module; gboolean res; MonoGenericContext context = { NULL, NULL }; MonoClass *klass = rgctx->class_vtable->klass; @@ -4096,16 +4091,22 @@ gpointer mono_aot_get_method (MonoDomain *domain, MonoMethod *method) { MonoClass *klass = method->klass; + MonoMethod *orig_method = method; guint32 method_index; - MonoAotModule *amodule = klass->image->aot_module; + MonoAotModule *amodule = (MonoAotModule *)klass->image->aot_module; guint8 *code; + gboolean cache_result = FALSE; + + if (domain != mono_get_root_domain ()) + /* Non shared AOT code can't be used in other appdomains */ + return NULL; if (enable_aot_cache && !amodule && domain->entry_assembly && klass->image == mono_defaults.corlib) { /* This cannot be AOTed during startup, so do it now */ if (!mscorlib_aot_loaded) { mscorlib_aot_loaded = TRUE; load_aot_module (klass->image->assembly, NULL); - amodule = klass->image->aot_module; + amodule = (MonoAotModule *)klass->image->aot_module; } } @@ -4152,11 +4153,12 @@ mono_aot_get_method (MonoDomain *domain, MonoMethod *method) } else if (method->is_inflated || !method->token) { /* This hash table is used to avoid the slower search in the extra_method_table in the AOT image */ amodule_lock (amodule); - code = g_hash_table_lookup (amodule->method_to_code, method); + code = (guint8 *)g_hash_table_lookup (amodule->method_to_code, method); amodule_unlock (amodule); if (code) return code; + cache_result = TRUE; method_index = find_aot_method (method, &amodule); /* * Special case the ICollection wrappers for arrays, as they cannot @@ -4166,7 +4168,7 @@ mono_aot_get_method (MonoDomain *domain, MonoMethod *method) if (method_index == 0xffffff && method->wrapper_type == MONO_WRAPPER_MANAGED_TO_MANAGED && method->klass->rank && strstr (method->name, "System.Collections.Generic")) { MonoMethod *m = mono_aot_get_array_helper_from_wrapper (method); - code = mono_aot_get_method (domain, m); + code = (guint8 *)mono_aot_get_method (domain, m); if (code) return code; } @@ -4200,7 +4202,7 @@ mono_aot_get_method (MonoDomain *domain, MonoMethod *method) * Get the code for the instantiation which should be emitted into * the mscorlib aot image by the AOT compiler. */ - code = mono_aot_get_method (domain, m); + code = (guint8 *)mono_aot_get_method (domain, m); if (code) return code; } @@ -4238,7 +4240,7 @@ mono_aot_get_method (MonoDomain *domain, MonoMethod *method) * Get the code for the instantiation which should be emitted into * the mscorlib aot image by the AOT compiler. */ - code = mono_aot_get_method (domain, m); + code = (guint8 *)mono_aot_get_method (domain, m); if (code) return code; } @@ -4256,7 +4258,7 @@ mono_aot_get_method (MonoDomain *domain, MonoMethod *method) m = mono_marshal_get_array_accessor_wrapper (m); if (m != method) { - code = mono_aot_get_method (domain, m); + code = (guint8 *)mono_aot_get_method (domain, m); if (code) return code; } @@ -4305,7 +4307,13 @@ mono_aot_get_method (MonoDomain *domain, MonoMethod *method) method_index = mono_metadata_token_index (method->token) - 1; } - return load_method (domain, amodule, klass->image, method, method->token, method_index); + code = (guint8 *)load_method (domain, amodule, klass->image, method, method->token, method_index); + if (code && cache_result) { + amodule_lock (amodule); + g_hash_table_insert (amodule->method_to_code, orig_method, code); + amodule_unlock (amodule); + } + return code; } /** @@ -4315,7 +4323,7 @@ mono_aot_get_method (MonoDomain *domain, MonoMethod *method) gpointer mono_aot_get_method_from_token (MonoDomain *domain, MonoImage *image, guint32 token) { - MonoAotModule *aot_module = image->aot_module; + MonoAotModule *aot_module = (MonoAotModule *)image->aot_module; int method_index; if (!aot_module) @@ -4438,7 +4446,7 @@ mono_aot_plt_resolve (gpointer aot_module, guint32 plt_info_offset, guint8 *code p = &module->blob [plt_info_offset]; - ji.type = decode_value (p, &p); + ji.type = (MonoJumpInfoType)decode_value (p, &p); mp = mono_mempool_new (); res = decode_patch (module, mp, &ji, p, &p); @@ -4460,10 +4468,10 @@ mono_aot_plt_resolve (gpointer aot_module, guint32 plt_info_offset, guint8 *code */ if (mono_aot_only && ji.type == MONO_PATCH_INFO_METHOD && !ji.data.method->is_generic && !mono_method_check_context_used (ji.data.method) && !(ji.data.method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED) && !mono_method_needs_static_rgctx_invoke (ji.data.method, FALSE) && !using_gsharedvt) { - target = mono_jit_compile_method (ji.data.method); + target = (guint8 *)mono_jit_compile_method (ji.data.method); no_ftnptr = TRUE; } else { - target = mono_resolve_patch_target (NULL, mono_domain_get (), NULL, &ji, TRUE); + target = (guint8 *)mono_resolve_patch_target (NULL, mono_domain_get (), NULL, &ji, TRUE); } /* @@ -4484,7 +4492,7 @@ mono_aot_plt_resolve (gpointer aot_module, guint32 plt_info_offset, guint8 *code #ifdef PPC_USES_FUNCTION_DESCRIPTOR g_assert (((gpointer*)target) [2] != 0); #endif - target = mono_create_ftnptr (mono_domain_get (), target); + target = (guint8 *)mono_create_ftnptr (mono_domain_get (), target); } mono_mempool_destroy (mp); @@ -4681,7 +4689,7 @@ load_function_full (MonoAotModule *amodule, const char *name, MonoTrampInfo **ou uw_info_len = decode_value (uw_info, &uw_info); tinfo = g_new0 (MonoTrampInfo, 1); - tinfo->code = code; + tinfo->code = (guint8 *)code; tinfo->code_size = code_size; tinfo->uw_info = uw_info; tinfo->uw_info_len = uw_info_len; @@ -4725,7 +4733,7 @@ load_function_full (MonoAotModule *amodule, const char *name, MonoTrampInfo **ou } else if (!strcmp (ji->data.name, "mono_throw_exception")) { target = mono_get_throw_exception (); } else if (strstr (ji->data.name, "trampoline_func_") == ji->data.name) { - int tramp_type2 = atoi (ji->data.name + strlen ("trampoline_func_")); + MonoTrampolineType tramp_type2 = (MonoTrampolineType)atoi (ji->data.name + strlen ("trampoline_func_")); target = (gpointer)mono_get_trampoline_func (tramp_type2); } else if (strstr (ji->data.name, "specific_trampoline_lazy_fetch_") == ji->data.name) { /* atoll is needed because the the offset is unsigned */ @@ -4735,7 +4743,7 @@ load_function_full (MonoAotModule *amodule, const char *name, MonoTrampInfo **ou res = sscanf (ji->data.name, "specific_trampoline_lazy_fetch_%u", &slot); g_assert (res == 1); target = mono_create_specific_trampoline (GUINT_TO_POINTER (slot), MONO_TRAMPOLINE_RGCTX_LAZY_FETCH, mono_get_root_domain (), NULL); - target = mono_create_ftnptr_malloc (target); + target = mono_create_ftnptr_malloc ((guint8 *)target); } else if (!strcmp (ji->data.name, "mono_thread_get_and_clear_pending_exception")) { target = mono_thread_get_and_clear_pending_exception; } else if (!strcmp (ji->data.name, "debugger_agent_single_step_from_context")) { @@ -4756,7 +4764,7 @@ load_function_full (MonoAotModule *amodule, const char *name, MonoTrampInfo **ou /* Hopefully the code doesn't have patches which need method or * domain to be set. */ - target = mono_resolve_patch_target (NULL, NULL, code, ji, FALSE); + target = mono_resolve_patch_target (NULL, NULL, (guint8 *)code, ji, FALSE); g_assert (target); } @@ -4785,7 +4793,7 @@ get_mscorlib_aot_module (void) image = mono_defaults.corlib; if (image) - amodule = image->aot_module; + amodule = (MonoAotModule *)image->aot_module; else amodule = mscorlib_aot_module; g_assert (amodule); @@ -4812,7 +4820,7 @@ mono_aot_get_trampoline_full (const char *name, MonoTrampInfo **out_tinfo) return no_trampolines; } - return mono_create_ftnptr_malloc (load_function_full (amodule, name, out_tinfo)); + return mono_create_ftnptr_malloc ((guint8 *)load_function_full (amodule, name, out_tinfo)); } gpointer @@ -5146,14 +5154,14 @@ mono_aot_create_specific_trampoline (MonoImage *image, gpointer arg1, MonoTrampo g_free (symbol); } - tramp = generic_trampolines [tramp_type]; + tramp = (guint8 *)generic_trampolines [tramp_type]; g_assert (tramp); if (USE_PAGE_TRAMPOLINES) { - code = get_new_specific_trampoline_from_page (tramp, arg1); + code = (guint8 *)get_new_specific_trampoline_from_page (tramp, arg1); tramp_size = 8; } else { - code = get_numerous_trampoline (MONO_AOT_TRAMP_SPECIFIC, 2, &amodule, &got_offset, &tramp_size); + code = (guint8 *)get_numerous_trampoline (MONO_AOT_TRAMP_SPECIFIC, 2, &amodule, &got_offset, &tramp_size); amodule->got [got_offset] = tramp; amodule->got [got_offset + 1] = arg1; @@ -5173,9 +5181,9 @@ mono_aot_get_static_rgctx_trampoline (gpointer ctx, gpointer addr) guint32 got_offset; if (USE_PAGE_TRAMPOLINES) { - code = get_new_rgctx_trampoline_from_page (addr, ctx); + code = (guint8 *)get_new_rgctx_trampoline_from_page (addr, ctx); } else { - code = get_numerous_trampoline (MONO_AOT_TRAMP_STATIC_RGCTX, 2, &amodule, &got_offset, NULL); + code = (guint8 *)get_numerous_trampoline (MONO_AOT_TRAMP_STATIC_RGCTX, 2, &amodule, &got_offset, NULL); amodule->got [got_offset] = ctx; amodule->got [got_offset + 1] = addr; @@ -5208,12 +5216,12 @@ mono_aot_get_unbox_trampoline (MonoMethod *method) } g_assert (method_index != 0xffffff); } else { - amodule = method->klass->image->aot_module; + amodule = (MonoAotModule *)method->klass->image->aot_module; g_assert (amodule); } if (amodule->info.llvm_get_unbox_tramp) { - gpointer (*get_tramp) (int) = amodule->info.llvm_get_unbox_tramp; + gpointer (*get_tramp) (int) = (gpointer (*)(int))amodule->info.llvm_get_unbox_tramp; code = get_tramp (method_index); if (code) @@ -5242,7 +5250,7 @@ mono_aot_get_unbox_trampoline (MonoMethod *method) code = get_call_table_entry (amodule->unbox_trampoline_addresses, entry_index); g_assert (code); - tinfo = mono_tramp_info_create (NULL, code, 0, NULL, NULL); + tinfo = mono_tramp_info_create (NULL, (guint8 *)code, 0, NULL, NULL); symbol_addr = read_unwind_info (amodule, tinfo, "unbox_trampoline_p"); if (!symbol_addr) { @@ -5262,7 +5270,7 @@ mono_aot_get_lazy_fetch_trampoline (guint32 slot) { char *symbol; gpointer code; - MonoAotModule *amodule = mono_defaults.corlib->aot_module; + MonoAotModule *amodule = (MonoAotModule *)mono_defaults.corlib->aot_module; guint32 index = MONO_RGCTX_SLOT_INDEX (slot); static int count = 0; @@ -5276,7 +5284,7 @@ mono_aot_get_lazy_fetch_trampoline (guint32 slot) */ if (!addr) addr = load_function (amodule, "rgctx_fetch_trampoline_general"); - info = mono_domain_alloc0 (mono_get_root_domain (), sizeof (gpointer) * 2); + info = (void **)mono_domain_alloc0 (mono_get_root_domain (), sizeof (gpointer) * 2); info [0] = GUINT_TO_POINTER (slot); info [1] = mono_create_specific_trampoline (GUINT_TO_POINTER (slot), MONO_TRAMPOLINE_RGCTX_LAZY_FETCH, mono_get_root_domain (), NULL); code = mono_aot_get_static_rgctx_trampoline (info, addr); @@ -5284,7 +5292,7 @@ mono_aot_get_lazy_fetch_trampoline (guint32 slot) } symbol = mono_get_rgctx_fetch_trampoline_name (slot); - code = load_function (mono_defaults.corlib->aot_module, symbol); + code = load_function ((MonoAotModule *)mono_defaults.corlib->aot_module, symbol); g_free (symbol); /* The caller expects an ftnptr */ return mono_create_ftnptr (mono_domain_get (), code); @@ -5317,7 +5325,7 @@ mono_aot_get_imt_thunk (MonoVTable *vtable, MonoDomain *domain, MonoIMTCheckItem } /* Save the entries into an array */ - buf = mono_domain_alloc (domain, (real_count + 1) * 2 * sizeof (gpointer)); + buf = (void **)mono_domain_alloc (domain, (real_count + 1) * 2 * sizeof (gpointer)); index = 0; for (i = 0; i < count; ++i) { MonoIMTCheckItem *item = imt_entries [i]; @@ -5329,7 +5337,7 @@ mono_aot_get_imt_thunk (MonoVTable *vtable, MonoDomain *domain, MonoIMTCheckItem buf [(index * 2)] = item->key; if (item->has_target_code) { - gpointer *p = mono_domain_alloc (domain, sizeof (gpointer)); + gpointer *p = (gpointer *)mono_domain_alloc (domain, sizeof (gpointer)); *p = item->value.target_code; buf [(index * 2) + 1] = p; } else { @@ -5359,9 +5367,9 @@ mono_aot_get_gsharedvt_arg_trampoline (gpointer arg, gpointer addr) guint32 got_offset; if (USE_PAGE_TRAMPOLINES) { - code = get_new_gsharedvt_arg_trampoline_from_page (addr, arg); + code = (guint8 *)get_new_gsharedvt_arg_trampoline_from_page (addr, arg); } else { - code = get_numerous_trampoline (MONO_AOT_TRAMP_GSHAREDVT_ARG, 2, &amodule, &got_offset, NULL); + code = (guint8 *)get_numerous_trampoline (MONO_AOT_TRAMP_GSHAREDVT_ARG, 2, &amodule, &got_offset, NULL); amodule->got [got_offset] = arg; amodule->got [got_offset + 1] = addr; diff --git a/mono/mini/aot-tests.cs b/mono/mini/aot-tests.cs index 048ae081e4e..6092346ea4c 100644 --- a/mono/mini/aot-tests.cs +++ b/mono/mini/aot-tests.cs @@ -303,6 +303,52 @@ class Tests return 0; } + enum UInt32Enum : uint { + A = 1 + } + + enum Int32Enum : int { + A = 1 + } + + enum Int16Enum : short { + A = 1 + } + + enum UInt16Enum : ushort { + A = 1 + } + + enum Int8Enum : sbyte { + A = 1 + } + + enum UInt8Enum : byte { + A = 1 + } + + public static int test_0_int_enum_eq_comparer () { + var t1 = new Dictionary (); + t1 [Int32Enum.A] = "foo"; + + var t2 = new Dictionary (); + t2 [UInt32Enum.A] = "foo"; + + var t3 = new Dictionary (); + t3 [UInt16Enum.A] = "foo"; + + var t4 = new Dictionary (); + t4 [Int16Enum.A] = "foo"; + + var t5 = new Dictionary (); + t5 [Int8Enum.A] = "foo"; + + var t6 = new Dictionary (); + t6 [UInt8Enum.A] = "foo"; + + return 0; + } + public static int test_0_array_accessor_runtime_invoke_ref () { var t = typeof (string[]); var arr = Array.CreateInstance (typeof (string), 1); @@ -312,4 +358,47 @@ class Tests return 1; return 0; } + + public static void SetArrayValue_ (T[] values) { + values.Select (x => x).ToArray (); + } + + [Category ("GSHAREDVT")] + public static int test_0_delegate_invoke_wrappers_gsharedvt () { + var enums = new LongEnum [] { LongEnum.A }; + SetArrayValue_ (enums); + return 0; + } + + struct LargeStruct { + public int a, b, c, d; + } + + [MethodImplAttribute (MethodImplOptions.NoInlining)] + public static bool GetHasValue(T? value) where T : struct + { + return value.HasValue; + } + + [Category ("DYNCALL")] + public static int test_0_large_nullable_invoke () { + var s = new LargeStruct () { a = 1, b = 2, c = 3, d = 4 }; + + GetHasValue (s); + +#if __MOBILE__ + var m = typeof(AotTests).GetMethod("GetHasValue", BindingFlags.Static | BindingFlags.Public); +#else + var m = typeof(Tests).GetMethod("GetHasValue", BindingFlags.Static | BindingFlags.Public); +#endif + + Type type = typeof (LargeStruct?).GetGenericArguments () [0]; + bool b1 = (bool)m.MakeGenericMethod (new Type[] {type}).Invoke (null, new object[] { s }); + if (!b1) + return 1; + bool b2 = (bool)m.MakeGenericMethod (new Type[] {type}).Invoke (null, new object[] { null }); + if (b2) + return 2; + return 0; + } } diff --git a/mono/mini/branch-opts.c b/mono/mini/branch-opts.c index a6d4915ee36..aeb11a0ff0e 100644 --- a/mono/mini/branch-opts.c +++ b/mono/mini/branch-opts.c @@ -85,7 +85,7 @@ mono_branch_optimize_exception_target (MonoCompile *cfg, MonoBasicBlock *bb, con MONO_INST_NEW (cfg, jump, OP_BR); /* Allocate memory for our branch target */ - jump->inst_i1 = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst)); + jump->inst_i1 = (MonoInst *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst)); jump->inst_true_bb = targetbb; if (cfg->verbose_level > 2) @@ -851,7 +851,7 @@ replace_out_block_in_code (MonoBasicBlock *bb, MonoBasicBlock *orig, MonoBasicBl ins->inst_false_bb = repl; } else if (MONO_IS_JUMP_TABLE (ins)) { int i; - MonoJumpInfoBBTable *table = MONO_JUMP_TABLE_FROM_INS (ins); + MonoJumpInfoBBTable *table = (MonoJumpInfoBBTable *)MONO_JUMP_TABLE_FROM_INS (ins); for (i = 0; i < table->table_size; i++ ) { if (table->table [i] == orig) table->table [i] = repl; @@ -995,7 +995,7 @@ mono_merge_basic_blocks (MonoCompile *cfg, MonoBasicBlock *bb, MonoBasicBlock *b for (inst = bb->code; inst != NULL; inst = inst->next) { if (MONO_IS_JUMP_TABLE (inst)) { int i; - MonoJumpInfoBBTable *table = MONO_JUMP_TABLE_FROM_INS (inst); + MonoJumpInfoBBTable *table = (MonoJumpInfoBBTable *)MONO_JUMP_TABLE_FROM_INS (inst); for (i = 0; i < table->table_size; i++ ) { /* Might be already NULL from a previous merge */ if (table->table [i]) @@ -1137,7 +1137,7 @@ mono_remove_critical_edges (MonoCompile *cfg) * overwrite the sreg1 of the ins. */ if ((in_bb->out_count > 1) || (in_bb->out_count == 1 && in_bb->last_ins && in_bb->last_ins->opcode == OP_BR_REG)) { - MonoBasicBlock *new_bb = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoBasicBlock)); + MonoBasicBlock *new_bb = (MonoBasicBlock *)mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoBasicBlock)); new_bb->block_num = cfg->num_bblocks++; // new_bb->real_offset = bb->real_offset; new_bb->region = bb->region; @@ -1161,7 +1161,7 @@ mono_remove_critical_edges (MonoCompile *cfg) /* We cannot add any inst to the entry BB, so we must */ /* put a new BB in the middle to hold the OP_BR */ MonoInst *jump; - MonoBasicBlock *new_bb_after_entry = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoBasicBlock)); + MonoBasicBlock *new_bb_after_entry = (MonoBasicBlock *)mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoBasicBlock)); new_bb_after_entry->block_num = cfg->num_bblocks++; // new_bb_after_entry->real_offset = bb->real_offset; new_bb_after_entry->region = bb->region; @@ -1190,10 +1190,10 @@ mono_remove_critical_edges (MonoCompile *cfg) previous_bb = new_bb; /* Setup in_bb and out_bb */ - new_bb->in_bb = mono_mempool_alloc ((cfg)->mempool, sizeof (MonoBasicBlock*)); + new_bb->in_bb = (MonoBasicBlock **)mono_mempool_alloc ((cfg)->mempool, sizeof (MonoBasicBlock*)); new_bb->in_bb [0] = in_bb; new_bb->in_count = 1; - new_bb->out_bb = mono_mempool_alloc ((cfg)->mempool, sizeof (MonoBasicBlock*)); + new_bb->out_bb = (MonoBasicBlock **)mono_mempool_alloc ((cfg)->mempool, sizeof (MonoBasicBlock*)); new_bb->out_bb [0] = bb; new_bb->out_count = 1; diff --git a/mono/mini/debug-mini.c b/mono/mini/debug-mini.c index 92ff7d8ce1f..8ee0457a564 100644 --- a/mono/mini/debug-mini.c +++ b/mono/mini/debug-mini.c @@ -451,7 +451,7 @@ mono_debug_serialize_debug_info (MonoCompile *cfg, guint8 **out_buf, guint32 *bu } size = ((jit->num_params + jit->num_locals + 1) * 10) + (jit->num_line_numbers * 10) + 64; - p = buf = g_malloc (size); + p = buf = (guint8 *)g_malloc (size); encode_value (jit->epilogue_begin, p, &p); encode_value (jit->prologue_end, p, &p); encode_value (jit->code_size, p, &p); @@ -650,7 +650,7 @@ void mono_debug_print_vars (gpointer ip, gboolean only_arguments) { MonoDomain *domain = mono_domain_get (); - MonoJitInfo *ji = mono_jit_info_table_find (domain, ip); + MonoJitInfo *ji = mono_jit_info_table_find (domain, (char *)ip); MonoDebugMethodJitInfo *jit; int i; @@ -730,7 +730,7 @@ mono_debugger_method_has_breakpoint (MonoMethod *method) return 0; for (i = 0; i < breakpoints->len; i++) { - MiniDebugBreakpointInfo *info = g_ptr_array_index (breakpoints, i); + MiniDebugBreakpointInfo *info = (MiniDebugBreakpointInfo *)g_ptr_array_index (breakpoints, i); if (!mono_method_desc_full_match (info->desc, method)) continue; diff --git a/mono/mini/debugger-agent.c b/mono/mini/debugger-agent.c index eef2438346a..a8e6b3920eb 100644 --- a/mono/mini/debugger-agent.c +++ b/mono/mini/debugger-agent.c @@ -62,7 +62,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -91,7 +92,7 @@ #ifndef DISABLE_DEBUGGER_AGENT -#include +#include #define THREAD_TO_INTERNAL(thread) (thread)->internal_thread @@ -680,10 +681,10 @@ static GPtrArray *pending_assembly_loads; static gboolean debugger_thread_exited; /* Cond variable used to wait for debugger_thread_exited becoming true */ -static mono_cond_t debugger_thread_exited_cond; +static MonoCoopCond debugger_thread_exited_cond; /* Mutex for the cond var above */ -static mono_mutex_t debugger_thread_exited_mutex; +static MonoCoopMutex debugger_thread_exited_mutex; static DebuggerProfiler debugger_profiler; @@ -715,14 +716,9 @@ static gboolean buffer_replies; static ReplyPacket reply_packets [128]; int nreply_packets; -#define dbg_lock() do { \ - MONO_TRY_BLOCKING; \ - mono_mutex_lock (&debug_mutex); \ - MONO_FINISH_TRY_BLOCKING; \ -} while (0) - -#define dbg_unlock() mono_mutex_unlock (&debug_mutex) -static mono_mutex_t debug_mutex; +#define dbg_lock() mono_coop_mutex_lock (&debug_mutex) +#define dbg_unlock() mono_coop_mutex_unlock (&debug_mutex) +static MonoCoopMutex debug_mutex; static void transport_init (void); static void transport_connect (const char *address); @@ -822,7 +818,7 @@ parse_address (char *address, char **host, int *port) if (pos == NULL || pos == address) return 1; - *host = g_malloc (pos - address + 1); + *host = (char *)g_malloc (pos - address + 1); strncpy (*host, address, pos - address); (*host) [pos - address] = '\0'; @@ -961,7 +957,7 @@ mono_debugger_agent_parse_options (char *options) void mono_debugger_agent_init (void) { - mono_mutex_init_recursive (&debug_mutex); + mono_coop_mutex_init_recursive (&debug_mutex); if (!agent_config.enabled) return; @@ -973,11 +969,11 @@ mono_debugger_agent_init (void) event_requests = g_ptr_array_new (); - mono_mutex_init (&debugger_thread_exited_mutex); - mono_cond_init (&debugger_thread_exited_cond, 0); + mono_coop_mutex_init (&debugger_thread_exited_mutex); + mono_coop_cond_init (&debugger_thread_exited_cond); mono_profiler_install ((MonoProfiler*)&debugger_profiler, runtime_shutdown); - mono_profiler_set_events (MONO_PROFILE_APPDOMAIN_EVENTS | MONO_PROFILE_THREADS | MONO_PROFILE_ASSEMBLY_EVENTS | MONO_PROFILE_JIT_COMPILATION | MONO_PROFILE_METHOD_EVENTS); + mono_profiler_set_events ((MonoProfileFlags)(MONO_PROFILE_APPDOMAIN_EVENTS | MONO_PROFILE_THREADS | MONO_PROFILE_ASSEMBLY_EVENTS | MONO_PROFILE_JIT_COMPILATION | MONO_PROFILE_METHOD_EVENTS)); mono_profiler_install_runtime_initialized (runtime_initialized); mono_profiler_install_appdomain (NULL, appdomain_load, appdomain_start_unload, appdomain_unload); mono_profiler_install_thread (thread_startup, thread_end); @@ -1075,7 +1071,7 @@ finish_agent_init (gboolean on_startup) argv [2] = agent_config.address; argv [3] = NULL; - res = g_spawn_async_with_pipes (NULL, argv, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + res = g_spawn_async_with_pipes (NULL, argv, NULL, (GSpawnFlags)0, NULL, NULL, NULL, NULL, NULL, NULL, NULL); if (!res) { fprintf (stderr, "Failed to execute '%s'.\n", agent_config.launch); exit (1); @@ -1104,9 +1100,6 @@ mono_debugger_agent_cleanup (void) breakpoints_cleanup (); objrefs_cleanup (); ids_cleanup (); - - mono_mutex_destroy (&debugger_thread_exited_mutex); - mono_cond_destroy (&debugger_thread_exited_cond); } /* @@ -1538,18 +1531,18 @@ transport_handshake (void) /* Write handshake message */ sprintf (handshake_msg, "DWP-Handshake"); /* Must use try blocking as this can nest into code that runs blocking */ - MONO_TRY_BLOCKING; + MONO_PREPARE_BLOCKING; do { res = transport_send (handshake_msg, strlen (handshake_msg)); } while (res == -1 && get_last_sock_error () == MONO_EINTR); - MONO_FINISH_TRY_BLOCKING; + MONO_FINISH_BLOCKING; g_assert (res != -1); /* Read answer */ - MONO_TRY_BLOCKING; + MONO_PREPARE_BLOCKING; res = transport_recv (buf, strlen (handshake_msg)); - MONO_FINISH_TRY_BLOCKING; + MONO_FINISH_BLOCKING; if ((res != strlen (handshake_msg)) || (memcmp (buf, handshake_msg, strlen (handshake_msg)) != 0)) { fprintf (stderr, "debugger-agent: DWP handshake failed.\n"); return FALSE; @@ -1604,12 +1597,10 @@ stop_debugger_thread (void) */ if (!is_debugger_thread ()) { do { - MONO_TRY_BLOCKING; - mono_mutex_lock (&debugger_thread_exited_mutex); + mono_coop_mutex_lock (&debugger_thread_exited_mutex); if (!debugger_thread_exited) - mono_cond_wait (&debugger_thread_exited_cond, &debugger_thread_exited_mutex); - mono_mutex_unlock (&debugger_thread_exited_mutex); - MONO_FINISH_TRY_BLOCKING; + mono_coop_cond_wait (&debugger_thread_exited_cond, &debugger_thread_exited_mutex); + mono_coop_mutex_unlock (&debugger_thread_exited_mutex); } while (!debugger_thread_exited); } @@ -1674,7 +1665,7 @@ decode_string (guint8 *buf, guint8 **endbuf, guint8 *limit) return NULL; } - s = g_malloc (len + 1); + s = (char *)g_malloc (len + 1); g_assert (s); memcpy (s, buf, len); @@ -1692,7 +1683,7 @@ decode_string (guint8 *buf, guint8 **endbuf, guint8 *limit) static inline void buffer_init (Buffer *buf, int size) { - buf->buf = g_malloc (size); + buf->buf = (guint8 *)g_malloc (size); buf->p = buf->buf; buf->end = buf->buf + size; } @@ -1708,7 +1699,7 @@ buffer_make_room (Buffer *buf, int size) { if (buf->end - buf->p < size) { int new_size = buf->end - buf->buf + size + 32; - guint8 *p = g_realloc (buf->buf, new_size); + guint8 *p = (guint8 *)g_realloc (buf->buf, new_size); size = buf->p - buf->buf; buf->buf = p; buf->p = p + size; @@ -1917,7 +1908,7 @@ static MonoGHashTable *suspended_objs; static void free_objref (gpointer value) { - ObjRef *o = value; + ObjRef *o = (ObjRef *)value; mono_gchandle_free (o->handle); @@ -1973,9 +1964,9 @@ get_objref (MonoObject *obj) */ hash = mono_object_hash (obj); - reflist = g_hash_table_lookup (obj_to_objref, GINT_TO_POINTER (hash)); + reflist = (GSList *)g_hash_table_lookup (obj_to_objref, GINT_TO_POINTER (hash)); for (l = reflist; l; l = l->next) { - ref = l->data; + ref = (ObjRef *)l->data; if (ref && mono_gchandle_get_target (ref->handle) == obj) { mono_loader_unlock (); return ref; @@ -1983,7 +1974,7 @@ get_objref (MonoObject *obj) } } else { /* Use a hash table with masked pointers to internalize object references */ - ref = g_hash_table_lookup (obj_to_objref, GINT_TO_POINTER (~((gsize)obj))); + ref = (ObjRef *)g_hash_table_lookup (obj_to_objref, GINT_TO_POINTER (~((gsize)obj))); /* ref might refer to a different object with the same addr which was GCd */ if (ref && mono_gchandle_get_target (ref->handle) == obj) { mono_loader_unlock (); @@ -2041,7 +2032,7 @@ get_object_allow_null (int objid, MonoObject **obj) if (objid == 0) { *obj = NULL; - return 0; + return ERR_NONE; } if (!objrefs) @@ -2049,14 +2040,14 @@ get_object_allow_null (int objid, MonoObject **obj) mono_loader_lock (); - ref = g_hash_table_lookup (objrefs, GINT_TO_POINTER (objid)); + ref = (ObjRef *)g_hash_table_lookup (objrefs, GINT_TO_POINTER (objid)); if (ref) { *obj = mono_gchandle_get_target (ref->handle); mono_loader_unlock (); if (!(*obj)) return ERR_INVALID_OBJECT; - return 0; + return ERR_NONE; } else { mono_loader_unlock (); return ERR_INVALID_OBJECT; @@ -2066,13 +2057,13 @@ get_object_allow_null (int objid, MonoObject **obj) static ErrorCode get_object (int objid, MonoObject **obj) { - int err = get_object_allow_null (objid, obj); + ErrorCode err = get_object_allow_null (objid, obj); - if (err) + if (err != ERR_NONE) return err; if (!(*obj)) return ERR_INVALID_OBJECT; - return 0; + return ERR_NONE; } static inline int @@ -2168,7 +2159,7 @@ ids_cleanup (void) void mono_debugger_agent_free_domain_info (MonoDomain *domain) { - AgentDomainInfo *info = domain_jit_info (domain)->agent_info; + AgentDomainInfo *info = (AgentDomainInfo *)domain_jit_info (domain)->agent_info; int i, j; GHashTableIter iter; GPtrArray *file_names; @@ -2210,7 +2201,7 @@ mono_debugger_agent_free_domain_info (MonoDomain *domain) for (i = 0; i < ID_NUM; ++i) { if (ids [i]) { for (j = 0; j < ids [i]->len; ++j) { - Id *id = g_ptr_array_index (ids [i], j); + Id *id = (Id *)g_ptr_array_index (ids [i], j); if (id->domain == domain) id->domain = NULL; } @@ -2230,9 +2221,10 @@ get_agent_domain_info (MonoDomain *domain) mono_domain_lock (domain); - info = domain_jit_info (domain)->agent_info; + info = (AgentDomainInfo *)domain_jit_info (domain)->agent_info; if (!info) { - info = domain_jit_info (domain)->agent_info = g_new0 (AgentDomainInfo, 1); + info = g_new0 (AgentDomainInfo, 1); + domain_jit_info (domain)->agent_info = info; info->loaded_classes = g_hash_table_new (mono_aligned_addr_hash, NULL); info->source_files = g_hash_table_new (mono_aligned_addr_hash, NULL); info->source_file_to_class = g_hash_table_new (g_str_hash, g_str_equal); @@ -2260,7 +2252,7 @@ get_id (MonoDomain *domain, IdType type, gpointer val) if (info->val_to_id [type] == NULL) info->val_to_id [type] = g_hash_table_new (mono_aligned_addr_hash, NULL); - id = g_hash_table_lookup (info->val_to_id [type], val); + id = (Id *)g_hash_table_lookup (info->val_to_id [type], val); if (id) { dbg_unlock (); return id->id; @@ -2281,13 +2273,13 @@ get_id (MonoDomain *domain, IdType type, gpointer val) } static inline gpointer -decode_ptr_id (guint8 *buf, guint8 **endbuf, guint8 *limit, IdType type, MonoDomain **domain, int *err) +decode_ptr_id (guint8 *buf, guint8 **endbuf, guint8 *limit, IdType type, MonoDomain **domain, ErrorCode *err) { Id *res; int id = decode_id (buf, endbuf, limit); - *err = 0; + *err = ERR_NONE; if (domain) *domain = NULL; @@ -2298,7 +2290,7 @@ decode_ptr_id (guint8 *buf, guint8 **endbuf, guint8 *limit, IdType type, MonoDom dbg_lock (); g_assert (id > 0 && id <= ids [type]->len); - res = g_ptr_array_index (ids [type], GPOINTER_TO_INT (id - 1)); + res = (Id *)g_ptr_array_index (ids [type], GPOINTER_TO_INT (id - 1)); dbg_unlock (); if (res->domain == NULL) { @@ -2323,11 +2315,11 @@ buffer_add_ptr_id (Buffer *buf, MonoDomain *domain, IdType type, gpointer val) } static inline MonoClass* -decode_typeid (guint8 *buf, guint8 **endbuf, guint8 *limit, MonoDomain **domain, int *err) +decode_typeid (guint8 *buf, guint8 **endbuf, guint8 *limit, MonoDomain **domain, ErrorCode *err) { MonoClass *klass; - klass = decode_ptr_id (buf, endbuf, limit, ID_TYPE, domain, err); + klass = (MonoClass *)decode_ptr_id (buf, endbuf, limit, ID_TYPE, domain, err); if (G_UNLIKELY (log_level >= 2) && klass) { char *s; @@ -2339,23 +2331,23 @@ decode_typeid (guint8 *buf, guint8 **endbuf, guint8 *limit, MonoDomain **domain, } static inline MonoAssembly* -decode_assemblyid (guint8 *buf, guint8 **endbuf, guint8 *limit, MonoDomain **domain, int *err) +decode_assemblyid (guint8 *buf, guint8 **endbuf, guint8 *limit, MonoDomain **domain, ErrorCode *err) { - return decode_ptr_id (buf, endbuf, limit, ID_ASSEMBLY, domain, err); + return (MonoAssembly *)decode_ptr_id (buf, endbuf, limit, ID_ASSEMBLY, domain, err); } static inline MonoImage* -decode_moduleid (guint8 *buf, guint8 **endbuf, guint8 *limit, MonoDomain **domain, int *err) +decode_moduleid (guint8 *buf, guint8 **endbuf, guint8 *limit, MonoDomain **domain, ErrorCode *err) { - return decode_ptr_id (buf, endbuf, limit, ID_MODULE, domain, err); + return (MonoImage *)decode_ptr_id (buf, endbuf, limit, ID_MODULE, domain, err); } static inline MonoMethod* -decode_methodid (guint8 *buf, guint8 **endbuf, guint8 *limit, MonoDomain **domain, int *err) +decode_methodid (guint8 *buf, guint8 **endbuf, guint8 *limit, MonoDomain **domain, ErrorCode *err) { MonoMethod *m; - m = decode_ptr_id (buf, endbuf, limit, ID_METHOD, domain, err); + m = (MonoMethod *)decode_ptr_id (buf, endbuf, limit, ID_METHOD, domain, err); if (G_UNLIKELY (log_level >= 2) && m) { char *s; @@ -2367,21 +2359,21 @@ decode_methodid (guint8 *buf, guint8 **endbuf, guint8 *limit, MonoDomain **domai } static inline MonoClassField* -decode_fieldid (guint8 *buf, guint8 **endbuf, guint8 *limit, MonoDomain **domain, int *err) +decode_fieldid (guint8 *buf, guint8 **endbuf, guint8 *limit, MonoDomain **domain, ErrorCode *err) { - return decode_ptr_id (buf, endbuf, limit, ID_FIELD, domain, err); + return (MonoClassField *)decode_ptr_id (buf, endbuf, limit, ID_FIELD, domain, err); } static inline MonoDomain* -decode_domainid (guint8 *buf, guint8 **endbuf, guint8 *limit, MonoDomain **domain, int *err) +decode_domainid (guint8 *buf, guint8 **endbuf, guint8 *limit, MonoDomain **domain, ErrorCode *err) { - return decode_ptr_id (buf, endbuf, limit, ID_DOMAIN, domain, err); + return (MonoDomain *)decode_ptr_id (buf, endbuf, limit, ID_DOMAIN, domain, err); } static inline MonoProperty* -decode_propertyid (guint8 *buf, guint8 **endbuf, guint8 *limit, MonoDomain **domain, int *err) +decode_propertyid (guint8 *buf, guint8 **endbuf, guint8 *limit, MonoDomain **domain, ErrorCode *err) { - return decode_ptr_id (buf, endbuf, limit, ID_PROPERTY, domain, err); + return (MonoProperty *)decode_ptr_id (buf, endbuf, limit, ID_PROPERTY, domain, err); } static inline void @@ -2464,7 +2456,7 @@ save_thread_context (MonoContext *ctx) { DebuggerTlsData *tls; - tls = mono_native_tls_get_value (debugger_tls_id); + tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id); g_assert (tls); if (ctx) @@ -2480,20 +2472,20 @@ save_thread_context (MonoContext *ctx) */ static gint32 threads_suspend_count; -static mono_mutex_t suspend_mutex; +static MonoCoopMutex suspend_mutex; /* Cond variable used to wait for suspend_count becoming 0 */ -static mono_cond_t suspend_cond; +static MonoCoopCond suspend_cond; /* Semaphore used to wait for a thread becoming suspended */ -static MonoSemType suspend_sem; +static MonoCoopSem suspend_sem; static void suspend_init (void) { - mono_mutex_init (&suspend_mutex); - mono_cond_init (&suspend_cond, 0); - MONO_SEM_INIT (&suspend_sem, 0); + mono_coop_mutex_init (&suspend_mutex); + mono_coop_cond_init (&suspend_cond); + mono_coop_sem_init (&suspend_sem, 0); } typedef struct @@ -2508,7 +2500,7 @@ typedef struct static gboolean get_last_frame (StackFrameInfo *info, MonoContext *ctx, gpointer user_data) { - GetLastFrameUserData *data = user_data; + GetLastFrameUserData *data = (GetLastFrameUserData *)user_data; if (info->type == FRAME_TYPE_MANAGED_TO_NATIVE || info->type == FRAME_TYPE_TRAMPOLINE) return FALSE; @@ -2608,7 +2600,7 @@ thread_interrupt (DebuggerTlsData *tls, MonoThreadInfo *info, MonoJitInfo *ji) mono_memory_barrier (); tls->suspended = TRUE; - MONO_SEM_POST (&suspend_sem); + mono_coop_sem_post (&suspend_sem); } } } @@ -2621,7 +2613,7 @@ thread_interrupt (DebuggerTlsData *tls, MonoThreadInfo *info, MonoJitInfo *ji) static void reset_native_thread_suspend_state (gpointer key, gpointer value, gpointer user_data) { - DebuggerTlsData *tls = value; + DebuggerTlsData *tls = (DebuggerTlsData *)value; if (!tls->really_suspended && tls->suspended) { tls->suspended = FALSE; @@ -2643,13 +2635,13 @@ typedef struct { static SuspendThreadResult debugger_interrupt_critical (MonoThreadInfo *info, gpointer user_data) { - InterruptData *data = user_data; + InterruptData *data = (InterruptData *)user_data; MonoJitInfo *ji; data->valid_info = TRUE; ji = mono_jit_info_table_find_internal ( - mono_thread_info_get_suspend_state (info)->unwind_data [MONO_UNWIND_DATA_DOMAIN], - MONO_CONTEXT_GET_IP (&mono_thread_info_get_suspend_state (info)->ctx), + (MonoDomain *)mono_thread_info_get_suspend_state (info)->unwind_data [MONO_UNWIND_DATA_DOMAIN], + (char *)MONO_CONTEXT_GET_IP (&mono_thread_info_get_suspend_state (info)->ctx), TRUE, TRUE); @@ -2666,8 +2658,8 @@ debugger_interrupt_critical (MonoThreadInfo *info, gpointer user_data) static void notify_thread (gpointer key, gpointer value, gpointer user_data) { - MonoInternalThread *thread = key; - DebuggerTlsData *tls = value; + MonoInternalThread *thread = (MonoInternalThread *)key; + DebuggerTlsData *tls = (DebuggerTlsData *)value; MonoNativeThreadId tid = MONO_UINT_TO_NATIVE_THREAD_ID (thread->tid); if (mono_native_thread_id_equals (mono_native_thread_id_get (), tid) || tls->terminated) @@ -2692,7 +2684,7 @@ notify_thread (gpointer key, gpointer value, gpointer user_data) static void process_suspend (DebuggerTlsData *tls, MonoContext *ctx) { - guint8 *ip = MONO_CONTEXT_GET_IP (ctx); + guint8 *ip = (guint8 *)MONO_CONTEXT_GET_IP (ctx); MonoJitInfo *ji; MonoMethod *method; @@ -2747,9 +2739,7 @@ suspend_vm (void) { mono_loader_lock (); - MONO_TRY_BLOCKING; - mono_mutex_lock (&suspend_mutex); - MONO_FINISH_TRY_BLOCKING; + mono_coop_mutex_lock (&suspend_mutex); suspend_count ++; @@ -2761,7 +2751,7 @@ suspend_vm (void) mono_g_hash_table_foreach (thread_to_tls, notify_thread, NULL); } - mono_mutex_unlock (&suspend_mutex); + mono_coop_mutex_unlock (&suspend_mutex); if (suspend_count == 1) /* @@ -2787,9 +2777,7 @@ resume_vm (void) mono_loader_lock (); - MONO_TRY_BLOCKING; - mono_mutex_lock (&suspend_mutex); - MONO_FINISH_TRY_BLOCKING; + mono_coop_mutex_lock (&suspend_mutex); g_assert (suspend_count > 0); suspend_count --; @@ -2803,10 +2791,10 @@ resume_vm (void) } /* Signal this even when suspend_count > 0, since some threads might have resume_count > 0 */ - err = mono_cond_broadcast (&suspend_cond); + err = mono_coop_cond_broadcast (&suspend_cond); g_assert (err == 0); - mono_mutex_unlock (&suspend_mutex); + mono_coop_mutex_unlock (&suspend_mutex); //g_assert (err == 0); if (suspend_count == 0) @@ -2830,12 +2818,10 @@ resume_thread (MonoInternalThread *thread) mono_loader_lock (); - tls = mono_g_hash_table_lookup (thread_to_tls, thread); + tls = (DebuggerTlsData *)mono_g_hash_table_lookup (thread_to_tls, thread); g_assert (tls); - - MONO_TRY_BLOCKING; - mono_mutex_lock (&suspend_mutex); - MONO_FINISH_TRY_BLOCKING; + + mono_coop_mutex_lock (&suspend_mutex); g_assert (suspend_count > 0); @@ -2847,10 +2833,10 @@ resume_thread (MonoInternalThread *thread) * Signal suspend_count without decreasing suspend_count, the threads will wake up * but only the one whose resume_count field is > 0 will be resumed. */ - err = mono_cond_broadcast (&suspend_cond); + err = mono_coop_cond_broadcast (&suspend_cond); g_assert (err == 0); - mono_mutex_unlock (&suspend_mutex); + mono_coop_mutex_unlock (&suspend_mutex); //g_assert (err == 0); mono_loader_unlock (); @@ -2873,7 +2859,7 @@ static void invalidate_frames (DebuggerTlsData *tls) { if (!tls) - tls = mono_native_tls_get_value (debugger_tls_id); + tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id); g_assert (tls); free_frames (tls->frames, tls->frame_count); @@ -2907,36 +2893,32 @@ suspend_current (void) return; } - tls = mono_native_tls_get_value (debugger_tls_id); + tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id); g_assert (tls); - MONO_TRY_BLOCKING; - mono_mutex_lock (&suspend_mutex); - MONO_FINISH_TRY_BLOCKING; + mono_coop_mutex_lock (&suspend_mutex); tls->suspending = FALSE; tls->really_suspended = TRUE; if (!tls->suspended) { tls->suspended = TRUE; - MONO_SEM_POST (&suspend_sem); + mono_coop_sem_post (&suspend_sem); } DEBUG_PRINTF (1, "[%p] Suspended.\n", (gpointer)mono_native_thread_id_get ()); - MONO_TRY_BLOCKING; while (suspend_count - tls->resume_count > 0) { - err = mono_cond_wait (&suspend_cond, &suspend_mutex); + err = mono_coop_cond_wait (&suspend_cond, &suspend_mutex); g_assert (err == 0); } - MONO_FINISH_TRY_BLOCKING; tls->suspended = FALSE; tls->really_suspended = FALSE; threads_suspend_count --; - mono_mutex_unlock (&suspend_mutex); + mono_coop_mutex_unlock (&suspend_mutex); DEBUG_PRINTF (1, "[%p] Resumed.\n", (gpointer)mono_native_thread_id_get ()); @@ -2957,7 +2939,7 @@ suspend_current (void) static void count_thread (gpointer key, gpointer value, gpointer user_data) { - DebuggerTlsData *tls = value; + DebuggerTlsData *tls = (DebuggerTlsData *)value; if (!tls->suspended && !tls->terminated) *(int*)user_data = *(int*)user_data + 1; @@ -2995,7 +2977,7 @@ wait_for_suspend (void) nwait = count_threads_to_wait_for (); if (nwait) { DEBUG_PRINTF (1, "Waiting for %d(%d) threads to suspend...\n", nwait, nthreads); - err = MONO_SEM_WAIT (&suspend_sem); + err = mono_coop_sem_wait (&suspend_sem, MONO_SEM_FLAGS_NONE); g_assert (err == 0); waited = TRUE; } else { @@ -3035,7 +3017,7 @@ typedef struct { static gboolean process_frame (StackFrameInfo *info, MonoContext *ctx, gpointer user_data) { - ComputeFramesUserData *ud = user_data; + ComputeFramesUserData *ud = (ComputeFramesUserData *)user_data; StackFrame *frame; MonoMethod *method, *actual_method, *api_method; SeqPoint sp; @@ -3110,7 +3092,7 @@ process_frame (StackFrameInfo *info, MonoContext *ctx, gpointer user_data) static gboolean process_filter_frame (StackFrameInfo *info, MonoContext *ctx, gpointer user_data) { - ComputeFramesUserData *ud = user_data; + ComputeFramesUserData *ud = (ComputeFramesUserData *)user_data; /* * 'tls->filter_ctx' is the location of the throw site. @@ -3133,7 +3115,7 @@ static StackFrame** compute_frame_info_from (MonoInternalThread *thread, DebuggerTlsData *tls, MonoThreadUnwindState *state, int *out_nframes) { ComputeFramesUserData user_data; - MonoUnwindOptions opts = MONO_UNWIND_DEFAULT|MONO_UNWIND_REG_LOCATIONS; + MonoUnwindOptions opts = (MonoUnwindOptions)(MONO_UNWIND_DEFAULT | MONO_UNWIND_REG_LOCATIONS); StackFrame **res; int i, nframes; GSList *l; @@ -3147,7 +3129,7 @@ compute_frame_info_from (MonoInternalThread *thread, DebuggerTlsData *tls, MonoT res = g_new0 (StackFrame*, nframes); l = user_data.frames; for (i = 0; i < nframes; ++i) { - res [i] = l->data; + res [i] = (StackFrame *)l->data; l = l->next; } *out_nframes = nframes; @@ -3162,7 +3144,7 @@ compute_frame_info (MonoInternalThread *thread, DebuggerTlsData *tls) GSList *tmp; int i, findex, new_frame_count; StackFrame **new_frames, *f; - MonoUnwindOptions opts = MONO_UNWIND_DEFAULT|MONO_UNWIND_REG_LOCATIONS; + MonoUnwindOptions opts = (MonoUnwindOptions)(MONO_UNWIND_DEFAULT | MONO_UNWIND_REG_LOCATIONS); // FIXME: Locking on tls if (tls->frames && tls->frames_up_to_date) @@ -3203,7 +3185,7 @@ compute_frame_info (MonoInternalThread *thread, DebuggerTlsData *tls) new_frames = g_new0 (StackFrame*, new_frame_count); findex = 0; for (tmp = user_data.frames; tmp; tmp = tmp->next) { - f = tmp->data; + f = (StackFrame *)tmp->data; /* * Reuse the id for already existing stack frames, so invokes don't invalidate @@ -3241,7 +3223,7 @@ static void emit_appdomain_load (gpointer key, gpointer value, gpointer user_data) { process_profiler_event (EVENT_KIND_APPDOMAIN_CREATE, value); - g_hash_table_foreach (get_agent_domain_info (value)->loaded_classes, emit_type_load, NULL); + g_hash_table_foreach (get_agent_domain_info ((MonoDomain *)value)->loaded_classes, emit_type_load, NULL); } /* @@ -3402,7 +3384,7 @@ create_event_list (EventKind event, GPtrArray *reqs, MonoJitInfo *ji, EventInfo return NULL; for (i = 0; i < reqs->len; ++i) { - EventRequest *req = g_ptr_array_index (reqs, i); + EventRequest *req = (EventRequest *)g_ptr_array_index (reqs, i); if (req->event_kind == event) { gboolean filtered = FALSE; @@ -3458,7 +3440,7 @@ create_event_list (EventKind event, GPtrArray *reqs, MonoJitInfo *ji, EventInfo if (minfo) { mono_debug_get_seq_points (minfo, &source_file, &source_file_list, NULL, NULL, NULL); for (i = 0; i < source_file_list->len; ++i) { - sinfo = g_ptr_array_index (source_file_list, i); + sinfo = (MonoDebugSourceInfo *)g_ptr_array_index (source_file_list, i); /* * Do a case-insesitive match by converting the file name to * lowercase. @@ -3638,7 +3620,7 @@ process_event (EventKind event, gpointer arg, gint32 il_offset, MonoContext *ctx thread = mono_thread_current (); if (event == EVENT_KIND_VM_START && arg != NULL) - thread = arg; + thread = (MonoThread *)arg; buffer_add_objid (&buf, (MonoObject*)thread); // thread @@ -3648,32 +3630,32 @@ process_event (EventKind event, gpointer arg, gint32 il_offset, MonoContext *ctx break; case EVENT_KIND_APPDOMAIN_CREATE: case EVENT_KIND_APPDOMAIN_UNLOAD: - buffer_add_domainid (&buf, arg); + buffer_add_domainid (&buf, (MonoDomain *)arg); break; case EVENT_KIND_METHOD_ENTRY: case EVENT_KIND_METHOD_EXIT: - buffer_add_methodid (&buf, domain, arg); + buffer_add_methodid (&buf, domain, (MonoMethod *)arg); break; case EVENT_KIND_ASSEMBLY_LOAD: - buffer_add_assemblyid (&buf, domain, arg); + buffer_add_assemblyid (&buf, domain, (MonoAssembly *)arg); break; case EVENT_KIND_ASSEMBLY_UNLOAD: { DebuggerTlsData *tls; /* The domain the assembly belonged to is not equal to the current domain */ - tls = mono_native_tls_get_value (debugger_tls_id); + tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id); g_assert (tls); g_assert (tls->domain_unloading); - buffer_add_assemblyid (&buf, tls->domain_unloading, arg); + buffer_add_assemblyid (&buf, tls->domain_unloading, (MonoAssembly *)arg); break; } case EVENT_KIND_TYPE_LOAD: - buffer_add_typeid (&buf, domain, arg); + buffer_add_typeid (&buf, domain, (MonoClass *)arg); break; case EVENT_KIND_BREAKPOINT: case EVENT_KIND_STEP: - buffer_add_methodid (&buf, domain, arg); + buffer_add_methodid (&buf, domain, (MonoMethod *)arg); buffer_add_long (&buf, il_offset); break; case EVENT_KIND_VM_START: @@ -3684,7 +3666,7 @@ process_event (EventKind event, gpointer arg, gint32 il_offset, MonoContext *ctx buffer_add_int (&buf, mono_environment_exitcode_get ()); break; case EVENT_KIND_EXCEPTION: { - EventInfo *ei = arg; + EventInfo *ei = (EventInfo *)arg; buffer_add_objid (&buf, ei->exc); /* * We are not yet suspending, so get_objref () will not keep this object alive. So we need to do it @@ -3696,7 +3678,7 @@ process_event (EventKind event, gpointer arg, gint32 il_offset, MonoContext *ctx case EVENT_KIND_USER_BREAK: break; case EVENT_KIND_USER_LOG: { - EventInfo *ei = arg; + EventInfo *ei = (EventInfo *)arg; buffer_add_int (&buf, ei->level); buffer_add_string (&buf, ei->category ? ei->category : ""); buffer_add_string (&buf, ei->message ? ei->message : ""); @@ -3778,7 +3760,7 @@ process_profiler_event (EventKind event, gpointer arg) EventInfo ei, *ei_arg = NULL; if (event == EVENT_KIND_TYPE_LOAD) { - ei.klass = arg; + ei.klass = (MonoClass *)arg; ei_arg = &ei; } @@ -3818,7 +3800,7 @@ thread_startup (MonoProfiler *prof, uintptr_t tid) g_assert (mono_native_thread_id_equals (MONO_UINT_TO_NATIVE_THREAD_ID (tid), MONO_UINT_TO_NATIVE_THREAD_ID (thread->tid))); mono_loader_lock (); - old_thread = mono_g_hash_table_lookup (tid_to_thread, GUINT_TO_POINTER (tid)); + old_thread = (MonoInternalThread *)mono_g_hash_table_lookup (tid_to_thread, GUINT_TO_POINTER (tid)); mono_loader_unlock (); if (old_thread) { if (thread == old_thread) { @@ -3842,7 +3824,7 @@ thread_startup (MonoProfiler *prof, uintptr_t tid) } } - tls = mono_native_tls_get_value (debugger_tls_id); + tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id); g_assert (!tls); // FIXME: Free this somewhere tls = g_new0 (DebuggerTlsData, 1); @@ -3873,10 +3855,10 @@ thread_end (MonoProfiler *prof, uintptr_t tid) DebuggerTlsData *tls = NULL; mono_loader_lock (); - thread = mono_g_hash_table_lookup (tid_to_thread, GUINT_TO_POINTER (tid)); + thread = (MonoInternalThread *)mono_g_hash_table_lookup (tid_to_thread, GUINT_TO_POINTER (tid)); if (thread) { mono_g_hash_table_remove (tid_to_thread_obj, GUINT_TO_POINTER (tid)); - tls = mono_g_hash_table_lookup (thread_to_tls, thread); + tls = (DebuggerTlsData *)mono_g_hash_table_lookup (thread_to_tls, thread); if (tls) { /* FIXME: Maybe we need to free this instead, but some code can't handle that */ tls->terminated = TRUE; @@ -3928,7 +3910,7 @@ appdomain_start_unload (MonoProfiler *prof, MonoDomain *domain) * Remember the currently unloading appdomain as it is needed to generate * proper ids for unloading assemblies. */ - tls = mono_native_tls_get_value (debugger_tls_id); + tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id); g_assert (tls); tls->domain_unloading = domain; } @@ -3941,7 +3923,7 @@ appdomain_unload (MonoProfiler *prof, MonoDomain *domain) if (is_debugger_thread ()) return; - tls = mono_native_tls_get_value (debugger_tls_id); + tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id); g_assert (tls); tls->domain_unloading = NULL; @@ -3964,7 +3946,7 @@ appdomain_unload (MonoProfiler *prof, MonoDomain *domain) static void invalidate_each_thread (gpointer key, gpointer value, gpointer user_data) { - invalidate_frames (value); + invalidate_frames ((DebuggerTlsData *)value); } static void @@ -4043,7 +4025,7 @@ jit_end (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *jinfo, int result) // FIXME: Maybe store this in TLS so the thread of the event is correct ? dbg_lock (); if (pending_assembly_loads->len > 0) { - assembly = g_ptr_array_index (pending_assembly_loads, 0); + assembly = (MonoAssembly *)g_ptr_array_index (pending_assembly_loads, 0); g_ptr_array_remove_index (pending_assembly_loads, 0); } dbg_unlock (); @@ -4280,14 +4262,14 @@ add_pending_breakpoints (MonoMethod *method, MonoJitInfo *ji) mono_loader_lock (); for (i = 0; i < breakpoints->len; ++i) { - MonoBreakpoint *bp = g_ptr_array_index (breakpoints, i); + MonoBreakpoint *bp = (MonoBreakpoint *)g_ptr_array_index (breakpoints, i); gboolean found = FALSE; if (!bp_matches_method (bp, method)) continue; for (j = 0; j < bp->children->len; ++j) { - BreakpointInstance *inst = g_ptr_array_index (bp->children, j); + BreakpointInstance *inst = (BreakpointInstance *)g_ptr_array_index (bp->children, j); if (inst->ji == ji) found = TRUE; @@ -4301,9 +4283,9 @@ add_pending_breakpoints (MonoMethod *method, MonoJitInfo *ji) declaring = mono_method_get_declaring_generic_method (jmethod); mono_domain_lock (domain); - seq_points = g_hash_table_lookup (domain_jit_info (domain)->seq_points, jmethod); + seq_points = (MonoSeqPointInfo *)g_hash_table_lookup (domain_jit_info (domain)->seq_points, jmethod); if (!seq_points && declaring) - seq_points = g_hash_table_lookup (domain_jit_info (domain)->seq_points, declaring); + seq_points = (MonoSeqPointInfo *)g_hash_table_lookup (domain_jit_info (domain)->seq_points, declaring); mono_domain_unlock (domain); if (!seq_points) /* Could be AOT code */ @@ -4331,7 +4313,7 @@ set_bp_in_method (MonoDomain *domain, MonoMethod *method, MonoSeqPointInfo *seq_ /* Might be AOTed code */ code = mono_aot_get_method (domain, method); g_assert (code); - ji = mono_jit_info_table_find (domain, code); + ji = mono_jit_info_table_find (domain, (char *)code); g_assert (ji); } g_assert (code); @@ -4403,9 +4385,9 @@ set_breakpoint (MonoMethod *method, long il_offset, EventRequest *req, MonoError } for (i = 0; i < methods->len; ++i) { - m = g_ptr_array_index (methods, i); - domain = g_ptr_array_index (method_domains, i); - seq_points = g_ptr_array_index (method_seq_points, i); + m = (MonoMethod *)g_ptr_array_index (methods, i); + domain = (MonoDomain *)g_ptr_array_index (method_domains, i); + seq_points = (MonoSeqPointInfo *)g_ptr_array_index (method_seq_points, i); set_bp_in_method (domain, m, seq_points, bp, error); } @@ -4431,7 +4413,7 @@ clear_breakpoint (MonoBreakpoint *bp) // FIXME: locking, races for (i = 0; i < bp->children->len; ++i) { - BreakpointInstance *inst = g_ptr_array_index (bp->children, i); + BreakpointInstance *inst = (BreakpointInstance *)g_ptr_array_index (bp->children, i); remove_breakpoint (inst); @@ -4454,10 +4436,10 @@ breakpoints_cleanup (void) mono_loader_lock (); i = 0; while (i < event_requests->len) { - EventRequest *req = g_ptr_array_index (event_requests, i); + EventRequest *req = (EventRequest *)g_ptr_array_index (event_requests, i); if (req->event_kind == EVENT_KIND_BREAKPOINT) { - clear_breakpoint (req->info); + clear_breakpoint ((MonoBreakpoint *)req->info); g_ptr_array_remove_index_fast (event_requests, i); g_free (req); } else { @@ -4493,11 +4475,11 @@ clear_breakpoints_for_domain (MonoDomain *domain) mono_loader_lock (); for (i = 0; i < breakpoints->len; ++i) { - MonoBreakpoint *bp = g_ptr_array_index (breakpoints, i); + MonoBreakpoint *bp = (MonoBreakpoint *)g_ptr_array_index (breakpoints, i); j = 0; while (j < bp->children->len) { - BreakpointInstance *inst = g_ptr_array_index (bp->children, j); + BreakpointInstance *inst = (BreakpointInstance *)g_ptr_array_index (bp->children, j); if (inst->domain == domain) { remove_breakpoint (inst); @@ -4564,7 +4546,7 @@ ss_update (SingleStepReq *req, MonoJitInfo *ji, SeqPoint *sp, DebuggerTlsData *t minfo = mono_debug_lookup_method (method); if (minfo) - loc = mono_debug_symfile_lookup_location (minfo, sp->il_offset); + loc = mono_debug_method_lookup_location (minfo, sp->il_offset); if (!loc) { DEBUG_PRINTF (1, "[%p] No line number info for il offset %x, continuing single stepping.\n", (gpointer)mono_native_thread_id_get (), sp->il_offset); @@ -4610,7 +4592,7 @@ process_breakpoint_inner (DebuggerTlsData *tls, gboolean from_signal) // FIXME: Speed this up - ip = MONO_CONTEXT_GET_IP (ctx); + ip = (guint8 *)MONO_CONTEXT_GET_IP (ctx); ji = mini_jit_info_table_find (mono_domain_get (), (char*)ip, NULL); g_assert (ji && !ji->is_trampoline); method = jinfo_get_method (ji); @@ -4648,13 +4630,13 @@ process_breakpoint_inner (DebuggerTlsData *tls, gboolean from_signal) bp = NULL; for (i = 0; i < breakpoints->len; ++i) { - bp = g_ptr_array_index (breakpoints, i); + bp = (MonoBreakpoint *)g_ptr_array_index (breakpoints, i); if (!bp->method) continue; for (j = 0; j < bp->children->len; ++j) { - inst = g_ptr_array_index (bp->children, j); + inst = (BreakpointInstance *)g_ptr_array_index (bp->children, j); if (inst->ji == ji && inst->il_offset == sp.il_offset && inst->native_offset == sp.native_offset) { if (bp->req->event_kind == EVENT_KIND_STEP) { g_ptr_array_add (ss_reqs_orig, bp->req); @@ -4674,8 +4656,8 @@ process_breakpoint_inner (DebuggerTlsData *tls, gboolean from_signal) /* Process single step requests */ for (i = 0; i < ss_reqs_orig->len; ++i) { - EventRequest *req = g_ptr_array_index (ss_reqs_orig, i); - SingleStepReq *ss_req = req->info; + EventRequest *req = (EventRequest *)g_ptr_array_index (ss_reqs_orig, i); + SingleStepReq *ss_req = (SingleStepReq *)req->info; gboolean hit; if (mono_thread_internal_current () != ss_req->thread) @@ -4721,7 +4703,7 @@ process_signal_event (void (*func) (DebuggerTlsData*, gboolean)) MonoThreadUnwindState orig_restore_state; MonoContext ctx; - tls = mono_native_tls_get_value (debugger_tls_id); + tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id); /* Have to save/restore the restore_ctx as we can be called recursively during invokes etc. */ memcpy (&orig_restore_state, &tls->restore_state, sizeof (MonoThreadUnwindState)); mono_thread_state_init_from_monoctx (&tls->restore_state, &tls->handler_ctx); @@ -4749,7 +4731,7 @@ resume_from_signal_handler (void *sigctx, void *func) /* Save the original context in TLS */ // FIXME: This might not work on an altstack ? - tls = mono_native_tls_get_value (debugger_tls_id); + tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id); if (!tls) fprintf (stderr, "Thread %p is not attached to the JIT.\n", (gpointer)mono_native_thread_id_get ()); g_assert (tls); @@ -4808,7 +4790,7 @@ mono_debugger_agent_user_break (void) /* Obtain a context */ MONO_CONTEXT_SET_IP (&ctx, NULL); - mono_walk_stack_with_ctx (user_break_cb, NULL, 0, &ctx); + mono_walk_stack_with_ctx (user_break_cb, NULL, (MonoUnwindOptions)0, &ctx); g_assert (MONO_CONTEXT_GET_IP (&ctx) != NULL); mono_loader_lock (); @@ -4851,7 +4833,7 @@ process_single_step_inner (DebuggerTlsData *tls, gboolean from_signal) SeqPoint sp; MonoSeqPointInfo *info; - ip = MONO_CONTEXT_GET_IP (ctx); + ip = (guint8 *)MONO_CONTEXT_GET_IP (ctx); /* Skip the instruction causing the single step */ if (from_signal) @@ -4974,7 +4956,7 @@ debugger_agent_single_step_from_context (MonoContext *ctx) DebuggerTlsData *tls; MonoThreadUnwindState orig_restore_state; - tls = mono_native_tls_get_value (debugger_tls_id); + tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id); /* Fastpath during invokes, see in process_suspend () */ if (tls && suspend_count && suspend_count - tls->resume_count == 0) return; @@ -5005,10 +4987,10 @@ debugger_agent_breakpoint_from_context (MonoContext *ctx) if (is_debugger_thread ()) return; - orig_ip = MONO_CONTEXT_GET_IP (ctx); + orig_ip = (guint8 *)MONO_CONTEXT_GET_IP (ctx); MONO_CONTEXT_SET_IP (ctx, orig_ip - 1); - tls = mono_native_tls_get_value (debugger_tls_id); + tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id); g_assert (tls); memcpy (&orig_restore_state, &tls->restore_state, sizeof (MonoThreadUnwindState)); mono_thread_state_init_from_monoctx (&tls->restore_state, ctx); @@ -5066,7 +5048,7 @@ ss_stop (SingleStepReq *ss_req) GSList *l; for (l = ss_req->bps; l; l = l->next) { - clear_breakpoint (l->data); + clear_breakpoint ((MonoBreakpoint *)l->data); } g_slist_free (ss_req->bps); ss_req->bps = NULL; @@ -5295,7 +5277,7 @@ ss_create (MonoInternalThread *thread, StepSize size, StepDepth depth, StepFilte req->info = ss_req; mono_loader_lock (); - tls = mono_g_hash_table_lookup (thread_to_tls, thread); + tls = (DebuggerTlsData *)mono_g_hash_table_lookup (thread_to_tls, thread); mono_loader_unlock (); g_assert (tls); g_assert (tls->context.valid); @@ -5321,7 +5303,10 @@ ss_create (MonoInternalThread *thread, StepSize size, StepDepth depth, StepFilte */ /* Find the the jit info for the catch context */ - res = mono_find_jit_info_ext (tls->catch_state.unwind_data [MONO_UNWIND_DATA_DOMAIN], ((MonoThreadInfo*)thread->thread_info)->jit_data, NULL, &tls->catch_state.ctx, &new_ctx, NULL, &lmf, NULL, &frame); + res = mono_find_jit_info_ext ( + (MonoDomain *)tls->catch_state.unwind_data [MONO_UNWIND_DATA_DOMAIN], + (MonoJitTlsData *)((MonoThreadInfo*)thread->thread_info)->jit_data, + NULL, &tls->catch_state.ctx, &new_ctx, NULL, &lmf, NULL, &frame); g_assert (res); g_assert (frame.type == FRAME_TYPE_MANAGED); @@ -5362,7 +5347,7 @@ ss_create (MonoInternalThread *thread, StepSize size, StepDepth depth, StepFilte minfo = mono_debug_lookup_method (frame->method); if (minfo && frame->il_offset != -1) { - MonoDebugSourceLocation *loc = mono_debug_symfile_lookup_location (minfo, frame->il_offset); + MonoDebugSourceLocation *loc = mono_debug_method_lookup_location (minfo, frame->il_offset); if (loc) { ss_req->last_line = loc->row; @@ -5392,7 +5377,7 @@ ss_create (MonoInternalThread *thread, StepSize size, StepDepth depth, StepFilte if (frames) free_frames (frames, nframes); - return 0; + return ERR_NONE; } static void @@ -5416,8 +5401,8 @@ ss_clear_for_assembly (SingleStepReq *req, MonoAssembly *assembly) while (found) { found = FALSE; for (l = ss_req->bps; l; l = l->next) { - if (breakpoint_matches_assembly (l->data, assembly)) { - clear_breakpoint (l->data); + if (breakpoint_matches_assembly ((MonoBreakpoint *)l->data, assembly)) { + clear_breakpoint ((MonoBreakpoint *)l->data); ss_req->bps = g_slist_delete_link (ss_req->bps, l); found = TRUE; break; @@ -5496,7 +5481,7 @@ mono_debugger_agent_handle_exception (MonoException *exc, MonoContext *throw_ctx MonoInternalThread *thread = mono_thread_internal_current (); mono_loader_lock (); - tls = mono_g_hash_table_lookup (thread_to_tls, thread); + tls = (DebuggerTlsData *)mono_g_hash_table_lookup (thread_to_tls, thread); mono_loader_unlock (); if (tls && tls->abort_requested) @@ -5525,7 +5510,7 @@ mono_debugger_agent_handle_exception (MonoException *exc, MonoContext *throw_ctx gboolean found = FALSE; for (l = agent_config.onthrow; l; l = l->next) { - char *ex_type = l->data; + char *ex_type = (char *)l->data; char *f = mono_type_full_name (&exc->object.vtable->klass->byval_arg); if (!strcmp (ex_type, "") || !strcmp (ex_type, f)) @@ -5550,9 +5535,9 @@ mono_debugger_agent_handle_exception (MonoException *exc, MonoContext *throw_ctx if (!inited) return; - ji = mini_jit_info_table_find (mono_domain_get (), MONO_CONTEXT_GET_IP (throw_ctx), NULL); + ji = mini_jit_info_table_find (mono_domain_get (), (char *)MONO_CONTEXT_GET_IP (throw_ctx), NULL); if (catch_ctx) - catch_ji = mini_jit_info_table_find (mono_domain_get (), MONO_CONTEXT_GET_IP (catch_ctx), NULL); + catch_ji = mini_jit_info_table_find (mono_domain_get (), (char *)MONO_CONTEXT_GET_IP (catch_ctx), NULL); else catch_ji = NULL; @@ -5563,7 +5548,7 @@ mono_debugger_agent_handle_exception (MonoException *exc, MonoContext *throw_ctx /* Treat exceptions which are caught in non-user code as unhandled */ for (i = 0; i < event_requests->len; ++i) { - EventRequest *req = g_ptr_array_index (event_requests, i); + EventRequest *req = (EventRequest *)g_ptr_array_index (event_requests, i); if (req->event_kind != EVENT_KIND_EXCEPTION) continue; @@ -5610,7 +5595,7 @@ mono_debugger_agent_begin_exception_filter (MonoException *exc, MonoContext *ctx if (!inited) return; - tls = mono_native_tls_get_value (debugger_tls_id); + tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id); if (!tls) return; @@ -5649,7 +5634,7 @@ mono_debugger_agent_end_exception_filter (MonoException *exc, MonoContext *ctx, if (!inited) return; - tls = mono_native_tls_get_value (debugger_tls_id); + tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id); if (!tls) return; @@ -5879,14 +5864,14 @@ decode_vtype (MonoType *t, MonoDomain *domain, guint8 *addr, guint8 *buf, guint8 int nfields; gpointer iter = NULL; MonoDomain *d; - int err; + ErrorCode err; is_enum = decode_byte (buf, &buf, limit); /* Enums are sent as a normal vtype */ if (is_enum) return ERR_NOT_IMPLEMENTED; klass = decode_typeid (buf, &buf, limit, &d, &err); - if (err) + if (err != ERR_NONE) return err; if (t && klass != mono_class_from_mono_type (t)) { @@ -5905,7 +5890,7 @@ decode_vtype (MonoType *t, MonoDomain *domain, guint8 *addr, guint8 *buf, guint8 if (mono_field_is_deleted (f)) continue; err = decode_value (f->type, domain, (guint8*)addr + f->offset - sizeof (MonoObject), buf, &buf, limit); - if (err) + if (err != ERR_NONE) return err; nfields --; } @@ -5913,13 +5898,13 @@ decode_vtype (MonoType *t, MonoDomain *domain, guint8 *addr, guint8 *buf, guint8 *endbuf = buf; - return 0; + return ERR_NONE; } static ErrorCode decode_value_internal (MonoType *t, int type, MonoDomain *domain, guint8 *addr, guint8 *buf, guint8 **endbuf, guint8 *limit) { - int err; + ErrorCode err; if (type != t->type && !MONO_TYPE_IS_REFERENCE (t) && !(t->type == MONO_TYPE_I && type == MONO_TYPE_VALUETYPE) && @@ -5993,11 +5978,11 @@ decode_value_internal (MonoType *t, int type, MonoDomain *domain, guint8 *addr, if (type == MONO_TYPE_OBJECT) { /* Boxed vtype */ int objid = decode_objid (buf, &buf, limit); - int err; + ErrorCode err; MonoObject *obj; err = get_object (objid, (MonoObject**)&obj); - if (err) + if (err != ERR_NONE) return err; if (!obj) return ERR_INVALID_ARGUMENT; @@ -6008,7 +5993,7 @@ decode_value_internal (MonoType *t, int type, MonoDomain *domain, guint8 *addr, memcpy (addr, mono_object_unbox (obj), mono_class_value_size (obj->vtable->klass, NULL)); } else { err = decode_vtype (t, domain, addr, buf, &buf, limit); - if (err) + if (err != ERR_NONE) return err; } break; @@ -6017,11 +6002,11 @@ decode_value_internal (MonoType *t, int type, MonoDomain *domain, guint8 *addr, if (MONO_TYPE_IS_REFERENCE (t)) { if (type == MONO_TYPE_OBJECT) { int objid = decode_objid (buf, &buf, limit); - int err; + ErrorCode err; MonoObject *obj; err = get_object (objid, (MonoObject**)&obj); - if (err) + if (err != ERR_NONE) return err; if (obj) { @@ -6054,17 +6039,17 @@ decode_value_internal (MonoType *t, int type, MonoDomain *domain, guint8 *addr, if (is_enum) return ERR_NOT_IMPLEMENTED; klass = decode_typeid (buf, &buf, limit, &d, &err); - if (err) + if (err != ERR_NONE) return err; /* Decode the vtype into a temporary buffer, then box it. */ vtype_buf_size = mono_class_value_size (klass, NULL); - vtype_buf = g_malloc0 (vtype_buf_size); + vtype_buf = (guint8 *)g_malloc0 (vtype_buf_size); g_assert (vtype_buf); buf = buf2; err = decode_vtype (NULL, domain, vtype_buf, buf, &buf, limit); - if (err) { + if (err != ERR_NONE) { g_free (vtype_buf); return err; } @@ -6084,13 +6069,13 @@ decode_value_internal (MonoType *t, int type, MonoDomain *domain, guint8 *addr, *endbuf = buf; - return 0; + return ERR_NONE; } static ErrorCode decode_value (MonoType *t, MonoDomain *domain, guint8 *addr, guint8 *buf, guint8 **endbuf, guint8 *limit) { - int err; + ErrorCode err; int type = decode_byte (buf, &buf, limit); if (t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t))) { @@ -6101,16 +6086,16 @@ decode_value (MonoType *t, MonoDomain *domain, guint8 *addr, guint8 *buf, guint8 * First try decoding it as a Nullable`1 */ err = decode_value_internal (t, type, domain, addr, buf, endbuf, limit); - if (!err) + if (err == ERR_NONE) return err; /* * Then try decoding as a primitive value or null. */ if (targ->type == type) { - nullable_buf = g_malloc (mono_class_instance_size (mono_class_from_mono_type (targ))); + nullable_buf = (guint8 *)g_malloc (mono_class_instance_size (mono_class_from_mono_type (targ))); err = decode_value_internal (targ, type, domain, nullable_buf, buf, endbuf, limit); - if (err) { + if (err != ERR_NONE) { g_free (nullable_buf); return err; } @@ -6146,7 +6131,7 @@ add_var (Buffer *buf, MonoDebugMethodJitInfo *jit, MonoType *t, MonoDebugVarInfo buffer_add_value_full (buf, t, ®_val, domain, as_vtype, NULL); break; case MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET: - addr = (gpointer)mono_arch_context_get_int_reg (ctx, reg); + addr = (guint8 *)mono_arch_context_get_int_reg (ctx, reg); addr += (gint32)var->offset; //printf ("[R%d+%d] = %p\n", reg, var->offset, addr); @@ -6159,10 +6144,10 @@ add_var (Buffer *buf, MonoDebugMethodJitInfo *jit, MonoType *t, MonoDebugVarInfo case MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET_INDIR: case MONO_DEBUG_VAR_ADDRESS_MODE_VTADDR: /* Same as regoffset, but with an indirection */ - addr = (gpointer)mono_arch_context_get_int_reg (ctx, reg); + addr = (guint8 *)mono_arch_context_get_int_reg (ctx, reg); addr += (gint32)var->offset; - gaddr = *(gpointer*)addr; + gaddr = (guint8 *)*(gpointer*)addr; g_assert (gaddr); buffer_add_value_full (buf, t, gaddr, domain, as_vtype, NULL); break; @@ -6181,11 +6166,11 @@ add_var (Buffer *buf, MonoDebugMethodJitInfo *jit, MonoType *t, MonoDebugVarInfo flags = info_var->index & MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS; reg = info_var->index & ~MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS; if (flags == MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET) { - addr = (gpointer)mono_arch_context_get_int_reg (ctx, reg); + addr = (guint8 *)mono_arch_context_get_int_reg (ctx, reg); addr += (gint32)info_var->offset; - info = *(gpointer*)addr; + info = (MonoGSharedVtMethodRuntimeInfo *)*(gpointer*)addr; } else if (flags == MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER) { - info = (gpointer)mono_arch_context_get_int_reg (ctx, reg); + info = (MonoGSharedVtMethodRuntimeInfo *)mono_arch_context_get_int_reg (ctx, reg); } else { g_assert_not_reached (); } @@ -6194,11 +6179,11 @@ add_var (Buffer *buf, MonoDebugMethodJitInfo *jit, MonoType *t, MonoDebugVarInfo flags = locals_var->index & MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS; reg = locals_var->index & ~MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS; if (flags == MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET) { - addr = (gpointer)mono_arch_context_get_int_reg (ctx, reg); + addr = (guint8 *)mono_arch_context_get_int_reg (ctx, reg); addr += (gint32)locals_var->offset; - locals = *(gpointer*)addr; + locals = (guint8 *)*(gpointer*)addr; } else if (flags == MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER) { - locals = (gpointer)mono_arch_context_get_int_reg (ctx, reg); + locals = (guint8 *)mono_arch_context_get_int_reg (ctx, reg); } else { g_assert_not_reached (); } @@ -6237,7 +6222,7 @@ set_var (MonoType *t, MonoDebugVarInfo *var, MonoContext *ctx, MonoDomain *domai gboolean is_signed = FALSE; if (t->byref) { - addr = (gpointer)mono_arch_context_get_int_reg (ctx, reg); + addr = (guint8 *)mono_arch_context_get_int_reg (ctx, reg); if (addr) { // FIXME: Write barriers @@ -6286,7 +6271,7 @@ set_var (MonoType *t, MonoDebugVarInfo *var, MonoContext *ctx, MonoDomain *domai break; } case MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET: - addr = (gpointer)mono_arch_context_get_int_reg (ctx, reg); + addr = (guint8 *)mono_arch_context_get_int_reg (ctx, reg); addr += (gint32)var->offset; //printf ("[R%d+%d] = %p\n", reg, var->offset, addr); @@ -6303,10 +6288,10 @@ set_var (MonoType *t, MonoDebugVarInfo *var, MonoContext *ctx, MonoDomain *domai break; case MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET_INDIR: /* Same as regoffset, but with an indirection */ - addr = (gpointer)mono_arch_context_get_int_reg (ctx, reg); + addr = (guint8 *)mono_arch_context_get_int_reg (ctx, reg); addr += (gint32)var->offset; - gaddr = *(gpointer*)addr; + gaddr = (guint8 *)*(gpointer*)addr; g_assert (gaddr); // FIXME: Write barriers mono_gc_memmove_atomic (gaddr, val, size); @@ -6326,17 +6311,17 @@ clear_event_request (int req_id, int etype) mono_loader_lock (); for (i = 0; i < event_requests->len; ++i) { - EventRequest *req = g_ptr_array_index (event_requests, i); + EventRequest *req = (EventRequest *)g_ptr_array_index (event_requests, i); if (req->id == req_id && req->event_kind == etype) { if (req->event_kind == EVENT_KIND_BREAKPOINT) - clear_breakpoint (req->info); + clear_breakpoint ((MonoBreakpoint *)req->info); if (req->event_kind == EVENT_KIND_STEP) - ss_destroy (req->info); + ss_destroy ((SingleStepReq *)req->info); if (req->event_kind == EVENT_KIND_METHOD_ENTRY) - clear_breakpoint (req->info); + clear_breakpoint ((MonoBreakpoint *)req->info); if (req->event_kind == EVENT_KIND_METHOD_EXIT) - clear_breakpoint (req->info); + clear_breakpoint ((MonoBreakpoint *)req->info); g_ptr_array_remove_index_fast (event_requests, i); g_free (req); break; @@ -6404,18 +6389,18 @@ clear_event_requests_for_assembly (MonoAssembly *assembly) while (found) { found = FALSE; for (i = 0; i < event_requests->len; ++i) { - EventRequest *req = g_ptr_array_index (event_requests, i); + EventRequest *req = (EventRequest *)g_ptr_array_index (event_requests, i); clear_assembly_from_modifiers (req, assembly); - if (req->event_kind == EVENT_KIND_BREAKPOINT && breakpoint_matches_assembly (req->info, assembly)) { + if (req->event_kind == EVENT_KIND_BREAKPOINT && breakpoint_matches_assembly ((MonoBreakpoint *)req->info, assembly)) { clear_event_request (req->id, req->event_kind); found = TRUE; break; } if (req->event_kind == EVENT_KIND_STEP) - ss_clear_for_assembly (req->info, assembly); + ss_clear_for_assembly ((SingleStepReq *)req->info, assembly); } } mono_loader_unlock (); @@ -6457,8 +6442,8 @@ clear_types_for_assembly (MonoAssembly *assembly) static void add_thread (gpointer key, gpointer value, gpointer user_data) { - MonoInternalThread *thread = value; - Buffer *buf = user_data; + MonoInternalThread *thread = (MonoInternalThread *)value; + Buffer *buf = (Buffer *)user_data; buffer_add_objid (buf, (MonoObject*)thread); } @@ -6468,7 +6453,8 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8 { guint8 *end = invoke->endp; MonoMethod *m; - int i, err, nargs; + int i, nargs; + ErrorCode err; MonoMethodSignature *sig; guint8 **arg_buf; void **args; @@ -6491,14 +6477,14 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8 } m = decode_methodid (p, &p, end, &domain, &err); - if (err) + if (err != ERR_NONE) return err; sig = mono_method_signature (m); if (m->klass->valuetype) - this_buf = g_alloca (mono_class_instance_size (m->klass)); + this_buf = (guint8 *)g_alloca (mono_class_instance_size (m->klass)); else - this_buf = g_alloca (sizeof (MonoObject*)); + this_buf = (guint8 *)g_alloca (sizeof (MonoObject*)); if (m->klass->valuetype && (m->flags & METHOD_ATTRIBUTE_STATIC)) { /* Should be null */ int type = decode_byte (p, &p, end); @@ -6517,12 +6503,12 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8 p = tmp_p; } else { err = decode_value (&m->klass->byval_arg, domain, this_buf, p, &p, end); - if (err) + if (err != ERR_NONE) return err; } } else { err = decode_value (&m->klass->byval_arg, domain, this_buf, p, &p, end); - if (err) + if (err != ERR_NONE) return err; } @@ -6539,7 +6525,7 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8 m = mono_object_get_virtual_method (this_arg, m); /* Transform this to the format the rest of the code expects it to be */ if (m->klass->valuetype) { - this_buf = g_alloca (mono_class_instance_size (m->klass)); + this_buf = (guint8 *)g_alloca (mono_class_instance_size (m->klass)); memcpy (this_buf, mono_object_unbox (this_arg), mono_class_instance_size (m->klass)); } } else if ((m->flags & METHOD_ATTRIBUTE_VIRTUAL) && !m->klass->valuetype && invoke->flags & INVOKE_FLAG_VIRTUAL) { @@ -6549,7 +6535,7 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8 } m = mono_object_get_virtual_method (this_arg, m); if (m->klass->valuetype) { - this_buf = g_alloca (mono_class_instance_size (m->klass)); + this_buf = (guint8 *)g_alloca (mono_class_instance_size (m->klass)); memcpy (this_buf, mono_object_unbox (this_arg), mono_class_instance_size (m->klass)); } } @@ -6577,26 +6563,26 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8 if (nargs != sig->param_count) return ERR_INVALID_ARGUMENT; /* Use alloca to get gc tracking */ - arg_buf = g_alloca (nargs * sizeof (gpointer)); + arg_buf = (guint8 **)g_alloca (nargs * sizeof (gpointer)); memset (arg_buf, 0, nargs * sizeof (gpointer)); - args = g_alloca (nargs * sizeof (gpointer)); + args = (gpointer *)g_alloca (nargs * sizeof (gpointer)); for (i = 0; i < nargs; ++i) { if (MONO_TYPE_IS_REFERENCE (sig->params [i])) { err = decode_value (sig->params [i], domain, (guint8*)&args [i], p, &p, end); - if (err) + if (err != ERR_NONE) break; if (args [i] && ((MonoObject*)args [i])->vtable->domain != domain) NOT_IMPLEMENTED; if (sig->params [i]->byref) { - arg_buf [i] = g_alloca (sizeof (mgreg_t)); + arg_buf [i] = (guint8 *)g_alloca (sizeof (mgreg_t)); *(gpointer*)arg_buf [i] = args [i]; args [i] = arg_buf [i]; } } else { - arg_buf [i] = g_alloca (mono_class_instance_size (mono_class_from_mono_type (sig->params [i]))); + arg_buf [i] = (guint8 *)g_alloca (mono_class_instance_size (mono_class_from_mono_type (sig->params [i]))); err = decode_value (sig->params [i], domain, arg_buf [i], p, &p, end); - if (err) + if (err != ERR_NONE) break; args [i] = arg_buf [i]; } @@ -6663,7 +6649,7 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8 } else if (mono_class_from_mono_type (sig->ret)->valuetype || sig->ret->type == MONO_TYPE_PTR || sig->ret->type == MONO_TYPE_FNPTR) { if (mono_class_is_nullable (mono_class_from_mono_type (sig->ret))) { MonoClass *k = mono_class_from_mono_type (sig->ret); - guint8 *nullable_buf = g_alloca (mono_class_value_size (k, NULL)); + guint8 *nullable_buf = (guint8 *)g_alloca (mono_class_value_size (k, NULL)); g_assert (nullable_buf); mono_nullable_init (nullable_buf, res, k); @@ -6696,7 +6682,7 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8 #ifdef MONO_ARCH_SOFT_DEBUG_SUPPORTED if (invoke->has_ctx) - mono_set_lmf ((gpointer)(((gssize)ext.lmf.previous_lmf) & ~3)); + mono_set_lmf ((MonoLMF *)(((gssize)ext.lmf.previous_lmf) & ~3)); #endif *endp = p; @@ -6716,12 +6702,13 @@ invoke_method (void) DebuggerTlsData *tls; InvokeData *invoke; int id; - int i, err, mindex; + int i, mindex; + ErrorCode err; Buffer buf; MonoContext restore_ctx; guint8 *p; - tls = mono_native_tls_get_value (debugger_tls_id); + tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id); g_assert (tls); /* @@ -6745,7 +6732,7 @@ invoke_method (void) id = invoke->id; p = invoke->p; - err = 0; + err = ERR_NONE; for (mindex = 0; mindex < invoke->nmethods; ++mindex) { buffer_init (&buf, 128); @@ -6812,12 +6799,12 @@ invoke_method (void) static gboolean is_really_suspended (gpointer key, gpointer value, gpointer user_data) { - MonoThread *thread = value; + MonoThread *thread = (MonoThread *)value; DebuggerTlsData *tls; gboolean res; mono_loader_lock (); - tls = mono_g_hash_table_lookup (thread_to_tls, thread); + tls = (DebuggerTlsData *)mono_g_hash_table_lookup (thread_to_tls, thread); g_assert (tls); res = tls->really_suspended; mono_loader_unlock (); @@ -6843,7 +6830,7 @@ get_source_files_for_type (MonoClass *klass) if (minfo) { mono_debug_get_seq_points (minfo, NULL, &source_file_list, NULL, NULL, NULL); for (j = 0; j < source_file_list->len; ++j) { - sinfo = g_ptr_array_index (source_file_list, j); + sinfo = (MonoDebugSourceInfo *)g_ptr_array_index (source_file_list, j); for (i = 0; i < files->len; ++i) if (!strcmp (g_ptr_array_index (files, i), sinfo->source_file)) break; @@ -6903,7 +6890,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) /* Clear all event requests */ mono_loader_lock (); while (event_requests->len > 0) { - EventRequest *req = g_ptr_array_index (event_requests, 0); + EventRequest *req = (EventRequest *)g_ptr_array_index (event_requests, 0); clear_event_request (req->id, req->event_kind); } @@ -6934,7 +6921,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) /* Clear all event requests */ mono_loader_lock (); while (event_requests->len > 0) { - EventRequest *req = g_ptr_array_index (event_requests, 0); + EventRequest *req = (EventRequest *)g_ptr_array_index (event_requests, 0); clear_event_request (req->id, req->event_kind); } @@ -6957,12 +6944,12 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) #endif mono_loader_lock (); - thread = mono_g_hash_table_find (tid_to_thread, is_really_suspended, NULL); + thread = (MonoInternalThread *)mono_g_hash_table_find (tid_to_thread, is_really_suspended, NULL); mono_loader_unlock (); if (thread && exit_method) { mono_loader_lock (); - tls = mono_g_hash_table_lookup (thread_to_tls, thread); + tls = (DebuggerTlsData *)mono_g_hash_table_lookup (thread_to_tls, thread); mono_loader_unlock (); args = g_new0 (gpointer, 1); @@ -7006,10 +6993,11 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) int objid = decode_objid (p, &p, end); MonoThread *thread; DebuggerTlsData *tls; - int i, count, err, flags, nmethods; + int i, count, flags, nmethods; + ErrorCode err; err = get_object (objid, (MonoObject**)&thread); - if (err) + if (err != ERR_NONE) return err; flags = decode_int (p, &p, end); @@ -7026,7 +7014,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) return ERR_NOT_SUSPENDED; mono_loader_lock (); - tls = mono_g_hash_table_lookup (thread_to_tls, THREAD_TO_INTERNAL (thread)); + tls = (DebuggerTlsData *)mono_g_hash_table_lookup (thread_to_tls, THREAD_TO_INTERNAL (thread)); mono_loader_unlock (); g_assert (tls); @@ -7043,7 +7031,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) tls->pending_invoke = g_new0 (InvokeData, 1); tls->pending_invoke->id = id; tls->pending_invoke->flags = flags; - tls->pending_invoke->p = g_malloc (end - p); + tls->pending_invoke->p = (guint8 *)g_malloc (end - p); memcpy (tls->pending_invoke->p, p, end - p); tls->pending_invoke->endp = tls->pending_invoke->p + (end - p); tls->pending_invoke->suspend_count = suspend_count; @@ -7063,16 +7051,17 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) int objid = decode_objid (p, &p, end); MonoThread *thread; DebuggerTlsData *tls; - int invoke_id, err; + int invoke_id; + ErrorCode err; err = get_object (objid, (MonoObject**)&thread); - if (err) + if (err != ERR_NONE) return err; invoke_id = decode_int (p, &p, end); mono_loader_lock (); - tls = mono_g_hash_table_lookup (thread_to_tls, THREAD_TO_INTERNAL (thread)); + tls = (DebuggerTlsData *)mono_g_hash_table_lookup (thread_to_tls, THREAD_TO_INTERNAL (thread)); g_assert (tls); if (tls->abort_requested) { @@ -7136,7 +7125,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) mono_loader_lock (); g_hash_table_iter_init (&iter, domains); while (g_hash_table_iter_next (&iter, NULL, (void**)&domain)) { - AgentDomainInfo *info = domain_jit_info (domain)->agent_info; + AgentDomainInfo *info = (AgentDomainInfo *)domain_jit_info (domain)->agent_info; /* Update 'source_file_to_class' cache */ g_hash_table_iter_init (&kiter, info->loaded_classes); @@ -7146,11 +7135,11 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) g_hash_table_insert (info->source_files, klass, files); for (i = 0; i < files->len; ++i) { - char *s = g_ptr_array_index (files, i); + char *s = (char *)g_ptr_array_index (files, i); char *s2 = dbg_path_get_basename (s); char *s3; - class_list = g_hash_table_lookup (info->source_file_to_class, s2); + class_list = (GSList *)g_hash_table_lookup (info->source_file_to_class, s2); if (!class_list) { class_list = g_slist_prepend (class_list, klass); g_hash_table_insert (info->source_file_to_class, g_strdup (s2), class_list); @@ -7161,7 +7150,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) /* The _ignorecase hash contains the lowercase path */ s3 = strdup_tolower (s2); - class_list = g_hash_table_lookup (info->source_file_to_class_ignorecase, s3); + class_list = (GSList *)g_hash_table_lookup (info->source_file_to_class_ignorecase, s3); if (!class_list) { class_list = g_slist_prepend (class_list, klass); g_hash_table_insert (info->source_file_to_class_ignorecase, g_strdup (s3), class_list); @@ -7180,14 +7169,14 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) char *s; s = strdup_tolower (basename); - class_list = g_hash_table_lookup (info->source_file_to_class_ignorecase, s); + class_list = (GSList *)g_hash_table_lookup (info->source_file_to_class_ignorecase, s); g_free (s); } else { - class_list = g_hash_table_lookup (info->source_file_to_class, basename); + class_list = (GSList *)g_hash_table_lookup (info->source_file_to_class, basename); } for (l = class_list; l; l = l->next) { - klass = l->data; + klass = (MonoClass *)l->data; g_ptr_array_add (res_classes, klass); g_ptr_array_add (res_domains, domain); @@ -7200,7 +7189,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) buffer_add_int (buf, res_classes->len); for (i = 0; i < res_classes->len; ++i) - buffer_add_typeid (buf, g_ptr_array_index (res_domains, i), g_ptr_array_index (res_classes, i)); + buffer_add_typeid (buf, (MonoDomain *)g_ptr_array_index (res_domains, i), (MonoClass *)g_ptr_array_index (res_classes, i)); g_ptr_array_free (res_classes, TRUE); g_ptr_array_free (res_domains, TRUE); break; @@ -7236,7 +7225,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) mono_domain_assemblies_lock (domain); for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) { - ass = tmp->data; + ass = (MonoAssembly *)tmp->data; if (ass->image) { type_resolve = TRUE; @@ -7256,7 +7245,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) buffer_add_int (buf, res_classes->len); for (i = 0; i < res_classes->len; ++i) - buffer_add_typeid (buf, g_ptr_array_index (res_domains, i), g_ptr_array_index (res_classes, i)); + buffer_add_typeid (buf, (MonoDomain *)g_ptr_array_index (res_domains, i), (MonoClass *)g_ptr_array_index (res_classes, i)); g_ptr_array_free (res_classes, TRUE); g_ptr_array_free (res_domains, TRUE); break; @@ -7275,17 +7264,21 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) static ErrorCode event_commands (int command, guint8 *p, guint8 *end, Buffer *buf) { - int err; + ErrorCode err; MonoError error; switch (command) { case CMD_EVENT_REQUEST_SET: { EventRequest *req; - int i, event_kind, suspend_policy, nmodifiers, mod; + int i, event_kind, suspend_policy, nmodifiers; + ModifierKind mod; MonoMethod *method; long location = 0; MonoThread *step_thread; - int size = 0, depth = 0, filter = 0, step_thread_id = 0; + int step_thread_id = 0; + StepDepth depth = STEP_DEPTH_INTO; + StepSize size = STEP_SIZE_MIN; + StepFilter filter = STEP_FILTER_NONE; MonoDomain *domain; Modifier *modifier; @@ -7293,7 +7286,7 @@ event_commands (int command, guint8 *p, guint8 *end, Buffer *buf) suspend_policy = decode_byte (p, &p, end); nmodifiers = decode_byte (p, &p, end); - req = g_malloc0 (sizeof (EventRequest) + (nmodifiers * sizeof (Modifier))); + req = (EventRequest *)g_malloc0 (sizeof (EventRequest) + (nmodifiers * sizeof (Modifier))); req->id = InterlockedIncrement (&event_request_id); req->event_kind = event_kind; req->suspend_policy = suspend_policy; @@ -7301,38 +7294,38 @@ event_commands (int command, guint8 *p, guint8 *end, Buffer *buf) method = NULL; for (i = 0; i < nmodifiers; ++i) { - mod = decode_byte (p, &p, end); + mod = (ModifierKind)decode_byte (p, &p, end); req->modifiers [i].kind = mod; if (mod == MOD_KIND_COUNT) { req->modifiers [i].data.count = decode_int (p, &p, end); } else if (mod == MOD_KIND_LOCATION_ONLY) { method = decode_methodid (p, &p, end, &domain, &err); - if (err) + if (err != ERR_NONE) return err; location = decode_long (p, &p, end); } else if (mod == MOD_KIND_STEP) { step_thread_id = decode_id (p, &p, end); - size = decode_int (p, &p, end); - depth = decode_int (p, &p, end); + size = (StepSize)decode_int (p, &p, end); + depth = (StepDepth)decode_int (p, &p, end); if (CHECK_PROTOCOL_VERSION (2, 16)) - filter = decode_int (p, &p, end); + filter = (StepFilter)decode_int (p, &p, end); req->modifiers [i].data.filter = filter; if (!CHECK_PROTOCOL_VERSION (2, 26) && (req->modifiers [i].data.filter & STEP_FILTER_DEBUGGER_HIDDEN)) /* Treat STEP_THOUGH the same as HIDDEN */ - req->modifiers [i].data.filter |= STEP_FILTER_DEBUGGER_STEP_THROUGH; + req->modifiers [i].data.filter = (StepFilter)(req->modifiers [i].data.filter | STEP_FILTER_DEBUGGER_STEP_THROUGH); } else if (mod == MOD_KIND_THREAD_ONLY) { int id = decode_id (p, &p, end); err = get_object (id, (MonoObject**)&req->modifiers [i].data.thread); - if (err) { + if (err != ERR_NONE) { g_free (req); return err; } } else if (mod == MOD_KIND_EXCEPTION_ONLY) { MonoClass *exc_class = decode_typeid (p, &p, end, &domain, &err); - if (err) + if (err != ERR_NONE) return err; req->modifiers [i].caught = decode_byte (p, &p, end); req->modifiers [i].uncaught = decode_byte (p, &p, end); @@ -7356,7 +7349,7 @@ event_commands (int command, guint8 *p, guint8 *end, Buffer *buf) req->modifiers [i].data.assemblies = g_new0 (MonoAssembly*, n); for (j = 0; j < n; ++j) { req->modifiers [i].data.assemblies [j] = decode_assemblyid (p, &p, end, &domain, &err); - if (err) { + if (err != ERR_NONE) { g_free (req->modifiers [i].data.assemblies); return err; } @@ -7409,13 +7402,13 @@ event_commands (int command, guint8 *p, guint8 *end, Buffer *buf) g_assert (step_thread_id); err = get_object (step_thread_id, (MonoObject**)&step_thread); - if (err) { + if (err != ERR_NONE) { g_free (req); return err; } err = ss_create (THREAD_TO_INTERNAL (step_thread), size, depth, filter, req); - if (err) { + if (err != ERR_NONE) { g_free (req); return err; } @@ -7479,10 +7472,10 @@ event_commands (int command, guint8 *p, guint8 *end, Buffer *buf) mono_loader_lock (); i = 0; while (i < event_requests->len) { - EventRequest *req = g_ptr_array_index (event_requests, i); + EventRequest *req = (EventRequest *)g_ptr_array_index (event_requests, i); if (req->event_kind == EVENT_KIND_BREAKPOINT) { - clear_breakpoint (req->info); + clear_breakpoint ((MonoBreakpoint *)req->info); g_ptr_array_remove_index_fast (event_requests, i); g_free (req); @@ -7503,7 +7496,7 @@ event_commands (int command, guint8 *p, guint8 *end, Buffer *buf) static ErrorCode domain_commands (int command, guint8 *p, guint8 *end, Buffer *buf) { - int err; + ErrorCode err; MonoDomain *domain; switch (command) { @@ -7513,7 +7506,7 @@ domain_commands (int command, guint8 *p, guint8 *end, Buffer *buf) } case CMD_APPDOMAIN_GET_FRIENDLY_NAME: { domain = decode_domainid (p, &p, end, NULL, &err); - if (err) + if (err != ERR_NONE) return err; buffer_add_string (buf, domain->friendly_name); break; @@ -7524,7 +7517,7 @@ domain_commands (int command, guint8 *p, guint8 *end, Buffer *buf) int count; domain = decode_domainid (p, &p, end, NULL, &err); - if (err) + if (err != ERR_NONE) return err; mono_loader_lock (); count = 0; @@ -7533,7 +7526,7 @@ domain_commands (int command, guint8 *p, guint8 *end, Buffer *buf) } buffer_add_int (buf, count); for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) { - ass = tmp->data; + ass = (MonoAssembly *)tmp->data; buffer_add_assemblyid (buf, domain, ass); } mono_loader_unlock (); @@ -7541,7 +7534,7 @@ domain_commands (int command, guint8 *p, guint8 *end, Buffer *buf) } case CMD_APPDOMAIN_GET_ENTRY_ASSEMBLY: { domain = decode_domainid (p, &p, end, NULL, &err); - if (err) + if (err != ERR_NONE) return err; buffer_add_assemblyid (buf, domain, domain->entry_assembly); @@ -7549,7 +7542,7 @@ domain_commands (int command, guint8 *p, guint8 *end, Buffer *buf) } case CMD_APPDOMAIN_GET_CORLIB: { domain = decode_domainid (p, &p, end, NULL, &err); - if (err) + if (err != ERR_NONE) return err; buffer_add_assemblyid (buf, domain, domain->domain->mbr.obj.vtable->klass->image->assembly); @@ -7560,7 +7553,7 @@ domain_commands (int command, guint8 *p, guint8 *end, Buffer *buf) MonoString *o; domain = decode_domainid (p, &p, end, NULL, &err); - if (err) + if (err != ERR_NONE) return err; s = decode_string (p, &p, end); @@ -7574,10 +7567,10 @@ domain_commands (int command, guint8 *p, guint8 *end, Buffer *buf) MonoObject *o; domain = decode_domainid (p, &p, end, NULL, &err); - if (err) + if (err != ERR_NONE) return err; klass = decode_typeid (p, &p, end, &domain2, &err); - if (err) + if (err != ERR_NONE) return err; // FIXME: @@ -7585,8 +7578,8 @@ domain_commands (int command, guint8 *p, guint8 *end, Buffer *buf) o = mono_object_new (domain, klass); - err = decode_value (&klass->byval_arg, domain, mono_object_unbox (o), p, &p, end); - if (err) + err = decode_value (&klass->byval_arg, domain, (guint8 *)mono_object_unbox (o), p, &p, end); + if (err != ERR_NONE) return err; buffer_add_objid (buf, o); @@ -7602,12 +7595,12 @@ domain_commands (int command, guint8 *p, guint8 *end, Buffer *buf) static ErrorCode assembly_commands (int command, guint8 *p, guint8 *end, Buffer *buf) { - int err; + ErrorCode err; MonoAssembly *ass; MonoDomain *domain; ass = decode_assemblyid (p, &p, end, &domain, &err); - if (err) + if (err != ERR_NONE) return err; switch (command) { @@ -7694,7 +7687,7 @@ assembly_commands (int command, guint8 *p, guint8 *end, Buffer *buf) static ErrorCode module_commands (int command, guint8 *p, guint8 *end, Buffer *buf) { - int err; + ErrorCode err; MonoDomain *domain; switch (command) { @@ -7721,7 +7714,7 @@ module_commands (int command, guint8 *p, guint8 *end, Buffer *buf) static ErrorCode field_commands (int command, guint8 *p, guint8 *end, Buffer *buf) { - int err; + ErrorCode err; MonoDomain *domain; switch (command) { @@ -7755,7 +7748,7 @@ buffer_add_cattr_arg (Buffer *buf, MonoType *t, MonoDomain *domain, MonoObject * buffer_add_value (buf, t, mono_object_unbox (val), domain); } -static int +static ErrorCode buffer_add_cattrs (Buffer *buf, MonoDomain *domain, MonoImage *image, MonoClass *attr_klass, MonoCustomAttrInfo *cinfo) { int i, j; @@ -7860,7 +7853,8 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint MonoType *type; gpointer iter; guint8 b; - int err, nnested; + int nnested; + ErrorCode err; char *name; switch (command) { @@ -7932,7 +7926,7 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint count = container->type_argc; buffer_add_int (buf, count); for (i = 0; i < count; i++) { - pklass = mono_class_from_generic_parameter (mono_generic_container_get_param (container, i), klass->image, FALSE); + pklass = mono_class_from_generic_parameter_internal (mono_generic_container_get_param (container, i)); buffer_add_typeid (buf, domain, pklass); } } else { @@ -8007,13 +8001,13 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint attr_klass = decode_typeid (p, &p, end, NULL, &err); /* attr_klass can be NULL */ - if (err) + if (err != ERR_NONE) return err; cinfo = mono_custom_attrs_from_class (klass); err = buffer_add_cattrs (buf, domain, klass->image, attr_klass, cinfo); - if (err) + if (err != ERR_NONE) return err; break; } @@ -8023,16 +8017,16 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint MonoClassField *field; field = decode_fieldid (p, &p, end, NULL, &err); - if (err) + if (err != ERR_NONE) return err; attr_klass = decode_typeid (p, &p, end, NULL, &err); - if (err) + if (err != ERR_NONE) return err; cinfo = mono_custom_attrs_from_field (klass, field); err = buffer_add_cattrs (buf, domain, klass->image, attr_klass, cinfo); - if (err) + if (err != ERR_NONE) return err; break; } @@ -8042,16 +8036,16 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint MonoProperty *prop; prop = decode_propertyid (p, &p, end, NULL, &err); - if (err) + if (err != ERR_NONE) return err; attr_klass = decode_typeid (p, &p, end, NULL, &err); - if (err) + if (err != ERR_NONE) return err; cinfo = mono_custom_attrs_from_property (klass, prop); err = buffer_add_cattrs (buf, domain, klass->image, attr_klass, cinfo); - if (err) + if (err != ERR_NONE) return err; break; } @@ -8069,10 +8063,10 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint if (command == CMD_TYPE_GET_VALUES_2) { int objid = decode_objid (p, &p, end); - int err; + ErrorCode err; err = get_object (objid, (MonoObject**)&thread_obj); - if (err) + if (err != ERR_NONE) return err; thread = THREAD_TO_INTERNAL (thread_obj); @@ -8081,7 +8075,7 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint len = decode_int (p, &p, end); for (i = 0; i < len; ++i) { f = decode_fieldid (p, &p, end, NULL, &err); - if (err) + if (err != ERR_NONE) return err; if (!(f->type->attrs & FIELD_ATTRIBUTE_STATIC)) @@ -8104,7 +8098,7 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint return ERR_INVALID_FIELDID; vtable = mono_class_vtable (domain, f->parent); - val = g_malloc (mono_class_instance_size (mono_class_from_mono_type (f->type))); + val = (guint8 *)g_malloc (mono_class_instance_size (mono_class_from_mono_type (f->type))); mono_field_static_get_value_for_thread (thread ? thread : mono_thread_internal_current (), vtable, f, val); buffer_add_value (buf, f->type, val, domain); g_free (val); @@ -8122,7 +8116,7 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint len = decode_int (p, &p, end); for (i = 0; i < len; ++i) { f = decode_fieldid (p, &p, end, NULL, &err); - if (err) + if (err != ERR_NONE) return err; if (!(f->type->attrs & FIELD_ATTRIBUTE_STATIC)) @@ -8144,9 +8138,9 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint // FIXME: Check for literal/const vtable = mono_class_vtable (domain, f->parent); - val = g_malloc (mono_class_instance_size (mono_class_from_mono_type (f->type))); + val = (guint8 *)g_malloc (mono_class_instance_size (mono_class_from_mono_type (f->type))); err = decode_value (f->type, domain, val, p, &p, end); - if (err) { + if (err != ERR_NONE) { g_free (val); return err; } @@ -8173,7 +8167,7 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint buffer_add_int (buf, files->len); for (i = 0; i < files->len; ++i) { - source_file = g_ptr_array_index (files, i); + source_file = (char *)g_ptr_array_index (files, i); if (command == CMD_TYPE_GET_SOURCE_FILES_2) { buffer_add_string (buf, source_file); } else { @@ -8189,7 +8183,7 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint case CMD_TYPE_IS_ASSIGNABLE_FROM: { MonoClass *oklass = decode_typeid (p, &p, end, NULL, &err); - if (err) + if (err != ERR_NONE) return err; if (mono_class_is_assignable_from (klass, oklass)) buffer_add_byte (buf, 1); @@ -8207,7 +8201,7 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint return ERR_LOADER_ERROR; buffer_add_int (buf, array->len); for (i = 0; i < array->len; ++i) { - MonoMethod *method = g_ptr_array_index (array, i); + MonoMethod *method = (MonoMethod *)g_ptr_array_index (array, i); buffer_add_methodid (buf, domain, method); } @@ -8254,7 +8248,7 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint for (tindex = 0; tindex < len; ++tindex) { iclass = decode_typeid (p, &p, end, NULL, &err); - if (err) + if (err != ERR_NONE) return err; ioffset = mono_class_interface_offset_with_variance (klass, iclass, &variance_used); @@ -8302,10 +8296,10 @@ type_commands (int command, guint8 *p, guint8 *end, Buffer *buf) MonoClass *klass; MonoDomain *old_domain; MonoDomain *domain; - int err; + ErrorCode err; klass = decode_typeid (p, &p, end, &domain, &err); - if (err) + if (err != ERR_NONE) return err; old_domain = mono_domain_get (); @@ -8323,7 +8317,7 @@ static ErrorCode method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, guint8 *p, guint8 *end, Buffer *buf) { MonoMethodHeader *header; - int err; + ErrorCode err; switch (command) { case CMD_METHOD_GET_NAME: { @@ -8364,7 +8358,7 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g if (CHECK_PROTOCOL_VERSION (2, 13)) { buffer_add_int (buf, source_file_list->len); for (i = 0; i < source_file_list->len; ++i) { - MonoDebugSourceInfo *sinfo = g_ptr_array_index (source_file_list, i); + MonoDebugSourceInfo *sinfo = (MonoDebugSourceInfo *)g_ptr_array_index (source_file_list, i); buffer_add_string (buf, sinfo->source_file); if (CHECK_PROTOCOL_VERSION (2, 14)) { for (j = 0; j < 16; ++j) @@ -8381,7 +8375,7 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g const char *srcfile = ""; if (source_files [i] != -1) { - MonoDebugSourceInfo *sinfo = g_ptr_array_index (source_file_list, source_files [i]); + MonoDebugSourceInfo *sinfo = (MonoDebugSourceInfo *)g_ptr_array_index (source_file_list, source_files [i]); srcfile = sinfo->source_file; } DEBUG_PRINTF (10, "IL%x -> %s:%d %d %d %d\n", sp->il_offset, srcfile, sp->line, sp->column, sp->end_line, sp->end_column); @@ -8544,7 +8538,7 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g buffer_add_int (buf, count); for (i = 0; i < count; i++) { MonoGenericParam *param = mono_generic_container_get_param (container, i); - MonoClass *pklass = mono_class_from_generic_parameter (param, method->klass->image, TRUE); + MonoClass *pklass = mono_class_from_generic_parameter_internal (param); buffer_add_typeid (buf, domain, pklass); } } else { @@ -8617,7 +8611,7 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g if (method->wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD) { val = mono_method_get_wrapper_data (method, token); - handle_class = mono_method_get_wrapper_data (method, token + 1); + handle_class = (MonoClass *)mono_method_get_wrapper_data (method, token + 1); if (handle_class == NULL) { // Can't figure out the token type @@ -8639,14 +8633,14 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g buffer_add_typeid (buf, domain, mono_class_from_mono_type ((MonoType*)val)); } else if (handle_class == mono_defaults.fieldhandle_class) { buffer_add_byte (buf, TOKEN_TYPE_FIELD); - buffer_add_fieldid (buf, domain, val); + buffer_add_fieldid (buf, domain, (MonoClassField *)val); } else if (handle_class == mono_defaults.methodhandle_class) { buffer_add_byte (buf, TOKEN_TYPE_METHOD); - buffer_add_methodid (buf, domain, val); + buffer_add_methodid (buf, domain, (MonoMethod *)val); } else if (handle_class == mono_defaults.string_class) { char *s; - s = mono_string_to_utf8 (val); + s = mono_string_to_utf8 ((MonoString *)val); buffer_add_byte (buf, TOKEN_TYPE_STRING); buffer_add_string (buf, s); g_free (s); @@ -8664,13 +8658,13 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g attr_klass = decode_typeid (p, &p, end, NULL, &err); /* attr_klass can be NULL */ - if (err) + if (err != ERR_NONE) return err; cinfo = mono_custom_attrs_from_method (method); err = buffer_add_cattrs (buf, domain, method->klass->image, attr_klass, cinfo); - if (err) + if (err != ERR_NONE) return err; break; } @@ -8688,7 +8682,7 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g type_argv = g_new0 (MonoType*, type_argc); for (i = 0; i < type_argc; ++i) { klass = decode_typeid (p, &p, end, &d, &err); - if (err) { + if (err != ERR_NONE) { g_free (type_argv); return err; } @@ -8720,13 +8714,13 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g static ErrorCode method_commands (int command, guint8 *p, guint8 *end, Buffer *buf) { - int err; + ErrorCode err; MonoDomain *old_domain; MonoDomain *domain; MonoMethod *method; method = decode_methodid (p, &p, end, &domain, &err); - if (err) + if (err != ERR_NONE) return err; old_domain = mono_domain_get (); @@ -8744,12 +8738,12 @@ static ErrorCode thread_commands (int command, guint8 *p, guint8 *end, Buffer *buf) { int objid = decode_objid (p, &p, end); - int err; + ErrorCode err; MonoThread *thread_obj; MonoInternalThread *thread; err = get_object (objid, (MonoObject**)&thread_obj); - if (err) + if (err != ERR_NONE) return err; thread = THREAD_TO_INTERNAL (thread_obj); @@ -8797,7 +8791,7 @@ thread_commands (int command, guint8 *p, guint8 *end, Buffer *buf) return ERR_NOT_IMPLEMENTED; mono_loader_lock (); - tls = mono_g_hash_table_lookup (thread_to_tls, thread); + tls = (DebuggerTlsData *)mono_g_hash_table_lookup (thread_to_tls, thread); mono_loader_unlock (); g_assert (tls); @@ -8841,7 +8835,7 @@ thread_commands (int command, guint8 *p, guint8 *end, Buffer *buf) gint64 il_offset; method = decode_methodid (p, &p, end, &domain, &err); - if (err) + if (err != ERR_NONE) return err; il_offset = decode_long (p, &p, end); @@ -8851,7 +8845,7 @@ thread_commands (int command, guint8 *p, guint8 *end, Buffer *buf) } mono_loader_lock (); - tls = mono_g_hash_table_lookup (thread_to_tls, thread); + tls = (DebuggerTlsData *)mono_g_hash_table_lookup (thread_to_tls, thread); mono_loader_unlock (); g_assert (tls); @@ -8883,7 +8877,7 @@ static ErrorCode frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf) { int objid; - int err; + ErrorCode err; MonoThread *thread_obj; MonoInternalThread *thread; int pos, i, len, frame_idx; @@ -8896,7 +8890,7 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf) objid = decode_objid (p, &p, end); err = get_object (objid, (MonoObject**)&thread_obj); - if (err) + if (err != ERR_NONE) return err; thread = THREAD_TO_INTERNAL (thread_obj); @@ -8904,7 +8898,7 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf) id = decode_id (p, &p, end); mono_loader_lock (); - tls = mono_g_hash_table_lookup (thread_to_tls, thread); + tls = (DebuggerTlsData *)mono_g_hash_table_lookup (thread_to_tls, thread); mono_loader_unlock (); g_assert (tls); @@ -9039,11 +9033,11 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf) } if (MONO_TYPE_IS_REFERENCE (t)) - val_buf = g_alloca (sizeof (MonoObject*)); + val_buf = (guint8 *)g_alloca (sizeof (MonoObject*)); else - val_buf = g_alloca (mono_class_instance_size (mono_class_from_mono_type (t))); + val_buf = (guint8 *)g_alloca (mono_class_instance_size (mono_class_from_mono_type (t))); err = decode_value (t, frame->domain, val_buf, p, &p, end); - if (err) + if (err != ERR_NONE) return err; set_var (t, var, &frame->ctx, frame->domain, val_buf, frame->reg_locations, &tls->restore_state.ctx); @@ -9067,12 +9061,13 @@ static ErrorCode array_commands (int command, guint8 *p, guint8 *end, Buffer *buf) { MonoArray *arr; - int objid, err, index, len, i, esize; + int objid, index, len, i, esize; + ErrorCode err; gpointer elem; objid = decode_objid (p, &p, end); err = get_object (objid, (MonoObject**)&arr); - if (err) + if (err != ERR_NONE) return err; switch (command) { @@ -9114,7 +9109,7 @@ array_commands (int command, guint8 *p, guint8 *end, Buffer *buf) for (i = index; i < index + len; ++i) { elem = (gpointer*)((char*)arr->vector + (i * esize)); - decode_value (&arr->obj.vtable->klass->element_class->byval_arg, arr->obj.vtable->domain, elem, p, &p, end); + decode_value (&arr->obj.vtable->klass->element_class->byval_arg, arr->obj.vtable->domain, (guint8 *)elem, p, &p, end); } break; default: @@ -9127,7 +9122,8 @@ array_commands (int command, guint8 *p, guint8 *end, Buffer *buf) static ErrorCode string_commands (int command, guint8 *p, guint8 *end, Buffer *buf) { - int objid, err; + int objid; + ErrorCode err; MonoString *str; char *s; int i, index, length; @@ -9136,7 +9132,7 @@ string_commands (int command, guint8 *p, guint8 *end, Buffer *buf) objid = decode_objid (p, &p, end); err = get_object (objid, (MonoObject**)&str); - if (err) + if (err != ERR_NONE) return err; switch (command) { @@ -9178,7 +9174,8 @@ string_commands (int command, guint8 *p, guint8 *end, Buffer *buf) static ErrorCode object_commands (int command, guint8 *p, guint8 *end, Buffer *buf) { - int objid, err; + int objid; + ErrorCode err; MonoObject *obj; int len, i; MonoClassField *f; @@ -9188,16 +9185,16 @@ object_commands (int command, guint8 *p, guint8 *end, Buffer *buf) if (command == CMD_OBJECT_REF_IS_COLLECTED) { objid = decode_objid (p, &p, end); err = get_object (objid, &obj); - if (err) + if (err != ERR_NONE) buffer_add_int (buf, 1); else buffer_add_int (buf, 0); - return 0; + return ERR_NONE; } objid = decode_objid (p, &p, end); err = get_object (objid, &obj); - if (err) + if (err != ERR_NONE) return err; MonoClass *obj_type; @@ -9218,7 +9215,7 @@ object_commands (int command, guint8 *p, guint8 *end, Buffer *buf) for (i = 0; i < len; ++i) { MonoClassField *f = decode_fieldid (p, &p, end, NULL, &err); - if (err) + if (err != ERR_NONE) return err; /* Check that the field belongs to the object */ @@ -9241,7 +9238,7 @@ object_commands (int command, guint8 *p, guint8 *end, Buffer *buf) g_assert (f->type->attrs & FIELD_ATTRIBUTE_STATIC); vtable = mono_class_vtable (obj->vtable->domain, f->parent); - val = g_malloc (mono_class_instance_size (mono_class_from_mono_type (f->type))); + val = (guint8 *)g_malloc (mono_class_instance_size (mono_class_from_mono_type (f->type))); mono_field_static_get_value (vtable, f, val); buffer_add_value (buf, f->type, val, obj->vtable->domain); g_free (val); @@ -9255,7 +9252,7 @@ object_commands (int command, guint8 *p, guint8 *end, Buffer *buf) for (i = 0; i < len; ++i) { f = decode_fieldid (p, &p, end, NULL, &err); - if (err) + if (err != ERR_NONE) return err; /* Check that the field belongs to the object */ @@ -9279,9 +9276,9 @@ object_commands (int command, guint8 *p, guint8 *end, Buffer *buf) g_assert (f->type->attrs & FIELD_ATTRIBUTE_STATIC); vtable = mono_class_vtable (obj->vtable->domain, f->parent); - val = g_malloc (mono_class_instance_size (mono_class_from_mono_type (f->type))); + val = (guint8 *)g_malloc (mono_class_instance_size (mono_class_from_mono_type (f->type))); err = decode_value (f->type, obj->vtable->domain, val, p, &p, end); - if (err) { + if (err != ERR_NONE) { g_free (val); return err; } @@ -9289,7 +9286,7 @@ object_commands (int command, guint8 *p, guint8 *end, Buffer *buf) g_free (val); } else { err = decode_value (f->type, obj->vtable->domain, (guint8*)obj + f->offset, p, &p, end); - if (err) + if (err != ERR_NONE) return err; } } @@ -9584,7 +9581,8 @@ wait_for_attach (void) static guint32 WINAPI debugger_thread (void *arg) { - int res, len, id, flags, command_set = 0, command = 0; + int res, len, id, flags, command = 0; + CommandSet command_set = (CommandSet)0; guint8 header [HEADER_LENGTH]; guint8 *data, *p, *end; Buffer buf; @@ -9629,7 +9627,7 @@ debugger_thread (void *arg) len = decode_int (p, &p, end); id = decode_int (p, &p, end); flags = decode_byte (p, &p, end); - command_set = decode_byte (p, &p, end); + command_set = (CommandSet)decode_byte (p, &p, end); command = decode_byte (p, &p, end); g_assert (flags == 0); @@ -9647,7 +9645,7 @@ debugger_thread (void *arg) DEBUG_PRINTF (1, "[dbg] Command %s(%s) [%d][at=%lx].\n", command_set_to_string (command_set), cmd_str, id, (long)mono_100ns_ticks () / 10000); } - data = g_malloc (len - HEADER_LENGTH); + data = (guint8 *)g_malloc (len - HEADER_LENGTH); if (len - HEADER_LENGTH > 0) { MONO_PREPARE_BLOCKING; @@ -9671,7 +9669,7 @@ debugger_thread (void *arg) switch (command_set) { case CMD_SET_VM: err = vm_commands (command, id, p, end, &buf); - if (!err && command == CMD_VM_INVOKE_METHOD) + if (err == ERR_NONE && command == CMD_VM_INVOKE_METHOD) /* Sent after the invoke is complete */ no_reply = TRUE; break; @@ -9728,7 +9726,7 @@ debugger_thread (void *arg) } } - if (!err && command_set == CMD_SET_VM && command == CMD_VM_STOP_BUFFERING) { + if (err == ERR_NONE && command_set == CMD_SET_VM && command == CMD_VM_STOP_BUFFERING) { send_buffered_reply_packets (); buffer_replies = FALSE; } @@ -9741,13 +9739,11 @@ debugger_thread (void *arg) } mono_set_is_debugger_attached (FALSE); - - MONO_TRY_BLOCKING; - mono_mutex_lock (&debugger_thread_exited_mutex); + + mono_coop_mutex_lock (&debugger_thread_exited_mutex); debugger_thread_exited = TRUE; - mono_cond_signal (&debugger_thread_exited_cond); - mono_mutex_unlock (&debugger_thread_exited_mutex); - MONO_FINISH_TRY_BLOCKING; + mono_coop_cond_signal (&debugger_thread_exited_cond); + mono_coop_mutex_unlock (&debugger_thread_exited_mutex); DEBUG_PRINTF (1, "[dbg] Debugger thread exited.\n"); diff --git a/mono/mini/decompose.c b/mono/mini/decompose.c index d3fc7f2e923..2dfff74b4fb 100644 --- a/mono/mini/decompose.c +++ b/mono/mini/decompose.c @@ -539,7 +539,7 @@ mono_decompose_opcode (MonoCompile *cfg, MonoInst *ins) g_assert (!info->sig->hasthis); g_assert (info->sig->param_count <= MONO_MAX_SRC_REGS); - args = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst*) * info->sig->param_count); + args = (MonoInst **)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst*) * info->sig->param_count); if (info->sig->param_count > 0) { int sregs [MONO_MAX_SRC_REGS]; int num_sregs, i; @@ -1197,9 +1197,11 @@ mono_decompose_vtype_opts (MonoCompile *cfg) * Create a dummy bblock and emit code into it so we can use the normal * code generation macros. */ - cfg->cbb = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoBasicBlock)); + cfg->cbb = (MonoBasicBlock *)mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoBasicBlock)); first_bb = cfg->cbb; + /* For LLVM, decompose only the OP_STOREV_MEMBASE opcodes, which need write barriers and the gsharedvt opcodes */ + for (bb = cfg->bb_entry; bb; bb = bb->next_bb) { MonoInst *ins; MonoInst *prev = NULL; @@ -1218,11 +1220,12 @@ mono_decompose_vtype_opts (MonoCompile *cfg) for (ins = bb->code; ins; ins = ins->next) { switch (ins->opcode) { case OP_VMOVE: { + g_assert (ins->klass); + if (COMPILE_LLVM (cfg) && !mini_is_gsharedvt_klass (ins->klass)) + break; src_var = get_vreg_to_inst (cfg, ins->sreg1); dest_var = get_vreg_to_inst (cfg, ins->dreg); - g_assert (ins->klass); - if (!src_var) src_var = mono_compile_create_var_for_vreg (cfg, &ins->klass->byval_arg, OP_LOCAL, ins->dreg); @@ -1240,6 +1243,9 @@ mono_decompose_vtype_opts (MonoCompile *cfg) break; } case OP_VZERO: + if (COMPILE_LLVM (cfg)) + break; + g_assert (ins->klass); EMIT_NEW_VARLOADA_VREG (cfg, dest, ins->dreg, &ins->klass->byval_arg); @@ -1258,6 +1264,9 @@ mono_decompose_vtype_opts (MonoCompile *cfg) } break; case OP_DUMMY_VZERO: + if (COMPILE_LLVM (cfg)) + break; + NULLIFY_INS (ins); break; case OP_STOREV_MEMBASE: { @@ -1277,6 +1286,8 @@ mono_decompose_vtype_opts (MonoCompile *cfg) } case OP_LOADV_MEMBASE: { g_assert (ins->klass); + if (COMPILE_LLVM (cfg) && !mini_is_gsharedvt_klass (ins->klass)) + break; dest_var = get_vreg_to_inst (cfg, ins->dreg); // FIXME-VT: @@ -1291,6 +1302,9 @@ mono_decompose_vtype_opts (MonoCompile *cfg) break; } case OP_OUTARG_VT: { + if (COMPILE_LLVM (cfg)) + break; + g_assert (ins->klass); src_var = get_vreg_to_inst (cfg, ins->sreg1); @@ -1307,6 +1321,9 @@ mono_decompose_vtype_opts (MonoCompile *cfg) case OP_OUTARG_VTRETADDR: { MonoCallInst *call = (MonoCallInst*)ins->inst_p1; + if (COMPILE_LLVM (cfg)) + break; + src_var = get_vreg_to_inst (cfg, call->inst.dreg); if (!src_var) src_var = mono_compile_create_var_for_vreg (cfg, call->signature->ret, OP_LOCAL, call->inst.dreg); @@ -1322,6 +1339,9 @@ mono_decompose_vtype_opts (MonoCompile *cfg) MonoCallInst *call = (MonoCallInst*)ins; int size; + if (COMPILE_LLVM (cfg)) + break; + if (call->vret_in_reg) { MonoCallInst *call2; @@ -1442,71 +1462,6 @@ mono_decompose_vtype_opts (MonoCompile *cfg) } } -void -mono_decompose_vtype_opts_llvm (MonoCompile *cfg) -{ - MonoBasicBlock *bb, *first_bb; - - /* Decompose only the OP_STOREV_MEMBASE opcodes, which need write barriers */ - - cfg->cbb = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoBasicBlock)); - first_bb = cfg->cbb; - - for (bb = cfg->bb_entry; bb; bb = bb->next_bb) { - MonoInst *ins; - MonoInst *prev = NULL; - MonoInst *src_var, *src, *dest; - gboolean restart; - int dreg; - - if (cfg->verbose_level > 2) mono_print_bb (bb, "BEFORE LOWER-VTYPE-OPTS(LLVM) "); - - cfg->cbb->code = cfg->cbb->last_ins = NULL; - restart = TRUE; - - while (restart) { - restart = FALSE; - - for (ins = bb->code; ins; ins = ins->next) { - switch (ins->opcode) { - case OP_STOREV_MEMBASE: { - src_var = get_vreg_to_inst (cfg, ins->sreg1); - - if (!src_var) { - g_assert (ins->klass); - src_var = mono_compile_create_var_for_vreg (cfg, &ins->klass->byval_arg, OP_LOCAL, ins->sreg1); - } - - EMIT_NEW_VARLOADA_VREG ((cfg), (src), ins->sreg1, &ins->klass->byval_arg); - - dreg = alloc_preg (cfg); - EMIT_NEW_BIALU_IMM (cfg, dest, OP_ADD_IMM, dreg, ins->inst_destbasereg, ins->inst_offset); - mini_emit_stobj (cfg, dest, src, src_var->klass, src_var->backend.is_pinvoke); - break; - } - default: - break; - } - - g_assert (cfg->cbb == first_bb); - - if (cfg->cbb->code || (cfg->cbb != first_bb)) { - /* Replace the original instruction with the new code sequence */ - - mono_replace_ins (cfg, bb, ins, &prev, first_bb, cfg->cbb); - first_bb->code = first_bb->last_ins = NULL; - first_bb->in_count = first_bb->out_count = 0; - cfg->cbb = first_bb; - } - else - prev = ins; - } - } - - if (cfg->verbose_level > 2) mono_print_bb (bb, "AFTER LOWER-VTYPE-OPTS(LLVM) "); - } -} - inline static MonoInst * mono_get_domainvar (MonoCompile *cfg) { @@ -1534,7 +1489,7 @@ mono_decompose_array_access_opts (MonoCompile *cfg) * Create a dummy bblock and emit code into it so we can use the normal * code generation macros. */ - cfg->cbb = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoBasicBlock)); + cfg->cbb = (MonoBasicBlock *)mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoBasicBlock)); first_bb = cfg->cbb; for (bb = cfg->bb_entry; bb; bb = bb->next_bb) { diff --git a/mono/mini/dominators.c b/mono/mini/dominators.c index b9437db9be4..ab3ba6333cc 100644 --- a/mono/mini/dominators.c +++ b/mono/mini/dominators.c @@ -117,7 +117,7 @@ compute_dominators (MonoCompile *cfg) MonoBitSet *dominators; char *mem; - mem = mono_mempool_alloc0 (cfg->mempool, bitsize); + mem = (char *)mono_mempool_alloc0 (cfg->mempool, bitsize); bb->dominators = dominators = mono_bitset_mem_new (mem, cfg->num_bblocks, 0); mem += bitsize; @@ -199,7 +199,7 @@ compute_dominance_frontier (MonoCompile *cfg) cfg->bblocks [i]->flags &= ~BB_VISITED; bitsize = mono_bitset_alloc_size (cfg->num_bblocks, 0); - mem = mono_mempool_alloc0 (cfg->mempool, bitsize * cfg->num_bblocks); + mem = (char *)mono_mempool_alloc0 (cfg->mempool, bitsize * cfg->num_bblocks); for (i = 0; i < cfg->num_bblocks; ++i) { MonoBasicBlock *bb = cfg->bblocks [i]; @@ -332,7 +332,7 @@ mono_compute_natural_loops (MonoCompile *cfg) GList *l; for (l = h->loop_blocks; l; l = l->next) { - MonoBasicBlock *b = l->data; + MonoBasicBlock *b = (MonoBasicBlock *)l->data; if (b->dfn) mono_bitset_set_fast (in_loop_blocks, b->dfn); } diff --git a/mono/mini/driver.c b/mono/mini/driver.c index ff482db7b51..7f35d2549db 100644 --- a/mono/mini/driver.c +++ b/mono/mini/driver.c @@ -60,6 +60,9 @@ #include #include "version.h" #include "debugger-agent.h" +#if TARGET_OSX +# include +#endif static FILE *mini_stats_fd; @@ -392,7 +395,7 @@ mini_regression_step (MonoImage *image, int verbose, int *total_run, int *total, if (verbose >= 2) g_print ("Running '%s' ...\n", method->name); #ifdef MONO_USE_AOT_COMPILER - if ((func = mono_aot_get_method (mono_get_root_domain (), method))) + if ((func = (TestMethod)mono_aot_get_method (mono_get_root_domain (), method))) ; else #endif @@ -497,7 +500,7 @@ mini_regression (MonoImage *image, int verbose, int *total_run) for (iter = mono_single_method_list; iter; iter = g_slist_next (iter)) { char *method_name; - mono_current_single_method = iter->data; + mono_current_single_method = (MonoMethod *)iter->data; method_name = mono_method_full_name (mono_current_single_method, TRUE); g_print ("Current single method: %s\n", method_name); @@ -934,7 +937,7 @@ compile_all_methods_thread_main_inner (CompileAllThreadArgs *args) g_print ("Compiling %d %s\n", count, desc); g_free (desc); } - cfg = mini_method_compile (method, mono_get_optimizations_for_method (method, args->opts), mono_get_root_domain (), 0, 0, -1); + cfg = mini_method_compile (method, mono_get_optimizations_for_method (method, args->opts), mono_get_root_domain (), (JitFlags)0, 0, -1); if (cfg->exception_type != MONO_EXCEPTION_NONE) { printf ("Compilation of %s failed with exception '%s':\n", mono_method_full_name (cfg->method, TRUE), cfg->exception_message); fail_count ++; @@ -1017,7 +1020,7 @@ typedef struct static void main_thread_handler (gpointer user_data) { - MainThreadArgs *main_args = user_data; + MainThreadArgs *main_args = (MainThreadArgs *)user_data; MonoAssembly *assembly; if (mono_compile_aot) { @@ -1079,7 +1082,7 @@ load_agent (MonoDomain *domain, char *desc) MonoImageOpenStatus open_status; if (col) { - agent = g_memdup (desc, col - desc + 1); + agent = (char *)g_memdup (desc, col - desc + 1); agent [col - desc] = '\0'; args = col + 1; } else { @@ -1257,9 +1260,9 @@ mini_debug_usage (void) } #if defined(MONO_ARCH_ARCHITECTURE) -/* Redefine ARCHITECTURE to include more information */ -#undef ARCHITECTURE -#define ARCHITECTURE MONO_ARCH_ARCHITECTURE +/* Redefine MONO_ARCHITECTURE to include more information */ +#undef MONO_ARCHITECTURE +#define MONO_ARCHITECTURE MONO_ARCH_ARCHITECTURE #endif static const char info[] = @@ -1280,7 +1283,7 @@ static const char info[] = #else "\tNotification: Thread + polling\n" #endif - "\tArchitecture: " ARCHITECTURE "\n" + "\tArchitecture: " MONO_ARCHITECTURE "\n" "\tDisabled: " DISABLED_FEATURES "\n" "\tMisc: " #ifdef MONO_SMALL_CONFIG @@ -1435,7 +1438,7 @@ mono_set_use_smp (int use_smp) #ifdef GLIBC_BEFORE_2_3_4_SCHED_SETAFFINITY sched_setaffinity (getpid(), (gpointer)&proc_mask); #else - sched_setaffinity (getpid(), sizeof (unsigned long), (gpointer)&proc_mask); + sched_setaffinity (getpid(), sizeof (unsigned long), (const cpu_set_t *)&proc_mask); #endif } #endif @@ -1470,14 +1473,30 @@ switch_gc (char* argv[], const char* target_gc) #ifdef TARGET_OSX +/* + * tries to increase the minimum number of files, if the number is below 1024 + */ +static void +darwin_change_default_file_handles () +{ + struct rlimit limit; + + if (getrlimit (RLIMIT_NOFILE, &limit) == 0){ + if (limit.rlim_cur < 1024){ + limit.rlim_cur = MAX(1024,limit.rlim_cur); + setrlimit (RLIMIT_NOFILE, &limit); + } + } +} + static void switch_arch (char* argv[], const char* target_arch) { GString *path; gsize arch_offset; - if ((strcmp (target_arch, "32") == 0 && strcmp (ARCHITECTURE, "x86") == 0) || - (strcmp (target_arch, "64") == 0 && strcmp (ARCHITECTURE, "amd64") == 0)) { + if ((strcmp (target_arch, "32") == 0 && strcmp (MONO_ARCHITECTURE, "x86") == 0) || + (strcmp (target_arch, "64") == 0 && strcmp (MONO_ARCHITECTURE, "amd64") == 0)) { return; /* matching arch loaded */ } @@ -1520,7 +1539,7 @@ mono_main (int argc, char* argv[]) char *config_file = NULL; int i, count = 1; guint32 opt, action = DO_EXEC, recompilation_times = 1; - MonoGraphOptions mono_graph_options = 0; + MonoGraphOptions mono_graph_options = (MonoGraphOptions)0; int mini_verbose = 0; gboolean enable_profile = FALSE; char *trace_options = NULL; @@ -1550,6 +1569,10 @@ mono_main (int argc, char* argv[]) setlocale (LC_ALL, ""); +#if TARGET_OSX + darwin_change_default_file_handles (); +#endif + if (g_getenv ("MONO_NO_SMP")) mono_set_use_smp (FALSE); @@ -2113,10 +2136,10 @@ mono_main (int argc, char* argv[]) (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)) { MonoMethod *nm; nm = mono_marshal_get_native_wrapper (method, TRUE, FALSE); - cfg = mini_method_compile (nm, opt, mono_get_root_domain (), 0, part, -1); + cfg = mini_method_compile (nm, opt, mono_get_root_domain (), (JitFlags)0, part, -1); } else - cfg = mini_method_compile (method, opt, mono_get_root_domain (), 0, part, -1); + cfg = mini_method_compile (method, opt, mono_get_root_domain (), (JitFlags)0, part, -1); if ((mono_graph_options & MONO_GRAPH_CFG_SSA) && !(cfg->comp_done & MONO_COMP_SSA)) { g_warning ("no SSA info available (use -O=deadce)"); return 1; @@ -2148,7 +2171,7 @@ mono_main (int argc, char* argv[]) opt = opt_sets [i]; g_timer_start (timer); for (j = 0; j < count; ++j) { - cfg = mini_method_compile (method, opt, mono_get_root_domain (), 0, 0, -1); + cfg = mini_method_compile (method, opt, mono_get_root_domain (), (JitFlags)0, 0, -1); mono_destroy_compile (cfg); } g_timer_stop (timer); @@ -2171,12 +2194,12 @@ mono_main (int argc, char* argv[]) (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)) method = mono_marshal_get_native_wrapper (method, TRUE, FALSE); - cfg = mini_method_compile (method, opt, mono_get_root_domain (), 0, 0, -1); + cfg = mini_method_compile (method, opt, mono_get_root_domain (), (JitFlags)0, 0, -1); mono_destroy_compile (cfg); } } } else { - cfg = mini_method_compile (method, opt, mono_get_root_domain (), 0, 0, -1); + cfg = mini_method_compile (method, opt, mono_get_root_domain (), (JitFlags)0, 0, -1); mono_destroy_compile (cfg); } #endif @@ -2290,8 +2313,11 @@ mono_set_crash_chaining (gboolean chain_crashes) } void -mono_parse_env_options (int argc, char *argv []) +mono_parse_env_options (int *ref_argc, char **ref_argv []) { + int argc = *ref_argc; + char **argv = *ref_argv; + const char *env_options = g_getenv ("MONO_ENV_OPTIONS"); if (env_options != NULL){ GPtrArray *array = g_ptr_array_new (); @@ -2354,14 +2380,14 @@ mono_parse_env_options (int argc, char *argv []) /* First the environment variable settings, to allow the command line options to override */ for (i = 0; i < array->len; i++) - new_argv [i+1] = g_ptr_array_index (array, i); + new_argv [i+1] = (char *)g_ptr_array_index (array, i); i++; for (j = 1; j < argc; j++) new_argv [i++] = argv [j]; new_argv [i] = NULL; - argc = new_argc; - argv = new_argv; + *ref_argc = new_argc; + *ref_argv = new_argv; } g_ptr_array_free (array, TRUE); } diff --git a/mono/mini/dwarfwriter.c b/mono/mini/dwarfwriter.c index 090f29fb12e..771c1be1e7f 100644 --- a/mono/mini/dwarfwriter.c +++ b/mono/mini/dwarfwriter.c @@ -223,6 +223,39 @@ emit_byte (MonoDwarfWriter *w, guint8 val) mono_img_writer_emit_byte (w->w, val); } +static void +emit_escaped_string (MonoDwarfWriter *w, char *value) +{ + int i, len; + + len = strlen (value); + for (i = 0; i < len; ++i) { + char c = value [i]; + if (!(isalnum (c))) { + switch (c) { + case '_': + case '-': + case ':': + case '.': + case ',': + case '/': + case '<': + case '>': + case '`': + case '(': + case ')': + case '[': + case ']': + break; + default: + value [i] = '_'; + break; + } + } + } + mono_img_writer_emit_string (w->w, value); +} + static G_GNUC_UNUSED void emit_uleb128 (MonoDwarfWriter *w, guint32 value) { @@ -678,7 +711,7 @@ mono_dwarf_escape_path (const char *name) int len, i, j; len = strlen (name); - s = g_malloc0 ((len + 1) * 2); + s = (char *)g_malloc0 ((len + 1) * 2); j = 0; for (i = 0; i < len; ++i) { if (name [i] == '\\') { @@ -708,7 +741,7 @@ emit_all_line_number_info (MonoDwarfWriter *w) /* Collect files */ info_list = g_slist_reverse (w->line_info); for (l = info_list; l; l = l->next) { - MethodLineNumberInfo *info = l->data; + MethodLineNumberInfo *info = (MethodLineNumberInfo *)l->data; MonoDebugMethodInfo *minfo; GPtrArray *source_file_list; @@ -719,7 +752,7 @@ emit_all_line_number_info (MonoDwarfWriter *w) mono_debug_get_seq_points (minfo, NULL, &source_file_list, NULL, NULL, NULL); for (i = 0; i < source_file_list->len; ++i) { - MonoDebugSourceInfo *sinfo = g_ptr_array_index (source_file_list, i); + MonoDebugSourceInfo *sinfo = (MonoDebugSourceInfo *)g_ptr_array_index (source_file_list, i); add_line_number_file_name (w, sinfo->source_file, 0, 0); } } @@ -728,7 +761,7 @@ emit_all_line_number_info (MonoDwarfWriter *w) dir_to_index = g_hash_table_new (g_str_hash, g_str_equal); index_to_dir = g_hash_table_new (NULL, NULL); for (i = 0; i < w->line_number_file_index; ++i) { - char *name = g_hash_table_lookup (w->index_to_file, GUINT_TO_POINTER (i + 1)); + char *name = (char *)g_hash_table_lookup (w->index_to_file, GUINT_TO_POINTER (i + 1)); char *copy; int dir_index = 0; @@ -778,7 +811,7 @@ emit_all_line_number_info (MonoDwarfWriter *w) /* Includes */ emit_section_change (w, ".debug_line", 0); for (i = 0; i < w->line_number_dir_index; ++i) { - char *dir = g_hash_table_lookup (index_to_dir, GUINT_TO_POINTER (i + 1)); + char *dir = (char *)g_hash_table_lookup (index_to_dir, GUINT_TO_POINTER (i + 1)); emit_string (w, mono_dwarf_escape_path (dir)); } @@ -787,7 +820,7 @@ emit_all_line_number_info (MonoDwarfWriter *w) /* Files */ for (i = 0; i < w->line_number_file_index; ++i) { - char *name = g_hash_table_lookup (w->index_to_file, GUINT_TO_POINTER (i + 1)); + char *name = (char *)g_hash_table_lookup (w->index_to_file, GUINT_TO_POINTER (i + 1)); char *basename = NULL, *dir; int dir_index = 0; @@ -814,7 +847,7 @@ emit_all_line_number_info (MonoDwarfWriter *w) /* Emit line number table */ for (l = info_list; l; l = l->next) { - MethodLineNumberInfo *info = l->data; + MethodLineNumberInfo *info = (MethodLineNumberInfo *)l->data; MonoDebugMethodJitInfo *dmji; dmji = mono_debug_find_method (info->method, mono_domain_get ()); @@ -978,7 +1011,7 @@ get_class_die (MonoDwarfWriter *w, MonoClass *klass, gboolean vtype) else cache = w->class_to_die; - return g_hash_table_lookup (cache, klass); + return (const char *)g_hash_table_lookup (cache, klass); } /* Returns the local symbol pointing to the emitted debug info */ @@ -999,7 +1032,7 @@ emit_class_dwarf_info (MonoDwarfWriter *w, MonoClass *klass, gboolean vtype) else cache = w->class_to_die; - die = g_hash_table_lookup (cache, klass); + die = (char *)g_hash_table_lookup (cache, klass); if (die) return die; @@ -1206,7 +1239,7 @@ get_type_die (MonoDwarfWriter *w, MonoType *t) if (t->byref) { if (t->type == MONO_TYPE_VALUETYPE) { - tdie = g_hash_table_lookup (w->class_to_pointer_die, klass); + tdie = (const char *)g_hash_table_lookup (w->class_to_pointer_die, klass); } else { tdie = get_class_die (w, klass, FALSE); @@ -1223,7 +1256,7 @@ get_type_die (MonoDwarfWriter *w, MonoType *t) } else { switch (t->type) { case MONO_TYPE_CLASS: - tdie = g_hash_table_lookup (w->class_to_reference_die, klass); + tdie = (const char *)g_hash_table_lookup (w->class_to_reference_die, klass); //tdie = ".LDIE_OBJECT"; break; case MONO_TYPE_ARRAY: @@ -1237,7 +1270,7 @@ get_type_die (MonoDwarfWriter *w, MonoType *t) break; case MONO_TYPE_GENERICINST: if (!MONO_TYPE_ISSTRUCT (t)) { - tdie = g_hash_table_lookup (w->class_to_reference_die, klass); + tdie = (const char *)g_hash_table_lookup (w->class_to_reference_die, klass); } else { tdie = ".LDIE_I4"; } @@ -1386,7 +1419,7 @@ token_handler (MonoDisHelper *dh, MonoMethod *method, guint32 token) case CEE_CASTCLASS: case CEE_LDELEMA: if (method->wrapper_type) { - klass = data; + klass = (MonoClass *)data; } else { klass = mono_class_get_checked (method->klass->image, token, &error); g_assert (mono_error_ok (&error)); /* FIXME error handling */ @@ -1397,7 +1430,7 @@ token_handler (MonoDisHelper *dh, MonoMethod *method, guint32 token) case CEE_CALL: case CEE_CALLVIRT: if (method->wrapper_type) - cmethod = data; + cmethod = (MonoMethod *)data; else cmethod = mono_get_method_full (method->klass->image, token, NULL, NULL); desc = mono_method_full_name (cmethod, TRUE); @@ -1406,7 +1439,7 @@ token_handler (MonoDisHelper *dh, MonoMethod *method, guint32 token) break; case CEE_CALLI: if (method->wrapper_type) { - desc = mono_signature_get_desc (data, FALSE); + desc = mono_signature_get_desc ((MonoMethodSignature *)data, FALSE); res = g_strdup_printf ("<%s>", desc); g_free (desc); } else { @@ -1418,7 +1451,7 @@ token_handler (MonoDisHelper *dh, MonoMethod *method, guint32 token) case CEE_STFLD: case CEE_STSFLD: if (method->wrapper_type) { - field = data; + field = (MonoClassField *)data; } else { field = mono_field_from_token_checked (method->klass->image, token, &klass, NULL, &error); g_assert (mono_error_ok (&error)); /* FIXME error handling */ @@ -1587,7 +1620,7 @@ emit_line_number_info (MonoDwarfWriter *w, MonoMethod *method, ln_array = g_new0 (MonoDebugLineNumberEntry, debug_info->num_line_numbers); memcpy (ln_array, debug_info->line_numbers, debug_info->num_line_numbers * sizeof (MonoDebugLineNumberEntry)); - qsort (ln_array, debug_info->num_line_numbers, sizeof (MonoDebugLineNumberEntry), (gpointer)compare_lne); + qsort (ln_array, debug_info->num_line_numbers, sizeof (MonoDebugLineNumberEntry), (int (*)(const void *, const void *))compare_lne); native_to_il_offset = g_new0 (int, code_size + 1); @@ -1870,7 +1903,7 @@ mono_dwarf_writer_emit_method (MonoDwarfWriter *w, MonoCompile *cfg, MonoMethod emit_uleb128 (w, ABBREV_SUBPROGRAM); /* DW_AT_name */ name = mono_method_full_name (method, FALSE); - emit_string (w, name); + emit_escaped_string (w, name); /* DW_AT_MIPS_linkage_name */ if (linkage_name) emit_string (w, linkage_name); diff --git a/mono/mini/exceptions-amd64.c b/mono/mini/exceptions-amd64.c index ca3b19bfb0a..3f039f74b3e 100644 --- a/mono/mini/exceptions-amd64.c +++ b/mono/mini/exceptions-amd64.c @@ -167,7 +167,7 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot) /* restore_contect (MonoContext *ctx) */ - start = code = mono_global_codeman_reserve (256); + start = code = (guint8 *)mono_global_codeman_reserve (256); amd64_mov_reg_reg (code, AMD64_R11, AMD64_ARG_REG1, 8); @@ -226,7 +226,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot) GSList *unwind_ops = NULL; const guint kMaxCodeSize = NACL_SIZE (128, 256); - start = code = mono_global_codeman_reserve (kMaxCodeSize); + start = code = (guint8 *)mono_global_codeman_reserve (kMaxCodeSize); /* call_filter (MonoContext *ctx, unsigned long eip) */ code = start; @@ -381,7 +381,7 @@ get_throw_trampoline (MonoTrampInfo **info, gboolean rethrow, gboolean corlib, g dummy_stack_space = 0; #endif - start = code = mono_global_codeman_reserve (kMaxCodeSize); + start = code = (guint8 *)mono_global_codeman_reserve (kMaxCodeSize); /* The stack is unaligned on entry */ stack_size = ALIGN_TO (sizeof (MonoContext) + 64 + dummy_stack_space, MONO_ARCH_FRAME_ALIGNMENT) + 8; @@ -561,9 +561,9 @@ mono_arch_unwind_frame (MonoDomain *domain, MonoJitTlsData *jit_tls, for (i = 0; i < AMD64_NREG; ++i) regs [i] = new_ctx->gregs [i]; - mono_unwind_frame (unwind_info, unwind_info_len, ji->code_start, + mono_unwind_frame (unwind_info, unwind_info_len, (guint8 *)ji->code_start, (guint8*)ji->code_start + ji->code_size, - ip, epilog ? &epilog : NULL, regs, MONO_MAX_IREGS + 1, + (guint8 *)ip, epilog ? &epilog : NULL, regs, MONO_MAX_IREGS + 1, save_locations, MONO_MAX_IREGS, &cfa); for (i = 0; i < AMD64_NREG; ++i) @@ -590,7 +590,7 @@ mono_arch_unwind_frame (MonoDomain *domain, MonoJitTlsData *jit_tls, memcpy (new_ctx, &ext->ctx, sizeof (MonoContext)); - *lmf = (gpointer)(((guint64)(*lmf)->previous_lmf) & ~7); + *lmf = (MonoLMF *)(((guint64)(*lmf)->previous_lmf) & ~7); frame->type = FRAME_TYPE_DEBUGGER_INVOKE; @@ -615,7 +615,7 @@ mono_arch_unwind_frame (MonoDomain *domain, MonoJitTlsData *jit_tls, rip = *(guint64*)((*lmf)->rsp - sizeof(mgreg_t)); } - ji = mini_jit_info_table_find (domain, (gpointer)rip, NULL); + ji = mini_jit_info_table_find (domain, (char *)rip, NULL); /* * FIXME: ji == NULL can happen when a managed-to-native wrapper is interrupted * in the soft debugger suspend code, since (*lmf)->rsp no longer points to the @@ -652,7 +652,7 @@ mono_arch_unwind_frame (MonoDomain *domain, MonoJitTlsData *jit_tls, } } - *lmf = (gpointer)(((guint64)(*lmf)->previous_lmf) & ~7); + *lmf = (MonoLMF *)(((guint64)(*lmf)->previous_lmf) & ~7); return TRUE; } @@ -668,12 +668,12 @@ mono_arch_unwind_frame (MonoDomain *domain, MonoJitTlsData *jit_tls, static void handle_signal_exception (gpointer obj) { - MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); MonoContext ctx; memcpy (&ctx, &jit_tls->ex_ctx, sizeof (MonoContext)); - mono_handle_exception (&ctx, obj); + mono_handle_exception (&ctx, (MonoObject *)obj); mono_restore_context (&ctx); } @@ -715,7 +715,7 @@ mono_arch_handle_exception (void *sigctx, gpointer obj) * signal is disabled, and we could run arbitrary code though the debugger. So * resume into the normal stack and do most work there if possible. */ - MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); /* Pass the ctx parameter in TLS */ mono_sigctx_to_monoctx (sigctx, &jit_tls->ex_ctx); @@ -756,7 +756,7 @@ mono_arch_ip_from_context (void *sigctx) static void restore_soft_guard_pages (void) { - MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); if (jit_tls->stack_ovf_guard_base) mono_mprotect (jit_tls->stack_ovf_guard_base, jit_tls->stack_ovf_guard_size, MONO_MMAP_NONE); } @@ -771,7 +771,7 @@ static void prepare_for_guard_pages (MonoContext *mctx) { gpointer *sp; - sp = (gpointer)(mctx->gregs [AMD64_RSP]); + sp = (gpointer *)(mctx->gregs [AMD64_RSP]); sp -= 1; /* the return addr */ sp [0] = (gpointer)(mctx->gregs [AMD64_RIP]); @@ -780,7 +780,7 @@ prepare_for_guard_pages (MonoContext *mctx) } static void -altstack_handle_and_restore (MonoContext *ctx, gpointer obj, gboolean stack_ovf) +altstack_handle_and_restore (MonoContext *ctx, MonoObject *obj, gboolean stack_ovf) { MonoContext mctx; @@ -797,7 +797,7 @@ mono_arch_handle_altstack_exception (void *sigctx, MONO_SIG_HANDLER_INFO_TYPE *s { #if defined(MONO_ARCH_USE_SIGACTION) MonoException *exc = NULL; - MonoJitInfo *ji = mini_jit_info_table_find (mono_domain_get (), (gpointer)UCONTEXT_REG_RIP (sigctx), NULL); + MonoJitInfo *ji = mini_jit_info_table_find (mono_domain_get (), (char *)UCONTEXT_REG_RIP (sigctx), NULL); gpointer *sp; int frame_size; MonoContext *copied_ctx; @@ -818,8 +818,8 @@ mono_arch_handle_altstack_exception (void *sigctx, MONO_SIG_HANDLER_INFO_TYPE *s frame_size = sizeof (MonoContext) + sizeof (gpointer) * 4 + 128; frame_size += 15; frame_size &= ~15; - sp = (gpointer)(UCONTEXT_REG_RSP (sigctx) & ~15); - sp = (gpointer)((char*)sp - frame_size); + sp = (gpointer *)(UCONTEXT_REG_RSP (sigctx) & ~15); + sp = (gpointer *)((char*)sp - frame_size); copied_ctx = (MonoContext*)(sp + 4); /* the arguments must be aligned */ sp [-1] = (gpointer)UCONTEXT_REG_RIP (sigctx); @@ -882,7 +882,7 @@ mono_arch_exceptions_init (void) /* Call this to avoid initialization races */ tramps = mono_amd64_get_exception_trampolines (FALSE); for (l = tramps; l; l = l->next) { - MonoTrampInfo *info = l->data; + MonoTrampInfo *info = (MonoTrampInfo *)l->data; mono_register_jit_icall (info->code, g_strdup (info->name), NULL, TRUE); mono_tramp_info_register (info, NULL); @@ -1145,7 +1145,7 @@ mono_tasklets_arch_restore (void) if (saved) return (MonoContinuationRestore)saved; - code = start = mono_global_codeman_reserve (kMaxCodeSize); + code = start = (guint8 *)mono_global_codeman_reserve (kMaxCodeSize); /* the signature is: restore (MonoContinuation *cont, int state, MonoLMF **lmf_addr) */ /* cont is in AMD64_ARG_REG1 ($rcx or $rdi) * state is in AMD64_ARG_REG2 ($rdx or $rsi) diff --git a/mono/mini/exceptions.cs b/mono/mini/exceptions.cs index 0148488dee3..e84abc68b01 100644 --- a/mono/mini/exceptions.cs +++ b/mono/mini/exceptions.cs @@ -2816,6 +2816,34 @@ class Tests } return finally_called ? 0 : 1; } + + static int array_len_1 = 1; + + public static int test_0_bounds_check_negative_constant () { + try { + byte[] arr = new byte [array_len_1]; + byte b = arr [-1]; + return 1; + } catch { + } + try { + byte[] arr = new byte [array_len_1]; + arr [-1] = 1; + return 2; + } catch { + } + return 0; + } + + public static int test_0_string_bounds_check_negative_constant () { + try { + string s = "A"; + char c = s [-1]; + return 1; + } catch { + } + return 0; + } } #if !__MOBILE__ diff --git a/mono/mini/genmdesc.c b/mono/mini/genmdesc.c index 0cd3f3b5c81..b996f8f83b5 100644 --- a/mono/mini/genmdesc.c +++ b/mono/mini/genmdesc.c @@ -99,7 +99,7 @@ load_file (const char *name) { is_template = TRUE; desc = g_new0 (OpDesc, 1); } else { - desc = g_hash_table_lookup (table, str); + desc = (OpDesc *)g_hash_table_lookup (table, str); if (!desc) g_error ("Invalid opcode '%s' at line %d in %s\n", str, line, name); if (desc->desc) @@ -165,7 +165,7 @@ load_file (const char *name) { tname = p; while (*p && isalnum (*p)) ++p; *p++ = 0; - tdesc = g_hash_table_lookup (template_table, tname); + tdesc = (OpDesc *)g_hash_table_lookup (template_table, tname); if (!tdesc) g_error ("Invalid template name %s at '%s' at line %d in %s\n", tname, p, line, name); for (i = 0; i < MONO_INST_MAX; ++i) { diff --git a/mono/mini/graph.c b/mono/mini/graph.c index fed90023204..08d2891f87c 100644 --- a/mono/mini/graph.c +++ b/mono/mini/graph.c @@ -20,7 +20,7 @@ static char * convert_name (const char *str) { int i, j, len = strlen (str); - char *res = g_malloc (len * 2); + char *res = (char *)g_malloc (len * 2); j = 0; for (i = 0; i < len; i++) { diff --git a/mono/mini/gshared.cs b/mono/mini/gshared.cs index c4c6a1ff196..48a3e441631 100644 --- a/mono/mini/gshared.cs +++ b/mono/mini/gshared.cs @@ -1718,6 +1718,33 @@ public class Tests return 2; return 0; } + + public interface IFaceTest { + int iface_method (); + } + + public interface IFaceConstrainedIFace { + int foo (ref T val) where T: IFaceTest; + } + + class ConstrainedIFace : IFaceConstrainedIFace { + public int foo (ref T val) where T: IFaceTest { + return val.iface_method (); + } + } + + class ClassTest : IFaceTest { + public int iface_method () { + return 42; + } + } + + // Test constrained calls on an interface made from gsharedvt methods + public static int test_42_gsharedvt_constrained_iface () { + IFaceConstrainedIFace obj = new ConstrainedIFace (); + IFaceTest t = new ClassTest (); + return obj.foo (ref t); + } } // #13191 diff --git a/mono/mini/image-writer.c b/mono/mini/image-writer.c index 0a74bfb4ff8..c216f3b2575 100644 --- a/mono/mini/image-writer.c +++ b/mono/mini/image-writer.c @@ -324,7 +324,7 @@ bin_writer_emit_ensure_buffer (BinSection *section, int size) guint8 *data; while (new_size <= new_offset) new_size *= 2; - data = g_malloc0 (new_size); + data = (guint8 *)g_malloc0 (new_size); #ifdef __native_client_codegen__ /* for Native Client, fill empty space with HLT instruction */ /* instead of 00. */ @@ -448,7 +448,7 @@ static BinReloc* create_reloc (MonoImageWriter *acfg, const char *end, const char* start, int offset) { BinReloc *reloc; - reloc = mono_mempool_alloc0 (acfg->mempool, sizeof (BinReloc)); + reloc = (BinReloc *)mono_mempool_alloc0 (acfg->mempool, sizeof (BinReloc)); reloc->val1 = mono_mempool_strdup (acfg->mempool, end); if (strcmp (start, ".") == 0) { reloc->val2_section = acfg->cur_section; @@ -899,7 +899,7 @@ get_label_addr (MonoImageWriter *acfg, const char *name) BinSection *section; gsize value; - lab = g_hash_table_lookup (acfg->labels, name); + lab = (BinLabel *)g_hash_table_lookup (acfg->labels, name); if (!lab) g_error ("Undefined label: '%s'.\n", name); section = lab->section; @@ -982,7 +982,7 @@ collect_syms (MonoImageWriter *acfg, int *hash, ElfStrTable *strtab, ElfSectHead /*g_print ("sym name %s tabled to %d\n", symbol->name, symbols [i].st_name);*/ section = symbol->section; symbols [i].st_shndx = section->parent? section->parent->shidx: section->shidx; - lab = g_hash_table_lookup (acfg->labels, symbol->name); + lab = (BinLabel *)g_hash_table_lookup (acfg->labels, symbol->name); offset = lab->offset; if (section->parent) { symbols [i].st_value = section->parent->virt_offset + section->cur_offset + offset; @@ -991,7 +991,7 @@ collect_syms (MonoImageWriter *acfg, int *hash, ElfStrTable *strtab, ElfSectHead } if (symbol->end_label) { - BinLabel *elab = g_hash_table_lookup (acfg->labels, symbol->end_label); + BinLabel *elab = (BinLabel *)g_hash_table_lookup (acfg->labels, symbol->end_label); g_assert (elab); symbols [i].st_size = elab->offset - lab->offset; } @@ -1063,7 +1063,7 @@ reloc_symbols (MonoImageWriter *acfg, ElfSymbol *symbols, ElfSectHeader *sheader if (dynamic && !symbol->is_global) continue; section = symbol->section; - lab = g_hash_table_lookup (acfg->labels, symbol->name); + lab = (BinLabel *)g_hash_table_lookup (acfg->labels, symbol->name); offset = lab->offset; if (section->parent) { symbols [i].st_value = sheaders [section->parent->shidx].sh_addr + section->cur_offset + offset; @@ -1615,7 +1615,7 @@ bin_writer_emit_writeout (MonoImageWriter *acfg) if (!acfg->fp) { acfg->out_buf_size = file_offset + sizeof (secth); - acfg->out_buf = g_malloc (acfg->out_buf_size); + acfg->out_buf = (guint8 *)g_malloc (acfg->out_buf_size); } bin_writer_fwrite (acfg, &header, sizeof (header), 1); diff --git a/mono/mini/ir-emit.h b/mono/mini/ir-emit.h index 59654ee9028..b9ed1784a56 100644 --- a/mono/mini/ir-emit.h +++ b/mono/mini/ir-emit.h @@ -106,7 +106,7 @@ alloc_dreg (MonoCompile *cfg, MonoStackType stack_type) * JIT code still uses the left and right fields, so it has to stay. */ #define MONO_INST_NEW(cfg,dest,op) do { \ - (dest) = mono_mempool_alloc ((cfg)->mempool, sizeof (MonoInst)); \ + (dest) = (MonoInst *)mono_mempool_alloc ((cfg)->mempool, sizeof (MonoInst)); \ (dest)->inst_c0 = (dest)->inst_c1 = 0; \ (dest)->next = (dest)->prev = NULL; \ (dest)->opcode = (op); \ @@ -230,7 +230,7 @@ alloc_dreg (MonoCompile *cfg, MonoStackType stack_type) #define NEW_AOTCONST(cfg,dest,patch_type,cons) do { \ MONO_INST_NEW ((cfg), (dest), cfg->compile_aot ? OP_AOTCONST : OP_PCONST); \ (dest)->inst_p0 = (cons); \ - (dest)->inst_i1 = (gpointer)(patch_type); \ + (dest)->inst_i1 = (MonoInst *)(patch_type); \ (dest)->type = STACK_PTR; \ (dest)->dreg = alloc_dreg ((cfg), STACK_PTR); \ } while (0) @@ -311,7 +311,7 @@ alloc_dreg (MonoCompile *cfg, MonoStackType stack_type) type_to_eval_stack_type ((cfg), (vartype), (dest)); \ (dest)->klass = var->klass; \ (dest)->sreg1 = var->dreg; \ - (dest)->dreg = alloc_dreg ((cfg), (dest)->type); \ + (dest)->dreg = alloc_dreg ((cfg), (MonoStackType)(dest)->type); \ if ((dest)->opcode == OP_VMOVE) (dest)->klass = mono_class_from_mono_type ((vartype)); \ } while (0) @@ -373,7 +373,7 @@ handle_gsharedvt_ldaddr (MonoCompile *cfg) (dest)->type = STACK_MP; \ (dest)->klass = cfg->ret->klass; \ (dest)->sreg1 = cfg->vret_addr->dreg; \ - (dest)->dreg = alloc_dreg ((cfg), (dest)->type); \ + (dest)->dreg = alloc_dreg ((cfg), (MonoStackType)(dest)->type); \ } while (0) #define NEW_ARGLOADA(cfg,dest,num) NEW_VARLOADA ((cfg), (dest), arg_array [(num)], param_types [(num)]) @@ -395,7 +395,7 @@ handle_gsharedvt_ldaddr (MonoCompile *cfg) #define NEW_LOAD_MEMBASE_TYPE(cfg,dest,ltype,base,offset) do { \ NEW_LOAD_MEMBASE ((cfg), (dest), mono_type_to_load_membase ((cfg), (ltype)), 0, (base), (offset)); \ type_to_eval_stack_type ((cfg), (ltype), (dest)); \ - (dest)->dreg = alloc_dreg ((cfg), (dest)->type); \ + (dest)->dreg = alloc_dreg ((cfg), (MonoStackType)(dest)->type); \ } while (0) #define NEW_STORE_MEMBASE_TYPE(cfg,dest,ltype,base,offset,sr) do { \ @@ -743,7 +743,7 @@ handle_gsharedvt_ldaddr (MonoCompile *cfg) * block_num: unique ID assigned at bblock creation */ #define NEW_BBLOCK(cfg,bblock) do { \ - (bblock) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoBasicBlock)); \ + (bblock) = (MonoBasicBlock *)mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoBasicBlock)); \ (bblock)->block_num = cfg->num_bblocks++; \ } while (0) @@ -796,7 +796,7 @@ static int ccount = 0; MONO_ADD_INS ((cfg)->cbb, ins); \ MONO_START_BB ((cfg), falsebb); \ } else { \ - ins->inst_many_bb = mono_mempool_alloc (cfg->mempool, sizeof(gpointer)*2); \ + ins->inst_many_bb = (MonoBasicBlock **)mono_mempool_alloc (cfg->mempool, sizeof(gpointer)*2); \ ins->inst_true_bb = (truebb); \ ins->inst_false_bb = NULL; \ mono_link_bblock ((cfg), (cfg)->cbb, (truebb)); \ @@ -817,7 +817,7 @@ static int ccount = 0; #define MONO_EMIT_NEW_BRANCH_BLOCK2(cfg,op,truebb,falsebb) do { \ MonoInst *ins; \ MONO_INST_NEW ((cfg), (ins), (op)); \ - ins->inst_many_bb = mono_mempool_alloc (cfg->mempool, sizeof(gpointer)*2); \ + ins->inst_many_bb = (MonoBasicBlock **)mono_mempool_alloc (cfg->mempool, sizeof(gpointer)*2); \ ins->inst_true_bb = (truebb); \ ins->inst_false_bb = (falsebb); \ mono_link_bblock ((cfg), (cfg)->cbb, (truebb)); \ diff --git a/mono/mini/jit-icalls.c b/mono/mini/jit-icalls.c index a5875f98883..f5b4e4204fd 100644 --- a/mono/mini/jit-icalls.c +++ b/mono/mini/jit-icalls.c @@ -671,14 +671,14 @@ mono_array_new_va (MonoMethod *cm, ...) va_start (ap, cm); - lengths = alloca (sizeof (uintptr_t) * pcount); + lengths = (uintptr_t *)alloca (sizeof (uintptr_t) * pcount); for (i = 0; i < pcount; ++i) lengths [i] = d = va_arg(ap, int); if (rank == pcount) { /* Only lengths provided. */ if (cm->klass->byval_arg.type == MONO_TYPE_ARRAY) { - lower_bounds = alloca (sizeof (intptr_t) * rank); + lower_bounds = (intptr_t *)alloca (sizeof (intptr_t) * rank); memset (lower_bounds, 0, sizeof (intptr_t) * rank); } else { lower_bounds = NULL; @@ -712,7 +712,7 @@ mono_array_new_1 (MonoMethod *cm, guint32 length) g_assert (rank == pcount); if (cm->klass->byval_arg.type == MONO_TYPE_ARRAY) { - lower_bounds = alloca (sizeof (intptr_t) * rank); + lower_bounds = (intptr_t *)alloca (sizeof (intptr_t) * rank); memset (lower_bounds, 0, sizeof (intptr_t) * rank); } else { lower_bounds = NULL; @@ -739,7 +739,7 @@ mono_array_new_2 (MonoMethod *cm, guint32 length1, guint32 length2) g_assert (rank == pcount); if (cm->klass->byval_arg.type == MONO_TYPE_ARRAY) { - lower_bounds = alloca (sizeof (intptr_t) * rank); + lower_bounds = (intptr_t *)alloca (sizeof (intptr_t) * rank); memset (lower_bounds, 0, sizeof (intptr_t) * rank); } else { lower_bounds = NULL; @@ -767,7 +767,7 @@ mono_array_new_3 (MonoMethod *cm, guint32 length1, guint32 length2, guint32 leng g_assert (rank == pcount); if (cm->klass->byval_arg.type == MONO_TYPE_ARRAY) { - lower_bounds = alloca (sizeof (intptr_t) * rank); + lower_bounds = (intptr_t *)alloca (sizeof (intptr_t) * rank); memset (lower_bounds, 0, sizeof (intptr_t) * rank); } else { lower_bounds = NULL; @@ -796,7 +796,7 @@ mono_array_new_4 (MonoMethod *cm, guint32 length1, guint32 length2, guint32 leng g_assert (rank == pcount); if (cm->klass->byval_arg.type == MONO_TYPE_ARRAY) { - lower_bounds = alloca (sizeof (intptr_t) * rank); + lower_bounds = (intptr_t *)alloca (sizeof (intptr_t) * rank); memset (lower_bounds, 0, sizeof (intptr_t) * rank); } else { lower_bounds = NULL; @@ -1119,7 +1119,7 @@ mono_object_castclass_unbox (MonoObject *obj, MonoClass *klass) MonoClass *oklass; if (mini_get_debug_options ()->better_cast_details) { - jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); jit_tls->class_cast_from = NULL; } @@ -1150,7 +1150,7 @@ mono_object_castclass_with_cache (MonoObject *obj, MonoClass *klass, gpointer *c gpointer cached_vtable, obj_vtable; if (mini_get_debug_options ()->better_cast_details) { - jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); jit_tls->class_cast_from = NULL; } @@ -1223,11 +1223,16 @@ static MonoMethod* constrained_gsharedvt_call_setup (gpointer mp, MonoMethod *cmethod, MonoClass *klass, gpointer *this_arg) { MonoMethod *m; - int vt_slot; + int vt_slot, iface_offset; if (klass->flags & TYPE_ATTRIBUTE_INTERFACE) { - mono_set_pending_exception (mono_get_exception_execution_engine ("Not yet supported.")); - return NULL; + MonoObject *this_obj; + + /* Have to use the receiver's type instead of klass, the receiver is a ref type */ + this_obj = *(MonoObject**)mp; + g_assert (this_obj); + + klass = this_obj->vtable->klass; } if (mono_method_signature (cmethod)->pinvoke) { @@ -1239,8 +1244,6 @@ constrained_gsharedvt_call_setup (gpointer mp, MonoMethod *cmethod, MonoClass *k g_assert (klass->vtable); vt_slot = mono_method_get_vtable_slot (cmethod); if (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE) { - int iface_offset; - iface_offset = mono_class_interface_offset (klass, cmethod->klass); g_assert (iface_offset != -1); vt_slot += iface_offset; @@ -1249,6 +1252,7 @@ constrained_gsharedvt_call_setup (gpointer mp, MonoMethod *cmethod, MonoClass *k if (cmethod->is_inflated) m = mono_class_inflate_generic_method (m, mono_method_get_context (cmethod)); } + if (klass->valuetype && (m->klass == mono_defaults.object_class || m->klass == mono_defaults.enum_class->parent || m->klass == mono_defaults.enum_class)) /* * Calling a non-vtype method with a vtype receiver, has to box. @@ -1384,7 +1388,7 @@ mono_resolve_iface_call (MonoObject *this_obj, int imt_slot, MonoMethod *imt_met /* * The exact compiled method might not be shared so it doesn't have an rgctx arg. */ - ji = mini_jit_info_table_find (mono_domain_get (), compiled_method, NULL); + ji = mini_jit_info_table_find (mono_domain_get (), (char *)compiled_method, NULL); if (!ji || (ji && ji->has_generic_jit_info)) { if (m->wrapper_type == MONO_WRAPPER_MANAGED_TO_MANAGED && m->klass->rank && strstr (m->name, "System.Collections.Generic")) m = mono_aot_get_array_helper_from_wrapper (m); diff --git a/mono/mini/jit-icalls.h b/mono/mini/jit-icalls.h index 6368b8d5e37..7c224995c2b 100644 --- a/mono/mini/jit-icalls.h +++ b/mono/mini/jit-icalls.h @@ -195,9 +195,9 @@ gpointer mono_fill_class_rgctx (MonoVTable *vtable, int index); gpointer mono_fill_method_rgctx (MonoMethodRuntimeGenericContext *mrgctx, int index); -gpointer mono_resolve_iface_call (MonoObject *this, int imt_slot, MonoMethod *imt_method, gpointer *out_rgctx_arg); +gpointer mono_resolve_iface_call (MonoObject *this_obj, int imt_slot, MonoMethod *imt_method, gpointer *out_rgctx_arg); -gpointer mono_resolve_vcall (MonoObject *this, int slot, MonoMethod *imt_method); +gpointer mono_resolve_vcall (MonoObject *this_obj, int slot, MonoMethod *imt_method); void mono_init_delegate (MonoDelegate *del, MonoObject *target, MonoMethod *method); diff --git a/mono/mini/linear-scan.c b/mono/mini/linear-scan.c index d778ab5fc73..6ee1e0ff792 100644 --- a/mono/mini/linear-scan.c +++ b/mono/mini/linear-scan.c @@ -23,7 +23,7 @@ mono_varlist_insert_sorted (MonoCompile *cfg, GList *list, MonoMethodVar *mv, in return g_list_prepend (NULL, mv); for (l = list; l; l = l->next) { - MonoMethodVar *v1 = l->data; + MonoMethodVar *v1 = (MonoMethodVar *)l->data; if (sort_type == 2) { if (mv->spill_costs >= v1->spill_costs) { @@ -108,7 +108,7 @@ mono_linear_scan (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_ma /* linear scan */ for (l = vars; l; l = l->next) { - vmv = l->data; + vmv = (MonoMethodVar *)l->data; #ifdef DEBUG_LSCAN printf ("START %2d %08x %08x\n", vmv->idx, vmv->range.first_use.abs_pos, @@ -199,7 +199,7 @@ mono_linear_scan (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_ma n_regvars = 0; for (l = vars; l; l = l->next) { - vmv = l->data; + vmv = (MonoMethodVar *)l->data; if (vmv->reg >= 0) { if ((gains [vmv->reg] > mono_arch_regalloc_cost (cfg, vmv)) && (cfg->varinfo [vmv->idx]->opcode != OP_REGVAR)) { @@ -227,7 +227,7 @@ mono_linear_scan (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_ma /* Compute used regs */ used_regs = 0; for (l = vars; l; l = l->next) { - vmv = l->data; + vmv = (MonoMethodVar *)l->data; if (vmv->reg >= 0) used_regs |= 1LL << vmv->reg; @@ -288,7 +288,7 @@ mono_linear_scan2 (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_m int n_regs, n_regvars, i; for (l = vars; l; l = l->next) { - vmv = l->data; + vmv = (MonoMethodVar *)l->data; LSCAN_DEBUG (printf ("VAR R%d %08x %08x C%d\n", cfg->varinfo [vmv->idx]->dreg, vmv->range.first_use.abs_pos, vmv->range.last_use.abs_pos, vmv->spill_costs)); } @@ -302,7 +302,7 @@ mono_linear_scan2 (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_m inactive = NULL; while (unhandled) { - MonoMethodVar *current = unhandled->data; + MonoMethodVar *current = (MonoMethodVar *)unhandled->data; int pos, reg, max_free_pos; gboolean changed; @@ -470,7 +470,7 @@ mono_linear_scan2 (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_m /* Do the actual register assignment */ n_regvars = 0; for (l = vars; l; l = l->next) { - vmv = l->data; + vmv = (MonoMethodVar *)l->data; if (vmv->reg >= 0) { int reg_index = vmv->reg; @@ -498,7 +498,7 @@ mono_linear_scan2 (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_m /* Compute used regs */ used_regs = 0; for (l = vars; l; l = l->next) { - vmv = l->data; + vmv = (MonoMethodVar *)l->data; if (vmv->reg >= 0) used_regs |= 1LL << vmv->reg; diff --git a/mono/mini/liveness.c b/mono/mini/liveness.c index 355846bea67..ee87dfa082a 100644 --- a/mono/mini/liveness.c +++ b/mono/mini/liveness.c @@ -44,14 +44,14 @@ optimize_initlocals (MonoCompile *cfg); static inline MonoBitSet* mono_bitset_mp_new (MonoMemPool *mp, guint32 size, guint32 max_size) { - guint8 *mem = mono_mempool_alloc0 (mp, size); + guint8 *mem = (guint8 *)mono_mempool_alloc0 (mp, size); return mono_bitset_mem_new (mem, max_size, MONO_BITSET_DONT_FREE); } static inline MonoBitSet* mono_bitset_mp_new_noinit (MonoMemPool *mp, guint32 size, guint32 max_size) { - guint8 *mem = mono_mempool_alloc (mp, size); + guint8 *mem = (guint8 *)mono_mempool_alloc (mp, size); return mono_bitset_mem_new (mem, max_size, MONO_BITSET_DONT_FREE); } @@ -154,7 +154,7 @@ mono_liveness_handle_exception_clauses (MonoCompile *cfg) * Determine which clauses are outer try clauses, i.e. they are not contained in any * other non-try clause. */ - outer_try = mono_mempool_alloc0 (cfg->mempool, sizeof (gboolean) * header->num_clauses); + outer_try = (gboolean *)mono_mempool_alloc0 (cfg->mempool, sizeof (gboolean) * header->num_clauses); for (i = 0; i < header->num_clauses; ++i) outer_try [i] = TRUE; /* Iterate over the clauses backward, so outer clauses come first */ @@ -238,7 +238,7 @@ analyze_liveness_bb (MonoCompile *cfg, MonoBasicBlock *bb) continue; if (ins->opcode == OP_LDADDR) { - MonoInst *var = ins->inst_p0; + MonoInst *var = (MonoInst *)ins->inst_p0; int idx = var->inst_c0; MonoMethodVar *vi = MONO_VARINFO (cfg, idx); @@ -660,7 +660,7 @@ mono_linterval_add_range (MonoCompile *cfg, MonoLiveInterval *interval, int from next_range->from = from; } else { /* Insert it */ - new_range = mono_mempool_alloc (cfg->mempool, sizeof (MonoLiveRange2)); + new_range = (MonoLiveRange2 *)mono_mempool_alloc (cfg->mempool, sizeof (MonoLiveRange2)); new_range->from = from; new_range->to = to; new_range->next = NULL; @@ -753,8 +753,8 @@ mono_linterval_split (MonoCompile *cfg, MonoLiveInterval *interval, MonoLiveInte g_assert (pos > interval->range->from && pos <= interval->last_range->to); - *i1 = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoLiveInterval)); - *i2 = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoLiveInterval)); + *i1 = (MonoLiveInterval *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoLiveInterval)); + *i2 = (MonoLiveInterval *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoLiveInterval)); for (r = interval->range; r; r = r->next) { if (pos > r->to) { @@ -889,12 +889,12 @@ mono_analyze_liveness2 (MonoCompile *cfg) last_use = g_new0 (gint32, max_vars); reverse_len = 1024; - reverse = mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * reverse_len); + reverse = (MonoInst **)mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * reverse_len); for (idx = 0; idx < max_vars; ++idx) { MonoMethodVar *vi = MONO_VARINFO (cfg, idx); - vi->interval = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoLiveInterval)); + vi->interval = (MonoLiveInterval *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoLiveInterval)); } /* @@ -941,7 +941,7 @@ mono_analyze_liveness2 (MonoCompile *cfg) for (nins = 0, pos = block_from, ins = bb->code; ins; ins = ins->next, ++nins, ++pos) { if (nins >= reverse_len) { int new_reverse_len = reverse_len * 2; - MonoInst **new_reverse = mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * new_reverse_len); + MonoInst **new_reverse = (MonoInst **)mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * new_reverse_len); memcpy (new_reverse, reverse, sizeof (MonoInst*) * reverse_len); reverse = new_reverse; reverse_len = new_reverse_len; @@ -1025,17 +1025,17 @@ update_liveness_gc (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins, gint32 /* Add it to the last callsite */ g_assert (*callsites); - last = (*callsites)->data; + last = (GCCallSite *)(*callsites)->data; last->param_slots = g_slist_prepend_mempool (cfg->mempool, last->param_slots, ins); } else if (ins->flags & MONO_INST_GC_CALLSITE) { - GCCallSite *callsite = mono_mempool_alloc0 (cfg->mempool, sizeof (GCCallSite)); + GCCallSite *callsite = (GCCallSite *)mono_mempool_alloc0 (cfg->mempool, sizeof (GCCallSite)); int i; LIVENESS_DEBUG (printf ("\t%x: ", ins->backend.pc_offset); mono_print_ins (ins)); LIVENESS_DEBUG (printf ("\t\tlive: ")); callsite->bb = bb; - callsite->liveness = mono_mempool_alloc0 (cfg->mempool, ALIGN_TO (cfg->num_varinfo, 8) / 8); + callsite->liveness = (guint8 *)mono_mempool_alloc0 (cfg->mempool, ALIGN_TO (cfg->num_varinfo, 8) / 8); callsite->pc_offset = ins->backend.pc_offset; for (i = 0; i < cfg->num_varinfo; ++i) { if (last_use [i] != 0) { @@ -1091,7 +1091,7 @@ mono_analyze_liveness_gc (MonoCompile *cfg) } reverse_len = 1024; - reverse = mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * reverse_len); + reverse = (MonoInst **)mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * reverse_len); for (bb = cfg->bb_entry; bb; bb = bb->next_bb) { MonoInst *ins; @@ -1133,7 +1133,7 @@ mono_analyze_liveness_gc (MonoCompile *cfg) for (nins = 0, pos = block_from, ins = bb->code; ins; ins = ins->next, ++nins, ++pos) { if (nins >= reverse_len) { int new_reverse_len = reverse_len * 2; - MonoInst **new_reverse = mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * new_reverse_len); + MonoInst **new_reverse = (MonoInst **)mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * new_reverse_len); memcpy (new_reverse, reverse, sizeof (MonoInst*) * reverse_len); reverse = new_reverse; reverse_len = new_reverse_len; diff --git a/mono/mini/llvm-jit.cpp b/mono/mini/llvm-jit.cpp new file mode 100644 index 00000000000..dc39414e557 --- /dev/null +++ b/mono/mini/llvm-jit.cpp @@ -0,0 +1,581 @@ +// +// jit-llvm.cpp: Support code for using LLVM as a JIT backend +// +// (C) 2009-2011 Novell, Inc. +// Copyright 2011-2015 Xamarin, Inc (http://www.xamarin.com) +// + +// +// Mono's internal header files are not C++ clean, so avoid including them if +// possible +// + +#include "config.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "mini-llvm-cpp.h" + +#ifndef MONO_CROSS_COMPILE + +using namespace llvm; + +static void (*unhandled_exception)() = default_mono_llvm_unhandled_exception; + +void +mono_llvm_set_unhandled_exception_handler (void) +{ + std::set_terminate (unhandled_exception); +} + +class MonoJITMemoryManager : public JITMemoryManager +{ +private: + JITMemoryManager *mm; + +public: + /* Callbacks installed by mono */ + AllocCodeMemoryCb *alloc_cb; + DlSymCb *dlsym_cb; + ExceptionTableCb *exception_cb; + + MonoJITMemoryManager (); + ~MonoJITMemoryManager (); + + void setMemoryWritable (void); + + void setMemoryExecutable (void); + + void AllocateGOT(); + + unsigned char *getGOTBase() const { + return mm->getGOTBase (); + } + + void setPoisonMemory(bool) { + } + + unsigned char *startFunctionBody(const Function *F, + uintptr_t &ActualSize); + + unsigned char *allocateStub(const GlobalValue* F, unsigned StubSize, + unsigned Alignment); + + void endFunctionBody(const Function *F, unsigned char *FunctionStart, + unsigned char *FunctionEnd); + + unsigned char *allocateSpace(intptr_t Size, unsigned Alignment); + + uint8_t *allocateGlobal(uintptr_t Size, unsigned Alignment); + + void deallocateMemForFunction(const Function *F); + + unsigned char*startExceptionTable(const Function* F, + uintptr_t &ActualSize); + + void endExceptionTable(const Function *F, unsigned char *TableStart, + unsigned char *TableEnd, + unsigned char* FrameRegister); + + virtual void deallocateFunctionBody(void*) { + } + + virtual void deallocateExceptionTable(void*) { + } + + virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, + StringRef SectionName) { + // FIXME: + assert(0); + return NULL; + } + + virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, + StringRef SectionName, bool IsReadOnly) { + // FIXME: + assert(0); + return NULL; + } + + virtual bool applyPermissions(std::string*) { + // FIXME: + assert(0); + return false; + } + + virtual bool finalizeMemory(std::string *ErrMsg = 0) { + // FIXME: + assert(0); + return false; + } + + virtual void* getPointerToNamedFunction(const std::string &Name, bool AbortOnFailure) { + void *res; + char *err; + + err = dlsym_cb (Name.c_str (), &res); + if (err) { + outs () << "Unable to resolve: " << Name << ": " << err << "\n"; + assert(0); + return NULL; + } + return res; + } +}; + +MonoJITMemoryManager::MonoJITMemoryManager () +{ + mm = JITMemoryManager::CreateDefaultMemManager (); +} + +MonoJITMemoryManager::~MonoJITMemoryManager () +{ + delete mm; +} + +void +MonoJITMemoryManager::setMemoryWritable (void) +{ +} + +void +MonoJITMemoryManager::setMemoryExecutable (void) +{ +} + +void +MonoJITMemoryManager::AllocateGOT() +{ + mm->AllocateGOT (); +} + +unsigned char * +MonoJITMemoryManager::startFunctionBody(const Function *F, + uintptr_t &ActualSize) +{ + // FIXME: This leaks memory + if (ActualSize == 0) + ActualSize = 128; + return alloc_cb (wrap (F), ActualSize); +} + +unsigned char * +MonoJITMemoryManager::allocateStub(const GlobalValue* F, unsigned StubSize, + unsigned Alignment) +{ + return alloc_cb (wrap (F), StubSize); +} + +void +MonoJITMemoryManager::endFunctionBody(const Function *F, unsigned char *FunctionStart, + unsigned char *FunctionEnd) +{ +} + +unsigned char * +MonoJITMemoryManager::allocateSpace(intptr_t Size, unsigned Alignment) +{ + return new unsigned char [Size]; +} + +uint8_t * +MonoJITMemoryManager::allocateGlobal(uintptr_t Size, unsigned Alignment) +{ + return new unsigned char [Size]; +} + +void +MonoJITMemoryManager::deallocateMemForFunction(const Function *F) +{ +} + +unsigned char* +MonoJITMemoryManager::startExceptionTable(const Function* F, + uintptr_t &ActualSize) +{ + return startFunctionBody(F, ActualSize); +} + +void +MonoJITMemoryManager::endExceptionTable(const Function *F, unsigned char *TableStart, + unsigned char *TableEnd, + unsigned char* FrameRegister) +{ + exception_cb (FrameRegister); +} + +class MonoJITEventListener : public JITEventListener { + +public: + FunctionEmittedCb *emitted_cb; + + MonoJITEventListener (FunctionEmittedCb *cb) { + emitted_cb = cb; + } + + virtual void NotifyFunctionEmitted(const Function &F, + void *Code, size_t Size, + const EmittedFunctionDetails &Details) { + emitted_cb (wrap (&F), Code, (char*)Code + Size); + } +}; + +class MonoEE { +public: + ExecutionEngine *EE; + MonoJITMemoryManager *mm; + MonoJITEventListener *listener; + FunctionPassManager *fpm; +}; + +void +mono_llvm_optimize_method (MonoEERef eeref, LLVMValueRef method) +{ + MonoEE *mono_ee = (MonoEE*)eeref; + + /* + * The verifier does some checks on the whole module, leading to quadratic behavior. + */ + //verifyFunction (*(unwrap (method))); + mono_ee->fpm->run (*unwrap (method)); +} + +static cl::list +PassList(cl::desc("Optimizations available:")); + +static void +force_pass_linking (void) +{ + // Make sure the rest is linked in, but never executed + if (g_getenv ("FOO") != (char*)-1) + return; + + // This is a subset of the passes in LinkAllPasses.h + // The utility passes and the interprocedural passes are commented out + + (void) llvm::createAAEvalPass(); + (void) llvm::createAggressiveDCEPass(); + (void) llvm::createAliasAnalysisCounterPass(); + (void) llvm::createAliasDebugger(); + /* + (void) llvm::createArgumentPromotionPass(); + (void) llvm::createStructRetPromotionPass(); + */ + (void) llvm::createBasicAliasAnalysisPass(); + (void) llvm::createLibCallAliasAnalysisPass(0); + (void) llvm::createScalarEvolutionAliasAnalysisPass(); + //(void) llvm::createBlockPlacementPass(); + (void) llvm::createBreakCriticalEdgesPass(); + (void) llvm::createCFGSimplificationPass(); + /* + (void) llvm::createConstantMergePass(); + (void) llvm::createConstantPropagationPass(); + */ + /* + (void) llvm::createDeadArgEliminationPass(); + */ + (void) llvm::createDeadCodeEliminationPass(); + (void) llvm::createDeadInstEliminationPass(); + (void) llvm::createDeadStoreEliminationPass(); + /* + (void) llvm::createDeadTypeEliminationPass(); + (void) llvm::createDomOnlyPrinterPass(); + (void) llvm::createDomPrinterPass(); + (void) llvm::createDomOnlyViewerPass(); + (void) llvm::createDomViewerPass(); + (void) llvm::createEdgeProfilerPass(); + (void) llvm::createOptimalEdgeProfilerPass(); + (void) llvm::createFunctionInliningPass(); + (void) llvm::createAlwaysInlinerPass(); + (void) llvm::createGlobalDCEPass(); + (void) llvm::createGlobalOptimizerPass(); + (void) llvm::createGlobalsModRefPass(); + (void) llvm::createIPConstantPropagationPass(); + (void) llvm::createIPSCCPPass(); + */ + (void) llvm::createIndVarSimplifyPass(); + (void) llvm::createInstructionCombiningPass(); + /* + (void) llvm::createInternalizePass(false); + */ + (void) llvm::createLCSSAPass(); + (void) llvm::createLICMPass(); + (void) llvm::createLazyValueInfoPass(); + //(void) llvm::createLoopDependenceAnalysisPass(); + /* + (void) llvm::createLoopExtractorPass(); + */ + (void) llvm::createLoopSimplifyPass(); + (void) llvm::createLoopStrengthReducePass(); + (void) llvm::createLoopUnrollPass(); + (void) llvm::createLoopUnswitchPass(); + (void) llvm::createLoopRotatePass(); + (void) llvm::createLowerInvokePass(); + /* + (void) llvm::createLowerSetJmpPass(); + */ + (void) llvm::createLowerSwitchPass(); + (void) llvm::createNoAAPass(); + /* + (void) llvm::createNoProfileInfoPass(); + (void) llvm::createProfileEstimatorPass(); + (void) llvm::createProfileVerifierPass(); + (void) llvm::createProfileLoaderPass(); + */ + (void) llvm::createPromoteMemoryToRegisterPass(); + (void) llvm::createDemoteRegisterToMemoryPass(); + /* + (void) llvm::createPruneEHPass(); + (void) llvm::createPostDomOnlyPrinterPass(); + (void) llvm::createPostDomPrinterPass(); + (void) llvm::createPostDomOnlyViewerPass(); + (void) llvm::createPostDomViewerPass(); + */ + (void) llvm::createReassociatePass(); + (void) llvm::createSCCPPass(); + (void) llvm::createScalarReplAggregatesPass(); + //(void) llvm::createSimplifyLibCallsPass(); + /* + (void) llvm::createSingleLoopExtractorPass(); + (void) llvm::createStripSymbolsPass(); + (void) llvm::createStripNonDebugSymbolsPass(); + (void) llvm::createStripDeadDebugInfoPass(); + (void) llvm::createStripDeadPrototypesPass(); + (void) llvm::createTailCallEliminationPass(); + (void) llvm::createTailDuplicationPass(); + (void) llvm::createJumpThreadingPass(); + */ + /* + (void) llvm::createUnifyFunctionExitNodesPass(); + */ + (void) llvm::createInstCountPass(); + (void) llvm::createCodeGenPreparePass(); + (void) llvm::createGVNPass(); + (void) llvm::createMemCpyOptPass(); + (void) llvm::createLoopDeletionPass(); + /* + (void) llvm::createPostDomTree(); + (void) llvm::createPostDomFrontier(); + (void) llvm::createInstructionNamerPass(); + (void) llvm::createPartialSpecializationPass(); + (void) llvm::createFunctionAttrsPass(); + (void) llvm::createMergeFunctionsPass(); + (void) llvm::createPrintModulePass(0); + (void) llvm::createPrintFunctionPass("", 0); + (void) llvm::createDbgInfoPrinterPass(); + (void) llvm::createModuleDebugInfoPrinterPass(); + (void) llvm::createPartialInliningPass(); + (void) llvm::createGEPSplitterPass(); + (void) llvm::createLintPass(); + */ + (void) llvm::createSinkingPass(); +} + +static gboolean inited; + +static void +init_llvm (void) +{ + if (inited) + return; + + force_pass_linking (); + +#ifdef TARGET_ARM + LLVMInitializeARMTarget (); + LLVMInitializeARMTargetInfo (); + LLVMInitializeARMTargetMC (); +#elif defined(TARGET_X86) || defined(TARGET_AMD64) + LLVMInitializeX86Target (); + LLVMInitializeX86TargetInfo (); + LLVMInitializeX86TargetMC (); +#elif defined(TARGET_POWERPC) + LLVMInitializePowerPCTarget (); + LLVMInitializePowerPCTargetInfo (); + LLVMInitializePowerPCTargetMC (); +#else + #error Unsupported mono-llvm target +#endif + + PassRegistry &Registry = *PassRegistry::getPassRegistry(); + initializeCore(Registry); + initializeScalarOpts(Registry); + initializeAnalysis(Registry); + initializeIPA(Registry); + initializeTransformUtils(Registry); + initializeInstCombine(Registry); + initializeTarget(Registry); + + llvm::cl::ParseEnvironmentOptions("mono", "MONO_LLVM", ""); + + inited = true; +} + +MonoEERef +mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, FunctionEmittedCb *emitted_cb, ExceptionTableCb *exception_cb, DlSymCb *dlsym_cb, LLVMExecutionEngineRef *ee) +{ + std::string Error; + MonoEE *mono_ee; + + init_llvm (); + + mono_ee = new MonoEE (); + + MonoJITMemoryManager *mono_mm = new MonoJITMemoryManager (); + mono_mm->alloc_cb = alloc_cb; + mono_mm->dlsym_cb = dlsym_cb; + mono_mm->exception_cb = exception_cb; + mono_ee->mm = mono_mm; + + /* + * The Default code model doesn't seem to work on amd64, + * test_0_fields_with_big_offsets (among others) crashes, because LLVM tries to call + * memset using a normal pcrel code which is in 32bit memory, while memset isn't. + */ + + TargetOptions opts; + opts.JITExceptionHandling = 1; + + StringRef cpu_name = sys::getHostCPUName (); + + // EngineBuilder no longer has a copy assignment operator (?) + std::unique_ptr Owner(unwrap(MP)); + EngineBuilder b (std::move(Owner)); + ExecutionEngine *EE = b.setJITMemoryManager (mono_mm).setTargetOptions (opts).setAllocateGVsWithCode (true).setMCPU (cpu_name).create (); + + g_assert (EE); + mono_ee->EE = EE; + + MonoJITEventListener *listener = new MonoJITEventListener (emitted_cb); + EE->RegisterJITEventListener (listener); + mono_ee->listener = listener; + + FunctionPassManager *fpm = new FunctionPassManager (unwrap (MP)); + mono_ee->fpm = fpm; + + fpm->add(new DataLayoutPass(*EE->getDataLayout())); + + if (PassList.size() > 0) { + /* Use the passes specified by the env variable */ + /* Only the passes in force_pass_linking () can be used */ + for (unsigned i = 0; i < PassList.size(); ++i) { + const PassInfo *PassInf = PassList[i]; + Pass *P = 0; + + if (PassInf->getNormalCtor()) + P = PassInf->getNormalCtor()(); + fpm->add (P); + } + } else { + /* Use the same passes used by 'opt' by default, without the ipo passes */ + const char *opts = "-simplifycfg -domtree -domfrontier -scalarrepl -instcombine -simplifycfg -domtree -domfrontier -scalarrepl -instcombine -simplifycfg -instcombine -simplifycfg -reassociate -domtree -loops -loop-simplify -domfrontier -loop-simplify -lcssa -loop-rotate -licm -lcssa -loop-unswitch -instcombine -scalar-evolution -loop-simplify -lcssa -iv-users -indvars -loop-deletion -loop-simplify -lcssa -loop-unroll -instcombine -memdep -gvn -memdep -memcpyopt -sccp -instcombine -domtree -memdep -dse -adce -gvn -simplifycfg"; + char **args; + int i; + + args = g_strsplit (opts, " ", 1000); + for (i = 0; args [i]; i++) + ; + llvm::cl::ParseCommandLineOptions (i, args, ""); + g_strfreev (args); + + for (unsigned i = 0; i < PassList.size(); ++i) { + const PassInfo *PassInf = PassList[i]; + Pass *P = 0; + + if (PassInf->getNormalCtor()) + P = PassInf->getNormalCtor()(); + g_assert (P->getPassKind () == llvm::PT_Function || P->getPassKind () == llvm::PT_Loop); + fpm->add (P); + } + + /* + fpm->add(createInstructionCombiningPass()); + fpm->add(createReassociatePass()); + fpm->add(createGVNPass()); + fpm->add(createCFGSimplificationPass()); + */ + } + + *ee = wrap (EE); + + return mono_ee; +} + +void +mono_llvm_dispose_ee (MonoEERef *eeref) +{ + MonoEE *mono_ee = (MonoEE*)eeref; + + delete mono_ee->EE; + delete mono_ee->fpm; + //delete mono_ee->mm; + delete mono_ee->listener; + delete mono_ee; +} + +#else /* MONO_CROSS_COMPILE */ + +void +mono_llvm_set_unhandled_exception_handler (void) +{ +} + +MonoEERef +mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, FunctionEmittedCb *emitted_cb, ExceptionTableCb *exception_cb, DlSymCb *dlsym_cb, LLVMExecutionEngineRef *ee) +{ + g_assert_not_reached (); + return NULL; +} + +void +mono_llvm_optimize_method (MonoEERef eeref, LLVMValueRef method) +{ +} + +void +mono_llvm_dispose_ee (MonoEERef *eeref) +{ + g_assert_not_reached (); +} + +/* Not linked in */ +void +LLVMAddGlobalMapping(LLVMExecutionEngineRef EE, LLVMValueRef Global, + void* Addr) +{ + g_assert_not_reached (); +} + +void* +LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global) +{ + g_assert_not_reached (); + return NULL; +} + +#endif /* !MONO_CROSS_COMPILE */ diff --git a/mono/mini/local-propagation.c b/mono/mini/local-propagation.c index 3d4e8029aab..fc7b74692f7 100644 --- a/mono/mini/local-propagation.c +++ b/mono/mini/local-propagation.c @@ -58,8 +58,8 @@ mono_local_cprop (MonoCompile *cfg) restart: max = cfg->next_vreg; - defs = mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * (cfg->next_vreg + 1)); - def_index = mono_mempool_alloc (cfg->mempool, sizeof (guint32) * (cfg->next_vreg + 1)); + defs = (MonoInst **)mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * (cfg->next_vreg + 1)); + def_index = (gint32 *)mono_mempool_alloc (cfg->mempool, sizeof (guint32) * (cfg->next_vreg + 1)); for (bb = cfg->bb_entry; bb; bb = bb->next_bb) { MonoInst *ins; @@ -107,7 +107,7 @@ restart: /* FIXME: Optimize this */ if (ins->opcode == OP_LDADDR) { - MonoInst *var = ins->inst_p0; + MonoInst *var = (MonoInst *)ins->inst_p0; defs [var->dreg] = NULL; /* diff --git a/mono/mini/main.c b/mono/mini/main.c index 82849806e0a..4ef344ecdd9 100644 --- a/mono/mini/main.c +++ b/mono/mini/main.c @@ -15,7 +15,7 @@ static int mono_main_with_options (int argc, char *argv []) { - mono_parse_env_options (argc, argv); + mono_parse_env_options (&argc, &argv); return mono_main (argc, argv); } diff --git a/mono/mini/method-to-ir.c b/mono/mini/method-to-ir.c index 70bfd7934f6..a337597dae3 100644 --- a/mono/mini/method-to-ir.c +++ b/mono/mini/method-to-ir.c @@ -499,7 +499,7 @@ add_widen_op (MonoCompile *cfg, MonoInst *ins, MonoInst **arg1_ref, MonoInst **a CHECK_TYPE (ins); \ /* Have to insert a widening op */ \ add_widen_op (cfg, ins, &sp [0], &sp [1]); \ - ins->dreg = alloc_dreg ((cfg), (ins)->type); \ + ins->dreg = alloc_dreg ((cfg), (MonoStackType)(ins)->type); \ MONO_ADD_INS ((cfg)->cbb, (ins)); \ *sp++ = mono_decompose_opcode ((cfg), (ins)); \ } while (0) @@ -510,7 +510,7 @@ add_widen_op (MonoCompile *cfg, MonoInst *ins, MonoInst **arg1_ref, MonoInst **a ins->sreg1 = sp [0]->dreg; \ type_from_op (cfg, ins, sp [0], NULL); \ CHECK_TYPE (ins); \ - (ins)->dreg = alloc_dreg ((cfg), (ins)->type); \ + (ins)->dreg = alloc_dreg ((cfg), (MonoStackType)(ins)->type); \ MONO_ADD_INS ((cfg)->cbb, (ins)); \ *sp++ = mono_decompose_opcode (cfg, ins); \ } while (0) @@ -525,7 +525,7 @@ add_widen_op (MonoCompile *cfg, MonoInst *ins, MonoInst **arg1_ref, MonoInst **a CHECK_TYPE (cmp); \ add_widen_op (cfg, cmp, &sp [0], &sp [1]); \ type_from_op (cfg, ins, sp [0], sp [1]); \ - ins->inst_many_bb = mono_mempool_alloc (cfg->mempool, sizeof(gpointer)*2); \ + ins->inst_many_bb = (MonoBasicBlock **)mono_mempool_alloc (cfg->mempool, sizeof(gpointer)*2); \ GET_BBLOCK (cfg, tblock, target); \ link_bblock (cfg, cfg->cbb, tblock); \ ins->inst_true_bb = tblock; \ @@ -582,7 +582,7 @@ link_bblock (MonoCompile *cfg, MonoBasicBlock *from, MonoBasicBlock* to) } } if (!found) { - newa = mono_mempool_alloc (cfg->mempool, sizeof (gpointer) * (from->out_count + 1)); + newa = (MonoBasicBlock **)mono_mempool_alloc (cfg->mempool, sizeof (gpointer) * (from->out_count + 1)); for (i = 0; i < from->out_count; ++i) { newa [i] = from->out_bb [i]; } @@ -599,7 +599,7 @@ link_bblock (MonoCompile *cfg, MonoBasicBlock *from, MonoBasicBlock* to) } } if (!found) { - newa = mono_mempool_alloc (cfg->mempool, sizeof (gpointer) * (to->in_count + 1)); + newa = (MonoBasicBlock **)mono_mempool_alloc (cfg->mempool, sizeof (gpointer) * (to->in_count + 1)); for (i = 0; i < to->in_count; ++i) { newa [i] = to->in_bb [i]; } @@ -685,7 +685,7 @@ mono_create_spvar_for_region (MonoCompile *cfg, int region) { MonoInst *var; - var = g_hash_table_lookup (cfg->spvars, GINT_TO_POINTER (region)); + var = (MonoInst *)g_hash_table_lookup (cfg->spvars, GINT_TO_POINTER (region)); if (var) return; @@ -699,7 +699,7 @@ mono_create_spvar_for_region (MonoCompile *cfg, int region) MonoInst * mono_find_exvar_for_offset (MonoCompile *cfg, int offset) { - return g_hash_table_lookup (cfg->exvars, GINT_TO_POINTER (offset)); + return (MonoInst *)g_hash_table_lookup (cfg->exvars, GINT_TO_POINTER (offset)); } static MonoInst* @@ -707,7 +707,7 @@ mono_create_exvar_for_offset (MonoCompile *cfg, int offset) { MonoInst *var; - var = g_hash_table_lookup (cfg->exvars, GINT_TO_POINTER (offset)); + var = (MonoInst *)g_hash_table_lookup (cfg->exvars, GINT_TO_POINTER (offset)); if (var) return var; @@ -1397,7 +1397,7 @@ mono_save_token_info (MonoCompile *cfg, MonoImage *image, guint32 token, gpointe * table == 0 means this is a reference made from a wrapper. */ if (cfg->compile_aot && !cfg->generic_context && (mono_metadata_token_table (token) > 0)) { - MonoJumpInfoToken *jump_info_token = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoJumpInfoToken)); + MonoJumpInfoToken *jump_info_token = (MonoJumpInfoToken *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoJumpInfoToken)); jump_info_token->image = image; jump_info_token->token = token; g_hash_table_insert (cfg->token_info_hash, key, jump_info_token); @@ -1447,7 +1447,7 @@ handle_stack_args (MonoCompile *cfg, MonoInst **sp, int count) } //printf ("\n"); if (!found) { - bb->out_stack = mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * count); + bb->out_stack = (MonoInst **)mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * count); for (i = 0; i < count; ++i) { /* * try to reuse temps already allocated for this purpouse, if they occupy the same @@ -1950,7 +1950,7 @@ mini_emit_memcpy (MonoCompile *cfg, int destreg, int doffset, int srcreg, int so } static void -emit_tls_set (MonoCompile *cfg, int sreg1, int tls_key) +emit_tls_set (MonoCompile *cfg, int sreg1, MonoTlsKey tls_key) { MonoInst *ins, *c; @@ -2191,8 +2191,12 @@ target_type_is_incompatible (MonoCompile *cfg, MonoType *target, MonoInst *arg) if (target->byref) { /* FIXME: check that the pointed to types match */ - if (arg->type == STACK_MP) - return target->type != MONO_TYPE_I && arg->klass != mono_class_from_mono_type (target); + if (arg->type == STACK_MP) { + MonoClass *base_class = mono_class_from_mono_type (target); + /* This is needed to handle gshared types + ldaddr */ + simple_type = mini_get_underlying_type (&base_class->byval_arg); + return target->type != MONO_TYPE_I && arg->klass != base_class && arg->klass != mono_class_from_mono_type (simple_type); + } if (arg->type == STACK_PTR) return 0; return 1; @@ -2264,11 +2268,13 @@ target_type_is_incompatible (MonoCompile *cfg, MonoType *target, MonoInst *arg) return 0; case MONO_TYPE_GENERICINST: if (mono_type_generic_inst_is_valuetype (simple_type)) { + MonoClass *target_class; if (arg->type != STACK_VTYPE) return 1; klass = mono_class_from_mono_type (simple_type); + target_class = mono_class_from_mono_type (target); /* The second cases is needed when doing partial sharing */ - if (klass != arg->klass && mono_class_from_mono_type (target) != arg->klass) + if (klass != arg->klass && target_class != arg->klass && target_class != mono_class_from_mono_type (mini_get_underlying_type (&arg->klass->byval_arg))) return 1; return 0; } else { @@ -2474,7 +2480,7 @@ emit_imt_argument (MonoCompile *cfg, MonoCallInst *call, MonoMethod *method, Mon static MonoJumpInfo * mono_patch_info_new (MonoMemPool *mp, int ip, MonoJumpInfoType type, gconstpointer target) { - MonoJumpInfo *ji = mono_mempool_alloc (mp, sizeof (MonoJumpInfo)); + MonoJumpInfo *ji = (MonoJumpInfo *)mono_mempool_alloc (mp, sizeof (MonoJumpInfo)); ji->ip.i = ip; ji->type = type; @@ -2550,7 +2556,7 @@ check_method_sharing (MonoCompile *cfg, MonoMethod *cmethod, gboolean *out_pass_ inline static MonoCallInst * mono_emit_call_args (MonoCompile *cfg, MonoMethodSignature *sig, - MonoInst **args, int calli, int virtual, int tail, int rgctx, int unbox_trampoline) + MonoInst **args, int calli, int virtual_, int tail, int rgctx, int unbox_trampoline) { MonoType *sig_ret; MonoCallInst *call; @@ -2566,7 +2572,7 @@ mono_emit_call_args (MonoCompile *cfg, MonoMethodSignature *sig, MONO_INST_NEW_CALL (cfg, call, OP_TAILCALL); } else - MONO_INST_NEW_CALL (cfg, call, ret_type_to_call_opcode (cfg, sig->ret, calli, virtual)); + MONO_INST_NEW_CALL (cfg, call, ret_type_to_call_opcode (cfg, sig->ret, calli, virtual_)); call->args = args; call->signature = sig; @@ -2605,7 +2611,7 @@ mono_emit_call_args (MonoCompile *cfg, MonoMethodSignature *sig, call->vret_var = loada; } else if (!MONO_TYPE_IS_VOID (sig_ret)) - call->inst.dreg = alloc_dreg (cfg, call->inst.type); + call->inst.dreg = alloc_dreg (cfg, (MonoStackType)call->inst.type); #ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK if (COMPILE_SOFT_FLOAT (cfg)) { @@ -2743,7 +2749,7 @@ mono_emit_method_call_full (MonoCompile *cfg, MonoMethod *method, MonoMethodSign #ifndef DISABLE_REMOTING gboolean might_be_remote = FALSE; #endif - gboolean virtual = this_ins != NULL; + gboolean virtual_ = this_ins != NULL; gboolean enable_for_aot = TRUE; int context_used; MonoCallInst *call; @@ -2807,7 +2813,7 @@ mono_emit_method_call_full (MonoCompile *cfg, MonoMethod *method, MonoMethodSign } #endif - if (cfg->llvm_only && !call_target && virtual && (method->flags & METHOD_ATTRIBUTE_VIRTUAL)) { + if (cfg->llvm_only && !call_target && virtual_ && (method->flags & METHOD_ATTRIBUTE_VIRTUAL)) { // FIXME: Vcall optimizations below MonoInst *icall_args [16]; MonoInst *ins; @@ -2837,7 +2843,7 @@ mono_emit_method_call_full (MonoCompile *cfg, MonoMethod *method, MonoMethodSign need_unbox_trampoline = method->klass == mono_defaults.object_class || (method->klass->flags & TYPE_ATTRIBUTE_INTERFACE); - call = mono_emit_call_args (cfg, sig, args, FALSE, virtual, tail, rgctx_arg ? TRUE : FALSE, need_unbox_trampoline); + call = mono_emit_call_args (cfg, sig, args, FALSE, virtual_, tail, rgctx_arg ? TRUE : FALSE, need_unbox_trampoline); #ifndef DISABLE_REMOTING if (might_be_remote) @@ -2849,7 +2855,7 @@ mono_emit_method_call_full (MonoCompile *cfg, MonoMethod *method, MonoMethodSign call->inst.inst_left = this_ins; call->tail_call = tail; - if (virtual) { + if (virtual_) { int vtable_reg, slot_reg, this_reg; int offset; @@ -3470,10 +3476,10 @@ emit_get_rgctx (MonoCompile *cfg, MonoMethod *method, int context_used) static MonoJumpInfoRgctxEntry * mono_patch_info_rgctx_entry_new (MonoMemPool *mp, MonoMethod *method, gboolean in_mrgctx, MonoJumpInfoType patch_type, gconstpointer patch_data, MonoRgctxInfoType info_type) { - MonoJumpInfoRgctxEntry *res = mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoRgctxEntry)); + MonoJumpInfoRgctxEntry *res = (MonoJumpInfoRgctxEntry *)mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoRgctxEntry)); res->method = method; res->in_mrgctx = in_mrgctx; - res->data = mono_mempool_alloc0 (mp, sizeof (MonoJumpInfo)); + res->data = (MonoJumpInfo *)mono_mempool_alloc0 (mp, sizeof (MonoJumpInfo)); res->data->type = patch_type; res->data->data.target = patch_data; res->info_type = info_type; @@ -3632,7 +3638,7 @@ emit_get_rgctx_gsharedvt_call (MonoCompile *cfg, int context_used, MonoJumpInfoRgctxEntry *entry; MonoInst *rgctx; - call_info = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoJumpInfoGSharedVtCall)); + call_info = (MonoJumpInfoGSharedVtCall *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoJumpInfoGSharedVtCall)); call_info->sig = sig; call_info->method = cmethod; @@ -3655,7 +3661,7 @@ emit_get_rgctx_virt_method (MonoCompile *cfg, int context_used, MonoJumpInfoRgctxEntry *entry; MonoInst *rgctx; - info = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoJumpInfoVirtMethod)); + info = (MonoJumpInfoVirtMethod *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoJumpInfoVirtMethod)); info->klass = klass; info->method = virt_method; @@ -3723,7 +3729,7 @@ static int get_gsharedvt_info_slot (MonoCompile *cfg, gpointer data, MonoRgctxInfoType rgctx_type) { MonoGSharedVtMethodInfo *info = cfg->gsharedvt_info; - MonoRuntimeGenericContextInfoTemplate *template; + MonoRuntimeGenericContextInfoTemplate *template_; int i, idx; g_assert (info); @@ -3739,7 +3745,7 @@ get_gsharedvt_info_slot (MonoCompile *cfg, gpointer data, MonoRgctxInfoType rgct MonoRuntimeGenericContextInfoTemplate *new_entries; int new_count_entries = info->count_entries ? info->count_entries * 2 : 16; - new_entries = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoRuntimeGenericContextInfoTemplate) * new_count_entries); + new_entries = (MonoRuntimeGenericContextInfoTemplate *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoRuntimeGenericContextInfoTemplate) * new_count_entries); memcpy (new_entries, info->entries, sizeof (MonoRuntimeGenericContextInfoTemplate) * info->count_entries); info->entries = new_entries; @@ -3747,9 +3753,9 @@ get_gsharedvt_info_slot (MonoCompile *cfg, gpointer data, MonoRgctxInfoType rgct } idx = info->num_entries; - template = &info->entries [idx]; - template->info_type = rgctx_type; - template->data = data; + template_ = &info->entries [idx]; + template_->info_type = rgctx_type; + template_->data = data; info->num_entries ++; @@ -4108,7 +4114,7 @@ handle_unbox_gsharedvt (MonoCompile *cfg, MonoClass *klass, MonoInst *obj) MonoInst *unbox_call; MonoMethodSignature *unbox_sig; - unbox_sig = mono_mempool_alloc0 (cfg->mempool, MONO_SIZEOF_METHOD_SIGNATURE + (1 * sizeof (MonoType *))); + unbox_sig = (MonoMethodSignature *)mono_mempool_alloc0 (cfg->mempool, MONO_SIZEOF_METHOD_SIGNATURE + (1 * sizeof (MonoType *))); unbox_sig->ret = &klass->byval_arg; unbox_sig->param_count = 1; unbox_sig->params [0] = &mono_defaults.object_class->byval_arg; @@ -4140,7 +4146,7 @@ handle_alloc (MonoCompile *cfg, MonoClass *klass, gboolean for_box, int context_ if (context_used) { MonoInst *data; - int rgctx_info; + MonoRgctxInfoType rgctx_info; MonoInst *iargs [2]; gboolean known_instance_size = !mini_is_gsharedvt_klass (klass); @@ -4312,7 +4318,7 @@ handle_box (MonoCompile *cfg, MonoInst *val, MonoClass *klass, int context_used) * klass is Nullable, need to call Nullable.Box () using a gsharedvt signature, but we cannot * construct that method at JIT time, so have to do things by hand. */ - box_sig = mono_mempool_alloc0 (cfg->mempool, MONO_SIZEOF_METHOD_SIGNATURE + (1 * sizeof (MonoType *))); + box_sig = (MonoMethodSignature *)mono_mempool_alloc0 (cfg->mempool, MONO_SIZEOF_METHOD_SIGNATURE + (1 * sizeof (MonoType *))); box_sig->ret = &mono_defaults.object_class->byval_arg; box_sig->param_count = 1; box_sig->params [0] = &klass->byval_arg; @@ -4920,13 +4926,13 @@ handle_enum_has_flag (MonoCompile *cfg, MonoClass *klass, MonoInst *enum_this, M } { - MonoInst *load, *and, *cmp, *ceq; + MonoInst *load, *and_, *cmp, *ceq; int enum_reg = is_i4 ? alloc_ireg (cfg) : alloc_lreg (cfg); int and_reg = is_i4 ? alloc_ireg (cfg) : alloc_lreg (cfg); int dest_reg = alloc_ireg (cfg); EMIT_NEW_LOAD_MEMBASE (cfg, load, load_opc, enum_reg, enum_this->dreg, 0); - EMIT_NEW_BIALU (cfg, and, is_i4 ? OP_IAND : OP_LAND, and_reg, enum_reg, enum_flag->dreg); + EMIT_NEW_BIALU (cfg, and_, is_i4 ? OP_IAND : OP_LAND, and_reg, enum_reg, enum_flag->dreg); EMIT_NEW_BIALU (cfg, cmp, is_i4 ? OP_ICOMPARE : OP_LCOMPARE, -1, and_reg, enum_flag->dreg); EMIT_NEW_UNALU (cfg, ceq, is_i4 ? OP_ICEQ : OP_LCEQ, dest_reg, -1); @@ -4934,7 +4940,7 @@ handle_enum_has_flag (MonoCompile *cfg, MonoClass *klass, MonoInst *enum_this, M if (!is_i4) { load = mono_decompose_opcode (cfg, load); - and = mono_decompose_opcode (cfg, and); + and_ = mono_decompose_opcode (cfg, and_); cmp = mono_decompose_opcode (cfg, cmp); ceq = mono_decompose_opcode (cfg, ceq); } @@ -4947,7 +4953,7 @@ handle_enum_has_flag (MonoCompile *cfg, MonoClass *klass, MonoInst *enum_this, M * Returns NULL and set the cfg exception on error. */ static G_GNUC_UNUSED MonoInst* -handle_delegate_ctor (MonoCompile *cfg, MonoClass *klass, MonoInst *target, MonoMethod *method, int context_used, gboolean virtual) +handle_delegate_ctor (MonoCompile *cfg, MonoClass *klass, MonoInst *target, MonoMethod *method, int context_used, gboolean virtual_) { MonoInst *ptr; int dreg; @@ -4956,7 +4962,7 @@ handle_delegate_ctor (MonoCompile *cfg, MonoClass *klass, MonoInst *target, Mono MonoDomain *domain; guint8 **code_slot; - if (virtual && !cfg->llvm_only) { + if (virtual_ && !cfg->llvm_only) { MonoMethod *invoke = mono_get_delegate_invoke (klass); g_assert (invoke); @@ -4979,7 +4985,7 @@ handle_delegate_ctor (MonoCompile *cfg, MonoClass *klass, MonoInst *target, Mono args [0] = obj; args [1] = target; args [2] = emit_get_rgctx_method (cfg, context_used, method, MONO_RGCTX_INFO_METHOD); - mono_emit_jit_icall (cfg, virtual ? mono_init_delegate_virtual : mono_init_delegate, args); + mono_emit_jit_icall (cfg, virtual_ ? mono_init_delegate_virtual : mono_init_delegate, args); return obj; } @@ -5016,9 +5022,9 @@ handle_delegate_ctor (MonoCompile *cfg, MonoClass *klass, MonoInst *target, Mono mono_domain_lock (domain); if (!domain_jit_info (domain)->method_code_hash) domain_jit_info (domain)->method_code_hash = g_hash_table_new (NULL, NULL); - code_slot = g_hash_table_lookup (domain_jit_info (domain)->method_code_hash, method); + code_slot = (guint8 **)g_hash_table_lookup (domain_jit_info (domain)->method_code_hash, method); if (!code_slot) { - code_slot = mono_domain_alloc0 (domain, sizeof (gpointer)); + code_slot = (guint8 **)mono_domain_alloc0 (domain, sizeof (gpointer)); g_hash_table_insert (domain_jit_info (domain)->method_code_hash, method, code_slot); } mono_domain_unlock (domain); @@ -5031,13 +5037,13 @@ handle_delegate_ctor (MonoCompile *cfg, MonoClass *klass, MonoInst *target, Mono if (cfg->compile_aot) { MonoDelegateClassMethodPair *del_tramp; - del_tramp = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoDelegateClassMethodPair)); + del_tramp = (MonoDelegateClassMethodPair *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoDelegateClassMethodPair)); del_tramp->klass = klass; del_tramp->method = context_used ? NULL : method; - del_tramp->is_virtual = virtual; + del_tramp->is_virtual = virtual_; EMIT_NEW_AOTCONST (cfg, tramp_ins, MONO_PATCH_INFO_DELEGATE_TRAMPOLINE, del_tramp); } else { - if (virtual) + if (virtual_) trampoline = mono_create_delegate_virtual_trampoline (cfg->domain, klass, context_used ? NULL : method); else trampoline = mono_create_delegate_trampoline_info (cfg->domain, klass, context_used ? NULL : method); @@ -5045,7 +5051,7 @@ handle_delegate_ctor (MonoCompile *cfg, MonoClass *klass, MonoInst *target, Mono } /* Set invoke_impl field */ - if (virtual) { + if (virtual_) { MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, obj->dreg, MONO_STRUCT_OFFSET (MonoDelegate, invoke_impl), tramp_ins->dreg); } else { dreg = alloc_preg (cfg); @@ -5058,7 +5064,7 @@ handle_delegate_ctor (MonoCompile *cfg, MonoClass *klass, MonoInst *target, Mono } dreg = alloc_preg (cfg); - MONO_EMIT_NEW_ICONST (cfg, dreg, virtual ? 1 : 0); + MONO_EMIT_NEW_ICONST (cfg, dreg, virtual_ ? 1 : 0); MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREI1_MEMBASE_REG, obj->dreg, MONO_STRUCT_OFFSET (MonoDelegate, method_is_virtual), dreg); /* All the checks which are in mono_delegate_ctor () are done by the delegate trampoline */ @@ -5638,6 +5644,9 @@ emit_array_store (MonoCompile *cfg, MonoClass *klass, MonoInst **sp, gboolean sa int index_reg = sp [1]->dreg; int offset = (mono_class_array_element_size (klass) * sp [1]->inst_c0) + MONO_STRUCT_OFFSET (MonoArray, vector); + if (SIZEOF_REGISTER == 8 && COMPILE_LLVM (cfg)) + MONO_EMIT_NEW_UNALU (cfg, OP_ZEXT_I4, index_reg, index_reg); + if (safety_checks) MONO_EMIT_BOUNDS_CHECK (cfg, array_reg, MonoArray, max_length, index_reg); EMIT_NEW_STORE_MEMBASE_TYPE (cfg, ins, &klass->byval_arg, array_reg, offset, sp [2]->dreg); @@ -5754,6 +5763,9 @@ emit_array_unsafe_mov (MonoCompile *cfg, MonoMethodSignature *fsig, MonoInst **a MonoClass *param_klass = mono_class_from_mono_type (fsig->params [0]); MonoClass *return_klass = mono_class_from_mono_type (fsig->ret); + if (mini_is_gsharedvt_variable_type (fsig->ret)) + return NULL; + //Valuetypes that are semantically equivalent or numbers than can be widened to if (is_unsafe_mov_compatible (cfg, param_klass, return_klass)) return args [0]; @@ -5886,8 +5898,12 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign int add_reg = alloc_preg (cfg); #if SIZEOF_REGISTER == 8 - /* The array reg is 64 bits but the index reg is only 32 */ - MONO_EMIT_NEW_UNALU (cfg, OP_SEXT_I4, index_reg, args [1]->dreg); + if (COMPILE_LLVM (cfg)) { + MONO_EMIT_NEW_UNALU (cfg, OP_ZEXT_I4, index_reg, args [1]->dreg); + } else { + /* The array reg is 64 bits but the index reg is only 32 */ + MONO_EMIT_NEW_UNALU (cfg, OP_SEXT_I4, index_reg, args [1]->dreg); + } #else index_reg = args [1]->dreg; #endif @@ -6676,13 +6692,13 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign cfg->disable_llvm = TRUE; if (args [0]->opcode == OP_GOT_ENTRY) { - pi = args [0]->inst_p1; + pi = (MonoInst *)args [0]->inst_p1; g_assert (pi->opcode == OP_PATCH_INFO); g_assert (GPOINTER_TO_INT (pi->inst_p1) == MONO_PATCH_INFO_LDSTR); - ji = pi->inst_p0; + ji = (MonoJumpInfoToken *)pi->inst_p0; } else { g_assert (GPOINTER_TO_INT (args [0]->inst_p1) == MONO_PATCH_INFO_LDSTR); - ji = args [0]->inst_p0; + ji = (MonoJumpInfoToken *)args [0]->inst_p0; } NULLIFY_INS (args [0]); @@ -6911,7 +6927,7 @@ emit_init_local (MonoCompile *cfg, int local, MonoType *type, gboolean init) MonoInst *var = cfg->locals [local]; if (COMPILE_SOFT_FLOAT (cfg)) { MonoInst *store; - int reg = alloc_dreg (cfg, var->type); + int reg = alloc_dreg (cfg, (MonoStackType)var->type); emit_init_rvar (cfg, reg, type); EMIT_NEW_LOCSTORE (cfg, store, local, cfg->cbb->last_ins); } else { @@ -6946,7 +6962,7 @@ inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, guint32 prev_cil_offset_to_bb_len; MonoMethod *prev_current_method; MonoGenericContext *prev_generic_context; - gboolean ret_var_set, prev_ret_var_set, prev_disable_inline, virtual = FALSE; + gboolean ret_var_set, prev_ret_var_set, prev_disable_inline, virtual_ = FALSE; g_assert (cfg->exception_type == MONO_EXCEPTION_NONE); @@ -6997,7 +7013,7 @@ inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, } prev_locals = cfg->locals; - cfg->locals = mono_mempool_alloc0 (cfg->mempool, cheader->num_locals * sizeof (MonoInst*)); + cfg->locals = (MonoInst **)mono_mempool_alloc0 (cfg->mempool, cheader->num_locals * sizeof (MonoInst*)); for (i = 0; i < cheader->num_locals; ++i) cfg->locals [i] = mono_compile_create_var (cfg, cheader->locals [i], OP_LOCAL); @@ -7028,9 +7044,9 @@ inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, prev_disable_inline = cfg->disable_inline; if (ip && *ip == CEE_CALLVIRT && !(cmethod->flags & METHOD_ATTRIBUTE_STATIC)) - virtual = TRUE; + virtual_ = TRUE; - costs = mono_method_to_ir (cfg, cmethod, sbblock, ebblock, rvar, sp, real_offset, virtual); + costs = mono_method_to_ir (cfg, cmethod, sbblock, ebblock, rvar, sp, real_offset, virtual_); ret_var_set = cfg->ret_var_set; @@ -7270,7 +7286,7 @@ mini_get_method_allow_open (MonoMethod *m, guint32 token, MonoClass *klass, Mono MonoMethod *method; if (m->wrapper_type != MONO_WRAPPER_NONE) { - method = mono_method_get_wrapper_data (m, token); + method = (MonoMethod *)mono_method_get_wrapper_data (m, token); if (context) { MonoError error; method = mono_class_inflate_generic_method_checked (method, context, &error); @@ -7301,7 +7317,7 @@ mini_get_class (MonoMethod *method, guint32 token, MonoGenericContext *context) MonoClass *klass; if (method->wrapper_type != MONO_WRAPPER_NONE) { - klass = mono_method_get_wrapper_data (method, token); + klass = (MonoClass *)mono_method_get_wrapper_data (method, token); if (context) klass = mono_class_inflate_generic_class (klass, context); } else { @@ -7464,7 +7480,7 @@ initialize_array_data (MonoMethod *method, gboolean aot, unsigned char *ip, Mono /*g_print ("field: 0x%08x, rva: %d, rva_ptr: %p\n", read32 (ip + 2), rva, data_ptr);*/ /* for aot code we do the lookup on load */ if (aot && data_ptr) - return GUINT_TO_POINTER (rva); + return (const char *)GUINT_TO_POINTER (rva); } else { /*FIXME is it possible to AOT a SRE assembly not meant to be saved? */ g_assert (!aot); @@ -7781,7 +7797,7 @@ sig_to_rgctx_sig (MonoMethodSignature *sig) MonoMethodSignature *res; int i; - res = g_malloc (MONO_SIZEOF_METHOD_SIGNATURE + (sig->param_count + 1) * sizeof (MonoType*)); + res = (MonoMethodSignature *)g_malloc (MONO_SIZEOF_METHOD_SIGNATURE + (sig->param_count + 1) * sizeof (MonoType*)); memcpy (res, sig, MONO_SIZEOF_METHOD_SIGNATURE); res->param_count = sig->param_count + 1; for (i = 0; i < sig->param_count; ++i) @@ -7941,7 +7957,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b cfg->real_offset = inline_offset; } - cfg->cil_offset_to_bb = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoBasicBlock*) * header->code_size); + cfg->cil_offset_to_bb = (MonoBasicBlock **)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoBasicBlock*) * header->code_size); cfg->cil_offset_to_bb_len = header->code_size; cfg->current_method = method; @@ -7949,7 +7965,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b if (cfg->verbose_level > 2) printf ("method to IR %s\n", mono_method_full_name (method, TRUE)); - param_types = mono_mempool_alloc (cfg->mempool, sizeof (MonoType*) * num_args); + param_types = (MonoType **)mono_mempool_alloc (cfg->mempool, sizeof (MonoType*) * num_args); if (sig->hasthis) param_types [0] = method->klass->valuetype?&method->klass->this_arg:&method->klass->byval_arg; for (n = 0; n < sig->param_count; ++n) @@ -8034,7 +8050,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b /* mostly like handle_stack_args (), but just sets the input args */ /* printf ("handling clause at IL_%04x\n", clause->handler_offset); */ tblock->in_scount = 1; - tblock->in_stack = mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*)); + tblock->in_stack = (MonoInst **)mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*)); tblock->in_stack [0] = mono_create_exvar_for_offset (cfg, clause->handler_offset); cfg->cbb = tblock; @@ -8066,7 +8082,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b tblock->flags |= BB_EXCEPTION_HANDLER; tblock->real_offset = clause->data.filter_offset; tblock->in_scount = 1; - tblock->in_stack = mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*)); + tblock->in_stack = (MonoInst **)mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*)); /* The filter block shares the exvar with the handler block */ tblock->in_stack [0] = mono_create_exvar_for_offset (cfg, clause->handler_offset); MONO_INST_NEW (cfg, ins, OP_START_HANDLER); @@ -8139,10 +8155,10 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b MonoInst *var, *locals_var; int dreg; - info = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoGSharedVtMethodInfo)); + info = (MonoGSharedVtMethodInfo *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoGSharedVtMethodInfo)); info->method = cfg->method; info->count_entries = 16; - info->entries = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoRuntimeGenericContextInfoTemplate) * info->count_entries); + info->entries = (MonoRuntimeGenericContextInfoTemplate *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoRuntimeGenericContextInfoTemplate) * info->count_entries); cfg->gsharedvt_info = info; var = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL); @@ -8247,7 +8263,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b } /* we use a spare stack slot in SWITCH and NEWOBJ and others */ - stack_start = sp = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst*) * (header->max_stack + 1)); + stack_start = sp = (MonoInst **)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst*) * (header->max_stack + 1)); ins_flag = 0; start_new_bblock = 0; @@ -8567,7 +8583,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b #endif /* FIXME: we should really allocate this only late in the compilation process */ - f = mono_domain_alloc (cfg->domain, sizeof (float)); + f = (float *)mono_domain_alloc (cfg->domain, sizeof (float)); CHECK_OPSIZE (5); CHECK_STACK_OVF (1); @@ -8604,7 +8620,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b #endif /* FIXME: we should really allocate this only late in the compilation process */ - d = mono_domain_alloc (cfg->domain, sizeof (double)); + d = (double *)mono_domain_alloc (cfg->domain, sizeof (double)); CHECK_OPSIZE (9); CHECK_STACK_OVF (1); @@ -8689,7 +8705,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b if (cfg->llvm_only) { MonoInst **args; - args = mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * n); + args = (MonoInst **)mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * n); for (i = 0; i < n; ++i) EMIT_NEW_ARGLOAD (cfg, args [i], i); ins = mono_emit_method_call_full (cfg, cmethod, fsig, TRUE, args, NULL, NULL, NULL); @@ -8713,7 +8729,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b call->method = cmethod; call->tail_call = TRUE; call->signature = mono_method_signature (cmethod); - call->args = mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * n); + call->args = (MonoInst **)mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * n); call->inst.inst_p0 = cmethod; for (i = 0; i < n; ++i) EMIT_NEW_ARGLOAD (cfg, call->args [i], i); @@ -8771,7 +8787,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b CHECK_STACK (n); - //g_assert (!virtual || fsig->hasthis); + //g_assert (!virtual_ || fsig->hasthis); sp -= n; @@ -8802,7 +8818,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b INLINE_FAILURE ("indirect call"); if (addr->opcode == OP_PCONST || addr->opcode == OP_AOTCONST || addr->opcode == OP_GOT_ENTRY) { - int info_type; + MonoJumpInfoType info_type; gpointer info_data; /* @@ -8810,10 +8826,10 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b * with the contents of the aotconst as the patch info. */ if (addr->opcode == OP_PCONST || addr->opcode == OP_AOTCONST) { - info_type = addr->inst_c1; + info_type = (MonoJumpInfoType)addr->inst_c1; info_data = addr->inst_p0; } else { - info_type = addr->inst_right->inst_c1; + info_type = (MonoJumpInfoType)addr->inst_right->inst_c1; info_data = addr->inst_right->inst_left; } @@ -8846,7 +8862,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b MonoInst *addr = NULL; MonoMethodSignature *fsig = NULL; int array_rank = 0; - int virtual = *ip == CEE_CALLVIRT; + int virtual_ = *ip == CEE_CALLVIRT; gboolean pass_imt_from_rgctx = FALSE; MonoInst *imt_arg = NULL; MonoInst *keep_this_alive = NULL; @@ -8927,9 +8943,9 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b if (mono_security_core_clr_enabled ()) ensure_method_is_allowed_to_call_method (cfg, method, cil_method); - if (!virtual && (cmethod->flags & METHOD_ATTRIBUTE_ABSTRACT)) + if (!virtual_ && (cmethod->flags & METHOD_ATTRIBUTE_ABSTRACT)) /* MS.NET seems to silently convert this to a callvirt */ - virtual = 1; + virtual_ = 1; { /* @@ -8940,8 +8956,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b */ const int test_flags = METHOD_ATTRIBUTE_VIRTUAL | METHOD_ATTRIBUTE_FINAL | METHOD_ATTRIBUTE_STATIC; const int expected_flags = METHOD_ATTRIBUTE_VIRTUAL | METHOD_ATTRIBUTE_FINAL; - if (!virtual && mono_class_is_marshalbyref (cmethod->klass) && (cmethod->flags & test_flags) == expected_flags && cfg->method->wrapper_type == MONO_WRAPPER_NONE) - virtual = 1; + if (!virtual_ && mono_class_is_marshalbyref (cmethod->klass) && (cmethod->flags & test_flags) == expected_flags && cfg->method->wrapper_type == MONO_WRAPPER_NONE) + virtual_ = 1; } if (!cmethod->klass->inited) @@ -9005,10 +9021,13 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b CHECK_STACK (n); - //g_assert (!virtual || fsig->hasthis); + //g_assert (!virtual_ || fsig->hasthis); sp -= n; + /* + * We have the `constrained.' prefix opcode. + */ if (constrained_class) { if (mini_is_gsharedvt_klass (constrained_class)) { if ((cmethod->klass != mono_defaults.object_class) && constrained_class->valuetype && cmethod->klass->valuetype) { @@ -9023,9 +9042,6 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b } } - /* - * We have the `constrained.' prefix opcode. - */ if (constrained_partial_call) { gboolean need_box = TRUE; @@ -9141,7 +9157,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b CHECK_CFG_EXCEPTION; } } - virtual = 0; + virtual_ = 0; } constrained_class = NULL; } @@ -9231,9 +9247,9 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b if ((!(cmethod->flags & METHOD_ATTRIBUTE_VIRTUAL) || MONO_METHOD_IS_FINAL (cmethod)) && !mono_class_is_marshalbyref (cmethod->klass)) { - if (virtual) + if (virtual_) check_this = TRUE; - virtual = 0; + virtual_ = 0; } } @@ -9248,7 +9264,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b MONO_EMIT_NEW_CHECK_THIS (cfg, sp [0]->dreg); /* Calling virtual generic methods */ - if (virtual && (cmethod->flags & METHOD_ATTRIBUTE_VIRTUAL) && + if (virtual_ && (cmethod->flags & METHOD_ATTRIBUTE_VIRTUAL) && !(MONO_METHOD_IS_FINAL (cmethod) && cmethod->wrapper_type != MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK) && fsig->generic_param_count && @@ -9333,7 +9349,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b /* Inlining */ if ((cfg->opt & MONO_OPT_INLINE) && - (!virtual || !(cmethod->flags & METHOD_ATTRIBUTE_VIRTUAL) || MONO_METHOD_IS_FINAL (cmethod)) && + (!virtual_ || !(cmethod->flags & METHOD_ATTRIBUTE_VIRTUAL) || MONO_METHOD_IS_FINAL (cmethod)) && mono_method_check_inlining (cfg, cmethod)) { int costs; gboolean always = FALSE; @@ -9405,7 +9421,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b !(cmethod->klass->rank && cmethod->klass->byval_arg.type != MONO_TYPE_SZARRAY)) { MonoRgctxInfoType info_type; - if (virtual) { + if (virtual_) { //if (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE) //GSHAREDVT_FAILURE (*ip); // disable for possible remoting calls @@ -9430,7 +9446,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b if ((cmethod->klass->parent == mono_defaults.multicastdelegate_class) && (!strcmp (cmethod->name, "Invoke"))) keep_this_alive = sp [0]; - if (virtual && (cmethod->flags & METHOD_ATTRIBUTE_VIRTUAL)) + if (virtual_ && (cmethod->flags & METHOD_ATTRIBUTE_VIRTUAL)) info_type = MONO_RGCTX_INFO_METHOD_GSHAREDVT_OUT_TRAMPOLINE_VIRT; else info_type = MONO_RGCTX_INFO_METHOD_GSHAREDVT_OUT_TRAMPOLINE; @@ -9450,7 +9466,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b if (context_used && !imt_arg && !array_rank && !delegate_invoke && (!mono_method_is_generic_sharable_full (cmethod, TRUE, FALSE, FALSE) || !mono_class_generic_sharing_enabled (cmethod->klass)) && - (!virtual || MONO_METHOD_IS_FINAL (cmethod) || + (!virtual_ || MONO_METHOD_IS_FINAL (cmethod) || !(cmethod->flags & METHOD_ATTRIBUTE_VIRTUAL))) { INLINE_FAILURE ("gshared"); @@ -9537,7 +9553,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b goto call_end; } - ins = mini_redirect_call (cfg, cmethod, fsig, sp, virtual ? sp [0] : NULL); + ins = mini_redirect_call (cfg, cmethod, fsig, sp, virtual_ ? sp [0] : NULL); if (ins) goto call_end; @@ -9620,7 +9636,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b * So we make resolve_iface_call return the rgctx, and do two calls with different signatures * based on whenever there is an rgctx or not. */ - if (cfg->llvm_only && virtual && cmethod && (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE)) { + if (cfg->llvm_only && virtual_ && cmethod && (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE)) { MonoInst *args_buf [16], *icall_args [16]; MonoInst **args; MonoBasicBlock *rgctx_bb, *end_bb; @@ -9667,7 +9683,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b if (fsig->param_count + 2 < 16) args = args_buf; else - args = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst*) * (fsig->param_count + 2)); + args = (MonoInst **)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst*) * (fsig->param_count + 2)); args [0] = sp [0]; for (i = 0; i < fsig->param_count; ++i) args [i + 1] = sp [i + 1]; @@ -9685,7 +9701,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b /* Common call */ INLINE_FAILURE ("call"); - ins = mono_emit_method_call_full (cfg, cmethod, fsig, tail_call, sp, virtual ? sp [0] : NULL, + ins = mono_emit_method_call_full (cfg, cmethod, fsig, tail_call, sp, virtual_ ? sp [0] : NULL, imt_arg, vtable_arg); if (tail_call && !cfg->llvm_only) { @@ -9911,7 +9927,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b MONO_INST_NEW (cfg, ins, is_true ? CEE_BNE_UN : CEE_BEQ); type_from_op (cfg, ins, sp [0], NULL); MONO_ADD_INS (cfg->cbb, ins); - ins->inst_many_bb = mono_mempool_alloc (cfg->mempool, sizeof(gpointer)*2); + ins->inst_many_bb = (MonoBasicBlock **)mono_mempool_alloc (cfg->mempool, sizeof(gpointer)*2); GET_BBLOCK (cfg, tblock, target); ins->inst_true_bb = tblock; GET_BBLOCK (cfg, tblock, ip); @@ -9970,7 +9986,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b GET_BBLOCK (cfg, default_bblock, target); default_bblock->flags |= BB_INDIRECT_JUMP_TARGET; - targets = mono_mempool_alloc (cfg->mempool, sizeof (MonoBasicBlock*) * n); + targets = (MonoBasicBlock **)mono_mempool_alloc (cfg->mempool, sizeof (MonoBasicBlock*) * n); for (i = 0; i < n; ++i) { GET_BBLOCK (cfg, tblock, target + (gint32)read32(ip)); targets [i] = tblock; @@ -10003,7 +10019,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b for (i = 0; i < n; ++i) link_bblock (cfg, cfg->cbb, targets [i]); - table = mono_mempool_alloc (cfg->mempool, sizeof (MonoJumpInfoBBTable)); + table = (MonoJumpInfoBBTable *)mono_mempool_alloc (cfg->mempool, sizeof (MonoJumpInfoBBTable)); table->table = targets; table->table_size = n; @@ -10025,7 +10041,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b ins->sreg1 = src1->dreg; ins->inst_p0 = table; ins->inst_many_bb = targets; - ins->klass = GUINT_TO_POINTER (n); + ins->klass = (MonoClass *)GUINT_TO_POINTER (n); MONO_ADD_INS (cfg->cbb, ins); } else { if (sizeof (gpointer) == 8) @@ -10138,7 +10154,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b ins->sreg2 = sp [1]->dreg; type_from_op (cfg, ins, sp [0], sp [1]); CHECK_TYPE (ins); - ins->dreg = alloc_dreg ((cfg), (ins)->type); + ins->dreg = alloc_dreg ((cfg), (MonoStackType)(ins)->type); /* Use the immediate opcodes if possible */ if ((sp [1]->opcode == OP_ICONST) && mono_arch_is_inst_imm (sp [1]->inst_c0)) { @@ -10178,7 +10194,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b type_from_op (cfg, ins, sp [0], sp [1]); CHECK_TYPE (ins); add_widen_op (cfg, ins, &sp [0], &sp [1]); - ins->dreg = alloc_dreg ((cfg), (ins)->type); + ins->dreg = alloc_dreg ((cfg), (MonoStackType)(ins)->type); /* FIXME: Pass opcode to is_inst_imm */ @@ -10426,7 +10442,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b } else if (method->wrapper_type != MONO_WRAPPER_NONE) { MonoInst *iargs [1]; - char *str = mono_method_get_wrapper_data (method, n); + char *str = (char *)mono_method_get_wrapper_data (method, n); if (cfg->compile_aot) EMIT_NEW_LDSTRLITCONST (cfg, iargs [0], str); @@ -10991,7 +11007,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b CHECK_OPSIZE (5); token = read32 (ip + 1); if (method->wrapper_type != MONO_WRAPPER_NONE) { - field = mono_method_get_wrapper_data (method, token); + field = (MonoClassField *)mono_method_get_wrapper_data (method, token); klass = field->parent; } else { @@ -11713,6 +11729,9 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b int index_reg = sp [1]->dreg; int offset = (mono_class_array_element_size (klass) * sp [1]->inst_c0) + MONO_STRUCT_OFFSET (MonoArray, vector); + if (SIZEOF_REGISTER == 8 && COMPILE_LLVM (cfg)) + MONO_EMIT_NEW_UNALU (cfg, OP_ZEXT_I4, index_reg, index_reg); + MONO_EMIT_BOUNDS_CHECK (cfg, array_reg, MonoArray, max_length, index_reg); EMIT_NEW_LOAD_MEMBASE_TYPE (cfg, ins, &klass->byval_arg, array_reg, offset); } else { @@ -11885,7 +11904,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b if (method->wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD || method->wrapper_type == MONO_WRAPPER_SYNCHRONIZED) { handle = mono_method_get_wrapper_data (method, n); - handle_class = mono_method_get_wrapper_data (method, n + 1); + handle_class = (MonoClass *)mono_method_get_wrapper_data (method, n + 1); if (handle_class == mono_defaults.typehandle_class) handle = &((MonoClass*)handle)->byval_arg; } @@ -11904,11 +11923,11 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b typeof(Gen<>). */ context_used = 0; } else if (handle_class == mono_defaults.typehandle_class) { - context_used = mini_class_check_context_used (cfg, mono_class_from_mono_type (handle)); + context_used = mini_class_check_context_used (cfg, mono_class_from_mono_type ((MonoType *)handle)); } else if (handle_class == mono_defaults.fieldhandle_class) context_used = mini_class_check_context_used (cfg, ((MonoClassField*)handle)->parent); else if (handle_class == mono_defaults.methodhandle_class) - context_used = mini_method_check_context_used (cfg, handle); + context_used = mini_method_check_context_used (cfg, (MonoMethod *)handle); else g_assert_not_reached (); } @@ -11944,7 +11963,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b (cmethod = mini_get_method (cfg, method, read32 (ip + 6), NULL, generic_context)) && (cmethod->klass == mono_defaults.systemtype_class) && (strcmp (cmethod->name, "GetTypeFromHandle") == 0)) { - MonoClass *tclass = mono_class_from_mono_type (handle); + MonoClass *tclass = mono_class_from_mono_type ((MonoType *)handle); mono_class_init (tclass); if (context_used) { @@ -11966,7 +11985,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b EMIT_NEW_TYPE_FROM_HANDLE_CONST (cfg, ins, image, n, generic_context); } } else { - EMIT_NEW_PCONST (cfg, ins, mono_type_get_object (cfg->domain, handle)); + EMIT_NEW_PCONST (cfg, ins, mono_type_get_object (cfg->domain, (MonoType *)handle)); } ins->type = STACK_OBJ; ins->klass = cmethod->klass; @@ -11979,14 +11998,14 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b if (context_used) { if (handle_class == mono_defaults.typehandle_class) { ins = emit_get_rgctx_klass (cfg, context_used, - mono_class_from_mono_type (handle), + mono_class_from_mono_type ((MonoType *)handle), MONO_RGCTX_INFO_TYPE); } else if (handle_class == mono_defaults.methodhandle_class) { ins = emit_get_rgctx_method (cfg, context_used, - handle, MONO_RGCTX_INFO_METHOD); + (MonoMethod *)handle, MONO_RGCTX_INFO_METHOD); } else if (handle_class == mono_defaults.fieldhandle_class) { ins = emit_get_rgctx_field (cfg, context_used, - handle, MONO_RGCTX_INFO_CLASS_FIELD); + (MonoClassField *)handle, MONO_RGCTX_INFO_CLASS_FIELD); } else { g_assert_not_reached (); } @@ -12109,7 +12128,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b MonoExceptionClause *clause; for (tmp = handlers; tmp; tmp = tmp->next) { - clause = tmp->data; + clause = (MonoExceptionClause *)tmp->data; tblock = cfg->cil_offset_to_bb [clause->handler_offset]; g_assert (tblock); link_bblock (cfg, cfg->cbb, tblock); @@ -12248,7 +12267,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b CHECK_OPSIZE (6); token = read32 (ip + 2); - cmethod = mono_method_get_wrapper_data (method, token); + cmethod = (MonoMethod *)mono_method_get_wrapper_data (method, token); if (cfg->compile_aot) { EMIT_NEW_AOTCONST (cfg, ins, MONO_PATCH_INFO_ICALL_ADDR, cmethod); @@ -12311,7 +12330,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b CHECK_OPSIZE (6); --sp; token = read32 (ip + 2); - klass = mono_method_get_wrapper_data (method, token); + klass = (MonoClass *)mono_method_get_wrapper_data (method, token); g_assert (klass->valuetype); mono_class_init (klass); @@ -12400,11 +12419,11 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b ip += 2; break; case CEE_MONO_TLS: { - int key; + MonoTlsKey key; CHECK_STACK_OVF (1); CHECK_OPSIZE (6); - key = (gint32)read32 (ip + 2); + key = (MonoTlsKey)read32 (ip + 2); g_assert (key < TLS_KEY_NUM); ins = mono_create_tls_get (cfg, key); @@ -12582,7 +12601,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b cmp->opcode = OP_ICOMPARE; MONO_ADD_INS (cfg->cbb, cmp); ins->type = STACK_I4; - ins->dreg = alloc_dreg (cfg, ins->type); + ins->dreg = alloc_dreg (cfg, (MonoStackType)ins->type); type_from_op (cfg, ins, arg1, arg2); if (cmp->opcode == OP_FCOMPARE || cmp->opcode == OP_RCOMPARE) { @@ -13701,7 +13720,7 @@ mono_handle_global_vregs (MonoCompile *cfg) MonoBasicBlock *bb; int i, pos; - vreg_to_bb = mono_mempool_alloc0 (cfg->mempool, sizeof (gint32*) * cfg->next_vreg + 1); + vreg_to_bb = (gint32 *)mono_mempool_alloc0 (cfg->mempool, sizeof (gint32*) * cfg->next_vreg + 1); #ifdef MONO_ARCH_SIMD_INTRINSICS if (cfg->uses_simd_intrinsics) @@ -13944,7 +13963,7 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts) guint32 *lvregs; guint32 i, lvregs_len; gboolean dest_has_lvreg = FALSE; - guint32 stacktypes [128]; + MonoStackType stacktypes [128]; MonoInst **live_range_start, **live_range_end; MonoBasicBlock **live_range_start_bb, **live_range_end_bb; int *gsharedvt_vreg_to_idx = NULL; @@ -14008,7 +14027,7 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts) } if (cfg->gsharedvt) { - gsharedvt_vreg_to_idx = mono_mempool_alloc0 (cfg->mempool, sizeof (int) * cfg->next_vreg); + gsharedvt_vreg_to_idx = (int *)mono_mempool_alloc0 (cfg->mempool, sizeof (int) * cfg->next_vreg); for (i = 0; i < cfg->num_varinfo; ++i) { MonoInst *ins = cfg->varinfo [i]; @@ -14038,8 +14057,8 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts) * the variable again. */ orig_next_vreg = cfg->next_vreg; - vreg_to_lvreg = mono_mempool_alloc0 (cfg->mempool, sizeof (guint32) * cfg->next_vreg); - lvregs = mono_mempool_alloc (cfg->mempool, sizeof (guint32) * 1024); + vreg_to_lvreg = (guint32 *)mono_mempool_alloc0 (cfg->mempool, sizeof (guint32) * cfg->next_vreg); + lvregs = (guint32 *)mono_mempool_alloc (cfg->mempool, sizeof (guint32) * 1024); lvregs_len = 0; /* @@ -14090,7 +14109,7 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts) * when variable addresses are known. */ if (ins->opcode == OP_LDADDR) { - MonoInst *var = ins->inst_p0; + MonoInst *var = (MonoInst *)ins->inst_p0; if (var->opcode == OP_VTARG_ADDR) { /* Happens on SPARC/S390 where vtypes are passed by reference */ diff --git a/mono/mini/mini-amd64.c b/mono/mini/mini-amd64.c index 1abbd145408..3b92f4c72e8 100644 --- a/mono/mini/mini-amd64.c +++ b/mono/mini/mini-amd64.c @@ -61,8 +61,8 @@ static gboolean optimize_for_xen = TRUE; #endif /* This mutex protects architecture specific caches */ -#define mono_mini_arch_lock() mono_mutex_lock (&mini_arch_mutex) -#define mono_mini_arch_unlock() mono_mutex_unlock (&mini_arch_mutex) +#define mono_mini_arch_lock() mono_os_mutex_lock (&mini_arch_mutex) +#define mono_mini_arch_unlock() mono_os_mutex_unlock (&mini_arch_mutex) static mono_mutex_t mini_arch_mutex; /* The single step trampoline */ @@ -1142,9 +1142,9 @@ get_call_info (MonoMemPool *mp, MonoMethodSignature *sig) gboolean is_pinvoke = sig->pinvoke; if (mp) - cinfo = mono_mempool_alloc0 (mp, sizeof (CallInfo) + (sizeof (ArgInfo) * n)); + cinfo = (CallInfo *)mono_mempool_alloc0 (mp, sizeof (CallInfo) + (sizeof (ArgInfo) * n)); else - cinfo = g_malloc0 (sizeof (CallInfo) + (sizeof (ArgInfo) * n)); + cinfo = (CallInfo *)g_malloc0 (sizeof (CallInfo) + (sizeof (ArgInfo) * n)); cinfo->nargs = n; @@ -1449,7 +1449,7 @@ mono_arch_cpu_init (void) void mono_arch_init (void) { - mono_mutex_init_recursive (&mini_arch_mutex); + mono_os_mutex_init_recursive (&mini_arch_mutex); #if defined(__native_client_codegen__) mono_native_tls_alloc (&nacl_instruction_depth, NULL); mono_native_tls_set_value (nacl_instruction_depth, (gpointer)0); @@ -1472,7 +1472,7 @@ mono_arch_init (void) void mono_arch_cleanup (void) { - mono_mutex_destroy (&mini_arch_mutex); + mono_os_mutex_destroy (&mini_arch_mutex); #if defined(__native_client_codegen__) mono_native_tls_free (nacl_instruction_depth); mono_native_tls_free (nacl_rex_tag); @@ -1593,7 +1593,7 @@ mono_arch_compute_omit_fp (MonoCompile *cfg) if (!cfg->arch.cinfo) cfg->arch.cinfo = get_call_info (cfg->mempool, sig); - cinfo = cfg->arch.cinfo; + cinfo = (CallInfo *)cfg->arch.cinfo; /* * FIXME: Remove some of the restrictions. @@ -1776,7 +1776,7 @@ mono_arch_fill_argument_info (MonoCompile *cfg) sig = mono_method_signature (cfg->method); - cinfo = cfg->arch.cinfo; + cinfo = (CallInfo *)cfg->arch.cinfo; sig_ret = mini_get_underlying_type (sig->ret); /* @@ -1843,7 +1843,7 @@ mono_arch_allocate_vars (MonoCompile *cfg) sig = mono_method_signature (cfg->method); - cinfo = cfg->arch.cinfo; + cinfo = (CallInfo *)cfg->arch.cinfo; sig_ret = mini_get_underlying_type (sig->ret); mono_arch_compute_omit_fp (cfg); @@ -2071,7 +2071,7 @@ mono_arch_create_vars (MonoCompile *cfg) if (!cfg->arch.cinfo) cfg->arch.cinfo = get_call_info (cfg->mempool, sig); - cinfo = cfg->arch.cinfo; + cinfo = (CallInfo *)cfg->arch.cinfo; if (cinfo->ret.storage == ArgValuetypeInReg) cfg->ret_var_is_local = TRUE; @@ -2984,7 +2984,7 @@ mono_arch_finish_dyn_call (MonoDynCallInfo *info, guint8 *buf) } while (0); static guint8* -emit_call_body (MonoCompile *cfg, guint8 *code, guint32 patch_type, gconstpointer data) +emit_call_body (MonoCompile *cfg, guint8 *code, MonoJumpInfoType patch_type, gconstpointer data) { gboolean no_patch = FALSE; @@ -3018,7 +3018,7 @@ emit_call_body (MonoCompile *cfg, guint8 *code, guint32 patch_type, gconstpointe * The call might go directly to a native function without * the wrapper. */ - MonoJitICallInfo *mi = mono_find_jit_icall_by_name (data); + MonoJitICallInfo *mi = mono_find_jit_icall_by_name ((const char *)data); if (mi) { gconstpointer target = mono_icall_get_wrapper (mi); if ((((guint64)target) >> 32) != 0) @@ -3030,7 +3030,7 @@ emit_call_body (MonoCompile *cfg, guint8 *code, guint32 patch_type, gconstpointe MonoJumpInfo *jinfo = NULL; if (cfg->abs_patches) - jinfo = g_hash_table_lookup (cfg->abs_patches, data); + jinfo = (MonoJumpInfo *)g_hash_table_lookup (cfg->abs_patches, data); if (jinfo) { if (jinfo->type == MONO_PATCH_INFO_JIT_ICALL_ADDR) { MonoJitICallInfo *mi = mono_find_jit_icall_by_name (jinfo->data.name); @@ -3109,7 +3109,7 @@ emit_call_body (MonoCompile *cfg, guint8 *code, guint32 patch_type, gconstpointe } static inline guint8* -emit_call (MonoCompile *cfg, guint8 *code, guint32 patch_type, gconstpointer data, gboolean win64_adjust_stack) +emit_call (MonoCompile *cfg, guint8 *code, MonoJumpInfoType patch_type, gconstpointer data, gboolean win64_adjust_stack) { #ifdef TARGET_WIN32 if (win64_adjust_stack) @@ -3597,7 +3597,7 @@ emit_move_return_value (MonoCompile *cfg, MonoInst *ins, guint8 *code) case OP_VCALL2_MEMBASE: cinfo = get_call_info (cfg->mempool, ((MonoCallInst*)ins)->signature); if (cinfo->ret.storage == ArgValuetypeInReg) { - MonoInst *loc = cfg->arch.vret_addr_loc; + MonoInst *loc = (MonoInst *)cfg->arch.vret_addr_loc; /* Load the destination address */ g_assert (loc->opcode == OP_REGOFFSET); @@ -3966,7 +3966,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) if (G_UNLIKELY (offset > (cfg->code_size - max_len - EXTRA_CODE_SPACE))) { cfg->code_size *= 2; - cfg->native_code = mono_realloc_native_code(cfg); + cfg->native_code = (unsigned char *)mono_realloc_native_code(cfg); code = cfg->native_code + offset; cfg->stat_code_reallocs++; } @@ -4314,7 +4314,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_SEQ_POINT: { if (ins->flags & MONO_INST_SINGLE_STEP_LOC) { - MonoInst *var = cfg->arch.ss_tramp_var; + MonoInst *var = (MonoInst *)cfg->arch.ss_tramp_var; guint8 *label; /* Load ss_tramp_var */ @@ -4338,7 +4338,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) if (cfg->compile_aot) { guint32 offset = code - cfg->native_code; guint32 val; - MonoInst *info_var = cfg->arch.seq_point_info_var; + MonoInst *info_var = (MonoInst *)cfg->arch.seq_point_info_var; guint8 *label; /* Load info var */ @@ -4353,7 +4353,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) amd64_call_reg (code, AMD64_R11); amd64_patch (label, code); } else { - MonoInst *var = cfg->arch.bp_tramp_var; + MonoInst *var = (MonoInst *)cfg->arch.bp_tramp_var; guint8 *label; /* @@ -5224,21 +5224,21 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_COND_EXC_IGE_UN: case OP_COND_EXC_ILE: case OP_COND_EXC_ILE_UN: - EMIT_COND_SYSTEM_EXCEPTION (cc_table [mono_opcode_to_cond (ins->opcode)], cc_signed_table [mono_opcode_to_cond (ins->opcode)], ins->inst_p1); + EMIT_COND_SYSTEM_EXCEPTION (cc_table [mono_opcode_to_cond (ins->opcode)], cc_signed_table [mono_opcode_to_cond (ins->opcode)], (const char *)ins->inst_p1); break; case OP_COND_EXC_OV: case OP_COND_EXC_NO: case OP_COND_EXC_C: case OP_COND_EXC_NC: EMIT_COND_SYSTEM_EXCEPTION (branch_cc_table [ins->opcode - OP_COND_EXC_EQ], - (ins->opcode < OP_COND_EXC_NE_UN), ins->inst_p1); + (ins->opcode < OP_COND_EXC_NE_UN), (const char *)ins->inst_p1); break; case OP_COND_EXC_IOV: case OP_COND_EXC_INO: case OP_COND_EXC_IC: case OP_COND_EXC_INC: EMIT_COND_SYSTEM_EXCEPTION (branch_cc_table [ins->opcode - OP_COND_EXC_IEQ], - (ins->opcode < OP_COND_EXC_INE_UN), ins->inst_p1); + (ins->opcode < OP_COND_EXC_INE_UN), (const char *)ins->inst_p1); break; /* floating point opcodes */ @@ -6857,7 +6857,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) cfg->code_size = MAX (cfg->header->code_size * 4, 1024); #if defined(__default_codegen__) - code = cfg->native_code = g_malloc (cfg->code_size); + code = cfg->native_code = (unsigned char *)g_malloc (cfg->code_size); #elif defined(__native_client_codegen__) /* native_code_alloc is not 32-byte aligned, native_code is. */ cfg->native_code_alloc = g_malloc (cfg->code_size + kNaClAlignment); @@ -6968,7 +6968,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) if (G_UNLIKELY (required_code_size >= (cfg->code_size - offset))) { while (required_code_size >= (cfg->code_size - offset)) cfg->code_size *= 2; - cfg->native_code = mono_realloc_native_code (cfg); + cfg->native_code = (unsigned char *)mono_realloc_native_code (cfg); code = cfg->native_code + offset; cfg->stat_code_reallocs++; } @@ -7138,7 +7138,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) sig = mono_method_signature (method); pos = 0; - cinfo = cfg->arch.cinfo; + cinfo = (CallInfo *)cfg->arch.cinfo; if (sig->ret->type != MONO_TYPE_VOID) { /* Save volatile arguments to the stack */ @@ -7243,7 +7243,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) if (trace) { args_clobbered = TRUE; - code = mono_arch_instrument_prolog (cfg, mono_trace_enter_method, code, TRUE); + code = (guint8 *)mono_arch_instrument_prolog (cfg, mono_trace_enter_method, code, TRUE); } if (cfg->prof_options & MONO_PROFILE_ENTER_LEAVE) @@ -7318,7 +7318,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) } if (cfg->gen_sdb_seq_points) { - MonoInst *info_var = cfg->arch.seq_point_info_var; + MonoInst *info_var = (MonoInst *)cfg->arch.seq_point_info_var; /* Initialize seq_point_info_var */ if (cfg->compile_aot) { @@ -7332,7 +7332,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) if (cfg->compile_aot) { /* Initialize ss_tramp_var */ - ins = cfg->arch.ss_tramp_var; + ins = (MonoInst *)cfg->arch.ss_tramp_var; g_assert (ins->opcode == OP_REGOFFSET); amd64_mov_reg_membase (code, AMD64_R11, info_var->inst_basereg, info_var->inst_offset, 8); @@ -7340,14 +7340,14 @@ mono_arch_emit_prolog (MonoCompile *cfg) amd64_mov_membase_reg (code, ins->inst_basereg, ins->inst_offset, AMD64_R11, 8); } else { /* Initialize ss_tramp_var */ - ins = cfg->arch.ss_tramp_var; + ins = (MonoInst *)cfg->arch.ss_tramp_var; g_assert (ins->opcode == OP_REGOFFSET); amd64_mov_reg_imm (code, AMD64_R11, (guint64)&ss_trampoline); amd64_mov_membase_reg (code, ins->inst_basereg, ins->inst_offset, AMD64_R11, 8); /* Initialize bp_tramp_var */ - ins = cfg->arch.bp_tramp_var; + ins = (MonoInst *)cfg->arch.bp_tramp_var; g_assert (ins->opcode == OP_REGOFFSET); amd64_mov_reg_imm (code, AMD64_R11, (guint64)&bp_trampoline); @@ -7377,7 +7377,7 @@ mono_arch_emit_epilog (MonoCompile *cfg) while (cfg->code_len + max_epilog_size > (cfg->code_size - 16)) { cfg->code_size *= 2; - cfg->native_code = mono_realloc_native_code (cfg); + cfg->native_code = (unsigned char *)mono_realloc_native_code (cfg); cfg->stat_code_reallocs++; } code = cfg->native_code + cfg->code_len; @@ -7391,7 +7391,7 @@ mono_arch_emit_epilog (MonoCompile *cfg) mono_emit_unwind_op_remember_state (cfg, code); if (mono_jit_trace_calls != NULL && mono_trace_eval (method)) - code = mono_arch_instrument_epilog (cfg, mono_trace_leave_method, code, TRUE); + code = (guint8 *)mono_arch_instrument_epilog (cfg, mono_trace_leave_method, code, TRUE); /* the code restoring the registers must be kept in sync with OP_TAILCALL */ @@ -7432,7 +7432,7 @@ mono_arch_emit_epilog (MonoCompile *cfg) } /* Load returned vtypes into registers if needed */ - cinfo = cfg->arch.cinfo; + cinfo = (CallInfo *)cfg->arch.cinfo; if (cinfo->ret.storage == ArgValuetypeInReg) { ArgInfo *ainfo = &cinfo->ret; MonoInst *inst = cfg->ret; @@ -7507,7 +7507,7 @@ mono_arch_emit_exceptions (MonoCompile *cfg) while (cfg->code_len + code_size > (cfg->code_size - 16)) { cfg->code_size *= 2; - cfg->native_code = mono_realloc_native_code (cfg); + cfg->native_code = (unsigned char *)mono_realloc_native_code (cfg); cfg->stat_code_reallocs++; } @@ -7699,7 +7699,7 @@ mono_arch_emit_exceptions (MonoCompile *cfg) void* mono_arch_instrument_prolog (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments) { - guchar *code = p; + guchar *code = (guchar *)p; MonoMethodSignature *sig; MonoInst *inst; int i, n, stack_area = 0; @@ -7750,7 +7750,7 @@ enum { void* mono_arch_instrument_epilog_full (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments, gboolean preserve_argument_registers) { - guchar *code = p; + guchar *code = (guchar *)p; int save_mode = SAVE_NONE; MonoMethod *method = cfg->method; MonoType *ret_type = mini_get_underlying_type (mono_method_signature (method)->ret); @@ -8009,7 +8009,7 @@ get_delegate_invoke_impl (MonoTrampInfo **info, gboolean has_target, guint32 par unwind_ops = mono_arch_get_cie_program (); if (has_target) { - start = code = mono_global_codeman_reserve (64); + start = code = (guint8 *)mono_global_codeman_reserve (64); /* Replace the this argument with the target */ amd64_mov_reg_reg (code, AMD64_RAX, AMD64_ARG_REG1, 8); @@ -8018,7 +8018,7 @@ get_delegate_invoke_impl (MonoTrampInfo **info, gboolean has_target, guint32 par g_assert ((code - start) < 64); } else { - start = code = mono_global_codeman_reserve (64); + start = code = (guint8 *)mono_global_codeman_reserve (64); if (param_count == 0) { amd64_jump_membase (code, AMD64_ARG_REG1, MONO_STRUCT_OFFSET (MonoDelegate, method_ptr)); @@ -8080,7 +8080,7 @@ get_delegate_virtual_invoke_impl (MonoTrampInfo **info, gboolean load_imt_reg, i if (offset / (int)sizeof (gpointer) > MAX_VIRTUAL_DELEGATE_OFFSET) return NULL; - start = code = mono_global_codeman_reserve (size); + start = code = (guint8 *)mono_global_codeman_reserve (size); unwind_ops = mono_arch_get_cie_program (); @@ -8160,10 +8160,10 @@ mono_arch_get_delegate_invoke_impl (MonoMethodSignature *sig, gboolean has_targe return cached; if (mono_aot_only) { - start = mono_aot_get_trampoline ("delegate_invoke_impl_has_target"); + start = (guint8 *)mono_aot_get_trampoline ("delegate_invoke_impl_has_target"); } else { MonoTrampInfo *info; - start = get_delegate_invoke_impl (&info, TRUE, 0); + start = (guint8 *)get_delegate_invoke_impl (&info, TRUE, 0); mono_tramp_info_register (info, NULL); } @@ -8184,11 +8184,11 @@ mono_arch_get_delegate_invoke_impl (MonoMethodSignature *sig, gboolean has_targe if (mono_aot_only) { char *name = g_strdup_printf ("delegate_invoke_impl_target_%d", sig->param_count); - start = mono_aot_get_trampoline (name); + start = (guint8 *)mono_aot_get_trampoline (name); g_free (name); } else { MonoTrampInfo *info; - start = get_delegate_invoke_impl (&info, FALSE, sig->param_count); + start = (guint8 *)get_delegate_invoke_impl (&info, FALSE, sig->param_count); mono_tramp_info_register (info, NULL); } @@ -8326,9 +8326,9 @@ mono_arch_build_imt_thunk (MonoVTable *vtable, MonoDomain *domain, MonoIMTCheckI code = mono_domain_code_reserve (domain, size); #else if (fail_tramp) - code = mono_method_alloc_generic_virtual_thunk (domain, size); + code = (guint8 *)mono_method_alloc_generic_virtual_thunk (domain, size); else - code = mono_domain_code_reserve (domain, size); + code = (guint8 *)mono_domain_code_reserve (domain, size); #endif start = code; @@ -8550,8 +8550,8 @@ mono_arch_install_handler_block_guard (MonoJitInfo *ji, MonoJitExceptionInfo *cl char *bp; /*Load the spvar*/ - bp = MONO_CONTEXT_GET_BP (ctx); - sp = *(gpointer*)(bp + clause->exvar_offset); + bp = (char *)MONO_CONTEXT_GET_BP (ctx); + sp = (gpointer *)*(gpointer*)(bp + clause->exvar_offset); old_value = *sp; if (old_value < ji->code_start || (char*)old_value > ((char*)ji->code_start + ji->code_size)) @@ -8570,7 +8570,7 @@ mono_arch_install_handler_block_guard (MonoJitInfo *ji, MonoJitExceptionInfo *cl * On AMD64, the result is placed into R11. */ guint8* -mono_arch_emit_load_aotconst (guint8 *start, guint8 *code, MonoJumpInfo **ji, int tramp_type, gconstpointer target) +mono_arch_emit_load_aotconst (guint8 *start, guint8 *code, MonoJumpInfo **ji, MonoJumpInfoType tramp_type, gconstpointer target) { *ji = mono_patch_info_list_prepend (*ji, code - start, tramp_type, target); amd64_mov_reg_membase (code, AMD64_R11, AMD64_RIP, 0, 8); @@ -8606,7 +8606,7 @@ mono_arch_set_breakpoint (MonoJitInfo *ji, guint8 *ip) if (ji->from_aot) { guint32 native_offset = ip - (guint8*)ji->code_start; - SeqPointInfo *info = mono_arch_get_seq_point_info (mono_domain_get (), ji->code_start); + SeqPointInfo *info = (SeqPointInfo *)mono_arch_get_seq_point_info (mono_domain_get (), (guint8 *)ji->code_start); g_assert (info->bp_addrs [native_offset] == 0); info->bp_addrs [native_offset] = mini_get_breakpoint_trampoline (); @@ -8630,7 +8630,7 @@ mono_arch_clear_breakpoint (MonoJitInfo *ji, guint8 *ip) if (ji->from_aot) { guint32 native_offset = ip - (guint8*)ji->code_start; - SeqPointInfo *info = mono_arch_get_seq_point_info (mono_domain_get (), ji->code_start); + SeqPointInfo *info = (SeqPointInfo *)mono_arch_get_seq_point_info (mono_domain_get (), (guint8 *)ji->code_start); info->bp_addrs [native_offset] = NULL; } else { @@ -8719,7 +8719,7 @@ mono_arch_get_seq_point_info (MonoDomain *domain, guint8 *code) // FIXME: Add a free function mono_domain_lock (domain); - info = g_hash_table_lookup (domain_jit_info (domain)->arch_seq_points, + info = (SeqPointInfo *)g_hash_table_lookup (domain_jit_info (domain)->arch_seq_points, code); mono_domain_unlock (domain); @@ -8728,7 +8728,7 @@ mono_arch_get_seq_point_info (MonoDomain *domain, guint8 *code) g_assert (ji); // FIXME: Optimize the size - info = g_malloc0 (sizeof (SeqPointInfo) + (ji->code_size * sizeof (gpointer))); + info = (SeqPointInfo *)g_malloc0 (sizeof (SeqPointInfo) + (ji->code_size * sizeof (gpointer))); info->ss_tramp_addr = &ss_trampoline; diff --git a/mono/mini/mini-amd64.h b/mono/mini/mini-amd64.h index 25d2877a680..7292aae2ffe 100644 --- a/mono/mini/mini-amd64.h +++ b/mono/mini/mini-amd64.h @@ -341,7 +341,6 @@ typedef struct { #define MONO_ARCH_DYN_CALL_SUPPORTED 1 #define MONO_ARCH_DYN_CALL_PARAM_AREA 0 -#define MONO_ARCH_HAVE_LLVM_IMT_TRAMPOLINE 1 #define MONO_ARCH_LLVM_SUPPORTED 1 #define MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD 1 #define MONO_ARCH_HAVE_CARD_TABLE_WBARRIER 1 diff --git a/mono/mini/mini-arm.c b/mono/mini/mini-arm.c index 2798808809f..a2c8541e260 100644 --- a/mono/mini/mini-arm.c +++ b/mono/mini/mini-arm.c @@ -95,8 +95,8 @@ void sys_icache_invalidate (void *start, size_t len); #endif /* This mutex protects architecture specific caches */ -#define mono_mini_arch_lock() mono_mutex_lock (&mini_arch_mutex) -#define mono_mini_arch_unlock() mono_mutex_unlock (&mini_arch_mutex) +#define mono_mini_arch_lock() mono_os_mutex_lock (&mini_arch_mutex) +#define mono_mini_arch_unlock() mono_os_mutex_unlock (&mini_arch_mutex) static mono_mutex_t mini_arch_mutex; static gboolean v5_supported = FALSE; @@ -916,7 +916,7 @@ mono_arch_init (void) { const char *cpu_arch; - mono_mutex_init_recursive (&mini_arch_mutex); + mono_os_mutex_init_recursive (&mini_arch_mutex); if (mini_get_debug_options ()->soft_breakpoints) { breakpoint_tramp = mini_get_breakpoint_trampoline (); } else { @@ -4084,6 +4084,12 @@ mono_arm_emit_load_imm (guint8 *code, int dreg, guint32 val) code += 4; return code; #endif + if (mini_get_debug_options()->single_imm_size && v7_supported) { + ARM_MOVW_REG_IMM (code, dreg, val & 0xffff); + ARM_MOVT_REG_IMM (code, dreg, (val >> 16) & 0xffff); + return code; + } + if ((imm8 = mono_arm_is_rotated_imm8 (val, &rot_amount)) >= 0) { ARM_MOV_REG_IMM (code, dreg, imm8, rot_amount); } else if ((imm8 = mono_arm_is_rotated_imm8 (~val, &rot_amount)) >= 0) { diff --git a/mono/mini/mini-codegen.c b/mono/mini/mini-codegen.c index 9129c800a45..83170902e4e 100644 --- a/mono/mini/mini-codegen.c +++ b/mono/mini/mini-codegen.c @@ -144,7 +144,7 @@ mono_regstate_assign (MonoRegState *rs) if (rs->next_vreg > rs->vassign_size) { g_free (rs->vassign); rs->vassign_size = MAX (rs->next_vreg, 256); - rs->vassign = g_malloc (rs->vassign_size * sizeof (gint32)); + rs->vassign = (gint32 *)g_malloc (rs->vassign_size * sizeof (gint32)); } memset (rs->isymbolic, 0, MONO_MAX_IREGS * sizeof (rs->isymbolic [0])); @@ -295,7 +295,7 @@ resize_spill_info (MonoCompile *cfg, int bank) g_assert (bank < MONO_NUM_REGBANKS); - new_info = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoSpillInfo) * new_len); + new_info = (MonoSpillInfo *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoSpillInfo) * new_len); if (orig_info) memcpy (new_info, orig_info, sizeof (MonoSpillInfo) * orig_len); for (i = orig_len; i < new_len; ++i) @@ -1180,10 +1180,11 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) if (cfg->reginfo && cfg->reginfo_len < max) cfg->reginfo = NULL; - reginfo = cfg->reginfo; + reginfo = (RegTrack *)cfg->reginfo; if (!reginfo) { cfg->reginfo_len = MAX (1024, max * 2); - reginfo = cfg->reginfo = mono_mempool_alloc (cfg->mempool, sizeof (RegTrack) * cfg->reginfo_len); + reginfo = (RegTrack *)mono_mempool_alloc (cfg->mempool, sizeof (RegTrack) * cfg->reginfo_len); + cfg->reginfo = reginfo; } else g_assert (cfg->reginfo_len >= rs->next_vreg); @@ -2450,7 +2451,7 @@ mono_opcode_to_cond (int opcode) default: printf ("%s\n", mono_inst_name (opcode)); g_assert_not_reached (); - return 0; + return (CompRelation)0; } } @@ -2512,7 +2513,7 @@ mono_opcode_to_type (int opcode, int cmp_opcode) } } else { g_error ("Unknown opcode '%s' in opcode_to_type", mono_inst_name (opcode)); - return 0; + return (CompType)0; } } diff --git a/mono/mini/mini-exceptions.c b/mono/mini/mini-exceptions.c index 26c9451330e..8db012832c6 100644 --- a/mono/mini/mini-exceptions.c +++ b/mono/mini/mini-exceptions.c @@ -134,7 +134,7 @@ mono_exceptions_init (void) if (mono_llvm_only) cbs.mono_raise_exception = mono_llvm_raise_exception; else - cbs.mono_raise_exception = mono_get_throw_exception (); + cbs.mono_raise_exception = (void (*)(MonoException *))mono_get_throw_exception (); cbs.mono_raise_exception_with_ctx = mono_raise_exception_with_ctx; cbs.mono_exception_walk_trace = mono_exception_walk_trace; cbs.mono_install_handler_block_guard = mono_install_handler_block_guard; @@ -238,21 +238,21 @@ find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInfo *res, Mo if (prev_ji && (ip > prev_ji->code_start && ((guint8*)ip < ((guint8*)prev_ji->code_start) + prev_ji->code_size))) ji = prev_ji; else - ji = mini_jit_info_table_find (domain, ip, NULL); + ji = mini_jit_info_table_find (domain, (char *)ip, NULL); if (managed) *managed = FALSE; err = mono_arch_unwind_frame (domain, jit_tls, ji, ctx, new_ctx, lmf, NULL, &frame); if (!err) - return (gpointer)-1; + return (MonoJitInfo *)-1; if (*lmf && ((*lmf) != jit_tls->first_lmf) && ((gpointer)MONO_CONTEXT_GET_SP (new_ctx) >= (gpointer)(*lmf))) { /* * Remove any unused lmf. * Mask out the lower bits which might be used to hold additional information. */ - *lmf = (gpointer)(((gsize)(*lmf)->previous_lmf) & ~(SIZEOF_VOID_P -1)); + *lmf = (MonoLMF *)(((gsize)(*lmf)->previous_lmf) & ~(SIZEOF_VOID_P -1)); } /* Convert between the new and the old APIs */ @@ -397,7 +397,7 @@ mono_find_jit_info_ext (MonoDomain *domain, MonoJitTlsData *jit_tls, if (prev_ji && (ip > prev_ji->code_start && ((guint8*)ip < ((guint8*)prev_ji->code_start) + prev_ji->code_size))) ji = prev_ji; else - ji = mini_jit_info_table_find (domain, ip, &target_domain); + ji = mini_jit_info_table_find (domain, (char *)ip, &target_domain); if (!target_domain) target_domain = domain; @@ -414,7 +414,7 @@ mono_find_jit_info_ext (MonoDomain *domain, MonoJitTlsData *jit_tls, * Remove any unused lmf. * Mask out the lower bits which might be used to hold additional information. */ - *lmf = (gpointer)(((gsize)(*lmf)->previous_lmf) & ~(SIZEOF_VOID_P -1)); + *lmf = (MonoLMF *)(((gsize)(*lmf)->previous_lmf) & ~(SIZEOF_VOID_P -1)); } if (frame->ji && !frame->ji->is_trampoline && !frame->ji->async) @@ -524,7 +524,7 @@ get_generic_info_from_stack_frame (MonoJitInfo *ji, MonoContext *ctx) return info; } else { /* Avoid returning a managed object */ - MonoObject *this_obj = info; + MonoObject *this_obj = (MonoObject *)info; return this_obj->vtable->klass; } @@ -542,17 +542,17 @@ get_generic_context_from_stack_frame (MonoJitInfo *ji, gpointer generic_info) method = jinfo_get_method (ji); g_assert (method->is_inflated); if (mono_method_get_context (method)->method_inst) { - MonoMethodRuntimeGenericContext *mrgctx = generic_info; + MonoMethodRuntimeGenericContext *mrgctx = (MonoMethodRuntimeGenericContext *)generic_info; klass = mrgctx->class_vtable->klass; context.method_inst = mrgctx->method_inst; g_assert (context.method_inst); } else if ((method->flags & METHOD_ATTRIBUTE_STATIC) || method->klass->valuetype) { - MonoVTable *vtable = generic_info; + MonoVTable *vtable = (MonoVTable *)generic_info; klass = vtable->klass; } else { - klass = generic_info; + klass = (MonoClass *)generic_info; } //g_assert (!method->klass->generic_container); @@ -623,7 +623,7 @@ mono_exception_walk_trace (MonoException *ex, MonoExceptionFrameWalk func, gpoin for (i = 0; i < len; i++) { gpointer ip = mono_array_get (ta, gpointer, i * 2 + 0); gpointer generic_info = mono_array_get (ta, gpointer, i * 2 + 1); - MonoJitInfo *ji = mono_jit_info_table_find (domain, ip); + MonoJitInfo *ji = mono_jit_info_table_find (domain, (char *)ip); if (ji == NULL) { if (func (NULL, ip, 0, FALSE, user_data)) @@ -663,7 +663,7 @@ ves_icall_get_trace (MonoException *exc, gint32 skip, MonoBoolean need_file_info gpointer generic_info = mono_array_get (ta, gpointer, i * 2 + 1); MonoMethod *method; - ji = mono_jit_info_table_find (domain, ip); + ji = mono_jit_info_table_find (domain, (char *)ip); if (ji == NULL) { /* Unmanaged frame */ mono_array_setref (res, i, sf); @@ -726,7 +726,7 @@ static void mono_runtime_walk_stack_with_ctx (MonoJitStackWalk func, MonoContext *start_ctx, MonoUnwindOptions unwind_options, void *user_data) { if (!start_ctx) { - MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); if (jit_tls && jit_tls->orig_ex_ctx_set) start_ctx = &jit_tls->orig_ex_ctx; } @@ -760,7 +760,7 @@ mono_walk_stack_with_ctx (MonoJitStackWalk func, MonoContext *start_ctx, MonoUnw start_ctx = &extra_ctx; } - mono_walk_stack_full (func, start_ctx, mono_domain_get (), thread->jit_data, mono_get_lmf (), unwind_options, user_data); + mono_walk_stack_full (func, start_ctx, mono_domain_get (), (MonoJitTlsData *)thread->jit_data, mono_get_lmf (), unwind_options, user_data); } /** @@ -793,9 +793,9 @@ mono_walk_stack_with_state (MonoJitStackWalk func, MonoThreadUnwindState *state, mono_walk_stack_full (func, &state->ctx, - state->unwind_data [MONO_UNWIND_DATA_DOMAIN], - state->unwind_data [MONO_UNWIND_DATA_JIT_TLS], - state->unwind_data [MONO_UNWIND_DATA_LMF], + (MonoDomain *)state->unwind_data [MONO_UNWIND_DATA_DOMAIN], + (MonoJitTlsData *)state->unwind_data [MONO_UNWIND_DATA_JIT_TLS], + (MonoLMF *)state->unwind_data [MONO_UNWIND_DATA_LMF], unwind_options, user_data); } @@ -901,7 +901,7 @@ ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info, MonoString **file, gint32 *line, gint32 *column) { MonoDomain *domain = mono_domain_get (); - MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); MonoLMF *lmf = mono_get_lmf (); MonoJitInfo *ji = NULL; MonoContext ctx, new_ctx; @@ -1033,7 +1033,7 @@ mini_jit_info_table_find_ext (MonoDomain *domain, char *addr, gboolean allow_tra if (!t) return NULL; - refs = (t->appdomain_refs) ? *(gpointer *) t->appdomain_refs : NULL; + refs = (gpointer *)((t->appdomain_refs) ? *(gpointer *) t->appdomain_refs : NULL); for (; refs && *refs; refs++) { if (*refs != domain && *refs != mono_get_root_domain ()) { ji = mono_jit_info_table_find_internal ((MonoDomain*) *refs, addr, TRUE, allow_trampolines); @@ -1101,7 +1101,7 @@ wrap_non_exception_throws (MonoMethod *m) if (named_type != 0x54) continue; name_len = mono_metadata_decode_blob_size (p, &p); - name = g_malloc (name_len + 1); + name = (char *)g_malloc (name_len + 1); memcpy (name, p, name_len); name [name_len] = 0; p += name_len; @@ -1193,12 +1193,12 @@ setup_stack_trace (MonoException *mono_ex, GSList *dynamic_methods, MonoArray *i * OUT_FILTER_IDX. Return TRUE if the exception is caught, FALSE otherwise. */ static gboolean -mono_handle_exception_internal_first_pass (MonoContext *ctx, gpointer obj, gint32 *out_filter_idx, MonoJitInfo **out_ji, MonoJitInfo **out_prev_ji, MonoObject *non_exception) +mono_handle_exception_internal_first_pass (MonoContext *ctx, MonoObject *obj, gint32 *out_filter_idx, MonoJitInfo **out_ji, MonoJitInfo **out_prev_ji, MonoObject *non_exception) { MonoDomain *domain = mono_domain_get (); MonoJitInfo *ji = NULL; static int (*call_filter) (MonoContext *, gpointer) = NULL; - MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); MonoLMF *lmf = mono_get_lmf (); MonoArray *initial_trace_ips = NULL; GList *trace_ips = NULL; @@ -1214,7 +1214,7 @@ mono_handle_exception_internal_first_pass (MonoContext *ctx, gpointer obj, gint3 g_assert (ctx != NULL); - if (obj == domain->stack_overflow_ex) + if (obj == (MonoObject *)domain->stack_overflow_ex) stack_overflow = TRUE; mono_ex = (MonoException*)obj; @@ -1228,7 +1228,7 @@ mono_handle_exception_internal_first_pass (MonoContext *ctx, gpointer obj, gint3 } if (!call_filter) - call_filter = mono_get_call_filter (); + call_filter = (int (*) (MonoContext *, void *))mono_get_call_filter (); g_assert (jit_tls->end_of_stack); g_assert (jit_tls->abort_func); @@ -1413,12 +1413,12 @@ mono_handle_exception_internal_first_pass (MonoContext *ctx, gpointer obj, gint3 * @resume: whenever to resume unwinding based on the state in MonoJitTlsData. */ static gboolean -mono_handle_exception_internal (MonoContext *ctx, gpointer obj, gboolean resume, MonoJitInfo **out_ji) +mono_handle_exception_internal (MonoContext *ctx, MonoObject *obj, gboolean resume, MonoJitInfo **out_ji) { MonoDomain *domain = mono_domain_get (); MonoJitInfo *ji, *prev_ji; static int (*call_filter) (MonoContext *, gpointer) = NULL; - MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); MonoLMF *lmf = mono_get_lmf (); MonoException *mono_ex; gboolean stack_overflow = FALSE; @@ -1440,20 +1440,20 @@ mono_handle_exception_internal (MonoContext *ctx, gpointer obj, gboolean resume, /* * Allocate a new exception object instead of the preconstructed ones. */ - if (obj == domain->stack_overflow_ex) { + if (obj == (MonoObject *)domain->stack_overflow_ex) { /* * It is not a good idea to try and put even more pressure on the little stack available. * obj = mono_get_exception_stack_overflow (); */ stack_overflow = TRUE; } - else if (obj == domain->null_reference_ex) { - obj = mono_get_exception_null_reference (); + else if (obj == (MonoObject *)domain->null_reference_ex) { + obj = (MonoObject *)mono_get_exception_null_reference (); } if (!mono_object_isinst (obj, mono_defaults.exception_class)) { non_exception = obj; - obj = mono_get_exception_runtime_wrapped (obj); + obj = (MonoObject *)mono_get_exception_runtime_wrapped (obj); } mono_ex = (MonoException*)obj; @@ -1492,7 +1492,7 @@ mono_handle_exception_internal (MonoContext *ctx, gpointer obj, gboolean resume, } if (!call_filter) - call_filter = mono_get_call_filter (); + call_filter = (int (*)(MonoContext *, void*))mono_get_call_filter (); g_assert (jit_tls->end_of_stack); g_assert (jit_tls->abort_func); @@ -1540,7 +1540,7 @@ mono_handle_exception_internal (MonoContext *ctx, gpointer obj, gboolean resume, if (!res) { if (mini_get_debug_options ()->break_on_exc) G_BREAKPOINT (); - mono_debugger_agent_handle_exception (obj, ctx, NULL); + mono_debugger_agent_handle_exception ((MonoException *)obj, ctx, NULL); if (mini_get_debug_options ()->suspend_on_unhandled) { mono_runtime_printf_err ("Unhandled exception, suspending..."); @@ -1567,9 +1567,9 @@ mono_handle_exception_internal (MonoContext *ctx, gpointer obj, gboolean resume, } if (unhandled) - mono_debugger_agent_handle_exception (obj, ctx, NULL); + mono_debugger_agent_handle_exception ((MonoException *)obj, ctx, NULL); else - mono_debugger_agent_handle_exception (obj, ctx, &ctx_cp); + mono_debugger_agent_handle_exception ((MonoException *)obj, ctx, &ctx_cp); } } @@ -1700,7 +1700,7 @@ mono_handle_exception_internal (MonoContext *ctx, gpointer obj, gboolean resume, * There aren't any further finally/fault handler blocks down the stack over this exception. * This must be ensured by the code that installs the guard trampoline. */ - g_assert (ji == mini_jit_info_table_find (domain, MONO_CONTEXT_GET_IP (&jit_tls->handler_block_context), NULL)); + g_assert (ji == mini_jit_info_table_find (domain, (char *)MONO_CONTEXT_GET_IP (&jit_tls->handler_block_context), NULL)); if (!is_address_protected (ji, jit_tls->handler_block, ei->handler_start)) { is_outside = TRUE; @@ -1723,7 +1723,7 @@ mono_handle_exception_internal (MonoContext *ctx, gpointer obj, gboolean resume, #ifndef DISABLE_PERFCOUNTERS mono_perfcounters->exceptions_depth += frame_count; #endif - if (obj == domain->stack_overflow_ex) + if (obj == (MonoObject *)domain->stack_overflow_ex) jit_tls->handling_stack_ovf = FALSE; return 0; @@ -1798,7 +1798,7 @@ mono_debugger_run_finally (MonoContext *start_ctx) { static int (*call_filter) (MonoContext *, gpointer) = NULL; MonoDomain *domain = mono_domain_get (); - MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); MonoLMF *lmf = mono_get_lmf (); MonoContext ctx, new_ctx; MonoJitInfo *ji, rji; @@ -1811,7 +1811,7 @@ mono_debugger_run_finally (MonoContext *start_ctx) return; if (!call_filter) - call_filter = mono_get_call_filter (); + call_filter = (int (*)(MonoContext *, void *))mono_get_call_filter (); for (i = 0; i < ji->num_clauses; i++) { MonoJitExceptionInfo *ei = &ji->clauses [i]; @@ -1829,7 +1829,7 @@ mono_debugger_run_finally (MonoContext *start_ctx) * @obj: the exception object */ gboolean -mono_handle_exception (MonoContext *ctx, gpointer obj) +mono_handle_exception (MonoContext *ctx, MonoObject *obj) { #ifndef DISABLE_PERFCOUNTERS mono_perfcounters->exceptions_thrown++; @@ -1944,7 +1944,7 @@ try_restore_stack_protection (MonoJitTlsData *jit_tls, int extra_bytes) static G_GNUC_UNUSED void try_more_restore (void) { - MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); if (try_restore_stack_protection (jit_tls, 500)) jit_tls->restore_stack_prot = NULL; } @@ -1952,7 +1952,7 @@ try_more_restore (void) static G_GNUC_UNUSED void restore_stack_protection (void) { - MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); MonoException *ex = mono_domain_get ()->stack_overflow_ex; /* if we can't restore the stack protection, keep a callback installed so * we'll try to restore as much stack as we can at each return from unmanaged @@ -1971,7 +1971,7 @@ restore_stack_protection (void) gpointer mono_altstack_restore_prot (mgreg_t *regs, guint8 *code, gpointer *tramp_data, guint8* tramp) { - void (*func)(void) = (gpointer)tramp_data; + void (*func)(void) = (void (*)(void))tramp_data; func (); return NULL; } @@ -2039,7 +2039,7 @@ static gboolean print_overflow_stack_frame (StackFrameInfo *frame, MonoContext *ctx, gpointer data) { MonoMethod *method = NULL; - PrintOverflowUserData *user_data = data; + PrintOverflowUserData *user_data = (PrintOverflowUserData *)data; gchar *location; if (frame->ji && frame->type != FRAME_TYPE_TRAMPOLINE) @@ -2157,7 +2157,7 @@ mono_handle_native_sigsegv (int signal, void *ctx, MONO_SIG_HANDLER_INFO_TYPE *i #ifdef MONO_ARCH_USE_SIGACTION struct sigaction sa; #endif - MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); const char *signal_str = (signal == SIGSEGV) ? "SIGSEGV" : "SIGABRT"; if (handling_sigsegv) @@ -2182,7 +2182,8 @@ mono_handle_native_sigsegv (int signal, void *ctx, MONO_SIG_HANDLER_INFO_TYPE *i if (jit_tls && mono_thread_internal_current ()) { mono_runtime_printf_err ("Stacktrace:\n"); - mono_walk_stack (print_stack_frame_to_stderr, TRUE, NULL); + /* FIXME: Is MONO_UNWIND_LOOKUP_IL_OFFSET correct here? */ + mono_walk_stack (print_stack_frame_to_stderr, MONO_UNWIND_LOOKUP_IL_OFFSET, NULL); } #ifdef HAVE_BACKTRACE_SYMBOLS @@ -2371,14 +2372,14 @@ mono_print_thread_dump_from_ctx (MonoContext *ctx) void mono_resume_unwind (MonoContext *ctx) { - MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); MonoContext new_ctx; MONO_CONTEXT_SET_IP (ctx, MONO_CONTEXT_GET_IP (&jit_tls->resume_state.ctx)); MONO_CONTEXT_SET_SP (ctx, MONO_CONTEXT_GET_SP (&jit_tls->resume_state.ctx)); new_ctx = *ctx; - mono_handle_exception_internal (&new_ctx, jit_tls->resume_state.ex_obj, TRUE, NULL); + mono_handle_exception_internal (&new_ctx, (MonoObject *)jit_tls->resume_state.ex_obj, TRUE, NULL); mono_restore_context (&new_ctx); } @@ -2396,7 +2397,7 @@ find_last_handler_block (StackFrameInfo *frame, MonoContext *ctx, gpointer data) { int i; gpointer ip; - FindHandlerBlockData *pdata = data; + FindHandlerBlockData *pdata = (FindHandlerBlockData *)data; MonoJitInfo *ji = frame->ji; if (!ji) @@ -2457,7 +2458,7 @@ gboolean mono_install_handler_block_guard (MonoThreadUnwindState *ctx) { FindHandlerBlockData data = { 0 }; - MonoJitTlsData *jit_tls = ctx->unwind_data [MONO_UNWIND_DATA_JIT_TLS]; + MonoJitTlsData *jit_tls = (MonoJitTlsData *)ctx->unwind_data [MONO_UNWIND_DATA_JIT_TLS]; gpointer resume_ip; /* FIXME */ @@ -2505,7 +2506,7 @@ mono_set_cast_details (MonoClass *from, MonoClass *to) MonoJitTlsData *jit_tls = NULL; if (mini_get_debug_options ()->better_cast_details) { - jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); jit_tls->class_cast_from = from; jit_tls->class_cast_to = to; } @@ -2612,7 +2613,7 @@ mono_thread_state_init_from_current (MonoThreadUnwindState *ctx) static void mono_raise_exception_with_ctx (MonoException *exc, MonoContext *ctx) { - mono_handle_exception (ctx, exc); + mono_handle_exception (ctx, (MonoObject *)exc); mono_restore_context (ctx); } @@ -2621,7 +2622,7 @@ void mono_setup_async_callback (MonoContext *ctx, void (*async_cb)(void *fun), gpointer user_data) { #ifdef MONO_ARCH_HAVE_SETUP_ASYNC_CALLBACK - MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); jit_tls->ex_ctx = *ctx; mono_arch_setup_async_callback (ctx, async_cb, user_data); @@ -2684,7 +2685,7 @@ mono_restore_context (MonoContext *ctx) static void (*restore_context) (MonoContext *); if (!restore_context) - restore_context = mono_get_restore_context (); + restore_context = (void (*)(MonoContext *))mono_get_restore_context (); restore_context (ctx); g_assert_not_reached (); } diff --git a/mono/mini/mini-generic-sharing.c b/mono/mini/mini-generic-sharing.c index 6bec18405f5..58094823d31 100644 --- a/mono/mini/mini-generic-sharing.c +++ b/mono/mini/mini-generic-sharing.c @@ -27,6 +27,12 @@ static void mono_class_unregister_image_generic_subclasses (MonoImage *image, gpointer user_data); +/* Counters */ +static int num_templates_allocted; +static int num_templates_bytes; +static int num_oti_allocted; +static int num_oti_bytes; + static gboolean partial_supported = FALSE; static inline gboolean @@ -136,35 +142,35 @@ mono_class_check_context_used (MonoClass *klass) * LOCKING: loader lock */ static MonoRuntimeGenericContextInfoTemplate* -get_info_templates (MonoRuntimeGenericContextTemplate *template, int type_argc) +get_info_templates (MonoRuntimeGenericContextTemplate *template_, int type_argc) { g_assert (type_argc >= 0); if (type_argc == 0) - return template->infos; - return g_slist_nth_data (template->method_templates, type_argc - 1); + return template_->infos; + return (MonoRuntimeGenericContextInfoTemplate *)g_slist_nth_data (template_->method_templates, type_argc - 1); } /* * LOCKING: loader lock */ static void -set_info_templates (MonoImage *image, MonoRuntimeGenericContextTemplate *template, int type_argc, +set_info_templates (MonoImage *image, MonoRuntimeGenericContextTemplate *template_, int type_argc, MonoRuntimeGenericContextInfoTemplate *oti) { g_assert (type_argc >= 0); if (type_argc == 0) - template->infos = oti; + template_->infos = oti; else { - int length = g_slist_length (template->method_templates); + int length = g_slist_length (template_->method_templates); GSList *list; /* FIXME: quadratic! */ while (length < type_argc) { - template->method_templates = g_slist_append_image (image, template->method_templates, NULL); + template_->method_templates = g_slist_append_image (image, template_->method_templates, NULL); length++; } - list = g_slist_nth (template->method_templates, type_argc - 1); + list = g_slist_nth (template_->method_templates, type_argc - 1); g_assert (list); list->data = oti; } @@ -174,23 +180,23 @@ set_info_templates (MonoImage *image, MonoRuntimeGenericContextTemplate *templat * LOCKING: loader lock */ static int -template_get_max_argc (MonoRuntimeGenericContextTemplate *template) +template_get_max_argc (MonoRuntimeGenericContextTemplate *template_) { - return g_slist_length (template->method_templates); + return g_slist_length (template_->method_templates); } /* * LOCKING: loader lock */ static MonoRuntimeGenericContextInfoTemplate* -rgctx_template_get_other_slot (MonoRuntimeGenericContextTemplate *template, int type_argc, int slot) +rgctx_template_get_other_slot (MonoRuntimeGenericContextTemplate *template_, int type_argc, int slot) { int i; MonoRuntimeGenericContextInfoTemplate *oti; g_assert (slot >= 0); - for (oti = get_info_templates (template, type_argc), i = 0; i < slot; oti = oti->next, ++i) { + for (oti = get_info_templates (template_, type_argc), i = 0; i < slot; oti = oti->next, ++i) { if (!oti) return NULL; } @@ -202,12 +208,12 @@ rgctx_template_get_other_slot (MonoRuntimeGenericContextTemplate *template, int * LOCKING: loader lock */ static int -rgctx_template_num_infos (MonoRuntimeGenericContextTemplate *template, int type_argc) +rgctx_template_num_infos (MonoRuntimeGenericContextTemplate *template_, int type_argc) { MonoRuntimeGenericContextInfoTemplate *oti; int i; - for (i = 0, oti = get_info_templates (template, type_argc); oti; ++i, oti = oti->next) + for (i = 0, oti = get_info_templates (template_, type_argc); oti; ++i, oti = oti->next) ; return i; @@ -239,14 +245,14 @@ class_set_rgctx_template (MonoClass *klass, MonoRuntimeGenericContextTemplate *r static MonoRuntimeGenericContextTemplate* class_lookup_rgctx_template (MonoClass *klass) { - MonoRuntimeGenericContextTemplate *template; + MonoRuntimeGenericContextTemplate *template_; if (!klass->image->rgctx_template_hash) return NULL; - template = g_hash_table_lookup (klass->image->rgctx_template_hash, klass); + template_ = (MonoRuntimeGenericContextTemplate *)g_hash_table_lookup (klass->image->rgctx_template_hash, klass); - return template; + return template_; } /* @@ -267,7 +273,7 @@ register_generic_subclass (MonoClass *klass) if (!generic_subclass_hash) generic_subclass_hash = g_hash_table_new (mono_aligned_addr_hash, NULL); - subclass = g_hash_table_lookup (generic_subclass_hash, parent); + subclass = (MonoClass *)g_hash_table_lookup (generic_subclass_hash, parent); rgctx_template->next_subclass = subclass; g_hash_table_insert (generic_subclass_hash, parent, klass); } @@ -340,43 +346,24 @@ mono_class_unregister_image_generic_subclasses (MonoImage *image, gpointer user_ static MonoRuntimeGenericContextTemplate* alloc_template (MonoClass *klass) { - static gboolean inited = FALSE; - static int num_allocted = 0; - static int num_bytes = 0; - int size = sizeof (MonoRuntimeGenericContextTemplate); - if (!inited) { - mono_counters_register ("RGCTX template num allocted", MONO_COUNTER_GENERICS | MONO_COUNTER_INT, &num_allocted); - mono_counters_register ("RGCTX template bytes allocted", MONO_COUNTER_GENERICS | MONO_COUNTER_INT, &num_bytes); - inited = TRUE; - } - - num_allocted++; - num_bytes += size; + num_templates_allocted++; + num_templates_bytes += size; - return mono_image_alloc0 (klass->image, size); + return (MonoRuntimeGenericContextTemplate *)mono_image_alloc0 (klass->image, size); } +/* LOCKING: Takes the loader lock */ static MonoRuntimeGenericContextInfoTemplate* alloc_oti (MonoImage *image) { - static gboolean inited = FALSE; - static int num_allocted = 0; - static int num_bytes = 0; - int size = sizeof (MonoRuntimeGenericContextInfoTemplate); - if (!inited) { - mono_counters_register ("RGCTX oti num allocted", MONO_COUNTER_GENERICS | MONO_COUNTER_INT, &num_allocted); - mono_counters_register ("RGCTX oti bytes allocted", MONO_COUNTER_GENERICS | MONO_COUNTER_INT, &num_bytes); - inited = TRUE; - } - - num_allocted++; - num_bytes += size; + num_oti_allocted++; + num_oti_bytes += size; - return mono_image_alloc0 (image, size); + return (MonoRuntimeGenericContextInfoTemplate *)mono_image_alloc0 (image, size); } #define MONO_RGCTX_SLOT_USED_MARKER ((gpointer)&mono_defaults.object_class->byval_arg) @@ -396,7 +383,7 @@ info_has_identity (MonoRgctxInfoType info_type) * LOCKING: loader lock */ static void -rgctx_template_set_slot (MonoImage *image, MonoRuntimeGenericContextTemplate *template, int type_argc, +rgctx_template_set_slot (MonoImage *image, MonoRuntimeGenericContextTemplate *template_, int type_argc, int slot, gpointer data, MonoRgctxInfoType info_type) { static gboolean inited = FALSE; @@ -404,7 +391,7 @@ rgctx_template_set_slot (MonoImage *image, MonoRuntimeGenericContextTemplate *te static int num_data = 0; int i; - MonoRuntimeGenericContextInfoTemplate *list = get_info_templates (template, type_argc); + MonoRuntimeGenericContextInfoTemplate *list = get_info_templates (template_, type_argc); MonoRuntimeGenericContextInfoTemplate **oti = &list; if (!inited) { @@ -429,7 +416,7 @@ rgctx_template_set_slot (MonoImage *image, MonoRuntimeGenericContextTemplate *te (*oti)->data = data; (*oti)->info_type = info_type; - set_info_templates (image, template, type_argc, list); + set_info_templates (image, template_, type_argc, list); if (data == MONO_RGCTX_SLOT_USED_MARKER) ++num_markers; @@ -543,8 +530,9 @@ inflate_info (MonoRuntimeGenericContextInfoTemplate *oti, MonoGenericContext *co case MONO_RGCTX_INFO_NULLABLE_CLASS_BOX: case MONO_RGCTX_INFO_NULLABLE_CLASS_UNBOX: { gpointer result = mono_class_inflate_generic_type_with_mempool (temporary ? NULL : klass->image, - data, context, &error); - g_assert (mono_error_ok (&error)); /*FIXME proper error handling*/ + (MonoType *)data, context, &error); + if (!mono_error_ok (&error)) /*FIXME proper error handling */ + g_error ("Could not inflate generic type due to %s", mono_error_get_message (&error)); return result; } @@ -554,7 +542,7 @@ inflate_info (MonoRuntimeGenericContextInfoTemplate *oti, MonoGenericContext *co case MONO_RGCTX_INFO_METHOD_CONTEXT: case MONO_RGCTX_INFO_REMOTING_INVOKE_WITH_CHECK: case MONO_RGCTX_INFO_METHOD_DELEGATE_CODE: { - MonoMethod *method = data; + MonoMethod *method = (MonoMethod *)data; MonoMethod *inflated_method; MonoType *inflated_type = mono_class_inflate_generic_type (&method->klass->byval_arg, context); MonoClass *inflated_class = mono_class_from_mono_type (inflated_type); @@ -579,12 +567,12 @@ inflate_info (MonoRuntimeGenericContextInfoTemplate *oti, MonoGenericContext *co return inflated_method; } case MONO_RGCTX_INFO_METHOD_GSHAREDVT_INFO: { - MonoGSharedVtMethodInfo *oinfo = data; + MonoGSharedVtMethodInfo *oinfo = (MonoGSharedVtMethodInfo *)data; MonoGSharedVtMethodInfo *res; MonoDomain *domain = mono_domain_get (); int i; - res = mono_domain_alloc0 (domain, sizeof (MonoGSharedVtMethodInfo)); + res = (MonoGSharedVtMethodInfo *)mono_domain_alloc0 (domain, sizeof (MonoGSharedVtMethodInfo)); /* res->nlocals = info->nlocals; res->locals_types = g_new0 (MonoType*, info->nlocals); @@ -592,19 +580,19 @@ inflate_info (MonoRuntimeGenericContextInfoTemplate *oti, MonoGenericContext *co res->locals_types [i] = mono_class_inflate_generic_type (info->locals_types [i], context); */ res->num_entries = oinfo->num_entries; - res->entries = mono_domain_alloc0 (domain, sizeof (MonoRuntimeGenericContextInfoTemplate) * oinfo->num_entries); + res->entries = (MonoRuntimeGenericContextInfoTemplate *)mono_domain_alloc0 (domain, sizeof (MonoRuntimeGenericContextInfoTemplate) * oinfo->num_entries); for (i = 0; i < oinfo->num_entries; ++i) { MonoRuntimeGenericContextInfoTemplate *otemplate = &oinfo->entries [i]; - MonoRuntimeGenericContextInfoTemplate *template = &res->entries [i]; + MonoRuntimeGenericContextInfoTemplate *template_ = &res->entries [i]; - memcpy (template, otemplate, sizeof (MonoRuntimeGenericContextInfoTemplate)); - template->data = inflate_info (template, context, klass, FALSE); + memcpy (template_, otemplate, sizeof (MonoRuntimeGenericContextInfoTemplate)); + template_->data = inflate_info (template_, context, klass, FALSE); } return res; } case MONO_RGCTX_INFO_METHOD_GSHAREDVT_OUT_TRAMPOLINE: case MONO_RGCTX_INFO_METHOD_GSHAREDVT_OUT_TRAMPOLINE_VIRT: { - MonoJumpInfoGSharedVtCall *info = data; + MonoJumpInfoGSharedVtCall *info = (MonoJumpInfoGSharedVtCall *)data; MonoMethod *method = info->method; MonoMethod *inflated_method; MonoType *inflated_type = mono_class_inflate_generic_type (&method->klass->byval_arg, context); @@ -612,7 +600,7 @@ inflate_info (MonoRuntimeGenericContextInfoTemplate *oti, MonoGenericContext *co MonoJumpInfoGSharedVtCall *res; MonoDomain *domain = mono_domain_get (); - res = mono_domain_alloc0 (domain, sizeof (MonoJumpInfoGSharedVtCall)); + res = (MonoJumpInfoGSharedVtCall *)mono_domain_alloc0 (domain, sizeof (MonoJumpInfoGSharedVtCall)); /* Keep the original signature */ res->sig = info->sig; @@ -640,7 +628,7 @@ inflate_info (MonoRuntimeGenericContextInfoTemplate *oti, MonoGenericContext *co case MONO_RGCTX_INFO_CLASS_FIELD: case MONO_RGCTX_INFO_FIELD_OFFSET: { - MonoClassField *field = data; + MonoClassField *field = (MonoClassField *)data; MonoType *inflated_type = mono_class_inflate_generic_type (&field->parent->byval_arg, context); MonoClass *inflated_class = mono_class_from_mono_type (inflated_type); int i = field - field->parent->fields; @@ -654,7 +642,7 @@ inflate_info (MonoRuntimeGenericContextInfoTemplate *oti, MonoGenericContext *co return &inflated_class->fields [i]; } case MONO_RGCTX_INFO_SIG_GSHAREDVT_OUT_TRAMPOLINE_CALLI: { - MonoMethodSignature *sig = data; + MonoMethodSignature *sig = (MonoMethodSignature *)data; MonoMethodSignature *isig; MonoError error; @@ -664,14 +652,14 @@ inflate_info (MonoRuntimeGenericContextInfoTemplate *oti, MonoGenericContext *co } case MONO_RGCTX_INFO_VIRT_METHOD_CODE: case MONO_RGCTX_INFO_VIRT_METHOD_BOX_TYPE: { - MonoJumpInfoVirtMethod *info = data; + MonoJumpInfoVirtMethod *info = (MonoJumpInfoVirtMethod *)data; MonoJumpInfoVirtMethod *res; MonoType *t; MonoDomain *domain = mono_domain_get (); MonoError error; // FIXME: Temporary - res = mono_domain_alloc0 (domain, sizeof (MonoJumpInfoVirtMethod)); + res = (MonoJumpInfoVirtMethod *)mono_domain_alloc0 (domain, sizeof (MonoJumpInfoVirtMethod)); t = mono_class_inflate_generic_type (&info->klass->byval_arg, context); res->klass = mono_class_from_mono_type (t); mono_metadata_free_type (t); @@ -702,7 +690,7 @@ free_inflated_info (MonoRgctxInfoType info_type, gpointer info) case MONO_RGCTX_INFO_TYPE: case MONO_RGCTX_INFO_REFLECTION_TYPE: case MONO_RGCTX_INFO_CAST_CACHE: - mono_metadata_free_type (info); + mono_metadata_free_type ((MonoType *)info); break; default: break; @@ -741,21 +729,21 @@ get_shared_class (MonoClass *klass) static MonoRuntimeGenericContextTemplate* mono_class_get_runtime_generic_context_template (MonoClass *klass) { - MonoRuntimeGenericContextTemplate *parent_template, *template; + MonoRuntimeGenericContextTemplate *parent_template, *template_; guint32 i; klass = get_shared_class (klass); mono_loader_lock (); - template = class_lookup_rgctx_template (klass); + template_ = class_lookup_rgctx_template (klass); mono_loader_unlock (); - if (template) - return template; + if (template_) + return template_; //g_assert (get_shared_class (class) == class); - template = alloc_template (klass); + template_ = alloc_template (klass); mono_loader_lock (); @@ -775,7 +763,7 @@ mono_class_get_runtime_generic_context_template (MonoClass *klass) oti = class_get_rgctx_template_oti (klass->parent, type_argc, i, FALSE, FALSE, NULL); if (oti.data && oti.data != MONO_RGCTX_SLOT_USED_MARKER) { - rgctx_template_set_slot (klass->image, template, type_argc, i, + rgctx_template_set_slot (klass->image, template_, type_argc, i, oti.data, oti.info_type); } } @@ -784,9 +772,9 @@ mono_class_get_runtime_generic_context_template (MonoClass *klass) if (class_lookup_rgctx_template (klass)) { /* some other thread already set the template */ - template = class_lookup_rgctx_template (klass); + template_ = class_lookup_rgctx_template (klass); } else { - class_set_rgctx_template (klass, template); + class_set_rgctx_template (klass, template_); if (klass->parent) register_generic_subclass (klass); @@ -794,7 +782,7 @@ mono_class_get_runtime_generic_context_template (MonoClass *klass) mono_loader_unlock (); - return template; + return template_; } /* @@ -833,11 +821,11 @@ class_get_rgctx_template_oti (MonoClass *klass, int type_argc, guint32 slot, gbo return oti; } else { - MonoRuntimeGenericContextTemplate *template; + MonoRuntimeGenericContextTemplate *template_; MonoRuntimeGenericContextInfoTemplate *oti; - template = mono_class_get_runtime_generic_context_template (klass); - oti = rgctx_template_get_other_slot (template, type_argc, slot); + template_ = mono_class_get_runtime_generic_context_template (klass); + oti = rgctx_template_get_other_slot (template_, type_argc, slot); g_assert (oti); if (temporary) @@ -869,8 +857,8 @@ class_type_info (MonoDomain *domain, MonoClass *klass, MonoRgctxInfoType info_ty } case MONO_RGCTX_INFO_CAST_CACHE: { /*First slot is the cache itself, the second the vtable.*/ - gpointer **cache_data = mono_domain_alloc0 (domain, sizeof (gpointer) * 2); - cache_data [1] = (gpointer)klass; + gpointer **cache_data = (gpointer **)mono_domain_alloc0 (domain, sizeof (gpointer) * 2); + cache_data [1] = (gpointer *)klass; return cache_data; } case MONO_RGCTX_INFO_ARRAY_ELEMENT_SIZE: @@ -926,7 +914,7 @@ class_type_info (MonoDomain *domain, MonoClass *klass, MonoRgctxInfoType info_ty if (!domain_info->memcpy_addr [size]) { gpointer addr = mono_compile_method (memcpy_method [size]); mono_memory_barrier (); - domain_info->memcpy_addr [size] = addr; + domain_info->memcpy_addr [size] = (gpointer *)addr; } return domain_info->memcpy_addr [size]; } else { @@ -946,7 +934,7 @@ class_type_info (MonoDomain *domain, MonoClass *klass, MonoRgctxInfoType info_ty if (!domain_info->bzero_addr [size]) { gpointer addr = mono_compile_method (bzero_method [size]); mono_memory_barrier (); - domain_info->bzero_addr [size] = addr; + domain_info->bzero_addr [size] = (gpointer *)addr; } return domain_info->bzero_addr [size]; } @@ -968,7 +956,7 @@ class_type_info (MonoDomain *domain, MonoClass *klass, MonoRgctxInfoType info_ty addr = mono_compile_method (method); // The caller uses the gsharedvt call signature - ji = mini_jit_info_table_find (mono_domain_get (), mono_get_addr_from_ftnptr (addr), NULL); + ji = mini_jit_info_table_find (mono_domain_get (), (char *)mono_get_addr_from_ftnptr (addr), NULL); g_assert (ji); if (mini_jit_info_is_gsharedvt (ji)) return mono_create_static_rgctx_trampoline (method, addr); @@ -1018,7 +1006,7 @@ typedef struct { static guint tramp_info_hash (gconstpointer key) { - GSharedVtTrampInfo *tramp = (gpointer)key; + GSharedVtTrampInfo *tramp = (GSharedVtTrampInfo *)key; return (gsize)tramp->addr; } @@ -1026,8 +1014,8 @@ tramp_info_hash (gconstpointer key) static gboolean tramp_info_equal (gconstpointer a, gconstpointer b) { - GSharedVtTrampInfo *tramp1 = (gpointer)a; - GSharedVtTrampInfo *tramp2 = (gpointer)b; + GSharedVtTrampInfo *tramp1 = (GSharedVtTrampInfo *)a; + GSharedVtTrampInfo *tramp2 = (GSharedVtTrampInfo *)b; /* The signatures should be internalized */ return tramp1->is_in == tramp2->is_in && tramp1->calli == tramp2->calli && tramp1->vcall_offset == tramp2->vcall_offset && @@ -1110,7 +1098,7 @@ mini_get_gsharedvt_wrapper (gboolean gsharedvt_in, gpointer addr, MonoMethodSign num_trampolines ++; /* Cache it */ - tramp_info = mono_domain_alloc0 (domain, sizeof (GSharedVtTrampInfo)); + tramp_info = (GSharedVtTrampInfo *)mono_domain_alloc0 (domain, sizeof (GSharedVtTrampInfo)); memcpy (tramp_info, &tinfo, sizeof (GSharedVtTrampInfo)); mono_domain_lock (domain); @@ -1158,7 +1146,7 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti case MONO_RGCTX_INFO_BZERO: case MONO_RGCTX_INFO_NULLABLE_CLASS_BOX: case MONO_RGCTX_INFO_NULLABLE_CLASS_UNBOX: { - MonoClass *arg_class = mono_class_from_mono_type (data); + MonoClass *arg_class = mono_class_from_mono_type ((MonoType *)data); free_inflated_info (oti->info_type, data); g_assert (arg_class); @@ -1174,17 +1162,17 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti case MONO_RGCTX_INFO_TYPE: return data; case MONO_RGCTX_INFO_REFLECTION_TYPE: - return mono_type_get_object (domain, data); + return mono_type_get_object (domain, (MonoType *)data); case MONO_RGCTX_INFO_METHOD: return data; case MONO_RGCTX_INFO_GENERIC_METHOD_CODE: { gpointer addr; - addr = mono_compile_method (data); - return mini_add_method_trampoline (data, addr, mono_method_needs_static_rgctx_invoke (data, FALSE), FALSE); + addr = mono_compile_method ((MonoMethod *)data); + return mini_add_method_trampoline ((MonoMethod *)data, addr, mono_method_needs_static_rgctx_invoke ((MonoMethod *)data, FALSE), FALSE); } case MONO_RGCTX_INFO_VIRT_METHOD_CODE: { - MonoJumpInfoVirtMethod *info = data; + MonoJumpInfoVirtMethod *info = (MonoJumpInfoVirtMethod *)data; MonoClass *iface_class = info->method->klass; MonoMethod *method; MonoError error; @@ -1210,7 +1198,7 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti return mini_add_method_trampoline (method, addr, mono_method_needs_static_rgctx_invoke (method, FALSE), FALSE); } case MONO_RGCTX_INFO_VIRT_METHOD_BOX_TYPE: { - MonoJumpInfoVirtMethod *info = data; + MonoJumpInfoVirtMethod *info = (MonoJumpInfoVirtMethod *)data; MonoClass *iface_class = info->method->klass; MonoMethod *method; MonoClass *impl_class; @@ -1239,14 +1227,14 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti } #ifndef DISABLE_REMOTING case MONO_RGCTX_INFO_REMOTING_INVOKE_WITH_CHECK: - return mono_compile_method (mono_marshal_get_remoting_invoke_with_check (data)); + return mono_compile_method (mono_marshal_get_remoting_invoke_with_check ((MonoMethod *)data)); #endif case MONO_RGCTX_INFO_METHOD_DELEGATE_CODE: return mono_domain_alloc0 (domain, sizeof (gpointer)); case MONO_RGCTX_INFO_CLASS_FIELD: return data; case MONO_RGCTX_INFO_FIELD_OFFSET: { - MonoClassField *field = data; + MonoClassField *field = (MonoClassField *)data; /* The value is offset by 1 */ if (field->parent->valuetype && !(field->type->attrs & FIELD_ATTRIBUTE_STATIC)) @@ -1255,7 +1243,7 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti return GUINT_TO_POINTER (field->offset + 1); } case MONO_RGCTX_INFO_METHOD_RGCTX: { - MonoMethodInflated *method = data; + MonoMethodInflated *method = (MonoMethodInflated *)data; MonoVTable *vtable; g_assert (method->method.method.is_inflated); @@ -1268,7 +1256,7 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti return mono_method_lookup_rgctx (vtable, method->context.method_inst); } case MONO_RGCTX_INFO_METHOD_CONTEXT: { - MonoMethodInflated *method = data; + MonoMethodInflated *method = (MonoMethodInflated *)data; g_assert (method->method.method.is_inflated); g_assert (method->context.method_inst); @@ -1276,8 +1264,8 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti return method->context.method_inst; } case MONO_RGCTX_INFO_SIG_GSHAREDVT_OUT_TRAMPOLINE_CALLI: { - MonoMethodSignature *gsig = oti->data; - MonoMethodSignature *sig = data; + MonoMethodSignature *gsig = (MonoMethodSignature *)oti->data; + MonoMethodSignature *sig = (MonoMethodSignature *)data; gpointer addr; /* @@ -1288,12 +1276,12 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti } case MONO_RGCTX_INFO_METHOD_GSHAREDVT_OUT_TRAMPOLINE: case MONO_RGCTX_INFO_METHOD_GSHAREDVT_OUT_TRAMPOLINE_VIRT: { - MonoJumpInfoGSharedVtCall *call_info = data; + MonoJumpInfoGSharedVtCall *call_info = (MonoJumpInfoGSharedVtCall *)data; MonoMethodSignature *call_sig; MonoMethod *method; gpointer addr; MonoJitInfo *callee_ji; - gboolean virtual = oti->info_type == MONO_RGCTX_INFO_METHOD_GSHAREDVT_OUT_TRAMPOLINE_VIRT; + gboolean virtual_ = oti->info_type == MONO_RGCTX_INFO_METHOD_GSHAREDVT_OUT_TRAMPOLINE_VIRT; gint32 vcall_offset; gboolean callee_gsharedvt; @@ -1304,12 +1292,12 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti g_assert (method->is_inflated); - if (!virtual) + if (!virtual_) addr = mono_compile_method (method); else addr = NULL; - if (virtual) { + if (virtual_) { /* Same as in mono_emit_method_call_full () */ if ((method->klass->parent == mono_defaults.multicastdelegate_class) && (!strcmp (method->name, "Invoke"))) { /* See mono_emit_method_call_full () */ @@ -1327,7 +1315,7 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti } // FIXME: This loads information in the AOT case - callee_ji = mini_jit_info_table_find (mono_domain_get (), mono_get_addr_from_ftnptr (addr), NULL); + callee_ji = mini_jit_info_table_find (mono_domain_get (), (char *)mono_get_addr_from_ftnptr (addr), NULL); callee_gsharedvt = ji_is_gsharedvt (callee_ji); /* @@ -1341,7 +1329,7 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti * caller -> out trampoline -> in trampoline -> callee * This is not very efficient, but it is easy to implement. */ - if (virtual || !callee_gsharedvt) { + if (virtual_ || !callee_gsharedvt) { MonoMethodSignature *sig, *gsig; g_assert (method->is_inflated); @@ -1395,21 +1383,21 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti return addr; } case MONO_RGCTX_INFO_METHOD_GSHAREDVT_INFO: { - MonoGSharedVtMethodInfo *info = data; + MonoGSharedVtMethodInfo *info = (MonoGSharedVtMethodInfo *)data; MonoGSharedVtMethodRuntimeInfo *res; MonoType *t; int i, offset, align, size; // FIXME: - res = g_malloc0 (sizeof (MonoGSharedVtMethodRuntimeInfo) + (info->num_entries * sizeof (gpointer))); + res = (MonoGSharedVtMethodRuntimeInfo *)g_malloc0 (sizeof (MonoGSharedVtMethodRuntimeInfo) + (info->num_entries * sizeof (gpointer))); offset = 0; for (i = 0; i < info->num_entries; ++i) { - MonoRuntimeGenericContextInfoTemplate *template = &info->entries [i]; + MonoRuntimeGenericContextInfoTemplate *template_ = &info->entries [i]; - switch (template->info_type) { + switch (template_->info_type) { case MONO_RGCTX_INFO_LOCAL_OFFSET: - t = template->data; + t = (MonoType *)template_->data; size = mono_type_size (t, &align); @@ -1425,7 +1413,7 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti offset += size; break; default: - res->entries [i] = instantiate_info (domain, template, context, klass); + res->entries [i] = instantiate_info (domain, template_, context, klass); break; } } @@ -1446,14 +1434,14 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti static void fill_in_rgctx_template_slot (MonoClass *klass, int type_argc, int index, gpointer data, MonoRgctxInfoType info_type) { - MonoRuntimeGenericContextTemplate *template = mono_class_get_runtime_generic_context_template (klass); + MonoRuntimeGenericContextTemplate *template_ = mono_class_get_runtime_generic_context_template (klass); MonoClass *subclass; - rgctx_template_set_slot (klass->image, template, type_argc, index, data, info_type); + rgctx_template_set_slot (klass->image, template_, type_argc, index, data, info_type); /* Recurse for all subclasses */ if (generic_subclass_hash) - subclass = g_hash_table_lookup (generic_subclass_hash, klass); + subclass = (MonoClass *)g_hash_table_lookup (generic_subclass_hash, klass); else subclass = NULL; @@ -1527,11 +1515,11 @@ static int register_info (MonoClass *klass, int type_argc, gpointer data, MonoRgctxInfoType info_type) { int i; - MonoRuntimeGenericContextTemplate *template = mono_class_get_runtime_generic_context_template (klass); + MonoRuntimeGenericContextTemplate *template_ = mono_class_get_runtime_generic_context_template (klass); MonoClass *parent; MonoRuntimeGenericContextInfoTemplate *oti; - for (i = 0, oti = get_info_templates (template, type_argc); oti; ++i, oti = oti->next) { + for (i = 0, oti = get_info_templates (template_, type_argc); oti; ++i, oti = oti->next) { if (!oti->data) break; } @@ -1555,7 +1543,7 @@ register_info (MonoClass *klass, int type_argc, gpointer data, MonoRgctxInfoType break; rgctx_template_set_slot (parent->image, parent_template, type_argc, i, - MONO_RGCTX_SLOT_USED_MARKER, 0); + MONO_RGCTX_SLOT_USED_MARKER, (MonoRgctxInfoType)0); parent = parent->parent; } @@ -1585,7 +1573,7 @@ info_equal (gpointer data1, gpointer data2, MonoRgctxInfoType info_type) case MONO_RGCTX_INFO_BZERO: case MONO_RGCTX_INFO_NULLABLE_CLASS_BOX: case MONO_RGCTX_INFO_NULLABLE_CLASS_UNBOX: - return mono_class_from_mono_type (data1) == mono_class_from_mono_type (data2); + return mono_class_from_mono_type ((MonoType *)data1) == mono_class_from_mono_type ((MonoType *)data2); case MONO_RGCTX_INFO_METHOD: case MONO_RGCTX_INFO_METHOD_GSHAREDVT_INFO: case MONO_RGCTX_INFO_GENERIC_METHOD_CODE: @@ -1601,8 +1589,8 @@ info_equal (gpointer data1, gpointer data2, MonoRgctxInfoType info_type) return data1 == data2; case MONO_RGCTX_INFO_VIRT_METHOD_CODE: case MONO_RGCTX_INFO_VIRT_METHOD_BOX_TYPE: { - MonoJumpInfoVirtMethod *info1 = data1; - MonoJumpInfoVirtMethod *info2 = data2; + MonoJumpInfoVirtMethod *info1 = (MonoJumpInfoVirtMethod *)data1; + MonoJumpInfoVirtMethod *info2 = (MonoJumpInfoVirtMethod *)data2; return info1->klass == info2->klass && info1->method == info2->method; } @@ -1642,7 +1630,7 @@ mini_rgctx_info_type_to_patch_info_type (MonoRgctxInfoType info_type) return MONO_PATCH_INFO_FIELD; default: g_assert_not_reached (); - return -1; + return (MonoJumpInfoType)-1; } } @@ -1769,7 +1757,7 @@ alloc_rgctx_array (MonoDomain *domain, int n, gboolean is_mrgctx) static int mrgctx_bytes_alloced = 0; int size = mono_class_rgctx_get_array_size (n, is_mrgctx) * sizeof (gpointer); - gpointer array = mono_domain_alloc0 (domain, size); + gpointer *array = (gpointer *)mono_domain_alloc0 (domain, size); if (!inited) { mono_counters_register ("RGCTX num arrays alloced", MONO_COUNTER_GENERICS | MONO_COUNTER_INT, &rgctx_num_alloced); @@ -1834,7 +1822,7 @@ fill_runtime_generic_context (MonoVTable *class_vtable, MonoRuntimeGenericContex } if (!rgctx [offset + 0]) rgctx [offset + 0] = alloc_rgctx_array (domain, i + 1, method_inst != NULL); - rgctx = rgctx [offset + 0]; + rgctx = (void **)rgctx [offset + 0]; first_slot += size - 1; size = mono_class_rgctx_get_array_size (i + 1, method_inst != NULL); } @@ -1932,7 +1920,7 @@ mono_method_fill_runtime_generic_context (MonoMethodRuntimeGenericContext *mrgct static guint mrgctx_hash_func (gconstpointer key) { - const MonoMethodRuntimeGenericContext *mrgctx = key; + const MonoMethodRuntimeGenericContext *mrgctx = (const MonoMethodRuntimeGenericContext *)key; return mono_aligned_addr_hash (mrgctx->class_vtable) ^ mono_metadata_generic_inst_hash (mrgctx->method_inst); } @@ -1940,8 +1928,8 @@ mrgctx_hash_func (gconstpointer key) static gboolean mrgctx_equal_func (gconstpointer a, gconstpointer b) { - const MonoMethodRuntimeGenericContext *mrgctx1 = a; - const MonoMethodRuntimeGenericContext *mrgctx2 = b; + const MonoMethodRuntimeGenericContext *mrgctx1 = (const MonoMethodRuntimeGenericContext *)a; + const MonoMethodRuntimeGenericContext *mrgctx2 = (const MonoMethodRuntimeGenericContext *)b; return mrgctx1->class_vtable == mrgctx2->class_vtable && mono_metadata_generic_inst_equal (mrgctx1->method_inst, mrgctx2->method_inst); @@ -1974,7 +1962,7 @@ mono_method_lookup_rgctx (MonoVTable *class_vtable, MonoGenericInst *method_inst key.class_vtable = class_vtable; key.method_inst = method_inst; - mrgctx = g_hash_table_lookup (domain->method_rgctx_hash, &key); + mrgctx = (MonoMethodRuntimeGenericContext *)g_hash_table_lookup (domain->method_rgctx_hash, &key); if (!mrgctx) { //int i; @@ -2335,7 +2323,7 @@ get_object_generic_inst (int type_argc) MonoType **type_argv; int i; - type_argv = alloca (sizeof (MonoType*) * type_argc); + type_argv = (MonoType **)alloca (sizeof (MonoType*) * type_argc); for (i = 0; i < type_argc; ++i) type_argv [i] = &mono_defaults.object_class->byval_arg; @@ -2624,6 +2612,11 @@ mini_type_stack_size_full (MonoType *t, guint32 *align, gboolean pinvoke) void mono_generic_sharing_init (void) { + mono_counters_register ("RGCTX template num allocted", MONO_COUNTER_GENERICS | MONO_COUNTER_INT, &num_templates_allocted); + mono_counters_register ("RGCTX template bytes allocted", MONO_COUNTER_GENERICS | MONO_COUNTER_INT, &num_templates_bytes); + mono_counters_register ("RGCTX oti num allocted", MONO_COUNTER_GENERICS | MONO_COUNTER_INT, &num_oti_allocted); + mono_counters_register ("RGCTX oti bytes allocted", MONO_COUNTER_GENERICS | MONO_COUNTER_INT, &num_oti_bytes); + mono_install_image_unload_hook (mono_class_unregister_image_generic_subclasses, NULL); } @@ -2779,38 +2772,31 @@ mini_get_shared_gparam (MonoType *t, MonoType *constraint) key.param.param.gshared_constraint = constraint; g_assert (mono_generic_param_info (par)); - /* image might not be set for sre */ - if (par->owner && par->owner->image) { - image = par->owner->image; + image = get_image_for_generic_param(par); - /* - * Need a cache to ensure the newly created gparam - * is unique wrt T/CONSTRAINT. - */ - mono_image_lock (image); - if (!image->gshared_types) { - image->gshared_types_len = MONO_TYPE_INTERNAL; - image->gshared_types = g_new0 (GHashTable*, image->gshared_types_len); - } - if (!image->gshared_types [constraint->type]) - image->gshared_types [constraint->type] = g_hash_table_new (shared_gparam_hash, shared_gparam_equal); - res = g_hash_table_lookup (image->gshared_types [constraint->type], &key); - mono_image_unlock (image); - if (res) - return res; - copy = mono_image_alloc0 (image, sizeof (MonoGSharedGenericParam)); - memcpy (©->param, par, sizeof (MonoGenericParamFull)); - name = get_shared_gparam_name (constraint->type, ((MonoGenericParamFull*)copy)->info.name); - copy->param.info.name = mono_image_strdup (image, name); - g_free (name); - } else { - /* mono_generic_param_name () expects this to be a MonoGenericParamFull */ - copy = g_new0 (MonoGSharedGenericParam, 1); - memcpy (©->param, par, sizeof (MonoGenericParam)); - } - copy->param.param.owner = NULL; - // FIXME: - copy->param.param.image = image ? image : mono_defaults.corlib; + /* + * Need a cache to ensure the newly created gparam + * is unique wrt T/CONSTRAINT. + */ + mono_image_lock (image); + if (!image->gshared_types) { + image->gshared_types_len = MONO_TYPE_INTERNAL; + image->gshared_types = g_new0 (GHashTable*, image->gshared_types_len); + } + if (!image->gshared_types [constraint->type]) + image->gshared_types [constraint->type] = g_hash_table_new (shared_gparam_hash, shared_gparam_equal); + res = (MonoType *)g_hash_table_lookup (image->gshared_types [constraint->type], &key); + mono_image_unlock (image); + if (res) + return res; + copy = (MonoGSharedGenericParam *)mono_image_alloc0 (image, sizeof (MonoGSharedGenericParam)); + memcpy (©->param, par, sizeof (MonoGenericParamFull)); + copy->param.info.pklass = NULL; + name = get_shared_gparam_name (constraint->type, ((MonoGenericParamFull*)copy)->info.name); + copy->param.info.name = mono_image_strdup (image, name); + g_free (name); + + copy->param.param.owner = par->owner; copy->param.param.gshared_constraint = constraint; copy->parent = par; @@ -2998,7 +2984,7 @@ mini_get_rgctx_entry_slot (MonoJumpInfoRgctxEntry *entry) slot = mono_method_lookup_or_register_info (entry->method, entry->in_mrgctx, entry->data->data.sig, entry->info_type, mono_method_get_context (entry->method)); break; case MONO_PATCH_INFO_GSHAREDVT_CALL: { - MonoJumpInfoGSharedVtCall *call_info = g_malloc0 (sizeof (MonoJumpInfoGSharedVtCall)); //mono_domain_alloc0 (domain, sizeof (MonoJumpInfoGSharedVtCall)); + MonoJumpInfoGSharedVtCall *call_info = (MonoJumpInfoGSharedVtCall *)g_malloc0 (sizeof (MonoJumpInfoGSharedVtCall)); //mono_domain_alloc0 (domain, sizeof (MonoJumpInfoGSharedVtCall)); memcpy (call_info, entry->data->data.gsharedvt, sizeof (MonoJumpInfoGSharedVtCall)); slot = mono_method_lookup_or_register_info (entry->method, entry->in_mrgctx, call_info, entry->info_type, mono_method_get_context (entry->method)); @@ -3010,15 +2996,15 @@ mini_get_rgctx_entry_slot (MonoJumpInfoRgctxEntry *entry) int i; /* Make a copy into the domain mempool */ - info = g_malloc0 (sizeof (MonoGSharedVtMethodInfo)); //mono_domain_alloc0 (domain, sizeof (MonoGSharedVtMethodInfo)); + info = (MonoGSharedVtMethodInfo *)g_malloc0 (sizeof (MonoGSharedVtMethodInfo)); //mono_domain_alloc0 (domain, sizeof (MonoGSharedVtMethodInfo)); info->method = oinfo->method; info->num_entries = oinfo->num_entries; - info->entries = g_malloc0 (sizeof (MonoRuntimeGenericContextInfoTemplate) * info->num_entries); + info->entries = (MonoRuntimeGenericContextInfoTemplate *)g_malloc0 (sizeof (MonoRuntimeGenericContextInfoTemplate) * info->num_entries); for (i = 0; i < oinfo->num_entries; ++i) { MonoRuntimeGenericContextInfoTemplate *otemplate = &oinfo->entries [i]; - MonoRuntimeGenericContextInfoTemplate *template = &info->entries [i]; + MonoRuntimeGenericContextInfoTemplate *template_ = &info->entries [i]; - memcpy (template, otemplate, sizeof (MonoRuntimeGenericContextInfoTemplate)); + memcpy (template_, otemplate, sizeof (MonoRuntimeGenericContextInfoTemplate)); } slot = mono_method_lookup_or_register_info (entry->method, entry->in_mrgctx, info, entry->info_type, mono_method_get_context (entry->method)); break; @@ -3027,7 +3013,7 @@ mini_get_rgctx_entry_slot (MonoJumpInfoRgctxEntry *entry) MonoJumpInfoVirtMethod *info; MonoJumpInfoVirtMethod *oinfo = entry->data->data.virt_method; - info = g_malloc0 (sizeof (MonoJumpInfoVirtMethod)); + info = (MonoJumpInfoVirtMethod *)g_malloc0 (sizeof (MonoJumpInfoVirtMethod)); memcpy (info, oinfo, sizeof (MonoJumpInfoVirtMethod)); slot = mono_method_lookup_or_register_info (entry->method, entry->in_mrgctx, info, entry->info_type, mono_method_get_context (entry->method)); break; diff --git a/mono/mini/mini-llvm-cpp.cpp b/mono/mini/mini-llvm-cpp.cpp index 1d79ce0d511..cb5ddd33e79 100644 --- a/mono/mini/mini-llvm-cpp.cpp +++ b/mono/mini/mini-llvm-cpp.cpp @@ -25,267 +25,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include #include -#include -#include - #include "mini-llvm-cpp.h" -// extern "C" void LLVMInitializeARMTargetInfo(); -// extern "C" void LLVMInitializeARMTarget (); -// extern "C" void LLVMInitializeARMTargetMC (); - using namespace llvm; -#ifndef MONO_CROSS_COMPILE - -static void (*unhandled_exception)() = default_mono_llvm_unhandled_exception; - -void -mono_llvm_set_unhandled_exception_handler (void) -{ - std::set_terminate (unhandled_exception); -} - -class MonoJITMemoryManager : public JITMemoryManager -{ -private: - JITMemoryManager *mm; - -public: - /* Callbacks installed by mono */ - AllocCodeMemoryCb *alloc_cb; - DlSymCb *dlsym_cb; - ExceptionTableCb *exception_cb; - - MonoJITMemoryManager (); - ~MonoJITMemoryManager (); - - void setMemoryWritable (void); - - void setMemoryExecutable (void); - - void AllocateGOT(); - - unsigned char *getGOTBase() const { - return mm->getGOTBase (); - } - - void setPoisonMemory(bool) { - } - - unsigned char *startFunctionBody(const Function *F, - uintptr_t &ActualSize); - - unsigned char *allocateStub(const GlobalValue* F, unsigned StubSize, - unsigned Alignment); - - void endFunctionBody(const Function *F, unsigned char *FunctionStart, - unsigned char *FunctionEnd); - - unsigned char *allocateSpace(intptr_t Size, unsigned Alignment); - - uint8_t *allocateGlobal(uintptr_t Size, unsigned Alignment); - - void deallocateMemForFunction(const Function *F); - - unsigned char*startExceptionTable(const Function* F, - uintptr_t &ActualSize); - - void endExceptionTable(const Function *F, unsigned char *TableStart, - unsigned char *TableEnd, - unsigned char* FrameRegister); - - virtual void deallocateFunctionBody(void*) { - } - - virtual void deallocateExceptionTable(void*) { - } - - virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, - StringRef SectionName) { - // FIXME: - assert(0); - return NULL; - } - - virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, - StringRef SectionName, bool IsReadOnly) { - // FIXME: - assert(0); - return NULL; - } - - virtual bool applyPermissions(std::string*) { - // FIXME: - assert(0); - return false; - } - - virtual bool finalizeMemory(std::string *ErrMsg = 0) { - // FIXME: - assert(0); - return false; - } - - virtual void* getPointerToNamedFunction(const std::string &Name, bool AbortOnFailure) { - void *res; - char *err; - - err = dlsym_cb (Name.c_str (), &res); - if (err) { - outs () << "Unable to resolve: " << Name << ": " << err << "\n"; - assert(0); - return NULL; - } - return res; - } -}; - -MonoJITMemoryManager::MonoJITMemoryManager () -{ - mm = JITMemoryManager::CreateDefaultMemManager (); -} - -MonoJITMemoryManager::~MonoJITMemoryManager () -{ - delete mm; -} - -void -MonoJITMemoryManager::setMemoryWritable (void) -{ -} - -void -MonoJITMemoryManager::setMemoryExecutable (void) -{ -} - -void -MonoJITMemoryManager::AllocateGOT() -{ - mm->AllocateGOT (); -} - -unsigned char * -MonoJITMemoryManager::startFunctionBody(const Function *F, - uintptr_t &ActualSize) -{ - // FIXME: This leaks memory - if (ActualSize == 0) - ActualSize = 128; - return alloc_cb (wrap (F), ActualSize); -} - -unsigned char * -MonoJITMemoryManager::allocateStub(const GlobalValue* F, unsigned StubSize, - unsigned Alignment) -{ - return alloc_cb (wrap (F), StubSize); -} - -void -MonoJITMemoryManager::endFunctionBody(const Function *F, unsigned char *FunctionStart, - unsigned char *FunctionEnd) -{ -} - -unsigned char * -MonoJITMemoryManager::allocateSpace(intptr_t Size, unsigned Alignment) -{ - return new unsigned char [Size]; -} - -uint8_t * -MonoJITMemoryManager::allocateGlobal(uintptr_t Size, unsigned Alignment) -{ - return new unsigned char [Size]; -} - -void -MonoJITMemoryManager::deallocateMemForFunction(const Function *F) -{ -} - -unsigned char* -MonoJITMemoryManager::startExceptionTable(const Function* F, - uintptr_t &ActualSize) -{ - return startFunctionBody(F, ActualSize); -} - -void -MonoJITMemoryManager::endExceptionTable(const Function *F, unsigned char *TableStart, - unsigned char *TableEnd, - unsigned char* FrameRegister) -{ - exception_cb (FrameRegister); -} - -#else - -class MonoJITMemoryManager { -}; - -#endif /* !MONO_CROSS_COMPILE */ - -class MonoJITEventListener : public JITEventListener { - -public: - FunctionEmittedCb *emitted_cb; - - MonoJITEventListener (FunctionEmittedCb *cb) { - emitted_cb = cb; - } - - virtual void NotifyFunctionEmitted(const Function &F, - void *Code, size_t Size, - const EmittedFunctionDetails &Details) { - emitted_cb (wrap (&F), Code, (char*)Code + Size); - } -}; - -class MonoEE { -public: - ExecutionEngine *EE; - MonoJITMemoryManager *mm; - MonoJITEventListener *listener; - FunctionPassManager *fpm; -}; - -void -mono_llvm_optimize_method (MonoEERef eeref, LLVMValueRef method) -{ - MonoEE *mono_ee = (MonoEE*)eeref; - - /* - * The verifier does some checks on the whole module, leading to quadratic behavior. - */ - //verifyFunction (*(unwrap (method))); - mono_ee->fpm->run (*unwrap (method)); -} - void mono_llvm_dump_value (LLVMValueRef value) { @@ -469,315 +216,3 @@ mono_llvm_set_call_preserveall_cc (LLVMValueRef func) { unwrap(func)->setCallingConv (CallingConv::PreserveAll); } - -static cl::list -PassList(cl::desc("Optimizations available:")); - -static void -force_pass_linking (void) -{ - // Make sure the rest is linked in, but never executed - if (g_getenv ("FOO") != (char*)-1) - return; - - // This is a subset of the passes in LinkAllPasses.h - // The utility passes and the interprocedural passes are commented out - - (void) llvm::createAAEvalPass(); - (void) llvm::createAggressiveDCEPass(); - (void) llvm::createAliasAnalysisCounterPass(); - (void) llvm::createAliasDebugger(); - /* - (void) llvm::createArgumentPromotionPass(); - (void) llvm::createStructRetPromotionPass(); - */ - (void) llvm::createBasicAliasAnalysisPass(); - (void) llvm::createLibCallAliasAnalysisPass(0); - (void) llvm::createScalarEvolutionAliasAnalysisPass(); - //(void) llvm::createBlockPlacementPass(); - (void) llvm::createBreakCriticalEdgesPass(); - (void) llvm::createCFGSimplificationPass(); - /* - (void) llvm::createConstantMergePass(); - (void) llvm::createConstantPropagationPass(); - */ - /* - (void) llvm::createDeadArgEliminationPass(); - */ - (void) llvm::createDeadCodeEliminationPass(); - (void) llvm::createDeadInstEliminationPass(); - (void) llvm::createDeadStoreEliminationPass(); - /* - (void) llvm::createDeadTypeEliminationPass(); - (void) llvm::createDomOnlyPrinterPass(); - (void) llvm::createDomPrinterPass(); - (void) llvm::createDomOnlyViewerPass(); - (void) llvm::createDomViewerPass(); - (void) llvm::createEdgeProfilerPass(); - (void) llvm::createOptimalEdgeProfilerPass(); - (void) llvm::createFunctionInliningPass(); - (void) llvm::createAlwaysInlinerPass(); - (void) llvm::createGlobalDCEPass(); - (void) llvm::createGlobalOptimizerPass(); - (void) llvm::createGlobalsModRefPass(); - (void) llvm::createIPConstantPropagationPass(); - (void) llvm::createIPSCCPPass(); - */ - (void) llvm::createIndVarSimplifyPass(); - (void) llvm::createInstructionCombiningPass(); - /* - (void) llvm::createInternalizePass(false); - */ - (void) llvm::createLCSSAPass(); - (void) llvm::createLICMPass(); - (void) llvm::createLazyValueInfoPass(); - //(void) llvm::createLoopDependenceAnalysisPass(); - /* - (void) llvm::createLoopExtractorPass(); - */ - (void) llvm::createLoopSimplifyPass(); - (void) llvm::createLoopStrengthReducePass(); - (void) llvm::createLoopUnrollPass(); - (void) llvm::createLoopUnswitchPass(); - (void) llvm::createLoopRotatePass(); - (void) llvm::createLowerInvokePass(); - /* - (void) llvm::createLowerSetJmpPass(); - */ - (void) llvm::createLowerSwitchPass(); - (void) llvm::createNoAAPass(); - /* - (void) llvm::createNoProfileInfoPass(); - (void) llvm::createProfileEstimatorPass(); - (void) llvm::createProfileVerifierPass(); - (void) llvm::createProfileLoaderPass(); - */ - (void) llvm::createPromoteMemoryToRegisterPass(); - (void) llvm::createDemoteRegisterToMemoryPass(); - /* - (void) llvm::createPruneEHPass(); - (void) llvm::createPostDomOnlyPrinterPass(); - (void) llvm::createPostDomPrinterPass(); - (void) llvm::createPostDomOnlyViewerPass(); - (void) llvm::createPostDomViewerPass(); - */ - (void) llvm::createReassociatePass(); - (void) llvm::createSCCPPass(); - (void) llvm::createScalarReplAggregatesPass(); - //(void) llvm::createSimplifyLibCallsPass(); - /* - (void) llvm::createSingleLoopExtractorPass(); - (void) llvm::createStripSymbolsPass(); - (void) llvm::createStripNonDebugSymbolsPass(); - (void) llvm::createStripDeadDebugInfoPass(); - (void) llvm::createStripDeadPrototypesPass(); - (void) llvm::createTailCallEliminationPass(); - (void) llvm::createTailDuplicationPass(); - (void) llvm::createJumpThreadingPass(); - */ - /* - (void) llvm::createUnifyFunctionExitNodesPass(); - */ - (void) llvm::createInstCountPass(); - (void) llvm::createCodeGenPreparePass(); - (void) llvm::createGVNPass(); - (void) llvm::createMemCpyOptPass(); - (void) llvm::createLoopDeletionPass(); - /* - (void) llvm::createPostDomTree(); - (void) llvm::createPostDomFrontier(); - (void) llvm::createInstructionNamerPass(); - (void) llvm::createPartialSpecializationPass(); - (void) llvm::createFunctionAttrsPass(); - (void) llvm::createMergeFunctionsPass(); - (void) llvm::createPrintModulePass(0); - (void) llvm::createPrintFunctionPass("", 0); - (void) llvm::createDbgInfoPrinterPass(); - (void) llvm::createModuleDebugInfoPrinterPass(); - (void) llvm::createPartialInliningPass(); - (void) llvm::createGEPSplitterPass(); - (void) llvm::createLintPass(); - */ - (void) llvm::createSinkingPass(); -} - -#ifndef MONO_CROSS_COMPILE - -static gboolean inited; - -static void -init_llvm (void) -{ - if (inited) - return; - - force_pass_linking (); - -#ifdef TARGET_ARM - LLVMInitializeARMTarget (); - LLVMInitializeARMTargetInfo (); - LLVMInitializeARMTargetMC (); -#elif defined(TARGET_X86) || defined(TARGET_AMD64) - LLVMInitializeX86Target (); - LLVMInitializeX86TargetInfo (); - LLVMInitializeX86TargetMC (); -#elif defined(TARGET_POWERPC) - LLVMInitializePowerPCTarget (); - LLVMInitializePowerPCTargetInfo (); - LLVMInitializePowerPCTargetMC (); -#else - #error Unsupported mono-llvm target -#endif - - PassRegistry &Registry = *PassRegistry::getPassRegistry(); - initializeCore(Registry); - initializeScalarOpts(Registry); - initializeAnalysis(Registry); - initializeIPA(Registry); - initializeTransformUtils(Registry); - initializeInstCombine(Registry); - initializeTarget(Registry); - - llvm::cl::ParseEnvironmentOptions("mono", "MONO_LLVM", ""); - - inited = true; -} - -MonoEERef -mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, FunctionEmittedCb *emitted_cb, ExceptionTableCb *exception_cb, DlSymCb *dlsym_cb, LLVMExecutionEngineRef *ee) -{ - std::string Error; - MonoEE *mono_ee; - - init_llvm (); - - mono_ee = new MonoEE (); - - MonoJITMemoryManager *mono_mm = new MonoJITMemoryManager (); - mono_mm->alloc_cb = alloc_cb; - mono_mm->dlsym_cb = dlsym_cb; - mono_mm->exception_cb = exception_cb; - mono_ee->mm = mono_mm; - - /* - * The Default code model doesn't seem to work on amd64, - * test_0_fields_with_big_offsets (among others) crashes, because LLVM tries to call - * memset using a normal pcrel code which is in 32bit memory, while memset isn't. - */ - - TargetOptions opts; - opts.JITExceptionHandling = 1; - - StringRef cpu_name = sys::getHostCPUName (); - - // EngineBuilder no longer has a copy assignment operator (?) - std::unique_ptr Owner(unwrap(MP)); - EngineBuilder b (std::move(Owner)); - ExecutionEngine *EE = b.setJITMemoryManager (mono_mm).setTargetOptions (opts).setAllocateGVsWithCode (true).setMCPU (cpu_name).create (); - - g_assert (EE); - mono_ee->EE = EE; - - MonoJITEventListener *listener = new MonoJITEventListener (emitted_cb); - EE->RegisterJITEventListener (listener); - mono_ee->listener = listener; - - FunctionPassManager *fpm = new FunctionPassManager (unwrap (MP)); - mono_ee->fpm = fpm; - - fpm->add(new DataLayoutPass(*EE->getDataLayout())); - - if (PassList.size() > 0) { - /* Use the passes specified by the env variable */ - /* Only the passes in force_pass_linking () can be used */ - for (unsigned i = 0; i < PassList.size(); ++i) { - const PassInfo *PassInf = PassList[i]; - Pass *P = 0; - - if (PassInf->getNormalCtor()) - P = PassInf->getNormalCtor()(); - fpm->add (P); - } - } else { - /* Use the same passes used by 'opt' by default, without the ipo passes */ - const char *opts = "-simplifycfg -domtree -domfrontier -scalarrepl -instcombine -simplifycfg -domtree -domfrontier -scalarrepl -instcombine -simplifycfg -instcombine -simplifycfg -reassociate -domtree -loops -loop-simplify -domfrontier -loop-simplify -lcssa -loop-rotate -licm -lcssa -loop-unswitch -instcombine -scalar-evolution -loop-simplify -lcssa -iv-users -indvars -loop-deletion -loop-simplify -lcssa -loop-unroll -instcombine -memdep -gvn -memdep -memcpyopt -sccp -instcombine -domtree -memdep -dse -adce -gvn -simplifycfg"; - char **args; - int i; - - args = g_strsplit (opts, " ", 1000); - for (i = 0; args [i]; i++) - ; - llvm::cl::ParseCommandLineOptions (i, args, ""); - g_strfreev (args); - - for (unsigned i = 0; i < PassList.size(); ++i) { - const PassInfo *PassInf = PassList[i]; - Pass *P = 0; - - if (PassInf->getNormalCtor()) - P = PassInf->getNormalCtor()(); - g_assert (P->getPassKind () == llvm::PT_Function || P->getPassKind () == llvm::PT_Loop); - fpm->add (P); - } - - /* - fpm->add(createInstructionCombiningPass()); - fpm->add(createReassociatePass()); - fpm->add(createGVNPass()); - fpm->add(createCFGSimplificationPass()); - */ - } - - *ee = wrap (EE); - - return mono_ee; -} - -void -mono_llvm_dispose_ee (MonoEERef *eeref) -{ - MonoEE *mono_ee = (MonoEE*)eeref; - - delete mono_ee->EE; - delete mono_ee->fpm; - //delete mono_ee->mm; - delete mono_ee->listener; - delete mono_ee; -} - -#else - -void -mono_llvm_set_unhandled_exception_handler (void) -{ -} - -MonoEERef -mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, FunctionEmittedCb *emitted_cb, ExceptionTableCb *exception_cb, DlSymCb *dlsym_cb, LLVMExecutionEngineRef *ee) -{ - g_assert_not_reached (); - return NULL; -} - -void -mono_llvm_dispose_ee (MonoEERef *eeref) -{ - g_assert_not_reached (); -} - -/* Not linked in */ -void -LLVMAddGlobalMapping(LLVMExecutionEngineRef EE, LLVMValueRef Global, - void* Addr) -{ - g_assert_not_reached (); -} - -void* -LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global) -{ - g_assert_not_reached (); - return NULL; -} - -#endif /* !MONO_CROSS_COMPILE */ diff --git a/mono/mini/mini-llvm.c b/mono/mini/mini-llvm.c index 35c8ab6d995..c608faa5ce6 100644 --- a/mono/mini/mini-llvm.c +++ b/mono/mini/mini-llvm.c @@ -1269,6 +1269,8 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo * break; case LLVMArgVtypeRetAddr: case LLVMArgScalarRetAddr: + case LLVMArgGsharedvtFixed: + case LLVMArgGsharedvtVariable: vretaddr = TRUE; ret_type = LLVMVoidType (); break; @@ -1326,6 +1328,7 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo * if (sig->hasthis) { cinfo->this_arg_pindex = pindex; param_types [pindex ++] = ThisType (); + cinfo->args [0].pindex = cinfo->this_arg_pindex; } if (vretaddr && vret_arg_pindex == pindex) param_types [pindex ++] = IntPtrType (); @@ -1378,6 +1381,10 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo * case LLVMArgVtypeAsScalar: g_assert_not_reached (); break; + case LLVMArgGsharedvtFixed: + case LLVMArgGsharedvtVariable: + param_types [pindex ++] = LLVMPointerType (type_to_llvm_arg_type (ctx, ainfo->type), 0); + break; default: param_types [pindex ++] = type_to_llvm_arg_type (ctx, ainfo->type); break; @@ -2791,6 +2798,22 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder) case LLVMArgVtypeAsScalar: g_assert_not_reached (); break; + case LLVMArgGsharedvtFixed: { + /* These are non-gsharedvt arguments passed by ref, the rest of the IR treats them as scalars */ + LLVMValueRef arg = LLVMGetParam (ctx->lmethod, pindex); + + if (names [i]) + name = g_strdup_printf ("arg_%s", names [i]); + else + name = g_strdup_printf ("arg_%d", i); + + ctx->values [reg] = LLVMBuildLoad (builder, convert (ctx, arg, LLVMPointerType (type_to_llvm_type (ctx, ainfo->type), 0)), name); + break; + } + case LLVMArgGsharedvtVariable: + /* The IR treats these as variables with addresses */ + ctx->addresses [reg] = LLVMGetParam (ctx->lmethod, pindex); + break; default: ctx->values [reg] = convert_full (ctx, ctx->values [reg], llvm_type_to_stack_type (cfg, type_to_llvm_type (ctx, ainfo->type)), type_is_unsigned (ctx, ainfo->type)); break; @@ -2935,7 +2958,7 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref, if (call->imt_arg_reg) cinfo->imt_arg = TRUE; - vretaddr = (cinfo->ret.storage == LLVMArgVtypeRetAddr || cinfo->ret.storage == LLVMArgVtypeByRef || cinfo->ret.storage == LLVMArgScalarRetAddr); + vretaddr = (cinfo->ret.storage == LLVMArgVtypeRetAddr || cinfo->ret.storage == LLVMArgVtypeByRef || cinfo->ret.storage == LLVMArgScalarRetAddr || cinfo->ret.storage == LLVMArgGsharedvtFixed || cinfo->ret.storage == LLVMArgGsharedvtVariable); llvm_sig = sig_to_llvm_sig_full (ctx, sig, cinfo); CHECK_FAILURE (ctx); @@ -3231,6 +3254,10 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref, /* Normal scalar returned using a vtype return argument */ values [ins->dreg] = LLVMBuildLoad (builder, convert_full (ctx, addresses [call->inst.dreg], LLVMPointerType (type_to_llvm_type (ctx, sig->ret), 0), FALSE), ""); break; + case LLVMArgGsharedvtFixed: + case LLVMArgGsharedvtVariable: + g_assert_not_reached (); + break; default: if (sig->ret->type != MONO_TYPE_VOID) /* If the method returns an unsigned value, need to zext it */ @@ -3967,6 +3994,21 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) LLVMBuildRetVoid (builder); break; } + case LLVMArgGsharedvtFixed: { + LLVMTypeRef ret_type = type_to_llvm_type (ctx, sig->ret); + /* The return value is in lhs, need to store to the vret argument */ + g_assert (lhs); + g_assert (cfg->vret_addr); + g_assert (values [cfg->vret_addr->dreg]); + LLVMBuildStore (builder, convert (ctx, lhs, ret_type), convert (ctx, values [cfg->vret_addr->dreg], LLVMPointerType (ret_type, 0))); + LLVMBuildRetVoid (builder); + break; + } + case LLVMArgGsharedvtVariable: { + /* Already set */ + LLVMBuildRetVoid (builder); + break; + } case LLVMArgVtypeRetAddr: { LLVMBuildRetVoid (builder); break; @@ -6010,6 +6052,46 @@ get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig) LLVMCallInfo *linfo; int i; + if (cfg->gsharedvt && cfg->llvm_only && mini_is_gsharedvt_variable_signature (sig)) { + int i, n, pindex; + + /* + * Gsharedvt methods have the following calling convention: + * - all arguments are passed by ref, even non generic ones + * - the return value is returned by ref too, using a vret + * argument passed after 'this'. + */ + n = sig->param_count + sig->hasthis; + linfo = mono_mempool_alloc0 (cfg->mempool, sizeof (LLVMCallInfo) + (sizeof (LLVMArgInfo) * n)); + + pindex = 0; + if (sig->hasthis) + linfo->args [pindex ++].storage = LLVMArgNormal; + + if (sig->ret->type != MONO_TYPE_VOID) { + if (mini_is_gsharedvt_variable_type (sig->ret)) + linfo->ret.storage = LLVMArgGsharedvtVariable; + else + linfo->ret.storage = LLVMArgGsharedvtFixed; + linfo->vret_arg_index = pindex; + } else { + linfo->ret.storage = LLVMArgNone; + } + + for (i = 0; i < sig->param_count; ++i) { + if (sig->params [i]->byref) + linfo->args [pindex].storage = LLVMArgNormal; + else if (mini_is_gsharedvt_variable_type (sig->params [i])) + linfo->args [pindex].storage = LLVMArgGsharedvtVariable; + else + linfo->args [pindex].storage = LLVMArgGsharedvtFixed; + linfo->args [pindex].type = sig->params [i]; + pindex ++; + } + return linfo; + } + + linfo = mono_arch_get_llvm_call_info (cfg, sig); for (i = 0; i < sig->param_count; ++i) linfo->args [i + sig->hasthis].type = sig->params [i]; @@ -6093,7 +6175,7 @@ mono_llvm_emit_method (MonoCompile *cfg) lmodule = ctx->lmodule = ctx->module->lmodule; ctx->llvm_only = ctx->module->llvm_only; - if (cfg->gsharedvt) + if (cfg->gsharedvt && !cfg->llvm_only) LLVM_FAILURE (ctx, "gsharedvt"); #if 1 @@ -6206,6 +6288,11 @@ mono_llvm_emit_method (MonoCompile *cfg) name = g_strdup_printf ("p_arg_%s", names [i]); else name = g_strdup_printf ("p_arg_%d", i); + } else if (ainfo->storage == LLVMArgGsharedvtFixed) { + if (names [i] && names [i][0] != '\0') + name = g_strdup_printf ("p_arg_%s", names [i]); + else + name = g_strdup_printf ("p_arg_%d", i); } else { if (names [i] && names [i][0] != '\0') name = g_strdup_printf ("arg_%s", names [i]); @@ -6518,7 +6605,7 @@ mono_llvm_emit_method (MonoCompile *cfg) int err = LLVMVerifyFunction(method, LLVMPrintMessageAction); g_assert (err == 0); } else { - LLVMVerifyFunction(method, 0); + //LLVMVerifyFunction(method, 0); mono_llvm_optimize_method (ctx->module->mono_ee, method); if (cfg->verbose_level > 1) @@ -6587,6 +6674,30 @@ mono_llvm_emit_method (MonoCompile *cfg) mono_loader_unlock (); } +/* + * mono_llvm_create_vars: + * + * Same as mono_arch_create_vars () for LLVM. + */ +void +mono_llvm_create_vars (MonoCompile *cfg) +{ + MonoMethodSignature *sig; + + sig = mono_method_signature (cfg->method); + if (cfg->gsharedvt && cfg->llvm_only) { + if (mini_is_gsharedvt_variable_signature (sig) && sig->ret->type != MONO_TYPE_VOID) { + cfg->vret_addr = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_ARG); + if (G_UNLIKELY (cfg->verbose_level > 1)) { + printf ("vret_addr = "); + mono_print_ins (cfg->vret_addr); + } + } + } else { + mono_arch_create_vars (cfg); + } +} + /* * mono_llvm_emit_call: * diff --git a/mono/mini/mini-llvm.h b/mono/mini/mini-llvm.h index 3e36b0a9bc0..bf7bdb0e4d4 100644 --- a/mono/mini/mini-llvm.h +++ b/mono/mini/mini-llvm.h @@ -26,6 +26,7 @@ void mono_llvm_clear_exception (void); MonoObject *mono_llvm_load_exception (void); void mono_llvm_reset_exception (void); void mono_llvm_raise_exception (MonoException *e); +void mono_llvm_create_vars (MonoCompile *cfg); gboolean mini_llvm_init (void); diff --git a/mono/mini/mini-mips.c b/mono/mini/mini-mips.c index de484d15b22..f9157a8690b 100644 --- a/mono/mini/mini-mips.c +++ b/mono/mini/mini-mips.c @@ -57,8 +57,8 @@ enum { }; /* This mutex protects architecture specific caches */ -#define mono_mini_arch_lock() mono_mutex_lock (&mini_arch_mutex) -#define mono_mini_arch_unlock() mono_mutex_unlock (&mini_arch_mutex) +#define mono_mini_arch_lock() mono_os_mutex_lock (&mini_arch_mutex) +#define mono_mini_arch_unlock() mono_os_mutex_unlock (&mini_arch_mutex) static mono_mutex_t mini_arch_mutex; int mono_exc_esp_offset = 0; @@ -713,7 +713,7 @@ mono_arch_cpu_init (void) void mono_arch_init (void) { - mono_mutex_init_recursive (&mini_arch_mutex); + mono_os_mutex_init_recursive (&mini_arch_mutex); ss_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ|MONO_MMAP_32BIT); bp_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ|MONO_MMAP_32BIT); @@ -726,7 +726,7 @@ mono_arch_init (void) void mono_arch_cleanup (void) { - mono_mutex_destroy (&mini_arch_mutex); + mono_os_mutex_destroy (&mini_arch_mutex); } /* diff --git a/mono/mini/mini-posix.c b/mono/mini/mini-posix.c index 724c4aa2c87..962557058b4 100644 --- a/mono/mini/mini-posix.c +++ b/mono/mini/mini-posix.c @@ -130,19 +130,19 @@ mono_gdb_render_native_backtraces (pid_t crashed_pid) static GHashTable *mono_saved_signal_handlers = NULL; -static gpointer +static struct sigaction * get_saved_signal_handler (int signo) { if (mono_saved_signal_handlers) /* The hash is only modified during startup, so no need for locking */ - return g_hash_table_lookup (mono_saved_signal_handlers, GINT_TO_POINTER (signo)); + return (struct sigaction *)g_hash_table_lookup (mono_saved_signal_handlers, GINT_TO_POINTER (signo)); return NULL; } static void save_old_signal_handler (int signo, struct sigaction *old_action) { - struct sigaction *handler_to_save = g_malloc (sizeof (struct sigaction)); + struct sigaction *handler_to_save = (struct sigaction *)g_malloc (sizeof (struct sigaction)); mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_CONFIG, "Saving old signal handler for signal %d.", signo); @@ -189,7 +189,7 @@ gboolean MONO_SIG_HANDLER_SIGNATURE (mono_chain_signal) { int signal = MONO_SIG_HANDLER_GET_SIGNO (); - struct sigaction *saved_handler = get_saved_signal_handler (signal); + struct sigaction *saved_handler = (struct sigaction *)get_saved_signal_handler (signal); if (saved_handler && saved_handler->sa_handler) { if (!(saved_handler->sa_flags & SA_SIGINFO)) { @@ -211,7 +211,7 @@ MONO_SIG_HANDLER_FUNC (static, sigabrt_signal_handler) MONO_SIG_HANDLER_GET_CONTEXT; if (mono_thread_internal_current ()) - ji = mono_jit_info_table_find_internal (mono_domain_get (), mono_arch_ip_from_context (ctx), TRUE, TRUE); + ji = mono_jit_info_table_find_internal (mono_domain_get (), (char *)mono_arch_ip_from_context (ctx), TRUE, TRUE); if (!ji) { if (mono_chain_signal (MONO_SIG_HANDLER_PARAMS)) return; @@ -257,15 +257,15 @@ per_thread_profiler_hit (void *ctx) MonoProfilerCallChainStrategy call_chain_strategy = mono_profiler_stat_get_call_chain_strategy (); if (call_chain_depth == 0) { - mono_profiler_stat_hit (mono_arch_ip_from_context (ctx), ctx); + mono_profiler_stat_hit ((guchar *)mono_arch_ip_from_context (ctx), ctx); } else { - MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); int current_frame_index = 1; MonoContext mono_context; guchar *ips [call_chain_depth + 1]; mono_sigctx_to_monoctx (ctx, &mono_context); - ips [0] = MONO_CONTEXT_GET_IP (&mono_context); + ips [0] = (guchar *)MONO_CONTEXT_GET_IP (&mono_context); if (jit_tls != NULL) { if (call_chain_strategy == MONO_PROFILER_CALL_CHAIN_NATIVE) { @@ -274,17 +274,17 @@ per_thread_profiler_hit (void *ctx) guchar *stack_bottom; guchar *stack_top; - stack_bottom = jit_tls->end_of_stack; - stack_top = MONO_CONTEXT_GET_SP (&mono_context); - current_frame = MONO_CONTEXT_GET_BP (&mono_context); + stack_bottom = (guchar *)jit_tls->end_of_stack; + stack_top = (guchar *)MONO_CONTEXT_GET_SP (&mono_context); + current_frame = (guchar *)MONO_CONTEXT_GET_BP (&mono_context); while ((current_frame_index <= call_chain_depth) && (stack_bottom IS_BEFORE_ON_STACK (guchar*) current_frame) && ((guchar*) current_frame IS_BEFORE_ON_STACK stack_top)) { - ips [current_frame_index] = CURRENT_FRAME_GET_RETURN_ADDRESS (current_frame); + ips [current_frame_index] = (guchar *)CURRENT_FRAME_GET_RETURN_ADDRESS (current_frame); current_frame_index ++; stack_top = current_frame; - current_frame = CURRENT_FRAME_GET_BASE_POINTER (current_frame); + current_frame = (guchar *)CURRENT_FRAME_GET_BASE_POINTER (current_frame); } #else call_chain_strategy = MONO_PROFILER_CALL_CHAIN_GLIBC; @@ -310,7 +310,7 @@ per_thread_profiler_hit (void *ctx) ji = mono_find_jit_info (domain, jit_tls, &res, NULL, &mono_context, &new_mono_context, NULL, &lmf, &native_offset, NULL); while ((ji != NULL) && (current_frame_index <= call_chain_depth)) { - ips [current_frame_index] = MONO_CONTEXT_GET_IP (&new_mono_context); + ips [current_frame_index] = (guchar *)MONO_CONTEXT_GET_IP (&new_mono_context); current_frame_index ++; mono_context = new_mono_context; ji = mono_find_jit_info (domain, jit_tls, &res, NULL, &mono_context, @@ -393,7 +393,7 @@ add_signal_handler (int signo, gpointer handler) struct sigaction previous_sa; #ifdef MONO_ARCH_USE_SIGACTION - sa.sa_sigaction = handler; + sa.sa_sigaction = (void (*)(int, siginfo_t *, void *))handler; sigemptyset (&sa.sa_mask); sa.sa_flags = SA_SIGINFO; #ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK @@ -658,7 +658,7 @@ void mono_gdb_render_native_backtraces (pid_t crashed_pid) { const char *argv [9]; - char template [] = "/tmp/mono-lldb-commands.XXXXXX"; + char template_ [] = "/tmp/mono-lldb-commands.XXXXXX"; char buf1 [128]; FILE *commands; gboolean using_lldb = FALSE; @@ -673,10 +673,10 @@ mono_gdb_render_native_backtraces (pid_t crashed_pid) return; if (using_lldb) { - if (mkstemp (template) == -1) + if (mkstemp (template_) == -1) return; - commands = fopen (template, "w"); + commands = fopen (template_, "w"); fprintf (commands, "process attach --pid %ld\n", (long) crashed_pid); fprintf (commands, "thread list\n"); @@ -688,7 +688,7 @@ mono_gdb_render_native_backtraces (pid_t crashed_pid) fclose (commands); argv [1] = "--source"; - argv [2] = template; + argv [2] = template_; argv [3] = 0; } else { argv [1] = "-ex"; @@ -705,7 +705,7 @@ mono_gdb_render_native_backtraces (pid_t crashed_pid) execv (argv [0], (char**)argv); if (using_lldb) - unlink (template); + unlink (template_); } #endif #endif /* __native_client__ */ diff --git a/mono/mini/mini-ppc.c b/mono/mini/mini-ppc.c index 4ddce9efeac..530e82cd3bf 100644 --- a/mono/mini/mini-ppc.c +++ b/mono/mini/mini-ppc.c @@ -62,8 +62,8 @@ enum { #define BREAKPOINT_SIZE (PPC_LOAD_SEQUENCE_LENGTH + 4) /* This mutex protects architecture specific caches */ -#define mono_mini_arch_lock() mono_mutex_lock (&mini_arch_mutex) -#define mono_mini_arch_unlock() mono_mutex_unlock (&mini_arch_mutex) +#define mono_mini_arch_lock() mono_os_mutex_lock (&mini_arch_mutex) +#define mono_mini_arch_unlock() mono_os_mutex_unlock (&mini_arch_mutex) static mono_mutex_t mini_arch_mutex; int mono_exc_esp_offset = 0; @@ -625,13 +625,16 @@ mono_arch_init (void) if (mono_cpu_count () > 1) cpu_hw_caps |= PPC_SMP_CAPABLE; - mono_mutex_init_recursive (&mini_arch_mutex); + mono_os_mutex_init_recursive (&mini_arch_mutex); ss_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ|MONO_MMAP_32BIT); bp_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ|MONO_MMAP_32BIT); mono_mprotect (bp_trigger_page, mono_pagesize (), 0); mono_aot_register_jit_icall ("mono_ppc_throw_exception", mono_ppc_throw_exception); + + // FIXME: Fix partial sharing for power and remove this + mono_set_partial_sharing_supported (FALSE); } /* @@ -640,7 +643,7 @@ mono_arch_init (void) void mono_arch_cleanup (void) { - mono_mutex_destroy (&mini_arch_mutex); + mono_os_mutex_destroy (&mini_arch_mutex); } /* @@ -5969,7 +5972,7 @@ mono_arch_emit_load_got_addr (guint8 *start, guint8 *code, MonoCompile *cfg, Mon * r12. */ guint8* -mono_arch_emit_load_aotconst (guint8 *start, guint8 *code, MonoJumpInfo **ji, int tramp_type, gconstpointer target) +mono_arch_emit_load_aotconst (guint8 *start, guint8 *code, MonoJumpInfo **ji, MonoJumpInfoType tramp_type, gconstpointer target) { /* Load the mscorlib got address */ ppc_ldptr (code, ppc_r12, sizeof (gpointer), ppc_r30); diff --git a/mono/mini/mini-runtime.c b/mono/mini/mini-runtime.c index 3583d587c61..9cf0f042c8f 100644 --- a/mono/mini/mini-runtime.c +++ b/mono/mini/mini-runtime.c @@ -109,8 +109,8 @@ int mini_verbose = 0; */ gboolean mono_use_llvm = FALSE; -#define mono_jit_lock() mono_mutex_lock (&jit_mutex) -#define mono_jit_unlock() mono_mutex_unlock (&jit_mutex) +#define mono_jit_lock() mono_os_mutex_lock (&jit_mutex) +#define mono_jit_unlock() mono_os_mutex_unlock (&jit_mutex) static mono_mutex_t jit_mutex; static MonoCodeManager *global_codeman; @@ -167,7 +167,7 @@ get_method_from_ip (void *ip) if (!domain) domain = mono_get_root_domain (); - ji = mono_jit_info_table_find_internal (domain, ip, TRUE, TRUE); + ji = mono_jit_info_table_find_internal (domain, (char *)ip, TRUE, TRUE); if (!ji) { user_data.ip = ip; user_data.method = NULL; @@ -244,9 +244,9 @@ mono_print_method_from_ip (void *ip) MonoGenericSharingContext*gsctx; const char *shared_type; - ji = mini_jit_info_table_find_ext (domain, ip, TRUE, &target_domain); + ji = mini_jit_info_table_find_ext (domain, (char *)ip, TRUE, &target_domain); if (ji && ji->is_trampoline) { - MonoTrampInfo *tinfo = ji->d.tramp_info; + MonoTrampInfo *tinfo = (MonoTrampInfo *)ji->d.tramp_info; printf ("IP %p is at offset 0x%x of trampoline '%s'.\n", ip, (int)((guint8*)ip - tinfo->code), tinfo->name); return; @@ -437,7 +437,7 @@ mono_create_unwind_op (int when, int tag, int reg, int val) MonoJumpInfoToken * mono_jump_info_token_new2 (MonoMemPool *mp, MonoImage *image, guint32 token, MonoGenericContext *context) { - MonoJumpInfoToken *res = mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoToken)); + MonoJumpInfoToken *res = (MonoJumpInfoToken *)mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoToken)); res->image = image; res->token = token; res->has_context = context != NULL; @@ -488,8 +488,8 @@ register_trampoline_jit_info (MonoDomain *domain, MonoTrampInfo *info) { MonoJitInfo *ji; - ji = mono_domain_alloc0 (domain, mono_jit_info_size (0, 0, 0)); - mono_jit_info_init (ji, NULL, info->code, info->code_size, 0, 0, 0); + ji = (MonoJitInfo *)mono_domain_alloc0 (domain, mono_jit_info_size ((MonoJitInfoFlags)0, 0, 0)); + mono_jit_info_init (ji, NULL, info->code, info->code_size, (MonoJitInfoFlags)0, 0, 0); ji->d.tramp_info = info; ji->is_trampoline = TRUE; @@ -551,7 +551,7 @@ mono_tramp_info_cleanup (void) GSList *l; for (l = tramp_infos; l; l = l->next) { - MonoTrampInfo *info = l->data; + MonoTrampInfo *info = (MonoTrampInfo *)l->data; mono_tramp_info_free (info); } @@ -565,7 +565,7 @@ register_trampolines (MonoDomain *domain) GSList *l; for (l = tramp_infos; l; l = l->next) { - MonoTrampInfo *info = l->data; + MonoTrampInfo *info = (MonoTrampInfo *)l->data; register_trampoline_jit_info (domain, info); } @@ -656,7 +656,7 @@ mono_dynamic_code_hash_lookup (MonoDomain *domain, MonoMethod *method) MonoJitDynamicMethodInfo *res; if (domain_jit_info (domain)->dynamic_code_hash) - res = g_hash_table_lookup (domain_jit_info (domain)->dynamic_code_hash, method); + res = (MonoJitDynamicMethodInfo *)g_hash_table_lookup (domain_jit_info (domain)->dynamic_code_hash, method); else res = NULL; return res; @@ -775,7 +775,7 @@ MonoLMF * mono_get_lmf (void) { #if defined(MONO_HAVE_FAST_TLS) && defined(MONO_ARCH_ENABLE_MONO_LMF_VAR) - return MONO_FAST_TLS_GET (mono_lmf); + return (MonoLMF *)MONO_FAST_TLS_GET (mono_lmf); #else MonoJitTlsData *jit_tls; @@ -794,7 +794,7 @@ MonoLMF ** mono_get_lmf_addr (void) { #ifdef MONO_HAVE_FAST_TLS - return MONO_FAST_TLS_GET (mono_lmf_addr); + return (MonoLMF **)MONO_FAST_TLS_GET (mono_lmf_addr); #else MonoJitTlsData *jit_tls; @@ -833,7 +833,7 @@ mono_set_lmf (MonoLMF *lmf) MonoJitTlsData* mono_get_jit_tls (void) { - return mono_native_tls_get_value (mono_jit_tls_id); + return (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); } static void @@ -941,13 +941,13 @@ setup_jit_tls_data (gpointer stack_start, gpointer abort_func) MonoJitTlsData *jit_tls; MonoLMF *lmf; - jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); if (jit_tls) return jit_tls; jit_tls = g_new0 (MonoJitTlsData, 1); - jit_tls->abort_func = abort_func; + jit_tls->abort_func = (void (*)(MonoObject *))abort_func; jit_tls->end_of_stack = stack_start; mono_set_jit_tls (jit_tls); @@ -1038,7 +1038,7 @@ mini_thread_cleanup (MonoNativeThreadId tid) * The current offender is mono_thread_manage which cleanup threads from the outside. */ if (info && mono_thread_info_get_tid (info) == tid) { - jit_tls = info->jit_data; + jit_tls = (MonoJitTlsData *)info->jit_data; info->jit_data = NULL; mono_set_jit_tls (NULL); @@ -1051,7 +1051,7 @@ mini_thread_cleanup (MonoNativeThreadId tid) } else { info = mono_thread_info_lookup (tid); if (info) { - jit_tls = info->jit_data; + jit_tls = (MonoJitTlsData *)info->jit_data; info->jit_data = NULL; } mono_hazard_pointer_clear (mono_hazard_pointer_get (), 1); @@ -1122,7 +1122,7 @@ mono_patch_info_list_prepend (MonoJumpInfo *list, int ip, MonoJumpInfoType type, MonoJumpInfo* mono_patch_info_dup_mp (MonoMemPool *mp, MonoJumpInfo *patch_info) { - MonoJumpInfo *res = mono_mempool_alloc (mp, sizeof (MonoJumpInfo)); + MonoJumpInfo *res = (MonoJumpInfo *)mono_mempool_alloc (mp, sizeof (MonoJumpInfo)); memcpy (res, patch_info, sizeof (MonoJumpInfo)); switch (patch_info->type) { @@ -1131,27 +1131,27 @@ mono_patch_info_dup_mp (MonoMemPool *mp, MonoJumpInfo *patch_info) case MONO_PATCH_INFO_TYPE_FROM_HANDLE: case MONO_PATCH_INFO_LDTOKEN: case MONO_PATCH_INFO_DECLSEC: - res->data.token = mono_mempool_alloc (mp, sizeof (MonoJumpInfoToken)); + res->data.token = (MonoJumpInfoToken *)mono_mempool_alloc (mp, sizeof (MonoJumpInfoToken)); memcpy (res->data.token, patch_info->data.token, sizeof (MonoJumpInfoToken)); break; case MONO_PATCH_INFO_SWITCH: - res->data.table = mono_mempool_alloc (mp, sizeof (MonoJumpInfoBBTable)); + res->data.table = (MonoJumpInfoBBTable *)mono_mempool_alloc (mp, sizeof (MonoJumpInfoBBTable)); memcpy (res->data.table, patch_info->data.table, sizeof (MonoJumpInfoBBTable)); - res->data.table->table = mono_mempool_alloc (mp, sizeof (MonoBasicBlock*) * patch_info->data.table->table_size); + res->data.table->table = (MonoBasicBlock **)mono_mempool_alloc (mp, sizeof (MonoBasicBlock*) * patch_info->data.table->table_size); memcpy (res->data.table->table, patch_info->data.table->table, sizeof (MonoBasicBlock*) * patch_info->data.table->table_size); break; case MONO_PATCH_INFO_RGCTX_FETCH: case MONO_PATCH_INFO_RGCTX_SLOT_INDEX: - res->data.rgctx_entry = mono_mempool_alloc (mp, sizeof (MonoJumpInfoRgctxEntry)); + res->data.rgctx_entry = (MonoJumpInfoRgctxEntry *)mono_mempool_alloc (mp, sizeof (MonoJumpInfoRgctxEntry)); memcpy (res->data.rgctx_entry, patch_info->data.rgctx_entry, sizeof (MonoJumpInfoRgctxEntry)); res->data.rgctx_entry->data = mono_patch_info_dup_mp (mp, res->data.rgctx_entry->data); break; case MONO_PATCH_INFO_DELEGATE_TRAMPOLINE: - res->data.del_tramp = mono_mempool_alloc0 (mp, sizeof (MonoDelegateClassMethodPair)); + res->data.del_tramp = (MonoDelegateClassMethodPair *)mono_mempool_alloc0 (mp, sizeof (MonoDelegateClassMethodPair)); memcpy (res->data.del_tramp, patch_info->data.del_tramp, sizeof (MonoDelegateClassMethodPair)); break; case MONO_PATCH_INFO_GSHAREDVT_CALL: - res->data.gsharedvt = mono_mempool_alloc (mp, sizeof (MonoJumpInfoGSharedVtCall)); + res->data.gsharedvt = (MonoJumpInfoGSharedVtCall *)mono_mempool_alloc (mp, sizeof (MonoJumpInfoGSharedVtCall)); memcpy (res->data.gsharedvt, patch_info->data.gsharedvt, sizeof (MonoJumpInfoGSharedVtCall)); break; case MONO_PATCH_INFO_GSHAREDVT_METHOD: { @@ -1160,15 +1160,15 @@ mono_patch_info_dup_mp (MonoMemPool *mp, MonoJumpInfo *patch_info) int i; oinfo = patch_info->data.gsharedvt_method; - info = mono_mempool_alloc (mp, sizeof (MonoGSharedVtMethodInfo)); + info = (MonoGSharedVtMethodInfo *)mono_mempool_alloc (mp, sizeof (MonoGSharedVtMethodInfo)); res->data.gsharedvt_method = info; memcpy (info, oinfo, sizeof (MonoGSharedVtMethodInfo)); - info->entries = mono_mempool_alloc (mp, sizeof (MonoRuntimeGenericContextInfoTemplate) * info->count_entries); + info->entries = (MonoRuntimeGenericContextInfoTemplate *)mono_mempool_alloc (mp, sizeof (MonoRuntimeGenericContextInfoTemplate) * info->count_entries); for (i = 0; i < oinfo->num_entries; ++i) { MonoRuntimeGenericContextInfoTemplate *otemplate = &oinfo->entries [i]; - MonoRuntimeGenericContextInfoTemplate *template = &info->entries [i]; + MonoRuntimeGenericContextInfoTemplate *template_ = &info->entries [i]; - memcpy (template, otemplate, sizeof (MonoRuntimeGenericContextInfoTemplate)); + memcpy (template_, otemplate, sizeof (MonoRuntimeGenericContextInfoTemplate)); } //info->locals_types = mono_mempool_alloc0 (mp, info->nlocals * sizeof (MonoType*)); //memcpy (info->locals_types, oinfo->locals_types, info->nlocals * sizeof (MonoType*)); @@ -1179,7 +1179,7 @@ mono_patch_info_dup_mp (MonoMemPool *mp, MonoJumpInfo *patch_info) MonoJumpInfoVirtMethod *oinfo; oinfo = patch_info->data.virt_method; - info = mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoVirtMethod)); + info = (MonoJumpInfoVirtMethod *)mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoVirtMethod)); res->data.virt_method = info; memcpy (info, oinfo, sizeof (MonoJumpInfoVirtMethod)); break; @@ -1445,12 +1445,12 @@ mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code, jump_table = g_malloc0 (sizeof(gpointer) * patch_info->data.table->table_size); #else if (method && method->dynamic) { - jump_table = mono_code_manager_reserve (mono_dynamic_code_hash_lookup (domain, method)->code_mp, sizeof (gpointer) * patch_info->data.table->table_size); + jump_table = (void **)mono_code_manager_reserve (mono_dynamic_code_hash_lookup (domain, method)->code_mp, sizeof (gpointer) * patch_info->data.table->table_size); } else { if (mono_aot_only) { - jump_table = mono_domain_alloc (domain, sizeof (gpointer) * patch_info->data.table->table_size); + jump_table = (void **)mono_domain_alloc (domain, sizeof (gpointer) * patch_info->data.table->table_size); } else { - jump_table = mono_domain_code_reserve (domain, sizeof (gpointer) * patch_info->data.table->table_size); + jump_table = (void **)mono_domain_code_reserve (domain, sizeof (gpointer) * patch_info->data.table->table_size); } } #endif @@ -1560,10 +1560,10 @@ mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code, if (!mono_error_ok (&error)) g_error ("Could not patch ldtoken due to %s", mono_error_get_message (&error)); mono_class_init (handle_class); - mono_class_init (mono_class_from_mono_type (handle)); + mono_class_init (mono_class_from_mono_type ((MonoType *)handle)); target = - mono_type_get_object (domain, handle); + mono_type_get_object (domain, (MonoType *)handle); break; } case MONO_PATCH_INFO_LDTOKEN: { @@ -1642,14 +1642,6 @@ mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code, target = mono_arch_get_seq_point_info (domain, code); break; #endif - case MONO_PATCH_INFO_LLVM_IMT_TRAMPOLINE: -#ifdef MONO_ARCH_LLVM_SUPPORTED - g_assert (mono_use_llvm); - target = mono_create_llvm_imt_trampoline (domain, patch_info->data.imt_tramp->method, patch_info->data.imt_tramp->vt_offset); -#else - g_assert_not_reached (); -#endif - break; case MONO_PATCH_INFO_GC_CARD_TABLE_ADDR: { int card_table_shift_bits; gpointer card_table_mask; @@ -1684,7 +1676,7 @@ mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code, case MONO_PATCH_INFO_TLS_OFFSET: { int offset; - offset = mini_get_tls_offset (GPOINTER_TO_INT (patch_info->data.target)); + offset = mini_get_tls_offset ((MonoTlsKey)GPOINTER_TO_INT (patch_info->data.target)); #ifdef MONO_ARCH_HAVE_TRANSLATE_TLS_OFFSET offset = mono_arch_translate_tls_offset (offset); #endif @@ -1699,8 +1691,8 @@ mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code, int len; char *s; - len = strlen (patch_info->data.target); - s = mono_domain_alloc0 (domain, len + 1); + len = strlen ((const char *)patch_info->data.target); + s = (char *)mono_domain_alloc0 (domain, len + 1); memcpy (s, patch_info->data.target, len); target = s; @@ -1754,10 +1746,10 @@ mini_lookup_method (MonoDomain *domain, MonoMethod *method, MonoMethod *shared) static int failed_lookups = 0; mono_domain_jit_code_hash_lock (domain); - ji = mono_internal_hash_table_lookup (&domain->jit_code_hash, method); + ji = (MonoJitInfo *)mono_internal_hash_table_lookup (&domain->jit_code_hash, method); if (!ji && shared) { /* Try generic sharing */ - ji = mono_internal_hash_table_lookup (&domain->jit_code_hash, shared); + ji = (MonoJitInfo *)mono_internal_hash_table_lookup (&domain->jit_code_hash, shared); if (ji && !ji->has_generic_jit_info) ji = NULL; if (!inited) { @@ -1950,7 +1942,7 @@ mono_jit_compile_method_with_opt (MonoMethod *method, guint32 opt, MonoException /* * SGEN requires the JIT info for these methods to be registered, see is_ip_in_managed_allocator (). */ - ji = mini_jit_info_table_find (mono_domain_get (), code, &d); + ji = mini_jit_info_table_find (mono_domain_get (), (char *)code, &d); g_assert (ji); } @@ -2037,13 +2029,13 @@ mono_jit_free_method (MonoDomain *domain, MonoMethod *method) remove = NULL; for (tmp = jlist->list; tmp; tmp = tmp->next) { - guint8 *ip = tmp->data; + guint8 *ip = (guint8 *)tmp->data; if (ip >= (guint8*)ji->ji->code_start && ip < (guint8*)ji->ji->code_start + ji->ji->code_size) remove = g_slist_prepend (remove, tmp); } for (tmp = remove; tmp; tmp = tmp->next) { - jlist->list = g_slist_delete_link (jlist->list, tmp->data); + jlist->list = g_slist_delete_link ((GSList *)jlist->list, (GSList *)tmp->data); } g_slist_free (remove); } @@ -2170,7 +2162,7 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec domain_info = domain_jit_info (domain); - info = mono_conc_hashtable_lookup (domain_info->runtime_invoke_hash, method); + info = (RuntimeInvokeInfo *)mono_conc_hashtable_lookup (domain_info->runtime_invoke_hash, method); if (!info) { if (mono_security_core_clr_enabled ()) { @@ -2315,7 +2307,7 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec info->runtime_invoke = mono_jit_compile_method (invoke); mono_domain_lock (domain); - info2 = mono_conc_hashtable_insert (domain_info->runtime_invoke_hash, method, info); + info2 = (RuntimeInvokeInfo *)mono_conc_hashtable_insert (domain_info->runtime_invoke_hash, method, info); mono_domain_unlock (domain); if (info2) { g_free (info); @@ -2323,7 +2315,7 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec } } - runtime_invoke = info->runtime_invoke; + runtime_invoke = (MonoObject *(*)(MonoObject *, void **, MonoObject **, void *))info->runtime_invoke; /* * We need this here because mono_marshal_get_runtime_invoke can place @@ -2347,17 +2339,17 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec gpointer *args; static RuntimeInvokeDynamicFunction dyn_runtime_invoke; int i, pindex; - guint8 buf [256]; + guint8 buf [512]; guint8 retval [256]; gpointer rgctx; if (!dyn_runtime_invoke) { invoke = mono_marshal_get_runtime_invoke_dynamic (); - dyn_runtime_invoke = mono_jit_compile_method (invoke); + dyn_runtime_invoke = (RuntimeInvokeDynamicFunction)mono_jit_compile_method (invoke); } /* Convert the arguments to the format expected by start_dyn_call () */ - args = g_alloca ((sig->param_count + sig->hasthis + info->needs_rgctx) * sizeof (gpointer)); + args = (void **)g_alloca ((sig->param_count + sig->hasthis + info->needs_rgctx) * sizeof (gpointer)); pindex = 0; if (sig->hasthis) args [pindex ++] = &obj; @@ -2398,15 +2390,15 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec gpointer *args; int i, pindex; - args = g_alloca ((sig->param_count + sig->hasthis + info->needs_rgctx) * sizeof (gpointer)); + args = (void **)g_alloca ((sig->param_count + sig->hasthis + info->needs_rgctx) * sizeof (gpointer)); pindex = 0; rgctx = mini_method_get_rgctx (method); for (i = 0; i < sig->param_count; ++i) args [pindex ++] = params [i]; args [pindex ++] = &rgctx; - return runtime_invoke (obj, args, exc, info->compiled_method); + return runtime_invoke ((MonoObject *)obj, args, exc, info->compiled_method); } else { - return runtime_invoke (obj, params, exc, info->compiled_method); + return runtime_invoke ((MonoObject *)obj, params, exc, info->compiled_method); } } @@ -2417,7 +2409,7 @@ MONO_SIG_HANDLER_FUNC (, mono_sigfpe_signal_handler) MONO_SIG_HANDLER_INFO_TYPE *info = MONO_SIG_HANDLER_GET_INFO (); MONO_SIG_HANDLER_GET_CONTEXT; - ji = mono_jit_info_table_find_internal (mono_domain_get (), mono_arch_ip_from_context (ctx), TRUE, TRUE); + ji = mono_jit_info_table_find_internal (mono_domain_get (), (char *)mono_arch_ip_from_context (ctx), TRUE, TRUE); #if defined(MONO_ARCH_HAVE_IS_INT_OVERFLOW) if (mono_arch_is_int_overflow (ctx, info)) @@ -2463,7 +2455,7 @@ MONO_SIG_HANDLER_FUNC (, mono_sigill_signal_handler) MONO_SIG_HANDLER_FUNC (, mono_sigsegv_signal_handler) { MonoJitInfo *ji; - MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); gpointer fault_addr = NULL; #ifdef HAVE_SIG_INFO MONO_SIG_HANDLER_INFO_TYPE *info = MONO_SIG_HANDLER_GET_INFO (); @@ -2503,7 +2495,7 @@ MONO_SIG_HANDLER_FUNC (, mono_sigsegv_signal_handler) } #endif - ji = mono_jit_info_table_find_internal (mono_domain_get (), mono_arch_ip_from_context (ctx), TRUE, TRUE); + ji = mono_jit_info_table_find_internal (mono_domain_get (), (char *)mono_arch_ip_from_context (ctx), TRUE, TRUE); #ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK if (mono_handle_soft_stack_ovf (jit_tls, ji, ctx, info, (guint8*)info->si_addr)) @@ -2587,10 +2579,10 @@ mono_jit_create_remoting_trampoline (MonoDomain *domain, MonoMethod *method, Mon if ((method->flags & METHOD_ATTRIBUTE_ABSTRACT) || (mono_method_signature (method)->hasthis && (mono_class_is_marshalbyref (method->klass) || method->klass == mono_defaults.object_class))) { nm = mono_marshal_get_remoting_invoke_for_target (method, target); - addr = mono_compile_method (nm); + addr = (guint8 *)mono_compile_method (nm); } else { - addr = mono_compile_method (method); + addr = (guint8 *)mono_compile_method (method); } return mono_get_addr_from_ftnptr (addr); } @@ -2641,7 +2633,7 @@ mini_get_vtable_trampoline (int slot_index) memcpy (new_table, vtable_trampolines, vtable_trampolines_size * sizeof (gpointer)); g_free (vtable_trampolines); mono_memory_barrier (); - vtable_trampolines = new_table; + vtable_trampolines = (void **)new_table; vtable_trampolines_size = new_size; } mono_jit_unlock (); @@ -2708,10 +2700,10 @@ mono_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *met int ind = (load_imt_reg ? (-offset) : offset) / SIZEOF_VOID_P; sprintf (tramp_name, "delegate_virtual_invoke%s_%d", imt, ind); - cache [idx] = mono_aot_get_trampoline (tramp_name); + cache [idx] = (guint8 *)mono_aot_get_trampoline (tramp_name); g_assert (cache [idx]); } else { - cache [idx] = mono_arch_get_delegate_virtual_invoke_impl (sig, method, offset, load_imt_reg); + cache [idx] = (guint8 *)mono_arch_get_delegate_virtual_invoke_impl (sig, method, offset, load_imt_reg); } return cache [idx]; } @@ -2872,8 +2864,8 @@ static void runtime_invoke_info_free (gpointer value); static gint class_method_pair_equal (gconstpointer ka, gconstpointer kb) { - const MonoClassMethodPair *apair = ka; - const MonoClassMethodPair *bpair = kb; + const MonoClassMethodPair *apair = (const MonoClassMethodPair *)ka; + const MonoClassMethodPair *bpair = (const MonoClassMethodPair *)kb; return apair->klass == bpair->klass && apair->method == bpair->method ? 1 : 0; } @@ -2881,7 +2873,7 @@ class_method_pair_equal (gconstpointer ka, gconstpointer kb) static guint class_method_pair_hash (gconstpointer data) { - const MonoClassMethodPair *pair = data; + const MonoClassMethodPair *pair = (const MonoClassMethodPair *)data; return (gsize)pair->klass ^ (gsize)pair->method; } @@ -2906,21 +2898,21 @@ mini_create_jit_domain_info (MonoDomain *domain) static void delete_jump_list (gpointer key, gpointer value, gpointer user_data) { - MonoJumpList *jlist = value; + MonoJumpList *jlist = (MonoJumpList *)value; g_slist_free (jlist->list); } static void delete_got_slot_list (gpointer key, gpointer value, gpointer user_data) { - GSList *list = value; + GSList *list = (GSList *)value; g_slist_free (list); } static void dynamic_method_info_free (gpointer key, gpointer value, gpointer user_data) { - MonoJitDynamicMethodInfo *di = value; + MonoJitDynamicMethodInfo *di = (MonoJitDynamicMethodInfo *)value; mono_code_manager_destroy (di->code_mp); g_free (di); } @@ -3030,7 +3022,7 @@ mini_init (const char *filename, const char *runtime_version) } #endif - mono_mutex_init_recursive (&jit_mutex); + mono_os_mutex_init_recursive (&jit_mutex); mono_cross_helpers_run (); @@ -3568,7 +3560,7 @@ mini_cleanup (MonoDomain *domain) mono_runtime_cleanup (domain); #endif - free_jit_tls_data (mono_native_tls_get_value (mono_jit_tls_id)); + free_jit_tls_data ((MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id)); mono_icall_cleanup (); @@ -3611,7 +3603,7 @@ mini_cleanup (MonoDomain *domain) mono_native_tls_free (mono_jit_tls_id); - mono_mutex_destroy (&jit_mutex); + mono_os_mutex_destroy (&jit_mutex); mono_code_manager_cleanup (); @@ -3746,8 +3738,8 @@ typedef struct MonoJumpTableChunk { } MonoJumpTableChunk; static MonoJumpTableChunk* g_jumptable; -#define mono_jumptable_lock() mono_mutex_lock (&jumptable_mutex) -#define mono_jumptable_unlock() mono_mutex_unlock (&jumptable_mutex) +#define mono_jumptable_lock() mono_os_mutex_lock (&jumptable_mutex) +#define mono_jumptable_unlock() mono_os_mutex_unlock (&jumptable_mutex) static mono_mutex_t jumptable_mutex; static MonoJumpTableChunk* @@ -3763,7 +3755,7 @@ void mono_jumptable_init (void) { if (g_jumptable == NULL) { - mono_mutex_init_recursive (&jumptable_mutex); + mono_os_mutex_init_recursive (&jumptable_mutex); g_jumptable = mono_create_jumptable_chunk (DEFAULT_JUMPTABLE_CHUNK_ELEMENTS); } } @@ -3819,7 +3811,7 @@ mono_jumptable_cleanup (void) current = prev; } g_jumptable = NULL; - mono_mutex_destroy (&jumptable_mutex); + mono_os_mutex_destroy (&jumptable_mutex); } } diff --git a/mono/mini/mini-s390x.c b/mono/mini/mini-s390x.c index 1c775f80341..8c27ecee488 100644 --- a/mono/mini/mini-s390x.c +++ b/mono/mini/mini-s390x.c @@ -246,8 +246,8 @@ if (ins->inst_target_bb->native_offset) { \ #define JUMP_SIZE 6 #define ENABLE_WRONG_METHOD_CHECK 0 -#define mono_mini_arch_lock() mono_mutex_lock (&mini_arch_mutex) -#define mono_mini_arch_unlock() mono_mutex_unlock (&mini_arch_mutex) +#define mono_mini_arch_lock() mono_os_mutex_lock (&mini_arch_mutex) +#define mono_mini_arch_unlock() mono_os_mutex_unlock (&mini_arch_mutex) /*========================= End of Defines =========================*/ @@ -1310,7 +1310,7 @@ mono_arch_init (void) { guint8 *code; - mono_mutex_init_recursive (&mini_arch_mutex); + mono_os_mutex_init_recursive (&mini_arch_mutex); ss_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ); bp_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ); @@ -1341,7 +1341,7 @@ mono_arch_cleanup (void) mono_vfree (ss_trigger_page, mono_pagesize ()); if (bp_trigger_page) mono_vfree (bp_trigger_page, mono_pagesize ()); - mono_mutex_destroy (&mini_arch_mutex); + mono_os_mutex_destroy (&mini_arch_mutex); } /*========================= End of Function ========================*/ diff --git a/mono/mini/mini-trampolines.c b/mono/mini/mini-trampolines.c index fb6d1f62e1d..b9790e99681 100644 --- a/mono/mini/mini-trampolines.c +++ b/mono/mini/mini-trampolines.c @@ -27,8 +27,8 @@ static GHashTable *rgctx_lazy_fetch_trampoline_hash; static GHashTable *rgctx_lazy_fetch_trampoline_hash_addr; static guint32 trampoline_calls, jit_trampolines, unbox_trampolines, static_rgctx_trampolines; -#define mono_trampolines_lock() mono_mutex_lock (&trampolines_mutex) -#define mono_trampolines_unlock() mono_mutex_unlock (&trampolines_mutex) +#define mono_trampolines_lock() mono_os_mutex_lock (&trampolines_mutex) +#define mono_trampolines_unlock() mono_os_mutex_unlock (&trampolines_mutex) static mono_mutex_t trampolines_mutex; #ifdef MONO_ARCH_GSHARED_SUPPORTED @@ -41,8 +41,8 @@ typedef struct { static gint rgctx_tramp_info_equal (gconstpointer ka, gconstpointer kb) { - const RgctxTrampInfo *i1 = ka; - const RgctxTrampInfo *i2 = kb; + const RgctxTrampInfo *i1 = (const RgctxTrampInfo *)ka; + const RgctxTrampInfo *i2 = (const RgctxTrampInfo *)kb; if (i1->m == i2->m && i1->addr == i2->addr) return 1; @@ -53,7 +53,7 @@ rgctx_tramp_info_equal (gconstpointer ka, gconstpointer kb) static guint rgctx_tramp_info_hash (gconstpointer data) { - const RgctxTrampInfo *info = data; + const RgctxTrampInfo *info = (const RgctxTrampInfo *)data; return GPOINTER_TO_UINT (info->m) ^ GPOINTER_TO_UINT (info->addr); } @@ -112,11 +112,11 @@ mono_create_static_rgctx_trampoline (MonoMethod *m, gpointer addr) if (mono_aot_only) res = mono_aot_get_static_rgctx_trampoline (ctx, addr); else - res = mono_arch_get_static_rgctx_trampoline (m, ctx, addr); + res = mono_arch_get_static_rgctx_trampoline (m, (MonoMethodRuntimeGenericContext *)ctx, addr); mono_domain_lock (domain); /* Duplicates inserted while we didn't hold the lock are OK */ - info = mono_domain_alloc (domain, sizeof (RgctxTrampInfo)); + info = (RgctxTrampInfo *)mono_domain_alloc (domain, sizeof (RgctxTrampInfo)); info->m = m; info->addr = addr; g_hash_table_insert (domain_jit_info (domain)->static_rgctx_trampoline_hash, info, res); @@ -167,7 +167,7 @@ mini_resolve_imt_method (MonoVTable *vt, gpointer *vtable_slot, MonoMethod *imt_ /* This has to be variance aware since imt_method can be from an interface that vt->klass doesn't directly implement */ interface_offset = mono_class_interface_offset_with_variance (vt->klass, imt_method->klass, &variance_used); if (interface_offset < 0) - g_error ("%s doesn't implement interface %s\n", mono_type_get_name_full (&vt->klass->byval_arg, 0), mono_type_get_name_full (&imt_method->klass->byval_arg, 0)); + g_error ("%s doesn't implement interface %s\n", mono_type_get_name_full (&vt->klass->byval_arg, MONO_TYPE_NAME_FORMAT_IL), mono_type_get_name_full (&imt_method->klass->byval_arg, MONO_TYPE_NAME_FORMAT_IL)); *variant_iface = NULL; if (imt_method->is_inflated && ((MonoMethodInflated*)imt_method)->context.method_inst) { @@ -203,7 +203,7 @@ mini_resolve_imt_method (MonoVTable *vt, gpointer *vtable_slot, MonoMethod *imt_ } else { /* Avoid loading metadata or creating a generic vtable if possible */ if (lookup_aot && !vt->klass->valuetype) - aot_addr = mono_aot_get_method_from_vt_slot (mono_domain_get (), vt, interface_offset + mono_method_get_vtable_slot (imt_method)); + aot_addr = (guint8 *)mono_aot_get_method_from_vt_slot (mono_domain_get (), vt, interface_offset + mono_method_get_vtable_slot (imt_method)); else aot_addr = NULL; if (aot_addr) @@ -298,7 +298,7 @@ mini_add_method_trampoline (MonoMethod *m, gpointer compiled_method, gboolean ad MonoJitInfo *ji; // FIXME: This loads information from AOT (perf problem) - ji = mini_jit_info_table_find (mono_domain_get (), mono_get_addr_from_ftnptr (compiled_method), NULL); + ji = mini_jit_info_table_find (mono_domain_get (), (char *)mono_get_addr_from_ftnptr (compiled_method), NULL); callee_gsharedvt = mini_jit_info_is_gsharedvt (ji); callee_array_helper = FALSE; @@ -391,18 +391,18 @@ common_call_trampoline_inner (mgreg_t *regs, guint8 *code, MonoMethod *m, MonoVT MonoMethod *declaring = NULL; MonoMethod *generic_virtual = NULL, *variant_iface = NULL; int context_used; - gboolean imt_call, virtual; + gboolean imt_call, virtual_; gpointer *orig_vtable_slot, *vtable_slot_to_patch = NULL; MonoJitInfo *ji = NULL; - virtual = vt && (gpointer)vtable_slot > (gpointer)vt; + virtual_ = vt && (gpointer)vtable_slot > (gpointer)vt; imt_call = vt && (gpointer)vtable_slot < (gpointer)vt; /* * rgctx trampolines are needed when the call is indirect so the caller can't pass * the rgctx argument needed by the callee. */ - if (virtual && m) + if (virtual_ && m) need_rgctx_tramp = mono_method_needs_static_rgctx_invoke (m, FALSE); orig_vtable_slot = vtable_slot; @@ -416,7 +416,7 @@ common_call_trampoline_inner (mgreg_t *regs, guint8 *code, MonoMethod *m, MonoVT g_assert (vtable_slot); imt_method = mono_arch_find_imt_method (regs, code); - this_arg = mono_arch_get_this_arg_from_call (regs, code); + this_arg = (MonoObject *)mono_arch_get_this_arg_from_call (regs, code); if (mono_object_is_transparent_proxy (this_arg)) { /* Use the slow path for now */ @@ -451,7 +451,7 @@ common_call_trampoline_inner (mgreg_t *regs, guint8 *code, MonoMethod *m, MonoVT * The virtual check is needed because is_generic_method_definition (m) could * return TRUE for methods used in IMT calls too. */ - if (virtual && is_generic_method_definition (m)) { + if (virtual_ && is_generic_method_definition (m)) { MonoError error; MonoGenericContext context = { NULL, NULL }; MonoMethod *declaring; @@ -499,7 +499,7 @@ common_call_trampoline_inner (mgreg_t *regs, guint8 *code, MonoMethod *m, MonoVT klass = vtable->klass; } else { - MonoObject *this_argument = mono_arch_get_this_arg_from_call (regs, code); + MonoObject *this_argument = (MonoObject *)mono_arch_get_this_arg_from_call (regs, code); vt = this_argument->vtable; vtable_slot = orig_vtable_slot; @@ -605,10 +605,10 @@ common_call_trampoline_inner (mgreg_t *regs, guint8 *code, MonoMethod *m, MonoVT GSList *list, *tmp; mono_domain_lock (domain); - list = g_hash_table_lookup (domain_jit_info (domain)->jump_target_got_slot_hash, m); + list = (GSList *)g_hash_table_lookup (domain_jit_info (domain)->jump_target_got_slot_hash, m); if (list) { for (tmp = list; tmp; tmp = tmp->next) { - gpointer *got_slot = tmp->data; + gpointer *got_slot = (gpointer *)tmp->data; *got_slot = addr; } g_hash_table_remove (domain_jit_info (domain)->jump_target_got_slot_hash, m); @@ -635,7 +635,7 @@ common_call_trampoline_inner (mgreg_t *regs, guint8 *code, MonoMethod *m, MonoVT if (plt_entry) { if (generic_shared) { target_ji = - mini_jit_info_table_find (mono_domain_get (), mono_get_addr_from_ftnptr (compiled_method), NULL); + mini_jit_info_table_find (mono_domain_get (), (char *)mono_get_addr_from_ftnptr (compiled_method), NULL); if (!ji) ji = mini_jit_info_table_find (mono_domain_get (), (char*)code, NULL); @@ -644,7 +644,7 @@ common_call_trampoline_inner (mgreg_t *regs, guint8 *code, MonoMethod *m, MonoVT } } if (!no_patch) - mono_aot_patch_plt_entry (code, plt_entry, NULL, regs, addr); + mono_aot_patch_plt_entry (code, plt_entry, NULL, regs, (guint8 *)addr); } else { if (generic_shared) { if (m->wrapper_type != MONO_WRAPPER_NONE) @@ -654,7 +654,7 @@ common_call_trampoline_inner (mgreg_t *regs, guint8 *code, MonoMethod *m, MonoVT /* Patch calling code */ target_ji = - mini_jit_info_table_find (mono_domain_get (), mono_get_addr_from_ftnptr (compiled_method), NULL); + mini_jit_info_table_find (mono_domain_get (), (char *)mono_get_addr_from_ftnptr (compiled_method), NULL); if (!ji) ji = mini_jit_info_table_find (mono_domain_get (), (char*)code, NULL); @@ -668,7 +668,7 @@ common_call_trampoline_inner (mgreg_t *regs, guint8 *code, MonoMethod *m, MonoVT } if (!no_patch && mono_method_same_domain (ji, target_ji)) - mono_arch_patch_callsite (ji->code_start, code, addr); + mono_arch_patch_callsite ((guint8 *)ji->code_start, code, (guint8 *)addr); } } @@ -695,7 +695,7 @@ mono_magic_trampoline (mgreg_t *regs, guint8 *code, gpointer arg, guint8* tramp) { trampoline_calls ++; - return common_call_trampoline (regs, code, arg, NULL, NULL); + return common_call_trampoline (regs, code, (MonoMethod *)arg, NULL, NULL); } /** @@ -725,7 +725,7 @@ mono_vcall_trampoline (mgreg_t *regs, guint8 *code, int slot, guint8 *tramp) /* * Obtain the vtable from the 'this' arg. */ - this_arg = mono_arch_get_this_arg_from_call (regs, code); + this_arg = (MonoObject *)mono_arch_get_this_arg_from_call (regs, code); g_assert (this_arg); vt = this_arg->vtable; @@ -823,7 +823,7 @@ mono_aot_trampoline (mgreg_t *regs, guint8 *code, guint8 *token_info, trampoline_calls ++; - image = *(gpointer*)(gpointer)token_info; + image = (MonoImage *)*(gpointer*)(gpointer)token_info; token_info += sizeof (gpointer); token = *(guint32*)(gpointer)token_info; @@ -842,7 +842,7 @@ mono_aot_trampoline (mgreg_t *regs, guint8 *code, guint8 *token_info, plt_entry = mono_aot_get_plt_entry (code); g_assert (plt_entry); - mono_aot_patch_plt_entry (code, plt_entry, NULL, regs, addr); + mono_aot_patch_plt_entry (code, plt_entry, NULL, regs, (guint8 *)addr); return addr; } @@ -894,9 +894,9 @@ mono_rgctx_lazy_fetch_trampoline (mgreg_t *regs, guint8 *code, gpointer data, gu num_lookups++; if (mrgctx) - return mono_method_fill_runtime_generic_context (arg, index); + return mono_method_fill_runtime_generic_context ((MonoMethodRuntimeGenericContext *)arg, index); else - return mono_class_fill_runtime_generic_context (arg, index); + return mono_class_fill_runtime_generic_context ((MonoVTable *)arg, index); } /* @@ -914,7 +914,7 @@ create_delegate_trampoline_data (MonoDomain *domain, MonoClass *klass, MonoMetho invoke = mono_get_delegate_invoke (klass); g_assert (invoke); - tramp_data = mono_domain_alloc0 (domain, sizeof (MonoDelegateTrampInfo)); + tramp_data = (MonoDelegateTrampInfo *)mono_domain_alloc0 (domain, sizeof (MonoDelegateTrampInfo)); tramp_data->invoke = invoke; tramp_data->invoke_sig = mono_method_signature (invoke); tramp_data->impl_this = mono_arch_get_delegate_invoke_impl (mono_method_signature (invoke), TRUE); @@ -949,8 +949,8 @@ mono_delegate_trampoline (mgreg_t *regs, guint8 *code, gpointer *arg, guint8* tr gboolean enable_caching = TRUE; MonoDelegateTrampInfo *tramp_info = (MonoDelegateTrampInfo*)arg; MonoMethod *invoke = tramp_info->invoke; - guint8 *impl_this = tramp_info->impl_this; - guint8 *impl_nothis = tramp_info->impl_nothis; + guint8 *impl_this = (guint8 *)tramp_info->impl_this; + guint8 *impl_nothis = (guint8 *)tramp_info->impl_nothis; MonoError err; MonoMethodSignature *sig; gpointer addr, compiled_method; @@ -959,7 +959,7 @@ mono_delegate_trampoline (mgreg_t *regs, guint8 *code, gpointer *arg, guint8* tr trampoline_calls ++; /* Obtain the delegate object according to the calling convention */ - delegate = mono_arch_get_this_arg_from_call (regs, code); + delegate = (MonoDelegate *)mono_arch_get_this_arg_from_call (regs, code); g_assert (mono_class_has_parent (mono_object_class (delegate), mono_defaults.multicastdelegate_class)); if (delegate->method) { @@ -1009,7 +1009,7 @@ mono_delegate_trampoline (mgreg_t *regs, guint8 *code, gpointer *arg, guint8* tr // ftnptrs are being used. "method" would end up null on archtitectures without // ftnptrs so we can just skip this. } else if (delegate->method_ptr) { - ji = mono_jit_info_table_find (domain, mono_get_addr_from_ftnptr (delegate->method_ptr)); + ji = mono_jit_info_table_find (domain, (char *)mono_get_addr_from_ftnptr (delegate->method_ptr)); if (ji) method = jinfo_get_method (ji); } @@ -1073,7 +1073,7 @@ mono_delegate_trampoline (mgreg_t *regs, guint8 *code, gpointer *arg, guint8* tr addr = mini_add_method_trampoline (method, compiled_method, need_rgctx_tramp, need_unbox_tramp); delegate->method_ptr = addr; if (enable_caching && delegate->method_code) - *delegate->method_code = delegate->method_ptr; + *delegate->method_code = (guint8 *)delegate->method_ptr; } } else { if (need_rgctx_tramp) @@ -1095,8 +1095,8 @@ mono_delegate_trampoline (mgreg_t *regs, guint8 *code, gpointer *arg, guint8* tr if (!code) { /* The general, unoptimized case */ m = mono_marshal_get_delegate_invoke (invoke, delegate); - code = mono_compile_method (m); - code = mini_add_method_trampoline (m, code, mono_method_needs_static_rgctx_invoke (m, FALSE), FALSE); + code = (guint8 *)mono_compile_method (m); + code = (guint8 *)mini_add_method_trampoline (m, code, mono_method_needs_static_rgctx_invoke (m, FALSE), FALSE); } delegate->invoke_impl = mono_get_addr_from_ftnptr (code); @@ -1114,7 +1114,7 @@ mono_handler_block_guard_trampoline (mgreg_t *regs, guint8 *code, gpointer *tram { MonoContext ctx; MonoException *exc; - MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); gpointer resume_ip = jit_tls->handler_block_return_address; memcpy (&ctx, &jit_tls->handler_block_context, sizeof (MonoContext)); @@ -1129,7 +1129,7 @@ mono_handler_block_guard_trampoline (mgreg_t *regs, guint8 *code, gpointer *tram exc = mono_thread_resume_interruption (); if (exc) { - mono_handle_exception (&ctx, exc); + mono_handle_exception (&ctx, (MonoObject *)exc); mono_restore_context (&ctx); } @@ -1220,7 +1220,7 @@ create_trampoline_code (MonoTrampolineType tramp_type) void mono_trampolines_init (void) { - mono_mutex_init_recursive (&trampolines_mutex); + mono_os_mutex_init_recursive (&trampolines_mutex); if (mono_aot_only) return; @@ -1257,7 +1257,7 @@ mono_trampolines_cleanup (void) if (rgctx_lazy_fetch_trampoline_hash_addr) g_hash_table_destroy (rgctx_lazy_fetch_trampoline_hash_addr); - mono_mutex_destroy (&trampolines_mutex); + mono_os_mutex_destroy (&trampolines_mutex); } guint8 * @@ -1306,7 +1306,7 @@ mono_create_jump_trampoline (MonoDomain *domain, MonoMethod *method, gboolean ad code = mono_create_specific_trampoline (method, MONO_TRAMPOLINE_JUMP, mono_domain_get (), &code_size); g_assert (code_size); - ji = mono_domain_alloc0 (domain, MONO_SIZEOF_JIT_INFO); + ji = (MonoJitInfo *)mono_domain_alloc0 (domain, MONO_SIZEOF_JIT_INFO); ji->code_start = code; ji->code_size = code_size; ji->d.method = method; @@ -1383,7 +1383,7 @@ mono_create_jit_trampoline_from_token (MonoImage *image, guint32 token) MonoDomain *domain = mono_domain_get (); guint8 *buf, *start; - buf = start = mono_domain_alloc0 (domain, 2 * sizeof (gpointer)); + buf = start = (guint8 *)mono_domain_alloc0 (domain, 2 * sizeof (gpointer)); *(gpointer*)(gpointer)buf = image; buf += sizeof (gpointer); @@ -1412,7 +1412,7 @@ mono_create_delegate_trampoline_info (MonoDomain *domain, MonoClass *klass, Mono pair.klass = klass; pair.method = method; mono_domain_lock (domain); - tramp_info = g_hash_table_lookup (domain_jit_info (domain)->delegate_trampoline_hash, &pair); + tramp_info = (MonoDelegateTrampInfo *)g_hash_table_lookup (domain_jit_info (domain)->delegate_trampoline_hash, &pair); mono_domain_unlock (domain); if (tramp_info) return tramp_info; @@ -1422,7 +1422,7 @@ mono_create_delegate_trampoline_info (MonoDomain *domain, MonoClass *klass, Mono tramp_info->invoke_impl = mono_create_specific_trampoline (tramp_info, MONO_TRAMPOLINE_DELEGATE, domain, &code_size); g_assert (code_size); - dpair = mono_domain_alloc0 (domain, sizeof (MonoClassMethodPair)); + dpair = (MonoClassMethodPair *)mono_domain_alloc0 (domain, sizeof (MonoClassMethodPair)); memcpy (dpair, &pair, sizeof (MonoClassMethodPair)); /* store trampoline address */ @@ -1502,26 +1502,6 @@ mono_create_rgctx_lazy_fetch_trampoline (guint32 offset) return ptr; } - -#ifdef MONO_ARCH_LLVM_SUPPORTED -/* - * mono_create_llvm_imt_trampoline: - * - * LLVM compiled code can't pass in the IMT argument, so we use this trampoline, which - * sets the IMT argument, then branches to the contents of the vtable slot given by - * vt_offset in the vtable which is obtained from the argument list. - */ -gpointer -mono_create_llvm_imt_trampoline (MonoDomain *domain, MonoMethod *m, int vt_offset) -{ -#ifdef MONO_ARCH_HAVE_LLVM_IMT_TRAMPOLINE - return mono_arch_get_llvm_imt_trampoline (domain, m, vt_offset); -#else - g_assert_not_reached (); - return NULL; -#endif -} -#endif guint32 mono_find_rgctx_lazy_fetch_trampoline_by_addr (gconstpointer addr) diff --git a/mono/mini/mini-x86.c b/mono/mini/mini-x86.c index a837d0d74dc..a74765570f7 100644 --- a/mono/mini/mini-x86.c +++ b/mono/mini/mini-x86.c @@ -52,8 +52,8 @@ static gpointer ss_trampoline; static gpointer bp_trampoline; /* This mutex protects architecture specific caches */ -#define mono_mini_arch_lock() mono_mutex_lock (&mini_arch_mutex) -#define mono_mini_arch_unlock() mono_mutex_unlock (&mini_arch_mutex) +#define mono_mini_arch_lock() mono_os_mutex_lock (&mini_arch_mutex) +#define mono_mini_arch_unlock() mono_os_mutex_unlock (&mini_arch_mutex) static mono_mutex_t mini_arch_mutex; #define ALIGN_TO(val,align) ((((guint64)val) + ((align) - 1)) & ~((align) - 1)) @@ -754,7 +754,7 @@ mono_arch_cpu_init (void) void mono_arch_init (void) { - mono_mutex_init_recursive (&mini_arch_mutex); + mono_os_mutex_init_recursive (&mini_arch_mutex); if (!mono_aot_only) bp_trampoline = mini_get_breakpoint_trampoline (); @@ -772,7 +772,7 @@ mono_arch_init (void) void mono_arch_cleanup (void) { - mono_mutex_destroy (&mini_arch_mutex); + mono_os_mutex_destroy (&mini_arch_mutex); } /* @@ -6652,7 +6652,7 @@ emit_load_aotconst (guint8 *start, guint8 *code, MonoCompile *cfg, MonoJumpInfo * EAX. */ guint8* -mono_arch_emit_load_aotconst (guint8 *start, guint8 *code, MonoJumpInfo **ji, int tramp_type, gconstpointer target) +mono_arch_emit_load_aotconst (guint8 *start, guint8 *code, MonoJumpInfo **ji, MonoJumpInfoType tramp_type, gconstpointer target) { /* Load the mscorlib got address */ x86_mov_reg_membase (code, X86_EAX, MONO_ARCH_GOT_REG, sizeof (gpointer), 4); diff --git a/mono/mini/mini-x86.h b/mono/mini/mini-x86.h index 0547b2c807e..212f844af4c 100644 --- a/mono/mini/mini-x86.h +++ b/mono/mini/mini-x86.h @@ -234,7 +234,6 @@ typedef struct { #define MONO_ARCH_AOT_SUPPORTED 1 #define MONO_ARCH_GSHARED_SUPPORTED 1 -#define MONO_ARCH_HAVE_LLVM_IMT_TRAMPOLINE 1 #define MONO_ARCH_LLVM_SUPPORTED 1 #define MONO_ARCH_SOFT_DEBUG_SUPPORTED 1 diff --git a/mono/mini/mini.c b/mono/mini/mini.c index 4bc45b46f32..89ae9d56a9d 100644 --- a/mono/mini/mini.c +++ b/mono/mini/mini.c @@ -83,8 +83,8 @@ int mono_break_at_bb_bb_num; gboolean mono_do_x86_stack_align = TRUE; gboolean mono_using_xdebug; -#define mono_jit_lock() mono_mutex_lock (&jit_mutex) -#define mono_jit_unlock() mono_mutex_unlock (&jit_mutex) +#define mono_jit_lock() mono_os_mutex_lock (&jit_mutex) +#define mono_jit_unlock() mono_os_mutex_unlock (&jit_mutex) static mono_mutex_t jit_mutex; MonoBackend *current_backend; @@ -214,8 +214,8 @@ typedef struct MonoJumpTableChunk { } MonoJumpTableChunk; static MonoJumpTableChunk* g_jumptable; -#define mono_jumptable_lock() mono_mutex_lock (&jumptable_mutex) -#define mono_jumptable_unlock() mono_mutex_unlock (&jumptable_mutex) +#define mono_jumptable_lock() mono_os_mutex_lock (&jumptable_mutex) +#define mono_jumptable_unlock() mono_os_mutex_unlock (&jumptable_mutex) static mono_mutex_t jumptable_mutex; static MonoJumpTableChunk* @@ -231,7 +231,7 @@ void mono_jumptable_init (void) { if (g_jumptable == NULL) { - mono_mutex_init_recursive (&jumptable_mutex); + mono_os_mutex_init_recursive (&jumptable_mutex); g_jumptable = mono_create_jumptable_chunk (DEFAULT_JUMPTABLE_CHUNK_ELEMENTS); } } @@ -287,7 +287,7 @@ mono_jumptable_cleanup (void) current = prev; } g_jumptable = NULL; - mono_mutex_destroy (&jumptable_mutex); + mono_os_mutex_destroy (&jumptable_mutex); } } @@ -314,7 +314,7 @@ typedef struct { void mono_emit_unwind_op (MonoCompile *cfg, int when, int tag, int reg, int val) { - MonoUnwindOp *op = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoUnwindOp)); + MonoUnwindOp *op = (MonoUnwindOp *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoUnwindOp)); op->op = tag; op->reg = reg; @@ -465,7 +465,7 @@ mono_find_spvar_for_region (MonoCompile *cfg, int region) { region = mono_get_block_region_notry (cfg, region); - return g_hash_table_lookup (cfg->spvars, GINT_TO_POINTER (region)); + return (MonoInst *)g_hash_table_lookup (cfg->spvars, GINT_TO_POINTER (region)); } static void @@ -787,7 +787,7 @@ set_vreg_to_inst (MonoCompile *cfg, int vreg, MonoInst *inst) while (vreg >= cfg->vreg_to_inst_len) cfg->vreg_to_inst_len = cfg->vreg_to_inst_len ? cfg->vreg_to_inst_len * 2 : 32; - cfg->vreg_to_inst = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst*) * cfg->vreg_to_inst_len); + cfg->vreg_to_inst = (MonoInst **)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst*) * cfg->vreg_to_inst_len); if (size) memcpy (cfg->vreg_to_inst, tmp, size * sizeof (MonoInst*)); } @@ -949,7 +949,7 @@ mono_mark_vreg_as_ref (MonoCompile *cfg, int vreg) while (vreg >= cfg->vreg_is_ref_len) cfg->vreg_is_ref_len = cfg->vreg_is_ref_len ? cfg->vreg_is_ref_len * 2 : 32; - cfg->vreg_is_ref = mono_mempool_alloc0 (cfg->mempool, sizeof (gboolean) * cfg->vreg_is_ref_len); + cfg->vreg_is_ref = (gboolean *)mono_mempool_alloc0 (cfg->mempool, sizeof (gboolean) * cfg->vreg_is_ref_len); if (size) memcpy (cfg->vreg_is_ref, tmp, size * sizeof (gboolean)); } @@ -965,7 +965,7 @@ mono_mark_vreg_as_mp (MonoCompile *cfg, int vreg) while (vreg >= cfg->vreg_is_mp_len) cfg->vreg_is_mp_len = cfg->vreg_is_mp_len ? cfg->vreg_is_mp_len * 2 : 32; - cfg->vreg_is_mp = mono_mempool_alloc0 (cfg->mempool, sizeof (gboolean) * cfg->vreg_is_mp_len); + cfg->vreg_is_mp = (gboolean *)mono_mempool_alloc0 (cfg->mempool, sizeof (gboolean) * cfg->vreg_is_mp_len); if (size) memcpy (cfg->vreg_is_mp, tmp, size * sizeof (gboolean)); } @@ -1079,10 +1079,10 @@ mono_add_ins_to_end (MonoBasicBlock *bb, MonoInst *inst) void mono_create_jump_table (MonoCompile *cfg, MonoInst *label, MonoBasicBlock **bbs, int num_blocks) { - MonoJumpInfo *ji = mono_mempool_alloc (cfg->mempool, sizeof (MonoJumpInfo)); + MonoJumpInfo *ji = (MonoJumpInfo *)mono_mempool_alloc (cfg->mempool, sizeof (MonoJumpInfo)); MonoJumpInfoBBTable *table; - table = mono_mempool_alloc (cfg->mempool, sizeof (MonoJumpInfoBBTable)); + table = (MonoJumpInfoBBTable *)mono_mempool_alloc (cfg->mempool, sizeof (MonoJumpInfoBBTable)); table->table = bbs; table->table_size = num_blocks; @@ -1104,7 +1104,7 @@ mono_get_array_new_va_signature (int arity) if (!sighash) { sighash = g_hash_table_new (NULL, NULL); } - else if ((res = g_hash_table_lookup (sighash, GINT_TO_POINTER (arity)))) { + else if ((res = (MonoMethodSignature *)g_hash_table_lookup (sighash, GINT_TO_POINTER (arity)))) { mono_jit_unlock (); return res; } @@ -1269,7 +1269,7 @@ mono_dynamic_code_hash_lookup (MonoDomain *domain, MonoMethod *method) MonoJitDynamicMethodInfo *res; if (domain_jit_info (domain)->dynamic_code_hash) - res = g_hash_table_lookup (domain_jit_info (domain)->dynamic_code_hash, method); + res = (MonoJitDynamicMethodInfo *)g_hash_table_lookup (domain_jit_info (domain)->dynamic_code_hash, method); else res = NULL; return res; @@ -1319,11 +1319,11 @@ mono_allocate_stack_slots2 (MonoCompile *cfg, gboolean backward, guint32 *stack_ LSCAN_DEBUG (printf ("Allocate Stack Slots 2 for %s:\n", mono_method_full_name (cfg->method, TRUE))); - scalar_stack_slots = mono_mempool_alloc0 (cfg->mempool, sizeof (StackSlotInfo) * MONO_TYPE_PINNED); + scalar_stack_slots = (StackSlotInfo *)mono_mempool_alloc0 (cfg->mempool, sizeof (StackSlotInfo) * MONO_TYPE_PINNED); vtype_stack_slots = NULL; nvtypes = 0; - offsets = mono_mempool_alloc (cfg->mempool, sizeof (gint32) * cfg->num_varinfo); + offsets = (gint32 *)mono_mempool_alloc (cfg->mempool, sizeof (gint32) * cfg->num_varinfo); for (i = 0; i < cfg->num_varinfo; ++i) offsets [i] = -1; @@ -1355,7 +1355,7 @@ mono_allocate_stack_slots2 (MonoCompile *cfg, gboolean backward, guint32 *stack_ offset = 0; *stack_align = 0; for (unhandled = vars; unhandled; unhandled = unhandled->next) { - MonoMethodVar *current = unhandled->data; + MonoMethodVar *current = (MonoMethodVar *)unhandled->data; vmv = current; inst = cfg->varinfo [vmv->idx]; @@ -1393,7 +1393,7 @@ mono_allocate_stack_slots2 (MonoCompile *cfg, gboolean backward, guint32 *stack_ /* Fall through */ case MONO_TYPE_VALUETYPE: if (!vtype_stack_slots) - vtype_stack_slots = mono_mempool_alloc0 (cfg->mempool, sizeof (StackSlotInfo) * 256); + vtype_stack_slots = (StackSlotInfo *)mono_mempool_alloc0 (cfg->mempool, sizeof (StackSlotInfo) * 256); for (i = 0; i < nvtypes; ++i) if (t->data.klass == vtype_stack_slots [i].vtype) break; @@ -1632,11 +1632,11 @@ mono_allocate_stack_slots (MonoCompile *cfg, gboolean backward, guint32 *stack_s if ((cfg->num_varinfo > 0) && MONO_VARINFO (cfg, 0)->interval) return mono_allocate_stack_slots2 (cfg, backward, stack_size, stack_align); - scalar_stack_slots = mono_mempool_alloc0 (cfg->mempool, sizeof (StackSlotInfo) * MONO_TYPE_PINNED); + scalar_stack_slots = (StackSlotInfo *)mono_mempool_alloc0 (cfg->mempool, sizeof (StackSlotInfo) * MONO_TYPE_PINNED); vtype_stack_slots = NULL; nvtypes = 0; - offsets = mono_mempool_alloc (cfg->mempool, sizeof (gint32) * cfg->num_varinfo); + offsets = (gint32 *)mono_mempool_alloc (cfg->mempool, sizeof (gint32) * cfg->num_varinfo); for (i = 0; i < cfg->num_varinfo; ++i) offsets [i] = -1; @@ -1654,7 +1654,7 @@ mono_allocate_stack_slots (MonoCompile *cfg, gboolean backward, guint32 *stack_s offset = 0; *stack_align = sizeof(mgreg_t); for (l = vars; l; l = l->next) { - vmv = l->data; + vmv = (MonoMethodVar *)l->data; inst = cfg->varinfo [vmv->idx]; t = mono_type_get_underlying_type (inst->inst_vtype); @@ -1692,7 +1692,7 @@ mono_allocate_stack_slots (MonoCompile *cfg, gboolean backward, guint32 *stack_s /* Fall through */ case MONO_TYPE_VALUETYPE: if (!vtype_stack_slots) - vtype_stack_slots = mono_mempool_alloc0 (cfg->mempool, sizeof (StackSlotInfo) * 256); + vtype_stack_slots = (StackSlotInfo *)mono_mempool_alloc0 (cfg->mempool, sizeof (StackSlotInfo) * 256); for (i = 0; i < nvtypes; ++i) if (t->data.klass == vtype_stack_slots [i].vtype) break; @@ -1893,8 +1893,8 @@ mini_register_opcode_emulation (int opcode, const char *name, const char *sigstr if (emul_opcode_num >= emul_opcode_alloced) { int incr = emul_opcode_alloced? emul_opcode_alloced/2: 16; emul_opcode_alloced += incr; - emul_opcode_map = g_realloc (emul_opcode_map, sizeof (emul_opcode_map [0]) * emul_opcode_alloced); - emul_opcode_opcodes = g_realloc (emul_opcode_opcodes, sizeof (emul_opcode_opcodes [0]) * emul_opcode_alloced); + emul_opcode_map = (MonoJitICallInfo **)g_realloc (emul_opcode_map, sizeof (emul_opcode_map [0]) * emul_opcode_alloced); + emul_opcode_opcodes = (short *)g_realloc (emul_opcode_opcodes, sizeof (emul_opcode_opcodes [0]) * emul_opcode_alloced); } emul_opcode_map [emul_opcode_num] = info; emul_opcode_opcodes [emul_opcode_num] = opcode; @@ -2070,7 +2070,7 @@ mono_destroy_compile (MonoCompile *cfg) if (cfg->exvars) g_hash_table_destroy (cfg->exvars); for (l = cfg->headers_to_free; l; l = l->next) - mono_metadata_free_mh (l->data); + mono_metadata_free_mh ((MonoMethodHeader *)l->data); g_list_free (cfg->ldstr_list); g_hash_table_destroy (cfg->token_info_hash); if (cfg->abs_patches) @@ -2174,7 +2174,7 @@ mono_get_lmf_addr_intrinsic (MonoCompile* cfg) void mono_add_patch_info (MonoCompile *cfg, int ip, MonoJumpInfoType type, gconstpointer target) { - MonoJumpInfo *ji = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoJumpInfo)); + MonoJumpInfo *ji = (MonoJumpInfo *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoJumpInfo)); ji->ip.i = ip; ji->type = type; @@ -2187,7 +2187,7 @@ mono_add_patch_info (MonoCompile *cfg, int ip, MonoJumpInfoType type, gconstpoin void mono_add_patch_info_rel (MonoCompile *cfg, int ip, MonoJumpInfoType type, gconstpointer target, int relocation) { - MonoJumpInfo *ji = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoJumpInfo)); + MonoJumpInfo *ji = (MonoJumpInfo *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoJumpInfo)); ji->ip.i = ip; ji->type = type; @@ -2225,7 +2225,7 @@ mono_add_seq_point (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins, int nat void mono_add_var_location (MonoCompile *cfg, MonoInst *var, gboolean is_reg, int reg, int offset, int from, int to) { - MonoDwarfLocListEntry *entry = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoDwarfLocListEntry)); + MonoDwarfLocListEntry *entry = (MonoDwarfLocListEntry *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoDwarfLocListEntry)); if (is_reg) g_assert (offset == 0); @@ -2261,7 +2261,7 @@ mono_compile_create_vars (MonoCompile *cfg) if (cfg->verbose_level > 2) g_print ("creating vars\n"); - cfg->args = mono_mempool_alloc0 (cfg->mempool, (sig->param_count + sig->hasthis) * sizeof (MonoInst*)); + cfg->args = (MonoInst **)mono_mempool_alloc0 (cfg->mempool, (sig->param_count + sig->hasthis) * sizeof (MonoInst*)); if (sig->hasthis) cfg->args [0] = mono_compile_create_var (cfg, &cfg->method->klass->this_arg, OP_ARG); @@ -2288,7 +2288,7 @@ mono_compile_create_vars (MonoCompile *cfg) } cfg->locals_start = cfg->num_varinfo; - cfg->locals = mono_mempool_alloc0 (cfg->mempool, header->num_locals * sizeof (MonoInst*)); + cfg->locals = (MonoInst **)mono_mempool_alloc0 (cfg->mempool, header->num_locals * sizeof (MonoInst*)); if (cfg->verbose_level > 2) g_print ("creating locals\n"); @@ -2348,7 +2348,7 @@ mono_postprocess_patches (MonoCompile *cfg) if (patch_info->type == MONO_PATCH_INFO_ABS) { if (cfg->abs_patches) { - MonoJumpInfo *abs_ji = g_hash_table_lookup (cfg->abs_patches, patch_info->data.target); + MonoJumpInfo *abs_ji = (MonoJumpInfo *)g_hash_table_lookup (cfg->abs_patches, patch_info->data.target); if (abs_ji) { patch_info->type = abs_ji->type; patch_info->data.target = abs_ji->data.target; @@ -2367,9 +2367,9 @@ mono_postprocess_patches (MonoCompile *cfg) table = g_malloc0 (sizeof(gpointer) * patch_info->data.table->table_size); #else if (cfg->method->dynamic) { - table = mono_code_manager_reserve (cfg->dynamic_info->code_mp, sizeof (gpointer) * patch_info->data.table->table_size); + table = (void **)mono_code_manager_reserve (cfg->dynamic_info->code_mp, sizeof (gpointer) * patch_info->data.table->table_size); } else { - table = mono_domain_code_reserve (cfg->domain, sizeof (gpointer) * patch_info->data.table->table_size); + table = (void **)mono_domain_code_reserve (cfg->domain, sizeof (gpointer) * patch_info->data.table->table_size); } #endif @@ -2397,9 +2397,9 @@ mono_postprocess_patches (MonoCompile *cfg) #endif mono_domain_lock (domain); - jlist = g_hash_table_lookup (domain_jit_info (domain)->jump_target_hash, patch_info->data.method); + jlist = (MonoJumpList *)g_hash_table_lookup (domain_jit_info (domain)->jump_target_hash, patch_info->data.method); if (!jlist) { - jlist = mono_domain_alloc0 (domain, sizeof (MonoJumpList)); + jlist = (MonoJumpList *)mono_domain_alloc0 (domain, sizeof (MonoJumpList)); g_hash_table_insert (domain_jit_info (domain)->jump_target_hash, patch_info->data.method, jlist); } jlist->list = g_slist_prepend (jlist->list, ip); @@ -2515,11 +2515,11 @@ mono_codegen (MonoCompile *cfg) if (mono_using_xdebug) /* See the comment for cfg->code_domain */ - code = mono_domain_code_reserve (code_domain, cfg->code_size + cfg->thunk_area + unwindlen); + code = (guint8 *)mono_domain_code_reserve (code_domain, cfg->code_size + cfg->thunk_area + unwindlen); else - code = mono_code_manager_reserve (cfg->dynamic_info->code_mp, cfg->code_size + cfg->thunk_area + unwindlen); + code = (guint8 *)mono_code_manager_reserve (cfg->dynamic_info->code_mp, cfg->code_size + cfg->thunk_area + unwindlen); } else { - code = mono_domain_code_reserve (code_domain, cfg->code_size + cfg->thunk_area + unwindlen); + code = (guint8 *)mono_domain_code_reserve (code_domain, cfg->code_size + cfg->thunk_area + unwindlen); } #if defined(__native_client_codegen__) && defined(__native_client__) nacl_allow_target_modification (TRUE); @@ -2685,7 +2685,7 @@ create_jit_info (MonoCompile *cfg, MonoMethod *method_to_compile) header = cfg->header; if (cfg->gshared) - flags |= JIT_INFO_HAS_GENERIC_JIT_INFO; + flags = (MonoJitInfoFlags)(flags | JIT_INFO_HAS_GENERIC_JIT_INFO); if (cfg->arch_eh_jit_info) { MonoJitArgumentInfo *arg_info; @@ -2699,18 +2699,18 @@ create_jit_info (MonoCompile *cfg, MonoMethod *method_to_compile) stack_size = mono_arch_get_argument_info (sig, sig->param_count, arg_info); if (stack_size) - flags |= JIT_INFO_HAS_ARCH_EH_INFO; + flags = (MonoJitInfoFlags)(flags | JIT_INFO_HAS_ARCH_EH_INFO); } if (cfg->has_unwind_info_for_epilog && !(flags & JIT_INFO_HAS_ARCH_EH_INFO)) - flags |= JIT_INFO_HAS_ARCH_EH_INFO; + flags = (MonoJitInfoFlags)(flags | JIT_INFO_HAS_ARCH_EH_INFO); if (cfg->thunk_area) - flags |= JIT_INFO_HAS_THUNK_INFO; + flags = (MonoJitInfoFlags)(flags | JIT_INFO_HAS_THUNK_INFO); if (cfg->try_block_holes) { for (tmp = cfg->try_block_holes; tmp; tmp = tmp->next) { - TryBlockHole *hole = tmp->data; + TryBlockHole *hole = (TryBlockHole *)tmp->data; MonoExceptionClause *ec = hole->clause; int hole_end = hole->basic_block->native_offset + hole->basic_block->native_length; MonoBasicBlock *clause_last_bb = cfg->cil_offset_to_bb [ec->try_offset + ec->try_len]; @@ -2721,7 +2721,7 @@ create_jit_info (MonoCompile *cfg, MonoMethod *method_to_compile) ++num_holes; } if (num_holes) - flags |= JIT_INFO_HAS_TRY_BLOCK_HOLES; + flags = (MonoJitInfoFlags)(flags | JIT_INFO_HAS_TRY_BLOCK_HOLES); if (G_UNLIKELY (cfg->verbose_level >= 4)) printf ("Number of try block holes %d\n", num_holes); } @@ -2732,9 +2732,9 @@ create_jit_info (MonoCompile *cfg, MonoMethod *method_to_compile) num_clauses = header->num_clauses; if (cfg->method->dynamic) - jinfo = g_malloc0 (mono_jit_info_size (flags, num_clauses, num_holes)); + jinfo = (MonoJitInfo *)g_malloc0 (mono_jit_info_size (flags, num_clauses, num_holes)); else - jinfo = mono_domain_alloc0 (cfg->domain, mono_jit_info_size (flags, num_clauses, num_holes)); + jinfo = (MonoJitInfo *)mono_domain_alloc0 (cfg->domain, mono_jit_info_size (flags, num_clauses, num_holes)); mono_jit_info_init (jinfo, cfg->method_to_register, cfg->native_code, cfg->code_len, flags, num_clauses, num_holes); jinfo->domain_neutral = (cfg->opt & MONO_OPT_SHARED) != 0; @@ -2752,7 +2752,7 @@ create_jit_info (MonoCompile *cfg, MonoMethod *method_to_compile) if (cfg->method->dynamic) gi->generic_sharing_context = g_new0 (MonoGenericSharingContext, 1); else - gi->generic_sharing_context = mono_domain_alloc0 (cfg->domain, sizeof (MonoGenericSharingContext)); + gi->generic_sharing_context = (MonoGenericSharingContext *)mono_domain_alloc0 (cfg->domain, sizeof (MonoGenericSharingContext)); mini_init_gsctx (cfg->method->dynamic ? NULL : cfg->domain, NULL, cfg->gsctx_context, gi->generic_sharing_context); if ((method_to_compile->flags & METHOD_ATTRIBUTE_STATIC) || @@ -2782,9 +2782,9 @@ create_jit_info (MonoCompile *cfg, MonoMethod *method_to_compile) gi->nlocs = g_slist_length (loclist); if (cfg->method->dynamic) - gi->locations = g_malloc0 (gi->nlocs * sizeof (MonoDwarfLocListEntry)); + gi->locations = (MonoDwarfLocListEntry *)g_malloc0 (gi->nlocs * sizeof (MonoDwarfLocListEntry)); else - gi->locations = mono_domain_alloc0 (cfg->domain, gi->nlocs * sizeof (MonoDwarfLocListEntry)); + gi->locations = (MonoDwarfLocListEntry *)mono_domain_alloc0 (cfg->domain, gi->nlocs * sizeof (MonoDwarfLocListEntry)); i = 0; for (l = loclist; l; l = l->next) { memcpy (&(gi->locations [i]), l->data, sizeof (MonoDwarfLocListEntry)); @@ -2825,7 +2825,7 @@ create_jit_info (MonoCompile *cfg, MonoMethod *method_to_compile) for (tmp = cfg->try_block_holes; tmp; tmp = tmp->next) { guint32 start_bb_offset; MonoTryBlockHoleJitInfo *hole; - TryBlockHole *hole_data = tmp->data; + TryBlockHole *hole_data = (TryBlockHole *)tmp->data; MonoExceptionClause *ec = hole_data->clause; int hole_end = hole_data->basic_block->native_offset + hole_data->basic_block->native_length; MonoBasicBlock *clause_last_bb = cfg->cil_offset_to_bb [ec->try_offset + ec->try_len]; @@ -2933,7 +2933,7 @@ create_jit_info (MonoCompile *cfg, MonoMethod *method_to_compile) ei->handler_start = cfg->native_code + tblock->native_offset; for (tmp = cfg->try_block_holes; tmp; tmp = tmp->next) { - TryBlockHole *hole = tmp->data; + TryBlockHole *hole = (TryBlockHole *)tmp->data; gpointer hole_end = cfg->native_code + (hole->basic_block->native_offset + hole->basic_block->native_length); if (hole->clause == ec && hole_end == ei->try_end) { if (G_UNLIKELY (cfg->verbose_level >= 4)) @@ -3288,8 +3288,10 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl try_generic_shared = mono_class_generic_sharing_enabled (method->klass) && (opts & MONO_OPT_GSHARED) && mono_method_is_generic_sharable (method, FALSE); if (mini_is_gsharedvt_sharable_method (method)) { + /* if (!mono_debug_count ()) try_generic_shared = FALSE; + */ } } @@ -3456,7 +3458,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl if (COMPILE_LLVM (cfg)) { mono_llvm_check_method_supported (cfg); if (cfg->disable_llvm) { - if (cfg->verbose_level >= cfg->llvm_only ? 0 : 1) { + if (cfg->verbose_level >= (cfg->llvm_only ? 0 : 1)) { //nm = mono_method_full_name (cfg->method, TRUE); printf ("LLVM failed for '%s': %s\n", method->name, cfg->exception_message); //g_free (nm); @@ -3548,7 +3550,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl } } - cfg->intvars = mono_mempool_alloc0 (cfg->mempool, sizeof (guint16) * STACK_MAX * header->max_stack); + cfg->intvars = (guint16 *)mono_mempool_alloc0 (cfg->mempool, sizeof (guint16) * STACK_MAX * header->max_stack); if (cfg->verbose_level > 0) { char *method_name; @@ -3690,7 +3692,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl mono_threads_safepoint (); /* Depth-first ordering on basic blocks */ - cfg->bblocks = mono_mempool_alloc (cfg->mempool, sizeof (MonoBasicBlock*) * (cfg->num_bblocks + 1)); + cfg->bblocks = (MonoBasicBlock **)mono_mempool_alloc (cfg->mempool, sizeof (MonoBasicBlock*) * (cfg->num_bblocks + 1)); cfg->max_block_num = cfg->num_bblocks; @@ -3830,10 +3832,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl if (COMPILE_SOFT_FLOAT (cfg)) mono_decompose_soft_float (cfg); #endif - if (COMPILE_LLVM (cfg)) - mono_decompose_vtype_opts_llvm (cfg); - else - mono_decompose_vtype_opts (cfg); + mono_decompose_vtype_opts (cfg); if (cfg->flags & MONO_CFG_HAS_ARRAY_ACCESS) mono_decompose_array_access_opts (cfg); @@ -3933,7 +3932,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl bb->last_ins->opcode = mono_reverse_branch_op (bb->last_ins->opcode); } else { - MonoInst *inst = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst)); + MonoInst *inst = (MonoInst *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst)); inst->opcode = OP_BR; inst->inst_target_bb = bb->last_ins->inst_false_bb; mono_bblock_add_inst (bb, inst); @@ -3975,7 +3974,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl if (!cfg->disable_llvm) mono_llvm_emit_method (cfg); if (cfg->disable_llvm) { - if (cfg->verbose_level >= cfg->llvm_only ? 0 : 1) { + if (cfg->verbose_level >= (cfg->llvm_only ? 0 : 1)) { //nm = mono_method_full_name (cfg->method, TRUE); printf ("LLVM failed for '%s': %s\n", method->name, cfg->exception_message); //g_free (nm); @@ -4078,7 +4077,7 @@ mono_arch_instrument_epilog (MonoCompile *cfg, void *func, void *p, gboolean ena void mono_cfg_add_try_hole (MonoCompile *cfg, MonoExceptionClause *clause, guint8 *start, MonoBasicBlock *bb) { - TryBlockHole *hole = mono_mempool_alloc (cfg->mempool, sizeof (TryBlockHole)); + TryBlockHole *hole = (TryBlockHole *)mono_mempool_alloc (cfg->mempool, sizeof (TryBlockHole)); hole->clause = clause; hole->start_offset = start - cfg->native_code; hole->basic_block = bb; @@ -4109,7 +4108,7 @@ create_jit_info_for_trampoline (MonoMethod *wrapper, MonoTrampInfo *info) uw_info = mono_unwind_ops_encode (info->unwind_ops, &info_len); } - jinfo = mono_domain_alloc0 (domain, MONO_SIZEOF_JIT_INFO); + jinfo = (MonoJitInfo *)mono_domain_alloc0 (domain, MONO_SIZEOF_JIT_INFO); jinfo->d.method = wrapper; jinfo->code_start = info->code; jinfo->code_size = info->code_size; @@ -4157,9 +4156,9 @@ mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain, in } nm = mono_marshal_get_native_wrapper (method, TRUE, mono_aot_only); code = mono_get_addr_from_ftnptr (mono_compile_method (nm)); - jinfo = mono_jit_info_table_find (target_domain, code); + jinfo = mono_jit_info_table_find (target_domain, (char *)code); if (!jinfo) - jinfo = mono_jit_info_table_find (mono_domain_get (), code); + jinfo = mono_jit_info_table_find (mono_domain_get (), (char *)code); if (jinfo) mono_profiler_method_end_jit (method, jinfo, MONO_PROFILE_OK); return code; @@ -4274,7 +4273,7 @@ mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain, in ex = mono_loader_error_prepare_exception (error); } else { if (cfg->exception_ptr) { - ex = mono_class_get_exception_for_failure (cfg->exception_ptr); + ex = mono_class_get_exception_for_failure ((MonoClass *)cfg->exception_ptr); } else { if (cfg->exception_type == MONO_EXCEPTION_MISSING_FIELD) ex = mono_exception_from_name_msg (mono_defaults.corlib, "System", "MissingFieldException", cfg->exception_message); @@ -4305,7 +4304,7 @@ mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain, in ex = mono_exception_from_name_msg (mono_defaults.corlib, "System", "FieldAccessException", cfg->exception_message); break; case MONO_EXCEPTION_OBJECT_SUPPLIED: { - MonoException *exp = cfg->exception_ptr; + MonoException *exp = (MonoException *)cfg->exception_ptr; MONO_GC_UNREGISTER_ROOT (cfg->exception_ptr); ex = exp; @@ -4389,7 +4388,7 @@ mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain, in MonoJumpInfo patch_info; MonoJumpList *jlist; GSList *tmp; - jlist = g_hash_table_lookup (domain_jit_info (target_domain)->jump_target_hash, method); + jlist = (MonoJumpList *)g_hash_table_lookup (domain_jit_info (target_domain)->jump_target_hash, method); if (jlist) { patch_info.next = NULL; patch_info.ip.i = 0; @@ -4403,8 +4402,8 @@ mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain, in #endif #ifdef MONO_ARCH_HAVE_PATCH_CODE_NEW for (tmp = jlist->list; tmp; tmp = tmp->next) { - gpointer target = mono_resolve_patch_target (NULL, target_domain, tmp->data, &patch_info, TRUE); - mono_arch_patch_code_new (NULL, target_domain, tmp->data, &patch_info, target); + gpointer target = mono_resolve_patch_target (NULL, target_domain, (guint8 *)tmp->data, &patch_info, TRUE); + mono_arch_patch_code_new (NULL, target_domain, (guint8 *)tmp->data, &patch_info, target); } #else for (tmp = jlist->list; tmp; tmp = tmp->next) @@ -4466,7 +4465,7 @@ mini_get_underlying_type (MonoType *type) void mini_jit_init (void) { - mono_mutex_init_recursive (&jit_mutex); + mono_os_mutex_init_recursive (&jit_mutex); #ifndef DISABLE_JIT current_backend = g_new0 (MonoBackend, 1); init_backend (current_backend); diff --git a/mono/mini/mini.h b/mono/mini/mini.h index c355233ad96..e27511ce338 100644 --- a/mono/mini/mini.h +++ b/mono/mini/mini.h @@ -111,7 +111,7 @@ #endif /* Version number of the AOT file format */ -#define MONO_AOT_FILE_VERSION 127 +#define MONO_AOT_FILE_VERSION 128 //TODO: This is x86/amd64 specific. #define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6)) @@ -389,7 +389,7 @@ enum { } while (0) #define MONO_INST_NEW(cfg,dest,op) do { \ - (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \ + (dest) = (MonoInst *)mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \ (dest)->opcode = (op); \ (dest)->dreg = -1; \ MONO_INST_NULLIFY_SREGS ((dest)); \ @@ -397,7 +397,7 @@ enum { } while (0) #define MONO_INST_NEW_CALL(cfg,dest,op) do { \ - (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoCallInst)); \ + (dest) = (MonoCallInst *)mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoCallInst)); \ (dest)->inst.opcode = (op); \ (dest)->inst.dreg = -1; \ MONO_INST_NULLIFY_SREGS (&(dest)->inst); \ @@ -741,6 +741,10 @@ typedef enum { LLVMArgVtypeByVal, LLVMArgVtypeRetAddr, /* On on cinfo->ret */ LLVMArgGSharedVt, + /* Fixed sized argument passed to/returned from gsharedvt method by ref */ + LLVMArgGsharedvtFixed, + /* Variable sized argument passed to/returned from gsharedvt method by ref */ + LLVMArgGsharedvtVariable, /* Vtype passed as one int array argument */ LLVMArgAsIArgs, /* Vtype passed as a set of fp arguments */ @@ -2173,7 +2177,7 @@ mono_bb_last_inst (MonoBasicBlock *bb, int filter) /* main function */ MONO_API int mono_main (int argc, char* argv[]); MONO_API void mono_set_defaults (int verbose_level, guint32 opts); -MONO_API void mono_parse_env_options (int argc, char *argv []); +MONO_API void mono_parse_env_options (int *ref_argc, char **ref_argv []); MonoDomain* mini_init (const char *filename, const char *runtime_version); void mini_cleanup (MonoDomain *domain); MONO_API MonoDebugOptions *mini_get_debug_options (void); @@ -2436,7 +2440,6 @@ gpointer mono_create_monitor_enter_trampoline (void); gpointer mono_create_monitor_enter_v4_trampoline (void); gpointer mono_create_monitor_exit_trampoline (void); gpointer mono_create_static_rgctx_trampoline (MonoMethod *m, gpointer addr); -gpointer mono_create_llvm_imt_trampoline (MonoDomain *domain, MonoMethod *m, int vt_offset) MONO_LLVM_INTERNAL; MonoVTable* mono_find_class_init_trampoline_by_addr (gconstpointer addr); guint32 mono_find_rgctx_lazy_fetch_trampoline_by_addr (gconstpointer addr); gpointer mono_magic_trampoline (mgreg_t *regs, guint8 *code, gpointer arg, guint8* tramp); @@ -2505,7 +2508,6 @@ int mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoB MonoInst *mono_decompose_opcode (MonoCompile *cfg, MonoInst *ins); void mono_decompose_long_opts (MonoCompile *cfg); void mono_decompose_vtype_opts (MonoCompile *cfg); -void mono_decompose_vtype_opts_llvm (MonoCompile *cfg); void mono_decompose_array_access_opts (MonoCompile *cfg); void mono_decompose_soft_float (MonoCompile *cfg); void mono_handle_global_vregs (MonoCompile *cfg); @@ -2574,7 +2576,7 @@ void mono_arch_decompose_long_opts (MonoCompile *cfg, MonoInst *ins GSList* mono_arch_get_delegate_invoke_impls (void); LLVMCallInfo* mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig) MONO_LLVM_INTERNAL; guint8* mono_arch_emit_load_got_addr (guint8 *start, guint8 *code, MonoCompile *cfg, MonoJumpInfo **ji); -guint8* mono_arch_emit_load_aotconst (guint8 *start, guint8 *code, MonoJumpInfo **ji, int tramp_type, gconstpointer target); +guint8* mono_arch_emit_load_aotconst (guint8 *start, guint8 *code, MonoJumpInfo **ji, MonoJumpInfoType tramp_type, gconstpointer target); GSList* mono_arch_get_cie_program (void); void mono_arch_set_target (char *mtriple); gboolean mono_arch_gsharedvt_sig_supported (MonoMethodSignature *sig); @@ -2695,7 +2697,7 @@ mono_thread_state_init_from_handle (MonoThreadUnwindState *tctx, MonoThreadInfo typedef gboolean (*MonoJitStackWalk) (StackFrameInfo *frame, MonoContext *ctx, gpointer data); void mono_exceptions_init (void); -gboolean mono_handle_exception (MonoContext *ctx, gpointer obj); +gboolean mono_handle_exception (MonoContext *ctx, MonoObject *obj); void mono_handle_native_sigsegv (int signal, void *sigctx, MONO_SIG_HANDLER_INFO_TYPE *siginfo); MONO_API void mono_print_thread_dump (void *sigctx); MONO_API void mono_print_thread_dump_from_ctx (MonoContext *ctx); diff --git a/mono/mini/objects.cs b/mono/mini/objects.cs index 3de372c89d0..2fe402f907f 100644 --- a/mono/mini/objects.cs +++ b/mono/mini/objects.cs @@ -1686,6 +1686,28 @@ ncells ) { } return 0; } + + struct Struct16 { + public int a, b, c, d; + } + + [MethodImplAttribute (MethodImplOptions.NoInlining)] + static int pass_struct16 (object o0, object o2, object o3, object o4, object o5, object o6, object o7, Struct16 o8) { + // This disables LLVM + try { + } catch { + } + return o8.a; + } + + [MethodImplAttribute (MethodImplOptions.NoInlining)] + static int pass_struct16 (object o0, object o2, object o3, object o6, object o7, Struct16 o8) { + return pass_struct16 (o0, o2, null, o3, null, o6, o7, o8); + } + + public static int test_42_pass_16byte_struct_split () { + return pass_struct16 (null, null, null, null, null, new Struct16 () { a = 42 }); + } } #if __MOBILE__ diff --git a/mono/mini/patch-info.h b/mono/mini/patch-info.h index ca4ea9fd7d3..c9b9885e18b 100644 --- a/mono/mini/patch-info.h +++ b/mono/mini/patch-info.h @@ -41,7 +41,6 @@ PATCH_INFO(MONITOR_ENTER_V4, "monitor_enter_v4") PATCH_INFO(MONITOR_EXIT, "monitor_exit") PATCH_INFO(MSCORLIB_GOT_ADDR, "mscorlib_got_addr") PATCH_INFO(SEQ_POINT_INFO, "seq_point_info") -PATCH_INFO(LLVM_IMT_TRAMPOLINE, "llvm_imt_trampoline") PATCH_INFO(GC_CARD_TABLE_ADDR, "gc_card_table_addr") PATCH_INFO(CASTCLASS_CACHE, "castclass_cache") PATCH_INFO(SIGNATURE, "signature") diff --git a/mono/mini/seq-points.c b/mono/mini/seq-points.c index c9f74b8e170..ac22ca41f07 100644 --- a/mono/mini/seq-points.c +++ b/mono/mini/seq-points.c @@ -58,7 +58,7 @@ mono_save_seq_point_info (MonoCompile *cfg) for (i = 0; i < cfg->seq_points->len; ++i) { SeqPoint *sp = &seq_points [i]; - MonoInst *ins = g_ptr_array_index (cfg->seq_points, i); + MonoInst *ins = (MonoInst *)g_ptr_array_index (cfg->seq_points, i); sp->il_offset = ins->inst_imm; sp->native_offset = ins->inst_offset; @@ -79,7 +79,7 @@ mono_save_seq_point_info (MonoCompile *cfg) bb_seq_points = g_slist_reverse (bb->seq_points); last = NULL; for (l = bb_seq_points; l; l = l->next) { - MonoInst *ins = l->data; + MonoInst *ins = (MonoInst *)l->data; if (ins->inst_imm == METHOD_ENTRY_IL_OFFSET || ins->inst_imm == METHOD_EXIT_IL_OFFSET) /* Used to implement method entry/exit events */ @@ -108,13 +108,13 @@ mono_save_seq_point_info (MonoCompile *cfg) */ l = g_slist_last (bb->seq_points); if (l) { - endfinally_seq_point = l->data; + endfinally_seq_point = (MonoInst *)l->data; for (bb2 = cfg->bb_entry; bb2; bb2 = bb2->next_bb) { GSList *l = g_slist_last (bb2->seq_points); if (l) { - MonoInst *ins = l->data; + MonoInst *ins = (MonoInst *)l->data; if (!(ins->inst_imm == METHOD_ENTRY_IL_OFFSET || ins->inst_imm == METHOD_EXIT_IL_OFFSET) && ins != endfinally_seq_point) next [endfinally_seq_point->backend.size] = g_slist_append (next [endfinally_seq_point->backend.size], GUINT_TO_POINTER (ins->backend.size)); @@ -198,12 +198,12 @@ mono_get_seq_points (MonoDomain *domain, MonoMethod *method) } mono_loader_lock (); - seq_points = g_hash_table_lookup (domain_jit_info (domain)->seq_points, method); + seq_points = (MonoSeqPointInfo *)g_hash_table_lookup (domain_jit_info (domain)->seq_points, method); if (!seq_points && method->is_inflated) { /* generic sharing + aot */ - seq_points = g_hash_table_lookup (domain_jit_info (domain)->seq_points, declaring_generic_method); + seq_points = (MonoSeqPointInfo *)g_hash_table_lookup (domain_jit_info (domain)->seq_points, declaring_generic_method); if (!seq_points) - seq_points = g_hash_table_lookup (domain_jit_info (domain)->seq_points, shared_method); + seq_points = (MonoSeqPointInfo *)g_hash_table_lookup (domain_jit_info (domain)->seq_points, shared_method); } mono_loader_unlock (); @@ -299,6 +299,6 @@ void mono_image_get_aot_seq_point_path (MonoImage *image, char **str) { int size = strlen (image->name) + strlen (SEQ_POINT_AOT_EXT) + 1; - *str = g_malloc (size); + *str = (char *)g_malloc (size); g_sprintf (*str, "%s%s", image->name, SEQ_POINT_AOT_EXT); } diff --git a/mono/mini/simd-intrinsics.c b/mono/mini/simd-intrinsics.c index 0f484a98758..6bffbd05c49 100644 --- a/mono/mini/simd-intrinsics.c +++ b/mono/mini/simd-intrinsics.c @@ -686,7 +686,7 @@ mono_simd_simplify_indirection (MonoCompile *cfg) } DEBUG (printf ("[simd-simplify] max vreg is %d\n", max_vreg)); - vreg_flags = g_malloc0 (max_vreg + 1); + vreg_flags = (char *)g_malloc0 (max_vreg + 1); target_bb = g_new0 (MonoBasicBlock*, max_vreg + 1); for (i = 0; i < cfg->num_varinfo; i++) { @@ -1482,7 +1482,7 @@ simd_version_name (guint32 version) static MonoInst* emit_intrinsics (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args, const SimdIntrinsc *intrinsics, guint32 size) { - const SimdIntrinsc * result = mono_binary_search (cmethod->name, intrinsics, size, sizeof (SimdIntrinsc), &simd_intrinsic_compare_by_name); + const SimdIntrinsc *result = (const SimdIntrinsc *)mono_binary_search (cmethod->name, intrinsics, size, sizeof (SimdIntrinsc), &simd_intrinsic_compare_by_name); if (!result) { DEBUG (printf ("function doesn't have a simd intrinsic %s::%s/%d\n", cmethod->klass->name, cmethod->name, fsig->param_count)); return NULL; diff --git a/mono/mini/ssa.c b/mono/mini/ssa.c index 95bea3006ee..3e79b5e3916 100644 --- a/mono/mini/ssa.c +++ b/mono/mini/ssa.c @@ -141,7 +141,7 @@ static inline void record_use (MonoCompile *cfg, MonoInst *var, MonoBasicBlock *bb, MonoInst *ins) { MonoMethodVar *info; - MonoVarUsageInfo *ui = mono_mempool_alloc (cfg->mempool, sizeof (MonoVarUsageInfo)); + MonoVarUsageInfo *ui = (MonoVarUsageInfo *)mono_mempool_alloc (cfg->mempool, sizeof (MonoVarUsageInfo)); info = MONO_VARINFO (cfg, var->inst_c0); @@ -352,7 +352,7 @@ mono_ssa_compute (MonoCompile *cfg) mono_compile_dominator_info (cfg, MONO_COMP_DOM | MONO_COMP_IDOM | MONO_COMP_DFRONTIER); bitsize = mono_bitset_alloc_size (cfg->num_bblocks, 0); - buf = buf_start = g_malloc0 (mono_bitset_alloc_size (cfg->num_bblocks, 0) * cfg->num_varinfo); + buf = buf_start = (guint8 *)g_malloc0 (mono_bitset_alloc_size (cfg->num_bblocks, 0) * cfg->num_varinfo); for (i = 0; i < cfg->num_varinfo; ++i) { vinfo [i].def_in = mono_bitset_mem_new (buf, cfg->num_bblocks, 0); @@ -434,7 +434,7 @@ mono_ssa_compute (MonoCompile *cfg) else ins->klass = var->klass; - ins->inst_phi_args = mono_mempool_alloc0 (cfg->mempool, sizeof (int) * (cfg->bblocks [idx]->in_count + 1)); + ins->inst_phi_args = (int *)mono_mempool_alloc0 (cfg->mempool, sizeof (int) * (cfg->bblocks [idx]->in_count + 1)); ins->inst_phi_args [0] = cfg->bblocks [idx]->in_count; /* For debugging */ @@ -457,7 +457,7 @@ mono_ssa_compute (MonoCompile *cfg) /* Renaming phase */ - stack = alloca (sizeof (MonoInst *) * cfg->num_varinfo); + stack = (MonoInst **)alloca (sizeof (MonoInst *) * cfg->num_varinfo); memset (stack, 0, sizeof (MonoInst *) * cfg->num_varinfo); lvreg_stack = g_new0 (guint32, cfg->next_vreg); @@ -937,7 +937,7 @@ visit_inst (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins, GList **cvars, if (MONO_IS_JUMP_TABLE (ins)) { int i; - MonoJumpInfoBBTable *table = MONO_JUMP_TABLE_FROM_INS (ins); + MonoJumpInfoBBTable *table = (MonoJumpInfoBBTable *)MONO_JUMP_TABLE_FROM_INS (ins); if (!ins->next || ins->next->opcode != OP_PADD) { /* The PADD was optimized away */ @@ -973,7 +973,7 @@ visit_inst (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins, GList **cvars, if (ins->opcode == OP_SWITCH) { int i; - MonoJumpInfoBBTable *table = ins->inst_p0; + MonoJumpInfoBBTable *table = (MonoJumpInfoBBTable *)ins->inst_p0; for (i = 0; i < table->table_size; i++) if (table->table [i]) @@ -1049,7 +1049,7 @@ fold_ins (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins, MonoInst **carray if (MONO_IS_JUMP_TABLE (ins)) { int i; - MonoJumpInfoBBTable *table = MONO_JUMP_TABLE_FROM_INS (ins); + MonoJumpInfoBBTable *table = (MonoJumpInfoBBTable *)MONO_JUMP_TABLE_FROM_INS (ins); if (!ins->next || ins->next->opcode != OP_PADD) { /* The PADD was optimized away */ diff --git a/mono/mini/tasklets.c b/mono/mini/tasklets.c index 6b5be99a733..9457633bafc 100644 --- a/mono/mini/tasklets.c +++ b/mono/mini/tasklets.c @@ -8,8 +8,8 @@ #if defined(MONO_SUPPORT_TASKLETS) static mono_mutex_t tasklets_mutex; -#define tasklets_lock() mono_mutex_lock(&tasklets_mutex) -#define tasklets_unlock() mono_mutex_unlock(&tasklets_mutex) +#define tasklets_lock() mono_os_mutex_lock(&tasklets_mutex) +#define tasklets_unlock() mono_os_mutex_unlock(&tasklets_mutex) /* LOCKING: tasklets_mutex is assumed to e taken */ static void @@ -47,7 +47,7 @@ continuation_mark_frame (MonoContinuation *cont) if (cont->domain) return mono_get_exception_argument ("cont", "Already marked"); - jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); lmf = mono_get_lmf(); cont->domain = mono_domain_get (); cont->thread_id = mono_native_thread_id_get (); @@ -136,7 +136,7 @@ continuation_restore (MonoContinuation *cont, int state) void mono_tasklets_init (void) { - mono_mutex_init_recursive (&tasklets_mutex); + mono_os_mutex_init_recursive (&tasklets_mutex); mono_add_internal_call ("Mono.Tasklets.Continuation::alloc", continuation_alloc); mono_add_internal_call ("Mono.Tasklets.Continuation::free", continuation_free); diff --git a/mono/mini/trace.c b/mono/mini/trace.c index 3d843f3b46b..765bc111c09 100644 --- a/mono/mini/trace.c +++ b/mono/mini/trace.c @@ -158,7 +158,7 @@ static void get_string (void) } if (value != NULL) g_free (value); - value = g_malloc (input - start + 1); + value = (char *)g_malloc (input - start + 1); strncpy (value, start, input-start); value [input-start] = 0; } @@ -431,11 +431,11 @@ mono_trace_enter_method (MonoMethod *method, char *ebp) sig = mono_method_signature (method); - arg_info = alloca (sizeof (MonoJitArgumentInfo) * (sig->param_count + 1)); + arg_info = (MonoJitArgumentInfo *)alloca (sizeof (MonoJitArgumentInfo) * (sig->param_count + 1)); if (method->is_inflated) { /* FIXME: Might be better to pass the ji itself */ - MonoJitInfo *ji = mini_jit_info_table_find (mono_domain_get (), RETURN_ADDRESS (), NULL); + MonoJitInfo *ji = mini_jit_info_table_find (mono_domain_get (), (char *)RETURN_ADDRESS (), NULL); if (ji) { gsctx = mono_jit_info_get_generic_sharing_context (ji); if (gsctx && gsctx->is_gsharedvt) { @@ -455,11 +455,11 @@ mono_trace_enter_method (MonoMethod *method, char *ebp) } if (mono_method_signature (method)->hasthis) { - gpointer *this = (gpointer *)(ebp + arg_info [0].offset); + gpointer *this_obj = (gpointer *)(ebp + arg_info [0].offset); if (method->klass->valuetype) { - printf ("value:%p, ", *arg_in_stack_slot(this, gpointer *)); + printf ("value:%p, ", *arg_in_stack_slot(this_obj, gpointer *)); } else { - o = *arg_in_stack_slot(this, MonoObject *); + o = *arg_in_stack_slot(this_obj, MonoObject *); if (o) { klass = o->vtable->klass; @@ -486,7 +486,7 @@ mono_trace_enter_method (MonoMethod *method, char *ebp) if (type->byref) { printf ("[BYREF:%p], ", *arg_in_stack_slot(cpos, gpointer *)); - } else switch (mono_type_get_underlying_type (type)->type) { + } else switch (mini_get_underlying_type (type)->type) { case MONO_TYPE_I: case MONO_TYPE_U: @@ -599,7 +599,7 @@ mono_trace_leave_method (MonoMethod *method, ...) if (method->is_inflated) { /* FIXME: Might be better to pass the ji itself */ - MonoJitInfo *ji = mini_jit_info_table_find (mono_domain_get (), RETURN_ADDRESS (), NULL); + MonoJitInfo *ji = mini_jit_info_table_find (mono_domain_get (), (char *)RETURN_ADDRESS (), NULL); if (ji) { gsctx = mono_jit_info_get_generic_sharing_context (ji); if (gsctx && gsctx->is_gsharedvt) { @@ -610,9 +610,8 @@ mono_trace_leave_method (MonoMethod *method, ...) } } - type = mono_method_signature (method)->ret; + type = mini_get_underlying_type (mono_method_signature (method)->ret); -handle_enum: switch (type->type) { case MONO_TYPE_VOID: break; @@ -694,20 +693,16 @@ handle_enum: printf ("FP=%f", f); break; } - case MONO_TYPE_VALUETYPE: - if (type->data.klass->enumtype) { - type = mono_class_enum_basetype (type->data.klass); - goto handle_enum; - } else { - guint8 *p = va_arg (ap, gpointer); - int j, size, align; - size = mono_type_size (type, &align); - printf ("["); - for (j = 0; p && j < size; j++) - printf ("%02x,", p [j]); - printf ("]"); - } + case MONO_TYPE_VALUETYPE: { + guint8 *p = (guint8 *)va_arg (ap, gpointer); + int j, size, align; + size = mono_type_size (type, &align); + printf ("["); + for (j = 0; p && j < size; j++) + printf ("%02x,", p [j]); + printf ("]"); break; + } default: printf ("(unknown return type %x)", mono_method_signature (method)->ret->type); } diff --git a/mono/mini/tramp-amd64.c b/mono/mini/tramp-amd64.c index 4468ad30869..b3712467479 100644 --- a/mono/mini/tramp-amd64.c +++ b/mono/mini/tramp-amd64.c @@ -57,7 +57,7 @@ mono_arch_get_unbox_trampoline (MonoMethod *m, gpointer addr) this_reg = mono_arch_get_this_arg_reg (NULL); - start = code = mono_domain_code_reserve (domain, size); + start = code = (guint8 *)mono_domain_code_reserve (domain, size); unwind_ops = mono_arch_get_cie_program (); @@ -101,7 +101,7 @@ mono_arch_get_static_rgctx_trampoline (MonoMethod *m, MonoMethodRuntimeGenericCo buf_len = NACL_SIZE (30, 32); #endif - start = code = mono_domain_code_reserve (domain, buf_len); + start = code = (guint8 *)mono_domain_code_reserve (domain, buf_len); unwind_ops = mono_arch_get_cie_program (); @@ -118,36 +118,6 @@ mono_arch_get_static_rgctx_trampoline (MonoMethod *m, MonoMethodRuntimeGenericCo return start; } -gpointer -mono_arch_get_llvm_imt_trampoline (MonoDomain *domain, MonoMethod *m, int vt_offset) -{ - guint8 *code, *start; - int buf_len; - int this_reg; - - buf_len = 32; - - start = code = mono_domain_code_reserve (domain, buf_len); - - this_reg = mono_arch_get_this_arg_reg (NULL); - - /* Set imt arg */ - amd64_mov_reg_imm (code, MONO_ARCH_IMT_REG, m); - /* Load vtable address */ - amd64_mov_reg_membase (code, AMD64_RAX, this_reg, 0, 8); - amd64_jump_membase (code, AMD64_RAX, vt_offset); - amd64_ret (code); - - g_assert ((code - start) < buf_len); - - nacl_domain_code_validate (domain, &start, buf_len, &code); - - mono_arch_flush_icache (start, code - start); - mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_IMT_TRAMPOLINE, NULL); - - return start; -} - #ifdef _WIN64 // Workaround lack of Valgrind support for 64-bit Windows #define VALGRIND_DISCARD_TRANSLATIONS(...) @@ -185,7 +155,7 @@ mono_arch_patch_callsite (guint8 *method_start, guint8 *orig_code, guint8 *addr) */ guint8 *thunk_start, *thunk_code; - thunk_start = thunk_code = mono_domain_code_reserve (mono_domain_get (), 32); + thunk_start = thunk_code = (guint8 *)mono_domain_code_reserve (mono_domain_get (), 32); amd64_jump_membase (thunk_code, AMD64_RIP, 0); *(guint64*)thunk_code = (guint64)addr; addr = thunk_start; @@ -252,7 +222,7 @@ mono_arch_create_llvm_native_thunk (MonoDomain *domain, guint8 *addr) */ guint8 *thunk_start, *thunk_code; - thunk_start = thunk_code = mono_domain_code_reserve (mono_domain_get (), 32); + thunk_start = thunk_code = (guint8 *)mono_domain_code_reserve (mono_domain_get (), 32); amd64_jump_membase (thunk_code, AMD64_RIP, 0); *(guint64*)thunk_code = (guint64)addr; addr = thunk_start; @@ -324,7 +294,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf else has_caller = TRUE; - code = buf = mono_global_codeman_reserve (kMaxCodeSize); + code = buf = (guint8 *)mono_global_codeman_reserve (kMaxCodeSize); /* Compute stack frame size and offsets */ offset = 0; @@ -648,7 +618,7 @@ mono_arch_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_ty else size = 5 + 1 + 8; - code = buf = mono_domain_code_reserve_align (domain, size, 1); + code = buf = (guint8 *)mono_domain_code_reserve_align (domain, size, 1); if (((gint64)tramp - (gint64)code) >> 31 != 0 && ((gint64)tramp - (gint64)code) >> 31 != -1) { #ifndef MONO_ARCH_NOMAP32BIT @@ -656,7 +626,7 @@ mono_arch_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_ty #endif far_addr = TRUE; size += 16; - code = buf = mono_domain_code_reserve_align (domain, size, 1); + code = buf = (guint8 *)mono_domain_code_reserve_align (domain, size, 1); } #elif defined(__native_client_codegen__) size = 5 + 1 + 4; @@ -732,11 +702,11 @@ mono_arch_create_rgctx_lazy_fetch_trampoline (guint32 slot, MonoTrampInfo **info tramp_size = NACL_SIZE (64 + 8 * depth, 128 + 8 * depth); - code = buf = mono_global_codeman_reserve (tramp_size); + code = buf = (guint8 *)mono_global_codeman_reserve (tramp_size); unwind_ops = mono_arch_get_cie_program (); - rgctx_null_jumps = g_malloc (sizeof (guint8*) * (depth + 2)); + rgctx_null_jumps = (guint8 **)g_malloc (sizeof (guint8*) * (depth + 2)); if (mrgctx) { /* get mrgctx ptr */ @@ -786,7 +756,7 @@ mono_arch_create_rgctx_lazy_fetch_trampoline (guint32 slot, MonoTrampInfo **info code = mono_arch_emit_load_aotconst (buf, code, &ji, MONO_PATCH_INFO_JIT_ICALL_ADDR, g_strdup_printf ("specific_trampoline_lazy_fetch_%u", slot)); amd64_jump_reg (code, AMD64_R11); } else { - tramp = mono_arch_create_specific_trampoline (GUINT_TO_POINTER (slot), MONO_TRAMPOLINE_RGCTX_LAZY_FETCH, mono_get_root_domain (), NULL); + tramp = (guint8 *)mono_arch_create_specific_trampoline (GUINT_TO_POINTER (slot), MONO_TRAMPOLINE_RGCTX_LAZY_FETCH, mono_get_root_domain (), NULL); /* jump to the actual trampoline */ amd64_jump_code (code, tramp); @@ -809,7 +779,7 @@ void mono_arch_invalidate_method (MonoJitInfo *ji, void *func, gpointer func_arg) { /* FIXME: This is not thread safe */ - guint8 *code = ji->code_start; + guint8 *code = (guint8 *)ji->code_start; amd64_mov_reg_imm (code, AMD64_ARG_REG1, func_arg); amd64_mov_reg_imm (code, AMD64_R11, func); @@ -822,7 +792,7 @@ mono_arch_invalidate_method (MonoJitInfo *ji, void *func, gpointer func_arg) static void handler_block_trampoline_helper (gpointer *ptr) { - MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id); *ptr = jit_tls->handler_block_return_address; } @@ -837,7 +807,7 @@ mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot) g_assert (!aot); - code = buf = mono_global_codeman_reserve (tramp_size); + code = buf = (guint8 *)mono_global_codeman_reserve (tramp_size); unwind_ops = mono_arch_get_cie_program (); @@ -922,7 +892,7 @@ mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gbo GSList *unwind_ops = NULL; MonoJumpInfo *ji = NULL; - code = buf = mono_global_codeman_reserve (tramp_size); + code = buf = (guint8 *)mono_global_codeman_reserve (tramp_size); framesize = 0; #ifdef TARGET_WIN32 diff --git a/mono/mini/tramp-x86.c b/mono/mini/tramp-x86.c index 3644a936639..2b4475f0a67 100644 --- a/mono/mini/tramp-x86.c +++ b/mono/mini/tramp-x86.c @@ -90,37 +90,6 @@ mono_arch_get_static_rgctx_trampoline (MonoMethod *m, MonoMethodRuntimeGenericCo return start; } -gpointer -mono_arch_get_llvm_imt_trampoline (MonoDomain *domain, MonoMethod *m, int vt_offset) -{ - guint8 *code, *start; - int buf_len; - int this_offset; - - buf_len = 32; - - start = code = mono_domain_code_reserve (domain, buf_len); - - this_offset = mono_x86_get_this_arg_offset (mono_method_signature (m)); - - /* Set imt arg */ - x86_mov_reg_imm (code, MONO_ARCH_IMT_REG, m); - /* Load this */ - x86_mov_reg_membase (code, X86_EAX, X86_ESP, this_offset + 4, 4); - /* Load vtable address */ - x86_mov_reg_membase (code, X86_EAX, X86_EAX, 0, 4); - x86_jump_membase (code, X86_EAX, vt_offset); - - g_assert ((code - start) < buf_len); - - nacl_domain_code_validate (domain, &start, buf_len, &code); - - mono_arch_flush_icache (start, code - start); - mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_IMT_TRAMPOLINE, NULL); - - return start; -} - void mono_arch_patch_callsite (guint8 *method_start, guint8 *orig_code, guint8 *addr) { @@ -789,6 +758,7 @@ mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gbo /* Argument area */ framesize += sizeof (mgreg_t); + framesize = ALIGN_TO (framesize, 8); ctx_offset = framesize; framesize += sizeof (MonoContext); diff --git a/mono/mini/unwind.c b/mono/mini/unwind.c index 1fbd5c9f63b..82f14d78822 100644 --- a/mono/mini/unwind.c +++ b/mono/mini/unwind.c @@ -41,8 +41,8 @@ static GSList *cached_info_list; /* Statistics */ static int unwind_info_size; -#define unwind_lock() mono_mutex_lock (&unwind_mutex) -#define unwind_unlock() mono_mutex_unlock (&unwind_mutex) +#define unwind_lock() mono_os_mutex_lock (&unwind_mutex) +#define unwind_unlock() mono_os_mutex_unlock (&unwind_mutex) #ifdef TARGET_AMD64 static int map_hw_reg_to_dwarf_reg [] = { 0, 2, 1, 3, 7, 6, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; @@ -361,7 +361,7 @@ mono_unwind_ops_encode_full (GSList *unwind_ops, guint32 *out_len, gboolean enab for (; l; l = l->next) { int reg; - op = l->data; + op = (MonoUnwindOp *)l->data; /* Convert the register from the hw encoding to the dwarf encoding */ reg = mono_hw_reg_to_dwarf_reg (op->reg); @@ -446,7 +446,7 @@ mono_unwind_ops_encode_full (GSList *unwind_ops, guint32 *out_len, gboolean enab g_assert (p - buf < 4096); *out_len = p - buf; - res = g_malloc (p - buf); + res = (guint8 *)g_malloc (p - buf); memcpy (res, buf, p - buf); return res; } @@ -632,7 +632,7 @@ mono_unwind_frame (guint8 *unwind_info, guint32 unwind_info_len, void mono_unwind_init (void) { - mono_mutex_init_recursive (&unwind_mutex); + mono_os_mutex_init_recursive (&unwind_mutex); mono_counters_register ("Unwind info size", MONO_COUNTER_JIT | MONO_COUNTER_INT, &unwind_info_size); } @@ -642,7 +642,7 @@ mono_unwind_cleanup (void) { int i; - mono_mutex_destroy (&unwind_mutex); + mono_os_mutex_destroy (&unwind_mutex); if (!cached_info) return; @@ -688,7 +688,7 @@ mono_cache_unwind_info (guint8 *unwind_info, guint32 unwind_info_len) } } - info = g_malloc (sizeof (MonoUnwindInfo) + unwind_info_len); + info = (MonoUnwindInfo *)g_malloc (sizeof (MonoUnwindInfo) + unwind_info_len); info->len = unwind_info_len; memcpy (&info->info, unwind_info, unwind_info_len); @@ -881,11 +881,11 @@ decode_lsda (guint8 *lsda, guint8 *code, MonoJitExceptionInfo **ex_info, guint32 p = (guint8*)ALIGN_TO ((mgreg_t)p, 4); if (ex_info) { - *ex_info = g_malloc0 (ncall_sites * sizeof (MonoJitExceptionInfo)); + *ex_info = (MonoJitExceptionInfo *)g_malloc0 (ncall_sites * sizeof (MonoJitExceptionInfo)); *ex_info_len = ncall_sites; } if (type_info) - *type_info = g_malloc0 (ncall_sites * sizeof (gpointer)); + *type_info = (gpointer *)g_malloc0 (ncall_sites * sizeof (gpointer)); for (i = 0; i < ncall_sites; ++i) { int block_start_offset, block_size, landing_pad; @@ -1058,7 +1058,7 @@ mono_unwind_decode_fde (guint8 *fde, guint32 *out_len, guint32 *code_len, MonoJi g_assert (return_reg == DWARF_PC_REG); buf_len = (cie + cie_len + 4 - cie_cfi) + (fde + fde_len + 4 - fde_cfi); - buf = g_malloc0 (buf_len); + buf = (guint8 *)g_malloc0 (buf_len); i = 0; p = cie_cfi; @@ -1084,7 +1084,7 @@ mono_unwind_decode_fde (guint8 *fde, guint32 *out_len, guint32 *code_len, MonoJi *out_len = i; - return g_realloc (buf, i); + return (guint8 *)g_realloc (buf, i); } /* @@ -1158,7 +1158,7 @@ mono_unwind_decode_llvm_mono_fde (guint8 *fde, int fde_len, guint8 *cie, guint8 cie_cfi_len = p - cie_cfi; fde_cfi_len = (fde + fde_len - fde_cfi); - buf = g_malloc0 (cie_cfi_len + fde_cfi_len); + buf = (guint8 *)g_malloc0 (cie_cfi_len + fde_cfi_len); memcpy (buf, cie_cfi, cie_cfi_len); memcpy (buf + cie_cfi_len, fde_cfi, fde_cfi_len); diff --git a/mono/profiler/decode.c b/mono/profiler/decode.c index 4ee385504be..e57211635ee 100644 --- a/mono/profiler/decode.c +++ b/mono/profiler/decode.c @@ -133,7 +133,7 @@ static char* pstrdup (const char *s) { int len = strlen (s) + 1; - char *p = malloc (len); + char *p = (char *)malloc (len); memcpy (p, s, len); return p; } @@ -196,7 +196,7 @@ add_counter_to_section (Counter *counter) CounterSection *csection, *s; CounterList *clist; - clist = calloc (1, sizeof (CounterList)); + clist = (CounterList *)calloc (1, sizeof (CounterList)); clist->counter = counter; for (csection = counters_sections; csection; csection = csection->next) { @@ -212,7 +212,7 @@ add_counter_to_section (Counter *counter) } /* If section does not exist */ - csection = calloc (1, sizeof (CounterSection)); + csection = (CounterSection *)calloc (1, sizeof (CounterSection)); csection->value = counter->section; csection->counters = clist; csection->counters_last = clist; @@ -237,7 +237,7 @@ add_counter (const char *section, const char *name, int type, int unit, int vari if (list->counter->index == index) return; - counter = calloc (1, sizeof (Counter)); + counter = (Counter *)calloc (1, sizeof (Counter)); counter->section = section; counter->name = name; counter->type = type; @@ -245,7 +245,7 @@ add_counter (const char *section, const char *name, int type, int unit, int vari counter->variance = variance; counter->index = index; - list = calloc (1, sizeof (CounterList)); + list = (CounterList *)calloc (1, sizeof (CounterList)); list->counter = counter; if (!counters) { @@ -268,7 +268,7 @@ add_counter_to_timestamp (uint64_t timestamp, Counter *counter) CounterSection *csection; CounterList *clist; - clist = calloc (1, sizeof (CounterList)); + clist = (CounterList *)calloc (1, sizeof (CounterList)); clist->counter = counter; for (ctimestamp = counters_timestamps; ctimestamp; ctimestamp = ctimestamp->next) { @@ -286,7 +286,7 @@ add_counter_to_timestamp (uint64_t timestamp, Counter *counter) } /* if timestamp exist and section does not exist */ - csection = calloc (1, sizeof (CounterSection)); + csection = (CounterSection *)calloc (1, sizeof (CounterSection)); csection->value = counter->section; csection->counters = clist; csection->counters_last = clist; @@ -301,12 +301,12 @@ add_counter_to_timestamp (uint64_t timestamp, Counter *counter) } /* If timestamp do not exist and section does not exist */ - csection = calloc (1, sizeof (CounterSection)); + csection = (CounterSection *)calloc (1, sizeof (CounterSection)); csection->value = counter->section; csection->counters = clist; csection->counters_last = clist; - ctimestamp = calloc (1, sizeof (CounterTimestamp)); + ctimestamp = (CounterTimestamp *)calloc (1, sizeof (CounterTimestamp)); ctimestamp->value = timestamp; ctimestamp->sections = csection; ctimestamp->sections_last = csection; @@ -564,7 +564,7 @@ static void add_image (intptr_t image, char *name) { int slot = ((image >> 2) & 0xffff) % SMALL_HASH_SIZE; - ImageDesc *cd = malloc (sizeof (ImageDesc)); + ImageDesc *cd = (ImageDesc *)malloc (sizeof (ImageDesc)); cd->image = image; cd->filename = pstrdup (name); cd->next = image_hash [slot]; @@ -587,7 +587,7 @@ static void add_assembly (intptr_t assembly, char *name) { int slot = ((assembly >> 2) & 0xffff) % SMALL_HASH_SIZE; - AssemblyDesc *cd = malloc (sizeof (AssemblyDesc)); + AssemblyDesc *cd = (AssemblyDesc *)malloc (sizeof (AssemblyDesc)); cd->assembly = assembly; cd->asmname = pstrdup (name); cd->next = assembly_hash [slot]; @@ -635,7 +635,7 @@ add_class (intptr_t klass, const char *name) cd->name = pstrdup (name); return cd; } - cd = calloc (sizeof (ClassDesc), 1); + cd = (ClassDesc *)calloc (sizeof (ClassDesc), 1); cd->klass = klass; cd->name = pstrdup (name); cd->next = class_hash [slot]; @@ -701,7 +701,7 @@ add_method (intptr_t method, const char *name, intptr_t code, int len) cd->name = pstrdup (name); return cd; } - cd = calloc (sizeof (MethodDesc), 1); + cd = (MethodDesc *)calloc (sizeof (MethodDesc), 1); cd->method = method; cd->name = pstrdup (name); cd->code = code; @@ -743,8 +743,8 @@ add_stat_sample (int type, uintptr_t ip) { size_stat_samples *= 2; if (!size_stat_samples) size_stat_samples = 32; - stat_samples = realloc (stat_samples, size_stat_samples * sizeof (uintptr_t)); - stat_sample_desc = realloc (stat_sample_desc, size_stat_samples * sizeof (int)); + stat_samples = (uintptr_t *)realloc (stat_samples, size_stat_samples * sizeof (uintptr_t)); + stat_sample_desc = (int *)realloc (stat_sample_desc, size_stat_samples * sizeof (int)); } stat_samples [num_stat_samples] = ip; stat_sample_desc [num_stat_samples++] = type; @@ -772,8 +772,8 @@ lookup_method_by_ip (uintptr_t ip) static int compare_method_samples (const void *a, const void *b) { - MethodDesc *const*A = a; - MethodDesc *const*B = b; + MethodDesc *const *A = (MethodDesc *const *)a; + MethodDesc *const *B = (MethodDesc *const *)b; if ((*A)->sample_hits == (*B)->sample_hits) return 0; if ((*B)->sample_hits < (*A)->sample_hits) @@ -798,8 +798,8 @@ static int usymbols_num = 0; static int compare_usymbol_addr (const void *a, const void *b) { - UnmanagedSymbol *const*A = a; - UnmanagedSymbol *const*B = b; + UnmanagedSymbol *const *A = (UnmanagedSymbol *const *)a; + UnmanagedSymbol *const *B = (UnmanagedSymbol *const *)b; if ((*B)->addr == (*A)->addr) return 0; if ((*B)->addr > (*A)->addr) @@ -810,8 +810,8 @@ compare_usymbol_addr (const void *a, const void *b) static int compare_usymbol_samples (const void *a, const void *b) { - UnmanagedSymbol *const*A = a; - UnmanagedSymbol *const*B = b; + UnmanagedSymbol *const *A = (UnmanagedSymbol *const *)a; + UnmanagedSymbol *const *B = (UnmanagedSymbol *const *)b; if ((*B)->sample_hits == (*A)->sample_hits) return 0; if ((*B)->sample_hits < (*A)->sample_hits) @@ -827,10 +827,10 @@ add_unmanaged_symbol (uintptr_t addr, char *name, uintptr_t size) int new_size = usymbols_size * 2; if (!new_size) new_size = 16; - usymbols = realloc (usymbols, sizeof (void*) * new_size); + usymbols = (UnmanagedSymbol **)realloc (usymbols, sizeof (void*) * new_size); usymbols_size = new_size; } - sym = calloc (sizeof (UnmanagedSymbol), 1); + sym = (UnmanagedSymbol *)calloc (sizeof (UnmanagedSymbol), 1); sym->addr = addr; sym->name = name; sym->size = size; @@ -875,10 +875,10 @@ add_unmanaged_binary (uintptr_t addr, char *name, uintptr_t size) int new_size = ubinaries_size * 2; if (!new_size) new_size = 16; - ubinaries = realloc (ubinaries, sizeof (void*) * new_size); + ubinaries = (UnmanagedSymbol **)realloc (ubinaries, sizeof (void*) * new_size); ubinaries_size = new_size; } - sym = calloc (sizeof (UnmanagedSymbol), 1); + sym = (UnmanagedSymbol *)calloc (sizeof (UnmanagedSymbol), 1); sym->addr = addr; sym->name = name; sym->size = size; @@ -965,7 +965,7 @@ dump_samples (void) msize *= 2; if (!msize) msize = 4; - cachedm = realloc (cachedm, sizeof (void*) * msize); + cachedm = (MethodDesc **)realloc (cachedm, sizeof (void*) * msize); } cachedm [count++] = m; } @@ -983,7 +983,7 @@ dump_samples (void) usize *= 2; if (!usize) usize = 4; - cachedus = realloc (cachedus, sizeof (void*) * usize); + cachedus = (UnmanagedSymbol **)realloc (cachedus, sizeof (void*) * usize); } cachedus [ucount++] = usym; } @@ -1091,7 +1091,7 @@ add_heap_class_rev (HeapClassDesc *from, HeapClassDesc *to) to->rev_hash_size *= 2; if (to->rev_hash_size == 0) to->rev_hash_size = 4; - n = calloc (sizeof (HeapClassRevRef) * to->rev_hash_size, 1); + n = (HeapClassRevRef *)calloc (sizeof (HeapClassRevRef) * to->rev_hash_size, 1); for (i = 0; i < old_size; ++i) { if (to->rev_hash [i].klass) add_rev_class_hashed (n, to->rev_hash_size, to->rev_hash [i].klass, to->rev_hash [i].count); @@ -1133,9 +1133,9 @@ static int num_heap_shots = 0; static HeapShot* new_heap_shot (uint64_t timestamp) { - HeapShot *hs = calloc (sizeof (HeapShot), 1); + HeapShot *hs = (HeapShot *)calloc (sizeof (HeapShot), 1); hs->hash_size = 4; - hs->class_hash = calloc (sizeof (void*), hs->hash_size); + hs->class_hash = (HeapClassDesc **)calloc (sizeof (void*), hs->hash_size); hs->timestamp = timestamp; num_heap_shots++; hs->next = heap_shots; @@ -1181,7 +1181,7 @@ add_heap_hashed (HeapClassDesc **hash, HeapClassDesc **retv, uintptr_t hsize, Cl hash [i] = *retv; return 1; } - hash [i] = calloc (sizeof (HeapClassDesc), 1); + hash [i] = (HeapClassDesc *)calloc (sizeof (HeapClassDesc), 1); hash [i]->klass = klass; hash [i]->total_size += size; hash [i]->count += count; @@ -1208,7 +1208,7 @@ add_heap_shot_class (HeapShot *hs, ClassDesc *klass, uint64_t size) hs->hash_size *= 2; if (hs->hash_size == 0) hs->hash_size = 4; - n = calloc (sizeof (void*) * hs->hash_size, 1); + n = (HeapClassDesc **)calloc (sizeof (void*) * hs->hash_size, 1); for (i = 0; i < old_size; ++i) { res = hs->class_hash [i]; if (hs->class_hash [i]) @@ -1228,7 +1228,7 @@ add_heap_shot_class (HeapShot *hs, ClassDesc *klass, uint64_t size) static HeapObjectDesc* alloc_heap_obj (uintptr_t objaddr, HeapClassDesc *hklass, uintptr_t num_refs) { - HeapObjectDesc* ho = calloc (sizeof (HeapObjectDesc) + num_refs * sizeof (uintptr_t), 1); + HeapObjectDesc* ho = (HeapObjectDesc *)calloc (sizeof (HeapObjectDesc) + num_refs * sizeof (uintptr_t), 1); ho->objaddr = objaddr; ho->hklass = hklass; ho->num_refs = num_refs; @@ -1311,7 +1311,7 @@ add_heap_shot_obj (HeapShot *hs, HeapObjectDesc *obj) hs->objects_hash_size *= 2; if (hs->objects_hash_size == 0) hs->objects_hash_size = 4; - n = calloc (sizeof (void*) * hs->objects_hash_size, 1); + n = (HeapObjectDesc **)calloc (sizeof (void*) * hs->objects_hash_size, 1); for (i = 0; i < old_size; ++i) { if (hs->objects_hash [i]) add_heap_hashed_obj (n, hs->objects_hash_size, hs->objects_hash [i]); @@ -1365,7 +1365,7 @@ heap_shot_mark_objects (HeapShot *hs) if (!debug) return; /* consistency checks: it seems not all the objects are walked in the heap in some cases */ - marks = calloc (hs->objects_hash_size, 1); + marks = (unsigned char *)calloc (hs->objects_hash_size, 1); if (!marks) return; for (i = 0; i < hs->num_roots; ++i) { @@ -1478,14 +1478,14 @@ add_backtrace (int count, MethodDesc **methods) return bt; bt = bt->next; } - bt = malloc (sizeof (BackTrace) + ((count - 1) * sizeof (void*))); + bt = (BackTrace *)malloc (sizeof (BackTrace) + ((count - 1) * sizeof (void*))); bt->next = backtrace_hash [slot]; backtrace_hash [slot] = bt; if (next_backtrace == num_backtraces) { num_backtraces *= 2; if (!num_backtraces) num_backtraces = 16; - backtraces = realloc (backtraces, sizeof (void*) * num_backtraces); + backtraces = (BackTrace **)realloc (backtraces, sizeof (void*) * num_backtraces); } bt->id = next_backtrace++; backtraces [bt->id] = bt; @@ -1562,7 +1562,7 @@ static void ensure_buffer (ProfContext *ctx, int size) { if (ctx->size < size) { - ctx->buf = realloc (ctx->buf, size); + ctx->buf = (unsigned char *)realloc (ctx->buf, size); ctx->size = size; } } @@ -1600,16 +1600,16 @@ get_thread (ProfContext *ctx, intptr_t thread_id) } thread = thread->next; } - thread = calloc (sizeof (ThreadContext), 1); + thread = (ThreadContext *)calloc (sizeof (ThreadContext), 1); thread->next = ctx->threads; ctx->threads = thread; thread->thread_id = thread_id; thread->last_time = 0; thread->stack_id = 0; thread->stack_size = 32; - thread->stack = malloc (thread->stack_size * sizeof (void*)); - thread->time_stack = malloc (thread->stack_size * sizeof (uint64_t)); - thread->callee_time_stack = malloc (thread->stack_size * sizeof (uint64_t)); + thread->stack = (MethodDesc **)malloc (thread->stack_size * sizeof (void*)); + thread->time_stack = (uint64_t *)malloc (thread->stack_size * sizeof (uint64_t)); + thread->callee_time_stack = (uint64_t *)malloc (thread->stack_size * sizeof (uint64_t)); return thread; } @@ -1628,7 +1628,7 @@ get_domain (ProfContext *ctx, intptr_t domain_id) domain = domain->next; } - domain = calloc (sizeof (DomainContext), 1); + domain = (DomainContext *)calloc (sizeof (DomainContext), 1); domain->next = ctx->domains; ctx->domains = domain; domain->domain_id = domain_id; @@ -1651,7 +1651,7 @@ get_remctx (ProfContext *ctx, intptr_t remctx_id) remctx = remctx->next; } - remctx = calloc (sizeof (RemCtxContext), 1); + remctx = (RemCtxContext *)calloc (sizeof (RemCtxContext), 1); remctx->next = ctx->remctxs; ctx->remctxs = remctx; remctx->remctx_id = remctx_id; @@ -1672,9 +1672,9 @@ ensure_thread_stack (ThreadContext *thread) { if (thread->stack_id == thread->stack_size) { thread->stack_size *= 2; - thread->stack = realloc (thread->stack, thread->stack_size * sizeof (void*)); - thread->time_stack = realloc (thread->time_stack, thread->stack_size * sizeof (uint64_t)); - thread->callee_time_stack = realloc (thread->callee_time_stack, thread->stack_size * sizeof (uint64_t)); + thread->stack = (MethodDesc **)realloc (thread->stack, thread->stack_size * sizeof (void*)); + thread->time_stack = (uint64_t *)realloc (thread->time_stack, thread->stack_size * sizeof (uint64_t)); + thread->callee_time_stack = (uint64_t *)realloc (thread->callee_time_stack, thread->stack_size * sizeof (uint64_t)); } } @@ -1715,7 +1715,7 @@ add_trace_bt (BackTrace *bt, TraceDesc *trace, uint64_t value) trace->size *= 2; if (trace->size == 0) trace->size = 4; - n = calloc (sizeof (CallContext) * trace->size, 1); + n = (CallContext *)calloc (sizeof (CallContext) * trace->size, 1); for (i = 0; i < old_size; ++i) { if (trace->traces [i].bt) add_trace_hashed (n, trace->size, trace->traces [i].bt, trace->traces [i].count); @@ -1761,9 +1761,9 @@ thread_add_root (ThreadContext *ctx, uintptr_t obj, int root_type, uintptr_t ext int new_size = ctx->size_roots * 2; if (!new_size) new_size = 4; - ctx->roots = realloc (ctx->roots, new_size * sizeof (uintptr_t)); - ctx->roots_extra = realloc (ctx->roots_extra, new_size * sizeof (uintptr_t)); - ctx->roots_types = realloc (ctx->roots_types, new_size * sizeof (int)); + ctx->roots = (uintptr_t *)realloc (ctx->roots, new_size * sizeof (uintptr_t)); + ctx->roots_extra = (uintptr_t *)realloc (ctx->roots_extra, new_size * sizeof (uintptr_t)); + ctx->roots_types = (int *)realloc (ctx->roots_types, new_size * sizeof (int)); ctx->size_roots = new_size; } ctx->roots_types [ctx->num_roots] = root_type; @@ -1774,8 +1774,8 @@ thread_add_root (ThreadContext *ctx, uintptr_t obj, int root_type, uintptr_t ext static int compare_callc (const void *a, const void *b) { - const CallContext *A = a; - const CallContext *B = b; + const CallContext *A = (const CallContext *)a; + const CallContext *B = (const CallContext *)b; if (B->count == A->count) return 0; if (B->count < A->count) @@ -1908,7 +1908,7 @@ lookup_monitor (uintptr_t objid) while (cd && cd->objid != objid) cd = cd->next; if (!cd) { - cd = calloc (sizeof (MonitorDesc), 1); + cd = (MonitorDesc *)calloc (sizeof (MonitorDesc), 1); cd->objid = objid; cd->next = monitor_hash [slot]; monitor_hash [slot] = cd; @@ -1963,7 +1963,7 @@ decode_bt (MethodDesc** sframes, int *size, unsigned char *p, unsigned char **en if (flags != 0) return NULL; if (count > *size) - frames = malloc (count * sizeof (void*)); + frames = (MethodDesc **)malloc (count * sizeof (void*)); else frames = sframes; for (i = 0; i < count; ++i) { @@ -2033,7 +2033,7 @@ static void found_object (uintptr_t obj) { num_tracked_objects ++; - tracked_objects = realloc (tracked_objects, num_tracked_objects * sizeof (tracked_objects [0])); + tracked_objects = (uintptr_t *)realloc (tracked_objects, num_tracked_objects * sizeof (tracked_objects [0])); tracked_objects [num_tracked_objects - 1] = obj; } @@ -2120,8 +2120,8 @@ static void gather_coverage_statements (void) { for (guint i = 0; i < coverage_statements->len; i++) { - CoverageCoverage *coverage = coverage_statements->pdata[i]; - CoverageMethod *method = g_hash_table_lookup (coverage_methods_hash, GINT_TO_POINTER (coverage->method_id)); + CoverageCoverage *coverage = (CoverageCoverage *)coverage_statements->pdata[i]; + CoverageMethod *method = (CoverageMethod *)g_hash_table_lookup (coverage_methods_hash, GINT_TO_POINTER (coverage->method_id)); if (method == NULL) { fprintf (outfile, "Cannot find method with ID: %d\n", coverage->method_id); continue; @@ -2163,7 +2163,7 @@ coverage_add_class (CoverageClass *klass) } g_ptr_array_add (coverage_classes, klass); - classes = g_hash_table_lookup (coverage_assembly_classes, klass->assembly_name); + classes = (GPtrArray *)g_hash_table_lookup (coverage_assembly_classes, klass->assembly_name); if (classes == NULL) { classes = g_ptr_array_new (); g_hash_table_insert (coverage_assembly_classes, klass->assembly_name, classes); @@ -2768,7 +2768,7 @@ decode_buffer (ProfContext *ctx) int codelen = decode_uleb128 (p, &p); const char *name; if (type == MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE) { - name = (void*)p; + name = (const char *)p; while (*p) p++; p++; } else { @@ -2877,7 +2877,7 @@ decode_buffer (ProfContext *ctx) type = decode_uleb128 (p, &p); - value = calloc (1, sizeof (CounterValue)); + value = (CounterValue *)calloc (1, sizeof (CounterValue)); value->timestamp = timestamp; switch (type) { @@ -2885,11 +2885,11 @@ decode_buffer (ProfContext *ctx) #if SIZEOF_VOID_P == 4 case MONO_COUNTER_WORD: #endif - value->buffer = malloc (sizeof (int32_t)); + value->buffer = (unsigned char *)malloc (sizeof (int32_t)); *(int32_t*)value->buffer = (int32_t)decode_sleb128 (p, &p) + (previous ? (*(int32_t*)previous->buffer) : 0); break; case MONO_COUNTER_UINT: - value->buffer = malloc (sizeof (uint32_t)); + value->buffer = (unsigned char *)malloc (sizeof (uint32_t)); *(uint32_t*)value->buffer = (uint32_t)decode_uleb128 (p, &p) + (previous ? (*(uint32_t*)previous->buffer) : 0); break; case MONO_COUNTER_LONG: @@ -2897,15 +2897,15 @@ decode_buffer (ProfContext *ctx) case MONO_COUNTER_WORD: #endif case MONO_COUNTER_TIME_INTERVAL: - value->buffer = malloc (sizeof (int64_t)); + value->buffer = (unsigned char *)malloc (sizeof (int64_t)); *(int64_t*)value->buffer = (int64_t)decode_sleb128 (p, &p) + (previous ? (*(int64_t*)previous->buffer) : 0); break; case MONO_COUNTER_ULONG: - value->buffer = malloc (sizeof (uint64_t)); + value->buffer = (unsigned char *)malloc (sizeof (uint64_t)); *(uint64_t*)value->buffer = (uint64_t)decode_uleb128 (p, &p) + (previous ? (*(uint64_t*)previous->buffer) : 0); break; case MONO_COUNTER_DOUBLE: - value->buffer = malloc (sizeof (double)); + value->buffer = (unsigned char *)malloc (sizeof (double)); #if TARGET_BYTE_ORDER == G_LITTLE_ENDIAN for (i = 0; i < sizeof (double); i++) #else @@ -2939,11 +2939,11 @@ decode_buffer (ProfContext *ctx) int token, n_offsets, method_id; p++; - assembly = (void *)p; while (*p) p++; p++; - klass = (void *)p; while (*p) p++; p++; - name = (void *)p; while (*p) p++; p++; - sig = (void *)p; while (*p) p++; p++; - filename = (void *)p; while (*p) p++; p++; + assembly = (const char *)p; while (*p) p++; p++; + klass = (const char *)p; while (*p) p++; p++; + name = (const char *)p; while (*p) p++; p++; + sig = (const char *)p; while (*p) p++; p++; + filename = (const char *)p; while (*p) p++; p++; token = decode_uleb128 (p, &p); method_id = decode_uleb128 (p, &p); @@ -2989,9 +2989,9 @@ decode_buffer (ProfContext *ctx) int number_of_methods, fully_covered, partially_covered; p++; - name = (void *)p; while (*p) p++; p++; - guid = (void *)p; while (*p) p++; p++; - filename = (void *)p; while (*p) p++; p++; + name = (char *)p; while (*p) p++; p++; + guid = (char *)p; while (*p) p++; p++; + filename = (char *)p; while (*p) p++; p++; number_of_methods = decode_uleb128 (p, &p); fully_covered = decode_uleb128 (p, &p); partially_covered = decode_uleb128 (p, &p); @@ -3012,8 +3012,8 @@ decode_buffer (ProfContext *ctx) int number_of_methods, fully_covered, partially_covered; p++; - assembly_name = (void *)p; while (*p) p++; p++; - class_name = (void *)p; while (*p) p++; p++; + assembly_name = (char *)p; while (*p) p++; p++; + class_name = (char *)p; while (*p) p++; p++; number_of_methods = decode_uleb128 (p, &p); fully_covered = decode_uleb128 (p, &p); partially_covered = decode_uleb128 (p, &p); @@ -3049,7 +3049,7 @@ static ProfContext* load_file (char *name) { unsigned char *p; - ProfContext *ctx = calloc (sizeof (ProfContext), 1); + ProfContext *ctx = (ProfContext *)calloc (sizeof (ProfContext), 1); if (strcmp (name, "-") == 0) ctx->file = stdin; else @@ -3091,8 +3091,8 @@ static int alloc_sort_mode = ALLOC_SORT_BYTES; static int compare_class (const void *a, const void *b) { - ClassDesc *const*A = a; - ClassDesc *const*B = b; + ClassDesc *const *A = (ClassDesc *const *)a; + ClassDesc *const *B = (ClassDesc *const *)b; uint64_t vala, valb; if (alloc_sort_mode == ALLOC_SORT_BYTES) { vala = (*A)->alloc_size; @@ -3190,8 +3190,8 @@ dump_exceptions (void) static int compare_monitor (const void *a, const void *b) { - MonitorDesc *const*A = a; - MonitorDesc *const*B = b; + MonitorDesc *const *A = (MonitorDesc *const *)a; + MonitorDesc *const *B = (MonitorDesc *const *)b; if ((*B)->wait_time == (*A)->wait_time) return 0; if ((*B)->wait_time < (*A)->wait_time) @@ -3206,7 +3206,7 @@ dump_monitors (void) int i, j; if (!num_monitors) return; - monitors = malloc (sizeof (void*) * num_monitors); + monitors = (MonitorDesc **)malloc (sizeof (void*) * num_monitors); for (i = 0, j = 0; i < SMALL_HASH_SIZE; ++i) { MonitorDesc *mdesc = monitor_hash [i]; while (mdesc) { @@ -3288,7 +3288,7 @@ dump_allocations (void) intptr_t allocs = 0; uint64_t size = 0; int header_done = 0; - ClassDesc **classes = malloc (num_classes * sizeof (void*)); + ClassDesc **classes = (ClassDesc **)malloc (num_classes * sizeof (void*)); ClassDesc *cd; c = 0; for (i = 0; i < HASH_SIZE; ++i) { @@ -3331,8 +3331,8 @@ static int method_sort_mode = METHOD_SORT_TOTAL; static int compare_method (const void *a, const void *b) { - MethodDesc *const*A = a; - MethodDesc *const*B = b; + MethodDesc *const *A = (MethodDesc *const *)a; + MethodDesc *const *B = (MethodDesc *const *)b; uint64_t vala, valb; if (method_sort_mode == METHOD_SORT_SELF) { vala = (*A)->self_time; @@ -3387,7 +3387,7 @@ dump_methods (void) int i, c; uint64_t calls = 0; int header_done = 0; - MethodDesc **methods = malloc (num_methods * sizeof (void*)); + MethodDesc **methods = (MethodDesc **)malloc (num_methods * sizeof (void*)); MethodDesc *cd; c = 0; for (i = 0; i < HASH_SIZE; ++i) { @@ -3428,8 +3428,8 @@ dump_methods (void) static int compare_heap_class (const void *a, const void *b) { - HeapClassDesc *const*A = a; - HeapClassDesc *const*B = b; + HeapClassDesc *const *A = (HeapClassDesc *const *)a; + HeapClassDesc *const *B = (HeapClassDesc *const *)b; uint64_t vala, valb; if (alloc_sort_mode == ALLOC_SORT_BYTES) { vala = (*A)->total_size; @@ -3448,8 +3448,8 @@ compare_heap_class (const void *a, const void *b) static int compare_rev_class (const void *a, const void *b) { - const HeapClassRevRef *A = a; - const HeapClassRevRef *B = b; + const HeapClassRevRef *A = (const HeapClassRevRef *)a; + const HeapClassRevRef *B = (const HeapClassRevRef *)b; if (B->count == A->count) return 0; if (B->count < A->count) @@ -3482,7 +3482,7 @@ heap_shot_summary (HeapShot *hs, int hs_num, HeapShot *last_hs) int i; HeapClassDesc *cd; HeapClassDesc **sorted; - sorted = malloc (sizeof (void*) * hs->class_count); + sorted = (HeapClassDesc **)malloc (sizeof (void*) * hs->class_count); for (i = 0; i < hs->hash_size; ++i) { cd = hs->class_hash [i]; if (!cd) @@ -3523,7 +3523,7 @@ heap_shot_summary (HeapShot *hs, int hs_num, HeapShot *last_hs) } if (!collect_traces) continue; - rev_sorted = malloc (cd->rev_count * sizeof (HeapClassRevRef)); + rev_sorted = (HeapClassRevRef *)malloc (cd->rev_count * sizeof (HeapClassRevRef)); k = 0; for (j = 0; j < cd->rev_hash_size; ++j) { if (cd->rev_hash [j].klass) @@ -3542,8 +3542,8 @@ heap_shot_summary (HeapShot *hs, int hs_num, HeapShot *last_hs) static int compare_heap_shots (const void *a, const void *b) { - HeapShot *const*A = a; - HeapShot *const*B = b; + HeapShot *const *A = (HeapShot *const *)a; + HeapShot *const *B = (HeapShot *const *)b; if ((*B)->timestamp == (*A)->timestamp) return 0; if ((*B)->timestamp > (*A)->timestamp) @@ -3560,7 +3560,7 @@ dump_heap_shots (void) int i; if (!heap_shots) return; - hs_sorted = malloc (num_heap_shots * sizeof (void*)); + hs_sorted = (HeapShot **)malloc (num_heap_shots * sizeof (void*)); fprintf (outfile, "\nHeap shot summary\n"); i = 0; for (hs = heap_shots; hs; hs = hs->next) @@ -3650,7 +3650,7 @@ dump_coverage (void) g_ptr_array_sort (coverage_assemblies, sort_assemblies); for (guint i = 0; i < coverage_assemblies->len; i++) { - CoverageAssembly *assembly = coverage_assemblies->pdata[i]; + CoverageAssembly *assembly = (CoverageAssembly *)coverage_assemblies->pdata[i]; GPtrArray *classes; if (assembly->number_of_methods != 0) { @@ -3670,10 +3670,10 @@ dump_coverage (void) g_free (escaped_filename); } - classes = g_hash_table_lookup (coverage_assembly_classes, assembly->name); + classes = (GPtrArray *)g_hash_table_lookup (coverage_assembly_classes, assembly->name); if (classes) { for (guint j = 0; j < classes->len; j++) { - CoverageClass *klass = classes->pdata[j]; + CoverageClass *klass = (CoverageClass *)classes->pdata [j]; if (klass->number_of_methods > 0) { int percentage = ((klass->fully_covered + klass->partially_covered) * 100) / klass->number_of_methods; @@ -3693,7 +3693,7 @@ dump_coverage (void) } for (guint i = 0; i < coverage_methods->len; i++) { - CoverageMethod *method = coverage_methods->pdata[i]; + CoverageMethod *method = (CoverageMethod *)coverage_methods->pdata [i]; if (coverage_outfile) { char *escaped_assembly, *escaped_class, *escaped_method, *escaped_sig, *escaped_filename; @@ -3713,7 +3713,7 @@ dump_coverage (void) g_free (escaped_filename); for (guint j = 0; j < method->coverage->len; j++) { - CoverageCoverage *coverage = method->coverage->pdata[j]; + CoverageCoverage *coverage = (CoverageCoverage *)method->coverage->pdata [j]; fprintf (coverage_outfile, "\t\t\n", coverage->offset, coverage->count, coverage->line, coverage->column); } fprintf (coverage_outfile, "\t\n"); diff --git a/mono/profiler/mono-profiler-aot.c b/mono/profiler/mono-profiler-aot.c index ba614b4de7e..79d80717aaa 100644 --- a/mono/profiler/mono-profiler-aot.c +++ b/mono/profiler/mono-profiler-aot.c @@ -124,7 +124,7 @@ prof_jit_leave (MonoProfiler *prof, MonoMethod *method, int result) MonoImage *image = mono_class_get_image (mono_method_get_class (method)); PerImageData *data; - data = g_hash_table_lookup (prof->images, image); + data = (PerImageData *)g_hash_table_lookup (prof->images, image); if (!data) { data = g_new0 (PerImageData, 1); g_hash_table_insert (prof->images, image, data); diff --git a/mono/profiler/mono-profiler-iomap.c b/mono/profiler/mono-profiler-iomap.c index bc0dd2c1b65..0dff9e98088 100644 --- a/mono/profiler/mono-profiler-iomap.c +++ b/mono/profiler/mono-profiler-iomap.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #define LOCATION_INDENT " " #define BACKTRACE_SIZE 64 @@ -112,7 +112,7 @@ static void mismatched_stats_foreach_func (gpointer key, gpointer value, gpointe return; } - location = g_hash_table_lookup (prof->string_locations_hash, &hash); + location = (StringLocation *)g_hash_table_lookup (prof->string_locations_hash, &hash); while (location) { if (location->hint && strlen (location->hint) > 0) { if (!bannerShown) { @@ -243,7 +243,7 @@ static gboolean saved_strings_find_func (gpointer key, gpointer value, gpointer static inline void store_string_location (MonoProfiler *prof, const gchar *string, guint32 hash, size_t len) { - StringLocation *location = g_hash_table_lookup (prof->string_locations_hash, &hash); + StringLocation *location = (StringLocation *)g_hash_table_lookup (prof->string_locations_hash, &hash); SavedString *saved; SavedStringFindInfo info; guint32 *hashptr; @@ -461,7 +461,7 @@ static void mono_portability_remember_string (MonoProfiler *prof, MonoDomain *do return; } - mono_mutex_lock (&mismatched_files_section); + mono_os_mutex_lock (&mismatched_files_section); head = (SavedString*)g_hash_table_lookup (prof->saved_strings_hash, (gpointer)str); if (head) { while (head->next) @@ -469,7 +469,7 @@ static void mono_portability_remember_string (MonoProfiler *prof, MonoDomain *do head->next = entry; } else g_hash_table_insert (prof->saved_strings_hash, (gpointer)str, (gpointer)entry); - mono_mutex_unlock (&mismatched_files_section); + mono_os_mutex_unlock (&mismatched_files_section); } static MonoClass *string_class = NULL; @@ -489,7 +489,7 @@ static void mono_portability_iomap_event (MonoProfiler *prof, const char *report if (!runtime_initialized) return; - mono_mutex_lock (&mismatched_files_section); + mono_os_mutex_lock (&mismatched_files_section); hash = calc_strings_hash (pathname, new_pathname, &pathnameHash); stats = (MismatchedFilesStats*)g_hash_table_lookup (prof->mismatched_files_hash, &hash); if (stats == NULL) { @@ -507,11 +507,11 @@ static void mono_portability_iomap_event (MonoProfiler *prof, const char *report g_error ("Out of memory allocating integer pointer for mismatched files hash table."); store_string_location (prof, (const gchar*)stats->requestedName, pathnameHash, strlen (stats->requestedName)); - mono_mutex_unlock (&mismatched_files_section); + mono_os_mutex_unlock (&mismatched_files_section); print_report ("%s - Found file path: '%s'\n", report, new_pathname); } else { - mono_mutex_unlock (&mismatched_files_section); + mono_os_mutex_unlock (&mismatched_files_section); stats->count++; } } @@ -525,14 +525,14 @@ static void runtime_initialized_cb (MonoProfiler *prof) static void profiler_shutdown (MonoProfiler *prof) { print_mismatched_stats (prof); - mono_mutex_destroy (&mismatched_files_section); + mono_os_mutex_destroy (&mismatched_files_section); } void mono_profiler_startup (const char *desc) { MonoProfiler *prof = g_new0 (MonoProfiler, 1); - mono_mutex_init (&mismatched_files_section); + mono_os_mutex_init (&mismatched_files_section); prof->mismatched_files_hash = g_hash_table_new (mismatched_files_guint32_hash, mismatched_files_guint32_equal); prof->saved_strings_hash = g_hash_table_new (NULL, NULL); prof->string_locations_hash = g_hash_table_new (mismatched_files_guint32_hash, mismatched_files_guint32_equal); @@ -542,5 +542,5 @@ void mono_profiler_startup (const char *desc) mono_profiler_install_iomap (mono_portability_iomap_event); mono_profiler_install_allocation (mono_portability_remember_alloc); - mono_profiler_set_events (MONO_PROFILE_ALLOCATIONS | MONO_PROFILE_IOMAP_EVENTS); + mono_profiler_set_events ((MonoProfileFlags)(MONO_PROFILE_ALLOCATIONS | MONO_PROFILE_IOMAP_EVENTS)); } diff --git a/mono/profiler/proflog.c b/mono/profiler/proflog.c index 83871f26892..9120ae06916 100644 --- a/mono/profiler/proflog.c +++ b/mono/profiler/proflog.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -522,7 +522,7 @@ static char* pstrdup (const char *s) { int len = strlen (s) + 1; - char *p = malloc (len); + char *p = (char *)malloc (len); memcpy (p, s, len); return p; } @@ -530,7 +530,7 @@ pstrdup (const char *s) static StatBuffer* create_stat_buffer (void) { - StatBuffer* buf = alloc_buffer (BUFFER_SIZE); + StatBuffer* buf = (StatBuffer *)alloc_buffer (BUFFER_SIZE); buf->size = BUFFER_SIZE; buf->data_end = (uintptr_t*)((unsigned char*)buf + buf->size); buf->data = buf->buf; @@ -540,7 +540,7 @@ create_stat_buffer (void) static LogBuffer* create_buffer (void) { - LogBuffer* buf = alloc_buffer (BUFFER_SIZE); + LogBuffer* buf = (LogBuffer *)alloc_buffer (BUFFER_SIZE); buf->size = BUFFER_SIZE; buf->time_base = current_time (); buf->last_time = buf->time_base; @@ -571,29 +571,29 @@ ensure_logbuf_inner (LogBuffer *old, int bytes) if (old && old->data + bytes + 100 < old->data_end) return old; - LogBuffer *new = create_buffer (); - new->thread_id = thread_id (); - new->next = old; + LogBuffer *new_ = (LogBuffer *)create_buffer (); + new_->thread_id = thread_id (); + new_->next = old; if (old) - new->call_depth = old->call_depth; + new_->call_depth = old->call_depth; - return new; + return new_; } static LogBuffer* ensure_logbuf (int bytes) { LogBuffer *old = TLS_GET (LogBuffer, tlsbuffer); - LogBuffer *new = ensure_logbuf_inner (old, bytes); + LogBuffer *new_ = ensure_logbuf_inner (old, bytes); - if (new == old) + if (new_ == old) return old; // Still enough space. - TLS_SET (tlsbuffer, new); + TLS_SET (tlsbuffer, new_); init_thread (); - return new; + return new_; } static void @@ -720,7 +720,7 @@ register_method_local (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *ji) */ //g_assert (ji); - MethodInfo *info = malloc (sizeof (MethodInfo)); + MethodInfo *info = (MethodInfo *)malloc (sizeof (MethodInfo)); info->method = method; info->ji = ji; @@ -845,7 +845,7 @@ dump_header (MonoProfiler *profiler) static void send_buffer (MonoProfiler *prof, GPtrArray *methods, LogBuffer *buffer) { - WriterQueueEntry *entry = calloc (1, sizeof (WriterQueueEntry)); + WriterQueueEntry *entry = (WriterQueueEntry *)calloc (1, sizeof (WriterQueueEntry)); mono_lock_free_queue_node_init (&entry->node, FALSE); entry->methods = methods; entry->buffer = buffer; @@ -1056,7 +1056,7 @@ static int num_frames = MAX_FRAMES; static mono_bool walk_stack (MonoMethod *method, int32_t native_offset, int32_t il_offset, mono_bool managed, void* data) { - FrameData *frame = data; + FrameData *frame = (FrameData *)data; if (method && frame->count < num_frames) { frame->il_offsets [frame->count] = il_offset; frame->native_offsets [frame->count] = native_offset; @@ -1271,7 +1271,7 @@ type_name (MonoClass *klass) char buf [1024]; char *p; push_nesting (buf, klass); - p = malloc (strlen (buf) + 1); + p = (char *)malloc (strlen (buf) + 1); strcpy (p, buf); return p; } @@ -1595,7 +1595,7 @@ code_buffer_new (MonoProfiler *prof, void *buffer, int size, MonoProfilerCodeBuf char *name; LogBuffer *logbuffer; if (type == MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE) { - name = data; + name = (char *)data; nlen = strlen (name) + 1; } else { name = NULL; @@ -1959,7 +1959,7 @@ typedef struct { static mono_bool async_walk_stack (MonoMethod *method, MonoDomain *domain, void *base_address, int offset, void *data) { - AsyncFrameData *frame = data; + AsyncFrameData *frame = (AsyncFrameData *)data; if (frame->count < num_frames) { frame->data [frame->count].method = method; frame->data [frame->count].domain = domain; @@ -2017,7 +2017,7 @@ mono_sample_hit (MonoProfiler *profiler, unsigned char *ip, void *context) do { oldsb = profiler->stat_buffers; sbuf->next = oldsb; - foundsb = InterlockedCompareExchangePointer ((void * volatile*)&profiler->stat_buffers, sbuf, oldsb); + foundsb = (StatBuffer *)InterlockedCompareExchangePointer ((void * volatile*)&profiler->stat_buffers, sbuf, oldsb); } while (foundsb != oldsb); if (do_debug) ign_res (write (2, "overflow\n", 9)); @@ -2032,7 +2032,7 @@ mono_sample_hit (MonoProfiler *profiler, unsigned char *ip, void *context) do { old_data = sbuf->data; new_data = old_data + SAMPLE_EVENT_SIZE_IN_SLOTS (bt_data.count); - data = InterlockedCompareExchangePointer ((void * volatile*)&sbuf->data, new_data, old_data); + data = (uintptr_t *)InterlockedCompareExchangePointer ((void * volatile*)&sbuf->data, new_data, old_data); } while (data != old_data); if (old_data >= sbuf->data_end) return; /* lost event */ @@ -2089,7 +2089,7 @@ add_code_pointer (uintptr_t ip) size_code_pages *= 2; if (size_code_pages == 0) size_code_pages = 16; - n = calloc (sizeof (uintptr_t) * size_code_pages, 1); + n = (uintptr_t *)calloc (sizeof (uintptr_t) * size_code_pages, 1); for (i = 0; i < old_size; ++i) { if (code_pages [i]) add_code_page (n, size_code_pages, code_pages [i]); @@ -2425,7 +2425,7 @@ dump_sample_hits (MonoProfiler *prof, StatBuffer *sbuf) g_ptr_array_sort (prof->sorted_sample_events, compare_sample_events); for (guint sidx = 0; sidx < prof->sorted_sample_events->len; sidx++) { - uintptr_t *sample = g_ptr_array_index (prof->sorted_sample_events, sidx); + uintptr_t *sample = (uintptr_t *)g_ptr_array_index (prof->sorted_sample_events, sidx); int count = sample [0] & 0xff; int mbt_count = (sample [0] & 0xff00) >> 8; int type = sample [0] >> 16; @@ -2438,7 +2438,7 @@ dump_sample_hits (MonoProfiler *prof, StatBuffer *sbuf) void *address = (void*)managed_sample_base [i * 4 + 2]; if (!method) { - MonoJitInfo *ji = mono_jit_info_table_find (domain, address); + MonoJitInfo *ji = mono_jit_info_table_find (domain, (char *)address); if (ji) managed_sample_base [i * 4 + 0] = (uintptr_t)mono_jit_info_get_method (ji); @@ -2781,7 +2781,7 @@ counters_add_agent (MonoCounter *counter) if (!counters_initialized) return; - mono_mutex_lock (&counters_mutex); + mono_os_mutex_lock (&counters_mutex); for (agent = counters; agent; agent = agent->next) { if (agent->counter == counter) { @@ -2790,12 +2790,12 @@ counters_add_agent (MonoCounter *counter) free (agent->value); agent->value = NULL; } - mono_mutex_unlock (&counters_mutex); + mono_os_mutex_unlock (&counters_mutex); return; } } - agent = malloc (sizeof (MonoCounterAgent)); + agent = (MonoCounterAgent *)malloc (sizeof (MonoCounterAgent)); agent->counter = counter; agent->value = NULL; agent->value_size = 0; @@ -2812,7 +2812,7 @@ counters_add_agent (MonoCounter *counter) item->next = agent; } - mono_mutex_unlock (&counters_mutex); + mono_os_mutex_unlock (&counters_mutex); } static mono_bool @@ -2827,7 +2827,7 @@ counters_init (MonoProfiler *profiler) { assert (!counters_initialized); - mono_mutex_init (&counters_mutex); + mono_os_mutex_init (&counters_mutex); counters_initialized = TRUE; @@ -2849,7 +2849,7 @@ counters_emit (MonoProfiler *profiler) if (!counters_initialized) return; - mono_mutex_lock (&counters_mutex); + mono_os_mutex_lock (&counters_mutex); for (agent = counters; agent; agent = agent->next) { if (agent->emitted) @@ -2868,7 +2868,7 @@ counters_emit (MonoProfiler *profiler) } if (!len) { - mono_mutex_unlock (&counters_mutex); + mono_os_mutex_unlock (&counters_mutex); return; } @@ -2897,7 +2897,7 @@ counters_emit (MonoProfiler *profiler) safe_send (profiler, logbuffer); - mono_mutex_unlock (&counters_mutex); + mono_os_mutex_unlock (&counters_mutex); } static void @@ -2919,7 +2919,7 @@ counters_sample (MonoProfiler *profiler, uint64_t timestamp) buffer_size = 8; buffer = calloc (1, buffer_size); - mono_mutex_lock (&counters_mutex); + mono_os_mutex_lock (&counters_mutex); size = EVENT_SIZE /* event */ + @@ -3028,7 +3028,7 @@ counters_sample (MonoProfiler *profiler, uint64_t timestamp) safe_send (profiler, logbuffer); - mono_mutex_unlock (&counters_mutex); + mono_os_mutex_unlock (&counters_mutex); } typedef struct _PerfCounterAgent PerfCounterAgent; @@ -3144,7 +3144,7 @@ perfcounters_sample (MonoProfiler *profiler, uint64_t timestamp) if (!counters_initialized) return; - mono_mutex_lock (&counters_mutex); + mono_os_mutex_lock (&counters_mutex); /* mark all perfcounters as deleted, foreach will unmark them as necessary */ for (pcagent = perfcounters; pcagent; pcagent = pcagent->next) @@ -3194,7 +3194,7 @@ perfcounters_sample (MonoProfiler *profiler, uint64_t timestamp) safe_send (profiler, logbuffer); - mono_mutex_unlock (&counters_mutex); + mono_os_mutex_unlock (&counters_mutex); } static void @@ -3275,7 +3275,7 @@ parse_generic_type_names(char *name) if (name == NULL || *name == '\0') return g_strdup (""); - if (!(ret = new_name = calloc (strlen (name) * 4 + 1, sizeof (char)))) + if (!(ret = new_name = (char *)calloc (strlen (name) * 4 + 1, sizeof (char)))) return NULL; do { @@ -3340,7 +3340,7 @@ build_method_buffer (gpointer key, gpointer value, gpointer userdata) method_name = mono_method_get_name (method); if (coverage_data->len != 0) { - CoverageEntry *entry = coverage_data->pdata[0]; + CoverageEntry *entry = (CoverageEntry *)coverage_data->pdata[0]; first_filename = entry->filename ? entry->filename : ""; } else first_filename = ""; @@ -3377,7 +3377,7 @@ build_method_buffer (gpointer key, gpointer value, gpointer userdata) safe_send (prof, logbuffer); for (i = 0; i < coverage_data->len; i++) { - CoverageEntry *entry = coverage_data->pdata[i]; + CoverageEntry *entry = (CoverageEntry *)coverage_data->pdata[i]; logbuffer = ensure_logbuf ( EVENT_SIZE /* event */ + @@ -3473,7 +3473,7 @@ build_class_buffer (gpointer key, gpointer value, gpointer userdata) static void get_coverage_for_image (MonoImage *image, int *number_of_methods, guint *fully_covered, int *partially_covered) { - MonoLockFreeQueue *image_methods = mono_conc_hashtable_lookup (image_to_methods, image); + MonoLockFreeQueue *image_methods = (MonoLockFreeQueue *)mono_conc_hashtable_lookup (image_to_methods, image); *number_of_methods = mono_image_get_table_rows (image, MONO_TABLE_METHOD); if (image_methods) @@ -3538,11 +3538,11 @@ dump_coverage (MonoProfiler *prof) COVERAGE_DEBUG(fprintf (stderr, "Coverage: Started dump\n");) method_id = 0; - mono_mutex_lock (&coverage_mutex); + mono_os_mutex_lock (&coverage_mutex); mono_conc_hashtable_foreach (coverage_assemblies, build_assembly_buffer, prof); mono_conc_hashtable_foreach (coverage_classes, build_class_buffer, prof); mono_conc_hashtable_foreach (coverage_methods, build_method_buffer, prof); - mono_mutex_unlock (&coverage_mutex); + mono_os_mutex_unlock (&coverage_mutex); COVERAGE_DEBUG(fprintf (stderr, "Coverage: Finished dump\n");) } @@ -3562,15 +3562,15 @@ process_method_enter_coverage (MonoProfiler *prof, MonoMethod *method) if (mono_conc_hashtable_lookup (suppressed_assemblies, (gpointer) mono_image_get_name (image))) return; - mono_mutex_lock (&coverage_mutex); + mono_os_mutex_lock (&coverage_mutex); mono_conc_hashtable_insert (entered_methods, method, method); - mono_mutex_unlock (&coverage_mutex); + mono_os_mutex_unlock (&coverage_mutex); } static MonoLockFreeQueueNode * create_method_node (MonoMethod *method) { - MethodNode *node = g_malloc (sizeof (MethodNode)); + MethodNode *node = (MethodNode *)g_malloc (sizeof (MethodNode)); mono_lock_free_queue_node_init ((MonoLockFreeQueueNode *) node, FALSE); node->method = method; @@ -3631,7 +3631,7 @@ coverage_filter (MonoProfiler *prof, MonoMethod *method) has_positive = FALSE; found = FALSE; for (guint i = 0; i < prof->coverage_filters->len; ++i) { - char *filter = g_ptr_array_index (prof->coverage_filters, i); + char *filter = (char *)g_ptr_array_index (prof->coverage_filters, i); if (filter [0] == '+') { filter = &filter [1]; @@ -3651,9 +3651,9 @@ coverage_filter (MonoProfiler *prof, MonoMethod *method) if (has_positive && !found) { COVERAGE_DEBUG(fprintf (stderr, " Positive match was not found\n");) - mono_mutex_lock (&coverage_mutex); + mono_os_mutex_lock (&coverage_mutex); mono_conc_hashtable_insert (filtered_classes, klass, klass); - mono_mutex_unlock (&coverage_mutex); + mono_os_mutex_unlock (&coverage_mutex); g_free (fqn); g_free (classname); @@ -3662,7 +3662,7 @@ coverage_filter (MonoProfiler *prof, MonoMethod *method) for (guint i = 0; i < prof->coverage_filters->len; ++i) { // FIXME: Is substring search sufficient? - char *filter = g_ptr_array_index (prof->coverage_filters, i); + char *filter = (char *)g_ptr_array_index (prof->coverage_filters, i); if (filter [0] == '+') continue; @@ -3673,9 +3673,9 @@ coverage_filter (MonoProfiler *prof, MonoMethod *method) if (strstr (fqn, filter) != NULL) { COVERAGE_DEBUG(fprintf (stderr, "matched\n");) - mono_mutex_lock (&coverage_mutex); + mono_os_mutex_lock (&coverage_mutex); mono_conc_hashtable_insert (filtered_classes, klass, klass); - mono_mutex_unlock (&coverage_mutex); + mono_os_mutex_unlock (&coverage_mutex); g_free (fqn); g_free (classname); @@ -3696,32 +3696,32 @@ coverage_filter (MonoProfiler *prof, MonoMethod *method) assembly = mono_image_get_assembly (image); - mono_mutex_lock (&coverage_mutex); + mono_os_mutex_lock (&coverage_mutex); mono_conc_hashtable_insert (coverage_methods, method, method); mono_conc_hashtable_insert (coverage_assemblies, assembly, assembly); - mono_mutex_unlock (&coverage_mutex); + mono_os_mutex_unlock (&coverage_mutex); - image_methods = mono_conc_hashtable_lookup (image_to_methods, image); + image_methods = (MonoLockFreeQueue *)mono_conc_hashtable_lookup (image_to_methods, image); if (image_methods == NULL) { - image_methods = g_malloc (sizeof (MonoLockFreeQueue)); + image_methods = (MonoLockFreeQueue *)g_malloc (sizeof (MonoLockFreeQueue)); mono_lock_free_queue_init (image_methods); - mono_mutex_lock (&coverage_mutex); + mono_os_mutex_lock (&coverage_mutex); mono_conc_hashtable_insert (image_to_methods, image, image_methods); - mono_mutex_unlock (&coverage_mutex); + mono_os_mutex_unlock (&coverage_mutex); } node = create_method_node (method); mono_lock_free_queue_enqueue (image_methods, node); - class_methods = mono_conc_hashtable_lookup (coverage_classes, klass); + class_methods = (MonoLockFreeQueue *)mono_conc_hashtable_lookup (coverage_classes, klass); if (class_methods == NULL) { - class_methods = g_malloc (sizeof (MonoLockFreeQueue)); + class_methods = (MonoLockFreeQueue *)g_malloc (sizeof (MonoLockFreeQueue)); mono_lock_free_queue_init (class_methods); - mono_mutex_lock (&coverage_mutex); + mono_os_mutex_lock (&coverage_mutex); mono_conc_hashtable_insert (coverage_classes, klass, class_methods); - mono_mutex_unlock (&coverage_mutex); + mono_os_mutex_unlock (&coverage_mutex); } node = create_method_node (method); @@ -3756,7 +3756,7 @@ get_file_content (FILE *stream) if (filesize > MAX_FILE_SIZE) return NULL; - buffer = g_malloc ((filesize + 1) * sizeof (char)); + buffer = (char *)g_malloc ((filesize + 1) * sizeof (char)); while ((bytes_read = fread (buffer + offset, 1, LINE_BUFFER_SIZE, stream)) > 0) offset += bytes_read; @@ -3824,7 +3824,7 @@ coverage_init (MonoProfiler *prof) COVERAGE_DEBUG(fprintf (stderr, "Coverage initialized\n");) - mono_mutex_init (&coverage_mutex); + mono_os_mutex_init (&coverage_mutex); coverage_methods = mono_conc_hashtable_new (NULL, NULL); coverage_assemblies = mono_conc_hashtable_new (NULL, NULL); coverage_classes = mono_conc_hashtable_new (NULL, NULL); @@ -3883,7 +3883,7 @@ log_shutdown (MonoProfiler *prof) fclose (prof->file); mono_conc_hashtable_destroy (prof->method_table); - mono_mutex_destroy (&prof->method_table_mutex); + mono_os_mutex_destroy (&prof->method_table_mutex); if (coverage_initialized) { mono_conc_hashtable_destroy (coverage_methods); @@ -3894,7 +3894,7 @@ log_shutdown (MonoProfiler *prof) mono_conc_hashtable_destroy (entered_methods); mono_conc_hashtable_destroy (image_to_methods); mono_conc_hashtable_destroy (suppressed_assemblies); - mono_mutex_destroy (&coverage_mutex); + mono_os_mutex_destroy (&coverage_mutex); } free (prof); @@ -3932,7 +3932,7 @@ new_filename (const char* filename) 1900 + ts->tm_year, 1 + ts->tm_mon, ts->tm_mday, ts->tm_hour, ts->tm_min, ts->tm_sec); s_date = strlen (time_buf); s_pid = strlen (pid_buf); - d = res = malloc (strlen (filename) + s_date * count_dates + s_pid * count_pids); + d = res = (char *)malloc (strlen (filename) + s_date * count_dates + s_pid * count_pids); for (p = filename; *p; p++) { if (*p != '%') { *d++ = *p; @@ -3967,7 +3967,7 @@ extern void mono_threads_attach_tools_thread (void); static void* helper_thread (void* arg) { - MonoProfiler* prof = arg; + MonoProfiler* prof = (MonoProfiler *)arg; int command_socket; int len; char buf [64]; @@ -4153,7 +4153,7 @@ start_helper_thread (MonoProfiler* prof) static void * writer_thread (void *arg) { - MonoProfiler *prof = arg; + MonoProfiler *prof = (MonoProfiler *)arg; mono_threads_attach_tools_thread (); @@ -4175,7 +4175,7 @@ writer_thread (void *arg) * methods have metadata emitted before they're referenced. */ for (guint i = 0; i < entry->methods->len; i++) { - MethodInfo *info = g_ptr_array_index (entry->methods, i); + MethodInfo *info = (MethodInfo *)g_ptr_array_index (entry->methods, i); if (mono_conc_hashtable_lookup (prof->method_table, info->method)) continue; @@ -4192,9 +4192,9 @@ writer_thread (void *arg) * method lists will just be empty for the rest of the * app's lifetime. */ - mono_mutex_lock (&prof->method_table_mutex); + mono_os_mutex_lock (&prof->method_table_mutex); mono_conc_hashtable_insert (prof->method_table, info->method, info->method); - mono_mutex_unlock (&prof->method_table_mutex); + mono_os_mutex_unlock (&prof->method_table_mutex); char *name = mono_method_full_name (info->method, 1); int nlen = strlen (name) + 1; @@ -4274,7 +4274,7 @@ create_profiler (const char *filename, GPtrArray *filters) MonoProfiler *prof; char *nf; int force_delete = 0; - prof = calloc (1, sizeof (MonoProfiler)); + prof = (MonoProfiler *)calloc (1, sizeof (MonoProfiler)); prof->command_port = command_port; if (filename && *filename == '-') { @@ -4291,7 +4291,7 @@ create_profiler (const char *filename, GPtrArray *filters) nf = new_filename (filename); if (do_report) { int s = strlen (nf) + 32; - char *p = malloc (s); + char *p = (char *)malloc (s); snprintf (p, s, "|mprof-report '--out=%s' -", nf); free (nf); nf = p; @@ -4344,7 +4344,7 @@ create_profiler (const char *filename, GPtrArray *filters) #endif mono_lock_free_queue_init (&prof->writer_queue); - mono_mutex_init (&prof->method_table_mutex); + mono_os_mutex_init (&prof->method_table_mutex); prof->method_table = mono_conc_hashtable_new (NULL, NULL); if (do_coverage) @@ -4404,7 +4404,7 @@ match_option (const char* p, const char *opt, char **rval) } else { l = end - opt; } - val = malloc (l + 1); + val = (char *)malloc (l + 1); memcpy (val, opt, l); val [l] = 0; *rval = val; @@ -4756,7 +4756,7 @@ mono_profiler_startup (const char *desc) mono_profiler_install_statistical (mono_sample_hit); } - mono_profiler_set_events (events); + mono_profiler_set_events ((MonoProfileFlags)events); TLS_INIT (tlsbuffer); TLS_INIT (tlsmethodlist); diff --git a/mono/sgen/gc-internal-agnostic.h b/mono/sgen/gc-internal-agnostic.h index 6b8a1a3dda8..a609c69d86f 100644 --- a/mono/sgen/gc-internal-agnostic.h +++ b/mono/sgen/gc-internal-agnostic.h @@ -67,7 +67,7 @@ typedef enum { #define MONO_GC_HANDLE_TYPE_SHIFT (3) #define MONO_GC_HANDLE_TYPE_MASK ((1 << MONO_GC_HANDLE_TYPE_SHIFT) - 1) -#define MONO_GC_HANDLE_TYPE(x) (((x) & MONO_GC_HANDLE_TYPE_MASK) - 1) +#define MONO_GC_HANDLE_TYPE(x) ((GCHandleType)(((x) & MONO_GC_HANDLE_TYPE_MASK) - 1)) #define MONO_GC_HANDLE_SLOT(x) ((x) >> MONO_GC_HANDLE_TYPE_SHIFT) #define MONO_GC_HANDLE_TYPE_IS_WEAK(x) ((x) <= HANDLE_WEAK_TRACK) #define MONO_GC_HANDLE(slot, type) (((slot) << MONO_GC_HANDLE_TYPE_SHIFT) | (((type) & MONO_GC_HANDLE_TYPE_MASK) + 1)) diff --git a/mono/sgen/sgen-alloc.c b/mono/sgen/sgen-alloc.c index 413388810f8..0832bc161fe 100644 --- a/mono/sgen/sgen-alloc.c +++ b/mono/sgen/sgen-alloc.c @@ -196,7 +196,7 @@ sgen_alloc_obj_nolock (GCVTable vtable, size_t size) */ if (real_size > SGEN_MAX_SMALL_OBJ_SIZE) { - p = sgen_los_alloc_large_inner (vtable, ALIGN_UP (real_size)); + p = (void **)sgen_los_alloc_large_inner (vtable, ALIGN_UP (real_size)); } else { /* tlab_next and tlab_temp_end are TLS vars so accessing them might be expensive */ @@ -252,7 +252,7 @@ sgen_alloc_obj_nolock (GCVTable vtable, size_t size) available_in_tlab = (int)(TLAB_REAL_END - TLAB_NEXT);//We'll never have tlabs > 2Gb if (size > tlab_size || available_in_tlab > SGEN_MAX_NURSERY_WASTE) { /* Allocate directly from the nursery */ - p = sgen_nursery_alloc (size); + p = (void **)sgen_nursery_alloc (size); if (!p) { /* * We couldn't allocate from the nursery, so we try @@ -273,7 +273,7 @@ sgen_alloc_obj_nolock (GCVTable vtable, size_t size) */ sgen_ensure_free_space (real_size); if (!degraded_mode) - p = sgen_nursery_alloc (size); + p = (void **)sgen_nursery_alloc (size); } if (!p) return alloc_degraded (vtable, size, FALSE); @@ -285,12 +285,12 @@ sgen_alloc_obj_nolock (GCVTable vtable, size_t size) SGEN_LOG (3, "Retire TLAB: %p-%p [%ld]", TLAB_START, TLAB_REAL_END, (long)(TLAB_REAL_END - TLAB_NEXT - size)); sgen_nursery_retire_region (p, available_in_tlab); - p = sgen_nursery_alloc_range (tlab_size, size, &alloc_size); + p = (void **)sgen_nursery_alloc_range (tlab_size, size, &alloc_size); if (!p) { /* See comment above in similar case. */ sgen_ensure_free_space (tlab_size); if (!degraded_mode) - p = sgen_nursery_alloc_range (tlab_size, size, &alloc_size); + p = (void **)sgen_nursery_alloc_range (tlab_size, size, &alloc_size); } if (!p) return alloc_degraded (vtable, size, FALSE); @@ -304,7 +304,7 @@ sgen_alloc_obj_nolock (GCVTable vtable, size_t size) zero_tlab_if_necessary (TLAB_START, alloc_size); /* Allocate from the TLAB */ - p = (void*)TLAB_NEXT; + p = (void **)TLAB_NEXT; TLAB_NEXT += size; sgen_set_nursery_scan_start ((char*)p); } @@ -349,7 +349,7 @@ sgen_try_alloc_obj_nolock (GCVTable vtable, size_t size) if (G_UNLIKELY (size > tlab_size)) { /* Allocate directly from the nursery */ - p = sgen_nursery_alloc (size); + p = (void **)sgen_nursery_alloc (size); if (!p) return NULL; sgen_set_nursery_scan_start ((char*)p); @@ -380,7 +380,7 @@ sgen_try_alloc_obj_nolock (GCVTable vtable, size_t size) } } else if (available_in_tlab > SGEN_MAX_NURSERY_WASTE) { /* Allocate directly from the nursery */ - p = sgen_nursery_alloc (size); + p = (void **)sgen_nursery_alloc (size); if (!p) return NULL; @@ -389,7 +389,7 @@ sgen_try_alloc_obj_nolock (GCVTable vtable, size_t size) size_t alloc_size = 0; sgen_nursery_retire_region (p, available_in_tlab); - new_next = sgen_nursery_alloc_range (tlab_size, size, &alloc_size); + new_next = (char *)sgen_nursery_alloc_range (tlab_size, size, &alloc_size); p = (void**)new_next; if (!p) return NULL; @@ -478,7 +478,7 @@ sgen_alloc_obj_pinned (GCVTable vtable, size_t size) if (size > SGEN_MAX_SMALL_OBJ_SIZE) { /* large objects are always pinned anyway */ - p = sgen_los_alloc_large_inner (vtable, size); + p = (GCObject *)sgen_los_alloc_large_inner (vtable, size); } else { SGEN_ASSERT (9, sgen_client_vtable_is_inited (vtable), "class %s:%s is not initialized", sgen_client_vtable_get_namespace (vtable), sgen_client_vtable_get_name (vtable)); p = major_collector.alloc_small_pinned_obj (vtable, size, SGEN_VTABLE_HAS_REFERENCES (vtable)); diff --git a/mono/sgen/sgen-cardtable.c b/mono/sgen/sgen-cardtable.c index 21da2d0df84..b6e9479f147 100644 --- a/mono/sgen/sgen-cardtable.c +++ b/mono/sgen/sgen-cardtable.c @@ -86,8 +86,8 @@ sgen_card_table_wbarrier_set_field (GCObject *obj, gpointer field_ptr, GCObject* static void sgen_card_table_wbarrier_arrayref_copy (gpointer dest_ptr, gpointer src_ptr, int count) { - gpointer *dest = dest_ptr; - gpointer *src = src_ptr; + gpointer *dest = (gpointer *)dest_ptr; + gpointer *src = (gpointer *)src_ptr; /*overlapping that required backward copying*/ if (src < dest && (src + count) > dest) { @@ -284,7 +284,7 @@ sgen_card_table_find_address (char *addr) static gboolean sgen_card_table_find_address_with_cards (char *cards_start, guint8 *cards, char *addr) { - cards_start = sgen_card_table_align_pointer (cards_start); + cards_start = (char *)sgen_card_table_align_pointer (cards_start); return cards [(addr - cards_start) >> CARD_BITS]; } @@ -292,15 +292,18 @@ static void update_mod_union (guint8 *dest, guint8 *start_card, size_t num_cards) { int i; - for (i = 0; i < num_cards; ++i) - dest [i] |= start_card [i]; + /* Marking from another thread can happen while we mark here */ + for (i = 0; i < num_cards; ++i) { + if (start_card [i]) + dest [i] = 1; + } } guint8* sgen_card_table_alloc_mod_union (char *obj, mword obj_size) { size_t num_cards = sgen_card_table_number_of_cards_in_range ((mword) obj, obj_size); - guint8 *mod_union = sgen_alloc_internal_dynamic (num_cards, INTERNAL_MEM_CARDTABLE_MOD_UNION, TRUE); + guint8 *mod_union = (guint8 *)sgen_alloc_internal_dynamic (num_cards, INTERNAL_MEM_CARDTABLE_MOD_UNION, TRUE); memset (mod_union, 0, num_cards); return mod_union; } @@ -570,10 +573,10 @@ sgen_card_tables_collect_stats (gboolean begin) void sgen_card_table_init (SgenRememberedSet *remset) { - sgen_cardtable = sgen_alloc_os_memory (CARD_COUNT_IN_BYTES, SGEN_ALLOC_INTERNAL | SGEN_ALLOC_ACTIVATE, "card table"); + sgen_cardtable = (guint8 *)sgen_alloc_os_memory (CARD_COUNT_IN_BYTES, (SgenAllocFlags)(SGEN_ALLOC_INTERNAL | SGEN_ALLOC_ACTIVATE), "card table"); #ifdef SGEN_HAVE_OVERLAPPING_CARDS - sgen_shadow_cardtable = sgen_alloc_os_memory (CARD_COUNT_IN_BYTES, SGEN_ALLOC_INTERNAL | SGEN_ALLOC_ACTIVATE, "shadow card table"); + sgen_shadow_cardtable = (guint8 *)sgen_alloc_os_memory (CARD_COUNT_IN_BYTES, (SgenAllocFlags)(SGEN_ALLOC_INTERNAL | SGEN_ALLOC_ACTIVATE), "shadow card table"); #endif #ifdef HEAVY_STATISTICS diff --git a/mono/sgen/sgen-copy-object.h b/mono/sgen/sgen-copy-object.h index 847269d5d72..2b7bc60670a 100644 --- a/mono/sgen/sgen-copy-object.h +++ b/mono/sgen/sgen-copy-object.h @@ -50,15 +50,15 @@ par_copy_object_no_checks (char *destination, GCVTable vt, void *obj, mword objs obj = destination; if (queue) { SGEN_LOG (9, "Enqueuing gray object %p (%s)", obj, sgen_client_vtable_get_name (vt)); - GRAY_OBJECT_ENQUEUE (queue, obj, sgen_vtable_get_descriptor (vt)); + GRAY_OBJECT_ENQUEUE (queue, (GCObject *)obj, sgen_vtable_get_descriptor (vt)); } } /* * This can return OBJ itself on OOM. */ -static MONO_NEVER_INLINE void* -copy_object_no_checks (void *obj, SgenGrayQueue *queue) +static MONO_NEVER_INLINE GCObject * +copy_object_no_checks (GCObject *obj, SgenGrayQueue *queue) { GCVTable vt = SGEN_LOAD_VTABLE_UNCHECKED (obj); gboolean has_references = SGEN_VTABLE_HAS_REFERENCES (vt); @@ -76,11 +76,11 @@ copy_object_no_checks (void *obj, SgenGrayQueue *queue) if (!has_references) queue = NULL; - par_copy_object_no_checks (destination, vt, obj, objsize, queue); + par_copy_object_no_checks ((char *)destination, vt, obj, objsize, queue); /* FIXME: mark mod union cards if necessary */ /* set the forwarding pointer */ SGEN_FORWARD_OBJECT (obj, destination); - return destination; + return (GCObject *)destination; } diff --git a/mono/sgen/sgen-debug.c b/mono/sgen/sgen-debug.c index 79e23ed453b..a7f61cc8f4e 100644 --- a/mono/sgen/sgen-debug.c +++ b/mono/sgen/sgen-debug.c @@ -113,7 +113,7 @@ describe_pointer (char *ptr, gboolean need_setup) if (object_is_pinned (ptr)) printf ("Object is pinned.\n"); - if ((forwarded = object_is_forwarded (ptr))) { + if ((forwarded = (char *)object_is_forwarded (ptr))) { printf ("Object is forwarded to %p:\n", forwarded); ptr = forwarded; goto restart; @@ -334,7 +334,7 @@ static void setup_valid_nursery_objects (void) { if (!valid_nursery_objects) - valid_nursery_objects = sgen_alloc_os_memory (DEFAULT_NURSERY_SIZE, SGEN_ALLOC_INTERNAL | SGEN_ALLOC_ACTIVATE, "debugging data"); + valid_nursery_objects = (GCObject **)sgen_alloc_os_memory (DEFAULT_NURSERY_SIZE, (SgenAllocFlags)(SGEN_ALLOC_INTERNAL | SGEN_ALLOC_ACTIVATE), "debugging data"); valid_nursery_object_count = 0; sgen_scan_area_with_callback (nursery_section->data, nursery_section->end_data, setup_mono_sgen_scan_area_with_callback, NULL, FALSE, FALSE); } @@ -542,7 +542,7 @@ find_pinning_reference (char *obj, size_t size) RootRecord *root; char *endobj = obj + size; - SGEN_HASH_TABLE_FOREACH (&roots_hash [ROOT_TYPE_NORMAL], start, root) { + SGEN_HASH_TABLE_FOREACH (&roots_hash [ROOT_TYPE_NORMAL], char **, start, RootRecord *, root) { /* if desc is non-null it has precise info */ if (!root->root_desc) { while (start < (char**)root->end_root) { @@ -786,7 +786,7 @@ scan_roots_for_specific_ref (GCObject *key, int root_type) RootRecord *root; check_key = key; - SGEN_HASH_TABLE_FOREACH (&roots_hash [root_type], start_root, root) { + SGEN_HASH_TABLE_FOREACH (&roots_hash [root_type], void **, start_root, RootRecord *, root) { SgenDescriptor desc = root->root_desc; check_root = root; @@ -796,13 +796,13 @@ scan_roots_for_specific_ref (GCObject *key, int root_type) desc >>= ROOT_DESC_TYPE_SHIFT; while (desc) { if (desc & 1) - check_root_obj_specific_ref (root, key, *start_root); + check_root_obj_specific_ref (root, key, (GCObject *)*start_root); desc >>= 1; start_root++; } return; case ROOT_DESC_COMPLEX: { - gsize *bitmap_data = sgen_get_complex_descriptor_bitmap (desc); + gsize *bitmap_data = (gsize *)sgen_get_complex_descriptor_bitmap (desc); int bwords = (int) ((*bitmap_data) - 1); void **start_run = start_root; bitmap_data++; @@ -811,7 +811,7 @@ scan_roots_for_specific_ref (GCObject *key, int root_type) void **objptr = start_run; while (bmap) { if (bmap & 1) - check_root_obj_specific_ref (root, key, *objptr); + check_root_obj_specific_ref (root, key, (GCObject *)*objptr); bmap >>= 1; ++objptr; } @@ -853,9 +853,9 @@ mono_gc_scan_for_specific_ref (GCObject *key, gboolean precise) scan_roots_for_specific_ref (key, ROOT_TYPE_NORMAL); scan_roots_for_specific_ref (key, ROOT_TYPE_WBARRIER); - SGEN_HASH_TABLE_FOREACH (&roots_hash [ROOT_TYPE_PINNED], ptr, root) { + SGEN_HASH_TABLE_FOREACH (&roots_hash [ROOT_TYPE_PINNED], void **, ptr, RootRecord *, root) { while (ptr < (void**)root->end_root) { - check_root_obj_specific_ref (root, *ptr, key); + check_root_obj_specific_ref (root, (GCObject *)*ptr, key); ++ptr; } } SGEN_HASH_TABLE_FOREACH_END; @@ -887,7 +887,7 @@ sgen_scan_for_registered_roots_in_domain (MonoDomain *domain, int root_type) void **start_root; RootRecord *root; check_domain = domain; - SGEN_HASH_TABLE_FOREACH (&roots_hash [root_type], start_root, root) { + SGEN_HASH_TABLE_FOREACH (&roots_hash [root_type], void **, start_root, RootRecord *, root) { SgenDescriptor desc = root->root_desc; /* The MonoDomain struct is allowed to hold @@ -900,13 +900,13 @@ sgen_scan_for_registered_roots_in_domain (MonoDomain *domain, int root_type) desc >>= ROOT_DESC_TYPE_SHIFT; while (desc) { if ((desc & 1) && *start_root) - check_obj_not_in_domain (*start_root); + check_obj_not_in_domain ((MonoObject **)*start_root); desc >>= 1; start_root++; } break; case ROOT_DESC_COMPLEX: { - gsize *bitmap_data = sgen_get_complex_descriptor_bitmap (desc); + gsize *bitmap_data = (gsize *)sgen_get_complex_descriptor_bitmap (desc); int bwords = (int)((*bitmap_data) - 1); void **start_run = start_root; bitmap_data++; @@ -915,7 +915,7 @@ sgen_scan_for_registered_roots_in_domain (MonoDomain *domain, int root_type) void **objptr = start_run; while (bmap) { if ((bmap & 1) && *objptr) - check_obj_not_in_domain (*objptr); + check_obj_not_in_domain ((MonoObject **)*objptr); bmap >>= 1; ++objptr; } @@ -985,7 +985,7 @@ check_reference_for_xdomain (GCObject **ptr, GCObject *obj, MonoDomain *domain) { MonoObject *ref = *ptr; size_t offset = (char*)(ptr) - (char*)obj; - MonoClass *class; + MonoClass *klass; MonoClassField *field; char *str; @@ -995,12 +995,12 @@ check_reference_for_xdomain (GCObject **ptr, GCObject *obj, MonoDomain *domain) return; field = NULL; - for (class = obj->vtable->klass; class; class = class->parent) { + for (klass = obj->vtable->klass; klass; klass = klass->parent) { int i; - for (i = 0; i < class->field.count; ++i) { - if (class->fields[i].offset == offset) { - field = &class->fields[i]; + for (i = 0; i < klass->field.count; ++i) { + if (klass->fields[i].offset == offset) { + field = &klass->fields[i]; break; } } @@ -1113,7 +1113,7 @@ dump_object (GCObject *obj, gboolean dump_location) #ifndef SGEN_WITHOUT_MONO static char class_name [1024]; - MonoClass *class = mono_object_class (obj); + MonoClass *klass = mono_object_class (obj); int i, j; /* @@ -1121,16 +1121,16 @@ dump_object (GCObject *obj, gboolean dump_location) * in strings, so we just ignore them; */ i = j = 0; - while (class->name [i] && j < sizeof (class_name) - 1) { - if (!strchr ("<>\"", class->name [i])) - class_name [j++] = class->name [i]; + while (klass->name [i] && j < sizeof (class_name) - 1) { + if (!strchr ("<>\"", klass->name [i])) + class_name [j++] = klass->name [i]; ++i; } g_assert (j < sizeof (class_name)); class_name [j] = 0; fprintf (heap_dump_file, "name_space, class_name, + klass->name_space, class_name, safe_object_get_size (obj)); if (dump_location) { const char *location; @@ -1181,7 +1181,7 @@ sgen_debug_dump_heap (const char *type, int num, const char *reason) fprintf (heap_dump_file, "\n"); pinned_objects = sgen_pin_stats_get_object_list (); for (i = 0; i < pinned_objects->next_slot; ++i) - dump_object (pinned_objects->data [i], TRUE); + dump_object ((GCObject *)pinned_objects->data [i], TRUE); fprintf (heap_dump_file, "\n"); sgen_dump_section (nursery_section, "nursery"); @@ -1201,7 +1201,7 @@ static GCObject *found_obj; static void find_object_for_ptr_callback (GCObject *obj, size_t size, void *user_data) { - char *ptr = user_data; + char *ptr = (char *)user_data; if (ptr >= (char*)obj && ptr < (char*)obj + size) { g_assert (!found_obj); diff --git a/mono/sgen/sgen-descriptor.c b/mono/sgen/sgen-descriptor.c index 1cae87f4bc2..177ba02c874 100644 --- a/mono/sgen/sgen-descriptor.c +++ b/mono/sgen/sgen-descriptor.c @@ -95,7 +95,7 @@ alloc_complex_descriptor (gsize *bitmap, int numbits) } if (complex_descriptors_next + nwords > complex_descriptors_size) { int new_size = complex_descriptors_size * 2 + nwords; - complex_descriptors = g_realloc (complex_descriptors, new_size * sizeof (gsize)); + complex_descriptors = (gsize *)g_realloc (complex_descriptors, new_size * sizeof (gsize)); complex_descriptors_size = new_size; } SGEN_LOG (6, "Complex descriptor %d, size: %d (total desc memory: %d)", res, nwords, complex_descriptors_size); @@ -293,7 +293,7 @@ mono_gc_make_root_descr_all_refs (int numbits) if (numbits < 32 && all_ref_root_descrs [numbits]) return all_ref_root_descrs [numbits]; - gc_bitmap = g_malloc0 (ALIGN_TO (ALIGN_TO (numbits, 8) + 1, sizeof (gsize))); + gc_bitmap = (gsize *)g_malloc0 (ALIGN_TO (ALIGN_TO (numbits, 8) + 1, sizeof (gsize))); memset (gc_bitmap, 0xff, num_bytes); if (numbits < ((sizeof (*gc_bitmap) * 8) - ROOT_DESC_TYPE_SHIFT)) gc_bitmap[0] = GUINT64_TO_LE(gc_bitmap[0]); diff --git a/mono/sgen/sgen-fin-weak-hash.c b/mono/sgen/sgen-fin-weak-hash.c index 9641594483e..a8ffed926fa 100644 --- a/mono/sgen/sgen-fin-weak-hash.c +++ b/mono/sgen/sgen-fin-weak-hash.c @@ -121,7 +121,7 @@ sgen_collect_bridge_objects (int generation, ScanCopyContext ctx) if (no_finalize) return; - SGEN_HASH_TABLE_FOREACH (hash_table, object, dummy) { + SGEN_HASH_TABLE_FOREACH (hash_table, GCObject *, object, gpointer, dummy) { int tag = tagged_object_get_tag (object); object = tagged_object_get_object (object); @@ -191,7 +191,7 @@ sgen_finalize_in_range (int generation, ScanCopyContext ctx) if (no_finalize) return; - SGEN_HASH_TABLE_FOREACH (hash_table, object, dummy) { + SGEN_HASH_TABLE_FOREACH (hash_table, GCObject *, object, gpointer, dummy) { int tag = tagged_object_get_tag (object); object = tagged_object_get_object (object); if (!major_collector.is_object_live (object)) { @@ -578,7 +578,7 @@ finalizers_with_predicate (SgenObjectPredicateFunc predicate, void *user_data, G if (no_finalize || !out_size || !out_array) return 0; count = 0; - SGEN_HASH_TABLE_FOREACH (hash_table, object, dummy) { + SGEN_HASH_TABLE_FOREACH (hash_table, GCObject *, object, gpointer, dummy) { object = tagged_object_get_object (object); if (predicate (object, user_data)) { @@ -634,7 +634,7 @@ sgen_remove_finalizers_if (SgenObjectPredicateFunc predicate, void *user_data, i GCObject *object; gpointer dummy G_GNUC_UNUSED; - SGEN_HASH_TABLE_FOREACH (hash_table, object, dummy) { + SGEN_HASH_TABLE_FOREACH (hash_table, GCObject *, object, gpointer, dummy) { object = tagged_object_get_object (object); if (predicate (object, user_data)) { diff --git a/mono/sgen/sgen-gc.c b/mono/sgen/sgen-gc.c index 865916a3b88..b73c1d88ff1 100644 --- a/mono/sgen/sgen-gc.c +++ b/mono/sgen/sgen-gc.c @@ -239,12 +239,6 @@ static gboolean do_concurrent_checks = FALSE; each collection */ static gboolean do_scan_starts_check = FALSE; -/* - * If the major collector is concurrent and this is FALSE, we will - * never initiate a synchronous major collection, unless requested via - * GC.Collect(). - */ -static gboolean allow_synchronous_major = TRUE; static gboolean disable_minor_collections = FALSE; static gboolean disable_major_collections = FALSE; static gboolean do_verify_nursery = FALSE; @@ -346,7 +340,7 @@ nursery_canaries_enabled (void) * ######## Global data. * ###################################################################### */ -LOCK_DECLARE (gc_mutex); +MonoCoopMutex gc_mutex; gboolean sgen_try_free_some_memory; #define SCAN_START_SIZE SGEN_SCAN_START_SIZE @@ -359,7 +353,7 @@ GCMemSection *nursery_section = NULL; static volatile mword lowest_heap_address = ~(mword)0; static volatile mword highest_heap_address = 0; -LOCK_DECLARE (sgen_interruption_mutex); +MonoCoopMutex sgen_interruption_mutex; int current_collection_generation = -1; static volatile gboolean concurrent_collection_in_progress = FALSE; @@ -444,7 +438,7 @@ gray_queue_redirect (SgenGrayQueue *queue) GrayQueueSection *section = sgen_gray_object_dequeue_section (queue); if (!section) break; - sgen_section_gray_queue_enqueue (queue->alloc_prepare_data, section); + sgen_section_gray_queue_enqueue ((SgenSectionGrayQueue *)queue->alloc_prepare_data, section); wake = TRUE; } @@ -477,7 +471,7 @@ sgen_scan_area_with_callback (char *start, char *end, IterateObjectCallbackFunc } if (allow_flags) { - if (!(obj = SGEN_OBJECT_IS_FORWARDED (start))) + if (!(obj = (char *)SGEN_OBJECT_IS_FORWARDED (start))) obj = start; } else { obj = start; @@ -506,7 +500,7 @@ sgen_scan_area_with_callback (char *start, char *end, IterateObjectCallbackFunc * lock must be held. For serial collectors that is not necessary. */ void -sgen_add_to_global_remset (gpointer ptr, gpointer obj) +sgen_add_to_global_remset (gpointer ptr, GCObject *obj) { SGEN_ASSERT (5, sgen_ptr_in_nursery (obj), "Target pointer of global remset must be in the nursery"); @@ -868,7 +862,7 @@ pin_from_roots (void *start_nursery, void *end_nursery, ScanCopyContext ctx) RootRecord *root; SGEN_LOG (2, "Scanning pinned roots (%d bytes, %d/%d entries)", (int)roots_size, roots_hash [ROOT_TYPE_NORMAL].num_entries, roots_hash [ROOT_TYPE_PINNED].num_entries); /* objects pinned from the API are inside these roots */ - SGEN_HASH_TABLE_FOREACH (&roots_hash [ROOT_TYPE_PINNED], start_root, root) { + SGEN_HASH_TABLE_FOREACH (&roots_hash [ROOT_TYPE_PINNED], void **, start_root, RootRecord *, root) { SGEN_LOG (6, "Pinned roots %p-%p", start_root, root->end_root); sgen_conservatively_pin_objects_from (start_root, (void**)root->end_root, start_nursery, end_nursery, PIN_TYPE_OTHER); } SGEN_HASH_TABLE_FOREACH_END; @@ -885,7 +879,7 @@ pin_from_roots (void *start_nursery, void *end_nursery, ScanCopyContext ctx) static void single_arg_user_copy_or_mark (GCObject **obj, void *gc_data) { - ScanCopyContext *ctx = gc_data; + ScanCopyContext *ctx = (ScanCopyContext *)gc_data; ctx->ops->copy_or_mark_object (obj, ctx->queue); } @@ -916,7 +910,7 @@ precisely_scan_objects_from (void** start_root, void** end_root, char* n_start, } return; case ROOT_DESC_COMPLEX: { - gsize *bitmap_data = sgen_get_complex_descriptor_bitmap (desc); + gsize *bitmap_data = (gsize *)sgen_get_complex_descriptor_bitmap (desc); gsize bwords = (*bitmap_data) - 1; void **start_run = start_root; bitmap_data++; @@ -992,21 +986,21 @@ alloc_nursery (void) * objects in the existing nursery. */ /* FIXME: handle OOM */ - section = sgen_alloc_internal (INTERNAL_MEM_SECTION); + section = (GCMemSection *)sgen_alloc_internal (INTERNAL_MEM_SECTION); alloc_size = sgen_nursery_size; /* If there isn't enough space even for the nursery we should simply abort. */ g_assert (sgen_memgov_try_alloc_space (alloc_size, SPACE_NURSERY)); - data = major_collector.alloc_heap (alloc_size, alloc_size, DEFAULT_NURSERY_BITS); + data = (char *)major_collector.alloc_heap (alloc_size, alloc_size, DEFAULT_NURSERY_BITS); sgen_update_heap_boundaries ((mword)data, (mword)(data + sgen_nursery_size)); SGEN_LOG (4, "Expanding nursery size (%p-%p): %lu, total: %lu", data, data + alloc_size, (unsigned long)sgen_nursery_size, (unsigned long)sgen_gc_get_total_heap_allocation ()); section->data = section->next_data = data; section->size = alloc_size; section->end_data = data + sgen_nursery_size; scan_starts = (alloc_size + SCAN_START_SIZE - 1) / SCAN_START_SIZE; - section->scan_starts = sgen_alloc_internal_dynamic (sizeof (char*) * scan_starts, INTERNAL_MEM_SCAN_STARTS, TRUE); + section->scan_starts = (char **)sgen_alloc_internal_dynamic (sizeof (char*) * scan_starts, INTERNAL_MEM_SCAN_STARTS, TRUE); section->num_scan_start = scan_starts; nursery_section = section; @@ -1028,7 +1022,7 @@ scan_finalizer_entries (SgenPointerQueue *fin_queue, ScanCopyContext ctx) size_t i; for (i = 0; i < fin_queue->next_slot; ++i) { - GCObject *obj = fin_queue->data [i]; + GCObject *obj = (GCObject *)fin_queue->data [i]; if (!obj) continue; SGEN_LOG (5, "Scan of fin ready object: %p (%s)\n", obj, sgen_client_vtable_get_name (SGEN_LOAD_VTABLE (obj))); @@ -1223,7 +1217,7 @@ scan_from_registered_roots (char *addr_start, char *addr_end, int root_type, Sca { void **start_root; RootRecord *root; - SGEN_HASH_TABLE_FOREACH (&roots_hash [root_type], start_root, root) { + SGEN_HASH_TABLE_FOREACH (&roots_hash [root_type], void **, start_root, RootRecord *, root) { SGEN_LOG (6, "Precise root scan %p-%p (desc: %p)", start_root, root->end_root, (void*)root->root_desc); precisely_scan_objects_from (start_root, (void**)root->end_root, addr_start, addr_end, root->root_desc, ctx); } SGEN_HASH_TABLE_FOREACH_END; @@ -1331,7 +1325,7 @@ typedef struct { static void job_remembered_set_scan (void *worker_data_untyped, SgenThreadPoolJob *job) { - WorkerData *worker_data = worker_data_untyped; + WorkerData *worker_data = (WorkerData *)worker_data_untyped; ScanJob *job_data = (ScanJob*)job; ScanCopyContext ctx = CONTEXT_FROM_OBJECT_OPERATIONS (job_data->ops, sgen_workers_get_job_gray_queue (worker_data)); remset.scan_remsets (ctx); @@ -1348,7 +1342,7 @@ typedef struct { static void job_scan_from_registered_roots (void *worker_data_untyped, SgenThreadPoolJob *job) { - WorkerData *worker_data = worker_data_untyped; + WorkerData *worker_data = (WorkerData *)worker_data_untyped; ScanFromRegisteredRootsJob *job_data = (ScanFromRegisteredRootsJob*)job; ScanCopyContext ctx = CONTEXT_FROM_OBJECT_OPERATIONS (job_data->ops, sgen_workers_get_job_gray_queue (worker_data)); @@ -1365,7 +1359,7 @@ typedef struct { static void job_scan_thread_data (void *worker_data_untyped, SgenThreadPoolJob *job) { - WorkerData *worker_data = worker_data_untyped; + WorkerData *worker_data = (WorkerData *)worker_data_untyped; ScanThreadDataJob *job_data = (ScanThreadDataJob*)job; ScanCopyContext ctx = CONTEXT_FROM_OBJECT_OPERATIONS (job_data->ops, sgen_workers_get_job_gray_queue (worker_data)); @@ -1381,7 +1375,7 @@ typedef struct { static void job_scan_finalizer_entries (void *worker_data_untyped, SgenThreadPoolJob *job) { - WorkerData *worker_data = worker_data_untyped; + WorkerData *worker_data = (WorkerData *)worker_data_untyped; ScanFinalizerEntriesJob *job_data = (ScanFinalizerEntriesJob*)job; ScanCopyContext ctx = CONTEXT_FROM_OBJECT_OPERATIONS (job_data->ops, sgen_workers_get_job_gray_queue (worker_data)); @@ -1391,7 +1385,7 @@ job_scan_finalizer_entries (void *worker_data_untyped, SgenThreadPoolJob *job) static void job_scan_major_mod_union_card_table (void *worker_data_untyped, SgenThreadPoolJob *job) { - WorkerData *worker_data = worker_data_untyped; + WorkerData *worker_data = (WorkerData *)worker_data_untyped; ScanJob *job_data = (ScanJob*)job; ScanCopyContext ctx = CONTEXT_FROM_OBJECT_OPERATIONS (job_data->ops, sgen_workers_get_job_gray_queue (worker_data)); @@ -1402,7 +1396,7 @@ job_scan_major_mod_union_card_table (void *worker_data_untyped, SgenThreadPoolJo static void job_scan_los_mod_union_card_table (void *worker_data_untyped, SgenThreadPoolJob *job) { - WorkerData *worker_data = worker_data_untyped; + WorkerData *worker_data = (WorkerData *)worker_data_untyped; ScanJob *job_data = (ScanJob*)job; ScanCopyContext ctx = CONTEXT_FROM_OBJECT_OPERATIONS (job_data->ops, sgen_workers_get_job_gray_queue (worker_data)); @@ -2244,17 +2238,6 @@ sgen_perform_collection (size_t requested_size, int generation_to_collect, const goto done; } - /* - * If we've been asked to do a major collection, and the major collector wants to - * run synchronously (to evacuate), we set the flag to do that. - */ - if (generation_to_collect == GENERATION_OLD && - allow_synchronous_major && - major_collector.want_synchronous_collection && - *major_collector.want_synchronous_collection) { - wait_to_finish = TRUE; - } - SGEN_ASSERT (0, !concurrent_collection_in_progress, "Why did this not get handled above?"); /* @@ -2449,11 +2432,11 @@ sgen_gc_invoke_finalizers (void) if (!sgen_pointer_queue_is_empty (&fin_ready_queue)) { pending_unqueued_finalizer = TRUE; mono_memory_write_barrier (); - obj = sgen_pointer_queue_pop (&fin_ready_queue); + obj = (GCObject *)sgen_pointer_queue_pop (&fin_ready_queue); } else if (!sgen_pointer_queue_is_empty (&critical_fin_queue)) { pending_unqueued_finalizer = TRUE; mono_memory_write_barrier (); - obj = sgen_pointer_queue_pop (&critical_fin_queue); + obj = (GCObject *)sgen_pointer_queue_pop (&critical_fin_queue); } else { obj = NULL; } @@ -2502,7 +2485,7 @@ sgen_register_root (char *start, size_t size, SgenDescriptor descr, int root_typ int i; LOCK_GC; for (i = 0; i < ROOT_TYPE_NUM; ++i) { - RootRecord *root = sgen_hash_table_lookup (&roots_hash [i], start); + RootRecord *root = (RootRecord *)sgen_hash_table_lookup (&roots_hash [i], start); /* we allow changing the size and the descriptor (for thread statics etc) */ if (root) { size_t old_size = root->end_root - start; @@ -2663,7 +2646,7 @@ mono_gc_wbarrier_generic_store_atomic (gpointer ptr, GCObject *value) SGEN_LOG (8, "Wbarrier atomic store at %p to %p (%s)", ptr, value, value ? sgen_client_vtable_get_name (SGEN_LOAD_VTABLE (value)) : "null"); - InterlockedWritePointer (ptr, value); + InterlockedWritePointer ((volatile gpointer *)ptr, value); if (ptr_in_nursery (value) || concurrent_collection_in_progress) mono_gc_wbarrier_generic_nostore (ptr); @@ -2674,8 +2657,8 @@ mono_gc_wbarrier_generic_store_atomic (gpointer ptr, GCObject *value) void sgen_wbarrier_value_copy_bitmap (gpointer _dest, gpointer _src, int size, unsigned bitmap) { - GCObject **dest = _dest; - GCObject **src = _src; + GCObject **dest = (GCObject **)_dest; + GCObject **src = (GCObject **)_src; while (size) { if (bitmap & 0x1) @@ -2726,16 +2709,6 @@ sgen_gc_get_used_size (void) return tot; } -gboolean -sgen_set_allow_synchronous_major (gboolean flag) -{ - if (!major_collector.is_concurrent) - return flag; - - allow_synchronous_major = flag; - return TRUE; -} - void sgen_env_var_error (const char *env_var, const char *fallback, const char *description_format, ...) { @@ -2807,11 +2780,11 @@ sgen_gc_init (void) mono_thread_smr_init (); #endif - LOCK_INIT (gc_mutex); + mono_coop_mutex_init (&gc_mutex); gc_debug_file = stderr; - LOCK_INIT (sgen_interruption_mutex); + mono_coop_mutex_init (&sgen_interruption_mutex); if ((env = g_getenv (MONO_GC_PARAMS_NAME))) { opts = g_strsplit (env, ",", -1); @@ -2952,23 +2925,6 @@ sgen_gc_init (void) } continue; } - if (g_str_has_prefix (opt, "allow-synchronous-major=")) { - if (!major_collector.is_concurrent) { - sgen_env_var_error (MONO_GC_PARAMS_NAME, "Ignoring.", "`allow-synchronous-major` is only valid for the concurrent major collector."); - continue; - } - - opt = strchr (opt, '=') + 1; - - if (!strcmp (opt, "yes")) { - allow_synchronous_major = TRUE; - } else if (!strcmp (opt, "no")) { - allow_synchronous_major = FALSE; - } else { - sgen_env_var_error (MONO_GC_PARAMS_NAME, "Using default value.", "`allow-synchronous-major` must be either `yes' or `no'."); - continue; - } - } if (!strcmp (opt, "cementing")) { cement_enabled = TRUE; @@ -3001,8 +2957,6 @@ sgen_gc_init (void) fprintf (stderr, " minor=COLLECTOR (where COLLECTOR is `simple' or `split')\n"); fprintf (stderr, " wbarrier=WBARRIER (where WBARRIER is `remset' or `cardtable')\n"); fprintf (stderr, " [no-]cementing\n"); - if (major_collector.is_concurrent) - fprintf (stderr, " allow-synchronous-major=FLAG (where FLAG is `yes' or `no')\n"); if (major_collector.print_gc_param_usage) major_collector.print_gc_param_usage (); if (sgen_minor_collector.print_gc_param_usage) @@ -3191,7 +3145,7 @@ sgen_get_nursery_clear_policy (void) void sgen_gc_lock (void) { - LOCK_GC; + mono_coop_mutex_lock (&gc_mutex); } void @@ -3199,7 +3153,7 @@ sgen_gc_unlock (void) { gboolean try_free = sgen_try_free_some_memory; sgen_try_free_some_memory = FALSE; - mono_mutex_unlock (&gc_mutex); + mono_coop_mutex_unlock (&gc_mutex); if (try_free) mono_thread_hazardous_try_free_some (); } diff --git a/mono/sgen/sgen-gc.h b/mono/sgen/sgen-gc.h index b7e1b68e0c7..9e022e12ba9 100644 --- a/mono/sgen/sgen-gc.h +++ b/mono/sgen/sgen-gc.h @@ -39,7 +39,8 @@ typedef struct _SgenThreadInfo SgenThreadInfo; #include #include "mono/utils/mono-compiler.h" #include "mono/utils/atomic.h" -#include "mono/utils/mono-mutex.h" +#include "mono/utils/mono-os-mutex.h" +#include "mono/utils/mono-coop-mutex.h" #include "mono/sgen/sgen-conf.h" #include "mono/sgen/sgen-hash-table.h" #include "mono/sgen/sgen-protocol.h" @@ -89,23 +90,14 @@ struct _GCMemSection { #define LOCK_DECLARE(name) mono_mutex_t name /* if changing LOCK_INIT to something that isn't idempotent, look at its use in mono_gc_base_init in sgen-gc.c */ -#define LOCK_INIT(name) mono_mutex_init (&(name)) -#define LOCK_GC do { \ - MONO_TRY_BLOCKING \ - mono_mutex_lock (&gc_mutex); \ - MONO_FINISH_TRY_BLOCKING \ - } while (0) +#define LOCK_INIT(name) mono_os_mutex_init (&(name)) +#define LOCK_GC do { sgen_gc_lock (); } while (0) #define UNLOCK_GC do { sgen_gc_unlock (); } while (0) -extern LOCK_DECLARE (sgen_interruption_mutex); - -#define LOCK_INTERRUPTION do { \ - MONO_TRY_BLOCKING \ - mono_mutex_lock (&sgen_interruption_mutex); \ - MONO_FINISH_TRY_BLOCKING \ -} while (0) +extern MonoCoopMutex sgen_interruption_mutex; -#define UNLOCK_INTERRUPTION mono_mutex_unlock (&sgen_interruption_mutex) +#define LOCK_INTERRUPTION mono_coop_mutex_lock (&sgen_interruption_mutex) +#define UNLOCK_INTERRUPTION mono_coop_mutex_unlock (&sgen_interruption_mutex) /* FIXME: Use InterlockedAdd & InterlockedAdd64 to reduce the CAS cost. */ #define SGEN_CAS InterlockedCompareExchange @@ -245,8 +237,8 @@ sgen_get_nursery_end (void) #define SGEN_POINTER_UNTAG_VTABLE(p) SGEN_POINTER_UNTAG_ALL((p)) /* returns NULL if not forwarded, or the forwarded address */ -#define SGEN_VTABLE_IS_FORWARDED(vtable) (SGEN_POINTER_IS_TAGGED_FORWARDED ((vtable)) ? SGEN_POINTER_UNTAG_VTABLE ((vtable)) : NULL) -#define SGEN_OBJECT_IS_FORWARDED(obj) (SGEN_VTABLE_IS_FORWARDED (((mword*)(obj))[0])) +#define SGEN_VTABLE_IS_FORWARDED(vtable) ((GCVTable *)(SGEN_POINTER_IS_TAGGED_FORWARDED ((vtable)) ? SGEN_POINTER_UNTAG_VTABLE ((vtable)) : NULL)) +#define SGEN_OBJECT_IS_FORWARDED(obj) ((GCObject *)SGEN_VTABLE_IS_FORWARDED (((mword*)(obj))[0])) #define SGEN_VTABLE_IS_PINNED(vtable) SGEN_POINTER_IS_TAGGED_PINNED ((vtable)) #define SGEN_OBJECT_IS_PINNED(obj) (SGEN_VTABLE_IS_PINNED (((mword*)(obj))[0])) @@ -272,7 +264,7 @@ sgen_get_nursery_end (void) * Since we set bits in the vtable, use the macro to load it from the pointer to * an object that is potentially pinned. */ -#define SGEN_LOAD_VTABLE(obj) ((GCVTable)(SGEN_POINTER_UNTAG_ALL (SGEN_LOAD_VTABLE_UNCHECKED ((obj))))) +#define SGEN_LOAD_VTABLE(obj) ((GCVTable)(SGEN_POINTER_UNTAG_ALL (SGEN_LOAD_VTABLE_UNCHECKED ((GCObject *)(obj))))) /* List of what each bit on of the vtable gc bits means. @@ -449,7 +441,7 @@ void sgen_pin_stats_register_global_remset (GCObject *obj); void sgen_pin_stats_print_class_stats (void); void sgen_sort_addresses (void **array, size_t size); -void sgen_add_to_global_remset (gpointer ptr, gpointer obj); +void sgen_add_to_global_remset (gpointer ptr, GCObject *obj); int sgen_get_current_collection_generation (void); gboolean sgen_collection_is_concurrent (void); @@ -607,13 +599,6 @@ struct _SgenMajorCollector { gboolean supports_cardtable; gboolean sweeps_lazily; - /* - * This is set to TRUE by the sweep if the next major - * collection should be synchronous (for evacuation). For - * non-concurrent collectors, this should be NULL. - */ - gboolean *want_synchronous_collection; - void* (*alloc_heap) (mword nursery_size, mword nursery_align, int nursery_bits); gboolean (*is_object_live) (GCObject *obj); GCObject* (*alloc_small_pinned_obj) (GCVTable vtable, size_t size, gboolean has_references); @@ -966,7 +951,7 @@ extern guint32 tlab_size; extern NurseryClearPolicy nursery_clear_policy; extern gboolean sgen_try_free_some_memory; -extern LOCK_DECLARE (gc_mutex); +extern MonoCoopMutex gc_mutex; /* Nursery helpers. */ diff --git a/mono/sgen/sgen-gchandles.c b/mono/sgen/sgen-gchandles.c index 11216ffd21d..f4b352eac11 100644 --- a/mono/sgen/sgen-gchandles.c +++ b/mono/sgen/sgen-gchandles.c @@ -105,17 +105,17 @@ static void protocol_gchandle_update (int handle_type, gpointer link, gpointer old_value, gpointer new_value) { gboolean old = MONO_GC_HANDLE_IS_OBJECT_POINTER (old_value); - gboolean new = MONO_GC_HANDLE_IS_OBJECT_POINTER (new_value); + gboolean new_ = MONO_GC_HANDLE_IS_OBJECT_POINTER (new_value); gboolean track = handle_type == HANDLE_WEAK_TRACK; if (!MONO_GC_HANDLE_TYPE_IS_WEAK (handle_type)) return; - if (!old && new) + if (!old && new_) binary_protocol_dislink_add (link, MONO_GC_REVEAL_POINTER (new_value, TRUE), track); - else if (old && !new) + else if (old && !new_) binary_protocol_dislink_remove (link, track); - else if (old && new && old_value != new_value) + else if (old && new_ && old_value != new_value) binary_protocol_dislink_update (link, MONO_GC_REVEAL_POINTER (new_value, TRUE), track); } @@ -123,15 +123,15 @@ protocol_gchandle_update (int handle_type, gpointer link, gpointer old_value, gp static inline gpointer try_set_slot (volatile gpointer *slot, GCObject *obj, gpointer old, GCHandleType type) { - gpointer new; + gpointer new_; if (obj) - new = MONO_GC_HANDLE_OBJECT_POINTER (obj, GC_HANDLE_TYPE_IS_WEAK (type)); + new_ = MONO_GC_HANDLE_OBJECT_POINTER (obj, GC_HANDLE_TYPE_IS_WEAK (type)); else - new = MONO_GC_HANDLE_METADATA_POINTER (sgen_client_default_metadata (), GC_HANDLE_TYPE_IS_WEAK (type)); - SGEN_ASSERT (0, new, "Why is the occupied bit not set?"); - if (InterlockedCompareExchangePointer (slot, new, old) == old) { - protocol_gchandle_update (type, (gpointer)slot, old, new); - return new; + new_ = MONO_GC_HANDLE_METADATA_POINTER (sgen_client_default_metadata (), GC_HANDLE_TYPE_IS_WEAK (type)); + SGEN_ASSERT (0, new_, "Why is the occupied bit not set?"); + if (InterlockedCompareExchangePointer (slot, new_, old) == old) { + protocol_gchandle_update (type, (gpointer)slot, old, new_); + return new_; } return NULL; } @@ -143,7 +143,7 @@ try_occupy_slot (HandleData *handles, guint bucket, guint offset, GCObject *obj, volatile gpointer *link_addr = &(handles->entries [bucket] [offset]); if (MONO_GC_HANDLE_OCCUPIED (*link_addr)) return FALSE; - return try_set_slot (link_addr, obj, NULL, handles->type) != NULL; + return try_set_slot (link_addr, obj, NULL, (GCHandleType)handles->type) != NULL; } static HandleData gc_handles [] = { @@ -216,7 +216,7 @@ handle_data_grow (HandleData *handles, guint32 old_capacity) const size_t new_bucket_size = sizeof (**handles->entries) * growth; if (handles->capacity >= new_capacity) return; - entries = g_malloc0 (new_bucket_size); + entries = (gpointer *)g_malloc0 (new_bucket_size); if (handles->type == HANDLE_PINNED) sgen_register_root ((char *)entries, new_bucket_size, SGEN_DESCRIPTOR_NULL, ROOT_TYPE_PINNED, MONO_ROOT_SOURCE_GC_HANDLE, "pinned gc handles"); /* The zeroing of the newly allocated bucket must be complete before storing @@ -446,7 +446,7 @@ GCObject* mono_gchandle_get_target (guint32 gchandle) { guint index = MONO_GC_HANDLE_SLOT (gchandle); - guint type = MONO_GC_HANDLE_TYPE (gchandle); + GCHandleType type = MONO_GC_HANDLE_TYPE (gchandle); HandleData *handles = gc_handles_for_type (type); /* Invalid handles are possible; accessing one should produce NULL. (#34276) */ if (!handles) @@ -461,7 +461,7 @@ void sgen_gchandle_set_target (guint32 gchandle, GCObject *obj) { guint index = MONO_GC_HANDLE_SLOT (gchandle); - guint type = MONO_GC_HANDLE_TYPE (gchandle); + GCHandleType type = MONO_GC_HANDLE_TYPE (gchandle); HandleData *handles = gc_handles_for_type (type); if (!handles) return; @@ -474,7 +474,7 @@ sgen_gchandle_set_target (guint32 gchandle, GCObject *obj) do { slot = handles->entries [bucket] [offset]; SGEN_ASSERT (0, MONO_GC_HANDLE_OCCUPIED (slot), "Why are we setting the target on an unoccupied slot?"); - } while (!try_set_slot (&handles->entries [bucket] [offset], obj, slot, handles->type)); + } while (!try_set_slot (&handles->entries [bucket] [offset], obj, slot, (GCHandleType)handles->type)); } static gpointer @@ -487,7 +487,7 @@ retry: if (!MONO_GC_HANDLE_OCCUPIED (slot)) return NULL; if (MONO_GC_HANDLE_IS_OBJECT_POINTER (slot)) { - GCObject *obj = MONO_GC_REVEAL_POINTER (slot, is_weak); + GCObject *obj = (GCObject *)MONO_GC_REVEAL_POINTER (slot, is_weak); /* See note [dummy use]. */ sgen_dummy_use (obj); /* @@ -511,7 +511,7 @@ gpointer sgen_gchandle_get_metadata (guint32 gchandle) { guint index = MONO_GC_HANDLE_SLOT (gchandle); - guint type = MONO_GC_HANDLE_TYPE (gchandle); + GCHandleType type = MONO_GC_HANDLE_TYPE (gchandle); HandleData *handles = gc_handles_for_type (type); if (!handles) return NULL; @@ -534,7 +534,7 @@ void mono_gchandle_free (guint32 gchandle) { guint index = MONO_GC_HANDLE_SLOT (gchandle); - guint type = MONO_GC_HANDLE_TYPE (gchandle); + GCHandleType type = MONO_GC_HANDLE_TYPE (gchandle); HandleData *handles = gc_handles_for_type (type); if (!handles) return; @@ -566,7 +566,7 @@ null_link_if_necessary (gpointer hidden, GCHandleType handle_type, int max_gener if (!MONO_GC_HANDLE_VALID (hidden)) return hidden; - obj = MONO_GC_REVEAL_POINTER (hidden, MONO_GC_HANDLE_TYPE_IS_WEAK (handle_type)); + obj = (GCObject *)MONO_GC_REVEAL_POINTER (hidden, MONO_GC_HANDLE_TYPE_IS_WEAK (handle_type)); SGEN_ASSERT (0, obj, "Why is the hidden pointer NULL?"); if (object_older_than (obj, max_generation)) @@ -607,7 +607,7 @@ null_link_if (gpointer hidden, GCHandleType handle_type, int max_generation, gpo if (!MONO_GC_HANDLE_VALID (hidden)) return hidden; - obj = MONO_GC_REVEAL_POINTER (hidden, MONO_GC_HANDLE_TYPE_IS_WEAK (handle_type)); + obj = (GCObject *)MONO_GC_REVEAL_POINTER (hidden, MONO_GC_HANDLE_TYPE_IS_WEAK (handle_type)); SGEN_ASSERT (0, obj, "Why is the hidden pointer NULL?"); if (object_older_than (obj, max_generation)) diff --git a/mono/sgen/sgen-gray.c b/mono/sgen/sgen-gray.c index fd561d50ff4..cb6694342fe 100644 --- a/mono/sgen/sgen-gray.c +++ b/mono/sgen/sgen-gray.c @@ -66,7 +66,7 @@ sgen_gray_object_alloc_queue_section (SgenGrayQueue *queue) STATE_TRANSITION (section, GRAY_QUEUE_SECTION_STATE_FREE_LIST, GRAY_QUEUE_SECTION_STATE_FLOATING); } else { /* Allocate a new section */ - section = sgen_alloc_internal (INTERNAL_MEM_GRAY_QUEUE); + section = (GrayQueueSection *)sgen_alloc_internal (INTERNAL_MEM_GRAY_QUEUE); STATE_SET (section, GRAY_QUEUE_SECTION_STATE_FLOATING); } @@ -292,7 +292,7 @@ lock_section_queue (SgenSectionGrayQueue *queue) if (!queue->locked) return; - mono_mutex_lock (&queue->lock); + mono_os_mutex_lock (&queue->lock); } static void @@ -301,7 +301,7 @@ unlock_section_queue (SgenSectionGrayQueue *queue) if (!queue->locked) return; - mono_mutex_unlock (&queue->lock); + mono_os_mutex_unlock (&queue->lock); } void @@ -311,7 +311,7 @@ sgen_section_gray_queue_init (SgenSectionGrayQueue *queue, gboolean locked, Gray queue->locked = locked; if (locked) { - mono_mutex_init_recursive (&queue->lock); + mono_os_mutex_init_recursive (&queue->lock); } #ifdef SGEN_CHECK_GRAY_OBJECT_ENQUEUE diff --git a/mono/sgen/sgen-hash-table.c b/mono/sgen/sgen-hash-table.c index 61c78e9bf56..42856fc65d8 100644 --- a/mono/sgen/sgen-hash-table.c +++ b/mono/sgen/sgen-hash-table.c @@ -53,7 +53,7 @@ rehash (SgenHashTable *hash_table) new_size = g_spaced_primes_closest (hash_table->num_entries); } - new_hash = sgen_alloc_internal_dynamic (new_size * sizeof (SgenHashTableEntry*), hash_table->table_mem_type, TRUE); + new_hash = (SgenHashTableEntry **)sgen_alloc_internal_dynamic (new_size * sizeof (SgenHashTableEntry*), hash_table->table_mem_type, TRUE); for (i = 0; i < old_hash_size; ++i) { for (entry = old_hash [i]; entry; entry = next) { hash = hash_table->hash_func (entry->key) % new_size; @@ -132,7 +132,7 @@ sgen_hash_table_replace (SgenHashTable *hash_table, gpointer key, gpointer new_v return FALSE; } - entry = sgen_alloc_internal (hash_table->entry_mem_type); + entry = (SgenHashTableEntry *)sgen_alloc_internal (hash_table->entry_mem_type); entry->key = key; memcpy (entry->data, new_value, hash_table->data_size); diff --git a/mono/sgen/sgen-hash-table.h b/mono/sgen/sgen-hash-table.h index e6cfe43a5a0..5144cab1270 100644 --- a/mono/sgen/sgen-hash-table.h +++ b/mono/sgen/sgen-hash-table.h @@ -42,9 +42,9 @@ void sgen_init_hash_table (void); #define sgen_hash_table_num_entries(h) ((h)->num_entries) -#define sgen_hash_table_key_for_value_pointer(v) (((SgenHashTableEntry*)((char*)(v) - G_STRUCT_OFFSET (SgenHashTableEntry, data)))->key) +#define sgen_hash_table_key_for_value_pointer(v) ((GCObject *)(((SgenHashTableEntry*)((char*)(v) - G_STRUCT_OFFSET (SgenHashTableEntry, data)))->key)) -#define SGEN_HASH_TABLE_FOREACH(h,k,v) do { \ +#define SGEN_HASH_TABLE_FOREACH(h,tk,k,tv,v) do { \ SgenHashTable *__hash_table = (h); \ SgenHashTableEntry **__table = __hash_table->table; \ guint __i; \ @@ -53,8 +53,8 @@ void sgen_init_hash_table (void); for (__iter = &__table [__i]; *__iter; __iter = __next) { \ SgenHashTableEntry *__entry = *__iter; \ __next = &__entry->next; \ - (k) = __entry->key; \ - (v) = (gpointer)__entry->data; + (k) = (tk)__entry->key; \ + (v) = (tv)__entry->data; /* The loop must be continue'd after using this! */ #define SGEN_HASH_TABLE_FOREACH_REMOVE(free) do { \ diff --git a/mono/sgen/sgen-internal.c b/mono/sgen/sgen-internal.c index 4ccff748aef..e5327399c58 100644 --- a/mono/sgen/sgen-internal.c +++ b/mono/sgen/sgen-internal.c @@ -165,7 +165,7 @@ sgen_alloc_internal_dynamic (size_t size, int type, gboolean assert_on_failure) void *p; if (size > allocator_sizes [NUM_ALLOCATORS - 1]) { - p = sgen_alloc_os_memory (size, SGEN_ALLOC_INTERNAL | SGEN_ALLOC_ACTIVATE, NULL); + p = sgen_alloc_os_memory (size, (SgenAllocFlags)(SGEN_ALLOC_INTERNAL | SGEN_ALLOC_ACTIVATE), NULL); if (!p) sgen_assert_memory_alloc (NULL, size, description_for_type (type)); } else { diff --git a/mono/sgen/sgen-los.c b/mono/sgen/sgen-los.c index ea1ba4692ea..2421150fcfb 100644 --- a/mono/sgen/sgen-los.c +++ b/mono/sgen/sgen-los.c @@ -238,7 +238,7 @@ get_los_section_memory (size_t size) if (!sgen_memgov_try_alloc_space (LOS_SECTION_SIZE, SPACE_LOS)) return NULL; - section = sgen_alloc_os_memory_aligned (LOS_SECTION_SIZE, LOS_SECTION_SIZE, SGEN_ALLOC_HEAP | SGEN_ALLOC_ACTIVATE, NULL); + section = (LOSSection *)sgen_alloc_os_memory_aligned (LOS_SECTION_SIZE, LOS_SECTION_SIZE, (SgenAllocFlags)(SGEN_ALLOC_HEAP | SGEN_ALLOC_ACTIVATE), NULL); if (!section) return NULL; @@ -379,7 +379,7 @@ sgen_los_alloc_large_inner (GCVTable vtable, size_t size) alloc_size += pagesize - 1; alloc_size &= ~(pagesize - 1); if (sgen_memgov_try_alloc_space (alloc_size, SPACE_LOS)) { - obj = sgen_alloc_os_memory (alloc_size, SGEN_ALLOC_HEAP | SGEN_ALLOC_ACTIVATE, NULL); + obj = (LOSObject *)sgen_alloc_os_memory (alloc_size, (SgenAllocFlags)(SGEN_ALLOC_HEAP | SGEN_ALLOC_ACTIVATE), NULL); } } else { obj = get_los_section_memory (size + sizeof (LOSObject)); @@ -593,7 +593,7 @@ get_cardtable_mod_union_for_object (LOSObject *obj) if (mod_union) return mod_union; mod_union = sgen_card_table_alloc_mod_union ((char*)obj->data, size); - other = SGEN_CAS_PTR ((gpointer*)&obj->cardtable_mod_union, mod_union, NULL); + other = (guint8 *)SGEN_CAS_PTR ((gpointer*)&obj->cardtable_mod_union, mod_union, NULL); if (!other) { SGEN_ASSERT (0, obj->cardtable_mod_union == mod_union, "Why did CAS not replace?"); return mod_union; diff --git a/mono/sgen/sgen-marksweep-drain-gray-stack.h b/mono/sgen/sgen-marksweep-drain-gray-stack.h index dce3be7344a..56efcf2694d 100644 --- a/mono/sgen/sgen-marksweep-drain-gray-stack.h +++ b/mono/sgen/sgen-marksweep-drain-gray-stack.h @@ -74,7 +74,7 @@ COPY_OR_MARK_FUNCTION_NAME (GCObject **ptr, GCObject *obj, SgenGrayQueue *queue) HEAVY_STAT (++stat_optimized_copy_nursery_pinned); return TRUE; } - if ((forwarded = SGEN_VTABLE_IS_FORWARDED (vtable_word))) { + if ((forwarded = (GCObject *)SGEN_VTABLE_IS_FORWARDED (vtable_word))) { HEAVY_STAT (++stat_optimized_copy_nursery_forwarded); SGEN_UPDATE_REFERENCE (ptr, forwarded); return sgen_ptr_in_nursery (forwarded); @@ -142,7 +142,7 @@ COPY_OR_MARK_FUNCTION_NAME (GCObject **ptr, GCObject *obj, SgenGrayQueue *queue) #ifdef COPY_OR_MARK_WITH_EVACUATION { GCObject *forwarded; - if ((forwarded = SGEN_VTABLE_IS_FORWARDED (vtable_word))) { + if ((forwarded = (GCObject *)SGEN_VTABLE_IS_FORWARDED (vtable_word))) { HEAVY_STAT (++stat_optimized_copy_major_forwarded); SGEN_UPDATE_REFERENCE (ptr, forwarded); SGEN_ASSERT (9, !sgen_ptr_in_nursery (forwarded), "Cannot be forwarded to nursery."); @@ -166,16 +166,21 @@ COPY_OR_MARK_FUNCTION_NAME (GCObject **ptr, GCObject *obj, SgenGrayQueue *queue) block = MS_BLOCK_FOR_OBJ (obj); +#ifdef COPY_OR_MARK_CONCURRENT + if (G_UNLIKELY (major_block_is_evacuating (block))) { + /* + * We don't copy within the concurrent phase. These objects will + * be handled below in the finishing pause, by scanning the mod-union + * card table. + */ + return FALSE; + } +#endif + #ifdef COPY_OR_MARK_WITH_EVACUATION - { - int size_index = block->obj_size_index; - - if (evacuate_block_obj_sizes [size_index] && !block->has_pinned) { - HEAVY_STAT (++stat_optimized_copy_major_small_evacuate); - if (block->is_to_space) - return FALSE; - goto do_copy_object; - } + if (major_block_is_evacuating (block)) { + HEAVY_STAT (++stat_optimized_copy_major_small_evacuate); + goto do_copy_object; } #endif @@ -218,23 +223,30 @@ SCAN_OBJECT_FUNCTION_NAME (GCObject *full_object, SgenDescriptor desc, SgenGrayQ #ifdef COPY_OR_MARK_CONCURRENT #define HANDLE_PTR(ptr,obj) do { \ GCObject *__old = *(ptr); \ - binary_protocol_scan_process_reference ((obj), (ptr), __old); \ + binary_protocol_scan_process_reference ((full_object), (ptr), __old); \ if (__old && !sgen_ptr_in_nursery (__old)) { \ - PREFETCH_READ (__old); \ - COPY_OR_MARK_FUNCTION_NAME ((ptr), __old, queue); \ + MSBlockInfo *block = MS_BLOCK_FOR_OBJ (__old); \ + if (G_UNLIKELY (!sgen_ptr_in_nursery (ptr) && \ + sgen_safe_object_is_small (__old, sgen_obj_get_descriptor (__old) & DESC_TYPE_MASK) && \ + major_block_is_evacuating (block))) { \ + mark_mod_union_card ((full_object), (void**)(ptr), __old); \ + } else { \ + PREFETCH_READ (__old); \ + COPY_OR_MARK_FUNCTION_NAME ((ptr), __old, queue); \ + } \ } else { \ if (G_UNLIKELY (sgen_ptr_in_nursery (__old) && !sgen_ptr_in_nursery ((ptr)))) \ - mark_mod_union_card ((full_object), (void**)(ptr)); \ + mark_mod_union_card ((full_object), (void**)(ptr), __old); \ } \ } while (0) #else #define HANDLE_PTR(ptr,obj) do { \ - void *__old = *(ptr); \ - binary_protocol_scan_process_reference ((obj), (ptr), __old); \ + GCObject *__old = *(ptr); \ + binary_protocol_scan_process_reference ((full_object), (ptr), __old); \ if (__old) { \ gboolean __still_in_nursery = COPY_OR_MARK_FUNCTION_NAME ((ptr), __old, queue); \ if (G_UNLIKELY (__still_in_nursery && !sgen_ptr_in_nursery ((ptr)) && !SGEN_OBJECT_IS_CEMENTED (*(ptr)))) { \ - void *__copy = *(ptr); \ + GCObject *__copy = *(ptr); \ sgen_add_to_global_remset ((ptr), __copy); \ } \ } \ diff --git a/mono/sgen/sgen-marksweep-scan-object-concurrent.h b/mono/sgen/sgen-marksweep-scan-object-concurrent.h index 8ebd8eee2a1..541a0a2b52f 100644 --- a/mono/sgen/sgen-marksweep-scan-object-concurrent.h +++ b/mono/sgen/sgen-marksweep-scan-object-concurrent.h @@ -32,12 +32,12 @@ #undef HANDLE_PTR #define HANDLE_PTR(ptr,obj) do { \ - void *__old = *(ptr); \ - binary_protocol_scan_process_reference ((obj), (ptr), __old); \ + GCObject *__old = *(ptr); \ + binary_protocol_scan_process_reference ((full_object), (ptr), __old); \ if (__old) { \ - gboolean __still_in_nursery = major_copy_or_mark_object_no_evacuation ((ptr), __old, queue); \ + gboolean __still_in_nursery = major_copy_or_mark_object_with_evacuation ((ptr), __old, queue); \ if (G_UNLIKELY (__still_in_nursery && !sgen_ptr_in_nursery ((ptr)) && !SGEN_OBJECT_IS_CEMENTED (*(ptr)))) { \ - void *__copy = *(ptr); \ + GCObject *__copy = *(ptr); \ sgen_add_to_global_remset ((ptr), __copy); \ } \ } \ diff --git a/mono/sgen/sgen-marksweep.c b/mono/sgen/sgen-marksweep.c index e2261e20034..ba92ab36e72 100644 --- a/mono/sgen/sgen-marksweep.c +++ b/mono/sgen/sgen-marksweep.c @@ -121,7 +121,7 @@ struct _MSBlockInfo { #define MS_BLOCK_FOR_BLOCK_INFO(b) ((char*)(b)) -#define MS_BLOCK_OBJ(b,i) ((void*)(MS_BLOCK_FOR_BLOCK_INFO(b) + MS_BLOCK_SKIP + (b)->obj_size * (i))) +#define MS_BLOCK_OBJ(b,i) ((GCObject *)(MS_BLOCK_FOR_BLOCK_INFO(b) + MS_BLOCK_SKIP + (b)->obj_size * (i))) #define MS_BLOCK_OBJ_FOR_SIZE(b,i,obj_size) (MS_BLOCK_FOR_BLOCK_INFO(b) + MS_BLOCK_SKIP + (obj_size) * (i)) #define MS_BLOCK_DATA_FOR_OBJ(o) ((char*)((mword)(o) & ~(mword)(MS_BLOCK_SIZE - 1))) @@ -170,8 +170,6 @@ static int fast_block_obj_size_indexes [MS_NUM_FAST_BLOCK_OBJ_SIZE_INDEXES]; static gboolean *evacuate_block_obj_sizes; static float evacuation_threshold = 0.666f; -static float concurrent_evacuation_threshold = 0.666f; -static gboolean want_evacuation = FALSE; static gboolean lazy_sweep = FALSE; @@ -194,7 +192,7 @@ static gboolean concurrent_sweep = TRUE; #define BLOCK_IS_TAGGED_CHECKING(bl) SGEN_POINTER_IS_TAGGED_2 ((bl)) #define BLOCK_TAG_CHECKING(bl) SGEN_POINTER_TAG_2 ((bl)) -#define BLOCK_UNTAG(bl) SGEN_POINTER_UNTAG_12 ((bl)) +#define BLOCK_UNTAG(bl) ((MSBlockInfo *)SGEN_POINTER_UNTAG_12 ((bl))) #define BLOCK_TAG(bl) ((bl)->has_references ? BLOCK_TAG_HAS_REFERENCES ((bl)) : (bl)) @@ -216,7 +214,7 @@ static size_t num_empty_blocks = 0; size_t __index; \ SGEN_ASSERT (0, sgen_is_world_stopped () && !sweep_in_progress (), "Can't iterate blocks while the world is running or sweep is in progress."); \ for (__index = 0; __index < allocated_blocks.next_slot; ++__index) { \ - (bl) = allocated_blocks.data [__index]; \ + (bl) = (MSBlockInfo *)allocated_blocks.data [__index]; \ (hr) = BLOCK_IS_TAGGED_HAS_REFERENCES ((bl)); \ (bl) = BLOCK_UNTAG ((bl)); #define END_FOREACH_BLOCK_NO_LOCK } } @@ -245,7 +243,6 @@ static MSBlockInfo * volatile *free_block_lists [MS_BLOCK_TYPE_MAX]; static guint64 stat_major_blocks_alloced = 0; static guint64 stat_major_blocks_freed = 0; static guint64 stat_major_blocks_lazy_swept = 0; -static guint64 stat_major_objects_evacuated = 0; #if SIZEOF_VOID_P != 8 static guint64 stat_major_blocks_freed_ideal = 0; @@ -271,9 +268,9 @@ add_scanned_object (void *ptr) if (!binary_protocol_is_enabled ()) return; - mono_mutex_lock (&scanned_objects_list_lock); + mono_os_mutex_lock (&scanned_objects_list_lock); sgen_pointer_queue_add (&scanned_objects_list, ptr); - mono_mutex_unlock (&scanned_objects_list_lock); + mono_os_mutex_unlock (&scanned_objects_list_lock); } #endif @@ -304,9 +301,9 @@ major_alloc_heap (mword nursery_size, mword nursery_align, int the_nursery_bits) { char *start; if (nursery_align) - start = sgen_alloc_os_memory_aligned (nursery_size, nursery_align, SGEN_ALLOC_HEAP | SGEN_ALLOC_ACTIVATE, "nursery"); + start = (char *)sgen_alloc_os_memory_aligned (nursery_size, nursery_align, (SgenAllocFlags)(SGEN_ALLOC_HEAP | SGEN_ALLOC_ACTIVATE), "nursery"); else - start = sgen_alloc_os_memory (nursery_size, SGEN_ALLOC_HEAP | SGEN_ALLOC_ACTIVATE, "nursery"); + start = (char *)sgen_alloc_os_memory (nursery_size, (SgenAllocFlags)(SGEN_ALLOC_HEAP | SGEN_ALLOC_ACTIVATE), "nursery"); return start; } @@ -336,8 +333,9 @@ ms_get_empty_block (void) */ int alloc_num = MS_BLOCK_ALLOC_NUM; for (;;) { - p = sgen_alloc_os_memory_aligned (MS_BLOCK_SIZE * alloc_num, MS_BLOCK_SIZE, SGEN_ALLOC_HEAP | SGEN_ALLOC_ACTIVATE, - alloc_num == 1 ? "major heap section" : NULL); + p = (char *)sgen_alloc_os_memory_aligned (MS_BLOCK_SIZE * alloc_num, MS_BLOCK_SIZE, + (SgenAllocFlags)(SGEN_ALLOC_HEAP | SGEN_ALLOC_ACTIVATE), + alloc_num == 1 ? "major heap section" : NULL); if (p) break; alloc_num >>= 1; @@ -502,7 +500,7 @@ add_free_block (MSBlockInfo * volatile *free_blocks, int size_index, MSBlockInfo MSBlockInfo *old; do { block->next_free = old = free_blocks [size_index]; - } while (SGEN_CAS_PTR ((gpointer)&free_blocks [size_index], block, old) != old); + } while (SGEN_CAS_PTR ((volatile gpointer *)&free_blocks [size_index], block, old) != old); } static void major_finish_sweep_checking (void); @@ -533,10 +531,11 @@ ms_alloc_block (int size_index, gboolean pinned, gboolean has_references) * Blocks that are to-space are not evacuated from. During an major collection * blocks are allocated for two reasons: evacuating objects from the nursery and * evacuating them from major blocks marked for evacuation. In both cases we don't - * want further evacuation. + * want further evacuation. We also don't want to evacuate objects allocated during + * the concurrent mark since it would add pointless stress on the finishing pause. */ - info->is_to_space = (sgen_get_current_collection_generation () == GENERATION_OLD); - info->state = (info->is_to_space || sgen_concurrent_collection_in_progress ()) ? BLOCK_STATE_MARKING : BLOCK_STATE_SWEPT; + info->is_to_space = (sgen_get_current_collection_generation () == GENERATION_OLD) || sgen_concurrent_collection_in_progress (); + info->state = info->is_to_space ? BLOCK_STATE_MARKING : BLOCK_STATE_SWEPT; SGEN_ASSERT (6, !sweep_in_progress () || info->state == BLOCK_STATE_SWEPT, "How do we add a new block to be swept while sweeping?"); info->cardtable_mod_union = NULL; @@ -630,12 +629,12 @@ unlink_slot_from_free_list_uncontested (MSBlockInfo * volatile *free_blocks, int next_free_slot = *(void**)obj; if (next_free_slot) { - block->free_list = next_free_slot; + block->free_list = (gpointer *)next_free_slot; return obj; } next_free_block = block->next_free; - if (SGEN_CAS_PTR ((gpointer)&free_blocks [size_index], next_free_block, block) != block) + if (SGEN_CAS_PTR ((volatile gpointer *)&free_blocks [size_index], next_free_block, block) != block) goto retry; block->free_list = NULL; @@ -661,7 +660,7 @@ alloc_obj (GCVTable vtable, size_t size, gboolean pinned, gboolean has_reference /* FIXME: assumes object layout */ *(GCVTable*)obj = vtable; - return obj; + return (GCObject *)obj; } static GCObject* @@ -726,7 +725,7 @@ major_alloc_small_pinned_obj (GCVTable vtable, size_t size, gboolean has_referen sgen_perform_collection (0, GENERATION_OLD, "pinned alloc failure", TRUE); res = alloc_obj (vtable, size, TRUE, has_references); } - return res; + return (GCObject *)res; } static void @@ -792,7 +791,7 @@ major_ptr_is_in_non_pinned_space (char *ptr, char **start) *start = NULL; for (i = 0; i <= count; ++i) { if (ptr >= (char*)MS_BLOCK_OBJ (block, i) && ptr < (char*)MS_BLOCK_OBJ (block, i + 1)) { - *start = MS_BLOCK_OBJ (block, i); + *start = (char *)MS_BLOCK_OBJ (block, i); break; } } @@ -803,16 +802,16 @@ major_ptr_is_in_non_pinned_space (char *ptr, char **start) } static gboolean -try_set_sweep_state (int new, int expected) +try_set_sweep_state (int new_, int expected) { - int old = SGEN_CAS (&sweep_state, new, expected); + int old = SGEN_CAS (&sweep_state, new_, expected); return old == expected; } static void -set_sweep_state (int new, int expected) +set_sweep_state (int new_, int expected) { - gboolean success = try_set_sweep_state (new, expected); + gboolean success = try_set_sweep_state (new_, expected); SGEN_ASSERT (0, success, "Could not set sweep state."); } @@ -986,8 +985,8 @@ static void major_dump_heap (FILE *heap_dump_file) { MSBlockInfo *block; - int *slots_available = alloca (sizeof (int) * num_block_obj_sizes); - int *slots_used = alloca (sizeof (int) * num_block_obj_sizes); + int *slots_available = (int *)alloca (sizeof (int) * num_block_obj_sizes); + int *slots_used = (int *)alloca (sizeof (int) * num_block_obj_sizes); int i; for (i = 0; i < num_block_obj_sizes; ++i) @@ -1024,7 +1023,7 @@ major_dump_heap (FILE *heap_dump_file) start = i; } else { if (start >= 0) { - sgen_dump_occupied (MS_BLOCK_OBJ (block, start), MS_BLOCK_OBJ (block, i), MS_BLOCK_FOR_BLOCK_INFO (block)); + sgen_dump_occupied ((char *)MS_BLOCK_OBJ (block, start), (char *)MS_BLOCK_OBJ (block, i), MS_BLOCK_FOR_BLOCK_INFO (block)); start = -1; } } @@ -1044,7 +1043,7 @@ get_cardtable_mod_union_for_block (MSBlockInfo *block, gboolean allocate) else if (!allocate) return NULL; mod_union = sgen_card_table_alloc_mod_union (MS_BLOCK_FOR_BLOCK_INFO (block), MS_BLOCK_SIZE); - other = SGEN_CAS_PTR ((gpointer*)&block->cardtable_mod_union, mod_union, NULL); + other = (guint8 *)SGEN_CAS_PTR ((gpointer*)&block->cardtable_mod_union, mod_union, NULL); if (!other) { SGEN_ASSERT (0, block->cardtable_mod_union == mod_union, "Why did CAS not replace?"); return mod_union; @@ -1067,7 +1066,7 @@ major_get_cardtable_mod_union_for_reference (char *ptr) * Mark the mod-union card for `ptr`, which must be a reference within the object `obj`. */ static void -mark_mod_union_card (GCObject *obj, void **ptr) +mark_mod_union_card (GCObject *obj, void **ptr, GCObject *value_obj) { int type = sgen_obj_get_descriptor (obj) & DESC_TYPE_MASK; if (sgen_safe_object_is_small (obj, type)) { @@ -1077,6 +1076,18 @@ mark_mod_union_card (GCObject *obj, void **ptr) } else { sgen_los_mark_mod_union_card (obj, ptr); } + + binary_protocol_mod_union_remset (obj, ptr, value_obj, SGEN_LOAD_VTABLE (value_obj)); +} + +static inline gboolean +major_block_is_evacuating (MSBlockInfo *block) +{ + if (evacuate_block_obj_sizes [block->obj_size_index] && + !block->has_pinned && + !block->is_to_space) + return TRUE; + return FALSE; } #define LOAD_VTABLE SGEN_LOAD_VTABLE @@ -1166,8 +1177,6 @@ static guint64 stat_drain_prefetch_fill_failures; static guint64 stat_drain_loops; #endif -static void major_scan_object_with_evacuation (GCObject *start, mword desc, SgenGrayQueue *queue); - #define COPY_OR_MARK_FUNCTION_NAME major_copy_or_mark_object_no_evacuation #define SCAN_OBJECT_FUNCTION_NAME major_scan_object_no_evacuation #define DRAIN_GRAY_STACK_FUNCTION_NAME drain_gray_stack_no_evacuation @@ -1221,7 +1230,7 @@ major_copy_or_mark_object_concurrent_canonical (GCObject **ptr, SgenGrayQueue *q static void major_copy_or_mark_object_concurrent_finish_canonical (GCObject **ptr, SgenGrayQueue *queue) { - major_copy_or_mark_object_no_evacuation (ptr, *ptr, queue); + major_copy_or_mark_object_with_evacuation (ptr, *ptr, queue); } static void @@ -1275,7 +1284,7 @@ sweep_block_for_size (MSBlockInfo *block, int count, int obj_size) memset (obj, 0, obj_size); } *(void**)obj = block->free_list; - block->free_list = obj; + block->free_list = (void **)obj; } } } @@ -1355,9 +1364,9 @@ sweep_block (MSBlockInfo *block) void *next = *(void**)block->free_list; *(void**)block->free_list = reversed; reversed = block->free_list; - block->free_list = next; + block->free_list = (void **)next; } - block->free_list = reversed; + block->free_list = (void **)reversed; mono_memory_write_barrier (); @@ -1610,8 +1619,6 @@ sweep_job_func (void *thread_data_untyped, SgenThreadPoolJob *job) static void sweep_finish (void) { - mword total_evacuate_heap = 0; - mword total_evacuate_saved = 0; int i; for (i = 0; i < num_block_obj_sizes; ++i) { @@ -1625,16 +1632,8 @@ sweep_finish (void) } else { evacuate_block_obj_sizes [i] = FALSE; } - { - mword total_bytes = block_obj_sizes [i] * sweep_slots_available [i]; - total_evacuate_heap += total_bytes; - if (evacuate_block_obj_sizes [i]) - total_evacuate_saved += total_bytes - block_obj_sizes [i] * sweep_slots_used [i]; - } } - want_evacuation = (float)total_evacuate_saved / (float)total_evacuate_heap > (1 - concurrent_evacuation_threshold); - set_sweep_state (SWEEP_STATE_SWEPT, SWEEP_STATE_COMPACTING); } @@ -2380,16 +2379,16 @@ sgen_marksweep_init_internal (SgenMajorCollector *collector, gboolean is_concurr sgen_register_fixed_internal_mem_type (INTERNAL_MEM_MS_BLOCK_INFO, sizeof (MSBlockInfo)); num_block_obj_sizes = ms_calculate_block_obj_sizes (MS_BLOCK_OBJ_SIZE_FACTOR, NULL); - block_obj_sizes = sgen_alloc_internal_dynamic (sizeof (int) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE); + block_obj_sizes = (int *)sgen_alloc_internal_dynamic (sizeof (int) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE); ms_calculate_block_obj_sizes (MS_BLOCK_OBJ_SIZE_FACTOR, block_obj_sizes); - evacuate_block_obj_sizes = sgen_alloc_internal_dynamic (sizeof (gboolean) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE); + evacuate_block_obj_sizes = (gboolean *)sgen_alloc_internal_dynamic (sizeof (gboolean) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE); for (i = 0; i < num_block_obj_sizes; ++i) evacuate_block_obj_sizes [i] = FALSE; - sweep_slots_available = sgen_alloc_internal_dynamic (sizeof (size_t) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE); - sweep_slots_used = sgen_alloc_internal_dynamic (sizeof (size_t) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE); - sweep_num_blocks = sgen_alloc_internal_dynamic (sizeof (size_t) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE); + sweep_slots_available = (size_t *)sgen_alloc_internal_dynamic (sizeof (size_t) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE); + sweep_slots_used = (size_t *)sgen_alloc_internal_dynamic (sizeof (size_t) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE); + sweep_num_blocks = (size_t *)sgen_alloc_internal_dynamic (sizeof (size_t) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE); /* { @@ -2401,7 +2400,7 @@ sgen_marksweep_init_internal (SgenMajorCollector *collector, gboolean is_concurr */ for (i = 0; i < MS_BLOCK_TYPE_MAX; ++i) - free_block_lists [i] = sgen_alloc_internal_dynamic (sizeof (MSBlockInfo*) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE); + free_block_lists [i] = (MSBlockInfo *volatile *)sgen_alloc_internal_dynamic (sizeof (MSBlockInfo*) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES, TRUE); for (i = 0; i < MS_NUM_FAST_BLOCK_OBJ_SIZE_INDEXES; ++i) fast_block_obj_size_indexes [i] = ms_find_block_obj_size_index (i * 8); @@ -2411,7 +2410,6 @@ sgen_marksweep_init_internal (SgenMajorCollector *collector, gboolean is_concurr mono_counters_register ("# major blocks allocated", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_major_blocks_alloced); mono_counters_register ("# major blocks freed", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_major_blocks_freed); mono_counters_register ("# major blocks lazy swept", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_major_blocks_lazy_swept); - mono_counters_register ("# major objects evacuated", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_major_objects_evacuated); #if SIZEOF_VOID_P != 8 mono_counters_register ("# major blocks freed ideally", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_major_blocks_freed_ideal); mono_counters_register ("# major blocks freed less ideally", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_major_blocks_freed_less_ideal); @@ -2424,10 +2422,6 @@ sgen_marksweep_init_internal (SgenMajorCollector *collector, gboolean is_concurr concurrent_mark = is_concurrent; collector->is_concurrent = is_concurrent; collector->needs_thread_pool = is_concurrent || concurrent_sweep; - if (is_concurrent) - collector->want_synchronous_collection = &want_evacuation; - else - collector->want_synchronous_collection = NULL; collector->get_and_reset_num_major_objects_marked = major_get_and_reset_num_major_objects_marked; collector->supports_cardtable = TRUE; @@ -2481,9 +2475,9 @@ sgen_marksweep_init_internal (SgenMajorCollector *collector, gboolean is_concurr collector->major_ops_concurrent_start.drain_gray_stack = drain_gray_stack_concurrent; collector->major_ops_concurrent_finish.copy_or_mark_object = major_copy_or_mark_object_concurrent_finish_canonical; - collector->major_ops_concurrent_finish.scan_object = major_scan_object_no_evacuation; + collector->major_ops_concurrent_finish.scan_object = major_scan_object_with_evacuation; collector->major_ops_concurrent_finish.scan_vtype = major_scan_vtype_concurrent_finish; - collector->major_ops_concurrent_finish.drain_gray_stack = drain_gray_stack_no_evacuation; + collector->major_ops_concurrent_finish.drain_gray_stack = drain_gray_stack; } #ifdef HEAVY_STATISTICS @@ -2494,6 +2488,7 @@ sgen_marksweep_init_internal (SgenMajorCollector *collector, gboolean is_concurr mono_counters_register ("Optimized copy major", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_optimized_copy_major); mono_counters_register ("Optimized copy major small fast", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_optimized_copy_major_small_fast); mono_counters_register ("Optimized copy major small slow", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_optimized_copy_major_small_slow); + mono_counters_register ("Optimized copy major small evacuate", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_optimized_copy_major_small_evacuate); mono_counters_register ("Optimized copy major large", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_optimized_copy_major_large); mono_counters_register ("Optimized major scan", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_optimized_major_scan); mono_counters_register ("Optimized major scan no refs", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_optimized_major_scan_no_refs); @@ -2504,7 +2499,7 @@ sgen_marksweep_init_internal (SgenMajorCollector *collector, gboolean is_concurr #endif #ifdef SGEN_HEAVY_BINARY_PROTOCOL - mono_mutex_init (&scanned_objects_list_lock); + mono_os_mutex_init (&scanned_objects_list_lock); #endif SGEN_ASSERT (0, SGEN_MAX_SMALL_OBJ_SIZE <= MS_BLOCK_FREE / 2, "MAX_SMALL_OBJ_SIZE must be at most MS_BLOCK_FREE / 2"); diff --git a/mono/sgen/sgen-minor-scan-object.h b/mono/sgen/sgen-minor-scan-object.h index cda7746a44d..b1895985dc3 100644 --- a/mono/sgen/sgen-minor-scan-object.h +++ b/mono/sgen/sgen-minor-scan-object.h @@ -38,7 +38,7 @@ extern guint64 stat_scan_object_called_nursery; #define HANDLE_PTR(ptr,obj) do { \ void *__old = *(ptr); \ SGEN_OBJECT_LAYOUT_STATISTICS_MARK_BITMAP ((obj), (ptr)); \ - binary_protocol_scan_process_reference ((obj), (ptr), __old); \ + binary_protocol_scan_process_reference ((full_object), (ptr), __old); \ if (__old) { \ SERIAL_COPY_OBJECT_FROM_OBJ ((ptr), queue); \ SGEN_COND_LOG (9, __old != *(ptr), "Overwrote field at %p with %p (was: %p)", (ptr), *(ptr), __old); \ @@ -46,9 +46,9 @@ extern guint64 stat_scan_object_called_nursery; } while (0) static void -SERIAL_SCAN_OBJECT (GCObject *object, SgenDescriptor desc, SgenGrayQueue *queue) +SERIAL_SCAN_OBJECT (GCObject *full_object, SgenDescriptor desc, SgenGrayQueue *queue) { - char *start = (char*)object; + char *start = (char*)full_object; SGEN_OBJECT_LAYOUT_STATISTICS_DECLARE_BITMAP; diff --git a/mono/sgen/sgen-nursery-allocator.c b/mono/sgen/sgen-nursery-allocator.c index dc6152c77e7..e42e3bf64aa 100644 --- a/mono/sgen/sgen-nursery-allocator.c +++ b/mono/sgen/sgen-nursery-allocator.c @@ -253,7 +253,7 @@ sgen_fragment_allocator_alloc (void) frag->next = frag->next_in_order = NULL; return frag; } - frag = sgen_alloc_internal (INTERNAL_MEM_FRAGMENT); + frag = (SgenFragment *)sgen_alloc_internal (INTERNAL_MEM_FRAGMENT); frag->next = frag->next_in_order = NULL; return frag; } @@ -267,7 +267,7 @@ sgen_fragment_allocator_add (SgenFragmentAllocator *allocator, char *start, char fragment->fragment_start = start; fragment->fragment_next = start; fragment->fragment_end = end; - fragment->next_in_order = fragment->next = unmask (allocator->region_head); + fragment->next_in_order = fragment->next = (SgenFragment *)unmask (allocator->region_head); allocator->region_head = allocator->alloc_head = fragment; g_assert (fragment->fragment_end > fragment->fragment_start); @@ -304,7 +304,7 @@ try_again: printf ("retry count for fppf is %d\n", count); #endif - cur = unmask (*prev); + cur = (SgenFragment *)unmask (*prev); while (1) { if (cur == NULL) @@ -326,14 +326,14 @@ try_again: return prev; prev = &cur->next; } else { - next = unmask (next); + next = (SgenFragment *)unmask (next); if (InterlockedCompareExchangePointer ((volatile gpointer*)prev, next, cur) != cur) goto try_again; /*we must make sure that the next from cur->next happens after*/ mono_memory_write_barrier (); } - cur = unmask (next); + cur = (SgenFragment *)unmask (next); } return NULL; } @@ -448,7 +448,7 @@ sgen_fragment_allocator_par_alloc (SgenFragmentAllocator *allocator, size_t size #endif restart: - for (frag = unmask (allocator->alloc_head); unmask (frag); frag = unmask (frag->next)) { + for (frag = (SgenFragment *)unmask (allocator->alloc_head); unmask (frag); frag = (SgenFragment *)unmask (frag->next)) { HEAVY_STAT (++stat_alloc_iterations); if (size <= (size_t)(frag->fragment_end - frag->fragment_next)) { @@ -478,7 +478,7 @@ sgen_fragment_allocator_serial_alloc (SgenFragmentAllocator *allocator, size_t s previous = &allocator->alloc_head; for (frag = *previous; frag; frag = *previous) { - char *p = serial_alloc_from_fragment (previous, frag, size); + char *p = (char *)serial_alloc_from_fragment (previous, frag, size); HEAVY_STAT (++stat_alloc_iterations); @@ -558,7 +558,7 @@ restart: InterlockedIncrement (&alloc_count); #endif - for (frag = unmask (allocator->alloc_head); frag; frag = unmask (frag->next)) { + for (frag = (SgenFragment *)unmask (allocator->alloc_head); frag; frag = (SgenFragment *)unmask (frag->next)) { size_t frag_size = frag->fragment_end - frag->fragment_next; HEAVY_STAT (++stat_alloc_range_iterations); @@ -618,7 +618,7 @@ sgen_clear_allocator_fragments (SgenFragmentAllocator *allocator) { SgenFragment *frag; - for (frag = unmask (allocator->alloc_head); frag; frag = unmask (frag->next)) { + for (frag = (SgenFragment *)unmask (allocator->alloc_head); frag; frag = (SgenFragment *)unmask (frag->next)) { SGEN_LOG (4, "Clear nursery frag %p-%p", frag->fragment_next, frag->fragment_end); sgen_clear_range (frag->fragment_next, frag->fragment_end); #ifdef NALLOC_DEBUG @@ -747,7 +747,7 @@ sgen_build_nursery_fragments (GCMemSection *nursery_section, SgenGrayQueue *unpi addr0 = addr1 = sgen_nursery_end; if (pin_entry < pin_end) - addr0 = *pin_entry; + addr0 = (char *)*pin_entry; if (frags_ranges) addr1 = frags_ranges->fragment_start; @@ -802,7 +802,7 @@ sgen_build_nursery_fragments (GCMemSection *nursery_section, SgenGrayQueue *unpi if (!unmask (mutator_allocator.alloc_head)) { SGEN_LOG (1, "Nursery fully pinned"); for (pin_entry = pin_start; pin_entry < pin_end; ++pin_entry) { - void *p = *pin_entry; + GCObject *p = (GCObject *)*pin_entry; SGEN_LOG (3, "Bastard pinning obj %p (%s), size: %zd", p, sgen_client_vtable_get_name (SGEN_LOAD_VTABLE (p)), sgen_safe_object_get_size (p)); } } @@ -833,7 +833,7 @@ sgen_can_alloc_size (size_t size) size = SGEN_ALIGN_UP (size); - for (frag = unmask (mutator_allocator.alloc_head); frag; frag = unmask (frag->next)) { + for (frag = (SgenFragment *)unmask (mutator_allocator.alloc_head); frag; frag = (SgenFragment *)unmask (frag->next)) { if ((size_t)(frag->fragment_end - frag->fragment_next) >= size) return TRUE; } @@ -918,7 +918,7 @@ sgen_nursery_allocator_set_nursery_bounds (char *start, char *end) * since the nursery size must be a power of 2. */ sgen_space_bitmap_size = (end - start + SGEN_TO_SPACE_GRANULE_IN_BYTES * 8 - 1) / (SGEN_TO_SPACE_GRANULE_IN_BYTES * 8); - sgen_space_bitmap = g_malloc0 (sgen_space_bitmap_size); + sgen_space_bitmap = (char *)g_malloc0 (sgen_space_bitmap_size); /* Setup the single first large fragment */ sgen_minor_collector.init_nursery (&mutator_allocator, start, end); diff --git a/mono/sgen/sgen-pinning-stats.c b/mono/sgen/sgen-pinning-stats.c index 546f895583c..5edccfaabec 100644 --- a/mono/sgen/sgen-pinning-stats.c +++ b/mono/sgen/sgen-pinning-stats.c @@ -107,7 +107,7 @@ sgen_pin_stats_register_address (char *addr, int pin_type) node_ptr = &node->right; } - node = sgen_alloc_internal_dynamic (sizeof (PinStatAddress), INTERNAL_MEM_STATISTICS, TRUE); + node = (PinStatAddress *)sgen_alloc_internal_dynamic (sizeof (PinStatAddress), INTERNAL_MEM_STATISTICS, TRUE); node->addr = addr; node->pin_types = pin_type_bit; node->left = node->right = NULL; @@ -161,7 +161,7 @@ register_vtable (GCVTable vtable, int pin_types) int i; memset (&empty_entry, 0, sizeof (PinnedClassEntry)); - entry = lookup_vtable_entry (&pinned_class_hash_table, vtable, &empty_entry); + entry = (PinnedClassEntry *)lookup_vtable_entry (&pinned_class_hash_table, vtable, &empty_entry); for (i = 0; i < PIN_TYPE_MAX; ++i) { if (pin_types & (1 << i)) @@ -194,7 +194,7 @@ sgen_pin_stats_register_global_remset (GCObject *obj) return; memset (&empty_entry, 0, sizeof (GlobalRemsetClassEntry)); - entry = lookup_vtable_entry (&global_remset_class_hash_table, SGEN_LOAD_VTABLE (obj), &empty_entry); + entry = (GlobalRemsetClassEntry *)lookup_vtable_entry (&global_remset_class_hash_table, SGEN_LOAD_VTABLE (obj), &empty_entry); ++entry->num_remsets; } @@ -210,7 +210,7 @@ sgen_pin_stats_print_class_stats (void) return; mono_gc_printf (gc_debug_file, "\n%-50s %10s %10s %10s\n", "Class", "Stack", "Static", "Other"); - SGEN_HASH_TABLE_FOREACH (&pinned_class_hash_table, name, pinned_entry) { + SGEN_HASH_TABLE_FOREACH (&pinned_class_hash_table, char *, name, PinnedClassEntry *, pinned_entry) { int i; mono_gc_printf (gc_debug_file, "%-50s", name); for (i = 0; i < PIN_TYPE_MAX; ++i) @@ -219,7 +219,7 @@ sgen_pin_stats_print_class_stats (void) } SGEN_HASH_TABLE_FOREACH_END; mono_gc_printf (gc_debug_file, "\n%-50s %10s\n", "Class", "#Remsets"); - SGEN_HASH_TABLE_FOREACH (&global_remset_class_hash_table, name, remset_entry) { + SGEN_HASH_TABLE_FOREACH (&global_remset_class_hash_table, char *, name, GlobalRemsetClassEntry *, remset_entry) { mono_gc_printf (gc_debug_file, "%-50s %10ld\n", name, remset_entry->num_remsets); } SGEN_HASH_TABLE_FOREACH_END; diff --git a/mono/sgen/sgen-pinning.c b/mono/sgen/sgen-pinning.c index fc0ba0bbdf6..a94af9ddf44 100644 --- a/mono/sgen/sgen-pinning.c +++ b/mono/sgen/sgen-pinning.c @@ -173,7 +173,7 @@ sgen_dump_pin_queue (void) int i; for (i = 0; i < last_num_pinned; ++i) { - void *ptr = pin_queue.data [i]; + GCObject *ptr = (GCObject *)pin_queue.data [i]; SGEN_LOG (3, "Bastard pinning obj %p (%s), size: %zd", ptr, sgen_client_vtable_get_name (SGEN_LOAD_VTABLE (ptr)), sgen_safe_object_get_size (ptr)); } } diff --git a/mono/sgen/sgen-pointer-queue.c b/mono/sgen/sgen-pointer-queue.c index 0e3fea65318..196bc301071 100644 --- a/mono/sgen/sgen-pointer-queue.c +++ b/mono/sgen/sgen-pointer-queue.c @@ -43,7 +43,7 @@ static void realloc_queue (SgenPointerQueue *queue) { size_t new_size = queue->size ? queue->size + queue->size/2 : 1024; - void **new_data = sgen_alloc_internal_dynamic (sizeof (void*) * new_size, queue->mem_type, TRUE); + void **new_data = (void **)sgen_alloc_internal_dynamic (sizeof (void*) * new_size, queue->mem_type, TRUE); memcpy (new_data, queue->data, sizeof (void*) * queue->next_slot); sgen_free_internal_dynamic (queue->data, sizeof (void*) * queue->size, queue->mem_type); diff --git a/mono/sgen/sgen-protocol-def.h b/mono/sgen/sgen-protocol-def.h index 91094fdc1ae..6d76952b0af 100644 --- a/mono/sgen/sgen-protocol-def.h +++ b/mono/sgen/sgen-protocol-def.h @@ -112,7 +112,7 @@ MATCH_INDEX (matches_interval (ptr, entry->addr, entry->size) ? 0 : BINARY_PROTO IS_VTABLE_MATCH (FALSE) END_PROTOCOL_ENTRY_HEAVY -BEGIN_PROTOCOL_ENTRY_HEAVY4 (binary_protocol_block_set_state, TYPE_POINTER, addr, TYPE_SIZE, size, TYPE_INT, old, TYPE_INT, new) +BEGIN_PROTOCOL_ENTRY_HEAVY4 (binary_protocol_block_set_state, TYPE_POINTER, addr, TYPE_SIZE, size, TYPE_INT, old, TYPE_INT, new_) DEFAULT_PRINT () IS_ALWAYS_MATCH (FALSE) MATCH_INDEX (matches_interval (ptr, entry->addr, entry->size) ? 0 : BINARY_PROTOCOL_NO_MATCH) @@ -372,6 +372,13 @@ MATCH_INDEX (ptr == entry->cursor ? 1 : ptr == entry->value ? 2 : BINARY_PROTOCO IS_VTABLE_MATCH (FALSE) END_PROTOCOL_ENTRY_HEAVY +BEGIN_PROTOCOL_ENTRY_HEAVY4 (binary_protocol_mod_union_remset, TYPE_POINTER, obj, TYPE_POINTER, ptr, TYPE_POINTER, value, TYPE_POINTER, value_vtable) +DEFAULT_PRINT () +IS_ALWAYS_MATCH (FALSE) +MATCH_INDEX (ptr == entry->obj ? 0 : ptr == entry->ptr ? 1 : ptr == entry->value ? 2 : BINARY_PROTOCOL_NO_MATCH) +IS_VTABLE_MATCH (ptr == entry->value_vtable) +END_PROTOCOL_ENTRY_HEAVY + #undef BEGIN_PROTOCOL_ENTRY0 #undef BEGIN_PROTOCOL_ENTRY1 #undef BEGIN_PROTOCOL_ENTRY2 diff --git a/mono/sgen/sgen-protocol.c b/mono/sgen/sgen-protocol.c index 4ea1ac391c9..5b30cbce11b 100644 --- a/mono/sgen/sgen-protocol.c +++ b/mono/sgen/sgen-protocol.c @@ -69,7 +69,7 @@ filename_for_index (int index) SGEN_ASSERT (0, file_size_limit > 0, "Indexed binary protocol filename must only be used with file size limit"); - filename = sgen_alloc_internal_dynamic (strlen (filename_or_prefix) + 32, INTERNAL_MEM_BINARY_PROTOCOL, TRUE); + filename = (char *)sgen_alloc_internal_dynamic (strlen (filename_or_prefix) + 32, INTERNAL_MEM_BINARY_PROTOCOL, TRUE); sprintf (filename, "%s.%d", filename_or_prefix, index); return filename; @@ -108,7 +108,7 @@ void binary_protocol_init (const char *filename, long long limit) { #ifdef HAVE_UNISTD_H - filename_or_prefix = sgen_alloc_internal_dynamic (strlen (filename) + 1, INTERNAL_MEM_BINARY_PROTOCOL, TRUE); + filename_or_prefix = (char *)sgen_alloc_internal_dynamic (strlen (filename) + 1, INTERNAL_MEM_BINARY_PROTOCOL, TRUE); strcpy (filename_or_prefix, filename); file_size_limit = limit; @@ -251,7 +251,7 @@ binary_protocol_flush_buffers (gboolean force) for (buf = binary_protocol_buffers; buf != NULL; buf = buf->next) ++num_buffers; - bufs = sgen_alloc_internal_dynamic (num_buffers * sizeof (BinaryProtocolBuffer*), INTERNAL_MEM_BINARY_PROTOCOL, TRUE); + bufs = (BinaryProtocolBuffer **)sgen_alloc_internal_dynamic (num_buffers * sizeof (BinaryProtocolBuffer*), INTERNAL_MEM_BINARY_PROTOCOL, TRUE); for (buf = binary_protocol_buffers, i = 0; buf != NULL; buf = buf->next, i++) bufs [i] = buf; SGEN_ASSERT (0, i == num_buffers, "Binary protocol buffer count error"); @@ -280,7 +280,7 @@ binary_protocol_get_buffer (int length) if (buffer && buffer->index + length <= BINARY_PROTOCOL_BUFFER_SIZE) return buffer; - new_buffer = sgen_alloc_os_memory (sizeof (BinaryProtocolBuffer), SGEN_ALLOC_INTERNAL | SGEN_ALLOC_ACTIVATE, "debugging memory"); + new_buffer = (BinaryProtocolBuffer *)sgen_alloc_os_memory (sizeof (BinaryProtocolBuffer), (SgenAllocFlags)(SGEN_ALLOC_INTERNAL | SGEN_ALLOC_ACTIVATE), "debugging memory"); new_buffer->next = buffer; new_buffer->index = 0; diff --git a/mono/sgen/sgen-split-nursery.c b/mono/sgen/sgen-split-nursery.c index ea427f6a21f..588651fbc0b 100644 --- a/mono/sgen/sgen-split-nursery.c +++ b/mono/sgen/sgen-split-nursery.c @@ -179,8 +179,8 @@ mark_bit (char *space_bitmap, char *pos) static void mark_bits_in_range (char *space_bitmap, char *start, char *end) { - start = align_down (start, SGEN_TO_SPACE_GRANULE_BITS); - end = align_up (end, SGEN_TO_SPACE_GRANULE_BITS); + start = (char *)align_down (start, SGEN_TO_SPACE_GRANULE_BITS); + end = (char *)align_up (end, SGEN_TO_SPACE_GRANULE_BITS); for (;start < end; start += SGEN_TO_SPACE_GRANULE_IN_BYTES) mark_bit (space_bitmap, start); @@ -244,7 +244,7 @@ alloc_for_promotion_slow_path (int age, size_t objsize) size_t allocated_size; size_t aligned_objsize = (size_t)align_up (objsize, SGEN_TO_SPACE_GRANULE_BITS); - p = sgen_fragment_allocator_serial_range_alloc ( + p = (char *)sgen_fragment_allocator_serial_range_alloc ( &collector_allocator, MAX (aligned_objsize, AGE_ALLOC_BUFFER_DESIRED_SIZE), MAX (aligned_objsize, AGE_ALLOC_BUFFER_MIN_SIZE), @@ -336,8 +336,8 @@ prepare_to_space (char *to_space_bitmap, size_t space_bitmap_size) previous = &collector_allocator.alloc_head; for (frag = *previous; frag; frag = *previous) { - char *start = align_up (frag->fragment_next, SGEN_TO_SPACE_GRANULE_BITS); - char *end = align_down (frag->fragment_end, SGEN_TO_SPACE_GRANULE_BITS); + char *start = (char *)align_up (frag->fragment_next, SGEN_TO_SPACE_GRANULE_BITS); + char *end = (char *)align_down (frag->fragment_end, SGEN_TO_SPACE_GRANULE_BITS); /* Fragment is too small to be usable. */ if ((end - start) < SGEN_MAX_NURSERY_WASTE) { @@ -378,12 +378,12 @@ static void init_nursery (SgenFragmentAllocator *allocator, char *start, char *end) { int alloc_quote = (int)((end - start) * alloc_ratio); - promotion_barrier = align_down (start + alloc_quote, 3); + promotion_barrier = (char *)align_down (start + alloc_quote, 3); sgen_fragment_allocator_add (allocator, start, promotion_barrier); sgen_fragment_allocator_add (&collector_allocator, promotion_barrier, end); region_age_size = (end - start) >> SGEN_TO_SPACE_GRANULE_BITS; - region_age = g_malloc0 (region_age_size); + region_age = (char *)g_malloc0 (region_age_size); } static gboolean diff --git a/mono/sgen/sgen-thread-pool.c b/mono/sgen/sgen-thread-pool.c index 629b19a4151..e9706943f84 100644 --- a/mono/sgen/sgen-thread-pool.c +++ b/mono/sgen/sgen-thread-pool.c @@ -23,7 +23,7 @@ #include "mono/sgen/sgen-gc.h" #include "mono/sgen/sgen-thread-pool.h" #include "mono/sgen/sgen-pointer-queue.h" -#include "mono/utils/mono-mutex.h" +#include "mono/utils/mono-os-mutex.h" #ifndef SGEN_WITHOUT_MONO #include "mono/utils/mono-threads.h" #endif @@ -52,7 +52,7 @@ static SgenThreadPoolJob* get_job_and_set_in_progress (void) { for (size_t i = 0; i < job_queue.next_slot; ++i) { - SgenThreadPoolJob *job = job_queue.data [i]; + SgenThreadPoolJob *job = (SgenThreadPoolJob *)job_queue.data [i]; if (job->state == STATE_WAITING) { job->state = STATE_IN_PROGRESS; return job; @@ -98,7 +98,7 @@ thread_func (void *thread_data) { thread_init_func (thread_data); - mono_mutex_lock (&lock); + mono_os_mutex_lock (&lock); for (;;) { /* * It's important that we check the continue idle flag with the lock held. @@ -115,16 +115,16 @@ thread_func (void *thread_data) * not being signalled, so we have to run this in a loop until we * really have work to do. */ - mono_cond_wait (&work_cond, &lock); + mono_os_cond_wait (&work_cond, &lock); continue; } - mono_mutex_unlock (&lock); + mono_os_mutex_unlock (&lock); if (job) { job->func (thread_data, job); - mono_mutex_lock (&lock); + mono_os_mutex_lock (&lock); SGEN_ASSERT (0, job->state == STATE_IN_PROGRESS, "The job should still be in progress."); job->state = STATE_DONE; @@ -133,7 +133,7 @@ thread_func (void *thread_data) * Only the main GC thread will ever wait on the done condition, so we don't * have to broadcast. */ - mono_cond_signal (&done_cond); + mono_os_cond_signal (&done_cond); } else { SGEN_ASSERT (0, do_idle, "Why did we unlock if we still have to wait for idle?"); SGEN_ASSERT (0, idle_job_func, "Why do we have idle work when there's no idle job function?"); @@ -142,10 +142,10 @@ thread_func (void *thread_data) do_idle = continue_idle_job (); } while (do_idle && !job_queue.next_slot); - mono_mutex_lock (&lock); + mono_os_mutex_lock (&lock); if (!do_idle) - mono_cond_signal (&done_cond); + mono_os_cond_signal (&done_cond); } } @@ -157,9 +157,9 @@ sgen_thread_pool_init (int num_threads, SgenThreadPoolThreadInitFunc init_func, { SGEN_ASSERT (0, num_threads == 1, "We only support 1 thread pool thread for now."); - mono_mutex_init (&lock); - mono_cond_init (&work_cond, 0); - mono_cond_init (&done_cond, 0); + mono_os_mutex_init (&lock); + mono_os_cond_init (&work_cond); + mono_os_cond_init (&done_cond); thread_init_func = init_func; idle_job_func = idle_func; @@ -171,7 +171,7 @@ sgen_thread_pool_init (int num_threads, SgenThreadPoolThreadInitFunc init_func, SgenThreadPoolJob* sgen_thread_pool_job_alloc (const char *name, SgenThreadPoolJobFunc func, size_t size) { - SgenThreadPoolJob *job = sgen_alloc_internal_dynamic (size, INTERNAL_MEM_THREAD_POOL_JOB, TRUE); + SgenThreadPoolJob *job = (SgenThreadPoolJob *)sgen_alloc_internal_dynamic (size, INTERNAL_MEM_THREAD_POOL_JOB, TRUE); job->name = name; job->size = size; job->state = STATE_WAITING; @@ -188,16 +188,16 @@ sgen_thread_pool_job_free (SgenThreadPoolJob *job) void sgen_thread_pool_job_enqueue (SgenThreadPoolJob *job) { - mono_mutex_lock (&lock); + mono_os_mutex_lock (&lock); sgen_pointer_queue_add (&job_queue, job); /* * FIXME: We could check whether there is a job in progress. If there is, there's * no need to signal the condition, at least as long as we have only one thread. */ - mono_cond_signal (&work_cond); + mono_os_cond_signal (&work_cond); - mono_mutex_unlock (&lock); + mono_os_mutex_unlock (&lock); } void @@ -205,12 +205,12 @@ sgen_thread_pool_job_wait (SgenThreadPoolJob *job) { SGEN_ASSERT (0, job, "Where's the job?"); - mono_mutex_lock (&lock); + mono_os_mutex_lock (&lock); while (find_job_in_queue (job) >= 0) - mono_cond_wait (&done_cond, &lock); + mono_os_cond_wait (&done_cond, &lock); - mono_mutex_unlock (&lock); + mono_os_mutex_unlock (&lock); } void @@ -218,12 +218,12 @@ sgen_thread_pool_idle_signal (void) { SGEN_ASSERT (0, idle_job_func, "Why are we signaling idle without an idle function?"); - mono_mutex_lock (&lock); + mono_os_mutex_lock (&lock); if (continue_idle_job_func ()) - mono_cond_signal (&work_cond); + mono_os_cond_signal (&work_cond); - mono_mutex_unlock (&lock); + mono_os_mutex_unlock (&lock); } void @@ -231,23 +231,23 @@ sgen_thread_pool_idle_wait (void) { SGEN_ASSERT (0, idle_job_func, "Why are we waiting for idle without an idle function?"); - mono_mutex_lock (&lock); + mono_os_mutex_lock (&lock); while (continue_idle_job_func ()) - mono_cond_wait (&done_cond, &lock); + mono_os_cond_wait (&done_cond, &lock); - mono_mutex_unlock (&lock); + mono_os_mutex_unlock (&lock); } void sgen_thread_pool_wait_for_all_jobs (void) { - mono_mutex_lock (&lock); + mono_os_mutex_lock (&lock); while (!sgen_pointer_queue_is_empty (&job_queue)) - mono_cond_wait (&done_cond, &lock); + mono_os_cond_wait (&done_cond, &lock); - mono_mutex_unlock (&lock); + mono_os_mutex_unlock (&lock); } gboolean diff --git a/mono/sgen/sgen-workers.c b/mono/sgen/sgen-workers.c index 40d0ed10359..8f1af133129 100644 --- a/mono/sgen/sgen-workers.c +++ b/mono/sgen/sgen-workers.c @@ -191,7 +191,7 @@ init_private_gray_queue (WorkerData *data) static void thread_pool_init_func (void *data_untyped) { - WorkerData *data = data_untyped; + WorkerData *data = (WorkerData *)data_untyped; SgenMajorCollector *major = sgen_get_major_collector (); sgen_client_thread_register_worker (); @@ -211,7 +211,7 @@ continue_idle_func (void) static void marker_idle_func (void *data_untyped) { - WorkerData *data = data_untyped; + WorkerData *data = (WorkerData *)data_untyped; SGEN_ASSERT (0, continue_idle_func (), "Why are we called when we're not supposed to work?"); SGEN_ASSERT (0, sgen_concurrent_collection_in_progress (), "The worker should only mark in concurrent collections."); @@ -258,7 +258,7 @@ void sgen_workers_init (int num_workers) { int i; - void **workers_data_ptrs = alloca(num_workers * sizeof(void *)); + void **workers_data_ptrs = (void **)alloca(num_workers * sizeof(void *)); if (!sgen_get_major_collector ()->is_concurrent) { sgen_thread_pool_init (num_workers, thread_pool_init_func, NULL, NULL, NULL); @@ -269,7 +269,7 @@ sgen_workers_init (int num_workers) workers_num = num_workers; - workers_data = sgen_alloc_internal_dynamic (sizeof (WorkerData) * num_workers, INTERNAL_MEM_WORKER_DATA, TRUE); + workers_data = (WorkerData *)sgen_alloc_internal_dynamic (sizeof (WorkerData) * num_workers, INTERNAL_MEM_WORKER_DATA, TRUE); memset (workers_data, 0, sizeof (WorkerData) * num_workers); init_distribute_gray_queue (); diff --git a/mono/tests/Makefile.am b/mono/tests/Makefile.am index 03cf5a7e9bf..f784c41bfdc 100644 --- a/mono/tests/Makefile.am +++ b/mono/tests/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = assemblyresolve gc-descriptors -check-local: assemblyresolve/test/asm.dll testjit test-generic-sharing test-type-load test-cattr-type-load test-reflection-load-with-context test_platform test-process-exit test-messages test-unhandled-exception-2 test-appdomain-unload rm-empty-logs +check-local: assemblyresolve/test/asm.dll testjit test-generic-sharing test-type-load test-cattr-type-load test-reflection-load-with-context test_platform test-process-exit test-messages test-env-options test-unhandled-exception-2 test-appdomain-unload rm-empty-logs check-full: test-sgen check-local check-parallel: compile-tests check-full @@ -188,6 +188,7 @@ BASE_TEST_CS_SRC= \ delegate10.cs \ delegate11.cs \ delegate12.cs \ + delegate13.cs \ remoting1.cs \ remoting2.cs \ remoting3.cs \ @@ -754,6 +755,9 @@ test-messages: w32message.exe endif endif +test-env-options: + MONO_ENV_OPTIONS="--version" $(RUNTIME) array-init.exe | grep -q Architecture: + if AMD64 test-sgen : sgen-tests else diff --git a/mono/tests/delegate13.cs b/mono/tests/delegate13.cs new file mode 100644 index 00000000000..3a4cfd02a01 --- /dev/null +++ b/mono/tests/delegate13.cs @@ -0,0 +1,31 @@ +using System; + +public static class Program +{ + public static int Main () + { + Action d1 = new Action (Method1); + Action d2 = new Action (Method2); + Action d12 = d1 + d2; + Action d21 = d2 + d1; + + if (d1.Method.Name != "Method1") + return 1; + if (d2.Method.Name != "Method2") + return 2; + if (d12.Method.Name != "Method2") + return 3; + if (d21.Method.Name != "Method1") + return 4; + + return 0; + } + + public static void Method1 () + { + } + + public static void Method2 () + { + } +} \ No newline at end of file diff --git a/mono/tests/delegate7.cs b/mono/tests/delegate7.cs index a89657a4ba2..dd3a2a3ea27 100644 --- a/mono/tests/delegate7.cs +++ b/mono/tests/delegate7.cs @@ -16,6 +16,10 @@ class Tests { v += 4; Console.WriteLine ("Test.F4"); } + static void F8 () { + v += 8; + Console.WriteLine ("Test.F8"); + } public static int Main () { return TestDriver.RunTests (typeof (Tests)); @@ -33,6 +37,7 @@ class Tests { SimpleDelegate d1 = new SimpleDelegate (F1); SimpleDelegate d2 = new SimpleDelegate (F2); SimpleDelegate d4 = new SimpleDelegate (F4); + SimpleDelegate d8 = new SimpleDelegate (F8); if (d1 - d1 != null) return 1; @@ -82,21 +87,21 @@ class Tests { if (d12 - d12 != null) return 21; - if (!check_is_expected_v (d12 - d14, 2)) + if (!check_is_expected_v (d12 - d14, 3)) return 22; - if (!check_is_expected_v (d12 - d24, 1)) + if (!check_is_expected_v (d12 - d24, 3)) return 23; - if (!check_is_expected_v (d14 - d12, 4)) + if (!check_is_expected_v (d14 - d12, 5)) return 24; if (d14 - d14 != null) return 25; - if (!check_is_expected_v (d14 - d24, 1)) + if (!check_is_expected_v (d14 - d24, 5)) return 26; - if (!check_is_expected_v (d24 - d12, 4)) + if (!check_is_expected_v (d24 - d12, 6)) return 27; - if (!check_is_expected_v (d24 - d14, 2)) + if (!check_is_expected_v (d24 - d14, 6)) return 28; if (d24 - d24 != null) return 29; @@ -112,7 +117,7 @@ class Tests { if (!check_is_expected_v (d124 - d12, 4)) return 34; - if (!check_is_expected_v (d124 - d14, 2)) + if (!check_is_expected_v (d124 - d14, 7)) return 35; if (!check_is_expected_v (d124 - d24, 1)) return 36; @@ -120,6 +125,35 @@ class Tests { if (d124 - d124 != null) return 37; + SimpleDelegate d1248 = d1 + d2 + d4 + d8; + + if (!check_is_expected_v (d1248 - (d1 + d2), 12)) + return 41; + if (!check_is_expected_v (d1248 - (d1 + d4), 15)) + return 42; + if (!check_is_expected_v (d1248 - (d1 + d8), 15)) + return 43; + if (!check_is_expected_v (d1248 - (d2 + d4), 9)) + return 44; + if (!check_is_expected_v (d1248 - (d2 + d8), 15)) + return 45; + if (!check_is_expected_v (d1248 - (d4 + d8), 3)) + return 46; + + if (!check_is_expected_v (d1248 - (d1 + d2 + d4), 8)) + return 51; + if (!check_is_expected_v (d1248 - (d1 + d2 + d8), 15)) + return 52; + if (!check_is_expected_v (d1248 - (d1 + d4 + d8), 15)) + return 53; + if (!check_is_expected_v (d1248 - (d2 + d4 + d8), 1)) + return 54; + if (!check_is_expected_v (d1248 - (d2 + d4 + d8), 1)) + return 54; + + if (d1248 - d1248 != null) + return 55; + return 0; } diff --git a/mono/tests/libtest.c b/mono/tests/libtest.c index 60983ef323e..de80d9f693f 100644 --- a/mono/tests/libtest.c +++ b/mono/tests/libtest.c @@ -99,7 +99,7 @@ static gunichar2* marshal_bstr_alloc(const gchar* str) int slen = strlen (str); gunichar2* temp; /* allocate len + 1 utf16 characters plus 4 byte integer for length*/ - ret = g_malloc ((slen + 1) * sizeof(gunichar2) + sizeof(guint32)); + ret = (gchar *)g_malloc ((slen + 1) * sizeof(gunichar2) + sizeof(guint32)); if (ret == NULL) return NULL; temp = g_utf8_to_utf16 (str, -1, NULL, NULL, NULL); @@ -129,7 +129,7 @@ test_lpwstr_marshal (unsigned short* chars, long length) int i = 0; unsigned short *res; - res = marshal_alloc (2 * (length + 1)); + res = (unsigned short *)marshal_alloc (2 * (length + 1)); // printf("test_lpwstr_marshal()\n"); @@ -152,7 +152,7 @@ test_lpwstr_marshal_out (unsigned short** chars) const char abc[] = "ABC"; glong len = strlen(abc); - *chars = marshal_alloc (2 * (len + 1)); + *chars = (unsigned short *)marshal_alloc (2 * (len + 1)); while ( i < len ) { (*chars) [i] = abc[i]; @@ -515,7 +515,7 @@ mono_test_marshal_out_byref_array_out_size_param (int **out_arr, int *out_len) int i, len; len = 4; - arr = marshal_alloc (sizeof (gint32) * len); + arr = (gint32 *)marshal_alloc (sizeof (gint32) * len); for (i = 0; i < len; ++i) arr [i] = i; *out_arr = arr; @@ -623,7 +623,7 @@ LIBTEST_API int STDCALL mono_test_marshal_out_struct (int a, simplestruct *ss, int b, OutVTypeDelegate func) { /* Check that the input pointer is ignored */ - ss->d = (gpointer)0x12345678; + ss->d = (const char *)0x12345678; func (a, ss, b); @@ -1018,7 +1018,7 @@ mono_test_marshal_delegate7 (SimpleDelegate7 delegate) simplestruct *ptr; /* Check that the input pointer is ignored */ - ptr = (gpointer)0x12345678; + ptr = (simplestruct *)0x12345678; res = delegate (&ptr); if (res != 0) @@ -1067,7 +1067,7 @@ typedef int (STDCALL *SimpleDelegate9) (return_int_fnt d); LIBTEST_API int STDCALL mono_test_marshal_delegate9 (SimpleDelegate9 delegate, gpointer ftn) { - return delegate (ftn); + return delegate ((return_int_fnt)ftn); } static int STDCALL @@ -1172,7 +1172,7 @@ mono_test_marshal_stringbuilder_out (char **s) const char m[] = "This is my message. Isn't it nice?"; char *str; - str = marshal_alloc (strlen (m) + 1); + str = (char *)marshal_alloc (strlen (m) + 1); memcpy (str, m, strlen (m) + 1); *s = str; @@ -1188,7 +1188,7 @@ mono_test_marshal_stringbuilder_out_unicode (gunichar2 **s) s2 = g_utf8_to_utf16 (m, -1, NULL, &len, NULL); len = (len * 2) + 2; - *s = marshal_alloc (len); + *s = (gunichar2 *)marshal_alloc (len); memcpy (*s, s2, len); g_free (s2); @@ -1205,18 +1205,21 @@ mono_test_marshal_stringbuilder_ref (char **s) if (strcmp (*s, "ABC")) return 1; - str = marshal_alloc (strlen (m) + 1); + str = (char *)marshal_alloc (strlen (m) + 1); memcpy (str, m, strlen (m) + 1); *s = str; return 0; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++-compat" typedef struct { #ifndef __GNUC__ char a; #endif } EmptyStruct; +#pragma GCC diagnostic pop LIBTEST_API int STDCALL mono_test_marshal_empty_string_array (char **array) @@ -1334,7 +1337,7 @@ mono_test_byvalstr_gen (void) { ByValStrStruct *ret; - ret = malloc(sizeof(ByValStrStruct)); + ret = (ByValStrStruct *)malloc (sizeof (ByValStrStruct)); memset(ret, 'a', sizeof(ByValStrStruct)-1); ret->a[sizeof(ByValStrStruct)-1] = 0; @@ -1490,7 +1493,7 @@ class_marshal_test4 (SimpleObj *obj1) LIBTEST_API void STDCALL class_marshal_test1 (SimpleObj **obj1) { - SimpleObj *res = malloc (sizeof (SimpleObj)); + SimpleObj *res = (SimpleObj *)malloc (sizeof (SimpleObj)); res->str = marshal_strdup ("ABC"); res->i = 5; @@ -1733,7 +1736,7 @@ mono_test_asany (void *ptr, int what) GError *error = NULL; char *s; - s = g_utf16_to_utf8 (ptr, -1, NULL, NULL, &error); + s = g_utf16_to_utf8 ((const gunichar2 *)ptr, -1, NULL, NULL, &error); if (!s) return 1; @@ -1765,7 +1768,7 @@ typedef struct LIBTEST_API int STDCALL mono_test_marshal_asany_in (void* ptr) { - AsAnyStruct* asAny = ptr; + AsAnyStruct *asAny = (AsAnyStruct *)ptr; int res = asAny->i + asAny->j + asAny->k; return res; @@ -1774,7 +1777,7 @@ mono_test_marshal_asany_in (void* ptr) LIBTEST_API int STDCALL mono_test_marshal_asany_inout (void* ptr) { - AsAnyStruct* asAny = ptr; + AsAnyStruct *asAny = (AsAnyStruct *)ptr; int res = asAny->i + asAny->j + asAny->k; marshal_free (asAny->s); @@ -1790,7 +1793,7 @@ mono_test_marshal_asany_inout (void* ptr) LIBTEST_API int STDCALL mono_test_marshal_asany_out (void* ptr) { - AsAnyStruct* asAny = ptr; + AsAnyStruct *asAny = (AsAnyStruct *)ptr; int res = asAny->i + asAny->j + asAny->k; asAny->i = 10; @@ -1976,7 +1979,7 @@ mono_test_marshal_pass_return_custom_in_delegate (PassReturnPtrDelegate del) buf [0] = 0; buf [1] = 10; - ptr = del (&buf); + ptr = (guint32 *)del (&buf); res = ptr [1]; @@ -3586,22 +3589,22 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj int ret = 0; gpointer (*mono_method_get_unmanaged_thunk)(gpointer) - = lookup_mono_symbol ("mono_method_get_unmanaged_thunk"); + = (gpointer (*)(gpointer))lookup_mono_symbol ("mono_method_get_unmanaged_thunk"); gpointer (*mono_string_new_wrapper)(const char *) - = lookup_mono_symbol ("mono_string_new_wrapper"); + = (gpointer (*)(const char *))lookup_mono_symbol ("mono_string_new_wrapper"); - char* (*mono_string_to_utf8)(gpointer) - = lookup_mono_symbol ("mono_string_to_utf8"); + char *(*mono_string_to_utf8)(gpointer) + = (char *(*)(gpointer))lookup_mono_symbol ("mono_string_to_utf8"); gpointer (*mono_object_unbox)(gpointer) - = lookup_mono_symbol ("mono_object_unbox"); + = (gpointer (*)(gpointer))lookup_mono_symbol ("mono_object_unbox"); gpointer (*mono_threads_enter_gc_unsafe_region) (gpointer) - = lookup_mono_symbol ("mono_threads_enter_gc_unsafe_region"); + = (gpointer (*)(gpointer))lookup_mono_symbol ("mono_threads_enter_gc_unsafe_region"); void (*mono_threads_exit_gc_unsafe_region) (gpointer, gpointer) - = lookup_mono_symbol ("mono_threads_exit_gc_unsafe_region"); + = (void (*)(gpointer, gpointer))lookup_mono_symbol ("mono_threads_exit_gc_unsafe_region"); @@ -3621,7 +3624,7 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj goto done; } - CreateObject = mono_method_get_unmanaged_thunk (create_object_method_handle); + CreateObject = (gpointer (STDCALL *)(gpointer *))mono_method_get_unmanaged_thunk (create_object_method_handle); if (!CreateObject) { ret = 3; goto done; @@ -3632,14 +3635,14 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj case 0: { /* thunks.cs:Test.Test0 */ - void (STDCALL *F)(gpointer*) = test_method; + void (STDCALL *F)(gpointer *) = (void (STDCALL *)(gpointer *))test_method; F (&ex); break; } case 1: { /* thunks.cs:Test.Test1 */ - int (STDCALL *F)(gpointer*) = test_method; + int (STDCALL *F)(gpointer *) = (int (STDCALL *)(gpointer *))test_method; if (F (&ex) != 42) { ret = 4; goto done; @@ -3649,7 +3652,7 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj case 2: { /* thunks.cs:Test.Test2 */ - gpointer (STDCALL *F)(gpointer, gpointer*) = test_method; + gpointer (STDCALL *F)(gpointer, gpointer*) = (gpointer (STDCALL *)(gpointer, gpointer *))test_method; gpointer str = mono_string_new_wrapper ("foo"); if (str != F (str, &ex)) { ret = 4; @@ -3664,7 +3667,7 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj gpointer obj; gpointer str; - F = test_method; + F = (gpointer (STDCALL *)(gpointer, gpointer, gpointer *))test_method; obj = CreateObject (&ex); str = mono_string_new_wrapper ("bar"); @@ -3681,7 +3684,7 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj gpointer obj; gpointer str; - F = test_method; + F = (int (STDCALL *)(gpointer, gpointer, int, gpointer *))test_method; obj = CreateObject (&ex); str = mono_string_new_wrapper ("bar"); @@ -3699,7 +3702,7 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj gpointer obj; gpointer str; - F = test_method; + F = (int (STDCALL *)(gpointer, gpointer, int, gpointer *))test_method; obj = CreateObject (&ex); str = mono_string_new_wrapper ("bar"); @@ -3720,7 +3723,7 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj gpointer str = mono_string_new_wrapper ("Test6"); int res; - F = test_method; + F = (int (STDCALL *)(gpointer, guint8, gint16, gint32, gint64, float, double, gpointer, gpointer *))test_method; obj = CreateObject (&ex); res = F (obj, 254, 32700, -245378, 6789600, 3.1415, 3.1415, str, &ex); @@ -3739,7 +3742,7 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj case 7: { /* thunks.cs:Test.Test7 */ - gint64 (STDCALL *F)(gpointer*) = test_method; + gint64 (STDCALL *F)(gpointer*) = (gint64 (STDCALL *)(gpointer *))test_method; if (F (&ex) != G_MAXINT64) { ret = 4; goto done; @@ -3760,7 +3763,8 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj double a6; gpointer a7; - F = test_method; + F = (void (STDCALL *)(guint8 *, gint16 *, gint32 *, gint64 *, float *, double *, + gpointer *, gpointer *))test_method; F (&a1, &a2, &a3, &a4, &a5, &a6, &a7, &ex); if (ex) { @@ -3785,7 +3789,7 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj case 9: { /* thunks.cs:Test.Test9 */ void (STDCALL *F)(guint8*, gint16*, gint32*, gint64*, float*, double*, - gpointer*, gpointer*); + gpointer*, gpointer*); guint8 a1; gint16 a2; @@ -3795,7 +3799,8 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj double a6; gpointer a7; - F = test_method; + F = (void (STDCALL *)(guint8 *, gint16 *, gint32 *, gint64 *, float *, double *, + gpointer *, gpointer *))test_method; F (&a1, &a2, &a3, &a4, &a5, &a6, &a7, &ex); if (!ex) { @@ -3818,7 +3823,7 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj goto done; } - F = test_method; + F = (void (STDCALL *)(gpointer *, gpointer *))test_method; F (&obj1, &ex); if (ex) { @@ -3853,7 +3858,7 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj goto done; } - a1 = mono_object_unbox (obj); + a1 = (TestStruct *)mono_object_unbox (obj); if (!a1) { ret = 6; goto done; @@ -3862,9 +3867,9 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj a1->A = 42; a1->B = 3.1415; - F = test_method; + F = (int (STDCALL *)(gpointer *, gpointer *))test_method; - res = F (obj, &ex); + res = F ((gpointer *)obj, &ex); if (ex) { ret = 7; goto done; @@ -3902,13 +3907,13 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj goto done; } - a1 = mono_object_unbox (obj); + a1 = (TestStruct *)mono_object_unbox (obj); if (!a1) { ret = 6; goto done; } - F = test_method; + F = (void (STDCALL *)(gpointer, gpointer *))test_method; F (obj, &ex); if (ex) { @@ -3936,7 +3941,7 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj TestStruct *a1; gpointer obj; - F = test_method; + F = (gpointer (STDCALL *)(gpointer *))test_method; obj = F (&ex); if (ex) { @@ -3949,7 +3954,7 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj goto done; } - a1 = mono_object_unbox (obj); + a1 = (TestStruct *)mono_object_unbox (obj); if (a1->A != 42) { ret = 5; @@ -3982,7 +3987,7 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj goto done; } - a1 = mono_object_unbox (obj); + a1 = (TestStruct *)mono_object_unbox (obj); if (!a1) { ret = 6; @@ -3992,7 +3997,7 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj a1->A = 42; a1->B = 3.1415; - F = test_method; + F = (void (STDCALL *)(gpointer, gpointer *))test_method; F (obj, &ex); if (ex) { @@ -5406,7 +5411,7 @@ static int call_managed_res; static void call_managed (gpointer arg) { - SimpleDelegate del = arg; + SimpleDelegate del = (SimpleDelegate)arg; call_managed_res = del (42); } @@ -5420,7 +5425,7 @@ mono_test_marshal_thread_attach (SimpleDelegate del) int res; pthread_t t; - res = pthread_create (&t, NULL, (gpointer)call_managed, del); + res = pthread_create (&t, NULL, (gpointer (*)(gpointer))call_managed, del); g_assert (res == 0); pthread_join (t, NULL); @@ -5466,7 +5471,7 @@ mono_test_marshal_lpwstr (gunichar2 *str) LIBTEST_API char* STDCALL mono_test_marshal_return_lpstr (void) { - char *res = marshal_alloc (4); + char *res = (char *)marshal_alloc (4); strcpy (res, "XYZ"); return res; } @@ -5475,7 +5480,7 @@ mono_test_marshal_return_lpstr (void) LIBTEST_API gunichar2* STDCALL mono_test_marshal_return_lpwstr (void) { - gunichar2 *res = marshal_alloc (8); + gunichar2 *res = (gunichar2 *)marshal_alloc (8); gunichar2* tmp = g_utf8_to_utf16 ("XYZ", -1, NULL, NULL, NULL); memcpy (res, tmp, 8); diff --git a/mono/tests/sgen-bridge-major-fragmentation.cs b/mono/tests/sgen-bridge-major-fragmentation.cs index 5fc72e67e77..c954ade20b8 100644 --- a/mono/tests/sgen-bridge-major-fragmentation.cs +++ b/mono/tests/sgen-bridge-major-fragmentation.cs @@ -13,6 +13,9 @@ public class Bridge { } class Driver { + static void LogLine (string message) { + Console.WriteLine ("[" + DateTime.Now + "] " + message); + } //we fill 16Mb worth of stuff, eg, 256k objects const int major_fill = 1024 * 256; @@ -24,7 +27,7 @@ class Driver { for (int i = 0; i < major_fill; ++i) arr [i] = new NonBridge (); GC.Collect (1); - Console.WriteLine ("major fill done"); + LogLine ("major fill done"); //induce massive fragmentation for (int i = 0; i < major_fill; i += 4) { @@ -33,7 +36,7 @@ class Driver { arr [i + 3] = null; } GC.Collect (1); - Console.WriteLine ("fragmentation done"); + LogLine ("fragmentation done"); //since 50% is garbage, do 2 fill passes for (int j = 0; j < 2; ++j) { @@ -44,7 +47,7 @@ class Driver { arr [i] = new Bridge (); } } - Console.WriteLine ("done spewing bridges"); + LogLine ("done spewing bridges"); for (int i = 0; i < major_fill; ++i) arr [i] = null; @@ -55,10 +58,10 @@ class Driver { static void Main () { const int loops = 4; for (int i = 0; i < loops; ++i) { - Console.WriteLine ("CrashLoop {0}/{1}", i + 1, loops); + LogLine ("CrashLoop " + (i + 1) + "/" + loops); CrashMainLoop (); } - Console.WriteLine ("done"); + LogLine ("done"); GC.Collect (); GC.WaitForPendingFinalizers (); GC.Collect (); diff --git a/mono/tests/test-driver b/mono/tests/test-driver index 41b2832d1c7..a10323bb177 100755 --- a/mono/tests/test-driver +++ b/mono/tests/test-driver @@ -27,7 +27,7 @@ if ($test =~ /.*\|.*/) { $output = $test; #This is a silly workaround, but all tests that use extra parameters need a larger timeout. - $timeout_in_minutes = 9; + $timeout_in_minutes = 15; } $ENV{'TEST_DRIVER_TIMEOUT_SEC'} = $timeout_in_minutes * 60; diff --git a/mono/unit-tests/test-conc-hashtable.c b/mono/unit-tests/test-conc-hashtable.c index fec63391ed8..c5303a1a6cd 100644 --- a/mono/unit-tests/test-conc-hashtable.c +++ b/mono/unit-tests/test-conc-hashtable.c @@ -37,24 +37,24 @@ single_writer_single_reader (void) MonoConcurrentHashTable *h; int res = 0; - mono_mutex_init (&mutex); + mono_os_mutex_init (&mutex); h = mono_conc_hashtable_new (NULL, NULL); - mono_mutex_lock (&mutex); + mono_os_mutex_lock (&mutex); mono_conc_hashtable_insert (h, GUINT_TO_POINTER (10), GUINT_TO_POINTER (20)); - mono_mutex_unlock (&mutex); + mono_os_mutex_unlock (&mutex); - mono_mutex_lock (&mutex); + mono_os_mutex_lock (&mutex); mono_conc_hashtable_insert (h, GUINT_TO_POINTER (30), GUINT_TO_POINTER (40)); - mono_mutex_unlock (&mutex); + mono_os_mutex_unlock (&mutex); - mono_mutex_lock (&mutex); + mono_os_mutex_lock (&mutex); mono_conc_hashtable_insert (h, GUINT_TO_POINTER (50), GUINT_TO_POINTER (60)); - mono_mutex_unlock (&mutex); + mono_os_mutex_unlock (&mutex); - mono_mutex_lock (&mutex); + mono_os_mutex_lock (&mutex); mono_conc_hashtable_insert (h, GUINT_TO_POINTER (2), GUINT_TO_POINTER (3)); - mono_mutex_unlock (&mutex); + mono_os_mutex_unlock (&mutex); if (mono_conc_hashtable_lookup (h, GUINT_TO_POINTER (30)) != GUINT_TO_POINTER (40)) res = 1; @@ -66,7 +66,7 @@ single_writer_single_reader (void) res = 4; mono_conc_hashtable_destroy (h); - mono_mutex_destroy (&mutex); + mono_os_mutex_destroy (&mutex); if (res) printf ("SERIAL TEST FAILED %d\n", res); return res; @@ -82,9 +82,9 @@ pw_sr_thread (void *arg) mono_thread_info_attach ((gpointer)&arg); for (i = 0; i < 1000; ++i) { - mono_mutex_lock (&global_mutex); + mono_os_mutex_lock (&global_mutex); mono_conc_hashtable_insert (hash, GINT_TO_POINTER (i + idx), GINT_TO_POINTER (i + 1)); - mono_mutex_unlock (&global_mutex); + mono_os_mutex_unlock (&global_mutex); } return NULL; } @@ -95,7 +95,7 @@ parallel_writer_single_reader (void) pthread_t a,b,c; int i, j, res = 0; - mono_mutex_init (&global_mutex); + mono_os_mutex_init (&global_mutex); hash = mono_conc_hashtable_new (NULL, NULL); pthread_create (&a, NULL, pw_sr_thread, GINT_TO_POINTER (1)); @@ -117,7 +117,7 @@ parallel_writer_single_reader (void) done: mono_conc_hashtable_destroy (hash); - mono_mutex_destroy (&global_mutex); + mono_os_mutex_destroy (&global_mutex); if (res) printf ("PAR_WRITER_SINGLE_READER TEST FAILED %d\n", res); return res; @@ -149,7 +149,7 @@ single_writer_parallel_reader (void) int i, res = 0; ra = rb = rc = GINT_TO_POINTER (1); - mono_mutex_init (&global_mutex); + mono_os_mutex_init (&global_mutex); hash = mono_conc_hashtable_new (NULL, NULL); pthread_create (&a, NULL, pr_sw_thread, GINT_TO_POINTER (0)); @@ -157,17 +157,17 @@ single_writer_parallel_reader (void) pthread_create (&c, NULL, pr_sw_thread, GINT_TO_POINTER (2)); for (i = 0; i < 100; ++i) { - mono_mutex_lock (&global_mutex); + mono_os_mutex_lock (&global_mutex); mono_conc_hashtable_insert (hash, GINT_TO_POINTER (i + 0 + 1), GINT_TO_POINTER ((i + 0) * 2 + 1)); - mono_mutex_unlock (&global_mutex); + mono_os_mutex_unlock (&global_mutex); - mono_mutex_lock (&global_mutex); + mono_os_mutex_lock (&global_mutex); mono_conc_hashtable_insert (hash, GINT_TO_POINTER (i + 100 + 1), GINT_TO_POINTER ((i + 100) * 2 + 1)); - mono_mutex_unlock (&global_mutex); + mono_os_mutex_unlock (&global_mutex); - mono_mutex_lock (&global_mutex); + mono_os_mutex_lock (&global_mutex); mono_conc_hashtable_insert (hash, GINT_TO_POINTER (i + 200 + 1), GINT_TO_POINTER ((i + 200) * 2 + 1)); - mono_mutex_unlock (&global_mutex); + mono_os_mutex_unlock (&global_mutex); } pthread_join (a, &ra); @@ -176,7 +176,7 @@ single_writer_parallel_reader (void) res = GPOINTER_TO_INT (ra) + GPOINTER_TO_INT (rb) + GPOINTER_TO_INT (rc); mono_conc_hashtable_destroy (hash); - mono_mutex_destroy (&global_mutex); + mono_os_mutex_destroy (&global_mutex); if (res) printf ("SINGLE_WRITER_PAR_READER TEST FAILED %d\n", res); return res; @@ -213,9 +213,9 @@ pw_pr_w_add_thread (void *arg) mono_thread_info_attach ((gpointer)&arg); for (i = idx; i < idx + 1000; i++) { - mono_mutex_lock (&global_mutex); + mono_os_mutex_lock (&global_mutex); mono_conc_hashtable_insert (hash, GINT_TO_POINTER (i + 1), GINT_TO_POINTER (i + 1)); - mono_mutex_unlock (&global_mutex); + mono_os_mutex_unlock (&global_mutex); } return NULL; } @@ -228,9 +228,9 @@ pw_pr_w_del_thread (void *arg) mono_thread_info_attach ((gpointer)&arg); for (i = idx; i < idx + 1000; i++) { - mono_mutex_lock (&global_mutex); + mono_os_mutex_lock (&global_mutex); mono_conc_hashtable_remove (hash, GINT_TO_POINTER (i + 1)); - mono_mutex_unlock (&global_mutex); + mono_os_mutex_unlock (&global_mutex); } return NULL; } @@ -244,7 +244,7 @@ parallel_writer_parallel_reader (void) srand(time(NULL)); - mono_mutex_init (&global_mutex); + mono_os_mutex_init (&global_mutex); hash = mono_conc_hashtable_new (NULL, NULL); for (i = 0; i < 2; i++) { @@ -284,7 +284,7 @@ parallel_writer_parallel_reader (void) printf ("PAR_WRITER_PAR_READER TEST FAILED %d %d %d\n", GPOINTER_TO_INT (a), GPOINTER_TO_INT (b), GPOINTER_TO_INT (c)); mono_conc_hashtable_destroy (hash); - mono_mutex_destroy (&global_mutex); + mono_os_mutex_destroy (&global_mutex); return res; } @@ -328,14 +328,25 @@ benchmark_glib (void) g_hash_table_destroy (h); } +static void +thread_state_init (MonoThreadUnwindState *ctx) +{ +} + + int main (void) { MonoThreadInfoCallbacks cb = { NULL }; + MonoThreadInfoRuntimeCallbacks ticallbacks; int res = 0; CHECKED_MONO_INIT (); mono_threads_init (&cb, sizeof (MonoThreadInfo)); + memset (&ticallbacks, 0, sizeof (ticallbacks)); + ticallbacks.thread_state_init = thread_state_init; + mono_threads_runtime_init (&ticallbacks); + mono_thread_info_attach ((gpointer)&cb); // benchmark_conc (); diff --git a/mono/unit-tests/test-memfuncs.c b/mono/unit-tests/test-memfuncs.c index a2b86bbd825..2fb1498f609 100644 --- a/mono/unit-tests/test-memfuncs.c +++ b/mono/unit-tests/test-memfuncs.c @@ -40,9 +40,9 @@ int main (void) { - unsigned char *random_mem = malloc (POOL_SIZE); - unsigned char *reference = malloc (POOL_SIZE); - unsigned char *playground = malloc (POOL_SIZE); + unsigned char *random_mem = (unsigned char *)malloc (POOL_SIZE); + unsigned char *reference = (unsigned char *)malloc (POOL_SIZE); + unsigned char *playground = (unsigned char *)malloc (POOL_SIZE); long *long_random_mem; int i, offset, size, src_offset, dest_offset; diff --git a/mono/unit-tests/test-mono-linked-list-set.c b/mono/unit-tests/test-mono-linked-list-set.c index 7d5cac53085..a5e01ebe09e 100644 --- a/mono/unit-tests/test-mono-linked-list-set.c +++ b/mono/unit-tests/test-mono-linked-list-set.c @@ -48,7 +48,7 @@ mono_hazard_pointer_clear_all (MonoThreadHazardPointers *hp, int retain) static void free_node (void *n) { - node_t *node = n; + node_t *node = (node_t *)n; assert (node->state == STATE_BUSY); node->state = STATE_OUT; } @@ -56,7 +56,7 @@ free_node (void *n) static void* worker (void *arg) { - thread_data_t *thread_data = arg; + thread_data_t *thread_data = (thread_data_t *)arg; MonoThreadHazardPointers *hp; int skip = thread_data->skip; int i, j; diff --git a/mono/unit-tests/test-sgen-qsort.c b/mono/unit-tests/test-sgen-qsort.c index 40ca64cb01f..951b1b7321b 100644 --- a/mono/unit-tests/test-sgen-qsort.c +++ b/mono/unit-tests/test-sgen-qsort.c @@ -100,7 +100,7 @@ compare_sorts2 (void *base, size_t nel) memcpy (b2, base, len); qsort (b1, nel, sizeof (teststruct_t*), compare_teststructs2); - qsort_test_struct (b2, nel); + qsort_test_struct ((teststruct_t **)b2, nel); assert (!memcmp (b1, b2, len)); diff --git a/mono/utils/Makefile.am b/mono/utils/Makefile.am index d03a73a3e07..c608c582b55 100644 --- a/mono/utils/Makefile.am +++ b/mono/utils/Makefile.am @@ -37,8 +37,9 @@ monoutils_sources = \ mono-mmap.c \ mono-mmap.h \ mono-mmap-internals.h \ - mono-mutex.c \ - mono-mutex.h \ + mono-os-mutex.h \ + mono-coop-mutex.h \ + mono-once.h \ mono-lazy-init.h \ mono-networkinterfaces.c \ mono-networkinterfaces.h \ @@ -53,8 +54,8 @@ monoutils_sources = \ mono-uri.c \ mono-poll.c \ mono-path.c \ - mono-semaphore.c \ - mono-semaphore.h \ + mono-os-semaphore.h \ + mono-coop-semaphore.h \ mono-sigcontext.h \ mono-stdlib.c \ mono-property-hash.h \ diff --git a/mono/utils/atomic.c b/mono/utils/atomic.c index 9ab8746f299..447af4e8995 100644 --- a/mono/utils/atomic.c +++ b/mono/utils/atomic.c @@ -12,7 +12,6 @@ #include #include -#include #if defined (WAPI_NO_ATOMIC_ASM) || defined (BROKEN_64BIT_ATOMICS_INTRINSIC) diff --git a/mono/utils/bsearch.c b/mono/utils/bsearch.c index 47be44419ae..399a5c609a9 100644 --- a/mono/utils/bsearch.c +++ b/mono/utils/bsearch.c @@ -42,7 +42,7 @@ mono_binary_search ( size_t member_size, BinarySearchComparer comparer) { - const char *base = array; + const char *base = (const char *)array; size_t lim; int cmp; const void *p; diff --git a/mono/utils/checked-build.c b/mono/utils/checked-build.c index 1a07001dc04..9690d9d030d 100644 --- a/mono/utils/checked-build.c +++ b/mono/utils/checked-build.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #define MAX_NATIVE_BT 6 @@ -237,9 +238,24 @@ assert_gc_neutral_mode (void) // * Code below assumes reference counts never underflow (ie: if we have a pointer to something, it won't be deallocated while we're looking at it) // Locking strategy is a little slapdash overall. +// Reference audit support #define check_mempool_assert_message(...) \ g_assertion_message("Mempool reference violation: " __VA_ARGS__) +typedef struct +{ + MonoImage *image; + MonoImageSet *image_set; +} MonoMemPoolOwner; + +static MonoMemPoolOwner mono_mempool_no_owner = {NULL,NULL}; + +static gboolean +check_mempool_owner_eq (MonoMemPoolOwner a, MonoMemPoolOwner b) +{ + return a.image == b.image && a.image_set == b.image_set; +} + // Say image X "references" image Y if X either contains Y in its modules field, or X’s "references" field contains an // assembly whose image is Y. // Say image X transitively references image Y if there is any chain of images-referencing-images which leads from X to Y. @@ -283,6 +299,18 @@ check_image_may_reference_image(MonoImage *from, MonoImage *to) if (to == mono_defaults.corlib) return TRUE; + // Non-dynamic images may NEVER reference dynamic images + if (to->dynamic && !from->dynamic) + return FALSE; + + // FIXME: We currently give a dynamic images a pass on the reference rules. + // Dynamic images may ALWAYS reference non-dynamic images. + // We allow this because the dynamic image code is known "messy", and in theory it is already + // protected because dynamic images can only reference classes their assembly has retained. + // However, long term, we should make this rigorous. + if (from->dynamic && !to->dynamic) + return TRUE; + gboolean success = FALSE; // Images to inspect on this pass, images to inspect on the next pass @@ -351,7 +379,7 @@ check_image_set_may_reference_image (MonoImageSet *from, MonoImage *to) mono_image_set_lock (from); for (idx = 0; !success && idx < from->nimages; idx++) { - if (!check_image_may_reference_image (from->images[idx], to)) + if (check_image_may_reference_image (from->images[idx], to)) success = TRUE; } mono_image_set_unlock (from); @@ -414,16 +442,51 @@ check_image_may_reference_image_set (MonoImage *from, MonoImageSet *to) } // Small helper-- get a descriptive string for a MonoMemPoolOwner +// Callers are obligated to free buffer with g_free after use static const char * check_mempool_owner_name (MonoMemPoolOwner owner) { + GString *result = g_string_new (NULL); if (owner.image) - return owner.image->name; - if (owner.image_set) // TODO: Construct a string containing all included images - return "(Imageset)"; - return "(Non-image memory)"; + { + if (owner.image->dynamic) + g_string_append (result, "(Dynamic)"); + g_string_append (result, owner.image->name); + } + else if (owner.image_set) + { + char *temp = mono_image_set_description (owner.image_set); + g_string_append (result, "(Image set)"); + g_string_append (result, temp); + g_free (temp); + } + else + { + g_string_append (result, "(Non-image memory)"); + } + return g_string_free (result, FALSE); +} + +// Helper -- surf various image-locating functions looking for the owner of this pointer +static MonoMemPoolOwner +mono_find_mempool_owner (void *ptr) +{ + MonoMemPoolOwner owner = mono_mempool_no_owner; + + owner.image = mono_find_image_owner (ptr); + if (!check_mempool_owner_eq (owner, mono_mempool_no_owner)) + return owner; + + owner.image_set = mono_find_image_set_owner (ptr); + if (!check_mempool_owner_eq (owner, mono_mempool_no_owner)) + return owner; + + owner.image = mono_find_dynamic_image_owner (ptr); + + return owner; } +// Actually perform reference audit static void check_mempool_may_reference_mempool (void *from_ptr, void *to_ptr, gboolean require_local) { @@ -436,44 +499,44 @@ check_mempool_may_reference_mempool (void *from_ptr, void *to_ptr, gboolean requ if (require_local) { if (!check_mempool_owner_eq (from,to)) - check_mempool_assert_message ("Pointer in image %s should have been internal, but instead pointed to image %s", check_mempool_owner_name(from), check_mempool_owner_name(to)); + check_mempool_assert_message ("Pointer in image %s should have been internal, but instead pointed to image %s", check_mempool_owner_name (from), check_mempool_owner_name (to)); } // Writing into unknown mempool else if (check_mempool_owner_eq (from, mono_mempool_no_owner)) { - check_mempool_assert_message ("Non-image memory attempting to write pointer to image %s", check_mempool_owner_name(to)); + check_mempool_assert_message ("Non-image memory attempting to write pointer to image %s", check_mempool_owner_name (to)); } // Reading from unknown mempool else if (check_mempool_owner_eq (to, mono_mempool_no_owner)) { - check_mempool_assert_message ("Attempting to write pointer from image %s to non-image memory", check_mempool_owner_name(from)); + check_mempool_assert_message ("Attempting to write pointer from image %s to non-image memory", check_mempool_owner_name (from)); } // Split out the four cases described above: else if (from.image && to.image) { if (!check_image_may_reference_image (from.image, to.image)) - check_mempool_assert_message ("Image %s tried to point to image %s, but does not retain a reference", check_mempool_owner_name(from), check_mempool_owner_name(to)); + check_mempool_assert_message ("Image %s tried to point to image %s, but does not retain a reference", check_mempool_owner_name (from), check_mempool_owner_name (to)); } else if (from.image && to.image_set) { if (!check_image_may_reference_image_set (from.image, to.image_set)) - check_mempool_assert_message ("Image %s tried to point to image set, but does not retain a reference", check_mempool_owner_name(from)); + check_mempool_assert_message ("Image %s tried to point to image set %s, but does not retain a reference", check_mempool_owner_name (from), check_mempool_owner_name (to)); } else if (from.image_set && to.image_set) { if (!check_image_set_may_reference_image_set (from.image_set, to.image_set)) - check_mempool_assert_message ("Image set tried to point to image set, but does not retain a reference"); + check_mempool_assert_message ("Image set %s tried to point to image set %s, but does not retain a reference", check_mempool_owner_name (from), check_mempool_owner_name (to)); } else if (from.image_set && to.image) { if (!check_image_set_may_reference_image (from.image_set, to.image)) - check_mempool_assert_message ("Image set tried to point to image %s, but does not retain a reference", check_mempool_owner_name(to)); + check_mempool_assert_message ("Image set %s tried to point to image %s, but does not retain a reference", check_mempool_owner_name (from), check_mempool_owner_name (to)); } else diff --git a/mono/utils/checked-build.h b/mono/utils/checked-build.h index 17524bdd1b8..8fac45b018f 100644 --- a/mono/utils/checked-build.h +++ b/mono/utils/checked-build.h @@ -20,6 +20,8 @@ #ifdef CHECKED_BUILD +#define g_assert_checked g_assert + /* GC runtime modes rules: @@ -88,6 +90,12 @@ Functions that can be called from both coop or preept modes. (ptr) = (val); \ } while (0); +// Use when writing a pointer from one image or imageset to another (atomic version). +#define CHECKED_METADATA_WRITE_PTR_ATOMIC(ptr, val) do { \ + check_metadata_store (&(ptr), (val)); \ + mono_atomic_store_release (&(ptr), (val)); \ +} while (0); + /* This can be called by embedders */ @@ -116,6 +124,8 @@ void check_metadata_store_local(void *from, void *to); #else +#define g_assert_checked(...) + #define MONO_REQ_GC_SAFE_MODE #define MONO_REQ_GC_UNSAFE_MODE #define MONO_REQ_GC_NEUTRAL_MODE @@ -127,6 +137,7 @@ void check_metadata_store_local(void *from, void *to); #define CHECKED_METADATA_WRITE_PTR(ptr, val) do { (ptr) = (val); } while (0) #define CHECKED_METADATA_WRITE_PTR_LOCAL(ptr, val) do { (ptr) = (val); } while (0) +#define CHECKED_METADATA_WRITE_PTR_ATOMIC(ptr, val) do { mono_atomic_store_release (&(ptr), (val)); } while (0) #endif /* CHECKED_BUILD */ diff --git a/mono/utils/gc_wrapper.h b/mono/utils/gc_wrapper.h index 11620b3a425..a90d27c064f 100644 --- a/mono/utils/gc_wrapper.h +++ b/mono/utils/gc_wrapper.h @@ -37,6 +37,7 @@ # endif # endif +# define GC_INSIDE_DLL # include # include # include diff --git a/mono/utils/hazard-pointer.c b/mono/utils/hazard-pointer.c index 0d7d37ac736..606387c073e 100644 --- a/mono/utils/hazard-pointer.c +++ b/mono/utils/hazard-pointer.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #ifdef SGEN_WITHOUT_MONO #include #include @@ -71,7 +71,7 @@ mono_thread_small_id_alloc (void) { int i, id = -1; - mono_mutex_lock (&small_id_mutex); + mono_os_mutex_lock (&small_id_mutex); if (!small_id_table) small_id_table = mono_bitset_new (1, 0); @@ -133,7 +133,7 @@ mono_thread_small_id_alloc (void) mono_memory_write_barrier (); } - mono_mutex_unlock (&small_id_mutex); + mono_os_mutex_unlock (&small_id_mutex); return id; } @@ -142,13 +142,13 @@ void mono_thread_small_id_free (int id) { /* MonoBitSet operations are not atomic. */ - mono_mutex_lock (&small_id_mutex); + mono_os_mutex_lock (&small_id_mutex); g_assert (id >= 0 && id < small_id_table->size); g_assert (mono_bitset_test_fast (small_id_table, id)); mono_bitset_clear_fast (small_id_table, id); - mono_mutex_unlock (&small_id_mutex); + mono_os_mutex_unlock (&small_id_mutex); } static gboolean @@ -353,7 +353,7 @@ mono_thread_smr_init (void) { int i; - mono_mutex_init_recursive(&small_id_mutex); + mono_os_mutex_init_recursive(&small_id_mutex); mono_counters_register ("Hazardous pointers", MONO_COUNTER_JIT | MONO_COUNTER_INT, &hazardous_pointer_count); for (i = 0; i < HAZARD_TABLE_OVERFLOW; ++i) { diff --git a/mono/utils/memfuncs.c b/mono/utils/memfuncs.c index c2a39d22b84..f657b5532ee 100644 --- a/mono/utils/memfuncs.c +++ b/mono/utils/memfuncs.c @@ -188,7 +188,7 @@ mono_gc_memmove_aligned (void *dest, const void *src, size_t size) while (p > align_end) *--p = *--s; - word_start = align_up (start); + word_start = (char *)align_up (start); bytes_to_memmove = p - word_start; p -= bytes_to_memmove; s -= bytes_to_memmove; diff --git a/mono/utils/mono-codeman.c b/mono/utils/mono-codeman.c index 30416858d9f..16dc6f9f658 100644 --- a/mono/utils/mono-codeman.c +++ b/mono/utils/mono-codeman.c @@ -26,7 +26,7 @@ #include #include #endif -#include +#include static uintptr_t code_memory_used = 0; @@ -243,14 +243,14 @@ codechunk_valloc (void *preferred, guint32 size) GSList *freelist; if (!valloc_freelists) { - mono_mutex_init_recursive (&valloc_mutex); + mono_os_mutex_init_recursive (&valloc_mutex); valloc_freelists = g_hash_table_new (NULL, NULL); } /* * Keep a small freelist of memory blocks to decrease pressure on the kernel memory subsystem to avoid #3321. */ - mono_mutex_lock (&valloc_mutex); + mono_os_mutex_lock (&valloc_mutex); freelist = (GSList *) g_hash_table_lookup (valloc_freelists, GUINT_TO_POINTER (size)); if (freelist) { ptr = freelist->data; @@ -262,7 +262,7 @@ codechunk_valloc (void *preferred, guint32 size) if (!ptr && preferred) ptr = mono_valloc (NULL, size, MONO_PROT_RWX | ARCH_MAP_FLAGS); } - mono_mutex_unlock (&valloc_mutex); + mono_os_mutex_unlock (&valloc_mutex); return ptr; } @@ -271,7 +271,7 @@ codechunk_vfree (void *ptr, guint32 size) { GSList *freelist; - mono_mutex_lock (&valloc_mutex); + mono_os_mutex_lock (&valloc_mutex); freelist = (GSList *) g_hash_table_lookup (valloc_freelists, GUINT_TO_POINTER (size)); if (!freelist || g_slist_length (freelist) < VALLOC_FREELIST_SIZE) { freelist = g_slist_prepend (freelist, ptr); @@ -279,7 +279,7 @@ codechunk_vfree (void *ptr, guint32 size) } else { mono_vfree (ptr, size); } - mono_mutex_unlock (&valloc_mutex); + mono_os_mutex_unlock (&valloc_mutex); } static void diff --git a/mono/utils/mono-conc-hashtable.c b/mono/utils/mono-conc-hashtable.c index 30521b2af9e..e0b2dcbbb0e 100644 --- a/mono/utils/mono-conc-hashtable.c +++ b/mono/utils/mono-conc-hashtable.c @@ -48,7 +48,7 @@ conc_table_new (int size) static void conc_table_free (gpointer ptr) { - conc_table *table = ptr; + conc_table *table = (conc_table *)ptr; g_free (table->kvs); g_free (table); } @@ -164,7 +164,7 @@ mono_conc_hashtable_lookup (MonoConcurrentHashTable *hash_table, gpointer key) hp = mono_hazard_pointer_get (); retry: - table = get_hazardous_pointer ((gpointer volatile*)&hash_table->table, hp, 0); + table = (conc_table *)get_hazardous_pointer ((gpointer volatile*)&hash_table->table, hp, 0); table_mask = table->table_size - 1; kvs = table->kvs; i = hash & table_mask; diff --git a/mono/utils/mono-conc-hashtable.h b/mono/utils/mono-conc-hashtable.h index a1d20f1b04e..a8eb927fb35 100644 --- a/mono/utils/mono-conc-hashtable.h +++ b/mono/utils/mono-conc-hashtable.h @@ -12,7 +12,7 @@ #include #include -#include +#include #include typedef struct _MonoConcurrentHashTable MonoConcurrentHashTable; diff --git a/mono/utils/mono-coop-mutex.h b/mono/utils/mono-coop-mutex.h new file mode 100644 index 00000000000..0a812754019 --- /dev/null +++ b/mono/utils/mono-coop-mutex.h @@ -0,0 +1,128 @@ + +#ifndef __MONO_COOP_MUTEX_H__ +#define __MONO_COOP_MUTEX_H__ + +#include +#include + +#include "mono-os-mutex.h" +#include "mono-threads.h" + +G_BEGIN_DECLS + +/* We put the OS sync primitives in struct, so the compiler will warn us if + * we use mono_os_(mutex|cond|sem)_... on MonoCoop(Mutex|Cond|Sem) structures */ + +typedef struct _MonoCoopMutex MonoCoopMutex; +struct _MonoCoopMutex { + mono_mutex_t m; +}; + +typedef struct _MonoCoopCond MonoCoopCond; +struct _MonoCoopCond { + mono_cond_t c; +}; + +static inline gint +mono_coop_mutex_init (MonoCoopMutex *mutex) +{ + return mono_os_mutex_init (&mutex->m); +} + +static inline gint +mono_coop_mutex_init_recursive (MonoCoopMutex *mutex) +{ + return mono_os_mutex_init_recursive (&mutex->m); +} + +static inline gint +mono_coop_mutex_destroy (MonoCoopMutex *mutex) +{ + return mono_os_mutex_destroy (&mutex->m); +} + +static inline gint +mono_coop_mutex_lock (MonoCoopMutex *mutex) +{ + gint res; + + /* Avoid thread state switch if lock is not contended */ + if (mono_os_mutex_trylock (&mutex->m) == 0) + return 0; + + MONO_PREPARE_BLOCKING; + + res = mono_os_mutex_lock (&mutex->m); + + MONO_FINISH_BLOCKING; + + return res; +} + +static inline gint +mono_coop_mutex_trylock (MonoCoopMutex *mutex) +{ + return mono_os_mutex_trylock (&mutex->m); +} + +static inline gint +mono_coop_mutex_unlock (MonoCoopMutex *mutex) +{ + return mono_os_mutex_unlock (&mutex->m); +} + +static inline gint +mono_coop_cond_init (MonoCoopCond *cond) +{ + return mono_os_cond_init (&cond->c); +} + +static inline gint +mono_coop_cond_destroy (MonoCoopCond *cond) +{ + return mono_os_cond_destroy (&cond->c); +} + +static inline gint +mono_coop_cond_wait (MonoCoopCond *cond, MonoCoopMutex *mutex) +{ + gint res; + + MONO_PREPARE_BLOCKING; + + res = mono_os_cond_wait (&cond->c, &mutex->m); + + MONO_FINISH_BLOCKING; + + return res; +} + +static inline gint +mono_coop_cond_timedwait (MonoCoopCond *cond, MonoCoopMutex *mutex, guint32 timeout_ms) +{ + gint res; + + MONO_PREPARE_BLOCKING; + + res = mono_os_cond_timedwait (&cond->c, &mutex->m, timeout_ms); + + MONO_FINISH_BLOCKING; + + return res; +} + +static inline gint +mono_coop_cond_signal (MonoCoopCond *cond) +{ + return mono_os_cond_signal (&cond->c); +} + +static inline gint +mono_coop_cond_broadcast (MonoCoopCond *cond) +{ + return mono_os_cond_broadcast (&cond->c); +} + +G_END_DECLS + +#endif /* __MONO_COOP_MUTEX_H__ */ diff --git a/mono/utils/mono-coop-semaphore.h b/mono/utils/mono-coop-semaphore.h new file mode 100644 index 00000000000..bcf45a2f294 --- /dev/null +++ b/mono/utils/mono-coop-semaphore.h @@ -0,0 +1,69 @@ + +#ifndef __MONO_COOP_SEMAPHORE_H__ +#define __MONO_COOP_SEMAPHORE_H__ + +#include +#include + +#include "mono-os-semaphore.h" +#include "mono-threads.h" + +G_BEGIN_DECLS + +/* We put the OS sync primitives in struct, so the compiler will warn us if + * we use mono_os_(mutex|cond|sem)_... on MonoCoop(Mutex|Cond|Sem) structures */ + +typedef struct _MonoCoopSem MonoCoopSem; +struct _MonoCoopSem { + MonoSemType s; +}; + +static inline gint +mono_coop_sem_init (MonoCoopSem *sem, int value) +{ + return mono_os_sem_init (&sem->s, value); +} + +static inline gint +mono_coop_sem_destroy (MonoCoopSem *sem) +{ + return mono_os_sem_destroy (&sem->s); +} + +static inline gint +mono_coop_sem_wait (MonoCoopSem *sem, MonoSemFlags flags) +{ + gint res; + + MONO_PREPARE_BLOCKING; + + res = mono_os_sem_wait (&sem->s, flags); + + MONO_FINISH_BLOCKING; + + return res; +} + +static inline gint +mono_coop_sem_timedwait (MonoCoopSem *sem, guint timeout_ms, MonoSemFlags flags) +{ + gint res; + + MONO_PREPARE_BLOCKING; + + res = mono_os_sem_timedwait (&sem->s, timeout_ms, flags); + + MONO_FINISH_BLOCKING; + + return res; +} + +static inline gint +mono_coop_sem_post (MonoCoopSem *sem) +{ + return mono_os_sem_post (&sem->s); +} + +G_END_DECLS + +#endif /* __MONO_COOP_SEMAPHORE_H__ */ diff --git a/mono/utils/mono-counters.c b/mono/utils/mono-counters.c index 2c7dd19eb9f..17170a40ed2 100644 --- a/mono/utils/mono-counters.c +++ b/mono/utils/mono-counters.c @@ -8,7 +8,7 @@ #include "config.h" #include "mono-counters.h" #include "mono-proclib.h" -#include "mono-mutex.h" +#include "mono-os-mutex.h" #ifdef HAVE_UNISTD_H #include @@ -138,7 +138,7 @@ mono_counters_init (void) if (initialized) return; - mono_mutex_init (&counters_mutex); + mono_os_mutex_init (&counters_mutex); initialize_system_counters (); @@ -155,19 +155,19 @@ register_internal (const char *name, int type, void *addr, int size) if ((type & MONO_COUNTER_VARIANCE_MASK) == 0) type |= MONO_COUNTER_MONOTONIC; - mono_mutex_lock (&counters_mutex); + mono_os_mutex_lock (&counters_mutex); for (counter = counters; counter; counter = counter->next) { if (counter->addr == addr) { g_warning ("you are registering twice the same counter address"); - mono_mutex_unlock (&counters_mutex); + mono_os_mutex_unlock (&counters_mutex); return; } } counter = (MonoCounter *) malloc (sizeof (MonoCounter)); if (!counter) { - mono_mutex_unlock (&counters_mutex); + mono_os_mutex_unlock (&counters_mutex); return; } counter->name = g_strdup (name); @@ -191,7 +191,7 @@ register_internal (const char *name, int type, void *addr, int size) for (register_callback = register_callbacks; register_callback; register_callback = register_callback->next) ((MonoCounterRegisterCallback)register_callback->data) (counter); - mono_mutex_unlock (&counters_mutex); + mono_os_mutex_unlock (&counters_mutex); } /** @@ -291,9 +291,9 @@ mono_counters_on_register (MonoCounterRegisterCallback callback) return; } - mono_mutex_lock (&counters_mutex); + mono_os_mutex_lock (&counters_mutex); register_callbacks = g_slist_append (register_callbacks, (gpointer) callback); - mono_mutex_unlock (&counters_mutex); + mono_os_mutex_unlock (&counters_mutex); } typedef int (*IntFunc) (void); @@ -437,16 +437,16 @@ mono_counters_foreach (CountersEnumCallback cb, gpointer user_data) return; } - mono_mutex_lock (&counters_mutex); + mono_os_mutex_lock (&counters_mutex); for (counter = counters; counter; counter = counter->next) { if (!cb (counter, user_data)) { - mono_mutex_unlock (&counters_mutex); + mono_os_mutex_unlock (&counters_mutex); return; } } - mono_mutex_unlock (&counters_mutex); + mono_os_mutex_unlock (&counters_mutex); } #define COPY_COUNTER(type,functype) do { \ @@ -600,10 +600,10 @@ mono_counters_dump (int section_mask, FILE *outfile) if (!initialized) return; - mono_mutex_lock (&counters_mutex); + mono_os_mutex_lock (&counters_mutex); if (!counters) { - mono_mutex_unlock (&counters_mutex); + mono_os_mutex_unlock (&counters_mutex); return; } @@ -622,7 +622,7 @@ mono_counters_dump (int section_mask, FILE *outfile) } fflush (outfile); - mono_mutex_unlock (&counters_mutex); + mono_os_mutex_unlock (&counters_mutex); } /** @@ -638,7 +638,7 @@ mono_counters_cleanup (void) if (!initialized) return; - mono_mutex_lock (&counters_mutex); + mono_os_mutex_lock (&counters_mutex); counter = counters; counters = NULL; @@ -649,7 +649,7 @@ mono_counters_cleanup (void) free (tmp); } - mono_mutex_unlock (&counters_mutex); + mono_os_mutex_unlock (&counters_mutex); } static MonoResourceCallback limit_reached = NULL; diff --git a/mono/utils/mono-linked-list-set.h b/mono/utils/mono-linked-list-set.h index 8f609d0e44d..0abcee98f15 100644 --- a/mono/utils/mono-linked-list-set.h +++ b/mono/utils/mono-linked-list-set.h @@ -71,7 +71,7 @@ Requires the world to be stoped #define MONO_LLS_FOREACH_FILTERED(list, element, filter_func, type) {\ MonoLinkedListSetNode *__cur; \ - for (__cur = (list)->head; __cur; __cur = mono_lls_pointer_unmask (__cur->next)) \ + for (__cur = (list)->head; __cur; __cur = (MonoLinkedListSetNode *)mono_lls_pointer_unmask (__cur->next)) \ if (!mono_lls_pointer_get_mark (__cur->next)) { \ (element) = (type)__cur; \ if (!filter_func (element)) continue; diff --git a/mono/utils/mono-mutex.c b/mono/utils/mono-mutex.c deleted file mode 100644 index 51dee2339d1..00000000000 --- a/mono/utils/mono-mutex.c +++ /dev/null @@ -1,186 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * mono-mutex.h: Portability wrappers around POSIX Mutexes - * - * Authors: Jeffrey Stedfast - * - * Copyright 2002 Ximian, Inc. (www.ximian.com) - */ - - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include - -#ifdef HAVE_SYS_TIME_H -#include -#endif - -#include "mono-mutex.h" - -#ifndef HOST_WIN32 - -#if defined(__APPLE__) -#define _DARWIN_C_SOURCE -#include -#include -#endif - -#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK -/* Android does not implement pthread_mutex_timedlock(), but does provide an - * unusual declaration: http://code.google.com/p/android/issues/detail?id=7807 - */ -#ifdef PLATFORM_ANDROID -#define CONST_NEEDED -#else -#define CONST_NEEDED const -#endif - -int pthread_mutex_timedlock (pthread_mutex_t *mutex, - CONST_NEEDED struct timespec *timeout); -int -pthread_mutex_timedlock (pthread_mutex_t *mutex, CONST_NEEDED struct timespec *timeout) -{ - struct timeval timenow; - struct timespec sleepytime; - int retcode; - - /* This is just to avoid a completely busy wait */ - sleepytime.tv_sec = 0; - sleepytime.tv_nsec = 10000000; /* 10ms */ - - while ((retcode = pthread_mutex_trylock (mutex)) == EBUSY) { - gettimeofday (&timenow, NULL); - - if (timenow.tv_sec >= timeout->tv_sec && - (timenow.tv_usec * 1000) >= timeout->tv_nsec) { - return ETIMEDOUT; - } - - nanosleep (&sleepytime, NULL); - } - - return retcode; -} -#endif /* HAVE_PTHREAD_MUTEX_TIMEDLOCK */ - - -int -mono_once (mono_once_t *once, void (*once_init) (void)) -{ - int thr_ret; - - if (!once->complete) { - pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, - (void *)&once->mutex); - thr_ret = pthread_mutex_lock (&once->mutex); - g_assert (thr_ret == 0); - - if (!once->complete) { - once_init (); - once->complete = TRUE; - } - thr_ret = pthread_mutex_unlock (&once->mutex); - g_assert (thr_ret == 0); - - pthread_cleanup_pop (0); - } - - return 0; -} - -#endif - -/* -Returns a recursive mutex that is safe under suspension. - -A suspension safe mutex means one that can handle this scenario: - -mutex M - -thread 1: -1)lock M -2)suspend thread 2 -3)unlock M -4)lock M - -thread 2: -5)lock M - -Say (1) happens before (5) and (5) happens before (2). -This means that thread 2 was suspended by the kernel because -it's waiting on mutext M. - -Thread 1 then proceed to suspend thread 2 and unlock/lock the -mutex. - -If the kernel implements mutexes with FIFO wait lists, this means -that thread 1 will be blocked waiting for thread 2 acquire the lock. -Since thread 2 is suspended, we have a deadlock. - -A suspend safe mutex is an unfair lock but will schedule any runable -thread that is waiting for a the lock. - -This problem was witnessed on OSX in mono/tests/thread-exit.cs. - -*/ -int -mono_mutex_init_suspend_safe (mono_mutex_t *mutex) -{ -#if defined(__APPLE__) - int res; - pthread_mutexattr_t attr; - static gboolean inited; - static int (*setpolicy_np) (pthread_mutexattr_t *, int); - - if (!inited) { - setpolicy_np = (int (*) (pthread_mutexattr_t *, int)) dlsym (RTLD_NEXT, "pthread_mutexattr_setpolicy_np"); - mono_atomic_store_release (&inited, TRUE); - } - - pthread_mutexattr_init (&attr); - pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); - if (setpolicy_np) - setpolicy_np (&attr, _PTHREAD_MUTEX_POLICY_FIRSTFIT); - res = pthread_mutex_init (mutex, &attr); - pthread_mutexattr_destroy (&attr); - - return res; -#else - return mono_mutex_init (mutex); -#endif -} - -#ifndef HOST_WIN32 -int -mono_cond_timedwait_ms (mono_cond_t *cond, mono_mutex_t *mutex, int timeout_ms) -{ - struct timeval tv; - struct timespec ts; - gint64 usecs; - int res; - - /* ms = 10^-3, us = 10^-6, ns = 10^-9 */ - - gettimeofday (&tv, NULL); - tv.tv_sec += timeout_ms / 1000; - usecs = tv.tv_usec + ((timeout_ms % 1000) * 1000); - if (usecs >= 1000000) { - usecs -= 1000000; - tv.tv_sec ++; - } - ts.tv_sec = tv.tv_sec; - ts.tv_nsec = usecs * 1000; - - res = pthread_cond_timedwait (cond, mutex, &ts); - g_assert (res != EINVAL); - return res; -} - -#endif diff --git a/mono/utils/mono-mutex.h b/mono/utils/mono-mutex.h deleted file mode 100644 index 78a4f140cff..00000000000 --- a/mono/utils/mono-mutex.h +++ /dev/null @@ -1,213 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * mono-mutex.h: Portability wrappers around POSIX Mutexes - * - * Authors: Jeffrey Stedfast - * - * Copyright 2002 Ximian, Inc. (www.ximian.com) - */ - -#ifndef __MONO_MUTEX_H__ -#define __MONO_MUTEX_H__ - -#include - -#include -#ifdef HAVE_PTHREAD_H -#include -#endif -#include - -#ifdef HOST_WIN32 -#include -#include - -/* Vanilla MinGW is missing some defs, loan them from MinGW-w64. */ -#if defined __MINGW32__ && !defined __MINGW64_VERSION_MAJOR - -#if (_WIN32_WINNT >= 0x0600) -/* Fixme: Opaque structs */ -typedef PVOID RTL_CONDITION_VARIABLE; -typedef PVOID RTL_SRWLOCK; - -#ifndef _RTL_RUN_ONCE_DEF -#define _RTL_RUN_ONCE_DEF 1 -typedef PVOID RTL_RUN_ONCE, *PRTL_RUN_ONCE; -typedef DWORD (WINAPI *PRTL_RUN_ONCE_INIT_FN)(PRTL_RUN_ONCE, PVOID, PVOID *); -#define RTL_RUN_ONCE_INIT 0 -#define RTL_RUN_ONCE_CHECK_ONLY 1UL -#define RTL_RUN_ONCE_ASYNC 2UL -#define RTL_RUN_ONCE_INIT_FAILED 4UL -#define RTL_RUN_ONCE_CTX_RESERVED_BITS 2 -#endif -#define RTL_SRWLOCK_INIT 0 -#define RTL_CONDITION_VARIABLE_INIT 0 -#define RTL_CONDITION_VARIABLE_LOCKMODE_SHARED 1 - -#define CONDITION_VARIABLE_INIT RTL_CONDITION_VARIABLE_INIT -#define CONDITION_VARIABLE_LOCKMODE_SHARED RTL_CONDITION_VARIABLE_LOCKMODE_SHARED -#define SRWLOCK_INIT RTL_SRWLOCK_INIT -#endif - -#if (_WIN32_WINNT >= 0x0600) -/*Condition Variables http://msdn.microsoft.com/en-us/library/ms682052%28VS.85%29.aspx*/ -typedef RTL_CONDITION_VARIABLE CONDITION_VARIABLE, *PCONDITION_VARIABLE; -typedef RTL_SRWLOCK SRWLOCK, *PSRWLOCK; - -WINBASEAPI VOID WINAPI InitializeConditionVariable(PCONDITION_VARIABLE ConditionVariable); -WINBASEAPI WINBOOL WINAPI SleepConditionVariableCS(PCONDITION_VARIABLE ConditionVariable, PCRITICAL_SECTION CriticalSection, DWORD dwMilliseconds); -WINBASEAPI WINBOOL WINAPI SleepConditionVariableSRW(PCONDITION_VARIABLE ConditionVariable, PSRWLOCK SRWLock, DWORD dwMilliseconds, ULONG Flags); -WINBASEAPI VOID WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE ConditionVariable); -WINBASEAPI VOID WINAPI WakeConditionVariable(PCONDITION_VARIABLE ConditionVariable); - -/*Slim Reader/Writer (SRW) Locks http://msdn.microsoft.com/en-us/library/aa904937%28VS.85%29.aspx*/ -WINBASEAPI VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK SRWLock); -WINBASEAPI VOID WINAPI AcquireSRWLockShared(PSRWLOCK SRWLock); -WINBASEAPI VOID WINAPI InitializeSRWLock(PSRWLOCK SRWLock); -WINBASEAPI VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK SRWLock); -WINBASEAPI VOID WINAPI ReleaseSRWLockShared(PSRWLOCK SRWLock); - -WINBASEAPI BOOLEAN TryAcquireSRWLockExclusive(PSRWLOCK SRWLock); -WINBASEAPI BOOLEAN TryAcquireSRWLockShared(PSRWLOCK SRWLock); - -/*One-Time Initialization http://msdn.microsoft.com/en-us/library/aa363808(VS.85).aspx*/ -#define INIT_ONCE_ASYNC 0x00000002UL -#define INIT_ONCE_INIT_FAILED 0x00000004UL - -typedef PRTL_RUN_ONCE PINIT_ONCE; -typedef PRTL_RUN_ONCE LPINIT_ONCE; -typedef WINBOOL CALLBACK (*PINIT_ONCE_FN) (PINIT_ONCE InitOnce, PVOID Parameter, PVOID *Context); - -WINBASEAPI WINBOOL WINAPI InitOnceBeginInitialize(LPINIT_ONCE lpInitOnce, DWORD dwFlags, PBOOL fPending, LPVOID *lpContext); -WINBASEAPI WINBOOL WINAPI InitOnceComplete(LPINIT_ONCE lpInitOnce, DWORD dwFlags, LPVOID lpContext); -WINBASEAPI WINBOOL WINAPI InitOnceExecuteOnce(PINIT_ONCE InitOnce, PINIT_ONCE_FN InitFn, PVOID Parameter, LPVOID *Context); -#endif - -#endif /* defined __MINGW32__ && !defined __MINGW64_VERSION_MAJOR */ -#endif /* HOST_WIN32 */ - -G_BEGIN_DECLS - -#ifndef HOST_WIN32 - -typedef struct { - pthread_mutex_t mutex; - gboolean complete; -} mono_once_t; - -#define MONO_ONCE_INIT { PTHREAD_MUTEX_INITIALIZER, FALSE } - -int mono_once (mono_once_t *once, void (*once_init) (void)); - -typedef pthread_mutex_t mono_mutex_t; -typedef pthread_cond_t mono_cond_t; - -#define mono_mutex_init(mutex) pthread_mutex_init (mutex, NULL) -#define mono_mutex_lock(mutex) pthread_mutex_lock (mutex) -#define mono_mutex_trylock(mutex) pthread_mutex_trylock (mutex) -#define mono_mutex_timedlock(mutex,timeout) pthread_mutex_timedlock (mutex, timeout) -#define mono_mutex_unlock(mutex) pthread_mutex_unlock (mutex) -#define mono_mutex_destroy(mutex) pthread_mutex_destroy (mutex) - -#define mono_cond_init(cond,attr) pthread_cond_init (cond,attr) -#define mono_cond_wait(cond,mutex) pthread_cond_wait (cond, mutex) -#define mono_cond_timedwait(cond,mutex,timeout) pthread_cond_timedwait (cond, mutex, timeout) -#define mono_cond_signal(cond) pthread_cond_signal (cond) -#define mono_cond_broadcast(cond) pthread_cond_broadcast (cond) -#define mono_cond_destroy(cond) pthread_cond_destroy (cond) - -/* - * This should be used instead of mono_cond_timedwait, since that function is not implemented on windows. - */ -int mono_cond_timedwait_ms (mono_cond_t *cond, mono_mutex_t *mutex, int timeout_ms); - -/* This is a function so it can be passed to pthread_cleanup_push - - * that is a macro and giving it a macro as a parameter breaks. - */ -G_GNUC_UNUSED -static inline int mono_mutex_unlock_in_cleanup (mono_mutex_t *mutex) -{ - return(mono_mutex_unlock (mutex)); -} - -/* Returns zero on success. */ -static inline int -mono_mutex_init_recursive (mono_mutex_t *mutex) -{ - int res; - pthread_mutexattr_t attr; - - pthread_mutexattr_init (&attr); - pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); - res = pthread_mutex_init (mutex, &attr); - pthread_mutexattr_destroy (&attr); - - return res; -} - -#else - -typedef CRITICAL_SECTION mono_mutex_t; -typedef CONDITION_VARIABLE mono_cond_t; - -#define mono_mutex_init(mutex) (InitializeCriticalSection((mutex)), 0) -#define mono_mutex_init_recursive(mutex) (InitializeCriticalSection((mutex)), 0) -#define mono_mutex_lock(mutex) EnterCriticalSection((mutex)) -#define mono_mutex_trylock(mutex) (!TryEnterCriticalSection((mutex))) -#define mono_mutex_unlock(mutex) LeaveCriticalSection((mutex)) -#define mono_mutex_destroy(mutex) DeleteCriticalSection((mutex)) - -static inline int -mono_cond_init (mono_cond_t *cond, int attr) -{ - InitializeConditionVariable (cond); - return 0; -} - -static inline int -mono_cond_wait (mono_cond_t *cond, mono_mutex_t *mutex) -{ - return SleepConditionVariableCS (cond, mutex, INFINITE) ? 0 : 1; -} - -static inline int -mono_cond_timedwait (mono_cond_t *cond, mono_mutex_t *mutex, struct timespec *timeout) -{ - // FIXME: - g_assert_not_reached (); - return 0; -} - -static inline int -mono_cond_signal (mono_cond_t *cond) -{ - WakeConditionVariable (cond); - return 0; -} - -static inline int -mono_cond_broadcast (mono_cond_t *cond) -{ - WakeAllConditionVariable (cond); - return 0; -} - -static inline int -mono_cond_destroy (mono_cond_t *cond) -{ - return 0; -} - -static inline int -mono_cond_timedwait_ms (mono_cond_t *cond, mono_mutex_t *mutex, int timeout_ms) -{ - return SleepConditionVariableCS (cond, mutex, timeout_ms) ? 0 : 1; -} - -#endif - -int mono_mutex_init_suspend_safe (mono_mutex_t *mutex); - -G_END_DECLS - -#endif /* __MONO_MUTEX_H__ */ diff --git a/mono/utils/mono-once.h b/mono/utils/mono-once.h new file mode 100644 index 00000000000..0021ac3f9ba --- /dev/null +++ b/mono/utils/mono-once.h @@ -0,0 +1,17 @@ + +#ifndef __MONO_ONCE_H__ +#define __MONO_ONCE_H__ + +#include "mono-lazy-init.h" + +typedef mono_lazy_init_t mono_once_t; + +#define MONO_ONCE_INIT MONO_LAZY_INIT_STATUS_NOT_INITIALIZED + +static inline void +mono_once (mono_once_t *once, void (*once_init) (void)) +{ + mono_lazy_initialize (once, once_init); +} + +#endif /* __MONO_ONCE_H__ */ diff --git a/mono/utils/mono-os-mutex.h b/mono/utils/mono-os-mutex.h new file mode 100644 index 00000000000..536640532ef --- /dev/null +++ b/mono/utils/mono-os-mutex.h @@ -0,0 +1,301 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * mono-os-mutex.h: Portability wrappers around POSIX Mutexes + * + * Authors: Jeffrey Stedfast + * + * Copyright 2002 Ximian, Inc. (www.ximian.com) + */ + +#ifndef __MONO_OS_MUTEX_H__ +#define __MONO_OS_MUTEX_H__ + +#include +#include + +#include +#include +#include + +#if !defined(HOST_WIN32) +#include +#include +#else +#include +#include +#endif + +#ifdef HAVE_SYS_TIME_H +#include +#endif + +G_BEGIN_DECLS + +#if !defined(HOST_WIN32) + +typedef pthread_mutex_t mono_mutex_t; +typedef pthread_cond_t mono_cond_t; + +static inline int +mono_os_mutex_init (mono_mutex_t *mutex) +{ + return pthread_mutex_init (mutex, NULL); +} + +static inline int +mono_os_mutex_init_recursive (mono_mutex_t *mutex) +{ + int res; + pthread_mutexattr_t attr; + + pthread_mutexattr_init (&attr); + pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); + res = pthread_mutex_init (mutex, &attr); + pthread_mutexattr_destroy (&attr); + + return res; +} + +static inline int +mono_os_mutex_destroy (mono_mutex_t *mutex) +{ + return pthread_mutex_destroy (mutex); +} + +static inline int +mono_os_mutex_lock (mono_mutex_t *mutex) +{ + int res; + + res = pthread_mutex_lock (mutex); + g_assert (res != EINVAL); + + return res; +} + +static inline int +mono_os_mutex_trylock (mono_mutex_t *mutex) +{ + return pthread_mutex_trylock (mutex); +} + +static inline int +mono_os_mutex_unlock (mono_mutex_t *mutex) +{ + return pthread_mutex_unlock (mutex); +} + +static inline int +mono_os_cond_init (mono_cond_t *cond) +{ + return pthread_cond_init (cond, NULL); +} + +static inline int +mono_os_cond_destroy (mono_cond_t *cond) +{ + return pthread_cond_destroy (cond); +} + +static inline int +mono_os_cond_wait (mono_cond_t *cond, mono_mutex_t *mutex) +{ + int res; + + res = pthread_cond_wait (cond, mutex); + g_assert (res != EINVAL); + + return res; +} + +static inline int +mono_os_cond_timedwait (mono_cond_t *cond, mono_mutex_t *mutex, guint32 timeout_ms) +{ + struct timeval tv; + struct timespec ts; + gint64 usecs; + int res; + + if (timeout_ms == (guint32) 0xFFFFFFFF) + return mono_os_cond_wait (cond, mutex); + + /* ms = 10^-3, us = 10^-6, ns = 10^-9 */ + + gettimeofday (&tv, NULL); + tv.tv_sec += timeout_ms / 1000; + usecs = tv.tv_usec + ((timeout_ms % 1000) * 1000); + if (usecs >= 1000000) { + usecs -= 1000000; + tv.tv_sec ++; + } + ts.tv_sec = tv.tv_sec; + ts.tv_nsec = usecs * 1000; + + res = pthread_cond_timedwait (cond, mutex, &ts); + g_assert (res != EINVAL); + + return res; +} + +static inline int +mono_os_cond_signal (mono_cond_t *cond) +{ + return pthread_cond_signal (cond); +} + +static inline int +mono_os_cond_broadcast (mono_cond_t *cond) +{ + return pthread_cond_broadcast (cond); +} + +#else + +/* Vanilla MinGW is missing some defs, load them from MinGW-w64. */ +#if defined __MINGW32__ && !defined __MINGW64_VERSION_MAJOR && (_WIN32_WINNT >= 0x0600) + +/* Fixme: Opaque structs */ +typedef PVOID RTL_CONDITION_VARIABLE; +typedef PVOID RTL_SRWLOCK; + +#ifndef _RTL_RUN_ONCE_DEF +#define _RTL_RUN_ONCE_DEF 1 +typedef PVOID RTL_RUN_ONCE, *PRTL_RUN_ONCE; +typedef DWORD (WINAPI *PRTL_RUN_ONCE_INIT_FN)(PRTL_RUN_ONCE, PVOID, PVOID *); +#define RTL_RUN_ONCE_INIT 0 +#define RTL_RUN_ONCE_CHECK_ONLY 1UL +#define RTL_RUN_ONCE_ASYNC 2UL +#define RTL_RUN_ONCE_INIT_FAILED 4UL +#define RTL_RUN_ONCE_CTX_RESERVED_BITS 2 +#endif /* _RTL_RUN_ONCE_DEF */ +#define RTL_SRWLOCK_INIT 0 +#define RTL_CONDITION_VARIABLE_INIT 0 +#define RTL_CONDITION_VARIABLE_LOCKMODE_SHARED 1 + +#define CONDITION_VARIABLE_INIT RTL_CONDITION_VARIABLE_INIT +#define CONDITION_VARIABLE_LOCKMODE_SHARED RTL_CONDITION_VARIABLE_LOCKMODE_SHARED +#define SRWLOCK_INIT RTL_SRWLOCK_INIT + +/*Condition Variables http://msdn.microsoft.com/en-us/library/ms682052%28VS.85%29.aspx*/ +typedef RTL_CONDITION_VARIABLE CONDITION_VARIABLE, *PCONDITION_VARIABLE; +typedef RTL_SRWLOCK SRWLOCK, *PSRWLOCK; + +WINBASEAPI VOID WINAPI InitializeConditionVariable(PCONDITION_VARIABLE ConditionVariable); +WINBASEAPI WINBOOL WINAPI SleepConditionVariableCS(PCONDITION_VARIABLE ConditionVariable, PCRITICAL_SECTION CriticalSection, DWORD dwMilliseconds); +WINBASEAPI WINBOOL WINAPI SleepConditionVariableSRW(PCONDITION_VARIABLE ConditionVariable, PSRWLOCK SRWLock, DWORD dwMilliseconds, ULONG Flags); +WINBASEAPI VOID WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE ConditionVariable); +WINBASEAPI VOID WINAPI WakeConditionVariable(PCONDITION_VARIABLE ConditionVariable); + +/*Slim Reader/Writer (SRW) Locks http://msdn.microsoft.com/en-us/library/aa904937%28VS.85%29.aspx*/ +WINBASEAPI VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK SRWLock); +WINBASEAPI VOID WINAPI AcquireSRWLockShared(PSRWLOCK SRWLock); +WINBASEAPI VOID WINAPI InitializeSRWLock(PSRWLOCK SRWLock); +WINBASEAPI VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK SRWLock); +WINBASEAPI VOID WINAPI ReleaseSRWLockShared(PSRWLOCK SRWLock); + +WINBASEAPI BOOLEAN TryAcquireSRWLockExclusive(PSRWLOCK SRWLock); +WINBASEAPI BOOLEAN TryAcquireSRWLockShared(PSRWLOCK SRWLock); + +/*One-Time Initialization http://msdn.microsoft.com/en-us/library/aa363808(VS.85).aspx*/ +#define INIT_ONCE_ASYNC 0x00000002UL +#define INIT_ONCE_INIT_FAILED 0x00000004UL + +typedef PRTL_RUN_ONCE PINIT_ONCE; +typedef PRTL_RUN_ONCE LPINIT_ONCE; +typedef WINBOOL CALLBACK (*PINIT_ONCE_FN) (PINIT_ONCE InitOnce, PVOID Parameter, PVOID *Context); + +WINBASEAPI WINBOOL WINAPI InitOnceBeginInitialize(LPINIT_ONCE lpInitOnce, DWORD dwFlags, PBOOL fPending, LPVOID *lpContext); +WINBASEAPI WINBOOL WINAPI InitOnceComplete(LPINIT_ONCE lpInitOnce, DWORD dwFlags, LPVOID lpContext); +WINBASEAPI WINBOOL WINAPI InitOnceExecuteOnce(PINIT_ONCE InitOnce, PINIT_ONCE_FN InitFn, PVOID Parameter, LPVOID *Context); + +#endif /* defined __MINGW32__ && !defined __MINGW64_VERSION_MAJOR && (_WIN32_WINNT >= 0x0600) */ + +typedef CRITICAL_SECTION mono_mutex_t; +typedef CONDITION_VARIABLE mono_cond_t; + +static inline int +mono_os_mutex_init (mono_mutex_t *mutex) +{ + InitializeCriticalSection (mutex); + return 0; +} + +static inline int +mono_os_mutex_init_recursive (mono_mutex_t *mutex) +{ + InitializeCriticalSection (mutex); + return 0; +} + +static inline int +mono_os_mutex_destroy (mono_mutex_t *mutex) +{ + DeleteCriticalSection (mutex); + return 0; +} + +static inline int +mono_os_mutex_lock (mono_mutex_t *mutex) +{ + EnterCriticalSection (mutex); + return 0; +} + +static inline int +mono_os_mutex_trylock (mono_mutex_t *mutex) +{ + return TryEnterCriticalSection (mutex) != 0 ? 0 : 1; +} + +static inline int +mono_os_mutex_unlock (mono_mutex_t *mutex) +{ + LeaveCriticalSection (mutex); + return 0; +} + +static inline int +mono_os_cond_init (mono_cond_t *cond) +{ + InitializeConditionVariable (cond); + return 0; +} + +static inline int +mono_os_cond_destroy (mono_cond_t *cond) +{ + /* Beauty of win32 API: do not destroy it */ + return 0; +} + +static inline int +mono_os_cond_wait (mono_cond_t *cond, mono_mutex_t *mutex) +{ + return SleepConditionVariableCS (cond, mutex, INFINITE) ? 0 : 1; +} + +static inline int +mono_os_cond_timedwait (mono_cond_t *cond, mono_mutex_t *mutex, guint32 timeout_ms) +{ + return SleepConditionVariableCS (cond, mutex, timeout_ms) ? 0 : 1; +} + +static inline int +mono_os_cond_signal (mono_cond_t *cond) +{ + WakeConditionVariable (cond); + return 0; +} + +static inline int +mono_os_cond_broadcast (mono_cond_t *cond) +{ + WakeAllConditionVariable (cond); + return 0; +} + +#endif + +G_END_DECLS + +#endif /* __MONO_OS_MUTEX_H__ */ diff --git a/mono/utils/mono-os-semaphore.h b/mono/utils/mono-os-semaphore.h new file mode 100644 index 00000000000..7ab1b9df787 --- /dev/null +++ b/mono/utils/mono-os-semaphore.h @@ -0,0 +1,277 @@ +/* + * mono-os-semaphore.h: Definitions for generic semaphore usage + * + * Author: + * Geoff Norton + * + * (C) 2009 Novell, Inc. + */ + +#ifndef _MONO_SEMAPHORE_H_ +#define _MONO_SEMAPHORE_H_ + +#include +#include + +#include + +#ifdef HAVE_SYS_TIME_H +#include +#endif + +#ifdef HAVE_UNISTD_H +#include +#endif + +#if defined(USE_MACH_SEMA) +#include +#include +#include +#elif !defined(HOST_WIN32) && defined(HAVE_SEMAPHORE_H) +#include +#else +#include +#include +#endif + +#define MONO_HAS_SEMAPHORES 1 + +#ifndef NSEC_PER_SEC +#define NSEC_PER_SEC (1000 * 1000 * 1000) +#endif + +G_BEGIN_DECLS + +typedef enum { + MONO_SEM_FLAGS_NONE = 0, + MONO_SEM_FLAGS_ALERTABLE = 1 << 0, +} MonoSemFlags; + +#if defined(USE_MACH_SEMA) + +typedef semaphore_t MonoSemType; + +static inline int +mono_os_sem_init (MonoSemType *sem, int value) +{ + return semaphore_create (current_task (), sem, SYNC_POLICY_FIFO, value) != KERN_SUCCESS ? -1 : 0; +} + +static inline int +mono_os_sem_destroy (MonoSemType *sem) +{ + return semaphore_destroy (current_task (), *sem) != KERN_SUCCESS ? -1 : 0; +} + +static inline int +mono_os_sem_wait (MonoSemType *sem, MonoSemFlags flags) +{ + int res; + +retry: + res = semaphore_wait (*sem); + g_assert (res != KERN_INVALID_ARGUMENT); + + if (res == KERN_ABORTED && !(flags & MONO_SEM_FLAGS_ALERTABLE)) + goto retry; + + return res != KERN_SUCCESS ? -1 : 0; +} + +static inline int +mono_os_sem_timedwait (MonoSemType *sem, guint32 timeout_ms, MonoSemFlags flags) +{ + mach_timespec_t ts, copy; + struct timeval start, current; + int res = 0; + + if (timeout_ms == (guint32) 0xFFFFFFFF) + return mono_os_sem_wait (sem, flags); + + ts.tv_sec = timeout_ms / 1000; + ts.tv_nsec = (timeout_ms % 1000) * 1000000; + while (ts.tv_nsec >= NSEC_PER_SEC) { + ts.tv_nsec -= NSEC_PER_SEC; + ts.tv_sec++; + } + + copy = ts; + gettimeofday (&start, NULL); + +retry: + res = semaphore_timedwait (*sem, ts); + g_assert (res != KERN_INVALID_ARGUMENT); + + if (res == KERN_ABORTED && !(flags & MONO_SEM_FLAGS_ALERTABLE)) { + ts = copy; + + gettimeofday (¤t, NULL); + ts.tv_sec -= (current.tv_sec - start.tv_sec); + ts.tv_nsec -= (current.tv_usec - start.tv_usec) * 1000; + if (ts.tv_nsec < 0) { + if (ts.tv_sec <= 0) { + ts.tv_nsec = 0; + } else { + ts.tv_sec--; + ts.tv_nsec += NSEC_PER_SEC; + } + } + if (ts.tv_sec < 0) { + ts.tv_sec = 0; + ts.tv_nsec = 0; + } + + goto retry; + } + + return res != KERN_SUCCESS ? -1 : 0; +} + +static inline int +mono_os_sem_post (MonoSemType *sem) +{ + int res; + + res = semaphore_signal (*sem); + g_assert (res != KERN_INVALID_ARGUMENT); + + return res != KERN_SUCCESS ? -1 : 0; +} + +#elif !defined(HOST_WIN32) && defined(HAVE_SEMAPHORE_H) + +typedef sem_t MonoSemType; + +static inline int +mono_os_sem_init (MonoSemType *sem, int value) +{ + return sem_init (sem, 0, value); +} + +static inline int +mono_os_sem_destroy (MonoSemType *sem) +{ + return sem_destroy (sem); +} + +static inline int +mono_os_sem_wait (MonoSemType *sem, MonoSemFlags flags) +{ + int res; + +retry: + res = sem_wait (sem); + if (res == -1) + g_assert (errno != EINVAL); + + if (res == -1 && errno == EINTR && !(flags & MONO_SEM_FLAGS_ALERTABLE)) + goto retry; + + return res != 0 ? -1 : 0; +} + +static inline int +mono_os_sem_timedwait (MonoSemType *sem, guint32 timeout_ms, MonoSemFlags flags) +{ + struct timespec ts, copy; + struct timeval t; + int res = 0; + + if (timeout_ms == 0) { + res = sem_trywait (sem) != 0 ? -1 : 0; + if (res == -1) + g_assert (errno != EINVAL); + + return res != 0 ? -1 : 0; + } + + if (timeout_ms == (guint32) 0xFFFFFFFF) + return mono_os_sem_wait (sem, flags); + + gettimeofday (&t, NULL); + ts.tv_sec = timeout_ms / 1000 + t.tv_sec; + ts.tv_nsec = (timeout_ms % 1000) * 1000000 + t.tv_usec * 1000; + while (ts.tv_nsec >= NSEC_PER_SEC) { + ts.tv_nsec -= NSEC_PER_SEC; + ts.tv_sec++; + } + + copy = ts; + +retry: +#if defined(__native_client__) && defined(USE_NEWLIB) + res = sem_trywait (sem); +#else + res = sem_timedwait (sem, &ts); +#endif + if (res == -1) + g_assert (errno != EINVAL); + + if (res == -1 && errno == EINTR && !(flags & MONO_SEM_FLAGS_ALERTABLE)) { + ts = copy; + goto retry; + } + + return res != 0 ? -1 : 0; +} + +static inline int +mono_os_sem_post (MonoSemType *sem) +{ + int res; + + res = sem_post (sem); + if (res == -1) + g_assert (errno != EINVAL); + + return res; +} + +#else + +typedef HANDLE MonoSemType; + +static inline int +mono_os_sem_init (MonoSemType *sem, int value) +{ + *sem = CreateSemaphore (NULL, value, 0x7FFFFFFF, NULL); + return *sem == NULL ? -1 : 0; +} + +static inline int +mono_os_sem_destroy (MonoSemType *sem) +{ + return !CloseHandle (*sem) ? -1 : 0; +} + +static inline int +mono_os_sem_timedwait (MonoSemType *sem, guint32 timeout_ms, MonoSemFlags flags) +{ + gboolean res; + +retry: + res = WaitForSingleObjectEx (*sem, timeout_ms, flags & MONO_SEM_FLAGS_ALERTABLE); + + if (res == WAIT_IO_COMPLETION && !(flags & MONO_SEM_FLAGS_ALERTABLE)) + goto retry; + + return res != WAIT_OBJECT_0 ? -1 : 0; +} + +static inline int +mono_os_sem_wait (MonoSemType *sem, MonoSemFlags flags) +{ + return mono_os_sem_timedwait (sem, INFINITE, flags); +} + +static inline int +mono_os_sem_post (MonoSemType *sem) +{ + return !ReleaseSemaphore (*sem, 1, NULL) ? -1 : 0; +} + +#endif + +G_END_DECLS + +#endif /* _MONO_SEMAPHORE_H_ */ diff --git a/mono/utils/mono-proclib.c b/mono/utils/mono-proclib.c index 7766729c655..c4e20e4ed42 100644 --- a/mono/utils/mono-proclib.c +++ b/mono/utils/mono-proclib.c @@ -161,7 +161,7 @@ mono_process_list (int *size) count = 16; else count *= 2; - buf = g_realloc (buf, count * sizeof (void*)); + buf = (void **)g_realloc (buf, count * sizeof (void*)); } buf [i++] = GINT_TO_POINTER (pid); } diff --git a/mono/utils/mono-semaphore.c b/mono/utils/mono-semaphore.c deleted file mode 100644 index 6c857fe8239..00000000000 --- a/mono/utils/mono-semaphore.c +++ /dev/null @@ -1,172 +0,0 @@ -/* - * mono-semaphore.c: mono-semaphore functions - * - * Author: - * Gonzalo Paniagua Javier - * - * (C) 2010 Novell, Inc. - */ - -#include -#include -#include "utils/mono-semaphore.h" -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif - -#if (defined (HAVE_SEMAPHORE_H) || defined (USE_MACH_SEMA)) && !defined(HOST_WIN32) -/* sem_* or semaphore_* functions in use */ -# ifdef USE_MACH_SEMA -# define TIMESPEC mach_timespec_t -# define WAIT_BLOCK(a,b) semaphore_timedwait (*(a), *(b)) -# elif defined(__native_client__) && defined(USE_NEWLIB) -# define TIMESPEC struct timespec -# define WAIT_BLOCK(a, b) sem_trywait(a) -# else -# define TIMESPEC struct timespec -# define WAIT_BLOCK(a,b) sem_timedwait (a, b) -# endif - -#ifndef NSEC_PER_SEC -#define NSEC_PER_SEC 1000000000 -#endif - -int -mono_sem_timedwait (MonoSemType *sem, guint32 timeout_ms, gboolean alertable) -{ - TIMESPEC ts, copy; - struct timeval t; - int res = 0; - -#ifndef USE_MACH_SEMA - if (timeout_ms == 0) - return sem_trywait (sem); -#endif - if (timeout_ms == (guint32) 0xFFFFFFFF) - return mono_sem_wait (sem, alertable); - -#ifdef USE_MACH_SEMA - memset (&t, 0, sizeof (t)); -#else - gettimeofday (&t, NULL); -#endif - ts.tv_sec = timeout_ms / 1000 + t.tv_sec; - ts.tv_nsec = (timeout_ms % 1000) * 1000000 + t.tv_usec * 1000; - while (ts.tv_nsec >= NSEC_PER_SEC) { - ts.tv_nsec -= NSEC_PER_SEC; - ts.tv_sec++; - } - - copy = ts; -#ifdef USE_MACH_SEMA - gettimeofday (&t, NULL); - while ((res = WAIT_BLOCK (sem, &ts)) == KERN_ABORTED) -#else - while ((res = WAIT_BLOCK (sem, &ts)) == -1 && errno == EINTR) -#endif - { -#ifdef USE_MACH_SEMA - struct timeval current; -#endif - if (alertable) - return -1; - ts = copy; -#ifdef USE_MACH_SEMA - gettimeofday (¤t, NULL); - ts.tv_sec -= (current.tv_sec - t.tv_sec); - ts.tv_nsec -= (current.tv_usec - t.tv_usec) * 1000; - if (ts.tv_nsec < 0) { - if (ts.tv_sec <= 0) { - ts.tv_nsec = 0; - } else { - ts.tv_sec--; - ts.tv_nsec += NSEC_PER_SEC; - } - } - if (ts.tv_sec < 0) { - ts.tv_sec = 0; - ts.tv_nsec = 0; - } -#endif - } - - /* OSX might return > 0 for error */ - if (res != 0) - res = -1; - return res; -} - -int -mono_sem_wait (MonoSemType *sem, gboolean alertable) -{ - int res; -#ifndef USE_MACH_SEMA - while ((res = sem_wait (sem)) == -1 && errno == EINTR) -#else - while ((res = semaphore_wait (*sem)) == KERN_ABORTED) -#endif - { - if (alertable) - return -1; - } - /* OSX might return > 0 for error */ - if (res != 0) - res = -1; - return res; -} - -int -mono_sem_post (MonoSemType *sem) -{ - int res; -#ifndef USE_MACH_SEMA - while ((res = sem_post (sem)) == -1 && errno == EINTR); -#else - res = semaphore_signal (*sem); - /* OSX might return > 0 for error */ - if (res != KERN_SUCCESS) - res = -1; -#endif - return res; -} - -#else -/* Windows or io-layer functions in use */ -int -mono_sem_wait (MonoSemType *sem, gboolean alertable) -{ - return mono_sem_timedwait (sem, INFINITE, alertable); -} - -int -mono_sem_timedwait (MonoSemType *sem, guint32 timeout_ms, gboolean alertable) -{ - gboolean res; - - while ((res = WaitForSingleObjectEx (*sem, timeout_ms, alertable)) == WAIT_IO_COMPLETION) { - if (alertable) { - errno = EINTR; - return -1; - } - } - switch (res) { - case WAIT_OBJECT_0: - return 0; - // WAIT_TIMEOUT and WAIT_FAILED - default: - return -1; - } -} - -int -mono_sem_post (MonoSemType *sem) -{ - if (!ReleaseSemaphore (*sem, 1, NULL)) - return -1; - return 0; -} -#endif - diff --git a/mono/utils/mono-semaphore.h b/mono/utils/mono-semaphore.h deleted file mode 100644 index b4e9f26d2ac..00000000000 --- a/mono/utils/mono-semaphore.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * mono-semaphore.h: Definitions for generic semaphore usage - * - * Author: - * Geoff Norton - * - * (C) 2009 Novell, Inc. - */ - -#ifndef _MONO_SEMAPHORE_H_ -#define _MONO_SEMAPHORE_H_ - -#include -#include -#include -#if defined(HAVE_SEMAPHORE_H) && !defined(HOST_WIN32) -#include -#endif -#include -#include - -#if (defined (HAVE_SEMAPHORE_H) || defined (USE_MACH_SEMA)) && !defined(HOST_WIN32) -# define MONO_HAS_SEMAPHORES - -# if defined (USE_MACH_SEMA) -# include -# include -# include -typedef semaphore_t MonoSemType; -# define MONO_SEM_INIT(addr,value) semaphore_create (current_task (), (addr), SYNC_POLICY_FIFO, (value)) -# define MONO_SEM_DESTROY(sem) semaphore_destroy (current_task (), *(sem)) -# else -typedef sem_t MonoSemType; -# define MONO_SEM_INIT(addr,value) sem_init ((addr), 0, (value)) -# define MONO_SEM_DESTROY(sem) sem_destroy ((sem)) -# endif -#else -# define MONO_HAS_SEMAPHORES -typedef HANDLE MonoSemType; -# define MONO_SEM_INIT(addr,initial) do {*(addr) = CreateSemaphore ( NULL,(initial),0x7FFFFFFF,NULL);} while(0) -# define MONO_SEM_DESTROY(sem) do { CloseHandle (*(sem)); (*(sem))=0; } while(0) -#endif - -#define MONO_SEM_WAIT(sem) MONO_SEM_WAIT_ALERTABLE(sem, FALSE) -#define MONO_SEM_WAIT_ALERTABLE(sem,alertable) mono_sem_wait ((sem), alertable) -#define MONO_SEM_POST(sem) mono_sem_post ((sem)) -#define MONO_SEM_TIMEDWAIT(sem, timeout_ms) MONO_SEM_TIMEDWAIT_ALERTABLE(sem, timeout_ms, FALSE) -#define MONO_SEM_TIMEDWAIT_ALERTABLE(sem, timeout_ms, alertable) mono_sem_timedwait ((sem), (timeout_ms), alertable) - -#define MONO_SEM_WAIT_UNITERRUPTIBLE(sem) do { \ - while (MONO_SEM_WAIT ((sem)) != 0) { \ - /*if (EINTR != errno) ABORT("sem_wait failed"); */ \ - } \ -} while (0) - -G_BEGIN_DECLS - -MONO_API int mono_sem_wait (MonoSemType *sem, gboolean alertable); -MONO_API int mono_sem_timedwait (MonoSemType *sem, guint32 timeout_ms, gboolean alertable); -MONO_API int mono_sem_post (MonoSemType *sem); - -G_END_DECLS -#endif /* _MONO_SEMAPHORE_H_ */ diff --git a/mono/utils/mono-threads-coop.c b/mono/utils/mono-threads-coop.c index edfb11d6c02..dcf1a786e40 100644 --- a/mono/utils/mono-threads-coop.c +++ b/mono/utils/mono-threads-coop.c @@ -15,7 +15,6 @@ #endif #include -#include #include #include #include @@ -158,7 +157,7 @@ mono_threads_finish_blocking (void *cookie, void* stackdata) if (!mono_threads_is_coop_enabled ()) return; - info = cookie; + info = (MonoThreadInfo *)cookie; if (!info) return; @@ -228,7 +227,7 @@ mono_threads_reset_blocking_end (void *cookie, void* stackdata) if (!mono_threads_is_coop_enabled ()) return; - info = cookie; + info = (MonoThreadInfo *)cookie; if (!info) return; @@ -236,49 +235,6 @@ mono_threads_reset_blocking_end (void *cookie, void* stackdata) mono_threads_prepare_blocking (stackdata); } -void* -mono_threads_try_prepare_blocking (void* stackdata) -{ - MonoThreadInfo *info; - - if (!mono_threads_is_coop_enabled ()) - return NULL; - - ++coop_try_blocking_count; - - info = mono_thread_info_current_unchecked (); - /* If the thread is not attached, it doesn't make sense prepare for suspend. */ - if (!info || !mono_thread_info_is_live (info) || mono_thread_info_current_state (info) == STATE_BLOCKING) { - THREADS_SUSPEND_DEBUG ("PREPARE-TRY-BLOCKING failed %p\n", mono_thread_info_get_tid (info)); - return NULL; - } - - copy_stack_data (info, stackdata); - -retry: - ++coop_save_count; - mono_threads_get_runtime_callbacks ()->thread_state_init (&info->thread_saved_state [SELF_SUSPEND_STATE_INDEX]); - - switch (mono_threads_transition_do_blocking (info)) { - case DoBlockingContinue: - break; - case DoBlockingPollAndRetry: - mono_threads_state_poll (); - goto retry; - } - - return info; -} - -void -mono_threads_finish_try_blocking (void* cookie, void* stackdata) -{ - if (!mono_threads_is_coop_enabled ()) - return; - - mono_threads_finish_blocking (cookie, stackdata); -} - void mono_threads_init_coop (void) { diff --git a/mono/utils/mono-threads-coop.h b/mono/utils/mono-threads-coop.h index fa928672400..4e24389489a 100644 --- a/mono/utils/mono-threads-coop.h +++ b/mono/utils/mono-threads-coop.h @@ -42,9 +42,6 @@ void mono_threads_finish_blocking (void* cookie, void* stackdata); void* mono_threads_reset_blocking_start (void* stackdata); void mono_threads_reset_blocking_end (void* cookie, void* stackdata); -void* mono_threads_try_prepare_blocking (void* stackdata); -void mono_threads_finish_try_blocking (void* cookie, void* stackdata); - static inline void mono_threads_safepoint (void) { @@ -53,30 +50,21 @@ mono_threads_safepoint (void) } #define MONO_PREPARE_BLOCKING \ -{ \ - void *__dummy; \ - void *__blocking_cookie = mono_threads_prepare_blocking (&__dummy); + do { \ + void *__dummy; \ + void *__blocking_cookie = mono_threads_prepare_blocking (&__dummy) #define MONO_FINISH_BLOCKING \ - mono_threads_finish_blocking (__blocking_cookie, &__dummy); \ -} + mono_threads_finish_blocking (__blocking_cookie, &__dummy); \ + } while (0) #define MONO_PREPARE_RESET_BLOCKING \ -{ \ - void *__dummy; \ - void *__reset_cookie = mono_threads_reset_blocking_start (&__dummy); + do { \ + void *__dummy; \ + void *__reset_cookie = mono_threads_reset_blocking_start (&__dummy) #define MONO_FINISH_RESET_BLOCKING \ - mono_threads_reset_blocking_end (__reset_cookie, &__dummy); \ -} - -#define MONO_TRY_BLOCKING \ -{ \ - void *__dummy; \ - void *__try_block_cookie = mono_threads_try_prepare_blocking (&__dummy); - -#define MONO_FINISH_TRY_BLOCKING \ - mono_threads_finish_try_blocking (__try_block_cookie, &__dummy); \ -} + mono_threads_reset_blocking_end (__reset_cookie, &__dummy); \ + } while (0) #endif diff --git a/mono/utils/mono-threads-mach.c b/mono/utils/mono-threads-mach.c index d48e30a2b37..6f2ddfa78af 100644 --- a/mono/utils/mono-threads-mach.c +++ b/mono/utils/mono-threads-mach.c @@ -21,7 +21,6 @@ #include #include -#include #include #include diff --git a/mono/utils/mono-threads-posix-signals.c b/mono/utils/mono-threads-posix-signals.c index ade08008827..155f830a0fa 100644 --- a/mono/utils/mono-threads-posix-signals.c +++ b/mono/utils/mono-threads-posix-signals.c @@ -17,7 +17,6 @@ #include #include -#include "mono-semaphore.h" #include "mono-threads-posix-signals.h" #if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) @@ -65,7 +64,7 @@ signal_add_handler (int signo, gpointer handler, int flags) struct sigaction previous_sa; int ret; - sa.sa_sigaction = handler; + sa.sa_sigaction = (void (*)(int, siginfo_t *, void *))handler; sigfillset (&sa.sa_mask); sa.sa_flags = SA_SIGINFO | flags; @@ -217,7 +216,8 @@ suspend_signal_handler (int _dummy, siginfo_t *info, void *context) #if MONO_ARCH_HAS_MONO_CONTEXT MonoContext tmp = current->thread_saved_state [ASYNC_SUSPEND_STATE_INDEX].ctx; mono_threads_get_runtime_callbacks ()->setup_async_callback (&tmp, current->async_target, current->user_data); - current->async_target = current->user_data = NULL; + current->user_data = NULL; + current->async_target = NULL; mono_monoctx_to_sigctx (&tmp, context); #else g_error ("The new interruption machinery requires a working mono-context"); diff --git a/mono/utils/mono-threads-posix.c b/mono/utils/mono-threads-posix.c index b9ede7e25de..54f183e58f0 100644 --- a/mono/utils/mono-threads-posix.c +++ b/mono/utils/mono-threads-posix.c @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -40,7 +41,7 @@ typedef struct { void *(*start_routine)(void*); void *arg; int flags; - MonoSemType registered; + MonoCoopSem registered; HANDLE handle; } StartInfo; @@ -59,35 +60,34 @@ inner_start_thread (void *arg) /* Register the thread with the io-layer */ handle = wapi_create_thread_handle (); if (!handle) { - res = MONO_SEM_POST (&(start_info->registered)); + res = mono_coop_sem_post (&(start_info->registered)); g_assert (!res); return NULL; } start_info->handle = handle; info = mono_thread_info_attach (&result); - MONO_PREPARE_BLOCKING; info->runtime_thread = TRUE; info->handle = handle; if (flags & CREATE_SUSPENDED) { info->create_suspended = TRUE; - MONO_SEM_INIT (&info->create_suspended_sem, 0); + mono_coop_sem_init (&info->create_suspended_sem, 0); } /* start_info is not valid after this */ - res = MONO_SEM_POST (&(start_info->registered)); + res = mono_coop_sem_post (&(start_info->registered)); g_assert (!res); start_info = NULL; if (flags & CREATE_SUSPENDED) { - while (MONO_SEM_WAIT (&info->create_suspended_sem) != 0 && - errno == EINTR); - MONO_SEM_DESTROY (&info->create_suspended_sem); + res = mono_coop_sem_wait (&info->create_suspended_sem, MONO_SEM_FLAGS_NONE); + g_assert (res != -1); + + mono_coop_sem_destroy (&info->create_suspended_sem); } - MONO_FINISH_BLOCKING; /* Run the actual main function of the thread */ result = start_func (t_arg); @@ -131,23 +131,20 @@ mono_threads_core_create_thread (LPTHREAD_START_ROUTINE start_routine, gpointer start_info.start_routine = (void *(*)(void *)) start_routine; start_info.arg = arg; start_info.flags = creation_flags; - MONO_SEM_INIT (&(start_info.registered), 0); + mono_coop_sem_init (&(start_info.registered), 0); /* Actually start the thread */ res = mono_gc_pthread_create (&thread, &attr, inner_start_thread, &start_info); if (res) { - MONO_SEM_DESTROY (&(start_info.registered)); + mono_coop_sem_destroy (&(start_info.registered)); return NULL; } - MONO_TRY_BLOCKING; /* Wait until the thread register itself in various places */ - while (MONO_SEM_WAIT (&(start_info.registered)) != 0) { - /*if (EINTR != errno) ABORT("sem_wait failed"); */ - } - MONO_FINISH_TRY_BLOCKING; + res = mono_coop_sem_wait (&start_info.registered, MONO_SEM_FLAGS_NONE); + g_assert (res != -1); - MONO_SEM_DESTROY (&(start_info.registered)); + mono_coop_sem_destroy (&(start_info.registered)); if (out_tid) *out_tid = thread; @@ -163,7 +160,7 @@ mono_threads_core_create_thread (LPTHREAD_START_ROUTINE start_routine, gpointer void mono_threads_core_resume_created (MonoThreadInfo *info, MonoNativeThreadId tid) { - MONO_SEM_POST (&info->create_suspended_sem); + mono_coop_sem_post (&info->create_suspended_sem); } gboolean diff --git a/mono/utils/mono-threads-windows.c b/mono/utils/mono-threads-windows.c index 5f62b198075..86275a53833 100644 --- a/mono/utils/mono-threads-windows.c +++ b/mono/utils/mono-threads-windows.c @@ -139,7 +139,7 @@ mono_threads_platform_free (MonoThreadInfo *info) typedef struct { LPTHREAD_START_ROUTINE start_routine; void *arg; - MonoSemType registered; + MonoCoopSem registered; gboolean suspend; HANDLE suspend_event; } ThreadStartInfo; @@ -160,7 +160,7 @@ inner_start_thread (LPVOID arg) info->runtime_thread = TRUE; info->create_suspended = suspend; - post_result = MONO_SEM_POST (&(start_info->registered)); + post_result = mono_coop_sem_post (&(start_info->registered)); g_assert (!post_result); if (suspend) { @@ -181,11 +181,12 @@ mono_threads_core_create_thread (LPTHREAD_START_ROUTINE start_routine, gpointer ThreadStartInfo *start_info; HANDLE result; DWORD thread_id; + int res; start_info = g_malloc0 (sizeof (ThreadStartInfo)); if (!start_info) return NULL; - MONO_SEM_INIT (&(start_info->registered), 0); + mono_coop_sem_init (&(start_info->registered), 0); start_info->arg = arg; start_info->start_routine = start_routine; start_info->suspend = creation_flags & CREATE_SUSPENDED; @@ -198,9 +199,9 @@ mono_threads_core_create_thread (LPTHREAD_START_ROUTINE start_routine, gpointer result = CreateThread (NULL, stack_size, inner_start_thread, start_info, creation_flags, &thread_id); if (result) { - while (MONO_SEM_WAIT (&(start_info->registered)) != 0) { - /*if (EINTR != errno) ABORT("sem_wait failed"); */ - } + res = mono_coop_sem_wait (&(start_info->registered), MONO_SEM_FLAGS_NONE); + g_assert (res != -1); + if (start_info->suspend) { g_assert (SuspendThread (result) != (DWORD)-1); SetEvent (start_info->suspend_event); @@ -210,7 +211,7 @@ mono_threads_core_create_thread (LPTHREAD_START_ROUTINE start_routine, gpointer } if (out_tid) *out_tid = thread_id; - MONO_SEM_DESTROY (&(start_info->registered)); + mono_coop_sem_destroy (&(start_info->registered)); g_free (start_info); return result; } diff --git a/mono/utils/mono-threads.c b/mono/utils/mono-threads.c index abad3b64aaa..9a41de7c716 100644 --- a/mono/utils/mono-threads.c +++ b/mono/utils/mono-threads.c @@ -16,7 +16,7 @@ #endif #include -#include +#include #include #include #include @@ -25,7 +25,8 @@ #include #include #include - +#include +#include #include @@ -45,7 +46,7 @@ The GC has to acquire this lock before starting a STW to make sure a runtime suspend won't make it wronly see a thread in a safepoint when it is in fact not. */ -static MonoSemType global_suspend_semaphore; +static MonoCoopSem global_suspend_semaphore; static size_t thread_info_size; static MonoThreadInfoCallbacks threads_callbacks; @@ -77,7 +78,7 @@ mono_threads_notify_initiator_of_abort (MonoThreadInfo* info) { THREADS_SUSPEND_DEBUG ("[INITIATOR-NOTIFY-ABORT] %p\n", mono_thread_info_get_tid (info)); InterlockedIncrement (&abort_posts); - MONO_SEM_POST (&suspend_semaphore); + mono_os_sem_post (&suspend_semaphore); } void @@ -85,7 +86,7 @@ mono_threads_notify_initiator_of_suspend (MonoThreadInfo* info) { THREADS_SUSPEND_DEBUG ("[INITIATOR-NOTIFY-SUSPEND] %p\n", mono_thread_info_get_tid (info)); InterlockedIncrement (&suspend_posts); - MONO_SEM_POST (&suspend_semaphore); + mono_os_sem_post (&suspend_semaphore); } void @@ -93,7 +94,7 @@ mono_threads_notify_initiator_of_resume (MonoThreadInfo* info) { THREADS_SUSPEND_DEBUG ("[INITIATOR-NOTIFY-RESUME] %p\n", mono_thread_info_get_tid (info)); InterlockedIncrement (&resume_posts); - MONO_SEM_POST (&suspend_semaphore); + mono_os_sem_post (&suspend_semaphore); } static gboolean @@ -132,21 +133,23 @@ static void resume_self_suspended (MonoThreadInfo* info) { THREADS_SUSPEND_DEBUG ("**BEGIN self-resume %p\n", mono_thread_info_get_tid (info)); - MONO_SEM_POST (&info->resume_semaphore); + mono_os_sem_post (&info->resume_semaphore); } void mono_thread_info_wait_for_resume (MonoThreadInfo* info) { + int res; THREADS_SUSPEND_DEBUG ("**WAIT self-resume %p\n", mono_thread_info_get_tid (info)); - MONO_SEM_WAIT_UNITERRUPTIBLE (&info->resume_semaphore); + res = mono_os_sem_wait (&info->resume_semaphore, MONO_SEM_FLAGS_NONE); + g_assert (res != -1); } static void resume_blocking_suspended (MonoThreadInfo* info) { THREADS_SUSPEND_DEBUG ("**BEGIN blocking-resume %p\n", mono_thread_info_get_tid (info)); - MONO_SEM_POST (&info->resume_semaphore); + mono_os_sem_post (&info->resume_semaphore); } void @@ -225,7 +228,7 @@ mono_threads_wait_pending_operations (void) for (i = 0; i < pending_suspends; ++i) { THREADS_SUSPEND_DEBUG ("[INITIATOR-WAIT-WAITING]\n"); InterlockedIncrement (&waits_done); - if (!MONO_SEM_TIMEDWAIT (&suspend_semaphore, SLEEP_DURATION_BEFORE_ABORT)) + if (!mono_os_sem_timedwait (&suspend_semaphore, SLEEP_DURATION_BEFORE_ABORT, MONO_SEM_FLAGS_NONE)) continue; mono_stopwatch_stop (&suspension_time); @@ -308,7 +311,7 @@ free_thread_info (gpointer mem) { MonoThreadInfo *info = (MonoThreadInfo *) mem; - MONO_SEM_DESTROY (&info->resume_semaphore); + mono_os_sem_destroy (&info->resume_semaphore); mono_threads_platform_free (info); g_free (info); @@ -336,7 +339,7 @@ register_thread (MonoThreadInfo *info, gpointer baseptr) mono_thread_info_set_tid (info, mono_native_thread_id_get ()); info->small_id = small_id; - MONO_SEM_INIT (&info->resume_semaphore, 0); + mono_os_sem_init (&info->resume_semaphore, 0); /*set TLS early so SMR works */ mono_native_tls_set_value (thread_info_key, info); @@ -631,8 +634,8 @@ mono_threads_init (MonoThreadInfoCallbacks *callbacks, size_t info_size) unified_suspend_enabled = g_getenv ("MONO_ENABLE_UNIFIED_SUSPEND") != NULL || mono_threads_is_coop_enabled (); - MONO_SEM_INIT (&global_suspend_semaphore, 1); - MONO_SEM_INIT (&suspend_semaphore, 0); + mono_coop_sem_init (&global_suspend_semaphore, 1); + mono_os_sem_init (&suspend_semaphore, 0); mono_lls_init (&thread_list, NULL); mono_thread_smr_init (); @@ -661,45 +664,6 @@ mono_threads_get_runtime_callbacks (void) return &runtime_callbacks; } -/* -The return value is only valid until a matching mono_thread_info_resume is called -*/ -static MonoThreadInfo* -mono_thread_info_suspend_sync (MonoNativeThreadId tid, gboolean interrupt_kernel, const char **error_condition) -{ - MonoThreadHazardPointers *hp = mono_hazard_pointer_get (); - MonoThreadInfo *info = mono_thread_info_lookup (tid); /*info on HP1*/ - if (!info) { - *error_condition = "Thread not found"; - return NULL; - } - - switch (mono_threads_transition_request_async_suspension (info)) { - case AsyncSuspendAlreadySuspended: - mono_hazard_pointer_clear (hp, 1); //XXX this is questionable we got to clean the suspend/resume nonsense of critical sections - return info; - case AsyncSuspendWait: - mono_threads_add_to_pending_operation_set (info); - break; - case AsyncSuspendInitSuspend: - if (!begin_async_suspend (info, interrupt_kernel)) { - mono_hazard_pointer_clear (hp, 1); - *error_condition = "Could not suspend thread"; - return NULL; - } - } - - //Wait for the pending suspend to finish - mono_threads_wait_pending_operations (); - - if (!check_async_suspend (info)) { - mono_hazard_pointer_clear (hp, 1); - *error_condition = "Post suspend failed"; - return NULL; - } - return info; -} - /* Signal that the current thread wants to be suspended. This function can be called without holding the suspend lock held. @@ -884,14 +848,48 @@ mono_thread_info_in_critical_location (MonoThreadInfo *info) return is_thread_in_critical_region (info); } +/* +The return value is only valid until a matching mono_thread_info_resume is called +*/ +static MonoThreadInfo* +suspend_sync (MonoNativeThreadId tid, gboolean interrupt_kernel) +{ + MonoThreadHazardPointers *hp = mono_hazard_pointer_get (); + MonoThreadInfo *info = mono_thread_info_lookup (tid); /*info on HP1*/ + if (!info) + return NULL; + + switch (mono_threads_transition_request_async_suspension (info)) { + case AsyncSuspendAlreadySuspended: + mono_hazard_pointer_clear (hp, 1); //XXX this is questionable we got to clean the suspend/resume nonsense of critical sections + return info; + case AsyncSuspendWait: + mono_threads_add_to_pending_operation_set (info); + break; + case AsyncSuspendInitSuspend: + if (!begin_async_suspend (info, interrupt_kernel)) { + mono_hazard_pointer_clear (hp, 1); + return NULL; + } + } + + //Wait for the pending suspend to finish + mono_threads_wait_pending_operations (); + + if (!check_async_suspend (info)) { + mono_hazard_pointer_clear (hp, 1); + return NULL; + } + return info; +} + static MonoThreadInfo* suspend_sync_nolock (MonoNativeThreadId id, gboolean interrupt_kernel) { MonoThreadInfo *info = NULL; int sleep_duration = 0; for (;;) { - const char *suspend_error = "Unknown error"; - if (!(info = mono_thread_info_suspend_sync (id, interrupt_kernel, &suspend_error))) { + if (!(info = suspend_sync (id, interrupt_kernel))) { mono_hazard_pointer_clear (mono_hazard_pointer_get (), 1); return NULL; } @@ -909,16 +907,11 @@ suspend_sync_nolock (MonoNativeThreadId id, gboolean interrupt_kernel) /* Wait for the pending resume to finish */ mono_threads_wait_pending_operations (); - if (!sleep_duration) { -#ifdef HOST_WIN32 - SwitchToThread (); -#else - sched_yield (); -#endif - } - else { - g_usleep (sleep_duration); - } + if (sleep_duration == 0) + mono_thread_info_yield (); + else + mono_thread_info_usleep (sleep_duration); + sleep_duration += 10; } return info; @@ -961,38 +954,6 @@ done: mono_thread_info_suspend_unlock (); } -/* -WARNING: -If we are trying to suspend a target that is on a critical region -and running a syscall we risk looping forever if @interrupt_kernel is FALSE. -So, be VERY carefull in calling this with @interrupt_kernel == FALSE. - -Info is not put on a hazard pointer as a suspended thread cannot exit and be freed. - -This function MUST be matched with mono_thread_info_finish_suspend or mono_thread_info_finish_suspend_and_resume -*/ -MonoThreadInfo* -mono_thread_info_safe_suspend_sync (MonoNativeThreadId id, gboolean interrupt_kernel) -{ - MonoThreadInfo *info = NULL; - - THREADS_SUSPEND_DEBUG ("SUSPENDING tid %p\n", (void*)id); - /*FIXME: unify this with self-suspend*/ - g_assert (id != mono_native_thread_id_get ()); - - mono_thread_info_suspend_lock (); - mono_threads_begin_global_suspend (); - - info = suspend_sync_nolock (id, interrupt_kernel); - - /* XXX this clears HP 1, so we restated it again */ - // mono_atomic_store_release (&mono_thread_info_current ()->inside_critical_region, TRUE); - mono_threads_end_global_suspend (); - mono_thread_info_suspend_unlock (); - - return info; -} - /** Inject an assynchronous call into the target thread. The target thread must be suspended and only a single async call can be setup for a given suspend cycle. @@ -1020,15 +981,14 @@ STW to make sure no unsafe pending suspend is in progress. void mono_thread_info_suspend_lock (void) { - MONO_TRY_BLOCKING; - MONO_SEM_WAIT_UNITERRUPTIBLE (&global_suspend_semaphore); - MONO_FINISH_TRY_BLOCKING; + int res = mono_coop_sem_wait (&global_suspend_semaphore, MONO_SEM_FLAGS_NONE); + g_assert (res != -1); } void mono_thread_info_suspend_unlock (void) { - MONO_SEM_POST (&global_suspend_semaphore); + mono_coop_sem_post (&global_suspend_semaphore); } /* @@ -1143,22 +1103,22 @@ mono_thread_info_yield (void) return mono_threads_core_yield (); } static mono_lazy_init_t sleep_init = MONO_LAZY_INIT_STATUS_NOT_INITIALIZED; -static mono_mutex_t sleep_mutex; -static mono_cond_t sleep_cond; +static MonoCoopMutex sleep_mutex; +static MonoCoopCond sleep_cond; static void sleep_initialize (void) { - mono_mutex_init (&sleep_mutex); - mono_cond_init (&sleep_cond, NULL); + mono_coop_mutex_init (&sleep_mutex); + mono_coop_cond_init (&sleep_cond); } static void sleep_interrupt (gpointer data) { - mono_mutex_lock (&sleep_mutex); - mono_cond_broadcast (&sleep_cond); - mono_mutex_unlock (&sleep_mutex); + mono_coop_mutex_lock (&sleep_mutex); + mono_coop_cond_broadcast (&sleep_cond); + mono_coop_mutex_unlock (&sleep_mutex); } static inline guint32 @@ -1182,28 +1142,28 @@ sleep_interruptable (guint32 ms, gboolean *alerted) mono_lazy_initialize (&sleep_init, sleep_initialize); - mono_mutex_lock (&sleep_mutex); + mono_coop_mutex_lock (&sleep_mutex); for (now = mono_msec_ticks (); ms == INFINITE || now - start < ms; now = mono_msec_ticks ()) { mono_thread_info_install_interrupt (sleep_interrupt, NULL, alerted); if (*alerted) { - mono_mutex_unlock (&sleep_mutex); + mono_coop_mutex_unlock (&sleep_mutex); return WAIT_IO_COMPLETION; } if (ms < INFINITE) - mono_cond_timedwait_ms (&sleep_cond, &sleep_mutex, end - now); + mono_coop_cond_timedwait (&sleep_cond, &sleep_mutex, end - now); else - mono_cond_wait (&sleep_cond, &sleep_mutex); + mono_coop_cond_wait (&sleep_cond, &sleep_mutex); mono_thread_info_uninstall_interrupt (alerted); if (*alerted) { - mono_mutex_unlock (&sleep_mutex); + mono_coop_mutex_unlock (&sleep_mutex); return WAIT_IO_COMPLETION; } } - mono_mutex_unlock (&sleep_mutex); + mono_coop_mutex_unlock (&sleep_mutex); return 0; } @@ -1226,6 +1186,8 @@ mono_thread_info_sleep (guint32 ms, gboolean *alerted) if (alerted) return sleep_interruptable (ms, alerted); + MONO_PREPARE_BLOCKING; + if (ms == INFINITE) { do { #ifdef HOST_WIN32 @@ -1269,6 +1231,17 @@ mono_thread_info_sleep (guint32 ms, gboolean *alerted) #endif /* __linux__ */ } + MONO_FINISH_BLOCKING; + + return 0; +} + +gint +mono_thread_info_usleep (guint64 us) +{ + MONO_PREPARE_BLOCKING; + g_usleep (us); + MONO_FINISH_BLOCKING; return 0; } @@ -1374,7 +1347,7 @@ mono_thread_info_install_interrupt (void (*callback) (gpointer data), gpointer d token->callback = callback; token->data = data; - previous_token = InterlockedCompareExchangePointer ((gpointer*) &info->interrupt_token, token, NULL); + previous_token = (MonoThreadInfoInterruptToken *)InterlockedCompareExchangePointer ((gpointer*) &info->interrupt_token, token, NULL); if (previous_token) { if (previous_token != INTERRUPT_STATE) @@ -1401,7 +1374,7 @@ mono_thread_info_uninstall_interrupt (gboolean *interrupted) info = mono_thread_info_current (); g_assert (info); - previous_token = InterlockedExchangePointer ((gpointer*) &info->interrupt_token, NULL); + previous_token = (MonoThreadInfoInterruptToken *)InterlockedExchangePointer ((gpointer*) &info->interrupt_token, NULL); /* only the installer can uninstall the token */ g_assert (previous_token); @@ -1510,7 +1483,7 @@ mono_thread_info_clear_self_interrupt () info = mono_thread_info_current (); g_assert (info); - previous_token = InterlockedCompareExchangePointer ((gpointer*) &info->interrupt_token, NULL, INTERRUPT_STATE); + previous_token = (MonoThreadInfoInterruptToken *)InterlockedCompareExchangePointer ((gpointer*) &info->interrupt_token, NULL, INTERRUPT_STATE); g_assert (previous_token == NULL || previous_token == INTERRUPT_STATE); THREADS_INTERRUPT_DEBUG ("interrupt clear self tid %p previous_token %p\n", mono_thread_info_get_tid (info), previous_token); diff --git a/mono/utils/mono-threads.h b/mono/utils/mono-threads.h index 8a7782fad12..5fe411dbe1a 100644 --- a/mono/utils/mono-threads.h +++ b/mono/utils/mono-threads.h @@ -10,13 +10,15 @@ #ifndef __MONO_THREADS_H__ #define __MONO_THREADS_H__ -#include +#include #include #include -#include #include #include #include +#include + +#include #include #include @@ -226,7 +228,7 @@ typedef struct { gboolean create_suspended; /* Semaphore used to implement CREATE_SUSPENDED */ - MonoSemType create_suspended_sem; + MonoCoopSem create_suspended_sem; /* * Values of TLS variables for this thread. @@ -356,9 +358,6 @@ mono_thread_info_list_head (void); THREAD_INFO_TYPE* mono_thread_info_lookup (MonoNativeThreadId id); -THREAD_INFO_TYPE* -mono_thread_info_safe_suspend_sync (MonoNativeThreadId tid, gboolean interrupt_kernel); - gboolean mono_thread_info_resume (MonoNativeThreadId tid); @@ -407,6 +406,9 @@ mono_thread_info_yield (void); gint mono_thread_info_sleep (guint32 ms, gboolean *alerted); +gint +mono_thread_info_usleep (guint64 us); + gpointer mono_thread_info_tls_get (THREAD_INFO_TYPE *info, MonoTlsKey key); diff --git a/mono/utils/networking-posix.c b/mono/utils/networking-posix.c index ad4a623eda7..58ab1378a90 100644 --- a/mono/utils/networking-posix.c +++ b/mono/utils/networking-posix.c @@ -182,7 +182,7 @@ mono_get_local_interfaces (int family, int *interface_count) memset (&ifc, 0, sizeof (ifc)); ifc.ifc_len = IFCONF_BUFF_SIZE; - ifc.ifc_buf = g_malloc (IFCONF_BUFF_SIZE); /* We can't have such huge buffers on the stack. */ + ifc.ifc_buf = (char *)g_malloc (IFCONF_BUFF_SIZE); /* We can't have such huge buffers on the stack. */ if (ioctl (fd, SIOCGIFCONF, &ifc) < 0) goto done; @@ -219,7 +219,8 @@ mono_get_local_interfaces (int family, int *interface_count) ++if_count; } - result_ptr = result = g_malloc (if_count * mono_address_size_for_family (family)); + result = (char *)g_malloc (if_count * mono_address_size_for_family (family)); + result_ptr = (char *)result; FOREACH_IFR (ifr, ifc) { if (ifr->ifr_name [0] == '\0') continue; diff --git a/msvc/.gitignore b/msvc/.gitignore index 13fa9cfd9ef..486f7866be2 100644 --- a/msvc/.gitignore +++ b/msvc/.gitignore @@ -6,4 +6,5 @@ /*.opensdf /ipch/ /Win32/ -/x64/ \ No newline at end of file +/x64/ +/include/ \ No newline at end of file diff --git a/msvc/libmonoutils.vcxproj b/msvc/libmonoutils.vcxproj index ff512f903d0..5daad947262 100644 --- a/msvc/libmonoutils.vcxproj +++ b/msvc/libmonoutils.vcxproj @@ -45,7 +45,6 @@ - @@ -58,7 +57,6 @@ - @@ -104,6 +102,8 @@ + + @@ -120,15 +120,16 @@ - + + + - diff --git a/msvc/mono.def b/msvc/mono.def index df0b1c98562..615886ddf32 100644 --- a/msvc/mono.def +++ b/msvc/mono.def @@ -759,9 +759,6 @@ mono_security_core_clr_require_elevated_permissions mono_security_core_clr_set_options mono_security_enable_core_clr mono_security_set_core_clr_platform_callback -mono_sem_post -mono_sem_timedwait -mono_sem_wait mono_set_assemblies_path mono_set_break_policy mono_set_config_dir diff --git a/msvc/monosgen.def b/msvc/monosgen.def index f0dae232db0..66fea4dae38 100644 --- a/msvc/monosgen.def +++ b/msvc/monosgen.def @@ -761,9 +761,6 @@ mono_security_core_clr_require_elevated_permissions mono_security_core_clr_set_options mono_security_enable_core_clr mono_security_set_core_clr_platform_callback -mono_sem_post -mono_sem_timedwait -mono_sem_wait mono_set_assemblies_path mono_set_break_policy mono_set_config_dir diff --git a/msvc/scripts/.gitignore b/msvc/scripts/.gitignore new file mode 100644 index 00000000000..ddab2abcf3e --- /dev/null +++ b/msvc/scripts/.gitignore @@ -0,0 +1 @@ +*.mdb \ No newline at end of file diff --git a/msvc/scripts/README b/msvc/scripts/README index eae93d57b54..e73eab7fc0b 100644 --- a/msvc/scripts/README +++ b/msvc/scripts/README @@ -54,10 +54,10 @@ necessary to build the Mono class libraries. On Mac: cd msvc/scripts/ make genproj.exe - mono genproj. + mono genproj.exe One output of genproj is the solutions for the successive profiles, - from net_2_0.sln to from net_4.5.sln + like net_4_x.sln. The command ./genproj.exe -h diff --git a/msvc/scripts/net_4_x.sln b/msvc/scripts/net_4_x.sln index 035004a84d4..732e14aa11a 100644 --- a/msvc/scripts/net_4_x.sln +++ b/msvc/scripts/net_4_x.sln @@ -27,6 +27,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Core-net_4_x", "..\. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Core-plaincore-net_4_x", "..\..\mcs\class/System.Core\System.Core-plaincore-net_4_x.csproj", "{1EC0EBC0-0B35-454C-89AE-3F8F0FDD9705}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.IO.Compression-net_4_x", "..\..\mcs\class/System.IO.Compression\System.IO.Compression-net_4_x.csproj", "{6187D26C-54C8-4298-829E-A99B0E6036B1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.IO.Compression.FileSystem-net_4_x", "..\..\mcs\class/System.IO.Compression.FileSystem\System.IO.Compression.FileSystem-net_4_x.csproj", "{9E61FF2E-493E-4CA0-BBDA-2EF96A4CB058}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Drawing-net_4_x", "..\..\mcs\class/System.Drawing\System.Drawing-net_4_x.csproj", "{584A5E46-2958-4CB2-8DF9-188B420D0BB0}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Transactions-net_4_x", "..\..\mcs\class/System.Transactions\System.Transactions-net_4_x.csproj", "{3821C69F-220D-4231-992C-0FE05311A005}" @@ -267,14 +271,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Threading.Tasks.Data EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.ComponentModel.Composition-net_4_x", "..\..\mcs\class/System.ComponentModel.Composition.4.5\System.ComponentModel.Composition-net_4_x.csproj", "{9091B5ED-8AFF-4B93-801A-9A33E0895A2B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.IO.Compression-net_4_x", "..\..\mcs\class/System.IO.Compression\System.IO.Compression-net_4_x.csproj", "{6187D26C-54C8-4298-829E-A99B0E6036B1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.IO.Compression.FileSystem-net_4_x", "..\..\mcs\class/System.IO.Compression.FileSystem\System.IO.Compression.FileSystem-net_4_x.csproj", "{9E61FF2E-493E-4CA0-BBDA-2EF96A4CB058}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Windows-net_4_x", "..\..\mcs\class/System.Windows\System.Windows-net_4_x.csproj", "{3F6EB6D4-602E-43C2-A3E1-4AD98E8C86EE}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Xml.Serialization-net_4_x", "..\..\mcs\class/System.Xml.Serialization\System.Xml.Serialization-net_4_x.csproj", "{2210873E-99FC-48A2-A261-D650BAE33A1C}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Security.Providers.DotNet-net_4_x", "..\..\mcs\class/Mono.Security.Providers.DotNet\Mono.Security.Providers.DotNet-net_4_x.csproj", "{391EDD2B-85AC-4FCA-B607-AAD6C51E6799}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Security.Providers.OldTls-net_4_x", "..\..\mcs\class/Mono.Security.Providers.OldTls\Mono.Security.Providers.OldTls-net_4_x.csproj", "{E485E885-59B1-4081-BC66-56AAAFD8771A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Security.Providers.NewSystemSource-net_4_x", "..\..\mcs\class/Mono.Security.Providers.NewSystemSource\Mono.Security.Providers.NewSystemSource-net_4_x.csproj", "{0BB4541F-9B1A-4CBC-BEB1-00B31B37F74E}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.DirectoryServices.Protocols-net_4_x", "..\..\mcs\class/System.DirectoryServices.Protocols\System.DirectoryServices.Protocols-net_4_x.csproj", "{EF08F249-31A1-4E62-8391-ECBA5227B686}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.VisualC-net_4_x", "..\..\mcs\class/Microsoft.VisualC\Microsoft.VisualC-net_4_x.csproj", "{ACA2694D-9F07-4AE2-9171-9AB5DD1A8C18}" @@ -341,6 +347,14 @@ Global {1EC0EBC0-0B35-454C-89AE-3F8F0FDD9705}.Debug|Any CPU.Build.0 = Debug|Any CPU {1EC0EBC0-0B35-454C-89AE-3F8F0FDD9705}.Release|Any CPU.ActiveCfg = Release|Any CPU {1EC0EBC0-0B35-454C-89AE-3F8F0FDD9705}.Release|Any CPU.Build.0 = Release|Any CPU + {6187D26C-54C8-4298-829E-A99B0E6036B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6187D26C-54C8-4298-829E-A99B0E6036B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6187D26C-54C8-4298-829E-A99B0E6036B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6187D26C-54C8-4298-829E-A99B0E6036B1}.Release|Any CPU.Build.0 = Release|Any CPU + {9E61FF2E-493E-4CA0-BBDA-2EF96A4CB058}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9E61FF2E-493E-4CA0-BBDA-2EF96A4CB058}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9E61FF2E-493E-4CA0-BBDA-2EF96A4CB058}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9E61FF2E-493E-4CA0-BBDA-2EF96A4CB058}.Release|Any CPU.Build.0 = Release|Any CPU {584A5E46-2958-4CB2-8DF9-188B420D0BB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {584A5E46-2958-4CB2-8DF9-188B420D0BB0}.Debug|Any CPU.Build.0 = Debug|Any CPU {584A5E46-2958-4CB2-8DF9-188B420D0BB0}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -821,14 +835,6 @@ Global {9091B5ED-8AFF-4B93-801A-9A33E0895A2B}.Debug|Any CPU.Build.0 = Debug|Any CPU {9091B5ED-8AFF-4B93-801A-9A33E0895A2B}.Release|Any CPU.ActiveCfg = Release|Any CPU {9091B5ED-8AFF-4B93-801A-9A33E0895A2B}.Release|Any CPU.Build.0 = Release|Any CPU - {6187D26C-54C8-4298-829E-A99B0E6036B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6187D26C-54C8-4298-829E-A99B0E6036B1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6187D26C-54C8-4298-829E-A99B0E6036B1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6187D26C-54C8-4298-829E-A99B0E6036B1}.Release|Any CPU.Build.0 = Release|Any CPU - {9E61FF2E-493E-4CA0-BBDA-2EF96A4CB058}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9E61FF2E-493E-4CA0-BBDA-2EF96A4CB058}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9E61FF2E-493E-4CA0-BBDA-2EF96A4CB058}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9E61FF2E-493E-4CA0-BBDA-2EF96A4CB058}.Release|Any CPU.Build.0 = Release|Any CPU {3F6EB6D4-602E-43C2-A3E1-4AD98E8C86EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3F6EB6D4-602E-43C2-A3E1-4AD98E8C86EE}.Debug|Any CPU.Build.0 = Debug|Any CPU {3F6EB6D4-602E-43C2-A3E1-4AD98E8C86EE}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -837,6 +843,18 @@ Global {2210873E-99FC-48A2-A261-D650BAE33A1C}.Debug|Any CPU.Build.0 = Debug|Any CPU {2210873E-99FC-48A2-A261-D650BAE33A1C}.Release|Any CPU.ActiveCfg = Release|Any CPU {2210873E-99FC-48A2-A261-D650BAE33A1C}.Release|Any CPU.Build.0 = Release|Any CPU + {391EDD2B-85AC-4FCA-B607-AAD6C51E6799}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {391EDD2B-85AC-4FCA-B607-AAD6C51E6799}.Debug|Any CPU.Build.0 = Debug|Any CPU + {391EDD2B-85AC-4FCA-B607-AAD6C51E6799}.Release|Any CPU.ActiveCfg = Release|Any CPU + {391EDD2B-85AC-4FCA-B607-AAD6C51E6799}.Release|Any CPU.Build.0 = Release|Any CPU + {E485E885-59B1-4081-BC66-56AAAFD8771A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E485E885-59B1-4081-BC66-56AAAFD8771A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E485E885-59B1-4081-BC66-56AAAFD8771A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E485E885-59B1-4081-BC66-56AAAFD8771A}.Release|Any CPU.Build.0 = Release|Any CPU + {0BB4541F-9B1A-4CBC-BEB1-00B31B37F74E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0BB4541F-9B1A-4CBC-BEB1-00B31B37F74E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0BB4541F-9B1A-4CBC-BEB1-00B31B37F74E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0BB4541F-9B1A-4CBC-BEB1-00B31B37F74E}.Release|Any CPU.Build.0 = Release|Any CPU {EF08F249-31A1-4E62-8391-ECBA5227B686}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EF08F249-31A1-4E62-8391-ECBA5227B686}.Debug|Any CPU.Build.0 = Debug|Any CPU {EF08F249-31A1-4E62-8391-ECBA5227B686}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/msvc/scripts/order.xml b/msvc/scripts/order.xml index 587a99b1c46..bf815da41c7 100644 --- a/msvc/scripts/order.xml +++ b/msvc/scripts/order.xml @@ -2,7 +2,7 @@ - /codepage:65001 -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -d:DISABLE_CAS_USE -lib:./../class/lib/basic -optimize /noconfig -r:System -r:System.Core -r:System.Xml + /codepage:65001 -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_PROCESS_START -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -d:DISABLE_CAS_USE -lib:./../class/lib/basic -optimize /noconfig -r:System -r:System.Core -r:System.Xml basic.exe ./../class/lib/basic/basic.exe @@ -12,7 +12,7 @@ true - /codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -d:DISABLE_CAS_USE -lib:./../../class/lib/basic -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4 + /codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -d:DISABLE_CAS_USE -lib:./../../class/lib/basic -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4 mscorlib.dll ./../../class/lib/basic/mscorlib.dll @@ -22,7 +22,7 @@ true - /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -d:DISABLE_CAS_USE -lib:./../../class/lib/basic -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=./../../class/lib/basic/secxml/System.dll -r:System.Configuration.dll -d:CONFIGURATION_DEP -r:System.Xml -r:MonoSecurity=Mono.Security + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -d:DISABLE_CAS_USE -lib:./../../class/lib/basic -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=./../../class/lib/basic/secxml/System.dll -d:MONO_SECURITY_ALIAS -d:MONO_X509_ALIAS -r:System.Configuration.dll -d:CONFIGURATION_DEP -r:System.Xml -r:MonoSecurity=Mono.Security System.dll ./../../class/lib/basic/System.dll @@ -42,7 +42,7 @@ true - /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -d:DISABLE_CAS_USE -lib:./../../class/lib/basic -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=./../../class/lib/basic/secxml/System.dll -r:System.Configuration.dll -d:CONFIGURATION_DEP -r:System.Xml -r:MonoSecurity=Mono.Security + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -d:DISABLE_CAS_USE -lib:./../../class/lib/basic -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=./../../class/lib/basic/secxml/System.dll -d:MONO_SECURITY_ALIAS -d:MONO_X509_ALIAS -r:System.Configuration.dll -d:CONFIGURATION_DEP -r:System.Xml -r:MonoSecurity=Mono.Security System.dll ./../../class/lib/basic/System.dll @@ -72,7 +72,7 @@ true - /codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/build -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4 + /codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/build -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4 mscorlib.dll ./../../class/lib/build/mscorlib.dll @@ -82,7 +82,7 @@ false - /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/build -r:mscorlib.dll -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=./../../class/lib/build/secxml/System.dll -r:System.Configuration.dll -d:CONFIGURATION_DEP -r:System.Xml -r:MonoSecurity=Mono.Security + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/build -r:mscorlib.dll -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=./../../class/lib/build/secxml/System.dll -d:MONO_SECURITY_ALIAS -d:MONO_X509_ALIAS -r:System.Configuration.dll -d:CONFIGURATION_DEP -r:System.Xml -r:MonoSecurity=Mono.Security System.dll ./../../class/lib/build/System.dll @@ -92,7 +92,7 @@ false - /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/build -r:mscorlib.dll -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/build -r:mscorlib.dll -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav System.dll ./../../class/lib/build/bare/System.dll @@ -102,7 +102,7 @@ false - /codepage:65001 -lib:./../../class/lib/build/bare -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/build -r:mscorlib.dll -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=./../../class/lib/build/bare/System.dll -r:System.Xml -r:MonoSecurity=Mono.Security + /codepage:65001 -lib:./../../class/lib/build/bare -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/build -r:mscorlib.dll -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=./../../class/lib/build/bare/System.dll -d:MONO_SECURITY_ALIAS -d:MONO_X509_ALIAS -r:System.Xml -r:MonoSecurity=Mono.Security System.dll ./../../class/lib/build/secxml/System.dll @@ -132,7 +132,7 @@ false - /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/build -r:mscorlib.dll -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=./../../class/lib/build/secxml/System.dll -r:System.Configuration.dll -d:CONFIGURATION_DEP -r:System.Xml -r:MonoSecurity=Mono.Security + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/build -r:mscorlib.dll -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=./../../class/lib/build/secxml/System.dll -d:MONO_SECURITY_ALIAS -d:MONO_X509_ALIAS -r:System.Configuration.dll -d:CONFIGURATION_DEP -r:System.Xml -r:MonoSecurity=Mono.Security System.dll ./../../class/lib/build/System.dll @@ -142,7 +142,7 @@ false - /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/build -r:mscorlib.dll -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/build -r:mscorlib.dll -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav System.dll ./../../class/lib/build/bare/System.dll @@ -152,7 +152,7 @@ false - /codepage:65001 -lib:./../../class/lib/build/bare -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/build -r:mscorlib.dll -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=./../../class/lib/build/bare/System.dll -r:System.Xml -r:MonoSecurity=Mono.Security + /codepage:65001 -lib:./../../class/lib/build/bare -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/build -r:mscorlib.dll -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=./../../class/lib/build/bare/System.dll -d:MONO_SECURITY_ALIAS -d:MONO_X509_ALIAS -r:System.Xml -r:MonoSecurity=Mono.Security System.dll ./../../class/lib/build/secxml/System.dll @@ -202,7 +202,7 @@ - /codepage:65001 -lib:./../class/lib/build -debug -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../class/lib/build -r:mscorlib.dll -optimize /noconfig -r:System -r:System.Core -r:System.Xml + /codepage:65001 -lib:./../class/lib/build -debug -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_PROCESS_START -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../class/lib/build -r:mscorlib.dll -optimize /noconfig -r:System -r:System.Core -r:System.Xml mcs.exe mcs.exe @@ -232,7 +232,7 @@ - /codepage:65001 -lib:./../class/lib/build -debug -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig -r:System -r:System.Core -r:System.Xml + /codepage:65001 -lib:./../class/lib/build -debug -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_PROCESS_START -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig -r:System -r:System.Core -r:System.Xml mcs.exe mcs.exe @@ -242,7 +242,7 @@ true - /codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -debug -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4 + /codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -debug -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4 mscorlib.dll ./../../class/lib/net_4_x/mscorlib.dll @@ -252,7 +252,7 @@ false - /codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -debug -optimize -r:./../../class/lib/net_4_x/mscorlib.dll -debug -nowarn:168,219,618,672 -unsafe -r:Mono.Posix.dll -r:System.Core.dll -define:MONO_DATACONVERTER_STATIC_METHODS -resource:Test/resources/Resources.resources + /codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -debug -optimize -r:./../../class/lib/net_4_x/mscorlib.dll -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -debug -nowarn:168,219,618,672 -unsafe -r:Mono.Posix.dll -r:System.Core.dll -define:MONO_DATACONVERTER_STATIC_METHODS -resource:Test/resources/Resources.resources corlib_test_net_4_x.dll corlib_test_net_4_x.dll @@ -262,7 +262,7 @@ false - /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=./../../class/lib/net_4_x/secxml/System.dll -r:System.Configuration.dll -d:CONFIGURATION_DEP -r:System.Xml -r:MonoSecurity=Mono.Security + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=./../../class/lib/net_4_x/secxml/System.dll -d:MONO_SECURITY_ALIAS -d:MONO_X509_ALIAS -r:System.Configuration.dll -d:CONFIGURATION_DEP -r:System.Xml -r:MonoSecurity=Mono.Security System.dll ./../../class/lib/net_4_x/System.dll @@ -272,7 +272,7 @@ false - /codepage:65001 -lib:./../../class/lib/net_4_x/bare -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize -r:./../../class/lib/net_4_x/secxml/System.dll -r:System.Drawing.dll -r:Mono.Security.dll -r:System.Data -r:System.Xml.dll -r:System.Core.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -r:System.Configuration + /codepage:65001 -lib:./../../class/lib/net_4_x/bare -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize -r:./../../class/lib/net_4_x/secxml/System.dll -r:System.Drawing.dll -r:Mono.Security.dll -r:System.Data -r:System.Xml.dll -r:System.Core.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -d:MONO_FEATURE_PROCESS_START -r:System.Configuration -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME System_test_net_4_x.dll System_test_net_4_x.dll @@ -282,7 +282,7 @@ false - /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav System.dll ./../../class/lib/net_4_x/bare/System.dll @@ -292,7 +292,7 @@ false - /codepage:65001 -lib:./../../class/lib/net_4_x/bare -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize -r:./../../class/lib/net_4_x/secxml/System.dll -r:System.Drawing.dll -r:Mono.Security.dll -r:System.Data -r:System.Xml.dll -r:System.Core.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -r:System.Configuration + /codepage:65001 -lib:./../../class/lib/net_4_x/bare -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize -r:./../../class/lib/net_4_x/secxml/System.dll -r:System.Drawing.dll -r:Mono.Security.dll -r:System.Data -r:System.Xml.dll -r:System.Core.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -d:MONO_FEATURE_PROCESS_START -r:System.Configuration -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME System_test_net_4_x.dll System_test_net_4_x.dll @@ -302,7 +302,7 @@ false - /codepage:65001 -lib:./../../class/lib/net_4_x/bare -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=./../../class/lib/net_4_x/bare/System.dll -r:System.Xml -r:MonoSecurity=Mono.Security + /codepage:65001 -lib:./../../class/lib/net_4_x/bare -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=./../../class/lib/net_4_x/bare/System.dll -d:MONO_SECURITY_ALIAS -d:MONO_X509_ALIAS -r:System.Xml -r:MonoSecurity=Mono.Security System.dll ./../../class/lib/net_4_x/secxml/System.dll @@ -312,7 +312,7 @@ false - /codepage:65001 -lib:./../../class/lib/net_4_x/bare -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize -r:./../../class/lib/net_4_x/secxml/System.dll -r:System.Drawing.dll -r:Mono.Security.dll -r:System.Data -r:System.Xml.dll -r:System.Core.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -r:System.Configuration + /codepage:65001 -lib:./../../class/lib/net_4_x/bare -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize -r:./../../class/lib/net_4_x/secxml/System.dll -r:System.Drawing.dll -r:Mono.Security.dll -r:System.Data -r:System.Xml.dll -r:System.Core.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -d:MONO_FEATURE_PROCESS_START -r:System.Configuration -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME System_test_net_4_x.dll System_test_net_4_x.dll @@ -500,6 +500,46 @@ net_4_x resgen.exe.sources + + false + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig /unsafe -r:System -r:System.Core + System.IO.Compression.dll + + ./../../class/lib/net_4_x/System.IO.Compression.dll + 4.5 + net_4_x + System.IO.Compression.dll.sources + + + false + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize -r:./../../class/lib/net_4_x/System.IO.Compression.dll /r:System /r:System.Core + System.IO.Compression_test_net_4_x.dll + + System.IO.Compression_test_net_4_x.dll + 4.5 + net_4_x + ./../../build/deps/System.IO.Compression_test_net_4_x.dll.response + + + false + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig -r:System -r:System.IO.Compression + System.IO.Compression.FileSystem.dll + + ./../../class/lib/net_4_x/System.IO.Compression.FileSystem.dll + 4.5 + net_4_x + System.IO.Compression.FileSystem.dll.sources + + + false + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize -r:./../../class/lib/net_4_x/System.IO.Compression.FileSystem.dll /r:System /r:System.Core /r:System.IO.Compression.dll + System.IO.Compression.FileSystem_test_net_4_x.dll + + System.IO.Compression.FileSystem_test_net_4_x.dll + 4.5 + net_4_x + ./../../build/deps/System.IO.Compression.FileSystem_test_net_4_x.dll.response + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig /unsafe /r:mscorlib.dll -resource:Assembly/Mono.ico,Mono.ico -resource:Assembly/Information.ico,Information.ico -resource:Assembly/Error.ico,Error.ico -resource:Assembly/Warning.ico,Warning.ico -resource:Assembly/Question.ico,Question.ico -resource:Assembly/Shield.ico,Shield.ico -r:System @@ -822,7 +862,7 @@ false - /codepage:65001 -lib:./../../class/lib/net_4_x/plainweb -lib:./../../class/lib/net_4_x/plaindesign -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize -r:./../../class/lib/net_4_x/System.Web.Services.dll -nowarn:168,169,219,414,612,649 -d:MONO_BROKEN_CONFIGURATION_DLL -resource:System.Web.Services.Description/wsdl-1.1.xsd,wsdl-1.1.xsd -resource:System.Web.Services.Description/wsdl-1.1-soap.xsd,wsdl-1.1-soap.xsd -resource:System.Web.Services.Description/web-reference.xsd,web-reference.xsd -r:System -r:System.EnterpriseServices -r:System.Xml -r:System.Data -r:System.Web -r:System.Design -r:System.DirectoryServices -r:System.Configuration -nowarn:618 + /codepage:65001 -lib:./../../class/lib/net_4_x/plainweb -lib:./../../class/lib/net_4_x/plaindesign -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize -r:./../../class/lib/net_4_x/System.Web.Services.dll -nowarn:168,169,219,414,612,649 -d:MONO_BROKEN_CONFIGURATION_DLL -resource:System.Web.Services.Description/wsdl-1.1.xsd,wsdl-1.1.xsd -resource:System.Web.Services.Description/wsdl-1.1-soap.xsd,wsdl-1.1-soap.xsd -resource:System.Web.Services.Description/web-reference.xsd,web-reference.xsd -r:System -r:System.EnterpriseServices -r:System.Xml -r:System.Data -r:System.Web -r:System.Design -r:System.DirectoryServices -r:System.Configuration -nowarn:618 -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME System.Web.Services_test_net_4_x.dll System.Web.Services_test_net_4_x.dll @@ -1282,7 +1322,7 @@ false - /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize -r:./../../class/lib/net_4_x/System.Web.Extensions.dll -unsafe -define:NET_3_5 -define:SYSTEM_WEB_EXTENSIONS -r:mscorlib.dll -r:System.Web.ApplicationServices.dll /resource:../MicrosoftAjaxLibrary/System.Web.Extensions/3.5.0.0/3.5.21022.8/MicrosoftAjax.debug.js /resource:../MicrosoftAjaxLibrary/System.Web.Extensions/3.5.0.0/3.5.21022.8/MicrosoftAjax.js /resource:../MicrosoftAjaxLibrary/System.Web.Extensions/3.5.0.0/3.5.21022.8/MicrosoftAjaxTimer.debug.js /resource:../MicrosoftAjaxLibrary/System.Web.Extensions/3.5.0.0/3.5.21022.8/MicrosoftAjaxTimer.js /resource:../MicrosoftAjaxLibrary/System.Web.Extensions/3.5.0.0/3.5.21022.8/MicrosoftAjaxWebForms.debug.js /resource:../MicrosoftAjaxLibrary/System.Web.Extensions/3.5.0.0/3.5.21022.8/MicrosoftAjaxWebForms.js -r:System -r:System.Core -r:System.Drawing -r:System.Data -r:System.Data.Linq -r:System.Xml -r:System.Web -r:System.Web.Services -r:System.Configuration -r:System.EnterpriseServices -r:System.ServiceModel -doc:System.Web.Extensions_test_net_4_x.xml -nowarn:219,169,1591 /resource:Test/resources/Web.mono.config /resource:Test/resources/profile.config.4.x /resource:Test/resources/ListViewSort.aspx /resource:Test/resources/ListViewTest.aspx /resource:Test/resources/ListViewTotalRowCount_Bug535701_1.aspx /resource:Test/resources/ListViewTotalRowCount_Bug535701_2.aspx /resource:Test/resources/ListViewTotalRowCount_Bug604053.aspx /resource:../System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPage.aspx.cs /resource:../System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/Global.asax /resource:../System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/My.ashx /resource:../System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPage.aspx /resource:../System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPageWithDerivedMaster.aspx /resource:../System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPageWithMaster.aspx /resource:../System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPageWithMasterInvalidPlaceHolder.aspx /resource:../System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/My.master /resource:../System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/MyDerived.master -r:SystemWebTestShim.dll -define:SYSTEM_WEB_EXTENSIONS + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize -r:./../../class/lib/net_4_x/System.Web.Extensions.dll -unsafe -define:NET_3_5 -define:SYSTEM_WEB_EXTENSIONS -r:mscorlib.dll -r:System.Web.ApplicationServices.dll /resource:../MicrosoftAjaxLibrary/System.Web.Extensions/3.5.0.0/3.5.21022.8/MicrosoftAjax.debug.js /resource:../MicrosoftAjaxLibrary/System.Web.Extensions/3.5.0.0/3.5.21022.8/MicrosoftAjax.js /resource:../MicrosoftAjaxLibrary/System.Web.Extensions/3.5.0.0/3.5.21022.8/MicrosoftAjaxTimer.debug.js /resource:../MicrosoftAjaxLibrary/System.Web.Extensions/3.5.0.0/3.5.21022.8/MicrosoftAjaxTimer.js /resource:../MicrosoftAjaxLibrary/System.Web.Extensions/3.5.0.0/3.5.21022.8/MicrosoftAjaxWebForms.debug.js /resource:../MicrosoftAjaxLibrary/System.Web.Extensions/3.5.0.0/3.5.21022.8/MicrosoftAjaxWebForms.js -r:System -r:System.Core -r:System.Drawing -r:System.Data -r:System.Data.Linq -r:System.Xml -r:System.Web -r:System.Web.Services -r:System.Configuration -r:System.EnterpriseServices -r:System.ServiceModel -doc:System.Web.Extensions_test_net_4_x.xml -nowarn:219,169,1591 /resource:Test/resources/Web.mono.config /resource:Test/resources/profile.config.4.x /resource:Test/resources/ListViewSort.aspx /resource:Test/resources/ListViewTest.aspx /resource:Test/resources/ListViewTotalRowCount_Bug535701_1.aspx /resource:Test/resources/ListViewTotalRowCount_Bug535701_2.aspx /resource:Test/resources/ListViewTotalRowCount_Bug604053.aspx /resource:../System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPage.aspx.cs /resource:../System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/Global.asax /resource:../System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/My.ashx /resource:../System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPage.aspx /resource:../System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPageWithDerivedMaster.aspx /resource:../System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPageWithMaster.aspx /resource:../System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPageWithMasterInvalidPlaceHolder.aspx /resource:../System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/MyDerived.master /resource:../System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/My.master -r:SystemWebTestShim.dll -define:SYSTEM_WEB_EXTENSIONS System.Web.Extensions_test_net_4_x.dll System.Web.Extensions_test_net_4_x.dll @@ -1322,7 +1362,7 @@ false - /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig -r:System.Core -r:System.Xml -r:System + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig -d:MONO_FEATURE_THREAD_ABORT -r:System.Core -r:System.Xml -r:System Mono.CSharp.dll ./../../class/lib/net_4_x/Mono.CSharp.dll @@ -2292,7 +2332,7 @@ false - /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig -r:System.Core -r:System -r:mscorlib.dll + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig -r:System.Core -r:System -r:mscorlib.dll -d:CONCURRENT_COLLECTIONS System.Threading.Tasks.Dataflow.dll ./../../class/lib/net_4_x/System.Threading.Tasks.Dataflow.dll @@ -2320,65 +2360,55 @@ net_4_x System.ComponentModel.Composition.dll.sources - - false - /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig /unsafe -r:System -r:System.Core - System.IO.Compression.dll - - ./../../class/lib/net_4_x/System.IO.Compression.dll - 4.5 - net_4_x - System.IO.Compression.dll.sources - - + false - /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize -r:./../../class/lib/net_4_x/System.IO.Compression.dll /r:System /r:System.Core - System.IO.Compression_test_net_4_x.dll + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig -r:System + System.Windows.dll - System.IO.Compression_test_net_4_x.dll + ./../../class/lib/net_4_x/System.Windows.dll 4.5 net_4_x - ./../../build/deps/System.IO.Compression_test_net_4_x.dll.response + System.Windows.dll.sources - + false - /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig -r:System -r:System.IO.Compression - System.IO.Compression.FileSystem.dll + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig -r:System.Xml -r:System.ServiceModel + System.Xml.Serialization.dll - ./../../class/lib/net_4_x/System.IO.Compression.FileSystem.dll + ./../../class/lib/net_4_x/System.Xml.Serialization.dll 4.5 net_4_x - System.IO.Compression.FileSystem.dll.sources + System.Xml.Serialization.dll.sources - + false - /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize -r:./../../class/lib/net_4_x/System.IO.Compression.FileSystem.dll /r:System /r:System.Core /r:System.IO.Compression.dll - System.IO.Compression.FileSystem_test_net_4_x.dll + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -r:System -r:Mono.Security + Mono.Security.Providers.DotNet.dll - System.IO.Compression.FileSystem_test_net_4_x.dll + ./../../class/lib/net_4_x/Mono.Security.Providers.DotNet.dll 4.5 net_4_x - ./../../build/deps/System.IO.Compression.FileSystem_test_net_4_x.dll.response + Mono.Security.Providers.DotNet.dll.sources - + false - /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig -r:System - System.Windows.dll + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -d:SECURITY_DEP -r:System -r:Mono.Security + Mono.Security.Providers.OldTls.dll - ./../../class/lib/net_4_x/System.Windows.dll + ./../../class/lib/net_4_x/Mono.Security.Providers.OldTls.dll 4.5 net_4_x - System.Windows.dll.sources + Mono.Security.Providers.OldTls.dll.sources - + false - /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig -r:System.Xml -r:System.ServiceModel - System.Xml.Serialization.dll + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig -d:SECURITY_DEP -d:MONO_SECURITY_ALIAS -r:MonoSecurity=Mono.Security -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -d:MONO -d:FEATURE_PAL -d:MONO_FEATURE_NEW_TLS -d:MONO_FEATURE_NEW_SYSTEM_SOURCE -d:DISABLE_CAS_USE -r:System + Mono.Security.Providers.NewSystemSource.dll - ./../../class/lib/net_4_x/System.Xml.Serialization.dll + ./../../class/lib/net_4_x/Mono.Security.Providers.NewSystemSource.dll 4.5 net_4_x - System.Xml.Serialization.dll.sources + Mono.Security.Providers.NewSystemSource.dll.sources false @@ -2440,7 +2470,7 @@ net_4_x ./../../build/deps/monodoc_test_net_4_x.dll.response - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Collections.Concurrent.dll @@ -2450,7 +2480,7 @@ net_4_x System.Collections.Concurrent.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System -r:System.Core System.Collections.dll @@ -2460,7 +2490,7 @@ net_4_x System.Collections.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System.ComponentModel.DataAnnotations System.ComponentModel.Annotations.dll @@ -2470,7 +2500,7 @@ net_4_x System.ComponentModel.Annotations.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.ComponentModel.EventBasedAsync.dll @@ -2480,7 +2510,7 @@ net_4_x System.ComponentModel.EventBasedAsync.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.ComponentModel.dll @@ -2490,7 +2520,7 @@ net_4_x System.ComponentModel.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib System.Diagnostics.Contracts.dll @@ -2500,7 +2530,7 @@ net_4_x System.Diagnostics.Contracts.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Diagnostics.Debug.dll @@ -2510,7 +2540,7 @@ net_4_x System.Diagnostics.Debug.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib System.Diagnostics.Tracing.dll @@ -2520,7 +2550,7 @@ net_4_x System.Diagnostics.Tracing.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Diagnostics.Tools.dll @@ -2530,7 +2560,7 @@ net_4_x System.Diagnostics.Tools.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System.Core -r:System System.Dynamic.Runtime.dll @@ -2540,7 +2570,7 @@ net_4_x System.Dynamic.Runtime.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib System.Globalization.dll @@ -2550,7 +2580,7 @@ net_4_x System.Globalization.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.IO.dll @@ -2560,7 +2590,7 @@ net_4_x System.IO.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System.Core System.Linq.Expressions.dll @@ -2570,7 +2600,7 @@ net_4_x System.Linq.Expressions.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System.Core System.Linq.Parallel.dll @@ -2580,7 +2610,7 @@ net_4_x System.Linq.Parallel.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System.Core System.Linq.Queryable.dll @@ -2590,7 +2620,7 @@ net_4_x System.Linq.Queryable.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System.Core System.Linq.dll @@ -2600,7 +2630,7 @@ net_4_x System.Linq.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Net.NetworkInformation.dll @@ -2610,7 +2640,7 @@ net_4_x System.Net.NetworkInformation.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Net.Primitives.dll @@ -2620,7 +2650,7 @@ net_4_x System.Net.Primitives.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Net.Requests.dll @@ -2630,7 +2660,7 @@ net_4_x System.Net.Requests.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.ObjectModel.dll @@ -2640,7 +2670,7 @@ net_4_x System.ObjectModel.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib System.Reflection.Extensions.dll @@ -2650,7 +2680,7 @@ net_4_x System.Reflection.Extensions.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib System.Reflection.Primitives.dll @@ -2660,7 +2690,7 @@ net_4_x System.Reflection.Primitives.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib System.Reflection.dll @@ -2670,7 +2700,7 @@ net_4_x System.Reflection.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib System.Resources.ResourceManager.dll @@ -2680,7 +2710,7 @@ net_4_x System.Resources.ResourceManager.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Runtime.Extensions.dll @@ -2690,7 +2720,7 @@ net_4_x System.Runtime.Extensions.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System -r:System.Core System.Runtime.InteropServices.dll @@ -2700,7 +2730,7 @@ net_4_x System.Runtime.InteropServices.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib System.Runtime.InteropServices.WindowsRuntime.dll @@ -2710,7 +2740,7 @@ net_4_x System.Runtime.InteropServices.WindowsRuntime.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System.Numerics System.Runtime.Numerics.dll @@ -2720,7 +2750,7 @@ net_4_x System.Runtime.Numerics.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System.Runtime.Serialization System.Runtime.Serialization.Json.dll @@ -2730,7 +2760,7 @@ net_4_x System.Runtime.Serialization.Json.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System.Runtime.Serialization System.Runtime.Serialization.Primitives.dll @@ -2740,7 +2770,7 @@ net_4_x System.Runtime.Serialization.Primitives.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System.Runtime.Serialization -r:System.Xml System.Runtime.Serialization.Xml.dll @@ -2750,7 +2780,7 @@ net_4_x System.Runtime.Serialization.Xml.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System -r:System.ComponentModel.Composition -r:System.Core System.Runtime.dll @@ -2760,7 +2790,7 @@ net_4_x System.Runtime.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib System.Security.Principal.dll @@ -2770,7 +2800,7 @@ net_4_x System.Security.Principal.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System.ServiceModel System.ServiceModel.Http.dll @@ -2780,7 +2810,7 @@ net_4_x System.ServiceModel.Http.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System.ServiceModel -r:System.Xml System.ServiceModel.Primitives.dll @@ -2790,7 +2820,7 @@ net_4_x System.ServiceModel.Primitives.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System.ServiceModel System.ServiceModel.Security.dll @@ -2800,7 +2830,7 @@ net_4_x System.ServiceModel.Security.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib System.Text.Encoding.Extensions.dll @@ -2810,7 +2840,7 @@ net_4_x System.Text.Encoding.Extensions.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib System.Text.Encoding.dll @@ -2820,7 +2850,7 @@ net_4_x System.Text.Encoding.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Text.RegularExpressions.dll @@ -2830,7 +2860,7 @@ net_4_x System.Text.RegularExpressions.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib System.Threading.Tasks.Parallel.dll @@ -2840,7 +2870,7 @@ net_4_x System.Threading.Tasks.Parallel.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System.Core System.Threading.Tasks.dll @@ -2850,7 +2880,7 @@ net_4_x System.Threading.Tasks.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System -r:System.Core System.Threading.Timer.dll @@ -2860,7 +2890,7 @@ net_4_x System.Threading.Timer.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System -r:System.Core System.Threading.dll @@ -2870,7 +2900,7 @@ net_4_x System.Threading.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System.Xml System.Xml.ReaderWriter.dll @@ -2880,7 +2910,7 @@ net_4_x System.Xml.ReaderWriter.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System.Xml.Linq -r:System.Xml System.Xml.XDocument.dll @@ -2890,7 +2920,7 @@ net_4_x System.Xml.XDocument.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System.Xml System.Xml.XmlSerializer.dll @@ -2900,7 +2930,7 @@ net_4_x System.Xml.XmlSerializer.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System -r:System.Core System.Runtime.Handles.dll @@ -2910,7 +2940,7 @@ net_4_x System.Runtime.Handles.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System.ServiceModel System.ServiceModel.Duplex.dll @@ -2920,7 +2950,7 @@ net_4_x System.ServiceModel.Duplex.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System.ServiceModel System.ServiceModel.NetTcp.dll @@ -2930,7 +2960,7 @@ net_4_x System.ServiceModel.NetTcp.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System Microsoft.Win32.Primitives.dll @@ -2940,7 +2970,7 @@ net_4_x Microsoft.Win32.Primitives.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System Microsoft.Win32.Registry.dll @@ -2950,7 +2980,7 @@ net_4_x Microsoft.Win32.Registry.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.AppContext.dll @@ -2960,7 +2990,7 @@ net_4_x System.AppContext.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Collections.NonGeneric.dll @@ -2970,7 +3000,7 @@ net_4_x System.Collections.NonGeneric.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Collections.Specialized.dll @@ -2980,7 +3010,7 @@ net_4_x System.Collections.Specialized.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.ComponentModel.Primitives.dll @@ -2990,7 +3020,7 @@ net_4_x System.ComponentModel.Primitives.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.ComponentModel.TypeConverter.dll @@ -3000,7 +3030,7 @@ net_4_x System.ComponentModel.TypeConverter.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Console.dll @@ -3010,7 +3040,7 @@ net_4_x System.Console.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib /r:System.Data.dll -r:System System.Data.Common.dll @@ -3020,7 +3050,7 @@ net_4_x System.Data.Common.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib /r:System.Data.dll /r:System.Xml.dll -r:System System.Data.SqlClient.dll @@ -3030,7 +3060,7 @@ net_4_x System.Data.SqlClient.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Diagnostics.FileVersionInfo.dll @@ -3040,7 +3070,7 @@ net_4_x System.Diagnostics.FileVersionInfo.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Diagnostics.Process.dll @@ -3050,7 +3080,7 @@ net_4_x System.Diagnostics.Process.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Diagnostics.TextWriterTraceListener.dll @@ -3060,7 +3090,7 @@ net_4_x System.Diagnostics.TextWriterTraceListener.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Diagnostics.TraceEvent.dll @@ -3070,7 +3100,7 @@ net_4_x System.Diagnostics.TraceEvent.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Diagnostics.TraceSource.dll @@ -3080,7 +3110,7 @@ net_4_x System.Diagnostics.TraceSource.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Globalization.Calendars.dll @@ -3090,17 +3120,7 @@ net_4_x System.Globalization.Calendars.dll.sources - - false - /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib /r:System.IO.Compression.dll -r:System - System.IO.Compression.dll - - ./../../../class/lib/net_4_x/Facades/System.IO.Compression.dll - 4.5 - net_4_x - System.IO.Compression.dll.sources - - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib /r:System.IO.Compression.FileSystem.dll -r:System System.IO.Compression.ZipFile.dll @@ -3110,7 +3130,7 @@ net_4_x System.IO.Compression.ZipFile.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.IO.FileSystem.dll @@ -3120,7 +3140,7 @@ net_4_x System.IO.FileSystem.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.IO.FileSystem.DriveInfo.dll @@ -3130,7 +3150,7 @@ net_4_x System.IO.FileSystem.DriveInfo.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.IO.FileSystem.Primitives.dll @@ -3140,7 +3160,7 @@ net_4_x System.IO.FileSystem.Primitives.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.IO.IsolatedStorage.dll @@ -3150,7 +3170,7 @@ net_4_x System.IO.IsolatedStorage.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib /r:System.Core.dll -r:System System.IO.MemoryMappedFiles.dll @@ -3160,7 +3180,7 @@ net_4_x System.IO.MemoryMappedFiles.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.IO.UnmanagedMemoryStream.dll @@ -3170,7 +3190,7 @@ net_4_x System.IO.UnmanagedMemoryStream.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Net.AuthenticationManager.dll @@ -3180,7 +3200,7 @@ net_4_x System.Net.AuthenticationManager.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Net.Cache.dll @@ -3190,7 +3210,7 @@ net_4_x System.Net.Cache.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib /r:System.dll -r:System System.Net.HttpListener.dll @@ -3200,7 +3220,7 @@ net_4_x System.Net.HttpListener.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib /r:System.dll -r:System System.Net.Mail.dll @@ -3210,7 +3230,7 @@ net_4_x System.Net.Mail.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Net.NameResolution.dll @@ -3220,7 +3240,7 @@ net_4_x System.Net.NameResolution.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib /r:System.dll -r:System System.Net.Security.dll @@ -3230,7 +3250,7 @@ net_4_x System.Net.Security.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Net.ServicePoint.dll @@ -3240,7 +3260,7 @@ net_4_x System.Net.ServicePoint.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib /r:System.dll -r:System System.Net.Sockets.dll @@ -3250,7 +3270,7 @@ net_4_x System.Net.Sockets.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Net.Utilities.dll @@ -3260,7 +3280,7 @@ net_4_x System.Net.Utilities.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Net.WebHeaderCollection.dll @@ -3270,7 +3290,7 @@ net_4_x System.Net.WebHeaderCollection.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Net.WebSockets.dll @@ -3280,7 +3300,7 @@ net_4_x System.Net.WebSockets.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Net.WebSockets.Client.dll @@ -3290,7 +3310,7 @@ net_4_x System.Net.WebSockets.Client.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Resources.ReaderWriter.dll @@ -3300,7 +3320,7 @@ net_4_x System.Resources.ReaderWriter.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Runtime.CompilerServices.VisualC.dll @@ -3310,7 +3330,7 @@ net_4_x System.Runtime.CompilerServices.VisualC.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Security.AccessControl.dll @@ -3320,7 +3340,7 @@ net_4_x System.Security.AccessControl.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Security.Claims.dll @@ -3330,7 +3350,7 @@ net_4_x System.Security.Claims.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Security.Cryptography.DeriveBytes.dll @@ -3340,7 +3360,7 @@ net_4_x System.Security.Cryptography.DeriveBytes.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Security.Cryptography.Encoding.dll @@ -3350,7 +3370,7 @@ net_4_x System.Security.Cryptography.Encoding.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Security.Cryptography.Encryption.dll @@ -3360,7 +3380,7 @@ net_4_x System.Security.Cryptography.Encryption.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Security.Cryptography.Encryption.Aes.dll @@ -3370,7 +3390,7 @@ net_4_x System.Security.Cryptography.Encryption.Aes.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib /r:System.Core.dll -r:System System.Security.Cryptography.Encryption.ECDiffieHellman.dll @@ -3380,7 +3400,7 @@ net_4_x System.Security.Cryptography.Encryption.ECDiffieHellman.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib /r:System.Core.dll -r:System System.Security.Cryptography.Encryption.ECDsa.dll @@ -3390,7 +3410,7 @@ net_4_x System.Security.Cryptography.Encryption.ECDsa.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Security.Cryptography.Hashing.dll @@ -3400,7 +3420,7 @@ net_4_x System.Security.Cryptography.Hashing.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Security.Cryptography.Hashing.Algorithms.dll @@ -3410,7 +3430,7 @@ net_4_x System.Security.Cryptography.Hashing.Algorithms.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Security.Cryptography.RSA.dll @@ -3420,7 +3440,7 @@ net_4_x System.Security.Cryptography.RSA.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Security.Cryptography.RandomNumberGenerator.dll @@ -3430,7 +3450,7 @@ net_4_x System.Security.Cryptography.RandomNumberGenerator.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Security.Cryptography.X509Certificates.dll @@ -3440,7 +3460,7 @@ net_4_x System.Security.Cryptography.X509Certificates.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Security.Principal.Windows.dll @@ -3450,7 +3470,7 @@ net_4_x System.Security.Principal.Windows.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Threading.Thread.dll @@ -3460,7 +3480,7 @@ net_4_x System.Threading.Thread.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Threading.ThreadPool.dll @@ -3470,7 +3490,7 @@ net_4_x System.Threading.ThreadPool.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib /r:System.Xml.dll -r:System System.Xml.XPath.dll @@ -3480,7 +3500,7 @@ net_4_x System.Xml.XPath.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib /r:System.Xml.dll -r:System System.Xml.XmlDocument.dll @@ -3490,7 +3510,7 @@ net_4_x System.Xml.XmlDocument.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib /r:System.Xml.dll -r:System System.Xml.Xsl.Primitives.dll @@ -3500,7 +3520,7 @@ net_4_x System.Xml.Xsl.Primitives.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System Microsoft.Win32.Registry.AccessControl.dll @@ -3510,7 +3530,7 @@ net_4_x Microsoft.Win32.Registry.AccessControl.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Diagnostics.StackTrace.dll @@ -3520,7 +3540,7 @@ net_4_x System.Diagnostics.StackTrace.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Globalization.Extensions.dll @@ -3530,7 +3550,7 @@ net_4_x System.Globalization.Extensions.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.IO.FileSystem.AccessControl.dll @@ -3540,7 +3560,7 @@ net_4_x System.IO.FileSystem.AccessControl.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Private.CoreLib.InteropServices.dll @@ -3550,7 +3570,7 @@ net_4_x System.Private.CoreLib.InteropServices.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Private.CoreLib.Threading.dll @@ -3560,7 +3580,7 @@ net_4_x System.Private.CoreLib.Threading.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Reflection.TypeExtensions.dll @@ -3570,7 +3590,7 @@ net_4_x System.Reflection.TypeExtensions.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Security.SecureString.dll @@ -3580,7 +3600,7 @@ net_4_x System.Security.SecureString.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Threading.AccessControl.dll @@ -3590,7 +3610,7 @@ net_4_x System.Threading.AccessControl.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Threading.Overlapped.dll @@ -3600,7 +3620,7 @@ net_4_x System.Threading.Overlapped.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib /r:System.Xml.Linq.dll -r:System System.Xml.XPath.XDocument.dll @@ -3610,7 +3630,7 @@ net_4_x System.Xml.XPath.XDocument.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib System.Reflection.Emit.ILGeneration.dll @@ -3620,7 +3640,7 @@ net_4_x System.Reflection.Emit.ILGeneration.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib System.Reflection.Emit.Lightweight.dll @@ -3630,7 +3650,7 @@ net_4_x System.Reflection.Emit.Lightweight.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib System.Reflection.Emit.dll @@ -3640,7 +3660,7 @@ net_4_x System.Reflection.Emit.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.Diagnostics.PerformanceCounter.dll @@ -3650,7 +3670,7 @@ net_4_x System.Diagnostics.PerformanceCounter.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib -r:System System.IO.FileSystem.Watcher.dll @@ -3660,7 +3680,7 @@ net_4_x System.IO.FileSystem.Watcher.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib /r:System.Core.dll -r:System System.IO.Pipes.dll @@ -3670,7 +3690,7 @@ net_4_x System.IO.Pipes.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib /r:System.Security.dll -r:System System.Security.Cryptography.ProtectedData.dll @@ -3680,7 +3700,7 @@ net_4_x System.Security.Cryptography.ProtectedData.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib /r:System.ServiceProcess.dll -r:System System.ServiceProcess.ServiceController.dll @@ -3690,7 +3710,7 @@ net_4_x System.ServiceProcess.ServiceController.dll.sources - + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../../class/lib/net_4_x -r:mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /r:mscorlib /r:System.Net.Http.WebRequest.dll /r:System.Net.Http.dll -r:System System.Net.Http.WebRequestHandler.dll @@ -4240,6 +4260,16 @@ net_4_x mono-symbolicate.exe.sources + + + /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/net_4_x -r:mscorlib.dll -debug -optimize /noconfig + linkeranalyzer.exe + + ./../../class/lib/net_4_x/linkeranalyzer.exe + 4.5 + net_4_x + linkeranalyzer.exe.sources + false /codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:./../../class/lib/xbuild_12 -r:mscorlib.dll -debug -d:XBUILD_12 -d:MONO -d:DISABLE_CAS_USE -lib:./../../class/lib/net_4_x -optimize /noconfig /r:mscorlib.dll /r:System.dll -r:System diff --git a/msvc/winsetup.bat b/msvc/winsetup.bat index f67a8545693..336778204f2 100755 --- a/msvc/winsetup.bat +++ b/msvc/winsetup.bat @@ -4,6 +4,7 @@ if exist config.h if not exist cygconfig.h copy config.h cygconfig.h if exist eglib\config.h if not exist eglib\cygconfig.h copy eglib\config.h eglib\cygconfig.h copy winconfig.h config.h copy eglib\winconfig.h eglib\config.h +powershell -Command "(Get-Content config.h) -replace '#MONO_VERSION#', (Select-String -path configure.ac -pattern 'AC_INIT\(mono, \[(.*)\]').Matches[0].Groups[1].Value | Set-Content config.h" goto end :error echo fatal error: the VSDepenancies directory was not found in the "mono" directory diff --git a/support/map.h b/support/map.h index 34cdb68ab4d..9f89fcde93b 100644 --- a/support/map.h +++ b/support/map.h @@ -2018,8 +2018,9 @@ struct Mono_Unix_UnixSignal_SignalInfo { int count; int read_fd; int write_fd; - int have_handler; int pipecnt; + int pipelock; + int have_handler; void* handler; }; @@ -2049,6 +2050,7 @@ int Mono_Posix_Stdlib_clearerr (void* stream); void* Mono_Posix_Stdlib_CreateFilePosition (void); int Mono_Posix_Stdlib_DumpFilePosition (char* buf, void* handle, int len); int Mono_Posix_Stdlib_EOF (void); +const char* Mono_Unix_VersionString (void); int Mono_Posix_Stdlib_EXIT_FAILURE (void); int Mono_Posix_Stdlib_EXIT_SUCCESS (void); int Mono_Posix_Stdlib_fgetpos (void* stream, void* pos); diff --git a/support/signal.c b/support/signal.c index 6adf5463878..993e2e21661 100644 --- a/support/signal.c +++ b/support/signal.c @@ -107,23 +107,28 @@ int Mono_Posix_FromRealTimeSignum (int offset, int *r) #ifndef HOST_WIN32 +// Atomicity rules: Fields of signal_info read or written by the signal handler +// (see UnixSignal.cs) should be read and written using atomic functions. +// (For simplicity, we're protecting some things we don't strictly need to.) + +// Because we are in MonoPosixHelper, we are banned from linking mono. +// We can still use atomic.h because that's all inline functions-- +// unless WAPI_NO_ATOMIC_ASM is defined, in which case atomic.h calls linked functions. #ifndef WAPI_NO_ATOMIC_ASM #define mph_int_get(p) InterlockedExchangeAdd ((p), 0) #define mph_int_inc(p) InterlockedIncrement ((p)) #define mph_int_dec_test(p) (InterlockedDecrement ((p)) == 0) - #define mph_int_set(p,o,n) InterlockedExchange ((p), (n)) + #define mph_int_set(p,n) InterlockedExchange ((p), (n)) + // Pointer, original, new + #define mph_int_test_and_set(p,o,n) (o == InterlockedCompareExchange ((p), (n), (o))) #elif GLIB_CHECK_VERSION(2,4,0) #define mph_int_get(p) g_atomic_int_get ((p)) #define mph_int_inc(p) do {g_atomic_int_inc ((p));} while (0) #define mph_int_dec_test(p) g_atomic_int_dec_and_test ((p)) - #define mph_int_set(p,o,n) do { \ - while (!g_atomic_int_compare_and_exchange ((p), (o), (n))) {} \ - } while (0) + #define mph_int_set(p,n) g_atomic_int_set ((p),(n)) + #define mph_int_test_and_set(p,o,n) g_atomic_int_compare_and_exchange ((p), (o), (n)) #else - #define mph_int_get(p) (*(p)) - #define mph_int_inc(p) do { (*(p))++; } while (0) - #define mph_int_dec_test(p) (--(*(p)) == 0) - #define mph_int_set(p,o,n) do { *(p) = n; } while (0) + #error "GLIB 2.4 required because building without ASM atomics" #endif #if HAVE_PSIGNAL @@ -166,6 +171,90 @@ keep_trying (int r) return r == -1 && errno == EINTR; } +// This tiny ad-hoc read/write lock is needed because of the very specific +// synchronization needed between default_handler and teardown_pipes: +// - Many default_handlers can be running at once +// - The signals_mutex already ensures only one teardown_pipes runs at once +// - If teardown_pipes starts while a default_handler is ongoing, it must block +// - If default_handler starts while a teardown_pipes is ongoing, it must *not* block +// Locks are implemented as ints. + +// The lock is split into a teardown bit and a handler count (sign bit unused). +// There is a teardown running or waiting to run if the teardown bit is set. +// There is a handler running if the handler count is nonzero. +#define PIPELOCK_TEARDOWN_BIT ( (int)0x40000000 ) +#define PIPELOCK_COUNT_MASK (~((int)0xC0000000)) +#define PIPELOCK_GET_COUNT(x) ((x) & PIPELOCK_COUNT_MASK) +#define PIPELOCK_INCR_COUNT(x, by) (((x) & PIPELOCK_TEARDOWN_BIT) | (PIPELOCK_GET_COUNT (PIPELOCK_GET_COUNT (x) + (by)))) + +static inline void +acquire_pipelock_teardown (int *lock) +{ + int lockvalue_draining; + // First mark that a teardown is occurring, so handlers will stop entering the lock. + while (1) { + int lockvalue = mph_int_get (lock); + lockvalue_draining = lockvalue | PIPELOCK_TEARDOWN_BIT; + if (mph_int_test_and_set (lock, lockvalue, lockvalue_draining)) + break; + } + // Now wait for all handlers to complete. + while (1) { + if (0 == PIPELOCK_GET_COUNT (lockvalue_draining)) + break; // We now hold the lock. + // Handler is still running, spin until it completes. + sched_yield (); // We can call this because !defined(HOST_WIN32) + lockvalue_draining = mph_int_get (lock); + } +} + +static inline void +release_pipelock_teardown (int *lock) +{ + while (1) { + int lockvalue = mph_int_get (lock); + int lockvalue_new = lockvalue & ~PIPELOCK_TEARDOWN_BIT; + // Technically this can't fail, because we hold both the pipelock and the mutex, but + if (mph_int_test_and_set (lock, lockvalue, lockvalue_new)) + return; + } +} + +// Return 1 for success +static inline int +acquire_pipelock_handler (int *lock) +{ + while (1) { + int lockvalue = mph_int_get (lock); + if (lockvalue & PIPELOCK_TEARDOWN_BIT) // Final lock is being torn down + return 0; + int lockvalue_new = PIPELOCK_INCR_COUNT (lockvalue, 1); + if (mph_int_test_and_set (lock, lockvalue, lockvalue_new)) + return 1; + } +} + +static inline void +release_pipelock_handler (int *lock) +{ + while (1) { + int lockvalue = mph_int_get (lock); + int lockvalue_new = PIPELOCK_INCR_COUNT (lockvalue, -1); + if (mph_int_test_and_set (lock, lockvalue, lockvalue_new)) + return; + } +} + +// This handler is registered once for each UnixSignal object. A pipe is maintained +// for each one; Wait users read at one end of this pipe, and default_handler sends +// a write on the pipe for each signal received while the Wait is ongoing. +// +// Notice a fairly unlikely race condition exists here: Because we synchronize with +// pipe teardown, but not install/uninstall (in other words, we are only trying to +// protect against writing on a closed pipe) it is technically possible a full +// uninstall and then an install could complete after signum is checked but before +// the remaining instructions execute. In this unlikely case count could be +// incremented or a byte written on the wrong signal handler. static void default_handler (int signum) { @@ -175,30 +264,36 @@ default_handler (int signum) signal_info* h = &signals [i]; if (mph_int_get (&h->signum) != signum) continue; + mph_int_inc (&h->count); + + if (!acquire_pipelock_handler (&h->pipelock)) + continue; // Teardown is occurring on this object, no one to send to. + fd = mph_int_get (&h->write_fd); - if (fd > 0) { + if (fd > 0) { // If any listener exists to write to int j,pipecounter; - char c = signum; - pipecounter = mph_int_get (&h->pipecnt); + char c = signum; // (Value is meaningless) + pipecounter = mph_int_get (&h->pipecnt); // Write one byte per pipe listener for (j = 0; j < pipecounter; ++j) { int r; do { r = write (fd, &c, 1); } while (keep_trying (r)); - fsync (fd); /* force */ } } + release_pipelock_handler (&h->pipelock); } } static pthread_mutex_t signals_mutex = PTHREAD_MUTEX_INITIALIZER; +// A UnixSignal object is being constructed void* Mono_Unix_UnixSignal_install (int sig) { #if defined(HAVE_SIGNAL) int i; - signal_info* h = NULL; - int have_handler = 0; + signal_info* h = NULL; // signals[] slot to install to + int have_handler = 0; // Candidates for signal_info handler fields void* handler = NULL; if (acquire_mutex (&signals_mutex) == -1) @@ -212,13 +307,16 @@ Mono_Unix_UnixSignal_install (int sig) if (sinfo.sa_handler != SIG_DFL || (void*)sinfo.sa_sigaction != (void*)SIG_DFL) { pthread_mutex_unlock (&signals_mutex); errno = EADDRINUSE; - return NULL; + return NULL; // This is an rt signal with an existing handler. Bail out. } } #endif /*defined (SIGRTMIN) && defined (SIGRTMAX)*/ + // Scan through signals list looking for (1) an unused spot (2) a usable value for handler for (i = 0; i < NUM_SIGNALS; ++i) { - if (h == NULL && signals [i].signum == 0) { + int just_installed = 0; + // We're still looking for a signal_info spot, and this one is available: + if (h == NULL && mph_int_get (&signals [i].signum) == 0) { h = &signals [i]; h->handler = signal (sig, default_handler); if (h->handler == SIG_ERR) { @@ -227,27 +325,32 @@ Mono_Unix_UnixSignal_install (int sig) break; } else { - h->have_handler = 1; + just_installed = 1; } } - if (!have_handler && signals [i].signum == sig && + // Check if this slot has a "usable" (not installed by this file) handler-to-restore-later: + // (On the first signal to be installed, signals [i] will be == h when this happens.) + if (!have_handler && (just_installed || mph_int_get (&signals [i].signum) == sig) && signals [i].handler != default_handler) { have_handler = 1; handler = signals [i].handler; } - if (h && have_handler) + if (h && have_handler) // We have everything we need break; } - if (h && have_handler) { + if (h) { + // If we reached here without have_handler, this means that default_handler + // was set as the signal handler before the first UnixSignal object was installed. + g_assert (have_handler); + + // Overwrite the tenative handler we set a moment ago with a known-usable one + h->handler = handler; h->have_handler = 1; - h->handler = handler; - } - if (h) { - mph_int_set (&h->count, h->count, 0); - mph_int_set (&h->signum, h->signum, sig); - mph_int_set (&h->pipecnt, h->pipecnt, 0); + mph_int_set (&h->count, 0); + mph_int_set (&h->pipecnt, 0); + mph_int_set (&h->signum, sig); } release_mutex (&signals_mutex); @@ -265,16 +368,17 @@ count_handlers (int signum) int i; int count = 0; for (i = 0; i < NUM_SIGNALS; ++i) { - if (signals [i].signum == signum) + if (mph_int_get (&signals [i].signum) == signum) ++count; } return count; } +// A UnixSignal object is being Disposed int Mono_Unix_UnixSignal_uninstall (void* info) { -#if defined(HAVE_SIGNAL) +#if defined(HAVE_SIGNAL) signal_info* h; int r = -1; @@ -287,14 +391,15 @@ Mono_Unix_UnixSignal_uninstall (void* info) errno = EINVAL; else { /* last UnixSignal -- we can unregister */ - if (h->have_handler && count_handlers (h->signum) == 1) { - mph_sighandler_t p = signal (h->signum, h->handler); + int signum = mph_int_get (&h->signum); + if (h->have_handler && count_handlers (signum) == 1) { + mph_sighandler_t p = signal (signum, h->handler); if (p != SIG_ERR) r = 0; h->handler = NULL; h->have_handler = 0; } - h->signum = 0; + mph_int_set (&h->signum, 0); } release_mutex (&signals_mutex); @@ -306,6 +411,7 @@ Mono_Unix_UnixSignal_uninstall (void* info) #endif } +// Set up a signal_info to begin waiting for signal static int setup_pipes (signal_info** signals, int count, struct pollfd *fd_structs, int *currfd) { @@ -317,21 +423,22 @@ setup_pipes (signal_info** signals, int count, struct pollfd *fd_structs, int *c h = signals [i]; - if (mph_int_get (&h->pipecnt) == 0) { + if (mph_int_get (&h->pipecnt) == 0) { // First listener for this signal_info if ((r = pipe (filedes)) != 0) { break; } - h->read_fd = filedes [0]; - h->write_fd = filedes [1]; + mph_int_set (&h->read_fd, filedes [0]); + mph_int_set (&h->write_fd, filedes [1]); } mph_int_inc (&h->pipecnt); - fd_structs[*currfd].fd = h->read_fd; + fd_structs[*currfd].fd = mph_int_get (&h->read_fd); fd_structs[*currfd].events = POLLIN; - ++(*currfd); + ++(*currfd); // count is verified less than NUM_SIGNALS by caller } return r; } +// Cleanup a signal_info after waiting for signal static void teardown_pipes (signal_info** signals, int count) { @@ -339,21 +446,28 @@ teardown_pipes (signal_info** signals, int count) for (i = 0; i < count; ++i) { signal_info* h = signals [i]; - if (mph_int_dec_test (&h->pipecnt)) { - if (h->read_fd != 0) - close (h->read_fd); - if (h->write_fd != 0) - close (h->write_fd); - h->read_fd = 0; - h->write_fd = 0; + if (mph_int_dec_test (&h->pipecnt)) { // Final listener for this signal_info + acquire_pipelock_teardown (&h->pipelock); + int read_fd = mph_int_get (&h->read_fd); + int write_fd = mph_int_get (&h->write_fd); + if (read_fd != 0) + close (read_fd); + if (write_fd != 0) + close (write_fd); + mph_int_set (&h->read_fd, 0); + mph_int_set (&h->write_fd, 0); + release_pipelock_teardown (&h->pipelock); } } } +// Given pipes set up, wait for a byte to arrive on one of them static int wait_for_any (signal_info** signals, int count, int *currfd, struct pollfd* fd_structs, int timeout, Mono_Posix_RuntimeIsShuttingDown shutting_down) { int r, idx; + // Poll until one of this signal_info's pipes is ready to read. + // Once a second, stop to check if the VM is shutting down. do { struct timeval tv; struct timeval *ptv = NULL; @@ -368,7 +482,7 @@ wait_for_any (signal_info** signals, int count, int *currfd, struct pollfd* fd_s idx = -1; if (r == 0) idx = timeout; - else if (r > 0) { + else if (r > 0) { // The pipe[s] are ready to read. int i; for (i = 0; i < count; ++i) { signal_info* h = signals [i]; @@ -376,7 +490,7 @@ wait_for_any (signal_info** signals, int count, int *currfd, struct pollfd* fd_s int r; char c; do { - r = read (h->read_fd, &c, 1); + r = read (mph_int_get (&h->read_fd), &c, 1); } while (keep_trying (r) && !shutting_down ()); if (idx == -1) idx = i; diff --git a/support/stdlib.c b/support/stdlib.c index 56df107016f..523ae924828 100644 --- a/support/stdlib.c +++ b/support/stdlib.c @@ -14,6 +14,13 @@ G_BEGIN_DECLS +// See Stdlib.cs +const char * +Mono_Unix_VersionString () +{ + return "MonoProject-2015-12-1"; +} + gint32 Mono_Posix_Stdlib_EXIT_FAILURE (void) { diff --git a/winconfig.h b/winconfig.h index 71555cecf19..1a9a35eb18a 100644 --- a/winconfig.h +++ b/winconfig.h @@ -7,11 +7,11 @@ /* The architecture this is running on */ #if defined(_M_IA64) -#define ARCHITECTURE "ia64" +#define MONO_ARCHITECTURE "ia64" #elif defined(_M_AMD64) -#define ARCHITECTURE "amd64" +#define MONO_ARCHITECTURE "amd64" #elif defined(_M_IX86) -#define ARCHITECTURE "x86" +#define MONO_ARCHITECTURE "x86" #else #error Unknown architecture #endif @@ -67,9 +67,6 @@ /* Disable reflection emit support */ /* #undef DISABLE_REFLECTION_EMIT */ -/* Disable inter-process shared handles */ -/* #undef DISABLE_SHARED_HANDLES */ - /* Disable advanced SSA JIT optimizations */ /* #undef DISABLE_SSA */ @@ -645,5 +642,5 @@ /* #undef USE_MONO_MUTEX */ /* Version number of package */ -#define VERSION "4.1.0" +#define VERSION "#MONO_VERSION#" #endif