Skip to content

Commit

Permalink
more build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyMusatkin committed Sep 12, 2024
1 parent 3666ef7 commit 4ee76d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/crc.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "aws/checksums/crc.h"
#include "aws/common/byte_buf.h"
PyObject *checksums_crc32_common(PyObject *args, uint32_t (*checksum_fn)(const uint8_t *, int, uint32_t)) {
PyObject *checksums_crc32_common(PyObject *args, uint32_t (*checksum_fn)(const uint8_t *, size_t, uint32_t)) {
Py_buffer input;
PyObject *py_previousCrc;
PyObject *py_result = NULL;
Expand Down Expand Up @@ -43,7 +43,7 @@ PyObject *checksums_crc32_common(PyObject *args, uint32_t (*checksum_fn)(const u
Py_END_ALLOW_THREADS
/* clang-format on */
} else {
val = checksum_fn(input.buf, (int)input.len, val);
val = checksum_fn(input.buf, (size_t)input.len, val);
}
py_result = PyLong_FromUnsignedLong(val);
done:
Expand Down Expand Up @@ -75,7 +75,7 @@ PyObject *aws_py_checksums_crc64nvme(PyObject *self, PyObject *args) {

/* Note: PyArg_ParseTuple() doesn't do overflow checking on unsigned values
* so use PyLong_AsUnsignedLongLong() to get the value of the previousCrc arg */
uin64_t previousCrc = PyLong_AsUnsignedLongLong(py_previousCrc64);
uint64_t previousCrc = PyLong_AsUnsignedLongLong(py_previousCrc64);

if (previousCrc == (uint64_t)-1 && PyErr_Occurred()) {
goto done;
Expand Down

0 comments on commit 4ee76d6

Please sign in to comment.