dde_*: remove the use of deprecated APIs

Issue #1987
Issue #3125
This commit is contained in:
Norman Feske
2019-01-21 14:30:54 +01:00
parent 954aff7002
commit f23579532e
35 changed files with 136 additions and 129 deletions

View File

@ -334,17 +334,17 @@ static void configure_mixer(Genode::Env &env, Mixer &mixer, Genode::Xml_node con
mixer_reporter.enabled(v);
config.for_each_sub_node("mixer", [&] (Xml_node node) {
char field[32];
char value[16];
try {
node.attribute("field").value(field, sizeof(field));
node.attribute("value").value(value, sizeof(value));
set_mixer_value(mixer, field, value);
} catch (Xml_attribute::Nonexistent_attribute) { }
typedef String<32> Field;
typedef String<16> Value;
Field const field = node.attribute_value("field", Field());
Value const value = node.attribute_value("value", Value());
set_mixer_value(mixer, field.string(), value.string());
});
if (mixer_reporter.is_enabled()) try {
if (mixer_reporter.enabled()) try {
Genode::Reporter::Xml_generator xml(mixer_reporter, [&]() {
for (unsigned i = 0; i < mixer.num; i++) {

View File

@ -57,7 +57,7 @@ class Bsd::Slab_backend_alloc : public Genode::Allocator,
addr_t _ds_phys[ELEMENTS]; /* physical bases of dataspaces */
int _index; /* current index in ds_cap */
Genode::Allocator_avl _range; /* manage allocations */
Genode::Ram_session &_ram; /* ram session to allocate ds from */
Genode::Ram_allocator &_ram; /* allocator to allocate ds from */
bool _alloc_block()
{
@ -81,7 +81,7 @@ class Bsd::Slab_backend_alloc : public Genode::Allocator,
public:
Slab_backend_alloc(Genode::Env &env, Genode::Ram_session &ram,
Slab_backend_alloc(Genode::Env &env, Genode::Ram_allocator &ram,
Genode::Region_map &rm, Genode::Allocator &md_alloc)
:
Rm_connection(env),

View File

@ -12,7 +12,6 @@
*/
/* Genode includes */
#include <base/printf.h>
#include <base/sleep.h>
#include <base/snprintf.h>
#include <util/string.h>
@ -40,27 +39,36 @@ void mtx_leave(struct mutex *mtx) {
** sys/systm.h **
*****************/
extern "C" void panic(const char *fmt, ...)
static int _vprintf(char const *format, va_list list)
{
va_list va;
char buf[128] { };
Genode::String_console sc(buf, sizeof(buf));
sc.vprintf(format, list);
return sc.len();
}
va_start(va, fmt);
Genode::vprintf(fmt, va);
va_end(va);
extern "C" void panic(char const *format, ...)
{
va_list list;
va_start(list, format);
_vprintf(format, list);
va_end(list);
Genode::sleep_forever();
}
extern "C" int printf(const char *fmt, ...)
extern "C" int printf(const char *format, ...)
{
va_list va;
va_list list;
va_start(va, fmt);
Genode::vprintf(fmt, va);
va_end(va);
va_start(list, format);
int const result = _vprintf(format, list);
va_end(list);
return 0; /* XXX proper return value */
return result;
}

View File

@ -18,6 +18,7 @@
/* Genode includes */
#include <base/log.h>
#include <base/sleep.h>
#include <base/allocator.h>
/* local includes */
#include <bsd.h>