Rework casting in decode_bigend_u16.

Both versions pass tests, but this doesn't make -Wconversion complain.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/f48cc9ed
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/f48cc9ed
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/f48cc9ed

Branch: refs/heads/master
Commit: f48cc9edddcb1ff8da2ddb79d4ced3f828f8689b
Parents: e691a22
Author: Marvin Humphrey <[email protected]>
Authored: Thu Apr 21 17:10:21 2016 -0700
Committer: Marvin Humphrey <[email protected]>
Committed: Thu Apr 21 17:10:21 2016 -0700

----------------------------------------------------------------------
 core/Lucy/Util/NumberUtils.cfh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/f48cc9ed/core/Lucy/Util/NumberUtils.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/NumberUtils.cfh b/core/Lucy/Util/NumberUtils.cfh
index bbb48d6..a9cca59 100644
--- a/core/Lucy/Util/NumberUtils.cfh
+++ b/core/Lucy/Util/NumberUtils.cfh
@@ -249,8 +249,7 @@ lucy_NumUtil_encode_bigend_u64(uint64_t value, void 
*dest_ptr) {
 static CFISH_INLINE uint16_t
 lucy_NumUtil_decode_bigend_u16(const void *source) {
     const uint8_t *const buf = (const uint8_t*)source;
-    return  ((uint16_t)buf[0] << 8) |
-            ((uint16_t)buf[1]);
+    return  (uint16_t)((buf[0] << 8) | buf[1]);
 }
 
 static CFISH_INLINE uint32_t

Reply via email to