Module Name: src Committed By: rin Date: Tue Jan 17 11:09:36 UTC 2017
Modified Files: src/sys/arch/aarch64/include: byte_swap.h Log Message: avoid conversion warnings To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/aarch64/include/byte_swap.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/aarch64/include/byte_swap.h diff -u src/sys/arch/aarch64/include/byte_swap.h:1.3 src/sys/arch/aarch64/include/byte_swap.h:1.4 --- src/sys/arch/aarch64/include/byte_swap.h:1.3 Wed Oct 29 01:33:39 2014 +++ src/sys/arch/aarch64/include/byte_swap.h Tue Jan 17 11:09:36 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: byte_swap.h,v 1.3 2014/10/29 01:33:39 dennis Exp $ */ +/* $NetBSD: byte_swap.h,v 1.4 2017/01/17 11:09:36 rin Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -89,11 +89,11 @@ __byte_swap_u16_variable(uint16_t v) if (!__builtin_constant_p(v)) { uint32_t v32 = v; __asm("rev16\t%w0, %w1" : "=r" (v32) : "0" (v32)); - return v32; + return (uint16_t)v32; } v &= 0xffff; - v = (v >> 8) | (v << 8); + v = (uint16_t)((v >> 8) | (v << 8)); return v; }