Skip to content

Commit d0a0c7c

Browse files
author
Michael Hallett
committed
added this prefix to the compression library (missed before) and cleared warn as error on build in windows phone project
1 parent 7974f06 commit d0a0c7c

File tree

10 files changed

+196
-197
lines changed

10 files changed

+196
-197
lines changed

.nuget/RestSharp.Build.dll

-512 Bytes
Binary file not shown.

.nuget/Signed/RestSharp.Build.dll

-512 Bytes
Binary file not shown.

RestSharp/Compression/ZLib/Crc32.cs

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public int Crc32Result
9999
get
100100
{
101101
// return one's complement of the running result
102-
return unchecked((int) (~runningCrc32Result));
102+
return unchecked((int) (~this.runningCrc32Result));
103103
}
104104
}
105105

@@ -110,7 +110,7 @@ public int Crc32Result
110110
/// <returns>the CRC32 calculation</returns>
111111
public int GetCrc32(Stream input)
112112
{
113-
return GetCrc32AndCopy(input, null);
113+
return this.GetCrc32AndCopy(input, null);
114114
}
115115

116116
/// <summary>
@@ -132,26 +132,26 @@ public int GetCrc32AndCopy(Stream input, Stream output)
132132
byte[] buffer = new byte[BUFFER_SIZE];
133133
const int readSize = BUFFER_SIZE;
134134

135-
TotalBytesRead = 0;
135+
this.TotalBytesRead = 0;
136136
int count = input.Read(buffer, 0, readSize);
137137

138138
if (output != null)
139139
output.Write(buffer, 0, count);
140140

141-
TotalBytesRead += count;
141+
this.TotalBytesRead += count;
142142

143143
while (count > 0)
144144
{
145-
SlurpBlock(buffer, 0, count);
145+
this.SlurpBlock(buffer, 0, count);
146146
count = input.Read(buffer, 0, readSize);
147147

148148
if (output != null)
149149
output.Write(buffer, 0, count);
150150

151-
TotalBytesRead += count;
151+
this.TotalBytesRead += count;
152152
}
153153

154-
return (int) (~runningCrc32Result);
154+
return (int) (~this.runningCrc32Result);
155155
}
156156
}
157157

@@ -164,7 +164,7 @@ public int GetCrc32AndCopy(Stream input, Stream output)
164164
/// <returns>The CRC-ized result.</returns>
165165
public int ComputeCrc32(int w, byte b)
166166
{
167-
return InternalComputeCrc32((uint) w, b);
167+
return this.InternalComputeCrc32((uint) w, b);
168168
}
169169

170170
internal int InternalComputeCrc32(uint w, byte b)
@@ -188,10 +188,10 @@ public void SlurpBlock(byte[] block, int offset, int count)
188188
{
189189
int x = offset + i;
190190

191-
runningCrc32Result = ((runningCrc32Result) >> 8) ^ crc32Table[(block[x]) ^ ((runningCrc32Result) & 0x000000FF)];
191+
this.runningCrc32Result = ((this.runningCrc32Result) >> 8) ^ crc32Table[(block[x]) ^ ((this.runningCrc32Result) & 0x000000FF)];
192192
}
193193

194-
TotalBytesRead += count;
194+
this.TotalBytesRead += count;
195195
}
196196
}
197197

@@ -282,10 +282,10 @@ public CrcCalculatorStream(Stream stream, long length, bool leaveOpen)
282282
// value.
283283
private CrcCalculatorStream(bool leaveOpen, long length, Stream stream)
284284
{
285-
innerStream = stream;
286-
crc32 = new Crc32();
287-
lengthLimit = length;
288-
LeaveOpen = leaveOpen;
285+
this.innerStream = stream;
286+
this.crc32 = new Crc32();
287+
this.lengthLimit = length;
288+
this.LeaveOpen = leaveOpen;
289289
}
290290

291291
/// <summary>
@@ -296,12 +296,12 @@ private CrcCalculatorStream(bool leaveOpen, long length, Stream stream)
296296
/// This is either the total number of bytes read, or the total number of bytes
297297
/// written, depending on the direction of this stream.
298298
/// </remarks>
299-
public long TotalBytesSlurped { get { return crc32.TotalBytesRead; } }
299+
public long TotalBytesSlurped { get { return this.crc32.TotalBytesRead; } }
300300

