Skip to content

Commit

Permalink
Added more const to format
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmoreno committed Sep 5, 2024
1 parent 29b3ef8 commit bbab530
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/rtpmidid/packet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ template <> struct fmt::formatter<rtpmidid::packet_type_e> {
constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); }

template <typename FormatContext>
auto format(const rtpmidid::packet_type_e &c, FormatContext &ctx) {
auto format(const rtpmidid::packet_type_e &c, FormatContext &ctx) const {
switch (c) {
case rtpmidid::packet_type_e::UNKNOWN:
return format_to(ctx.out(), "UNKNOWN");
Expand All @@ -158,7 +158,7 @@ template <> struct fmt::formatter<rtpmidid::packet_t> {
constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); }

template <typename FormatContext>
auto format(const rtpmidid::packet_t &c, FormatContext &ctx) {
auto format(const rtpmidid::packet_t &c, FormatContext &ctx) const {
return format_to(ctx.out(), "Packet: {} bytes", c.get_size());
}
};
6 changes: 3 additions & 3 deletions include/rtpmidid/rtpmidipacket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ template <> struct fmt::formatter<rtpmidid::command_e> {
constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); }

template <typename FormatContext>
auto format(const rtpmidid::command_e &c, FormatContext &ctx) {
auto format(const rtpmidid::command_e &c, FormatContext &ctx) const {
switch (c) {
case rtpmidid::IN:
return format_to(ctx.out(), "IN");
Expand All @@ -387,7 +387,7 @@ template <> struct fmt::formatter<rtpmidid::packet_midi_t> {
constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); }

template <typename FormatContext>
auto format(const rtpmidid::packet_midi_t &p, FormatContext &ctx) {
auto format(const rtpmidid::packet_midi_t &p, FormatContext &ctx) const {
return format_to(ctx.out(), "{}", p.to_string());
}
};
Expand All @@ -397,7 +397,7 @@ template <> struct fmt::formatter<rtpmidid::packet_command_t> {
constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); }

template <typename FormatContext>
auto format(const rtpmidid::packet_command_t &p, FormatContext &ctx) {
auto format(const rtpmidid::packet_command_t &p, FormatContext &ctx) const {
return format_to(ctx.out(), "{}", p.to_string());
}
};
Expand Down

0 comments on commit bbab530

Please sign in to comment.