diff options
author | Jacqueline Molz <Jacqueline.Molz@bmw.de> | 2018-08-22 17:26:53 +0200 |
---|---|---|
committer | Jacqueline Molz <Jacqueline.Molz@bmw.de> | 2018-08-22 17:29:36 +0200 |
commit | 9a379652687bacab9a162d89c83829fff411340b (patch) | |
tree | 8168a89885ed3e7b30ad5ac2a449b3b07bc555c1 /AudioManagerUtilities | |
parent | 4f261b37238d310cc74ca5b1d9ca244ec3c5b70e (diff) | |
download | audiomanager-9a379652687bacab9a162d89c83829fff411340b.tar.gz |
Notifying observers of sound properties only by value changes.genivi_imp
Fix infinite loop in CAmDltWrapper by logging out enum values exceeding the boundaries.
Minor changes: Pull request 36
changed implementation to database macros (review comments)
added option "WITH_DATABASE_CHANGE_CHECK" to audiomanagerconfig.h.in
whitespace cleanup in test/AmMapHandlerTest/CAmMapHandlerTest.cpp
additional cast to uint in DB_UPDATE call in function removeMainConnectionDB to solve error in macro expansion
Diffstat (limited to 'AudioManagerUtilities')
-rw-r--r-- | AudioManagerUtilities/include/CAmDltWrapper.h | 55 | ||||
-rw-r--r-- | AudioManagerUtilities/include/CAmSerializer.h | 6 |
2 files changed, 33 insertions, 28 deletions
diff --git a/AudioManagerUtilities/include/CAmDltWrapper.h b/AudioManagerUtilities/include/CAmDltWrapper.h index b6772d9..a86b4dc 100644 --- a/AudioManagerUtilities/include/CAmDltWrapper.h +++ b/AudioManagerUtilities/include/CAmDltWrapper.h @@ -163,14 +163,11 @@ public: { #ifdef WITH_DLT # ifdef DLT_IS_LOG_LEVEL_ENABLED - if (mlogDestination == logDestination::DAEMON) - { - return (dlt_user_is_logLevel_enabled(&mDltContext, logLevel) == DLT_RETURN_TRUE); - } + return (dlt_user_is_logLevel_enabled(&mDltContext, logLevel) == DLT_RETURN_TRUE); # else (void)logLevel; -# endif // ifdef DLT_IS_LOG_LEVEL_ENABLED return true; +# endif #else // ifdef WITH_DLT return (logLevel <= mDltContext.log_level_user); #endif // ifdef WITH_DLT @@ -234,8 +231,9 @@ public: { if (static_cast<std::size_t>(value) >= mStr_error.size()) { - append("value for am_Error_e out of bounds!"); - append(static_cast<uint16_t>(value)); + std::ostringstream ss; + ss << "value for am_Error_e out of bounds! " << std::dec << (size_t)value; + append(ss.str().c_str()); return; } @@ -248,8 +246,9 @@ public: { if (static_cast<std::size_t>(value) >= mStr_sourceState.size()) { - append("value for am_SourceState_e out of bounds!"); - append(static_cast<uint16_t>(value)); + std::ostringstream ss; + ss << "value for am_SourceState_e out of bounds! " << std::dec << (size_t)value; + append(ss.str().c_str()); return; } @@ -261,8 +260,9 @@ public: { if (static_cast<std::size_t>(value) >= mStr_MuteState.size()) { - append("value for am_MuteState_e out of bounds!"); - append(static_cast<uint16_t>(value)); + std::ostringstream ss; + ss << "value for am_MuteState_e out of bounds! " << std::dec << (size_t)value; + append(ss.str().c_str()); return; } @@ -274,8 +274,10 @@ public: { if (static_cast<std::size_t>(value) >= mStr_DomainState.size()) { - append("value for am_DomainState_e out of bounds!"); - append(static_cast<uint16_t>(value)); + std::ostringstream ss; + ss << "value for am_DomainState_e out of bounds! " << std::dec << (size_t)value; + append(ss.str().c_str()); + return; } @@ -287,8 +289,9 @@ public: { if (static_cast<std::size_t>(value) >= mStr_ConnectionState.size()) { - append("value for am_ConnectionState_e out of bounds!"); - append(static_cast<uint16_t>(value)); + std::ostringstream ss; + ss << "value for am_ConnectionState_e out of bounds! " << std::dec << (size_t)value; + append(ss.str().c_str()); return; } @@ -300,8 +303,9 @@ public: { if (static_cast<std::size_t>(value) >= mStr_Availability.size()) { - append("value for am_Availability_e out of bounds!"); - append(static_cast<uint16_t>(value)); + std::ostringstream ss; + ss << "value for am_Availability_e out of bounds! " << std::dec << (size_t)value; + append(ss.str().c_str()); return; } @@ -313,8 +317,9 @@ public: { if (static_cast<std::size_t>(value) >= mStr_Interrupt.size()) { - append("value for am_InterruptState_e out of bounds!"); - append(static_cast<uint16_t>(value)); + std::ostringstream ss; + ss << "value for am_InterruptState_e out of bounds! " << std::dec << (size_t)value; + append(ss.str().c_str()); return; } @@ -326,8 +331,9 @@ public: { if (static_cast<std::size_t>(value) >= mStr_Handle.size()) { - append("value for am_Handle_e out of bounds!"); - append(static_cast<uint16_t>(value)); + std::ostringstream ss; + ss << "value for am_Handle_e out of bounds! " << std::dec << (size_t)value; + append(ss.str().c_str()); return; } @@ -346,8 +352,9 @@ public: { if (static_cast<std::size_t>(value) >= mStr_NotificationStatus.size()) { - append("value for am_NotificationStatus_e out of bounds!"); - append(static_cast<uint16_t>(value)); + std::ostringstream ss; + ss << "value for am_NotificationStatus_e out of bounds! " << std::dec << (size_t)value; + append(ss.str().c_str()); return; } @@ -368,7 +375,7 @@ public: void append(T value) { std::ostringstream ss; - ss << std::dec << value; + ss << std::dec << static_cast<int>(value); append(ss.str().c_str()); } diff --git a/AudioManagerUtilities/include/CAmSerializer.h b/AudioManagerUtilities/include/CAmSerializer.h index ad0b2b1..5fd1977 100644 --- a/AudioManagerUtilities/include/CAmSerializer.h +++ b/AudioManagerUtilities/include/CAmSerializer.h @@ -97,8 +97,7 @@ private: { public: - typedef enum - : bool + typedef enum : bool { SyncCallType = false, AsyncCallType = true } CallType; @@ -883,8 +882,7 @@ class CAmSerializer class CAmDelegate { public: - typedef enum - : bool + typedef enum : bool { SyncCallType = false, AsyncCallType = true } CallType; |