diff options
author | Martin Baulig <mabaul@microsoft.com> | 2019-08-02 01:46:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-02 01:46:15 +0300 |
commit | 455b051ce525cc1ca48c33cd4e5c6ae7f1a51a9e (patch) | |
tree | 8e8a3b4ed22ba5c5cf0c4514a4654057b11ba53b /mcs/class/System | |
parent | fcfd3e54a5bbf0b2e0bcab3074af39021bffb206 (diff) |
Fix compiler warnings in System.dll. (#15971)
* Merge the `System.Diagnostics/ProcessStartInfo.cs` part into the referencesource file to avoid CS0282.
* Remove duplicate `using`.
* Fix unreachable code warning that got introduced in my last PR.
Diffstat (limited to 'mcs/class/System')
-rw-r--r-- | mcs/class/System/System.Diagnostics/ProcessStartInfo.cs | 103 | ||||
-rw-r--r-- | mcs/class/System/System.Net.Sockets/Socket.cs | 2 | ||||
-rw-r--r-- | mcs/class/System/System.csproj | 1 | ||||
-rw-r--r-- | mcs/class/System/common.sources | 1 |
4 files changed, 0 insertions, 107 deletions
diff --git a/mcs/class/System/System.Diagnostics/ProcessStartInfo.cs b/mcs/class/System/System.Diagnostics/ProcessStartInfo.cs deleted file mode 100644 index 72248766299..00000000000 --- a/mcs/class/System/System.Diagnostics/ProcessStartInfo.cs +++ /dev/null @@ -1,103 +0,0 @@ -// -// System.Diagnostics.ProcessStartInfo.cs -// -// Authors: -// Dick Porter (dick@ximian.com) -// Andreas Nahr (ClassDevelopment@A-SoftTech.com) -// -// (C) 2002 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. -// - -using Microsoft.Win32; -using System.Collections; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using System.IO; -using System.Security; -using System.Security.Permissions; -using System.Text; -using System.Runtime.InteropServices; - -namespace System.Diagnostics -{ - [StructLayout (LayoutKind.Sequential)] - public sealed partial class ProcessStartInfo - { - internal bool HaveEnvVars { - get { return (environmentVariables != null); } - } - - Collection<string> _argumentList; - - public Collection<string> ArgumentList { - get { - if (_argumentList == null) { - _argumentList = new Collection<string>(); - } - return _argumentList; - } - } - - public Encoding StandardInputEncoding { get; set; } - - static readonly string [] empty = new string [0]; - - [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden), Browsable (false)] - public string[] Verbs { - get { -#if MOBILE - return empty; -#else - switch (System.Environment.OSVersion.Platform) { - case (PlatformID)4: - case (PlatformID)6: - case (PlatformID)128: - return empty; // no verb on non-Windows - default: - string ext = String.IsNullOrEmpty (fileName) ? null : Path.GetExtension (fileName); - if (ext == null) - return empty; - - RegistryKey rk = null, rk2 = null, rk3 = null; - try { - rk = Registry.ClassesRoot.OpenSubKey (ext); - string k = rk != null ? rk.GetValue (null) as string : null; - rk2 = k != null ? Registry.ClassesRoot.OpenSubKey (k) : null; - rk3 = rk2 != null ? rk2.OpenSubKey ("shell") : null; - return rk3 != null ? rk3.GetSubKeyNames () : null; - } finally { - if (rk3 != null) - rk3.Close (); - if (rk2 != null) - rk2.Close (); - if (rk != null) - rk.Close (); - } - } -#endif - } - } - } -} diff --git a/mcs/class/System/System.Net.Sockets/Socket.cs b/mcs/class/System/System.Net.Sockets/Socket.cs index 00fb6303434..0c9041b8e5d 100644 --- a/mcs/class/System/System.Net.Sockets/Socket.cs +++ b/mcs/class/System/System.Net.Sockets/Socket.cs @@ -971,8 +971,6 @@ namespace System.Net.Sockets e.socket_async_result.Complete (exc, true); return false; } - - return true; } public static void CancelConnectAsync (SocketAsyncEventArgs e) diff --git a/mcs/class/System/System.csproj b/mcs/class/System/System.csproj index 7519128a773..f96864e2407 100644 --- a/mcs/class/System/System.csproj +++ b/mcs/class/System/System.csproj @@ -856,7 +856,6 @@ <Compile Include="System.Diagnostics\Process.cs" /> <Compile Include="System.Diagnostics\ProcessModule.cs" /> <Compile Include="System.Diagnostics\ProcessPriorityClass.cs" /> - <Compile Include="System.Diagnostics\ProcessStartInfo.cs" /> <Compile Include="System.Diagnostics\ProcessThread.cs" /> <Compile Include="System.Diagnostics\ProcessWindowStyle.cs" /> <Compile Include="System.Diagnostics\Stopwatch.cs" /> diff --git a/mcs/class/System/common.sources b/mcs/class/System/common.sources index e4d69c0da23..26cb114a88b 100644 --- a/mcs/class/System/common.sources +++ b/mcs/class/System/common.sources @@ -16,7 +16,6 @@ System.Diagnostics/MonitoringDescriptionAttribute.cs System.Diagnostics/Process.cs System.Diagnostics/ProcessModule.cs System.Diagnostics/ProcessPriorityClass.cs -System.Diagnostics/ProcessStartInfo.cs System.Diagnostics/ProcessThread.cs System.Diagnostics/ProcessWindowStyle.cs System.Diagnostics/Stopwatch.cs |