From 22abf0836369c6059e4eeca2f74326d33b58e9e6 Mon Sep 17 00:00:00 2001
From: Timm Fitschen <t.fitschen@indiscale.com>
Date: Mon, 27 Sep 2021 10:51:42 +0200
Subject: [PATCH] BUG: Add enum name to cases.

---
 include/caosdb/transaction.h | 30 +++++++++++++++---------------
 src/caosdb/transaction.cpp   |  4 ++--
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/include/caosdb/transaction.h b/include/caosdb/transaction.h
index 68040dc..1355b86 100644
--- a/include/caosdb/transaction.h
+++ b/include/caosdb/transaction.h
@@ -55,12 +55,12 @@
     return StatusCode::TRANSACTION_STATUS_ERROR;                                                   \
   }                                                                                                \
   switch (this->transaction_type) {                                                                \
-  case NONE:                                                                                       \
+  case TransactionType::NONE:                                                                      \
     this->transaction_type = TransactionType::READ_ONLY;                                           \
     break;                                                                                         \
-  case READ_ONLY:                                                                                  \
+  case TransactionType::READ_ONLY:                                                                 \
     break;                                                                                         \
-  case MIXED_READ_AND_WRITE:                                                                       \
+  case TransactionType::MIXED_READ_AND_WRITE:                                                      \
     break;                                                                                         \
   default:                                                                                         \
     CAOSDB_LOG_ERROR_AND_RETURN_STATUS(                                                            \
@@ -91,11 +91,11 @@
     return StatusCode::TRANSACTION_STATUS_ERROR;                                                   \
   }                                                                                                \
   switch (this->transaction_type) {                                                                \
-  case NONE:                                                                                       \
+  case TransactionType::NONE:                                                                      \
     this->transaction_type = TransactionType::DELETE;                                              \
-  case DELETE:                                                                                     \
-  case MIXED_WRITE:                                                                                \
-  case MIXED_READ_AND_WRITE:                                                                       \
+  case TransactionType::DELETE:                                                                    \
+  case TransactionType::MIXED_WRITE:                                                               \
+  case TransactionType::MIXED_READ_AND_WRITE:                                                      \
     break;                                                                                         \
   default:                                                                                         \
     CAOSDB_LOG_ERROR_AND_RETURN_STATUS(                                                            \
@@ -113,11 +113,11 @@
     return StatusCode::TRANSACTION_STATUS_ERROR;                                                   \
   }                                                                                                \
   switch (this->transaction_type) {                                                                \
-  case NONE:                                                                                       \
+  case TransactionType::NONE:                                                                      \
     this->transaction_type = TransactionType::INSERT;                                              \
-  case INSERT:                                                                                     \
-  case MIXED_WRITE:                                                                                \
-  case MIXED_READ_AND_WRITE:                                                                       \
+  case TransactionType::INSERT:                                                                    \
+  case TransactionType::MIXED_WRITE:                                                               \
+  case TransactionType::MIXED_READ_AND_WRITE:                                                      \
     break;                                                                                         \
   default:                                                                                         \
     CAOSDB_LOG_ERROR_AND_RETURN_STATUS(                                                            \
@@ -135,11 +135,11 @@
     return StatusCode::TRANSACTION_STATUS_ERROR;                                                   \
   }                                                                                                \
   switch (this->transaction_type) {                                                                \
-  case NONE:                                                                                       \
+  case TransactionType::NONE:                                                                      \
     this->transaction_type = TransactionType::INSERT;                                              \
-  case INSERT:                                                                                     \
-  case MIXED_WRITE:                                                                                \
-  case MIXED_READ_AND_WRITE:                                                                       \
+  case TransactionType::INSERT:                                                                    \
+  case TransactionType::MIXED_WRITE:                                                               \
+  case TransactionType::MIXED_READ_AND_WRITE:                                                      \
     break;                                                                                         \
   default:                                                                                         \
     CAOSDB_LOG_ERROR_AND_RETURN_STATUS(                                                            \
diff --git a/src/caosdb/transaction.cpp b/src/caosdb/transaction.cpp
index 6380dcd..637112d 100644
--- a/src/caosdb/transaction.cpp
+++ b/src/caosdb/transaction.cpp
@@ -193,13 +193,13 @@ auto Transaction::ExecuteAsynchronously() noexcept -> StatusCode { // NOLINT
     return StatusCode::TRANSACTION_STATUS_ERROR;
   }
   switch (this->transaction_type) {
-  case MIXED_WRITE:
+  case TransactionType::MIXED_WRITE:
     CAOSDB_LOG_ERROR_AND_RETURN_STATUS(
       logger_name, StatusCode::UNSUPPORTED_FEATURE,
       "MIXED_WRITE UNSUPPORTED: The current implementation does not support "
       "mixed write transactions (containing insertions, deletions, and updates "
       "in one transaction).")
-  case MIXED_READ_AND_WRITE:
+  case TransactionType::MIXED_READ_AND_WRITE:
     CAOSDB_LOG_ERROR_AND_RETURN_STATUS(
       logger_name, StatusCode::UNSUPPORTED_FEATURE,
       "MIXED_WRITE UNSUPPORTED: The current implementation does not support "
-- 
GitLab