Skip to content

Conversation

@laanwj
Copy link
Member

@laanwj laanwj commented Dec 15, 2016

Analogous to c++11 vector data().

Came up in #9346. Also removes a silly ancient MSVC conditional.

I've also tried to replace some uses, but I'm not 100% sure that I caught all the uses of &CDataStream[0]. As a casual git grep '&[a-zA-Z0-9_]\+\[0\]' shows the pattern is still very common for bare vectors. These uses too should be replaced with data() at some point but not here.

Analogous to c++11 vector data().
Quite sure that we haven't supported MSVC 6.0 for ages (MSC_VER 1300 is
>= MSVC++ 7.0) but with the C++11 switch we can be sure.
@paveljanik
Copy link
Contributor

ACK 5113474

@sipa sipa mentioned this pull request Dec 16, 2016
@laanwj laanwj changed the title Add data() method to CDataStream Add data() method to CDataStream (and use it) Dec 19, 2016
@gmaxwell
Copy link
Contributor

Concept ACK.

@sipa
Copy link
Member

sipa commented Jan 7, 2017

utACK 5113474

1 similar comment
@TheBlueMatt
Copy link
Contributor

utACK 5113474

@sipa sipa merged commit 5113474 into bitcoin:master Jan 9, 2017
sipa added a commit that referenced this pull request Jan 9, 2017
5113474 wallet: Use CDataStream.data() (Wladimir J. van der Laan)
e2300ff bench: Use CDataStream.data() (Wladimir J. van der Laan)
adff950 dbwrapper: Use new .data() method of CDataStream (Wladimir J. van der Laan)
a2141e4 streams: Remove special cases for ancient MSVC (Wladimir J. van der Laan)
af4c44c streams: Add data() method to CDataStream (Wladimir J. van der Laan)
codablock pushed a commit to codablock/dash that referenced this pull request Oct 23, 2017
5113474 wallet: Use CDataStream.data() (Wladimir J. van der Laan)
e2300ff bench: Use CDataStream.data() (Wladimir J. van der Laan)
adff950 dbwrapper: Use new .data() method of CDataStream (Wladimir J. van der Laan)
a2141e4 streams: Remove special cases for ancient MSVC (Wladimir J. van der Laan)
af4c44c streams: Add data() method to CDataStream (Wladimir J. van der Laan)
random-zebra added a commit to PIVX-Project/PIVX that referenced this pull request Nov 15, 2020
…refactor.

58504c2 [Wallet] refactor CWallet/CWalletDB/CDB (Round 2) (furszy)
c16390d [Wallet] refactor CWallet/CWalletDB/CDB (Round 1) (furszy)
99adac0 C++11: s/boost::scoped_ptr/std::unique_ptr/ (furszy)
815773e use constant references for strings in functions in wallet/*.* (furszy)
24f1041 Do not shadow variables. (Pavel Janík)
6a0c59a wallet: Warn on unexpected EOF while salvaging wallet (Wladimir J. van der Laan)
12bc297 dbwrapper: Use new .data() method of CDataStream (Wladimir J. van der Laan)
b0f0d91 streams: Remove special cases for ancient MSVC (Wladimir J. van der Laan)
ba96777 streams: Add data() method to CDataStream (Wladimir J. van der Laan)
6ec0722 wallet: Use CDataStream.data() (Wladimir J. van der Laan)
ca1a3b0 [Wallet] remove unused code/conditions in ReadAtCursor (Jonas Schnelli)
fd259f3 remove unused classes from db.h (Philip Kaufmann)

Pull request description:

  Upgrading the wallet, wallet db and db wrapper areas with several back ports and updates adaptations.

  List of PRs:
  * dashpay#5933
  * bitcoin#7537
  * bitcoin#8191
  * bitcoin#8564
  * bitcoin#8574
  * bitcoin#8629
  * bitcoin#9353

  Note:
  Low priority PR, can be reviewing after merge Sapling and tier two PRs.
  I made it because we are pretty far from upstream in the db area and want to introduce some new functionality in the future that requires a more up-to-date db layer.

ACKs for top commit:
  random-zebra:
    ACK 58504c2 and merging...

Tree-SHA512: e5a700e855bcec20f0b74e41825ddc3a36b56a0cbe83212c93d212c06765254464999567b395584dfeb9d4b12999bc835d2e89949684d64b1503db36c53fd3c8
zkbot added a commit to zcash/zcash that referenced this pull request Jun 11, 2021
Add `data()` method to `CDataStream`

Analogous to C++11 `std::vector::data()`.

Cherry-picked from bitcoin/bitcoin#9353 (excluding bench change).
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants