Skip to contentSkip to conversation

header change affects c++ projects

DISCUSSION Michael Cronenworth 2 participants 6 messages Mar 29, 2015 – Mar 30, 2015 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hello,

The move of "bswap_128()" in commit 232015aeefd1c945ccfaf9744e791c5888eafcf7 breaks C++ projects. Specifically: The bswap_128() function is, without a cast, assigning a void* to a uint8_t*.

Can someone please review this commit? The message claims it is a "fix" but all I see is code copy and pasted along with a precision loss from uint128_t to uint8_t.

Thank you,
Michael

#1 lore raw

Hi Michael,

Quoted 5 lines · Michael Cronenworth

Hello,

The move of "bswap_128()" in commit 232015aeefd1c945ccfaf9744e791c5888eafcf7 breaks C++ projects. Specifically: The bswap_128() function is, without a cast, assigning a void* to a uint8_t*.

It will probably get applied, no reason to get neurotic on the weekend no one said we would not take it, so please be patience.

Quoted 3 lines

Can someone please review this commit? The message claims it is a "fix" but all I see is code copy and pasted along with a precision loss from uint128_t to uint8_t.

It is a fix to uuid: Add bt_uuid_to_le since the convention is to define 128 bit UUIDs as big endian which then need to be swaped regardless of endianess.

Signature · 1 line
Luiz Augusto von Dentz
#2 lore raw
Quoted 2 lines · Luiz Augusto von Dentz

It will probably get applied, no reason to get neurotic on the weekend no one said we would not take it, so please be patience.

I'm not following you here. What are you trying to say?

Quoted 1 line

It is a fix to uuid: Add bt_uuid_to_le since the convention is to define 128 bit UUIDs as big endian which then need to be swaped regardless of endianess.

The commit doesn't change anything though. Please revert it or fix it to not have a conversion or precision loss. If you need help I will make a patch.

Thanks,
Michael

#3 lore raw

Hi Michael,

Quoted 7 lines · Michael Cronenworth
Quoted 3 lines · Luiz Augusto von Dentz

It will probably get applied, no reason to get neurotic on the weekend no one said we would not take it, so please be patience.

I'm not following you here. What are you trying to say?

I though you were the same guy sending the patch, nevermind we have a fix already.

Quoted 7 lines
Quoted 3 lines

It is a fix to uuid: Add bt_uuid_to_le since the convention is to define 128 bit UUIDs as big endian which then need to be swaped regardless of endianess.

The commit doesn't change anything though. Please revert it or fix it to not have a conversion or precision loss. If you need help I will make a patch.

uint128_t is a byte array:

typedef struct {
uint8_t data[16];
} uint128_t;

There is no precision loss.

Signature · 1 line
Luiz Augusto von Dentz
#4 lore raw
Quoted 7 lines · Luiz Augusto von Dentz

uint128_t is a byte array:

typedef struct {
uint8_t data[16];
} uint128_t;

There is no precision loss.

Thanks, I did not see the definition.

However, the conversion of void* *must* be fixed. This is the key issue.

#5 lore raw
Quoted 2 lines · Michael Cronenworth

However, the conversion of void* *must* be fixed. This is the key issue.

I see you committed a fix this morning, thanks.