mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
vega: add some casts to silence MSVC warnings
This commit is contained in:
parent
4d452f1988
commit
21f8729c3d
2 changed files with 11 additions and 11 deletions
|
|
@ -273,7 +273,7 @@ void vegaColorMatrix(VGImage dst, VGImage src,
|
|||
|
||||
static VGfloat texture_offset(VGfloat width, VGint kernelSize, VGint current, VGint shift)
|
||||
{
|
||||
VGfloat diff = current - shift;
|
||||
VGfloat diff = (VGfloat) (current - shift);
|
||||
|
||||
return diff / width;
|
||||
}
|
||||
|
|
@ -336,7 +336,7 @@ void vegaConvolve(VGImage dst, VGImage src,
|
|||
buffer[2] = 2.f; /*unused*/
|
||||
buffer[3] = 4.f; /*unused*/
|
||||
|
||||
buffer[4] = kernelWidth * kernelHeight;
|
||||
buffer[4] = (VGfloat) (kernelWidth * kernelHeight);
|
||||
buffer[5] = scale;
|
||||
buffer[6] = bias;
|
||||
buffer[7] = 0.f;
|
||||
|
|
@ -347,8 +347,8 @@ void vegaConvolve(VGImage dst, VGImage src,
|
|||
VGint index = j * kernelWidth + i;
|
||||
VGfloat x, y;
|
||||
|
||||
x = texture_offset(s->width, kernelWidth, i, shiftX);
|
||||
y = texture_offset(s->height, kernelHeight, j, shiftY);
|
||||
x = (VGfloat) texture_offset(s->width, kernelWidth, i, shiftX);
|
||||
y = (VGfloat) texture_offset(s->height, kernelHeight, j, shiftY);
|
||||
|
||||
buffer[idx + index*4 + 0] = x;
|
||||
buffer[idx + index*4 + 1] = y;
|
||||
|
|
|
|||
|
|
@ -221,9 +221,9 @@ static INLINE void matrix_rotate(struct matrix *dst,
|
|||
else if (floatsEqual(angle, 180))
|
||||
cos_val = -1.f;
|
||||
else {
|
||||
float radians = DEGREES_TO_RADIANS(angle);
|
||||
sin_val = sin(radians);
|
||||
cos_val = cos(radians);
|
||||
double radians = DEGREES_TO_RADIANS(angle);
|
||||
sin_val = (float) sin(radians);
|
||||
cos_val = (float) cos(radians);
|
||||
}
|
||||
|
||||
if (!matrix_is_affine(dst)) {
|
||||
|
|
@ -410,7 +410,7 @@ static INLINE void line_normalize(float *l)
|
|||
{
|
||||
float x = l[2] - l[0];
|
||||
float y = l[3] - l[1];
|
||||
float len = sqrt(x*x + y*y);
|
||||
float len = (float) sqrt(x*x + y*y);
|
||||
l[2] = l[0] + x/len;
|
||||
l[3] = l[1] + y/len;
|
||||
}
|
||||
|
|
@ -420,14 +420,14 @@ static INLINE VGfloat line_length(VGfloat x1, VGfloat y1,
|
|||
{
|
||||
VGfloat x = x2 - x1;
|
||||
VGfloat y = y2 - y1;
|
||||
return sqrt(x*x + y*y);
|
||||
return (VGfloat) sqrt(x*x + y*y);
|
||||
}
|
||||
|
||||
static INLINE VGfloat line_lengthv(const VGfloat *l)
|
||||
{
|
||||
VGfloat x = l[2] - l[0];
|
||||
VGfloat y = l[3] - l[1];
|
||||
return sqrt(x*x + y*y);
|
||||
return (VGfloat) sqrt(x*x + y*y);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -442,7 +442,7 @@ static INLINE void line_point_at(float *l, float t, float *pt)
|
|||
|
||||
static INLINE void vector_unit(float *vec)
|
||||
{
|
||||
float len = sqrt(vec[0] * vec[0] + vec[1] * vec[1]);
|
||||
float len = (float) sqrt(vec[0] * vec[0] + vec[1] * vec[1]);
|
||||
vec[0] /= len;
|
||||
vec[1] /= len;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue