cpp: Resolve an ambiguous overload in some tests
authorDavid Reiss <dreiss@apache.org>
Thu, 21 May 2009 02:28:30 +0000 (02:28 +0000)
committerDavid Reiss <dreiss@apache.org>
Thu, 21 May 2009 02:28:30 +0000 (02:28 +0000)
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
test/JSONProtoTest.cpp

index 8c9aabe..f321d8f 100644 (file)
@@ -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"
index 6681356..2479638 100644 (file)
@@ -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"