gems: enable strict warnings for more components

Issue #465
This commit is contained in:
Norman Feske 2019-01-14 20:04:40 +01:00
parent 21ed41da9a
commit 3bd4197951
30 changed files with 178 additions and 138 deletions

View File

@ -27,7 +27,7 @@ class Nano3d::Cube_shape
typedef Nano3d::Vertex_array<NUM_VERTICES> Vertex_array; typedef Nano3d::Vertex_array<NUM_VERTICES> Vertex_array;
Vertex_array _vertices; Vertex_array _vertices { };
enum { VERTICES_PER_FACE = 4 }; enum { VERTICES_PER_FACE = 4 };

View File

@ -68,7 +68,7 @@ class Nano3d::Dodecahedron_shape
typedef Nano3d::Vertex_array<NUM_VERTICES> Vertex_array; typedef Nano3d::Vertex_array<NUM_VERTICES> Vertex_array;
Vertex_array _vertices; Vertex_array _vertices { };
Edge _edges[NUM_EDGES]; Edge _edges[NUM_EDGES];
Face _faces[NUM_FACES]; Face _faces[NUM_FACES];

View File

@ -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; virtual void handle_input(Input::Event const [], unsigned num_events) = 0;
}; };
@ -55,6 +55,12 @@ class Nano3d::Scene
private: private:
/**
* Noncopyable
*/
Scene(Scene const &);
Scene &operator = (Scene const &);
Genode::Env &_env; Genode::Env &_env;
/** /**
@ -279,9 +285,11 @@ class Nano3d::Scene
: :
_env(env), _pos(pos), _size(size) _env(env), _pos(pos), _size(size)
{ {
typedef Nitpicker::Session::View_handle View_handle;
Nitpicker::Rect rect(_pos, _size); Nitpicker::Rect rect(_pos, _size);
_nitpicker.enqueue<Command::Geometry>(_view_handle, rect); _nitpicker.enqueue<Command::Geometry>(_view_handle, rect);
_nitpicker.enqueue<Command::To_front>(_view_handle); _nitpicker.enqueue<Command::To_front>(_view_handle, View_handle());
_nitpicker.execute(); _nitpicker.execute();
_nitpicker.input()->sigh(_input_handler); _nitpicker.input()->sigh(_input_handler);
@ -292,6 +300,8 @@ class Nano3d::Scene
_framebuffer.framebuffer.sync_sigh(_sync_handler); _framebuffer.framebuffer.sync_sigh(_sync_handler);
} }
virtual ~Scene() { }
unsigned long elapsed_ms() const { return _timer.elapsed_ms(); } unsigned long elapsed_ms() const { return _timer.elapsed_ms(); }
void input_handler(Input_handler *input_handler) void input_handler(Input_handler *input_handler)

View File

@ -93,11 +93,11 @@ Nano3d::Sincos_frac16::Sincos_frac16()
ny_high = ny_high << 1; ny_high = ny_high << 1;
/* use new sin/cos values for next iteration, preserve sign */ /* 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_low = x_low >> 1;
x_mid = nx_high >> 16; 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_low = y_low >> 1;
y_mid = ny_high >> 16; y_mid = ny_high >> 16;
} }

View File

@ -52,12 +52,12 @@ struct Polygon::Point_base : Genode::Point<>
/** /**
* Return edge attribute by ID * 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 * 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()); }
}; };

View File

@ -56,7 +56,7 @@ struct Line_painter
Lut() 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; for (long i = x1; i < x2; i++) value[i] = y1;
}; };

View File

@ -118,6 +118,12 @@ class Polygon::Painter_base
int * const _edges = (int *)_alloc.alloc(_edges_size()); int * const _edges = (int *)_alloc.alloc(_edges_size());
/**
* Noncopyable
*/
Edge_buffers(Edge_buffers const &);
Edge_buffers &operator = (Edge_buffers const &);
public: public:
Edge_buffers(Genode::Allocator &alloc, unsigned edge_len) Edge_buffers(Genode::Allocator &alloc, unsigned edge_len)

