Remove unused variables

This commit is contained in:
Eugen Wissner 2018-05-06 07:03:11 +02:00
parent 5c8c0ce4d8
commit 6ed2992862
4 changed files with 7 additions and 10 deletions

View File

@ -23,7 +23,7 @@ if_else_same_check="skip-unittest"
; Checks for some problems with constructors
constructor_check="skip-unittest"
; Checks for unused variables and function parameters
unused_variable_check="disabled"
unused_variable_check="skip-unittest"
; Checks for unused labels
unused_label_check="skip-unittest"
; Checks for duplicate attributes

View File

@ -20,7 +20,6 @@ import tanya.meta.trait;
version (unittest)
{
private int fillBuffer(ubyte[] buffer,
in size_t size,
int start = 0,
int end = 10) @nogc pure nothrow
in
@ -173,7 +172,7 @@ struct ReadBuffer(T = ubyte)
assert(b.free == 0);
// Fills the buffer with values 0..10
numberRead = fillBuffer(b[], b.free, 0, 10);
numberRead = fillBuffer(b[], 0, 10);
b += numberRead;
assert(b.free == b.blockSize - numberRead);
b.clear();
@ -204,7 +203,7 @@ struct ReadBuffer(T = ubyte)
ubyte[] result;
// Fills the buffer with values 0..10
numberRead = fillBuffer(b[], b.free, 0, 10);
numberRead = fillBuffer(b[], 0, 10);
b += numberRead;
result = b[0 .. $];
@ -214,10 +213,10 @@ struct ReadBuffer(T = ubyte)
b.clear();
// It shouldn't overwrite, but append another 5 bytes to the buffer
numberRead = fillBuffer(b[], b.free, 0, 10);
numberRead = fillBuffer(b[], 0, 10);
b += numberRead;
numberRead = fillBuffer(b[], b.free, 20, 25);
numberRead = fillBuffer(b[], 20, 25);
b += numberRead;
result = b[0..$];
@ -279,7 +278,7 @@ struct ReadBuffer(T = ubyte)
ubyte[] result;
// Fills the buffer with values 0..10
numberRead = fillBuffer(b[], b.free, 0, 10);
numberRead = fillBuffer(b[], 0, 10);
b += numberRead;
assert(b.length == 10);
@ -599,8 +598,6 @@ struct WriteBuffer(T = ubyte)
*/
T[] opSlice(in size_t start, in size_t end)
{
immutable internStart = this.start + start;
if (position > ring || position < start) // Buffer overflowed
{
return buffer_[this.start .. ring + 1 - length + end];

View File

@ -632,7 +632,6 @@ do
size_t i;
auto tmp1 = Integer(x, x.allocator);
auto result = Integer(x.allocator);
bool firstBit;
if (x.size == 0 && y.size != 0)
{

View File

@ -104,6 +104,7 @@ final class Mallocator : Allocator
bool reallocateInPlace(ref void[] p, size_t size)
@nogc nothrow pure shared @system
{
cast(void) size;
return false;
}