Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
2e93a83d
Commit
2e93a83d
authored
Sep 07, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test/run_input: convert pointer to reference
parent
db8b419b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
run_input.cxx
test/run_input.cxx
+9
-9
No files found.
test/run_input.cxx
View file @
2e93a83d
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment