From e554696ccb451729dc28a7a8ead6d701809dae1b Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Fri, 24 Mar 2017 19:31:22 -0700 Subject: [PATCH] Fixed m_ prefixes in a few files from shared partition (dotnet/coreclr#10473) Commit migrated from https://github.com/dotnet/coreclr/commit/9851f95cd3d4cefe824b8ad90c61f05ff2fddbf1 --- .../shared/System/AttributeUsageAttribute.cs | 26 ++++++++++------------ .../src/mscorlib/shared/System/DefaultBinder.cs | 24 ++++++++++---------- src/coreclr/src/mscorlib/shared/System/Lazy.cs | 2 +- .../Serialization/ISafeSerializationData.cs | 26 +++++++++++----------- 4 files changed, 38 insertions(+), 40 deletions(-) diff --git a/src/coreclr/src/mscorlib/shared/System/AttributeUsageAttribute.cs b/src/coreclr/src/mscorlib/shared/System/AttributeUsageAttribute.cs index 22cc548..6f9aeb2 100644 --- a/src/coreclr/src/mscorlib/shared/System/AttributeUsageAttribute.cs +++ b/src/coreclr/src/mscorlib/shared/System/AttributeUsageAttribute.cs @@ -20,41 +20,39 @@ namespace System [AttributeUsage(AttributeTargets.Class, Inherited = true)] public sealed class AttributeUsageAttribute : Attribute { - internal AttributeTargets m_attributeTarget = AttributeTargets.All; // Defaults to all - internal bool m_allowMultiple = false; // Defaults to false - internal bool m_inherited = true; // Defaults to true + private AttributeTargets _attributeTarget = AttributeTargets.All; // Defaults to all + private bool _allowMultiple = false; // Defaults to false + private bool _inherited = true; // Defaults to true internal static AttributeUsageAttribute Default = new AttributeUsageAttribute(AttributeTargets.All); //Constructors public AttributeUsageAttribute(AttributeTargets validOn) { - m_attributeTarget = validOn; + _attributeTarget = validOn; } internal AttributeUsageAttribute(AttributeTargets validOn, bool allowMultiple, bool inherited) { - m_attributeTarget = validOn; - m_allowMultiple = allowMultiple; - m_inherited = inherited; + _attributeTarget = validOn; + _allowMultiple = allowMultiple; + _inherited = inherited; } - - //Properties public AttributeTargets ValidOn { - get { return m_attributeTarget; } + get { return _attributeTarget; } } public bool AllowMultiple { - get { return m_allowMultiple; } - set { m_allowMultiple = value; } + get { return _allowMultiple; } + set { _allowMultiple = value; } } public bool Inherited { - get { return m_inherited; } - set { m_inherited = value; } + get { return _inherited; } + set { _inherited = value; } } } } diff --git a/src/coreclr/src/mscorlib/shared/System/DefaultBinder.cs b/src/coreclr/src/mscorlib/shared/System/DefaultBinder.cs index 6fd6cf1..3b46d5f 100644 --- a/src/coreclr/src/mscorlib/shared/System/DefaultBinder.cs +++ b/src/coreclr/src/mscorlib/shared/System/DefaultBinder.cs @@ -731,11 +731,11 @@ namespace System public sealed override void ReorderArgumentArray(ref object[] args, object state) { BinderState binderState = (BinderState)state; - ReorderParams(binderState.m_argsMap, args); - if (binderState.m_isParamArray) + ReorderParams(binderState._argsMap, args); + if (binderState._isParamArray) { int paramArrayPos = args.Length - 1; - if (args.Length == binderState.m_originalSize) + if (args.Length == binderState._originalSize) args[paramArrayPos] = ((object[])args[paramArrayPos])[0]; else { @@ -751,10 +751,10 @@ namespace System } else { - if (args.Length > binderState.m_originalSize) + if (args.Length > binderState._originalSize) { - object[] newArgs = new object[binderState.m_originalSize]; - Array.Copy(args, 0, newArgs, 0, binderState.m_originalSize); + object[] newArgs = new object[binderState._originalSize]; + Array.Copy(args, 0, newArgs, 0, binderState._originalSize); args = newArgs; } } @@ -1186,15 +1186,15 @@ namespace System internal class BinderState { - internal int[] m_argsMap; - internal int m_originalSize; - internal bool m_isParamArray; + internal readonly int[] _argsMap; + internal readonly int _originalSize; + internal readonly bool _isParamArray; internal BinderState(int[] argsMap, int originalSize, bool isParamArray) { - m_argsMap = argsMap; - m_originalSize = originalSize; - m_isParamArray = isParamArray; + _argsMap = argsMap; + _originalSize = originalSize; + _isParamArray = isParamArray; } } } diff --git a/src/coreclr/src/mscorlib/shared/System/Lazy.cs b/src/coreclr/src/mscorlib/shared/System/Lazy.cs index 46a019f..55f915b 100644 --- a/src/coreclr/src/mscorlib/shared/System/Lazy.cs +++ b/src/coreclr/src/mscorlib/shared/System/Lazy.cs @@ -201,7 +201,7 @@ namespace System [NonSerialized] private Func _factory; - // m_value eventually stores the lazily created value. It is valid when _state = null. + // _value eventually stores the lazily created value. It is valid when _state = null. private T _value; /// diff --git a/src/coreclr/src/mscorlib/shared/System/Runtime/Serialization/ISafeSerializationData.cs b/src/coreclr/src/mscorlib/shared/System/Runtime/Serialization/ISafeSerializationData.cs index 12c2e34..5089d13 100644 --- a/src/coreclr/src/mscorlib/shared/System/Runtime/Serialization/ISafeSerializationData.cs +++ b/src/coreclr/src/mscorlib/shared/System/Runtime/Serialization/ISafeSerializationData.cs @@ -69,7 +69,7 @@ namespace System.Runtime.Serialization // ... // realSerializedDataN // safeSerializationData -> this is the serialization data member of the parent type - // m_serializedState -> list of saved serialized states from subclasses responding to the safe + // _serializedState -> list of saved serialized states from subclasses responding to the safe // serialization event // RealTypeSerializationName -> type which is using safe serialization // Type: @@ -135,21 +135,21 @@ namespace System.Runtime.Serialization // // 1. Include a data member of type SafeSerializationManager: // - // private SafeSerializationManager m_safeSerializationManager; + // private SafeSerializationManager _safeSerializationManager; // // 2. Add a protected SerializeObjectState event, which passes through to the SafeSerializationManager: // // protected event EventHandler SerializeObjectState // { - // add { m_safeSerializationManager.SerializeObjectState += value; } - // remove { m_safeSerializationManager.SerializeObjectState -= value; } + // add { _safeSerializationManager.SerializeObjectState += value; } + // remove { _safeSerializationManager.SerializeObjectState -= value; } // } // // 3. Serialize the safe serialization object in GetObjectData, and call its CompleteSerialization method: // // { - // info.AddValue("m_safeSerializationManager", m_safeSerializationManager, typeof(SafeSerializationManager)); - // m_safeSerializationManager.CompleteSerialization(this, info, context); + // info.AddValue("_safeSerializationManager", _safeSerializationManager, typeof(SafeSerializationManager)); + // _safeSerializationManager.CompleteSerialization(this, info, context); // } // // 4. Add an OnDeserialized handler if one doesn't already exist, and call CompleteDeserialization in it: @@ -157,7 +157,7 @@ namespace System.Runtime.Serialization // [OnDeserialized] // private void OnDeserialized(StreamingContext context) // { - // m_safeSerializationManager.CompleteDeserialization(this); + // _safeSerializationManager.CompleteDeserialization(this); // } // // On the client side, using safe serialization is also pretty easy. For example: @@ -168,30 +168,30 @@ namespace System.Runtime.Serialization // [Serializable] // private struct TransparentExceptionState : ISafeSerializationData // { - // public string m_extraData; + // public string _extraData; // // void ISafeSerializationData.CompleteDeserialization(object obj) // { // TransparentException exception = obj as TransparentException; - // exception.m_state = this; + // exception._state = this; // } // } // // [NonSerialized] - // private TransparentExceptionState m_state = new TransparentExceptionState(); + // private TransparentExceptionState _state = new TransparentExceptionState(); // // public TransparentException() // { // SerializeObjectState += delegate(object exception, SafeSerializationEventArgs eventArgs) // { - // eventArgs.AddSerializedState(m_state); + // eventArgs.AddSerializedState(_state); // }; // } // // public string ExtraData // { - // get { return m_state.m_extraData; } - // set { m_state.m_extraData = value; } + // get { return _state._extraData; } + // set { _state._extraData = value; } // } // } // -- 2.7.4