Skip to content

Commit

Permalink
Fix clang-tidy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
foonathan committed Jan 7, 2025
1 parent b08de16 commit 2b4693d
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/lexy/_detail/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ template <typename T>
std::add_rvalue_reference_t<T> declval();

template <typename T>
constexpr void swap(T& lhs, T& rhs)
constexpr void swap(T& lhs, T& rhs) noexcept
{
T tmp = LEXY_MOV(lhs);
lhs = LEXY_MOV(rhs);
Expand Down
2 changes: 1 addition & 1 deletion include/lexy/_detail/memory_resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <lexy/_detail/config.hpp>
#include <new>

#if 0
#if 0 // NOLINT
// Subset of the interface of std::pmr::memory_resource.
class MemoryResource
{
Expand Down
2 changes: 1 addition & 1 deletion include/lexy/encoding.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace lexy
{
/// The endianness used by an encoding.
enum class encoding_endianness
enum class encoding_endianness // NOLINT(performance-enum-size)
{
/// Little endian.
little,
Expand Down
4 changes: 3 additions & 1 deletion src/input/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

#include <cerrno>
#include <cstdio>
#include <lexy/_detail/assert.hpp>
#include <lexy/_detail/buffer_builder.hpp>
#include <lexy/input/buffer.hpp>

#if defined(__unix__) || defined(__APPLE__)

Expand Down Expand Up @@ -68,7 +70,7 @@ lexy::file_error lexy::_detail::read_file(const char* path, file_callback cb, vo
return get_file_error();

auto off = ::lseek(fd, 0, SEEK_END);
if (off == static_cast<::off_t>(-1))
if (off == static_cast<decltype(off)>(-1))
return lexy::file_error::os_error;
auto size = static_cast<std::size_t>(off);

Expand Down
2 changes: 0 additions & 2 deletions tests/doctest_main.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (C) 2020-2024 Jonathan Müller and lexy contributors
// SPDX-License-Identifier: BSL-1.0

#include <lexy/_detail/config.hpp>

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include <doctest/doctest.h>

1 change: 1 addition & 0 deletions tests/lexy/detail/buffer_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <lexy/_detail/buffer_builder.hpp>

#include <cstring>
#include <doctest/doctest.h>

TEST_CASE("_detail::buffer_builder")
Expand Down
1 change: 1 addition & 0 deletions tests/lexy/detail/integer_sequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <lexy/_detail/integer_sequence.hpp>

#include <doctest/doctest.h>
#include <type_traits>

TEST_CASE("_detail::integer_sequence")
{
Expand Down

0 comments on commit 2b4693d

Please sign in to comment.