aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Refactor: move runCommand() to util.cppJeff Garzik2012-05-231-0/+8
|
* Merge branch 'optimize'Gavin Andresen2012-05-221-0/+6
|\
| * Refactor: GetRandHash() method for utilGavin Andresen2012-05-171-0/+6
| |
* | Merge pull request #917 from mndrix/reopen-log-filePieter Wuille2012-05-211-0/+12
|\ \ | | | | | | Reopen log file on SIGHUP
| * | Reopen debug.log on SIGHUPMichael Hendricks2012-05-181-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The best log rotation method formerly available was to configure logrotate with the copytruncate option. As described in the logrotate documentation, "there is a very small time slice between copying the file and truncating it, so some logging data might be lost". By sending SIGHUP to the server process, one can now reopen the debug log file without losing any data.
| * | Serialize access to debug.log streamMichael Hendricks2012-05-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Acquire an exclusive, advisory lock before sending output to debug.log and release it when we're done. This should avoid output from multiple threads being interspersed in the log file. We can't use CRITICAL_SECTION machinery for this because the debug log is written during startup and shutdown when that machinery is not available. (Thanks to Gavin for pointing out the CRITICAL_SECTION problems based on his earlier work in this area)
* | | Merge pull request #1354 from fanquake/masterPieter Wuille2012-05-201-1/+1
|\ \ \ | | | | | | | | Update Header Licenses
| * | | Update License in File HeadersFordy2012-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | I originally created a pull to replace the "COPYING" in crypter.cpp and crypter.h, but it turned out that COPYING was actually the correct file.
* | | | Make testcases build, prevent windows symbol collisionWladimir J. van der Laan2012-05-201-1/+1
| | | |
* | | | Convert UI interface to boost::signals2.Wladimir J. van der Laan2012-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Signals now go directly from the core to WalletModel/ClientModel. - WalletModel subscribes to signals on CWallet: Prepares for multi-wallet support, by no longer assuming an implicit global wallet. - Gets rid of noui.cpp, the few lines that were left are merged into init.cpp - Rename wxXXX message flags to MF_XXX, to make them UI indifferent. - ThreadSafeMessageBox no longer returns the value `4` which was never used, converted to void.
* | | | Merge pull request #1302 from laanwj/2012_05_utilstringsWladimir J. van der Laan2012-05-201-76/+36
|\ \ \ \ | |_|/ / |/| | | Get rid of snprintf (except one) with fixed buffers, shorten code
| * | | Get rid of snprintf (except one) with fixed buffers, shorten codeWladimir J. van der Laan2012-05-141-76/+36
| | | | | | | | | | | | | | | | - Use strprintf or vstrprintf instead of snprintf
* | | | Use boost::thread locking instead of interprocessPieter Wuille2012-05-181-0/+1
| |/ / |/| |
* | | fix RenameOver() and FileCommit() functions, to not generate compilation errorsPhilip Kaufmann2012-05-171-1/+2
| | |
* | | Add new utility functions FileCommit(), RenameOver()Jeff Garzik2012-05-161-0/+21
| | |
* | | ensure that no double timestamps show up in the debug.log, by removing ↵Philip Kaufmann2012-05-131-1/+1
|/ / | | | | | | manual timestamps from the source (now only -logtimestamps parameter adds timestamps to debug.log)
* | Move GetStartOnSystemStartup and SetStartOnSystemStartup to GUI codeWladimir J. van der Laan2012-05-131-143/+0
| |
* | Split synchronization mechanisms from util.{h,cpp}Pieter Wuille2012-05-111-123/+9
| |
* | Fix osx buildGavin Andresen2012-05-091-1/+1
| |
* | util.h/.ccp: modifiy some comments / rename MyGetSpecialFolderPath() -> ↵Philip Kaufmann2012-05-091-44/+29
| | | | | | | | GetSpecialFolderPath(), set fCreate default to true and remove the fallback (not Win >= Vista compatible anyway) / remove namespace fs stuff where only used once / misc small changes'
* | Merge pull request #1187 from TheBlueMatt/win32_ieWladimir J. van der Laan2012-05-051-1/+1
|\ \ | |/ |/| Update to require IE 5.1 as it is required to build on mingw64.
| * Update to require IE 5.1 as it is required on mingw64.Matt Corallo2012-05-021-1/+1
| | | | | | | | We already require XP, this just fixes Mingw64 build.
* | fix compiler warning "suggest parentheses around assignment used as truthPhilip Kaufmann2012-05-011-1/+1
|/ | | | value [-Wparentheses]" in util.cpp
* Merge pull request #1140 from jgarzik/sign-compareJeff Garzik2012-04-231-1/+1
|\ | | | | Address many more sign comparison warnings
| * Add casts for unavoidable signed/unsigned comparisonsJeff Garzik2012-04-231-1/+1
| | | | | | | | | | At these code sites, it is preferable to cast rather than change a variable's type.
* | Make GetDataDir return absolute pathsPieter Wuille2012-04-221-4/+7
|/
* Fix bugs on 'unsigned char' platforms.Dwayne C. Litzenberger2012-04-181-4/+4
| | | | | | | | | | | | | | | | | | In ISO C++, the signedness of 'char' is undefined. On some platforms (e.g. ARM), 'char' is an unsigned type, but some of the code relies on 'char' being signed (as it is on x86). This is indicated by compiler warnings like this: bignum.h: In constructor 'CBigNum::CBigNum(char)': bignum.h:81:59: warning: comparison is always true due to limited range of data type [-Wtype-limits] util.cpp: In function 'bool IsHex(const string&)': util.cpp:427:28: warning: comparison is always false due to limited range of data type [-Wtype-limits] In particular, IsHex erroneously returned true regardless of the input characters, as long as the length of the string was a positive multiple of 2. Note: For testing, it's possible using GCC to force char to be unsigned by adding the -funsigned-char parameter to xCXXFLAGS.
* Fix phexdigits[255] is undefined.Dwayne C. Litzenberger2012-04-181-1/+1
|
* Further reduce header dependenciesPieter Wuille2012-04-171-0/+1
| | | | | | | This commit removes the dependency of serialize.h on PROTOCOL_VERSION, and makes this parameter required instead of implicit. This is much saner, as it makes the places where changing a version number can have an influence obvious.
* Remove headers.hPieter Wuille2012-04-171-1/+170
|
* Remove unused and unreachable codeWladimir J. van der Laan2012-04-171-1/+0
|
* fix warnings: array subscript is of type 'char' [-Wchar-subscripts]Wladimir J. van der Laan2012-04-151-3/+3
|
* work around issue in boost::program_options that prevents from compiling in ↵Wladimir J. van der Laan2012-04-151-0/+11
| | | | clang
* Merge pull request #1087 from sipa/fix_1086Gavin Andresen2012-04-121-2/+2
|\ | | | | Fix #1086: add /testnet to passed datadir
| * Fix #1086: add /testnet to passed datadirPieter Wuille2012-04-131-2/+2
| |
* | Fix OSX build errors.Gavin Andresen2012-04-121-1/+1
|/
* Use filesystem::path instead of manual string tinkeringPieter Wuille2012-04-111-83/+59
| | | | | | | | | | | | | | Where possible, use boost::filesystem::path instead of std::string or char* for filenames. This avoids a lot of manual string tinkering, in favor of path::operator/. GetDataDir is also reworked significantly, it now only keeps two cached directory names (the network-specific data dir, and the root data dir), which are decided through a parameter instead of pre-initialized global variables. Finally, remove the "upgrade from 0.1.5" case where a debug.log in the current directory has to be removed.
* Remove path.make_preferred() calls, and fix compiler error in bitcoinrpc RE: ↵Gavin Andresen2012-04-111-3/+0
| | | | boost::system
* Merge pull request #1054 from sipa/buildinfoPieter Wuille2012-04-101-6/+1
|\ | | | | Build identification strings
| * Build identification stringsPieter Wuille2012-04-101-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All client version information is moved to version.cpp, which optionally (-DHAVE_BUILD_INFO) includes build.h. build.h is automatically generated on supporting platforms via contrib/genbuild.sh, using git describe. The git export-subst attribute is used to put the commit id statically in version.cpp inside generated archives, and this value is used if no build.h is present. The gitian descriptors are modified to use git archive instead of a copy, to create the src/ directory in the output. This way, src/src/version.cpp will contain the static commit id. To prevent gitian builds from getting the "-dirty" marker in their git-describe generated identifiers, no touching of files or running sed on the makefile is performed anymore. This does not seem to influence determinism.
* | Merge pull request #1052 from sipa/scopedlocksPieter Wuille2012-04-091-12/+12
|\ \ | | | | | | Use scoped locks instead of CRITICAL_BLOCK
| * | Do not report spurious deadlocks caused by TRY_LOCKPieter Wuille2012-04-091-4/+4
| | |
| * | Support for parametrized locks in deadlock detectorPieter Wuille2012-04-091-9/+9
| | |
| * | Use scoped locks instead of CRITICAL_BLOCKPieter Wuille2012-04-091-1/+1
| |/
* / updated util.cpp to use make_preferred()Philip Kaufmann2012-04-061-9/+14
|/
* Merge pull request #1033 from sipa/waitPieter Wuille2012-04-061-52/+4
|\ | | | | Condition variables instead of polling
| * Locking system overhaul, add condition variablesPieter Wuille2012-04-041-52/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit simplifies the locking system: CCriticalSection becomes a simple typedef for boost::interprocess::interprocess_recursive_mutex, and CCriticalBlock and CTryCriticalBlock are replaced by a templated CMutexLock, which wraps boost::interprocess::scoped_lock. By making the lock type a template parameter, some critical sections can now be changed to non-recursive locks, which support waiting via condition variables. These are implemented in CWaitableCriticalSection and WAITABLE_CRITICAL_BLOCK. CWaitableCriticalSection is a wrapper for a different Boost mutex, which supports waiting/notification via condition variables. This should enable us to remove much of the used polling code. Important is that this mutex is not recursive, so functions that perform the locking must not call eachother. Because boost::interprocess::scoped_lock does not support assigning and copying, I had to revert to the older CRITICAL_BLOCK macros that use a nested for loop instead of a simple if.
* | removed obsolete boost workaround (boost ticket #4258)Philip Kaufmann2012-04-051-10/+0
|/
* qtui.h/noui.h interface cleanupWladimir J. van der Laan2012-04-041-1/+1
| | | | | | | - rename wxMessageBox, remove redundant arguments to noui/qtui calls - also, add flag to force blocking, modal dialog box for disk space warning etc - clarify function naming - no more special MessageBox needed from AppInit2, as window object is created before calling AppInit2
* VC2010 compile fixesWladimir J. van der Laan2012-04-031-4/+4
|