diff options
author | Josh Haberman <jhaberman@gmail.com> | 2015-05-18 11:37:03 -0700 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2015-05-18 12:57:44 -0700 |
commit | 2cff15d35e4ff862e6a0811ae9e509c3d3352514 (patch) | |
tree | 3bc0d6ef00bf5a54011e72c38d544f47e908e83f /upb/table.int.h | |
parent | e2840a4aa1b6a7a2ca1421d0d6da3e56992e5090 (diff) |
Updates from code review comments.
Diffstat (limited to 'upb/table.int.h')
-rw-r--r-- | upb/table.int.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/upb/table.int.h b/upb/table.int.h index 0a246d5..b6e8eb7 100644 --- a/upb/table.int.h +++ b/upb/table.int.h @@ -158,10 +158,14 @@ FUNCS(fptr, fptr, upb_func*, UPB_CTYPE_FPTR); // length into a byte-wise string representation, so code generation needs to // help it along. // -// "len1" is the low byte and len4 is the high byte. For big endian we'll need -// to define a version of this that flips it around. +// "len1" is the low byte and len4 is the high byte. +#ifdef UPB_BIG_ENDIAN +#define UPB_TABKEY_STR(len1, len2, len3, len4, strval) \ + (uintptr_t)(len4 len3 len2 len1 strval) +#else #define UPB_TABKEY_STR(len1, len2, len3, len4, strval) \ (uintptr_t)(len1 len2 len3 len4 strval) +#endif // Either: // 1. an actual integer key, or |