Skip to content

Commit dd87445

Browse files
committed
Handle even more tidying
1 parent e5f2fb0 commit dd87445

12 files changed

+59
-31
lines changed

Diff for: ref_app/src/mcal/host/mcal_wdg_watchdog.h

+10-9
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@
88
#ifndef MCAL_WDG_WATCHDOG_2013_12_11_H
99
#define MCAL_WDG_WATCHDOG_2013_12_11_H
1010

11+
#include <mcal_wdg.h>
12+
13+
#include <util/utility/util_noncopyable.h>
14+
#include <util/utility/util_time.h>
15+
1116
#include <atomic>
1217
#include <cstdint>
1318
#include <functional>
1419
#include <thread>
1520

16-
#include <mcal_wdg.h>
17-
#include <util/utility/util_noncopyable.h>
18-
#include <util/utility/util_time.h>
19-
2021
#if defined(_MSC_VER)
2122
#define MCAL_WDG_NORETURN
2223
#else
@@ -90,7 +91,7 @@
9091

9192
MCAL_WDG_NORETURN static auto thread_function() -> void
9293
{
93-
std::this_thread::sleep_for(std::chrono::milliseconds(10U));
94+
std::this_thread::sleep_for(std::chrono::milliseconds(static_cast<unsigned>(UINT8_C(10))));
9495

9596
bool timeout_has_occurred = false;
9697

@@ -100,7 +101,7 @@
100101
{
101102
print_timeout_message();
102103

103-
std::this_thread::sleep_for(std::chrono::milliseconds(500U));
104+
std::this_thread::sleep_for(std::chrono::milliseconds(static_cast<unsigned>(UINT16_C(500))));
104105
}
105106
else
106107
{
@@ -109,7 +110,7 @@
109110
timeout_has_occurred = true;
110111
}
111112

112-
std::this_thread::sleep_for(std::chrono::milliseconds(20U));
113+
std::this_thread::sleep_for(std::chrono::milliseconds(static_cast<unsigned>(UINT8_C(20))));
113114
}
114115
}
115116
}
@@ -122,7 +123,7 @@
122123

123124
template<const typename watchdog_base::base_timer_type::tick_type MyPeriod>
124125
std::atomic_flag watchdog<MyPeriod>::my_lock = ATOMIC_FLAG_INIT;
125-
}
126-
}
126+
} // namespace wdg
127+
} // namespace mcal
127128

128129
#endif // MCAL_WDG_WATCHDOG_2013_12_11_H

Diff for: ref_app/src/mcal_led/mcal_led_boolean_state_base.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace mcal { namespace led {
1414

15-
class led_boolean_state_base : public mcal::led::led_base
15+
class led_boolean_state_base : public mcal::led::led_base // NOLINT(cppcoreguidelines-special-member-functions,hicpp-special-member-functions)
1616
{
1717
protected:
1818
constexpr led_boolean_state_base() = default;
@@ -31,6 +31,7 @@
3131
bool is_on { };
3232
};
3333

34-
} } // namespace mcal::led
34+
} // namespace led
35+
} // namespace mcal
3536

3637
#endif // MCAL_LED_BOOLEAN_STATE_BASE_2020_08_07_H

Diff for: ref_app/src/mcal_led/mcal_led_console.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
const std::uint_fast8_t my_index;
4040
};
4141

42-
} } // namespace mcal::led
42+
} // namespace led
43+
} // namespace mcal
4344

4445
#endif // MCAL_LED_CONSOLE_2020_04_23_H

Diff for: ref_app/src/mcal_led/mcal_led_pwm.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
mcal::pwm::pwm_base& my_pwm;
4141
};
4242

43-
} } // namespace mcal::led
43+
} // namespace led
44+
} // namespace mcal
4445

4546
#endif // MCAL_LED_PWM_2020_04_23_H

Diff for: ref_app/src/mcal_led/mcal_led_rgb_base.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
}
9595
};
9696

97-
} } // namespace mcal::led
97+
} // namespace led
98+
} // namespace mcal
9899

99100
#endif // MCAL_LED_RGB_BASE_2023_07_12_H

Diff for: ref_app/src/mcal_pwm/mcal_pwm_console.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
~pwm_console() override = default;
5151
};
5252

53-
} }
53+
} // namespace pwm
54+
} // namespace mcal
5455

5556
#endif // MCAL_PWM_CONSOLE_2020_04_12_H_

