projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Standardize *get_*() functions
[babeltrace.git]
/
lib
/
ctf-ir
/
field-path.c
diff --git
a/lib/ctf-ir/field-path.c
b/lib/ctf-ir/field-path.c
index a3d42352709410dce141511fbe3b3d46a1b18526..bc991f4070943d5d0c901bdbb81ac5b0d634b5ff 100644
(file)
--- a/
lib/ctf-ir/field-path.c
+++ b/
lib/ctf-ir/field-path.c
@@
-115,24
+115,15
@@
end:
int64_t bt_ctf_field_path_get_index_count(
const struct bt_ctf_field_path *field_path)
{
int64_t bt_ctf_field_path_get_index_count(
const struct bt_ctf_field_path *field_path)
{
- int64_t ret = -1;
-
- if (!field_path) {
- goto end;
- }
-
- ret = field_path->indexes->len;
-
-end:
- return ret;
+ return field_path ? (int64_t) field_path->indexes->len : (int64_t) -1;
}
int bt_ctf_field_path_get_index(const struct bt_ctf_field_path *field_path,
}
int bt_ctf_field_path_get_index(const struct bt_ctf_field_path *field_path,
-
in
t index)
+
uint64_
t index)
{
int ret = INT_MIN;
{
int ret = INT_MIN;
- if (!field_path
|| index < 0
) {
+ if (!field_path) {
goto end;
}
goto end;
}
This page took
0.023229 seconds
and
4
git commands to generate.