Changeset 33b8d024 in mainline for uspace/srv/audio/hound/audio_data.h


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/audio/hound/audio_data.h

    rd39c46e0 r33b8d024  
    4545/** Reference counted audio buffer */
    4646typedef struct {
    47         /** Audio data */
    48         const void *data;
    4947        /** Size of the buffer pointer to by data */
    5048        size_t size;
     
    5351        /** Reference counter */
    5452        atomic_t refcount;
     53        /** Audio data */
     54        const uint8_t data[];
    5555} audio_data_t;
    5656
Note: See TracChangeset for help on using the changeset viewer.