Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-2863

byte data type is unsigned in generated Obj-C code

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Do
    • Affects Version/s: 0.9.1
    • Fix Version/s: 0.13.0
    • Component/s: Cocoa - Compiler
    • Labels:
      None
    • Environment:

      Description

      I have a Thrift struct:

      struct ObjectRecord {
      1: byte viewXOffset,
      2: byte viewYOffset,
      }

      The generated Java code looks like this:

      public ObjectRecord(
      byte viewXOffset,
      byte viewYOffset)

      {...}

      The generated Objective C header looks like this:

      @interface ObjectRecord : NSObject <TBase, NSCoding> {
      uint8_t __viewXOffset;
      uint8_t __viewYOffset;
      }

      According to the docs (https://thrift.apache.org/docs/types), a Thrift byte is an 8-bit signed integer.

      Can work around for now by converting back to signed after reading the value.

        Attachments

          Activity

            People

            • Assignee:
              jking3 James E. King III
              Reporter:
              steve_yegge Steve Yegge
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: