You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by djwatson <gi...@git.apache.org> on 2014/03/26 18:05:11 UTC

[GitHub] thrift pull request: thrift: clean up enum value assignment

GitHub user djwatson opened a pull request:

    https://github.com/apache/thrift/pull/88

    thrift: clean up enum value assignment

        Summary:
        Clean up how enum values are handled if an integer value is not
        explicitly specified in the thrift file.
    
        For example, the following used to be a compile error, but
        works now:
    
          enum MyEnum {
            SOMEVALUE
          }
          struct MyStruct {
            1: MyEnum e = SOMEVALUE
          }
    
        This change also cleans up some of the error handling with out-of-range
        values.  Previously thrift simply issued a warning for enum values that
        didn't fit in an i32, but serialized them as i32 anyway.  Now
        out-of-range enum values result in a compile failure.
    
        Test Plan:
        Included a new unit test to verify the assignment of enum values.  I
        also verified that g++ makes the same enum value assignments when
        compiling these enums as C++ code.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/djwatson/thrift enum_parser

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/88.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #88
    
----
commit 066cdfc0846dce8128263592efffa88084632a74
Author: Dave Watson <da...@fb.com>
Date:   2014-03-25T18:51:47Z

    thrift: clean up enum value assignment
    
        Summary:
        Clean up how enum values are handled if an integer value is not
        explicitly specified in the thrift file.
    
        For example, the following used to be a compile error, but
        works now:
    
          enum MyEnum {
            SOMEVALUE
          }
          struct MyStruct {
            1: MyEnum e = SOMEVALUE
          }
    
        This change also cleans up some of the error handling with out-of-range
        values.  Previously thrift simply issued a warning for enum values that
        didn't fit in an i32, but serialized them as i32 anyway.  Now
        out-of-range enum values result in a compile failure.
    
        Test Plan:
        Included a new unit test to verify the assignment of enum values.  I
        also verified that g++ makes the same enum value assignments when
        compiling these enums as C++ code.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: thrift: clean up enum value assignment

Posted by bufferoverflow <gi...@git.apache.org>.
Github user bufferoverflow commented on the pull request:

    https://github.com/apache/thrift/pull/88#issuecomment-42144665
  
    I made this: https://issues.apache.org/jira/browse/THRIFT-2513
    
    testing...
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: thrift: clean up enum value assignment

Posted by Jens-G <gi...@git.apache.org>.
Github user Jens-G commented on the pull request:

    https://github.com/apache/thrift/pull/88#issuecomment-39388481
  
    There is no ticket yet, right?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: thrift: clean up enum value assignment

Posted by djwatson <gi...@git.apache.org>.
Github user djwatson commented on the pull request:

    https://github.com/apache/thrift/pull/88#issuecomment-39388547
  
    not yet


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: thrift: clean up enum value assignment

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/thrift/pull/88


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---