From 7f91fb7b1ed29a7eb02fc1956e3ae5e196ce5297 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Tue, 31 Jan 2012 09:46:21 +0000 Subject: [PATCH] change read_xxx_xxx methods to not return input value by ref. --- include/mapnik/global.hpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/include/mapnik/global.hpp b/include/mapnik/global.hpp index f834552c7..767ecc73a 100644 --- a/include/mapnik/global.hpp +++ b/include/mapnik/global.hpp @@ -74,7 +74,7 @@ typedef boost::uint8_t byte; // read int16_t NDR (little endian) -inline boost::int16_t& read_int16_ndr(const char* data, boost::int16_t & val) +inline void read_int16_ndr(const char* data, boost::int16_t & val) { #ifndef MAPNIK_BIG_ENDIAN std::memcpy(&val,data,2); @@ -82,11 +82,10 @@ inline boost::int16_t& read_int16_ndr(const char* data, boost::int16_t & val) val = (data[0]&0xff) | ((data[1]&0xff)<<8); #endif - return val; } // read int32_t NDR (little endian) -inline boost::int32_t& read_int32_ndr(const char* data, boost::int32_t & val) +inline void read_int32_ndr(const char* data, boost::int32_t & val) { #ifndef MAPNIK_BIG_ENDIAN std::memcpy(&val,data,4); @@ -96,11 +95,10 @@ inline boost::int32_t& read_int32_ndr(const char* data, boost::int32_t & val) ((data[2]&0xff)<<16) | ((data[3]&0xff)<<24); #endif - return val; } // read double NDR (little endian) -inline double& read_double_ndr(const char* data, double & val) +inline void read_double_ndr(const char* data, double & val) { #ifndef MAPNIK_BIG_ENDIAN std::memcpy(&val,&data[0],8); @@ -115,33 +113,30 @@ inline double& read_double_ndr(const char* data, double & val) ((boost::int64_t)data[7] & 0xff) << 56 ; std::memcpy(&val,&bits,8); #endif - return val; } // read int16_t XDR (big endian) -inline boost::int16_t& read_int16_xdr(const char* data, boost::int16_t & val) +inline void read_int16_xdr(const char* data, boost::int16_t & val) { #ifndef MAPNIK_BIG_ENDIAN val = (data[3]&0xff) | ((data[2]&0xff)<<8); #else std::memcpy(&val,data,2); #endif - return val; } // read int32_t XDR (big endian) -inline boost::int32_t& read_int32_xdr(const char* data, boost::int32_t & val) +inline void read_int32_xdr(const char* data, boost::int32_t & val) { #ifndef MAPNIK_BIG_ENDIAN val = (data[3]&0xff) | ((data[2]&0xff)<<8) | ((data[1]&0xff)<<16) | ((data[0]&0xff)<<24); #else std::memcpy(&val,data,4); #endif - return val; } // read double XDR (big endian) -inline double& read_double_xdr(const char* data, double & val) +inline void read_double_xdr(const char* data, double & val) { #ifndef MAPNIK_BIG_ENDIAN boost::int64_t bits = ((boost::int64_t)data[7] & 0xff) | @@ -156,7 +151,6 @@ inline double& read_double_xdr(const char* data, double & val) #else std::memcpy(&val,&data[0],8); #endif - return val; } #ifdef _WINDOWS