OSDN Git Service

Use standard C99 integral types. This offers better type safety.
authorSharvil Nanavati <sharvil@google.com>
Thu, 17 Apr 2014 04:51:56 +0000 (21:51 -0700)
committerSharvil Nanavati <sharvil@google.com>
Sat, 26 Apr 2014 08:06:21 +0000 (01:06 -0700)
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
stack/btm/btm_ble_gap.c
stack/include/l2c_api.h

index 2c4347b..e9d5097 100644 (file)
 #ifndef DATA_TYPES_H
 #define DATA_TYPES_H
 
+#include <stdint.h>
+#include <stdbool.h>
+
 #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
-
index 608fa7e..39f344c 100644 (file)
@@ -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);
 
 
index 7679d26..0da7f79 100644 (file)
@@ -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);
 
 /*******************************************************************************