From: David Reiss Date: Thu, 21 May 2009 02:28:30 +0000 (+0000) Subject: cpp: Resolve an ambiguous overload in some tests X-Git-Tag: 0.2.0~104 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=e5eef13e6f509ad60cd2076d37f9ddfe54df7785;p=common%2Fthrift.git cpp: Resolve an ambiguous overload in some tests sqrt is defined for floats and long doubles in addition to doubles. Add a cast (from int) to specify which one we want. git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@776930 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/DebugProtoTest.cpp b/test/DebugProtoTest.cpp index 8c9aabec..f321d8fd 100644 --- a/test/DebugProtoTest.cpp +++ b/test/DebugProtoTest.cpp @@ -47,7 +47,7 @@ int main() { n.my_ooe.integer16 = 16; n.my_ooe.integer32 = 32; n.my_ooe.integer64 = 64; - n.my_ooe.double_precision = (std::sqrt(5)+1)/2; + n.my_ooe.double_precision = (std::sqrt(5.0)+1)/2; n.my_ooe.some_characters = ":R (me going \"rrrr\")"; n.my_ooe.zomg_unicode = "\xd3\x80\xe2\x85\xae\xce\x9d\x20" "\xd0\x9d\xce\xbf\xe2\x85\xbf\xd0\xbe\xc9\xa1\xd0\xb3\xd0\xb0\xcf\x81\xe2\x84\x8e" diff --git a/test/JSONProtoTest.cpp b/test/JSONProtoTest.cpp index 66813569..24796388 100644 --- a/test/JSONProtoTest.cpp +++ b/test/JSONProtoTest.cpp @@ -49,7 +49,7 @@ int main() { n.my_ooe.integer16 = 16; n.my_ooe.integer32 = 32; n.my_ooe.integer64 = 64; - n.my_ooe.double_precision = (std::sqrt(5)+1)/2; + n.my_ooe.double_precision = (std::sqrt(5.0)+1)/2; n.my_ooe.some_characters = ":R (me going \"rrrr\")"; n.my_ooe.zomg_unicode = "\xd3\x80\xe2\x85\xae\xce\x9d\x20" "\xd0\x9d\xce\xbf\xe2\x85\xbf\xd0\xbe\xc9\xa1\xd0\xb3\xd0\xb0\xcf\x81\xe2\x84\x8e"