From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 12 Jun 2019 10:14:43 +0000 (-0700) Subject: bpo-26219: Fix compiler warning in _PyCode_InitOpcache() (GH-13997) (GH-14000) X-Git-Tag: v3.8.0b2~159 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=996e52623af3854552d41751e0c2522bc0a7e84f;p=python bpo-26219: Fix compiler warning in _PyCode_InitOpcache() (GH-13997) (GH-14000) Fix MSVC warning: objects\codeobject.c(285): warning C4244: '=': conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data (cherry picked from commit 376ce9852eec4e97745c723f0dd0fe64383c6cd3) Co-authored-by: Victor Stinner --- diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 63ce479359..1333cc833e 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -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; }