Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions etc/c/odbc/sqlext.d
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ enum int SQL_ATTR_ANSI_APP = 115;
// * SQL_ACCESS_MODE options *
enum : uint
{
SQL_MODE_READ_WRITE = 0UL,
SQL_MODE_READ_WRITE,
SQL_MODE_READ_ONLY = 1UL,
SQL_MODE_DEFAULT = SQL_MODE_READ_WRITE
}

// * SQL_AUTOCOMMIT options *
enum : uint
{
SQL_AUTOCOMMIT_OFF = 0UL,
SQL_AUTOCOMMIT_OFF,
SQL_AUTOCOMMIT_ON = 1UL,
SQL_AUTOCOMMIT_DEFAULT = SQL_AUTOCOMMIT_ON
}
Expand All @@ -138,7 +138,7 @@ enum uint SQL_LOGIN_TIMEOUT_DEFAULT = 15UL;
// * SQL_OPT_TRACE options *
enum : uint
{
SQL_OPT_TRACE_OFF = 0UL,
SQL_OPT_TRACE_OFF,
SQL_OPT_TRACE_ON = 1UL,
SQL_OPT_TRACE_DEFAULT = SQL_OPT_TRACE_OFF
}
Expand All @@ -148,7 +148,7 @@ immutable char[] SQL_OPT_TRACE_FILE_DEFAULT = r"\SQL.LOG";
// * SQL_ODBC_CURSORS options *
enum : uint
{
SQL_CUR_USE_IF_NEEDED = 0UL,
SQL_CUR_USE_IF_NEEDED,
SQL_CUR_USE_ODBC = 1UL,
SQL_CUR_USE_DRIVER = 2UL,
SQL_CUR_DEFAULT = SQL_CUR_USE_DRIVER
Expand All @@ -157,7 +157,7 @@ enum : uint
enum
{
// * values for SQL_ATTR_DISCONNECT_BEHAVIOR *
SQL_DB_RETURN_TO_POOL = 0UL,
SQL_DB_RETURN_TO_POOL,
SQL_DB_DISCONNECT = 1UL,
SQL_DB_DEFAULT = SQL_DB_RETURN_TO_POOL,

Expand All @@ -168,7 +168,7 @@ enum

// * values for SQL_ATTR_CONNECTION_DEAD *
enum int SQL_CD_TRUE = 1L; // * Connection is closed/dead *
enum int SQL_CD_FALSE = 0L; // * Connection is open/available *
enum int SQL_CD_FALSE = 0L; // * Connection is open/available *

// * values for SQL_ATTR_ANSI_APP ( ODBC v3.51 ) *
enum int SQL_AA_TRUE = 1L; // * the application is an ANSI app *
Expand All @@ -177,7 +177,7 @@ enum int SQL_AA_FALSE = 0L; // * the application is a Unicode app *
// * statement attributes *
enum
{
SQL_QUERY_TIMEOUT = 0,
SQL_QUERY_TIMEOUT,
SQL_MAX_ROWS = 1,
SQL_NOSCAN = 2,
SQL_MAX_LENGTH = 3,
Expand Down Expand Up @@ -238,15 +238,15 @@ enum
// * the value of SQL_ATTR_PARAM_BIND_TYPE *
enum : uint
{
SQL_PARAM_BIND_BY_COLUMN = 0UL,
SQL_PARAM_BIND_BY_COLUMN,
SQL_PARAM_BIND_TYPE_DEFAULT = SQL_PARAM_BIND_BY_COLUMN
}

// * SQL_QUERY_TIMEOUT options *
enum uint SQL_QUERY_TIMEOUT_DEFAULT = 0UL;
enum uint SQL_QUERY_TIMEOUT_DEFAULT = 0L;

// * SQL_MAX_ROWS options *
enum uint SQL_MAX_ROWS_DEFAULT = 0UL;
enum uint SQL_MAX_ROWS_DEFAULT = 0L;

// * SQL_NOSCAN options *
enum : uint
Expand All @@ -257,7 +257,7 @@ enum : uint
}

// * SQL_MAX_LENGTH options *
enum uint SQL_MAX_LENGTH_DEFAULT = 0UL;
enum uint SQL_MAX_LENGTH_DEFAULT = 0L;

// * values for SQL_ATTR_ASYNC_ENABLE *
enum : uint
Expand Down Expand Up @@ -298,7 +298,7 @@ enum : uint
enum uint SQL_ROWSET_SIZE_DEFAULT = 1UL;

// * SQL_KEYSET_SIZE options *
enum uint SQL_KEYSET_SIZE_DEFAULT = 0UL;
enum uint SQL_KEYSET_SIZE_DEFAULT = 0L;

// * SQL_SIMULATE_CURSOR options *
enum : uint
Expand Down Expand Up @@ -527,7 +527,7 @@ enum
SQL_C_GUID = SQL_GUID /* GUID */
}

enum int SQL_TYPE_NULL = 0;
enum int SQL_TYPE_NULL = 0L;

// * define for SQL_DIAG_ROW_NUMBER and SQL_DIAG_COLUMN_NUMBER *
enum : uint
Expand Down Expand Up @@ -1642,7 +1642,7 @@ enum
' defined in sql.d
'
+/
enum int SQL_TABLE_STAT = 0;
enum int SQL_TABLE_STAT = 0L;

// * Defines for SQLTables *
immutable char[] SQL_ALL_CATALOGS = "%";
Expand Down
2 changes: 1 addition & 1 deletion etc/c/zlib.d
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ enum
}
/* The deflate compression method (the only one supported in this version) */