Diff for: ref_app/src/mcal_spi/mcal_spi_software_dummy.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace mcal { namespace spi {
1414

15-
class spi_software_dummy : public util::communication_buffer_depth_one_byte
15+
class spi_software_dummy : public util::communication_buffer_depth_one_byte // NOLINT(cppcoreguidelines-special-member-functions,hicpp-special-member-functions)
1616
{
1717
private:
1818
using base_class_type = util::communication_buffer_depth_one_byte;

Diff for: ref_app/src/os/os.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// or copy at http://www.boost.org/LICENSE_1_0.txt)
66
//
77

8-
#ifndef OS_2011_10_20_H_
9-
#define OS_2011_10_20_H_
8+
#ifndef OS_2011_10_20_H
9+
#define OS_2011_10_20_H
1010

1111
#include <os/os_cfg.h>
1212
#include <util/utility/util_time.h>
@@ -26,6 +26,6 @@
2626
auto set_event (const task_id_type task_id, const event_type& event_to_set) -> bool;
2727
auto get_event (event_type& event_to_get) -> void;
2828
auto clear_event(const event_type& event_to_clear) -> void;
29-
}
29+
} // namespace os
3030

31-
#endif // OS_2011_10_20_H_
31+
#endif // OS_2011_10_20_H

Diff for: ref_app/src/os/os_cfg.h

+27-5
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,38 @@
1515
#include <util/utility/util_time.h>
1616

1717
// Declare the task initialization and the task function of the idle process.
18-
namespace sys { namespace idle { auto task_init() noexcept -> void; auto task_func() -> void; } }
18+
namespace sys { namespace idle {
19+
20+
auto task_init() noexcept -> void; auto task_func() -> void;
21+
22+
} // namespace idle
23+
} // namespace sys
1924

2025
// Define symbols for the task initialization and the task function of the idle process.
2126
#define OS_IDLE_TASK_INIT() sys::idle::task_init()
2227
#define OS_IDLE_TASK_FUNC() sys::idle::task_func()
2328

2429
// Declare all of the task initializations and the task functions.
25-
namespace app { namespace led { auto task_init() -> void; auto task_func() -> void; } }
26-
namespace app { namespace benchmark { auto task_init() -> void; auto task_func() -> void; } }
27-
namespace sys { namespace mon { auto task_init() -> void; auto task_func() -> void; } }
30+
namespace app { namespace led {
31+
32+
auto task_init() -> void; auto task_func() -> void;
33+
34+
} // namespace led
35+
} // namespace app
36+
37+
namespace app { namespace benchmark {
38+
39+
auto task_init() -> void; auto task_func() -> void;
40+
41+
} // namespace benchmark
42+
} // namespace app
43+
44+
namespace sys { namespace mon {
45+
46+
auto task_init() -> void; auto task_func() -> void;
47+
48+
} // namespace mon
49+
} // namespace sys
2850

2951
namespace os
3052
{
@@ -50,7 +72,7 @@
5072

5173
static_assert(std::numeric_limits<os::event_type>::digits >= 16,
5274
"The operating system event_type must be at least 16-bits wide.");
53-
}
75+
} // namespace os
5476

5577
// Configure the operating system tasks.
5678

Diff for: ref_app/src/os/os_task_control_block.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
class task_control_block final
2020
{
2121
public:
22-
task_control_block(const function_type init,
23-
const function_type func,
24-
const tick_type cycle,
25-
const tick_type offset)
22+
task_control_block(const function_type init, // NOLINT(bugprone-easily-swappable-parameters)
23+
const function_type func, // NOLINT(bugprone-easily-swappable-parameters)
24+
const tick_type cycle, // NOLINT(bugprone-easily-swappable-parameters)
25+
const tick_type offset) // NOLINT(bugprone-easily-swappable-parameters)
2626
: my_init { init },
2727
my_func { func },
2828
my_cycle { cycle },

Diff for: ref_app/src/util/utility/util_communication.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
namespace util
1919
{
20-
class communication_base : private util::noncopyable
20+
class communication_base : private util::noncopyable // NOLINT(cppcoreguidelines-special-member-functions,hicpp-special-member-functions)
2121
{
2222
public:
2323
virtual ~communication_base() = default;

Diff for: ref_app/src/util/utility/util_time.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
{
9191
const timer t_delay(delay);
9292

93-
while(!t_delay.timeout())
93+
while(!t_delay.timeout()) // NOLINT(altera-id-dependent-backward-branch)
9494
{
9595
mcal::wdg::secure::trigger();
9696
}

0 commit comments

Comments
 (0)