summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2019-09-30 19:14:26 (GMT)
committerGitHub <noreply@github.com>2019-09-30 19:14:26 (GMT)
commitaca8c406ada3bb547765b262bed3ac0cc6be8dd3 (patch)
treecef8235766997246d6832c8217d897f5cc2eb289
parentbcda460baf25062ab68622b3f043f52b9db4d21d (diff)
downloadcpython-aca8c406ada3bb547765b262bed3ac0cc6be8dd3.zip
cpython-aca8c406ada3bb547765b262bed3ac0cc6be8dd3.tar.gz
cpython-aca8c406ada3bb547765b262bed3ac0cc6be8dd3.tar.bz2
bpo-38321: Fix _testcapimodule.c warning (GH-16494)
Fix the following warning: modules\_testcapimodule.c(6409): warning C4146: unary minus operator applied to unsigned type, result still unsigned
-rw-r--r--Modules/_testcapimodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 30a786c..3f3ed66 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -1952,7 +1952,7 @@ unicode_asutf8andsize(PyObject *self, PyObject *args)
return NULL;
}
- buffer = PyUnicode_AsUTF8AndSize(unicode, &utf8_len);
+ buffer = PyUnicode_AsUTF8AndSize(unicode, &utf8_len);
if (buffer == NULL) {
return NULL;
}
@@ -6406,7 +6406,7 @@ static PyType_Spec HeapCTypeWithDict_spec = {
static struct PyMemberDef heapctypewithnegativedict_members[] = {
{"dictobj", T_OBJECT, offsetof(HeapCTypeWithDictObject, dict)},
- {"__dictoffset__", T_PYSSIZET, -sizeof(void*), READONLY},
+ {"__dictoffset__", T_PYSSIZET, -(Py_ssize_t)sizeof(void*), READONLY},
{NULL} /* Sentinel */
};