From a13ab958cbba75bc9abd1ca50f3030a10a75784e Mon Sep 17 00:00:00 2001 From: Huw Pascoe Date: Wed, 27 Sep 2017 00:26:09 +0100 Subject: Fixed type conversion ambiguity --- src/common/string_util.cpp | 2 +- src/common/string_util.h | 2 +- src/common/vector_math.h | 12 +++--------- 3 files changed, 5 insertions(+), 11 deletions(-) (limited to 'src/common') diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index bad311793..6959915fa 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp @@ -117,7 +117,7 @@ std::string StringFromFormat(const char* format, ...) { } // For Debugging. Read out an u8 array. -std::string ArrayToString(const u8* data, u32 size, int line_len, bool spaces) { +std::string ArrayToString(const u8* data, size_t size, int line_len, bool spaces) { std::ostringstream oss; oss << std::setfill('0') << std::hex; diff --git a/src/common/string_util.h b/src/common/string_util.h index 075bf4ecb..259360aec 100644 --- a/src/common/string_util.h +++ b/src/common/string_util.h @@ -33,7 +33,7 @@ inline void CharArrayFromFormat(char (&out)[Count], const char* format, ...) { } // Good -std::string ArrayToString(const u8* data, u32 size, int line_len = 20, bool spaces = true); +std::string ArrayToString(const u8* data, size_t size, int line_len = 20, bool spaces = true); std::string StripSpaces(const std::string& s); std::string StripQuotes(const std::string& s); diff --git a/src/common/vector_math.h b/src/common/vector_math.h index 2b05f66ee..3f0057d9e 100644 --- a/src/common/vector_math.h +++ b/src/common/vector_math.h @@ -104,8 +104,7 @@ public: } template void operator*=(const V& f) { - x *= f; - y *= f; + *this = *this * f; } template Vec2 operator/(const V& f) const { @@ -262,9 +261,7 @@ public: } template void operator*=(const V& f) { - x *= f; - y *= f; - z *= f; + *this = *this * f; } template Vec3 operator/(const V& f) const { @@ -478,10 +475,7 @@ public: } template void operator*=(const V& f) { - x *= f; - y *= f; - z *= f; - w *= f; + *this = *this * f; } template Vec4 operator/(const V& f) const { -- cgit v1.2.3