summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2020-12-04 19:51:29 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2020-12-04 19:51:29 +0000
commit9d03e663e2edf3c992dfba92f15ac597ca864530 (patch)
tree5902200b7984fbac82ca5d06cf0d843e466dd57f
parentAdd a check to satisfy an otherwise valid cppcheck (diff)
downloadlibadhocutil-9d03e663e2edf3c992dfba92f15ac597ca864530.tar.bz2
libadhocutil-9d03e663e2edf3c992dfba92f15ac597ca864530.tar.xz
libadhocutil-9d03e663e2edf3c992dfba92f15ac597ca864530.zip
Remove copy initialisation of locks in ScopeLock
-rw-r--r--libadhocutil/lockHelpers.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libadhocutil/lockHelpers.h b/libadhocutil/lockHelpers.h
index 4bb285b..d306f9c 100644
--- a/libadhocutil/lockHelpers.h
+++ b/libadhocutil/lockHelpers.h
@@ -6,7 +6,7 @@
#define LIBADHOC_LOCK_WITHLINE(a) LIBADHOC_LOCK_CONCAT(a, __LINE__)
#define BaseLock(l, lt) lt LIBADHOC_LOCK_WITHLINE(_lck)(l)
-#define BaseScopeLock(l, lt) if (auto LIBADHOC_LOCK_WITHLINE(_lck) = lt(l))
+#define BaseScopeLock(l, lt) if (lt LIBADHOC_LOCK_WITHLINE(_lck) {l})
#define Lock(l) BaseLock(l, std::unique_lock)
#define SharedLock(l) BaseLock(l, std::shared_lock)