From: George Peter Banyard Date: Thu, 6 Feb 2020 00:20:46 +0000 (+0100) Subject: Fix [-Wtype-limits] in bundled GD lib by using signed integers X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac89139773a456f70f460fcc5fefb90c6326b257;p=php 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 https://github.com/libgd/libgd/commit/bd6d2e101f6f1df106d1cd2e2dc8058a5538109b therefore we should also mimic upstream and remove them... Thanks to @cmb69 for pointing it out. --- diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c index 1a7cf209dc..651c92467a 100644 --- a/ext/gd/libgd/gd_interpolation.c +++ b/ext/gd/libgd/gd_interpolation.c @@ -1771,8 +1771,8 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int const gdFixed f_j = gd_itofx((int)j - (int)new_width/2); const gdFixed f_m = gd_mulfx(f_j,f_sin) + gd_mulfx(f_i,f_cos) + f_0_5 + f_H; const gdFixed f_n = gd_mulfx(f_j,f_cos) - gd_mulfx(f_i,f_sin) + f_0_5 + f_W; - const unsigned int m = gd_fxtoi(f_m); - const unsigned int n = gd_fxtoi(f_n); + const int m = gd_fxtoi(f_m); + const int n = gd_fxtoi(f_n); if ((m >= 0) && (m < src_h - 1) && (n >= 0) && (n < src_w - 1)) { const gdFixed f_f = f_m - gd_itofx(m);