From c3633f3de61e3b6cf982f740e8cfa8be33395439 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 27 Feb 2012 23:57:19 +0100 Subject: [PATCH] Refactor a lot more includes into common.h --- src/common/cli_parser.cpp | 2 -- src/common/cli_parser.h | 7 +------ src/common/common.h | 26 ++++++++++++++++++++++++-- src/common/compression.cpp | 2 -- src/common/fs_sys_helpers.cpp | 2 -- src/common/math.h | 2 -- src/common/mm_io.cpp | 3 --- src/common/mm_multi_file_io.cpp | 5 ----- src/common/mm_multi_file_io.h | 6 ------ src/common/output.h | 3 --- src/common/samples_timecode_conv.h | 2 -- src/common/strings/editing.cpp | 2 -- src/common/strings/editing.h | 8 +------- src/common/translation.cpp | 3 --- src/common/unique_numbers.cpp | 4 ---- src/common/vc1.cpp | 3 --- src/common/version.cpp | 2 -- src/common/webm.cpp | 3 --- src/common/wx.h | 5 +---- src/extract/extract_cli_parser.cpp | 5 ----- src/extract/xtr_ivf.cpp | 2 -- src/info/info_cli_parser.cpp | 5 ----- src/input/r_matroska.cpp | 1 - src/input/r_matroska.h | 2 -- src/input/r_mpeg_ps.h | 2 -- src/input/r_mpeg_ts.cpp | 2 -- src/input/r_mpeg_ts.h | 4 ---- src/input/r_qtmp4.cpp | 3 --- src/merge/cluster_helper.cpp | 4 ---- src/merge/output_control.cpp | 6 ------ src/merge/pr_generic.h | 1 - src/output/p_avc.cpp | 2 -- src/output/p_truehd.cpp | 3 --- src/propedit/options.cpp | 6 +----- src/propedit/propedit_cli_parser.cpp | 11 +---------- src/propedit/target.cpp | 4 ---- 36 files changed, 29 insertions(+), 124 deletions(-) diff --git a/src/common/cli_parser.cpp b/src/common/cli_parser.cpp index 0c35a819a..f720428bd 100644 --- a/src/common/cli_parser.cpp +++ b/src/common/cli_parser.cpp @@ -11,8 +11,6 @@ #include "common/common_pch.h" -#include - #include "common/cli_parser.h" #include "common/command_line.h" #include "common/strings/editing.h" diff --git a/src/common/cli_parser.h b/src/common/cli_parser.h index 8fc0dd69a..f7bffb14d 100644 --- a/src/common/cli_parser.h +++ b/src/common/cli_parser.h @@ -11,12 +11,7 @@ #ifndef __COMMON_CLI_PARSER_H #define __COMMON_CLI_PARSER_H -#include "common/os.h" - -#include -#include -#include -#include +#include "common/common_pch.h" #include "common/translation.h" diff --git a/src/common/common.h b/src/common/common.h index 124589cb1..d2fc3f825 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -18,9 +18,31 @@ #undef max #undef __STRICT_ANSI__ -#include -#include +#include +#include #include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace ba = boost::algorithm; +namespace bfs = boost::filesystem; #include "common/os.h" diff --git a/src/common/compression.cpp b/src/common/compression.cpp index a6d44de32..589d66e2f 100644 --- a/src/common/compression.cpp +++ b/src/common/compression.cpp @@ -13,8 +13,6 @@ #include "common/common_pch.h" -#include - #include #include diff --git a/src/common/fs_sys_helpers.cpp b/src/common/fs_sys_helpers.cpp index 47a711544..e2e79e143 100644 --- a/src/common/fs_sys_helpers.cpp +++ b/src/common/fs_sys_helpers.cpp @@ -152,8 +152,6 @@ get_application_data_folder() { # include # include -# include - int64_t get_current_time_millis() { struct timeval tv; diff --git a/src/common/math.h b/src/common/math.h index 8d7a2df89..8133327d7 100644 --- a/src/common/math.h +++ b/src/common/math.h @@ -16,8 +16,6 @@ #include "common/common_pch.h" -#include - #define irnd(a) ((int64_t)((double)(a) + 0.5)) #define iabs(a) ((a) < 0 ? (a) * -1 : (a)) diff --git a/src/common/mm_io.cpp b/src/common/mm_io.cpp index 8dd9d2511..3225534ec 100644 --- a/src/common/mm_io.cpp +++ b/src/common/mm_io.cpp @@ -25,9 +25,6 @@ #include #include -#include -#include - #include "common/endian.h" #include "common/error.h" #include "common/fs_sys_helpers.h" diff --git a/src/common/mm_multi_file_io.cpp b/src/common/mm_multi_file_io.cpp index 68384bdf7..4e625ca35 100644 --- a/src/common/mm_multi_file_io.cpp +++ b/src/common/mm_multi_file_io.cpp @@ -13,18 +13,13 @@ #include "common/common_pch.h" -#include -#include #include -#include #include "common/mm_multi_file_io.h" #include "common/output.h" #include "common/strings/editing.h" #include "common/strings/parsing.h" -namespace bfs = boost::filesystem; - mm_multi_file_io_c::file_t::file_t(const bfs::path &file_name, uint64_t global_start, mm_file_io_cptr file) diff --git a/src/common/mm_multi_file_io.h b/src/common/mm_multi_file_io.h index 7b70826c9..227769238 100644 --- a/src/common/mm_multi_file_io.h +++ b/src/common/mm_multi_file_io.h @@ -16,14 +16,8 @@ #include "common/common_pch.h" -#include -#include -#include - #include "common/mm_io.h" -namespace bfs = boost::filesystem; - class mm_multi_file_io_c; typedef counted_ptr mm_multi_file_io_cptr; diff --git a/src/common/output.h b/src/common/output.h index 581c7f67e..315acbc4b 100644 --- a/src/common/output.h +++ b/src/common/output.h @@ -16,9 +16,6 @@ #include "common/os.h" -#include -#include - #include #include "common/locale.h" diff --git a/src/common/samples_timecode_conv.h b/src/common/samples_timecode_conv.h index 131e19bb2..f555ca771 100644 --- a/src/common/samples_timecode_conv.h +++ b/src/common/samples_timecode_conv.h @@ -16,8 +16,6 @@ #include "common/os.h" -#include - class samples_to_timecode_converter_c { protected: int64_t m_numerator, m_denominator; diff --git a/src/common/strings/editing.cpp b/src/common/strings/editing.cpp index 947079ac0..a0e04082e 100644 --- a/src/common/strings/editing.cpp +++ b/src/common/strings/editing.cpp @@ -13,8 +13,6 @@ #include "common/common_pch.h" -#include - #include "common/memory.h" #include "common/strings/editing.h" diff --git a/src/common/strings/editing.h b/src/common/strings/editing.h index f2988b180..ff5d4d4d8 100644 --- a/src/common/strings/editing.h +++ b/src/common/strings/editing.h @@ -14,16 +14,10 @@ #ifndef __MTX_COMMON_STRINGS_H #define __MTX_COMMON_STRINGS_H -#include "common/os.h" - -#include -#include -#include +#include "common/common_pch.h" #include -namespace ba = boost::algorithm; - std::vector split(const char *src, const char *pattern = ",", int max_num = -1); inline std::vector split(const std::string &src, diff --git a/src/common/translation.cpp b/src/common/translation.cpp index 0eac6191b..482a5c0e1 100644 --- a/src/common/translation.cpp +++ b/src/common/translation.cpp @@ -13,7 +13,6 @@ #include "common/common_pch.h" -#include #if HAVE_NL_LANGINFO # include #elif HAVE_LOCALE_CHARSET @@ -31,8 +30,6 @@ #if defined(SYS_WINDOWS) # include -# include - # include "common/fs_sys_helpers.h" # include "common/memory.h" #endif diff --git a/src/common/unique_numbers.cpp b/src/common/unique_numbers.cpp index c0a718280..5094a3a55 100644 --- a/src/common/unique_numbers.cpp +++ b/src/common/unique_numbers.cpp @@ -13,10 +13,6 @@ #include "common/common_pch.h" -#include -#include -#include - #include "common/hacks.h" #include "common/random.h" #include "common/unique_numbers.h" diff --git a/src/common/vc1.cpp b/src/common/vc1.cpp index 92056a731..4ea84cf66 100644 --- a/src/common/vc1.cpp +++ b/src/common/vc1.cpp @@ -14,9 +14,6 @@ #include "common/common_pch.h" -#include -#include - #include "common/bit_cursor.h" #include "common/endian.h" #include "common/strings/formatting.h" diff --git a/src/common/version.cpp b/src/common/version.cpp index cb12e6d1a..4b02f29b1 100644 --- a/src/common/version.cpp +++ b/src/common/version.cpp @@ -13,8 +13,6 @@ #include "common/common_pch.h" -#include - #if defined(HAVE_CURL_EASY_H) # include # include diff --git a/src/common/webm.cpp b/src/common/webm.cpp index 8b3a16816..36d573f31 100644 --- a/src/common/webm.cpp +++ b/src/common/webm.cpp @@ -15,9 +15,6 @@ #include "common/webm.h" -#include -#include - bool is_webm_file_name(const std::string &file_name) { static boost::regex s_webm_file_name_re("\\.webm(?:a|v)?$", boost::regex::perl); diff --git a/src/common/wx.h b/src/common/wx.h index 585f20128..327248955 100644 --- a/src/common/wx.h +++ b/src/common/wx.h @@ -13,10 +13,7 @@ #ifndef __MTX_COMMON_WXCOMMON_H #define __MTX_COMMON_WXCOMMON_H -#include "common/os.h" - -#include -#include +#include "common/common_pch.h" #include diff --git a/src/extract/extract_cli_parser.cpp b/src/extract/extract_cli_parser.cpp index 417ed7b81..e01e498b3 100644 --- a/src/extract/extract_cli_parser.cpp +++ b/src/extract/extract_cli_parser.cpp @@ -13,11 +13,6 @@ #include "common/common_pch.h" -#include -#include -#include -#include - #include "common/ebml.h" #include "common/strings/formatting.h" #include "common/strings/parsing.h" diff --git a/src/extract/xtr_ivf.cpp b/src/extract/xtr_ivf.cpp index 2d0f5ce43..2059a236b 100644 --- a/src/extract/xtr_ivf.cpp +++ b/src/extract/xtr_ivf.cpp @@ -12,8 +12,6 @@ #include "common/common_pch.h" -#include - #include "common/ebml.h" #include "common/endian.h" #include "common/math.h" diff --git a/src/info/info_cli_parser.cpp b/src/info/info_cli_parser.cpp index a63461778..23a2e2d60 100644 --- a/src/info/info_cli_parser.cpp +++ b/src/info/info_cli_parser.cpp @@ -13,11 +13,6 @@ #include "common/common_pch.h" -#include -#include -#include -#include - #include "common/ebml.h" #include "common/strings/formatting.h" #include "common/strings/parsing.h" diff --git a/src/input/r_matroska.cpp b/src/input/r_matroska.cpp index 39a276ed3..fd2787ac0 100644 --- a/src/input/r_matroska.cpp +++ b/src/input/r_matroska.cpp @@ -15,7 +15,6 @@ #include "common/common_pch.h" #include // for BITMAPINFOHEADER -#include #include #include diff --git a/src/input/r_matroska.h b/src/input/r_matroska.h index 00cc815ff..9f042ab25 100644 --- a/src/input/r_matroska.h +++ b/src/input/r_matroska.h @@ -17,8 +17,6 @@ #include "common/common_pch.h" -#include - #include "common/compression.h" #include "common/error.h" #include "common/kax_file.h" diff --git a/src/input/r_mpeg_ps.h b/src/input/r_mpeg_ps.h index 5e2a17d6f..18a49f1ba 100644 --- a/src/input/r_mpeg_ps.h +++ b/src/input/r_mpeg_ps.h @@ -23,8 +23,6 @@ #include "merge/packet_extensions.h" #include "merge/pr_generic.h" -namespace bfs = boost::filesystem; - struct mpeg_ps_id_t { int id; int sub_id; diff --git a/src/input/r_mpeg_ts.cpp b/src/input/r_mpeg_ts.cpp index 86971a6b3..948e2143c 100644 --- a/src/input/r_mpeg_ts.cpp +++ b/src/input/r_mpeg_ts.cpp @@ -38,8 +38,6 @@ #include "output/p_truehd.h" #include "output/p_vc1.h" -namespace bfs = boost::filesystem; - #define TS_CONSECUTIVE_PACKETS 16 #define TS_PROBE_SIZE (2 * TS_CONSECUTIVE_PACKETS * 204) #define TS_PIDS_DETECT_SIZE 10 * 1024 * 1024 diff --git a/src/input/r_mpeg_ts.h b/src/input/r_mpeg_ts.h index f796c884c..37ae47036 100644 --- a/src/input/r_mpeg_ts.h +++ b/src/input/r_mpeg_ts.h @@ -17,8 +17,6 @@ #include "common/common_pch.h" -#include - #include "common/aac.h" #include "common/byte_buffer.h" #include "common/endian.h" @@ -29,8 +27,6 @@ #include "merge/pr_generic.h" #include "mpegparser/M2VParser.h" -namespace bfs = boost::filesystem; - enum mpeg_ts_input_type_e { INPUT_PROBE = 0, INPUT_READ = 1, diff --git a/src/input/r_qtmp4.cpp b/src/input/r_qtmp4.cpp index 1cb2510a3..dd6738583 100644 --- a/src/input/r_qtmp4.cpp +++ b/src/input/r_qtmp4.cpp @@ -17,9 +17,6 @@ #include "common/common_pch.h" -#include -#include -#include #include #include diff --git a/src/merge/cluster_helper.cpp b/src/merge/cluster_helper.cpp index adf45fbe5..d09aed870 100644 --- a/src/merge/cluster_helper.cpp +++ b/src/merge/cluster_helper.cpp @@ -14,10 +14,6 @@ #include "common/common_pch.h" -#include - -#include -#include #include #include "common/ebml.h" diff --git a/src/merge/output_control.cpp b/src/merge/output_control.cpp index 6cb3048b3..057bc155d 100644 --- a/src/merge/output_control.cpp +++ b/src/merge/output_control.cpp @@ -22,7 +22,6 @@ #endif #include #include -#include #include #ifdef HAVE_UNISTD_H #include @@ -31,13 +30,9 @@ #include #endif -#include #include #include -#include -#include - #include #include #include @@ -117,7 +112,6 @@ #include "merge/webm.h" using namespace libmatroska; -namespace bfs = boost::filesystem; namespace libmatroska { diff --git a/src/merge/pr_generic.h b/src/merge/pr_generic.h index 2e22bbd45..c06d11a7d 100644 --- a/src/merge/pr_generic.h +++ b/src/merge/pr_generic.h @@ -17,7 +17,6 @@ #include "common/common_pch.h" -#include #include #include diff --git a/src/output/p_avc.cpp b/src/output/p_avc.cpp index c6a046b2b..6736eabd3 100644 --- a/src/output/p_avc.cpp +++ b/src/output/p_avc.cpp @@ -13,8 +13,6 @@ #include "common/common_pch.h" -#include - #include "common/hacks.h" #include "common/math.h" #include "common/matroska.h" diff --git a/src/output/p_truehd.cpp b/src/output/p_truehd.cpp index 51b9052ba..609cf2a56 100644 --- a/src/output/p_truehd.cpp +++ b/src/output/p_truehd.cpp @@ -13,9 +13,6 @@ #include "common/common_pch.h" -#include -#include - #include "common/hacks.h" #include "common/matroska.h" #include "common/truehd.h" diff --git a/src/propedit/options.cpp b/src/propedit/options.cpp index 131f89bfe..596108615 100644 --- a/src/propedit/options.cpp +++ b/src/propedit/options.cpp @@ -8,11 +8,7 @@ Written by Moritz Bunkus . */ -#include "common/os.h" - -#include -#include -#include +#include "common/common_pch.h" #include #include diff --git a/src/propedit/propedit_cli_parser.cpp b/src/propedit/propedit_cli_parser.cpp index e6b9947e5..9e40e2eb2 100644 --- a/src/propedit/propedit_cli_parser.cpp +++ b/src/propedit/propedit_cli_parser.cpp @@ -11,17 +11,8 @@ \author Written by Moritz Bunkus . */ -#include "common/os.h" - -#include -#include -#include -#include -#include -#include -#include - #include "common/common_pch.h" + #include "common/ebml.h" #include "common/strings/formatting.h" #include "common/translation.h" diff --git a/src/propedit/target.cpp b/src/propedit/target.cpp index 1f7d2d9a8..66111c9dc 100644 --- a/src/propedit/target.cpp +++ b/src/propedit/target.cpp @@ -10,10 +10,6 @@ #include "common/common_pch.h" -#include -#include -#include - #include #include #include