Skip to content

Commit

Permalink
SongRowPaint, StatusBar: use {} initializer syntax for Point
Browse files Browse the repository at this point in the history
Some compilers don't like using the implicit constructor for
initializing fields (looking at you, Apple!)
  • Loading branch information
MaxKellermann committed Aug 30, 2024
1 parent e402a7e commit 386e651
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/SongRowPaint.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <string.h>

void
paint_song_row(WINDOW *w, [[maybe_unused]] unsigned y, unsigned width,
paint_song_row(WINDOW *w, [[maybe_unused]] int y, unsigned width,
bool selected, bool highlight, const struct mpd_song *song,
[[maybe_unused]] class hscroll *hscroll, const char *format)
{
Expand All @@ -37,7 +37,7 @@ paint_song_row(WINDOW *w, [[maybe_unused]] unsigned y, unsigned width,

if (hscroll != nullptr && width > 3 &&
StringWidthMB(buffer) >= width) {
hscroll->Set(Point(0, y), width, buffer,
hscroll->Set({0, y}, width, buffer,
highlight ? Style::LIST_BOLD : Style::LIST,
selected ? A_REVERSE : 0);
hscroll->Paint();
Expand Down
2 changes: 1 addition & 1 deletion src/SongRowPaint.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class hscroll;
* @param format the song format
*/
void
paint_song_row(WINDOW *w, unsigned y, unsigned width,
paint_song_row(WINDOW *w, int y, unsigned width,
bool selected, bool highlight, const struct mpd_song *song,
class hscroll *hscroll, const char *format);

Expand Down
2 changes: 1 addition & 1 deletion src/StatusBar.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ StatusBar::Update(const struct mpd_status *status,
const unsigned center_width =
StringWidthMB(center_text.c_str());
if (width > 3 && center_width > (unsigned)width) {
hscroll.Set(Point(left_width, 0), width,
hscroll.Set({(int)left_width, 0}, width,
center_text.c_str(),
Style::STATUS);
} else {
Expand Down

0 comments on commit 386e651

Please sign in to comment.