2017-09-22 1 views
0

J'ai installé un Cocoapod appelé 'SwiftProtobuf' mais il arrive avec cette erreur 'Integer littéral' 9223372036854775808 'déborde lorsqu'il est stocké dans' Int 'L'erreur se produit dans cette fonction à cette section:Message d'erreur dans rapide protobuf CocoaPods

 if n >= 0x8000000000000000 { // -Int64.min 
      if n > 0x8000000000000000 { 

est ici toute la fonction:

internal mutating func nextSInt() throws -> Int64 { 
    if p == end { 
     throw TextFormatDecodingError.malformedNumber 
    } 
    let c = p[0] 
    if c == asciiMinus { // - 
     p += 1 
     // character after '-' must be digit 
     let digit = p[0] 
     if digit < asciiZero || digit > asciiNine { 
      throw TextFormatDecodingError.malformedNumber 
     } 
     let n = try nextUInt() 
     if n >= 0x8000000000000000 { // -Int64.min 
      if n > 0x8000000000000000 { 
       // Too large negative number 
       throw TextFormatDecodingError.malformedNumber 
      } else { 
       return Int64.min // Special case for Int64.min 
      } 
     } 
     return -Int64(bitPattern: n) 
    } else { 
     let n = try nextUInt() 
     if n > UInt64(bitPattern: Int64.max) { 
      throw TextFormatDecodingError.malformedNumber 
     } 
     return Int64(bitPattern: n) 
    } 
} 

Répondre

0

J'utilisé comme 0xffffffff comme UInt32 et l'erreur a disparu.