From e7b3d834d749117978c89735e85ed6823e8a116f Mon Sep 17 00:00:00 2001 From: k-hara Date: Tue, 10 Feb 2015 00:56:40 +0900 Subject: [PATCH] detab and remove trailing whitespaces --- std/algorithm/mutation.d | 4 ++-- std/complex.d | 26 +++++++++++------------ std/encoding.d | 6 +++--- std/experimental/logger/package.d | 4 ++-- std/functional.d | 4 ++-- std/internal/math/gammafunction.d | 8 ++++---- std/internal/scopebuffer.d | 2 +- std/internal/test/dummyrange.d | 4 ++-- std/math.d | 2 +- std/mmfile.d | 2 +- std/net/curl.d | 12 +++++------ std/parallelism.d | 4 ++-- std/regex/internal/thompson.d | 2 +- std/string.d | 2 +- std/zip.d | 34 +++++++++++++++---------------- 15 files changed, 58 insertions(+), 58 deletions(-) diff --git a/std/algorithm/mutation.d b/std/algorithm/mutation.d index 7d06d1ea5..9aecf2a51 100644 --- a/std/algorithm/mutation.d +++ b/std/algorithm/mutation.d @@ -938,7 +938,7 @@ unittest S5 s51; static assert(__traits(compiles, move(s51, s51)), - "issue 13990, cannot move opaque class reference"); + "issue 13990, cannot move opaque class reference"); } /// Ditto @@ -1047,7 +1047,7 @@ unittest S5 s51; static assert(__traits(compiles, s51 = move(s51)), - "issue 13990, cannot move opaque class reference"); + "issue 13990, cannot move opaque class reference"); } unittest//Issue 6217 diff --git a/std/complex.d b/std/complex.d index 10e2caadf..230085af1 100644 --- a/std/complex.d +++ b/std/complex.d @@ -660,34 +660,34 @@ unittest +/ T sqAbs(T)(Complex!T z) @safe pure nothrow @nogc { - return z.re*z.re + z.im*z.im; + return z.re*z.re + z.im*z.im; } unittest { import std.math; - assert (sqAbs(complex(0.0)) == 0.0); - assert (sqAbs(complex(1.0)) == 1.0); - assert (sqAbs(complex(0.0, 1.0)) == 1.0); - assert (approxEqual(sqAbs(complex(1.0L, -2.0L)), 5.0L)); - assert (approxEqual(sqAbs(complex(-3.0L, 1.0L)), 10.0L)); - assert (approxEqual(sqAbs(complex(1.0f,-1.0f)), 2.0f)); + assert (sqAbs(complex(0.0)) == 0.0); + assert (sqAbs(complex(1.0)) == 1.0); + assert (sqAbs(complex(0.0, 1.0)) == 1.0); + assert (approxEqual(sqAbs(complex(1.0L, -2.0L)), 5.0L)); + assert (approxEqual(sqAbs(complex(-3.0L, 1.0L)), 10.0L)); + assert (approxEqual(sqAbs(complex(1.0f,-1.0f)), 2.0f)); } /// ditto T sqAbs(T)(T x) @safe pure nothrow @nogc - if (isFloatingPoint!T) + if (isFloatingPoint!T) { - return x*x; + return x*x; } unittest { import std.math; - assert (sqAbs(0.0) == 0.0); - assert (sqAbs(-1.0) == 1.0); - assert (approxEqual(sqAbs(-3.0L), 9.0L)); - assert (approxEqual(sqAbs(-5.0f), 25.0f)); + assert (sqAbs(0.0) == 0.0); + assert (sqAbs(-1.0) == 1.0); + assert (approxEqual(sqAbs(-3.0L), 9.0L)); + assert (approxEqual(sqAbs(-5.0f), 25.0f)); } diff --git a/std/encoding.d b/std/encoding.d index 9e65ad74c..43e25b365 100644 --- a/std/encoding.d +++ b/std/encoding.d @@ -1353,7 +1353,7 @@ bool isValid(E)(const(E)[] s) unittest { assert( isValid("\u20AC100")); - assert(!isValid(cast(char[3])[167, 133, 175])); + assert(!isValid(cast(char[3])[167, 133, 175])); } /** @@ -1467,7 +1467,7 @@ body unittest { assert(firstSequence("\u20AC1000") == "\u20AC".length); - assert(firstSequence("hel") == "h".length); + assert(firstSequence("hel") == "h".length); } /** @@ -1498,7 +1498,7 @@ body unittest { assert(lastSequence("1000\u20AC") == "\u20AC".length); - assert(lastSequence("hellö") == "ö".length); + assert(lastSequence("hellö") == "ö".length); } /** diff --git a/std/experimental/logger/package.d b/std/experimental/logger/package.d index 5abc03f11..7533be4b7 100644 --- a/std/experimental/logger/package.d +++ b/std/experimental/logger/package.d @@ -106,8 +106,8 @@ explicit $(D LogLevel) and conditional logging functions and methods. $(H4 Thread Local Redirection) Calls to the free standing log functions are not directly forwarded to the -global $(D Logger) $(D sharedLog). Actually, a thread local $(D Logger) of -type $(D StdForwardLogger) process the log call and then, by default, forward +global $(D Logger) $(D sharedLog). Actually, a thread local $(D Logger) of +type $(D StdForwardLogger) process the log call and then, by default, forward the created $(D Logger.LogEntry) to the $(D sharedLog) $(D Logger). The thread local $(D Logger) is accessable by the $(D stdThreadLocalLog) property. This property allows to assign user defined $(D Logger). The default diff --git a/std/functional.d b/std/functional.d index 753a4cd88..fbc4d97bd 100644 --- a/std/functional.d +++ b/std/functional.d @@ -274,7 +274,7 @@ private uint _ctfeMatchUnary(string fun, string name) if (!__ctfe) assert(false); import std.stdio; fun._ctfeSkipOp(); - for (;;) + for (;;) { immutable h = fun._ctfeSkipName(name) + fun._ctfeSkipInteger(); if (h == 0) @@ -321,7 +321,7 @@ private uint _ctfeMatchBinary(string fun, string name1, string name2) { if (!__ctfe) assert(false); fun._ctfeSkipOp(); - for (;;) + for (;;) { immutable h = fun._ctfeSkipName(name1) + fun._ctfeSkipName(name2) + fun._ctfeSkipInteger(); if (h == 0) diff --git a/std/internal/math/gammafunction.d b/std/internal/math/gammafunction.d index a05f6e278..191c78bdf 100644 --- a/std/internal/math/gammafunction.d +++ b/std/internal/math/gammafunction.d @@ -1434,8 +1434,8 @@ immutable real [7] Bn_n = [ * digamma(x) = d/dx logGamma(x) * * References: -* 1. Abramowitz, M., and Stegun, I. A. (1970). -* Handbook of mathematical functions. Dover, New York, +* 1. Abramowitz, M., and Stegun, I. A. (1970). +* Handbook of mathematical functions. Dover, New York, * pages 258-259, equations 6.3.6 and 6.3.18. */ real digamma(real x) @@ -1530,8 +1530,8 @@ unittest { * logmdigamma(x) = log(x) - digamma(x) * * References: -* 1. Abramowitz, M., and Stegun, I. A. (1970). -* Handbook of mathematical functions. Dover, New York, +* 1. Abramowitz, M., and Stegun, I. A. (1970). +* Handbook of mathematical functions. Dover, New York, * pages 258-259, equations 6.3.6 and 6.3.18. */ real logmdigamma(real x) diff --git a/std/internal/scopebuffer.d b/std/internal/scopebuffer.d index 67323e25b..f8fd2d8f9 100644 --- a/std/internal/scopebuffer.d +++ b/std/internal/scopebuffer.d @@ -354,7 +354,7 @@ unittest } // const -unittest +unittest { char[10] tmpbuf = void; auto textbuf = ScopeBuffer!char(tmpbuf); diff --git a/std/internal/test/dummyrange.d b/std/internal/test/dummyrange.d index a9e7891de..8e97320d0 100644 --- a/std/internal/test/dummyrange.d +++ b/std/internal/test/dummyrange.d @@ -178,7 +178,7 @@ propagated properly from the base range(s) R to the higher order range H. Useful in combination with DummyRange for testing several higher order ranges. */ -template propagatesRangeType(H, R...) +template propagatesRangeType(H, R...) { static if(allSatisfy!(isRandomAccessRange, R)) enum bool propagatesRangeType = isRandomAccessRange!H; @@ -190,7 +190,7 @@ template propagatesRangeType(H, R...) enum bool propagatesRangeType = isInputRange!H; } -template propagatesLength(H, R...) +template propagatesLength(H, R...) { static if(allSatisfy!(hasLength, R)) enum bool propagatesLength = hasLength!H; diff --git a/std/math.d b/std/math.d index 25016fa90..f37ae3abd 100644 --- a/std/math.d +++ b/std/math.d @@ -6247,7 +6247,7 @@ body r *= x; r += A[i]; } - return r; + return r; } } diff --git a/std/mmfile.d b/std/mmfile.d index e619320e2..7cc64866c 100644 --- a/std/mmfile.d +++ b/std/mmfile.d @@ -328,7 +328,7 @@ class MmFile else { fd = -1; - version(linux) import core.sys.linux.sys.mman : MAP_ANON; + version(linux) import core.sys.linux.sys.mman : MAP_ANON; flags |= MAP_ANON; } this.size = size; diff --git a/std/net/curl.d b/std/net/curl.d index fd4644dfe..681e88b49 100644 --- a/std/net/curl.d +++ b/std/net/curl.d @@ -23,7 +23,7 @@ SMTP) ) ) Note: -You may need to link to the $(B curl) library, e.g. by adding $(D "libs": ["curl"]) +You may need to link to the $(B curl) library, e.g. by adding $(D "libs": ["curl"]) to your $(B dub.json) file if you are using $(LINK2 http://code.dlang.org, DUB). Windows x86 note: @@ -2688,19 +2688,19 @@ struct HTTP * Specify data to post when not using the onSend callback, with * user-specified Content-Type. * Params: - * data = Data to post. - * contentType = MIME type of the data, for example, "text/plain" or - * "application/octet-stream". See also: + * data = Data to post. + * contentType = MIME type of the data, for example, "text/plain" or + * "application/octet-stream". See also: * $(LINK2 http://en.wikipedia.org/wiki/Internet_media_type, * Internet media type) on Wikipedia. - *----- + * ----- * import std.net.curl; * auto http = HTTP("http://onlineform.example.com"); * auto data = "app=login&username=bob&password=s00perS3kret"; * http.setPostData(data, "application/x-www-form-urlencoded"); * http.onReceive = (ubyte[] data) { return data.length; }; * http.perform(); - *----- + * ----- */ void setPostData(const(void)[] data, string contentType) { diff --git a/std/parallelism.d b/std/parallelism.d index 1590c2558..267ea77eb 100644 --- a/std/parallelism.d +++ b/std/parallelism.d @@ -4572,7 +4572,7 @@ version(unittest) { struct __S_12733 { - invariant() { assert(checksum == 1234567890); } + invariant() { assert(checksum == 1234567890); } this(ulong u){n = u;} void opAssign(__S_12733 s){this.n = s.n;} ulong n; @@ -4585,6 +4585,6 @@ version(unittest) unittest { immutable ulong[] data = [ 2UL^^59-1, 2UL^^59-1, 2UL^^59-1, 112_272_537_195_293UL ]; - + auto result = taskPool.amap!__genPair_12733(data); } diff --git a/std/regex/internal/thompson.d b/std/regex/internal/thompson.d index 275e37df1..1faf438a4 100644 --- a/std/regex/internal/thompson.d +++ b/std/regex/internal/thompson.d @@ -1,7 +1,7 @@ //Written in the D programming language /* Implementation of Thompson NFA std.regex engine. - Key point is evaluation of all possible threads (state) at each step + Key point is evaluation of all possible threads (state) at each step in a breadth-first manner, thereby geting some nice properties: - looking at each character only once - merging of equivalent threads, that gives matching process linear time complexity diff --git a/std/string.d b/std/string.d index c1d4e410d..063431be5 100644 --- a/std/string.d +++ b/std/string.d @@ -1,7 +1,7 @@ // Written in the D programming language. /** -String handling functions. Note that many typical string functions are found in +String handling functions. Note that many typical string functions are found in $(D std.algorithm) because all D strings are bidirectional ranges. $(SCRIPT inhibitQuickIndex = 1;) diff --git a/std/zip.d b/std/zip.d index ea3836409..8018c0070 100644 --- a/std/zip.d +++ b/std/zip.d @@ -288,10 +288,10 @@ final class ZipArchive /// Read Only: number of ArchiveMembers in the directory. @property uint numEntries() { return _numEntries; } @property uint totalEntries() { return _totalEntries; } /// ditto - + /// True when the archive is in Zip64 format. @property bool isZip64() { return _isZip64; } - + /// Set this to true to force building a Zip64 archive. @property void isZip64(bool value) { _isZip64 = value; } /** @@ -392,7 +392,7 @@ final class ZipArchive + directorySize + 46 + de.name.length + de.extra.length + de.comment.length + 22 + comment.length + eocd64LocLength + eocd64Length > uint.max) throw new ZipException("zip files bigger than 4 GB are unsupported"); - + archiveSize += 30 + de.name.length + de.extra.length + de.compressedSize; @@ -406,7 +406,7 @@ final class ZipArchive uint dataSize = archiveSize + directorySize + 22 + cast(uint)comment.length; if (isZip64) dataSize += eocd64LocLength + eocd64Length; - + _data = new ubyte[dataSize]; // Populate the data[] @@ -484,7 +484,7 @@ final class ZipArchive putUlong (i + 40, directorySize); putUlong (i + 48, directoryOffset); i += eocd64Length; - + // Write zip64 end of central directory record locator _data[i .. i + 4] = cast(ubyte[])"PK\x06\x07"; putUint (i + 4, diskNumber); @@ -492,7 +492,7 @@ final class ZipArchive putUint (i + 16, 1); i += eocd64LocLength; } - + // Write end record endrecOffset = i; _data[i .. i + 4] = cast(ubyte[])"PK\x05\x06"; @@ -540,7 +540,7 @@ final class ZipArchive if (data.length > uint.max - 2) throw new ZipException("zip files bigger than 4 GB are unsupported"); - + // Find 'end record index' by searching backwards for signature iend = (data.length > 66000 ? to!uint(data.length - 66000) : 0); for (i = to!uint(data.length) - 22; 1; i--) @@ -556,14 +556,14 @@ final class ZipArchive continue; comment = cast(string)(_data[i + 22 .. i + 22 + endcommentlength]); endrecOffset = i; - + uint k = i - eocd64LocLength; if (k < i && _data[k .. k + 4] == cast(ubyte[])"PK\x06\x07") { _isZip64 = true; i = k; } - + break; } } @@ -575,33 +575,33 @@ final class ZipArchive ulong eocdOffset = getUlong(i + 8); if (eocdOffset + eocd64Length > _data.length) throw new ZipException("corrupted directory"); - + i = to!uint(eocdOffset); if (_data[i .. i + 4] != cast(ubyte[])"PK\x06\x06") throw new ZipException("invalid Zip EOCD64 signature"); - + ulong eocd64Size = getUlong(i + 4); if (eocd64Size + i - 12 > data.length) throw new ZipException("invalid Zip EOCD64 size"); - + _diskNumber = getUint(i + 16); _diskStartDir = getUint(i + 20); - + ulong numEntriesUlong = getUlong(i + 24); ulong totalEntriesUlong = getUlong(i + 32); ulong directorySizeUlong = getUlong(i + 40); ulong directoryOffsetUlong = getUlong(i + 48); - + if (numEntriesUlong > uint.max) throw new ZipException("supposedly more than 4294967296 files in archive"); - + if (numEntriesUlong != totalEntriesUlong) throw new ZipException("multiple disk zips not supported"); if (directorySizeUlong > i || directoryOffsetUlong > i || directorySizeUlong + directoryOffsetUlong > i) throw new ZipException("corrupted directory"); - + _numEntries = to!uint(numEntriesUlong); _totalEntries = to!uint(totalEntriesUlong); directorySize = to!uint(directorySizeUlong); @@ -814,7 +814,7 @@ unittest auto zip3 = new ZipArchive(data1); zip3.build(); assert(zip3.directory["foo"].compressedSize == am1.compressedSize); - + // Test if packing and unpacking produces the original data import std.random : uniform, MinstdRand0; import std.stdio, std.conv;