summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2023-10-19 20:26:26 +0600
committersfan5 <sfan5@live.de>2023-10-20 21:31:09 +0200
commitd05ef7fdc4eb527a940a1ec7449e8c5bf60f5862 (patch)
tree49a5e8f5bd1c07d890c8944728ee4985b68686f7
parent450a69b1d6592d8bc45c28250b86ba4a8b1d8e54 (diff)
downloadmpv-d05ef7fdc4eb527a940a1ec7449e8c5bf60f5862.tar.bz2
mpv-d05ef7fdc4eb527a940a1ec7449e8c5bf60f5862.tar.xz
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.
-rw-r--r--audio/out/ao_coreaudio_exclusive.c3
-rw-r--r--audio/out/ao_jack.c2
-rw-r--r--audio/out/ao_wasapi.h3
-rw-r--r--audio/out/internal.h4
-rw-r--r--common/msg.c10
-rw-r--r--common/stats.c2
-rw-r--r--demux/demux.c10
-rw-r--r--filters/f_async_queue.c2
-rw-r--r--filters/filter.c2
-rw-r--r--misc/thread_tools.c4
-rw-r--r--options/m_config_core.c12
-rw-r--r--options/m_config_frontend.c12
-rw-r--r--options/m_config_frontend.h4
-rw-r--r--osdep/windows_utils.c4
-rw-r--r--player/client.c10
-rw-r--r--player/core.h3
-rw-r--r--sub/osd_state.h2
-rw-r--r--video/out/cocoa_common.m3
-rw-r--r--video/out/dr_helper.c4
-rw-r--r--video/out/opengl/context_rpi.c4
-rw-r--r--video/out/vo.c10
-rw-r--r--video/out/vo_libmpv.c12
-rw-r--r--video/out/w32_common.c7
-rw-r--r--video/out/win32/droptarget.c2
-rw-r--r--video/out/x11_common.h5
25 files changed, 70 insertions, 66 deletions
diff --git a/audio/out/ao_coreaudio_exclusive.c b/audio/out/ao_coreaudio_exclusive.c
index ccd8a7d3d0..e24f791574 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 <stdatomic.h>
+
#include <CoreAudio/HostTime.h>
#include <libavutil/intreadwrite.h>
@@ -43,7 +45,6 @@
#include "internal.h"
#include "audio/format.h"
#include "osdep/timer.h"
-#include <stdatomic.h>
#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 5795e2b224..412e91d626 100644
--- a/audio/out/ao_jack.c
+++ b/audio/out/ao_jack.c
@@ -22,6 +22,7 @@
* with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <stdatomic.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -33,7 +34,6 @@
#include "ao.h"
#include "internal.h"
#include "audio/format.h"
-#include <stdatomic.h>
#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 58840f169d..17b8f7a6d7 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 <stdatomic.h>
#include <stdlib.h>
#include <stdbool.h>
+
#include <windows.h>
#include <mmdeviceapi.h>
#include <audioclient.h>
@@ -29,7 +31,6 @@
#include <endpointvolume.h>
#include "common/msg.h"
-#include <stdatomic.h>
#include "osdep/windows_utils.h"
#include "internal.h"
#include "ao.h"
diff --git a/audio/out/internal.h b/audio/out/internal.h
index 646132634b..182b2cbc93 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 <stdbool.h>
#include <pthread.h>
-
#include <stdatomic.h>
+#include <stdbool.h>
+
#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 c2ec9e26ee..f80df373ef 100644
--- a/common/msg.c
+++ b/common/msg.c
@@ -15,19 +15,19 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <assert.h>
+#include <pthread.h>
+#include <stdarg.h>
+#include <stdatomic.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
-#include <stdarg.h>
#include <string.h>
#include <unistd.h>
-#include <assert.h>
-#include <pthread.h>
-#include <stdint.h>
#include "mpv_talloc.h"
#include "misc/bstr.h"
-#include <stdatomic.h>
#include "common/common.h"
#include "common/global.h"
#include "misc/bstr.h"
diff --git a/common/stats.c b/common/stats.c
index 2336d80c75..50984c2719 100644
--- a/common/stats.c
+++ b/common/stats.c
@@ -1,4 +1,5 @@
#include <pthread.h>
+#include <stdatomic.h>
#include <time.h>
#include <unistd.h>
@@ -8,7 +9,6 @@
#include "misc/node.h"
#include "msg.h"
#include "options/m_option.h"
-#include <stdatomic.h>
#include "osdep/timer.h"
#include "stats.h"
diff --git a/demux/demux.c b/demux/demux.c
index 2efbef270e..e28c45b079 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -15,15 +15,16 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <assert.h>
#include <float.h>
+#include <limits.h>
+#include <pthread.h>
+#include <stdatomic.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <assert.h>
#include <unistd.h>
-#include <limits.h>
-#include <pthread.h>
-#include <stdint.h>
#include <math.h>
@@ -42,7 +43,6 @@
#include "common/stats.h"
#include "misc/charset_conv.h"
#include "misc/thread_tools.h"
-#include <stdatomic.h>
#include "osdep/timer.h"
#include "osdep/threads.h"
diff --git a/filters/f_async_queue.c b/filters/f_async_queue.c
index 80c330524a..d7df39c13f 100644
--- a/filters/f_async_queue.c
+++ b/filters/f_async_queue.c
@@ -1,10 +1,10 @@
#include <limits.h>
#include <pthread.h>
+#include <stdatomic.h>
#include "audio/aframe.h"
#include "common/common.h"
#include "common/msg.h"
-#include <stdatomic.h>
#include "f_async_queue.h"
#include "filter_internal.h"
diff --git a/filters/filter.c b/filters/filter.c
index c3d8bc059c..c386401c9f 100644
--- a/filters/filter.c
+++ b/filters/filter.c
@@ -1,12 +1,12 @@
#include <math.h>
#include <pthread.h>
+#include <stdatomic.h>
#include <libavutil/hwcontext.h>
#include "common/common.h"
#include "common/global.h"
#include "common/msg.h"
-#include <stdatomic.h>
#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 d75a37be78..b12ec4d603 100644
--- a/misc/thread_tools.c
+++ b/misc/thread_tools.c
@@ -14,10 +14,11 @@
*/
#include <assert.h>
+#include <errno.h>
+#include <stdatomic.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
-#include <errno.h>
#ifdef __MINGW32__
#include <windows.h>
@@ -27,7 +28,6 @@
#include "common/common.h"
#include "misc/linked_list.h"
-#include <stdatomic.h>
#include "osdep/io.h"
#include "osdep/timer.h"
diff --git a/options/m_config_core.c b/options/m_config_core.c
index 3357d31ee6..6a7b0a065f 100644
--- a/options/m_config_core.c
+++ b/options/m_config_core.c
@@ -15,14 +15,15 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdlib.h>
-#include <stdio.h>
+#include <assert.h>
#include <errno.h>
+#include <pthread.h>
+#include <stdatomic.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <strings.h>
-#include <assert.h>
-#include <stdbool.h>
-#include <pthread.h>
#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 <stdatomic.h>
// 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 032f54803b..44cb9fd834 100644
--- a/options/m_config_frontend.c
+++ b/options/m_config_frontend.c
@@ -15,15 +15,16 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <assert.h>
+#include <errno.h>
#include <float.h>
-#include <stdlib.h>
+#include <pthread.h>
+#include <stdatomic.h>
+#include <stdbool.h>
#include <stdio.h>
-#include <errno.h>
+#include <stdlib.h>
#include <string.h>
#include <strings.h>
-#include <assert.h>
-#include <stdbool.h>
-#include <pthread.h>
#include "libmpv/client.h"
@@ -36,7 +37,6 @@
#include "common/msg_control.h"
#include "misc/dispatch.h"
#include "misc/node.h"
-#include <stdatomic.h>
extern const char mp_help_text[];
diff --git a/options/m_config_frontend.h b/options/m_config_frontend.h
index 3f0b25a5b2..6108d9feec 100644
--- a/options/m_config_frontend.h
+++ b/options/m_config_frontend.h
@@ -17,9 +17,10 @@
#pragma once
+#include <stdatomic.h>
+#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
-#include <stdbool.h>
#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 <stdatomic.h>
// 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/osdep/windows_utils.c b/osdep/windows_utils.c
index b83a7ced9c..8cedf939e2 100644
--- a/osdep/windows_utils.c
+++ b/osdep/windows_utils.c
@@ -15,8 +15,9 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdio.h>
#include <inttypes.h>
+#include <stdatomic.h>
+#include <stdio.h>
#include <windows.h>
#include <errors.h>
@@ -25,7 +26,6 @@
#include <dxgi1_2.h>
#include "common/common.h"
-#include <stdatomic.h>
#include "windows_utils.h"
char *mp_GUID_to_str_buf(char *buf, size_t buf_size, const GUID *guid)
diff --git a/player/client.c b/player/client.c
index 5c98938ce3..176d49ef75 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 <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <math.h>
+#include <stdatomic.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <math.h>
-#include <assert.h>
#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 <stdatomic.h>
#include "osdep/threads.h"
#include "osdep/timer.h"
#include "osdep/io.h"
diff --git a/player/core.h b/player/core.h
index 12105c3da5..70692a0c86 100644
--- a/player/core.h
+++ b/player/core.h
@@ -19,9 +19,8 @@
#define MPLAYER_MP_CORE_H
#include <pthread.h>
-#include <stdbool.h>
-
#include <stdatomic.h>
+#include <stdbool.h>
#include "libmpv/client.h"
diff --git a/sub/osd_state.h b/sub/osd_state.h
index 1f4e58b8f6..79f7b902d8 100644
--- a/sub/osd_state.h
+++ b/sub/osd_state.h
@@ -2,8 +2,8 @@
#define MP_OSD_STATE_H_
#include <pthread.h>
-
#include <stdatomic.h>
+
#include "osd.h"
enum mp_osdtype {
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m
index 6b6fe4ccb6..d670a7c1c3 100644
--- a/video/out/cocoa_common.m
+++ b/video/out/cocoa_common.m
@@ -17,6 +17,8 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <stdatomic.h>
+
#import <Cocoa/Cocoa.h>
#import <IOKit/pwr_mgt/IOPMLib.h>
#import <IOKit/IOKitLib.h>
@@ -30,7 +32,6 @@
#import "video/out/cocoa/mpvadapter.h"
#include "osdep/threads.h"
-#include <stdatomic.h>
#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 a381923526..862705369d 100644
--- a/video/out/dr_helper.c
+++ b/video/out/dr_helper.c
@@ -1,12 +1,12 @@
-#include <stdlib.h>
#include <assert.h>
#include <pthread.h>
+#include <stdatomic.h>
+#include <stdlib.h>
#include <libavutil/buffer.h>
#include "mpv_talloc.h"
#include "misc/dispatch.h"
-#include <stdatomic.h>
#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 815c3aa11f..0b6babbd1f 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 <http://www.gnu.org/licenses/>.
*/
-#include <stddef.h>
#include <assert.h>
+#include <stdatomic.h>
+#include <stddef.h>
#include <bcm_host.h>
@@ -24,7 +25,6 @@
#include <EGL/eglext.h>
#include "common/common.h"
-#include <stdatomic.h>
#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 fd2ccf9e17..445a6c3a0c 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -15,18 +15,18 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <assert.h>
+#include <math.h>
+#include <pthread.h>
+#include <stdatomic.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <assert.h>
-#include <stdbool.h>
-#include <pthread.h>
-#include <math.h>
#include "mpv_talloc.h"
#include "config.h"
-#include <stdatomic.h>
#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 1af1fc72f0..c084ad6768 100644
--- a/video/out/vo_libmpv.c
+++ b/video/out/vo_libmpv.c
@@ -1,11 +1,12 @@
+#include <assert.h>
+#include <limits.h>
+#include <math.h>
+#include <pthread.h>
+#include <stdatomic.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <math.h>
-#include <stdbool.h>
-#include <limits.h>
-#include <pthread.h>
-#include <assert.h>
#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 <stdatomic.h>
#include "osdep/timer.h"
#include "common/global.h"
diff --git a/video/out/w32_common.c b/video/out/w32_common.c
index be9c5d250d..f58149e3c9 100644
--- a/video/out/w32_common.c
+++ b/video/out/w32_common.c
@@ -15,10 +15,12 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdio.h>
+#include <assert.h>
#include <limits.h>
#include <pthread.h>
-#include <assert.h>
+#include <stdatomic.h>
+#include <stdio.h>
+
#include <windows.h>
#include <windowsx.h>
#include <dwmapi.h>
@@ -42,7 +44,6 @@
#include "osdep/io.h"
#include "osdep/threads.h"
#include "osdep/w32_keyboard.h"
-#include <stdatomic.h>
#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 67864cdc61..8a33522df0 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 <http://www.gnu.org/licenses/>.
*/
+#include <stdatomic.h>
#include <windows.h>
#include <ole2.h>
@@ -23,7 +24,6 @@
#include "common/common.h"
#include "input/input.h"
#include "input/event.h"
-#include <stdatomic.h>
#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 cf92de58f8..62a96d7043 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 <stdint.h>
+#include <stdatomic.h>
#include <stdbool.h>
+#include <stdint.h>
+
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "common/common.h"
-#include <stdatomic.h>
#include "config.h"
#if !HAVE_GPL