Commit 725f3487 authored by Jan Kiene's avatar Jan Kiene
Browse files

fix td ring buffer total size function

port went wrong somehow
parent 3056cb80
Loading
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -53,21 +53,17 @@
static UWord32 ivas_td_ringbuf_total_size(
    TD_RINGBUF_HANDLE h )
{
    UWord32 total_size;

    IF( h->is_full )
    {
        total_size = h->capacity;
        return h->capacity;
    }

    IF( h->read_pos <= h->write_pos )
    {
        total_size = L_sub( h->write_pos, h->read_pos );
        return L_sub( h->write_pos, h->read_pos );
    }
    /* else wrap around */
    total_size = L_add( h->write_pos, L_sub( h->capacity, h->read_pos ) );

    return total_size;
    return L_add( h->write_pos, L_sub( h->capacity, h->read_pos ) );
}