Browse Source

Wanrings fixes and a cleanup.

cl-refactor
Gav Wood 10 years ago
parent
commit
6531981a73
  1. 2
      alethzero/DappLoader.cpp
  2. 1
      libdevcore/Common.h
  3. 4
      libethereum/BlockChain.cpp

2
alethzero/DappLoader.cpp

@ -69,7 +69,7 @@ DappLocation DappLoader::resolveAppUri(QString const& _uri)
while (address && partIndex < parts.length())
{
lastAddress = address;
string32 name = { 0 };
string32 name = ZeroString32;
QByteArray utf8 = parts[partIndex].toUtf8();
std::copy(utf8.data(), utf8.data() + utf8.size(), name.data());
address = abiOut<Address>(web3()->ethereum()->call(address, abiIn("addr(string32)", name)));

1
libdevcore/Common.h

@ -87,6 +87,7 @@ using strings = std::vector<std::string>;
// Fixed-length string types.
using string32 = std::array<char, 32>;
static const string32 ZeroString32 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
// Null/Invalid values for convenience.
static const u256 Invalid256 = ~(u256)0;

4
libethereum/BlockChain.cpp

@ -610,8 +610,8 @@ void BlockChain::checkConsistency()
static inline unsigned upow(unsigned a, unsigned b) { while (b-- > 0) a *= a; return a; }
static inline unsigned ceilDiv(unsigned n, unsigned d) { return n / (n + d - 1); }
static inline unsigned floorDivPow(unsigned n, unsigned a, unsigned b) { return n / upow(a, b); }
static inline unsigned ceilDivPow(unsigned n, unsigned a, unsigned b) { return ceilDiv(n, upow(a, b)); }
//static inline unsigned floorDivPow(unsigned n, unsigned a, unsigned b) { return n / upow(a, b); }
//static inline unsigned ceilDivPow(unsigned n, unsigned a, unsigned b) { return ceilDiv(n, upow(a, b)); }
// Level 1
// [xxx. ]

Loading…
Cancel
Save