From 391c8f0d0c4232a94f64a8ca0bc9590c5545388c Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Mon, 3 Apr 2017 18:01:06 -0400 Subject: [PATCH] Rename bt_ctf_trace_set_byte_order() -> bt_ctf_trace_set_native_byte_order() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- include/babeltrace/ctf-ir/trace.h | 20 +++++++++---------- lib/ctf-ir/trace.c | 4 ++-- lib/ctf-writer/writer.c | 2 +- .../ctf/common/metadata/visitor-generate-ir.c | 2 +- tests/lib/test_ctf_writer.c | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/babeltrace/ctf-ir/trace.h b/include/babeltrace/ctf-ir/trace.h index 95b8fef5..af8b9fcc 100644 --- a/include/babeltrace/ctf-ir/trace.h +++ b/include/babeltrace/ctf-ir/trace.h @@ -170,7 +170,7 @@ The created trace class has the following initial properties: - Name: none. You can set a name with bt_ctf_trace_set_name(). - Default byte order: #BT_CTF_BYTE_ORDER_NATIVE. You - can set a default byte order with bt_ctf_trace_set_byte_order(). + can set a default byte order with bt_ctf_trace_set_native_byte_order(). Note that you \em must set the default byte order if any field type contained in the created trace class, in its stream classes, or in @@ -250,31 +250,31 @@ extern enum bt_ctf_byte_order bt_ctf_trace_get_byte_order( /** @brief Sets the default byte order of the CTF IR trace class - \p trace_class to \p name. + \p trace_class to \p native_byte_order. -\p byte_order \em must be one of: +\p native_byte_order \em must be one of: - #BT_CTF_BYTE_ORDER_LITTLE_ENDIAN - #BT_CTF_BYTE_ORDER_BIG_ENDIAN - #BT_CTF_BYTE_ORDER_NETWORK -@param[in] trace_class Trace class of which to set the default byte - order. -@param[in] byte_order Default byte order of the trace class. -@returns 0 on success, or a negative value on error. +@param[in] trace_class Trace class of which to set the default byte + order. +@param[in] native_byte_order Default byte order of the trace class. +@returns 0 on success, or a negative value on error. @prenotnull{trace_class} @prenotnull{name} @prehot{trace_class} -@pre \p byte_order is either #BT_CTF_BYTE_ORDER_LITTLE_ENDIAN, +@pre \p native_byte_order is either #BT_CTF_BYTE_ORDER_LITTLE_ENDIAN, #BT_CTF_BYTE_ORDER_BIG_ENDIAN, or #BT_CTF_BYTE_ORDER_NETWORK. @postrefcountsame{trace_class} @sa bt_ctf_trace_get_name(): Returns the name of a given trace class. */ -extern int bt_ctf_trace_set_byte_order(struct bt_ctf_trace *trace_class, - enum bt_ctf_byte_order byte_order); +extern int bt_ctf_trace_set_native_byte_order(struct bt_ctf_trace *trace_class, + enum bt_ctf_byte_order native_byte_order); /** @brief Returns the number of entries contained in the environment of diff --git a/lib/ctf-ir/trace.c b/lib/ctf-ir/trace.c index 90432dba..52293381 100644 --- a/lib/ctf-ir/trace.c +++ b/lib/ctf-ir/trace.c @@ -89,7 +89,7 @@ struct bt_ctf_trace *bt_ctf_trace_create(void) goto error; } - bt_ctf_trace_set_byte_order(trace, BT_CTF_BYTE_ORDER_NATIVE); + trace->native_byte_order = BT_CTF_BYTE_ORDER_NATIVE; bt_object_init(trace, bt_ctf_trace_destroy); trace->clocks = g_ptr_array_new_with_free_func( (GDestroyNotify) bt_put); @@ -995,7 +995,7 @@ end: return ret; } -int bt_ctf_trace_set_byte_order(struct bt_ctf_trace *trace, +int bt_ctf_trace_set_native_byte_order(struct bt_ctf_trace *trace, enum bt_ctf_byte_order byte_order) { int ret = 0; diff --git a/lib/ctf-writer/writer.c b/lib/ctf-writer/writer.c index 854de432..c822d63f 100644 --- a/lib/ctf-writer/writer.c +++ b/lib/ctf-writer/writer.c @@ -298,7 +298,7 @@ int bt_ctf_writer_set_byte_order(struct bt_ctf_writer *writer, goto end; } - ret = bt_ctf_trace_set_byte_order(writer->trace, + ret = bt_ctf_trace_set_native_byte_order(writer->trace, byte_order); end: return ret; diff --git a/plugins/ctf/common/metadata/visitor-generate-ir.c b/plugins/ctf/common/metadata/visitor-generate-ir.c index da979078..3018fbcc 100644 --- a/plugins/ctf/common/metadata/visitor-generate-ir.c +++ b/plugins/ctf/common/metadata/visitor-generate-ir.c @@ -4123,7 +4123,7 @@ int set_trace_byte_order(struct ctx *ctx, struct ctf_node *trace_node) goto error; } - ret = bt_ctf_trace_set_byte_order( + ret = bt_ctf_trace_set_native_byte_order( ctx->trace, bo); if (ret) { _PERROR("cannot set trace's byte order (%d)", diff --git a/tests/lib/test_ctf_writer.c b/tests/lib/test_ctf_writer.c index eca6a310..5b256cad 100644 --- a/tests/lib/test_ctf_writer.c +++ b/tests/lib/test_ctf_writer.c @@ -2589,7 +2589,7 @@ void test_create_writer_vs_non_writer_mode(void) /* Create non-writer trace, stream class, stream, and clock */ non_writer_trace = bt_ctf_trace_create(); assert(non_writer_trace); - ret = bt_ctf_trace_set_byte_order(non_writer_trace, + ret = bt_ctf_trace_set_native_byte_order(non_writer_trace, BT_CTF_BYTE_ORDER_LITTLE_ENDIAN); assert(!ret); non_writer_sc = bt_ctf_stream_class_create("nonwriter_sc"); @@ -2834,7 +2834,7 @@ int main(int argc, char **argv) trace = bt_ctf_writer_get_trace(writer); ok(trace, "bt_ctf_writer_get_trace returns a bt_ctf_trace object"); - ok(bt_ctf_trace_set_byte_order(trace, BT_CTF_BYTE_ORDER_BIG_ENDIAN) == 0, + ok(bt_ctf_trace_set_native_byte_order(trace, BT_CTF_BYTE_ORDER_BIG_ENDIAN) == 0, "Set a trace's byte order to big endian"); ok(bt_ctf_trace_get_byte_order(trace) == BT_CTF_BYTE_ORDER_BIG_ENDIAN, "bt_ctf_trace_get_byte_order returns a correct endianness"); -- 2.34.1