From 730a9435ca5fbf958abe6bd9395612cdd037e106 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 23 Feb 2024 00:18:42 -0500 Subject: [PATCH] Clean up headers in extensions Either remove unused, or switch to more specific ones. --- src/_backend_agg.cpp | 1 - src/_backend_agg.h | 5 ++--- src/_backend_agg_basic_types.h | 1 + src/_image_resample.h | 1 - src/_path.h | 1 - src/_tkagg.cpp | 4 ++-- src/_ttconv.cpp | 2 +- src/array.h | 3 +++ src/ft2font.h | 6 +++--- src/ft2font_wrapper.cpp | 2 -- src/mplutils.h | 1 - src/path_converters.h | 4 ++-- src/py_adaptors.h | 1 + 13 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/_backend_agg.cpp b/src/_backend_agg.cpp index c35f92eb8fc1..ce88f504dc1e 100644 --- a/src/_backend_agg.cpp +++ b/src/_backend_agg.cpp @@ -4,7 +4,6 @@ #include #include "_backend_agg.h" -#include "mplutils.h" RendererAgg::RendererAgg(unsigned int width, unsigned int height, double dpi) : width(width), diff --git a/src/_backend_agg.h b/src/_backend_agg.h index c191f3448144..470d459de341 100644 --- a/src/_backend_agg.h +++ b/src/_backend_agg.h @@ -7,14 +7,15 @@ #define MPL_BACKEND_AGG_H #include -#include #include #include "agg_alpha_mask_u8.h" #include "agg_conv_curve.h" #include "agg_conv_dash.h" #include "agg_conv_stroke.h" +#include "agg_conv_transform.h" #include "agg_image_accessors.h" +#include "agg_path_storage.h" #include "agg_pixfmt_amask_adaptor.h" #include "agg_pixfmt_gray.h" #include "agg_pixfmt_rgba.h" @@ -25,7 +26,6 @@ #include "agg_scanline_bin.h" #include "agg_scanline_p.h" #include "agg_scanline_storage_aa.h" -#include "agg_scanline_storage_bin.h" #include "agg_scanline_u.h" #include "agg_span_allocator.h" #include "agg_span_converter.h" @@ -34,7 +34,6 @@ #include "agg_span_image_filter_rgba.h" #include "agg_span_interpolator_linear.h" #include "agg_span_pattern_rgba.h" -#include "util/agg_color_conv_rgb8.h" #include "_backend_agg_basic_types.h" #include "path_converters.h" diff --git a/src/_backend_agg_basic_types.h b/src/_backend_agg_basic_types.h index 95c7a3ca5a3c..4fbf846d8cb4 100644 --- a/src/_backend_agg_basic_types.h +++ b/src/_backend_agg_basic_types.h @@ -8,6 +8,7 @@ #include "agg_color_rgba.h" #include "agg_math_stroke.h" +#include "agg_trans_affine.h" #include "path_converters.h" #include "py_adaptors.h" diff --git a/src/_image_resample.h b/src/_image_resample.h index 60f5e66d4539..745fe9f10cd7 100644 --- a/src/_image_resample.h +++ b/src/_image_resample.h @@ -6,7 +6,6 @@ #include "agg_image_accessors.h" #include "agg_path_storage.h" #include "agg_pixfmt_gray.h" -#include "agg_pixfmt_rgb.h" #include "agg_pixfmt_rgba.h" #include "agg_renderer_base.h" #include "agg_renderer_scanline.h" diff --git a/src/_path.h b/src/_path.h index 239a3c760221..7f17d0bc2933 100644 --- a/src/_path.h +++ b/src/_path.h @@ -14,7 +14,6 @@ #include "agg_conv_curve.h" #include "agg_conv_stroke.h" #include "agg_conv_transform.h" -#include "agg_path_storage.h" #include "agg_trans_affine.h" #include "path_converters.h" diff --git a/src/_tkagg.cpp b/src/_tkagg.cpp index 513938173326..e35502fe23ff 100644 --- a/src/_tkagg.cpp +++ b/src/_tkagg.cpp @@ -10,12 +10,10 @@ // you can get it at https://python-pillow.org/ #include -#include #include #include #include #include -#include #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN @@ -48,6 +46,8 @@ static inline PyObject *PyErr_SetFromWindowsErr(int ierr) { #endif #ifdef WIN32_DLL +#include + #include #include #define PSAPI_VERSION 1 diff --git a/src/_ttconv.cpp b/src/_ttconv.cpp index 715d46d4cf7a..a99ea9d1c891 100644 --- a/src/_ttconv.cpp +++ b/src/_ttconv.cpp @@ -5,8 +5,8 @@ Python wrapper for TrueType conversion library in ../ttconv. */ + #include -#include "mplutils.h" #include "pprdrv.h" #include diff --git a/src/array.h b/src/array.h index 6694412b8df5..97d66dd4a6d2 100644 --- a/src/array.h +++ b/src/array.h @@ -6,6 +6,9 @@ #ifndef MPL_SCALAR_H #define MPL_SCALAR_H +#include +#include + namespace array { diff --git a/src/ft2font.h b/src/ft2font.h index 6b8f05466700..66b218316e90 100644 --- a/src/ft2font.h +++ b/src/ft2font.h @@ -9,10 +9,10 @@ #define PY_SSIZE_T_CLEAN #include -#include -#include -#include +#include +#include #include +#include extern "C" { #include diff --git a/src/ft2font_wrapper.cpp b/src/ft2font_wrapper.cpp index 1b03e5406147..25b2d173f5e9 100644 --- a/src/ft2font_wrapper.cpp +++ b/src/ft2font_wrapper.cpp @@ -2,13 +2,11 @@ #include "ft2font.h" #include "py_converters.h" #include "py_exceptions.h" -#include "numpy_cpp.h" // From Python #include #include -#include static PyObject *convert_xys_to_array(std::vector &xys) { diff --git a/src/mplutils.h b/src/mplutils.h index 8c2921a1d2ff..58eb32d190ec 100644 --- a/src/mplutils.h +++ b/src/mplutils.h @@ -7,7 +7,6 @@ #define PY_SSIZE_T_CLEAN #include -#include #ifdef _POSIX_C_SOURCE # undef _POSIX_C_SOURCE diff --git a/src/path_converters.h b/src/path_converters.h index 8583d84855aa..db732e126c3f 100644 --- a/src/path_converters.h +++ b/src/path_converters.h @@ -4,8 +4,8 @@ #define MPL_PATH_CONVERTERS_H #include -#include -#include "agg_path_storage.h" +#include + #include "agg_clip_liang_barsky.h" #include "mplutils.h" #include "agg_conv_segmentator.h" diff --git a/src/py_adaptors.h b/src/py_adaptors.h index 1863cd6efbb0..b0cec6c1d004 100644 --- a/src/py_adaptors.h +++ b/src/py_adaptors.h @@ -12,6 +12,7 @@ #include "numpy/arrayobject.h" +#include "agg_basics.h" #include "py_exceptions.h" extern "C" {