Bitcoin Forum
August 20, 2018, 05:11:43 AM *
News: Latest stable version of Bitcoin Core: 0.16.2  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Compile error in SVN r127  (Read 1252 times)
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1554
Merit: 1001


View Profile
August 11, 2010, 01:20:42 AM
 #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<Config>::Value_impl(double) [with Config = json_spirit::Config_vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]
json/json_spirit_value.h:275: note:                 json_spirit::Value_impl<Config>::Value_impl(uint64_t) [with Config = json_spirit::Config_vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]
json/json_spirit_value.h:267: note:                 json_spirit::Value_impl<Config>::Value_impl(int64_t) [with Config = json_spirit::Config_vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]
json/json_spirit_value.h:259: note:                 json_spirit::Value_impl<Config>::Value_impl(int) [with Config = json_spirit::Config_vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]
json/json_spirit_value.h:251: note:                 json_spirit::Value_impl<Config>::Value_impl(bool) [with Config = json_spirit::Config_vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]
json/json_spirit_value.h:219: note:                 json_spirit::Value_impl<Config>::Value_impl(typename Config::String_type::const_pointer) [with Config = json_spirit::Config_vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]
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<Config>::Value_impl(double) [with Config = json_spirit::Config_vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]
json/json_spirit_value.h:275: note:                 json_spirit::Value_impl<Config>::Value_impl(uint64_t) [with Config = json_spirit::Config_vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]
json/json_spirit_value.h:267: note:                 json_spirit::Value_impl<Config>::Value_impl(int64_t) [with Config = json_spirit::Config_vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]
json/json_spirit_value.h:259: note:                 json_spirit::Value_impl<Config>::Value_impl(int) [with Config = json_spirit::Config_vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]
json/json_spirit_value.h:251: note:                 json_spirit::Value_impl<Config>::Value_impl(bool) [with Config = json_spirit::Config_vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]
json/json_spirit_value.h:219: note:                 json_spirit::Value_impl<Config>::Value_impl(typename Config::String_type::const_pointer) [with Config = json_spirit::Config_vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >] <near match>




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;
 }
 

Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
BOUNTY PORTALS
BLOG
WHERE BOUNTY MANAGEMENT
MEETS AUTOMATION
SIGNATURE CAMPAIGNS
TWITTER
FACEBOOK
MEDIA CAMPAIGNS
AND MORE!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1534741903
Hero Member
*
Offline Offline

Posts: 1534741903

View Profile Personal Message (Offline)

Ignore
1534741903
Reply with quote  #2

1534741903
Report to moderator
1534741903
Hero Member
*
Offline Offline

Posts: 1534741903

View Profile Personal Message (Offline)

Ignore
1534741903
Reply with quote  #2

1534741903
Report to moderator
satoshi
Founder
Sr. Member
*
qt
Offline Offline

Activity: 364
Merit: 1364


View Profile
August 11, 2010, 01:42:30 AM
 #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.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!