Wladimir J. van der Laan
9c1e5bc2b7
Merge #12564 : [arith_uint256] Avoid unnecessary this-copy using prefix operator
...
22b4aae02
[arith_uint256] Avoid unnecessary this-copy using prefix operator (Karl-Johan Alm)
Pull request description:
I noticed while profiling a related project that `operator-()` actually calls the `base_uint` constructor, which is because the postfix operator version of `operator++` (used in `operator-()`) creates a copy of `this` and returns it.
Tree-SHA512: d9a2665caa3d93f064cdeaf1c6fada101b9943bb53d93ccac6d9a0edac20279d2e921349e30239039c71e0a9629e45c29ec9f10d8d7499e936cdba6cb7c3c3eb
2020-06-13 14:50:11 -05:00
MarcoFalke
aeaf3c5ef9
Merge #10749 : Use compile-time constants instead of unnamed enumerations (remove "enum hack")
...
1e65f0f33
Use compile-time constants instead of unnamed enumerations (remove "enum hack") (practicalswift)
Pull request description:
Use compile-time constants instead of unnamed enumerations (remove "enum hack").
Tree-SHA512: 1b6ebb2755398c5ebab6cce125b1dfc39cbd1504d98d55136b32703fe935c4070360ab3b2f52b1da48ba9f3b01082d204f3d87c92ccb5c8c333731f7f972e128
2020-01-22 09:24:25 -06:00
Wladimir J. van der Laan
16b1585d50
Merge #11071 : Use static_assert(…, …) (C++11) instead of assert(…) where appropriate
...
d1e6f91
Prefer compile-time checking over run-time checking (practicalswift)
Pull request description:
Use `static_assert(…, …)` instead of `assert(…)` where appropriate.
Tree-SHA512: 63b6e50916bcef2195a73f93476bd69657ed9a8eea0bc4382933f478a6df639632c23c076df401fea648142adcb308bb2e6be35cc3dabca30daf7649b790f436
2020-01-01 21:32:57 -06:00
Pasta
1a0d52814e
#10483 scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal instead of the macro NULL
...
-BEGIN VERIFY SCRIPT-
sed -i 's/\<NULL\>/nullptr/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h src/qt/*/*.cpp src/qt/*/*.h src/wallet/*/*.cpp src/wallet/*/*.h src/support/allocators/*.h
sed -i 's/Prefer nullptr, otherwise SAFECOOKIE./Prefer NULL, otherwise SAFECOOKIE./g' src/torcontrol.cpp
sed -i 's/tor: Using nullptr authentication/tor: Using NULL authentication/g' src/torcontrol.cpp
sed -i 's/METHODS=nullptr/METHODS=NULL/g' src/test/torcontrol_tests.cpp src/torcontrol.cpp
sed -i 's/nullptr certificates/NULL certificates/g' src/qt/paymentserver.cpp
sed -i 's/"nullptr"/"NULL"/g' src/torcontrol.cpp src/test/torcontrol_tests.cpp
-END VERIFY SCRIPT-
Signed-off-by: Pasta <pasta@dashboost.org>
2019-08-12 09:07:03 -05:00
Wladimir J. van der Laan
a3abc463f9
Merge #10530 : Fix invalid instantiation and possibly unsafe accesses of array in class base_uint<BITS>
...
e5c6168
Fix instantiation and array accesses in class base_uint<BITS> (Pavlos Antoniou)
Tree-SHA512: e4d39510d776c5ae8814cd5fb5c5d183cd8da937e339bff95caff68a84492fbec68bf513c5a6267446a564d39093e0c7fc703c645b511caab80f7baf7955b804
2019-07-11 10:34:46 -05:00
Wladimir J. van der Laan
9d661f4337
Merge #8675 : Make copyright header lines uniform
...
4b04e32
[copyright] copyright header style uniform (isle2983)
2018-01-13 13:44:39 +01:00
MarcoFalke
333e1eaeea
Bump copyright headers to 2015
...
- Bump copyright headers to 2015
- [devtools] Rewrite fix-copyright-headers.py
- [devtools] Use git pretty-format for year parsing
Github-Pull: #7205
Rebased-From: fa6ad855e9
fa24439ff3
fa71669452
2016-01-05 14:13:33 +01:00
Philip Kaufmann
a21df62069
ensure consistent header comment naming conventions
...
- BITCOIN_FOLDER_SUBFOLDER_FILENAME_H
2015-04-20 13:29:22 +02:00
Wladimir J. van der Laan
6bd0dc2a84
arith_uint256: remove initialization from byte vector
...
Remove initialization from vector (as this is only used in the tests).
Also implement SetHex and GetHex in terms of uint256, to avoid
duplicate code as well as avoid endianness issues (as they
work in term of bytes).
2015-01-05 15:45:36 +01:00
Wladimir J. van der Laan
30007fda76
Remove now-unused methods from arith_uint256 and base_uint
...
- Methods that access the guts of arith_uint256 are removed,
as these are incompatible between endians. Use uint256 instead
- Serialization is no longer needed as arith_uint256's are never
read or written
- GetHash is never used on arith_uint256
2015-01-05 15:45:36 +01:00
Wladimir J. van der Laan
edc720479d
Remove arith_uint160
...
We never do 160-bit arithmetic.
2015-01-05 15:45:36 +01:00
Wladimir J. van der Laan
92cdb1aace
Add conversion functions arith_uint256<->uint_256
2015-01-05 15:45:35 +01:00
Wladimir J. van der Laan
bfc6070342
uint256->arith_uint256 blob256->uint256
...
Introduce new opaque implementation of `uint256`, move old
"arithmetic" implementation to `arith_uint256.
2015-01-05 15:45:35 +01:00
Wladimir J. van der Laan
5d3064bc44
Temporarily add SetNull/IsNull/GetCheapHash to base_uint
...
Also add a stub for arith_uint256 and its conversion functions,
for now completely based on uint256.
Eases step-by-step migration to blob.
2015-01-05 15:14:47 +01:00