Skip to content

Commit ac89139

Browse files
committed
Fix [-Wtype-limits] in bundled GD lib by using signed integers
As seen in the gdImageRotateBicubicFixed() function the same setup occurs but it uses signed integers, therefore we use also use signed integers in gdImageRotateBilinear() Moreover, these two functions have been removed upstream in libgd/libgd@bd6d2e1 therefore we should also mimic upstream and remove them... Thanks to @cmb69 for pointing it out.
1 parent 62c51fc commit ac89139

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/gd/libgd/gd_interpolation.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1771,8 +1771,8 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int
17711771
const gdFixed f_j = gd_itofx((int)j - (int)new_width/2);
17721772
const gdFixed f_m = gd_mulfx(f_j,f_sin) + gd_mulfx(f_i,f_cos) + f_0_5 + f_H;
17731773
const gdFixed f_n = gd_mulfx(f_j,f_cos) - gd_mulfx(f_i,f_sin) + f_0_5 + f_W;
1774-
const unsigned int m = gd_fxtoi(f_m);
1775-
const unsigned int n = gd_fxtoi(f_n);
1774+
const int m = gd_fxtoi(f_m);
1775+
const int n = gd_fxtoi(f_n);
17761776

17771777
if ((m >= 0) && (m < src_h - 1) && (n >= 0) && (n < src_w - 1)) {
17781778
const gdFixed f_f = f_m - gd_itofx(m);

0 commit comments

Comments
 (0)