mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-29 19:24:25 +03:00
cStyleCasts
This commit is contained in:
@@ -49,7 +49,7 @@ void readRow(sqlite3_stmt *statement, vector<DataBlock> &blocks,
|
||||
map<unsigned int, unsigned int> &stream_indices) {
|
||||
unsigned int id = sqlite3_column_int(statement, 0);
|
||||
unsigned int stream_id = sqlite3_column_int(statement, 1);
|
||||
const char *blob = (const char *)sqlite3_column_blob(statement, 2);
|
||||
const char *blob = reinterpret_cast<const char *>(sqlite3_column_blob(statement, 2));
|
||||
unsigned int bytes = sqlite3_column_bytes(statement, 2);
|
||||
|
||||
if (!contains(stream_indices, stream_id)) {
|
||||
|
@@ -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 {
|
||||
|
@@ -485,7 +485,7 @@ void stopTotalTimer(const ThreadContext *ctx) {
|
||||
/** Run a benchmark over a given engine and corpus in block mode. */
|
||||
static
|
||||
void benchBlock(void *context) {
|
||||
ThreadContext *ctx = (ThreadContext *)context;
|
||||
ThreadContext *ctx = reinterpret_cast<ThreadContext *>(context);
|
||||
|
||||
// Synchronization point
|
||||
ctx->barrier();
|
||||
@@ -603,7 +603,7 @@ void benchStreamingInternal(ThreadContext *ctx, vector<StreamInfo> &streams,
|
||||
/** Run a benchmark over a given engine and corpus in streaming mode. */
|
||||
static
|
||||
void benchStreaming(void *context) {
|
||||
ThreadContext *ctx = (ThreadContext *)context;
|
||||
ThreadContext *ctx = reinterpret_cast<ThreadContext *>(context);
|
||||
vector<StreamInfo> streams = prepStreamingData(ctx);
|
||||
|
||||
// Synchronization point
|
||||
@@ -622,7 +622,7 @@ void benchStreaming(void *context) {
|
||||
|
||||
static
|
||||
void benchStreamingCompress(void *context) {
|
||||
ThreadContext *ctx = (ThreadContext *)context;
|
||||
ThreadContext *ctx = reinterpret_cast<ThreadContext *>(context);
|
||||
vector<StreamInfo> streams = prepStreamingData(ctx);
|
||||
|
||||
// Synchronization point
|
||||
@@ -671,8 +671,8 @@ vector<VectoredInfo> prepVectorData(const ThreadContext *ctx) {
|
||||
/** Run a benchmark over a given engine and corpus in vectored mode. */
|
||||
static
|
||||
void benchVectored(void *context) {
|
||||
ThreadContext *ctx = (ThreadContext *)context;
|
||||
|
||||
ThreadContext *ctx = reinterpret_cast<ThreadContext *>(context);
|
||||
|
||||
vector<VectoredInfo> v_plans = prepVectorData(ctx);
|
||||
|
||||
// Synchronization point
|
||||
|
Reference in New Issue
Block a user