Changeset 33b8d024 in mainline for uspace/lib/hound/src/client.c


Ignore:
Timestamp:
2018-01-16T20:38:46Z (7 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/lib/hound/src/client.c

    rd39c46e0 r33b8d024  
    7676        hound_sess_t *session;
    7777        /** context name, reported to the daemon */
    78         const char *name;
     78        char *name;
    7979        /** True if the instance is record context */
    8080        bool record;
     
    196196 */
    197197errno_t hound_context_get_available_targets(hound_context_t *hound,
    198     const char ***names, size_t *count)
     198    char ***names, size_t *count)
    199199{
    200200        assert(hound);
     
    213213 */
    214214errno_t hound_context_get_connected_targets(hound_context_t *hound,
    215     const char ***names, size_t *count)
     215    char ***names, size_t *count)
    216216{
    217217        assert(hound);
     
    237237        assert(target);
    238238
    239         const char **tgt = NULL;
     239        char **tgt = NULL;
    240240        size_t count = 1;
    241241        errno_t ret = EOK;
Note: See TracChangeset for help on using the changeset viewer.