You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by nsuke <gi...@git.apache.org> on 2016/07/18 14:25:55 UTC

[GitHub] thrift pull request #1051: THRIFT-3884 Fix Erlang compact protocol double en...

GitHub user nsuke opened a pull request:

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

    THRIFT-3884 Fix Erlang compact protocol double endianess and boolean \u2026

    \u2026list

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

    $ git pull https://github.com/nsuke/thrift THRIFT-3884

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

    https://github.com/apache/thrift/pull/1051.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 #1051
    
----
commit f51088bac2fe49b09612247fc5413a2f3eae3ed1
Author: Nobuaki Sukegawa <ns...@apache.org>
Date:   2016-07-18T12:27:27Z

    THRIFT-3884 Fix Erlang compact protocol double endianess and boolean list

----


---
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 #1051: THRIFT-3884 Fix Erlang compact protocol double en...

Posted by nsuke <gi...@git.apache.org>.
Github user nsuke commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/1051#discussion_r71166224
  
    --- Diff: lib/erl/src/thrift_compact_protocol.erl ---
    @@ -355,7 +356,7 @@ read(This0, i64) ->
     read(This0, double) ->
       {This1, Bytes} = read_data(This0, 8),
       case Bytes of
    -    {ok, <<Val:64/float-signed-big, _/binary>>} -> {This1, {ok, Val}};
    +    {ok, <<Val:64/float-signed-little, _/binary>>} -> {This1, {ok, Val}};
    --- End diff --
    
    @jeking3 thanks, good poinit. I've checked the [doc](http://erlang.org/doc/programming_examples/bit_syntax.html) but couldn't find any `double`.
    
    > The type can be integer, float, or binary.
    
    So I'll replace the other part with float and also unify the order.


---
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 #1051: THRIFT-3884 Fix Erlang compact protocol double en...

Posted by nsuke <gi...@git.apache.org>.
Github user nsuke commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/1051#discussion_r71166470
  
    --- Diff: lib/erl/src/thrift_compact_protocol.erl ---
    @@ -355,7 +356,7 @@ read(This0, i64) ->
     read(This0, double) ->
       {This1, Bytes} = read_data(This0, 8),
       case Bytes of
    -    {ok, <<Val:64/float-signed-big, _/binary>>} -> {This1, {ok, Val}};
    +    {ok, <<Val:64/float-signed-little, _/binary>>} -> {This1, {ok, Val}};
    --- End diff --
    
    Ooops, the `Double` part is just a variable, the same as `Val`.
    Anyway I'll unify the order.


---
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 #1051: THRIFT-3884 Fix Erlang compact protocol double en...

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

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


---
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 #1051: THRIFT-3884 Fix Erlang compact protocol double en...

Posted by jeking3 <gi...@git.apache.org>.
Github user jeking3 commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/1051#discussion_r71162579
  
    --- Diff: lib/erl/src/thrift_compact_protocol.erl ---
    @@ -355,7 +356,7 @@ read(This0, i64) ->
     read(This0, double) ->
       {This1, Bytes} = read_data(This0, 8),
       case Bytes of
    -    {ok, <<Val:64/float-signed-big, _/binary>>} -> {This1, {ok, Val}};
    +    {ok, <<Val:64/float-signed-little, _/binary>>} -> {This1, {ok, Val}};
    --- End diff --
    
    Why is "float" used here instead of "Double"?  I don't know erlang; just looking at line 222 above and expecting it to be similar.


---
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.
---