View File

@ -39,7 +39,7 @@ class Polygon::Shaded_painter : public Polygon::Painter_base
*/ */
struct Point : Point_base struct Point : Point_base
{ {
Color color; Color color { };
Point() { } Point() { }
Point(int x, int y, Color color) : Point_base(x, y), color(color) { } Point(int x, int y, Color color) : Point_base(x, y), color(color) { }

View File

@ -41,13 +41,13 @@ namespace Backdrop { struct Main; }
struct Backdrop::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 struct Buffer
{ {
@ -116,50 +116,52 @@ struct Backdrop::Main
} }
}; };
Constructible<Buffer> buffer; Constructible<Buffer> _buffer { };
Nitpicker::Session::View_handle view_handle = nitpicker.create_view(); Nitpicker::Session::View_handle _view_handle = _nitpicker.create_view();
void _update_view() void _update_view()
{ {
/* display view behind all others */ /* display view behind all others */
typedef Nitpicker::Session::Command Command; typedef Nitpicker::Session::Command Command;
nitpicker.enqueue<Command::Background>(view_handle); typedef Nitpicker::Session::View_handle View_handle;
Nitpicker::Rect rect(Nitpicker::Point(), buffer->size());
nitpicker.enqueue<Command::Geometry>(view_handle, rect); _nitpicker.enqueue<Command::Background>(_view_handle);
nitpicker.enqueue<Command::To_back>(view_handle); Nitpicker::Rect rect(Nitpicker::Point(), _buffer->size());
nitpicker.execute(); _nitpicker.enqueue<Command::Geometry>(_view_handle, rect);
_nitpicker.enqueue<Command::To_back>(_view_handle, View_handle());
_nitpicker.execute();
} }
/** /**
* Function called on config change or mode change * Function called on config change or mode change
*/ */
void handle_config(); void _handle_config();
void handle_config_signal() { void _handle_config_signal() {
Libc::with_libc([&] () { handle_config(); }); } Libc::with_libc([&] () { _handle_config(); }); }
Signal_handler<Main> config_dispatcher = { Signal_handler<Main> _config_handler = {
env.ep(), *this, &Main::handle_config_signal }; _env.ep(), *this, &Main::_handle_config_signal };
void handle_sync(); void _handle_sync();
Signal_handler<Main> sync_handler = { Signal_handler<Main> _sync_handler = {
env.ep(), *this, &Main::handle_sync}; _env.ep(), *this, &Main::_handle_sync};
template <typename PT> template <typename PT>
void paint_texture(Surface<PT> &, Texture<PT> const &, Surface_base::Point, bool); void _paint_texture(Surface<PT> &, Texture<PT> const &, Surface_base::Point, bool);
void apply_image(Xml_node); void _apply_image(Xml_node);
void apply_fill(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 <typename PT> template <typename PT>
void Backdrop::Main::paint_texture(Surface<PT> &surface, Texture<PT> const &texture, void Backdrop::Main::_paint_texture(Surface<PT> &surface, Texture<PT> const &texture,
Surface_base::Point pos, bool tiled) Surface_base::Point pos, bool tiled)
{ {
/* prevent division by zero */ /* prevent division by zero */
if (texture.size().count() == 0) if (texture.size().count() == 0)
@ -230,7 +232,7 @@ void Backdrop::Main::paint_texture(Surface<PT> &surface, Texture<PT> 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::Point Point;
typedef Surface_base::Area Area; typedef Surface_base::Area Area;
@ -244,20 +246,20 @@ void Backdrop::Main::apply_image(Xml_node operation)
png_file_name[0] = 0; png_file_name[0] = 0;
operation.attribute("png").value(png_file_name, sizeof(png_file_name)); 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); Anchor anchor(operation);
Png_image png_image(env.ram(), env.rm(), heap, file.data<void>()); Png_image png_image(_env.ram(), _env.rm(), _heap, file.data<void>());
Area const scaled_size = calc_scaled_size(operation, png_image.size(), Area const scaled_size = calc_scaled_size(operation, png_image.size(),
Area(buffer->mode.width(), Area(_buffer->mode.width(),
buffer->mode.height())); _buffer->mode.height()));
/* /*
* Determine parameters of graphics operation * Determine parameters of graphics operation
*/ */
int const h_gap = (int)buffer->mode.width() - scaled_size.w(), int const h_gap = (int)_buffer->mode.width() - scaled_size.w(),
v_gap = (int)buffer->mode.height() - scaled_size.h(); v_gap = (int)_buffer->mode.height() - scaled_size.h();
int const anchored_xpos = anchor.horizontal == Anchor::LOW ? 0 int const anchored_xpos = anchor.horizontal == Anchor::LOW ? 0
: anchor.horizontal == Anchor::CENTER ? h_gap/2 : anchor.horizontal == Anchor::CENTER ? h_gap/2
@ -281,8 +283,8 @@ void Backdrop::Main::apply_image(Xml_node operation)
Texture<Pixel_rgb888> *png_texture = png_image.texture<Pixel_rgb888>(); Texture<Pixel_rgb888> *png_texture = png_image.texture<Pixel_rgb888>();
/* create texture with the scaled image */ /* create texture with the scaled image */
Chunky_texture<Pixel_rgb888> scaled_texture(env.ram(), env.rm(), scaled_size); Chunky_texture<Pixel_rgb888> scaled_texture(_env.ram(), _env.rm(), scaled_size);
scale(*png_texture, scaled_texture, heap); scale(*png_texture, scaled_texture, _heap);
png_image.release_texture(png_texture); 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 */ /* create texture with down-sampled scaled image */
typedef Pixel_rgb565 PT; typedef Pixel_rgb565 PT;
Chunky_texture<PT> texture(env.ram(), env.rm(), scaled_size); Chunky_texture<PT> texture(_env.ram(), _env.rm(), scaled_size);
convert_pixel_format(scaled_texture, texture, alpha, heap); convert_pixel_format(scaled_texture, texture, alpha, _heap);
/* paint texture onto surface */ /* paint texture onto surface */
buffer->apply_to_surface<PT>([&] (Surface<PT> &surface) { _buffer->apply_to_surface<PT>([&] (Surface<PT> &surface) {
paint_texture(surface, texture, pos, tiled); _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 * 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)); Color const color = Decorator::attribute(operation, "color", Color(0, 0, 0));
buffer->apply_to_surface<PT>([&] (Surface<PT> &surface) { _buffer->apply_to_surface<PT>([&] (Surface<PT> &surface) {
Box_painter::paint(surface, Surface_base::Rect(Surface_base::Point(0, 0), 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 */ /* clear surface */
apply_fill(Xml_node("<fill color=\"#000000\"/>")); _apply_fill(Xml_node("<fill color=\"#000000\"/>"));
/* apply graphics primitives defined in the config */ /* apply graphics primitives defined in the config */
try { _config.xml().for_each_sub_node([&] (Xml_node operation) {
for (unsigned i = 0; i < config.xml().num_sub_nodes(); i++) { try {
try { if (operation.has_type("image"))
Xml_node operation = config.xml().sub_node(i); _apply_image(operation);
if (operation.has_type("image")) if (operation.has_type("fill"))
apply_image(operation); _apply_fill(operation);
if (operation.has_type("fill"))
apply_fill(operation);
}
catch (...) {
/*
* Ignore failure of individual operation, i.e., non-existing
* files or malformed PNG data.
*/
}
} }
} catch (...) { /* ignore failure to obtain config */ } catch (...) {
/*
* Ignore failure of individual operation, i.e., non-existing
* files or malformed PNG data.
*/
}
});
/* schedule buffer refresh */ /* 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([&] () { Libc::with_libc([&] () {
buffer->flush_surface(); _buffer->flush_surface();
_update_view(); _update_view();
}); });
/* disable sync signal until the next call of 'handle_config' */ /* disable sync signal until the next call of 'handle_config' */
nitpicker.framebuffer()->sync_sigh(Signal_context_capability()); _nitpicker.framebuffer()->sync_sigh(Signal_context_capability());
} }

View File

@ -1,5 +1,3 @@
TARGET = backdrop TARGET = backdrop
SRC_CC = main.cc SRC_CC = main.cc
LIBS = base libc libpng zlib blit file LIBS = base libc libpng zlib blit file
CC_CXX_WARN_STRICT =

View File

@ -125,7 +125,7 @@ class Cpu_load_display::Cpu : public Genode::List<Cpu>::Element
Genode::Allocator &_heap; Genode::Allocator &_heap;
Genode::Point<> const _pos; Genode::Point<> const _pos;
Genode::List<Timeline> _timelines; Genode::List<Timeline> _timelines { };
Timeline *_lookup_timeline(Xml_node subject) Timeline *_lookup_timeline(Xml_node subject)
{ {
@ -215,7 +215,7 @@ class Cpu_load_display::Cpu_registry
Genode::Allocator &_heap; Genode::Allocator &_heap;
Genode::List<Cpu> _cpus; Genode::List<Cpu> _cpus { };
static Genode::Point<> _cpu_pos(Xml_node subject) static Genode::Point<> _cpu_pos(Xml_node subject)
{ {
@ -446,7 +446,7 @@ class Cpu_load_display::Scene : public Nano3d::Scene<PT>
/* determine number of CPUs */ /* determine number of CPUs */
unsigned num_cpus = 0; 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) if (num_cpus == 0)
return; return;

View File

@ -2,5 +2,3 @@ TARGET = cpu_load_display
SRC_CC = main.cc SRC_CC = main.cc
LIBS = base LIBS = base
INC_DIR += $(PRG_DIR) INC_DIR += $(PRG_DIR)
CC_CXX_WARN_STRICT =

View File

@ -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; 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; Env &_env;
@ -325,11 +325,11 @@ struct Driver_manager::Main : Block_devices_generator
Reporter _usb_drv_config { _env, "config", "usb_drv.config" }; Reporter _usb_drv_config { _env, "config", "usb_drv.config" };
Reporter _block_devices { _env, "block_devices" }; Reporter _block_devices { _env, "block_devices" };
Constructible<Intel_fb_driver> _intel_fb_driver; Constructible<Intel_fb_driver> _intel_fb_driver { };
Constructible<Vesa_fb_driver> _vesa_fb_driver; Constructible<Vesa_fb_driver> _vesa_fb_driver { };
Constructible<Boot_fb_driver> _boot_fb_driver; Constructible<Boot_fb_driver> _boot_fb_driver { };
Constructible<Ahci_driver> _ahci_driver; Constructible<Ahci_driver> _ahci_driver { };
Constructible<Nvme_driver> _nvme_driver; Constructible<Nvme_driver> _nvme_driver { };
bool _use_ohci { true }; bool _use_ohci { true };

View File

@ -3,5 +3,3 @@ SRC_CC = main.cc
LIBS += base LIBS += base
REQUIRES = x86 REQUIRES = x86
CC_CXX_WARN_STRICT =

View File

@ -22,7 +22,7 @@ namespace Menu_view { struct Box_layout_widget; }
struct Menu_view::Box_layout_widget : 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 }; enum Direction { VERTICAL, HORIZONTAL };

View File

@ -33,7 +33,7 @@ struct Menu_view::Button_widget : Widget, Animator::Item
Texture<Pixel_rgb888> const * default_texture = nullptr; Texture<Pixel_rgb888> const * default_texture = nullptr;
Texture<Pixel_rgb888> const * hovered_texture = nullptr; Texture<Pixel_rgb888> const * hovered_texture = nullptr;
Lazy_value<int> blend; Lazy_value<int> blend { };
Padding padding { 9, 9, 2, 1 }; Padding padding { 9, 9, 2, 1 };
@ -158,6 +158,15 @@ struct Menu_view::Button_widget : Widget, Animator::Item
animated(blend != blend.dst()); animated(blend != blend.dst());
} }
private:
/**
* Noncopyable
*/
Button_widget(Button_widget const &);
Button_widget &operator = (Button_widget const &);
}; };
#endif /* _BUTTON_WIDGET_H_ */ #endif /* _BUTTON_WIDGET_H_ */

View File

@ -28,7 +28,7 @@ namespace Menu_view { struct Depgraph_widget; }
struct Menu_view::Depgraph_widget : 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 struct Depth_direction
{ {
@ -74,8 +74,8 @@ struct Menu_view::Depgraph_widget : Widget
} }
}; };
Registry<Registered<Anchor> > _server_anchors; Registry<Registered<Anchor> > _server_anchors { };
Registry<Registered<Anchor> > _client_anchors; Registry<Registered<Anchor> > _client_anchors { };
struct Dependency struct Dependency
{ {
@ -135,7 +135,7 @@ struct Menu_view::Depgraph_widget : Widget
void apply_to_server(FN const &fn) const { fn(_server); } void apply_to_server(FN const &fn) const { fn(_server); }
}; };
Registry<Registered<Dependency> > _deps; Registry<Registered<Dependency> > _deps { };
void cut_dependencies() void cut_dependencies()
{ {
@ -359,7 +359,7 @@ struct Menu_view::Depgraph_widget : Widget
typedef Registered<Node> Registered_node; typedef Registered<Node> Registered_node;
typedef Registry<Registered_node> Node_registry; typedef Registry<Registered_node> Node_registry;
Node_registry _nodes; Node_registry _nodes { };
Registered_node _root_node { _nodes, _factory.alloc, *this }; Registered_node _root_node { _nodes, _factory.alloc, *this };

View File

@ -86,6 +86,14 @@ struct Menu_view::Frame_widget : Widget
child.size(Area(geometry().w() - _space().w(), child.size(Area(geometry().w() - _space().w(),
geometry().h() - _space().h())); }); geometry().h() - _space().h())); });
} }
private:
/**
* Noncopyable
*/
Frame_widget(Frame_widget const &);
Frame_widget &operator = (Frame_widget const &);
}; };
#endif /* _FRAME_WIDGET_H_ */ #endif /* _FRAME_WIDGET_H_ */

