1024jp / GzipSwift

Swift package that enables gzip/gunzip Data using zlib
MIT License
544 stars 134 forks source link

Unsaferawbufferpointer is not convertible to Unsafepointer #36

Closed hytaoist closed 5 years ago

hytaoist commented 5 years ago

some error appeared when i use GzipSwift in swift 4.2. like: ` self.withUnsafeBytes { (inputPointer: UnsafeRawBufferPointer) in stream.next_in = UnsafeMutablePointer(mutating: inputPointer.bindMemory(to: Bytef.self).baseAddress!).advanced(by: Int(stream.total_in)) stream.avail_in = uint(inputCount) - uInt(stream.total_in)

            data.withUnsafeMutableBytes { (outputPointer: UnsafeMutableRawBufferPointer) in
                stream.next_out = outputPointer.bindMemory(to: Bytef.self).baseAddress!.advanced(by: Int(stream.total_out))
                stream.avail_out = uInt(outputCount) - uInt(stream.total_out)

                status = deflate(&stream, Z_FINISH)

                stream.next_out = nil
            }

            stream.next_in = nil
        }`

anyone has a idea?

1024jp commented 5 years ago

Please use not the latest one but one with tag 4.1.0.

yzhong52 commented 5 years ago

@1024jp 4.1.0 is for Swift 5 right? By any chance can we bring this fix back to 4.2 branches/releases as well?