mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Build System
- Added new src/commands and src/columns intermediate libs. - Began implementation of the first Command object. - Began implementation of the first Column object. - TDB2, Variant updates.
This commit is contained in:
parent
f1fa315342
commit
0471c17f12
20 changed files with 513 additions and 184 deletions
|
@ -789,10 +789,10 @@ void Variant::cast (const variant_type type)
|
|||
else if (mType == v_string && type == v_double)
|
||||
mDouble = atol (mString.c_str ());
|
||||
|
||||
// From v_date
|
||||
// TODO From v_date
|
||||
|
||||
|
||||
// From v_duration
|
||||
// TODO From v_duration
|
||||
|
||||
|
||||
mType = type;
|
||||
|
@ -805,4 +805,35 @@ Variant::variant_type Variant::type ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Variant::promote (Variant& lhs, Variant& rhs)
|
||||
{
|
||||
// Short circuit.
|
||||
if (lhs.type () == rhs.type ())
|
||||
return;
|
||||
|
||||
variant_type newType;
|
||||
switch (lhs.type () | rhs.type ())
|
||||
{
|
||||
case v_boolean | v_integer: newType = v_integer; break;
|
||||
case v_boolean | v_double: newType = v_double; break;
|
||||
case v_boolean | v_string: newType = v_string; break;
|
||||
case v_boolean | v_date: newType = v_date; break;
|
||||
case v_boolean | v_duration: newType = v_duration; break;
|
||||
case v_integer | v_double: newType = v_integer; break;
|
||||
case v_integer | v_string: newType = v_string; break;
|
||||
case v_integer | v_date: newType = v_date; break;
|
||||
case v_integer | v_duration: newType = v_duration; break;
|
||||
case v_double | v_string: newType = v_string; break;
|
||||
case v_double | v_date: newType = v_date; break;
|
||||
case v_double | v_duration: newType = v_duration; break;
|
||||
case v_string | v_date: newType = v_date; break;
|
||||
case v_string | v_duration: newType = v_duration; break;
|
||||
case v_date | v_duration: newType = v_date; break;
|
||||
}
|
||||
|
||||
lhs.cast (newType);
|
||||
rhs.cast (newType);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue