aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimothy D. Prime <tdprime@teleosmedia.com>2017-01-26 10:11:37 -0800
committerTimothy D. Prime <tdprime@teleosmedia.com>2017-01-26 10:11:37 -0800
commit99f584376e53aad34b149ebf5d720fd7271f1c81 (patch)
treefb70de4ce90730c18872969597dc40c2fc6ccd0a /src
parentMerge pull request #1622 (diff)
downloadmonero-99f584376e53aad34b149ebf5d720fd7271f1c81.tar.xz
Fix invalid + of std::string and int
These warnings were emitted by clang++, and they are real bugs. src/rpc/core_rpc_server.cpp:208:58: warning: adding 'uint64_t' (aka 'unsigned long') to a string does not append to the string [-Wstring-plus-int] res.status = "Error retrieving block at height " + height; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ The obvious intent is achieved by using std::to_string().
Diffstat (limited to 'src')
-rw-r--r--src/rpc/core_rpc_server.cpp2
-rw-r--r--src/wallet/wallet2.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index 7d896e491..8ae1255c2 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -205,7 +205,7 @@ namespace cryptonote
}
catch (...)
{
- res.status = "Error retrieving block at height " + height;
+ res.status = "Error retrieving block at height " + std::to_string(height);
return true;
}
std::list<transaction> txs;
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 4348b8a62..2f06be450 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -5424,9 +5424,9 @@ uint64_t wallet2::get_blockchain_height_by_date(uint16_t year, uint8_t month, ui
throw std::runtime_error(oss.str());
}
cryptonote::block blk_min, blk_mid, blk_max;
- if (!parse_and_validate_block_from_blob(res.blocks[0].block, blk_min)) throw std::runtime_error("failed to parse blob at height " + height_min);
- if (!parse_and_validate_block_from_blob(res.blocks[1].block, blk_mid)) throw std::runtime_error("failed to parse blob at height " + height_mid);
- if (!parse_and_validate_block_from_blob(res.blocks[2].block, blk_max)) throw std::runtime_error("failed to parse blob at height " + height_max);
+ if (!parse_and_validate_block_from_blob(res.blocks[0].block, blk_min)) throw std::runtime_error("failed to parse blob at height " + std::to_string(height_min));
+ if (!parse_and_validate_block_from_blob(res.blocks[1].block, blk_mid)) throw std::runtime_error("failed to parse blob at height " + std::to_string(height_mid));
+ if (!parse_and_validate_block_from_blob(res.blocks[2].block, blk_max)) throw std::runtime_error("failed to parse blob at height " + std::to_string(height_max));
uint64_t timestamp_min = blk_min.timestamp;
uint64_t timestamp_mid = blk_mid.timestamp;
uint64_t timestamp_max = blk_max.timestamp;