View File

@ -26,7 +26,7 @@ struct Menu_view::Label_widget : Widget
enum { LABEL_MAX_LEN = 256 }; enum { LABEL_MAX_LEN = 256 };
typedef String<200> Text; typedef String<200> Text;
Text text; Text text { };
Label_widget(Widget_factory &factory, Xml_node node, Unique_id unique_id) 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()), Text_painter::Position(centered.x(), centered.y()),
*font, Color(255, 255, 255), text.string()); *font, Color(255, 255, 255), text.string());
} }
private:
/**
* Noncopyable
*/
Label_widget(Label_widget const &);
Label_widget &operator = (Label_widget const &);
}; };
#endif /* _LABEL_WIDGET_H_ */ #endif /* _LABEL_WIDGET_H_ */

View File

@ -39,13 +39,13 @@ struct Menu_view::Main
Nitpicker::Connection _nitpicker { _env }; Nitpicker::Connection _nitpicker { _env };
Constructible<Nitpicker_buffer> _buffer; Constructible<Nitpicker_buffer> _buffer { };
Nitpicker::Session::View_handle _view_handle = _nitpicker.create_view(); Nitpicker::Session::View_handle _view_handle = _nitpicker.create_view();
Point _position; Point _position { };
Area _configured_size; Area _configured_size { };
Area _root_widget_size() const Area _root_widget_size() const
{ {
@ -54,7 +54,7 @@ struct Menu_view::Main
max(_configured_size.h(), min_size.h())); max(_configured_size.h(), min_size.h()));
} }
Rect _view_geometry; Rect _view_geometry { };
void _update_view() void _update_view()
{ {
@ -63,11 +63,12 @@ struct Menu_view::Main
return; return;
/* display view behind all others */ /* 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()); _view_geometry = Rect(_position, _buffer->size());
_nitpicker.enqueue<Command::Geometry>(_view_handle, _view_geometry); _nitpicker.enqueue<Command::Geometry>(_view_handle, _view_geometry);
_nitpicker.enqueue<Command::To_front>(_view_handle); _nitpicker.enqueue<Command::To_front>(_view_handle, View_handle());
_nitpicker.execute(); _nitpicker.execute();
} }
@ -108,7 +109,7 @@ struct Menu_view::Main
Style_database _styles { _env.ram(), _env.rm(), _heap, _fonts_dir }; Style_database _styles { _env.ram(), _env.rm(), _heap, _fonts_dir };
Animator _animator; Animator _animator { };
Widget_factory _widget_factory { _heap, _styles, _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() }; Attached_dataspace _input_ds { _env.rm(), _nitpicker.input()->dataspace() };
Widget::Unique_id _hovered; Widget::Unique_id _hovered { };
void _handle_config(); void _handle_config();

View File

@ -25,7 +25,13 @@ class Menu_view::Scratch_surface
{ {
private: private:
Area _size; /**
* Noncopyable
*/
Scratch_surface(Scratch_surface const &);
Scratch_surface &operator = (Scratch_surface const &);
Area _size { };
Allocator &_alloc; Allocator &_alloc;
unsigned char *_base = nullptr; unsigned char *_base = nullptr;
size_t _num_bytes = 0; size_t _num_bytes = 0;

View File

@ -91,8 +91,8 @@ class Menu_view::Style_database
* The list is mutable because it is populated as a side effect of * The list is mutable because it is populated as a side effect of
* calling the const lookup function. * calling the const lookup function.
*/ */
List<Texture_entry> mutable _textures; List<Texture_entry> mutable _textures { };
List<Font_entry> mutable _fonts; List<Font_entry> mutable _fonts { };
template <typename T> template <typename T>
T const *_lookup(List<T> &list, char const *path) const T const *_lookup(List<T> &list, char const *path) const

View File

@ -8,5 +8,3 @@ INC_DIR += $(PRG_DIR)
$(TARGET): menu_view_styles.tar $(TARGET): menu_view_styles.tar
menu_view_styles.tar: menu_view_styles.tar:
$(VERBOSE)cd $(PRG_DIR); tar cf $(PWD)/bin/$@ styles $(VERBOSE)cd $(PRG_DIR); tar cf $(PWD)/bin/$@ styles
CC_CXX_WARN_STRICT =

View File

@ -45,10 +45,17 @@ struct Menu_view::Margin
}; };
class Menu_view::Widget : public List_model<Widget>::Element class Menu_view::Widget : List_model<Widget>::Element
{ {
private:
friend class List_model<Widget>;
friend class List<Widget>;
public: public:
using List_model<Widget>::Element::next;
enum { NAME_MAX_LEN = 32 }; enum { NAME_MAX_LEN = 32 };
typedef String<NAME_MAX_LEN> Name; typedef String<NAME_MAX_LEN> Name;
@ -93,7 +100,7 @@ class Menu_view::Widget : public List_model<Widget>::Element
Type_name const _type_name; Type_name const _type_name;
Name const _name; Name const _name;
Version const _version; Version const _version { };
Unique_id const _unique_id; Unique_id const _unique_id;
@ -101,7 +108,7 @@ class Menu_view::Widget : public List_model<Widget>::Element
Widget_factory &_factory; Widget_factory &_factory;
List_model<Widget> _children; List_model<Widget> _children { };
struct Model_update_policy : List_model<Widget>::Update_policy struct Model_update_policy : List_model<Widget>::Update_policy
{ {
@ -156,7 +163,7 @@ class Menu_view::Widget : public List_model<Widget>::Element
* Position relative to the parent widget and actual size, defined by * Position relative to the parent widget and actual size, defined by
* the parent * the parent
*/ */
Rect _geometry; Rect _geometry { };
Animated_rect _animated_geometry { _factory.animator }; Animated_rect _animated_geometry { _factory.animator };

View File

@ -75,7 +75,7 @@ class Scene : public Nano3d::Scene<PT>
} }
}; };
Radial_texture _texture; Radial_texture _texture { };
Shape _shape = SHAPE_DODECAHEDRON; Shape _shape = SHAPE_DODECAHEDRON;
Painter _painter = PAINTER_TEXTURED; Painter _painter = PAINTER_TEXTURED;

