Skip to content

Commit

Permalink
Add missing parentheses in exception throws
Browse files Browse the repository at this point in the history
  • Loading branch information
magistere committed Dec 16, 2013
1 parent 12b8a32 commit 0e861ac
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
32 changes: 16 additions & 16 deletions base/bitarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -376,27 +376,27 @@ function getindex(B::BitArray, i1::Real, i2::Real)
#checkbounds(B, i0, i1) # manually inlined for performance
i1, i2 = to_index(i1, i2)
l1 = size(B,1)
1 <= i1 <= l1 || throw(BoundsError)
1 <= i1 <= l1 || throw(BoundsError())
return B[i1 + l1*(i2-1)]
end
function getindex(B::BitArray, i1::Real, i2::Real, i3::Real)
#checkbounds(B, i0, i1, i2) # manually inlined for performance
i1, i2, i3 = to_index(i1, i2, i3)
l1 = size(B,1)
1 <= i1 <= l1 || throw(BoundsError)
1 <= i1 <= l1 || throw(BoundsError())
l2 = size(B,2)
1 <= i2 <= l2 || throw(BoundsError)
1 <= i2 <= l2 || throw(BoundsError())
return B[i1 + l1*((i2-1) + l2*(i3-1))]
end
function getindex(B::BitArray, i1::Real, i2::Real, i3::Real, i4::Real)
#checkbounds(B, i1, i2, i3, i4)
i1, i2, i3, i4 = to_index(i1, i2, i3, i4)
l1 = size(B,1)
1 <= i1 <= l1 || throw(BoundsError)
1 <= i1 <= l1 || throw(BoundsError())
l2 = size(B,2)
1 <= i2 <= l2 || throw(BoundsError)
1 <= i2 <= l2 || throw(BoundsError())
l3 = size(B,3)
1 <= i3 <= l3 || throw(BoundsError)
1 <= i3 <= l3 || throw(BoundsError())
return B[i1 + l1*((i2-1) + l2*((i3-1) + l3*(i4-1)))]
end

Expand All @@ -406,14 +406,14 @@ function getindex(B::BitArray, I::Real...)
ndims = length(I)
i = to_index(I[1])
l = size(B,1)
1 <= i <= l || throw(BoundsError)
1 <= i <= l || throw(BoundsError())
index = i
stride = 1
for k = 2:ndims-1
stride *= l
i = to_index(I[k])
l = size(B,k)
1 <= i <= l || throw(BoundsError)
1 <= i <= l || throw(BoundsError())
index += (i-1) * stride
end
stride *= l
Expand Down Expand Up @@ -585,7 +585,7 @@ function setindex!(B::BitArray, x, i1::Real, i2::Real)
#checkbounds(B, i0, i1) # manually inlined for performance
i1, i2 = to_index(i1, i2)
l1 = size(B,1)
1 <= i1 <= l1 || throw(BoundsError)
1 <= i1 <= l1 || throw(BoundsError())
B[i1 + l1*(i2-1)] = x
return B
end
Expand All @@ -594,9 +594,9 @@ function setindex!(B::BitArray, x, i1::Real, i2::Real, i3::Real)
#checkbounds(B, i1, i2, i3) # manually inlined for performance
i1, i2, i3 = to_index(i1, i2, i3)
l1 = size(B,1)
1 <= i1 <= l1 || throw(BoundsError)
1 <= i1 <= l1 || throw(BoundsError())
l2 = size(B,2)
1 <= i2 <= l2 || throw(BoundsError)
1 <= i2 <= l2 || throw(BoundsError())
B[i1 + l1*((i2-1) + l2*(i3-1))] = x
return B
end
Expand All @@ -605,11 +605,11 @@ function setindex!(B::BitArray, x, i1::Real, i2::Real, i3::Real, i4::Real)
#checkbounds(B, i1, i2, i3, i4) # manually inlined for performance
i1, i2, i3, i4 = to_index(i1, i2, i3, i4)
l1 = size(B,1)
1 <= i1 <= l1 || throw(BoundsError)
1 <= i1 <= l1 || throw(BoundsError())
l2 = size(B,2)
1 <= i2 <= l2 || throw(BoundsError)
1 <= i2 <= l2 || throw(BoundsError())
l3 = size(B,3)
1 <= i3 <= l3 || throw(BoundsError)
1 <= i3 <= l3 || throw(BoundsError())
B[i1 + l1*((i2-1) + l2*((i3-1) + l3*(i4-1)))] = x
return B
end
Expand All @@ -620,14 +620,14 @@ function setindex!(B::BitArray, x, i::Real, I::Real...)
ndims = length(I) + 1
i = to_index(i)
l = size(B,1)
1 <= i <= l || throw(BoundsError)
1 <= i <= l || throw(BoundsError())
index = i
stride = 1
for k = 2:ndims-1
stride *= l
l = size(B,k)
i = to_index(I[k-1])
1 <= i <= l || throw(BoundsError)
1 <= i <= l || throw(BoundsError())
index += (i-1) * stride
end
stride *= l
Expand Down
2 changes: 1 addition & 1 deletion base/linalg/cholmod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import ..LinAlg: (\), A_mul_Bc, A_mul_Bt, Ac_ldiv_B, Ac_mul_B, At_ldiv_B, At_mul
include("cholmod_h.jl")

macro isok(A)
:($A==CHOLMOD_TRUE || throw(CholmodException))
:($A==CHOLMOD_TRUE || throw(CholmodException()))
end

const chm_ver = Array(Cint, 3)
Expand Down
2 changes: 1 addition & 1 deletion base/linalg/matmul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ scale(b::Vector, A::Matrix) = scale!(Array(promote_type(eltype(A),eltype(b)),siz

dot{T<:BlasReal}(x::Vector{T}, y::Vector{T}) = BLAS.dot(x, y)
function dot{T<:BLAS.BlasFloat, TI<:Integer}(x::Vector{T}, rx::Union(Range1{TI},Range{TI}), y::Vector{T}, ry::Union(Range1{TI},Range{TI}))
length(rx)==length(ry) || throw(DimensionMismatch)
length(rx)==length(ry) || throw(DimensionMismatch(""))
if minimum(rx) < 1 || maximum(rx) > length(x) || minimum(ry) < 1 || maximum(ry) > length(y)
throw(BoundsError())
end
Expand Down
4 changes: 2 additions & 2 deletions base/linalg/umfpack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ for (sym_r,sym_c,num_r,num_c,sol_r,sol_c,det_r,det_z,lunz,get_num_r,get_num_z,it
Ptr{Float64}, Ptr{Float64}),
U.colptr, U.rowval, U.nzval, U.symbolic, tmp,
umf_ctrl, umf_info)
status > 0 && throw(MatrixIllConditionedException)
status > 0 && throw(MatrixIllConditionedException(""))
umferror(status)
U.numeric = tmp[1]
return U
Expand All @@ -195,7 +195,7 @@ for (sym_r,sym_c,num_r,num_c,sol_r,sol_c,det_r,det_z,lunz,get_num_r,get_num_z,it
Ptr{Float64}, Ptr{Float64}),
U.colptr, U.rowval, real(U.nzval), imag(U.nzval), U.symbolic, tmp,
umf_ctrl, umf_info)
status > 0 && throw(MatrixIllConditionedException)
status > 0 && throw(MatrixIllConditionedException(""))
umferror(status)
U.numeric = tmp[1]
return U
Expand Down

0 comments on commit 0e861ac

Please sign in to comment.