You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "kernigh (via GitHub)" <gi...@apache.org> on 2023/02/07 00:30:19 UTC

[GitHub] [thrift] kernigh opened a new pull request, #2754: rewrite the endian conversion to fix a big-endian host

kernigh opened a new pull request, #2754:
URL: https://github.com/apache/thrift/pull/2754

   (This might need a Jira ticket, but I don't have a Jira account. I will try to ask for a Jira account, but I'm not sure how.)
   
   Client: py
   
   Change htolell(dub) to htolell(transfer.t) in compact.h, because the conversion takes a long long, not a double.  This matters on a big-endian host, where the conversion must swap bytes.
   
   The big-endian letohll(n) failed because ntohl(n) is just n, doesn't swap n.  Rewrite ntohll(n) and letohll(n) to use the same code with both big-endian and little-endian hosts.  Expect the compiler to optimize away one of ntohll(n) or letohll(n) when it doesn't swap n.
   
   <!-- Explain the changes in the pull request below: -->
     
   
   <!-- We recommend you review the checklist/tips before submitting a pull request. -->
   
   - [ ] Did you create an [Apache Jira](https://issues.apache.org/jira/projects/THRIFT/issues/) ticket?  (not required for trivial changes)
   - [ ] If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
   - [ ] Did you squash your changes to a single commit?  (not required, but preferred)
   - [ ] Did you do your best to avoid breaking changes?  If one was needed, did you label the Jira ticket with "Breaking-Change"?
   - [ ] If your change does not involve any code, include `[skip ci]` anywhere in the commit message to free up build resources.
   
   <!--
     The Contributing Guide at:
     https://github.com/apache/thrift/blob/master/CONTRIBUTING.md
     has more details and tips for committing properly.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@thrift.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org