* `AddTo` and `Difference` are made into static methods, as one may have
believed that these modified the current object previously. The
`Increment` method is kept, as it's obvious that it modifies the
current object as it doesn't have a return value, and `next_value` is
kept, as its naming (lower-case, snake) indicates that it's a simple
accessor.
* Difference will return the absolute difference. This is actually the
only reasonable choice, as the return value was unsigned and any
negative value would just wrap.
Bug: webrtc:12614
Change-Id: If14a71636e67fc612d12759dc80a9c2518c85281
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215069
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33714}
As this library will only use StrongAlias types for all its
sequence numbers, the UnwrappedSequenceNumber class should use those
types and not the primitive underlying types (e.g. uint32_t).
This makes e.g. Unwrap() return a strong type, which is preferred.
Bug: webrtc:12614
Change-Id: Icd0900c643a1988d1a3bbf49d87b4d4d1bbfbf1f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/213663
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33651}
These are quite generic utilities that are used by multiple modules
within dcSCTP. Some would be good to have in rtc_base and are simple
replicas of utilities available in abseil.
Bug: webrtc:12614
Change-Id: I9914286ced7317a34628a71697da9149d6d19d38
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/213190
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33609}