]> granicus.if.org Git - python/commitdiff
bpo-38321: Fix PyCStructUnionType_update_stgdict() warning (GH-16492)
authorVictor Stinner <vstinner@redhat.com>
Mon, 30 Sep 2019 15:49:48 +0000 (17:49 +0200)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Mon, 30 Sep 2019 15:49:47 +0000 (16:49 +0100)
bpo-22273, bpo-38321: Fix following warning:

    modules\_ctypes\stgdict.c(704):
    warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data

Modules/_ctypes/stgdict.c

index 947e9c25592fbde0615a7c9b5d353eb1126cb234..b794f10a2cb711fa39816438236d535f886c04fe 100644 (file)
@@ -701,7 +701,7 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
                 assert(actual_type_index <= MAX_ELEMENTS);
             }
             else {
-                int length = dict->length;
+                Py_ssize_t length = dict->length;
                 StgDictObject *edict;
 
                 edict = PyType_stgdict(dict->proto);