Author

Topic: Compile error in SVN r127 (Read 7827 times)

founder
Activity: 364
Merit: 6735
August 10, 2010, 09:42:30 PM
#2
Updated SVN.  Thanks.

There's little hope of not repeatedly stumbling over that in the future.  It doesn't break the compile for me.
legendary
Activity: 1596
Merit: 1099
August 10, 2010, 09:20:42 PM
#1
Building r127 here, we see some missing casts, apparently:

Code:
rpc.cpp: In function ‘json_spirit::Value gethashespersec(const json_spirit::Array&, bool)’:
rpc.cpp:340: error: conversion from ‘int64’ to ‘json_spirit::Value’ is ambiguous
json/json_spirit_value.h:283: note: candidates are: json_spirit::Value_impl::Value_impl(double) [with Config = json_spirit::Config_vector, std::allocator > >]
json/json_spirit_value.h:275: note:                 json_spirit::Value_impl::Value_impl(uint64_t) [with Config = json_spirit::Config_vector, std::allocator > >]
json/json_spirit_value.h:267: note:                 json_spirit::Value_impl::Value_impl(int64_t) [with Config = json_spirit::Config_vector, std::allocator > >]
json/json_spirit_value.h:259: note:                 json_spirit::Value_impl::Value_impl(int) [with Config = json_spirit::Config_vector, std::allocator > >]
json/json_spirit_value.h:251: note:                 json_spirit::Value_impl::Value_impl(bool) [with Config = json_spirit::Config_vector, std::allocator > >]
json/json_spirit_value.h:219: note:                 json_spirit::Value_impl::Value_impl(typename Config::String_type::const_pointer) [with Config = json_spirit::Config_vector, std::allocator > >]
rpc.cpp:341: error: conversion from ‘int64’ to ‘json_spirit::Value’ is ambiguous
json/json_spirit_value.h:283: note: candidates are: json_spirit::Value_impl::Value_impl(double) [with Config = json_spirit::Config_vector, std::allocator > >]
json/json_spirit_value.h:275: note:                 json_spirit::Value_impl::Value_impl(uint64_t) [with Config = json_spirit::Config_vector, std::allocator > >]
json/json_spirit_value.h:267: note:                 json_spirit::Value_impl::Value_impl(int64_t) [with Config = json_spirit::Config_vector, std::allocator > >]
json/json_spirit_value.h:259: note:                 json_spirit::Value_impl::Value_impl(int) [with Config = json_spirit::Config_vector, std::allocator > >]
json/json_spirit_value.h:251: note:                 json_spirit::Value_impl::Value_impl(bool) [with Config = json_spirit::Config_vector, std::allocator > >]
json/json_spirit_value.h:219: note:                 json_spirit::Value_impl::Value_impl(typename Config::String_type::const_pointer) [with Config = json_spirit::Config_vector, std::allocator > >]




The following patch seems to solve the problem:
Code:
--- a/rpc.cpp
+++ b/rpc.cpp
@@ -337,8 +337,8 @@ Value gethashespersec(const Array& params, bool fHelp)
             "Returns a recent hashes per second performance measurement while g
 
     if (GetTimeMillis() - nHPSTimerStart > 8000)
-        return (int64)0;
-    return (int64)dHashesPerSec;
+        return (int64_t)0;
+    return (int64_t)dHashesPerSec;
 }
 
Jump to: