Explorar el Código

Fixed warnings.

drieseng hace 9 años
padre
commit
1cfa14455b

+ 10 - 10
src/Renci.SshNet/Common/BigInteger.cs

@@ -326,7 +326,7 @@ namespace Renci.SshNet.Common
                     ++size;
 
                 _data = new uint[size];
-                int j = 0;
+                var j = 0;
                 for (var i = 0; i < fullWords; ++i)
                 {
                     _data[i] = (uint)value[j++] |
@@ -337,7 +337,7 @@ namespace Renci.SshNet.Common
                 size = len & 0x3;
                 if (size > 0)
                 {
-                    int idx = _data.Length - 1;
+                    var idx = _data.Length - 1;
                     for (var i = 0; i < size; ++i)
                         _data[idx] |= (uint)(value[j++] << (i * 8));
                 }
@@ -373,7 +373,7 @@ namespace Renci.SshNet.Common
                 {
                     word = 0;
                     uint storeMask = 0;
-                    for (int i = 0; i < size; ++i)
+                    for (var i = 0; i < size; ++i)
                     {
                         word |= (uint)(value[j++] << (i * 8));
                         storeMask = (storeMask << 8) | 0xFF;
@@ -1351,7 +1351,7 @@ namespace Renci.SshNet.Common
             }
 
             var res = new uint[size];
-            var carry_shift = 32 - bit_shift;
+            var carryShift = 32 - bit_shift;
 
             for (var i = data.Length - 1; i >= idx_shift; --i)
             {
@@ -1360,7 +1360,7 @@ namespace Renci.SshNet.Common
                 if (i - idx_shift < res.Length)
                     res[i - idx_shift] |= word >> bit_shift;
                 if (i - idx_shift - 1 >= 0)
-                    res[i - idx_shift - 1] = word << carry_shift;
+                    res[i - idx_shift - 1] = word << carryShift;
             }
 
             //Round down instead of toward zero
@@ -1375,7 +1375,7 @@ namespace Renci.SshNet.Common
                         return tmp;
                     }
                 }
-                if (bit_shift > 0 && (data[idx_shift] << carry_shift) != 0u)
+                if (bit_shift > 0 && (data[idx_shift] << carryShift) != 0u)
                 {
                     var tmp = new BigInteger((short)sign, res);
                     --tmp;
@@ -2041,7 +2041,7 @@ namespace Renci.SshNet.Common
                 return false;
             if (_data.Length != other._data.Length)
                 return false;
-            for (int i = 0; i < _data.Length; ++i)
+            for (var i = 0; i < _data.Length; ++i)
             {
                 if (_data[i] != other._data[i])
                     return false;
@@ -2970,10 +2970,10 @@ namespace Renci.SshNet.Common
                 return false;
             }
 
-            var info = provider.GetFormat(typeof(NumberFormatInfo)) as NumberFormatInfo;
+            var info = (NumberFormatInfo) provider.GetFormat(typeof (NumberFormatInfo));
 
-            string negative = info.NegativeSign;
-            string positive = info.PositiveSign;
+            var negative = info.NegativeSign;
+            var positive = info.PositiveSign;
 
             if (string.CompareOrdinal(s, i, positive, 0, positive.Length) == 0)
                 i += positive.Length;

+ 1 - 1
src/Renci.SshNet/PrivateKeyFile.cs

@@ -403,7 +403,7 @@ namespace Renci.SshNet
                 LoadBytes(data);
             }
 
-            public new UInt32 ReadUInt32()
+            public new uint ReadUInt32()
             {
                 return base.ReadUInt32();
             }

+ 8 - 8
src/Renci.SshNet/Security/KeyExchangeEllipticCurveDiffieHellman.cs

@@ -15,37 +15,37 @@ namespace Renci.SshNet.Security
         /// <summary>
         /// Specifies client payload
         /// </summary>
-        protected byte[] _clientPayload;
+        private byte[] _clientPayload;
 
         /// <summary>
         /// Specifies server payload
         /// </summary>
-        protected byte[] _serverPayload;
+        private byte[] _serverPayload;
 
         /// <summary>
         /// Specifies client exchange number.
         /// </summary>
-        protected BigInteger _clientExchangeValue;
+        private BigInteger _clientExchangeValue;
 
         /// <summary>
         /// Specifies server exchange number.
         /// </summary>
-        protected BigInteger _serverExchangeValue;
+        private BigInteger _serverExchangeValue;
 
         /// <summary>
         /// Specifies random generated number.
         /// </summary>
-        protected BigInteger _randomValue;
+        private BigInteger _randomValue;
 
         /// <summary>
         /// Specifies host key data.
         /// </summary>
-        protected byte[] _hostKey;
+        private byte[] _hostKey;
 
         /// <summary>
         /// Specifies signature data.
         /// </summary>
-        protected byte[] _signature;
+        private byte[] _signature;
 
         ////  256
         //p = FFFFFFFF 00000001 00000000 00000000 00000000 FFFFFFFF FFFFFFFF FFFFFFFF
@@ -221,7 +221,7 @@ namespace Renci.SshNet.Security
             //string   Q_C, client's ephemeral public key octet string
             //string   Q_S, server's ephemeral public key octet string
             //mpint    K,   shared secret
-            return this.Hash(hashData);
+            return Hash(hashData);
         }
 
         private class _ExchangeHashData : SshData

+ 2 - 2
src/Renci.SshNet/Sftp/SftpSession.cs

@@ -132,7 +132,7 @@ namespace Renci.SshNet.Sftp
                 fullPath.IndexOf('/') < 0)
                 return fullPath;
 
-            var pathParts = fullPath.Split(new[] { '/' });
+            var pathParts = fullPath.Split('/');
 
             var partialFullPath = string.Join("/", pathParts, 0, pathParts.Length - 1);
 
@@ -502,7 +502,7 @@ namespace Renci.SshNet.Sftp
                             attributes = response.Attributes;
                             wait.Set();
                         },
-                    (response) =>
+                    response =>
                         {
                             exception = GetSftpException(response);
                             wait.Set();