aboutsummaryrefslogtreecommitdiff
path: root/fmdriver/fmdriver_common.h
diff options
context:
space:
mode:
authorTakamichi Horikawa <takamichiho@gmail.com>2017-02-12 11:03:42 +0900
committerTakamichi Horikawa <takamichiho@gmail.com>2017-02-12 11:03:42 +0900
commit93dde8cf16973e07e687e7e0740cf02c38786c38 (patch)
treef303dca889d30e77578ad88f52a9cadf92f542cc /fmdriver/fmdriver_common.h
parentb1065289a6ca6d07d13fbbad2021b3ea5186393d (diff)
u8s16 to u8s8
Diffstat (limited to 'fmdriver/fmdriver_common.h')
-rw-r--r--fmdriver/fmdriver_common.h4
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