mirror of https://github.com/python/cpython.git
Py_SAFE_DOWNCAST isn't quite doing the right thing for going from Py_ssize_t
to an unsigned int (and back again) on 64-bit machines, even though the actual value of the Py_ssize_t variable is way below 31 bits. I suspect compiler-error.
This commit is contained in:
parent
46872b1613
commit
369092be43
|
@ -173,8 +173,7 @@ EVP_update(EVPobject *self, PyObject *args)
|
||||||
if (!PyArg_ParseTuple(args, "s#:update", &cp, &len))
|
if (!PyArg_ParseTuple(args, "s#:update", &cp, &len))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
EVP_DigestUpdate(&self->ctx, cp, Py_SAFE_DOWNCAST(len, Py_ssize_t,
|
EVP_DigestUpdate(&self->ctx, cp, (unsigned int)len);
|
||||||
unsigned int));
|
|
||||||
|
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
return Py_None;
|
return Py_None;
|
||||||
|
@ -265,8 +264,7 @@ EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds)
|
||||||
Py_INCREF(self->name);
|
Py_INCREF(self->name);
|
||||||
|
|
||||||
if (cp && len)
|
if (cp && len)
|
||||||
EVP_DigestUpdate(&self->ctx, cp, Py_SAFE_DOWNCAST(len, Py_ssize_t,
|
EVP_DigestUpdate(&self->ctx, cp, (unsigned int)len);
|
||||||
unsigned int));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -393,8 +391,7 @@ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict)
|
||||||
|
|
||||||
digest = EVP_get_digestbyname(name);
|
digest = EVP_get_digestbyname(name);
|
||||||
|
|
||||||
return EVPnew(name_obj, digest, NULL, cp, Py_SAFE_DOWNCAST(len, Py_ssize_t,
|
return EVPnew(name_obj, digest, NULL, cp, (unsigned int)len);
|
||||||
unsigned int));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -419,7 +416,7 @@ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict)
|
||||||
CONST_ ## NAME ## _name_obj, \
|
CONST_ ## NAME ## _name_obj, \
|
||||||
NULL, \
|
NULL, \
|
||||||
CONST_new_ ## NAME ## _ctx_p, \
|
CONST_new_ ## NAME ## _ctx_p, \
|
||||||
cp, Py_SAFE_DOWNCAST(len, Py_ssize_t, unsigned int)); \
|
cp, (unsigned int)len); \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* a PyMethodDef structure for the constructor */
|
/* a PyMethodDef structure for the constructor */
|
||||||
|
|
Loading…
Reference in New Issue