Skip to content

Commit

Permalink
make vcats explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
nolta committed Jul 22, 2013
1 parent 5dd3df7 commit 4d1ad32
Show file tree
Hide file tree
Showing 16 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions base/dsp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ function conv{T<:LinAlg.BlasFloat}(u::Vector{T}, v::Vector{T})
nv = length(v)
n = nu + nv - 1
np2 = n > 1024 ? nextprod([2,3,5], n) : nextpow2(n)
upad = [u, zeros(T, np2 - nu)]
vpad = [v, zeros(T, np2 - nv)]
upad = [u; zeros(T, np2 - nu)]
vpad = [v; zeros(T, np2 - nv)]
if T <: Real
p = plan_rfft(upad)
y = irfft(p(upad).*p(vpad), np2)
Expand Down
4 changes: 2 additions & 2 deletions base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ function typeinf(linfo::LambdaStaticData,atypes::Tuple,sparams::Tuple, def, cop)
la = length(args)
assert(is(ast.head,:lambda), "inference.jl:745")
locals = (ast.args[2][1])::Array{Any,1}
vars = [args, locals]
vars = [args; locals]
body = (ast.args[3].args)::Array{Any,1}
n = length(body)

Expand Down Expand Up @@ -1885,7 +1885,7 @@ function inlining_pass(e::Expr, sv, ast)
return (e,stmts)
end
end
e.args = [{e.args[2]}, newargs...]
e.args = [{e.args[2]}; newargs...]

# now try to inline the simplified call
res = inlineable(_ieval(e.args[1]), e, sv, ast)
Expand Down
2 changes: 1 addition & 1 deletion base/intfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ ndigits(x::Integer) = ndigits(unsigned(abs(x)))

## integer to string functions ##

const dig_syms = uint8(['0':'9','a':'z','A':'Z'])
const dig_syms = uint8(['0':'9';'a':'z';'A':'Z'])

function bin(x::Unsigned, pad::Int, neg::Bool)
i = neg + max(pad,sizeof(x)<<3-leading_zeros(x))
Expand Down
2 changes: 1 addition & 1 deletion base/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## byte-order mark, ntoh & hton ##

const ENDIAN_BOM = reinterpret(Uint32,uint8([1:4]))[1]
const ENDIAN_BOM = reinterpret(Uint32, 0x1:0x4)

if ENDIAN_BOM == 0x01020304
ntoh(x) = identity(x)
Expand Down
4 changes: 2 additions & 2 deletions base/linalg/factorization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ function (\){T<:BlasFloat}(A::QRPivoted{T}, B::StridedMatrix{T}, rcond::Real)
tmin, smin, cmin = LAPACK.laic1!(2, sub(xmin, 1:rnk), tmin, sub(A.hh, 1:rnk, rnk + 1), A.hh[rnk + 1, rnk + 1])
tmax, smax, cmax = LAPACK.laic1!(1, sub(xmax, 1:rnk), tmax, sub(A.hh, 1:rnk, rnk + 1), A.hh[rnk + 1, rnk + 1])
if tmax*rcond > tmin break end
xmin[1:rnk + 1] = [smin*sub(xmin, 1:rnk), cmin]
xmax[1:rnk + 1] = [smax*sub(xmin, 1:rnk), cmax]
xmin[1:rnk + 1] = [smin*sub(xmin, 1:rnk); cmin]
xmax[1:rnk + 1] = [smax*sub(xmin, 1:rnk); cmax]
rnk += 1
# if cond(r[1:rnk, 1:rnk])*rcond < 1 break end
end
Expand Down
2 changes: 1 addition & 1 deletion base/linalg/lapack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1727,7 +1727,7 @@ for (stev, stebz, stegr, stein, elty) in
function stegr!(jobz::BlasChar, range::BlasChar, dv::Vector{$elty}, ev::Vector{$elty}, vl::Real, vu::Real, il::Integer, iu::Integer)
n = length(dv)
if length(ev) != (n-1) throw(DimensionMismatch("stebz!")) end
eev = [ev, zero($elty)]
eev = [ev; zero($elty)]
abstol = Array($elty, 1)
m = Array(BlasInt, 1)
w = Array($elty, n)
Expand Down
2 changes: 1 addition & 1 deletion base/sparse/sparsematrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ speye{T}(S::SparseMatrixCSC{T}) = speye(T, size(S, 1), size(S, 2))
function speye(T::Type, m::Integer, n::Integer)
x = min(m,n)
rowval = [1:x]
colptr = [rowval, fill(int(x+1), n+1-x)]
colptr = [rowval; fill(int(x+1), n+1-x)]
nzval = ones(T, x)
return SparseMatrixCSC(m, n, colptr, rowval, nzval)
end
Expand Down
2 changes: 1 addition & 1 deletion base/string.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ rsearch(a::ByteArray, b::Union(Int8,Uint8,Char)) = rsearch(a,b,length(a))
# return a random string (often useful for temporary filenames/dirnames)
let
global randstring
const b = uint8(['0':'9','A':'Z','a':'z'])
const b = uint8(['0':'9';'A':'Z';'a':'z'])
randstring(n::Int) = ASCIIString(b[rand(1:length(b),n)])
randstring() = randstring(8)
end
Expand Down
2 changes: 1 addition & 1 deletion base/utf8.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ end

