Skip to content

Commit 512b1b3

Browse files
committed
Code quality
1 parent a2567f1 commit 512b1b3

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

source/Logger_any.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ namespace vx::logger {
6666

6767
return {
6868

69-
std::type_index( typeid( T ) ),
69+
std::type_index( static_cast<std::type_index>( typeid( T ) ) ),
7070
[ function = _function ]( Logger &_logger,
7171
[[maybe_unused]] const std::any &_any ) {
7272
function( _logger, std::any_cast<const T &>( _any ) );

source/Serial.cpp

+11-7
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@
3030

3131
/* c header */
3232
#include <cerrno>
33+
#include <cstddef> // std::size_t
3334
#include <cstdint> // std::int32_t
3435
#include <cstdio>
3536
#include <cstring> // strerror_r
3637

3738
/* system header */
38-
#include <fcntl.h> // open
39+
#include <sys/fcntl.h> // open
3940
#include <termios.h>
4041
#include <unistd.h> // write, read, close
4142

@@ -129,13 +130,16 @@ namespace vx {
129130
}
130131
}
131132

132-
/**
133-
* @brief Return timestamp in milliseconds.
134-
* @return Timestamp in milliseconds.
135-
*/
136-
static inline std::chrono::milliseconds timestampMs() noexcept {
133+
namespace {
137134

138-
return std::chrono::duration_cast<std::chrono::milliseconds>( std::chrono::steady_clock::now().time_since_epoch() );
135+
/**
136+
* @brief Return timestamp in milliseconds.
137+
* @return Timestamp in milliseconds.
138+
*/
139+
inline std::chrono::milliseconds timestampMs() noexcept {
140+
141+
return std::chrono::duration_cast<std::chrono::milliseconds>( std::chrono::steady_clock::now().time_since_epoch() );
142+
}
139143
}
140144

141145
bool Serial::flush() const {

source/StringUtils_apple.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*/
3030

31+
/* c header */
32+
#include <cstddef>
33+
3134
/* stl header */
3235
#include <string>
3336

0 commit comments

Comments
 (0)