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>
#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
*/
/* 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 */
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;
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
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,
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:
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";
#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 */
"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;
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 */
"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;
}
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;
}
offset_seconds, offset_cycles,
frequency, cycles, ns);
if (ret) {
- status = BT_UTIL_STATUS_OVERFLOW;
+ status = BT_UTIL_STATUS_OVERFLOW_ERROR;
}
end: