test/run_input: convert pointer to reference
This commit is contained in:
parent
db8b419b8c
commit
2e93a83dd5
@ -130,20 +130,20 @@ tag_save(FILE *file, const Tag &tag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
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 */
|
/* print meta data */
|
||||||
|
|
||||||
if (is->HasMimeType())
|
if (is.HasMimeType())
|
||||||
fprintf(stderr, "MIME type: %s\n", is->GetMimeType());
|
fprintf(stderr, "MIME type: %s\n", is.GetMimeType());
|
||||||
|
|
||||||
/* read data and tags from the stream */
|
/* read data and tags from the stream */
|
||||||
|
|
||||||
while (!is->IsEOF()) {
|
while (!is.IsEOF()) {
|
||||||
{
|
{
|
||||||
auto tag = is->ReadTag();
|
auto tag = is.ReadTag();
|
||||||
if (tag) {
|
if (tag) {
|
||||||
fprintf(stderr, "Received a tag:\n");
|
fprintf(stderr, "Received a tag:\n");
|
||||||
tag_save(stderr, *tag);
|
tag_save(stderr, *tag);
|
||||||
@ -151,7 +151,7 @@ dump_input_stream(InputStream *is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char buffer[4096];
|
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)
|
if (num_read == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ dump_input_stream(InputStream *is)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
is->Check();
|
is.Check();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -234,7 +234,7 @@ try {
|
|||||||
|
|
||||||
Mutex mutex;
|
Mutex mutex;
|
||||||
auto is = InputStream::OpenReady(c.uri, mutex);
|
auto is = InputStream::OpenReady(c.uri, mutex);
|
||||||
return dump_input_stream(is.get());
|
return dump_input_stream(*is);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
PrintException(std::current_exception());
|
PrintException(std::current_exception());
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user