Changeset b7fd2a0 in mainline for uspace/drv/audio/sb16/dsp.h


Ignore:
Timestamp:
2018-01-13T03:10:29Z (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:
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/drv/audio/sb16/dsp.h

    r36f0738 rb7fd2a0  
    7676} sb_dsp_t;
    7777
    78 int sb_dsp_init(sb_dsp_t *dsp, sb16_regs_t *regs, ddf_dev_t *dev,
     78errno_t sb_dsp_init(sb_dsp_t *dsp, sb16_regs_t *regs, ddf_dev_t *dev,
    7979    int dma8, int dma16);
    8080void sb_dsp_interrupt(sb_dsp_t *dsp);
    8181unsigned sb_dsp_query_cap(sb_dsp_t *dsp, audio_cap_t cap);
    82 int sb_dsp_get_buffer_position(sb_dsp_t *dsp, size_t *size);
    83 int sb_dsp_test_format(sb_dsp_t *dsp, unsigned *channels, unsigned *rate,
     82errno_t sb_dsp_get_buffer_position(sb_dsp_t *dsp, size_t *size);
     83errno_t sb_dsp_test_format(sb_dsp_t *dsp, unsigned *channels, unsigned *rate,
    8484  pcm_sample_format_t *format);
    85 int sb_dsp_get_buffer(sb_dsp_t *dsp, void **buffer, size_t *size);
    86 int sb_dsp_set_event_session(sb_dsp_t *dsp, async_sess_t *session);
     85errno_t sb_dsp_get_buffer(sb_dsp_t *dsp, void **buffer, size_t *size);
     86errno_t sb_dsp_set_event_session(sb_dsp_t *dsp, async_sess_t *session);
    8787async_sess_t * sb_dsp_get_event_session(sb_dsp_t *dsp);
    88 int sb_dsp_release_buffer(sb_dsp_t *dsp);
    89 int sb_dsp_start_playback(sb_dsp_t *dsp, unsigned frames,
     88errno_t sb_dsp_release_buffer(sb_dsp_t *dsp);
     89errno_t sb_dsp_start_playback(sb_dsp_t *dsp, unsigned frames,
    9090    unsigned channels, unsigned sample_rate, pcm_sample_format_t format);
    91 int sb_dsp_stop_playback(sb_dsp_t *dsp, bool immediate);
    92 int sb_dsp_start_capture(sb_dsp_t *dsp, unsigned frames,
     91errno_t sb_dsp_stop_playback(sb_dsp_t *dsp, bool immediate);
     92errno_t sb_dsp_start_capture(sb_dsp_t *dsp, unsigned frames,
    9393    unsigned channels, unsigned sample_rate, pcm_sample_format_t format);
    94 int sb_dsp_stop_capture(sb_dsp_t *dsp, bool immediate);
     94errno_t sb_dsp_stop_capture(sb_dsp_t *dsp, bool immediate);
    9595
    9696#endif
Note: See TracChangeset for help on using the changeset viewer.