From c21121752d95ee241eb616a9b958fc662c874803 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sun, 22 Apr 2012 13:59:24 -0400 Subject: [PATCH 1/3] CBlock::WriteToDisk() properly checks ftell(3) for error return Rather than storing ftell(3)'s return value -- a long -- in an unsigned int, we store and check a properly typed temp. Then, assured a non-negative value, we store in nBlockPosRet. --- src/main.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.h b/src/main.h index de674b5bb10..e835cdd7bb6 100644 --- a/src/main.h +++ b/src/main.h @@ -961,9 +961,10 @@ public: fileout << FLATDATA(pchMessageStart) << nSize; // Write block - nBlockPosRet = ftell(fileout); - if (nBlockPosRet == -1) + long fileOutPos = ftell(fileout); + if (fileOutPos < 0) return error("CBlock::WriteToDisk() : ftell failed"); + nBlockPosRet = fileOutPos; fileout << *this; // Flush stdio buffers and commit to disk before returning From 282e3ffe6e292ed6b11bc71414420de052193757 Mon Sep 17 00:00:00 2001 From: Timothy Redaelli Date: Wed, 25 Apr 2012 14:07:24 +0200 Subject: [PATCH 2/3] We should include netinet/in.h to use sockaddr_in (POSIX.1-2001) --- src/net.cpp | 2 ++ src/protocol.cpp | 1 + src/protocol.h | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/src/net.cpp b/src/net.cpp index 92ccb1e8806..5135a88b32d 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -12,6 +12,8 @@ #ifdef __WXMSW__ #include +#else +#include #endif #ifdef USE_UPNP diff --git a/src/protocol.cpp b/src/protocol.cpp index a3e54ebc3de..7d80d5d5d0d 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -8,6 +8,7 @@ #ifndef __WXMSW__ # include +# include #endif // Prototypes from net.h, but that header (currently) stinks, can't #include it without breaking things diff --git a/src/protocol.h b/src/protocol.h index 53d3eef4d57..6db64900f23 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -10,6 +10,10 @@ #ifndef __INCLUDED_PROTOCOL_H__ #define __INCLUDED_PROTOCOL_H__ +#ifndef __WXMSW__ +#include +#endif + #include "serialize.h" #include #include "uint256.h" From c18b82d5db39bff026f10694a062be2dc7048fd8 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Fri, 27 Apr 2012 10:50:24 -0400 Subject: [PATCH 3/3] Bump version to 0.4.6 --- contrib/Bitcoin.app/Contents/Info.plist | 2 +- doc/README | 2 +- doc/README_windows.txt | 2 +- share/setup.nsi | 6 +++--- src/serialize.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/contrib/Bitcoin.app/Contents/Info.plist b/contrib/Bitcoin.app/Contents/Info.plist index b34827e3ca8..8271c15ef45 100644 --- a/contrib/Bitcoin.app/Contents/Info.plist +++ b/contrib/Bitcoin.app/Contents/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.4.5 + 0.4.6 CFBundleSignature ???? CFBundleVersion diff --git a/doc/README b/doc/README index e572b2dd530..15f92bf4aff 100644 --- a/doc/README +++ b/doc/README @@ -1,4 +1,4 @@ -Bitcoin 0.4.5 BETA +Bitcoin 0.4.6 BETA Copyright (c) 2009-2012 Bitcoin Developers Distributed under the MIT/X11 software license, see the accompanying diff --git a/doc/README_windows.txt b/doc/README_windows.txt index 6a551a0b971..8dde1a9365a 100644 --- a/doc/README_windows.txt +++ b/doc/README_windows.txt @@ -1,4 +1,4 @@ -Bitcoin 0.4.5 BETA +Bitcoin 0.4.6 BETA Copyright (c) 2009-2012 Bitcoin Developers Distributed under the MIT/X11 software license, see the accompanying diff --git a/share/setup.nsi b/share/setup.nsi index 643b0ffef8b..27c87db84b7 100644 --- a/share/setup.nsi +++ b/share/setup.nsi @@ -5,7 +5,7 @@ SetCompressor /SOLID lzma # General Symbol Definitions !define REGKEY "SOFTWARE\$(^Name)" -!define VERSION 0.4.5 +!define VERSION 0.4.6 !define COMPANY "Bitcoin project" !define URL http://www.bitcoin.org/ @@ -45,13 +45,13 @@ Var StartMenuGroup !insertmacro MUI_LANGUAGE English # Installer attributes -OutFile bitcoin-0.4.5-win32-setup.exe +OutFile bitcoin-0.4.6-win32-setup.exe InstallDir $PROGRAMFILES\Bitcoin CRCCheck on XPStyle on BrandingText " " ShowInstDetails show -VIProductVersion 0.4.5.0 +VIProductVersion 0.4.6.0 VIAddVersionKey ProductName Bitcoin VIAddVersionKey ProductVersion "${VERSION}" VIAddVersionKey CompanyName "${COMPANY}" diff --git a/src/serialize.h b/src/serialize.h index 491169ff58b..302766062ab 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -59,7 +59,7 @@ class CDataStream; class CAutoFile; static const unsigned int MAX_SIZE = 0x02000000; -static const int VERSION = 40500; +static const int VERSION = 40600; static const char* pszSubVer = ""; static const bool VERSION_IS_BETA = true;