Fix some typos in Swift port

pull/82/head
fwcd 6 years ago
parent 3a420a3ad7
commit dac60dacee

@ -21,7 +21,6 @@
* Software. * Software.
*/ */
import BinaryKit
import Foundation import Foundation
struct QRCode { struct QRCode {
@ -620,7 +619,7 @@ struct QRCode {
} }
/// Returns an entry from the given table based on the given values. /// Returns an entry from the given table based on the given values.
private func table_get(_ table: [[Int]], version: Version, ecl: QrCodeEcc) -> UInt { private func table_get(_ table: [[Int]], version: QRCodeVersion, ecl: QRCodeECC) -> UInt {
UInt(table[ecl.ordinal][Int(version.value)]) UInt(table[ecl.ordinal][Int(version.value)])
} }

@ -171,7 +171,7 @@ public struct QRSegment: Hashable {
/// Calculates and returns the number of bits needed to encode the given /// Calculates and returns the number of bits needed to encode the given
/// segments at the given version. The result is None if a segment has too many /// segments at the given version. The result is None if a segment has too many
/// characters to fit its length field, or the total bits exceeds usize::MAX. /// characters to fit its length field, or the total bits exceeds usize::MAX.
public static func getTotalBits(segments: [Self], version: Version) -> UInt? { public static func getTotalBits(segments: [Self], version: QRCodeVersion) -> UInt? {
var result: UInt = 0 var result: UInt = 0
for seg in segments { for seg in segments {
let ccBits = seg.mode.numCharCountBits(version: version) let ccBits = seg.mode.numCharCountBits(version: version)
@ -197,7 +197,7 @@ public struct QRSegment: Hashable {
} }
/*---- QrSegmentMode functionality ----*/ /*---- QrSegmentMode functionality ----*/
public struct Mode: Hashable { public enum Mode: Hashable {
case numeric case numeric
case alphanumeric case alphanumeric
case byte case byte

Loading…
Cancel
Save