Skip to content

Commit

Permalink
Cleanup string print format for iree_device_size_t
Browse files Browse the repository at this point in the history
It should use PRIdsz instead of hard-coded PRIu64
  • Loading branch information
hcindyl committed Sep 3, 2021
1 parent 674aa9a commit 69d831c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions iree/hal/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ IREE_API_EXPORT iree_status_t iree_hal_buffer_validate_range(
return iree_make_status(
IREE_STATUS_OUT_OF_RANGE,
"attempted to access an address off the end of the valid buffer range "
"(offset=%" PRIu64 ", length=%" PRIu64 ", buffer byte_length=%" PRIu64
"(offset=%" PRIdsz ", length=%" PRIdsz ", buffer byte_length=%" PRIdsz
")",
byte_offset, byte_length, iree_hal_buffer_byte_length(buffer));
}
Expand All @@ -188,8 +188,8 @@ IREE_API_EXPORT iree_status_t iree_hal_buffer_validate_range(
return iree_make_status(
IREE_STATUS_OUT_OF_RANGE,
"attempted to access an address outside of the valid buffer range "
"(offset=%" PRIu64 ", length=%" PRIu64 ", end(inc)=%" PRIu64
", buffer byte_length=%" PRIu64 ")",
"(offset=%" PRIdsz ", length=%" PRIdsz ", end(inc)=%" PRIdsz
", buffer byte_length=%" PRIdsz ")",
byte_offset, byte_length, end - 1, iree_hal_buffer_byte_length(buffer));
}

Expand All @@ -208,8 +208,8 @@ static iree_status_t iree_hal_buffer_calculate_range(
return iree_make_status(
IREE_STATUS_OUT_OF_RANGE,
"attempted to access an address off the end of the valid buffer "
"range (offset=%" PRIu64 ", length=%" PRIu64
", buffer byte_length=%" PRIu64 ")",
"range (offset=%" PRIdsz ", length=%" PRIdsz
", buffer byte_length=%" PRIdsz ")",
offset, length, max_length);
}

Expand Down Expand Up @@ -241,8 +241,8 @@ static iree_status_t iree_hal_buffer_calculate_range(
return iree_make_status(
IREE_STATUS_OUT_OF_RANGE,
"attempted to access an address outside of the valid buffer "
"range (offset=%" PRIu64 ", adjusted_length=%" PRIu64 ", end=%" PRIu64
", buffer byte_length=%" PRIu64 ")",
"range (offset=%" PRIdsz ", adjusted_length=%" PRIdsz ", end=%" PRIdsz
", buffer byte_length=%" PRIdsz ")",
offset, adjusted_length, end, max_length);
}

Expand Down Expand Up @@ -411,8 +411,8 @@ iree_hal_buffer_fill(iree_hal_buffer_t* buffer, iree_device_size_t byte_offset,
IREE_TRACE_ZONE_END(z0);
return iree_make_status(IREE_STATUS_INVALID_ARGUMENT,
"attempting to fill a range with %zu byte values "
"that is not aligned (offset=%" PRIu64
", length=%" PRIu64 ")",
"that is not aligned (offset=%" PRIdsz
", length=%" PRIdsz ")",
pattern_length, byte_offset, byte_length);
}

Expand Down
2 changes: 1 addition & 1 deletion iree/hal/buffer_view.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ IREE_API_EXPORT iree_status_t iree_hal_buffer_view_reshape(
if (new_element_count != old_element_count) {
return iree_make_status(IREE_STATUS_INVALID_ARGUMENT,
"buffer view reshapes must have the same element "
"count; target=%" PRIu64 ", existing=%" PRIu64,
"count; target=%" PRIdsz ", existing=%" PRIdsz,
new_element_count, old_element_count);
}

Expand Down
2 changes: 1 addition & 1 deletion iree/hal/command_buffer_validation.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ static iree_status_t iree_hal_validating_command_buffer_fill_buffer(
return iree_make_status(
IREE_STATUS_INVALID_ARGUMENT,
"fill offset and/or length do not match the natural alignment of the "
"fill value (target_offset=%" PRIu64 ", length=%" PRIu64
"fill value (target_offset=%" PRIdsz ", length=%" PRIdsz
", pattern_length=%zu)",
target_offset, length, pattern_length);
}
Expand Down
2 changes: 1 addition & 1 deletion iree/modules/hal/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ IREE_VM_ABI_EXPORT(iree_hal_module_buffer_store, //
iree_hal_buffer_byte_length(target_buffer)) {
return iree_make_status(
IREE_STATUS_OUT_OF_RANGE,
"store out of bounds (target_offset=%d, length=%d into max %" PRIu64
"store out of bounds (target_offset=%d, length=%d into max %" PRIdsz
")",
target_offset, length, iree_hal_buffer_byte_length(target_buffer));
}
Expand Down

0 comments on commit 69d831c

Please sign in to comment.