Fix warning: narrowing conversion of 'img->vpx_image::d_w' and 'img->vpx_image::d_h' from 'unsigned int' to 'int32_t {aka int}' inside { } is ill-formed in C++11 [-Wnarrowing]

git-svn-id: https://svn.eduke32.com/eduke32@5257 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2015-05-27 08:48:07 +00:00
parent f4aca6df5d
commit ea82c1d897
2 changed files with 10 additions and 6 deletions

View file

@ -650,6 +650,10 @@ typedef struct {
int32_t x, y;
} vec2_t;
typedef struct {
uint32_t x, y;
} vec2u_t;
typedef struct {
int32_t x, y, z;
} vec3_t;

View file

@ -308,15 +308,15 @@ read_ivf_frame:
if (glinfo.glsl) /*** 3 planes --> packed conversion ***/
{
const vec2_t dim = { img->d_w, img->d_h };
vec2u_t const dim = { img->d_w, img->d_h };
for (int y = 0; y < dim.y; y += 2)
for (unsigned int y = 0; y < dim.y; y += 2)
{
int const y1 = y + 1;
int const wy = dim.x * y;
int const wy1 = dim.x * y1;
unsigned int const y1 = y + 1;
unsigned int const wy = dim.x * y;
unsigned int const wy1 = dim.x * y1;
for (int x = 0; x < dim.x; x += 2)
for (unsigned int x = 0; x < dim.x; x += 2)
{
uint8_t u = uplane[ustride * (y >> 1) + (x >> 1)];
uint8_t v = vplane[vstride * (y >> 1) + (x >> 1)];