From 925c5288f1ba612f9e740d16ee8bd9a05ad25dc1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Fri, 28 Oct 2016 14:46:49 -0400 Subject: [PATCH] Revert ABI-breaking enum bt_ctf_string_encoding change MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- formats/ctf/ir/field-types.c | 16 ++++++++-------- include/babeltrace/ctf-ir/field-types.h | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/formats/ctf/ir/field-types.c b/formats/ctf/ir/field-types.c index 7b52a41f..3a23d96e 100644 --- a/formats/ctf/ir/field-types.c +++ b/formats/ctf/ir/field-types.c @@ -806,21 +806,21 @@ end: } int bt_ctf_field_type_integer_set_encoding(struct bt_ctf_field_type *type, - enum bt_ctf_string_encoding encoding) + enum ctf_string_encoding encoding) { int ret = 0; struct bt_ctf_field_type_integer *integer; if (!type || type->frozen || (type->declaration->id != CTF_TYPE_INTEGER) || - (encoding < BT_CTF_STRING_ENCODING_NONE) || - (encoding >= BT_CTF_STRING_ENCODING_UNKNOWN)) { + (encoding < CTF_STRING_NONE) || + (encoding >= CTF_STRING_UNKNOWN)) { ret = -1; goto end; } integer = container_of(type, struct bt_ctf_field_type_integer, parent); - integer->declaration.encoding = (enum ctf_string_encoding) encoding; + integer->declaration.encoding = encoding; end: return ret; } @@ -2000,20 +2000,20 @@ end: } int bt_ctf_field_type_string_set_encoding(struct bt_ctf_field_type *type, - enum bt_ctf_string_encoding encoding) + enum ctf_string_encoding encoding) { int ret = 0; struct bt_ctf_field_type_string *string; if (!type || type->declaration->id != CTF_TYPE_STRING || - (encoding != BT_CTF_STRING_ENCODING_UTF8 && - encoding != BT_CTF_STRING_ENCODING_ASCII)) { + (encoding != CTF_STRING_UTF8 && + encoding != CTF_STRING_ASCII)) { ret = -1; goto end; } string = container_of(type, struct bt_ctf_field_type_string, parent); - string->declaration.encoding = (enum ctf_string_encoding) encoding; + string->declaration.encoding = encoding; end: return ret; } diff --git a/include/babeltrace/ctf-ir/field-types.h b/include/babeltrace/ctf-ir/field-types.h index cce364c4..b4aedbc5 100644 --- a/include/babeltrace/ctf-ir/field-types.h +++ b/include/babeltrace/ctf-ir/field-types.h @@ -130,13 +130,13 @@ extern int bt_ctf_field_type_integer_set_base(struct bt_ctf_field_type *integer, * * @param integer Integer type. * @param encoding Integer output encoding, defaults to - * BT_CTF_STRING_ENCODING_NONE + * CTF_STRING_NONE * * Returns 0 on success, a negative value on error. */ extern int bt_ctf_field_type_integer_set_encoding( struct bt_ctf_field_type *integer, - enum bt_ctf_string_encoding encoding); + enum ctf_string_encoding encoding); /* * bt_ctf_field_type_enumeration_create: create an enumeration field type. @@ -339,15 +339,15 @@ extern struct bt_ctf_field_type *bt_ctf_field_type_string_create(void); * Set the string type's encoding. * * @param string_type String type. - * @param encoding String field encoding, default BT_CTF_STRING_ENCODING_ASCII. - * Valid values are BT_CTF_STRING_ENCODING_ASCII and - * BT_CTF_STRING_ENCODING_UTF8. + * @param encoding String field encoding, default CTF_STRING_ASCII. + * Valid values are CTF_STRING_ASCII and + * CTF_STRING_UTF8. * * Returns 0 on success, a negative value on error. */ extern int bt_ctf_field_type_string_set_encoding( struct bt_ctf_field_type *string_type, - enum bt_ctf_string_encoding encoding); + enum ctf_string_encoding encoding); /* * bt_ctf_field_type_set_alignment: set a field type's alignment. -- 2.34.1