Skip to content

Commit c119e12

Browse files
committed
Merge branch 'develop'
2 parents c29fc3b + acf6006 commit c119e12

10 files changed

Lines changed: 27 additions & 19 deletions

.jazzy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ sourcekitten_sourcefile: docs.json
33
clean: false
44
author: Timofey Solomko
55
module: BitByteData
6-
module_version: 2.0.0
6+
module_version: 2.0.1
77
copyright: '© 2021 Timofey Solomko'
88
readme: README.md
99
github_url: https://github.com/tsolomko/BitByteData
10-
github_file_prefix: https://github.com/tsolomko/BitByteData/tree/2.0.0
10+
github_file_prefix: https://github.com/tsolomko/BitByteData/tree/2.0.1
1111
theme: fullwidth
1212

1313
custom_categories:

BitByteData.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "BitByteData"
4-
s.version = "2.0.0"
4+
s.version = "2.0.1"
55
s.summary = "Read and write bits and bytes in Swift."
66

77
s.description = "A Swift framework with classes for reading and writing bits and bytes."

BitByteData.xcodeproj/BitByteData.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>2.0.0</string>
18+
<string>2.0.1</string>
1919
<key>CFBundleVersion</key>
20-
<string>26</string>
20+
<string>27</string>
2121
<key>NSHumanReadableCopyright</key>
2222
<string>Copyright © 2021 Timofey Solomko</string>
2323
</dict>

BitByteData.xcodeproj/BitByteDataBenchmarks.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<key>CFBundlePackageType</key>
1616
<string>BNDL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>2.0.0</string>
18+
<string>2.0.1</string>
1919
<key>CFBundleVersion</key>
20-
<string>26</string>
20+
<string>27</string>
2121
</dict>
2222
</plist>

BitByteData.xcodeproj/TestBitByteData.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<key>CFBundlePackageType</key>
1616
<string>BNDL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>2.0.0</string>
18+
<string>2.0.1</string>
1919
<key>CFBundleVersion</key>
20-
<string>26</string>
20+
<string>27</string>
2121
</dict>
2222
</plist>

BitByteData.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@
406406
CLANG_WARN_SUSPICIOUS_MOVE = YES;
407407
CLANG_WARN_UNREACHABLE_CODE = YES;
408408
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
409-
CURRENT_PROJECT_VERSION = 26;
409+
CURRENT_PROJECT_VERSION = 27;
410410
DEBUG_INFORMATION_FORMAT = dwarf;
411411
ENABLE_STRICT_OBJC_MSGSEND = YES;
412412
ENABLE_TESTABILITY = YES;
@@ -455,7 +455,7 @@
455455
CLANG_WARN_SUSPICIOUS_MOVE = YES;
456456
CLANG_WARN_UNREACHABLE_CODE = YES;
457457
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
458-
CURRENT_PROJECT_VERSION = 26;
458+
CURRENT_PROJECT_VERSION = 27;
459459
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
460460
ENABLE_STRICT_OBJC_MSGSEND = YES;
461461
GCC_NO_COMMON_BLOCKS = YES;
@@ -484,7 +484,7 @@
484484
APPLICATION_EXTENSION_API_ONLY = YES;
485485
DEFINES_MODULE = YES;
486486
DYLIB_COMPATIBILITY_VERSION = 1;
487-
DYLIB_CURRENT_VERSION = 26;
487+
DYLIB_CURRENT_VERSION = 27;
488488
DYLIB_INSTALL_NAME_BASE = "@rpath";
489489
INFOPLIST_FILE = BitByteData.xcodeproj/BitByteData.plist;
490490
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
@@ -508,7 +508,7 @@
508508
APPLICATION_EXTENSION_API_ONLY = YES;
509509
DEFINES_MODULE = YES;
510510
DYLIB_COMPATIBILITY_VERSION = 1;
511-
DYLIB_CURRENT_VERSION = 26;
511+
DYLIB_CURRENT_VERSION = 27;
512512
DYLIB_INSTALL_NAME_BASE = "@rpath";
513513
INFOPLIST_FILE = BitByteData.xcodeproj/BitByteData.plist;
514514
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";

CHANGELOG.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 2.0.1
4+
5+
- Added an explicit precondition on `bitsCount` argument in the default implementation of the
6+
`BitWriter.write(signedNumber:bitsCount:representation:)` function.
7+
- Added missing documentation about a precondition in `L/MsbBitWriter.write(unsignedNumber:bitsCount:)`.
8+
39
## 2.0.0
410

