Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all trailing whitespace (again) #8914

Merged
merged 2 commits into from
Nov 6, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Stephan Boyer <[email protected]> <stephan@ubuntu.(none)>
Stephan Boyer <[email protected]> <[email protected]>

Jiahao Chen <[email protected]> Jiahao Chen (陈家豪) <[email protected]>

Giuseppe Zingales <[email protected]> <[email protected]>
Giuseppe Zingales <[email protected]> <[email protected]>

Expand Down Expand Up @@ -100,17 +100,17 @@ Steven G. Johnson <[email protected]> <[email protected]>
Steven G. Johnson <[email protected]> <[email protected]>

Isaiah Norton <[email protected]> <[email protected]>
Isaiah Norton <[email protected]> <[email protected]>
Isaiah Norton <[email protected]> <[email protected]>

Blake Johnson <[email protected]> <[email protected]>
Blake Johnson <[email protected]> <[email protected]>

Marcus Silva <[email protected]> <[email protected]>
Marcus Silva <[email protected]> <[email protected]>
Marcus Silva <[email protected]> <[email protected]>

Amit Murthy <[email protected]> <[email protected]>

Tanmay Mohapatra <[email protected]> <[email protected]>
Tanmay Mohapatra <[email protected]> <[email protected]>
Tanmay Mohapatra <[email protected]> <[email protected]>

Dan Luu <[email protected]> <[email protected]>
Expand All @@ -119,10 +119,10 @@ Dan Luu <[email protected]> <Dan>
Kevin Bache <[email protected]> <[email protected]>
Kevin Bache <[email protected]> <[email protected]>

Rick <[email protected]> <[email protected]>
Rick <[email protected]> <[email protected]>
Rick <[email protected]> <[email protected]>

David Smith <[email protected]> <[email protected]>
David Smith <[email protected]> <[email protected]>
David Smith <[email protected]> <[email protected]>

Carlos Becker <[email protected]> <[email protected]>
Expand All @@ -138,16 +138,16 @@ Joseph Perla <[email protected]> <joseph@ not an email.com>
Jutho <[email protected]>

Tomas Lycken <[email protected]> <[email protected]>

Simon Byrne <[email protected]> <[email protected]>
Simon Byrne <[email protected]> <[email protected]>

Jake Bolewski <[email protected]>
Simon Byrne <[email protected]> <[email protected]>
Simon Byrne <[email protected]> <[email protected]>

Jake Bolewski <[email protected]>

Leah Hanson <[email protected]> <[email protected]>

Lei Wang <[email protected]> <[email protected]>
Lei Wang <[email protected]> <[email protected]>
Lei Wang <[email protected]> <[email protected]>
Lei Wang <[email protected]> <[email protected]>

