Standardize *get_*() functions
[babeltrace.git] / lib / ctf-ir / field-path.c
index a3d42352709410dce141511fbe3b3d46a1b18526..bc991f4070943d5d0c901bdbb81ac5b0d634b5ff 100644 (file)
@@ -115,24 +115,15 @@ end:
 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 index)
+               uint64_t index)
 {
        int ret = INT_MIN;
 
-       if (!field_path || index < 0) {
+       if (!field_path) {
                goto end;
        }
 
This page took 0.024546 seconds and 4 git commands to generate.