Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/aarch64/include avoid conversion warnings



details:   https://anonhg.NetBSD.org/src/rev/ae2c8720bc72
branches:  trunk
changeset: 820975:ae2c8720bc72
user:      rin <rin%NetBSD.org@localhost>
date:      Tue Jan 17 11:09:36 2017 +0000

description:
avoid conversion warnings

diffstat:

 sys/arch/aarch64/include/byte_swap.h |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (23 lines):

diff -r c5801b272369 -r ae2c8720bc72 sys/arch/aarch64/include/byte_swap.h
--- a/sys/arch/aarch64/include/byte_swap.h      Tue Jan 17 11:09:10 2017 +0000
+++ b/sys/arch/aarch64/include/byte_swap.h      Tue Jan 17 11:09:36 2017 +0000
@@ -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 @@
        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;
 }



Home | Main Index | Thread Index | Old Index