Skip to content

Commit e8a7113

Browse files
Remove unnecessary casts.
Change-Id: I2d293d065c7efa006efe7d60a625cba0c6116c86
1 parent 4b4b886 commit e8a7113

16 files changed

+51
-51
lines changed

runtime/command_queue/command_queue_hw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ class CommandQueueHw : public CommandQueue {
333333

334334
protected:
335335
MOCKABLE_VIRTUAL void enqueueHandlerHook(const unsigned int commandType, const MultiDispatchInfo &dispatchInfo){};
336-
size_t calculateHostPtrSizeForImage(size_t *region, size_t rowPitch, size_t slicePitch, Image *image);
336+
size_t calculateHostPtrSizeForImage(const size_t *region, size_t rowPitch, size_t slicePitch, Image *image);
337337

338338
private:
339339
bool isTaskLevelUpdateRequired(const uint32_t &taskLevel, const cl_event *eventWaitList, const cl_uint &numEventsInWaitList, unsigned int commandType);

runtime/command_queue/enqueue_common.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
290290
CompletionStamp completionStamp;
291291
if (!blockQueue) {
292292
if (parentKernel) {
293-
size_t minSizeSSHForEM = KernelCommandsHelper<GfxFamily>::template getSizeRequiredForExecutionModel<IndirectHeap::SURFACE_STATE>(const_cast<const Kernel &>(*parentKernel));
293+
size_t minSizeSSHForEM = KernelCommandsHelper<GfxFamily>::template getSizeRequiredForExecutionModel<IndirectHeap::SURFACE_STATE>(*parentKernel);
294294

295295
uint32_t taskCount = getCommandStreamReceiver().peekTaskCount() + 1;
296296
devQueueHw->setupExecutionModelDispatch(getIndirectHeap(IndirectHeap::SURFACE_STATE, minSizeSSHForEM),
@@ -406,7 +406,7 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
406406

407407
if (blockQueue) {
408408
if (parentKernel) {
409-
size_t minSizeSSHForEM = KernelCommandsHelper<GfxFamily>::template getSizeRequiredForExecutionModel<IndirectHeap::SURFACE_STATE>(const_cast<const Kernel &>(*parentKernel));
409+
size_t minSizeSSHForEM = KernelCommandsHelper<GfxFamily>::template getSizeRequiredForExecutionModel<IndirectHeap::SURFACE_STATE>(*parentKernel);
410410
blockedCommandsData->surfaceStateHeapSizeEM = minSizeSSHForEM;
411411
}
412412

@@ -730,7 +730,7 @@ void CommandQueueHw<GfxFamily>::computeOffsetsValueForRectCommands(size_t *buffe
730730
}
731731

732732
template <typename GfxFamily>
733-
size_t CommandQueueHw<GfxFamily>::calculateHostPtrSizeForImage(size_t *region, size_t rowPitch, size_t slicePitch, Image *image) {
733+
size_t CommandQueueHw<GfxFamily>::calculateHostPtrSizeForImage(const size_t *region, size_t rowPitch, size_t slicePitch, Image *image) {
734734
auto bytesPerPixel = image->getSurfaceFormatInfo().ImageElementSizeInBytes;
735735
auto dstRowPitch = rowPitch ? rowPitch : region[0] * bytesPerPixel;
736736
auto dstSlicePitch = slicePitch ? slicePitch : ((image->getImageDesc().image_type == CL_MEM_OBJECT_IMAGE1D_ARRAY ? 1 : region[1]) * dstRowPitch);

runtime/command_queue/enqueue_read_image.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueReadImage(
7272

7373
BuiltInOwnershipWrapper builtInLock(builder, this->context);
7474

75-
size_t hostPtrSize = calculateHostPtrSizeForImage(const_cast<size_t *>(region), inputRowPitch, inputSlicePitch, srcImage);
75+
size_t hostPtrSize = calculateHostPtrSizeForImage(region, inputRowPitch, inputSlicePitch, srcImage);
7676
void *dstPtr = ptr;
7777

7878
MemObjSurface srcImgSurf(srcImage);

runtime/command_queue/enqueue_write_image.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueWriteImage(
6666

6767
BuiltInOwnershipWrapper lock(builder, this->context);
6868

69-
size_t hostPtrSize = calculateHostPtrSizeForImage(const_cast<size_t *>(region), inputRowPitch, inputSlicePitch, dstImage);
69+
size_t hostPtrSize = calculateHostPtrSizeForImage(region, inputRowPitch, inputSlicePitch, dstImage);
7070
void *srcPtr = const_cast<void *>(ptr);
7171

7272
MemObjSurface dstImgSurf(dstImage);

runtime/command_queue/gpgpu_walker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ IndirectHeap &getIndirectHeap(CommandQueue &commandQueue, const MultiDispatchInf
247247

248248
if (Kernel *parentKernel = multiDispatchInfo.peekParentKernel()) {
249249
if (heapType == IndirectHeap::SURFACE_STATE) {
250-
expectedSize += KernelCommandsHelper<GfxFamily>::template getSizeRequiredForExecutionModel<heapType>(const_cast<const Kernel &>(*parentKernel));
250+
expectedSize += KernelCommandsHelper<GfxFamily>::template getSizeRequiredForExecutionModel<heapType>(*parentKernel);
251251
} else //if (heapType == IndirectHeap::DYNAMIC_STATE || heapType == IndirectHeap::INDIRECT_OBJECT)
252252
{
253253
DeviceQueueHw<GfxFamily> *pDevQueue = castToObject<DeviceQueueHw<GfxFamily>>(commandQueue.getContext().getDefaultDeviceQueue());

runtime/helpers/base_object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ inline DerivedType *castToObjectOrAbort(typename DerivedType::BaseType *object)
5959

6060
template <typename DerivedType>
6161
inline const DerivedType *castToObject(const typename DerivedType::BaseType *object) {
62-
return const_cast<const DerivedType *>(castToObject<DerivedType>(const_cast<typename DerivedType::BaseType *>(object)));
62+
return castToObject<DerivedType>(const_cast<typename DerivedType::BaseType *>(object));
6363
}
6464

6565
template <typename DerivedType>

runtime/kernel/kernel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,7 +1939,7 @@ void Kernel::ReflectionSurfaceHelper::setParentImageParams(void *reflectionSurfa
19391939
uint32_t numArgs = (uint32_t)parentArguments.size();
19401940
for (uint32_t i = 0; i < numArgs; i++) {
19411941
if (parentArguments[i].type == Kernel::kernelArgType::IMAGE_OBJ) {
1942-
const Image *image = const_cast<const Image *>(castToObject<Image>((cl_mem)parentArguments[i].object));
1942+
const Image *image = castToObject<Image>((cl_mem)parentArguments[i].object);
19431943
if (image) {
19441944
pImageParameters->m_ArraySize = (uint32_t)image->getImageDesc().image_array_size;
19451945
pImageParameters->m_Depth = (uint32_t)image->getImageDesc().image_depth;
@@ -1964,7 +1964,7 @@ void Kernel::ReflectionSurfaceHelper::setParentSamplerParams(void *reflectionSur
19641964
uint32_t numArgs = (uint32_t)parentArguments.size();
19651965
for (uint32_t i = 0; i < numArgs; i++) {
19661966
if (parentArguments[i].type == Kernel::kernelArgType::SAMPLER_OBJ) {
1967-
const Sampler *sampler = const_cast<const Sampler *>(castToObject<Sampler>((cl_sampler)parentArguments[i].object));
1967+
const Sampler *sampler = castToObject<Sampler>((cl_sampler)parentArguments[i].object);
19681968
if (sampler) {
19691969
pParentSamplerParams->CoordinateSnapRequired = (uint32_t)sampler->getSnapWaValue();
19701970
pParentSamplerParams->m_AddressingMode = (uint32_t)sampler->addressingMode;

runtime/mem_obj/buffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ Buffer *Buffer::create(Context *context,
233233
properties.flags,
234234
size,
235235
memory->getUnderlyingBuffer(),
236-
const_cast<void *>(hostPtr),
236+
hostPtr,
237237
memory,
238238
zeroCopyAllowed,
239239
isHostPtrSVM,

runtime/mem_obj/image.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ cl_int Image::validateImageTraits(Context *context, cl_mem_flags flags, const cl
573573
return CL_SUCCESS;
574574
}
575575

576-
size_t Image::calculateHostPtrSize(size_t *region, size_t rowPitch, size_t slicePitch, size_t pixelSize, uint32_t imageType) {
576+
size_t Image::calculateHostPtrSize(const size_t *region, size_t rowPitch, size_t slicePitch, size_t pixelSize, uint32_t imageType) {
577577
DEBUG_BREAK_IF(!((rowPitch != 0) && (slicePitch != 0)));
578578
size_t sizeToReturn = 0u;
579579

runtime/mem_obj/image.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class Image : public MemObj {
8888

8989
static cl_int validateImageTraits(Context *context, cl_mem_flags flags, const cl_image_format *imageFormat, const cl_image_desc *imageDesc, const void *hostPtr);
9090

91-
static size_t calculateHostPtrSize(size_t *region, size_t rowPitch, size_t slicePitch, size_t pixelSize, uint32_t imageType);
91+
static size_t calculateHostPtrSize(const size_t *region, size_t rowPitch, size_t slicePitch, size_t pixelSize, uint32_t imageType);
9292

9393
static void calculateHostPtrOffset(size_t *imageOffset, const size_t *origin, const size_t *region, size_t rowPitch, size_t slicePitch, uint32_t imageType, size_t bytesPerPixel);
9494

runtime/os_interface/linux/hw_info_config.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ int HwInfoConfig::configureHwInfo(const HardwareInfo *inHwInfo, HardwareInfo *ou
7878
auto pWaTable = std::unique_ptr<WorkaroundTable>(new WorkaroundTable);
7979
*pWaTable = *(inHwInfo->pWaTable);
8080

81-
outHwInfo->pPlatform = const_cast<const PLATFORM *>(pPlatform.get());
82-
outHwInfo->pSysInfo = const_cast<const GT_SYSTEM_INFO *>(pSysInfo.get());
83-
outHwInfo->pSkuTable = const_cast<const FeatureTable *>(pSkuTable.get());
84-
outHwInfo->pWaTable = const_cast<const WorkaroundTable *>(pWaTable.get());
81+
outHwInfo->pPlatform = pPlatform.get();
82+
outHwInfo->pSysInfo = pSysInfo.get();
83+
outHwInfo->pSkuTable = pSkuTable.get();
84+
outHwInfo->pWaTable = pWaTable.get();
8585
outHwInfo->capabilityTable = inHwInfo->capabilityTable;
8686

8787
int val = 0;

unit_tests/api/cl_intel_accelerator_tests.inl

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -161,42 +161,42 @@ TEST_F(IntelAcceleratorGetInfoTest, GetInfoReferenceCountWithNullReturnExpectPas
161161
}
162162

163163
TEST_F(IntelAcceleratorGetInfoTest, GetInfoReferenceCount1ExpectPass) {
164-
cl_uint parm_value = static_cast<cl_uint>(-1);
164+
cl_uint param_value = static_cast<cl_uint>(-1);
165165

166166
result = clGetAcceleratorInfoINTEL(
167167
accelerator,
168168
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
169169
sizeof(cl_uint),
170-
reinterpret_cast<void *>(&parm_value),
170+
&param_value,
171171
nullptr);
172172

173173
EXPECT_EQ(CL_SUCCESS, result);
174-
EXPECT_EQ(1u, parm_value);
174+
EXPECT_EQ(1u, param_value);
175175
}
176176

177177
TEST_F(IntelAcceleratorGetInfoTest, GetInfoReferenceCountWithLongReturnExpectPass) {
178-
cl_uint parm_value = static_cast<cl_uint>(-1);
178+
cl_uint param_value = static_cast<cl_uint>(-1);
179179

180180
result = clGetAcceleratorInfoINTEL(
181181
accelerator,
182182
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
183183
sizeof(cl_uint) + 1,
184-
reinterpret_cast<void *>(&parm_value),
184+
&param_value,
185185
&param_value_size_ret);
186186

187187
EXPECT_EQ(CL_SUCCESS, result);
188188
EXPECT_EQ(sizeof(cl_uint), param_value_size_ret);
189-
EXPECT_EQ(1u, parm_value);
189+
EXPECT_EQ(1u, param_value);
190190
}
191191

192192
TEST_F(IntelAcceleratorGetInfoTest, GetInfoReferenceCountWithShortReturnExpectFail) {
193-
cl_uint parm_value = static_cast<cl_uint>(-1);
193+
cl_uint param_value = static_cast<cl_uint>(-1);
194194

195195
result = clGetAcceleratorInfoINTEL(
196196
accelerator,
197197
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
198198
sizeof(cl_uint) - 1,
199-
reinterpret_cast<void *>(&parm_value),
199+
&param_value,
200200
&param_value_size_ret);
201201

202202
EXPECT_EQ(CL_INVALID_VALUE, result);
@@ -215,7 +215,7 @@ TEST_F(IntelAcceleratorGetInfoTest, GetInfoReferenceCountSizeQueryExpectPass) {
215215
}
216216

217217
TEST_F(IntelAcceleratorGetInfoTest, GetInfoReferenceCount2ExpectPass) {
218-
cl_uint parm_value = static_cast<cl_uint>(-1);
218+
cl_uint param_value = static_cast<cl_uint>(-1);
219219

220220
result = clRetainAcceleratorINTEL(accelerator);
221221
ASSERT_EQ(CL_SUCCESS, result);
@@ -224,11 +224,11 @@ TEST_F(IntelAcceleratorGetInfoTest, GetInfoReferenceCount2ExpectPass) {
224224
accelerator,
225225
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
226226
sizeof(cl_uint),
227-
reinterpret_cast<void *>(&parm_value),
227+
&param_value,
228228
&param_value_size_ret);
229229

230230
EXPECT_EQ(CL_SUCCESS, result);
231-
EXPECT_EQ(2u, parm_value);
231+
EXPECT_EQ(2u, param_value);
232232

233233
result = clReleaseAcceleratorINTEL(accelerator);
234234

@@ -238,11 +238,11 @@ TEST_F(IntelAcceleratorGetInfoTest, GetInfoReferenceCount2ExpectPass) {
238238
accelerator,
239239
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
240240
sizeof(cl_uint),
241-
reinterpret_cast<void *>(&parm_value),
241+
&param_value,
242242
&param_value_size_ret);
243243

244244
EXPECT_EQ(CL_SUCCESS, result);
245-
EXPECT_EQ(1u, parm_value);
245+
EXPECT_EQ(1u, param_value);
246246
}
247247

248248
TEST_F(IntelAcceleratorGetInfoTest, GetInfoContextNullReturnExpectPass) {
@@ -258,44 +258,44 @@ TEST_F(IntelAcceleratorGetInfoTest, GetInfoContextNullReturnExpectPass) {
258258
}
259259

260260
TEST_F(IntelAcceleratorGetInfoTest, GetInfoContextLongExpectPass) {
261-
cl_context parm_value = reinterpret_cast<cl_context>(-1);
261+
cl_context param_value = reinterpret_cast<cl_context>(-1);
262262

263263
result = clGetAcceleratorInfoINTEL(
264264
accelerator,
265265
CL_ACCELERATOR_CONTEXT_INTEL,
266266
sizeof(cl_context) + 1,
267-
reinterpret_cast<void *>(&parm_value),
267+
&param_value,
268268
&param_value_size_ret);
269269

270270
EXPECT_EQ(CL_SUCCESS, result);
271271
EXPECT_EQ(sizeof(cl_context), param_value_size_ret);
272272
}
273273

274274
TEST_F(IntelAcceleratorGetInfoTest, GetInfoContextLongExpectRightContext) {
275-
cl_context parm_value = reinterpret_cast<cl_context>(-1);
275+
cl_context param_value = reinterpret_cast<cl_context>(-1);
276276

277277
result = clGetAcceleratorInfoINTEL(
278278
accelerator,
279279
CL_ACCELERATOR_CONTEXT_INTEL,
280280
sizeof(cl_context),
281-
reinterpret_cast<void *>(&parm_value),
281+
&param_value,
282282
&param_value_size_ret);
283283

284284
EXPECT_EQ(CL_SUCCESS, result);
285285
EXPECT_EQ(sizeof(cl_context), param_value_size_ret);
286286

287287
cl_context referenceContext = static_cast<cl_context>(pContext);
288-
EXPECT_EQ(referenceContext, parm_value);
288+
EXPECT_EQ(referenceContext, param_value);
289289
}
290290

291291
TEST_F(IntelAcceleratorGetInfoTest, GetInfoContextShortExpectPass) {
292-
cl_context parm_value = reinterpret_cast<cl_context>(-1);
292+
cl_context param_value = reinterpret_cast<cl_context>(-1);
293293

294294
result = clGetAcceleratorInfoINTEL(
295295
accelerator,
296296
CL_ACCELERATOR_CONTEXT_INTEL,
297297
sizeof(cl_context) - 1,
298-
reinterpret_cast<void *>(&parm_value),
298+
&param_value,
299299
&param_value_size_ret);
300300

301301
EXPECT_EQ(CL_INVALID_VALUE, result);

unit_tests/api/cl_intel_motion_estimation.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ TEST_F(IntelMotionEstimationGetInfoTest, getInfoDescriptorExactExpectPass) {
247247
accelerator,
248248
CL_ACCELERATOR_DESCRIPTOR_INTEL,
249249
sizeof(cl_motion_estimation_desc_intel), // exact
250-
reinterpret_cast<void *>(&descReturn),
250+
&descReturn,
251251
&param_value_size_ret);
252252

253253
EXPECT_EQ(CL_SUCCESS, result);
@@ -264,7 +264,7 @@ TEST_F(IntelMotionEstimationGetInfoTest, getInfoDescriptorShortExpectFail) {
264264
accelerator,
265265
CL_ACCELERATOR_DESCRIPTOR_INTEL,
266266
sizeof(cl_motion_estimation_desc_intel) - 1, // short
267-
reinterpret_cast<void *>(&descReturn),
267+
&descReturn,
268268
&param_value_size_ret);
269269

270270
EXPECT_EQ(CL_INVALID_VALUE, result);
@@ -276,7 +276,7 @@ TEST_F(IntelMotionEstimationGetInfoTest, getInfoDescriptorVeryShortExpectFail) {
276276
accelerator,
277277
CL_ACCELERATOR_DESCRIPTOR_INTEL,
278278
0, // very short
279-
reinterpret_cast<void *>(&descReturn),
279+
&descReturn,
280280
&param_value_size_ret);
281281

282282
EXPECT_EQ(CL_INVALID_VALUE, result);
@@ -288,7 +288,7 @@ TEST_F(IntelMotionEstimationGetInfoTest, getInfoDescriptorLongExpectPass) {
288288
accelerator,
289289
CL_ACCELERATOR_DESCRIPTOR_INTEL,
290290
sizeof(cl_motion_estimation_desc_intel) + 1, // long
291-
reinterpret_cast<void *>(&descReturn),
291+
&descReturn,
292292
&param_value_size_ret);
293293

294294
EXPECT_EQ(CL_SUCCESS, result);
@@ -314,7 +314,7 @@ TEST_F(IntelMotionEstimationGetInfoTest, getInfoTypeExpectPass) {
314314
accelerator,
315315
CL_ACCELERATOR_TYPE_INTEL,
316316
sizeof(cl_uint),
317-
reinterpret_cast<void *>(&type_returned),
317+
&type_returned,
318318
&param_value_size_ret);
319319

320320
EXPECT_EQ(CL_SUCCESS, result);
@@ -328,7 +328,7 @@ TEST_F(IntelMotionEstimationGetInfoTest, getInfoTypeExactExpectPass) {
328328
accelerator,
329329
CL_ACCELERATOR_TYPE_INTEL,
330330
sizeof(cl_uint), // exact
331-
reinterpret_cast<void *>(&type_returned),
331+
&type_returned,
332332
&param_value_size_ret);
333333

334334
EXPECT_EQ(CL_SUCCESS, result);
@@ -342,7 +342,7 @@ TEST_F(IntelMotionEstimationGetInfoTest, getInfoTypeShortExpectFail) {
342342
accelerator,
343343
CL_ACCELERATOR_TYPE_INTEL,
344344
sizeof(cl_uint) - 1, // short
345-
reinterpret_cast<void *>(&type_returned),
345+
&type_returned,
346346
&param_value_size_ret);
347347

348348
EXPECT_EQ(CL_INVALID_VALUE, result);
@@ -354,7 +354,7 @@ TEST_F(IntelMotionEstimationGetInfoTest, getInfoTypeVeryShortExpectFail) {
354354
accelerator,
355355
CL_ACCELERATOR_TYPE_INTEL,
356356
0, // very short
357-
reinterpret_cast<void *>(&type_returned),
357+
&type_returned,
358358
&param_value_size_ret);
359359

360360
EXPECT_EQ(CL_INVALID_VALUE, result);
@@ -366,7 +366,7 @@ TEST_F(IntelMotionEstimationGetInfoTest, getInfoTypeLongExpectPass) {
366366
accelerator,
367367
CL_ACCELERATOR_TYPE_INTEL,
368368
sizeof(cl_uint) + 1, // long
369-
reinterpret_cast<void *>(&type_returned),
369+
&type_returned,
370370
&param_value_size_ret);
371371

372372
EXPECT_EQ(CL_SUCCESS, result);

unit_tests/aub_mem_dump/lrca_helper_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ TEST(LrcaHelper, WhenLrcaHelperIsInitializedThenLrcaIncludesDebugModeLri) {
1717

1818
auto lrcaBufferSize = helper.sizeLRCA / sizeof(uint32_t);
1919
auto lrca = std::unique_ptr<uint32_t[]>(new uint32_t[lrcaBufferSize]);
20-
helper.initialize(reinterpret_cast<void *>(lrca.get()));
20+
helper.initialize(lrca.get());
2121

2222
bool debugModeLriFound = false;
2323
for (uint32_t i = 0; i < lrcaBufferSize; i += 2) {

unit_tests/event/async_events_handler_tests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ TEST_F(AsyncEventsHandlerTests, givenEventsNotHandledByHandlderWhenAsyncExecutio
207207
EXPECT_EQ(3, event1->getRefInternalCount());
208208
EXPECT_EQ(3, event2->getRefInternalCount());
209209
handler->allowAsyncProcess.store(false);
210-
MockHandler::asyncProcess(reinterpret_cast<void *>(handler.get())); // enter and exit because of allowAsyncProcess == false
210+
MockHandler::asyncProcess(handler.get()); // enter and exit because of allowAsyncProcess == false
211211
EXPECT_EQ(2, event1->getRefInternalCount());
212212
EXPECT_EQ(2, event2->getRefInternalCount());
213213
EXPECT_TRUE(handler->peekIsListEmpty());
@@ -349,7 +349,7 @@ TEST_F(AsyncEventsHandlerTests, givenSleepCandidateWhenProcessedThenCallWaitWith
349349

350350
EXPECT_CALL(*event1, wait(true, true)).Times(1).WillOnce(Invoke(unsetAsyncFlag));
351351

352-
MockHandler::asyncProcess(reinterpret_cast<void *>(handler.get()));
352+
MockHandler::asyncProcess(handler.get());
353353

354354
event1->setStatus(CL_COMPLETE);
355355
}
@@ -360,7 +360,7 @@ TEST_F(AsyncEventsHandlerTests, asyncProcessCallsProcessListBeforeReturning) {
360360
handler->registerEvent(event);
361361
handler->allowAsyncProcess.store(false);
362362

363-
MockHandler::asyncProcess(reinterpret_cast<void *>(handler.get()));
363+
MockHandler::asyncProcess(handler.get());
364364
EXPECT_TRUE(handler->peekIsListEmpty());
365365
EXPECT_EQ(1, event->getRefInternalCount());
366366

unit_tests/sampler/sampler_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ TEST(castToSamplerTest, GivenGenericPointerWhichHoldsSamplerObjectWhenCastToSamp
137137
TEST(castToSamplerTest, GivenGenericPointerWhichDoestNotHoldSamplerObjectWhenCastToSamplerIsCalledThenCastWithAFailure) {
138138
auto context = std::make_unique<MockContext>();
139139
auto notSamplerObj = std::unique_ptr<Image>(ImageHelper<Image2dDefaults>::create(context.get()));
140-
auto ptr = reinterpret_cast<void *>(notSamplerObj.get());
140+
void *ptr = notSamplerObj.get();
141141
auto notSampler = castToObject<Sampler>(ptr);
142142

143143
EXPECT_EQ(nullptr, notSampler);

0 commit comments

Comments
 (0)