Skip to content

Commit

Permalink
Update to latest fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
madeso committed Mar 13, 2024
1 parent 2965c32 commit 33a2e4f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion external/catchy
Submodule catchy updated 302 files
4 changes: 2 additions & 2 deletions libs/api/src/api/image.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ void Image::set_color(int x, int y, const Color& c)

Color Image::get_color(int x, int y) const
{
XASSERT(x >= 0 && x < width, "{} {}"_format(x, width));
XASSERT(y >= 0 && y < height, "{} {}"_format(y, height));
XASSERT(x >= 0 && x < width, fmt::format("{} {}", x, width));
XASSERT(y >= 0 && y < height, fmt::format("{} {}", y, height));
const auto index = (x + y * width) * 4;
return Color::rgb
(
Expand Down
6 changes: 3 additions & 3 deletions libs/backends/sdl_base/src/backend/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ log_warning_implementation(fmt::string_view format, fmt::format_args args);
template <typename S, typename... Args>
void
log_info(const S& format, Args&&... args) {
log_info_implementation(format, fmt::make_args_checked<Args...>(format, args...));
log_info_implementation(format, fmt::make_format_args(format, args...));
}

template <typename S, typename... Args>
void
log_error(const S& format, Args&&... args) {
log_error_implementation(format, fmt::make_args_checked<Args...>(format, args...));
log_error_implementation(format, fmt::make_format_args(format, args...));
}

template <typename S, typename... Args>
void
log_warning(const S& format, Args&&... args) {
log_warning_implementation(format, fmt::make_args_checked<Args...>(format, args...));
log_warning_implementation(format, fmt::make_format_args(format, args...));
}


Expand Down
4 changes: 2 additions & 2 deletions libs/core/src/core/rect.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,13 @@ struct Rect

static Self from_ltrb(T left, T top, T right, T bottom)
{
XASSERT(left <= right && top >= bottom, "{} <= {} && {} >= {}"_format(left, right, top, bottom));
XASSERT(left <= right && top >= bottom, fmt::format("{} <= {} && {} >= {}", left, right, top, bottom));
return {left, bottom, right - left, top-bottom};
}

static Self from_lrtb(T left, T right, T top, T bottom)
{
XASSERT(left <= right && top >= bottom, "{} <= {} && {} >= {}"_format(left, right, top, bottom));
XASSERT(left <= right && top >= bottom, fmt::format("{} <= {} && {} >= {}", left, right, top, bottom));
return {left, bottom, right - left, top-bottom};
}

Expand Down
4 changes: 2 additions & 2 deletions libs/ride/src/ride/view.document.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void ViewDoc::draw_line(api::Renderer* cache, std::size_t line_index, const Dp&,
font->draw
(
cache,
"{0: >{1}}"_format(line_index+1, gutter_char_length),
fmt::format("{0: >{1}}", line_index+1, gutter_char_length),
app->Cpx(gutter_rect.x + theme->gutter_spacing_left),
app->Cpx(y),
theme->gutter_color
Expand Down Expand Up @@ -288,7 +288,7 @@ void ViewDoc::draw_body(api::Renderer* cache)

// const auto line = absolute_pix_y_to_line(last_mouse.y);
// const auto offset = absolute_pix_x_to_offset(line, last_mouse.x);
// draw_text(cache, font, "{} {}: {}"_format(line+1, offset, last_mouse), app->Cpx(view_rect.x + 10_dp), app->Cpx(view_rect.y + 10_dp), {0,0,0});
// draw_text(cache, font, fmt::format("{} {}: {}", line+1, offset, last_mouse), app->Cpx(view_rect.x + 10_dp), app->Cpx(view_rect.y + 10_dp), {0,0,0});
}


Expand Down

0 comments on commit 33a2e4f

Please sign in to comment.