From d8f028d7a47e6e2872d733346509e3be1e64ceb4 Mon Sep 17 00:00:00 2001 From: Marco Rossignoli Date: Tue, 1 May 2018 19:45:59 +0200 Subject: [PATCH] remove duplicates --- src/mscorlib/shared/Interop/Unix/Interop.Errors.cs | 2 ++ .../shared/Interop/Windows/Kernel32/Interop.FileTypes.cs | 1 + src/mscorlib/shared/System/Buffers/Utilities.cs | 10 ++++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/mscorlib/shared/Interop/Unix/Interop.Errors.cs b/src/mscorlib/shared/Interop/Unix/Interop.Errors.cs index e8aef99..9cb0580 100644 --- a/src/mscorlib/shared/Interop/Unix/Interop.Errors.cs +++ b/src/mscorlib/shared/Interop/Unix/Interop.Errors.cs @@ -75,11 +75,13 @@ internal static partial class Interop ENOTCONN = 0x10038, // The socket is not connected. ENOTDIR = 0x10039, // Not a directory or a symbolic link to a directory. ENOTEMPTY = 0x1003A, // Directory not empty. + ENOTRECOVERABLE = 0x1003B, // State not recoverable. ENOTSOCK = 0x1003C, // Not a socket. ENOTSUP = 0x1003D, // Not supported (same value as EOPNOTSUP). ENOTTY = 0x1003E, // Inappropriate I/O control operation. ENXIO = 0x1003F, // No such device or address. EOVERFLOW = 0x10040, // Value too large to be stored in data type. + EOWNERDEAD = 0x10041, // Previous owner died. EPERM = 0x10042, // Operation not permitted. EPIPE = 0x10043, // Broken pipe. EPROTO = 0x10044, // Protocol error. diff --git a/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.FileTypes.cs b/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.FileTypes.cs index 1d30666..9d52f1f 100644 --- a/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.FileTypes.cs +++ b/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.FileTypes.cs @@ -8,6 +8,7 @@ internal partial class Interop { internal partial class FileTypes { + internal const int FILE_TYPE_UNKNOWN = 0x0000; internal const int FILE_TYPE_DISK = 0x0001; internal const int FILE_TYPE_CHAR = 0x0002; internal const int FILE_TYPE_PIPE = 0x0003; diff --git a/src/mscorlib/shared/System/Buffers/Utilities.cs b/src/mscorlib/shared/System/Buffers/Utilities.cs index 4f115fe..63ae1a9 100644 --- a/src/mscorlib/shared/System/Buffers/Utilities.cs +++ b/src/mscorlib/shared/System/Buffers/Utilities.cs @@ -12,14 +12,16 @@ namespace System.Buffers [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static int SelectBucketIndex(int bufferSize) { + Debug.Assert(bufferSize > 0); + uint bitsRemaining = ((uint)bufferSize - 1) >> 4; int poolIndex = 0; if (bitsRemaining > 0xFFFF) { bitsRemaining >>= 16; poolIndex = 16; } - if (bitsRemaining > 0xFF) { bitsRemaining >>= 8; poolIndex += 8; } - if (bitsRemaining > 0xF) { bitsRemaining >>= 4; poolIndex += 4; } - if (bitsRemaining > 0x3) { bitsRemaining >>= 2; poolIndex += 2; } - if (bitsRemaining > 0x1) { bitsRemaining >>= 1; poolIndex += 1; } + if (bitsRemaining > 0xFF) { bitsRemaining >>= 8; poolIndex += 8; } + if (bitsRemaining > 0xF) { bitsRemaining >>= 4; poolIndex += 4; } + if (bitsRemaining > 0x3) { bitsRemaining >>= 2; poolIndex += 2; } + if (bitsRemaining > 0x1) { bitsRemaining >>= 1; poolIndex += 1; } return poolIndex + (int)bitsRemaining; } -- 2.7.4