]> granicus.if.org Git - python/commitdiff
bpo-26219: Fix compiler warning in _PyCode_InitOpcache() (GH-13997)
authorVictor Stinner <vstinner@redhat.com>
Wed, 12 Jun 2019 02:41:16 +0000 (04:41 +0200)
committerGitHub <noreply@github.com>
Wed, 12 Jun 2019 02:41:16 +0000 (04:41 +0200)
Fix MSVC warning:

    objects\codeobject.c(285): warning C4244: '=':
    conversion from 'Py_ssize_t' to 'unsigned char',
    possible loss of data

Objects/codeobject.c

index 63ce4793597a134d5c36499e1c4a4af0f1b4f8ca..1333cc833e1e4b5194877ee11b4f8274248f5b18 100644 (file)
@@ -282,7 +282,7 @@ _PyCode_InitOpcache(PyCodeObject *co)
         co->co_opcache = NULL;
     }
 
-    co->co_opcache_size = opts;
+    co->co_opcache_size = (unsigned char)opts;
     return 0;
 }