From 37dfbca88ebdd92855b2230baef96c8a27b4afc7 Mon Sep 17 00:00:00 2001 From: Alexey Stukalov Date: Thu, 9 Mar 2017 17:38:39 +0100 Subject: [PATCH] fix deprecated map!(f, v) calls --- src/io/XDRIO.jl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/io/XDRIO.jl b/src/io/XDRIO.jl index c379bb9..2a07a10 100644 --- a/src/io/XDRIO.jl +++ b/src/io/XDRIO.jl @@ -14,13 +14,19 @@ readuint32(io::XDRIO) = ntoh(read(io.sub, UInt32)) readfloat64(io::XDRIO) = ntoh(read(io.sub, Float64)) readintorNA(io::XDRIO) = readint32(io) -readintorNA(io::XDRIO, n::RVecLength) = map!(ntoh, read(io.sub, Int32, n)) +function readintorNA(io::XDRIO, n::RVecLength) + v = read(io.sub, Int32, n) + return map!(ntoh, v, v) +end # this method have Win32 ABI issues, see JuliaStats/RData.jl#5 # R's NA is silently converted to NaN when the value is loaded in the register(?) #readfloatorNA(io::XDRIO) = readfloat64(io) -readfloatorNA(io::XDRIO, n::RVecLength) = reinterpret(Float64, map!(ntoh, read(io.sub, UInt64, n))) +function readfloatorNA(io::XDRIO, n::RVecLength) + v = read(io.sub, UInt64, n) + return reinterpret(Float64, map!(ntoh, v, v)) +end readuint8(io::XDRIO, n::RVecLength) = readbytes(io.sub, n)