Skip to content

Commit 0de4ac1

Browse files
committed
Fix Coverity RULE_OF_ZERO_THREE_FIVE errors
Fixes: ``` include/acl_thread.h:121:7: Type: Rule of three (RULE_OF_ZERO_THREE_FIVE) include/acl_thread.h:121:7: rule_of_three_violation: Class "acl_suspend_lock_guard" has a user definition for at least one special function (copy constructor, copy assignment, destructor) but not all. If one of these functions requires a user definition then the others likely do as well. include/acl_thread.h:121:7: remediation: Add user-definition for a copy constructor. include/acl_thread.h:121:7: remediation: Add user-definition for a copy assignment operator. include/acl_thread.h:126:3: destructor: User-defined destructor. include/acl_types.h:362:7: Type: Rule of three (RULE_OF_ZERO_THREE_FIVE) include/acl_types.h:362:7: rule_of_three_violation: Class "acl_device_program_info_t" has a user definition for at least one special function (copy constructor, copy assignment, destructor) but not all. If one of these functions requires a user definition then the others likely do as well. include/acl_types.h:362:7: remediation: Add user-definition for a copy constructor. include/acl_types.h:362:7: remediation: Add user-definition for a copy assignment operator. src/acl_device_program_info.cpp:29:28: destructor: User-defined destructor. ```
1 parent 10bd4e6 commit 0de4ac1

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

include/acl_thread.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ class acl_suspend_lock_guard {
125125
};
126126
~acl_suspend_lock_guard() { mutex.resume_lock(lock_count); }
127127

128+
// Delete copy constructor and copy assignment
129+
acl_suspend_lock_guard(const acl_suspend_lock_guard &) = delete;
130+
acl_suspend_lock_guard &operator=(const acl_suspend_lock_guard &) = delete;
131+
128132
private:
129133
int lock_count;
130134
acl_mutex_wrapper_t &mutex;

include/acl_types.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,11 @@ class acl_device_program_info_t {
365365

366366
~acl_device_program_info_t();
367367

368+
// Delete copy constructor and copy assignment
369+
acl_device_program_info_t(const acl_device_program_info_t &) = delete;
370+
acl_device_program_info_t &
371+
operator=(const acl_device_program_info_t &) = delete;
372+
368373
cl_program program = nullptr; // Back pointer.
369374
cl_device_id device = nullptr; // For what device? Shortcut only.
370375

0 commit comments

Comments
 (0)