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
fec80f28
Commit
fec80f28
authored
Sep 28, 2020
by
Max Kellermann
Committed by
Max Kellermann
Oct 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/Cast: use std::ptrdiff_t
parent
4e47653c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
Cast.hxx
src/util/Cast.hxx
+5
-5
No files found.
src/util/Cast.hxx
View file @
fec80f28
...
...
@@ -37,27 +37,27 @@
template
<
typename
T
,
typename
U
>
constexpr
T
*
OffsetCast
(
U
*
p
,
ptrdiff_t
offset
)
OffsetCast
(
U
*
p
,
std
::
ptrdiff_t
offset
)
{
return
reinterpret_cast
<
T
*>
(
OffsetPointer
(
p
,
offset
));
}
template
<
typename
T
,
typename
U
>
constexpr
T
*
OffsetCast
(
const
U
*
p
,
ptrdiff_t
offset
)
OffsetCast
(
const
U
*
p
,
std
::
ptrdiff_t
offset
)
{
return
reinterpret_cast
<
const
T
*>
(
OffsetPointer
(
p
,
offset
));
}
template
<
class
C
,
class
A
>
constexpr
ptrdiff_t
constexpr
std
::
ptrdiff_t
ContainerAttributeOffset
(
const
C
*
null_c
,
const
A
C
::*
p
)
{
return
ptrdiff_t
((
const
char
*
)
&
(
null_c
->*
p
)
-
(
const
char
*
)
null_c
);
return
std
::
ptrdiff_t
((
const
char
*
)
&
(
null_c
->*
p
)
-
(
const
char
*
)
null_c
);
}
template
<
class
C
,
class
A
>
constexpr
ptrdiff_t
constexpr
std
::
ptrdiff_t
ContainerAttributeOffset
(
const
A
C
::*
p
)
{
return
ContainerAttributeOffset
<
C
,
A
>
(
nullptr
,
p
);
...
...
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