Skip to content

Commit

Permalink
compile fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyMusatkin committed Sep 23, 2024
1 parent 5587af4 commit a5b2cf1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/native/checksums.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ jint crc32_common(
size_t length,
uint32_t (*checksum_fn)(const uint8_t *, size_t, uint32_t)) {
struct aws_byte_cursor c_byte_array = aws_jni_byte_cursor_from_jbyteArray_acquire(env, input);
jint res_signed = (jint)checksum_fn(c_byte_array.ptr, c_byte_array.len, 0);
struct aws_byte_cursor cursor = c_byte_array;
aws_byte_cursor_advance(&cursor, start);
cursor.len = aws_min_size(length, cursor.len);
jint res_signed = (jint)checksum_fn(cursor.ptr, cursor.len, previous);
aws_jni_byte_cursor_from_jbyteArray_release(env, input, c_byte_array);
return res_signed;
}
Expand Down Expand Up @@ -59,7 +62,10 @@ JNIEXPORT jint JNICALL Java_software_amazon_awssdk_crt_checksums_CRC64NVME_crc64
aws_cache_jni_ids(env);

struct aws_byte_cursor c_byte_array = aws_jni_byte_cursor_from_jbyteArray_acquire(env, input);
jint res_signed = (jint)aws_checksums_crc64nvme_ex(c_byte_array.ptr, c_byte_array.len, 0);
struct aws_byte_cursor cursor = c_byte_array;
aws_byte_cursor_advance(&cursor, offset);
cursor.len = aws_min_size(length, cursor.len);
jint res_signed = (jint)aws_checksums_crc64nvme_ex(cursor.ptr, cursor.len, previous);
aws_jni_byte_cursor_from_jbyteArray_release(env, input, c_byte_array);
return res_signed;
}

0 comments on commit a5b2cf1

Please sign in to comment.