Changeset b7fd2a0 in mainline for uspace/lib/pcm


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.

Location:
uspace/lib/pcm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/pcm/include/pcm/format.h

    r36f0738 rb7fd2a0  
    9999}
    100100void pcm_format_silence(void *dst, size_t size, const pcm_format_t *f);
    101 int pcm_format_convert_and_mix(void *dst, size_t dst_size, const void *src,
     101errno_t pcm_format_convert_and_mix(void *dst, size_t dst_size, const void *src,
    102102    size_t src_size, const pcm_format_t *sf, const pcm_format_t *df);
    103 int pcm_format_mix(void *dst, const void *src, size_t size, const pcm_format_t *f);
    104 int pcm_format_convert(pcm_format_t a, void* srca, size_t sizea,
     103errno_t pcm_format_mix(void *dst, const void *src, size_t size, const pcm_format_t *f);
     104errno_t pcm_format_convert(pcm_format_t a, void* srca, size_t sizea,
    105105    pcm_format_t b, void* srcb, size_t *sizeb);
    106106
  • uspace/lib/pcm/src/format.c

    r36f0738 rb7fd2a0  
    170170 * @return Error code.
    171171 */
    172 int pcm_format_mix(void *dst, const void *src, size_t size, const pcm_format_t *f)
     172errno_t pcm_format_mix(void *dst, const void *src, size_t size, const pcm_format_t *f)
    173173{
    174174        return pcm_format_convert_and_mix(dst, size, src, size, f, f);
     
    188188 * If there are not enough data in the source buffer silent data is assumed.
    189189 */
    190 int pcm_format_convert_and_mix(void *dst, size_t dst_size, const void *src,
     190errno_t pcm_format_convert_and_mix(void *dst, size_t dst_size, const void *src,
    191191    size_t src_size, const pcm_format_t *sf, const pcm_format_t *df)
    192192{
Note: See TracChangeset for help on using the changeset viewer.