More MSVC warnings fixes

This commit is contained in:
Olivier Goffart 2021-07-01 14:15:30 +02:00
parent c25d41526a
commit 63cf84d21f
3 changed files with 4 additions and 4 deletions

View file

@ -350,7 +350,7 @@ SCENARIO("Invoke callback")
auto instance = result->create(); auto instance = result->create();
REQUIRE(instance->set_callback("foo", [](auto args) { REQUIRE(instance->set_callback("foo", [](auto args) {
SharedString arg1 = *args[0].to_string(); SharedString arg1 = *args[0].to_string();
int arg2 = *args[1].to_number(); double arg2 = *args[1].to_number();
std::string res = std::string(arg1) + ":" + std::to_string(arg2); std::string res = std::string(arg1) + ":" + std::to_string(arg2);
return Value(SharedString(res)); return Value(SharedString(res));
})); }));

View file

@ -69,12 +69,12 @@ void DashboardBuilder::add_top_bar_widget(WidgetPtr widget)
top_bar_widgets.push_back(widget_id); top_bar_widgets.push_back(widget_id);
} }
std::size_t DashboardBuilder::register_widget(WidgetPtr widget) int DashboardBuilder::register_widget(WidgetPtr widget)
{ {
auto widget_type_name = widget->type_name(); auto widget_type_name = widget->type_name();
widgets_used.insert(widget_type_name); widgets_used.insert(widget_type_name);
auto widget_id = widgets.size(); auto widget_id = int(widgets.size());
auto widget_name = fmt::format("widget_{}", widget_id); auto widget_name = fmt::format("widget_{}", widget_id);
widgets.push_back({ widget_name, widget }); widgets.push_back({ widget_name, widget });
return widget_id; return widget_id;

View file

@ -99,7 +99,7 @@ struct DashboardBuilder
build(sixtyfps::interpreter::ComponentCompiler &compiler) const; build(sixtyfps::interpreter::ComponentCompiler &compiler) const;
private: private:
std::size_t register_widget(WidgetPtr widget); int register_widget(WidgetPtr widget);
std::unordered_set<std::string> widgets_used = { "TopBar", "MenuBar" }; std::unordered_set<std::string> widgets_used = { "TopBar", "MenuBar" };
std::vector<int> top_bar_widgets; std::vector<int> top_bar_widgets;