Ignore:
Timestamp:
2018-01-13T03:10:29Z (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:
a53ed3a
Parents:
36f0738
Message:

Use errno_t in all uspace and kernel code.

Change type of every variable, parameter and return value that holds an
<errno.h> constant to either errno_t (the usual case), or sys_errno_t
(some places in kernel). This is for the purpose of self-documentation,
as well as for type-checking with a bit of type definition hackery.

Although this is a massive commit, it is a simple text replacement, and thus
is very easy to verify. Simply do the following:

`
git checkout <this commit's hash>
git reset HEAD
git add .
tools/srepl '\berrno_t\b' int
git add .
tools/srepl '\bsys_errno_t\b' sysarg_t
git reset
git diff
`

While this doesn't ensure that the replacements are correct, it does ensure
that the commit doesn't do anything except those replacements. Since errno_t
is typedef'd to int in the usual case (and sys_errno_t to sysarg_t), even if
incorrect, this commit cannot change behavior.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/include/audio_pcm_iface.h

    r36f0738 rb7fd2a0  
    8080void audio_pcm_close(audio_pcm_sess_t *);
    8181
    82 int audio_pcm_get_info_str(audio_pcm_sess_t *, const char **);
    83 int audio_pcm_test_format(audio_pcm_sess_t *, unsigned *, unsigned *,
     82errno_t audio_pcm_get_info_str(audio_pcm_sess_t *, const char **);
     83errno_t audio_pcm_test_format(audio_pcm_sess_t *, unsigned *, unsigned *,
    8484    pcm_sample_format_t *);
    85 int audio_pcm_query_cap(audio_pcm_sess_t *, audio_cap_t, sysarg_t *);
    86 int audio_pcm_register_event_callback(audio_pcm_sess_t *,
     85errno_t audio_pcm_query_cap(audio_pcm_sess_t *, audio_cap_t, sysarg_t *);
     86errno_t audio_pcm_register_event_callback(audio_pcm_sess_t *,
    8787    async_port_handler_t, void *);
    88 int audio_pcm_unregister_event_callback(audio_pcm_sess_t *);
     88errno_t audio_pcm_unregister_event_callback(audio_pcm_sess_t *);
    8989
    90 int audio_pcm_get_buffer(audio_pcm_sess_t *, void **, size_t *);
    91 int audio_pcm_get_buffer_pos(audio_pcm_sess_t *, size_t *);
    92 int audio_pcm_release_buffer(audio_pcm_sess_t *);
     90errno_t audio_pcm_get_buffer(audio_pcm_sess_t *, void **, size_t *);
     91errno_t audio_pcm_get_buffer_pos(audio_pcm_sess_t *, size_t *);
     92errno_t audio_pcm_release_buffer(audio_pcm_sess_t *);
    9393
    94 int audio_pcm_start_playback_fragment(audio_pcm_sess_t *, unsigned,
     94errno_t audio_pcm_start_playback_fragment(audio_pcm_sess_t *, unsigned,
    9595    unsigned, unsigned, pcm_sample_format_t);
    96 int audio_pcm_last_playback_fragment(audio_pcm_sess_t *);
     96errno_t audio_pcm_last_playback_fragment(audio_pcm_sess_t *);
    9797
    98 int audio_pcm_start_playback(audio_pcm_sess_t *,
     98errno_t audio_pcm_start_playback(audio_pcm_sess_t *,
    9999    unsigned, unsigned, pcm_sample_format_t);
    100 int audio_pcm_stop_playback_immediate(audio_pcm_sess_t *);
    101 int audio_pcm_stop_playback(audio_pcm_sess_t *);
     100errno_t audio_pcm_stop_playback_immediate(audio_pcm_sess_t *);
     101errno_t audio_pcm_stop_playback(audio_pcm_sess_t *);
    102102
    103 int audio_pcm_start_capture_fragment(audio_pcm_sess_t *, unsigned,
     103errno_t audio_pcm_start_capture_fragment(audio_pcm_sess_t *, unsigned,
    104104    unsigned, unsigned, pcm_sample_format_t);
    105 int audio_pcm_last_capture_fragment(audio_pcm_sess_t *);
     105errno_t audio_pcm_last_capture_fragment(audio_pcm_sess_t *);
    106106
    107 int audio_pcm_start_capture(audio_pcm_sess_t *,
     107errno_t audio_pcm_start_capture(audio_pcm_sess_t *,
    108108    unsigned, unsigned, pcm_sample_format_t);
    109 int audio_pcm_stop_capture_immediate(audio_pcm_sess_t *);
    110 int audio_pcm_stop_capture(audio_pcm_sess_t *);
     109errno_t audio_pcm_stop_capture_immediate(audio_pcm_sess_t *);
     110errno_t audio_pcm_stop_capture(audio_pcm_sess_t *);
    111111
    112112/** Audio pcm communication interface. */
    113113typedef struct {
    114         int (*get_info_str)(ddf_fun_t *, const char **);
    115         int (*test_format)(ddf_fun_t *, unsigned *, unsigned *,
     114        errno_t (*get_info_str)(ddf_fun_t *, const char **);
     115        errno_t (*test_format)(ddf_fun_t *, unsigned *, unsigned *,
    116116            pcm_sample_format_t *);
    117117        unsigned (*query_cap)(ddf_fun_t *, audio_cap_t);
    118         int (*get_buffer_pos)(ddf_fun_t *, size_t *);
    119         int (*get_buffer)(ddf_fun_t *, void **, size_t *);
    120         int (*release_buffer)(ddf_fun_t *);
    121         int (*set_event_session)(ddf_fun_t *, async_sess_t *);
     118        errno_t (*get_buffer_pos)(ddf_fun_t *, size_t *);
     119        errno_t (*get_buffer)(ddf_fun_t *, void **, size_t *);
     120        errno_t (*release_buffer)(ddf_fun_t *);
     121        errno_t (*set_event_session)(ddf_fun_t *, async_sess_t *);
    122122        async_sess_t * (*get_event_session)(ddf_fun_t *);
    123         int (*start_playback)(ddf_fun_t *, unsigned,
     123        errno_t (*start_playback)(ddf_fun_t *, unsigned,
    124124            unsigned, unsigned, pcm_sample_format_t);
    125         int (*stop_playback)(ddf_fun_t *, bool);
    126         int (*start_capture)(ddf_fun_t *, unsigned,
     125        errno_t (*stop_playback)(ddf_fun_t *, bool);
     126        errno_t (*start_capture)(ddf_fun_t *, unsigned,
    127127            unsigned, unsigned, pcm_sample_format_t);
    128         int (*stop_capture)(ddf_fun_t *, bool);
     128        errno_t (*stop_capture)(ddf_fun_t *, bool);
    129129} audio_pcm_iface_t;
    130130
Note: See TracChangeset for help on using the changeset viewer.