Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core_c] Move implementation to lang folder. #1904

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

KerstinKeller
Copy link
Contributor

In core, events are now enum class instead of enum.

Description

This PR splits C and C++ ecal files into 2 different folders and completely moves the C files to lang/c, thus C is now handled as a proper language bindings.
The two implementation do no longer share any header files.

In core, events are now enum class instead of enum.
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

/**
* @brief eCAL subscriber event callback type.
**/
enum class Subscriber_Event
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: enum 'Subscriber_Event' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]

              ^

/**
* @brief eCAL publisher event callback type.
**/
enum class Publisher_Event
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: enum 'Publisher_Event' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]

              ^

/**
* @brief eCAL service client event callback type.
**/
enum class Client_Event
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: enum 'Client_Event' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]

              ^

/**
* @brief eCAL service server event callback type.
**/
enum class Server_Event
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: enum 'Server_Event' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]

              ^

/**
* @brief Service call state.
**/
enum class eCallState
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: enum 'eCallState' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]

  enum class eCallState
             ^

@@ -52,7 +62,7 @@
SServiceResponse()
{
ret_state = 0;
call_state = call_state_none;
call_state = eCallState::call_state_none;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'call_state' should be initialized in an in-class default member initializer [cppcoreguidelines-prefer-member-initializer]

Suggested change
call_state = eCallState::call_state_none;

ecal/core/include/ecal/ecal_service_info.h:72:

-     eCallState   call_state;     //!< call state (see eCallState)
+     eCallState   call_state{eCallState::call_state_none};     //!< call state (see eCallState)

@@ -366,7 +366,7 @@ namespace eCAL
return(true);
}

bool CPublisherImpl::SetEventCallback(eCAL_Publisher_Event type_, const v5::PubEventCallbackT callback_)
bool CPublisherImpl::SetEventCallback(Publisher_Event type_, const v5::PubEventCallbackT callback_)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: the const qualified parameter 'callback_' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param]

ecal/core/src/pubsub/ecal_publisher_impl.h:85:

-     bool SetEventCallback(Publisher_Event type_, const v5::PubEventCallbackT callback_);
+     bool SetEventCallback(Publisher_Event type_, const v5::PubEventCallbackT& callback_);
Suggested change
bool CPublisherImpl::SetEventCallback(Publisher_Event type_, const v5::PubEventCallbackT callback_)
bool CPublisherImpl::SetEventCallback(Publisher_Event type_, const v5::PubEventCallbackT& callback_)

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 20 out of 65. Check the log or trigger a new build to see more.

}

