From 3bd41979510fa2a93763564f222075f6d8ebd6f3 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Mon, 14 Jan 2019 20:04:40 +0100 Subject: [PATCH] gems: enable strict warnings for more components Issue #465 --- repos/gems/include/nano3d/cube_shape.h | 2 +- .../gems/include/nano3d/dodecahedron_shape.h | 2 +- repos/gems/include/nano3d/scene.h | 14 +- repos/gems/include/nano3d/sincos_frac16.h | 4 +- repos/gems/include/polygon_gfx/clipping.h | 4 +- repos/gems/include/polygon_gfx/line_painter.h | 2 +- .../polygon_gfx/polygon_painter_base.h | 6 + .../polygon_gfx/shaded_polygon_painter.h | 2 +- repos/gems/src/app/backdrop/main.cc | 138 +++++++++--------- repos/gems/src/app/backdrop/target.mk | 2 - repos/gems/src/app/cpu_load_display/main.cc | 6 +- repos/gems/src/app/cpu_load_display/target.mk | 2 - repos/gems/src/app/driver_manager/main.cc | 14 +- repos/gems/src/app/driver_manager/target.mk | 2 - .../src/app/menu_view/box_layout_widget.h | 2 +- repos/gems/src/app/menu_view/button_widget.h | 11 +- .../gems/src/app/menu_view/depgraph_widget.h | 10 +- repos/gems/src/app/menu_view/frame_widget.h | 8 + repos/gems/src/app/menu_view/label_widget.h | 10 +- repos/gems/src/app/menu_view/main.cc | 17 ++- .../gems/src/app/menu_view/scratch_surface.h | 8 +- repos/gems/src/app/menu_view/style_database.h | 4 +- repos/gems/src/app/menu_view/target.mk | 2 - repos/gems/src/app/menu_view/widget.h | 15 +- repos/gems/src/app/nano3d/main.cc | 2 +- repos/gems/src/app/nano3d/target.mk | 2 - repos/gems/src/server/file_terminal/main.cc | 12 +- repos/gems/src/server/file_terminal/target.mk | 2 - repos/gems/src/server/nit_fader/main.cc | 9 +- repos/gems/src/server/nit_fader/target.mk | 2 - 30 files changed, 178 insertions(+), 138 deletions(-) diff --git a/repos/gems/include/nano3d/cube_shape.h b/repos/gems/include/nano3d/cube_shape.h index d835091313..60a15ee8f0 100644 --- a/repos/gems/include/nano3d/cube_shape.h +++ b/repos/gems/include/nano3d/cube_shape.h @@ -27,7 +27,7 @@ class Nano3d::Cube_shape typedef Nano3d::Vertex_array Vertex_array; - Vertex_array _vertices; + Vertex_array _vertices { }; enum { VERTICES_PER_FACE = 4 }; diff --git a/repos/gems/include/nano3d/dodecahedron_shape.h b/repos/gems/include/nano3d/dodecahedron_shape.h index 62131c16cb..a90732eff3 100644 --- a/repos/gems/include/nano3d/dodecahedron_shape.h +++ b/repos/gems/include/nano3d/dodecahedron_shape.h @@ -68,7 +68,7 @@ class Nano3d::Dodecahedron_shape typedef Nano3d::Vertex_array Vertex_array; - Vertex_array _vertices; + Vertex_array _vertices { }; Edge _edges[NUM_EDGES]; Face _faces[NUM_FACES]; diff --git a/repos/gems/include/nano3d/scene.h b/repos/gems/include/nano3d/scene.h index 5b0ef27dd0..ae1229e2ff 100644 --- a/repos/gems/include/nano3d/scene.h +++ b/repos/gems/include/nano3d/scene.h @@ -35,7 +35,7 @@ namespace Nano3d { } -struct Nano3d::Input_handler +struct Nano3d::Input_handler : Genode::Interface { virtual void handle_input(Input::Event const [], unsigned num_events) = 0; }; @@ -55,6 +55,12 @@ class Nano3d::Scene private: + /** + * Noncopyable + */ + Scene(Scene const &); + Scene &operator = (Scene const &); + Genode::Env &_env; /** @@ -279,9 +285,11 @@ class Nano3d::Scene : _env(env), _pos(pos), _size(size) { + typedef Nitpicker::Session::View_handle View_handle; + Nitpicker::Rect rect(_pos, _size); _nitpicker.enqueue(_view_handle, rect); - _nitpicker.enqueue(_view_handle); + _nitpicker.enqueue(_view_handle, View_handle()); _nitpicker.execute(); _nitpicker.input()->sigh(_input_handler); @@ -292,6 +300,8 @@ class Nano3d::Scene _framebuffer.framebuffer.sync_sigh(_sync_handler); } + virtual ~Scene() { } + unsigned long elapsed_ms() const { return _timer.elapsed_ms(); } void input_handler(Input_handler *input_handler) diff --git a/repos/gems/include/nano3d/sincos_frac16.h b/repos/gems/include/nano3d/sincos_frac16.h index 866c6e864f..b8802f47fb 100644 --- a/repos/gems/include/nano3d/sincos_frac16.h +++ b/repos/gems/include/nano3d/sincos_frac16.h @@ -93,11 +93,11 @@ Nano3d::Sincos_frac16::Sincos_frac16() ny_high = ny_high << 1; /* use new sin/cos values for next iteration, preserve sign */ - x_low = (nx_high & 0x80000000) ? (nx_high | (~0 << 16)) : (nx_high & 0xffff); + x_low = (nx_high & 0x80000000) ? (nx_high | (~0U << 16)) : (nx_high & 0xffff); x_low = x_low >> 1; x_mid = nx_high >> 16; - y_low = (ny_high & 0x80000000) ? (ny_high | (~0 << 16)) : (ny_high & 0xffff); + y_low = (ny_high & 0x80000000) ? (ny_high | (~0U << 16)) : (ny_high & 0xffff); y_low = y_low >> 1; y_mid = ny_high >> 16; } diff --git a/repos/gems/include/polygon_gfx/clipping.h b/repos/gems/include/polygon_gfx/clipping.h index 97b1052421..31e5e427b1 100644 --- a/repos/gems/include/polygon_gfx/clipping.h +++ b/repos/gems/include/polygon_gfx/clipping.h @@ -52,12 +52,12 @@ struct Polygon::Point_base : Genode::Point<> /** * Return edge attribute by ID */ - inline int edge_attr(int id) const { return x(); } + inline int edge_attr(int) const { return x(); } /** * Assign value to edge attribute with specified ID */ - inline void edge_attr(int id, int value) { *this = Point_base(value, y()); } + inline void edge_attr(int, int value) { *this = Point_base(value, y()); } }; diff --git a/repos/gems/include/polygon_gfx/line_painter.h b/repos/gems/include/polygon_gfx/line_painter.h index 7698d2071b..a858633488 100644 --- a/repos/gems/include/polygon_gfx/line_painter.h +++ b/repos/gems/include/polygon_gfx/line_painter.h @@ -56,7 +56,7 @@ struct Line_painter Lut() { - auto fill_segment = [&] (long x1, long y1, long x2, long y2) + auto fill_segment = [&] (long x1, long y1, long x2, long) { for (long i = x1; i < x2; i++) value[i] = y1; }; diff --git a/repos/gems/include/polygon_gfx/polygon_painter_base.h b/repos/gems/include/polygon_gfx/polygon_painter_base.h index 6efa63aa08..0fd00c0856 100644 --- a/repos/gems/include/polygon_gfx/polygon_painter_base.h +++ b/repos/gems/include/polygon_gfx/polygon_painter_base.h @@ -118,6 +118,12 @@ class Polygon::Painter_base int * const _edges = (int *)_alloc.alloc(_edges_size()); + /** + * Noncopyable + */ + Edge_buffers(Edge_buffers const &); + Edge_buffers &operator = (Edge_buffers const &); + public: Edge_buffers(Genode::Allocator &alloc, unsigned edge_len) diff --git a/repos/gems/include/polygon_gfx/shaded_polygon_painter.h b/repos/gems/include/polygon_gfx/shaded_polygon_painter.h index 179962b71e..6aff7156ea 100644 --- a/repos/gems/include/polygon_gfx/shaded_polygon_painter.h +++ b/repos/gems/include/polygon_gfx/shaded_polygon_painter.h @@ -39,7 +39,7 @@ class Polygon::Shaded_painter : public Polygon::Painter_base */ struct Point : Point_base { - Color color; + Color color { }; Point() { } Point(int x, int y, Color color) : Point_base(x, y), color(color) { } diff --git a/repos/gems/src/app/backdrop/main.cc b/repos/gems/src/app/backdrop/main.cc index cf9fa30a5a..70dcc1b265 100644 --- a/repos/gems/src/app/backdrop/main.cc +++ b/repos/gems/src/app/backdrop/main.cc @@ -41,13 +41,13 @@ namespace Backdrop { struct Main; } struct Backdrop::Main { - Genode::Env &env; + Genode::Env &_env; - Genode::Heap heap { env.ram(), env.rm() }; + Genode::Heap _heap { _env.ram(), _env.rm() }; - Genode::Attached_rom_dataspace config { env, "config" }; + Genode::Attached_rom_dataspace _config { _env, "config" }; - Nitpicker::Connection nitpicker { env, "backdrop" }; + Nitpicker::Connection _nitpicker { _env, "backdrop" }; struct Buffer { @@ -116,50 +116,52 @@ struct Backdrop::Main } }; - Constructible buffer; + Constructible _buffer { }; - Nitpicker::Session::View_handle view_handle = nitpicker.create_view(); + Nitpicker::Session::View_handle _view_handle = _nitpicker.create_view(); void _update_view() { /* display view behind all others */ - typedef Nitpicker::Session::Command Command; - nitpicker.enqueue(view_handle); - Nitpicker::Rect rect(Nitpicker::Point(), buffer->size()); - nitpicker.enqueue(view_handle, rect); - nitpicker.enqueue(view_handle); - nitpicker.execute(); + typedef Nitpicker::Session::Command Command; + typedef Nitpicker::Session::View_handle View_handle; + + _nitpicker.enqueue(_view_handle); + Nitpicker::Rect rect(Nitpicker::Point(), _buffer->size()); + _nitpicker.enqueue(_view_handle, rect); + _nitpicker.enqueue(_view_handle, View_handle()); + _nitpicker.execute(); } /** * Function called on config change or mode change */ - void handle_config(); + void _handle_config(); - void handle_config_signal() { - Libc::with_libc([&] () { handle_config(); }); } + void _handle_config_signal() { + Libc::with_libc([&] () { _handle_config(); }); } - Signal_handler
config_dispatcher = { - env.ep(), *this, &Main::handle_config_signal }; + Signal_handler
_config_handler = { + _env.ep(), *this, &Main::_handle_config_signal }; - void handle_sync(); + void _handle_sync(); - Signal_handler
sync_handler = { - env.ep(), *this, &Main::handle_sync}; + Signal_handler
_sync_handler = { + _env.ep(), *this, &Main::_handle_sync}; template - void paint_texture(Surface &, Texture const &, Surface_base::Point, bool); + void _paint_texture(Surface &, Texture const &, Surface_base::Point, bool); - void apply_image(Xml_node); - void apply_fill(Xml_node); + void _apply_image(Xml_node); + void _apply_fill(Xml_node); - Main(Genode::Env &env) : env(env) + Main(Genode::Env &env) : _env(env) { - nitpicker.mode_sigh(config_dispatcher); + _nitpicker.mode_sigh(_config_handler); - config.sigh(config_dispatcher); + _config.sigh(_config_handler); - handle_config(); + _handle_config(); } }; @@ -201,8 +203,8 @@ static Surface_base::Area calc_scaled_size(Xml_node operation, template -void Backdrop::Main::paint_texture(Surface &surface, Texture const &texture, - Surface_base::Point pos, bool tiled) +void Backdrop::Main::_paint_texture(Surface &surface, Texture const &texture, + Surface_base::Point pos, bool tiled) { /* prevent division by zero */ if (texture.size().count() == 0) @@ -230,7 +232,7 @@ void Backdrop::Main::paint_texture(Surface &surface, Texture const &text } -void Backdrop::Main::apply_image(Xml_node operation) +void Backdrop::Main::_apply_image(Xml_node operation) { typedef Surface_base::Point Point; typedef Surface_base::Area Area; @@ -244,20 +246,20 @@ void Backdrop::Main::apply_image(Xml_node operation) png_file_name[0] = 0; operation.attribute("png").value(png_file_name, sizeof(png_file_name)); - File file(png_file_name, heap); + File file(png_file_name, _heap); Anchor anchor(operation); - Png_image png_image(env.ram(), env.rm(), heap, file.data()); + Png_image png_image(_env.ram(), _env.rm(), _heap, file.data()); Area const scaled_size = calc_scaled_size(operation, png_image.size(), - Area(buffer->mode.width(), - buffer->mode.height())); + Area(_buffer->mode.width(), + _buffer->mode.height())); /* * Determine parameters of graphics operation */ - int const h_gap = (int)buffer->mode.width() - scaled_size.w(), - v_gap = (int)buffer->mode.height() - scaled_size.h(); + int const h_gap = (int)_buffer->mode.width() - scaled_size.w(), + v_gap = (int)_buffer->mode.height() - scaled_size.h(); int const anchored_xpos = anchor.horizontal == Anchor::LOW ? 0 : anchor.horizontal == Anchor::CENTER ? h_gap/2 @@ -281,8 +283,8 @@ void Backdrop::Main::apply_image(Xml_node operation) Texture *png_texture = png_image.texture(); /* create texture with the scaled image */ - Chunky_texture scaled_texture(env.ram(), env.rm(), scaled_size); - scale(*png_texture, scaled_texture, heap); + Chunky_texture scaled_texture(_env.ram(), _env.rm(), scaled_size); + scale(*png_texture, scaled_texture, _heap); png_image.release_texture(png_texture); @@ -292,17 +294,17 @@ void Backdrop::Main::apply_image(Xml_node operation) /* create texture with down-sampled scaled image */ typedef Pixel_rgb565 PT; - Chunky_texture texture(env.ram(), env.rm(), scaled_size); - convert_pixel_format(scaled_texture, texture, alpha, heap); + Chunky_texture texture(_env.ram(), _env.rm(), scaled_size); + convert_pixel_format(scaled_texture, texture, alpha, _heap); /* paint texture onto surface */ - buffer->apply_to_surface([&] (Surface &surface) { - paint_texture(surface, texture, pos, tiled); + _buffer->apply_to_surface([&] (Surface &surface) { + _paint_texture(surface, texture, pos, tiled); }); } -void Backdrop::Main::apply_fill(Xml_node operation) +void Backdrop::Main::_apply_fill(Xml_node operation) { /* * Code specific for the screen mode's pixel format @@ -313,57 +315,53 @@ void Backdrop::Main::apply_fill(Xml_node operation) Color const color = Decorator::attribute(operation, "color", Color(0, 0, 0)); - buffer->apply_to_surface([&] (Surface &surface) { + _buffer->apply_to_surface([&] (Surface &surface) { Box_painter::paint(surface, Surface_base::Rect(Surface_base::Point(0, 0), - buffer->size()), color); + _buffer->size()), color); }); } -void Backdrop::Main::handle_config() +void Backdrop::Main::_handle_config() { - config.update(); + _config.update(); - buffer.construct(env, nitpicker); + _buffer.construct(_env, _nitpicker); /* clear surface */ - apply_fill(Xml_node("")); + _apply_fill(Xml_node("")); /* apply graphics primitives defined in the config */ - try { - for (unsigned i = 0; i < config.xml().num_sub_nodes(); i++) { - try { - Xml_node operation = config.xml().sub_node(i); + _config.xml().for_each_sub_node([&] (Xml_node operation) { + try { + if (operation.has_type("image")) + _apply_image(operation); - if (operation.has_type("image")) - apply_image(operation); - - if (operation.has_type("fill")) - apply_fill(operation); - } - catch (...) { - /* - * Ignore failure of individual operation, i.e., non-existing - * files or malformed PNG data. - */ - } + if (operation.has_type("fill")) + _apply_fill(operation); } - } catch (...) { /* ignore failure to obtain config */ } + catch (...) { + /* + * Ignore failure of individual operation, i.e., non-existing + * files or malformed PNG data. + */ + } + }); /* schedule buffer refresh */ - nitpicker.framebuffer()->sync_sigh(sync_handler); + _nitpicker.framebuffer()->sync_sigh(_sync_handler); } -void Backdrop::Main::handle_sync() +void Backdrop::Main::_handle_sync() { Libc::with_libc([&] () { - buffer->flush_surface(); + _buffer->flush_surface(); _update_view(); }); /* disable sync signal until the next call of 'handle_config' */ - nitpicker.framebuffer()->sync_sigh(Signal_context_capability()); + _nitpicker.framebuffer()->sync_sigh(Signal_context_capability()); } diff --git a/repos/gems/src/app/backdrop/target.mk b/repos/gems/src/app/backdrop/target.mk index 86d70d1556..810c7ef817 100644 --- a/repos/gems/src/app/backdrop/target.mk +++ b/repos/gems/src/app/backdrop/target.mk @@ -1,5 +1,3 @@ TARGET = backdrop SRC_CC = main.cc LIBS = base libc libpng zlib blit file - -CC_CXX_WARN_STRICT = diff --git a/repos/gems/src/app/cpu_load_display/main.cc b/repos/gems/src/app/cpu_load_display/main.cc index c0a07044a8..c842b7c48c 100644 --- a/repos/gems/src/app/cpu_load_display/main.cc +++ b/repos/gems/src/app/cpu_load_display/main.cc @@ -125,7 +125,7 @@ class Cpu_load_display::Cpu : public Genode::List::Element Genode::Allocator &_heap; Genode::Point<> const _pos; - Genode::List _timelines; + Genode::List _timelines { }; Timeline *_lookup_timeline(Xml_node subject) { @@ -215,7 +215,7 @@ class Cpu_load_display::Cpu_registry Genode::Allocator &_heap; - Genode::List _cpus; + Genode::List _cpus { }; static Genode::Point<> _cpu_pos(Xml_node subject) { @@ -446,7 +446,7 @@ class Cpu_load_display::Scene : public Nano3d::Scene /* determine number of CPUs */ unsigned num_cpus = 0; - _cpu_registry.for_each_cpu([&] (Cpu const &cpu) { num_cpus++; }); + _cpu_registry.for_each_cpu([&] (Cpu const &) { num_cpus++; }); if (num_cpus == 0) return; diff --git a/repos/gems/src/app/cpu_load_display/target.mk b/repos/gems/src/app/cpu_load_display/target.mk index 9a61c21fda..31797990e1 100644 --- a/repos/gems/src/app/cpu_load_display/target.mk +++ b/repos/gems/src/app/cpu_load_display/target.mk @@ -2,5 +2,3 @@ TARGET = cpu_load_display SRC_CC = main.cc LIBS = base INC_DIR += $(PRG_DIR) - -CC_CXX_WARN_STRICT = diff --git a/repos/gems/src/app/driver_manager/main.cc b/repos/gems/src/app/driver_manager/main.cc index b5a20b578e..cbf47dce00 100644 --- a/repos/gems/src/app/driver_manager/main.cc +++ b/repos/gems/src/app/driver_manager/main.cc @@ -41,7 +41,7 @@ namespace Driver_manager { } -struct Driver_manager::Block_devices_generator +struct Driver_manager::Block_devices_generator : Interface { virtual void generate_block_devices() = 0; }; @@ -310,7 +310,7 @@ struct Driver_manager::Nvme_driver : Device_driver }; -struct Driver_manager::Main : Block_devices_generator +struct Driver_manager::Main : private Block_devices_generator { Env &_env; @@ -325,11 +325,11 @@ struct Driver_manager::Main : Block_devices_generator Reporter _usb_drv_config { _env, "config", "usb_drv.config" }; Reporter _block_devices { _env, "block_devices" }; - Constructible _intel_fb_driver; - Constructible _vesa_fb_driver; - Constructible _boot_fb_driver; - Constructible _ahci_driver; - Constructible _nvme_driver; + Constructible _intel_fb_driver { }; + Constructible _vesa_fb_driver { }; + Constructible _boot_fb_driver { }; + Constructible _ahci_driver { }; + Constructible _nvme_driver { }; bool _use_ohci { true }; diff --git a/repos/gems/src/app/driver_manager/target.mk b/repos/gems/src/app/driver_manager/target.mk index b2d68a72e3..8dafdfea07 100644 --- a/repos/gems/src/app/driver_manager/target.mk +++ b/repos/gems/src/app/driver_manager/target.mk @@ -3,5 +3,3 @@ SRC_CC = main.cc LIBS += base REQUIRES = x86 - -CC_CXX_WARN_STRICT = diff --git a/repos/gems/src/app/menu_view/box_layout_widget.h b/repos/gems/src/app/menu_view/box_layout_widget.h index 4df7f346c1..ce2d686797 100644 --- a/repos/gems/src/app/menu_view/box_layout_widget.h +++ b/repos/gems/src/app/menu_view/box_layout_widget.h @@ -22,7 +22,7 @@ namespace Menu_view { struct Box_layout_widget; } struct Menu_view::Box_layout_widget : Widget { - Area _min_size; /* value cached from layout computation */ + Area _min_size { }; /* value cached from layout computation */ enum Direction { VERTICAL, HORIZONTAL }; diff --git a/repos/gems/src/app/menu_view/button_widget.h b/repos/gems/src/app/menu_view/button_widget.h index 708a5e4e54..a0a7c0b33f 100644 --- a/repos/gems/src/app/menu_view/button_widget.h +++ b/repos/gems/src/app/menu_view/button_widget.h @@ -33,7 +33,7 @@ struct Menu_view::Button_widget : Widget, Animator::Item Texture const * default_texture = nullptr; Texture const * hovered_texture = nullptr; - Lazy_value blend; + Lazy_value blend { }; Padding padding { 9, 9, 2, 1 }; @@ -158,6 +158,15 @@ struct Menu_view::Button_widget : Widget, Animator::Item animated(blend != blend.dst()); } + + private: + + /** + * Noncopyable + */ + Button_widget(Button_widget const &); + Button_widget &operator = (Button_widget const &); + }; #endif /* _BUTTON_WIDGET_H_ */ diff --git a/repos/gems/src/app/menu_view/depgraph_widget.h b/repos/gems/src/app/menu_view/depgraph_widget.h index 6be764ae4f..4d5f31ec54 100644 --- a/repos/gems/src/app/menu_view/depgraph_widget.h +++ b/repos/gems/src/app/menu_view/depgraph_widget.h @@ -28,7 +28,7 @@ namespace Menu_view { struct Depgraph_widget; } struct Menu_view::Depgraph_widget : Widget { - Area _min_size; /* value cached from layout computation */ + Area _min_size { }; /* value cached from layout computation */ struct Depth_direction { @@ -74,8 +74,8 @@ struct Menu_view::Depgraph_widget : Widget } }; - Registry > _server_anchors; - Registry > _client_anchors; + Registry > _server_anchors { }; + Registry > _client_anchors { }; struct Dependency { @@ -135,7 +135,7 @@ struct Menu_view::Depgraph_widget : Widget void apply_to_server(FN const &fn) const { fn(_server); } }; - Registry > _deps; + Registry > _deps { }; void cut_dependencies() { @@ -359,7 +359,7 @@ struct Menu_view::Depgraph_widget : Widget typedef Registered Registered_node; typedef Registry Node_registry; - Node_registry _nodes; + Node_registry _nodes { }; Registered_node _root_node { _nodes, _factory.alloc, *this }; diff --git a/repos/gems/src/app/menu_view/frame_widget.h b/repos/gems/src/app/menu_view/frame_widget.h index 2ee51e00b5..8cc8a9c68c 100644 --- a/repos/gems/src/app/menu_view/frame_widget.h +++ b/repos/gems/src/app/menu_view/frame_widget.h @@ -86,6 +86,14 @@ struct Menu_view::Frame_widget : Widget child.size(Area(geometry().w() - _space().w(), geometry().h() - _space().h())); }); } + + private: + + /** + * Noncopyable + */ + Frame_widget(Frame_widget const &); + Frame_widget &operator = (Frame_widget const &); }; #endif /* _FRAME_WIDGET_H_ */ diff --git a/repos/gems/src/app/menu_view/label_widget.h b/repos/gems/src/app/menu_view/label_widget.h index 316e4a20dc..1a3b064eb4 100644 --- a/repos/gems/src/app/menu_view/label_widget.h +++ b/repos/gems/src/app/menu_view/label_widget.h @@ -26,7 +26,7 @@ struct Menu_view::Label_widget : Widget enum { LABEL_MAX_LEN = 256 }; typedef String<200> Text; - Text text; + Text text { }; Label_widget(Widget_factory &factory, Xml_node node, Unique_id unique_id) : @@ -69,6 +69,14 @@ struct Menu_view::Label_widget : Widget Text_painter::Position(centered.x(), centered.y()), *font, Color(255, 255, 255), text.string()); } + + private: + + /** + * Noncopyable + */ + Label_widget(Label_widget const &); + Label_widget &operator = (Label_widget const &); }; #endif /* _LABEL_WIDGET_H_ */ diff --git a/repos/gems/src/app/menu_view/main.cc b/repos/gems/src/app/menu_view/main.cc index 081f2e126d..8aba49003f 100644 --- a/repos/gems/src/app/menu_view/main.cc +++ b/repos/gems/src/app/menu_view/main.cc @@ -39,13 +39,13 @@ struct Menu_view::Main Nitpicker::Connection _nitpicker { _env }; - Constructible _buffer; + Constructible _buffer { }; Nitpicker::Session::View_handle _view_handle = _nitpicker.create_view(); - Point _position; + Point _position { }; - Area _configured_size; + Area _configured_size { }; Area _root_widget_size() const { @@ -54,7 +54,7 @@ struct Menu_view::Main max(_configured_size.h(), min_size.h())); } - Rect _view_geometry; + Rect _view_geometry { }; void _update_view() { @@ -63,11 +63,12 @@ struct Menu_view::Main return; /* display view behind all others */ - typedef Nitpicker::Session::Command Command; + typedef Nitpicker::Session::Command Command; + typedef Nitpicker::Session::View_handle View_handle; _view_geometry = Rect(_position, _buffer->size()); _nitpicker.enqueue(_view_handle, _view_geometry); - _nitpicker.enqueue(_view_handle); + _nitpicker.enqueue(_view_handle, View_handle()); _nitpicker.execute(); } @@ -108,7 +109,7 @@ struct Menu_view::Main Style_database _styles { _env.ram(), _env.rm(), _heap, _fonts_dir }; - Animator _animator; + Animator _animator { }; Widget_factory _widget_factory { _heap, _styles, _animator }; @@ -118,7 +119,7 @@ struct Menu_view::Main Attached_dataspace _input_ds { _env.rm(), _nitpicker.input()->dataspace() }; - Widget::Unique_id _hovered; + Widget::Unique_id _hovered { }; void _handle_config(); diff --git a/repos/gems/src/app/menu_view/scratch_surface.h b/repos/gems/src/app/menu_view/scratch_surface.h index adf0f2b244..f61c6ecac8 100644 --- a/repos/gems/src/app/menu_view/scratch_surface.h +++ b/repos/gems/src/app/menu_view/scratch_surface.h @@ -25,7 +25,13 @@ class Menu_view::Scratch_surface { private: - Area _size; + /** + * Noncopyable + */ + Scratch_surface(Scratch_surface const &); + Scratch_surface &operator = (Scratch_surface const &); + + Area _size { }; Allocator &_alloc; unsigned char *_base = nullptr; size_t _num_bytes = 0; diff --git a/repos/gems/src/app/menu_view/style_database.h b/repos/gems/src/app/menu_view/style_database.h index 482c6d0317..1dd4be70b5 100644 --- a/repos/gems/src/app/menu_view/style_database.h +++ b/repos/gems/src/app/menu_view/style_database.h @@ -91,8 +91,8 @@ class Menu_view::Style_database * The list is mutable because it is populated as a side effect of * calling the const lookup function. */ - List mutable _textures; - List mutable _fonts; + List mutable _textures { }; + List mutable _fonts { }; template T const *_lookup(List &list, char const *path) const diff --git a/repos/gems/src/app/menu_view/target.mk b/repos/gems/src/app/menu_view/target.mk index a9de159b74..42877e1265 100644 --- a/repos/gems/src/app/menu_view/target.mk +++ b/repos/gems/src/app/menu_view/target.mk @@ -8,5 +8,3 @@ INC_DIR += $(PRG_DIR) $(TARGET): menu_view_styles.tar menu_view_styles.tar: $(VERBOSE)cd $(PRG_DIR); tar cf $(PWD)/bin/$@ styles - -CC_CXX_WARN_STRICT = diff --git a/repos/gems/src/app/menu_view/widget.h b/repos/gems/src/app/menu_view/widget.h index 70e2f73073..68ee393b9a 100644 --- a/repos/gems/src/app/menu_view/widget.h +++ b/repos/gems/src/app/menu_view/widget.h @@ -45,10 +45,17 @@ struct Menu_view::Margin }; -class Menu_view::Widget : public List_model::Element +class Menu_view::Widget : List_model::Element { + private: + + friend class List_model; + friend class List; + public: + using List_model::Element::next; + enum { NAME_MAX_LEN = 32 }; typedef String Name; @@ -93,7 +100,7 @@ class Menu_view::Widget : public List_model::Element Type_name const _type_name; Name const _name; - Version const _version; + Version const _version { }; Unique_id const _unique_id; @@ -101,7 +108,7 @@ class Menu_view::Widget : public List_model::Element Widget_factory &_factory; - List_model _children; + List_model _children { }; struct Model_update_policy : List_model::Update_policy { @@ -156,7 +163,7 @@ class Menu_view::Widget : public List_model::Element * Position relative to the parent widget and actual size, defined by * the parent */ - Rect _geometry; + Rect _geometry { }; Animated_rect _animated_geometry { _factory.animator }; diff --git a/repos/gems/src/app/nano3d/main.cc b/repos/gems/src/app/nano3d/main.cc index 656cbdc2e6..2d5dafee01 100644 --- a/repos/gems/src/app/nano3d/main.cc +++ b/repos/gems/src/app/nano3d/main.cc @@ -75,7 +75,7 @@ class Scene : public Nano3d::Scene } }; - Radial_texture _texture; + Radial_texture _texture { }; Shape _shape = SHAPE_DODECAHEDRON; Painter _painter = PAINTER_TEXTURED; diff --git a/repos/gems/src/app/nano3d/target.mk b/repos/gems/src/app/nano3d/target.mk index 9ba5c3788d..90b25a1923 100644 --- a/repos/gems/src/app/nano3d/target.mk +++ b/repos/gems/src/app/nano3d/target.mk @@ -2,5 +2,3 @@ TARGET = nano3d SRC_CC = main.cc LIBS = base INC_DIR += $(PRG_DIR) - -CC_CXX_WARN_STRICT = diff --git a/repos/gems/src/server/file_terminal/main.cc b/repos/gems/src/server/file_terminal/main.cc index c48928c67c..5b8862e8db 100644 --- a/repos/gems/src/server/file_terminal/main.cc +++ b/repos/gems/src/server/file_terminal/main.cc @@ -41,12 +41,12 @@ class Open_file /** * Signal handler to be informed about the established connection */ - Genode::Signal_context_capability _connected_sigh; + Genode::Signal_context_capability _connected_sigh { }; /** * Signal handler to be informed about data available to read */ - Genode::Signal_context_capability _read_avail_sigh; + Genode::Signal_context_capability _read_avail_sigh { }; /** * Buffer for incoming data @@ -61,7 +61,7 @@ class Open_file */ enum { READ_BUF_SIZE = 4096 }; char _read_buf[READ_BUF_SIZE]; - Genode::size_t _read_buf_bytes_used; + Genode::size_t _read_buf_bytes_used { }; public: @@ -148,7 +148,7 @@ class Open_file namespace Terminal { class Session_component : public Genode::Rpc_object, - public Open_file + private Open_file { private: @@ -221,8 +221,8 @@ namespace Terminal { void size_changed_sigh(Genode::Signal_context_capability) override { } - Genode::size_t read(void *buf, Genode::size_t) override { return 0; } - Genode::size_t write(void const *buf, Genode::size_t) override { return 0; } + Genode::size_t read(void *, Genode::size_t) override { return 0; } + Genode::size_t write(void const *, Genode::size_t) override { return 0; } }; diff --git a/repos/gems/src/server/file_terminal/target.mk b/repos/gems/src/server/file_terminal/target.mk index c5bd2fd51b..5b3896aee0 100644 --- a/repos/gems/src/server/file_terminal/target.mk +++ b/repos/gems/src/server/file_terminal/target.mk @@ -1,5 +1,3 @@ TARGET = file_terminal SRC_CC = main.cc LIBS = base libc - -CC_CXX_WARN_STRICT = diff --git a/repos/gems/src/server/nit_fader/main.cc b/repos/gems/src/server/nit_fader/main.cc index a983632c86..c93041a28e 100644 --- a/repos/gems/src/server/nit_fader/main.cc +++ b/repos/gems/src/server/nit_fader/main.cc @@ -141,10 +141,10 @@ class Nit_fader::Framebuffer_session_component Nitpicker::Connection &_nitpicker; Src_buffer &_src_buffer; - Constructible _dst_buffer; + Constructible _dst_buffer { }; - Lazy_value _fade; + Lazy_value _fade { }; public: @@ -279,9 +279,10 @@ class Nit_fader::Nitpicker_session_component Framebuffer::Session_capability _fb_cap { _env.ep().manage(_fb_session) }; - Nitpicker::Session::View_handle _view_handle; + Nitpicker::Session::View_handle _view_handle { }; + bool _view_visible = false; - Rect _view_geometry; + Rect _view_geometry { }; void _update_view_visibility() { diff --git a/repos/gems/src/server/nit_fader/target.mk b/repos/gems/src/server/nit_fader/target.mk index c3323cee48..2f0133baa5 100644 --- a/repos/gems/src/server/nit_fader/target.mk +++ b/repos/gems/src/server/nit_fader/target.mk @@ -2,5 +2,3 @@ TARGET = nit_fader SRC_CC = main.cc LIBS = base blit INC_DIR += $(PRG_DIR) - -CC_CXX_WARN_STRICT =