Changeset 132ab5d1 in mainline for uspace/srv/audio/hound/hound_ctx.c


Ignore:
Timestamp:
2018-01-30T03:20:45Z (8 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5a6cc679
Parents:
8bfb163 (diff), 6a5d05b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge commit '6a5d05bd2551e64111bea4f9332dd7448c26ce84' into forwardport

Separate return value from error code in gen_irq_code*().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/audio/hound/hound_ctx.c

    r8bfb163 r132ab5d1  
    3535 */
    3636
    37 #include <malloc.h>
    3837#include <macros.h>
    3938#include <errno.h>
     39#include <stdlib.h>
    4040#include <str_error.h>
    4141
     
    340340
    341341        pcm_format_silence(data, size, &stream->format);
    342         const int ret =
     342        const size_t ret =
    343343            audio_pipe_mix_data(&stream->fifo, data, size, &stream->format);
    344344        fibril_mutex_unlock(&stream->guard);
    345         if (ret == EOK)
     345        if (ret > 0) {
    346346                fibril_condvar_signal(&stream->change);
    347         return ret;
     347                return EOK;
     348        }
     349        return EEMPTY;
    348350}
    349351
     
    354356 * @param size Size of the @p data buffer.
    355357 * @param format Destination data format.
    356  * @return Size of the destination buffer touch with stream's data,
    357  *         error code on failure.
    358  */
    359 ssize_t hound_ctx_stream_add_self(hound_ctx_stream_t *stream, void *data,
     358 * @return Size of the destination buffer touch with stream's data.
     359 */
     360size_t hound_ctx_stream_add_self(hound_ctx_stream_t *stream, void *data,
    360361    size_t size, const pcm_format_t *f)
    361362{
    362363        assert(stream);
    363364        fibril_mutex_lock(&stream->guard);
    364         const int ret = audio_pipe_mix_data(&stream->fifo, data, size, f);
     365        const size_t ret = audio_pipe_mix_data(&stream->fifo, data, size, f);
    365366        fibril_condvar_signal(&stream->change);
    366367        fibril_mutex_unlock(&stream->guard);
     
    457458        list_foreach(sink->connections, source_link, connection_t, conn) {
    458459                /* This should not trigger data update on the source */
    459                 const size_t copied = connection_add_source_data(
     460                connection_add_source_data(
    460461                    conn, buffer, bsize, sink->format);
    461                 if (copied != bsize)
    462                         log_error("Copied less than advertised data, "
    463                             "something is wrong");
    464462        }
    465463        /* push to all streams */
Note: See TracChangeset for help on using the changeset viewer.