bool Tuple::getAt(unsigned int idx, int64_t* val)
{
- IF_FAIL_RETURN(__verify(idx, G_VARIANT_TYPE_INT64), false);
- *val = g_variant_get_int64(__elements[idx]);
+ if (__verify(idx, G_VARIANT_TYPE_INT64)) {
+ *val = g_variant_get_int64(__elements[idx]);
+ } else if (__verify(idx, G_VARIANT_TYPE_DOUBLE)) {
+ *val = g_variant_get_double(__elements[idx]);
+ } else {
+ return false;
+ }
+
return true;
}
bool Tuple::getAt(unsigned int idx, double* val)
{
- IF_FAIL_RETURN(__verify(idx, G_VARIANT_TYPE_DOUBLE), false);
- *val = g_variant_get_double(__elements[idx]);
+ if (__verify(idx, G_VARIANT_TYPE_DOUBLE)) {
+ *val = g_variant_get_double(__elements[idx]);
+ } else if (__verify(idx, G_VARIANT_TYPE_INT64)) {
+ *val = g_variant_get_int64(__elements[idx]);
+ } else {
+ return false;
+ }
+
return true;
}