Skip to content

Commit

Permalink
Merge branch fix-includes to develop.
Browse files Browse the repository at this point in the history
  • Loading branch information
vitamin-caig committed Nov 20, 2024
2 parents 44be56a + 2315bdc commit aad33b5
Show file tree
Hide file tree
Showing 1,130 changed files with 7,830 additions and 8,850 deletions.
40 changes: 39 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,44 @@ SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true

# other
SortIncludes: true
SortUsingDeclarations: false
FixNamespaceComments: true

# includes structure:
# optinal main include, may be local (use full path if possible)
# local includes (avoid if possible)
# includes from private libraries or impl includes from libraries (TODO: cleanup)
# includes from public libraries
# common includes (TODO: cleanup)
# third-party libraries
# qt/boost includes
# system includes
# std includes
SortIncludes: true
IncludeBlocks: Regroup
IncludeIsMainRegex: '$'
IncludeCategories:
# qt/boost
- Regex: '<(Qt|boost/).+>'
Priority: 6
# third-party includes
- Regex: '"3rdparty/.+"'
Priority: 5
# common includes
- Regex: '"(api_dynamic|byteorder|contract|error|error_tools|lazy|make_ptr|pointers|source_location|static_string|string_type|string_view|types)\.h"'
Priority: 4
# public libraries
- Regex: '"(analysis|async|binary(/compression)?|core|debug|devices|formats|io|l10n|math|module|parameters|platform(/(application|version))?|resource|sound|strings|time|tools)/[^/]+\.h"'
Priority: 3
# private libraries/impl includes
- Regex: '"(analysis|async|binary|core|debug|devices|formats|io|l10n|math|module|parameters|platform|resource|sound|strings|time|tools)/[^.]+\.h|zxtune.h"'
Priority: 2
# local includes or local libraries
- Regex: '".+\.h"'
Priority: 1
# std includes
- Regex: '<[_a-z0-9]+>'
Priority: 8
# system includes
- Regex: '<[/_a-z0-9]+\.h>'
Priority: 7
2 changes: 1 addition & 1 deletion 3rdparty/FLAC/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ endif
dirs.root := ../..
include $(dirs.root)/make/default.mak

defines += FLAC__NO_ASM PACKAGE_VERSION=\"1.3.3\" FLAC__HAS_OGG=0 HAVE_LROUND
defines += FLAC__NO_ASM PACKAGE_VERSION=\"1.3.3\" FLAC__HAS_OGG=0 HAVE_LROUND HAVE_STDINT_H
defines.mingw = HAVE_FSEEKO
defines.linux = HAVE_FSEEKO

Expand Down
2 changes: 2 additions & 0 deletions 3rdparty/gme/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ source_files += $(addprefix gme/,Kss_Emu.cpp Kss_Core.cpp Kss_Cpu.cpp Kss_Scc_Ap
source_files += $(addprefix gme/,Resampler.cpp Fir_Resampler.cpp Dual_Resampler.cpp \
)

defines += HAVE_STDINT_H

include $(dirs.root)/makefile.mak
3 changes: 2 additions & 1 deletion 3rdparty/mgba/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
library_name := mgba
dirs.root := ../..
include defines.mak

source_files += $(addprefix arm/,arm decoder-arm decoder-thumb isa-arm isa-thumb) \
$(addprefix core/,cheats config core interface sync tile-cache timing) \
Expand All @@ -15,6 +14,8 @@ source_files += platform/portable/memory

source_files := $(addprefix src/,$(addsuffix .c,$(source_files)))

defines.linux += HAVE_LOCALTIME_R
includes.dirs += $(dirs.root)/3rdparty/mgba/include $(dirs.root)/3rdparty/mgba/src
includes.files += defines.h

include $(dirs.root)/makefile.mak
2 changes: 0 additions & 2 deletions 3rdparty/mgba/defines.mak

This file was deleted.

2 changes: 2 additions & 0 deletions 3rdparty/vgm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,6 @@ source_files := $(addsuffix .c,$(source_files))

source_files += $(addprefix player/,playerbase.cpp s98player.cpp vgmplayer.cpp vgmplayer_cmdhandler.cpp helper.c dblk_compr.c)

defines += HAVE_STDINT_H

include $(dirs.root)/makefile.mak
9 changes: 4 additions & 5 deletions apps/benchmark/android/benchmark/src/main/jni/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
*
**/

// local includes
#include "apps/benchmark/core/benchmark.h"
// std includes
#include <cmath>
#include <sstream>
// system includes

#include <android/log.h>
#include <jni.h>

#include <cmath>
#include <sstream>

namespace
{
void Debug(const char* msg)
Expand Down
11 changes: 5 additions & 6 deletions apps/benchmark/core/ay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
*
**/

// local includes
#include "ay.h"
// common includes
#include <make_ptr.h>
// library includes
#include <sound/matrix_mixer.h>
#include <time/timer.h>

#include "sound/matrix_mixer.h"
#include "time/timer.h"

#include "make_ptr.h"

namespace
{
Expand Down
6 changes: 3 additions & 3 deletions apps/benchmark/core/ay.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

#pragma once

// library includes
#include <devices/aym/chip.h>
#include <time/duration.h>
#include "devices/aym/chip.h"

#include "time/duration.h"

namespace Benchmark::AY
{
Expand Down
14 changes: 7 additions & 7 deletions apps/benchmark/core/benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
*
**/

// local includes
#include "benchmark.h"

#include "ay.h"
#include "mixer.h"
#include "z80.h"
// common includes
#include <contract.h>
#include <make_ptr.h>
// library includes
#include <binary/dump.h>
#include <strings/format.h>

#include "binary/dump.h"
#include "strings/format.h"

#include "contract.h"
#include "make_ptr.h"

namespace Benchmark
{
Expand Down
1 change: 0 additions & 1 deletion apps/benchmark/core/benchmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#pragma once

// std includes
#include <string>

namespace Benchmark
Expand Down
7 changes: 3 additions & 4 deletions apps/benchmark/core/mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
*
**/

// local includes
#include "mixer.h"
// library includes
#include <sound/matrix_mixer.h>
#include <time/timer.h>

#include "sound/matrix_mixer.h"
#include "time/timer.h"

namespace Benchmark::Mixer
{
Expand Down
3 changes: 1 addition & 2 deletions apps/benchmark/core/mixer.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

#pragma once

// library includes
#include <time/duration.h>
#include "time/duration.h"

namespace Benchmark::Mixer
{
Expand Down
9 changes: 4 additions & 5 deletions apps/benchmark/core/z80.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
*
**/

// local includes
#include "z80.h"
// common includes
#include <make_ptr.h>
// library includes
#include <time/timer.h>

#include "time/timer.h"

#include "make_ptr.h"

namespace
{
Expand Down
5 changes: 2 additions & 3 deletions apps/benchmark/core/z80.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

#pragma once

// library includes
#include <devices/z80.h>
#include <time/duration.h>
#include "devices/z80.h"
#include "time/duration.h"

namespace Benchmark::Z80
{
Expand Down
1 change: 1 addition & 0 deletions apps/benchmark/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
**/

#include "core/benchmark.h"

#include <iostream>

namespace
Expand Down
22 changes: 0 additions & 22 deletions apps/libzxtune/Makefile

This file was deleted.

Loading

0 comments on commit aad33b5

Please sign in to comment.