From 159314e0440139d301ec145450b73045cea8563f Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Wed, 27 Aug 2008 18:28:16 +0000 Subject: [PATCH] Warnings cleanup svn path=/trunk/mcs/; revision=111730 --- .../System.Globalization/CultureInfo.cs | 4 +-- .../System.Globalization/NumberFormatInfo.cs | 5 +++ .../corlib/System.Globalization/RegionInfo.cs | 7 ++-- .../System.Reflection.Emit/MonoArrayMethod.cs | 2 ++ .../corlib/System.Reflection/MethodBody.cs | 2 ++ mcs/class/corlib/System.Reflection/Module.cs | 2 ++ .../corlib/System.Reflection/MonoMethod.cs | 4 +++ .../corlib/System.Reflection/MonoProperty.cs | 2 ++ .../MissingSatelliteAssemblyException.cs | 3 +- .../corlib/System.Resources/Win32Resources.cs | 3 +- .../RuntimeWrappedException.cs | 2 ++ .../AsyncResult.cs | 4 +-- .../MonoMethodMessage.cs | 2 ++ .../RealProxy.cs | 36 +++++++++---------- .../HostProtectionException.cs | 2 ++ .../corlib/System.Security/SecurityFrame.cs | 2 ++ mcs/class/corlib/System.Threading/Thread.cs | 4 +-- mcs/class/corlib/System/AppDomainManager.cs | 17 +++++---- mcs/class/corlib/System/Delegate.cs | 4 +-- mcs/class/corlib/System/Exception.cs | 4 +-- mcs/class/corlib/System/TermInfoReader.cs | 8 ++--- 21 files changed, 76 insertions(+), 43 deletions(-) diff --git a/mcs/class/corlib/System.Globalization/CultureInfo.cs b/mcs/class/corlib/System.Globalization/CultureInfo.cs index 95ec7e73092..724eacc32eb 100644 --- a/mcs/class/corlib/System.Globalization/CultureInfo.cs +++ b/mcs/class/corlib/System.Globalization/CultureInfo.cs @@ -53,7 +53,7 @@ namespace System.Globalization const int GregorianTypeMask = 0x00FFFFFF; const int CalendarTypeBits = 24; -#pragma warning disable 169 +#pragma warning disable 169, 649 bool m_isReadOnly; int cultureID; [NonSerialized] @@ -99,7 +99,7 @@ namespace System.Globalization int m_dataItem; // MS.NET serializes this. Calendar calendar; // MS.NET serializes this. -#pragma warning restore 169 +#pragma warning restore 169, 649 // Deserialized instances will set this to false [NonSerialized] diff --git a/mcs/class/corlib/System.Globalization/NumberFormatInfo.cs b/mcs/class/corlib/System.Globalization/NumberFormatInfo.cs index e7d6354666d..a02475a1fe5 100644 --- a/mcs/class/corlib/System.Globalization/NumberFormatInfo.cs +++ b/mcs/class/corlib/System.Globalization/NumberFormatInfo.cs @@ -54,6 +54,10 @@ namespace System.Globalization { #endif [Serializable] public sealed class NumberFormatInfo : ICloneable, IFormatProvider { + +/* Keep in sync with object-internals.h */ + +#pragma warning disable 649 private bool isReadOnly; // used for temporary storage. Used in InitPatterns () string decimalFormats; @@ -94,6 +98,7 @@ namespace System.Globalization { private string perMilleSymbol; private string positiveInfinitySymbol; private string positiveSign; +#pragma warning restore 649 #pragma warning disable 169 string ansiCurrencySymbol; // TODO, MS.NET serializes this. diff --git a/mcs/class/corlib/System.Globalization/RegionInfo.cs b/mcs/class/corlib/System.Globalization/RegionInfo.cs index eaaa605fcb3..c849a2511a0 100644 --- a/mcs/class/corlib/System.Globalization/RegionInfo.cs +++ b/mcs/class/corlib/System.Globalization/RegionInfo.cs @@ -58,8 +58,9 @@ namespace System.Globalization #if NET_2_0 int lcid; // it is used only for Equals() (not even used in GetHashCode()). - string currencyEnglishName; -#endif +#endif + +#pragma warning disable 649 int regionId; string iso2Name; string iso3Name; @@ -67,6 +68,8 @@ namespace System.Globalization string englishName; string currencySymbol; string isoCurrencySymbol; + string currencyEnglishName; +#pragma warning restore 649 public RegionInfo (int culture) { diff --git a/mcs/class/corlib/System.Reflection.Emit/MonoArrayMethod.cs b/mcs/class/corlib/System.Reflection.Emit/MonoArrayMethod.cs index 2a487430dcb..a64112f7c42 100644 --- a/mcs/class/corlib/System.Reflection.Emit/MonoArrayMethod.cs +++ b/mcs/class/corlib/System.Reflection.Emit/MonoArrayMethod.cs @@ -38,6 +38,7 @@ using System.Runtime.InteropServices; namespace System.Reflection { internal class MonoArrayMethod: MethodInfo { +#pragma warning disable 649 internal RuntimeMethodHandle mhandle; internal Type parent; internal Type ret; @@ -45,6 +46,7 @@ namespace System.Reflection { internal string name; internal int table_idx; internal CallingConventions call_conv; +#pragma warning restore 649 internal MonoArrayMethod (Type arrayClass, string methodName, CallingConventions callingConvention, Type returnType, Type[] parameterTypes) { name = methodName; diff --git a/mcs/class/corlib/System.Reflection/MethodBody.cs b/mcs/class/corlib/System.Reflection/MethodBody.cs index e3553fa1602..7f571c758ee 100644 --- a/mcs/class/corlib/System.Reflection/MethodBody.cs +++ b/mcs/class/corlib/System.Reflection/MethodBody.cs @@ -39,6 +39,7 @@ namespace System.Reflection { [ComVisible (true)] #endif public sealed class MethodBody { +#pragma warning disable 649 #region Sync with reflection.h ExceptionHandlingClause[] clauses; LocalVariableInfo[] locals; @@ -47,6 +48,7 @@ namespace System.Reflection { int sig_token; int max_stack; #endregion +#pragma warning restore 649 internal MethodBody () { } diff --git a/mcs/class/corlib/System.Reflection/Module.cs b/mcs/class/corlib/System.Reflection/Module.cs index 646d9ab30b1..935a0a08d3d 100644 --- a/mcs/class/corlib/System.Reflection/Module.cs +++ b/mcs/class/corlib/System.Reflection/Module.cs @@ -53,6 +53,7 @@ namespace System.Reflection { public static readonly TypeFilter FilterTypeName; public static readonly TypeFilter FilterTypeNameIgnoreCase; +#pragma warning disable 649 private IntPtr _impl; /* a pointer to a MonoImage */ internal Assembly assembly; internal string fqname; @@ -60,6 +61,7 @@ namespace System.Reflection { internal string scopename; internal bool is_resource; internal int token; +#pragma warning restore 649 const BindingFlags defaultBindingFlags = BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance; diff --git a/mcs/class/corlib/System.Reflection/MonoMethod.cs b/mcs/class/corlib/System.Reflection/MonoMethod.cs index 35f56915c26..d60869d9a25 100644 --- a/mcs/class/corlib/System.Reflection/MonoMethod.cs +++ b/mcs/class/corlib/System.Reflection/MonoMethod.cs @@ -65,9 +65,11 @@ namespace System.Reflection { [Serializable()] internal class MonoMethod : MethodInfo, ISerializable { +#pragma warning disable 649 internal IntPtr mhandle; string name; Type reftype; +#pragma warning restore 649 internal MonoMethod () { } @@ -378,9 +380,11 @@ namespace System.Reflection { internal class MonoCMethod : ConstructorInfo, ISerializable { +#pragma warning disable 649 internal IntPtr mhandle; string name; Type reftype; +#pragma warning restore 649 public override MethodImplAttributes GetMethodImplementationFlags() { MonoMethodInfo info; diff --git a/mcs/class/corlib/System.Reflection/MonoProperty.cs b/mcs/class/corlib/System.Reflection/MonoProperty.cs index 0b1f4582acc..a8f972e0f38 100644 --- a/mcs/class/corlib/System.Reflection/MonoProperty.cs +++ b/mcs/class/corlib/System.Reflection/MonoProperty.cs @@ -66,10 +66,12 @@ namespace System.Reflection { [Serializable] internal class MonoProperty : PropertyInfo, ISerializable { +#pragma warning disable 649 internal IntPtr klass; internal IntPtr prop; MonoPropertyInfo info; PInfo cached; +#pragma warning restore 649 public override PropertyAttributes Attributes { get { diff --git a/mcs/class/corlib/System.Resources/MissingSatelliteAssemblyException.cs b/mcs/class/corlib/System.Resources/MissingSatelliteAssemblyException.cs index 3f5704655d2..f674198fc7f 100644 --- a/mcs/class/corlib/System.Resources/MissingSatelliteAssemblyException.cs +++ b/mcs/class/corlib/System.Resources/MissingSatelliteAssemblyException.cs @@ -56,10 +56,11 @@ namespace System.Resources public MissingSatelliteAssemblyException (string message, string cultureName) :base (message) { + this.culture = cultureName; } protected MissingSatelliteAssemblyException (SerializationInfo info, StreamingContext context) - :base (info, context) + :base (info, context) { } diff --git a/mcs/class/corlib/System.Resources/Win32Resources.cs b/mcs/class/corlib/System.Resources/Win32Resources.cs index 0e7dad2a890..68e024a4bf2 100644 --- a/mcs/class/corlib/System.Resources/Win32Resources.cs +++ b/mcs/class/corlib/System.Resources/Win32Resources.cs @@ -708,6 +708,7 @@ internal class Win32ResFileReader { // internal class ICONDIRENTRY { +#pragma warning disable 649 public byte bWidth; public byte bHeight; public byte bColorCount; @@ -716,7 +717,7 @@ internal class ICONDIRENTRY { public Int16 wBitCount; public Int32 dwBytesInRes; public Int32 dwImageOffset; - +#pragma warning restore 649 public byte[] image; public override string ToString () { diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeWrappedException.cs b/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeWrappedException.cs index 9e08e3d8391..aab64307eeb 100644 --- a/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeWrappedException.cs +++ b/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeWrappedException.cs @@ -36,9 +36,11 @@ namespace System.Runtime.CompilerServices { [Serializable] public sealed class RuntimeWrappedException : Exception { +#pragma warning disable 649 #region Synch with object-internals.h private object wrapped_exception; #endregion +#pragma warning restore 649 // Called by the runtime private RuntimeWrappedException () diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/AsyncResult.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/AsyncResult.cs index 342f0b6ab10..4ebb2409b19 100644 --- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/AsyncResult.cs +++ b/mcs/class/corlib/System.Runtime.Remoting.Messaging/AsyncResult.cs @@ -41,7 +41,7 @@ namespace System.Runtime.Remoting.Messaging { #endif public class AsyncResult : IAsyncResult, IMessageSink { -#pragma warning disable 169, 414 +#pragma warning disable 169, 414, 649 object async_state; WaitHandle handle; object async_delegate; @@ -53,7 +53,7 @@ public class AsyncResult : IAsyncResult, IMessageSink { object async_callback; ExecutionContext current; ExecutionContext original; -#pragma warning restore 169, 414 +#pragma warning restore 169, 414, 649 // not part of MonoAsyncResult... MonoMethodMessage call_message; diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/MonoMethodMessage.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/MonoMethodMessage.cs index 32bee231a1b..54c10c937f0 100644 --- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/MonoMethodMessage.cs +++ b/mcs/class/corlib/System.Runtime.Remoting.Messaging/MonoMethodMessage.cs @@ -41,6 +41,7 @@ namespace System.Runtime.Remoting.Messaging { [Serializable] internal class MonoMethodMessage : IMethodCallMessage, IMethodReturnMessage, IInternalMessage { +#pragma warning disable 649 #region keep in sync with MonoMessage in object-internals.h MonoMethod method; object [] args; @@ -52,6 +53,7 @@ namespace System.Runtime.Remoting.Messaging { AsyncResult asyncResult; CallType call_type; #endregion +#pragma warning restore 649 string uri; diff --git a/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs b/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs index 0d5d4565a8e..a97ab10d397 100644 --- a/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs +++ b/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs @@ -47,13 +47,13 @@ using System.Runtime.InteropServices; namespace System.Runtime.Remoting.Proxies { -#pragma warning disable 169 +#pragma warning disable 169, 649 internal class TransparentProxy { public RealProxy _rp; IntPtr _class; bool _custom_type_info; } -#pragma warning restore 169 +#pragma warning restore 169, 649 #if NET_2_0 [ComVisible (true)] @@ -72,8 +72,8 @@ namespace System.Runtime.Remoting.Proxies int _targetDomainId = -1; internal string _targetUri; internal Identity _objectIdentity; - Object _objTP; - object _stubData; + Object _objTP; + object _stubData; #endregion #pragma warning restore 169, 414 @@ -120,8 +120,8 @@ namespace System.Runtime.Remoting.Proxies public virtual void GetObjectData (SerializationInfo info, StreamingContext context) { - Object obj = GetTransparentProxy(); - RemotingServices.GetObjectData (obj, info, context); + Object obj = GetTransparentProxy(); + RemotingServices.GetObjectData (obj, info, context); } internal Identity ObjectIdentity @@ -171,7 +171,7 @@ namespace System.Runtime.Remoting.Proxies IMethodReturnMessage res_msg = null; - if (call_type == CallType.BeginInvoke) + if (call_type == CallType.BeginInvoke) // todo: set CallMessage in runtime instead mMsg.AsyncResult.CallMessage = mMsg; @@ -179,30 +179,30 @@ namespace System.Runtime.Remoting.Proxies res_msg = (IMethodReturnMessage)mMsg.AsyncResult.EndInvoke (); // Check for constructor msg - if (mMsg.MethodBase.IsConstructor) + if (mMsg.MethodBase.IsConstructor) { - if (is_remproxy) + if (is_remproxy) res_msg = (IMethodReturnMessage) (rp as RemotingProxy).ActivateRemoteObject ((IMethodMessage) msg); - else + else msg = new ConstructionCall (rp.GetProxiedType ()); } if (null == res_msg) { res_msg = (IMethodReturnMessage)rp.Invoke (msg); - - // Note, from begining this code used AsyncResult.IsCompleted for - // checking if it was a remoting or custom proxy, but in some - // cases the remoting proxy finish before the call returns - // causing this method to be called, therefore causing all kind of bugs. - if ((!is_remproxy) && call_type == CallType.BeginInvoke) - { + + // Note, from begining this code used AsyncResult.IsCompleted for + // checking if it was a remoting or custom proxy, but in some + // cases the remoting proxy finish before the call returns + // causing this method to be called, therefore causing all kind of bugs. + if ((!is_remproxy) && call_type == CallType.BeginInvoke) + { IMessage asyncMsg = null; // allow calltype EndInvoke to finish asyncMsg = mMsg.AsyncResult.SyncProcessMessage (res_msg as IMessage); res_msg = new ReturnMessage (asyncMsg, null, 0, null, res_msg as IMethodCallMessage); - } + } } if (res_msg.LogicalCallContext != null && res_msg.LogicalCallContext.HasInfo) diff --git a/mcs/class/corlib/System.Security/HostProtectionException.cs b/mcs/class/corlib/System.Security/HostProtectionException.cs index 83929ea6221..70d20535c69 100644 --- a/mcs/class/corlib/System.Security/HostProtectionException.cs +++ b/mcs/class/corlib/System.Security/HostProtectionException.cs @@ -59,6 +59,8 @@ namespace System.Security { public HostProtectionException (string message, HostProtectionResource protectedResources, HostProtectionResource demandedResources) : base (message) { + this._protected = protectedResources; + this._demanded = demandedResources; } protected HostProtectionException (SerializationInfo info, StreamingContext context) diff --git a/mcs/class/corlib/System.Security/SecurityFrame.cs b/mcs/class/corlib/System.Security/SecurityFrame.cs index 7824e0880dd..13980f5d767 100644 --- a/mcs/class/corlib/System.Security/SecurityFrame.cs +++ b/mcs/class/corlib/System.Security/SecurityFrame.cs @@ -43,6 +43,7 @@ namespace System.Security { } // Must match MonoSecurityFrame in /mono/mini/declsec.h +#pragma warning disable 649 internal class RuntimeSecurityFrame { public AppDomain domain; public MethodInfo method; @@ -50,6 +51,7 @@ namespace System.Security { public RuntimeDeclSecurityEntry deny; public RuntimeDeclSecurityEntry permitonly; } +#pragma warning restore 649 internal struct SecurityFrame { diff --git a/mcs/class/corlib/System.Threading/Thread.cs b/mcs/class/corlib/System.Threading/Thread.cs index ce50dee7a43..a1e44a48687 100644 --- a/mcs/class/corlib/System.Threading/Thread.cs +++ b/mcs/class/corlib/System.Threading/Thread.cs @@ -54,7 +54,7 @@ namespace System.Threading { public sealed class Thread : _Thread { #endif -#pragma warning disable 169, 414 +#pragma warning disable 169, 414, 649 #region Sync with metadata/object-internals.h int lock_thread_id; // stores a thread handle @@ -113,7 +113,7 @@ namespace System.Threading { private IntPtr unused5; private IntPtr unused6; #endregion -#pragma warning restore 169, 414 +#pragma warning restore 169, 414, 649 // the name of local_slots is important as it's used by the runtime. [ThreadStatic] diff --git a/mcs/class/corlib/System/AppDomainManager.cs b/mcs/class/corlib/System/AppDomainManager.cs index bb6921b81f0..9cf025e75a2 100644 --- a/mcs/class/corlib/System/AppDomainManager.cs +++ b/mcs/class/corlib/System/AppDomainManager.cs @@ -44,9 +44,6 @@ namespace System { public class AppDomainManager : MarshalByRefObject { private ApplicationActivator _activator; - private Assembly _entry; - private HostExecutionContextManager _host_context; - private HostSecurityManager _host_security; private AppDomainManagerInitializationOptions _flags; public AppDomainManager () @@ -55,19 +52,25 @@ namespace System { } public virtual ApplicationActivator ApplicationActivator { - get { return _activator; } + get { + if (_activator == null) + _activator = new ApplicationActivator (); + return _activator; + } } + [MonoTODO] public virtual Assembly EntryAssembly { - get { return _entry; } + get { throw new NotImplementedException (); } } + [MonoTODO] public virtual HostExecutionContextManager HostExecutionContextManager { - get { return _host_context; } + get { throw new NotImplementedException (); } } public virtual HostSecurityManager HostSecurityManager { - get { return _host_security; } + get { return null; } } public AppDomainManagerInitializationOptions InitializationFlags { diff --git a/mcs/class/corlib/System/Delegate.cs b/mcs/class/corlib/System/Delegate.cs index c5191da69a7..3dc4fe78ec0 100644 --- a/mcs/class/corlib/System/Delegate.cs +++ b/mcs/class/corlib/System/Delegate.cs @@ -55,7 +55,7 @@ namespace System public abstract class Delegate : ICloneable, ISerializable { #region Sync with object-internals.h -#pragma warning disable 169, 414 +#pragma warning disable 169, 414, 649 private IntPtr method_ptr; private IntPtr invoke_impl; private object m_target; @@ -69,7 +69,7 @@ namespace System private MethodInfo original_method_info; private DelegateData data; -#pragma warning restore 169, 414 +#pragma warning restore 169, 414, 649 #endregion protected Delegate (object target, string method) diff --git a/mcs/class/corlib/System/Exception.cs b/mcs/class/corlib/System/Exception.cs index 4fe247f7b47..9fde5561bcd 100644 --- a/mcs/class/corlib/System/Exception.cs +++ b/mcs/class/corlib/System/Exception.cs @@ -52,7 +52,7 @@ namespace System , _Exception #endif { -#pragma warning disable 169 +#pragma warning disable 169, 649 #region Sync with object-internals.h IntPtr [] trace_ips; Exception inner_exception; @@ -66,7 +66,7 @@ namespace System string source; IDictionary _data; #endregion -#pragma warning restore 169 +#pragma warning restore 169, 649 public Exception () { diff --git a/mcs/class/corlib/System/TermInfoReader.cs b/mcs/class/corlib/System/TermInfoReader.cs index 4f6eb4123f0..eb26344fc4d 100644 --- a/mcs/class/corlib/System/TermInfoReader.cs +++ b/mcs/class/corlib/System/TermInfoReader.cs @@ -81,7 +81,7 @@ namespace System { //string [] names; // Last one is the description byte [] buffer; int booleansOffset; - string term; + //string term; public TermInfoReader (string term, string filename) { @@ -110,9 +110,9 @@ namespace System { ReadNames (buffer, ref booleansOffset); } - public string Term { - get { return term; } - } +// public string Term { +// get { return term; } +// } void ReadHeader (byte [] buffer, ref int position) { -- 2.25.1