Skip to content

Commit

Permalink
Merge pull request #4299 from JackStouffer/patch-6
Browse files Browse the repository at this point in the history
Prepare for long line checks in travis
  • Loading branch information
CyberShadow committed May 11, 2016
2 parents 5e6c5d6 + fdffbeb commit 3636733
Show file tree
Hide file tree
Showing 40 changed files with 19,722 additions and 1,005 deletions.
17 changes: 15 additions & 2 deletions etc/c/curl.d
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,14 @@ CURLcode curl_global_init(c_long flags);
* callback routines with be invoked by this library instead of the system
* memory management routines like malloc, free etc.
*/
CURLcode curl_global_init_mem(c_long flags, curl_malloc_callback m, curl_free_callback f, curl_realloc_callback r, curl_strdup_callback s, curl_calloc_callback c);
CURLcode curl_global_init_mem(
c_long flags,
curl_malloc_callback m,
curl_free_callback f,
curl_realloc_callback r,
curl_strdup_callback s,
curl_calloc_callback c
);

/**
* Name: curl_global_cleanup()
Expand Down Expand Up @@ -2139,7 +2146,13 @@ extern (C) CURLMcode curl_multi_remove_handle(CURLM *multi_handle, CURL *curl_h
/** tmp decl */
alias fd_set = int;
///
extern (C) CURLMcode curl_multi_fdset(CURLM *multi_handle, fd_set *read_fd_set, fd_set *write_fd_set, fd_set *exc_fd_set, int *max_fd);
extern (C) CURLMcode curl_multi_fdset(
CURLM *multi_handle,
fd_set *read_fd_set,
fd_set *write_fd_set,
fd_set *exc_fd_set,
int *max_fd
);

