diff --git a/lib/opencl_boinc.cpp b/lib/opencl_boinc.cpp
index bb828a4d07..227b2944df 100644
--- a/lib/opencl_boinc.cpp
+++ b/lib/opencl_boinc.cpp
@@ -48,7 +48,7 @@ void OPENCL_DEVICE_PROP::write_xml(MIOFILE& f, const char* tag, bool temp_file)
" <%s>\n"
" %s\n"
" %s\n"
- " %u\n"
+ " %lu\n"
" %d\n"
" %llu\n"
" %llu\n"
@@ -58,15 +58,15 @@ void OPENCL_DEVICE_PROP::write_xml(MIOFILE& f, const char* tag, bool temp_file)
" %s\n"
" %llu\n"
" %llu\n"
- " %u\n"
- " %u\n"
+ " %lu\n"
+ " %lu\n"
" %s\n"
" %s\n"
" %s\n",
tag,
name,
vendor,
- vendor_id,
+ (long)vendor_id,
available ? 1 : 0,
half_fp_config,
single_fp_config,
@@ -76,8 +76,8 @@ void OPENCL_DEVICE_PROP::write_xml(MIOFILE& f, const char* tag, bool temp_file)
extensions,
global_mem_size,
local_mem_size,
- max_clock_frequency,
- max_compute_units,
+ (long)max_clock_frequency,
+ (long)max_compute_units,
opencl_platform_version,
opencl_device_version,
opencl_driver_version