From bcfc934a98c6e9eba769f9dfe8f8156ad200795e Mon Sep 17 00:00:00 2001 From: Tony Kelman Date: Wed, 8 Jun 2016 01:21:00 -0700 Subject: [PATCH] Misc OCD whitespace adjustments Use 4 space indent in some doc code examples --- base/inference.jl | 2 +- base/multi.jl | 1 - base/random.jl | 1 - base/sharedarray.jl | 1 - doc/manual/variables-and-scoping.rst | 22 +++++++++++----------- src/ccalltest.c | 4 ++-- src/jitlayers.cpp | 2 -- src/jltypes.c | 2 +- test/fft.jl | 6 +----- test/file.jl | 1 - test/linalg/hessenberg.jl | 3 +-- test/math.jl | 2 -- test/parse.jl | 8 ++++---- 13 files changed, 21 insertions(+), 34 deletions(-) diff --git a/base/inference.jl b/base/inference.jl index 6e9c7537a5224..7464bab8edbce 100644 --- a/base/inference.jl +++ b/base/inference.jl @@ -5,7 +5,7 @@ import Core: _apply, svec, apply_type, Builtin, IntrinsicFunction #### parameters limiting potentially-infinite types #### const MAX_TYPEUNION_LEN = 3 const MAX_TYPE_DEPTH = 7 -const MAX_TUPLETYPE_LEN = 15 +const MAX_TUPLETYPE_LEN = 15 const MAX_TUPLE_DEPTH = 4 const MAX_TUPLE_SPLAT = 16 diff --git a/base/multi.jl b/base/multi.jl index 548516c14f31a..2b52b033a8dca 100644 --- a/base/multi.jl +++ b/base/multi.jl @@ -345,7 +345,6 @@ function send_connection_hdr(w::Worker, cookie=true) # For a connection initiated from the remote side to us, we only send the version, # else when we initiate a connection we first send the cookie followed by our version. # The remote side validates the cookie. - if cookie write(w.w_stream, LPROC.cookie) end diff --git a/base/random.jl b/base/random.jl index b8e8c90d0a220..641721bfd1d31 100644 --- a/base/random.jl +++ b/base/random.jl @@ -1190,7 +1190,6 @@ randexp(dims::Int...) = randexp!(Array{Float64}(dims)) randexp(rng::AbstractRNG, dims::Dims) = randexp!(rng, Array{Float64}(dims)) randexp(rng::AbstractRNG, dims::Int...) = randexp!(rng, Array{Float64}(dims)) - ## random UUID generation immutable UUID diff --git a/base/sharedarray.jl b/base/sharedarray.jl index dca0bf88c0e0e..894c9eb7358b5 100644 --- a/base/sharedarray.jl +++ b/base/sharedarray.jl @@ -53,7 +53,6 @@ If an `init` function of the type `initfn(S::SharedArray)` is specified, it is c the participating workers. """ function SharedArray{T,N}(::Type{T}, dims::Dims{N}; init=false, pids=Int[]) - isbits(T) || throw(ArgumentError("type of SharedArray elements must be bits types, got $(T)")) pids, onlocalhost = shared_pids(pids) diff --git a/doc/manual/variables-and-scoping.rst b/doc/manual/variables-and-scoping.rst index 480e836bf9a82..7840eb03ae636 100644 --- a/doc/manual/variables-and-scoping.rst +++ b/doc/manual/variables-and-scoping.rst @@ -400,8 +400,8 @@ storage. Here is an example where the behavior of ``let`` is needed:: Fs = Array{Any}(2) i = 1 while i <= 2 - Fs[i] = ()->i - i += 1 + Fs[i] = ()->i + i += 1 end julia> Fs[1]() @@ -418,10 +418,10 @@ behave identically. We can use ``let`` to create a new binding for Fs = Array{Any}(2) i = 1 while i <= 2 - let i = i - Fs[i] = ()->i - end - i += 1 + let i = i + Fs[i] = ()->i + end + i += 1 end julia> Fs[1]() @@ -437,11 +437,11 @@ block without creating any new bindings: .. doctest:: julia> let - local x = 1 - let - local x = 2 - end - x + local x = 1 + let + local x = 2 + end + x end 1 diff --git a/src/ccalltest.c b/src/ccalltest.c index e9c46e5d789a3..e01aafa300fb2 100644 --- a/src/ccalltest.c +++ b/src/ccalltest.c @@ -535,7 +535,7 @@ JL_DLLEXPORT void *test_echo_p(void *p) { #include -JL_DLLEXPORT __m128i test_m128i(__m128i a, __m128i b, __m128i c, __m128i d ) +JL_DLLEXPORT __m128i test_m128i(__m128i a, __m128i b, __m128i c, __m128i d) { // 64-bit x86 has only level 2 SSE, which does not have a <4 x int32> multiplication, // so we use floating-point instead, and assume caller knows about the hack. @@ -544,7 +544,7 @@ JL_DLLEXPORT __m128i test_m128i(__m128i a, __m128i b, __m128i c, __m128i d ) _mm_cvtepi32_ps(_mm_sub_epi32(c,d))))); } -JL_DLLEXPORT __m128 test_m128(__m128 a, __m128 b, __m128 c, __m128 d ) +JL_DLLEXPORT __m128 test_m128(__m128 a, __m128 b, __m128 c, __m128 d) { return _mm_add_ps(a, _mm_mul_ps(b, _mm_sub_ps(c, d))); } diff --git a/src/jitlayers.cpp b/src/jitlayers.cpp index 3476b821e7ee5..ec56f85de073e 100644 --- a/src/jitlayers.cpp +++ b/src/jitlayers.cpp @@ -1071,7 +1071,6 @@ void jl_dump_native(const char *bc_fname, const char *obj_fname, const char *sys if (!err.empty()) jl_safe_printf("%s\n", err.c_str()); else { - #ifndef LLVM37 bc_FOS.reset(new formatted_raw_ostream(*bc_OS.get())); #endif @@ -1095,7 +1094,6 @@ void jl_dump_native(const char *bc_fname, const char *obj_fname, const char *sys if (!err.empty()) jl_safe_printf("%s\n", err.c_str()); else { - #ifndef LLVM37 obj_FOS.reset(new formatted_raw_ostream(*obj_OS.get())); #endif diff --git a/src/jltypes.c b/src/jltypes.c index 39c0478477e10..12fb96270138b 100644 --- a/src/jltypes.c +++ b/src/jltypes.c @@ -2115,7 +2115,7 @@ void jl_precompute_memoized_dt(jl_datatype_t *dt) if (d > dt->depth) dt->depth = d; if (!dt->hastypevars) - dt->hastypevars = jl_has_typevars__(p, 0, NULL, 0); + dt->hastypevars = jl_has_typevars__(p, 0, NULL, 0); if (!dt->haswildcard) dt->haswildcard = jl_has_typevars__(p, 1, NULL, 0); if (dt->isleaftype) diff --git a/test/fft.jl b/test/fft.jl index b851def9aff9f..6aca96d874a02 100644 --- a/test/fft.jl +++ b/test/fft.jl @@ -121,7 +121,6 @@ for (f,fi,pf,pfi) in ((fft,ifft,plan_fft,plan_ifft), # The following capabilities are FFTW only. # They are not available in MKL, and hence do not test them. if Base.fftw_vendor() != :mkl - ifft3_fft3_m3d = fi(f(m3d)) fftd3_m3d = f(m3d,3) @@ -156,9 +155,8 @@ for (f,fi,pf,pfi) in ((fft,ifft,plan_fft,plan_ifft), @test pfftd3_m3d[i] ≈ true_fftd3_m3d[i] @test pifftd3_fftd3_m3d[i] ≈ m3d[i] @test pfft!d3_m3d[i] ≈ true_fftd3_m3d[i] - @test pifft!d3_fftd3_m3d[i] ≈ m3d[i] + @test pifft!d3_fftd3_m3d[i] ≈ m3d[i] end - end # if fftw_vendor() != :mkl # rfft/rfftn @@ -206,7 +204,6 @@ for (f,fi,pf,pfi) in ((fft,ifft,plan_fft,plan_ifft), end if Base.fftw_vendor() != :mkl - rfftn_m3d = rfft(m3d) rfftd3_m3d = rfft(m3d,3) @test size(rfftd3_m3d) == size(fftd3_m3d) @@ -225,7 +222,6 @@ for (f,fi,pf,pfi) in ((fft,ifft,plan_fft,plan_ifft), for i = 1:3, j = 1:3, k = 1:2 @test rfftn_m3d[i,j,k] ≈ fftn_m3d[i,j,k] end - end # !mkl end diff --git a/test/file.jl b/test/file.jl index 3c1e4381473e5..ef60ff00fd69c 100644 --- a/test/file.jl +++ b/test/file.jl @@ -1088,7 +1088,6 @@ test2_12992() test2_12992() # issue 13559 - if !is_windows() function test_13559() fn = tempname() diff --git a/test/linalg/hessenberg.jl b/test/linalg/hessenberg.jl index 80d7406f2a801..8ea3b290056bc 100644 --- a/test/linalg/hessenberg.jl +++ b/test/linalg/hessenberg.jl @@ -6,7 +6,6 @@ using Base.Test using Base.LinAlg: BlasComplex, BlasFloat, BlasReal, QRPivoted let n = 10 - srand(1234321) Areal = randn(n,n)/2 @@ -19,7 +18,7 @@ let n = 10 complex(Areal, Aimg) : Areal) - debug && println("\ntype of a: ", eltya, " type of b: ", eltyb, "\n") +debug && println("\ntype of a: ", eltya, " type of b: ", eltyb, "\n") if eltya != BigFloat H = hessfact(A) diff --git a/test/math.jl b/test/math.jl index 09d3cf814d52f..33902962b3999 100644 --- a/test/math.jl +++ b/test/math.jl @@ -47,7 +47,6 @@ for T in (Float16,Float32,Float64) (prevfloat(realmin(T)), nextfloat(one(T),-2)), (nextfloat(zero(T),3), T(0.75)), (nextfloat(zero(T)), T(0.5))] - n = Int(log2(a/b)) @test frexp(a) == (b,n) @test ldexp(b,n) == a @@ -539,7 +538,6 @@ end # digamma for elty in (Float32, Float64) - @test digamma(convert(elty, 9)) ≈ convert(elty, 2.140641477955609996536345) @test digamma(convert(elty, 2.5)) ≈ convert(elty, 0.7031566406452431872257) @test digamma(convert(elty, 0.1)) ≈ convert(elty, -10.42375494041107679516822) diff --git a/test/parse.jl b/test/parse.jl index 3fc6b8869215f..5c0ae1917650a 100644 --- a/test/parse.jl +++ b/test/parse.jl @@ -516,13 +516,13 @@ end let err = try include_string("module A - function broken() + function broken() - x[1] = some_func( + x[1] = some_func( - end + end - end") + end") catch e e end