lib: rename all `*_STATUS_OVERFLOW` -> `*_STATUS_OVERFLOW_ERROR`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 24 Jul 2019 18:48:05 +0000 (14:48 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 25 Jul 2019 18:04:47 +0000 (14:04 -0400)
All the error statuses must have the `_ERROR` suffix.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I2243c77ecb9723f3c97f7f9f9af09df646d48ae3
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1770
Tested-by: jenkins <jenkins@lttng.org>
12 files changed:
include/babeltrace2/babeltrace.h
include/babeltrace2/func-status.h
include/babeltrace2/trace-ir/clock-class-const.h
include/babeltrace2/trace-ir/clock-snapshot-const.h
include/babeltrace2/util.h
src/bindings/python/bt2/bt2/utils.py
src/common/common.h
src/lib/func-status.h
src/lib/trace-ir/clock-class.c
src/lib/trace-ir/clock-class.h
src/lib/trace-ir/clock-snapshot.c
src/lib/util.c

index ded1b03f83fc138478235c5b6d18a9480f1eb396..3b7bb7538f79722e5784337d5eb6588e803c2598 100644 (file)
 #undef __BT_FUNC_STATUS_MEMORY_ERROR
 #undef __BT_FUNC_STATUS_NOT_FOUND
 #undef __BT_FUNC_STATUS_OK
-#undef __BT_FUNC_STATUS_OVERFLOW
+#undef __BT_FUNC_STATUS_OVERFLOW_ERROR
 #undef __BT_IN_BABELTRACE_H
 #undef __BT_UPCAST
 #undef __BT_UPCAST_CONST
index 74fc101251359f93f1186871fb195748783ab9bc..4f8e61a9ee5c80164f5a04f19871d8fb4e2ba96a 100644 (file)
@@ -37,8 +37,8 @@
  */
 
 /* Value is too large for the given data type */
-#ifndef __BT_FUNC_STATUS_OVERFLOW
-# define __BT_FUNC_STATUS_OVERFLOW             -75
+#ifndef __BT_FUNC_STATUS_OVERFLOW_ERROR
+# define __BT_FUNC_STATUS_OVERFLOW_ERROR       -75
 #endif
 
 /* Invalid query object */
index 47635ceedaddbf050d1c506b13c5da103f5dcb56..b4affd536a19d6f0cece9012da00fe524fa6078b 100644 (file)
@@ -57,7 +57,7 @@ extern bt_uuid bt_clock_class_get_uuid(
                const bt_clock_class *clock_class);
 
 typedef enum bt_clock_class_cycles_to_ns_from_origin_status {
-       BT_CLOCK_CLASS_CYCLES_TO_NS_FROM_ORIGIN_STATUS_OVERFLOW         = __BT_FUNC_STATUS_OVERFLOW,
+       BT_CLOCK_CLASS_CYCLES_TO_NS_FROM_ORIGIN_STATUS_OVERFLOW_ERROR   = __BT_FUNC_STATUS_OVERFLOW_ERROR,
        BT_CLOCK_CLASS_CYCLES_TO_NS_FROM_ORIGIN_STATUS_OK               = __BT_FUNC_STATUS_OK,
 } bt_clock_class_cycles_to_ns_from_origin_status;
 
index 1474144482ce549a3bda695f45bb7513c406bbf7..3363b9df8318466a0998961eec562aab4334de1b 100644 (file)
@@ -42,8 +42,8 @@ extern uint64_t bt_clock_snapshot_get_value(
                const bt_clock_snapshot *clock_snapshot);
 
 typedef enum bt_clock_snapshot_get_ns_from_origin_status {
-       BT_CLOCK_SNAPSHOT_GET_NS_FROM_ORIGIN_STATUS_OK          = __BT_FUNC_STATUS_OK,
-       BT_CLOCK_SNAPSHOT_GET_NS_FROM_ORIGIN_STATUS_OVERFLOW    = __BT_FUNC_STATUS_OVERFLOW,
+       BT_CLOCK_SNAPSHOT_GET_NS_FROM_ORIGIN_STATUS_OK                  = __BT_FUNC_STATUS_OK,
+       BT_CLOCK_SNAPSHOT_GET_NS_FROM_ORIGIN_STATUS_OVERFLOW_ERROR      = __BT_FUNC_STATUS_OVERFLOW_ERROR,
 } bt_clock_snapshot_get_ns_from_origin_status;
 
 extern bt_clock_snapshot_get_ns_from_origin_status
index 0650d60359d02fdfff1dab1b44f2da2e28d30064..8d9585c3288b07a03c6aee6187eb3d518e28240f 100644 (file)
@@ -35,7 +35,7 @@ extern "C" {
 
 typedef enum bt_util_status {
        BT_UTIL_STATUS_OK = 0,
-       BT_UTIL_STATUS_OVERFLOW = -75,
+       BT_UTIL_STATUS_OVERFLOW_ERROR = -75,
 } bt_util_status;
 
 bt_util_status bt_util_clock_cycles_to_ns_from_origin(uint64_t cycles,
index abb9accfdee8b73ea3497737e99d96ff2c4f0590..9c88417577306102a0689cf8d9fd27cc04502463 100644 (file)
@@ -151,7 +151,7 @@ def _handle_func_status(status, msg=None):
             raise bt2.TryAgain
         else:
             raise bt2.TryAgain(msg)
-    elif status == native_bt.__BT_FUNC_STATUS_OVERFLOW:
+    elif status == native_bt.__BT_FUNC_STATUS_OVERFLOW_ERROR:
         if msg is None:
             raise bt2.OverflowError
         else:
index 3d5c0b5e29a1c5b2b95465be419a0375e7e31697..8c74579b525ff1c38c751a3241d6c8e99dcbc4e5 100644 (file)
@@ -601,7 +601,7 @@ static inline
 const char *bt_common_func_status_string(int status)
 {
        switch (status) {
-       case __BT_FUNC_STATUS_OVERFLOW:
+       case __BT_FUNC_STATUS_OVERFLOW_ERROR:
                return "OVERFLOW";
        case __BT_FUNC_STATUS_INVALID_OBJECT:
                return "INVALID_OBJECT";
index 25520ffa59cbf338be442b327efc3c52fe8a76f4..e5aca4aac340953b744ed89a45a0f353d304a34e 100644 (file)
@@ -38,6 +38,6 @@
 #define BT_FUNC_STATUS_MEMORY_ERROR    __BT_FUNC_STATUS_MEMORY_ERROR
 #define BT_FUNC_STATUS_NOT_FOUND       __BT_FUNC_STATUS_NOT_FOUND
 #define BT_FUNC_STATUS_OK              __BT_FUNC_STATUS_OK
-#define BT_FUNC_STATUS_OVERFLOW                __BT_FUNC_STATUS_OVERFLOW
+#define BT_FUNC_STATUS_OVERFLOW_ERROR  __BT_FUNC_STATUS_OVERFLOW_ERROR
 
 #endif /* BABELTRACE_FUNC_STATUS_INTERNAL_H */
index fb0d108c502bad23b157c7b9f843cf29e33afeea..34e3a87b26d4d480bafc7963db8b03b6e821388c 100644 (file)
@@ -296,7 +296,7 @@ bt_clock_class_cycles_to_ns_from_origin(
                        "value overflows the signed 64-bit integer range: "
                        "%![cc-]+K, cycles=%" PRIu64,
                        clock_class, cycles);
-               ret = BT_FUNC_STATUS_OVERFLOW;
+               ret = BT_FUNC_STATUS_OVERFLOW_ERROR;
        }
 
        return ret;
index f3daa67c431cdced1e4a07658fe18f59aceda0e5..b39183c2c94db206160cc61b6e022e846aa45700 100644 (file)
@@ -115,7 +115,7 @@ int bt_clock_class_clock_value_from_ns_from_origin(
 
        return bt_common_clock_value_from_ns_from_origin(cc->offset_seconds,
                cc->offset_cycles, cc->frequency, ns_from_origin,
-               raw_value) ? BT_FUNC_STATUS_OVERFLOW : BT_FUNC_STATUS_OK;
+               raw_value) ? BT_FUNC_STATUS_OVERFLOW_ERROR : BT_FUNC_STATUS_OK;
 }
 
 #endif /* BABELTRACE_TRACE_IR_CLOCK_CLASS_INTERNAL_H */
index e418fff61facd7a44ca5653471ce4909e6ef8a2f..899d0083dba106ff0fa6c993ed6d21b5f63dde27 100644 (file)
@@ -167,7 +167,7 @@ bt_clock_snapshot_get_ns_from_origin(
                        "Clock snapshot, once converted to nanoseconds from origin, "
                        "overflows the signed 64-bit integer range: "
                        "%![cs-]+k", clock_snapshot);
-               ret = BT_FUNC_STATUS_OVERFLOW;
+               ret = BT_FUNC_STATUS_OVERFLOW_ERROR;
                goto end;
        }
 
index a52daf9a52f82f376154a9ee34930c866df61365..d6b90537af06f51d8bd983c5e323f275045524a9 100644 (file)
@@ -51,7 +51,7 @@ bt_util_status bt_util_clock_cycles_to_ns_from_origin(uint64_t cycles,
        overflows = bt_util_get_base_offset_ns(offset_seconds, offset_cycles,
                frequency, &base_offset_ns);
        if (overflows) {
-               status = BT_UTIL_STATUS_OVERFLOW;
+               status = BT_UTIL_STATUS_OVERFLOW_ERROR;
                goto end;
        }
 
@@ -59,7 +59,7 @@ bt_util_status bt_util_clock_cycles_to_ns_from_origin(uint64_t cycles,
                offset_seconds, offset_cycles,
                frequency, cycles, ns);
        if (ret) {
-               status = BT_UTIL_STATUS_OVERFLOW;
+               status = BT_UTIL_STATUS_OVERFLOW_ERROR;
        }
 
 end:
This page took 0.031078 seconds and 4 git commands to generate.