summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-09-07 20:01:51 +0200
committerMax Kellermann <max@musicpd.org>2020-09-07 20:02:12 +0200
commit2e93a83dd5c3c5fd301e963904f114c7f72e9a6d (patch)
tree36ca462cb7c0774d1443bce744849ef8d82ae1a2
parentdb8b419b8c3aa738efb3fa7b5de7b2894ced6cde (diff)
test/run_input: convert pointer to reference
-rw-r--r--test/run_input.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/run_input.cxx b/test/run_input.cxx
index a3b5e7277..d5648f11a 100644
--- a/test/run_input.cxx
+++ b/test/run_input.cxx
@@ -130,20 +130,20 @@ tag_save(FILE *file, const Tag &tag)
}
static int
-dump_input_stream(InputStream *is)
+dump_input_stream(InputStream &is)
{
- const std::lock_guard<Mutex> protect(is->mutex);
+ const std::lock_guard<Mutex> protect(is.mutex);
/* print meta data */
- if (is->HasMimeType())
- fprintf(stderr, "MIME type: %s\n", is->GetMimeType());
+ if (is.HasMimeType())
+ fprintf(stderr, "MIME type: %s\n", is.GetMimeType());
/* read data and tags from the stream */
- while (!is->IsEOF()) {
+ while (!is.IsEOF()) {
{
- auto tag = is->ReadTag();
+ auto tag = is.ReadTag();
if (tag) {
fprintf(stderr, "Received a tag:\n");
tag_save(stderr, *tag);
@@ -151,7 +151,7 @@ dump_input_stream(InputStream *is)
}
char buffer[4096];
- size_t num_read = is->Read(buffer, sizeof(buffer));
+ size_t num_read = is.Read(buffer, sizeof(buffer));
if (num_read == 0)
break;
@@ -160,7 +160,7 @@ dump_input_stream(InputStream *is)
break;
}
- is->Check();
+ is.Check();
return 0;
}
@@ -234,7 +234,7 @@ try {
Mutex mutex;
auto is = InputStream::OpenReady(c.uri, mutex);
- return dump_input_stream(is.get());
+ return dump_input_stream(*is);
} catch (...) {
PrintException(std::current_exception());
return EXIT_FAILURE;