Skip to content

Commit 4e93cd0

Browse files
committed
3.1 updates
1 parent 8dd6243 commit 4e93cd0

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

.swift-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.1

DataDecoder.podspec

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Be sure to run `pod lib lint DataDecoder.podspec' to ensure this is a
3+
# valid spec before submitting.
4+
#
5+
# Any lines starting with a # are optional, but their use is encouraged
6+
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
7+
#
8+
9+
Pod::Spec.new do |s|
10+
s.name = 'DataDecoder'
11+
s.version = '0.6.1'
12+
s.summary = 'Swift Data Decoder. Easily Decode Data values'
13+
14+
s.description = <<-DESC
15+
Swift Data Decoder. Easily Decode Data values.
16+
DESC
17+
18+
s.homepage = 'https://github.com/FitnessKit/DataDecoder'
19+
s.license = { :type => 'MIT', :file => 'LICENSE' }
20+
s.author = { 'Kevin A. Hoogheem' => '[email protected]' }
21+
s.source = { :git => 'https://github.com/FitnessKit/DataDecoder.git', :tag => s.version.to_s }
22+
23+
s.ios.deployment_target = '8.0'
24+
25+
s.source_files = 'Sources/**/*'
26+
27+
end

Sources/DataDecoder/DataDecoder.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ public extension DataDecoder {
262262
var returnResult: Float = 0
263263

264264
if mantissa >= DecoderSFloatValues.positiveInfinity.rawValue && mantissa <= DecoderSFloatValues.negativeInfinity.rawValue {
265-
returnResult = Float(kReservedFloatValues[mantissa - DecoderSFloatValues.positiveInfinity.rawValue])
265+
let index: Int = Int(mantissa - DecoderSFloatValues.positiveInfinity.rawValue)
266+
returnResult = Float(kReservedFloatValues[index])
266267
} else {
267268

268269
if mantissa >= 0x0800 {
@@ -288,7 +289,8 @@ public extension DataDecoder {
288289
var returnResult: Float = 0
289290

290291
if mantissa >= Int32(DecoderFloatValues.positiveInfinity.rawValue) && mantissa <= Int32(DecoderFloatValues.negativeInfinity.rawValue) {
291-
returnResult = Float(kReservedFloatValues[mantissa - Int32(DecoderFloatValues.positiveInfinity.rawValue)])
292+
let index: Int = Int(mantissa - Int32(DecoderFloatValues.positiveInfinity.rawValue))
293+
returnResult = Float(kReservedFloatValues[index])
292294
} else {
293295

294296
if mantissa >= 0x800000 {

0 commit comments

Comments
 (0)