wsl/hsakmt: Fix conversion warnings by using 0 for Non-Pointers
This patch addresses several compiler warnings related to the use of NULL with non-pointer types, such as D3DKMT_HANDLE, uint64_t, and uint32_t. Signed-off-by: Horatio Zhang <Hongkun.Zhang@amd.com> Reviewed-by: tiancyin <tianci.yin@amd.com> Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/16>
Этот коммит содержится в:
коммит произвёл
Frank Min
родитель
9f5bda00ca
Коммит
ce64cf0314
@@ -69,9 +69,9 @@ public:
|
||||
uint32_t engine,
|
||||
bool use_hws = true) :
|
||||
device(device),
|
||||
context(NULL),
|
||||
queue(NULL),
|
||||
syncobj(NULL),
|
||||
context(0),
|
||||
queue(0),
|
||||
syncobj(0),
|
||||
sync_addr(NULL),
|
||||
cmdbuf(0),
|
||||
cmdbuf_addr(cmdbuf_addr),
|
||||
|
||||
@@ -256,8 +256,8 @@ size_t CmdUtil::BuildDispatch(
|
||||
// This feature may be enabled as a side effect of indirect calls.
|
||||
// However, the compiler team confirmed that the dispatch id itself is not used,
|
||||
// so safe to send 0 for each dispatch.
|
||||
dispatch.compute_user_data_regs.compute_user_data[sgpr_no++] = NULL;
|
||||
dispatch.compute_user_data_regs.compute_user_data[sgpr_no++] = NULL;
|
||||
dispatch.compute_user_data_regs.compute_user_data[sgpr_no++] = 0;
|
||||
dispatch.compute_user_data_regs.compute_user_data[sgpr_no++] = 0;
|
||||
}
|
||||
if (AMD_HSA_BITS_GET(pInfo->pKernelObject->kernel_code_properties,
|
||||
AMD_KERNEL_CODE_PROPERTIES_ENABLE_SGPR_FLAT_SCRATCH_INIT)) {
|
||||
|
||||
@@ -528,7 +528,7 @@ uint64_t ComputeQueue::GetKernelObjAddr(uint64_t addr) const {
|
||||
auto ret = hsakmt_hsa_ven_amd_loader_query_host_address(reinterpret_cast<const void *>(addr),
|
||||
reinterpret_cast<const void **>(&host_addr));
|
||||
if (ret == HSA_STATUS_ERROR_INVALID_ARGUMENT) {
|
||||
return NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return host_addr;
|
||||
|
||||
Ссылка в новой задаче
Block a user