Replace use of 'typedef' by 'using'

Issue #5227
This commit is contained in:
Norman Feske
2024-06-28 17:20:59 +02:00
parent 361557e1f0
commit 19c13877ca
442 changed files with 1306 additions and 1349 deletions

View File

@ -115,8 +115,8 @@ struct Backdrop::Main
void _update_view()
{
/* display view behind all others */
typedef Gui::Session::Command Command;
typedef Gui::Session::View_handle View_handle;
using Command = Gui::Session::Command;
using View_handle = Gui::Session::View_handle;
_gui.enqueue<Command::Background>(_view_handle);
Gui::Rect rect(Gui::Point(), _buffer->size());
@ -227,15 +227,15 @@ void Backdrop::Main::_paint_texture(Surface<PT> &surface, Texture<PT> const &tex
void Backdrop::Main::_apply_image(Xml_node operation)
{
typedef Surface_base::Point Point;
typedef Surface_base::Area Area;
using Point = Surface_base::Point;
using Area = Surface_base::Area;
if (!operation.has_attribute("png")) {
Genode::warning("missing 'png' attribute in <image> node");
return;
}
typedef String<256> File_name;
using File_name = String<256>;
File_name const png_file_name = operation.attribute_value("png", File_name());
File file(png_file_name.string(), _heap);
@ -284,7 +284,7 @@ void Backdrop::Main::_apply_image(Xml_node operation)
*/
/* create texture with down-sampled scaled image */
typedef Pixel_rgb888 PT;
using PT = Pixel_rgb888;
Chunky_texture<PT> texture(_env.ram(), _env.rm(), scaled_size);
convert_pixel_format(scaled_texture, texture, alpha, _heap);
@ -302,7 +302,7 @@ void Backdrop::Main::_apply_fill(Xml_node operation)
*/
/* create texture with down-sampled scaled image */
typedef Pixel_rgb888 PT;
using PT = Pixel_rgb888;
Color const color = operation.attribute_value("color", Color::black());

View File

@ -24,7 +24,7 @@
namespace Decorator {
typedef Text_painter::Font Font;
using Font = Text_painter::Font;
Font &default_font();
enum Texture_id {

View File

@ -26,7 +26,7 @@
namespace Decorator {
class Config;
typedef Genode::String<200> Window_title;
using Window_title = Genode::String<200>;
using Genode::Allocator;
using Genode::Reconstructible;

View File

@ -43,7 +43,7 @@ class Decorator::Window : public Window_base
View_handle _handle { _gui.create_view() };
typedef Gui::Session::Command Command;
using Command = Gui::Session::Command;
Gui_view(Gui::Session_client &gui, unsigned id = 0)
:
@ -124,7 +124,7 @@ class Decorator::Window : public Window_base
*/
Lazy_value<int> _gradient_percent = _config.gradient_percent(_title);
typedef Window_element Element;
using Element = Window_element;
/*
* The element order must correspond to the order of enum values
@ -162,7 +162,7 @@ class Decorator::Window : public Window_base
return element(type).apply_state(state);
}
typedef Config::Window_control Control;
using Control = Config::Window_control;
class Controls
{

View File

@ -278,7 +278,7 @@ void Child::gen_start_node(Xml_generator &xml,
xml.attribute("caps", caps);
typedef String<64> Version;
using Version = String<64>;
Version const version = _start_xml->xml().attribute_value("version", Version());
if (version.valid())
xml.attribute("version", version);
@ -423,7 +423,7 @@ void Child::_gen_routes(Xml_generator &xml,
if (!_pkg_xml.constructed())
return;
typedef String<160> Path;
using Path = String<160>;
/*
* Add routes given in the start node.
@ -474,7 +474,7 @@ void Child::_gen_routes(Xml_generator &xml,
xml.node("service", [&] () {
xml.attribute("name", "ROM");
xml.attribute("label", "config");
typedef String<160> Path;
using Path = String<160>;
Path const path = rom.attribute_value("path", Path());
if (cached_depot_rom.valid())
@ -503,7 +503,7 @@ void Child::_gen_routes(Xml_generator &xml,
if (!rom.has_attribute("path"))
return;
typedef Name Label;
using Label = Name;
Path const path = rom.attribute_value("path", Path());
Label const label = rom.attribute_value("label", Label());

View File

@ -240,13 +240,13 @@ class Depot_deploy::Child : public List_model<Child>::Element
{
public:
typedef String<100> Name;
typedef String<80> Binary_name;
typedef String<80> Config_name;
typedef String<32> Depot_rom_server;
typedef String<16> State_name;
typedef String<100> Launcher_name;
typedef String<128> Conclusion;
using Name = String<100>;
using Binary_name = String<80>;
using Config_name = String<80>;
using Depot_rom_server = String<32>;
using State_name = String<16>;
using Launcher_name = String<100>;
using Conclusion = String<128>;
private:

View File

@ -133,7 +133,7 @@ struct Depot_deploy::Main
_children.apply_blueprint(_blueprint.xml());
/* determine CPU architecture of deployment */
typedef String<16> Arch;
using Arch = String<16>;
Arch const arch = config.attribute_value("arch", Arch());
if (!arch.valid())
warning("config lacks 'arch' attribute");
@ -167,7 +167,7 @@ struct Depot_deploy::Main
_children.conclusion(result);
int exit_code = result.failed ? -1 : 0;
typedef String<12> Repeat;
using Repeat = String<12>;
Repeat repeat = config.attribute_value("repeat", Repeat("false"));
if (repeat == Repeat("until_forever") ||
(repeat == Repeat("until_failed") && exit_code == 0)) {

View File

@ -31,11 +31,11 @@ class Depot_deploy::Child : public List_model<Child>::Element
{
public:
typedef String<100> Name;
typedef String<80> Binary_name;
typedef String<80> Config_name;
typedef String<32> Depot_rom_server;
typedef String<100> Launcher_name;
using Name = String<100>;
using Binary_name = String<80>;
using Config_name = String<80>;
using Depot_rom_server = String<32>;
using Launcher_name = String<100>;
struct Prio_levels
{
@ -426,7 +426,7 @@ void Depot_deploy::Child::gen_start_node(Xml_generator &xml,
}
{
typedef String<64> Version;
using Version = String<64>;
Version const version = _start_xml->xml().attribute_value("version", Version());
if (version.valid())
xml.attribute("version", version);
@ -631,7 +631,7 @@ void Depot_deploy::Child::_gen_routes(Xml_generator &xml, Xml_node common,
if (!_pkg_xml.constructed())
return;
typedef String<160> Path;
using Path = String<160>;
/*
* Add routes given in the start node.
@ -710,7 +710,7 @@ void Depot_deploy::Child::_gen_routes(Xml_generator &xml, Xml_node common,
xml.node("service", [&] {
xml.attribute("name", "ROM");
xml.attribute("label", "config");
typedef String<160> Path;
using Path = String<160>;
Path const path = rom.attribute_value("path", Path());
if (cached_depot_rom.valid())
@ -739,7 +739,7 @@ void Depot_deploy::Child::_gen_routes(Xml_generator &xml, Xml_node common,
if (!rom.has_attribute("path"))
return;
typedef Name Label;
using Label = Name;
Path const path = rom.attribute_value("path", Path());
Label const label = rom.attribute_value("label", Label());
Label const as = rom.attribute_value("as", label);

View File

@ -24,7 +24,7 @@ void Depot_download_manager::gen_depot_query_start_content(Xml_generator &xml,
xml.node("config", [&] () {
xml.attribute("version", version.value);
typedef String<32> Arch;
using Arch = String<32>;
xml.attribute("arch", installation.attribute_value("arch", Arch()));
xml.node("vfs", [&] () {
xml.node("dir", [&] () {

View File

@ -57,7 +57,7 @@ void Depot_download_manager::gen_extract_start_content(Xml_generator &xml,
import.for_each_verified_or_blessed_archive([&] (Archive::Path const &path) {
typedef String<160> Path;
using Path = String<160>;
xml.node("extract", [&] () {
xml.attribute("archive", Path("/public/", Archive::download_file_path(path)));

View File

@ -68,9 +68,9 @@ void Depot_download_manager::gen_fetchurl_start_content(Xml_generator &xml,
});
import.for_each_download([&] (Archive::Path const &path) {
typedef String<160> Remote;
typedef String<160> Local;
typedef String<100> File_path;
using Remote = String<160>;
using Local = String<160>;
using File_path = String<100>;
File_path const file_path = Archive::download_file_path(path);
Remote const remote (current_user_url, "/", file_path);

View File

@ -51,7 +51,7 @@ void Depot_download_manager::gen_verify_start_content(Xml_generator &xml,
import.for_each_unverified_archive([&] (Archive::Path const &path) {
typedef String<160> Path;
using Path = String<160>;
Path const file_path ("/public/", Archive::download_file_path(path));
Path const pubkey_path (user_path, "/pubkey");

View File

@ -34,7 +34,7 @@ struct Depot_download_manager::Child_exit_state
bool exited = false;
int code = 0;
typedef String<64> Name;
using Name = String<64>;
Child_exit_state(Xml_node init_state, Name const &name)
{

View File

@ -22,9 +22,9 @@ namespace Depot_download_manager {
using namespace Depot;
typedef String<32> Rom_name;
typedef String<160> Url;
typedef String<160> Path;
using Rom_name = String<32>;
using Url = String<160>;
using Path = String<160>;
struct Depot_query_version { unsigned value; };
struct Fetchurl_version { unsigned value; };

View File

@ -215,7 +215,7 @@ void Depot_query::Main::_collect_source_dependencies(Archive::Path const &path,
}
case Archive::SRC: {
typedef String<160> Api;
using Api = String<160>;
_with_file_content(path, "used_apis", [&] (File_content const &used_apis) {
used_apis.for_each_line<Archive::Path>([&] (Api const &api) {
dependencies.record(Archive::Path(Archive::user(path), "/api/", api),
@ -303,13 +303,13 @@ void Depot_query::Main::_query_user(Archive::User const &user, Xml_generator &xm
Directory user_dir(_root, Directory::Path("depot/", user));
File_content download(_heap, user_dir, "download", File_content::Limit{4*1024});
typedef String<256> Url;
using Url = String<256>;
download.for_each_line<Url>([&] (Url const &url) {
xml.node("url", [&] () { xml.append_sanitized(url.string()); }); });
File_content pubkey(_heap, user_dir, "pubkey", File_content::Limit{8*1024});
xml.node("pubkey", [&] () {
typedef String<80> Line;
using Line = String<80>;
pubkey.for_each_line<Line>([&] (Line const &line) {
xml.append_sanitized(line.string());
xml.append("\n");

View File

@ -30,7 +30,7 @@ namespace Depot_query {
using namespace Depot;
typedef String<64> Rom_label;
using Rom_label = String<64>;
struct Require_verify;
struct Directory_cache;
@ -298,7 +298,7 @@ struct Depot_query::Main
Signal_handler<Main> _query_handler {
_env.ep(), *this, &Main::_handle_config };
typedef Constructible<Expanding_reporter> Constructible_reporter;
using Constructible_reporter = Constructible<Expanding_reporter>;
Constructible_reporter _scan_reporter { };
Constructible_reporter _blueprint_reporter { };
@ -318,8 +318,8 @@ struct Depot_query::Main
obj.destruct();
}
typedef String<16> Architecture;
typedef String<32> Version;
using Architecture = String<16>;
using Version = String<32>;
Architecture _architecture { };

View File

@ -56,7 +56,7 @@ struct Fs_tool::Main
bool _verbose = false;
typedef Directory::Path Path;
using Path = Directory::Path;
void _copy_file(Path const &from, Path const &to, Byte_range_ptr const &);

View File

@ -49,7 +49,7 @@ class Menu_view::Cursor : List_model<Cursor>::Element
Glyph_position &_glyph_position;
enum { NAME_MAX_LEN = 32 };
typedef String<NAME_MAX_LEN> Name;
using Name = String<NAME_MAX_LEN>;
Name const _name;

View File

@ -420,8 +420,8 @@ struct Menu_view::Depgraph_widget : Widget
}
};
typedef Registered<Node> Registered_node;
typedef Registry<Registered_node> Node_registry;
using Registered_node = Registered<Node>;
using Node_registry = Registry<Registered_node>;
Node_registry _nodes { };
@ -453,7 +453,7 @@ struct Menu_view::Depgraph_widget : Widget
{
/* update depth direction */
{
typedef String<10> Dir_name;
using Dir_name = String<10>;
Dir_name dir_name = node.attribute_value("direction", Dir_name());
_depth_direction = { Depth_direction::EAST };
if (dir_name == "north") _depth_direction = { Depth_direction::NORTH };
@ -516,7 +516,7 @@ struct Menu_view::Depgraph_widget : Widget
bool const primary = !node.has_type("dep");
typedef String<64> Node_name;
using Node_name = String<64>;
Node_name client_name, server_name;
bool dep_visible = true;
if (primary) {

View File

@ -27,7 +27,7 @@ struct Menu_view::Label_widget : Widget, Cursor::Glyph_position
enum { LABEL_MAX_LEN = 256 };
typedef String<200> Text;
using Text = String<200>;
Text _text { };
Animated_color _color;

View File

@ -56,9 +56,9 @@ class Menu_view::Style_database
*/
bool mutable _out_of_date = false;
typedef String<PATH_MAX_LEN> Path;
using Path = String<PATH_MAX_LEN>;
typedef ::File::Reading_failed Reading_failed;
using Reading_failed = ::File::Reading_failed;
struct Label_style_entry : List<Label_style_entry>::Element, Noncopyable
{
@ -198,7 +198,7 @@ class Menu_view::Style_database
*/
static Path _construct_png_path(Xml_node node, char const *name)
{
typedef String<64> Style;
using Style = String<64>;
Style const style = node.attribute_value("style", Style("default"));
return Path(node.type(), "/", style, "/", name, ".png");
@ -209,7 +209,7 @@ class Menu_view::Style_database
*/
static Path _widget_style_path(Xml_node const &node)
{
typedef String<64> Style;
using Style = String<64>;
Style const style = node.attribute_value("style", Style("default"));
return Path(node.type(), "/", style, "/", "style");

View File

@ -39,7 +39,7 @@ class Menu_view::Text_selection : List_model<Text_selection>::Element
Glyph_position &_glyph_position;
enum { NAME_MAX_LEN = 32 };
typedef String<NAME_MAX_LEN> Name;
using Name = String<NAME_MAX_LEN>;
Name const _name;

View File

@ -27,7 +27,7 @@ namespace Menu_view {
struct Margin;
struct Widget;
typedef Margin Padding;
using Padding = Margin;
}

View File

@ -35,7 +35,7 @@
** helper **
************/
typedef Mixer::Channel Channel;
using Channel = Mixer::Channel;
static struct Names {
char const *name;

View File

@ -126,7 +126,7 @@ class Scene : public Nano3d::Scene<PT>
SHAPE const &shape, unsigned frame,
bool backward_facing)
{
typedef Genode::Color Color;
using Color = Genode::Color;
auto vertices = shape.vertex_array();
@ -138,7 +138,7 @@ class Scene : public Nano3d::Scene<PT>
if (_painter == PAINTER_TEXTURED) {
typedef Polygon::Textured_painter::Point Textured_point;
using Textured_point = Polygon::Textured_painter::Point;
shape.for_each_face([&] (unsigned const vertex_indices[],
unsigned num_vertices) {
@ -171,7 +171,7 @@ class Scene : public Nano3d::Scene<PT>
if (_painter == PAINTER_SHADED) {
typedef Polygon::Shaded_painter::Point Shaded_point;
using Shaded_point = Polygon::Shaded_painter::Point;
shape.for_each_face([&] (unsigned const vertex_indices[],
unsigned num_vertices) {

View File

@ -38,8 +38,8 @@ void Sculpt::Deploy::view_diag(Scope<> &s) const
/*
* Collect messages in registry, avoiding duplicates
*/
typedef String<64> Message;
typedef Registered_no_delete<Message> Registered_message;
using Message = String<64>;
using Registered_message = Registered_no_delete<Message>;
Registry<Registered_message> messages { };
auto gen_missing_dependencies = [&] (Xml_node start, Start_name const &name)
@ -112,7 +112,7 @@ void Sculpt::Deploy::_handle_managed_deploy(Xml_node const &managed_deploy)
if (file.attribute_value("xml", false) == false)
return;
typedef Depot_deploy::Child::Launcher_name Name;
using Name = Depot_deploy::Child::Launcher_name;
Name const name = file.attribute_value("name", Name());
file.for_each_sub_node("launcher", [&] (Xml_node const &launcher) {

View File

@ -35,7 +35,7 @@ namespace Sculpt { struct Deploy; }
struct Sculpt::Deploy
{
typedef Depot_deploy::Child::Prio_levels Prio_levels;
using Prio_levels = Depot_deploy::Child::Prio_levels;
Env &_env;
@ -58,7 +58,7 @@ struct Sculpt::Deploy
Download_queue &_download_queue;
typedef String<16> Arch;
using Arch = String<16>;
Arch _arch { };
Child_state cached_depot_rom_state {

View File

@ -1702,7 +1702,7 @@ void Sculpt::Main::_update_window_layout(Xml_node const &decorator_margins,
unsigned const log_min_w = 400;
typedef String<128> Label;
using Label = String<128>;
Label const
inspect_label ("runtime -> leitzentrale -> inspect"),
runtime_view_label ("runtime -> leitzentrale -> runtime_dialog"),

View File

@ -21,14 +21,14 @@ namespace Sculpt {
struct Access_point;
struct Access_point_update_policy;
typedef List_model<Access_point> Access_points;
using Access_points = List_model<Access_point>;
};
struct Sculpt::Access_point : List_model<Access_point>::Element
{
typedef String<32> Bssid;
typedef String<32> Ssid;
using Bssid = String<32>;
using Ssid = String<32>;
enum Protection { UNKNOWN, UNPROTECTED, WPA_PSK };

View File

@ -25,7 +25,7 @@ struct Sculpt::Capacity
void print(Output &out) const
{
uint64_t const KB = 1024, MB = 1024*KB, GB = 1024*MB;
typedef String<64> Text;
using Text = String<64>;
Text const text = (value > GB) ? Text((float)value/GB, " GiB")
: (value > MB) ? Text((float)value/MB, " MiB")
: (value > KB) ? Text((float)value/KB, " KiB")

View File

@ -29,8 +29,8 @@ struct Sculpt::Child_exit_state
bool responsive = true;
int code = 0;
typedef String<64> Name;
typedef String<16> Version;
using Name = String<64>;
using Version = String<16>;
Version version { };

View File

@ -24,10 +24,10 @@ namespace Sculpt { struct Component; }
struct Sculpt::Component : Noncopyable
{
typedef Depot::Archive::Path Path;
typedef Depot::Archive::Name Name;
typedef String<100> Info;
typedef Start_name Service;
using Path = Depot::Archive::Path;
using Name = Depot::Archive::Name;
using Info = String<100>;
using Service = Start_name;
Allocator &_alloc;

View File

@ -126,7 +126,7 @@ struct Sculpt::Download_queue : Noncopyable
if (download.path != path)
return;
typedef String<16> State;
using State = String<16>;
State const state = elem.attribute_value("state", State());
download.percent = percent;

View File

@ -21,7 +21,7 @@ namespace Sculpt { struct Nic_state; }
struct Sculpt::Nic_state
{
typedef String<32> Ipv4;
using Ipv4 = String<32>;
Ipv4 ipv4;

View File

@ -23,7 +23,7 @@ namespace Sculpt {
struct Partition;
struct Partition_update_policy;
typedef List_model<Partition> Partitions;
using Partitions = List_model<Partition>;
};
@ -43,8 +43,8 @@ struct Sculpt::File_system
struct Sculpt::Partition : List_model<Partition>::Element
{
typedef String<16> Number;
typedef String<32> Label;
using Number = String<16>;
using Label = String<32>;
enum Expandable { FIXED_SIZE, EXPANDABLE };

View File

@ -298,8 +298,8 @@ class Sculpt::Runtime_config
struct Parent_services
{
typedef Registered_no_delete<Service> Parent_service;
typedef Service::Type Type;
using Parent_service = Registered_no_delete<Service>;
using Type = Service::Type;
Registry<Parent_service> _r { };

View File

@ -21,7 +21,7 @@ namespace Sculpt {
struct Usb_storage_device;
struct Usb_storage_device_update_policy;
typedef List_model<Usb_storage_device> Usb_storage_devices;
using Usb_storage_devices = List_model<Usb_storage_device>;
};
@ -33,8 +33,8 @@ struct Sculpt::Usb_storage_device : List_model<Usb_storage_device>::Element,
*/
struct Driver_info
{
typedef String<28> Vendor;
typedef String<48> Product;
using Vendor = String<28>;
using Product = String<48>;
Vendor const vendor;
Product const product;

View File

@ -23,7 +23,7 @@ void Sculpt::gen_update_start_content(Xml_generator &xml)
xml.node("route", [&] {
typedef String<32> Label;
using Label = String<32>;
auto gen_fs = [&] (Label const &label, Label const &server) {
gen_service_node<::File_system::Session>(xml, [&] {
xml.attribute("label", label);

View File

@ -40,13 +40,13 @@ namespace Sculpt {
using namespace Genode;
typedef String<64> Rom_name;
typedef String<128> Path;
typedef String<36> Start_name;
using Rom_name = String<64>;
using Path = String<128>;
using Start_name = String<36>;
typedef Gui::Point Point;
typedef Gui::Rect Rect;
typedef Gui::Area Area;
using Point = Gui::Point;
using Rect = Gui::Rect;
using Area = Gui::Area;
enum Writeable { WRITEABLE, READ_ONLY };

View File

@ -147,7 +147,7 @@ struct Text_area::Main : Text_area_widget::Action
File_content content(_heap, _vfs, _path(), File_content::Limit{1024*1024});
enum { MAX_LINE_LEN = 1000 };
typedef String<MAX_LINE_LEN + 1> Content_line;
using Content_line = String<MAX_LINE_LEN + 1>;
_dialog.text.clear();
content.for_each_line<Content_line>([&] (Content_line const &line) {

View File

@ -25,7 +25,7 @@ namespace Decorator {
class Config;
typedef Genode::String<200> Window_title;
using Window_title = Genode::String<200>;
}

View File

@ -33,7 +33,7 @@ enum Texture_id { TEXTURE_ID_DEFAULT, TEXTURE_ID_CLOSER, TEXTURE_ID_MAXIMIZER };
struct Texture_from_png_file
{
typedef Genode::Texture<Genode::Pixel_rgb888> Texture;
using Texture = Genode::Texture<Genode::Pixel_rgb888>;
File png_file;
Png_image png_image;
@ -202,8 +202,8 @@ void Decorator::Theme::draw_background(Decorator::Pixel_surface &pixel_surface,
Genode::Texture<Pixel_rgb888> const &texture =
texture_by_id(_ram, _rm, _alloc, TEXTURE_ID_DEFAULT);
typedef Genode::Surface_base::Point Point;
typedef Genode::Surface_base::Rect Rect;
using Point = Genode::Surface_base::Point;
using Rect = Genode::Surface_base::Rect;
unsigned const left = aura_margins().left + decor_margins().left;
unsigned const right = aura_margins().right + decor_margins().right;

View File

@ -23,15 +23,15 @@ namespace Decorator {
class Theme;
typedef Genode::Pixel_rgb888 Pixel_rgb888;
typedef Genode::Pixel_alpha8 Pixel_alpha8;
using Pixel_rgb888 = Genode::Pixel_rgb888;
using Pixel_alpha8 = Genode::Pixel_alpha8;
typedef Genode::Surface<Pixel_rgb888> Pixel_surface;
typedef Genode::Surface<Pixel_alpha8> Alpha_surface;
using Pixel_surface = Genode::Surface<Pixel_rgb888>;
using Alpha_surface = Genode::Surface<Pixel_alpha8>;
typedef Genode::Surface_base::Area Area;
typedef Genode::Surface_base::Point Point;
typedef Genode::Surface_base::Rect Rect;
using Area = Genode::Surface_base::Area;
using Point = Genode::Surface_base::Point;
using Rect = Genode::Surface_base::Rect;
}

View File

@ -20,7 +20,7 @@
struct Tint_painter
{
typedef Genode::Surface_base::Rect Rect;
using Rect = Genode::Surface_base::Rect;
/**
* Tint box with specified color

View File

@ -33,8 +33,8 @@
namespace Decorator {
class Window;
typedef Genode::String<200> Window_title;
typedef Genode::Attached_dataspace Attached_dataspace;
using Window_title = Genode::String<200>;
using Attached_dataspace = Genode::Attached_dataspace;
}
@ -143,7 +143,7 @@ class Decorator::Window : public Window_base, public Animator::Item
struct Gui_view
{
typedef Gui::Session::Command Command;
using Command = Gui::Session::Command;
bool const _view_is_remote;

View File

@ -18,7 +18,7 @@ using namespace Genode;
Directory::Path Trace_recorder::Monitor::Trace_directory::subject_path(::Subject_info const &info)
{
typedef Path<Session_label::capacity()> Label_path;
using Label_path = Path<Session_label::capacity()>;
Label_path label_path = path_from_label<Label_path>(info.session_label().string());
Directory::Path subject_path(Directory::join(_path, label_path.string()));

View File

@ -445,7 +445,7 @@ class Vfs_replay
void kick_off(Genode::Allocator &alloc, char const *file)
{
typedef Vfs::Directory_service::Open_result Open_result;
using Open_result = Vfs::Directory_service::Open_result;
Open_result res = _vfs.open(file,
Vfs::Directory_service::OPEN_MODE_RDWR,

View File

@ -43,7 +43,7 @@ class Window_layouter::Assign : public List_model<Assign>::Element
: Registry<Member>::Element(registry, *this), window(window) { }
};
typedef String<80> Label;
using Label = String<80>;
private:

View File

@ -100,7 +100,7 @@ class Window_layouter::Key_sequence_tracker
char const *node_type = entry.type == Stack::Entry::PRESS
? "press" : "release";
typedef String<32> Key_name;
using Key_name = String<32>;
Key_name const key(Input::key_name(entry.keycode));
Xml_node result("<none/>");
@ -160,7 +160,7 @@ class Window_layouter::Key_sequence_tracker
if (!node.has_attribute("action"))
return;
typedef String<32> Action;
using Action = String<32>;
Action action = node.attribute_value("action", Action());
using Name = Window_layouter::Target::Name;

View File

@ -558,7 +558,7 @@ void Window_layouter::Main::_gen_rules_with_frontmost_screen(Target::Name const
static Window_layouter::Window::Element
_element_from_hover_model(Genode::Xml_node hover_window_xml)
{
typedef Window_layouter::Window::Element::Type Type;
using Type = Window_layouter::Window::Element::Type;
bool const left_sizer = hover_window_xml.has_sub_node("left_sizer"),
right_sizer = hover_window_xml.has_sub_node("right_sizer"),

View File

@ -24,7 +24,7 @@ class Window_layouter::Target : Noncopyable
{
public:
typedef String<64> Name;
using Name = String<64>;
enum class Visible { YES, NO };

View File

@ -21,9 +21,9 @@ namespace Window_layouter {
using namespace Genode;
typedef Surface_base::Point Point;
typedef Surface_base::Area Area;
typedef Surface_base::Rect Rect;
using Point = Surface_base::Point;
using Area = Surface_base::Area;
using Rect = Surface_base::Rect;
struct Window_id
{

View File

@ -30,8 +30,8 @@ class Window_layouter::Window : public List_model<Window>::Element
{
public:
typedef String<256> Title;
typedef String<256> Label;
using Title = String<256>;
using Label = String<256>;
struct Element
{

View File

@ -99,7 +99,7 @@ struct Ttf_font::Glyph_buffer
Allocator &alloc;
typedef Glyph_painter::Glyph::Opacity Opacity;
using Opacity = Glyph_painter::Glyph::Opacity;
/**
* Maximum number of opacity values that fit in the buffer

View File

@ -87,7 +87,7 @@ struct Vfs_gpu::File_system : Single_file_system
Vfs::Env &_env;
typedef String<32> Config;
using Config = String<32>;
Id_space<Gpu_vfs_handle> _handle_space { };
Id_space<Gpu_vfs_handle>::Id _last_id { .value = ~0ul };

View File

@ -20,22 +20,23 @@
namespace Vfs_pipe {
using namespace Vfs;
typedef Vfs::Directory_service::Open_result Open_result;
typedef Vfs::File_io_service::Write_result Write_result;
typedef Vfs::File_io_service::Read_result Read_result;
typedef Genode::Path<Vfs::MAX_PATH_LEN> Path;
using Open_result = Vfs::Directory_service::Open_result;
using Write_result = Vfs::File_io_service::Write_result;
using Read_result = Vfs::File_io_service::Read_result;
using Path = Genode::Path<Vfs::MAX_PATH_LEN>;
enum { PIPE_BUF_SIZE = 8192U };
typedef Genode::Ring_buffer<unsigned char, PIPE_BUF_SIZE+1> Pipe_buffer;
using Pipe_buffer = Genode::Ring_buffer<unsigned char, PIPE_BUF_SIZE+1>;
struct Pipe_handle;
typedef Genode::Fifo_element<Pipe_handle> Handle_element;
typedef Genode::Fifo<Handle_element> Handle_fifo;
typedef Genode::Registry<Pipe_handle>::Element Pipe_handle_registry_element;
typedef Genode::Registry<Pipe_handle> Pipe_handle_registry;
using Handle_element = Genode::Fifo_element<Pipe_handle>;
using Handle_fifo = Genode::Fifo<Handle_element>;
using Pipe_handle_registry_element = Genode::Registry<Pipe_handle>::Element;
using Pipe_handle_registry = Genode::Registry<Pipe_handle>;
struct Pipe;
typedef Genode::Id_space<Pipe> Pipe_space;
using Pipe_space = Genode::Id_space<Pipe>;
struct New_pipe_handle;
@ -104,7 +105,7 @@ struct Vfs_pipe::Pipe
~Pipe() = default;
typedef Genode::String<8> Name;
using Name = Genode::String<8>;
Name name() const
{
return Name(space_elem.id().value);

View File

@ -94,8 +94,7 @@ class Vfs_trace::Trace_buffer_file_system : public Single_file_system
size_t _stat_size { 0 };
Trace_entries _entries { _env };
typedef String<32> Config;
using Config = String<32>;
static Config _config()
{
@ -291,7 +290,7 @@ class Vfs_trace::Subject : private Subject_factory,
{
private:
typedef String<200> Config;
using Config = String<200>;
Io::Watch_handler<Subject> _enable_handler {
_enabled_fs, "/enable",
@ -439,7 +438,7 @@ class Vfs_trace::File_system : private Local_factory,
{
private:
typedef String<512*1024> Config;
using Config = String<512*1024>;
static char const *_config(Vfs::Env &vfs_env, Trace_directory &directory)
{

View File

@ -330,7 +330,7 @@ class Vfs_tresor_crypto::Key_file_system : private Key_local_factory,
uint32_t _key_id;
typedef String<128> Config;
using Config = String<128>;
static Config _config(uint32_t key_id)
{
@ -1096,7 +1096,7 @@ class Vfs_tresor_crypto::File_system : private Local_factory,
{
private:
typedef String<128> Config;
using Config = String<128>;
static Config _config(Xml_node node)
{

View File

@ -27,8 +27,8 @@ namespace Vfs {
class Glyphs_file_system;
typedef Text_painter::Font Font;
typedef Vfs_font::Glyph_header Glyph_header;
using Font = Text_painter::Font;
using Glyph_header = Vfs_font::Glyph_header;
}
@ -112,8 +112,8 @@ class Vfs::Glyphs_file_system : public Vfs::Single_file_system
bool write_ready() const override { return false; }
};
typedef Registered<Vfs_watch_handle> Registered_watch_handle;
typedef Registry<Registered_watch_handle> Watch_handle_registry;
using Registered_watch_handle = Registered<Vfs_watch_handle>;
using Watch_handle_registry = Registry<Registered_watch_handle>;
Watch_handle_registry _handle_registry { };

View File

@ -32,13 +32,13 @@ namespace Vfs_ttf {
class Local_factory;
class File_system;
typedef Text_painter::Font Font;
using Font = Text_painter::Font;
}
struct Vfs_ttf::Font_from_file
{
typedef Directory::Path Path;
using Path = Directory::Path;
Directory const _dir;
File_content const _content;
@ -164,13 +164,13 @@ class Vfs_ttf::File_system : private Local_factory,
{
private:
typedef String<200> Config;
using Config = String<200>;
static Config _config(Xml_node node)
{
char buf[Config::capacity()] { };
Xml_generator xml(buf, sizeof(buf), "dir", [&] () {
typedef String<64> Name;
using Name = String<64>;
xml.attribute("name", node.attribute_value("name", Name()));
xml.node("glyphs", [&] () { });
xml.node("readonly_value", [&] () { xml.attribute("name", "baseline"); });

View File

@ -27,8 +27,9 @@
namespace Cpu_sampler {
using namespace Genode;
class Cpu_session_component;
typedef List<List_element<Cpu_thread_component>> Thread_list;
typedef List_element<Cpu_thread_component> Thread_element;
using Thread_list = List<List_element<Cpu_thread_component>>;
using Thread_element = List_element<Cpu_thread_component>;
template <typename FN>
void for_each_thread(Thread_list &thread_list, FN const &fn);

View File

@ -250,7 +250,7 @@ namespace Terminal {
throw Service_denied();
}
typedef String<256> File_name;
using File_name = String<256>;
File_name const file_name =
policy.attribute_value("filename", File_name());

View File

@ -21,10 +21,9 @@
struct Alpha_dither_painter
{
typedef Genode::Pixel_alpha8 Pixel_alpha8;
typedef Genode::Surface_base::Rect Rect;
typedef Genode::Surface_base::Point Point;
using Pixel_alpha8 = Genode::Pixel_alpha8;
using Rect = Genode::Surface_base::Rect;
using Point = Genode::Surface_base::Point;
/*
* \param fade fade value in 16.16 fixpoint format

View File

@ -37,9 +37,9 @@ namespace Gui_fader {
class Framebuffer_session_component;
class Gui_session_component;
typedef Genode::Surface_base::Area Area;
typedef Genode::Surface_base::Point Point;
typedef Genode::Surface_base::Rect Rect;
using Area = Genode::Surface_base::Area;
using Point = Genode::Surface_base::Point;
using Rect = Genode::Surface_base::Rect;
using Genode::size_t;
using Genode::Xml_node;
@ -50,8 +50,8 @@ namespace Gui_fader {
using Genode::Reconstructible;
using Genode::Constructible;
typedef Genode::Pixel_rgb888 Pixel_rgb888;
typedef Genode::Pixel_alpha8 Pixel_alpha8;
using Pixel_rgb888 = Genode::Pixel_rgb888;
using Pixel_alpha8 = Genode::Pixel_alpha8;
}
@ -62,7 +62,7 @@ class Gui_fader::Src_buffer
{
private:
typedef Pixel_rgb888 Pixel;
using Pixel = Pixel_rgb888;
bool const _use_alpha;
Attached_ram_dataspace _ds;
@ -259,8 +259,8 @@ class Gui_fader::Gui_session_component
{
private:
typedef Gui::View_capability View_capability;
typedef Gui::Session::View_handle View_handle;
using View_capability = Gui::View_capability;
using View_handle = Gui::Session::View_handle;
Genode::Env &_env;
@ -288,7 +288,7 @@ class Gui_fader::Gui_session_component
if (!_view_handle.valid() || (_view_visible == _fb_session.visible()))
return;
typedef Gui::Session::Command Command;
using Command = Gui::Session::Command;
if (_fb_session.visible())
_gui.enqueue<Command::Geometry>(_view_handle, _view_geometry);

View File

@ -592,7 +592,7 @@ class Terminal::Root_component : public Genode::Root_component<Session_component
Session_component *session = nullptr;
if (policy.has_attribute("ip")) {
typedef Genode::String<16> Ip;
using Ip = Genode::String<16>;
Ip ip_addr = policy.attribute_value("ip", Ip());
Libc::with_libc([&] () {
session = new (md_alloc())

View File

@ -18,7 +18,7 @@
#include "types.h"
namespace Terminal {
typedef Text_painter::Font Font;
using Font = Text_painter::Font;
class Font_family;
}

View File

@ -128,7 +128,7 @@ struct Terminal::Main : Character_consumer
struct Paste_buffer { char buffer[READ_BUFFER_SIZE]; } _paste_buffer { };
typedef Pixel_rgb888 PT;
using PT = Pixel_rgb888;
Constructible<Text_screen_surface<PT>> _text_screen_surface { };
@ -161,7 +161,7 @@ struct Terminal::Main : Character_consumer
/* update view geometry after mode change */
if (_fb_mode.area != _flushed_fb_mode.area) {
typedef Gui::Session::Command Command;
using Command = Gui::Session::Command;
_gui.enqueue<Command::Geometry>(_view, Rect(Point(0, 0), _fb_mode.area));
_gui.enqueue<Command::To_front>(_view, Gui::Session::View_handle());
_gui.execute();
@ -280,7 +280,7 @@ void Terminal::Main::_handle_config()
_text_screen_surface->size() != new_geometry.size();
if (reconstruct) {
typedef Text_screen_surface<PT>::Snapshot Snapshot;
using Snapshot = Text_screen_surface<PT>::Snapshot;
Constructible<Snapshot> snapshot { };
size_t const snapshot_bytes = _text_screen_surface.constructed()

View File

@ -38,8 +38,8 @@ class Terminal::Text_screen_surface
class Invalid_framebuffer_size : Genode::Exception { };
typedef Text_painter::Font Font;
typedef Glyph_painter::Fixpoint_number Fixpoint_number;
using Font = Text_painter::Font;
using Fixpoint_number = Glyph_painter::Fixpoint_number;
struct Geometry
{

View File

@ -28,9 +28,9 @@ namespace Terminal {
using namespace Genode;
typedef Surface_base::Rect Rect;
typedef Surface_base::Area Area;
typedef Surface_base::Point Point;
using Rect = Surface_base::Rect;
using Area = Surface_base::Area;
using Point = Surface_base::Point;
struct Character_consumer : Interface
{

View File

@ -67,9 +67,9 @@ namespace Wm { namespace Gui {
class Session_component;
class Root;
typedef Genode::Surface_base::Rect Rect;
typedef Genode::Surface_base::Point Point;
typedef Genode::Session_label Session_label;
using Rect = Genode::Surface_base::Rect;
using Point = Genode::Surface_base::Point;
using Session_label = Genode::Session_label;
} }
@ -509,8 +509,7 @@ class Wm::Gui::Session_component : public Rpc_object<Gui::Session>,
/*
* View handle registry
*/
typedef Genode::Handle_registry<View_handle, View>
View_handle_registry;
using View_handle_registry = Genode::Handle_registry<View_handle, View>;
View_handle_registry _view_handle_registry;

View File

@ -34,9 +34,9 @@ namespace Wm {
using Genode::Xml_generator;
using Genode::Reporter;
typedef Genode::Surface_base::Area Area;
typedef Genode::Surface_base::Point Point;
typedef Genode::Surface_base::Rect Rect;
using Area = Genode::Surface_base::Area;
using Point = Genode::Surface_base::Point;
using Rect = Genode::Surface_base::Rect;
}
@ -61,8 +61,8 @@ class Wm::Window_registry
{
public:
typedef Genode::String<200> Title;
typedef Genode::Session_label Session_label;
using Title = Genode::String<200>;
using Session_label = Genode::Session_label;
enum Has_alpha { HAS_ALPHA, HAS_NO_ALPHA };

View File

@ -22,9 +22,9 @@
/* libc includes */
#include <math.h>
typedef Genode::Surface_base::Point Point;
typedef Genode::Surface_base::Area Area;
typedef Genode::Surface_base::Rect Rect;
using Point = Genode::Surface_base::Point;
using Area = Genode::Surface_base::Area;
using Rect = Genode::Surface_base::Rect;
struct Param

View File

@ -33,9 +33,9 @@
namespace Test {
using namespace Genode;
typedef Surface_base::Point Point;
typedef Surface_base::Area Area;
typedef Surface_base::Rect Rect;
using Point = Surface_base::Point;
using Area = Surface_base::Area;
using Rect = Surface_base::Rect;
struct Main;
};
@ -55,7 +55,7 @@ struct Test::Main
Attached_dataspace _fb_ds { _env.rm(), _fb.dataspace() };
typedef Pixel_rgb888 PT;
using PT = Pixel_rgb888;
Surface_base::Area const _size = _fb.mode().area;

View File

@ -21,7 +21,7 @@
#include <os/reporter.h>
typedef Genode::String<32> Name;
using Name = Genode::String<32>;
namespace Test { struct Manager; }

View File

@ -36,7 +36,7 @@
/* qt5_component includes */
#include <qt5_component/qpa_init.h>
typedef Genode::String<32> Name;
using Name = Genode::String<32>;
/*