aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2012-04-17 10:12:33 -0700
committerGavin Andresen <gavinandresen@gmail.com>2012-04-17 10:12:33 -0700
commite873dc654c81810272e71af8b52a3836d2c8bf0a (patch)
treea0817e682ac7884a146e67a956027c1f6ac086f0 /src
parentce8c93498ab0b5b98f333b0ebb6e8c0097293ab9 (diff)
parent7fa3ad83a9060d4ebdb29f39e48eec7ea2220d98 (diff)
Merge pull request #1115 from laanwj/2012_04_cleanupmisc
Delete unused, unreachable and commented code, add missing initializer
Diffstat (limited to 'src')
-rw-r--r--src/qt/csvmodelwriter.cpp2
-rw-r--r--src/qt/transactionrecord.cpp6
-rw-r--r--src/serialize.h51
-rw-r--r--src/util.cpp1
4 files changed, 1 insertions, 59 deletions
diff --git a/src/qt/csvmodelwriter.cpp b/src/qt/csvmodelwriter.cpp
index 4b21b8c4be..84578b3322 100644
--- a/src/qt/csvmodelwriter.cpp
+++ b/src/qt/csvmodelwriter.cpp
@@ -6,7 +6,7 @@
CSVModelWriter::CSVModelWriter(const QString &filename, QObject *parent) :
QObject(parent),
- filename(filename)
+ filename(filename), model(0)
{
}
diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp
index 57210dcc02..2f3b29cc97 100644
--- a/src/qt/transactionrecord.cpp
+++ b/src/qt/transactionrecord.cpp
@@ -146,12 +146,6 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
//
// Mixed debit transaction, can't break down payees
//
- bool fAllMine = true;
- BOOST_FOREACH(const CTxOut& txout, wtx.vout)
- fAllMine = fAllMine && wallet->IsMine(txout);
- BOOST_FOREACH(const CTxIn& txin, wtx.vin)
- fAllMine = fAllMine && wallet->IsMine(txin);
-
parts.append(TransactionRecord(hash, nTime, TransactionRecord::Other, "", nNet, 0));
}
}
diff --git a/src/serialize.h b/src/serialize.h
index d34f3e557c..d24624ebee 100644
--- a/src/serialize.h
+++ b/src/serialize.h
@@ -275,48 +275,6 @@ public:
}
};
-
-
-/** string stored as a fixed length field */
-template<std::size_t LEN>
-class CFixedFieldString
-{
-protected:
- const std::string* pcstr;
- std::string* pstr;
-public:
- explicit CFixedFieldString(const std::string& str) : pcstr(&str), pstr(NULL) { }
- explicit CFixedFieldString(std::string& str) : pcstr(&str), pstr(&str) { }
-
- unsigned int GetSerializeSize(int, int=0) const
- {
- return LEN;
- }
-
- template<typename Stream>
- void Serialize(Stream& s, int, int=0) const
- {
- char pszBuf[LEN];
- strncpy(pszBuf, pcstr->c_str(), LEN);
- s.write(pszBuf, LEN);
- }
-
- template<typename Stream>
- void Unserialize(Stream& s, int, int=0)
- {
- if (pstr == NULL)
- throw std::ios_base::failure("CFixedFieldString::Unserialize : trying to unserialize to const string");
- char pszBuf[LEN+1];
- s.read(pszBuf, LEN);
- pszBuf[LEN] = '\0';
- *pstr = pszBuf;
- }
-};
-
-
-
-
-
//
// Forward declarations
//
@@ -478,10 +436,6 @@ inline void Serialize(Stream& os, const std::vector<T, A>& v, int nType, int nVe
template<typename Stream, typename T, typename A>
void Unserialize_impl(Stream& is, std::vector<T, A>& v, int nType, int nVersion, const boost::true_type&)
{
- //unsigned int nSize = ReadCompactSize(is);
- //v.resize(nSize);
- //is.read((char*)&v[0], nSize * sizeof(T));
-
// Limit size per read so bogus size value won't cause out of memory
v.clear();
unsigned int nSize = ReadCompactSize(is);
@@ -498,11 +452,6 @@ void Unserialize_impl(Stream& is, std::vector<T, A>& v, int nType, int nVersion,
template<typename Stream, typename T, typename A>
void Unserialize_impl(Stream& is, std::vector<T, A>& v, int nType, int nVersion, const boost::false_type&)
{
- //unsigned int nSize = ReadCompactSize(is);
- //v.resize(nSize);
- //for (std::vector<T, A>::iterator vi = v.begin(); vi != v.end(); ++vi)
- // Unserialize(is, (*vi), nType, nVersion);
-
v.clear();
unsigned int nSize = ReadCompactSize(is);
unsigned int i = 0;
diff --git a/src/util.cpp b/src/util.cpp
index a5427c061b..c1e3c5a806 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -301,7 +301,6 @@ bool error(const char *format, ...)
va_end(arg_ptr);
if (ret < 0 || ret >= limit)
{
- ret = limit - 1;
buffer[limit-1] = 0;
}
printf("ERROR: %s\n", buffer);