log_proxy_model_->setLogLevelFilter((eCAL_Logging_eLogLevel)log_level_filter);
log_proxy_model_->setLogLevelFilter((eCAL::Logging::eLogLevel)log_level_filter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: The value '10' provided to the cast expression is not in the valid range of values for 'eLogLevel' [clang-analyzer-optin.core.EnumCastOutOfRange]

                                        ^
Additional context

ecal/core/include/ecal/ecal_log_level.h:36: enum declared here

    enum eLogLevel
         ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:390: Calling 'LogWidget::setLogLevelFilter'

;
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:410: Calling 'LogWidget::updateLogLevelFilter'

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Assuming the condition is false

        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Taking false branch

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:233: The value 10 is assigned to 'log_level_filter'

{
      ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:236: The value '10' provided to the cast expression is not in the valid range of values for 'eLogLevel'

                                        ^

}

log_proxy_model_->setLogLevelFilter((eCAL_Logging_eLogLevel)log_level_filter);
log_proxy_model_->setLogLevelFilter((eCAL::Logging::eLogLevel)log_level_filter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: The value '11' provided to the cast expression is not in the valid range of values for 'eLogLevel' [clang-analyzer-optin.core.EnumCastOutOfRange]

                                        ^
Additional context

ecal/core/include/ecal/ecal_log_level.h:36: enum declared here

    enum eLogLevel
         ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:390: Calling 'LogWidget::setLogLevelFilter'

;
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:410: Calling 'LogWidget::updateLogLevelFilter'

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Assuming the condition is false

        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Taking false branch

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:233: The value 11 is assigned to 'log_level_filter'

{
      ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:236: The value '11' provided to the cast expression is not in the valid range of values for 'eLogLevel'

                                        ^

}

log_proxy_model_->setLogLevelFilter((eCAL_Logging_eLogLevel)log_level_filter);
log_proxy_model_->setLogLevelFilter((eCAL::Logging::eLogLevel)log_level_filter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: The value '12' provided to the cast expression is not in the valid range of values for 'eLogLevel' [clang-analyzer-optin.core.EnumCastOutOfRange]

                                        ^
Additional context

ecal/core/include/ecal/ecal_log_level.h:36: enum declared here

    enum eLogLevel
         ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:390: Calling 'LogWidget::setLogLevelFilter'

;
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:410: Calling 'LogWidget::updateLogLevelFilter'

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Assuming the condition is false

        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Taking false branch

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:233: The value 12 is assigned to 'log_level_filter'

{
      ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:236: The value '12' provided to the cast expression is not in the valid range of values for 'eLogLevel'

                                        ^

}

log_proxy_model_->setLogLevelFilter((eCAL_Logging_eLogLevel)log_level_filter);
log_proxy_model_->setLogLevelFilter((eCAL::Logging::eLogLevel)log_level_filter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: The value '13' provided to the cast expression is not in the valid range of values for 'eLogLevel' [clang-analyzer-optin.core.EnumCastOutOfRange]

                                        ^
Additional context

ecal/core/include/ecal/ecal_log_level.h:36: enum declared here

    enum eLogLevel
         ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:390: Calling 'LogWidget::setLogLevelFilter'

;
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:410: Calling 'LogWidget::updateLogLevelFilter'

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Assuming the condition is false

        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Taking false branch

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:233: The value 13 is assigned to 'log_level_filter'

{
      ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:236: The value '13' provided to the cast expression is not in the valid range of values for 'eLogLevel'

                                        ^

}

log_proxy_model_->setLogLevelFilter((eCAL_Logging_eLogLevel)log_level_filter);
log_proxy_model_->setLogLevelFilter((eCAL::Logging::eLogLevel)log_level_filter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: The value '14' provided to the cast expression is not in the valid range of values for 'eLogLevel' [clang-analyzer-optin.core.EnumCastOutOfRange]

                                        ^
Additional context

ecal/core/include/ecal/ecal_log_level.h:36: enum declared here

    enum eLogLevel
         ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:390: Calling 'LogWidget::setLogLevelFilter'

;
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:410: Calling 'LogWidget::updateLogLevelFilter'

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Assuming the condition is false

        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Taking false branch

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:233: The value 14 is assigned to 'log_level_filter'

{
      ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:236: The value '14' provided to the cast expression is not in the valid range of values for 'eLogLevel'

                                        ^

}

log_proxy_model_->setLogLevelFilter((eCAL_Logging_eLogLevel)log_level_filter);
log_proxy_model_->setLogLevelFilter((eCAL::Logging::eLogLevel)log_level_filter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: The value '249' provided to the cast expression is not in the valid range of values for 'eLogLevel' [clang-analyzer-optin.core.EnumCastOutOfRange]

                                        ^
Additional context

ecal/core/include/ecal/ecal_log_level.h:36: enum declared here

    enum eLogLevel
         ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:390: Calling 'LogWidget::setLogLevelFilter'

;
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:410: Calling 'LogWidget::updateLogLevelFilter'

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Assuming the condition is true

        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Taking true branch

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:233: The value 249 is assigned to 'log_level_filter'

{
      ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:236: The value '249' provided to the cast expression is not in the valid range of values for 'eLogLevel'

                                        ^

}

log_proxy_model_->setLogLevelFilter((eCAL_Logging_eLogLevel)log_level_filter);
log_proxy_model_->setLogLevelFilter((eCAL::Logging::eLogLevel)log_level_filter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: The value '250' provided to the cast expression is not in the valid range of values for 'eLogLevel' [clang-analyzer-optin.core.EnumCastOutOfRange]

                                        ^
Additional context

ecal/core/include/ecal/ecal_log_level.h:36: enum declared here

    enum eLogLevel
         ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:390: Calling 'LogWidget::setLogLevelFilter'

;
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:410: Calling 'LogWidget::updateLogLevelFilter'

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Assuming the condition is true

        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Taking true branch

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:233: The value 250 is assigned to 'log_level_filter'

{
      ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:236: The value '250' provided to the cast expression is not in the valid range of values for 'eLogLevel'

                                        ^

}

log_proxy_model_->setLogLevelFilter((eCAL_Logging_eLogLevel)log_level_filter);
log_proxy_model_->setLogLevelFilter((eCAL::Logging::eLogLevel)log_level_filter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: The value '251' provided to the cast expression is not in the valid range of values for 'eLogLevel' [clang-analyzer-optin.core.EnumCastOutOfRange]

                                        ^
Additional context

ecal/core/include/ecal/ecal_log_level.h:36: enum declared here

    enum eLogLevel
         ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:390: Calling 'LogWidget::setLogLevelFilter'

;
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:410: Calling 'LogWidget::updateLogLevelFilter'

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Assuming the condition is true

        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Taking true branch

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:233: The value 251 is assigned to 'log_level_filter'

{
      ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:236: The value '251' provided to the cast expression is not in the valid range of values for 'eLogLevel'

                                        ^

}

log_proxy_model_->setLogLevelFilter((eCAL_Logging_eLogLevel)log_level_filter);
log_proxy_model_->setLogLevelFilter((eCAL::Logging::eLogLevel)log_level_filter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: The value '252' provided to the cast expression is not in the valid range of values for 'eLogLevel' [clang-analyzer-optin.core.EnumCastOutOfRange]

                                        ^
Additional context

ecal/core/include/ecal/ecal_log_level.h:36: enum declared here

    enum eLogLevel
         ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:390: Calling 'LogWidget::setLogLevelFilter'

;
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:410: Calling 'LogWidget::updateLogLevelFilter'

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Assuming the condition is true

        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Taking true branch

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:233: The value 252 is assigned to 'log_level_filter'

{
      ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:236: The value '252' provided to the cast expression is not in the valid range of values for 'eLogLevel'

                                        ^

}

log_proxy_model_->setLogLevelFilter((eCAL_Logging_eLogLevel)log_level_filter);
log_proxy_model_->setLogLevelFilter((eCAL::Logging::eLogLevel)log_level_filter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: The value '253' provided to the cast expression is not in the valid range of values for 'eLogLevel' [clang-analyzer-optin.core.EnumCastOutOfRange]

                                        ^
Additional context

ecal/core/include/ecal/ecal_log_level.h:36: enum declared here

    enum eLogLevel
         ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:390: Calling 'LogWidget::setLogLevelFilter'

;
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:410: Calling 'LogWidget::updateLogLevelFilter'

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Assuming the condition is true

        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Taking true branch

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:233: The value 253 is assigned to 'log_level_filter'

{
      ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:236: The value '253' provided to the cast expression is not in the valid range of values for 'eLogLevel'

                                        ^

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 20 out of 45. Check the log or trigger a new build to see more.

}

log_proxy_model_->setLogLevelFilter((eCAL_Logging_eLogLevel)log_level_filter);
log_proxy_model_->setLogLevelFilter((eCAL::Logging::eLogLevel)log_level_filter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: The value '254' provided to the cast expression is not in the valid range of values for 'eLogLevel' [clang-analyzer-optin.core.EnumCastOutOfRange]

                                        ^
Additional context

ecal/core/include/ecal/ecal_log_level.h:36: enum declared here

    enum eLogLevel
         ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:390: Calling 'LogWidget::setLogLevelFilter'

;
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:410: Calling 'LogWidget::updateLogLevelFilter'

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Assuming the condition is true

        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Taking true branch

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:233: The value 254 is assigned to 'log_level_filter'

{
      ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:236: The value '254' provided to the cast expression is not in the valid range of values for 'eLogLevel'

                                        ^

}

log_proxy_model_->setLogLevelFilter((eCAL_Logging_eLogLevel)log_level_filter);
log_proxy_model_->setLogLevelFilter((eCAL::Logging::eLogLevel)log_level_filter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: The value '3' provided to the cast expression is not in the valid range of values for 'eLogLevel' [clang-analyzer-optin.core.EnumCastOutOfRange]

                                        ^
Additional context

ecal/core/include/ecal/ecal_log_level.h:36: enum declared here

    enum eLogLevel
         ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:390: Calling 'LogWidget::setLogLevelFilter'

;
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:410: Calling 'LogWidget::updateLogLevelFilter'

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Assuming the condition is false

        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Taking false branch

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:225: The value 3 is assigned to 'log_level_filter'

{
      ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:236: The value '3' provided to the cast expression is not in the valid range of values for 'eLogLevel'

                                        ^

}

log_proxy_model_->setLogLevelFilter((eCAL_Logging_eLogLevel)log_level_filter);
log_proxy_model_->setLogLevelFilter((eCAL::Logging::eLogLevel)log_level_filter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: The value '5' provided to the cast expression is not in the valid range of values for 'eLogLevel' [clang-analyzer-optin.core.EnumCastOutOfRange]

                                        ^
Additional context

ecal/core/include/ecal/ecal_log_level.h:36: enum declared here

    enum eLogLevel
         ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:390: Calling 'LogWidget::setLogLevelFilter'

;
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:410: Calling 'LogWidget::updateLogLevelFilter'

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Assuming the condition is false

        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Taking false branch

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:229: The value 5 is assigned to 'log_level_filter'

{
      ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:236: The value '5' provided to the cast expression is not in the valid range of values for 'eLogLevel'

                                        ^

}

log_proxy_model_->setLogLevelFilter((eCAL_Logging_eLogLevel)log_level_filter);
log_proxy_model_->setLogLevelFilter((eCAL::Logging::eLogLevel)log_level_filter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: The value '6' provided to the cast expression is not in the valid range of values for 'eLogLevel' [clang-analyzer-optin.core.EnumCastOutOfRange]

                                        ^
Additional context

ecal/core/include/ecal/ecal_log_level.h:36: enum declared here

    enum eLogLevel
         ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:390: Calling 'LogWidget::setLogLevelFilter'

;
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:410: Calling 'LogWidget::updateLogLevelFilter'

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Assuming the condition is false

        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Taking false branch

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:229: The value 6 is assigned to 'log_level_filter'

{
      ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:236: The value '6' provided to the cast expression is not in the valid range of values for 'eLogLevel'

                                        ^

}

log_proxy_model_->setLogLevelFilter((eCAL_Logging_eLogLevel)log_level_filter);
log_proxy_model_->setLogLevelFilter((eCAL::Logging::eLogLevel)log_level_filter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: The value '7' provided to the cast expression is not in the valid range of values for 'eLogLevel' [clang-analyzer-optin.core.EnumCastOutOfRange]

                                        ^
Additional context

ecal/core/include/ecal/ecal_log_level.h:36: enum declared here

    enum eLogLevel
         ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:390: Calling 'LogWidget::setLogLevelFilter'

;
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:410: Calling 'LogWidget::updateLogLevelFilter'

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Assuming the condition is false

        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:215: Taking false branch

    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:219: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:223: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Assuming the condition is true

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:227: Taking true branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:229: The value 7 is assigned to 'log_level_filter'

{
      ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Assuming the condition is false

}
        ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:231: Taking false branch

}
    ^

app/mon/mon_gui/src/widgets/log_widget/log_widget.cpp:236: The value '7' provided to the cast expression is not in the valid range of values for 'eLogLevel'

                                        ^

SeverityModel* severity_model = static_cast<SeverityModel*>(combobox->model());
combobox->setCurrentIndex(severity_model->getRow(severity));
}
else if (index.column() == (int)GroupStateMinTaskStateTreeModel::Columns::SEVERITY_LEVEL)
{
eCAL_Process_eSeverity_Level severity_level = (eCAL_Process_eSeverity_Level)(current_int);
eCAL::Process::eSeverity_Level severity_level = (eCAL::Process::eSeverity_Level)(current_int);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'severity_level' of type 'eCAL::Process::eSeverity_Level' can be declared 'const' [misc-const-correctness]

Suggested change
eCAL::Process::eSeverity_Level severity_level = (eCAL::Process::eSeverity_Level)(current_int);
eCAL::Process::eSeverity_Level const severity_level = (eCAL::Process::eSeverity_Level)(current_int);

@@ -86,13 +86,13 @@
if (index.column() == (int)GroupStateMinTaskStateTreeModel::Columns::SEVERITY)
{
SeverityModel* severity_model = static_cast<SeverityModel*>(combobox->model());
eCAL_Process_eSeverity severity = severity_model->getSeverity(combobox->currentIndex());
eCAL::Process::eSeverity severity = severity_model->getSeverity(combobox->currentIndex());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'severity' of type 'eCAL::Process::eSeverity' can be declared 'const' [misc-const-correctness]

Suggested change
eCAL::Process::eSeverity severity = severity_model->getSeverity(combobox->currentIndex());
eCAL::Process::eSeverity const severity = severity_model->getSeverity(combobox->currentIndex());

model->setData(index, (int)severity, Qt::EditRole);
}
else if (index.column() == (int)GroupStateMinTaskStateTreeModel::Columns::SEVERITY_LEVEL)
{
SeverityLevelModel* severity_level_model = static_cast<SeverityLevelModel*>(combobox->model());
eCAL_Process_eSeverity_Level severity_level = severity_level_model->getSeverityLevel(combobox->currentIndex());
eCAL::Process::eSeverity_Level severity_level = severity_level_model->getSeverityLevel(combobox->currentIndex());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'severity_level' of type 'eCAL::Process::eSeverity_Level' can be declared 'const' [misc-const-correctness]

Suggested change
eCAL::Process::eSeverity_Level severity_level = severity_level_model->getSeverityLevel(combobox->currentIndex());
eCAL::Process::eSeverity_Level const severity_level = severity_level_model->getSeverityLevel(combobox->currentIndex());

rows.push_back(std::make_pair(QString("Level 3"), eCAL_Process_eSeverity_Level::proc_sev_level3));
rows.push_back(std::make_pair(QString("Level 4"), eCAL_Process_eSeverity_Level::proc_sev_level4));
rows.push_back(std::make_pair(QString("Level 5"), eCAL_Process_eSeverity_Level::proc_sev_level5));
rows.push_back(std::make_pair(QString("Level 1"), eCAL::Process::eSeverity_Level::proc_sev_level1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use emplace_back instead of push_back [modernize-use-emplace]

Suggested change
rows.push_back(std::make_pair(QString("Level 1"), eCAL::Process::eSeverity_Level::proc_sev_level1));
rows.emplace_back(QString("Level 1"), eCAL::Process::eSeverity_Level::proc_sev_level1);

rows.push_back(std::make_pair(QString("Level 4"), eCAL_Process_eSeverity_Level::proc_sev_level4));
rows.push_back(std::make_pair(QString("Level 5"), eCAL_Process_eSeverity_Level::proc_sev_level5));
rows.push_back(std::make_pair(QString("Level 1"), eCAL::Process::eSeverity_Level::proc_sev_level1));
rows.push_back(std::make_pair(QString("Level 2"), eCAL::Process::eSeverity_Level::proc_sev_level2));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use emplace_back instead of push_back [modernize-use-emplace]

Suggested change
rows.push_back(std::make_pair(QString("Level 2"), eCAL::Process::eSeverity_Level::proc_sev_level2));
rows.emplace_back(QString("Level 2"), eCAL::Process::eSeverity_Level::proc_sev_level2);

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 20 out of 46. Check the log or trigger a new build to see more.

std::cout << termcolor::on_magenta;
break;
default:
break;
}

std::cout << "State: " << (task_state.severity == eCAL_Process_eSeverity::proc_sev_unknown ? state : state + " " + level) << std::endl;
std::cout << "State: " << (task_state.severity == eCAL::Process::eSeverity::unknown ? state : state + " " + level) << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not use 'std::endl' with streams; use '\n' instead [performance-avoid-endl]

Suggested change
std::cout << "State: " << (task_state.severity == eCAL::Process::eSeverity::unknown ? state : state + " " + level) << std::endl;
std::cout << "State: " << (task_state.severity == eCAL::Process::eSeverity::unknown ? state : state + " " + level) << '\n';

, create_console(false)
{}

Task task;
eCAL_Process_eStartMode window_mode;
eCAL::Process::eStartMode window_mode;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use default member initializer for 'window_mode' [cppcoreguidelines-use-default-member-init]

app/sys/sys_client_core/include/sys_client_core/task.h:44:

-         : window_mode   (eCAL::Process::eStartMode::normal)
+         : 
Suggested change
eCAL::Process::eStartMode window_mode;
eCAL::Process::eStartMode window_mode{eCAL::Process::eStartMode::normal};

SeverityModel* severity_model = static_cast<SeverityModel*>(combobox->model());
combobox->setCurrentIndex(severity_model->getRow(severity));
}
else if (index.column() == (int)GroupStateMinTaskStateTreeModel::Columns::SEVERITY_LEVEL)
{
eCAL_Process_eSeverity_Level severity_level = (eCAL_Process_eSeverity_Level)(current_int);
eCAL::Process::eSeverityLevel severity_level = (eCAL::Process::eSeverityLevel)(current_int);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'severity_level' of type 'eCAL::Process::eSeverityLevel' can be declared 'const' [misc-const-correctness]

Suggested change
eCAL::Process::eSeverityLevel severity_level = (eCAL::Process::eSeverityLevel)(current_int);
eCAL::Process::eSeverityLevel const severity_level = (eCAL::Process::eSeverityLevel)(current_int);

model->setData(index, (int)severity, Qt::EditRole);
}
else if (index.column() == (int)GroupStateMinTaskStateTreeModel::Columns::SEVERITY_LEVEL)
{
SeverityLevelModel* severity_level_model = static_cast<SeverityLevelModel*>(combobox->model());
eCAL_Process_eSeverity_Level severity_level = severity_level_model->getSeverityLevel(combobox->currentIndex());
eCAL::Process::eSeverityLevel severity_level = severity_level_model->getSeverityLevel(combobox->currentIndex());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'severity_level' of type 'eCAL::Process::eSeverityLevel' can be declared 'const' [misc-const-correctness]

Suggested change
eCAL::Process::eSeverityLevel severity_level = severity_level_model->getSeverityLevel(combobox->currentIndex());
eCAL::Process::eSeverityLevel const severity_level = severity_level_model->getSeverityLevel(combobox->currentIndex());

rows.push_back(std::make_pair(QString("Level 3"), eCAL_Process_eSeverity_Level::proc_sev_level3));
rows.push_back(std::make_pair(QString("Level 4"), eCAL_Process_eSeverity_Level::proc_sev_level4));
rows.push_back(std::make_pair(QString("Level 5"), eCAL_Process_eSeverity_Level::proc_sev_level5));
rows.push_back(std::make_pair(QString("Level 1"), eCAL::Process::eSeverityLevel::level1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use emplace_back instead of push_back [modernize-use-emplace]

Suggested change
rows.push_back(std::make_pair(QString("Level 1"), eCAL::Process::eSeverityLevel::level1));
rows.emplace_back(QString("Level 1"), eCAL::Process::eSeverityLevel::level1);

@@ -2302,7 +2302,7 @@
auto selected_tasks = getSelectedTasks();
if (selected_tasks.size() != 0)
{
eCAL_Process_eSeverity_Level selected_severity_level = severity_level_model_->getSeverityLevel(index);
eCAL::Process::eSeverityLevel selected_severity_level = severity_level_model_->getSeverityLevel(index);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'selected_severity_level' of type 'eCAL::Process::eSeverityLevel' can be declared 'const' [misc-const-correctness]

Suggested change
eCAL::Process::eSeverityLevel selected_severity_level = severity_level_model_->getSeverityLevel(index);
!= 0)const

/**
* @brief eCAL subscriber event callback type.
**/
enum class eSubscriberEvent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: enum 'eSubscriberEvent' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]

              ^

/**
* @brief eCAL publisher event callback type.
**/
enum class ePublisherEvent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: enum 'ePublisherEvent' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]

              ^

/**
* @brief eCAL service client event callback type.
**/
enum class eClientEvent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: enum 'eClientEvent' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]

              ^

/**
* @brief eCAL service server event callback type.
**/
enum class eServerEvent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: enum 'eServerEvent' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]

              ^

@KerstinKeller KerstinKeller requested a review from Peguen January 16, 2025 08:22
@KerstinKeller KerstinKeller added the cherry-pick-to-NONE Don't cherry-pick these changes label Jan 16, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 20 out of 26. Check the log or trigger a new build to see more.

* @brief Values that represent different log level to filter on monitoring.
**/
enum eCAL_Logging_eLogLevel
namespace eCAL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: expected ';' after top level declarator [clang-diagnostic-error]

Suggested change
namespace eCAL
namespace eCAL;

* @brief Values that represent different log level to filter on monitoring.
**/
enum eCAL_Logging_eLogLevel
namespace eCAL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unknown type name 'namespace' [clang-diagnostic-error]

namespace eCAL
^

**/
// We're currently not making this an enum class, because this will not allow the bitmasking anymore.
// Need to come up with a different solution in that case.
enum eLogLevel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: enum 'eLogLevel' uses a larger base type ('unsigned int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]

    enum eLogLevel
         ^


typedef unsigned char eCAL_Logging_Filter; //!< This type is to be used as a bitmask for the activated logging levels
typedef unsigned char Filter; //!< This type is to be used as a bitmask for the activated logging levels
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use 'using' instead of 'typedef' [modernize-use-using]

Suggested change
typedef unsigned char Filter; //!< This type is to be used as a bitmask for the activated logging levels
using Filter = unsigned char; //!< This type is to be used as a bitmask for the activated logging levels

};
namespace Process
{
enum class eStartMode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: enum 'eStartMode' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]

    enum class eStartMode
               ^

@@ -43,7 +43,7 @@ int main()
eCAL::Process::SleepMS(2000);

// start process
int pid = eCAL::Process::StartProcess(proc_name, "", "", false, proc_smode_normal, false);
int pid = eCAL::Process::StartProcess(proc_name, "", "", false, eCAL::Process::eStartMode::normal, false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'pid' of type 'int' can be declared 'const' [misc-const-correctness]

Suggested change
int pid = eCAL::Process::StartProcess(proc_name, "", "", false, eCAL::Process::eStartMode::normal, false);
int const pid = eCAL::Process::StartProcess(proc_name, "", "", false, eCAL::Process::eStartMode::normal, false);

@@ -138,7 +190,7 @@ int ecal_set_unit_name(const char* unit_name_)
/****************************************/
void ecal_set_process_state(const int severity_, const int level_, const char* info_)
{
return(eCAL::Process::SetState(eCAL_Process_eSeverity(severity_), eCAL_Process_eSeverity_Level(level_), info_));
return(eCAL::Process::SetState(eCAL::Process::eSeverity(severity_), eCAL::Process::eSeverityLevel(level_), info_));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: return statement within a void function should not have a specified return value [readability-avoid-return-with-void-value]

  return(eCAL::Process::SetState(eCAL::Process::eSeverity(severity_), eCAL::Process::eSeverityLevel(level_), info_));
  ^

case sub_event_connected:
std::cout << "event : " << "sub_event_connected" << std::endl;
case eCAL::eSubscriberEvent::connected:
std::cout << "event : " << "connected" << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not use 'std::endl' with streams; use '\n' instead [performance-avoid-endl]

Suggested change
std::cout << "event : " << "connected" << std::endl;
std::cout << "event : " << "connected" << '\n';

case sub_event_disconnected:
std::cout << "event : " << "sub_event_disconnected" << std::endl;
case eCAL::eSubscriberEvent::disconnected:
std::cout << "event : " << "disconnected" << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not use 'std::endl' with streams; use '\n' instead [performance-avoid-endl]

Suggested change
std::cout << "event : " << "disconnected" << std::endl;
std::cout << "event : " << "disconnected" << '\n';

case sub_event_dropped:
std::cout << "event : " << "sub_event_dropped (" << data_->clock << " messages)" << std::endl;
case eCAL::eSubscriberEvent::dropped:
std::cout << "event : " << "dropped (" << data_->clock << " messages)" << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not use 'std::endl' with streams; use '\n' instead [performance-avoid-endl]

Suggested change
std::cout << "event : " << "dropped (" << data_->clock << " messages)" << std::endl;
std::cout << "event : " << "dropped (" << data_->clock << " messages)" << '\n';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-to-NONE Don't cherry-pick these changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant