From e62aff72cb2b4251a903e82f04ffc91b8cf03b0c Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Sat, 12 Jan 2013 21:51:57 -0800 Subject: [PATCH 1/3] Cosmetic. --- src/cpp/ripple/Interpreter.h | 7 ++----- src/cpp/ripple/Offer.cpp | 4 +++- src/cpp/ripple/Offer.h | 5 +++-- src/cpp/ripple/Operation.h | 6 ++++-- src/cpp/ripple/OrderBook.h | 4 ++-- src/cpp/ripple/ScriptData.cpp | 4 +++- src/cpp/ripple/ScriptData.h | 5 +++-- 7 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/cpp/ripple/Interpreter.h b/src/cpp/ripple/Interpreter.h index 5b43017bf..f544ab845 100644 --- a/src/cpp/ripple/Interpreter.h +++ b/src/cpp/ripple/Interpreter.h @@ -50,7 +50,7 @@ public: Interpreter(); - // returns a TransactionEngineResult + // returns a TransactionEngineResult TER interpret(Contract* contract,const SerializedTransaction& txn,std::vector& code); void stop(); @@ -67,16 +67,13 @@ public: bool startBlock(int offset); bool endBlock(); - Data::pointer getIntData(); Data::pointer getFloatData(); Data::pointer getUint160Data(); Data::pointer getAcceptData(int index); Data::pointer getContractData(int index); - - }; } // end namespace -#endif \ No newline at end of file +#endif diff --git a/src/cpp/ripple/Offer.cpp b/src/cpp/ripple/Offer.cpp index 5fe7add9f..126f6801b 100644 --- a/src/cpp/ripple/Offer.cpp +++ b/src/cpp/ripple/Offer.cpp @@ -13,4 +13,6 @@ Offer::Offer(SerializedLedgerEntry::pointer ledgerEntry) : AccountItem(ledgerEnt mTakerGets = mLedgerEntry->getFieldAmount(sfTakerGets); mTakerPays = mLedgerEntry->getFieldAmount(sfTakerPays); mSeq = mLedgerEntry->getFieldU32(sfSequence); -} \ No newline at end of file +} + +// vim:ts=4 diff --git a/src/cpp/ripple/Offer.h b/src/cpp/ripple/Offer.h index 75cc5dc57..94a4fe837 100644 --- a/src/cpp/ripple/Offer.h +++ b/src/cpp/ripple/Offer.h @@ -1,6 +1,5 @@ #include "AccountItems.h" - class Offer : public AccountItem { RippleAddress mAccount; @@ -20,4 +19,6 @@ public: RippleAddress getAccount(){ return(mAccount); } int getSeq(){ return(mSeq); } -}; \ No newline at end of file +}; + +// vim:ts=4 diff --git a/src/cpp/ripple/Operation.h b/src/cpp/ripple/Operation.h index 5c0c6b8d1..6e0c75043 100644 --- a/src/cpp/ripple/Operation.h +++ b/src/cpp/ripple/Operation.h @@ -305,7 +305,7 @@ public: bool work(Interpreter* interpreter) { Data::pointer index=interpreter->popStack(); - if(index->isInt32()) + if(index->isInt32()) { interpreter->pushStack( interpreter->getContractData(index->getInt())); return(true); @@ -315,4 +315,6 @@ public: } }; -} \ No newline at end of file +} + +// vim:ts=4 diff --git a/src/cpp/ripple/OrderBook.h b/src/cpp/ripple/OrderBook.h index 7042bb5fe..b4556f01d 100644 --- a/src/cpp/ripple/OrderBook.h +++ b/src/cpp/ripple/OrderBook.h @@ -30,6 +30,6 @@ public: // looks through the best offers to see how much it would cost to take the given amount STAmount& getTakePrice(STAmount& takeAmount); - +}; -}; \ No newline at end of file +// vim:ts=4 diff --git a/src/cpp/ripple/ScriptData.cpp b/src/cpp/ripple/ScriptData.cpp index 52442c0d1..51cb4caf0 100644 --- a/src/cpp/ripple/ScriptData.cpp +++ b/src/cpp/ripple/ScriptData.cpp @@ -1 +1,3 @@ -#include "ScriptData.h" \ No newline at end of file +#include "ScriptData.h" + +// vim:ts=4 diff --git a/src/cpp/ripple/ScriptData.h b/src/cpp/ripple/ScriptData.h index 0e84e8f92..480cc9f25 100644 --- a/src/cpp/ripple/ScriptData.h +++ b/src/cpp/ripple/ScriptData.h @@ -4,7 +4,7 @@ #include namespace Script { -class Data +class Data { public: typedef boost::shared_ptr pointer; @@ -89,5 +89,6 @@ public: } +#endif -#endif \ No newline at end of file +// vim:ts=4 From cced837600a0739c5f6e4260ffaa5986ef0a15e9 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Sat, 12 Jan 2013 22:01:21 -0800 Subject: [PATCH 2/3] Fixes for SConstruct on FreeBSD. --- SConstruct | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 0800c402b..53745565f 100644 --- a/SConstruct +++ b/SConstruct @@ -75,10 +75,21 @@ else: ] ) +# Apparently, only linux uses -ldl +if not FreeBSD: + env.Append( + LIBS = [ + 'dl', # dynamic linking for linux + ] + ) + +# Apparently, pkg-config --libs protobuf on bsd fails to provide this necessary include dir. +if FreeBSD: + env.Append(LINKFLAGS = ['-I/usr/local/include']) + env.Append( LIBS = [ 'protobuf', - 'dl', # dynamic linking 'z' ] ) From d47c637129035edb3cc435d693c5e3cad036886d Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Sat, 12 Jan 2013 22:05:20 -0800 Subject: [PATCH 3/3] Cosmetic. --- src/cpp/ripple/AccountItems.h | 8 +++++--- src/cpp/ripple/OrderBookDB.h | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/cpp/ripple/AccountItems.h b/src/cpp/ripple/AccountItems.h index fc4afe7c7..3382dff26 100644 --- a/src/cpp/ripple/AccountItems.h +++ b/src/cpp/ripple/AccountItems.h @@ -4,9 +4,9 @@ #include "Ledger.h" #include "SerializedLedger.h" -/* -Way to fetch ledger entries from an account's owner dir -*/ +// +// Fetch ledger entries from an account's owner dir. +// class AccountItem { protected: @@ -42,3 +42,5 @@ public: }; #endif + +// vim:ts=4 diff --git a/src/cpp/ripple/OrderBookDB.h b/src/cpp/ripple/OrderBookDB.h index 206898dad..ded3562ae 100644 --- a/src/cpp/ripple/OrderBookDB.h +++ b/src/cpp/ripple/OrderBookDB.h @@ -27,4 +27,6 @@ public: // returns the best rate we can find float getPrice(uint160& currencyIn,uint160& currencyOut); -}; \ No newline at end of file +}; + +// vim:ts=4