remove duplicates
authorMarco Rossignoli <marco.rossignoli@gmail.com>
Tue, 1 May 2018 17:45:59 +0000 (19:45 +0200)
committerJan Kotas <jkotas@microsoft.com>
Tue, 1 May 2018 22:40:13 +0000 (15:40 -0700)
src/mscorlib/shared/Interop/Unix/Interop.Errors.cs
src/mscorlib/shared/Interop/Windows/Kernel32/Interop.FileTypes.cs
src/mscorlib/shared/System/Buffers/Utilities.cs

index e8aef99..9cb0580 100644 (file)
@@ -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.
index 1d30666..9d52f1f 100644 (file)
@@ -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;
index 4f115fe..63ae1a9 100644 (file)
@@ -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;
         }