Skip to content

Conversation

kallewoof
Copy link
Contributor

serialize.h has a number of functions for accessing the data inside std::vectors, prepended with a warning to not use them in new code, as "with C++11 the language has built-in functionality for this and it's more readable to just use that". This PR removes these functions and their uses.

  • begin_ptr(X)X.data()
  • end_ptr(X)(X.data() + X.size())

@sipa
Copy link
Member

sipa commented Dec 9, 2016

Concept ACK

Copy link
Contributor

@dcousens dcousens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay, utACK / concept ACK

@paveljanik
Copy link
Contributor

ACK 8c1dbc5

Copy link
Contributor

@jonasschnelli jonasschnelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 8c1dbc5

@laanwj
Copy link
Member

laanwj commented Dec 9, 2016

I was about to mention the developer notes, but they're already gone from there.

utACK 8c1dbc5

@laanwj laanwj merged commit 8c1dbc5 into bitcoin:master Dec 13, 2016
laanwj added a commit that referenced this pull request Dec 13, 2016
8c1dbc5 Refactor: Removed begin/end_ptr functions. (Karl-Johan Alm)
@kallewoof kallewoof deleted the remove-begin-end_ptr-usage branch December 13, 2016 11:36
codablock pushed a commit to codablock/dash that referenced this pull request Jan 17, 2018
8c1dbc5 Refactor: Removed begin/end_ptr functions. (Karl-Johan Alm)
andvgal pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
8c1dbc5 Refactor: Removed begin/end_ptr functions. (Karl-Johan Alm)
CryptoCentric pushed a commit to absolute-community/absolute that referenced this pull request Feb 25, 2019
8c1dbc5 Refactor: Removed begin/end_ptr functions. (Karl-Johan Alm)
furszy added a commit to PIVX-Project/PIVX that referenced this pull request Apr 8, 2021
172fe15 Add missing locks and locking annotations for CAddrMan (practicalswift)
9271ace Support serialization as another type without casting (Pieter Wuille)
dc37dd9 Remove unnecessary NONNEGATIVE_SIGNED (Russell Yanofsky)
ddd2ab1 Add static_assert to prevent VARINT(<signed value>) (Russell Yanofsky)
539db35 Support deserializing into temporaries (Pieter Wuille)
36db7fd Merge READWRITEMANY into READWRITE (Pieter Wuille)
08ebd5b Remove old pre C++11 functions begin_ptr/end_ptr. (furszy)
9c84665 Prevent integer overflow in ReadVarInt. (Gregory Maxwell)

Pull request description:

  Back ported some pretty concise PRs from upstream over the data serialization area.

  * bitcoin#9305.  --> removal of pre c++11 compatibility functions.
  * bitcoin#9693.  --> prevent integer overflow in `ReadVarInt`.
  * bitcoin#9753.  --> compile error if VARINT is called with a signed value.
  * bitcoin#12683. --> fixing constness violations
  * bitcoin#12731. --> support for `READWRITEAS` macro.

ACKs for top commit:
  random-zebra:
    ACK 172fe15
  Fuzzbawls:
    ACK 172fe15

Tree-SHA512: 1e1e697761b885dcc1aed8a2132bed693b1c76f1f2ed22ae5c074dfb4c353b81d307f71a4c12ed71fc39fd2207c1403881bd699e32b85a167bee57b4f0946130
@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.

7 participants