From bad5dd2eee554d872e0eb83b8ae9da75245ab746 Mon Sep 17 00:00:00 2001 From: jvr Date: Thu, 16 Aug 2001 18:14:48 +0000 Subject: [PATCH] Ugh. The previous change broke under 1.5.2. Work around it, and clean up some more hwile we're at it. git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@173 4cde692c-a291-49d1-8350-778aa11640f8 --- Src/eexecOp/eexecOpmodule.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Src/eexecOp/eexecOpmodule.c b/Src/eexecOp/eexecOpmodule.c index 1e77109ee..3befda7c8 100644 --- a/Src/eexecOp/eexecOpmodule.c +++ b/Src/eexecOp/eexecOpmodule.c @@ -23,16 +23,19 @@ static PyObject * eexec_decrypt(PyObject *self, PyObject *args) { PyObject *_res = NULL; - unsigned short int R; - unsigned short int c1 = 52845; - unsigned short int c2 = 22719; + unsigned short R; + int tempR; /* can't portably use unsigned shorts between Python versions */ + unsigned short c1 = 52845; + unsigned short c2 = 22719; unsigned char * inbuf; unsigned char * outbuf; unsigned long counter, insize; - if (!PyArg_ParseTuple(args, "s#H", &inbuf, &insize, &R)) + if (!PyArg_ParseTuple(args, "s#i", &inbuf, &insize, &tempR)) return NULL; + R = (unsigned short)tempR; + if ((outbuf = malloc(insize)) == NULL) { PyErr_NoMemory(); @@ -56,16 +59,19 @@ static PyObject * eexec_encrypt(PyObject *self, PyObject *args) { PyObject *_res = NULL; - unsigned short int R; - unsigned short int c1 = 52845; - unsigned short int c2 = 22719; + unsigned short R; + int tempR; /* can't portably use unsigned shorts between Python versions */ + unsigned short c1 = 52845; + unsigned short c2 = 22719; unsigned char * inbuf; unsigned char * outbuf; unsigned long counter, insize; - if (!PyArg_ParseTuple(args, "s#H", &inbuf, &insize, &R)) + if (!PyArg_ParseTuple(args, "s#i", &inbuf, &insize, &tempR)) return NULL; + R = (unsigned short)tempR; + if ((outbuf = malloc(insize)) == NULL) { PyErr_NoMemory();