301301
/// <summary>
302302
/// Provides the current CRC for all blocks slurped in.
303303
/// </summary>
304-
public int Crc { get { return crc32.Crc32Result; } }
304+
public int Crc { get { return this.crc32.Crc32Result; } }
305305

306306
/// <summary>
307307
/// Indicates whether the underlying stream will be left open when the
@@ -328,21 +328,21 @@ public override int Read(byte[] buffer, int offset, int count)
328328
// calling ReadToEnd() on it, We can "over-read" the zip data and get a
329329
// corrupt string. The length limits that, prevents that problem.
330330

331-
if (lengthLimit != UNSET_LENGTH_LIMIT)
331+
if (this.lengthLimit != UNSET_LENGTH_LIMIT)
332332
{
333-
if (crc32.TotalBytesRead >= lengthLimit)
333+
if (this.crc32.TotalBytesRead >= this.lengthLimit)
334334
return 0; // EOF
335335

336-
long bytesRemaining = lengthLimit - crc32.TotalBytesRead;
336+
long bytesRemaining = this.lengthLimit - this.crc32.TotalBytesRead;
337337

338338
if (bytesRemaining < count)
339339
bytesToRead = (int) bytesRemaining;
340340
}
341341

342-
int n = innerStream.Read(buffer, offset, bytesToRead);
342+
int n = this.innerStream.Read(buffer, offset, bytesToRead);
343343

344344
if (n > 0)
345-
crc32.SlurpBlock(buffer, offset, n);
345+
this.crc32.SlurpBlock(buffer, offset, n);
346346

347347
return n;
348348
}
@@ -356,57 +356,57 @@ public override int Read(byte[] buffer, int offset, int count)
356356
public override void Write(byte[] buffer, int offset, int count)
357357
{
358358
if (count > 0)
359-
crc32.SlurpBlock(buffer, offset, count);
359+
this.crc32.SlurpBlock(buffer, offset, count);
360360

361-
innerStream.Write(buffer, offset, count);
361+
this.innerStream.Write(buffer, offset, count);
362362
}
363363

364364
/// <summary>
365365
/// Indicates whether the stream supports reading.
366366
/// </summary>
367367
public override bool CanRead
368368
{
369-
get { return innerStream.CanRead; }
369+
get { return this.innerStream.CanRead; }
370370
}
371371

372372
/// <summary>
373373
/// Indicates whether the stream supports seeking.
374374
/// </summary>
375375
public override bool CanSeek
376376
{
377-
get { return innerStream.CanSeek; }
377+
get { return this.innerStream.CanSeek; }
378378
}
379379

380380
/// <summary>
381381
/// Indicates whether the stream supports writing.
382382
/// </summary>
383383
public override bool CanWrite
384384
{
385-
get { return innerStream.CanWrite; }
385+
get { return this.innerStream.CanWrite; }
386386
}
387387

388388
/// <summary>
389389
/// Flush the stream.
390390
/// </summary>
391391
public override void Flush()
392392
{
393-
innerStream.Flush();
393+
this.innerStream.Flush();
394394
}
395395

396396
/// <summary>
397397
/// Not implemented.
398398
/// </summary>
399399
public override long Length
400400
{
401-
get { return lengthLimit == UNSET_LENGTH_LIMIT ? innerStream.Length : lengthLimit; }
401+
get { return this.lengthLimit == UNSET_LENGTH_LIMIT ? this.innerStream.Length : this.lengthLimit; }
402402
}
403403

404404
/// <summary>
405405
/// Not implemented.
406406
/// </summary>
407407
public override long Position
408408
{
409-
get { return crc32.TotalBytesRead; }
409+
get { return this.crc32.TotalBytesRead; }
410410
set { throw new NotImplementedException(); }
411411
}
412412

@@ -432,7 +432,7 @@ public override void SetLength(long value)
432432

433433
void IDisposable.Dispose()
434434
{
435-
Close();
435+
this.Close();
436436
}
437437

438438
/// <summary>
@@ -442,8 +442,8 @@ public override void Close()
442442
{
443443
base.Close();
444444

445-
if (!LeaveOpen)
446-
innerStream.Close();
445+
if (!this.LeaveOpen)
446+
this.innerStream.Close();
447447
}
448448
}
449449
}

0 commit comments

Comments
 (0)