@@ -37,7 +37,7 @@ char* common_read_file(const char *path, long *length_out) {
37
37
fseek (f , 0 , SEEK_END );
38
38
length = ftell (f );
39
39
fseek (f , 0 , SEEK_SET );
40
- buffer = malloc (length );
40
+ buffer = ( char * ) malloc (length );
41
41
if (fread (buffer , 1 , length , f ) < (size_t )length ) {
42
42
return NULL ;
43
43
}
@@ -52,7 +52,7 @@ char* common_read_file_null(const char *path) {
52
52
char * f ;
53
53
long length ;
54
54
f = common_read_file (path , & length );
55
- f = realloc (f , length + 1 );
55
+ f = ( char * ) realloc (f , length + 1 );
56
56
f [length ] = '\0' ;
57
57
return f ;
58
58
}
@@ -68,7 +68,7 @@ void common_build_program(
68
68
ret = clBuildProgram (* program , 1 , & (common -> device ), options , NULL , NULL );
69
69
if (CL_SUCCESS != ret ) {
70
70
clGetProgramBuildInfo (* program , common -> device , CL_PROGRAM_BUILD_LOG , 0 , NULL , & err_len );
71
- err = malloc (err_len );
71
+ err = ( char * ) malloc (err_len );
72
72
clGetProgramBuildInfo (* program , common -> device , CL_PROGRAM_BUILD_LOG , err_len , err , NULL );
73
73
fprintf (stderr , "error: clBuildProgram:\n%s\n" , err );
74
74
free (err );
@@ -195,7 +195,7 @@ void common_create_kernel_or_use_cache(
195
195
} else {
196
196
common_init_file (common , source_path );
197
197
clGetProgramInfo (common -> program , CL_PROGRAM_BINARY_SIZES , sizeof (size_t ), & binary_size , NULL );
198
- binary = malloc (binary_size );
198
+ binary = ( char * ) malloc (binary_size );
199
199
clGetProgramInfo (common -> program , CL_PROGRAM_BINARIES , binary_size , & binary , NULL );
200
200
f = fopen (bin_path , "w" );
201
201
fwrite (binary , binary_size , 1 , f );
0 commit comments