Skip to content

Commit 3afbb0d

Browse files
szymon-czaprackisjanc
authored andcommitted
nimble/btp: Keep sizeof parenthesis consistent
Ensure all sizeof use parenthesis for consitency.
1 parent c870b0a commit 3afbb0d

1 file changed

Lines changed: 24 additions & 32 deletions

File tree

apps/bttester/src/btp_gatt.c

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -355,14 +355,13 @@ gatt_svr_read_write_test(uint16_t conn_handle, uint16_t attr_handle,
355355
case PTS_CHR_NOTIFY:
356356
case PTS_CHR_NOTIFY_ALT:
357357
if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) {
358-
rc = gatt_svr_chr_write(conn_handle, attr_handle,
359-
ctxt->om, 0,
360-
sizeof gatt_svr_pts_static_short_val,
358+
rc = gatt_svr_chr_write(conn_handle, attr_handle, ctxt->om, 0,
359+
sizeof(gatt_svr_pts_static_short_val),
361360
&gatt_svr_pts_static_short_val, NULL);
362361
return rc;
363362
} else if (ctxt->op == BLE_GATT_ACCESS_OP_READ_CHR) {
364363
rc = os_mbuf_append(ctxt->om, &gatt_svr_pts_static_short_val,
365-
sizeof gatt_svr_pts_static_short_val);
364+
sizeof(gatt_svr_pts_static_short_val));
366365
return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES;
367366
}
368367
default:
@@ -386,14 +385,13 @@ gatt_svr_read_write_long_test(uint16_t conn_handle, uint16_t attr_handle,
386385
case PTS_LONG_CHR_READ_WRITE:
387386
case PTS_LONG_CHR_READ_WRITE_ALT:
388387
if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) {
389-
rc = gatt_svr_chr_write(conn_handle, attr_handle,
390-
ctxt->om, 0,
391-
sizeof gatt_svr_pts_static_long_val,
388+
rc = gatt_svr_chr_write(conn_handle, attr_handle, ctxt->om, 0,
389+
sizeof(gatt_svr_pts_static_long_val),
392390
&gatt_svr_pts_static_long_val, NULL);
393391
return rc;
394392
} else if (ctxt->op == BLE_GATT_ACCESS_OP_READ_CHR) {
395393
rc = os_mbuf_append(ctxt->om, &gatt_svr_pts_static_long_val,
396-
sizeof gatt_svr_pts_static_long_val);
394+
sizeof(gatt_svr_pts_static_long_val));
397395
return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES;
398396
}
399397
default:
@@ -416,14 +414,13 @@ gatt_svr_read_write_auth_test(uint16_t conn_handle, uint16_t attr_handle,
416414
switch (uuid16) {
417415
case PTS_CHR_READ_WRITE_AUTHEN:
418416
if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) {
419-
rc = gatt_svr_chr_write(conn_handle, attr_handle,
420-
ctxt->om, 0,
421-
sizeof gatt_svr_pts_static_val,
417+
rc = gatt_svr_chr_write(conn_handle, attr_handle, ctxt->om, 0,
418+
sizeof(gatt_svr_pts_static_val),
422419
&gatt_svr_pts_static_val, NULL);
423420
return rc;
424421
} else if (ctxt->op == BLE_GATT_ACCESS_OP_READ_CHR) {
425422
rc = os_mbuf_append(ctxt->om, &gatt_svr_pts_static_val,
426-
sizeof gatt_svr_pts_static_val);
423+
sizeof(gatt_svr_pts_static_val));
427424
return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES;
428425
}
429426
default:
@@ -470,12 +467,11 @@ gatt_svr_read_write_enc_test(uint16_t conn_handle, uint16_t attr_handle,
470467
case PTS_CHR_READ_WRITE_ENC:
471468
if (ctxt->op == BLE_GATT_ACCESS_OP_READ_CHR) {
472469
rc = os_mbuf_append(ctxt->om, &gatt_svr_pts_static_val,
473-
sizeof gatt_svr_pts_static_val);
470+
sizeof(gatt_svr_pts_static_val));
474471
return rc;
475472
} else if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) {
476-
rc = gatt_svr_chr_write(conn_handle, attr_handle,
477-
ctxt->om, 0,
478-
sizeof gatt_svr_pts_static_val,
473+
rc = gatt_svr_chr_write(conn_handle, attr_handle, ctxt->om, 0,
474+
sizeof(gatt_svr_pts_static_val),
479475
&gatt_svr_pts_static_val, NULL);
480476
return rc;
481477
}
@@ -499,14 +495,13 @@ gatt_svr_dsc_read_write_test(uint16_t conn_handle, uint16_t attr_handle,
499495
switch (uuid16) {
500496
case PTS_DSC_READ_WRITE:
501497
if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_DSC) {
502-
rc = gatt_svr_chr_write(conn_handle, attr_handle,
503-
ctxt->om, 0,
504-
sizeof gatt_svr_pts_static_short_val,
498+
rc = gatt_svr_chr_write(conn_handle, attr_handle, ctxt->om, 0,
499+
sizeof(gatt_svr_pts_static_short_val),
505500
&gatt_svr_pts_static_short_val, NULL);
506501
return rc;
507502
} else if (ctxt->op == BLE_GATT_ACCESS_OP_READ_DSC) {
508503
rc = os_mbuf_append(ctxt->om, &gatt_svr_pts_static_short_val,
509-
sizeof gatt_svr_pts_static_short_val);
504+
sizeof(gatt_svr_pts_static_short_val));
510505
return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES;
511506
}
512507
default:
@@ -529,14 +524,13 @@ gatt_svr_dsc_read_write_long_test(uint16_t conn_handle, uint16_t attr_handle,
529524
switch (uuid16) {
530525
case PTS_LONG_DSC_READ_WRITE:
531526
if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_DSC) {
532-
rc = gatt_svr_chr_write(conn_handle, attr_handle,
533-
ctxt->om, 0,
534-
sizeof gatt_svr_pts_static_long_val,
527+
rc = gatt_svr_chr_write(conn_handle, attr_handle, ctxt->om, 0,
528+
sizeof(gatt_svr_pts_static_long_val),
535529
&gatt_svr_pts_static_long_val, NULL);
536530
return rc;
537531
} else if (ctxt->op == BLE_GATT_ACCESS_OP_READ_DSC) {
538532
rc = os_mbuf_append(ctxt->om, &gatt_svr_pts_static_long_val,
539-
sizeof gatt_svr_pts_static_long_val);
533+
sizeof(gatt_svr_pts_static_long_val));
540534
return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES;
541535
}
542536
default:
@@ -560,7 +554,7 @@ gatt_svr_dsc_read_test(uint16_t conn_handle, uint16_t attr_handle,
560554
case PTS_DSC_READ:
561555
if (ctxt->op == BLE_GATT_ACCESS_OP_READ_DSC) {
562556
rc = os_mbuf_append(ctxt->om, &gatt_svr_pts_static_long_val,
563-
sizeof gatt_svr_pts_static_long_val);
557+
sizeof(gatt_svr_pts_static_long_val));
564558
return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES;
565559
}
566560
default:
@@ -583,14 +577,13 @@ gatt_svr_write_no_rsp_test(uint16_t conn_handle, uint16_t attr_handle,
583577
switch (uuid16) {
584578
case PTS_CHR_WRITE_NO_RSP:
585579
if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) {
586-
rc = gatt_svr_chr_write(conn_handle, attr_handle,
587-
ctxt->om, 0,
588-
sizeof gatt_svr_pts_static_short_val,
580+
rc = gatt_svr_chr_write(conn_handle, attr_handle, ctxt->om, 0,
581+
sizeof(gatt_svr_pts_static_short_val),
589582
&gatt_svr_pts_static_short_val, NULL);
590583
return rc;
591584
} else if (ctxt->op == BLE_GATT_ACCESS_OP_READ_CHR) {
592585
rc = os_mbuf_append(ctxt->om, &gatt_svr_pts_static_short_val,
593-
sizeof gatt_svr_pts_static_short_val);
586+
sizeof(gatt_svr_pts_static_short_val));
594587
return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES;
595588
}
596589
default:
@@ -613,9 +606,8 @@ gatt_svr_rel_write_test(uint16_t conn_handle, uint16_t attr_handle,
613606
switch (uuid16) {
614607
case PTS_CHR_RELIABLE_WRITE:
615608
if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) {
616-
rc = gatt_svr_chr_write(conn_handle, attr_handle,
617-
ctxt->om, 0,
618-
sizeof gatt_svr_pts_static_val,
609+
rc = gatt_svr_chr_write(conn_handle, attr_handle, ctxt->om, 0,
610+
sizeof(gatt_svr_pts_static_val),
619611
&gatt_svr_pts_static_val, NULL);
620612
return rc;
621613
}

0 commit comments

Comments
 (0)