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
f9f3306d
Commit
f9f3306d
authored
Jul 29, 2021
by
Max Kellermann
Committed by
Max Kellermann
Aug 27, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
io/BufferedOutputStream: use std::size_t
parent
19d19cd7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
BufferedOutputStream.cxx
src/fs/io/BufferedOutputStream.cxx
+5
-4
BufferedOutputStream.hxx
src/fs/io/BufferedOutputStream.hxx
+3
-3
No files found.
src/fs/io/BufferedOutputStream.cxx
View file @
f9f3306d
...
...
@@ -41,7 +41,7 @@
#endif
bool
BufferedOutputStream
::
AppendToBuffer
(
const
void
*
data
,
size_t
size
)
noexcept
BufferedOutputStream
::
AppendToBuffer
(
const
void
*
data
,
s
td
::
s
ize_t
size
)
noexcept
{
auto
r
=
buffer
.
Write
();
if
(
r
.
size
<
size
)
...
...
@@ -53,7 +53,7 @@ BufferedOutputStream::AppendToBuffer(const void *data, size_t size) noexcept
}
void
BufferedOutputStream
::
Write
(
const
void
*
data
,
size_t
size
)
BufferedOutputStream
::
Write
(
const
void
*
data
,
s
td
::
s
ize_t
size
)
{
/* try to append to the current buffer */
if
(
AppendToBuffer
(
data
,
size
))
...
...
@@ -88,7 +88,7 @@ BufferedOutputStream::Format(const char *fmt, ...)
/* format into the buffer */
std
::
va_list
ap
;
va_start
(
ap
,
fmt
);
size_t
size
=
vsnprintf
(
r
.
data
,
r
.
size
,
fmt
,
ap
);
s
td
::
s
ize_t
size
=
vsnprintf
(
r
.
data
,
r
.
size
,
fmt
,
ap
);
va_end
(
ap
);
if
(
gcc_unlikely
(
size
>=
r
.
size
))
{
...
...
@@ -127,7 +127,8 @@ BufferedOutputStream::Write(const wchar_t *p)
}
void
BufferedOutputStream
::
WriteWideToUTF8
(
const
wchar_t
*
src
,
size_t
src_length
)
BufferedOutputStream
::
WriteWideToUTF8
(
const
wchar_t
*
src
,
std
::
size_t
src_length
)
{
if
(
src_length
==
0
)
return
;
...
...
src/fs/io/BufferedOutputStream.hxx
View file @
f9f3306d
...
...
@@ -56,7 +56,7 @@ public:
explicit
BufferedOutputStream
(
OutputStream
&
_os
)
noexcept
:
os
(
_os
),
buffer
(
32768
)
{}
void
Write
(
const
void
*
data
,
size_t
size
);
void
Write
(
const
void
*
data
,
s
td
::
s
ize_t
size
);
void
Write
(
const
char
&
ch
)
{
Write
(
&
ch
,
sizeof
(
ch
));
...
...
@@ -81,10 +81,10 @@ public:
void
Flush
();
private
:
bool
AppendToBuffer
(
const
void
*
data
,
size_t
size
)
noexcept
;
bool
AppendToBuffer
(
const
void
*
data
,
s
td
::
s
ize_t
size
)
noexcept
;
#ifdef _UNICODE
void
WriteWideToUTF8
(
const
wchar_t
*
p
,
size_t
length
);
void
WriteWideToUTF8
(
const
wchar_t
*
p
,
s
td
::
s
ize_t
length
);
#endif
};
...
...
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