aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
AgeCommit message (Collapse)Author
2012-09-25Merge pull request #1807 from laanwj/2012_09_printf_warningsWladimir J. van der Laan
Add printf-style warnings to strprintf() and OutputDebugStringF()
2012-09-18Trim trailing whitespace for src/*.{h,cpp}Jeff Garzik
2012-09-10Add format characters for (s)size_t and ptrdiff_tWladimir J. van der Laan
2012-09-10HexStr: don't build a vector<char> firstWladimir J. van der Laan
Also const correctness for lookup tables in hex functions throughout the code.
2012-09-09Cleanup some unused macros from util.hWladimir J. van der Laan
Encapsulate _snprintf/sprintf difference in implementation not header
2012-09-09Add printf-style warnings to strprintf() and OutputDebugStringF()Wladimir J. van der Laan
This finds about ~150 potential problems with format characters on a 64 bit build.
2012-08-29Rename CreateThread to NewThreadWladimir J. van der Laan
Prevent clash with win32 API symbol
2012-08-29implement CreateThread with boost::threadWladimir J. van der Laan
I'm not sure why this wasn't done before. - Removes typedef of pthread_t on Windows, which fixes a native compile issue on mingw.
2012-08-02fix further spelling errors / remove a tab in the sourcePhilip Kaufmann
2012-08-01Bugfix: Fix a variety of misspellingsLuke Dashjr
2012-07-17Give threads a recognisable name to aid in debuggingGiel van Schijndel
NOTE: These thread names are visible in gdb when using 'info threads'. Additionally both 'top' and 'ps' show these names *unless* told to display the command-line instead of task name. Signed-off-by: Giel van Schijndel <me@mortis.eu>
2012-07-07CHashWriter that does SHA256 in-place during serializationPieter Wuille
2012-06-23Merge pull request #1174 from sipa/torhsGregory Maxwell
Tor hidden service support
2012-06-22Merge pull request #1458 from jgarzik/tracenetJeff Garzik
Introduce -tracenet option, thereby quieting some redundant debug messages
2012-06-22Introduce -debugnet option, thereby quieting some redundant debug messagesJeff Garzik
Prior to this change, each TX typically generated 3+ debug messages, askfor tx 8644cc97480ba1537214 0 sending getdata: tx 8644cc97480ba1537214 askfor tx 8644cc97480ba1537214 1339640761000000 askfor tx 8644cc97480ba1537214 1339640881000000 CTxMemPool::accept() : accepted 8644cc9748 (poolsz 6857) After this change, there is only one message for each valid TX received CTxMemPool::accept() : accepted 22a73c5d8c (poolsz 42) and two messages for each orphan tx received ERROR: FetchInputs() : 673dc195aa mempool Tx prev not found 1e439346fc stored orphan tx 673dc195aa (mapsz 19) The -debugnet option, or its superset -debug, will restore the full debug output.
2012-06-22Base32 encoding/decodingPieter Wuille
2012-06-18Merge branch 'signbugs' of https://github.com/wizeman/bitcoinGavin Andresen
Resolved minor conflict in main.cpp
2012-06-07Move NOINLINE definition to test where it's used.Ricardo M. Correia
2012-06-07Don't overflow integer on 32-bit machines.Ricardo M. Correia
This was causing test_bitcoin to abort on a 32-bit system likely due to -ftrapv.
2012-05-31Fix noinline definition so that it works for more compilers.Ricardo M. Correia
2012-05-23Refactor: move runCommand() to util.cppJeff Garzik
2012-05-22Merge branch 'optimize'Gavin Andresen
2012-05-21Merge pull request #917 from mndrix/reopen-log-filePieter Wuille
Reopen log file on SIGHUP
2012-05-20Merge pull request #1354 from fanquake/masterPieter Wuille
Update Header Licenses
2012-05-20Merge pull request #1302 from laanwj/2012_05_utilstringsWladimir J. van der Laan
Get rid of snprintf (except one) with fixed buffers, shorten code
2012-05-18Reopen debug.log on SIGHUPMichael Hendricks
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.
2012-05-18Update License in File HeadersFordy
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.
2012-05-17Refactor: GetRandHash() method for utilGavin Andresen
2012-05-16Add new utility functions FileCommit(), RenameOver()Jeff Garzik
2012-05-14Get rid of snprintf (except one) with fixed buffers, shorten codeWladimir J. van der Laan
- Use strprintf or vstrprintf instead of snprintf
2012-05-13Move GetStartOnSystemStartup and SetStartOnSystemStartup to GUI codeWladimir J. van der Laan
2012-05-11Split synchronization mechanisms from util.{h,cpp}Pieter Wuille
2012-05-11Use polling instead of boost's broken semaphore on OSXPieter Wuille
2012-05-11Use semaphores instead of condition variablesPieter Wuille
2012-05-09Merge pull request #1134 from Diapolo/util-updatesJeff Garzik
small util.cpp/h changes
2012-05-09util.h/.ccp: modifiy some comments / rename MyGetSpecialFolderPath() -> ↵Philip Kaufmann
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'
2012-05-09Fix DEBUG_LOCKCONTENTIONMatt Corallo
2012-05-01remove duplicate definition of SecureString in util.hWladimir J. van der Laan
SecureString was moved to allocators.h in commit 6cb6d623479c5dd42d91de7a4d391078d0800e54
2012-04-23Merge pull request #1140 from jgarzik/sign-compareJeff Garzik
Address many more sign comparison warnings
2012-04-23Change signed->unsigned at 3 code sitesJeff Garzik
This resolves signed/unsigned comparison warnings.
2012-04-22Make GetDataDir return absolute pathsPieter Wuille
2012-04-21Integrate @JoelKatz's optimized ToHex (#562) into current HexStr functionWladimir J. van der Laan
2012-04-17Further reduce header dependenciesPieter Wuille
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.
2012-04-17Remove headers.hPieter Wuille
2012-04-12Remove obsolete Win32 AffinityBugWorkaround()Jeff Garzik
Reference miner exists for testnet-in-a-box type situations, and as a reference. We don't care enough about highly optimized internal mining to keep workarounds like this.
2012-04-11Use filesystem::path instead of manual string tinkeringPieter Wuille
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.
2012-04-09Do not report spurious deadlocks caused by TRY_LOCKPieter Wuille
2012-04-09Use scoped locks instead of CRITICAL_BLOCKPieter Wuille
2012-04-04Locking system overhaul, add condition variablesPieter Wuille
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.
2012-04-04move translation function _ to qtui.h/noui.h instead of util.hWladimir J. van der Laan