From ff626ac76357940b2f0ac5cb243a68ac13df0f8a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 19 Oct 2013 18:48:38 +0200 Subject: *: use references instead of pointers --- src/DecoderInternal.cxx | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/DecoderInternal.cxx') diff --git a/src/DecoderInternal.cxx b/src/DecoderInternal.cxx index 43536686b..8d89155cc 100644 --- a/src/DecoderInternal.cxx +++ b/src/DecoderInternal.cxx @@ -42,17 +42,17 @@ decoder::~decoder() * one. */ static DecoderCommand -need_chunks(struct decoder_control *dc, bool do_wait) +need_chunks(decoder_control &dc, bool do_wait) { - if (dc->command == DecoderCommand::STOP || - dc->command == DecoderCommand::SEEK) - return dc->command; + if (dc.command == DecoderCommand::STOP || + dc.command == DecoderCommand::SEEK) + return dc.command; if (do_wait) { - dc->Wait(); - dc->client_cond.signal(); + dc.Wait(); + dc.client_cond.signal(); - return dc->command; + return dc.command; } return DecoderCommand::NONE; @@ -61,7 +61,7 @@ need_chunks(struct decoder_control *dc, bool do_wait) struct music_chunk * decoder_get_chunk(struct decoder *decoder) { - struct decoder_control *dc = decoder->dc; + decoder_control &dc = decoder->dc; DecoderCommand cmd; assert(decoder != nullptr); @@ -70,7 +70,7 @@ decoder_get_chunk(struct decoder *decoder) return decoder->chunk; do { - decoder->chunk = dc->buffer->Allocate(); + decoder->chunk = dc.buffer->Allocate(); if (decoder->chunk != nullptr) { decoder->chunk->replay_gain_serial = decoder->replay_gain_serial; @@ -81,9 +81,9 @@ decoder_get_chunk(struct decoder *decoder) return decoder->chunk; } - dc->Lock(); + dc.Lock(); cmd = need_chunks(dc, true); - dc->Unlock(); + dc.Unlock(); } while (cmd == DecoderCommand::NONE); return nullptr; @@ -92,15 +92,15 @@ decoder_get_chunk(struct decoder *decoder) void decoder_flush_chunk(struct decoder *decoder) { - struct decoder_control *dc = decoder->dc; + decoder_control &dc = decoder->dc; assert(decoder != nullptr); assert(decoder->chunk != nullptr); if (decoder->chunk->IsEmpty()) - dc->buffer->Return(decoder->chunk); + dc.buffer->Return(decoder->chunk); else - dc->pipe->Push(decoder->chunk); + dc.pipe->Push(decoder->chunk); decoder->chunk = nullptr; } -- cgit v1.2.3