Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8402708 authored by Sharvil Nanavati's avatar Sharvil Nanavati
Browse files

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
parent c6f387bc
Loading
Loading
Loading
Loading
+23 −28
Original line number Diff line number Diff line
@@ -19,33 +19,33 @@
#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
@@ -54,16 +54,11 @@ typedef unsigned char UBYTE;
#  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
+1 −1
Original line number Diff line number Diff line
@@ -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);


+1 −1
Original line number Diff line number Diff line
@@ -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);

/*******************************************************************************