mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix a few places where ints were passed to PyArg_Parse instead of Py_ssize_t
This commit is contained in:
parent
055f5b0979
commit
872613f5f3
@ -372,7 +372,7 @@ usbobserver_has_mtp_interface(io_service_t usb_device) {
|
||||
|
||||
static PyObject*
|
||||
usbobserver_is_mtp(PyObject *self, PyObject * args) {
|
||||
int serial_sz = 0;
|
||||
Py_ssize_t serial_sz = 0;
|
||||
long vendor_id = 0, product_id = 0, bcd = 0;
|
||||
char *serial = NULL, buf[500] = {0};
|
||||
CFNumberRef num = NULL;
|
||||
|
@ -152,7 +152,7 @@ decompress(PyObject *self, PyObject *args)
|
||||
{
|
||||
unsigned char *inbuf;
|
||||
unsigned char *outbuf;
|
||||
unsigned int inlen;
|
||||
Py_ssize_t inlen;
|
||||
unsigned int outlen;
|
||||
int err;
|
||||
memory_file source;
|
||||
|
@ -17,7 +17,7 @@ static PyObject *
|
||||
msdes_deskey(PyObject *self, PyObject *args)
|
||||
{
|
||||
unsigned char *key = NULL;
|
||||
unsigned int len = 0;
|
||||
Py_ssize_t len = 0;
|
||||
short int edf = 0;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y#h", &key, &len, &edf)) {
|
||||
@ -44,8 +44,8 @@ msdes_des(PyObject *self, PyObject *args)
|
||||
{
|
||||
unsigned char *inbuf = NULL;
|
||||
unsigned char *outbuf = NULL;
|
||||
unsigned int len = 0;
|
||||
unsigned int off = 0;
|
||||
Py_ssize_t len = 0;
|
||||
Py_ssize_t off = 0;
|
||||
PyObject *retval = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "y#", &inbuf, &len)) {
|
||||
|
@ -376,7 +376,7 @@ error:
|
||||
static PyObject *
|
||||
PDFDoc_set_xmp_metadata(PDFDoc *self, PyObject *args) {
|
||||
const char *raw = NULL;
|
||||
long len = 0;
|
||||
Py_ssize_t len = 0;
|
||||
PoDoFo::PdfObject *metadata = NULL, *catalog = NULL;
|
||||
PoDoFo::PdfStream *str = NULL;
|
||||
TVecFilters compressed(1);
|
||||
|
@ -959,7 +959,8 @@ is_wow64_process(PyObject *self, PyObject *args) {
|
||||
|
||||
static PyObject*
|
||||
write_file(PyObject *self, PyObject *args) {
|
||||
int size, offset = 0;
|
||||
int offset = 0;
|
||||
Py_ssize_t size;
|
||||
const char *data;
|
||||
HANDLE handle;
|
||||
if (!PyArg_ParseTuple(args, "O&y#|i", convert_handle, &handle, &data, &size, &offset)) return NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user