Skip to content

Commit

Permalink
Fix up JuliaLang#15995 with @Stevegj's comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
hayd committed May 1, 2016
1 parent e37b430 commit 360883f
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions base/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function gen_broadcast_body_iter_tobitarray(nd::Int, narrays::Int, f)
end

function gen_broadcast_function(genbody::Function, nd::Int, narrays::Int, f)
As = [Symbol("A_"*string(i)) for i = 1:narrays]
As = [Symbol("A_",string(i)) for i = 1:narrays]
body = genbody(nd, narrays, f)
@eval let
local _F_
Expand All @@ -179,7 +179,7 @@ function gen_broadcast_function(genbody::Function, nd::Int, narrays::Int, f)
end

function gen_broadcast_function_tobitarray(genbody::Function, nd::Int, narrays::Int, f)
As = [Symbol("A_"*string(i)) for i = 1:narrays]
As = [Symbol("A_",string(i)) for i = 1:narrays]
body = genbody(nd, narrays, f)
@eval let
local _F_
Expand Down
2 changes: 1 addition & 1 deletion base/dft.jl
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ A_mul_B!(y::AbstractArray, p::ScaledPlan, x::AbstractArray) =
# or odd).

for f in (:brfft, :irfft)
pf = Symbol(string("plan_", f))
pf = Symbol("plan_", f)
@eval begin
$f(x::AbstractArray, d::Integer) = $pf(x, d) * x
$f(x::AbstractArray, d::Integer, region) = $pf(x, d, region) * x
Expand Down
2 changes: 1 addition & 1 deletion base/fft/dct.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function plan_inv{T,K,inplace}(p::DCTPlan{T,K,inplace})
end

for f in (:dct, :dct!, :idct, :idct!)
pf = Symbol(string("plan_", f))
pf = Symbol("plan_", f)
@eval begin
$f{T<:fftwNumber}(x::AbstractArray{T}) = $pf(x) * x
$f{T<:fftwNumber}(x::AbstractArray{T}, region) = $pf(x, region) * x
Expand Down
2 changes: 1 addition & 1 deletion base/libuv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function uv_sizeof_req(req)
end

for h in uv_handle_types
@eval const $(Symbol("_sizeof_"*lowercase(string(h)))) = uv_sizeof_handle($h)
@eval const $(Symbol("_sizeof_",lowercase(string(h)))) = uv_sizeof_handle($h)
end
for r in uv_req_types
@eval const $(Symbol("_sizeof_"*lowercase(string(r)))) = uv_sizeof_req($r)
Expand Down
4 changes: 2 additions & 2 deletions base/multidimensional.jl
Original file line number Diff line number Diff line change
Expand Up @@ -489,14 +489,14 @@ end
for T in indexes.parameters
T <: CartesianIndex ? (M += length(T)) : (M += 1)
end
index_length_expr = index <: Colon ? Symbol(string("Istride_", N+1)) : :(length(index))
index_length_expr = index <: Colon ? Symbol("Istride_", N+1) : :(length(index))
quote
Cartesian.@nexprs $N d->(I_d = indexes[d])
dimlengths = Cartesian.@ncall $N index_lengths_dim V.parent length(V.indexes)-N+1 I
Istride_1 = 1 # strides of the indexes to merge
Cartesian.@nexprs $N d->(Istride_{d+1} = Istride_d*dimlengths[d])
idx_len = $(index_length_expr)
if idx_len < 0.1*$(Symbol(string("Istride_", N+1))) # this has not been carefully tuned
if idx_len < 0.1*$(Symbol("Istride_", N+1)) # this has not been carefully tuned
return merge_indexes_div(V, indexes, index, dimlengths)
end
Cartesian.@nexprs $N d->(counter_d = 1) # counter_0 is the linear index
Expand Down
2 changes: 1 addition & 1 deletion base/sparse/sparsevector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,7 @@ end
for isunittri in (true, false), islowertri in (true, false)
unitstr = isunittri ? "Unit" : ""
halfstr = islowertri ? "Lower" : "Upper"
tritype = :(Base.LinAlg.$(Symbol(string(unitstr, halfstr, "Triangular"))))
tritype = :(Base.LinAlg.$(Symbol(unitstr, halfstr, "Triangular")))

# build out-of-place left-division operations
for (istrans, func, ipfunc) in (
Expand Down
2 changes: 1 addition & 1 deletion base/stream.jl
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ _fd(x::IOStream) = RawFD(fd(x))
ccall(:jl_uv_handle,Ptr{Void},(Ptr{Void},),x.handle))

for (x,writable,unix_fd,c_symbol) in ((:STDIN,false,0,:jl_uv_stdin),(:STDOUT,true,1,:jl_uv_stdout),(:STDERR,true,2,:jl_uv_stderr))
f = Symbol("redirect_"*lowercase(string(x)))
f = Symbol("redirect_",lowercase(string(x)))
_f = Symbol("_",f)
@eval begin
function ($_f)(stream)
Expand Down
2 changes: 1 addition & 1 deletion test/fft.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ true_fftd3_m3d[:,:,2] = -15
# use invoke to force usage of CTPlan versions even if FFTW is present
for A in (Array,SubArray)
for f in (:fft,:ifft,:plan_fft,:plan_ifft)
f_ = Symbol(string(f, "_"))
f_ = Symbol(f, "_")
@eval begin
$f_{T,N}(x::$A{T,N}) = invoke($f, Tuple{AbstractArray{T,N}}, x)
$f_{T,N,R}(x::$A{T,N},r::R) = invoke($f,Tuple{AbstractArray{T,N},R},x,r)
Expand Down

0 comments on commit 360883f

Please sign in to comment.