Kevin Squire <[email protected]> <[email protected]>

Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ before_install:
make $BUILDOPTS -C contrib -f repackage_system_suitesparse4.make;
fi
script:
- ! git grep ' $' -- \*.jl \*.scm \*.c \*.cpp \*.h > /dev/null || { echo "trailing whitespace found in source file"; exit 1; }
- make $BUILDOPTS prefix=/tmp/julia install
- if [ `uname` = "Darwin" ]; then
for name in spqr umfpack colamd cholmod amd suitesparse_wrapper; do
Expand Down
2 changes: 1 addition & 1 deletion base/Dates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export Period, DatePeriod, TimePeriod,
July, August, September, October, November, December,
Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec,
# conversions.jl
unix2datetime, datetime2unix, now, today,
unix2datetime, datetime2unix, now, today,
rata2datetime, datetime2rata, julian2datetime, datetime2julian,
# adjusters.jl
firstdayofweek, lastdayofweek,
Expand Down
12 changes: 6 additions & 6 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,12 @@ float{T<:Integer64}(x::AbstractArray{T}) = convert(AbstractArray{typeof(float(ze
complex{T<:Union(Integer64,Float64,Float32,Float16)}(x::AbstractArray{T}) =
convert(AbstractArray{typeof(complex(zero(T)))}, x)

function float(A::AbstractArray)
function float(A::AbstractArray)
cnv(x) = convert(FloatingPoint,x)
map_promote(cnv, A)
end

function complex(A::AbstractArray)
function complex(A::AbstractArray)
cnv(x) = convert(Complex,x)
map_promote(cnv, A)
end
Expand Down Expand Up @@ -609,7 +609,7 @@ function cat(catdims, X...)
for k = 1:length(catdims)
dims2cat[catdims[k]]=k
end

typeC = isa(X[1],AbstractArray) ? eltype(X[1]) : typeof(X[1])
dimsC = Int[d <= ndimsX[1] ? size(X[1],d) : 1 for d=1:ndimsC]
for k = 1:length(catdims)
Expand All @@ -627,12 +627,12 @@ function cat(catdims, X...)
end
end
end

C = similar(isa(X[1],AbstractArray) ? full(X[1]) : [X[1]], typeC, tuple(dimsC...))
if length(catdims)>1
fill!(C,0)
end

offsets = zeros(Int,length(catdims))
for i=1:nargs
cat_one = [ dims2cat[d]==0 ? (1:dimsC[d]) : (offsets[dims2cat[d]]+(1:catsizes[i,dims2cat[d]])) for d=1:ndimsC]
Expand Down Expand Up @@ -1378,7 +1378,7 @@ function randsubseq!(S::AbstractArray, A::AbstractArray, p::Real)
end
else
# Skip through A, in order, from each element i to the next element i+s
# included in S. The probability that the next included element is
# included in S. The probability that the next included element is
# s==k (k > 0) is (1-p)^(k-1) * p, and hence the probability (CDF) that
# s is in {1,...,k} is 1-(1-p)^k = F(k). Thus, we can draw the skip s
# from this probability distribution via the discrete inverse-transform
Expand Down
6 changes: 3 additions & 3 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ function deleteat!(a::Vector, inds)
q = p+1
while !done(inds, s)
(i,s) = next(inds, s)
if !(q <= i <= n)
if !(q <= i <= n)
i < q && error("indices must be unique and sorted")
throw(BoundsError())
end
Expand Down Expand Up @@ -761,7 +761,7 @@ end

# familiar aliases for broadcasting operations of array ± scalar (#7226):
(+)(A::AbstractArray{Bool},x::Bool) = A .+ x
(+)(x::Bool,A::AbstractArray{Bool}) = x .+ A
(+)(x::Bool,A::AbstractArray{Bool}) = x .+ A
(-)(A::AbstractArray{Bool},x::Bool) = A .- x
(-)(x::Bool,A::AbstractArray{Bool}) = x .- A
(+)(A::AbstractArray,x::Number) = A .+ x
Expand Down Expand Up @@ -795,7 +795,7 @@ for f in (:+, :-)
for i=1:length(A)
@inbounds F[i] = ($f)(A[i], B[i])
end
return F
return F
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function init_bind_addr(args::Vector{UTF8String})
bind_addr = getipaddr()
catch
# All networking is unavailable, initialize bind_addr to the loopback address
# Will cause an exception to be raised only when used.
# Will cause an exception to be raised only when used.
bind_addr = ip"127.0.0.1"
end
end
Expand Down Expand Up @@ -309,7 +309,7 @@ const LOAD_PATH = ByteString[]
function init_load_path()
vers = "v$(VERSION.major).$(VERSION.minor)"
if haskey(ENV,"JULIA_LOAD_PATH")
prepend!(LOAD_PATH, split(ENV["JULIA_LOAD_PATH"], @windows? ';' : ':'))
prepend!(LOAD_PATH, split(ENV["JULIA_LOAD_PATH"], @windows? ';' : ':'))
end
push!(LOAD_PATH,abspath(JULIA_HOME,"..","local","share","julia","site",vers))
push!(LOAD_PATH,abspath(JULIA_HOME,"..","share","julia","site",vers))
Expand Down
6 changes: 3 additions & 3 deletions base/complex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ inv{T<:Union(Float16,Float32)}(z::Complex{T}) =
# the first step is to scale variables if appropriate ,then do calculations
# in a way that avoids over/underflow (subfuncs 1 and 2), then undo the scaling.
# scaling variable s and other techniques
# based on arxiv.1210.4539
# based on arxiv.1210.4539
# a + i*b
# p + i*q = ---------
# c + i*d
Expand Down Expand Up @@ -368,10 +368,10 @@ function expm1(z::Complex)
Complex(oftype(zr,NaN), oftype(zi,NaN))
end
else
erm1 = expm1(zr)
erm1 = expm1(zr)
if zi == 0
Complex(erm1, zi)
else
else
er = erm1+one(erm1)
wr = isfinite(er) ? erm1 - 2.0*er*(sin(0.5*zi))^2 : er*cos(zi)
Complex(wr, er*sin(zi))
Expand Down
10 changes: 5 additions & 5 deletions base/dSFMT.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ end

function dsfmt_get_min_array_size()
min_array_size = ccall((:dsfmt_get_min_array_size,:libdSFMT),
Int32,
Int32,
())
end

const dsfmt_min_array_size = dsfmt_get_min_array_size()

function dsfmt_init_gen_rand(s::DSFMT_state, seed::UInt32)
ccall((:dsfmt_init_gen_rand,:libdSFMT),
Void,
(Ptr{Void}, UInt32,),
Void,
(Ptr{Void}, UInt32,),
s.val, seed)
end

function dsfmt_init_by_array(s::DSFMT_state, seed::Vector{UInt32})
ccall((:dsfmt_init_by_array,:libdSFMT),
Void,
(Ptr{Void}, Ptr{UInt32}, Int32),
Void,
(Ptr{Void}, Ptr{UInt32}, Int32),
s.val, seed, length(seed))
end

Expand Down
8 changes: 4 additions & 4 deletions base/darray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ function reshape{T,S<:Array}(A::DArray{T,1,S}, d::Dims)
for i=1:div(length(B),nr)
i2 = ind2sub(sztail, i)
globalidx = [ I[j][i2[j-1]] for j=2:nd ]

a = sub2ind(d, d1offs, globalidx...)

B[:,i] = A[a:(a+nr-1)]
end
B
Expand Down Expand Up @@ -304,8 +304,8 @@ reduce(f::Function, d::DArray) =
mapreduce(fetch, f,
Any[ @spawnat p reduce(f, localpart(d)) for p in procs(d) ])

function map!(f::Callable, d::DArray)

function map!(f::Callable, d::DArray)
@sync begin
for p in procs(d)
@spawnat p map!(f, localpart(d))
Expand Down
20 changes: 10 additions & 10 deletions base/datafmt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function ascii_if_possible(sbuff::AbstractString)
isascii(sbuff) ? convert(ASCIIString,sbuff) : sbuff
end

#
#
# Handlers act on events generated by the parser.
# Parser calls store_cell on the handler to pass events.
#
Expand Down Expand Up @@ -148,7 +148,7 @@ function DLMStore{T,S<:AbstractString}(::Type{T}, dims::NTuple{2,Integer}, has_h
DLMStore{T,S}(fill(SubString(sbuff,1,0), 1, ncols), Array(T, nrows-hdr_offset, ncols), nrows, ncols, 0, 0, hdr_offset, sbuff, auto, eol, Array(Float64,1))
end

function store_cell{T,S<:AbstractString}(dlmstore::DLMStore{T,S}, row::Int, col::Int, quoted::Bool, startpos::Int, endpos::Int)
function store_cell{T,S<:AbstractString}(dlmstore::DLMStore{T,S}, row::Int, col::Int, quoted::Bool, startpos::Int, endpos::Int)
drow = row - dlmstore.hdr_offset

ncols = dlmstore.ncols
Expand Down Expand Up @@ -190,14 +190,14 @@ function store_cell{T,S<:AbstractString}(dlmstore::DLMStore{T,S}, row::Int, col:
if fail
((T <: Number) && dlmstore.auto) ? throw(TypeError(:store_cell, "", Any, T)) : error("file entry \"$(sval)\" cannot be converted to $T")
end

dlmstore.lastrow = drow
dlmstore.lastcol = col
else
# fill header
colval((quoted && ('"' in sval)) ? replace(sval, r"\"\"", "\"") : sval, dlmstore.hdr, 1, col, tmp64)
end
end

nothing
end

Expand Down Expand Up @@ -321,9 +321,9 @@ colval{T<:Char, S<:AbstractString}(sval::S, cells::Array{T,2}, row::Int, col::In
colval{S<:AbstractString}(sval::S, cells::Array, row::Int, col::Int, tmp64::Array{Float64,1}) = true

dlm_parse(s::ASCIIString, eol::Char, dlm::Char, qchar::Char, cchar::Char, ign_adj_dlm::Bool, allow_quote::Bool, allow_comments::Bool, skipstart::Int, skipblanks::Bool, dh::DLMHandler) = begin
dlm_parse(s.data, uint8(uint32(eol)), uint8(uint32(dlm)), uint8(uint32(qchar)), uint8(uint32(cchar)),
dlm_parse(s.data, uint8(uint32(eol)), uint8(uint32(dlm)), uint8(uint32(qchar)), uint8(uint32(cchar)),
ign_adj_dlm, allow_quote, allow_comments, skipstart, skipblanks, dh)
end
end

function dlm_parse{T,D}(dbuff::T, eol::D, dlm::D, qchar::D, cchar::D, ign_adj_dlm::Bool, allow_quote::Bool, allow_comments::Bool, skipstart::Int, skipblanks::Bool, dh::DLMHandler)
all_ascii = (D <: UInt8) || (isascii(eol) && isascii(dlm) && (!allow_quote || isascii(qchar)) && (!allow_comments || isascii(cchar)))
Expand Down Expand Up @@ -388,7 +388,7 @@ function dlm_parse{T,D}(dbuff::T, eol::D, dlm::D, qchar::D, cchar::D, ign_adj_dl
state = (allow_quote && !was_cr) ? 1 : 2
expct_col = false
elseif is_dlm
if !ign_adj_dlm
if !ign_adj_dlm
expct_col = true
col += 1
store_cell(dh, nrows+1, col, false, col_start_idx, idx-2)
Expand All @@ -397,7 +397,7 @@ function dlm_parse{T,D}(dbuff::T, eol::D, dlm::D, qchar::D, cchar::D, ign_adj_dl
elseif is_eol
if (col > 0) || !skipblanks
nrows += 1
if expct_col
if expct_col
col += 1
store_cell(dh, nrows, col, false, col_start_idx, idx - (was_cr ? 3 : 2))
end
Expand Down Expand Up @@ -478,7 +478,7 @@ function dlm_parse{T,D}(dbuff::T, eol::D, dlm::D, qchar::D, cchar::D, ign_adj_dl
end
end
!isempty(error_str) && error(error_str)

return (nrows, ncols)
end

Expand Down
6 changes: 3 additions & 3 deletions base/dates/accessors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ function yearmonthday(days)
end
function year(days)
z = days + 306; h = 100z - 25; a = fld(h,3652425); b = a - fld(a,4);
y = fld(100b+h,36525); c = b + z - 365y - fld(y,4); m = div(5c+456,153);
y = fld(100b+h,36525); c = b + z - 365y - fld(y,4); m = div(5c+456,153);
return m > 12 ? y+1 : y
end
function yearmonth(days)
z = days + 306; h = 100z - 25; a = fld(h,3652425); b = a - fld(a,4);
y = fld(100b+h,36525); c = b + z - 365y - fld(y,4); m = div(5c+456,153);
y = fld(100b+h,36525); c = b + z - 365y - fld(y,4); m = div(5c+456,153);
return m > 12 ? (y+1,m-12) : (y,m)
end
function month(days)
Expand All @@ -27,7 +27,7 @@ function monthday(days)
end
function day(days)
z = days + 306; h = 100z - 25; a = fld(h,3652425); b = a - fld(a,4);
y = fld(100b+h,36525); c = b + z - 365y - fld(y,4); m = div(5c+456,153);
y = fld(100b+h,36525); c = b + z - 365y - fld(y,4); m = div(5c+456,153);
return c - div(153m-457,5)
end
# https://en.wikipedia.org/wiki/Talk:ISO_week_date#Algorithms
Expand Down
2 changes: 1 addition & 1 deletion base/dates/adjusters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ lastdayofweek(dt::DateTime) = DateTime(lastdayofweek(Date(dt)))

firstdayofmonth(dt::Date) = Date(UTD(value(dt)-day(dt)+1))
firstdayofmonth(dt::DateTime) = DateTime(firstdayofmonth(Date(dt)))
function lastdayofmonth(dt::Date)
function lastdayofmonth(dt::Date)
y,m,d = yearmonthday(dt)
return Date(UTD(value(dt)+daysinmonth(y,m)-d))
end
Expand Down
8 changes: 4 additions & 4 deletions base/dates/arithmetic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,25 @@ monthwrap(m1,m2) = (v = mod1(m1+m2,12); return v < 0 ? 12 + v : v)
# the resulting year with wraparound behavior (i.e. 2000-12 + 1 == 2001)
yearwrap(y,m1,m2) = y + fld(m1 + m2 - 1,12)

function (+)(dt::DateTime,z::Month)
function (+)(dt::DateTime,z::Month)
y,m,d = yearmonthday(dt)
ny = yearwrap(y,m,value(z))
mm = monthwrap(m,value(z)); ld = daysinmonth(ny,mm)
return DateTime(ny,mm,d <= ld ? d : ld,hour(dt),minute(dt),second(dt),millisecond(dt))
end
function (+)(dt::Date,z::Month)
function (+)(dt::Date,z::Month)
y,m,d = yearmonthday(dt)
ny = yearwrap(y,m,value(z))
mm = monthwrap(m,value(z)); ld = daysinmonth(ny,mm)
return Date(ny,mm,d <= ld ? d : ld)
end
function (-)(dt::DateTime,z::Month)
function (-)(dt::DateTime,z::Month)
y,m,d = yearmonthday(dt)
ny = yearwrap(y,m,-value(z))
mm = monthwrap(m,-value(z)); ld = daysinmonth(ny,mm)
return DateTime(ny,mm,d <= ld ? d : ld,hour(dt),minute(dt),second(dt),millisecond(dt))
end
function (-)(dt::Date,z::Month)
function (-)(dt::Date,z::Month)
y,m,d = yearmonthday(dt)
ny = yearwrap(y,m,-value(z))
mm = monthwrap(m,-value(z)); ld = daysinmonth(ny,mm)
Expand Down
Loading