From f61e81a6eff6b817c41f2e6d43132f3439fde7d0 Mon Sep 17 00:00:00 2001 From: Peter Foley Date: Sun, 21 Oct 2012 19:08:03 -0400 Subject: [PATCH] fix warnings in cli_ure Change-Id: I4e081473612403e0bf277e8dbf5f1b9a15541dd7 --- cli_ure/CustomTarget_cli_ure_assemblies.mk | 7 -- cli_ure/Executable_climaker.mk | 4 + cli_ure/Library_cli_cppuhelper_native.mk | 7 ++ cli_ure/Library_cli_uno.mk | 4 + cli_ure/source/uno_bridge/cli_base.h | 108 ++++++++++---------- cli_ure/source/uno_bridge/cli_bridge.h | 4 +- cli_ure/source/uno_bridge/cli_data.cxx | 2 +- cli_ure/source/uno_bridge/cli_environment.h | 4 +- solenv/gbuild/CliLibrary.mk | 3 + 9 files changed, 77 insertions(+), 66 deletions(-) diff --git a/cli_ure/CustomTarget_cli_ure_assemblies.mk b/cli_ure/CustomTarget_cli_ure_assemblies.mk index 80a8e43ab33f..63bbe1fac2e1 100644 --- a/cli_ure/CustomTarget_cli_ure_assemblies.mk +++ b/cli_ure/CustomTarget_cli_ure_assemblies.mk @@ -9,10 +9,6 @@ cli_ure_source_MAKEFILE := $(lastword $(MAKEFILE_LIST)) -# FIXME move this to configure.in ? -cli_ure_CCNUMVER = $(shell $(CXX) | $(gb_AWK) -v num=true -f $(SOLARENV)/bin/getcompver.awk) -cli_ure_CCNUMVER_GOOD = $(shell expr $(cli_ure_CCNUMVER) '>=' 001399999999) - include $(SRCDIR)/cli_ure/version/version.txt $(eval $(call gb_CustomTarget_CustomTarget,cli_ure/source)) @@ -43,20 +39,17 @@ $(call gb_CustomTarget_get_workdir,cli_ure/source)/ure/assembly.cs : \ $(call gb_CustomTarget_get_workdir,cli_ure/source)/basetypes/assembly.cs : $(GNUCOPY) $< $@.tmp && \ echo '[assembly:System.Reflection.AssemblyVersion( "$(CLI_BASETYPES_NEW_VERSION)" )]' >> $@.tmp && \ - $(if $(cli_ure_CCNUMVER_GOOD),echo '[assembly:System.Reflection.AssemblyKeyFile( @"$(call gb_Helper_windows_path,$(SRCDIR)/cli_ure/source/cliuno.snk)" )]' >> $@.tmp &&) \ mv $@.tmp $@ # TODO use macros for this $(call gb_CustomTarget_get_workdir,cli_ure/source)/native/assembly.cxx : $(GNUCOPY) $< $@.tmp && \ echo '[assembly:System::Reflection::AssemblyVersion( "$(CLI_CPPUHELPER_NEW_VERSION)" )];' >> $@.tmp && \ - echo '[assembly:System::Reflection::AssemblyKeyFile( "$(call gb_Helper_windows_path,$(SRCDIR)/cli_ure/source/cliuno.snk)" )];' >> $@.tmp && \ mv $@.tmp $@ $(call gb_CustomTarget_get_workdir,cli_ure/source)/ure/assembly.cs : $(GNUCOPY) $< $@.tmp && \ echo '[assembly:System.Reflection.AssemblyVersion( "$(CLI_URE_NEW_VERSION)" )]' >> $@.tmp && \ - $(if $(cli_ure_CCNUMVER_GOOD),echo '[assembly:System.Reflection.AssemblyKeyFile( @"$(call gb_Helper_windows_path,$(SRCDIR)/cli_ure/source/cliuno.snk)" )]' >> $@.tmp &&) \ mv $@.tmp $@ # vim: set noet sw=4 ts=4: diff --git a/cli_ure/Executable_climaker.mk b/cli_ure/Executable_climaker.mk index 0ccd386f8502..01264f4f879b 100644 --- a/cli_ure/Executable_climaker.mk +++ b/cli_ure/Executable_climaker.mk @@ -17,6 +17,10 @@ $(eval $(call gb_Executable_add_cxxflags,climaker,\ -wd4715 \ )) +$(eval $(call gb_Executable_add_ldflags,climaker,\ + -ignore:4248 \ +)) + $(eval $(call gb_Executable_use_internal_bootstrap_api,climaker,\ udkapi \ )) diff --git a/cli_ure/Library_cli_cppuhelper_native.mk b/cli_ure/Library_cli_cppuhelper_native.mk index 32b9ffd99a9d..72ddeb1fc593 100644 --- a/cli_ure/Library_cli_cppuhelper_native.mk +++ b/cli_ure/Library_cli_cppuhelper_native.mk @@ -7,6 +7,8 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # +include $(SRCDIR)/cli_ure/version/version.txt + $(eval $(call gb_Library_Assembly,cli_cppuhelper_native)) # When compiling for CLR, disable "warning C4339: use of undefined type detected @@ -17,6 +19,11 @@ $(eval $(call gb_Library_add_cxxflags,cli_cppuhelper_native,\ -wd4339 \ )) +$(eval $(call gb_Library_add_ldflags,cli_cppuhelper_native,\ + -ignore:4248 \ + -keyfile:$(call gb_Helper_windows_path,$(SRCDIR)/cli_ure/source/cliuno.snk) \ +)) + # TODO do not encode filenames here $(eval $(call gb_Library_add_ldflags,cli_cppuhelper_native,\ -delayload:cppuhelper3MSC.dll \ diff --git a/cli_ure/Library_cli_uno.mk b/cli_ure/Library_cli_uno.mk index aa34fc0641e2..e87b91b097b9 100644 --- a/cli_ure/Library_cli_uno.mk +++ b/cli_ure/Library_cli_uno.mk @@ -15,6 +15,10 @@ $(eval $(call gb_Library_add_cxxflags,cli_uno,\ -wd4339 \ )) +$(eval $(call gb_Library_add_ldflags,cli_uno,\ + -ignore:4248 \ +)) + $(eval $(call gb_Library_use_udk_api,cli_uno)) $(eval $(call gb_Library_use_libraries,cli_uno,\ diff --git a/cli_ure/source/uno_bridge/cli_base.h b/cli_ure/source/uno_bridge/cli_base.h index d544087d61cd..505790b132b6 100644 --- a/cli_ure/source/uno_bridge/cli_base.h +++ b/cli_ure/source/uno_bridge/cli_base.h @@ -42,67 +42,67 @@ System::Type^ loadCliType(System::String ^ typeName); System::Type^ mapUnoType(typelib_TypeDescription const * pTD); System::Type^ mapUnoType(typelib_TypeDescriptionReference const * pTD); typelib_TypeDescriptionReference* mapCliType(System::Type^ cliType); -rtl::OUString mapCliString(System::String const ^ data); +rtl::OUString mapCliString(System::String ^ data); System::String^ mapUnoString(rtl_uString const * data); System::String^ mapUnoTypeName(rtl_uString const * typeName); ref struct Constants { - static const System::String^ sXInterfaceName= gcnew System::String( + static System::String^ sXInterfaceName= gcnew System::String( "unoidl.com.sun.star.uno.XInterface"); - static const System::String^ sObject= gcnew System::String("System.Object"); - static const System::String^ sType= gcnew System::String("System.Type"); - static const System::String^ sUnoidl= gcnew System::String("unoidl."); - static const System::String^ sVoid= gcnew System::String("System.Void"); - static const System::String^ sAny= gcnew System::String("uno.Any"); - static const System::String^ sArArray= gcnew System::String("System.Array[]"); - static const System::String^ sBoolean= gcnew System::String("System.Boolean"); - static const System::String^ sChar= gcnew System::String("System.Char"); - static const System::String^ sByte= gcnew System::String("System.Byte"); - static const System::String^ sInt16= gcnew System::String("System.Int16"); - static const System::String^ sUInt16= gcnew System::String("System.UInt16"); - static const System::String^ sInt32= gcnew System::String("System.Int32"); - static const System::String^ sUInt32= gcnew System::String("System.UInt32"); - static const System::String^ sInt64= gcnew System::String("System.Int64"); - static const System::String^ sUInt64= gcnew System::String("System.UInt64"); - static const System::String^ sString= gcnew System::String("System.String"); - static const System::String^ sSingle= gcnew System::String("System.Single"); - static const System::String^ sDouble= gcnew System::String("System.Double"); - static const System::String^ sArBoolean= gcnew System::String("System.Boolean[]"); - static const System::String^ sArChar= gcnew System::String("System.Char[]"); - static const System::String^ sArByte= gcnew System::String("System.Byte[]"); - static const System::String^ sArInt16= gcnew System::String("System.Int16[]"); - static const System::String^ sArUInt16= gcnew System::String("System.UInt16[]"); - static const System::String^ sArInt32= gcnew System::String("System.Int32[]"); - static const System::String^ sArUInt32= gcnew System::String("System.UInt32[]"); - static const System::String^ sArInt64= gcnew System::String("System.Int64[]"); - static const System::String^ sArUInt64= gcnew System::String("System.UInt64[]"); - static const System::String^ sArString= gcnew System::String("System.String[]"); - static const System::String^ sArSingle= gcnew System::String("System.Single[]"); - static const System::String^ sArDouble= gcnew System::String("System.Double[]"); - static const System::String^ sArType= gcnew System::String("System.Type[]"); - static const System::String^ sArObject= gcnew System::String("System.Object[]"); - static const System::String^ sBrackets= gcnew System::String("[]"); - static const System::String^ sAttributeSet= gcnew System::String("set_"); - static const System::String^ sAttributeGet= gcnew System::String("get_"); + static System::String^ sObject= gcnew System::String("System.Object"); + static System::String^ sType= gcnew System::String("System.Type"); + static System::String^ sUnoidl= gcnew System::String("unoidl."); + static System::String^ sVoid= gcnew System::String("System.Void"); + static System::String^ sAny= gcnew System::String("uno.Any"); + static System::String^ sArArray= gcnew System::String("System.Array[]"); + static System::String^ sBoolean= gcnew System::String("System.Boolean"); + static System::String^ sChar= gcnew System::String("System.Char"); + static System::String^ sByte= gcnew System::String("System.Byte"); + static System::String^ sInt16= gcnew System::String("System.Int16"); + static System::String^ sUInt16= gcnew System::String("System.UInt16"); + static System::String^ sInt32= gcnew System::String("System.Int32"); + static System::String^ sUInt32= gcnew System::String("System.UInt32"); + static System::String^ sInt64= gcnew System::String("System.Int64"); + static System::String^ sUInt64= gcnew System::String("System.UInt64"); + static System::String^ sString= gcnew System::String("System.String"); + static System::String^ sSingle= gcnew System::String("System.Single"); + static System::String^ sDouble= gcnew System::String("System.Double"); + static System::String^ sArBoolean= gcnew System::String("System.Boolean[]"); + static System::String^ sArChar= gcnew System::String("System.Char[]"); + static System::String^ sArByte= gcnew System::String("System.Byte[]"); + static System::String^ sArInt16= gcnew System::String("System.Int16[]"); + static System::String^ sArUInt16= gcnew System::String("System.UInt16[]"); + static System::String^ sArInt32= gcnew System::String("System.Int32[]"); + static System::String^ sArUInt32= gcnew System::String("System.UInt32[]"); + static System::String^ sArInt64= gcnew System::String("System.Int64[]"); + static System::String^ sArUInt64= gcnew System::String("System.UInt64[]"); + static System::String^ sArString= gcnew System::String("System.String[]"); + static System::String^ sArSingle= gcnew System::String("System.Single[]"); + static System::String^ sArDouble= gcnew System::String("System.Double[]"); + static System::String^ sArType= gcnew System::String("System.Type[]"); + static System::String^ sArObject= gcnew System::String("System.Object[]"); + static System::String^ sBrackets= gcnew System::String("[]"); + static System::String^ sAttributeSet= gcnew System::String("set_"); + static System::String^ sAttributeGet= gcnew System::String("get_"); - static const System::String^ usXInterface = "com.sun.star.uno.XInterface"; - static const System::String^ usVoid = "void"; - static const System::String^ usType = "type"; - static const System::String^ usAny = "any"; - static const System::String^ usBrackets = "[]"; - static const System::String^ usBool = "boolean"; - static const System::String^ usByte = "byte"; - static const System::String^ usChar = "char"; - static const System::String^ usShort = "short"; - static const System::String^ usUShort = "unsigned short"; - static const System::String^ usLong = "long"; - static const System::String^ usULong = "unsigned long"; - static const System::String^ usHyper = "hyper"; - static const System::String^ usUHyper = "unsigned hyper"; - static const System::String^ usString = "string"; - static const System::String^ usFloat = "float"; - static const System::String^ usDouble = "double"; + static System::String^ usXInterface = "com.sun.star.uno.XInterface"; + static System::String^ usVoid = "void"; + static System::String^ usType = "type"; + static System::String^ usAny = "any"; + static System::String^ usBrackets = "[]"; + static System::String^ usBool = "boolean"; + static System::String^ usByte = "byte"; + static System::String^ usChar = "char"; + static System::String^ usShort = "short"; + static System::String^ usUShort = "unsigned short"; + static System::String^ usLong = "long"; + static System::String^ usULong = "unsigned long"; + static System::String^ usHyper = "hyper"; + static System::String^ usUHyper = "unsigned hyper"; + static System::String^ usString = "string"; + static System::String^ usFloat = "float"; + static System::String^ usDouble = "double"; }; struct BridgeRuntimeError diff --git a/cli_ure/source/uno_bridge/cli_bridge.h b/cli_ure/source/uno_bridge/cli_bridge.h index b12b44816f46..ed116ac4aa37 100644 --- a/cli_ure/source/uno_bridge/cli_bridge.h +++ b/cli_ure/source/uno_bridge/cli_bridge.h @@ -67,8 +67,8 @@ struct Bridge ~Bridge() SAL_THROW(()); Bridge( uno_Environment * java_env, uno_ExtEnvironment * uno_env, bool registered_java2uno ); - void acquire() const; - void release() const; + void acquire() const SAL_THROW(()); + void release() const SAL_THROW(()); void map_to_uno( void * uno_data, System::Object^ cli_data, diff --git a/cli_ure/source/uno_bridge/cli_data.cxx b/cli_ure/source/uno_bridge/cli_data.cxx index 935a90be2a0a..9292b4af43c5 100644 --- a/cli_ure/source/uno_bridge/cli_data.cxx +++ b/cli_ure/source/uno_bridge/cli_data.cxx @@ -727,7 +727,7 @@ inline System::String^ mapUnoString( rtl_uString const * data) return gcnew System::String((__wchar_t*) data->buffer, 0, data->length); } -OUString mapCliString(System::String const ^ data) +OUString mapCliString(System::String ^ data) { if (data != nullptr) diff --git a/cli_ure/source/uno_bridge/cli_environment.h b/cli_ure/source/uno_bridge/cli_environment.h index d04a92bcf194..e53e18121dd9 100644 --- a/cli_ure/source/uno_bridge/cli_environment.h +++ b/cli_ure/source/uno_bridge/cli_environment.h @@ -40,8 +40,6 @@ public ref class Cli_environment int _numRegisteredObjects; #endif -public: - static Cli_environment() { m_objects = Hashtable::Synchronized(gcnew Hashtable()); @@ -53,6 +51,8 @@ public: sOidPart = buffer->ToString(); } +public: + inline Cli_environment(); ~Cli_environment(); diff --git a/solenv/gbuild/CliLibrary.mk b/solenv/gbuild/CliLibrary.mk index 331da33e864f..6b3a4efc944f 100644 --- a/solenv/gbuild/CliLibrary.mk +++ b/solenv/gbuild/CliLibrary.mk @@ -41,6 +41,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(CLI_CSCFLAGS) \ -target:library \ -out:$(1) \ + -keyfile:$(call gb_Helper_windows_path,$(CLI_KEYFILE)) \ -reference:System.dll \ $(foreach assembly,$(CLI_ASSEMBLIES),-reference:$(assembly)) \ $(CLI_SOURCES) \ @@ -71,6 +72,7 @@ define gb_CliLibraryTarget_CliLibraryTarget $(call gb_CliLibraryTarget_get_target,$(1)) : CLI_ASSEMBLIES := $(call gb_CliLibraryTarget_get_target,$(1)) : CLI_SOURCES := $(call gb_CliLibraryTarget_get_target,$(1)) : CLI_CSCFLAGS := +$(call gb_CliLibraryTarget_get_target,$(1)) : CLI_KEYFILE := $(call gb_CliLibraryTarget_get_target,$(1)) :| $(dir $(call gb_CliLibraryTarget_get_target,$(1))).dir @@ -148,6 +150,7 @@ $(call gb_CliAssembly_set_configfile,$(1),$(2)) endef define gb_CliLibrary_set_keyfile +$(call gb_CliLibraryTarget_get_target,$(1)) : CLI_KEYFILE := $(2) $(call gb_CliAssembly_set_keyfile,$(1),$(2)) endef