Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
0.xx (2020/xx/xx):
0.xx (2021/xx/xx):
- graph.axis.style:
- Allow invalid values (e.g. None) in color values of density style.
- text module:
Expand All @@ -9,6 +9,8 @@
- fix bitmap palette data pdf output being bytes
- canvas module:
- add clear() method to canvas class (suggested by Camilo Talero)
- t1 extension module:
- adjust to int/Py_ssize_t change in python 3.10 (thanks to Michael J Gruber)

0.15 (2019/07/14):
- text module:
Expand Down
12 changes: 8 additions & 4 deletions pyx/font/_t1code.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* USA.
*/

#define PY_SSIZE_T_CLEAN

#include <Python.h>
#include <stdlib.h>
#include <stdint.h>
Expand All @@ -32,11 +34,12 @@ def decoder(code, r, n):
static PyObject *py_decoder(PyObject *self, PyObject *args)
{
unsigned char *code;
int lcode, pr, n;
Py_ssize_t lcode;
int pr, n;

if (PyArg_ParseTuple(args, "y#ii", (char **) &code, &lcode, &pr, &n)) {
unsigned char *data;
int i;
Py_ssize_t i;
unsigned char x;
uint16_t r=pr;
PyObject *result;
Expand Down Expand Up @@ -74,11 +77,12 @@ static PyObject *py_encoder(PyObject *self, PyObject *args)
{
unsigned char *data;
unsigned char *random;
int ldata, pr, lrandom;
Py_ssize_t ldata, lrandom;
int pr;

if (PyArg_ParseTuple(args, "y#iy#", (char **) &data, &ldata, &pr, (char **) &random, &lrandom)) {
unsigned char *code;
int i;
Py_ssize_t i;
uint16_t r=pr;
PyObject *result;

Expand Down