Changeset 33b8d024 in mainline for uspace/lib/usbdev/include/usb


Ignore:
Timestamp:
2018-01-16T20:38:46Z (8 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2467b41
Parents:
d39c46e0
Message:

Remove const qualifier from the argument of free() and realloc(),
as well as in numerous other variables that hold ownership of memory.

By convention, a pointer that holds ownership is _never_ qualified by const.
This is reflected in the standard type signature of free() and realloc().
Allowing const pointers to hold ownership may seem superficially convenient,
but is actually quite confusing to experienced C programmers.

Location:
uspace/lib/usbdev/include/usb/dev
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/include/usb/dev/alternate_ifaces.h

    rd39c46e0 r33b8d024  
    5959typedef struct {
    6060        /** Array of alternate interfaces descriptions. */
    61         const usb_alternate_interface_descriptors_t *alternatives;
     61        usb_alternate_interface_descriptors_t *alternatives;
    6262        /** Size of @c alternatives array. */
    6363        size_t alternative_count;
  • uspace/lib/usbdev/include/usb/dev/device.h

    rd39c46e0 r33b8d024  
    5151        usb_standard_device_descriptor_t device;
    5252        /** Full configuration descriptor of current configuration. */
    53         const void *full_config;
     53        void *full_config;
    5454        size_t full_config_size;
    5555} usb_device_descriptors_t;
  • uspace/lib/usbdev/include/usb/dev/request.h

    rd39c46e0 r33b8d024  
    7070    void *, size_t, size_t *);
    7171errno_t usb_request_get_full_configuration_descriptor_alloc(usb_pipe_t *,
    72     int, const void **, size_t *);
     72    int, void **, size_t *);
    7373errno_t usb_request_set_descriptor(usb_pipe_t *, usb_request_type_t,
    7474    usb_request_recipient_t, uint8_t, uint8_t, uint16_t, const void *, size_t);
Note: See TracChangeset for help on using the changeset viewer.