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
d547ace7
Commit
d547ace7
authored
Nov 30, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
io/FileDescriptor: use std::size_t
parent
b47e0cff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
FileDescriptor.cxx
src/io/FileDescriptor.cxx
+4
-3
FileDescriptor.hxx
src/io/FileDescriptor.hxx
+5
-4
No files found.
src/io/FileDescriptor.cxx
View file @
d547ace7
/*
* Copyright 2012-20
19
Max Kellermann <max.kellermann@gmail.com>
* Copyright 2012-20
20
Max Kellermann <max.kellermann@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
...
...
@@ -32,6 +32,7 @@
#include <cassert>
#include <cstdint>
#include <stdexcept>
#include <sys/stat.h>
#include <fcntl.h>
...
...
@@ -289,7 +290,7 @@ FileDescriptor::GetSize() const noexcept
}
void
FileDescriptor
::
FullRead
(
void
*
_buffer
,
size_t
length
)
FileDescriptor
::
FullRead
(
void
*
_buffer
,
s
td
::
s
ize_t
length
)
{
auto
buffer
=
(
uint8_t
*
)
_buffer
;
...
...
@@ -307,7 +308,7 @@ FileDescriptor::FullRead(void *_buffer, size_t length)
}
void
FileDescriptor
::
FullWrite
(
const
void
*
_buffer
,
size_t
length
)
FileDescriptor
::
FullWrite
(
const
void
*
_buffer
,
s
td
::
s
ize_t
length
)
{
auto
buffer
=
(
const
uint8_t
*
)
_buffer
;
...
...
src/io/FileDescriptor.hxx
View file @
d547ace7
/*
* Copyright 2012-20
19
Max Kellermann <max.kellermann@gmail.com>
* Copyright 2012-20
20
Max Kellermann <max.kellermann@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
...
...
@@ -32,6 +32,7 @@
#include "util/Compiler.h"
#include <cstddef>
#include <utility>
#include <unistd.h>
...
...
@@ -229,7 +230,7 @@ public:
gcc_pure
off_t
GetSize
()
const
noexcept
;
ssize_t
Read
(
void
*
buffer
,
size_t
length
)
noexcept
{
ssize_t
Read
(
void
*
buffer
,
s
td
::
s
ize_t
length
)
noexcept
{
return
::
read
(
fd
,
buffer
,
length
);
}
...
...
@@ -237,9 +238,9 @@ public:
* Read until all of the given buffer has been filled. Throws
* on error.
*/
void
FullRead
(
void
*
buffer
,
size_t
length
);
void
FullRead
(
void
*
buffer
,
s
td
::
s
ize_t
length
);
ssize_t
Write
(
const
void
*
buffer
,
size_t
length
)
noexcept
{
ssize_t
Write
(
const
void
*
buffer
,
s
td
::
s
ize_t
length
)
noexcept
{
return
::
write
(
fd
,
buffer
,
length
);
}
...
...
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