From: Segev Finer Date: Thu, 29 Jun 2017 19:22:46 +0000 (+0300) Subject: bpo-9566: Fixed some _ssl warnings X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a639001c949ba53338a9ee047d2ec1efd2505e6f;p=thirdparty%2FPython%2Fcpython.git bpo-9566: Fixed some _ssl warnings --- diff --git a/Modules/_ssl.c b/Modules/_ssl.c index a79a7470d20a..65b1ee8d5938 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -1555,7 +1555,7 @@ cipher_to_dict(const SSL_CIPHER *cipher) cipher_protocol = SSL_CIPHER_get_version(cipher); cipher_id = SSL_CIPHER_get_id(cipher); SSL_CIPHER_description(cipher, buf, sizeof(buf) - 1); - len = strlen(buf); + len = (int)strlen(buf); if (len > 1 && buf[len-1] == '\n') buf[len-1] = '\0'; strength_bits = SSL_CIPHER_get_bits(cipher, &alg_bits); @@ -4073,7 +4073,7 @@ memory_bio_dealloc(PySSLMemoryBIO *self) static PyObject * memory_bio_get_pending(PySSLMemoryBIO *self, void *c) { - return PyLong_FromLong(BIO_ctrl_pending(self->bio)); + return PyLong_FromSize_t(BIO_ctrl_pending(self->bio)); } PyDoc_STRVAR(PySSL_memory_bio_pending_doc, @@ -4109,7 +4109,7 @@ _ssl_MemoryBIO_read_impl(PySSLMemoryBIO *self, int len) int avail, nbytes; PyObject *result; - avail = BIO_ctrl_pending(self->bio); + avail = (int)BIO_ctrl_pending(self->bio); if ((len < 0) || (len > avail)) len = avail;