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
6de4064c
Commit
6de4064c
authored
May 19, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client/Response, command/file: use %lu instead of %zu on Windows
Fixes -Wformat warnings. Closes
https://github.com/MusicPlayerDaemon/MPD/issues/1150
parent
bcf0fdd3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
Response.cxx
src/client/Response.cxx
+6
-1
FileCommands.cxx
src/command/FileCommands.cxx
+9
-0
No files found.
src/client/Response.cxx
View file @
6de4064c
...
@@ -61,7 +61,12 @@ Response::WriteBinary(ConstBuffer<void> payload) noexcept
...
@@ -61,7 +61,12 @@ Response::WriteBinary(ConstBuffer<void> payload) noexcept
{
{
assert
(
payload
.
size
<=
client
.
binary_limit
);
assert
(
payload
.
size
<=
client
.
binary_limit
);
return
Format
(
"binary: %zu
\n
"
,
payload
.
size
)
&&
return
#ifdef _WIN32
Format
(
"binary: %lu
\n
"
,
(
unsigned
long
)
payload
.
size
)
&&
#else
Format
(
"binary: %zu
\n
"
,
payload
.
size
)
&&
#endif
Write
(
payload
.
data
,
payload
.
size
)
&&
Write
(
payload
.
data
,
payload
.
size
)
&&
Write
(
"
\n
"
);
Write
(
"
\n
"
);
}
}
...
...
src/command/FileCommands.cxx
View file @
6de4064c
...
@@ -231,7 +231,12 @@ read_stream_art(Response &r, const char *uri, size_t offset)
...
@@ -231,7 +231,12 @@ read_stream_art(Response &r, const char *uri, size_t offset)
read_size
=
is
->
Read
(
lock
,
buffer
.
get
(),
buffer_size
);
read_size
=
is
->
Read
(
lock
,
buffer
.
get
(),
buffer_size
);
}
}
#ifdef _WIN32
r
.
Format
(
"size: %lu
\n
"
,
(
unsigned
long
)
art_file_size
);
#else
r
.
Format
(
"size: %"
PRIoffset
"
\n
"
,
art_file_size
);
r
.
Format
(
"size: %"
PRIoffset
"
\n
"
,
art_file_size
);
#endif
r
.
WriteBinary
({
buffer
.
get
(),
read_size
});
r
.
WriteBinary
({
buffer
.
get
(),
read_size
});
return
CommandResult
::
OK
;
return
CommandResult
::
OK
;
...
@@ -313,7 +318,11 @@ public:
...
@@ -313,7 +318,11 @@ public:
return
;
return
;
}
}
#ifdef _WIN32
response
.
Format
(
"size: %lu
\n
"
,
(
unsigned
long
)
buffer
.
size
);
#else
response
.
Format
(
"size: %zu
\n
"
,
buffer
.
size
);
response
.
Format
(
"size: %zu
\n
"
,
buffer
.
size
);
#endif
if
(
mime_type
!=
nullptr
)
if
(
mime_type
!=
nullptr
)
response
.
Format
(
"type: %s
\n
"
,
mime_type
);
response
.
Format
(
"type: %s
\n
"
,
mime_type
);
...
...
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