Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #97 from readium/fixes/xcode10.2
Browse files Browse the repository at this point in the history
Fix Xcode 10.2 warnings
  • Loading branch information
aferditamuriqi authored May 23, 2019
2 parents dc3d2f6 + bee76b3 commit 6da06d2
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*.pbxproj binary merge=union
#*.pbxproj binary merge=union
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github "readium/r2-shared-swift" == 1.2.8
github "readium/r2-shared-swift" == 1.2.9
github "tadija/AEXML" == 4.3.3
github "swisspol/GCDWebServer" == 3.5.2
github "krzyzanowskim/CryptoSwift" == 0.15.0
Expand Down
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
github "cezheng/Fuzi" "2.2.1"
github "dexman/Minizip" "1.4.0"
github "krzyzanowskim/CryptoSwift" "0.15.0"
github "readium/r2-shared-swift" "1.2.8"
github "readium/r2-shared-swift" "1.2.9"
github "swisspol/GCDWebServer" "3.5.2"
github "tadija/AEXML" "4.3.3"
github "tadija/AEXML" "4.3.3"
4 changes: 2 additions & 2 deletions Sources/fetcher/ContentFilter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ internal protocol ContentFilters {
// Default implementation. Do nothing.
internal extension ContentFilters {

internal func apply(to input: SeekableInputStream,
func apply(to input: SeekableInputStream,
of publication: Publication,
with container: Container, at path: String) throws -> SeekableInputStream {
// Do nothing.
return input
}

internal func apply(to input: Data,
func apply(to input: Data,
of publication: Publication,
with container: Container, at path: String) throws -> Data {
// Do nothing.
Expand Down
16 changes: 8 additions & 8 deletions Sources/fetcher/DataCompression.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public extension Data
/// Compresses the data.
/// - parameter withAlgorithm: Compression algorithm to use. See the `CompressionAlgorithm` type
/// - returns: compressed data
public func compress(withAlgorithm algo: CompressionAlgorithm) -> Data?
func compress(withAlgorithm algo: CompressionAlgorithm) -> Data?
{
return self.withUnsafeBytes { (sourcePtr: UnsafePointer<UInt8>) -> Data? in
let config = (operation: COMPRESSION_STREAM_ENCODE, algorithm: algo.lowLevelType)
Expand All @@ -46,7 +46,7 @@ public extension Data
/// Decompresses the data.
/// - parameter withAlgorithm: Compression algorithm to use. See the `CompressionAlgorithm` type
/// - returns: decompressed data
public func decompress(withAlgorithm algo: CompressionAlgorithm) -> Data?
func decompress(withAlgorithm algo: CompressionAlgorithm) -> Data?
{
return self.withUnsafeBytes { (sourcePtr: UnsafePointer<UInt8>) -> Data? in
let config = (operation: COMPRESSION_STREAM_DECODE, algorithm: algo.lowLevelType)
Expand All @@ -60,7 +60,7 @@ public extension Data
/// LZFSE : Apples proprietary compression algorithm. Claims to compress as good as ZLIB but 2 to 3 times faster.
/// LZMA : Horribly slow. Compression as well as decompression. Normally you will regret choosing LZMA.
/// LZ4 : Fast, but depending on the data the compression rate can be really bad. Which is often the case.
public enum CompressionAlgorithm
enum CompressionAlgorithm
{
case ZLIB
case LZFSE
Expand All @@ -71,7 +71,7 @@ public extension Data
/// Compresses the data using the zlib deflate algorithm.
/// - returns: raw deflated data according to [RFC-1951](https://tools.ietf.org/html/rfc1951).
/// - note: Fixed at compression level 5 (best trade off between speed and time)
public func deflate() -> Data?
func deflate() -> Data?
{
return self.withUnsafeBytes { (sourcePtr: UnsafePointer<UInt8>) -> Data? in
let config = (operation: COMPRESSION_STREAM_ENCODE, algorithm: COMPRESSION_ZLIB)
Expand All @@ -82,7 +82,7 @@ public extension Data
/// Deompresses the data using the zlib deflate algorithm. Self is expected to be a raw deflate
/// stream according to [RFC-1951](https://tools.ietf.org/html/rfc1951).
/// - returns: uncompressed data
public func inflate() -> Data?
func inflate() -> Data?
{
return self.withUnsafeBytes { (sourcePtr: UnsafePointer<UInt8>) -> Data? in
let config = (operation: COMPRESSION_STREAM_DECODE, algorithm: COMPRESSION_ZLIB)
Expand All @@ -93,7 +93,7 @@ public extension Data
/// Compresses the data using the zlib deflate algorithm.
/// - returns: zlib deflated data according to [RFC-1950](https://tools.ietf.org/html/rfc1950)
/// - note: Fixed at compression level 5 (best trade off between speed and time)
public func zip() -> Data?
func zip() -> Data?
{
var res = Data(bytes: [0x78, 0x5e])

Expand All @@ -109,7 +109,7 @@ public extension Data
/// Deompresses the data using the zlib deflate algorithm. Self is expected to be a zlib deflate
/// stream according to [RFC-1950](https://tools.ietf.org/html/rfc1950).
/// - returns: uncompressed data
public func unzip(skipCheckSumValidation: Bool = true) -> Data?
func unzip(skipCheckSumValidation: Bool = true) -> Data?
{
// 2 byte header + 4 byte adler32 checksum
let overhead = 6
Expand Down Expand Up @@ -146,7 +146,7 @@ public extension Data

/// Rudimentary implementation of the adler32 checksum.
/// - returns: adler32 checksum (4 byte)
public func adler32() -> UInt32
func adler32() -> UInt32
{
var s1: UInt32 = 1
var s2: UInt32 = 0
Expand Down
6 changes: 3 additions & 3 deletions Sources/fetcher/Fetcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public enum FetcherError: Error {
/// An Container error occurred, **underlyingError** thrown.
case container(underlyingError: Error)
/// The mimetype of the container is empty.
case missingContainerMimetype()
case missingContainerMimetype
/// The link href couldn't be found in the container.
case linkNotFound
}
Expand Down Expand Up @@ -140,7 +140,7 @@ internal class Fetcher {
/// `FetcherError.missingContainerMimetype`
static func getContentFilters(forMimeType mimeType: String?) throws -> ContentFilters {
guard let mimeType = mimeType else {
throw FetcherError.missingContainerMimetype()
throw FetcherError.missingContainerMimetype
}
switch mimeType {
case EpubConstant.mimetype, EpubConstant.mimetypeOEBPS:
Expand All @@ -150,7 +150,7 @@ internal class Fetcher {
case PDFConstant.pdfMimetype, PDFConstant.lcpdfMimetype:
return ContentFiltersPDF()
default:
throw FetcherError.missingContainerMimetype()
throw FetcherError.missingContainerMimetype
}
}
}
2 changes: 1 addition & 1 deletion Sources/parser/EPUB/SMILParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ internal extension SmilTimeFormat {
///
/// - Parameter time: The `smilTime` `String`.
/// - Returns: The converted value in seconds.
internal func convertToseconds(smilTime time: String) -> String {
func convertToseconds(smilTime time: String) -> String {
var seconds = 0.0

switch self {
Expand Down
7 changes: 5 additions & 2 deletions r2-streamer-swift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0820;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = Readium;
TargetAttributes = {
59501DCC1E2FB0D700D1B4BF = {
Expand All @@ -351,10 +351,11 @@
};
buildConfigurationList = 59501DC71E2FB0D700D1B4BF /* Build configuration list for PBXProject "r2-streamer-swift" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 59501DC31E2FB0D700D1B4BF;
productRefGroup = 59501DCE1E2FB0D700D1B4BF /* Products */;
Expand Down Expand Up @@ -427,6 +428,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down Expand Up @@ -489,6 +491,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down

0 comments on commit 6da06d2

Please sign in to comment.