From e5eef13e6f509ad60cd2076d37f9ddfe54df7785 Mon Sep 17 00:00:00 2001 From: David Reiss Date: Thu, 21 May 2009 02:28:30 +0000 Subject: [PATCH] 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 --- test/DebugProtoTest.cpp | 2 +- test/JSONProtoTest.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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" -- 2.17.1