This is in preparation for CTF 2 in which a default base is not
specified for integer-like field types.
sink.text.pretty defaults to BT_CTF_INTEGER_BASE_DECIMAL when it gets
BT_CTF_INTEGER_BASE_UNSPECIFIED.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
switch (base) {
case BT_CTF_INTEGER_BASE_UNKNOWN:
return "BT_CTF_INTEGER_BASE_UNKNOWN";
switch (base) {
case BT_CTF_INTEGER_BASE_UNKNOWN:
return "BT_CTF_INTEGER_BASE_UNKNOWN";
+ case BT_CTF_INTEGER_BASE_UNSPECIFIED:
+ return "BT_CTF_INTEGER_BASE_UNSPECIFIED";
case BT_CTF_INTEGER_BASE_BINARY:
return "BT_CTF_INTEGER_BASE_BINARY";
case BT_CTF_INTEGER_BASE_OCTAL:
case BT_CTF_INTEGER_BASE_BINARY:
return "BT_CTF_INTEGER_BASE_BINARY";
case BT_CTF_INTEGER_BASE_OCTAL:
/// Unknown, used for errors.
BT_CTF_INTEGER_BASE_UNKNOWN = -1,
/// Unknown, used for errors.
BT_CTF_INTEGER_BASE_UNKNOWN = -1,
+ /// Unspecified by the tracer.
+ BT_CTF_INTEGER_BASE_UNSPECIFIED = 0,
+
/// Binary.
BT_CTF_INTEGER_BASE_BINARY = 2,
/// Binary.
BT_CTF_INTEGER_BASE_BINARY = 2,
preferred display base.
@returns Preferred display base of the integer
fields described by \p int_field_type,
preferred display base.
@returns Preferred display base of the integer
fields described by \p int_field_type,
- or #BT_CTF_INTEGER_BASE_UNKNOWN on
- error.
+ #BT_CTF_INTEGER_BASE_UNSPECIFIED if
+ not specified, or
+ #BT_CTF_INTEGER_BASE_UNKNOWN on error.
@prenotnull{int_field_type}
@preisintft{int_field_type}
@prenotnull{int_field_type}
@preisintft{int_field_type}
@prenotnull{int_field_type}
@preisintft{int_field_type}
@prehot{int_field_type}
@prenotnull{int_field_type}
@preisintft{int_field_type}
@prehot{int_field_type}
-@pre \p base is #BT_CTF_INTEGER_BASE_BINARY, #BT_CTF_INTEGER_BASE_OCTAL,
- #BT_CTF_INTEGER_BASE_DECIMAL, or
- #BT_CTF_INTEGER_BASE_HEXADECIMAL.
+@pre \p base is #BT_CTF_INTEGER_BASE_UNSPECIFIED,
+ #BT_CTF_INTEGER_BASE_BINARY, #BT_CTF_INTEGER_BASE_OCTAL,
+ #BT_CTF_INTEGER_BASE_DECIMAL, or #BT_CTF_INTEGER_BASE_HEXADECIMAL.
@postrefcountsame{int_field_type}
@sa bt_ctf_field_type_integer_get_base(): Returns the preferred display
@postrefcountsame{int_field_type}
@sa bt_ctf_field_type_integer_get_base(): Returns the preferred display
+ case BT_CTF_INTEGER_BASE_UNSPECIFIED:
case BT_CTF_INTEGER_BASE_BINARY:
case BT_CTF_INTEGER_BASE_OCTAL:
case BT_CTF_INTEGER_BASE_DECIMAL:
case BT_CTF_INTEGER_BASE_BINARY:
case BT_CTF_INTEGER_BASE_OCTAL:
case BT_CTF_INTEGER_BASE_DECIMAL:
switch (base) {
case BT_CTF_INTEGER_BASE_DECIMAL:
switch (base) {
case BT_CTF_INTEGER_BASE_DECIMAL:
+ case BT_CTF_INTEGER_BASE_UNSPECIFIED:
base_string = "decimal";
break;
case BT_CTF_INTEGER_BASE_HEXADECIMAL:
base_string = "decimal";
break;
case BT_CTF_INTEGER_BASE_HEXADECIMAL:
break;
}
case BT_CTF_INTEGER_BASE_DECIMAL:
break;
}
case BT_CTF_INTEGER_BASE_DECIMAL:
+ case BT_CTF_INTEGER_BASE_UNSPECIFIED:
if (!signedness) {
g_string_append_printf(pretty->string, "%" PRIu64, v.u);
} else {
if (!signedness) {
g_string_append_printf(pretty->string, "%" PRIu64, v.u);
} else {