511
- Swift 4.2 is no longer supported.
@@ -11,10 +17,8 @@
1117
- Added a `ByteReader` protocol which inherits `AnyObject`.
1218
- Most of the methods and properties of the previously existing `ByteReader` _class_ are now requirements of the new
1319
protocol.
14-
- `ByteReader` provides a default implementation for the initializer which implements conversion from a `BitReader`
15-
(this initializer is not a protocol requirement).
16-
- `ByteReader` provides default implementations for the `bytesLeft`, `bytesRead`, and `isFinished` properties (these
17-
properties are not protocol requirements).
20+
- `ByteReader` provides default implementations for the initializer, which implements conversion from a `BitReader`,
21+
and for the `bytesLeft`, `bytesRead`, and `isFinished` properties (all of these are not protocol requirements).
1822
- `ByteReader` provides a default implementation for the `int(fromBytes:)` method.
1923
- Both `LittleEndianByteReader` and `BigEndianByteReader` now conform to the `ByteReader` protocol.
2024
- Added a `SignedNumberRepresentation` enum with five cases and two instance methods.
@@ -30,9 +34,9 @@ with the default value of `SignedNumberRepresentation.twoComplementNegatives` fo
3034
`write(signedNumber:bitsCount:representation:)`.
3135
- `BitWriter` now provides default implementations for `write(signedNumber:bitsCount:representation:)` and
3236
`write(number:bitsCount:)`.
33-
- The default implementation of the `write(number:bitsCount:)` function has a precondition crash if the `bitsCount`
37+
- The default implementation of the `write(number:bitsCount:)` function now has a precondition crash if the `bitsCount`
3438
argument exceeds the bit width of the integer type on the current platform.
35-
- The `write(unsignedNumber:bitsCount:)` function of the `LsbBitWriter` and `MsbBitWriter` classes functions now have a
39+
- The `write(unsignedNumber:bitsCount:)` function of the `LsbBitWriter` and `MsbBitWriter` classes now has a
3640
precondition crash if the `bitsCount` argument exceeds the bit width of the integer type on the current platform.
3741
- Documentation has been updated.
3842
- Added documentation for new APIs.

Sources/BitWriter.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,13 @@ extension BitWriter {
8181
- Precondition: The `signedNumber` must be representable within `bitsCount` bits using the `representation`, i.e.
8282
it must be in the `representation.minRepresentableNumber...representation.maxRepresentableNumber` range.
8383
- Precondition: For the `SignedNumberRepresentation.biased` representation, the `bias` must be non-negative.
84+
- Precondition: Parameter `bitsCount` must be in the `0...Int.bitWidth` range.
8485
*/
8586
public func write(signedNumber: Int, bitsCount: Int, representation: SignedNumberRepresentation = .twoComplementNegatives) {
8687
precondition(signedNumber >= representation.minRepresentableNumber(bitsCount: bitsCount) &&
8788
signedNumber <= representation.maxRepresentableNumber(bitsCount: bitsCount),
8889
"\(signedNumber) cannot be represented by \(representation) using \(bitsCount) bits")
90+
precondition(0...Int.bitWidth ~= bitsCount)
8991

9092
var magnitude = signedNumber.magnitude
9193
switch representation {

Sources/LsbBitWriter.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public final class LsbBitWriter: BitWriter {
5151
- Note: The `number` will be truncated if the `bitsCount` is less than the amount of bits required to fully
5252
represent the value of `number`.
5353
- Note: Bits of the `number` are processed using the same bit-numbering scheme as of the writer (i.e. "LSB 0").
54+
- Precondition: Parameter `bitsCount` must be in the `0...UInt.bitWidth` range.
5455
*/
5556
public func write(unsignedNumber: UInt, bitsCount: Int) {
5657
precondition(0...UInt.bitWidth ~= bitsCount)

Sources/MsbBitWriter.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public final class MsbBitWriter: BitWriter {
5151
- Note: The `number` will be truncated if the `bitsCount` is less than the amount of bits required to fully
5252
represent the value of `number`.
5353
- Note: Bits of the `number` are processed using the same bit-numbering scheme as of the writer (i.e. "MSB 0").
54+
- Precondition: Parameter `bitsCount` must be in the `0...UInt.bitWidth` range.
5455
*/
5556
public func write(unsignedNumber: UInt, bitsCount: Int) {
5657
precondition(0...UInt.bitWidth ~= bitsCount)

0 commit comments

Comments
 (0)