From 228f626a01936e87edaa09c421792fe2a98c7586 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 11 Sep 2011 22:22:55 +0000 Subject: [PATCH] - API: change boinc_get_opencl_ids() to use APP_INIT_DATA instead of cmdline svn path=/trunk/boinc/; revision=24159 --- api/boinc_api.cpp | 4 ++-- api/boinc_api.h | 1 + api/boinc_opencl.cpp | 32 +++++++++++--------------------- api/boinc_opencl.h | 17 +++++------------ checkin_notes | 8 ++++++++ 5 files changed, 27 insertions(+), 35 deletions(-) diff --git a/api/boinc_api.cpp b/api/boinc_api.cpp index 82d3c6de82..7d3e00d28c 100644 --- a/api/boinc_api.cpp +++ b/api/boinc_api.cpp @@ -112,7 +112,7 @@ using std::vector; #endif const char* api_version="API_VERSION_"PACKAGE_VERSION; -static APP_INIT_DATA aid; +APP_INIT_DATA aid; static FILE_LOCK file_lock; APP_CLIENT_SHM* app_client_shm = 0; static volatile int time_until_checkpoint; @@ -660,7 +660,7 @@ void boinc_exit(int status) { fflush(NULL); #if defined(_WIN32) - // Halt all the threads and cleans up. + // Halt all the threads and clean up. TerminateProcess(GetCurrentProcess(), status); // note: the above CAN return! Sleep(1000); diff --git a/api/boinc_api.h b/api/boinc_api.h index 1244e896e9..9c3dd7eff0 100644 --- a/api/boinc_api.h +++ b/api/boinc_api.h @@ -85,6 +85,7 @@ extern volatile BOINC_STATUS boinc_status; typedef void (*FUNC_PTR)(); struct APP_INIT_DATA; +extern APP_INIT_DATA aid; extern int boinc_init(void); extern int boinc_finish(int status); diff --git a/api/boinc_opencl.cpp b/api/boinc_opencl.cpp index 2326abd1d0..2f0713cf4e 100644 --- a/api/boinc_opencl.cpp +++ b/api/boinc_opencl.cpp @@ -47,6 +47,7 @@ #include #include "error_numbers.h" +#include "boinc_api.h" #include "coproc.h" @@ -101,35 +102,22 @@ int boinc_get_opencl_ids_aux( return 0; } -int boinc_get_opencl_ids( - int argc, char** argv, cl_device_id* device, cl_platform_id* platform -) { - char type[256]; - int device_num, retval=0; +int boinc_get_opencl_ids(cl_device_id* device, cl_platform_id* platform) { + int retval=0; - strcpy(type, ""); - device_num = -1; - - for (int i=1; i