Skip to content

Commit

Permalink
Fix Julia v0.5 deprecations (#15)
Browse files Browse the repository at this point in the history
* fix deprecations on julia 0.5, 0.6
* add julia 0.5 to travis build matrix
* require julia 0.5
* we can just use String() now that julia 0.5 is required
  • Loading branch information
rdeits authored and kmsquire committed Dec 14, 2016
1 parent 1fbe1ed commit 6b5f4ec
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ os:
- linux
julia:
- nightly
- 0.4
- 0.3
- 0.5
notifications:
email: false
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
julia 0.3
julia 0.5
Compat
16 changes: 8 additions & 8 deletions src/MsgPack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ end
function extserialize(t::Integer, d)
i = IOBuffer()
serialize(i, d)
return Ext(t, takebuf_array(i))
return Ext(t, take!(i))
end

# return (typecode, object) from an Ext where Ext.data is a serialized object
Expand Down Expand Up @@ -121,15 +121,15 @@ unpack(s::IO) = begin

elseif b <= 0x8f
# fixmap
unpack_map(s, b $ MAP_F)
unpack_map(s, xor(b, MAP_F))

elseif b <= 0x9f
# fixarray
unpack_arr(s, b $ ARR_F)
unpack_arr(s, xor(b, ARR_F))

elseif b <= 0xbf
# fixstr
unpack_str(s, b $ STR_F)
unpack_str(s, xor(b, STR_F))

elseif 0xd4 <= b <= 0xd8
# fixext
Expand Down Expand Up @@ -162,9 +162,9 @@ unpack_arr(s, n) = begin
out
end

unpack_str(s, n) = utf8(readbytes(s, n))
unpack_ext(s, n) = Ext(read(s, Int8), readbytes(s, n), impltype=true)
unpack_bin(s, n) = readbytes(s, n)
unpack_str(s, n) = String(read(s, n))
unpack_ext(s, n) = Ext(read(s, Int8), read(s, n), impltype=true)
unpack_bin(s, n) = read(s, n)

wh(io, head, v) = begin
write(io, head)
Expand All @@ -174,7 +174,7 @@ end
pack(v) = begin
s = IOBuffer()
pack(s, v)
takebuf_array(s)
take!(s)
end


Expand Down

0 comments on commit 6b5f4ec

Please sign in to comment.