View File

@ -2,5 +2,3 @@ TARGET = nano3d
SRC_CC = main.cc SRC_CC = main.cc
LIBS = base LIBS = base
INC_DIR += $(PRG_DIR) INC_DIR += $(PRG_DIR)
CC_CXX_WARN_STRICT =

View File

@ -41,12 +41,12 @@ class Open_file
/** /**
* Signal handler to be informed about the established connection * 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 * 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 * Buffer for incoming data
@ -61,7 +61,7 @@ class Open_file
*/ */
enum { READ_BUF_SIZE = 4096 }; enum { READ_BUF_SIZE = 4096 };
char _read_buf[READ_BUF_SIZE]; char _read_buf[READ_BUF_SIZE];
Genode::size_t _read_buf_bytes_used; Genode::size_t _read_buf_bytes_used { };
public: public:
@ -148,7 +148,7 @@ class Open_file
namespace Terminal { namespace Terminal {
class Session_component : public Genode::Rpc_object<Session, Session_component>, class Session_component : public Genode::Rpc_object<Session, Session_component>,
public Open_file private Open_file
{ {
private: private:
@ -221,8 +221,8 @@ namespace Terminal {
void size_changed_sigh(Genode::Signal_context_capability) override { } void size_changed_sigh(Genode::Signal_context_capability) override { }
Genode::size_t read(void *buf, Genode::size_t) override { return 0; } Genode::size_t read(void *, Genode::size_t) override { return 0; }
Genode::size_t write(void const *buf, Genode::size_t) override { return 0; } Genode::size_t write(void const *, Genode::size_t) override { return 0; }
}; };

View File

@ -1,5 +1,3 @@
TARGET = file_terminal TARGET = file_terminal
SRC_CC = main.cc SRC_CC = main.cc
LIBS = base libc LIBS = base libc
CC_CXX_WARN_STRICT =

View File

@ -141,10 +141,10 @@ class Nit_fader::Framebuffer_session_component
Nitpicker::Connection &_nitpicker; Nitpicker::Connection &_nitpicker;
Src_buffer &_src_buffer; Src_buffer &_src_buffer;
Constructible<Dst_buffer> _dst_buffer; Constructible<Dst_buffer> _dst_buffer { };
Lazy_value<int> _fade; Lazy_value<int> _fade { };
public: public:
@ -279,9 +279,10 @@ class Nit_fader::Nitpicker_session_component
Framebuffer::Session_capability _fb_cap { _env.ep().manage(_fb_session) }; 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; bool _view_visible = false;
Rect _view_geometry; Rect _view_geometry { };
void _update_view_visibility() void _update_view_visibility()
{ {

View File

@ -2,5 +2,3 @@ TARGET = nit_fader
SRC_CC = main.cc SRC_CC = main.cc
LIBS = base blit LIBS = base blit
INC_DIR += $(PRG_DIR) INC_DIR += $(PRG_DIR)
CC_CXX_WARN_STRICT =