string(a::ByteString, b::ByteString, c::ByteString...) =
# ^^ at least one must be UTF-8 or the ASCII-only method would get called
UTF8String([a.data,b.data,map(s->s.data,c)...])
UTF8String([a.data;b.data;map(s->s.data,c)...])

ucfirst(s::UTF8String) = string(uppercase(s[1]), s[2:])
lcfirst(s::UTF8String) = string(lowercase(s[1]), s[2:])
Expand Down
6 changes: 3 additions & 3 deletions src/uv_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
const uv_handle_types = [UV_HANDLE_TYPE_MAP(XX) :UV_FILE]
const uv_req_types = [UV_REQ_TYPE_MAP(XX)]
let
handles = [:UV_UNKNOWN_HANDLE, uv_handle_types, :UV_HANDLE_TYPE_MAX, :UV_RAW_FD, :UV_RAW_HANDLE]
reqs = [:UV_UNKNOWN_REQ, uv_req_types, :UV_REQ_TYPE_PRIVATE,:UV_REQ_TYPE_MAX]
handles = [:UV_UNKNOWN_HANDLE; uv_handle_types; :UV_HANDLE_TYPE_MAX; :UV_RAW_FD; :UV_RAW_HANDLE]
reqs = [:UV_UNKNOWN_REQ; uv_req_types; :UV_REQ_TYPE_PRIVATE; :UV_REQ_TYPE_MAX]
for i=0:(length(handles)-1)
@eval const $(handles[i+1]) = $i
end
for i=0:(length(reqs)-1)
@eval const $(reqs[i+1]) = $i
end
end
end
6 changes: 3 additions & 3 deletions test/arrayops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ let
@test x == -12
X = get(A, -5:5, nan(Float32))
@test eltype(X) == Float32
@test isnan(X) == [trues(6),falses(5)]
@test isnan(X) == [trues(6);falses(5)]
@test X[7:11] == 1:5
X = get(A, (2:4, 9:-2:-13), 0)
Xv = zeros(Int, 3, 12)
Expand All @@ -168,7 +168,7 @@ v = pop!(l)

# concatenation
@test isequal([ones(2,2) 2*ones(2,1)], [1 1 2; 1 1 2])
@test isequal([ones(2,2), 2*ones(1,2)], [1 1; 1 1; 2 2])
@test isequal([ones(2,2); 2*ones(1,2)], [1 1; 1 1; 2 2])

# typed array literals
X = Float64[1 2 3]
Expand Down Expand Up @@ -482,7 +482,7 @@ for idx in {1, 2, 5, 9, 10, 1:0, 2:1, 1:1, 2:2, 1:2, 2:4, 9:8, 10:9, 9:9, 10:10,
for repl in {[], [11], [11,22], [11,22,33,44,55]}
a = [1:10]; acopy = copy(a)
@test splice!(a, idx, repl) == acopy[idx]
@test a == [acopy[1:(first(idx)-1)], repl, acopy[(last(idx)+1):end]]
@test a == [acopy[1:(first(idx)-1)]; repl; acopy[(last(idx)+1):end]]
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/bigint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ee = typemax(Int64)
@test string(d) == "-246913578024691357802469135780"
@test string(a) == "123456789012345678901234567890"

for i = -10:10, j = [-10:-1,1:10]
for i = -10:10, j = [-10:-1;1:10]
@test div(BigInt(i), BigInt(j)) == div(i,j)
@test fld(BigInt(i), BigInt(j)) == fld(i,j)
@test mod(BigInt(i), BigInt(j)) == mod(i,j)
Expand Down
4 changes: 2 additions & 2 deletions test/hashing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ types = {
Rational{Int8}, Rational{Uint8}, Rational{Int16}, Rational{Uint16},
Rational{Int32}, Rational{Uint32}, Rational{Int64}, Rational{Uint64}
}
vals = [
vals = vcat(
typemin(Int64),
-integer(maxintfloat(Float64))+(-4:1),
typemin(Int32),
Expand All @@ -13,7 +13,7 @@ vals = [
typemax(Int32),
integer(maxintfloat(Float64))+(-1:4),
typemax(Int64),
]
)

for T=types, S=types, x=vals
a = convert(T,x)
Expand Down
2 changes: 1 addition & 1 deletion test/numbers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,7 @@ approx_eq(a, b) = approx_eq(a, b, 1e-6)
9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941,
9949, 9967, 9973 ]

for T in [Int,BigInt], n = [1:1000,1000000]
for T in [Int,BigInt], n = [1:1000;1000000]
n = convert(T,n)
f = factor(n)
@test n == prod([p^k for (p,k)=f])
Expand Down
2 changes: 1 addition & 1 deletion test/parallel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ a = convert(Array, d)
if nprocs() < 4
remotecall_fetch(1, () -> addprocs(4 - nprocs()))
end
workloads = hist(@parallel((a,b)->[a,b], for i=1:7; myid(); end), nprocs())[2]
workloads = hist(@parallel((a,b)->[a;b], for i=1:7; myid(); end), nprocs())[2]
@test max(workloads) - min(workloads) <= 1

# @parallel reduction should work even with very short ranges
Expand Down
2 changes: 1 addition & 1 deletion test/sorting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ end

srand(0xdeadbeef)

for n in [0:10, 100, 1000]
for n in [0:10; 100; 1000]
r = 1:10
v = rand(1:10,n)
h = hist(v,r)
Expand Down

0 comments on commit 4d1ad32

Please sign in to comment.