From 26ce92b3526430d4a40b2faccef4facb966d6a0a Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Mon, 19 Dec 2011 17:08:25 -0500 Subject: Use std::numeric_limits<> for typesafe INT_MAX/etc --- src/qt/optionsmodel.cpp | 2 +- src/qt/transactionrecord.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qt') diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index efc216dab8..eef91db5ba 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -101,7 +101,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in case ProxyPort: { int nPort = atoi(value.toString().toAscii().data()); - if (nPort > 0 && nPort < USHRT_MAX) + if (nPort > 0 && nPort < std::numeric_limits::max()) { addrProxy.port = htons(nPort); walletdb.WriteSetting("addrProxy", addrProxy); diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index 77c5a01260..53cd35b2da 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -187,7 +187,7 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx) // Sort order, unrecorded transactions sort to the top status.sortKey = strprintf("%010d-%01d-%010u-%03d", - (pindex ? pindex->nHeight : INT_MAX), + (pindex ? pindex->nHeight : std::numeric_limits::max()), (wtx.IsCoinBase() ? 1 : 0), wtx.nTimeReceived, idx); -- cgit v1.2.3