From bde280b9a4da2652716c8ffdeed9ebfa4461cc70 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 21 Dec 2011 22:33:19 +0100 Subject: Revert "Use standard C99 (and Qt) types for 64-bit integers" This reverts commit 21d9f36781604e4ca9fc35dc65265593423b73e9. --- src/qt/bitcoin.cpp | 3 +-- src/qt/bitcoinamountfield.cpp | 1 - src/qt/bitcoinamountfield.h | 1 - src/qt/bitcoingui.cpp | 1 - src/qt/bitcoingui.h | 1 - src/qt/bitcoinstrings.cpp | 2 +- src/qt/bitcoinunits.cpp | 1 - src/qt/bitcoinunits.h | 1 - src/qt/guiutil.cpp | 1 - src/qt/guiutil.h | 1 - src/qt/notificator.cpp | 1 - src/qt/optionsmodel.cpp | 2 -- src/qt/optionsmodel.h | 1 - src/qt/overviewpage.cpp | 1 - src/qt/overviewpage.h | 1 - src/qt/sendcoinsdialog.cpp | 1 - src/qt/sendcoinsdialog.h | 1 - src/qt/transactiondesc.cpp | 17 ++++++++--------- src/qt/transactionfilterproxy.cpp | 1 - src/qt/transactionfilterproxy.h | 1 - src/qt/transactionrecord.cpp | 20 +++++++++----------- src/qt/transactionrecord.h | 17 ++++++++--------- src/qt/transactionview.cpp | 1 - src/qt/walletmodel.cpp | 5 ++--- src/qt/walletmodel.h | 1 - 25 files changed, 29 insertions(+), 55 deletions(-) (limited to 'src/qt') diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index f696ca0f89..cba4e851b4 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -9,7 +9,6 @@ #include "headers.h" #include "init.h" -#include #include #include #include @@ -57,7 +56,7 @@ int ThreadSafeMessageBox(const std::string& message, const std::string& caption, return 4; } -bool ThreadSafeAskFee(qint64 nFeeRequired, const std::string& strCaption, wxWindow* parent) +bool ThreadSafeAskFee(int64 nFeeRequired, const std::string& strCaption, wxWindow* parent) { if(!guiref) return false; diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp index f385bc55e8..19cd5655cc 100644 --- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -4,7 +4,6 @@ #include "guiconstants.h" -#include #include #include #include diff --git a/src/qt/bitcoinamountfield.h b/src/qt/bitcoinamountfield.h index 954ed1ebd0..ead8bdb84b 100644 --- a/src/qt/bitcoinamountfield.h +++ b/src/qt/bitcoinamountfield.h @@ -1,7 +1,6 @@ #ifndef BITCOINFIELD_H #define BITCOINFIELD_H -#include #include QT_BEGIN_NAMESPACE diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index fa317a25ef..1c49683364 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -27,7 +27,6 @@ #include "macdockiconhandler.h" #endif -#include #include #include #include diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index a0b3652fc0..a0905e44ad 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -1,7 +1,6 @@ #ifndef BITCOINGUI_H #define BITCOINGUI_H -#include #include #include diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index b4ebe9d723..624ff58ce5 100644 --- a/src/qt/bitcoinstrings.cpp +++ b/src/qt/bitcoinstrings.cpp @@ -82,4 +82,4 @@ QT_TRANSLATE_NOOP("bitcoin-core", "" "Warning: Please check that your computer's date and time are correct. If " "your clock is wrong Bitcoin will not work properly."), QT_TRANSLATE_NOOP("bitcoin-core", "beta"), -}; +}; \ No newline at end of file diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp index 0845d2104b..9a9a4890dc 100644 --- a/src/qt/bitcoinunits.cpp +++ b/src/qt/bitcoinunits.cpp @@ -1,6 +1,5 @@ #include "bitcoinunits.h" -#include #include BitcoinUnits::BitcoinUnits(QObject *parent): diff --git a/src/qt/bitcoinunits.h b/src/qt/bitcoinunits.h index 35c0d8ea0d..18fa36a0b7 100644 --- a/src/qt/bitcoinunits.h +++ b/src/qt/bitcoinunits.h @@ -1,7 +1,6 @@ #ifndef BITCOINUNITS_H #define BITCOINUNITS_H -#include #include #include diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 378660b049..158b84a285 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -5,7 +5,6 @@ #include "headers.h" -#include #include #include #include diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 4a4cc62345..94e3314d14 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -1,7 +1,6 @@ #ifndef GUIUTIL_H #define GUIUTIL_H -#include #include QT_BEGIN_NAMESPACE diff --git a/src/qt/notificator.cpp b/src/qt/notificator.cpp index 5e9969bf9e..a2314caa47 100644 --- a/src/qt/notificator.cpp +++ b/src/qt/notificator.cpp @@ -1,6 +1,5 @@ #include "notificator.h" -#include #include #include #include diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index bc56bdea03..a68c84c957 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -1,5 +1,3 @@ -#include - #include "optionsmodel.h" #include "bitcoinunits.h" diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index 13d964b256..775362d636 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -1,7 +1,6 @@ #ifndef OPTIONSMODEL_H #define OPTIONSMODEL_H -#include #include class CWallet; diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 1710519e0d..5b5a8f5271 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -9,7 +9,6 @@ #include "guiutil.h" #include "guiconstants.h" -#include #include #include diff --git a/src/qt/overviewpage.h b/src/qt/overviewpage.h index 46317d9b9e..1199227168 100644 --- a/src/qt/overviewpage.h +++ b/src/qt/overviewpage.h @@ -1,7 +1,6 @@ #ifndef OVERVIEWPAGE_H #define OVERVIEWPAGE_H -#include #include QT_BEGIN_NAMESPACE diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index e6b500cfde..762f27dfa6 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -8,7 +8,6 @@ #include "guiutil.h" #include "askpassphrasedialog.h" -#include #include #include #include diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h index d879fbe973..82910257f0 100644 --- a/src/qt/sendcoinsdialog.h +++ b/src/qt/sendcoinsdialog.h @@ -1,7 +1,6 @@ #ifndef SENDCOINSDIALOG_H #define SENDCOINSDIALOG_H -#include #include namespace Ui { diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index a19ec875d9..6ca3ac8c4b 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -6,7 +6,6 @@ #include "headers.h" #include "qtui.h" -#include #include #include // For Qt::escape @@ -56,10 +55,10 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) strHTML.reserve(4000); strHTML += ""; - qint64 nTime = wtx.GetTxTime(); - qint64 nCredit = wtx.GetCredit(); - qint64 nDebit = wtx.GetDebit(); - qint64 nNet = nCredit - nDebit; + int64 nTime = wtx.GetTxTime(); + int64 nCredit = wtx.GetCredit(); + int64 nDebit = wtx.GetDebit(); + int64 nNet = nCredit - nDebit; strHTML += tr("Status: ") + FormatTxStatus(wtx); int nRequests = wtx.GetRequestCount(); @@ -142,7 +141,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) // // Coinbase // - qint64 nUnmatured = 0; + int64 nUnmatured = 0; BOOST_FOREACH(const CTxOut& txout, wtx.vout) nUnmatured += wallet->GetCredit(txout); strHTML += tr("Credit: "); @@ -201,13 +200,13 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) if (fAllToMe) { // Payment to self - qint64 nChange = wtx.GetChange(); - qint64 nValue = nCredit - nChange; + int64 nChange = wtx.GetChange(); + int64 nValue = nCredit - nChange; strHTML += tr("Debit: ") + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, -nValue) + "
"; strHTML += tr("Credit: ") + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, nValue) + "
"; } - qint64 nTxFee = nDebit - wtx.GetValueOut(); + int64 nTxFee = nDebit - wtx.GetValueOut(); if (nTxFee > 0) strHTML += tr("Transaction fee: ") + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC,-nTxFee) + "
"; } diff --git a/src/qt/transactionfilterproxy.cpp b/src/qt/transactionfilterproxy.cpp index 278186fe6e..16fb4dab92 100644 --- a/src/qt/transactionfilterproxy.cpp +++ b/src/qt/transactionfilterproxy.cpp @@ -1,7 +1,6 @@ #include "transactionfilterproxy.h" #include "transactiontablemodel.h" -#include #include #include diff --git a/src/qt/transactionfilterproxy.h b/src/qt/transactionfilterproxy.h index e33b5e5fb0..76cf46f156 100644 --- a/src/qt/transactionfilterproxy.h +++ b/src/qt/transactionfilterproxy.h @@ -1,7 +1,6 @@ #ifndef TRANSACTIONFILTERPROXY_H #define TRANSACTIONFILTERPROXY_H -#include #include #include diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index 8a1f1b6772..53cd35b2da 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -1,5 +1,3 @@ -#include - #include "transactionrecord.h" #include "headers.h" @@ -35,10 +33,10 @@ bool TransactionRecord::showTransaction(const CWalletTx &wtx) QList TransactionRecord::decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx) { QList parts; - qint64 nTime = wtx.nTimeDisplayed = wtx.GetTxTime(); - qint64 nCredit = wtx.GetCredit(true); - qint64 nDebit = wtx.GetDebit(); - qint64 nNet = nCredit - nDebit; + int64 nTime = wtx.nTimeDisplayed = wtx.GetTxTime(); + int64 nCredit = wtx.GetCredit(true); + int64 nDebit = wtx.GetDebit(); + int64 nNet = nCredit - nDebit; uint256 hash = wtx.GetHash(); std::map mapValue = wtx.mapValue; @@ -60,7 +58,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * if (nCredit == 0) { - qint64 nUnmatured = 0; + int64 nUnmatured = 0; BOOST_FOREACH(const CTxOut& txout, wtx.vout) nUnmatured += wallet->GetCredit(txout); sub.credit = nUnmatured; @@ -105,7 +103,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * if (fAllFromMe && fAllToMe) { // Payment to self - qint64 nChange = wtx.GetChange(); + int64 nChange = wtx.GetChange(); parts.append(TransactionRecord(hash, nTime, TransactionRecord::SendToSelf, "", -(nDebit - nChange), nCredit - nChange)); @@ -115,7 +113,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * // // Debit // - qint64 nTxFee = nDebit - wtx.GetValueOut(); + int64 nTxFee = nDebit - wtx.GetValueOut(); for (int nOut = 0; nOut < wtx.vout.size(); nOut++) { @@ -146,7 +144,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * } } - qint64 nValue = txout.nValue; + int64 nValue = txout.nValue; /* Add fee to first output */ if (nTxFee > 0) { @@ -229,7 +227,7 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx) // For generated transactions, determine maturity if(type == TransactionRecord::Generated) { - qint64 nCredit = wtx.GetCredit(true); + int64 nCredit = wtx.GetCredit(true); if (nCredit == 0) { status.maturity = TransactionStatus::Immature; diff --git a/src/qt/transactionrecord.h b/src/qt/transactionrecord.h index db29b94576..704cfe65b7 100644 --- a/src/qt/transactionrecord.h +++ b/src/qt/transactionrecord.h @@ -3,7 +3,6 @@ #include "uint256.h" -#include #include class CWallet; @@ -47,8 +46,8 @@ public: /** @name Reported status @{*/ Status status; - qint64 depth; - qint64 open_for; /**< Timestamp if status==OpenUntilDate, otherwise number of blocks */ + int64 depth; + int64 open_for; /**< Timestamp if status==OpenUntilDate, otherwise number of blocks */ /**@}*/ /** Current number of blocks (to know whether cached status is still valid) */ @@ -80,15 +79,15 @@ public: { } - TransactionRecord(uint256 hash, qint64 time): + TransactionRecord(uint256 hash, int64 time): hash(hash), time(time), type(Other), address(""), debit(0), credit(0), idx(0) { } - TransactionRecord(uint256 hash, qint64 time, + TransactionRecord(uint256 hash, int64 time, Type type, const std::string &address, - qint64 debit, qint64 credit): + int64 debit, int64 credit): hash(hash), time(time), type(type), address(address), debit(debit), credit(credit), idx(0) { @@ -102,11 +101,11 @@ public: /** @name Immutable transaction attributes @{*/ uint256 hash; - qint64 time; + int64 time; Type type; std::string address; - qint64 debit; - qint64 credit; + int64 debit; + int64 credit; /**@}*/ /** Subtransaction index, for sort key */ diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index af9597117d..2dcbf1ea8a 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -11,7 +11,6 @@ #include "editaddressdialog.h" #include "optionsmodel.h" -#include #include #include #include diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index b71256a23d..f028f10f6c 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -6,7 +6,6 @@ #include "headers.h" -#include #include #include @@ -121,7 +120,7 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(const QListcs_wallet) { // Sendmany - std::vector > vecSend; + std::vector > vecSend; foreach(const SendCoinsRecipient &rcp, recipients) { CScript scriptPubKey; @@ -131,7 +130,7 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(const QListCreateTransaction(vecSend, wtx, keyChange, nFeeRequired); if(!fCreated) diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index 6c0d6d2afd..89e8cdd2a0 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -1,7 +1,6 @@ #ifndef WALLETMODEL_H #define WALLETMODEL_H -#include #include #include "util.h" -- cgit v1.2.3