Skip to content

Commit 1cfa144

Browse files
committed
Fixed warnings.
1 parent eb044f5 commit 1cfa144

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

src/Renci.SshNet/Common/BigInteger.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ public BigInteger(byte[] value)
326326
++size;
327327

328328
_data = new uint[size];
329-
int j = 0;
329+
var j = 0;
330330
for (var i = 0; i < fullWords; ++i)
331331
{
332332
_data[i] = (uint)value[j++] |
@@ -337,7 +337,7 @@ public BigInteger(byte[] value)
337337
size = len & 0x3;
338338
if (size > 0)
339339
{
340-
int idx = _data.Length - 1;
340+
var idx = _data.Length - 1;
341341
for (var i = 0; i < size; ++i)
342342
_data[idx] |= (uint)(value[j++] << (i * 8));
343343
}
@@ -373,7 +373,7 @@ public BigInteger(byte[] value)
373373
{
374374
word = 0;
375375
uint storeMask = 0;
376-
for (int i = 0; i < size; ++i)
376+
for (var i = 0; i < size; ++i)
377377
{
378378
word |= (uint)(value[j++] << (i * 8));
379379
storeMask = (storeMask << 8) | 0xFF;
@@ -1351,7 +1351,7 @@ public static explicit operator BigInteger(decimal value)
13511351
}
13521352

13531353
var res = new uint[size];
1354-
var carry_shift = 32 - bit_shift;
1354+
var carryShift = 32 - bit_shift;
13551355

13561356
for (var i = data.Length - 1; i >= idx_shift; --i)
13571357
{
@@ -1360,7 +1360,7 @@ public static explicit operator BigInteger(decimal value)
13601360
if (i - idx_shift < res.Length)
13611361
res[i - idx_shift] |= word >> bit_shift;
13621362
if (i - idx_shift - 1 >= 0)
1363-
res[i - idx_shift - 1] = word << carry_shift;
1363+
res[i - idx_shift - 1] = word << carryShift;
13641364
}
13651365

13661366
//Round down instead of toward zero
@@ -1375,7 +1375,7 @@ public static explicit operator BigInteger(decimal value)
13751375
return tmp;
13761376
}
13771377
}
1378-
if (bit_shift > 0 && (data[idx_shift] << carry_shift) != 0u)
1378+
if (bit_shift > 0 && (data[idx_shift] << carryShift) != 0u)
13791379
{
13801380
var tmp = new BigInteger((short)sign, res);
13811381
--tmp;
@@ -2041,7 +2041,7 @@ public bool Equals(BigInteger other)
20412041
return false;
20422042
if (_data.Length != other._data.Length)
20432043
return false;
2044-
for (int i = 0; i < _data.Length; ++i)
2044+
for (var i = 0; i < _data.Length; ++i)
20452045
{
20462046
if (_data[i] != other._data[i])
20472047
return false;
@@ -2970,10 +2970,10 @@ private static bool Parse(string s, bool tryParse, NumberStyles style, IFormatPr
29702970
return false;
29712971
}
29722972

2973-
var info = provider.GetFormat(typeof(NumberFormatInfo)) as NumberFormatInfo;
2973+
var info = (NumberFormatInfo) provider.GetFormat(typeof (NumberFormatInfo));
29742974

2975-
string negative = info.NegativeSign;
2976-
string positive = info.PositiveSign;
2975+
var negative = info.NegativeSign;
2976+
var positive = info.PositiveSign;
29772977

29782978
if (string.CompareOrdinal(s, i, positive, 0, positive.Length) == 0)
29792979
i += positive.Length;

src/Renci.SshNet/PrivateKeyFile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ public SshDataReader(byte[] data)
403403
LoadBytes(data);
404404
}
405405

406-
public new UInt32 ReadUInt32()
406+
public new uint ReadUInt32()
407407
{
408408
return base.ReadUInt32();
409409
}

src/Renci.SshNet/Security/KeyExchangeEllipticCurveDiffieHellman.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,37 @@ public class KeyExchangeEllipticCurveDiffieHellman : KeyExchange
1515
/// <summary>
1616
/// Specifies client payload
1717
/// </summary>
18-
protected byte[] _clientPayload;
18+
private byte[] _clientPayload;
1919

2020
/// <summary>
2121
/// Specifies server payload
2222
/// </summary>
23-
protected byte[] _serverPayload;
23+
private byte[] _serverPayload;
2424

2525
/// <summary>
2626
/// Specifies client exchange number.
2727
/// </summary>
28-
protected BigInteger _clientExchangeValue;
28+
private BigInteger _clientExchangeValue;
2929

3030
/// <summary>
3131
/// Specifies server exchange number.
3232
/// </summary>
33-
protected BigInteger _serverExchangeValue;
33+
private BigInteger _serverExchangeValue;
3434

3535
/// <summary>
3636
/// Specifies random generated number.
3737
/// </summary>
38-
protected BigInteger _randomValue;
38+
private BigInteger _randomValue;
3939

4040
/// <summary>
4141
/// Specifies host key data.
4242
/// </summary>
43-
protected byte[] _hostKey;
43+
private byte[] _hostKey;
4444

4545
/// <summary>
4646
/// Specifies signature data.
4747
/// </summary>
48-
protected byte[] _signature;
48+
private byte[] _signature;
4949

5050
//// 256
5151
//p = FFFFFFFF 00000001 00000000 00000000 00000000 FFFFFFFF FFFFFFFF FFFFFFFF
@@ -221,7 +221,7 @@ protected override byte[] CalculateHash()
221221
//string Q_C, client's ephemeral public key octet string
222222
//string Q_S, server's ephemeral public key octet string
223223
//mpint K, shared secret
224-
return this.Hash(hashData);
224+
return Hash(hashData);
225225
}
226226

227227
private class _ExchangeHashData : SshData

src/Renci.SshNet/Sftp/SftpSession.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public string GetCanonicalPath(string path)
132132
fullPath.IndexOf('/') < 0)
133133
return fullPath;
134134

135-
var pathParts = fullPath.Split(new[] { '/' });
135+
var pathParts = fullPath.Split('/');
136136

137137
var partialFullPath = string.Join("/", pathParts, 0, pathParts.Length - 1);
138138

@@ -502,7 +502,7 @@ public SftpFileAttributes RequestFStat(byte[] handle)
502502
attributes = response.Attributes;
503503
wait.Set();
504504
},
505-
(response) =>
505+
response =>
506506
{
507507
exception = GetSftpException(response);
508508
wait.Set();

0 commit comments

Comments
 (0)