os: avoid using deprecated APIs

Issue #1987
Issue #3125
This commit is contained in:
Norman Feske
2019-01-21 10:48:39 +01:00
parent cb36d96569
commit 6b94e65a95
116 changed files with 995 additions and 1271 deletions

View File

@ -28,7 +28,6 @@
#include <pointer/shape_report.h>
/* local includes */
#include "util.h"
#include "rom_registry.h"
#include "big_mouse.h"
@ -59,7 +58,7 @@ class Pointer::Main : public Rom::Reader
{
private:
typedef Pointer::String String;
typedef Genode::String<128> String;
Genode::Env &_env;
@ -285,8 +284,6 @@ void Pointer::Main::_update_pointer()
void Pointer::Main::_handle_hover()
{
using Pointer::read_string_attribute;
_hover_ds->update();
if (!_hover_ds->valid())
return;
@ -295,9 +292,8 @@ void Pointer::Main::_handle_hover()
try {
Genode::Xml_node node(_hover_ds->local_addr<char>());
Genode::Session_label hovered_label { read_string_attribute(node,
"label",
String()) };
Genode::Session_label hovered_label {
node.attribute_value("label", String()) };
hovered_label = hovered_label.prefix();

View File

@ -26,7 +26,7 @@ struct Rom::Registry : Registry_for_reader, Registry_for_writer, Genode::Noncopy
private:
Genode::Allocator &_md_alloc;
Genode::Ram_session &_ram;
Genode::Ram_allocator &_ram;
Genode::Region_map &_rm;
Reader &_reader;
@ -97,7 +97,7 @@ struct Rom::Registry : Registry_for_reader, Registry_for_writer, Genode::Noncopy
public:
Registry(Genode::Allocator &md_alloc,
Genode::Ram_session &ram, Genode::Region_map &rm,
Genode::Ram_allocator &ram, Genode::Region_map &rm,
Reader &reader)
:
_md_alloc(md_alloc), _ram(ram), _rm(rm), _reader(reader)

View File

@ -1,42 +0,0 @@
/*
* \brief VirtualBox pointer utilities
* \author Christian Helmuth
* \date 2015-06-08
*/
/*
* Copyright (C) 2015-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _POINTER_UTIL_H_
#define _POINTER_UTIL_H_
/* Genode includes */
#include <util/xml_node.h>
#include <util/string.h>
namespace Pointer {
typedef Genode::String<64> String;
inline String read_string_attribute(Genode::Xml_node const &node,
char const *attr,
String const &default_value);
}
Pointer::String Pointer::read_string_attribute(Genode::Xml_node const &node,
char const *attr,
String const &default_value)
{
try {
char buf[String::capacity()];
node.attribute(attr).value(buf, sizeof(buf));
return String(Genode::Cstring(buf));
} catch (...) { return default_value; }
}
#endif /* _POINTER_UTIL_H_ */