Skip to content

Commit

Permalink
Use reinterpret_cast instead of a C-style cast in Discovery.cpp. (#…
Browse files Browse the repository at this point in the history
…103)

As described: this file is C++ and should prefer C++-style casts where possible. My mistake.
  • Loading branch information
grynspan authored Nov 9, 2023
1 parent 123a304 commit 3d8fea9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/TestingInternals/Discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ static SWTMachHeaderList getMachHeaders(void) {

static constinit dispatch_once_t once = 0;
dispatch_once_f(&once, nullptr, [] (void *) {
machHeaders = (SWTMachHeaderList *)std::malloc(sizeof(SWTMachHeaderList));
machHeaders = reinterpret_cast<SWTMachHeaderList *>(std::malloc(sizeof(SWTMachHeaderList)));
::new (machHeaders) SWTMachHeaderList();
machHeaders->reserve(_dyld_image_count());

Expand Down

0 comments on commit 3d8fea9

Please sign in to comment.