From 93dde8cf16973e07e687e7e0740cf02c38786c38 Mon Sep 17 00:00:00 2001 From: Takamichi Horikawa Date: Sun, 12 Feb 2017 11:03:42 +0900 Subject: u8s16 to u8s8 --- fmdriver/fmdriver_common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fmdriver/fmdriver_common.h') diff --git a/fmdriver/fmdriver_common.h b/fmdriver/fmdriver_common.h index 23600cb..706dc95 100644 --- a/fmdriver/fmdriver_common.h +++ b/fmdriver/fmdriver_common.h @@ -5,12 +5,12 @@ static inline uint16_t read16le(const uint8_t *ptr) { return (unsigned)ptr[0] | (((unsigned)ptr[1])<<8); } -static inline int16_t u8s16(uint8_t v) { +static inline int8_t u8s8(uint8_t v) { return (v & 0x80) ? ((int16_t)v)-0x100 : v; } static inline int16_t u16s16(uint16_t v) { - return (v & 0x8000) ? ((int32_t)v)-0x10000 : v; + return (v & 0x8000u) ? ((int32_t)v)-0x10000l : v; } #if 0 -- cgit v1.2.3