From c4a5c17fa1a361e66944ecf110e9259da2c41942 Mon Sep 17 00:00:00 2001 From: NRK Date: Thu, 19 Oct 2023 20:26:26 +0600 Subject: [PATCH] various: sort some standard headers since i was going to fix the include order of stdatomic, might as well sort the surrouding includes in accordance with the project's coding style. some headers can sometime require specific include order. standard library headers usually don't. but mpv might "hack into" the standard headers (e.g pthreads) so that complicates things a bit more. hopefully nothing breaks. if it does, the style guide is to blame. --- audio/out/ao_coreaudio_exclusive.c | 3 ++- audio/out/ao_jack.c | 2 +- audio/out/ao_wasapi.h | 3 ++- audio/out/internal.h | 4 ++-- common/msg.c | 10 +++++----- common/stats.c | 2 +- demux/demux.c | 10 +++++----- filters/f_async_queue.c | 2 +- filters/filter.c | 2 +- misc/thread_tools.c | 4 ++-- options/m_config_core.c | 12 ++++++------ options/m_config_frontend.c | 12 ++++++------ options/m_config_frontend.h | 4 ++-- player/client.c | 10 +++++----- player/core.h | 3 +-- video/out/cocoa_common.m | 3 ++- video/out/dr_helper.c | 4 ++-- video/out/opengl/context_rpi.c | 4 ++-- video/out/vo.c | 10 +++++----- video/out/vo_libmpv.c | 12 ++++++------ video/out/w32_common.c | 7 ++++--- video/out/win32/droptarget.c | 2 +- video/out/x11_common.h | 5 +++-- 23 files changed, 67 insertions(+), 63 deletions(-) diff --git a/audio/out/ao_coreaudio_exclusive.c b/audio/out/ao_coreaudio_exclusive.c index ccd8a7d3d0b2b..e24f7915743fc 100644 --- a/audio/out/ao_coreaudio_exclusive.c +++ b/audio/out/ao_coreaudio_exclusive.c @@ -34,6 +34,8 @@ * when you are wanting to do good buffering of audio). */ +#include + #include #include @@ -43,7 +45,6 @@ #include "internal.h" #include "audio/format.h" #include "osdep/timer.h" -#include #include "options/m_option.h" #include "common/msg.h" #include "audio/out/ao_coreaudio_chmap.h" diff --git a/audio/out/ao_jack.c b/audio/out/ao_jack.c index 5795e2b224c73..412e91d6266da 100644 --- a/audio/out/ao_jack.c +++ b/audio/out/ao_jack.c @@ -22,6 +22,7 @@ * with mpv. If not, see . */ +#include #include #include #include @@ -33,7 +34,6 @@ #include "ao.h" #include "internal.h" #include "audio/format.h" -#include #include "osdep/timer.h" #include "options/m_config.h" #include "options/m_option.h" diff --git a/audio/out/ao_wasapi.h b/audio/out/ao_wasapi.h index 58840f169ddd4..17b8f7a6d7c2f 100644 --- a/audio/out/ao_wasapi.h +++ b/audio/out/ao_wasapi.h @@ -20,8 +20,10 @@ #ifndef MP_AO_WASAPI_H_ #define MP_AO_WASAPI_H_ +#include #include #include + #include #include #include @@ -29,7 +31,6 @@ #include #include "common/msg.h" -#include #include "osdep/windows_utils.h" #include "internal.h" #include "ao.h" diff --git a/audio/out/internal.h b/audio/out/internal.h index 646132634b8bb..182b2cbc936fc 100644 --- a/audio/out/internal.h +++ b/audio/out/internal.h @@ -18,10 +18,10 @@ #ifndef MP_AO_INTERNAL_H_ #define MP_AO_INTERNAL_H_ -#include #include - #include +#include + #include "audio/out/ao.h" /* global data used by ao.c and ao drivers */ diff --git a/common/msg.c b/common/msg.c index c2ec9e26ee282..f80df373efeff 100644 --- a/common/msg.c +++ b/common/msg.c @@ -15,19 +15,19 @@ * License along with mpv. If not, see . */ +#include +#include +#include +#include +#include #include #include -#include #include #include -#include -#include -#include #include "mpv_talloc.h" #include "misc/bstr.h" -#include #include "common/common.h" #include "common/global.h" #include "misc/bstr.h" diff --git a/common/stats.c b/common/stats.c index 2336d80c7514b..50984c27199ab 100644 --- a/common/stats.c +++ b/common/stats.c @@ -1,4 +1,5 @@ #include +#include #include #include @@ -8,7 +9,6 @@ #include "misc/node.h" #include "msg.h" #include "options/m_option.h" -#include #include "osdep/timer.h" #include "stats.h" diff --git a/demux/demux.c b/demux/demux.c index 2efbef270ee21..e28c45b079651 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -15,15 +15,16 @@ * License along with mpv. If not, see . */ +#include #include +#include +#include +#include +#include #include #include #include -#include #include -#include -#include -#include #include @@ -42,7 +43,6 @@ #include "common/stats.h" #include "misc/charset_conv.h" #include "misc/thread_tools.h" -#include #include "osdep/timer.h" #include "osdep/threads.h" diff --git a/filters/f_async_queue.c b/filters/f_async_queue.c index 80c330524a791..d7df39c13f0cb 100644 --- a/filters/f_async_queue.c +++ b/filters/f_async_queue.c @@ -1,10 +1,10 @@ #include #include +#include #include "audio/aframe.h" #include "common/common.h" #include "common/msg.h" -#include #include "f_async_queue.h" #include "filter_internal.h" diff --git a/filters/filter.c b/filters/filter.c index c3d8bc059cba4..c386401c9f06d 100644 --- a/filters/filter.c +++ b/filters/filter.c @@ -1,12 +1,12 @@ #include #include +#include #include #include "common/common.h" #include "common/global.h" #include "common/msg.h" -#include #include "osdep/timer.h" #include "video/hwdec.h" #include "video/img_format.h" diff --git a/misc/thread_tools.c b/misc/thread_tools.c index d75a37be78039..b12ec4d603268 100644 --- a/misc/thread_tools.c +++ b/misc/thread_tools.c @@ -14,10 +14,11 @@ */ #include +#include +#include #include #include #include -#include #ifdef __MINGW32__ #include @@ -27,7 +28,6 @@ #include "common/common.h" #include "misc/linked_list.h" -#include #include "osdep/io.h" #include "osdep/timer.h" diff --git a/options/m_config_core.c b/options/m_config_core.c index 3357d31ee6bae..6a7b0a065f85c 100644 --- a/options/m_config_core.c +++ b/options/m_config_core.c @@ -15,14 +15,15 @@ * License along with mpv. If not, see . */ -#include -#include +#include #include +#include +#include +#include +#include +#include #include #include -#include -#include -#include #include "m_config_core.h" #include "options/m_option.h" @@ -31,7 +32,6 @@ #include "common/msg.h" #include "common/msg_control.h" #include "misc/dispatch.h" -#include // For use with m_config_cache. struct m_config_shadow { diff --git a/options/m_config_frontend.c b/options/m_config_frontend.c index 032f54803b426..44cb9fd834efa 100644 --- a/options/m_config_frontend.c +++ b/options/m_config_frontend.c @@ -15,15 +15,16 @@ * License along with mpv. If not, see . */ +#include +#include #include -#include +#include +#include +#include #include -#include +#include #include #include -#include -#include -#include #include "libmpv/client.h" @@ -36,7 +37,6 @@ #include "common/msg_control.h" #include "misc/dispatch.h" #include "misc/node.h" -#include extern const char mp_help_text[]; diff --git a/options/m_config_frontend.h b/options/m_config_frontend.h index 3f0b25a5b272f..6108d9feeccc2 100644 --- a/options/m_config_frontend.h +++ b/options/m_config_frontend.h @@ -17,9 +17,10 @@ #pragma once +#include +#include #include #include -#include #include "common/common.h" #include "common/global.h" @@ -29,7 +30,6 @@ #include "misc/bstr.h" #include "misc/dispatch.h" #include "options/m_option.h" -#include // m_config provides an API to manipulate the config variables in MPlayer. // It makes use of the Options API to provide a context stack that diff --git a/player/client.c b/player/client.c index 5c98938ce3de1..176d49ef75070 100644 --- a/player/client.c +++ b/player/client.c @@ -13,14 +13,15 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include +#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include #include "common/common.h" #include "common/global.h" @@ -39,7 +40,6 @@ #include "options/m_property.h" #include "options/path.h" #include "options/parse_configfile.h" -#include #include "osdep/threads.h" #include "osdep/timer.h" #include "osdep/io.h" diff --git a/player/core.h b/player/core.h index 12105c3da542f..70692a0c867e6 100644 --- a/player/core.h +++ b/player/core.h @@ -19,9 +19,8 @@ #define MPLAYER_MP_CORE_H #include -#include - #include +#include #include "libmpv/client.h" diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index 6b6fe4ccb60e4..d670a7c1c3edf 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -17,6 +17,8 @@ * License along with mpv. If not, see . */ +#include + #import #import #import @@ -30,7 +32,6 @@ #import "video/out/cocoa/mpvadapter.h" #include "osdep/threads.h" -#include #include "osdep/macosx_compat.h" #include "osdep/macosx_events_objc.h" diff --git a/video/out/dr_helper.c b/video/out/dr_helper.c index a381923526135..862705369db1f 100644 --- a/video/out/dr_helper.c +++ b/video/out/dr_helper.c @@ -1,12 +1,12 @@ -#include #include #include +#include +#include #include #include "mpv_talloc.h" #include "misc/dispatch.h" -#include #include "video/mp_image.h" #include "dr_helper.h" diff --git a/video/out/opengl/context_rpi.c b/video/out/opengl/context_rpi.c index 815c3aa11fb84..0b6babbd1f7eb 100644 --- a/video/out/opengl/context_rpi.c +++ b/video/out/opengl/context_rpi.c @@ -15,8 +15,9 @@ * License along with mpv. If not, see . */ -#include #include +#include +#include #include @@ -24,7 +25,6 @@ #include #include "common/common.h" -#include #include "video/out/win_state.h" #include "context.h" #include "egl_helpers.h" diff --git a/video/out/vo.c b/video/out/vo.c index fd2ccf9e1709b..445a6c3a0ceac 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -15,18 +15,18 @@ * License along with mpv. If not, see . */ +#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include #include "mpv_talloc.h" #include "config.h" -#include #include "osdep/timer.h" #include "osdep/threads.h" #include "misc/dispatch.h" diff --git a/video/out/vo_libmpv.c b/video/out/vo_libmpv.c index 1af1fc72f0cdb..c084ad6768e06 100644 --- a/video/out/vo_libmpv.c +++ b/video/out/vo_libmpv.c @@ -1,11 +1,12 @@ +#include +#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include #include "mpv_talloc.h" #include "common/common.h" @@ -19,7 +20,6 @@ #include "vo.h" #include "video/mp_image.h" #include "sub/osd.h" -#include #include "osdep/timer.h" #include "common/global.h" diff --git a/video/out/w32_common.c b/video/out/w32_common.c index be9c5d250d3f4..f58149e3c9f13 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -15,10 +15,12 @@ * License along with mpv. If not, see . */ -#include +#include #include #include -#include +#include +#include + #include #include #include @@ -42,7 +44,6 @@ #include "osdep/io.h" #include "osdep/threads.h" #include "osdep/w32_keyboard.h" -#include #include "misc/dispatch.h" #include "misc/rendezvous.h" #include "mpv_talloc.h" diff --git a/video/out/win32/droptarget.c b/video/out/win32/droptarget.c index 67864cdc6167d..8a33522df0384 100644 --- a/video/out/win32/droptarget.c +++ b/video/out/win32/droptarget.c @@ -14,6 +14,7 @@ * You should have received a copy of the GNU Lesser General Public * License along with mpv. If not, see . */ +#include #include #include @@ -23,7 +24,6 @@ #include "common/common.h" #include "input/input.h" #include "input/event.h" -#include #include "osdep/io.h" #include "osdep/windows_utils.h" #include "mpv_talloc.h" diff --git a/video/out/x11_common.h b/video/out/x11_common.h index cf92de58f81c3..62a96d7043a0d 100644 --- a/video/out/x11_common.h +++ b/video/out/x11_common.h @@ -18,13 +18,14 @@ #ifndef MPLAYER_X11_COMMON_H #define MPLAYER_X11_COMMON_H -#include +#include #include +#include + #include #include #include "common/common.h" -#include #include "config.h" #if !HAVE_GPL