Steve Yegge created THRIFT-2863:
-----------------------------------

             Summary: byte data type is unsigned in generated Obj-C code
                 Key: THRIFT-2863
                 URL: https://issues.apache.org/jira/browse/THRIFT-2863
             Project: Thrift
          Issue Type: Bug
          Components: Cocoa - Compiler
    Affects Versions: 0.9.1
         Environment: Using thrift compiled on Ubuntu:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.5 LTS"
NAME="Ubuntu"
VERSION="12.04.5 LTS, Precise Pangolin"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu precise (12.04.5 LTS)"
VERSION_ID="12.04"
            Reporter: Steve Yegge


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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to