Changeset 33b8d024 in mainline for uspace/lib/usbdev/src


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/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/src/devpoll.c

    rd39c46e0 r33b8d024  
    8080{
    8181        assert(arg);
    82         const polling_data_t *data = arg;
     82        polling_data_t *data = arg;
    8383        /* Helper to reduce typing. */
    8484        const usb_device_auto_polling_t *params = &data->auto_polling;
  • uspace/lib/usbdev/src/recognise.c

    rd39c46e0 r33b8d024  
    6161 */
    6262static errno_t usb_add_match_id(match_id_list_t *matches, int score,
    63     const char *match_str)
     63    char *match_str)
    6464{
    6565        assert(matches);
  • uspace/lib/usbdev/src/request.c

    rd39c46e0 r33b8d024  
    475475errno_t usb_request_get_full_configuration_descriptor_alloc(
    476476    usb_pipe_t *pipe, int index,
    477     const void **descriptor_ptr, size_t *descriptor_size)
     477    void **descriptor_ptr, size_t *descriptor_size)
    478478{
    479479        errno_t rc;
Note: See TracChangeset for help on using the changeset viewer.