diff options
Diffstat (limited to 'fmdriver/fmdriver_common.h')
-rw-r--r-- | fmdriver/fmdriver_common.h | 4 |
1 files changed, 2 insertions, 2 deletions
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 |