Skip to content

Commit 279ac65

Browse files
committed
Merge branch 'develop'
2 parents 3b5f072 + 0c94f06 commit 279ac65

16 files changed

Lines changed: 67 additions & 33 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: true
44
author: Timofey Solomko
55
module: BitByteData
6-
module_version: 1.0.1
6+
module_version: 1.0.2
77
copyright: '© 2018 Timofey Solomko'
88
readme: README.md
99
github_url: https://github.com/tsolomko/BitByteData
10-
github_file_prefix: https://github.com/tsolomko/BitByteData/tree/1.0.1
10+
github_file_prefix: https://github.com/tsolomko/BitByteData/tree/1.0.2
1111
theme: fullwidth
1212

1313
custom_categories:

.swiftlint.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ opt_in_rules:
44
- conditional_returns_on_newline
55
- contains_over_first_not_nil
66
- discouraged_direct_init
7+
- discouraged_object_literal
78
- explicit_init
89
- fatal_error_message
910
- first_where
@@ -19,4 +20,5 @@ opt_in_rules:
1920
- sorted_first_last
2021
- strict_fileprivate
2122
- switch_case_on_newline
22-
- trailing_closure
23+
- trailing_closure
24+
- yoda_condition

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
# Install SourceKitten and Jazzy.
3232
- brew install sourcekitten
3333
- gem install -N jazzy
34+
- gem update -N cocoapods
3435
before_deploy:
3536
- >
3637
if ! [ "$BEFORE_DEPLOY_RUN" ]; then

BitByteData.podspec

Lines changed: 3 additions & 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 = "1.0.1"
4+
s.version = "1.0.2"
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."
@@ -20,6 +20,8 @@ Pod::Spec.new do |s|
2020
s.tvos.deployment_target = "9.0"
2121
s.watchos.deployment_target = "2.0"
2222

23+
s.swift_version = '4.0'
24+
2325
s.source_files = "Sources/*.swift"
2426

2527
s.test_spec 'Tests' do |test_spec|

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>1.0.1</string>
18+
<string>1.0.2</string>
1919
<key>CFBundleVersion</key>
20-
<string>5</string>
20+
<string>6</string>
2121
<key>NSHumanReadableCopyright</key>
2222
<string>Copyright © 2018 Timofey Solomko. All rights reserved.</string>
2323
</dict>

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>1.0.1</string>
18+
<string>1.0.2</string>
1919
<key>CFBundleVersion</key>
20-
<string>5</string>
20+
<string>6</string>
2121
</dict>
2222
</plist>

BitByteData.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@
248248
CLANG_WARN_SUSPICIOUS_MOVE = YES;
249249
CLANG_WARN_UNREACHABLE_CODE = YES;
250250
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
251-
CURRENT_PROJECT_VERSION = 5;
251+
CURRENT_PROJECT_VERSION = 6;
252252
DEBUG_INFORMATION_FORMAT = dwarf;
253253
ENABLE_STRICT_OBJC_MSGSEND = YES;
254254
ENABLE_TESTABILITY = YES;
@@ -290,7 +290,7 @@
290290
CLANG_WARN_SUSPICIOUS_MOVE = YES;
291291
CLANG_WARN_UNREACHABLE_CODE = YES;
292292
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
293-
CURRENT_PROJECT_VERSION = 5;
293+
CURRENT_PROJECT_VERSION = 6;
294294
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
295295
ENABLE_STRICT_OBJC_MSGSEND = YES;
296296
GCC_NO_COMMON_BLOCKS = YES;
@@ -318,7 +318,7 @@
318318
APPLICATION_EXTENSION_API_ONLY = YES;
319319
DEFINES_MODULE = YES;
320320
DYLIB_COMPATIBILITY_VERSION = 1;
321-
DYLIB_CURRENT_VERSION = 5;
321+
DYLIB_CURRENT_VERSION = 6;
322322
DYLIB_INSTALL_NAME_BASE = "@rpath";
323323
INFOPLIST_FILE = BitByteData.xcodeproj/BitByteData.plist;
324324
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
@@ -337,7 +337,7 @@
337337
APPLICATION_EXTENSION_API_ONLY = YES;
338338
DEFINES_MODULE = YES;
339339
DYLIB_COMPATIBILITY_VERSION = 1;
340-
DYLIB_CURRENT_VERSION = 5;
340+
DYLIB_CURRENT_VERSION = 6;
341341
DYLIB_INSTALL_NAME_BASE = "@rpath";
342342
INFOPLIST_FILE = BitByteData.xcodeproj/BitByteData.plist;
343343
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";

CHANGELOG.md

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

3+
## 1.0.2
4+
5+
- Fix several problems causing incorrect preconditions failures.
6+
37
## 1.0.1
48

59
- Increased performance of `bit()`, `bits(count:)` and `int(fromBits:)` functions for both `LsbBitReader` and `MsbBitReader`.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ More details you can find in [Swift Package Manager's Documentation](https://git
3737

3838
### CocoaPods
3939

40-
Add `pod 'BitByteData', '~> 1.0'` and `use_frameworks!` lines to your Podfile.
40+
Add `pod 'BitByteData', '~> 1.0'` and `use_frameworks!` to your Podfile.
4141

4242
To complete installation, run `pod install`.
4343

Sources/ByteReader.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class ByteReader {
4040
- Precondition: There MUST be enough data left.
4141
*/
4242
public func byte() -> UInt8 {
43-
precondition(self.offset < self.size)
43+
precondition(self.offset < self.data.endIndex)
4444
self.offset += 1
4545
return self.data[self.offset - 1]
4646
}
@@ -55,7 +55,7 @@ public class ByteReader {
5555
precondition(count >= 0)
5656
guard count > 0
5757
else { return [] }
58-
precondition(self.offset + count <= self.size)
58+
precondition(self.offset + count <= self.data.endIndex)
5959
let result = self.data[self.offset..<self.offset + count].toArray(type: UInt8.self, count: count)
6060
self.offset += count
6161
return result
@@ -67,7 +67,7 @@ public class ByteReader {
6767
- Precondition: There MUST be enough data left.
6868
*/
6969
public func uint64() -> UInt64 {
70-
precondition(self.offset + 8 <= self.size)
70+
precondition(self.offset + 8 <= self.data.endIndex)
7171
let result = self.data[self.offset..<self.offset + 8].to(type: UInt64.self)
7272
self.offset += 8
7373
return result
@@ -79,7 +79,7 @@ public class ByteReader {
7979
- Precondition: There MUST be enough data left.
8080
*/
8181
public func uint32() -> UInt32 {
82-
precondition(self.offset + 4 <= self.size)
82+
precondition(self.offset + 4 <= self.data.endIndex)
8383
let result = self.data[self.offset..<self.offset + 4].to(type: UInt32.self)
8484
self.offset += 4
8585
return result
@@ -91,7 +91,7 @@ public class ByteReader {
9191
- Precondition: There MUST be enough data left.
9292
*/
9393
public func uint16() -> UInt16 {
94-
precondition(self.offset + 2 <= self.size)
94+
precondition(self.offset + 2 <= self.data.endIndex)
9595
let result = self.data[self.offset..<self.offset + 2].to(type: UInt16.self)
9696
self.offset += 2
9797
return result

0 commit comments

Comments
 (0)