Skip to content

Commit

Permalink
Merge pull request #17 from SjoerdB93/master
Browse files Browse the repository at this point in the history
Build cbf with PY_SSIZE_T_CLEAN to ensure compatibility with python>=3.10
  • Loading branch information
simongregorebner authored Dec 12, 2022
2 parents 16ead28 + 15dbee1 commit 8ef4bd3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/python-cbf.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <stdlib.h>
#include <stdint.h>
Expand All @@ -7,10 +8,10 @@

static PyObject *py_cbf_compress(PyObject *self, PyObject *args) {
const unsigned char *source;
int source_size;
Py_ssize_t source_size;
unsigned char *dest;
int dest_size;
int compressed_size;
Py_ssize_t dest_size;
Py_ssize_t compressed_size;

if (!PyArg_ParseTuple(args, "s#s#", &source, &source_size, &dest, &dest_size)) {
return NULL;
Expand All @@ -24,9 +25,9 @@ static PyObject *py_cbf_compress(PyObject *self, PyObject *args) {

static PyObject *py_cbf_uncompress(PyObject *self, PyObject *args) {
const unsigned char *source;
int source_size;
Py_ssize_t source_size;
unsigned char *dest;
int dest_size;
Py_ssize_t dest_size;


if (!PyArg_ParseTuple(args, "s#s#", &source, &source_size, &dest, &dest_size)) {
Expand Down

0 comments on commit 8ef4bd3

Please sign in to comment.