Skip to content

Commit 4869b01

Browse files
committed
Merge pull request #32 from timholy/teh/fix0.4
Fix deprecations, removal of Range1 from Base on 0.4
2 parents 7769507 + b74d77c commit 4869b01

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

src/ProfileView.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ immutable TagData
4242
ip::Uint
4343
status::Int
4444
end
45-
const TAGNONE = TagData(uint(0), -1)
45+
const TAGNONE = TagData(@compat(UInt(0)), -1)
4646

4747
type ProfileData
4848
img
@@ -91,8 +91,8 @@ function prepare(data; C = false, lidict = nothing, colorgc = true, combine = tr
9191
end
9292
isjl = builddict(uip, [!lkup[i].fromC for i = 1:nuip])
9393
isgc = builddict(uip, [lkup[i].func == "jl_gc_collect" for i = 1:nuip])
94-
isjl[uint(0)] = false # needed for root below
95-
isgc[uint(0)] = false
94+
isjl[@compat(UInt(0))] = false # needed for root below
95+
isgc[@compat(UInt(0))] = false
9696
p = Profile.liperm(lkup)
9797
rank = similar(p)
9898
rank[p] = 1:length(p)
@@ -359,7 +359,7 @@ function buildimg(imgtags, colors, bkg, gccolor, colorgc::Bool, combine::Bool, l
359359
w = size(imgtags,1)
360360
h = size(imgtags,2)
361361
img = fill(bkg, w, h)
362-
colorlen = int(length(colors)/2)
362+
colorlen = round(Int, length(colors)/2)
363363
for j = 1:h
364364
coloroffset = colorlen*iseven(j)
365365
colorindex = 1
@@ -399,7 +399,7 @@ function buildimg(imgtags, colors, bkg, gccolor, colorgc::Bool, combine::Bool, l
399399
img
400400
end
401401

402-
function fillrow!(img, j, rng::Range1{Int}, colorindex, colorlen, regcolor, gccolor, status)
402+
function fillrow!(img, j, rng::UnitRange{Int}, colorindex, colorlen, regcolor, gccolor, status)
403403
if status > 0
404404
img[rng,j] = gccolor
405405
return colorindex

src/pvtree.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
module PVTree
22

33
using ..Tree
4+
using Compat
45

56
export PVData, buildgraph!, prunegraph!
67

78
# ProfileView data we need attached to each node of the graph:
89
type PVData
910
ip::Uint # the instruction pointer
10-
hspan::Range1{Int} # horizontal span (used as the x-axis in display)
11+
hspan::UnitRange{Int} # horizontal span (used as the x-axis in display)
1112
status::Int # nonzero for special handling, (e.g., gc events)
1213
end
13-
PVData(hspan::Range1{Int}) = PVData(uint(0), hspan, 0)
14-
PVData(ip::Uint, hspan::Range1{Int}) = PVData(ip, hspan, 0)
14+
PVData(hspan::UnitRange{Int}) = PVData(@compat(UInt(0)), hspan, 0)
15+
PVData(ip::Uint, hspan::UnitRange{Int}) = PVData(ip, hspan, 0)
1516

1617
# Suppose we have several dicts:
1718
# isjl[ip]: true/false depending on whether it's a Julia function rather than C/Fortran

test/pvtree.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using Compat
2+
13
# First do the following from src/
24
# include("tree.jl")
35
# include("pvtree.jl")
@@ -12,14 +14,14 @@
1214
# 0J
1315
# 2J 5J 6J 4J
1416

15-
node(ip::Integer) = PVTree.PVData(uint(ip), 1:0)
17+
node(ip::Integer) = PVTree.PVData(@compat(UInt(ip)), 1:0)
1618

1719
if VERSION < v"0.4.0-dev+980"
1820
isjl = Dict(uint(0:7),[true,false,true,false,true,true,true,false])
1921
isgc = Dict(uint(0:7),[falses(7);true])
2022
else
21-
isjl = Dict(zip(uint(0:7),[true,false,true,false,true,true,true,false]))
22-
isgc = Dict(zip(uint(0:7),[falses(7);true]))
23+
isjl = Dict(zip(@compat(map(UInt, 0:7)),[true,false,true,false,true,true,true,false]))
24+
isgc = Dict(zip(@compat(map(UInt, 0:7)),[falses(7);true]))
2325
end
2426

2527
function buildraw()

0 commit comments

Comments
 (0)