From 2e1e6d89907172fadabc5d9bbef27198ce81cb00 Mon Sep 17 00:00:00 2001 From: Sharvil Nanavati Date: Wed, 16 Apr 2014 21:51:56 -0700 Subject: [PATCH] Use standard C99 integral types. This offers better type safety. Notice that I had to change a couple of function declarations because the compiler caught the inconsistency with the new typedefs. Change-Id: I202fd1dc086de41e1cfe083eb1a5f74a942d01e5 --- gki/ulinux/data_types.h | 51 ++++++++++++++++++++++--------------------------- stack/btm/btm_ble_gap.c | 2 +- stack/include/l2c_api.h | 2 +- 3 files changed, 25 insertions(+), 30 deletions(-) diff --git a/gki/ulinux/data_types.h b/gki/ulinux/data_types.h index 2c4347b15..e9d509722 100644 --- a/gki/ulinux/data_types.h +++ b/gki/ulinux/data_types.h @@ -19,51 +19,46 @@ #ifndef DATA_TYPES_H #define DATA_TYPES_H +#include +#include + #ifndef NULL -#define NULL 0 +# define NULL (void *)0 #endif #ifndef FALSE -#define FALSE 0 +# define FALSE false #endif -typedef unsigned char UINT8; -typedef unsigned short UINT16; -typedef unsigned long UINT32; -typedef unsigned long long UINT64; +#ifndef TRUE +# define TRUE true +#endif -typedef signed long INT32; -typedef signed char INT8; -typedef signed short INT16; -typedef unsigned char BOOLEAN; +typedef uint8_t UINT8; +typedef uint16_t UINT16; +typedef uint32_t UINT32; +typedef uint64_t UINT64; +typedef int8_t INT8; +typedef int16_t INT16; +typedef int32_t INT32; +typedef bool BOOLEAN; typedef UINT32 TIME_STAMP; -#ifndef TRUE -#define TRUE (!FALSE) -#endif - -typedef unsigned char UBYTE; - #ifdef __arm -#define PACKED __packed -#define INLINE __inline +# define PACKED __packed +# define INLINE __inline #else -#define PACKED -#define INLINE +# define PACKED +# define INLINE #endif -#define UINT16_LOW_BYTE(x) ((x) & 0xff) -#define UINT16_HI_BYTE(x) ((x) >> 8) - +#ifndef BIG_ENDIAN +#define BIG_ENDIAN FALSE +#endif -#define BCM_STRCAT_S(x1,x2,x3) strcat((x1),(x3)) -#define BCM_STRNCAT_S(x1,x2,x3,x4) strncat((x1),(x3),(x4)) #define BCM_STRCPY_S(x1,x2,x3) strcpy((x1),(x3)) #define BCM_STRNCPY_S(x1,x2,x3,x4) strncpy((x1),(x3),(x4)) - - #endif - diff --git a/stack/btm/btm_ble_gap.c b/stack/btm/btm_ble_gap.c index 608fa7eba..39f344cfc 100644 --- a/stack/btm/btm_ble_gap.c +++ b/stack/btm/btm_ble_gap.c @@ -55,7 +55,7 @@ static UINT8 btm_set_conn_mode_adv_init_addr(tBTM_BLE_INQ_CB *p_cb, BD_ADDR_PTR p_addr_ptr, tBLE_ADDR_TYPE *p_init_addr_type, tBLE_ADDR_TYPE *p_own_addr_type); -static BOOLEAN btm_ble_start_adv(void); +static tBTM_STATUS btm_ble_start_adv(void); static tBTM_STATUS btm_ble_stop_adv(void); diff --git a/stack/include/l2c_api.h b/stack/include/l2c_api.h index 7679d262e..0da7f7969 100644 --- a/stack/include/l2c_api.h +++ b/stack/include/l2c_api.h @@ -647,7 +647,7 @@ L2C_API extern BOOLEAN L2CA_FlowControl (UINT16 cid, BOOLEAN data_enabled); ** Returns TRUE if valid Channel, else FALSE ** *******************************************************************************/ -L2C_API extern BOOLEAN L2CA_SendTestSFrame (UINT16 cid, BOOLEAN rr_or_rej, +L2C_API extern BOOLEAN L2CA_SendTestSFrame (UINT16 cid, UINT8 sup_type, UINT8 back_track); /******************************************************************************* -- 2.11.0