Skip to content

Commit b04f406

Browse files
committed
http/local/Stock: use reinterpret_cast
1 parent 7cc83e5 commit b04f406

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/http/local/Stock.cxx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ StockOptions
4040
LhttpStock::GetOptions(const void *request,
4141
StockOptions o) const noexcept
4242
{
43-
const auto &address = *(const LhttpAddress *)request;
43+
const auto &address = *reinterpret_cast<const LhttpAddress *>(request);
44+
4445
if (address.parallelism > 0)
4546
o.limit = address.parallelism;
4647

@@ -72,14 +73,14 @@ LhttpStock::PreserveRequest(StockRequest request) noexcept
7273
bool
7374
LhttpStock::WantStderrPond(const void *info) const noexcept
7475
{
75-
const auto &address = *(const LhttpAddress *)info;
76+
const auto &address = *reinterpret_cast<const LhttpAddress *>(info);
7677
return address.options.stderr_pond;
7778
}
7879

7980
int
8081
LhttpStock::GetChildSocketType(const void *info) const noexcept
8182
{
82-
const auto &address = *(const LhttpAddress *)info;
83+
const auto &address = *reinterpret_cast<const LhttpAddress *>(info);
8384

8485
int type = SOCK_STREAM;
8586
if (!address.blocking)
@@ -91,7 +92,7 @@ LhttpStock::GetChildSocketType(const void *info) const noexcept
9192
unsigned
9293
LhttpStock::GetChildBacklog(const void *info) const noexcept
9394
{
94-
const auto &address = *(const LhttpAddress *)info;
95+
const auto &address = *reinterpret_cast<const LhttpAddress *>(info);
9596

9697
/* use the concurrency for the listener backlog to ensure that
9798
we'll never get ECONNREFUSED/EAGAIN while the child process
@@ -104,7 +105,7 @@ LhttpStock::GetChildBacklog(const void *info) const noexcept
104105
std::string_view
105106
LhttpStock::GetChildTag(const void *info) const noexcept
106107
{
107-
const auto &address = *(const LhttpAddress *)info;
108+
const auto &address = *reinterpret_cast<const LhttpAddress *>(info);
108109

109110
return address.options.tag;
110111
}
@@ -113,7 +114,7 @@ void
113114
LhttpStock::PrepareChild(const void *info, PreparedChildProcess &p,
114115
FdHolder &close_fds)
115116
{
116-
const auto &address = *(const LhttpAddress *)info;
117+
const auto &address = *reinterpret_cast<const LhttpAddress *>(info);
117118

118119
address.CopyTo(p, close_fds);
119120
}

0 commit comments

Comments
 (0)