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

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

Add a flexible array to the end of BT_HDR to avoid pointer arithmetic.

This change should clean up a lot of code. I've verified sizeof(BT_HDR)
remains constant after this change on ARM, x86, and x86_64.

Change-Id: I762351fa0f24a587da190de3e522bc74e497c542
parent 1060af76
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -108,6 +108,7 @@ typedef struct
    uint16_t          len;
    uint16_t          offset;
    uint16_t          layer_specific;
    uint8_t           data[];
} HC_BT_HDR;

#define BT_HC_HDR_SIZE (sizeof(HC_BT_HDR))
+5 −4
Original line number Diff line number Diff line
@@ -205,10 +205,11 @@
*/
typedef struct
{
    UINT16          event;
    UINT16          len;
    UINT16          offset;
    UINT16          layer_specific;
    uint16_t          event;
    uint16_t          len;
    uint16_t          offset;
    uint16_t          layer_specific;
    uint8_t           data[];
} BT_HDR;

#define BT_HDR_SIZE (sizeof (BT_HDR))