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
This commit is contained in:
jvr 2001-08-16 18:14:48 +00:00
parent 0d2a955eb0
commit bad5dd2eee

View File

@ -23,16 +23,19 @@ static PyObject *
eexec_decrypt(PyObject *self, PyObject *args) eexec_decrypt(PyObject *self, PyObject *args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
unsigned short int R; unsigned short R;
unsigned short int c1 = 52845; int tempR; /* can't portably use unsigned shorts between Python versions */
unsigned short int c2 = 22719; unsigned short c1 = 52845;
unsigned short c2 = 22719;
unsigned char * inbuf; unsigned char * inbuf;
unsigned char * outbuf; unsigned char * outbuf;
unsigned long counter, insize; unsigned long counter, insize;
if (!PyArg_ParseTuple(args, "s#H", &inbuf, &insize, &R)) if (!PyArg_ParseTuple(args, "s#i", &inbuf, &insize, &tempR))
return NULL; return NULL;
R = (unsigned short)tempR;
if ((outbuf = malloc(insize)) == NULL) if ((outbuf = malloc(insize)) == NULL)
{ {
PyErr_NoMemory(); PyErr_NoMemory();
@ -56,16 +59,19 @@ static PyObject *
eexec_encrypt(PyObject *self, PyObject *args) eexec_encrypt(PyObject *self, PyObject *args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
unsigned short int R; unsigned short R;
unsigned short int c1 = 52845; int tempR; /* can't portably use unsigned shorts between Python versions */
unsigned short int c2 = 22719; unsigned short c1 = 52845;
unsigned short c2 = 22719;
unsigned char * inbuf; unsigned char * inbuf;
unsigned char * outbuf; unsigned char * outbuf;
unsigned long counter, insize; unsigned long counter, insize;
if (!PyArg_ParseTuple(args, "s#H", &inbuf, &insize, &R)) if (!PyArg_ParseTuple(args, "s#i", &inbuf, &insize, &tempR))
return NULL; return NULL;
R = (unsigned short)tempR;
if ((outbuf = malloc(insize)) == NULL) if ((outbuf = malloc(insize)) == NULL)
{ {
PyErr_NoMemory(); PyErr_NoMemory();