/**
* Name: curl_multi_perform()
Expand Down
37 changes: 31 additions & 6 deletions std/algorithm/iteration.d
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,13 @@ private struct _Cache(R, bool bidir)
CacheTypes caches;

static assert(isAssignable!(UE, E) && is(UE : E),
algoFormat("Cannot instantiate range with %s because %s elements are not assignable to %s.", R.stringof, E.stringof, UE.stringof));
algoFormat(
"Cannot instantiate range with %s because %s elements are not assignable to %s.",
R.stringof,
E.stringof,
UE.stringof
)
);
}

this(R range)
Expand Down Expand Up @@ -2669,7 +2675,13 @@ template reduce(fun...) if (fun.length >= 1)
foreach (i, f; binfuns)
{
static assert(!is(typeof(f(args[i], e))) || is(typeof(args[i] = f(args[i], e))),
algoFormat("Incompatible function/seed/element: %s/%s/%s", fullyQualifiedName!f, Args[i].stringof, E.stringof));
algoFormat(
"Incompatible function/seed/element: %s/%s/%s",
fullyQualifiedName!f,
Args[i].stringof,
E.stringof
)
);
}

static if (mustInitialize) if (initialized == false)
Expand All @@ -2684,7 +2696,9 @@ template reduce(fun...) if (fun.length >= 1)
foreach (i, f; binfuns)
args[i] = f(args[i], e);
}
static if (mustInitialize) if (!initialized) throw new Exception("Cannot reduce an empty iterable w/o an explicit seed value.");
static if (mustInitialize)
if (!initialized)
throw new Exception("Cannot reduce an empty iterable w/o an explicit seed value.");

static if (Args.length == 1)
return args[0];
Expand Down Expand Up @@ -2968,7 +2982,12 @@ private template ReduceSeedType(E)
ReduceSeedType s = ReduceSeedType.init;
static assert(is(typeof({ReduceSeedType s = lvalueOf!E;})) &&
is(typeof(lvalueOf!ReduceSeedType = fun(lvalueOf!ReduceSeedType, lvalueOf!E))),
algoFormat("Unable to deduce an acceptable seed type for %s with element type %s.", fullyQualifiedName!fun, E.stringof));
algoFormat(
"Unable to deduce an acceptable seed type for %s with element type %s.",
fullyQualifiedName!fun,
E.stringof
)
);
}
}

Expand Down Expand Up @@ -4231,8 +4250,14 @@ private struct SplitterResult(alias isTerminator, Range)
import std.uni : isWhite;

//@@@6791@@@
assert(equal(splitter("là dove terminava quella valle"), ["", "dove", "terminava", "quella", "valle"]));
assert(equal(splitter!(std.uni.isWhite)("là dove terminava quella valle"), ["", "dove", "terminava", "quella", "valle"]));
assert(equal(
splitter("là dove terminava quella valle"),
["", "dove", "terminava", "quella", "valle"]
));
assert(equal(
splitter!(std.uni.isWhite)("là dove terminava quella valle"),
["", "dove", "terminava", "quella", "valle"]
));
assert(equal(splitter!"a=='本'"("日本語"), ["", ""]));
}

Expand Down
5 changes: 3 additions & 2 deletions std/array.d
Original file line number Diff line number Diff line change
Expand Up @@ -1462,8 +1462,9 @@ if (isForwardRange!Range && is(typeof(ElementType!Range.init == Separator.init))
return range.splitter(sep).array;
}
///ditto
auto split(Range, Separator)(Range range, Separator sep)
if (isForwardRange!Range && isForwardRange!Separator && is(typeof(ElementType!Range.init == ElementType!Separator.init)))
auto split(Range, Separator)(Range range, Separator sep) if (
isForwardRange!Range && isForwardRange!Separator
&& is(typeof(ElementType!Range.init == ElementType!Separator.init)))
{
import std.algorithm : splitter;
return range.splitter(sep).array;
Expand Down
24 changes: 20 additions & 4 deletions std/base64.d
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,11 @@ template Base64Impl(char Map62th, char Map63th, char Padding = '=')
}

// @@@BUG@@@ Workaround for DbC problem. See comment on 'out'.
version (unittest) assert(bufptr - buffer.ptr == encodeLength(srcLen), "The length of result is different from Base64");
version (unittest)
assert(
bufptr - buffer.ptr == encodeLength(srcLen),
"The length of result is different from Base64"
);

// encode method can't assume buffer length. So, slice needed.
return buffer[0..bufptr - buffer.ptr];
Expand Down Expand Up @@ -525,7 +529,11 @@ template Base64Impl(char Map62th, char Map63th, char Padding = '=')
}

// @@@BUG@@@ Workaround for DbC problem.
version (unittest) assert(pcount == encodeLength(srcLen), "The number of put is different from the length of Base64");
version (unittest)
assert(
pcount == encodeLength(srcLen),
"The number of put is different from the length of Base64"
);

return pcount;
}
Expand Down Expand Up @@ -1119,7 +1127,11 @@ template Base64Impl(char Map62th, char Map63th, char Padding = '=')
}

// @@@BUG@@@ Workaround for DbC problem.
version (unittest) assert((bufptr - buffer.ptr) >= (decodeLength(srcLen) - 2), "The length of result is smaller than expected length");
version (unittest)
assert(
(bufptr - buffer.ptr) >= (decodeLength(srcLen) - 2),
"The length of result is smaller than expected length"
);

return buffer[0..bufptr - buffer.ptr];
}
Expand Down Expand Up @@ -1300,7 +1312,11 @@ template Base64Impl(char Map62th, char Map63th, char Padding = '=')
}

// @@@BUG@@@ Workaround for DbC problem.
version (unittest) assert(pcount >= (decodeLength(srcLen) - 2), "The length of result is smaller than expected length");
version (unittest)
assert(
pcount >= (decodeLength(srcLen) - 2),
"The length of result is smaller than expected length"
);

return pcount;
}
Expand Down
8 changes: 6 additions & 2 deletions std/bitmanip.d
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ private template createReferenceAccessor(string store, T, ulong bits, string nam
~ "return cast("~T.stringof~") cast(void*) result;}\n"
// setter
~"@property void "~name~"("~T.stringof~" v) @trusted pure nothrow @nogc { "
~"assert(((cast(typeof("~store~")) cast(void*) v) & "~myToString(mask)~`) == 0, "Value not properly aligned for '`~name~`'"); `
~"assert(((cast(typeof("~store~")) cast(void*) v) & "~myToString(mask)
~`) == 0, "Value not properly aligned for '`~name~`'"); `
~store~" = cast(typeof("~store~"))"
~" (("~store~" & (cast(typeof("~store~")) "~myToString(mask)~"))"
~" | ((cast(typeof("~store~")) cast(void*) v) & (cast(typeof("~store~")) "~myToString(~mask)~")));}\n";
Expand All @@ -205,7 +206,10 @@ private template sizeOfBitField(T...)

private template createTaggedReference(T, ulong a, string name, Ts...)
{
static assert(sizeOfBitField!Ts <= getBitsForAlign(a), "Fields must fit in the bits know to be zero because of alignment.");
static assert(
sizeOfBitField!Ts <= getBitsForAlign(a),
"Fields must fit in the bits know to be zero because of alignment."
);
enum StoreName = createStoreName!(T, name, 0, Ts);
enum result
= createReferenceAccessor!(StoreName, T, sizeOfBitField!Ts, name).result
Expand Down
4 changes: 3 additions & 1 deletion std/container/rbtree.d
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,9 @@ assert(equal(rbt[], [5]));
{
writeln("bad tree at:");
debug printTree(n);
throw new Exception("Node at path " ~ path ~ " has different number of black nodes on left and right paths");
throw new Exception(
"Node at path " ~ path ~ " has different number of black nodes on left and right paths"
);
}
return l + (n.color == n.color.Black ? 1 : 0);
}
Expand Down
4 changes: 3 additions & 1 deletion std/cstream.d
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
deprecated("It will be removed from Phobos in October 2016. If you still need it, go to https://github.com/DigitalMars/undeaD") module std.cstream;
deprecated(
"It will be removed from Phobos in October 2016. If you still need it, go to https://github.com/DigitalMars/undeaD"
) module std.cstream;
// @@@DEPRECATED_2016-10@@@

public import core.stdc.stdio;
Expand Down
Loading

0 comments on commit 3636733

Please sign in to comment.