Skip to content

Commit e1ca4b8

Browse files
authored
Merge pull request #150 from JuliaIO/yyc/0.7
Fix most of depwarn and error on 0.7
2 parents bf2c3b3 + 5fd33a7 commit e1ca4b8

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/query.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ function add_format{sym}(fmt::Type{DataFormat{sym}}, magic::Union{Tuple,Abstract
8989
end
9090

9191
# for multiple magic bytes
92-
function add_format{sym, T <: Vector{UInt8}, N}(fmt::Type{DataFormat{sym}}, magics::NTuple{N, T}, extension)
92+
function add_format{sym, T <: Vector{UInt8}}(fmt::Type{DataFormat{sym}},
93+
magics::Tuple{T,Vararg{T}}, extension)
9394
haskey(sym2info, sym) && error("format ", fmt, " is already registered")
9495
magics = map(canonicalize_magic, magics)
9596
for magic in magics

src/registry.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ add_format(format"FLAC","fLaC",".flac",[:FLAC])
151151
const tiff_magic = (UInt8[0x4d,0x4d,0x00,0x2a], UInt8[0x4d,0x4d,0x00,0x2b], UInt8[0x49,0x49,0x2a,0x00],UInt8[0x49,0x49,0x2b,0x00])
152152
function detecttiff(io)
153153
seekstart(io)
154-
magic = read(io, UInt8, 4)
154+
magic = read!(io, Vector{UInt8}(4))
155155
# do any of the first 4 bytes match any of the 4 possible combinations of tiff magics
156156
return any(map(x->all(magic .== x), tiff_magic))
157157
end
@@ -218,8 +218,8 @@ function detect_stlascii(io)
218218
end
219219

220220
function detect_stlbinary(io)
221-
const size_header = 80+sizeof(UInt32)
222-
const size_triangleblock = (4*3*sizeof(Float32)) + sizeof(UInt16)
221+
size_header = 80+sizeof(UInt32)
222+
size_triangleblock = (4*3*sizeof(Float32)) + sizeof(UInt16)
223223

224224
position(io) != 0 && (seekstart(io); return false)
225225
seekend(io)

test/loadsave.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ import FileIO: File, @format_str, Stream, stream, skipmagic
169169

170170
load(f::File{format"AmbigExt1"}) = open(f) do io
171171
skipmagic(io)
172-
readstring(stream(io))
172+
read(stream(io), String)
173173
end
174174
load(f::File{format"AmbigExt2"}) = open(f) do io
175175
skipmagic(io)
176-
readstring(stream(io))
176+
read(stream(io), String)
177177
end
178178

179179
save(f::File{format"AmbigExt1"}, testdata) = open(f, "w") do io

0 commit comments

Comments
 (0)