use casts also for 16-bit values

This commit is contained in:
matthias.ringwald 2009-07-18 08:06:03 +00:00
parent b7d49065bd
commit b9fa6cb54b

View File

@ -15,7 +15,7 @@
#include "bt_control.h"
// helper for BT little endian format
#define READ_BT_16( buffer, pos) (buffer[pos] | (buffer[pos+1] << 8))
#define READ_BT_16( buffer, pos) ( ((uint16_t) buffer[pos]) | (((uint16_t)buffer[pos+1]) << 8))
#define READ_BT_24( buffer, pos) ( ((uint32_t) buffer[pos]) | (((uint32_t)buffer[pos+1]) << 8) | (((uint32_t)buffer[pos+2]) << 16))
#define READ_BT_32( buffer, pos) ( ((uint32_t) buffer[pos]) | (((uint32_t)buffer[pos+1]) << 8) | (((uint32_t)buffer[pos+2]) << 16) | (((uint32_t) buffer[pos+3])) << 24)