diff --git a/cpp/configure.in b/cpp/configure.in index 2dd92d18..23d7d6ee 100644 --- a/cpp/configure.in +++ b/cpp/configure.in @@ -55,7 +55,7 @@ if test "$msgpack_cv_atomic_ops" != "yes"; then Note that gcc < 4.1 is not supported. If you are using gcc >= 4.1 and the default target CPU architecture is "i386", try to -add CFLAGS="--march=i686" and CXXFLAGS="-march=i686" options to ./configure as follows: +add CFLAGS="-march=i686" and CXXFLAGS="-march=i686" options to ./configure as follows: $ ./configure CFLAGS="-march=i686" CXXFLAGS="-march=i686" ]) diff --git a/cpp/src/msgpack/type/float.hpp b/cpp/src/msgpack/type/float.hpp index a60ef0bf..11df6b2c 100644 --- a/cpp/src/msgpack/type/float.hpp +++ b/cpp/src/msgpack/type/float.hpp @@ -30,7 +30,7 @@ namespace msgpack { inline float& operator>> (object o, float& v) { if(o.type != type::DOUBLE) { throw type_error(); } - v = o.via.dec; + v = (float)o.via.dec; return v; } @@ -60,7 +60,7 @@ inline packer& operator<< (packer& o, const double& v) inline void operator<< (object& o, float v) { o.type = type::DOUBLE; - o.via.dec = v; + o.via.dec = (double)v; } inline void operator<< (object& o, double v) diff --git a/cpp/src/msgpack/type/int.hpp b/cpp/src/msgpack/type/int.hpp index e2d18209..e45121df 100644 --- a/cpp/src/msgpack/type/int.hpp +++ b/cpp/src/msgpack/type/int.hpp @@ -35,11 +35,11 @@ namespace detail { if(o.type == type::POSITIVE_INTEGER) { if(o.via.u64 > (uint64_t)std::numeric_limits::max()) { throw type_error(); } - return o.via.u64; + return (T)o.via.u64; } else if(o.type == type::NEGATIVE_INTEGER) { if(o.via.i64 < (int64_t)std::numeric_limits::min()) { throw type_error(); } - return o.via.i64; + return (T)o.via.i64; } throw type_error(); } @@ -51,7 +51,7 @@ namespace detail { if(o.type == type::POSITIVE_INTEGER) { if(o.via.u64 > (uint64_t)std::numeric_limits::max()) { throw type_error(); } - return o.via.u64; + return (T)o.via.u64; } throw type_error(); } diff --git a/cpp/src/objectc.c b/cpp/src/objectc.c index d4f1c8aa..548e923e 100644 --- a/cpp/src/objectc.c +++ b/cpp/src/objectc.c @@ -164,7 +164,7 @@ void msgpack_object_print(FILE* out, msgpack_object o) default: // FIXME - fprintf(out, "#", o.type, o.via.u64); + fprintf(out, "#", o.type, o.via.u64); } }