]> granicus.if.org Git - php/commitdiff
Remove unused variables and functions
authorChristoph M. Becker <cmbecker69@gmx.de>
Thu, 10 Jan 2019 17:00:27 +0000 (18:00 +0100)
committerChristoph M. Becker <cmbecker69@gmx.de>
Thu, 10 Jan 2019 17:00:27 +0000 (18:00 +0100)
We remove the unused variables altogether, and port
libgd/libgd@f50c24e467f1f44f0ede90bc7d2d8eaadbe11094 to silence the
compiler warnings.

ext/gd/libgd/gd_interpolation.c

index 86549a279d533dafb8a3a87f4aed8f434f3fd00a..138d2bf3b248e308440a68f44e7657768b064512 100644 (file)
@@ -366,6 +366,7 @@ static double filter_generalized_cubic(const double t)
        return 0;
 }
 
+#ifdef FUNCTION_NOT_USED_YET
 /* CubicSpline filter, default radius 2 */
 static double filter_cubic_spline(const double x1)
 {
@@ -381,7 +382,9 @@ static double filter_cubic_spline(const double x1)
        }
        return 0;
 }
+#endif
 
+#ifdef FUNCTION_NOT_USED_YET
 /* CubicConvolution filter, default radius 3 */
 static double filter_cubic_convolution(const double x1)
 {
@@ -394,6 +397,7 @@ static double filter_cubic_convolution(const double x1)
        if (x <= 3.0) return ( (1.0/12.0) * x2_x - (2.0 / 3.0) * x2 + 1.75 * x - 1.5);
        return 0;
 }
+#endif
 
 static double filter_box(double x) {
        if (x < - DEFAULT_FILTER_BOX)
@@ -418,6 +422,7 @@ static double filter_catmullrom(const double x)
        return(0.0f);
 }
 
+#ifdef FUNCTION_NOT_USED_YET
 static double filter_filter(double t)
 {
        /* f(t) = 2|t|^3 - 3|t|^2 + 1, -1 <= t <= 1 */
@@ -425,8 +430,9 @@ static double filter_filter(double t)
        if(t < 1.0) return((2.0 * t - 3.0) * t * t + 1.0);
        return(0.0);
 }
+#endif
 
-
+#ifdef FUNCTION_NOT_USED_YET
 /* Lanczos8 filter, default radius 8 */
 static double filter_lanczos8(const double x1)
 {
@@ -441,8 +447,9 @@ static double filter_lanczos8(const double x1)
        return 0.0;
 #undef R
 }
+#endif
 
-
+#ifdef FUNCTION_NOT_USED_YET
 /* Lanczos3 filter, default radius 3 */
 static double filter_lanczos3(const double x1)
 {
@@ -458,6 +465,7 @@ static double filter_lanczos3(const double x1)
        return 0.0;
 #undef R
 }
+#endif
 
 /* Hermite filter, default radius 1 */
 static double filter_hermite(const double x1)
@@ -515,6 +523,7 @@ static double filter_mitchell(const double x)
 
 
 
+#ifdef FUNCTION_NOT_USED_YET
 /* Cosine filter, default radius 1 */
 static double filter_cosine(const double x)
 {
@@ -522,6 +531,7 @@ static double filter_cosine(const double x)
 
        return 0;
 }
+#endif
 
 /* Quadratic filter, default radius 1.5 */
 static double filter_quadratic(const double x1)
@@ -553,6 +563,7 @@ static double filter_bspline(const double x)
        }
 }
 
+#ifdef FUNCTION_NOT_USED_YET
 /* QuadraticBSpline filter, default radius 1.5 */
 static double filter_quadratic_bspline(const double x1)
 {
@@ -562,6 +573,7 @@ static double filter_quadratic_bspline(const double x1)
        if (x <= 1.5) return (0.5 * x * x - 1.5 * x + 1.125);
        return 0.0;
 }
+#endif
 
 static double filter_gaussian(const double x)
 {
@@ -603,6 +615,7 @@ static double filter_sinc(const double x)
        return (sin(M_PI * (double) x) / (M_PI * (double) x));
 }
 
+#ifdef FUNCTION_NOT_USED_YET
 static double filter_welsh(const double x)
 {
        /* Welsh parabolic windowing filter */
@@ -610,7 +623,7 @@ static double filter_welsh(const double x)
                return(1 - x*x);
        return(0.0);
 }
-
+#endif
 
 /* Copied from upstream's libgd */
 static inline int _color_blend (const int dst, const int src)
@@ -1287,7 +1300,6 @@ static gdImagePtr gdImageScaleBilinearTC(gdImagePtr im, const unsigned int new_w
 
        int dst_offset_h;
        int dst_offset_v = 0;
-       int dwSrcTotalOffset;
        long i;
        gdImagePtr new_img;
 
@@ -1326,7 +1338,6 @@ static gdImagePtr gdImageScaleBilinearTC(gdImagePtr im, const unsigned int new_w
                                        f_g1, f_g2, f_g3, f_g4,
                                        f_b1, f_b2, f_b3, f_b4,
                                        f_a1, f_a2, f_a3, f_a4;
-                       dwSrcTotalOffset = m + n;
                        /* 0 for bgColor; (n,m) is supposed to be valid anyway */
                        pixel1 = getPixelOverflowTC(im, n, m, 0);
                        pixel2 = getPixelOverflowTC(im, n + 1, m, pixel1);
@@ -2352,12 +2363,10 @@ int gdTransformAffineCopy(gdImagePtr dst,
        gdRect bbox;
        int end_x, end_y;
        gdInterpolationMethod interpolation_id_bak = GD_DEFAULT;
-       interpolation_method interpolation_bak;
 
        /* These methods use special implementations */
        if (src->interpolation_id == GD_BILINEAR_FIXED || src->interpolation_id == GD_BICUBIC_FIXED || src->interpolation_id == GD_NEAREST_NEIGHBOUR) {
                interpolation_id_bak = src->interpolation_id;
-               interpolation_bak = src->interpolation;
 
                gdImageSetInterpolationMethod(src, GD_BICUBIC);
        }