mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Cleanup code using forward declarations.
Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
This commit is contained in:
31
src/core.h
31
src/core.h
@@ -2,14 +2,17 @@
|
||||
// Copyright (c) 2009-2013 The Bitcoin developers
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#ifndef BITCOIN_CORE_H
|
||||
#define BITCOIN_CORE_H
|
||||
|
||||
#include "uint256.h"
|
||||
#include "serialize.h"
|
||||
#include "script.h"
|
||||
#include "serialize.h"
|
||||
#include "uint256.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
class CTransaction;
|
||||
|
||||
@@ -114,7 +117,7 @@ public:
|
||||
class CTxOut
|
||||
{
|
||||
public:
|
||||
int64 nValue;
|
||||
int64_t nValue;
|
||||
CScript scriptPubKey;
|
||||
|
||||
CTxOut()
|
||||
@@ -122,7 +125,7 @@ public:
|
||||
SetNull();
|
||||
}
|
||||
|
||||
CTxOut(int64 nValueIn, CScript scriptPubKeyIn);
|
||||
CTxOut(int64_t nValueIn, CScript scriptPubKeyIn);
|
||||
|
||||
IMPLEMENT_SERIALIZE
|
||||
(
|
||||
@@ -143,7 +146,7 @@ public:
|
||||
|
||||
uint256 GetHash() const;
|
||||
|
||||
bool IsDust(int64 nMinRelayTxFee) const
|
||||
bool IsDust(int64_t nMinRelayTxFee) const
|
||||
{
|
||||
// "Dust" is defined in terms of CTransaction::nMinRelayTxFee,
|
||||
// which has units satoshis-per-kilobyte.
|
||||
@@ -178,8 +181,8 @@ public:
|
||||
class CTransaction
|
||||
{
|
||||
public:
|
||||
static int64 nMinTxFee;
|
||||
static int64 nMinRelayTxFee;
|
||||
static int64_t nMinTxFee;
|
||||
static int64_t nMinRelayTxFee;
|
||||
static const int CURRENT_VERSION=1;
|
||||
int nVersion;
|
||||
std::vector<CTxIn> vin;
|
||||
@@ -246,17 +249,17 @@ private:
|
||||
CTxOut &txout;
|
||||
|
||||
public:
|
||||
static uint64 CompressAmount(uint64 nAmount);
|
||||
static uint64 DecompressAmount(uint64 nAmount);
|
||||
static uint64_t CompressAmount(uint64_t nAmount);
|
||||
static uint64_t DecompressAmount(uint64_t nAmount);
|
||||
|
||||
CTxOutCompressor(CTxOut &txoutIn) : txout(txoutIn) { }
|
||||
|
||||
IMPLEMENT_SERIALIZE(({
|
||||
if (!fRead) {
|
||||
uint64 nVal = CompressAmount(txout.nValue);
|
||||
uint64_t nVal = CompressAmount(txout.nValue);
|
||||
READWRITE(VARINT(nVal));
|
||||
} else {
|
||||
uint64 nVal = 0;
|
||||
uint64_t nVal = 0;
|
||||
READWRITE(VARINT(nVal));
|
||||
txout.nValue = DecompressAmount(nVal);
|
||||
}
|
||||
@@ -599,9 +602,9 @@ public:
|
||||
|
||||
uint256 GetHash() const;
|
||||
|
||||
int64 GetBlockTime() const
|
||||
int64_t GetBlockTime() const
|
||||
{
|
||||
return (int64)nTime;
|
||||
return (int64_t)nTime;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user