From 496a77bdf8c5e6ea59c843381e9d4eccbf8028dc Mon Sep 17 00:00:00 2001 From: Tim Hughes Date: Wed, 4 Jun 2014 11:34:14 +0100 Subject: [PATCH] Fixed all the windows compile errors and project reorg with the exception of the more complex problem in Parser.cpp --- alethzero/MainWin.cpp | 3 + alethzero/MiningView.cpp | 15 +- alethzero/MiningView.h | 2 +- libethereum/Client.cpp | 2 +- libethsupport/FixedHash.h | 2 +- libethsupport/MemoryDB.cpp | 2 +- libethsupport/TrieDB.h | 8 +- liblll/CodeFragment.h | 2 +- libqethereum/QEthereum.cpp | 4 +- windows/Alethzero.vcxproj | 26 ++- windows/Alethzero.vcxproj.filters | 5 + windows/Ethereum.sln | 15 +- windows/LibEthCore.vcxproj | 193 ------------------- windows/LibEthCore.vcxproj.filters | 41 ---- windows/LibEthereum.props | 2 +- windows/LibEthereum.vcxproj | 71 +++++-- windows/LibEthereum.vcxproj.filters | 285 ++++++++++++++++++++++++---- windows/LibQEthereum.props | 2 +- 18 files changed, 360 insertions(+), 320 deletions(-) delete mode 100644 windows/LibEthCore.vcxproj delete mode 100644 windows/LibEthCore.vcxproj.filters diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 6873612a8..ccc7191d5 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -1266,4 +1266,7 @@ void Main::updateDebugger() #include\ "moc_MainWin.cpp" +#include\ +"moc_MiningView.cpp" + #endif diff --git a/alethzero/MiningView.cpp b/alethzero/MiningView.cpp index d347ee200..5720bb595 100644 --- a/alethzero/MiningView.cpp +++ b/alethzero/MiningView.cpp @@ -27,9 +27,20 @@ #include "Grapher.h" using namespace std; -using namespace eth; using namespace lb; +// do *not* use eth since eth::uint conflicts with Qt's global unit definition +// using namespace eth; + +// types + +using eth::MineInfo; +using eth::MineProgress; + +// functions +using eth::toString; +using eth::trimFront; + string id(float _y) { return toString(_y); } string s(float _x){ return toString(round(_x * 1000) / 1000) + (!_x ? "s" : ""); } string sL(float _x, float _y) { return toString(round(_x * 1000)) + "s (" + toString(_y) + ")"; } @@ -95,7 +106,7 @@ void MiningView::paintEvent(QPaintEvent*) g.init(&p, make_pair(0.f, max(m_duration * 0.1f, m_values.size() * 0.1f)), make_pair(0, 255.f - (m_progress.requirement - 4)), s, id, sL); g.drawAxes(); - g.setDataTransform(0.1, 0, -1, 255.f); + g.setDataTransform(0.1f, 0, -1.0f, 255.f); g.drawLineGraph(m_values, QColor(192, 192, 192)); g.drawLineGraph(m_bests, QColor(128, 128, 128)); diff --git a/alethzero/MiningView.h b/alethzero/MiningView.h index 9bd9072aa..090614b38 100644 --- a/alethzero/MiningView.h +++ b/alethzero/MiningView.h @@ -27,7 +27,7 @@ namespace eth { -class MineInfo; +struct MineInfo; } class MiningView: public QWidget diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index eb9ea80ad..cb7d487c5 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -224,7 +224,7 @@ void Client::work() { if (m_restartMining) { - m_mineProgress.best = (uint)-1; + m_mineProgress.best = (double)-1; m_mineProgress.hashes = 0; m_mineProgress.ms = 0; lock_guard l(m_lock); diff --git a/libethsupport/FixedHash.h b/libethsupport/FixedHash.h index e7e238371..728e36e50 100644 --- a/libethsupport/FixedHash.h +++ b/libethsupport/FixedHash.h @@ -120,7 +120,7 @@ public: { FixedHash ret; for (auto& i: ret.m_data) - i = std::uniform_int_distribution(0, 255)(_eng); + i = std::uniform_int_distribution(0, 255)(_eng); return ret; } diff --git a/libethsupport/MemoryDB.cpp b/libethsupport/MemoryDB.cpp index 44da8457b..aa4621307 100644 --- a/libethsupport/MemoryDB.cpp +++ b/libethsupport/MemoryDB.cpp @@ -91,8 +91,8 @@ bool MemoryDB::kill(h256 _h) return false; } #else - return true; } + return true; #endif } diff --git a/libethsupport/TrieDB.h b/libethsupport/TrieDB.h index 58cbcf039..a9dba9d1c 100644 --- a/libethsupport/TrieDB.h +++ b/libethsupport/TrieDB.h @@ -200,7 +200,7 @@ private: std::string atAux(RLP const& _here, NibbleSlice _key) const; void mergeAtAux(RLPStream& _out, RLP const& _replace, NibbleSlice _key, bytesConstRef _value); - bytes mergeAt(RLP const& _replace, NibbleSlice _k, bytesConstRef _v, bool _inline = false); + bytes mergeAt(RLP const& _replace, NibbleSlice _k, bytesConstRef _v, bool _inLine = false); bool deleteAtAux(RLPStream& _out, RLP const& _replace, NibbleSlice _key); bytes deleteAt(RLP const& _replace, NibbleSlice _k); @@ -502,7 +502,7 @@ template std::string GenericTrieDB::atAux(RLP const& _here, Nibbl } } -template bytes GenericTrieDB::mergeAt(RLP const& _orig, NibbleSlice _k, bytesConstRef _v, bool _inline) +template bytes GenericTrieDB::mergeAt(RLP const& _orig, NibbleSlice _k, bytesConstRef _v, bool _inLine) { #if ETH_PARANOIA tdebug << "mergeAt " << _orig << _k << sha3(_orig.data()).abridged(); @@ -529,7 +529,7 @@ template bytes GenericTrieDB::mergeAt(RLP const& _orig, NibbleSli // partial key is our key - move down. if (_k.contains(k) && !isLeaf(_orig)) { - if (!_inline) + if (!_inLine) killNode(_orig); RLPStream s(2); s.append(_orig[0]); @@ -555,7 +555,7 @@ template bytes GenericTrieDB::mergeAt(RLP const& _orig, NibbleSli return place(_orig, _k, _v); // Kill the node. - if (!_inline) + if (!_inLine) killNode(_orig); // not exactly our node - delve to next level at the correct index. diff --git a/liblll/CodeFragment.h b/liblll/CodeFragment.h index 2c6f2cce6..8e3ff1d7d 100644 --- a/liblll/CodeFragment.h +++ b/liblll/CodeFragment.h @@ -32,7 +32,7 @@ namespace sp = boost::spirit; namespace eth { -class CompilerState; +struct CompilerState; class CodeFragment { diff --git a/libqethereum/QEthereum.cpp b/libqethereum/QEthereum.cpp index 02d62c5b9..835f7224d 100644 --- a/libqethereum/QEthereum.cpp +++ b/libqethereum/QEthereum.cpp @@ -397,7 +397,7 @@ QString QEthereum::doCreate(QString _secret, QString _amount, QString _init, QSt client()->changed(); auto ret = toQJS(client()->transact(toSecret(_secret), toU256(_amount), toBytes(_init), toU256(_gas), toU256(_gasPrice))); while (!client()->peekChanged()) - usleep(10000); + this_thread::sleep_for(chrono::milliseconds(10)); return ret; } @@ -406,7 +406,7 @@ void QEthereum::doTransact(QString _secret, QString _amount, QString _dest, QStr client()->changed(); client()->transact(toSecret(_secret), toU256(_amount), toAddress(_dest), toBytes(_data), toU256(_gas), toU256(_gasPrice)); while (!client()->peekChanged()) - usleep(10000); + this_thread::sleep_for(chrono::milliseconds(10)); } // extra bits needed to link on VS diff --git a/windows/Alethzero.vcxproj b/windows/Alethzero.vcxproj index b54e97b47..8008c9e01 100644 --- a/windows/Alethzero.vcxproj +++ b/windows/Alethzero.vcxproj @@ -173,8 +173,10 @@ + + Create Create @@ -202,6 +204,26 @@ $(IntDir)moc_%(FileName).cpp $(IntDir)moc_%(FileName).cpp + + + + $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" + + + $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" + + + $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" + + + $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" + + + $(IntDir)moc_%(FileName).cpp + $(IntDir)moc_%(FileName).cpp + $(IntDir)moc_%(FileName).cpp + $(IntDir)moc_%(FileName).cpp + @@ -255,7 +277,9 @@ - $(BuildDependsOn);FinalCopy + + $(BuildDependsOn);FinalCopy + diff --git a/windows/Alethzero.vcxproj.filters b/windows/Alethzero.vcxproj.filters index e1095cf3b..308b3feb2 100644 --- a/windows/Alethzero.vcxproj.filters +++ b/windows/Alethzero.vcxproj.filters @@ -9,11 +9,16 @@ Windows + + Windows + + + diff --git a/windows/Ethereum.sln b/windows/Ethereum.sln index e968f32c0..b600c0a50 100644 --- a/windows/Ethereum.sln +++ b/windows/Ethereum.sln @@ -27,11 +27,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Walleth", "Walleth.vcxproj" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibQEthereum", "LibQEthereum.vcxproj", "{DF3C5B07-A1A2-4F16-B37F-A27333622CDD}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibEthCore", "LibEthCore.vcxproj", "{22DAD0B1-4EC6-425A-B75C-FE7F01FEE615}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eth", "Eth.vcxproj", "{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Eth", "Eth.vcxproj", "{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Neth", "Neth.vcxproj", "{90C70663-7181-4E99-9079-54188CEB8954}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "neth", "Neth.vcxproj", "{90C70663-7181-4E99-9079-54188CEB8954}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -121,14 +119,6 @@ Global {DF3C5B07-A1A2-4F16-B37F-A27333622CDD}.Release|Win32.Build.0 = Release|Win32 {DF3C5B07-A1A2-4F16-B37F-A27333622CDD}.Release|x64.ActiveCfg = Release|x64 {DF3C5B07-A1A2-4F16-B37F-A27333622CDD}.Release|x64.Build.0 = Release|x64 - {22DAD0B1-4EC6-425A-B75C-FE7F01FEE615}.Debug|Win32.ActiveCfg = Debug|Win32 - {22DAD0B1-4EC6-425A-B75C-FE7F01FEE615}.Debug|Win32.Build.0 = Debug|Win32 - {22DAD0B1-4EC6-425A-B75C-FE7F01FEE615}.Debug|x64.ActiveCfg = Debug|x64 - {22DAD0B1-4EC6-425A-B75C-FE7F01FEE615}.Debug|x64.Build.0 = Debug|x64 - {22DAD0B1-4EC6-425A-B75C-FE7F01FEE615}.Release|Win32.ActiveCfg = Release|Win32 - {22DAD0B1-4EC6-425A-B75C-FE7F01FEE615}.Release|Win32.Build.0 = Release|Win32 - {22DAD0B1-4EC6-425A-B75C-FE7F01FEE615}.Release|x64.ActiveCfg = Release|x64 - {22DAD0B1-4EC6-425A-B75C-FE7F01FEE615}.Release|x64.Build.0 = Release|x64 {C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Debug|Win32.ActiveCfg = Debug|Win32 {C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Debug|Win32.Build.0 = Debug|Win32 {C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Debug|x64.ActiveCfg = Debug|x64 @@ -156,7 +146,6 @@ Global {1CC213A4-3482-4211-B47B-172E90DAC7DE} = {988F2383-FA1D-408B-BCF6-C0EE7AB0A560} {1B1CA20E-39C3-4D9B-AC37-3783048E6672} = {988F2383-FA1D-408B-BCF6-C0EE7AB0A560} {DF3C5B07-A1A2-4F16-B37F-A27333622CDD} = {988F2383-FA1D-408B-BCF6-C0EE7AB0A560} - {22DAD0B1-4EC6-425A-B75C-FE7F01FEE615} = {988F2383-FA1D-408B-BCF6-C0EE7AB0A560} {3BF049F8-AF7E-4E1C-9627-3E94C887AF24} = {6838FA95-01BF-4FF7-914C-FC209B81406E} {3F3E389B-88DE-41D5-A73B-4F6036E18B36} = {6838FA95-01BF-4FF7-914C-FC209B81406E} EndGlobalSection diff --git a/windows/LibEthCore.vcxproj b/windows/LibEthCore.vcxproj deleted file mode 100644 index 197dec8e5..000000000 --- a/windows/LibEthCore.vcxproj +++ /dev/null @@ -1,193 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - stdafx.h - Create - Create - Create - Create - - - - - - - - - - - - - - - - - - - - - {1cc213a4-3482-4211-b47b-172e90dac7de} - - - {27014763-955d-486b-9ba7-69872192e6f4} - - - {1b1ca20e-39c3-4d9b-ac37-3783048e6672} - - - {1e1175bb-c4a9-41d8-b2d1-9022f71d3cea} - - - - Win32Proj - LibEthCore - {22DAD0B1-4EC6-425A-B75C-FE7F01FEE615} - - - - StaticLibrary - true - v120 - - - StaticLibrary - true - v120 - - - StaticLibrary - false - v120 - - - StaticLibrary - false - v120 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - false - MultiThreadedDebugDLL - Use - stdafx.h - - - Windows - true - - - - - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - false - MultiThreadedDebugDLL - stdafx.h - Use - - - Windows - true - - - - - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - Use - stdafx.h - - - Windows - true - true - true - - - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - Use - stdafx.h - - - Windows - true - true - true - - - - - - \ No newline at end of file diff --git a/windows/LibEthCore.vcxproj.filters b/windows/LibEthCore.vcxproj.filters deleted file mode 100644 index b961aae3f..000000000 --- a/windows/LibEthCore.vcxproj.filters +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Windows - - - - - - - - - - - - - - - Windows - - - - - - - - - - - - - - - - - - {f864ef86-509c-4f25-b218-c4e7e604fdad} - - - \ No newline at end of file diff --git a/windows/LibEthereum.props b/windows/LibEthereum.props index 7738ca189..9bb2482e7 100644 --- a/windows/LibEthereum.props +++ b/windows/LibEthereum.props @@ -15,7 +15,7 @@ Level4 true false - include/$(ProjectName);$(IntDir);..;../libethereum;$(BoostDir);../../leveldb/include;../../cryptopp;../secp256k1;../../miniupnp + include/$(ProjectName);$(IntDir);..;../libethcore;../libethereum;../libethsupport;$(BoostDir);../../leveldb/include;../../cryptopp;../secp256k1;../../miniupnp ETH_BUILD_PLATFORM=Windows/VS2013;ETH_BUILD_TYPE=$(Configuration)-$(Platform);STATICLIB;LEVELDB_PLATFORM_WINDOWS;USE_NUM_BOOST;USE_FIELD_10X26;USE_FIELD_INV_BUILTIN;_WIN32_WINNT=0x0501;WIN32;%(PreprocessorDefinitions) true true diff --git a/windows/LibEthereum.vcxproj b/windows/LibEthereum.vcxproj index b392b4447..387380bbe 100644 --- a/windows/LibEthereum.vcxproj +++ b/windows/LibEthereum.vcxproj @@ -19,25 +19,42 @@ + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + stdafx.h Create @@ -47,35 +64,53 @@ + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + {1cc213a4-3482-4211-b47b-172e90dac7de} - - {22dad0b1-4ec6-425a-b75c-fe7f01fee615} - {27014763-955d-486b-9ba7-69872192e6f4} diff --git a/windows/LibEthereum.vcxproj.filters b/windows/LibEthereum.vcxproj.filters index ee7a14460..13881c377 100644 --- a/windows/LibEthereum.vcxproj.filters +++ b/windows/LibEthereum.vcxproj.filters @@ -4,54 +4,261 @@ Windows - - - - - - - - - - - - - - - - - - - + + libethereum + + + libethereum + + + libethereum + + + libethereum + + + libethereum + + + libethereum + + + libethereum + + + libethereum + + + libethereum + + + libethereum + + + libethereum + + + libethereum + + + libethcore + + + libethcore + + + libethcore + + + libethcore + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + liblll + + + liblll + + + liblll + + + liblll + + + liblll + + + libevm + + + libevm + + + libevm + Windows - - - - - - - - - - - - - - - - - - - - + + libethereum + + + libethereum + + + libethereum + + + libethereum + + + libethereum + + + libethereum + + + libethereum + + + libethereum + + + libethereum + + + libethereum + + + libethereum + + + libethereum + + + libethcore + + + libethcore + + + libethcore + + + libethcore + + + libethcore + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + libethsupport + + + liblll + + + liblll + + + liblll + + + liblll + + + liblll + + + liblll + + + libevm + + + libevm + + + libevm + {2d571d8f-bacf-4c49-a0d0-c9036f5c0cc9} + + {8275e3be-c870-44a2-8185-5a9992af8f8e} + + + {b246b3d7-af02-4125-a254-2b377214c288} + + + {5f2cd0c1-a3e9-497e-83c4-e56d6c0f835f} + + + {0186fc6c-68b3-4cbc-90f2-e01193d853b2} + + + {37c37803-1515-47c1-b7e6-3879f4429ab3} + \ No newline at end of file diff --git a/windows/LibQEthereum.props b/windows/LibQEthereum.props index 9e3ab29be..bdf8eadae 100644 --- a/windows/LibQEthereum.props +++ b/windows/LibQEthereum.props @@ -5,7 +5,7 @@ ../../Qt/$(Platform) $(QtDir)/qtbase $(QtBase)/bin - $(QtBase)/include;../../Qt/Src/qtbase/include;../../Qt/Src/qtdeclarative/include;../../Qt/Src/qtwebkit/include + $(QtBase)/include;../../Qt/Src/qtbase/include;../../Qt/Src/qtbase/include/QtCore;../../Qt/Src/qtbase/include/QtWidgets;../../Qt/Src/qtbase/include/QtQml;../../Qt/Src/qtbase/include/QtGui;../../Qt/Src/qtdeclarative/include;../../Qt/Src/qtwebkit/include $(QtBase)/lib;$(QtBase)/plugins/platforms;../../icu/lib64 ..\..\icu\bin_$(Platform)\icu*52.dll;$(QtBase)\lib\Qt5Core$(d).dll;$(QtBase)\lib\Qt5Gui$(d).dll;$(QtBase)\lib\Qt5Multimedia$(d).dll;$(QtBase)\lib\Qt5MultimediaWidgets$(d).dll;$(QtBase)\lib\Qt5OpenGL$(d).dll;$(QtBase)\lib\Qt5Positioning$(d).dll;$(QtBase)\lib\Qt5PrintSupport$(d).dll;$(QtBase)\lib\Qt5Network$(d).dll;$(QtBase)\lib\Qt5Qml$(d).dll;$(QtBase)\lib\Qt5Quick$(d).dll;$(QtBase)\lib\Qt5Sensors$(d).dll;$(QtBase)\lib\Qt5Sql$(d).dll;$(QtBase)\lib\Qt5Webkit$(d).dll;$(QtBase)\lib\Qt5WebkitWidgets$(d).dll;$(QtBase)\lib\Qt5Widgets$(d).dll;$(QtBase)\plugins\**\qwindows$(d).dll;$(QtBase)\plugins\**\qgenericbearer$(d).dll;$(QtBase)\plugins\**\qnativewifibearer$(d).dll;$(QtBase)\plugins\**\qgif$(d).dll;$(QtBase)\plugins\**\qico$(d).dll;$(QtBase)\plugins\**\qjpeg$(d).dll;$(QtBase)\plugins\**\qsvg$(d).dll;$(QtBase)\plugins\**\qtsensors_dummy$(d).dll