From 4ba06534140e04c134154cc2682f2a1ec4d0d007 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 10 Nov 2011 17:25:15 +0200 Subject: [PATCH] btmgmt: Fix compilation issues with hci_set_bit This fixes string-aliasing rules warnings/errors with certain compilers. --- mgmt/main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mgmt/main.c b/mgmt/main.c index 93c42fd59..e9b0ee1e0 100644 --- a/mgmt/main.c +++ b/mgmt/main.c @@ -1096,14 +1096,18 @@ static void find_rsp(int mgmt_sk, uint16_t op, uint16_t id, uint8_t status, static void cmd_find(int mgmt_sk, uint16_t index, int argc, char **argv) { struct mgmt_cp_start_discovery cp; + uint8_t type; if (index == MGMT_INDEX_NONE) index = 0; + type = 0; + hci_set_bit(MGMT_ADDR_BREDR, &type); + hci_set_bit(MGMT_ADDR_LE_PUBLIC, &type); + hci_set_bit(MGMT_ADDR_LE_RANDOM, &type); + memset(&cp, 0, sizeof(cp)); - hci_set_bit(MGMT_ADDR_BREDR, &cp.type); - hci_set_bit(MGMT_ADDR_LE_PUBLIC, &cp.type); - hci_set_bit(MGMT_ADDR_LE_RANDOM, &cp.type); + cp.type = type; if (mgmt_send_cmd(mgmt_sk, MGMT_OP_START_DISCOVERY, index, &cp, sizeof(cp), find_rsp, NULL) < 0) { -- 2.47.3