Port: handle 'size_t' / 'off_t' on Solaris
[babeltrace.git] / lib / ctf-ir / fields.c
index 6caf2e45658524d9bced4df764bae3577a5fcb22..1633c54cb436613f4dbb864b12719307e75cabc2 100644 (file)
@@ -39,8 +39,6 @@
 #include <babeltrace/align-internal.h>
 #include <inttypes.h>
 
-#define PACKET_LEN_INCREMENT   (getpagesize() * 8 * CHAR_BIT)
-
 static
 struct bt_ctf_field *bt_ctf_field_integer_create(struct bt_ctf_field_type *);
 static
@@ -664,7 +662,7 @@ error:
        return ret_field;
 }
 
-int bt_ctf_field_structure_set_field(struct bt_ctf_field *field,
+int bt_ctf_field_structure_set_field_by_name(struct bt_ctf_field *field,
                const char *name, struct bt_ctf_field *value)
 {
        int ret = 0;
@@ -2252,7 +2250,7 @@ int bt_ctf_field_sequence_validate(struct bt_ctf_field *field)
                if (ret) {
                        BT_LOGW("Invalid sequence field's element field: "
                                "sequence-field-addr=%p, field-addr=%p, "
-                               "index=%" PRId64, field, elem_field, i);
+                               "index=%zu", field, elem_field, i);
                        goto end;
                }
        }
@@ -2390,7 +2388,7 @@ int bt_ctf_field_array_reset(struct bt_ctf_field *field)
                if (ret) {
                        BT_LOGE("Failed to reset array field's field: "
                                "array-field-addr=%p, field-addr=%p, "
-                               "index=%" PRId64, field, member, i);
+                               "index=%zu", field, member, i);
                        goto end;
                }
        }
@@ -2427,7 +2425,7 @@ int bt_ctf_field_sequence_reset(struct bt_ctf_field *field)
                if (ret) {
                        BT_LOGE("Failed to reset sequence field's field: "
                                "sequence-field-addr=%p, field-addr=%p, "
-                               "index=%" PRId64, field, member, i);
+                               "index=%zu", field, member, i);
                        goto end;
                }
        }
@@ -2831,7 +2829,7 @@ int bt_ctf_field_structure_copy(struct bt_ctf_field *src,
                struct bt_ctf_field *field_copy = NULL;
 
                if (field) {
-                       BT_LOGD("Copying structure field's field: src-field-addr=%p",
+                       BT_LOGD("Copying structure field's field: src-field-addr=%p"
                                "index=%" PRId64, field, i);
                        field_copy = bt_ctf_field_copy(field);
                        if (!field_copy) {
@@ -3038,8 +3036,8 @@ int increase_packet_size(struct bt_ctf_stream_pos *pos)
                pos->offset, pos->packet_size);
        ret = munmap_align(pos->base_mma);
        if (ret) {
-               BT_LOGE("Failed to perform an aligned memory unmapping: "
-                       "ret=%d, errno=%d", ret, errno);
+               BT_LOGE_ERRNO("Failed to perform an aligned memory unmapping",
+                       ": ret=%d", ret);
                goto end;
        }
 
@@ -3049,8 +3047,8 @@ int increase_packet_size(struct bt_ctf_stream_pos *pos)
                        pos->packet_size / CHAR_BIT);
        } while (ret == EINTR);
        if (ret) {
-               BT_LOGE("Failed to preallocate memory space: ret=%d, errno=%d",
-                       ret, errno);
+               BT_LOGE_ERRNO("Failed to preallocate memory space",
+                       ": ret=%d", ret);
                errno = EINTR;
                ret = -1;
                goto end;
@@ -3059,8 +3057,8 @@ int increase_packet_size(struct bt_ctf_stream_pos *pos)
        pos->base_mma = mmap_align(pos->packet_size / CHAR_BIT, pos->prot,
                pos->flags, pos->fd, pos->mmap_offset);
        if (pos->base_mma == MAP_FAILED) {
-               BT_LOGE("Failed to perform an aligned memory mapping: "
-                       "ret=%d, errno=%d", ret, errno);
+               BT_LOGE_ERRNO("Failed to perform an aligned memory mapping",
+                       ": ret=%d", ret);
                ret = -1;
        }
 
This page took 0.031839 seconds and 4 git commands to generate.