Bitcoin Forum
December 07, 2016, 12:51:40 PM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Compile error in SVN r127  (Read 1071 times)
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1470


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, bitcoin core dev team and BitPay engineer; opinions are my own, not my employer.
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
1481115100
Hero Member
*
Offline Offline

Posts: 1481115100

View Profile Personal Message (Offline)

Ignore
1481115100
Reply with quote  #2

1481115100
Report to moderator
1481115100
Hero Member
*
Offline Offline

Posts: 1481115100

View Profile Personal Message (Offline)

Ignore
1481115100
Reply with quote  #2

1481115100
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481115100
Hero Member
*
Offline Offline

Posts: 1481115100

View Profile Personal Message (Offline)

Ignore
1481115100
Reply with quote  #2

1481115100
Report to moderator
1481115100
Hero Member
*
Offline Offline

Posts: 1481115100

View Profile Personal Message (Offline)

Ignore
1481115100
Reply with quote  #2

1481115100
Report to moderator
1481115100
Hero Member
*
Offline Offline

Posts: 1481115100

View Profile Personal Message (Offline)

Ignore
1481115100
Reply with quote  #2

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

Activity: 364


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!