Skip to content

Commit 97947b4

Browse files
committed
shrink bast_pro_mini_m0; use proper flex-array syntax
1 parent 6abe3cd commit 97947b4

File tree

5 files changed

+54
-52
lines changed

5 files changed

+54
-52
lines changed

devices/ble_hci/common-hal/_bleio/hci_include/att_internal.h

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct bt_att_info_128 {
6969
#define BT_ATT_OP_FIND_INFO_RSP 0x05
7070
struct bt_att_find_info_rsp {
7171
uint8_t format;
72-
uint8_t info[0];
72+
uint8_t info[];
7373
} __packed;
7474

7575
/* Find By Type Value Request */
@@ -78,7 +78,7 @@ struct bt_att_find_type_req {
7878
uint16_t start_handle;
7979
uint16_t end_handle;
8080
uint16_t type;
81-
uint8_t value[0];
81+
uint8_t value[];
8282
} __packed;
8383

8484
struct bt_att_handle_group {
@@ -89,27 +89,27 @@ struct bt_att_handle_group {
8989
/* Find By Type Value Response */
9090
#define BT_ATT_OP_FIND_TYPE_RSP 0x07
9191
struct bt_att_find_type_rsp {
92-
struct bt_att_handle_group list[0];
92+
struct bt_att_handle_group list[];
9393
} __packed;
9494

9595
/* Read By Type Request */
9696
#define BT_ATT_OP_READ_TYPE_REQ 0x08
9797
struct bt_att_read_type_req {
9898
uint16_t start_handle;
9999
uint16_t end_handle;
100-
uint8_t uuid[0];
100+
uint8_t uuid[];
101101
} __packed;
102102

103103
struct bt_att_data {
104104
uint16_t handle;
105-
uint8_t value[0];
105+
uint8_t value[];
106106
} __packed;
107107

108108
/* Read By Type Response */
109109
#define BT_ATT_OP_READ_TYPE_RSP 0x09
110110
struct bt_att_read_type_rsp {
111111
uint8_t len;
112-
struct bt_att_data data[0];
112+
struct bt_att_data data[];
113113
} __packed;
114114

115115
/* Read Request */
@@ -121,7 +121,7 @@ struct bt_att_read_req {
121121
/* Read Response */
122122
#define BT_ATT_OP_READ_RSP 0x0b
123123
struct bt_att_read_rsp {
124-
uint8_t value[0];
124+
uint8_t value[];
125125
} __packed;
126126

127127
/* Read Blob Request */
@@ -134,49 +134,49 @@ struct bt_att_read_blob_req {
134134
/* Read Blob Response */
135135
#define BT_ATT_OP_READ_BLOB_RSP 0x0d
136136
struct bt_att_read_blob_rsp {
137-
uint8_t value[0];
137+
uint8_t value[];
138138
} __packed;
139139

140140
/* Read Multiple Request */
141141
#define BT_ATT_READ_MULT_MIN_LEN_REQ 0x04
142142

143143
#define BT_ATT_OP_READ_MULT_REQ 0x0e
144144
struct bt_att_read_mult_req {
145-
uint16_t handles[0];
145+
uint16_t handles[];
146146
} __packed;
147147

148148
/* Read Multiple Respose */
149149
#define BT_ATT_OP_READ_MULT_RSP 0x0f
150150
struct bt_att_read_mult_rsp {
151-
uint8_t value[0];
151+
uint8_t value[];
152152
} __packed;
153153

154154
/* Read by Group Type Request */
155155
#define BT_ATT_OP_READ_GROUP_REQ 0x10
156156
struct bt_att_read_group_req {
157157
uint16_t start_handle;
158158
uint16_t end_handle;
159-
uint8_t uuid[0];
159+
uint8_t uuid[];
160160
} __packed;
161161

162162
struct bt_att_group_data {
163163
uint16_t start_handle;
164164
uint16_t end_handle;
165-
uint8_t value[0];
165+
uint8_t value[];
166166
} __packed;
167167

168168
/* Read by Group Type Response */
169169
#define BT_ATT_OP_READ_GROUP_RSP 0x11
170170
struct bt_att_read_group_rsp {
171171
uint8_t len;
172-
struct bt_att_group_data data[0];
172+
struct bt_att_group_data data[];
173173
} __packed;
174174

175175
/* Write Request */
176176
#define BT_ATT_OP_WRITE_REQ 0x12
177177
struct bt_att_write_req {
178178
uint16_t handle;
179-
uint8_t value[0];
179+
uint8_t value[];
180180
} __packed;
181181

182182
/* Write Response */
@@ -187,15 +187,15 @@ struct bt_att_write_req {
187187
struct bt_att_prepare_write_req {
188188
uint16_t handle;
189189
uint16_t offset;
190-
uint8_t value[0];
190+
uint8_t value[];
191191
} __packed;
192192

193193
/* Prepare Write Respond */
194194
#define BT_ATT_OP_PREPARE_WRITE_RSP 0x17
195195
struct bt_att_prepare_write_rsp {
196196
uint16_t handle;
197197
uint16_t offset;
198-
uint8_t value[0];
198+
uint8_t value[];
199199
} __packed;
200200

201201
/* Execute Write Request */
@@ -214,14 +214,14 @@ struct bt_att_exec_write_req {
214214
#define BT_ATT_OP_NOTIFY 0x1b
215215
struct bt_att_notify {
216216
uint16_t handle;
217-
uint8_t value[0];
217+
uint8_t value[];
218218
} __packed;
219219

220220
/* Handle Value Indication */
221221
#define BT_ATT_OP_INDICATE 0x1d
222222
struct bt_att_indicate {
223223
uint16_t handle;
224-
uint8_t value[0];
224+
uint8_t value[];
225225
} __packed;
226226

227227
/* Handle Value Confirm */
@@ -233,34 +233,34 @@ struct bt_att_signature {
233233

234234
#define BT_ATT_OP_READ_MULT_VL_REQ 0x20
235235
struct bt_att_read_mult_vl_req {
236-
uint16_t handles[0];
236+
uint16_t handles[];
237237
} __packed;
238238

239239
/* Read Multiple Respose */
240240
#define BT_ATT_OP_READ_MULT_VL_RSP 0x21
241241
struct bt_att_read_mult_vl_rsp {
242242
uint16_t len;
243-
uint8_t value[0];
243+
uint8_t value[];
244244
} __packed;
245245

246246
/* Handle Multiple Value Notification */
247247
#define BT_ATT_OP_NOTIFY_MULT 0x23
248248
struct bt_att_notify_mult {
249249
uint16_t handle;
250250
uint16_t len;
251-
uint8_t value[0];
251+
uint8_t value[];
252252
} __packed;
253253

254254
/* Write Command */
255255
#define BT_ATT_OP_WRITE_CMD 0x52
256256
struct bt_att_write_cmd {
257257
uint16_t handle;
258-
uint8_t value[0];
258+
uint8_t value[];
259259
} __packed;
260260

261261
/* Signed Write Command */
262262
#define BT_ATT_OP_SIGNED_WRITE_CMD 0xd2
263263
struct bt_att_signed_write_cmd {
264264
uint16_t handle;
265-
uint8_t value[0];
265+
uint8_t value[];
266266
} __packed;

devices/ble_hci/common-hal/_bleio/hci_include/hci.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ struct bt_hci_handle_count {
454454
#define BT_HCI_OP_HOST_NUM_COMPLETED_PACKETS BT_OP(BT_OGF_BASEBAND, 0x0035)
455455
struct bt_hci_cp_host_num_completed_packets {
456456
uint8_t num_handles;
457-
struct bt_hci_handle_count h[0];
457+
struct bt_hci_handle_count h[];
458458
} __packed;
459459

460460
#define BT_HCI_OP_WRITE_INQUIRY_MODE BT_OP(BT_OGF_BASEBAND, 0x0045)
@@ -1099,7 +1099,7 @@ struct bt_hci_ext_adv_set {
10991099
struct bt_hci_cp_le_set_ext_adv_enable {
11001100
uint8_t enable;
11011101
uint8_t set_num;
1102-
struct bt_hci_ext_adv_set s[0];
1102+
struct bt_hci_ext_adv_set s[];
11031103
} __packed;
11041104

11051105
#define BT_HCI_OP_LE_READ_MAX_ADV_DATA_LEN BT_OP(BT_OGF_LE, 0x003a)
@@ -1158,7 +1158,7 @@ struct bt_hci_cp_le_set_ext_scan_param {
11581158
uint8_t own_addr_type;
11591159
uint8_t filter_policy;
11601160
uint8_t phys;
1161-
struct bt_hci_ext_scan_phy p[0];
1161+
struct bt_hci_ext_scan_phy p[];
11621162
} __packed;
11631163

11641164
/* Extends BT_HCI_LE_SCAN_FILTER_DUP */
@@ -1189,7 +1189,7 @@ struct bt_hci_cp_le_ext_create_conn {
11891189
uint8_t own_addr_type;
11901190
bt_addr_le_t peer_addr;
11911191
uint8_t phys;
1192-
struct bt_hci_ext_conn_phy p[0];
1192+
struct bt_hci_ext_conn_phy p[];
11931193
} __packed;
11941194

11951195
#define BT_HCI_OP_LE_PER_ADV_CREATE_SYNC BT_OP(BT_OGF_LE, 0x0044)
@@ -1354,7 +1354,7 @@ struct bt_hci_evt_role_change {
13541354
#define BT_HCI_EVT_NUM_COMPLETED_PACKETS 0x13
13551355
struct bt_hci_evt_num_completed_packets {
13561356
uint8_t num_handles;
1357-
struct bt_hci_handle_count h[0];
1357+
struct bt_hci_handle_count h[];
13581358
} __packed;
13591359

13601360
#define BT_HCI_EVT_PIN_CODE_REQ 0x16
@@ -1510,11 +1510,11 @@ struct bt_hci_evt_le_advertising_info {
15101510
uint8_t evt_type;
15111511
bt_addr_le_t addr;
15121512
uint8_t length;
1513-
uint8_t data[0];
1513+
uint8_t data[];
15141514
} __packed;
15151515
struct bt_hci_evt_le_advertising_report {
15161516
uint8_t num_reports;
1517-
struct bt_hci_evt_le_advertising_info adv_info[0];
1517+
struct bt_hci_evt_le_advertising_info adv_info[];
15181518
} __packed;
15191519

15201520
#define BT_HCI_EVT_LE_CONN_UPDATE_COMPLETE 0x03
@@ -1593,7 +1593,7 @@ struct bt_hci_evt_le_direct_adv_info {
15931593
} __packed;
15941594
struct bt_hci_evt_le_direct_adv_report {
15951595
uint8_t num_reports;
1596-
struct bt_hci_evt_le_direct_adv_info direct_adv_info[0];
1596+
struct bt_hci_evt_le_direct_adv_info direct_adv_info[];
15971597
} __packed;
15981598

15991599
#define BT_HCI_EVT_LE_PHY_UPDATE_COMPLETE 0x0c
@@ -1628,11 +1628,11 @@ struct bt_hci_evt_le_ext_advertising_info {
16281628
uint16_t interval;
16291629
bt_addr_le_t direct_addr;
16301630
uint8_t length;
1631-
uint8_t data[0];
1631+
uint8_t data[];
16321632
} __packed;
16331633
struct bt_hci_evt_le_ext_advertising_report {
16341634
uint8_t num_reports;
1635-
struct bt_hci_evt_le_ext_advertising_info adv_info[0];
1635+
struct bt_hci_evt_le_ext_advertising_info adv_info[];
16361636
} __packed;
16371637

16381638
#define BT_HCI_EVT_LE_PER_ADV_SYNC_ESTABLISHED 0x0e
@@ -1654,7 +1654,7 @@ struct bt_hci_evt_le_per_advertising_report {
16541654
uint8_t unused;
16551655
uint8_t data_status;
16561656
uint8_t length;
1657-
uint8_t data[0];
1657+
uint8_t data[];
16581658
} __packed;
16591659

16601660
#define BT_HCI_EVT_LE_PER_ADV_SYNC_LOST 0x10

devices/ble_hci/common-hal/_bleio/hci_include/hci_vs.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ struct bt_hci_cp_vs_set_trace_enable {
104104
#define BT_HCI_OP_VS_READ_BUILD_INFO BT_OP(BT_OGF_VS, 0x0008)
105105
struct bt_hci_rp_vs_read_build_info {
106106
uint8_t status;
107-
uint8_t info[0];
107+
uint8_t info[];
108108
} __packed;
109109

110110
struct bt_hci_vs_static_addr {
@@ -116,7 +116,7 @@ struct bt_hci_vs_static_addr {
116116
struct bt_hci_rp_vs_read_static_addrs {
117117
uint8_t status;
118118
uint8_t num_addrs;
119-
struct bt_hci_vs_static_addr a[0];
119+
struct bt_hci_vs_static_addr a[];
120120
} __packed;
121121

122122
#define BT_HCI_OP_VS_READ_KEY_HIERARCHY_ROOTS BT_OP(BT_OGF_VS, 0x000a)
@@ -143,7 +143,7 @@ struct bt_hci_vs_cmd {
143143
struct bt_hci_rp_vs_read_host_stack_cmds {
144144
uint8_t status;
145145
uint8_t num_cmds;
146-
struct bt_hci_vs_cmd c[0];
146+
struct bt_hci_vs_cmd c[];
147147
} __packed;
148148

149149
#define BT_HCI_VS_SCAN_REQ_REPORTS_DISABLED 0x00
@@ -189,7 +189,7 @@ struct bt_hci_rp_vs_read_tx_power_level {
189189
struct bt_hci_rp_vs_read_usb_transport_mode {
190190
uint8_t status;
191191
uint8_t num_supported_modes;
192-
uint8_t supported_mode[0];
192+
uint8_t supported_mode[];
193193
} __packed;
194194

195195
#define BT_HCI_VS_USB_H2_MODE 0x00
@@ -210,7 +210,7 @@ struct bt_hci_evt_vs {
210210
#define BT_HCI_EVT_VS_FATAL_ERROR 0x02
211211
struct bt_hci_evt_vs_fatal_error {
212212
uint64_t pc;
213-
uint8_t err_info[0];
213+
uint8_t err_info[];
214214
} __packed;
215215

216216
#define BT_HCI_VS_TRACE_LMP_TX 0x01
@@ -221,7 +221,7 @@ struct bt_hci_evt_vs_fatal_error {
221221
#define BT_HCI_EVT_VS_TRACE_INFO 0x03
222222
struct bt_hci_evt_vs_trace_info {
223223
uint8_t type;
224-
uint8_t data[0];
224+
uint8_t data[];
225225
} __packed;
226226

227227
#define BT_HCI_EVT_VS_SCAN_REQ_RX 0x04
@@ -267,14 +267,14 @@ struct bt_hci_rp_mesh_get_opts {
267267
#define BT_HCI_OC_MESH_SET_SCAN_FILTER 0x01
268268
struct bt_hci_mesh_pattern {
269269
uint8_t pattern_len;
270-
uint8_t pattern[0];
270+
uint8_t pattern[];
271271
} __packed;
272272

273273
struct bt_hci_cp_mesh_set_scan_filter {
274274
uint8_t scan_filter;
275275
uint8_t filter_dup;
276276
uint8_t num_patterns;
277-
struct bt_hci_mesh_pattern patterns[0];
277+
struct bt_hci_mesh_pattern patterns[];
278278
} __packed;
279279
struct bt_hci_rp_mesh_set_scan_filter {
280280
uint8_t status;
@@ -365,11 +365,11 @@ struct bt_hci_evt_mesh_scan_report {
365365
int8_t rssi;
366366
uint32_t instant;
367367
uint8_t data_len;
368-
uint8_t data[0];
368+
uint8_t data[];
369369
} __packed;
370370
struct bt_hci_evt_mesh_scanning_report {
371371
uint8_t num_reports;
372-
struct bt_hci_evt_mesh_scan_report reports[0];
372+
struct bt_hci_evt_mesh_scan_report reports[];
373373
} __packed;
374374

375375
#ifdef __cplusplus

0 commit comments

Comments
 (0)