Skip to content

Commit 602a8e1

Browse files
rename Uint => UInt (closes #8905)
1 parent cdcdc7a commit 602a8e1

File tree

156 files changed

+1818
-1808
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+1818
-1808
lines changed

NEWS.md

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ New language features
2323
Language changes
2424
----------------
2525

26+
* `Uint` et al. are now spelled `UInt` ([#8905]).
27+
2628
* `String` has been renamed to `AbstractString` ([#8872]).
2729

2830
* `None` is deprecated; use `Union()` instead ([#8423]).

base/REPL.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ function parse_input_line(s::AbstractString)
7171
# s = bytestring(s)
7272
# (expr, pos) = parse(s, 1)
7373
# (ex, pos) = ccall(:jl_parse_string, Any,
74-
# (Ptr{Uint8},Int32,Int32),
74+
# (Ptr{UInt8},Int32,Int32),
7575
# s, int32(pos)-1, 1)
7676
# if !is(ex,())
7777
# throw(ParseError("extra input after end of expression"))
7878
# end
7979
# expr
80-
ccall(:jl_parse_input_line, Any, (Ptr{Uint8},), s)
80+
ccall(:jl_parse_input_line, Any, (Ptr{UInt8},), s)
8181
end
8282

8383
function start_repl_backend(repl_channel::RemoteRef, response_channel::RemoteRef)
@@ -309,7 +309,7 @@ type REPLHistoryProvider <: HistoryProvider
309309
end
310310
REPLHistoryProvider(mode_mapping) =
311311
REPLHistoryProvider(AbstractString[], nothing, 0, -1, IOBuffer(),
312-
nothing, mode_mapping, Uint8[])
312+
nothing, mode_mapping, UInt8[])
313313

314314
const invalid_history_message = """
315315
Invalid history format. If you have a ~/.julia_history file left over from an older version of Julia, try renaming or deleting it.

base/Terminals.jl

+6-6
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ abstract TextTerminal <: Base.IO
4040

4141
# INTERFACE
4242
size(::TextTerminal) = error("Unimplemented")
43-
writepos(t::TextTerminal, x, y, s::Array{Uint8,1}) = error("Unimplemented")
43+
writepos(t::TextTerminal, x, y, s::Array{UInt8,1}) = error("Unimplemented")
4444
cmove(t::TextTerminal, x, y) = error("Unimplemented")
4545
getX(t::TextTerminal) = error("Unimplemented")
4646
getY(t::TextTerminal) = error("Unimplemented")
@@ -74,7 +74,7 @@ hascolor(::TextTerminal) = false
7474
# Utility Functions
7575
function writepos{T}(t::TextTerminal, x, y, b::Array{T})
7676
if isbits(T)
77-
writepos(t, x, y, reinterpret(Uint8, b))
77+
writepos(t, x, y, reinterpret(UInt8, b))
7878
else
7979
cmove(t, x, y)
8080
invoke(write, (IO, Array), s, a)
@@ -183,14 +183,14 @@ clear_line(t::UnixTerminal) = write(t.out_stream, "\x1b[0G\x1b[0K")
183183
#beep(t::UnixTerminal) = write(t.err_stream,"\x7")
184184

185185
write{T,N}(t::UnixTerminal, a::Array{T,N}) = write(t.out_stream, a)
186-
write(t::UnixTerminal, p::Ptr{Uint8}) = write(t.out_stream, p)
187-
write(t::UnixTerminal, p::Ptr{Uint8}, x::Integer) = write(t.out_stream, p, x)
188-
write(t::UnixTerminal, x::Uint8) = write(t.out_stream, x)
186+
write(t::UnixTerminal, p::Ptr{UInt8}) = write(t.out_stream, p)
187+
write(t::UnixTerminal, p::Ptr{UInt8}, x::Integer) = write(t.out_stream, p, x)
188+
write(t::UnixTerminal, x::UInt8) = write(t.out_stream, x)
189189
read{T,N}(t::UnixTerminal, x::Array{T,N}) = read(t.in_stream, x)
190190
readuntil(t::UnixTerminal, s::AbstractString) = readuntil(t.in_stream, s)
191191
readuntil(t::UnixTerminal, c::Char) = readuntil(t.in_stream, c)
192192
readuntil(t::UnixTerminal, s) = readuntil(t.in_stream, s)
193-
read(t::UnixTerminal, ::Type{Uint8}) = read(t.in_stream, Uint8)
193+
read(t::UnixTerminal, ::Type{UInt8}) = read(t.in_stream, UInt8)
194194
start_reading(t::UnixTerminal) = start_reading(t.in_stream)
195195
stop_reading(t::UnixTerminal) = stop_reading(t.in_stream)
196196

base/abstractarray.jl

+6-6
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,12 @@ for (f,t) in ((:char, Char),
255255
(:int32, Int32),
256256
(:int64, Int64),
257257
(:int128, Int128),
258-
(:uint, Uint),
259-
(:uint8, Uint8),
260-
(:uint16, Uint16),
261-
(:uint32, Uint32),
262-
(:uint64, Uint64),
263-
(:uint128,Uint128))
258+
(:uint, UInt),
259+
(:uint8, UInt8),
260+
(:uint16, UInt16),
261+
(:uint32, UInt32),
262+
(:uint64, UInt64),
263+
(:uint128,UInt128))
264264
@eval begin
265265
($f)(x::AbstractArray{$t}) = x
266266
($f)(x::AbstractArray{$t}) = x

base/array.jl

+21-21
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ isassigned(a::Array, i::Int...) = isdefined(a, i...)
3131
## copy ##
3232

3333
function unsafe_copy!{T}(dest::Ptr{T}, src::Ptr{T}, N)
34-
ccall(:memmove, Ptr{Void}, (Ptr{Void}, Ptr{Void}, Uint),
34+
ccall(:memmove, Ptr{Void}, (Ptr{Void}, Ptr{Void}, UInt),
3535
dest, src, N*sizeof(T))
3636
return dest
3737
end
@@ -150,7 +150,7 @@ function getindex{T<:Union(Char,Number)}(::Type{T}, r1::Range, rs::Range...)
150150
return a
151151
end
152152

153-
function fill!{T<:Union(Int8,Uint8)}(a::Array{T}, x::Integer)
153+
function fill!{T<:Union(Int8,UInt8)}(a::Array{T}, x::Integer)
154154
ccall(:memset, Ptr{Void}, (Ptr{Void}, Int32, Csize_t), a, x, length(a))
155155
return a
156156
end
@@ -402,7 +402,7 @@ function _growat!(a::Vector, i::Integer, delta::Integer)
402402
end
403403

404404
function _growat_beg!(a::Vector, i::Integer, delta::Integer)
405-
ccall(:jl_array_grow_beg, Void, (Any, Uint), a, delta)
405+
ccall(:jl_array_grow_beg, Void, (Any, UInt), a, delta)
406406
if i > 1
407407
ccall(:memmove, Ptr{Void}, (Ptr{Void}, Ptr{Void}, Csize_t),
408408
pointer(a, 1), pointer(a, 1+delta), (i-1)*elsize(a))
@@ -411,7 +411,7 @@ function _growat_beg!(a::Vector, i::Integer, delta::Integer)
411411
end
412412

413413
function _growat_end!(a::Vector, i::Integer, delta::Integer)
414-
ccall(:jl_array_grow_end, Void, (Any, Uint), a, delta)
414+
ccall(:jl_array_grow_end, Void, (Any, UInt), a, delta)
415415
n = length(a)
416416
if n >= i+delta
417417
ccall(:memmove, Ptr{Void}, (Ptr{Void}, Ptr{Void}, Csize_t),
@@ -438,7 +438,7 @@ function _deleteat_beg!(a::Vector, i::Integer, delta::Integer)
438438
ccall(:memmove, Ptr{Void}, (Ptr{Void}, Ptr{Void}, Csize_t),
439439
pointer(a, 1+delta), pointer(a, 1), (i-1)*elsize(a))
440440
end
441-
ccall(:jl_array_del_beg, Void, (Any, Uint), a, delta)
441+
ccall(:jl_array_del_beg, Void, (Any, UInt), a, delta)
442442
return a
443443
end
444444

@@ -448,7 +448,7 @@ function _deleteat_end!(a::Vector, i::Integer, delta::Integer)
448448
ccall(:memmove, Ptr{Void}, (Ptr{Void}, Ptr{Void}, Csize_t),
449449
pointer(a, i), pointer(a, i+delta), (n-i-delta+1)*elsize(a))
450450
end
451-
ccall(:jl_array_del_end, Void, (Any, Uint), a, delta)
451+
ccall(:jl_array_del_end, Void, (Any, UInt), a, delta)
452452
return a
453453
end
454454

@@ -457,27 +457,27 @@ end
457457
function push!{T}(a::Array{T,1}, item)
458458
# convert first so we don't grow the array if the assignment won't work
459459
item = convert(T, item)
460-
ccall(:jl_array_grow_end, Void, (Any, Uint), a, 1)
460+
ccall(:jl_array_grow_end, Void, (Any, UInt), a, 1)
461461
a[end] = item
462462
return a
463463
end
464464

465465
function push!(a::Array{Any,1}, item::ANY)
466-
ccall(:jl_array_grow_end, Void, (Any, Uint), a, 1)
466+
ccall(:jl_array_grow_end, Void, (Any, UInt), a, 1)
467467
arrayset(a, item, length(a))
468468
return a
469469
end
470470

471471
function append!{T}(a::Array{T,1}, items::AbstractVector)
472472
n = length(items)
473-
ccall(:jl_array_grow_end, Void, (Any, Uint), a, n)
473+
ccall(:jl_array_grow_end, Void, (Any, UInt), a, n)
474474
copy!(a, length(a)-n+1, items, 1, n)
475475
return a
476476
end
477477

478478
function prepend!{T}(a::Array{T,1}, items::AbstractVector)
479479
n = length(items)
480-
ccall(:jl_array_grow_beg, Void, (Any, Uint), a, n)
480+
ccall(:jl_array_grow_beg, Void, (Any, UInt), a, n)
481481
if a === items
482482
copy!(a, 1, items, n+1, n)
483483
else
@@ -489,18 +489,18 @@ end
489489
function resize!(a::Vector, nl::Integer)
490490
l = length(a)
491491
if nl > l
492-
ccall(:jl_array_grow_end, Void, (Any, Uint), a, nl-l)
492+
ccall(:jl_array_grow_end, Void, (Any, UInt), a, nl-l)
493493
else
494494
if nl < 0
495495
throw(BoundsError())
496496
end
497-
ccall(:jl_array_del_end, Void, (Any, Uint), a, l-nl)
497+
ccall(:jl_array_del_end, Void, (Any, UInt), a, l-nl)
498498
end
499499
return a
500500
end
501501

502502
function sizehint(a::Vector, sz::Integer)
503-
ccall(:jl_array_sizehint, Void, (Any, Uint), a, sz)
503+
ccall(:jl_array_sizehint, Void, (Any, UInt), a, sz)
504504
a
505505
end
506506

@@ -509,13 +509,13 @@ function pop!(a::Vector)
509509
error("array must be non-empty")
510510
end
511511
item = a[end]
512-
ccall(:jl_array_del_end, Void, (Any, Uint), a, 1)
512+
ccall(:jl_array_del_end, Void, (Any, UInt), a, 1)
513513
return item
514514
end
515515

516516
function unshift!{T}(a::Array{T,1}, item)
517517
item = convert(T, item)
518-
ccall(:jl_array_grow_beg, Void, (Any, Uint), a, 1)
518+
ccall(:jl_array_grow_beg, Void, (Any, UInt), a, 1)
519519
a[1] = item
520520
return a
521521
end
@@ -525,7 +525,7 @@ function shift!(a::Vector)
525525
error("array must be non-empty")
526526
end
527527
item = a[1]
528-
ccall(:jl_array_del_beg, Void, (Any, Uint), a, 1)
528+
ccall(:jl_array_del_beg, Void, (Any, UInt), a, 1)
529529
return item
530530
end
531531

@@ -578,7 +578,7 @@ function deleteat!(a::Vector, inds)
578578
@inbounds a[p] = a[q]
579579
p += 1; q += 1
580580
end
581-
ccall(:jl_array_del_end, Void, (Any, Uint), a, n-p+1)
581+
ccall(:jl_array_del_end, Void, (Any, UInt), a, n-p+1)
582582
return a
583583
end
584584

@@ -640,7 +640,7 @@ function splice!{T<:Integer}(a::Vector, r::UnitRange{T}, ins=_default_splice)
640640
end
641641

642642
function empty!(a::Vector)
643-
ccall(:jl_array_del_end, Void, (Any, Uint), a, length(a))
643+
ccall(:jl_array_del_end, Void, (Any, UInt), a, length(a))
644644
return a
645645
end
646646

@@ -828,8 +828,8 @@ function complex{T<:Real}(A::Array{T}, B::Real)
828828
end
829829

830830
# use memcmp for lexcmp on byte arrays
831-
function lexcmp(a::Array{Uint8,1}, b::Array{Uint8,1})
832-
c = ccall(:memcmp, Int32, (Ptr{Uint8}, Ptr{Uint8}, Uint),
831+
function lexcmp(a::Array{UInt8,1}, b::Array{UInt8,1})
832+
c = ccall(:memcmp, Int32, (Ptr{UInt8}, Ptr{UInt8}, UInt),
833833
a, b, min(length(a),length(b)))
834834
c < 0 ? -1 : c > 0 ? +1 : cmp(length(a),length(b))
835835
end
@@ -1001,7 +1001,7 @@ function vcat{T}(arrays::Vector{T}...)
10011001
end
10021002
for a in arrays
10031003
nba = length(a)*elsz
1004-
ccall(:memcpy, Ptr{Void}, (Ptr{Void}, Ptr{Void}, Uint),
1004+
ccall(:memcpy, Ptr{Void}, (Ptr{Void}, Ptr{Void}, UInt),
10051005
ptr+offset, a, nba)
10061006
offset += nba
10071007
end

base/ascii.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## from base/boot.jl:
22
#
33
# immutable ASCIIString <: DirectIndexString
4-
# data::Array{Uint8,1}
4+
# data::Array{UInt8,1}
55
# end
66
#
77

@@ -28,7 +28,7 @@ function string(c::ASCIIString...)
2828
for s in c
2929
n += length(s.data)
3030
end
31-
v = Array(Uint8,n)
31+
v = Array(UInt8,n)
3232
o = 1
3333
for s in c
3434
ls = length(s.data)
@@ -98,8 +98,8 @@ write(io::IO, s::ASCIIString) = write(io, s.data)
9898
ascii(x) = convert(ASCIIString, x)
9999
convert(::Type{ASCIIString}, s::ASCIIString) = s
100100
convert(::Type{ASCIIString}, s::UTF8String) = ascii(s.data)
101-
convert(::Type{ASCIIString}, a::Array{Uint8,1}) = is_valid_ascii(a) ? ASCIIString(a) : error("invalid ASCII sequence")
102-
function convert(::Type{ASCIIString}, a::Array{Uint8,1}, invalids_as::ASCIIString)
101+
convert(::Type{ASCIIString}, a::Array{UInt8,1}) = is_valid_ascii(a) ? ASCIIString(a) : error("invalid ASCII sequence")
102+
function convert(::Type{ASCIIString}, a::Array{UInt8,1}, invalids_as::ASCIIString)
103103
l = length(a)
104104
idx = 1
105105
iscopy = false

base/base.jl

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ call(T::Type{UndefVarError}, var::Symbol) = Core.call(T, var)
1717
call(T::Type{InterruptException}) = Core.call(T)
1818
call(T::Type{SymbolNode}, name::Symbol, t::ANY) = Core.call(T, name, t)
1919
call(T::Type{GetfieldNode}, value, name::Symbol, typ) = Core.call(T, value, name, typ)
20-
call(T::Type{ASCIIString}, d::Array{Uint8,1}) = Core.call(T, d)
21-
call(T::Type{UTF8String}, d::Array{Uint8,1}) = Core.call(T, d)
20+
call(T::Type{ASCIIString}, d::Array{UInt8,1}) = Core.call(T, d)
21+
call(T::Type{UTF8String}, d::Array{UInt8,1}) = Core.call(T, d)
2222
call(T::Type{TypeVar}, args...) = Core.call(T, args...)
2323
call(T::Type{TypeConstructor}, args...) = Core.call(T, args...)
2424
call(T::Type{Expr}, args::ANY...) = _expr(args...)
@@ -59,7 +59,7 @@ cconvert(T, x) = convert(T, x)
5959
# use the code in ccall.cpp to safely allocate temporary pointer arrays
6060
cconvert{T}(::Type{Ptr{Ptr{T}}}, a::Array) = a
6161
# convert strings to ByteString to pass as pointers
62-
cconvert{P<:Union(Int8,Uint8)}(::Type{Ptr{P}}, s::AbstractString) = bytestring(s)
62+
cconvert{P<:Union(Int8,UInt8)}(::Type{Ptr{P}}, s::AbstractString) = bytestring(s)
6363

6464
reinterpret{T,S}(::Type{T}, x::S) = box(T,unbox(S,x))
6565

@@ -127,8 +127,8 @@ ccall(:jl_get_system_hooks, Void, ())
127127

128128
int(x) = convert(Int, x)
129129
int(x::Int) = x
130-
uint(x) = convert(Uint, x)
131-
uint(x::Uint) = x
130+
uint(x) = convert(UInt, x)
131+
uint(x::UInt) = x
132132

133133
# index colon
134134
type Colon
@@ -164,14 +164,14 @@ function append_any(xs...)
164164
for x in xs
165165
for y in x
166166
if i > l
167-
ccall(:jl_array_grow_end, Void, (Any, Uint), out, 16)
167+
ccall(:jl_array_grow_end, Void, (Any, UInt), out, 16)
168168
l += 16
169169
end
170170
arrayset(out, y, i)
171171
i += 1
172172
end
173173
end
174-
ccall(:jl_array_del_end, Void, (Any, Uint), out, l-i+1)
174+
ccall(:jl_array_del_end, Void, (Any, UInt), out, l-i+1)
175175
out
176176
end
177177

0 commit comments

Comments
 (0)