diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-11-19 19:36:24 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-11-20 09:41:31 -0500 |
commit | c24eba06580cbeb1e6a6d0a4d3fe2cfa22abd8a7 (patch) | |
tree | 18ea8f309da86db6f5566033ab531e9faf575a51 | |
parent | e3ece4b31f734ceffab8fd082c447dac5552d207 (diff) |
C++ style struct / enum declarations without typedef.
Change-Id: Idf9e7ddaf4b28c00222470460478631c37c79a6b
-rw-r--r-- | sc/source/core/opencl/opencl_device.cxx | 8 | ||||
-rw-r--r-- | sc/source/core/opencl/opencl_device_selection.h | 20 |
2 files changed, 16 insertions, 12 deletions
diff --git a/sc/source/core/opencl/opencl_device.cxx b/sc/source/core/opencl/opencl_device.cxx index 65317c0467cc..bb12593d4a92 100644 --- a/sc/source/core/opencl/opencl_device.cxx +++ b/sc/source/core/opencl/opencl_device.cxx @@ -42,11 +42,11 @@ bool bIsInited = false; bool bIsDeviceSelected = false; ds_device selectedDevice; -typedef struct LibreOfficeDeviceScore +struct LibreOfficeDeviceScore { double fTime; // small time means faster device bool bNoCLErrors; // were there any opencl errors -} LibreOfficeDeviceScore; +}; struct LibreOfficeDeviceEvaluationIO { @@ -59,14 +59,14 @@ struct LibreOfficeDeviceEvaluationIO unsigned long outputSize; }; -typedef struct timer +struct timer { #ifdef _WIN32 LARGE_INTEGER start, stop, frequency; #else long long start, stop, frequency; #endif -} timer; +}; const char* source = STRINGIFY( \n#if defined(KHR_DP_EXTENSION) diff --git a/sc/source/core/opencl/opencl_device_selection.h b/sc/source/core/opencl/opencl_device_selection.h index 5761951b2319..b4c60b9361e5 100644 --- a/sc/source/core/opencl/opencl_device_selection.h +++ b/sc/source/core/opencl/opencl_device_selection.h @@ -22,7 +22,8 @@ #define DS_DEVICE_NAME_LENGTH 256 -typedef enum { +enum ds_status +{ DS_SUCCESS = 0 ,DS_INVALID_PROFILE = 1000 ,DS_MEMORY_ERROR @@ -34,28 +35,31 @@ typedef enum { , DS_PROFILE_FILE_ERROR , DS_SCORE_SERIALIZER_ERROR , DS_SCORE_DESERIALIZER_ERROR -} ds_status; +}; // device type -typedef enum { +enum ds_device_type +{ DS_DEVICE_NATIVE_CPU = 0 ,DS_DEVICE_OPENCL_DEVICE -} ds_device_type; +}; -typedef struct { +struct ds_device +{ ds_device_type type; cl_device_id oclDeviceID; char* oclDeviceName; char* oclDriverVersion; void* score; // a pointer to the score data, the content/format is application defined -} ds_device; +}; -typedef struct { +struct ds_profile +{ unsigned int numDevices; ds_device* devices; const char* version; -} ds_profile; +}; // deallocate memory used by score typedef ds_status(* ds_score_release)(void* score); |