Skip to content

Commit 95636be

Browse files
committed
Resolve clang-tidy issues
1 parent 80fda65 commit 95636be

File tree

19 files changed

+65
-68
lines changed

19 files changed

+65
-68
lines changed

.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
Checks: '*,-fuchsia-*,-google-*,-zircon-*,-abseil-*,-llvmlibc-*,-*-magic-numbers,-modernize-use-trailing-return-type,-hicpp-no-assembler,-hicpp-braces-around-statements,-readability-named-parameter,-readability-braces-around-statements,-readability-avoid-const-params-in-decls,-llvm-*'
2+
Checks: '*,-altera-*,-fuchsia-*,-google-*,-zircon-*,-abseil-*,-llvmlibc-*,-*-identifier-length,-*-magic-numbers,-*-include-cleaner,-modernize-use-trailing-return-type,-hicpp-no-assembler,-hicpp-braces-around-statements,-readability-named-parameter,-readability-braces-around-statements,-readability-avoid-const-params-in-decls,-llvm-*'
33
WarningsAsErrors: '1'
44
HeaderFilterRegex: '.*[a-z]\.hpp' # hack to exclude the doctest and approval test code from analysis (they are the only headers with a digit before the .hpp)
55
FormatStyle: none

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
mfl
22
·
3-
[![MacOS build](https://github.com/cpp-niel/mfl/workflows/macos/badge.svg)](https://github.com/cpp-niel/mfl/workflows/macos/badge.svg)
4-
[![Ubuntu build](https://github.com/cpp-niel/mfl/workflows/ubuntu/badge.svg)](https://github.com/cpp-niel/mfl/workflows/ubuntu/badge.svg)
5-
[![Windows build](https://github.com/cpp-niel/mfl/workflows/windows/badge.svg)](https://github.com/cpp-niel/mfl/workflows/windows/badge.svg)
3+
[![CI](https://github.com/cpp-niel/mfl/workflows/ci/badge.svg)](https://github.com/cpp-niel/mfl/workflows/ci.yml)
64
[![Coverage Status](https://coveralls.io/repos/github/cpp-niel/mfl/badge.svg?branch=master)](https://coveralls.io/github/cpp-niel/mfl?branch=master)
75
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/7c69b659287948279110d52066f1d9d5)](https://www.codacy.com/manual/cpp-niel/mfl?utm_source=github.com&utm_medium=referral&utm_content=cpp-niel/mfl&utm_campaign=Badge_Grade)
86
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/cpp-niel/mfl/blob/master/LICENSE)

include/mfl/abstract_font_face.hpp

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "mfl/units.hpp"
66

77
#include <cstddef>
8+
#include <cstdint>
89
#include <functional>
910
#include <memory>
1011
#include <vector>
@@ -13,38 +14,38 @@ namespace mfl
1314
{
1415
struct fraction_constants
1516
{
16-
int32_t numerator_shift_up = 0;
17-
int32_t denominator_shift_down = 0;
18-
int32_t numerator_min_gap = 0;
19-
int32_t denominator_min_gap = 0;
17+
std::int32_t numerator_shift_up = 0;
18+
std::int32_t denominator_shift_down = 0;
19+
std::int32_t numerator_min_gap = 0;
20+
std::int32_t denominator_min_gap = 0;
2021
};
2122

2223
struct math_constants
2324
{
24-
int32_t axis_height = 0;
25-
int32_t fraction_rule_thickness = 0;
26-
int32_t subscript_drop = 0;
27-
int32_t subscript_shift_down = 0;
28-
int32_t superscript_drop = 0;
29-
int32_t superscript_shift_up = 0;
30-
int32_t superscript_shift_up_cramped = 0;
31-
int32_t minimum_dual_script_gap = 0;
32-
int32_t maximum_superscript_bottom_in_dual_script = 0;
33-
int32_t space_after_script = 0;
34-
int32_t radical_vertical_gap = 0;
35-
int32_t radical_rule_thickness = 0;
36-
int32_t radical_extra_ascender = 0;
37-
int32_t radical_kern_before_degree = 0;
38-
int32_t radical_kern_after_degree = 0;
39-
int32_t radical_degree_bottom_raise_percent = 0;
40-
int32_t overline_gap = 0;
41-
int32_t overline_padding = 0;
42-
int32_t overline_thickness = 0;
43-
int32_t underline_gap = 0;
44-
int32_t underline_padding = 0;
45-
int32_t underline_thickness = 0;
46-
int32_t lower_limit_min_gap = 0;
47-
int32_t upper_limit_min_gap = 0;
25+
std::int32_t axis_height = 0;
26+
std::int32_t fraction_rule_thickness = 0;
27+
std::int32_t subscript_drop = 0;
28+
std::int32_t subscript_shift_down = 0;
29+
std::int32_t superscript_drop = 0;
30+
std::int32_t superscript_shift_up = 0;
31+
std::int32_t superscript_shift_up_cramped = 0;
32+
std::int32_t minimum_dual_script_gap = 0;
33+
std::int32_t maximum_superscript_bottom_in_dual_script = 0;
34+
std::int32_t space_after_script = 0;
35+
std::int32_t radical_vertical_gap = 0;
36+
std::int32_t radical_rule_thickness = 0;
37+
std::int32_t radical_extra_ascender = 0;
38+
std::int32_t radical_kern_before_degree = 0;
39+
std::int32_t radical_kern_after_degree = 0;
40+
std::int32_t radical_degree_bottom_raise_percent = 0;
41+
std::int32_t overline_gap = 0;
42+
std::int32_t overline_padding = 0;
43+
std::int32_t overline_thickness = 0;
44+
std::int32_t underline_gap = 0;
45+
std::int32_t underline_padding = 0;
46+
std::int32_t underline_thickness = 0;
47+
std::int32_t lower_limit_min_gap = 0;
48+
std::int32_t upper_limit_min_gap = 0;
4849
fraction_constants default_fraction;
4950
fraction_constants display_style_fraction;
5051
fraction_constants default_atop;
@@ -54,17 +55,17 @@ namespace mfl
5455
struct math_glyph_info
5556
{
5657
size_t glyph_index = 0;
57-
int32_t width = 0;
58-
int32_t height = 0;
59-
int32_t depth = 0;
60-
int32_t italic_correction = 0;
61-
int32_t accent_hpos = 0;
58+
std::int32_t width = 0;
59+
std::int32_t height = 0;
60+
std::int32_t depth = 0;
61+
std::int32_t italic_correction = 0;
62+
std::int32_t accent_hpos = 0;
6263
};
6364

6465
struct size_variant
6566
{
6667
size_t glyph_index = 0;
67-
int32_t size = 0;
68+
std::int32_t size = 0;
6869
};
6970

7071
struct abstract_font_face

include/mfl/code_point.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
namespace mfl
66
{
7-
using code_point = uint32_t;
7+
using code_point = std::uint32_t;
88
}

include/mfl/detail/quantity.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#include <fmt/format.h>
44

5-
#include <compare>
65
#include <iostream>
76

87
namespace mfl::detail

include/mfl/layout.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#pragma once
22

33
#include "mfl/abstract_font_face.hpp"
4+
#include "mfl/font_family.hpp"
45
#include "mfl/units.hpp"
56

7+
#include <cstddef>
68
#include <optional>
79
#include <string>
810
#include <string_view>
@@ -13,7 +15,7 @@ namespace mfl
1315
struct shaped_glyph
1416
{
1517
font_family family = font_family::roman;
16-
size_t index = 0;
18+
std::size_t index = 0;
1719
points size;
1820
points x;
1921
points y;

include/mfl/units.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include "mfl/detail/quantity.hpp"
44

5-
#include <fmt/format.h>
5+
#include <fmt/core.h>
66

77
#include <array>
88

@@ -49,14 +49,14 @@ namespace mfl
4949
namespace fmt
5050
{
5151
template<>
52-
struct formatter<mfl::inches> : mfl::unit_formatter<mfl::inches, '\"'> {};
52+
struct [[maybe_unused]] formatter<mfl::inches> : mfl::unit_formatter<mfl::inches, '\"'> {};
5353

5454
template <>
55-
struct formatter<mfl::dots_per_inch> : mfl::unit_formatter<mfl::dots_per_inch, 'd', 'p', 'i'> {};
55+
struct [[maybe_unused]] formatter<mfl::dots_per_inch> : mfl::unit_formatter<mfl::dots_per_inch, 'd', 'p', 'i'> {};
5656

5757
template <>
58-
struct formatter<mfl::pixels> : mfl::unit_formatter<mfl::pixels, 'p', 'x'> {};
58+
struct [[maybe_unused]] formatter<mfl::pixels> : mfl::unit_formatter<mfl::pixels, 'p', 'x'> {};
5959

6060
template <>
61-
struct formatter<mfl::points> : mfl::unit_formatter<mfl::points, 'p', 't'> {};
61+
struct [[maybe_unused]] formatter<mfl::points> : mfl::unit_formatter<mfl::points, 'p', 't'> {};
6262
}

src/noad/accent.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#include "noad/accent.hpp"
22

3-
#include "noad/math_char.hpp"
4-
#include "noad/noad.hpp"
3+
#include "noad.hpp"
54
#include "node/box.hpp"
65
#include "node/hlist.hpp"
7-
#include "node/node.hpp"
8-
#include "node/vlist.hpp"
96
#include "settings.hpp"
107

8+
#include <utility>
9+
#include <variant>
10+
1111
namespace mfl
1212
{
1313
namespace
@@ -47,7 +47,7 @@ namespace mfl
4747
return accent_hlist(s, shift, make_hbox(make_hlist(accentee_glyph)), accenter_glyph);
4848
}
4949

50-
// when positioning over complex content we may have a wide accent so we make an auto
50+
// when positioning over complex content we may have a wide accent, so we make an auto
5151
// width glyph and position it horizontally in the center of the content box
5252
hlist accent_over_complex_content(const settings s, const cramping cramp, const accent& a)
5353
{

src/noad/accent.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#include "mfl/code_point.hpp"
4+
#include "mfl/font_family.hpp"
45
#include "noad/noad.hpp"
56

67
#include <vector>

src/noad/big_op.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#include "noad/gen_script.hpp"
44
#include "node/hlist.hpp"
5-
#include "settings.hpp"
65

76
namespace mfl
87
{

0 commit comments

Comments
 (0)