mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-23 04:25:21 +00:00
parent
e09941f310
commit
b0e52ba7d4
@ -22,9 +22,6 @@ namespace Genode {
|
||||
template <typename T1, typename T2>
|
||||
static constexpr T1 min(T1 v1, T2 v2) { return v1 < v2 ? v1 : v2; }
|
||||
|
||||
template <typename T>
|
||||
static constexpr T abs(T value) { return value >= 0 ? value : -value; }
|
||||
|
||||
|
||||
/*
|
||||
* Alignment to the power of two
|
||||
|
@ -84,6 +84,8 @@ void Avl_node_base::_rebalance_subtree(Avl_node_base *node, Policy &policy)
|
||||
{
|
||||
int v = node->_child_depth(RIGHT) - node->_child_depth(LEFT);
|
||||
|
||||
auto abs = [] (auto v) { return v >= 0 ? v : -v; };
|
||||
|
||||
/* return if subtree is in balance */
|
||||
if (abs(v) < 2) return;
|
||||
|
||||
|
@ -139,6 +139,8 @@ struct Line_painter
|
||||
long const dx_f = x2.value - x1.value,
|
||||
dy_f = y2.value - y1.value;
|
||||
|
||||
auto abs = [] (auto v) { return v >= 0 ? v : -v; };
|
||||
|
||||
long const num_steps = max(abs(dx_f) + 127, abs(dy_f) + 127) >> 8;
|
||||
|
||||
if (num_steps == 0)
|
||||
|
@ -672,6 +672,8 @@ struct Menu_view::Depgraph_widget : Widget
|
||||
x4 = p2.x(),
|
||||
y4 = p2.y();
|
||||
|
||||
auto abs = [] (auto v) { return v >= 0 ? v : -v; };
|
||||
|
||||
/* subdivide the curve depending on the size of its bounding box */
|
||||
unsigned const levels = (unsigned)max(log2(max(abs(x4 - x1), abs(y4 - y1)) >> 2), 3);
|
||||
|
||||
|
@ -66,6 +66,8 @@ class Genode::Point
|
||||
|
||||
void print(Output &out) const
|
||||
{
|
||||
auto abs = [] (auto v) { return v >= 0 ? v : -v; };
|
||||
|
||||
Genode::print(out, _x >= 0 ? "+" : "-", abs(_x),
|
||||
_y >= 0 ? "+" : "-", abs(_y));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user