[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 5/5] usb-mtp: Advertise SendObjectInfo for wr
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH v2 5/5] usb-mtp: Advertise SendObjectInfo for write support |
Date: |
Tue, 13 Feb 2018 13:20:17 +0100 |
User-agent: |
NeoMutt/20171215 |
> +/*
> + * ObjectInfo dataset received from initiator
> + * Fields we don't care about are ignored
> + */
> +typedef struct {
> + char __pad1[4];
So, is this really padding or a field we don't care about?
If the latter I'd suggest to give them proper names nevertheless,
maybe append /* unused */.
> +static void utf16_to_str(uint8_t len, uint16_t *arr, char *name)
> +{
> + int count;
> +
> + for (count = 0; count < len; count++) {
> + /* Check for valid ascii */
> + assert(!(arr[count] & 0xFF80));
> + name[count] = arr[count];
> + }
> +}
This should do the reverse of usb_mtp_add_str, i.e. first copy uint16_t
array to wchar_t array, then use wcstombs to translate it into a
(multi-)byte string of the current locale.
cheers,
Gerd
- [Qemu-devel] [PATCH v2 0/5] Initial write support for MTP object, Bandan Das, 2018/02/12
- [Qemu-devel] [PATCH v2 2/5] usb-mtp: print parent path in IN_IGNORED trace fn, Bandan Das, 2018/02/12
- [Qemu-devel] [PATCH v2 5/5] usb-mtp: Advertise SendObjectInfo for write support, Bandan Das, 2018/02/12
- Re: [Qemu-devel] [PATCH v2 5/5] usb-mtp: Advertise SendObjectInfo for write support,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH v2 3/5] usb-mtp: Support delete of mtp objects, Bandan Das, 2018/02/12
- [Qemu-devel] [PATCH v2 1/5] usb-mtp: Add one more argument when building results, Bandan Das, 2018/02/12
- [Qemu-devel] [PATCH v2 4/5] usb-mtp: Introduce write support for MTP objects, Bandan Das, 2018/02/12