Skip to content

Commit 90d834d

Browse files
committed
fix compiler warnings
1 parent 3fc388c commit 90d834d

5 files changed

Lines changed: 9 additions & 14 deletions

File tree

src/ruis/paint/path.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,13 @@ path::vertices path::stroke(ruis::real half_width, ruis::real antialias_width, r
171171
ret.out_indices.push_back(2);
172172

173173
for (unsigned i = 0; i != this->points.size(); ++i) {
174-
ret.out_indices.push_back(4 * i);
175-
ret.out_indices.push_back(4 * i + 1);
174+
ret.out_indices.push_back(uint16_t(4 * i));
175+
ret.out_indices.push_back(uint16_t(4 * i + 1));
176176
}
177177

178178
for (auto i = unsigned(this->points.size() - 1); i != 0; --i) {
179-
ret.out_indices.push_back(4 * i + 3);
180-
ret.out_indices.push_back(4 * i + 2);
179+
ret.out_indices.push_back(uint16_t(4 * i + 3));
180+
ret.out_indices.push_back(uint16_t(4 * i + 2));
181181
}
182182

183183
ret.out_indices.push_back(3);

src/ruis/util/timer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ timer::timer( //
3838

3939
void timer::update(uint32_t dt_ms)
4040
{
41-
if (dt_ms < this->left_ms) {
42-
constexpr auto max_dt_ms = std::numeric_limits<uint16_t>::max();
41+
if (dt_ms < uint32_t(this->left_ms)) {
42+
constexpr auto max_dt_ms = uint32_t(std::numeric_limits<uint16_t>::max());
4343

4444
this->left_ms -= dt_ms;
4545

@@ -48,7 +48,7 @@ void timer::update(uint32_t dt_ms)
4848
this->updater.get().stop(*this);
4949
this->updater.get().start( //
5050
utki::make_shared_from(static_cast<updateable&>(*this)),
51-
this->left_ms
51+
uint16_t(this->left_ms)
5252
);
5353
}
5454
}

src/ruis/widget/base/text_widget.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ text_widget::text_widget(
9494
utki::shared_ref<ruis::context> context, //
9595
parameters params
9696
) :
97-
widget(std::move(context), {}, {}),
9897
params([&]() {
9998
if (!params.font_face.get() && !params.font_face.is_from_style()) {
10099
params.font_face = this->context.get().style().get_font_face_normal();

src/ruis/widget/input/character_input_widget.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ namespace ruis {
3333
class character_input_widget : virtual public widget
3434
{
3535
protected:
36-
character_input_widget(utki::shared_ref<ruis::context> context) :
37-
widget(std::move(context), {}, {})
38-
{}
36+
character_input_widget(utki::shared_ref<ruis::context> context) {}
3937

4038
public:
4139
/**

tests/wire_area/src/wire_socket.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ class wire_socket : virtual public ruis::widget{
1212
left,
1313
top,
1414
right,
15-
bottom,
16-
17-
enum_size
15+
bottom
1816
};
1917

2018
struct parameters{

0 commit comments

Comments
 (0)