From 2f4b93cd29ab927436c42544ef6fccfb33429c0f Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Thu, 15 Jun 2017 16:36:47 -0400 Subject: [PATCH] BT_CTF_BYTE_ORDER_NONE -> BT_CTF_BYTE_ORDER_UNSPECIFIED to match base 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/field-types-internal.h | 4 ++-- include/babeltrace/ctf-ir/field-types.h | 4 ++-- include/babeltrace/ctf-ir/trace.h | 9 +++++---- lib/ctf-ir/trace.c | 10 +++++----- plugins/libctfcopytrace/ctfcopytrace.c | 2 +- tests/lib/test_ctf_writer.c | 4 ++-- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/include/babeltrace/ctf-ir/field-types-internal.h b/include/babeltrace/ctf-ir/field-types-internal.h index f408f50b..a4f4c833 100644 --- a/include/babeltrace/ctf-ir/field-types-internal.h +++ b/include/babeltrace/ctf-ir/field-types-internal.h @@ -253,8 +253,8 @@ const char *bt_ctf_byte_order_string(enum bt_ctf_byte_order bo) switch (bo) { case BT_CTF_BYTE_ORDER_UNKNOWN: return "BT_CTF_BYTE_ORDER_UNKNOWN"; - case BT_CTF_BYTE_ORDER_NONE: - return "BT_CTF_BYTE_ORDER_NONE"; + case BT_CTF_BYTE_ORDER_UNSPECIFIED: + return "BT_CTF_BYTE_ORDER_UNSPECIFIED"; case BT_CTF_BYTE_ORDER_NATIVE: return "BT_CTF_BYTE_ORDER_NATIVE"; case BT_CTF_BYTE_ORDER_LITTLE_ENDIAN: diff --git a/include/babeltrace/ctf-ir/field-types.h b/include/babeltrace/ctf-ir/field-types.h index cf332762..29928986 100644 --- a/include/babeltrace/ctf-ir/field-types.h +++ b/include/babeltrace/ctf-ir/field-types.h @@ -493,10 +493,10 @@ enum bt_ctf_byte_order { BT_CTF_BYTE_ORDER_NATIVE = 0, /** - No byte order; the initial native byte order of a + Unspecified byte order; the initial native byte order of a \link ctfirtraceclass CTF IR trace class\endlink. */ - BT_CTF_BYTE_ORDER_NONE, + BT_CTF_BYTE_ORDER_UNSPECIFIED, /// Little-endian. BT_CTF_BYTE_ORDER_LITTLE_ENDIAN, diff --git a/include/babeltrace/ctf-ir/trace.h b/include/babeltrace/ctf-ir/trace.h index 362cd707..c7fa1f31 100644 --- a/include/babeltrace/ctf-ir/trace.h +++ b/include/babeltrace/ctf-ir/trace.h @@ -181,8 +181,9 @@ The created trace class has the following initial properties: with bt_ctf_trace_set_name(). - UUID: none. You can set a UUID with bt_ctf_trace_set_uuid(). -- Native byte order: #BT_CTF_BYTE_ORDER_NONE. You - can set a native byte order with bt_ctf_trace_set_native_byte_order(). +- Native byte order: #BT_CTF_BYTE_ORDER_UNSPECIFIED. + You can set a native byte order with + bt_ctf_trace_set_native_byte_order(). - Environment: empty. You can add environment entries with bt_ctf_trace_set_environment_field(), bt_ctf_trace_set_environment_field_integer(), and @@ -266,7 +267,7 @@ extern enum bt_ctf_byte_order bt_ctf_trace_get_native_byte_order( - #BT_CTF_BYTE_ORDER_BIG_ENDIAN - #BT_CTF_BYTE_ORDER_NETWORK - If the trace is not in CTF writer mode, - #BT_CTF_BYTE_ORDER_NONE. + #BT_CTF_BYTE_ORDER_UNSPECIFIED. @param[in] trace_class Trace class of which to set the native byte order. @@ -275,7 +276,7 @@ extern enum bt_ctf_byte_order bt_ctf_trace_get_native_byte_order( @prenotnull{trace_class} @prehot{trace_class} -@pre \p native_byte_order is either #BT_CTF_BYTE_ORDER_NONE (if the +@pre \p native_byte_order is either #BT_CTF_BYTE_ORDER_UNSPECIFIED (if the trace is not in CTF writer mode), #BT_CTF_BYTE_ORDER_LITTLE_ENDIAN, #BT_CTF_BYTE_ORDER_BIG_ENDIAN, or #BT_CTF_BYTE_ORDER_NETWORK. diff --git a/lib/ctf-ir/trace.c b/lib/ctf-ir/trace.c index 37fa2763..634a71ef 100644 --- a/lib/ctf-ir/trace.c +++ b/lib/ctf-ir/trace.c @@ -101,7 +101,7 @@ struct bt_ctf_trace *bt_ctf_trace_create(void) } BT_LOGD_STR("Creating trace object."); - trace->native_byte_order = BT_CTF_BYTE_ORDER_NONE; + trace->native_byte_order = BT_CTF_BYTE_ORDER_UNSPECIFIED; bt_object_init(trace, bt_ctf_trace_destroy); trace->clocks = g_ptr_array_new_with_free_func( (GDestroyNotify) bt_put); @@ -1641,8 +1641,8 @@ int append_trace_metadata(struct bt_ctf_trace *trace, int ret = 0; if (trace->native_byte_order == BT_CTF_BYTE_ORDER_NATIVE || - trace->native_byte_order == BT_CTF_BYTE_ORDER_NONE) { - BT_LOGW("Invalid parameter: trace's byte order cannot be BT_CTF_BYTE_ORDER_NATIVE or BT_CTF_BYTE_ORDER_NONE at this point; " + trace->native_byte_order == BT_CTF_BYTE_ORDER_UNSPECIFIED) { + BT_LOGW("Invalid parameter: trace's byte order cannot be BT_CTF_BYTE_ORDER_NATIVE or BT_CTF_BYTE_ORDER_UNSPECIFIED at this point; " "set it with bt_ctf_trace_set_native_byte_order(): " "addr=%p, name=\"%s\"", trace, bt_ctf_trace_get_name(trace)); @@ -1845,8 +1845,8 @@ int bt_ctf_trace_set_native_byte_order(struct bt_ctf_trace *trace, } if (trace->is_created_by_writer && - byte_order == BT_CTF_BYTE_ORDER_NONE) { - BT_LOGW("Invalid parameter: BT_CTF_BYTE_ORDER_NONE byte order is not allowed for a CTF writer trace: " + byte_order == BT_CTF_BYTE_ORDER_UNSPECIFIED) { + BT_LOGW("Invalid parameter: BT_CTF_BYTE_ORDER_UNSPECIFIED byte order is not allowed for a CTF writer trace: " "addr=%p, name=\"%s\"", trace, bt_ctf_trace_get_name(trace)); ret = -1; diff --git a/plugins/libctfcopytrace/ctfcopytrace.c b/plugins/libctfcopytrace/ctfcopytrace.c index 28aa5e5c..894ce2f3 100644 --- a/plugins/libctfcopytrace/ctfcopytrace.c +++ b/plugins/libctfcopytrace/ctfcopytrace.c @@ -885,7 +885,7 @@ enum bt_component_status ctf_copy_trace(FILE *err, struct bt_ctf_trace *trace, * the CTF writer object chooses, which is the machine's native * byte order. */ - if (order != BT_CTF_BYTE_ORDER_NONE) { + if (order != BT_CTF_BYTE_ORDER_UNSPECIFIED) { ret = bt_ctf_trace_set_native_byte_order(writer_trace, order); if (ret) { fprintf(err, "[error] %s in %s:%d\n", __func__, __FILE__, __LINE__); diff --git a/tests/lib/test_ctf_writer.c b/tests/lib/test_ctf_writer.c index 9eed82f4..6c2defc6 100644 --- a/tests/lib/test_ctf_writer.c +++ b/tests/lib/test_ctf_writer.c @@ -2976,8 +2976,8 @@ int main(int argc, char **argv) trace = bt_ctf_writer_get_trace(writer); ok(bt_ctf_trace_set_native_byte_order(trace, BT_CTF_BYTE_ORDER_NATIVE), "Cannot set a trace's byte order to BT_CTF_BYTE_ORDER_NATIVE"); - ok(bt_ctf_trace_set_native_byte_order(trace, BT_CTF_BYTE_ORDER_NONE), - "Cannot set a trace's byte order to BT_CTF_BYTE_ORDER_NONE"); + ok(bt_ctf_trace_set_native_byte_order(trace, BT_CTF_BYTE_ORDER_UNSPECIFIED), + "Cannot set a trace's byte order to BT_CTF_BYTE_ORDER_UNSPECIFIED"); ok(trace, "bt_ctf_writer_get_trace returns a bt_ctf_trace object"); ok(bt_ctf_trace_set_native_byte_order(trace, BT_CTF_BYTE_ORDER_BIG_ENDIAN) == 0, -- 2.34.1