cStyleCasts

This commit is contained in:
gtsoul-tech
2024-05-17 16:58:08 +03:00
parent db540d5ae7
commit d8f61b0d66
11 changed files with 396 additions and 396 deletions

View File

@@ -98,10 +98,10 @@ hs_database_t *get_huge(hs_database_t *db) {
// Mark this segment to be destroyed after this process detaches.
shmctl(hsdb_shmid, IPC_RMID, nullptr);
err = hs_deserialize_database_at(bytes, len, (hs_database_t *)shmaddr);
err = hs_deserialize_database_at(bytes, len, reinterpret_cast<hs_database_t *>(shmaddr));
if (err != HS_SUCCESS) {
printf("Failed to deserialize database into shm: %d\n", err);
shmdt((const void *)shmaddr);
shmdt(reinterpret_cast<const void *>(shmaddr));
goto fini;
}
@@ -121,7 +121,7 @@ fini:
void release_huge(hs_database_t *db) {
#if defined(HAVE_SHMGET) && defined(SHM_HUGETLB)
if (hsdb_shmid != -1) {
if (shmdt((const void *)db) != 0) {
if (shmdt(reinterpret_cast<const void *>(db)) != 0) {
perror("Detach failure");
}
} else {