Skip to content

Commit bfa9ddf

Browse files
committed
Use macro dedicated for string parameter values.
1 parent 5304a9c commit bfa9ddf

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

loader/icd_dispatch.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ clGetICDLoaderInfoOCLICD(
3737
size_t pvs;
3838
void * pv;
3939

40-
#define KHR_ICD_CASE_PARAM_NAME(name) \
40+
#define KHR_ICD_CASE_STRING_PARAM_NAME(name) \
4141
case CL_ICDL_ ## name: \
42-
pvs = sizeof(cl_icdl_ ## name); \
42+
pvs = strlen(cl_icdl_ ## name) + 1; \
4343
pv = (void *)cl_icdl_ ## name; \
4444
break
4545

4646
switch (param_name) {
47-
KHR_ICD_CASE_PARAM_NAME(OCL_VERSION);
48-
KHR_ICD_CASE_PARAM_NAME(VERSION);
49-
KHR_ICD_CASE_PARAM_NAME(NAME);
50-
KHR_ICD_CASE_PARAM_NAME(VENDOR);
47+
KHR_ICD_CASE_STRING_PARAM_NAME(OCL_VERSION);
48+
KHR_ICD_CASE_STRING_PARAM_NAME(VERSION);
49+
KHR_ICD_CASE_STRING_PARAM_NAME(NAME);
50+
KHR_ICD_CASE_STRING_PARAM_NAME(VENDOR);
5151
default:
5252
return CL_INVALID_VALUE;
5353
}

0 commit comments

Comments
 (0)