mastercoin-MSC / mastercore

mastercore info
mastercoin.org
MIT License
24 stars 11 forks source link

Fix and order includes, using directives, makefile #276

Closed dexX7 closed 9 years ago

dexX7 commented 9 years ago

There were many missing, but also many needless includes, as well as too wide imports of namespaces, which can lead to ambiguity.

Missing dependencies make it difficult to use Master Core in a different context, for example, and especially, in unit tests - which was by the way the reason I started with those maybe silly one-method-files like convert and parse_string, ...

Passes all tests:

Build log and results:

Basically nothing else than the dependency sections were touched.

zathras-crypto commented 9 years ago

pinging @m21 any objections here? Safety level?

Thanks Z

dexX7 commented 9 years ago

To review:

  1. Check, if no other code besides includes was changed.
  2. Check, if it builds without error.

Since it touches the includes and usings, a failure should show up during the build process.

Two functional changes:

In src/mastercore_rpc.cpp, src/mastercore_rpc.h:

-int populateRPCTransactionObject(uint256 txid, Object *txobj, string filterAddress = "")
+int populateRPCTransactionObject(const uint256& txid, Object *txobj, const string& filterAddress = "")

Instead of copying txid and filterAddress, a reference is passed.

In src/qt/transactiontablemodel.cpp:

-extern CWallet* pwalletMain;

pwalletMain was not used there anywhere.

dexX7 commented 9 years ago

Became part of https://github.com/mastercoin-MSC/mastercore/issues/286#issuecomment-77524801.