static VGfloat texture_offset(VGfloat width, VGint kernelSize, VGint current, VGint shift)
{
- VGfloat diff = current - shift;
+ VGfloat diff = (VGfloat) (current - shift);
return diff / width;
}
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;
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;
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)) {
{
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;
}
{
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);
}
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;
}