const int Z_NULL = 0; /* for initializing zalloc, zfree, opaque */
const int Z_NULL; /* for initializing zalloc, zfree, opaque */

/* basic functions */

Expand Down
28 changes: 14 additions & 14 deletions std/algorithm/iteration.d
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ if (isBidirectionalRange!Range)
import std.range, std.stdio;
import std.typecons : tuple;

ulong counter = 0;
ulong counter;
double fun(int x)
{
++counter;
Expand Down Expand Up @@ -221,7 +221,7 @@ same cost or side effects.
{
import std.algorithm.comparison : equal;
import std.range;
int i = 0;
int i;

auto r = iota(0, 4).tee!((a){i = a;}, No.pipeOnPop);
auto r1 = r.take(3).cache();
Expand Down Expand Up @@ -294,7 +294,7 @@ same cost or side effects.
{
static struct Range
{
bool initialized = false;
bool initialized;
bool front() @property {return initialized = true;}
void popFront() {initialized = false;}
enum empty = false;
Expand Down Expand Up @@ -514,7 +514,7 @@ function.
auto sums = [2, 4, 6, 8];
auto products = [1, 4, 9, 16];

size_t i = 0;
size_t i;
foreach (result; [ 1, 2, 3, 4 ].map!("a + a", "a * a"))
{
assert(result[0] == sums[i]);
Expand Down Expand Up @@ -905,7 +905,7 @@ public:
}
else // if (isRangeBinaryIterable!Range)
{
size_t i = 0;
size_t i;
while (!r.empty)
{
cast(void) binaryFun!BinaryArgs(i, r.front);
Expand Down Expand Up @@ -1809,7 +1809,7 @@ if (isForwardRange!Range)
{
import std.algorithm.comparison : equal;

size_t popCount = 0;
size_t popCount;
class RefFwdRange
{
int[] impl;
Expand Down Expand Up @@ -2839,7 +2839,7 @@ if (fun.length >= 1)
algoFormat("Seed %s does not have the correct amount of fields (should be %s)", Args.stringof, fun.length));
alias E = Select!(isInputRange!R, ElementType!R, ForeachType!R);

static if (mustInitialize) bool initialized = false;
static if (mustInitialize) bool initialized;
foreach (/+auto ref+/ E e; r) // @@@4707@@@
{
foreach (i, f; binfuns)
Expand Down Expand Up @@ -3065,14 +3065,14 @@ The number of seeds must be correspondingly increased.

@system unittest
{
int i = 0;
int i;
static struct OpApply
{
int opApply(int delegate(ref int) dg)
{
int[] a = [1, 2, 3];

int res = 0;
int res;
foreach (ref e; a)
{
res = dg(e);
Expand Down Expand Up @@ -3155,7 +3155,7 @@ private template ReduceSeedType(E)
alias ReduceSeedType = Unqual!(typeof(fun(lvalueOf!E, lvalueOf!E)));

//Check the Seed type is useable.
ReduceSeedType s = ReduceSeedType.init;
ReduceSeedType s;
static assert(is(typeof({ReduceSeedType s = lvalueOf!E;})) &&
is(typeof(lvalueOf!ReduceSeedType = fun(lvalueOf!ReduceSeedType, lvalueOf!E))),
algoFormat(
Expand Down Expand Up @@ -4240,7 +4240,7 @@ private struct SplitterResult(alias isTerminator, Range)
enum fullSlicing = (hasLength!Range && hasSlicing!Range) || isSomeString!Range;

private Range _input;
private size_t _end = 0;
private size_t _end;
static if (!fullSlicing)
private Range _next;

Expand Down Expand Up @@ -4717,7 +4717,7 @@ if (isInputRange!R && !isInfinite!R)
// elsewhere in std.algorithm and std.range on 64 bit platforms. The 16 in log2(16) comes
// from the manual unrolling in sumPairWise16
F[64] store = void;
size_t idx = 0;
size_t idx;

void collapseStore(T)(T k)
{
Expand All @@ -4744,7 +4744,7 @@ if (isInputRange!R && !isInfinite!R)
++idx;
}

size_t i = 0;
size_t i;
foreach (el; data)
{
store[idx] = el;
Expand All @@ -4755,7 +4755,7 @@ if (isInputRange!R && !isInfinite!R)
}
else
{
size_t k = 0;
size_t k;
while (!data.empty)
{
store[idx] = sumPairwiseN!(16, true, F)(data);
Expand Down
20 changes: 10 additions & 10 deletions std/algorithm/mutation.d
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ pure nothrow @safe @nogc unittest
// Issue 5661 test(1)
static struct S3
{
static struct X { int n = 0; ~this(){n = 0;} }
static struct X { int n; ~this(){n = 0;} }
X x;
}
static assert(hasElaborateDestructor!S3);
Expand All @@ -1134,7 +1134,7 @@ pure nothrow @safe @nogc unittest
// Issue 5661 test(2)
static struct S4
{
static struct X { int n = 0; this(this){n = 0;} }
static struct X { int n; this(this){n = 0;} }
X x;
}
static assert(hasElaborateCopyConstructor!S4);
Expand Down Expand Up @@ -1233,7 +1233,7 @@ private T moveImpl(T)(ref T source)
// Issue 5661 test(1)
static struct S3
{
static struct X { int n = 0; ~this(){n = 0;} }
static struct X { int n; ~this(){n = 0;} }
X x;
}
static assert(hasElaborateDestructor!S3);
Expand All @@ -1246,7 +1246,7 @@ private T moveImpl(T)(ref T source)
// Issue 5661 test(2)
static struct S4
{
static struct X { int n = 0; this(this){n = 0;} }
static struct X { int n; this(this){n = 0;} }
X x;
}
static assert(hasElaborateCopyConstructor!S4);
Expand All @@ -1268,7 +1268,7 @@ private T moveImpl(T)(ref T source)

@system unittest
{
static struct S { int n = 0; ~this() @system { n = 0; } }
static struct S { int n; ~this() @system { n = 0; } }
S a, b;
static assert(!__traits(compiles, () @safe { move(a, b); }));
static assert(!__traits(compiles, () @safe { move(a); }));
Expand Down Expand Up @@ -1775,9 +1775,9 @@ if (s != SwapStrategy.stable
}
}

size_t left = 0, right = offset.length - 1;
size_t left, right = offset.length - 1;
auto tgt = range.save;
size_t tgtPos = 0;
size_t tgtPos;

while (left <= right)
{
Expand Down Expand Up @@ -2167,15 +2167,15 @@ if (isRandomAccessRange!Range && hasLength!Range)
//swapAt is in fact the only way to swap non lvalue ranges
immutable last = r.length-1;
immutable steps = r.length/2;
for (size_t i = 0; i < steps; i++)
for (size_t i; i < steps; i++)
{
r.swapAt(i, last-i);
}
}

@safe unittest
{
int[] range = null;
int[] range;
reverse(range);
range = [ 1 ];
reverse(range);
Expand Down Expand Up @@ -2209,7 +2209,7 @@ if (isNarrowString!(Char[]) && !is(Char == const) && !is(Char == immutable))
import std.utf : stride;

auto r = representation(s);
for (size_t i = 0; i < s.length; )
for (size_t i; i < s.length; )
{
immutable step = stride(s, i);
if (step > 1)
Expand Down
Loading