From 88db3c0df7cdfa13451d3fc18abcc110853208c8 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Mon, 20 Mar 2017 12:04:55 +0100 Subject: [PATCH] Fix some deprecated warnings Issue #1987 --- repos/base-hw/src/test/cpu_quota/sync/main.cc | 3 +- repos/dde_linux/src/lib/libc_lxip/plugin.cc | 1 - repos/dde_linux/src/lib/lxip/timer_handler.cc | 1 - repos/dde_linux/src/test/vfs_lxip/main.cc | 4 +- repos/dde_rump/include/util/allocator_fap.h | 1 + .../src/server/rump_cgd/block_driver.h | 2 +- repos/dde_rump/src/server/rump_cgd/cgd.cc | 2 +- repos/dde_rump/src/server/rump_cgd/cgd.h | 3 +- repos/dde_rump/src/server/rump_cgd/main.cc | 2 +- repos/gems/run/cpu_load_display.run | 2 +- repos/gems/src/app/cpu_load_display/main.cc | 25 +++++++----- .../cpu_sampler/cpu_session_component.cc | 2 +- .../cpu_sampler/cpu_thread_component.cc | 10 ++--- .../server/cpu_sampler/cpu_thread_component.h | 4 +- repos/gems/src/server/cpu_sampler/main.cc | 17 +++----- repos/libports/run/acpica.run | 5 +-- repos/libports/run/avplay.run | 11 +++-- repos/libports/run/eglgears.run | 5 +-- repos/libports/run/expat.run | 17 ++++---- repos/libports/run/libc_pipe.run | 5 +-- repos/libports/run/libc_vfs.run | 13 +++--- repos/libports/run/libc_vfs_fs.run | 13 +++--- repos/libports/run/libc_vfs_ram.run | 13 +++--- repos/libports/run/moon.run | 5 +-- repos/libports/run/mupdf.run | 11 +++-- repos/libports/run/nic_bridge.run | 10 ++--- repos/libports/run/pthread.run | 5 +-- repos/libports/run/python.run | 13 +++--- repos/libports/run/qt5_avplay.run | 11 +++-- repos/libports/run/qt5_calculatorform.run | 11 +++-- repos/libports/run/qt5_openglwindow.run | 11 +++-- repos/libports/run/qt5_previewer.run | 11 +++-- repos/libports/run/qt5_qpluginwidget.run | 11 +++-- repos/libports/run/qt5_quicktest.run | 11 +++-- repos/libports/run/qt5_samegame.run | 11 +++-- repos/libports/run/qt5_tetrix.run | 11 +++-- repos/libports/run/sdl.run | 5 +-- repos/libports/run/smartcard.run | 23 +++++------ repos/libports/run/stdcxx.run | 5 +-- repos/libports/run/test-ping_client.run | 5 +-- repos/libports/run/test-ping_server.run | 5 +-- repos/libports/src/server/acpi_input/main.cc | 1 + .../libports/src/test/lwip/http_clnt/main.cc | 19 +++------ .../src/test/lwip/http_clnt/target.mk | 2 +- repos/libports/src/test/netty/main.cc | 40 +++++++++---------- .../drivers/framebuffer/spec/pl11x/main.cc | 2 +- .../input/spec/ps2/pl050/irq_handler.h | 17 ++++---- .../src/drivers/input/spec/ps2/pl050/main.cc | 8 ++-- .../src/drivers/input/spec/ps2/pl050/pl050.h | 30 +++++--------- repos/os/src/server/blk_cache/driver.h | 1 - 50 files changed, 205 insertions(+), 251 deletions(-) diff --git a/repos/base-hw/src/test/cpu_quota/sync/main.cc b/repos/base-hw/src/test/cpu_quota/sync/main.cc index eb41ee233..b9c015468 100644 --- a/repos/base-hw/src/test/cpu_quota/sync/main.cc +++ b/repos/base-hw/src/test/cpu_quota/sync/main.cc @@ -12,10 +12,9 @@ */ /* Genode includes */ -#include -#include #include #include +#include /* local includes */ #include diff --git a/repos/dde_linux/src/lib/libc_lxip/plugin.cc b/repos/dde_linux/src/lib/libc_lxip/plugin.cc index e20d49c2d..e57fc7975 100644 --- a/repos/dde_linux/src/lib/libc_lxip/plugin.cc +++ b/repos/dde_linux/src/lib/libc_lxip/plugin.cc @@ -178,7 +178,6 @@ void Plugin::init(Genode::Env &env) char ip_addr_str[16] = {0}; char netmask_str[16] = {0}; char gateway_str[16] = {0}; - char address_buf[128]; Genode::Attached_rom_dataspace config { env, "config"} ; diff --git a/repos/dde_linux/src/lib/lxip/timer_handler.cc b/repos/dde_linux/src/lib/lxip/timer_handler.cc index 6b6303726..5849aa22b 100644 --- a/repos/dde_linux/src/lib/lxip/timer_handler.cc +++ b/repos/dde_linux/src/lib/lxip/timer_handler.cc @@ -17,7 +17,6 @@ #include #include #include -#include #include #include diff --git a/repos/dde_linux/src/test/vfs_lxip/main.cc b/repos/dde_linux/src/test/vfs_lxip/main.cc index 33556010d..af494ac8f 100644 --- a/repos/dde_linux/src/test/vfs_lxip/main.cc +++ b/repos/dde_linux/src/test/vfs_lxip/main.cc @@ -220,6 +220,8 @@ static int test_connect_recv(char const *sock_root, char const *sock_fd) ssize_t n = write(fd, host, sizeof(host)); (void)n; close(fd); + + return 0; } @@ -252,7 +254,7 @@ static void test_proto(char const *sock_root, char const *proto) ls_socket_fs(sock_dir); test_bind_accept(sock_root, sock_path); - // test_connect_recv(proto_root, sock_fd); + if (0) test_connect_recv(proto_root, sock_path); ls_socket_fs(sock_dir); diff --git a/repos/dde_rump/include/util/allocator_fap.h b/repos/dde_rump/include/util/allocator_fap.h index 1de42e0f9..793475caa 100644 --- a/repos/dde_rump/include/util/allocator_fap.h +++ b/repos/dde_rump/include/util/allocator_fap.h @@ -112,6 +112,7 @@ namespace Allocator { Backend_alloc(Cache_attribute cached) : + Rm_connection(Rump::env().env()), Region_map_client(Rm_connection::create(VM_SIZE)), _cached(cached), _range(&Rump::env().heap()) diff --git a/repos/dde_rump/src/server/rump_cgd/block_driver.h b/repos/dde_rump/src/server/rump_cgd/block_driver.h index f214e705e..b78b19d24 100644 --- a/repos/dde_rump/src/server/rump_cgd/block_driver.h +++ b/repos/dde_rump/src/server/rump_cgd/block_driver.h @@ -37,7 +37,7 @@ class Driver : public Block::Driver public: - Driver(Server::Entrypoint &ep, Genode::Ram_session &ram) + Driver(Genode::Entrypoint &ep, Genode::Ram_session &ram) : Block::Driver(ram), _blk_sz(0), _blk_cnt(0), _cgd_device(0) diff --git a/repos/dde_rump/src/server/rump_cgd/cgd.cc b/repos/dde_rump/src/server/rump_cgd/cgd.cc index 3a726089d..9e5e8b5c5 100644 --- a/repos/dde_rump/src/server/rump_cgd/cgd.cc +++ b/repos/dde_rump/src/server/rump_cgd/cgd.cc @@ -444,7 +444,7 @@ Cgd::Device *Cgd::Device::configure(Genode::Allocator *alloc, Cgd::Params const /** * Initialize a new Cgd::Device */ -Cgd::Device *Cgd::init(Genode::Allocator *alloc, Server::Entrypoint &ep) +Cgd::Device *Cgd::init(Genode::Allocator *alloc, Genode::Entrypoint &ep) { /* start rumpkernel */ rump_init(); diff --git a/repos/dde_rump/src/server/rump_cgd/cgd.h b/repos/dde_rump/src/server/rump_cgd/cgd.h index 512a6de6d..d0ee07c0c 100644 --- a/repos/dde_rump/src/server/rump_cgd/cgd.h +++ b/repos/dde_rump/src/server/rump_cgd/cgd.h @@ -15,7 +15,6 @@ #define _CGD_H_ #include -#include namespace Cgd { @@ -52,7 +51,7 @@ namespace Cgd { }; - Device *init(Genode::Allocator *alloc, Server::Entrypoint &ep); + Device *init(Genode::Allocator *alloc, Genode::Entrypoint &ep); void deinit(Genode::Allocator *alloc, Device *dev); } diff --git a/repos/dde_rump/src/server/rump_cgd/main.cc b/repos/dde_rump/src/server/rump_cgd/main.cc index a693f4f48..2fc0a1b36 100644 --- a/repos/dde_rump/src/server/rump_cgd/main.cc +++ b/repos/dde_rump/src/server/rump_cgd/main.cc @@ -13,7 +13,7 @@ /* Genode includes */ #include -#include +#include /* local includes */ #include "block_driver.h" diff --git a/repos/gems/run/cpu_load_display.run b/repos/gems/run/cpu_load_display.run index 8854647a6..bb1ef668b 100644 --- a/repos/gems/run/cpu_load_display.run +++ b/repos/gems/run/cpu_load_display.run @@ -68,7 +68,7 @@ append_platform_drv_config append_if [have_spec framebuffer] config { - + } diff --git a/repos/gems/src/app/cpu_load_display/main.cc b/repos/gems/src/app/cpu_load_display/main.cc index b1f2bb44f..c0a07044a 100644 --- a/repos/gems/src/app/cpu_load_display/main.cc +++ b/repos/gems/src/app/cpu_load_display/main.cc @@ -13,6 +13,7 @@ /* Genode includes */ #include +#include #include #include #include @@ -122,6 +123,7 @@ class Cpu_load_display::Cpu : public Genode::List::Element { private: + Genode::Allocator &_heap; Genode::Point<> const _pos; Genode::List _timelines; @@ -138,8 +140,7 @@ class Cpu_load_display::Cpu : public Genode::List::Element } /* add new timeline */ - Timeline *t = new (Genode::env()->heap()) - Timeline(subject_id, Genode::Cstring(label)); + Timeline *t = new (_heap) Timeline(subject_id, Genode::Cstring(label)); _timelines.insert(t); return t; } @@ -156,7 +157,8 @@ class Cpu_load_display::Cpu : public Genode::List::Element public: - Cpu(Genode::Point<> pos) : _pos(pos) { } + Cpu(Genode::Allocator &heap, Genode::Point<> pos) + : _heap(heap), _pos(pos) { } bool has_pos(Genode::Point<> pos) const { @@ -183,7 +185,7 @@ class Cpu_load_display::Cpu : public Genode::List::Element if (t->idle()) { _timelines.remove(t); - Genode::destroy(Genode::env()->heap(), t); + Genode::destroy(_heap, t); } } } @@ -211,6 +213,8 @@ class Cpu_load_display::Cpu_registry { private: + Genode::Allocator &_heap; + Genode::List _cpus; static Genode::Point<> _cpu_pos(Xml_node subject) @@ -234,7 +238,7 @@ class Cpu_load_display::Cpu_registry } /* add new CPU */ - Cpu *cpu = new (Genode::env()->heap()) Cpu(cpu_pos); + Cpu *cpu = new (_heap) Cpu(_heap, cpu_pos); _cpus.insert(cpu); return cpu; } @@ -248,6 +252,8 @@ class Cpu_load_display::Cpu_registry public: + Cpu_registry(Genode::Allocator &heap) : _heap(heap) { } + void import_trace_subjects(Xml_node node, unsigned now) { node.for_each_sub_node("subject", [&] (Xml_node subject) { @@ -284,11 +290,13 @@ class Cpu_load_display::Scene : public Nano3d::Scene Genode::Signal_handler _config_handler; - Genode::Attached_rom_dataspace _trace_subjects { "trace_subjects" }; + Genode::Attached_rom_dataspace _trace_subjects { _env, "trace_subjects" }; unsigned _now = 0; - Cpu_registry _cpu_registry; + Genode::Heap _heap { _env.ram(), _env.rm() }; + + Cpu_registry _cpu_registry { _heap }; void _handle_trace_subjects() { @@ -325,8 +333,7 @@ class Cpu_load_display::Scene : public Nano3d::Scene private: - Polygon::Shaded_painter _shaded_painter { - *Genode::env()->heap(), _size.h() }; + Polygon::Shaded_painter _shaded_painter { _heap, _size.h() }; long _activity_sum[Timeline::HISTORY_LEN]; long _y_level[Timeline::HISTORY_LEN]; diff --git a/repos/gems/src/server/cpu_sampler/cpu_session_component.cc b/repos/gems/src/server/cpu_sampler/cpu_session_component.cc index 9f059e8b6..cc73490cd 100644 --- a/repos/gems/src/server/cpu_sampler/cpu_session_component.cc +++ b/repos/gems/src/server/cpu_sampler/cpu_session_component.cc @@ -29,7 +29,7 @@ Cpu_sampler::Cpu_session_component::create_thread(Pd_session_capability pd, addr_t utcb) { Cpu_thread_component *cpu_thread = new (_md_alloc) - Cpu_thread_component(*this, + Cpu_thread_component(*this, _env, _md_alloc, pd, name, diff --git a/repos/gems/src/server/cpu_sampler/cpu_thread_component.cc b/repos/gems/src/server/cpu_sampler/cpu_thread_component.cc index 31446f0f2..804026fb7 100644 --- a/repos/gems/src/server/cpu_sampler/cpu_thread_component.cc +++ b/repos/gems/src/server/cpu_sampler/cpu_thread_component.cc @@ -23,6 +23,7 @@ using namespace Genode; Cpu_sampler::Cpu_thread_component::Cpu_thread_component( Cpu_session_component &cpu_session_component, + Env &env, Allocator &md_alloc, Pd_session_capability pd, Cpu_session::Name const &name, @@ -31,7 +32,7 @@ Cpu_sampler::Cpu_thread_component::Cpu_thread_component( addr_t utcb, char const *thread_name, unsigned int thread_id) -: _cpu_session_component(cpu_session_component), +: _cpu_session_component(cpu_session_component), _env(env), _md_alloc(md_alloc), _parent_cpu_thread( _cpu_session_component.parent_cpu_session().create_thread(pd, @@ -61,9 +62,6 @@ Cpu_sampler::Cpu_thread_component::~Cpu_thread_component() { flush(); - if (_log) - destroy(_md_alloc, _log); - _cpu_session_component.thread_ep().dissolve(this); } @@ -111,8 +109,8 @@ void Cpu_sampler::Cpu_thread_component::flush() if (_sample_buf_index == 0) return; - if (!_log) - _log = new (_md_alloc) Log_connection(_log_session_label); + if (!_log.constructed()) + _log.construct(_env, _log_session_label); /* number of hex characters + newline + '\0' */ enum { SAMPLE_STRING_SIZE = 2 * sizeof(addr_t) + 1 + 1 }; diff --git a/repos/gems/src/server/cpu_sampler/cpu_thread_component.h b/repos/gems/src/server/cpu_sampler/cpu_thread_component.h index a01e87e13..e820e908f 100644 --- a/repos/gems/src/server/cpu_sampler/cpu_thread_component.h +++ b/repos/gems/src/server/cpu_sampler/cpu_thread_component.h @@ -35,6 +35,7 @@ class Cpu_sampler::Cpu_thread_component : public Rpc_object enum { SAMPLE_BUF_SIZE = 1024 }; Cpu_session_component &_cpu_session_component; + Env &_env; Allocator &_md_alloc; @@ -48,11 +49,12 @@ class Cpu_sampler::Cpu_thread_component : public Rpc_object Genode::addr_t _sample_buf[SAMPLE_BUF_SIZE]; unsigned int _sample_buf_index = 0; - Log_connection *_log = 0; + Constructible _log; public: Cpu_thread_component(Cpu_session_component &cpu_session_component, + Env &env, Allocator &md_alloc, Pd_session_capability pd, Cpu_session::Name const &name, diff --git a/repos/gems/src/server/cpu_sampler/main.cc b/repos/gems/src/server/cpu_sampler/main.cc index 4a9a13766..af5f7ef02 100644 --- a/repos/gems/src/server/cpu_sampler/main.cc +++ b/repos/gems/src/server/cpu_sampler/main.cc @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -32,7 +31,6 @@ namespace Cpu_sampler { struct Main; } static constexpr bool verbose = false; -static constexpr bool verbose_missed_timeouts = false; static constexpr bool verbose_sample_duration = true; @@ -46,7 +44,7 @@ struct Cpu_sampler::Main : Thread_list_change_handler Genode::Heap alloc; Cpu_root cpu_root; Attached_rom_dataspace config; - Timer::Connection timer; + Timer::Connection timer { env }; Thread_list thread_list; Thread_list selected_thread_list; @@ -55,11 +53,8 @@ struct Cpu_sampler::Main : Thread_list_change_handler unsigned int timeout_us; - void handle_timeout(unsigned int num) + void handle_timeout() { - if (verbose_missed_timeouts && (num > 1)) - Genode::log("missed ", num - 1, " timeouts"); - auto lambda = [&] (Thread_element *cpu_thread_element) { Cpu_thread_component *cpu_thread = cpu_thread_element->object(); @@ -82,11 +77,11 @@ struct Cpu_sampler::Main : Thread_list_change_handler } - Signal_rpc_member
timeout_dispatcher = + Signal_handler
timeout_dispatcher = { env.ep(), *this, &Main::handle_timeout }; - void handle_config_update(unsigned) + void handle_config_update() { config.update(); @@ -111,7 +106,7 @@ struct Cpu_sampler::Main : Thread_list_change_handler } - Signal_rpc_member
config_update_dispatcher = + Signal_handler
config_update_dispatcher = { env.ep(), *this, &Main::handle_config_update}; @@ -184,7 +179,7 @@ struct Cpu_sampler::Main : Thread_list_change_handler /* * Apply initial configuration */ - handle_config_update(0); + handle_config_update(); /* * Announce service diff --git a/repos/libports/run/acpica.run b/repos/libports/run/acpica.run index 273b1b303..cc69a92c9 100644 --- a/repos/libports/run/acpica.run +++ b/repos/libports/run/acpica.run @@ -73,9 +73,8 @@ set config { diff --git a/repos/libports/run/avplay.run b/repos/libports/run/avplay.run index b56aa7e7b..3137724a8 100644 --- a/repos/libports/run/avplay.run +++ b/repos/libports/run/avplay.run @@ -93,12 +93,11 @@ append config { - - - - - - + + + + + diff --git a/repos/libports/run/eglgears.run b/repos/libports/run/eglgears.run index 473044ec8..adebd395d 100644 --- a/repos/libports/run/eglgears.run +++ b/repos/libports/run/eglgears.run @@ -104,9 +104,8 @@ append config { - - - + + diff --git a/repos/libports/run/expat.run b/repos/libports/run/expat.run index 56932609d..70126959b 100644 --- a/repos/libports/run/expat.run +++ b/repos/libports/run/expat.run @@ -38,15 +38,14 @@ install_config { - - - - - - - - - + + + + + + + + diff --git a/repos/libports/run/libc_pipe.run b/repos/libports/run/libc_pipe.run index 41bc9a1e2..d9d324901 100644 --- a/repos/libports/run/libc_pipe.run +++ b/repos/libports/run/libc_pipe.run @@ -22,9 +22,8 @@ install_config { - - - + + diff --git a/repos/libports/run/libc_vfs.run b/repos/libports/run/libc_vfs.run index 6c2d4ced8..45d0bf1b5 100644 --- a/repos/libports/run/libc_vfs.run +++ b/repos/libports/run/libc_vfs.run @@ -41,14 +41,11 @@ set config { append_if [have_include "power_on/qemu"] config { } append config { - - - - - - - - + + + + + diff --git a/repos/libports/run/libc_vfs_fs.run b/repos/libports/run/libc_vfs_fs.run index f30b5e485..c3d501c0a 100644 --- a/repos/libports/run/libc_vfs_fs.run +++ b/repos/libports/run/libc_vfs_fs.run @@ -44,14 +44,11 @@ set config { append_if [have_include "power_on/qemu"] config { } append config { - - - - - - - - + + + + + diff --git a/repos/libports/run/libc_vfs_ram.run b/repos/libports/run/libc_vfs_ram.run index 35ba7d476..486b82d32 100644 --- a/repos/libports/run/libc_vfs_ram.run +++ b/repos/libports/run/libc_vfs_ram.run @@ -39,14 +39,11 @@ set config { append_if [have_include "power_on/qemu"] config { } append config { - - - - - - - - + + + + + diff --git a/repos/libports/run/moon.run b/repos/libports/run/moon.run index fcbfd5be7..57f153f33 100644 --- a/repos/libports/run/moon.run +++ b/repos/libports/run/moon.run @@ -28,9 +28,8 @@ install_config { - - - + + diff --git a/repos/libports/run/mupdf.run b/repos/libports/run/mupdf.run index e053a483f..074f144e6 100644 --- a/repos/libports/run/mupdf.run +++ b/repos/libports/run/mupdf.run @@ -61,12 +61,11 @@ append config { - - - - - - + + + + + diff --git a/repos/libports/run/nic_bridge.run b/repos/libports/run/nic_bridge.run index 10273a3ff..f10956e36 100644 --- a/repos/libports/run/nic_bridge.run +++ b/repos/libports/run/nic_bridge.run @@ -69,11 +69,10 @@ append config { + - - + gateway="10.0.2.1"/> @@ -83,9 +82,8 @@ append config { - - - + + } diff --git a/repos/libports/run/pthread.run b/repos/libports/run/pthread.run index c447da0d5..46850a425 100644 --- a/repos/libports/run/pthread.run +++ b/repos/libports/run/pthread.run @@ -22,9 +22,8 @@ install_config { - - - + + diff --git a/repos/libports/run/python.run b/repos/libports/run/python.run index f29f2a58b..ae1cb8a31 100644 --- a/repos/libports/run/python.run +++ b/repos/libports/run/python.run @@ -39,10 +39,9 @@ set config {