Re: [RFC v2 02/14] Use host byte order when converting UUID16/32 to UUID128

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Claudio,

On Fri, Feb 18, 2011 at 7:29 PM, Claudio Takahasi
<claudio.takahasi@xxxxxxxxxxxxx> wrote:
> @@ -2646,11 +2647,16 @@ void sdp_uuid16_to_uuid128(uuid_t *uuid128, const uuid_t *uuid16)
>        data1 += htons(uuid16->value.uuid16);
>
>        /* set bytes 2 and 3 of the 128 bit value */
> -       memcpy(&uuid128->value.uuid128.data[2], &data1, 2);
> +       memcpy(&n128.data[2], &data1, 2);
> +
> +       uuid128->type = SDP_UUID128;
> +       ntoh128(&n128, &uuid128->value.uuid128);
>  }

For consistency with patch 4/14, what about declaring a "uint128_t
h128" and using:

ntoh128(&n128, &h128);
sdp_uuid128_create(uuid128, &h128);

> @@ -2668,7 +2673,10 @@ void sdp_uuid32_to_uuid128(uuid_t *uuid128, const uuid_t *uuid32)
>        data0 += htonl(uuid32->value.uuid32);
>
>        /* set the 4 bytes of the 128 bit value */
> -       memcpy(&uuid128->value.uuid128.data[0], &data0, 4);
> +       memcpy(&n128.data[0], &data0, 4);
> +
> +       uuid128->type = SDP_UUID128;
> +       ntoh128(&n128, &uuid128->value.uuid128);
>  }

Same here. Note this is just a suggestion for better readability, the
behavior is unchanged compared to your current patch.

Regards,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux