Skip to content

Commit 2badd47

Browse files
committed
Make code C23 compliant
The `--std=gnu23` flag is not added because it breaks the GitHub workflow as it is based on `ubuntu-latest` (ubuntu-24.04 at the moment) and gcc 13 does not support it yet.
1 parent 7e7c766 commit 2badd47

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/tests.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ static const struct ow_device_desc TESTDEV_DESC_SIZE = {
6666
};
6767

6868
static void
69-
ow_engine_print_blocks (struct ow_engine *engine, char *blks, size_t blk_len)
69+
ow_engine_print_blocks (struct ow_engine *engine, uint8_t *blks, size_t blk_len)
7070
{
7171
int32_t v;
72-
unsigned char *s;
72+
uint8_t *s;
7373
struct ow_engine_usb_blk *blk;
7474

7575
for (int i = 0; i < engine->blocks_per_transfer; i++)
@@ -78,7 +78,7 @@ ow_engine_print_blocks (struct ow_engine *engine, char *blks, size_t blk_len)
7878
printf ("Block %d\n", i);
7979
printf ("0x%04x | 0x%04x\n", be16toh (blk->header),
8080
be16toh (blk->frames));
81-
s = (unsigned char *) blk->data;
81+
s = (uint8_t *) blk->data;
8282
for (int j = 0; j < OB_FRAMES_PER_BLOCK; j++)
8383
{
8484
if (engine->device->desc.type == OW_DEVICE_TYPE_2)
@@ -96,15 +96,15 @@ ow_engine_print_blocks (struct ow_engine *engine, char *blks, size_t blk_len)
9696
engine->device->desc.output_tracks;
9797
for (int k = 0; k < engine->device->desc.outputs; k++)
9898
{
99-
unsigned char *dst;
99+
uint8_t *dst;
100100
if (track->size == 4)
101101
{
102-
dst = (unsigned char *) &v;
102+
dst = (uint8_t *) &v;
103103
memcpy (dst, s, track->size);
104104
}
105105
else
106106
{
107-
dst = &((unsigned char *) &v)[1];
107+
dst = &((uint8_t *) &v)[1];
108108
memcpy (dst, s, track->size);
109109
}
110110
v = be32toh (v);
@@ -375,7 +375,7 @@ test_state_parser ()
375375
int
376376
main (int argc, char *argv[])
377377
{
378-
int err;
378+
int err = 0;
379379

380380
debug_level = 2;
381381

0 commit comments

Comments
 (0)