Skip to content

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
malcommac committed Sep 14, 2017
2 parents 906e45a + 2b3c854 commit 5d1f49b
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 18 deletions.
Binary file added .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0
4.0
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,23 @@

## CHANGELOG

* Version **[1.0.0](#100)**
* Version **[0.9.0](#090)**

<a name="100" />

## SwiftMsgPack 1.0.0
---
- **Release Date**: 2017/09/14
- **Zipped Version**: [Download 1.0.0](https://github.com/malcommac/SwiftMsgPack/releases/tag/1.0.0)

Swift 4 compatible version

<a name="090" />

## SwiftMsgPack 0.9.0
---
- **Release Date**: 2017/02/26
- **Zipped Version**: [Download 0.9.0](https://github.com/malcommac/SwiftMsgPack/releases/tag/0.9.0)

First release
First release
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ Take a look here:

## Current Release

Latest release is: 0.9.1 [Download here](https://github.com/malcommac/SwiftMsgPack/releases/tag/0.9.1).
* **Swift 4.x**: Latest is 1.0.0 [Download here](https://github.com/malcommac/SwiftMsgPack/releases/tag/1.0.0).
* **Swift 3.x**: Last is 0.9.1 [Download here](https://github.com/malcommac/SwiftMsgPack/releases/tag/0.9.1).

A complete list of changes for each release is available in the [CHANGELOG](CHANGELOG.md) file.

<a name="howto" />
Expand Down Expand Up @@ -136,7 +138,7 @@ Tests can also be runned with XCode using the SwiftMsgPack project.

Current version is compatible with:

* Swift 3.0+
* Swift 4.x+ (Swift 3.x up to 0.9.1)
* iOS 9.0 or later
* tvOS 9.0 or later
* macOS 10.10 or later
Expand Down
9 changes: 4 additions & 5 deletions Sources/SwiftMsgPack/Decoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,10 @@ public extension Data {
// STRING 32 BIT LENGTH
// str 32 11011011 0xdb
case 0xdb:
let len_data = Int(try stream.read8Bit()) << 24 +
Int(try stream.read8Bit()) << 16 +
Int(try stream.read8Bit()) << 8 +
Int(try stream.read8Bit())
var len_data = Int(try stream.read8Bit()) << 24
len_data += Int(try stream.read8Bit()) << 16
len_data += Int(try stream.read8Bit()) << 8
len_data += Int(try stream.read8Bit())
return try unpack(string: &stream, length: len_data)


Expand Down Expand Up @@ -346,7 +346,6 @@ public extension Data {
guard let key = try self.unpack(stream: &stream) as? AnyHashable else {
throw MsgPackError.unsupportedValue("Invalid dict key")
}
print(key)
let val = try self.unpack(stream: &stream)
dict[key] = val
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/SwiftMsgPack/Encoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ public extension Data {
@discardableResult
private mutating func pack(array value: [Any?]) throws -> Data {

guard value.count < Int(bitPattern: UInt(UInt32.max)) else {
guard UInt32(bitPattern: Int32(value.count)) < UInt32.max else {
//guard value.count < Int(UInt32.max) else {
// Array is too large to be included in a MsgPack data
throw MsgPackError.dataIsTooBig("Array is too big: \(value.count) items")
Expand All @@ -405,7 +405,7 @@ public extension Data {
@discardableResult
private mutating func pack(dict value: [AnyHashable:Any?]) throws -> Data {
guard value.count < Int(bitPattern: UInt(UInt32.max)) else {
guard UInt32(bitPattern: Int32(value.count)) < UInt32.max else {
// guard value.count < Int(UInt32.max) else {
// Dictionary is too large to be contained in a MsgPack data
throw MsgPackError.dataIsTooBig("Dictionary is too big: \(value.count) items")
Expand Down
6 changes: 3 additions & 3 deletions SwiftMsgPack.podspec
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Pod::Spec.new do |spec|
spec.name = 'SwiftMsgPack'
spec.version = '0.9.1'
spec.version = '1.0.0'
spec.summary = 'MsgPack Encoder/Decoder in pure Swift'
spec.homepage = 'https://github.com/malcommac/SwiftMsgPack'
spec.license = { :type => 'MIT', :file => 'LICENSE' }
spec.author = { 'Daniele Margutti' => 'me@danielemargutti.com' }
spec.social_media_url = 'http://twitter.com/danielemargutti'
spec.source = { :git => 'https://github.com/malcommac/SwiftMsgPack.git', :tag => "#{spec.version}" }
spec.source_files = 'Sources/**/*.swift'
spec.ios.deployment_target = '9.0'
spec.ios.deployment_target = '8.0'
spec.osx.deployment_target = '10.10'
spec.tvos.deployment_target = '9.0'
spec.requires_arc = true
spec.module_name = 'SwiftMsgPack'
end
end
10 changes: 6 additions & 4 deletions SwiftMsgPack/SwiftMsgPack.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2,3,4";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -354,6 +355,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2,3,4";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -382,7 +384,7 @@
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvsimulator appletvos";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
name = Debug;
Expand All @@ -407,7 +409,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvsimulator appletvos";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
name = Release;
Expand All @@ -423,7 +425,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.mokasw.SwiftMsgPackTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -437,7 +439,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.mokasw.SwiftMsgPackTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand Down
Binary file not shown.

0 comments on commit 5d1f49b

Please sign in to comment.