From 787721616ec1ab72689bfcca83dc4f5ace3be617 Mon Sep 17 00:00:00 2001 From: Krystie Date: Tue, 24 Mar 2026 11:32:41 +0100 Subject: [PATCH] Fix C++11 literal-suffix warnings in main.h and trianglesrpc.cpp Added spaces between format specifiers and PRIszu/PRIu64/PRIx64 macros to comply with C++11 requirements. Fixed warnings in: - main.h: lines 646 (2x), 1073, 1334 - trianglesrpc.cpp: lines 433, 1067 Build verified successful with no new errors. --- src/main.h | 6 +++--- src/trianglesrpc.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.h b/src/main.h index 71040e7..7cd09fa 100644 --- a/src/main.h +++ b/src/main.h @@ -643,7 +643,7 @@ public: { std::string str; str += IsCoinBase()? "Coinbase" : (IsCoinStake()? "Coinstake" : "CTransaction"); - str += strprintf("(hash=%s, nTime=%d, ver=%d, vin.size=%"PRIszu", vout.size=%"PRIszu", nLockTime=%d)\n", + str += strprintf("(hash=%s, nTime=%d, ver=%d, vin.size=%" PRIszu ", vout.size=%" PRIszu ", nLockTime=%d)\n", GetHash().ToString().substr(0,10).c_str(), nTime, nVersion, @@ -1070,7 +1070,7 @@ public: void print() const { - printf("CBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%"PRIszu", vchBlockSig=%s)\n", + printf("CBlock(hash=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%" PRIszu ", vchBlockSig=%s)\n", GetHash().ToString().c_str(), nVersion, hashPrevBlock.ToString().c_str(), @@ -1331,7 +1331,7 @@ public: std::string ToString() const { - return strprintf("CBlockIndex(nprev=%p, pnext=%p, nFile=%u, nBlockPos=%-6d nHeight=%d, nMint=%s, nMoneySupply=%s, nFlags=(%s)(%d)(%s), nStakeModifier=%016"PRIx64", nStakeModifierChecksum=%08x, hashProofOfStake=%s, prevoutStake=(%s), nStakeTime=%d merkle=%s, hashBlock=%s)", + return strprintf("CBlockIndex(nprev=%p, pnext=%p, nFile=%u, nBlockPos=%-6d nHeight=%d, nMint=%s, nMoneySupply=%s, nFlags=(%s)(%d)(%s), nStakeModifier=%016" PRIx64 ", nStakeModifierChecksum=%08x, hashProofOfStake=%s, prevoutStake=(%s), nStakeTime=%d merkle=%s, hashBlock=%s)", pprev, pnext, nFile, nBlockPos, nHeight, FormatMoney(nMint).c_str(), FormatMoney(nMoneySupply).c_str(), GeneratedStakeModifier() ? "MOD" : "-", GetStakeEntropyBit(), IsProofOfStake()? "PoS" : "PoW", diff --git a/src/trianglesrpc.cpp b/src/trianglesrpc.cpp index 9aae40c..30018da 100644 --- a/src/trianglesrpc.cpp +++ b/src/trianglesrpc.cpp @@ -430,7 +430,7 @@ static string HTTPReply(int nStatus, const string& strMsg, bool keepalive) "HTTP/1.1 %d %s\r\n" "Date: %s\r\n" "Connection: %s\r\n" - "Content-Length: %"PRIszu"\r\n" + "Content-Length: %" PRIszu "\r\n" "Content-Type: application/json\r\n" "Server: Triangles-json-rpc/%s\r\n" "\r\n" @@ -1064,7 +1064,7 @@ static void HandleSSEConnection(AcceptedConnection* conn) // Send events for (size_t i = 0; i < vEvents.size(); i++) { - std::string strSSE = strprintf("id: %"PRIu64"\ndata: %s\n\n", nLastId - vEvents.size() + i + 1, vEvents[i].c_str()); + std::string strSSE = strprintf("id: %" PRIu64 "\ndata: %s\n\n", nLastId - vEvents.size() + i + 1, vEvents[i].c_str()); try { conn->stream() << strSSE << std::flush; } catch (...) {