Skip to content

Commit fcccb93

Browse files
authored
Merge pull request #13 from Return-To-The-Roots/fix_cmdline
Fix cmdline
2 parents 6e6c88f + f343dd4 commit fcccb93

File tree

8 files changed

+30
-23
lines changed

8 files changed

+30
-23
lines changed

.clang-format

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ AlwaysBreakBeforeMultilineStrings: false
2020
AlwaysBreakTemplateDeclarations: true
2121
BinPackArguments: true
2222
BinPackParameters: true
23-
BraceWrapping:
23+
BraceWrapping:
2424
AfterClass: true
2525
AfterControlStatement: true
2626
AfterEnum: true
@@ -55,7 +55,7 @@ DisableFormat: false
5555
ExperimentalAutoDetectBinPacking: false
5656
FixNamespaceComments: true
5757
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, BOOST_REVERSE_FOREACH, RTTR_FOREACH_PT ]
58-
IncludeCategories:
58+
IncludeCategories:
5959
- Regex: '[dD]efines.h'
6060
Priority: -1
6161
- Regex: '^"world/'
@@ -70,15 +70,21 @@ IncludeCategories:
7070
Priority: 50
7171
- Regex: '^(<|")lib.*/'
7272
Priority: 90
73-
- Regex: '^<boost/'
73+
- Regex: '^(<|")s25util.*/'
74+
Priority: 90
75+
- Regex: '(<|")rttr/'
76+
Priority: 90
77+
- Regex: '<(utf8.h|kaguya|turtle|glad|KHR)'
78+
Priority: 95
79+
- Regex: '<boost/'
7480
Priority: 99
7581
- Regex: '^<windows'
7682
Priority: 100
7783
- Regex: '^<'
7884
Priority: 110
7985
- Regex: '.*'
8086
Priority: 1
81-
IncludeIsMainRegex: '(Impl)?$'
87+
IncludeIsMainRegex: '(Impl|_Win32|_Other)?$'
8288
IndentCaseLabels: true
8389
IndentWidth: 4
8490
IndentWrappedFunctionNames: false
@@ -114,6 +120,6 @@ SpacesInContainerLiterals: false
114120
SpacesInCStyleCastParentheses: false
115121
SpacesInParentheses: false
116122
SpacesInSquareBrackets: false
117-
Standard: Cpp03
123+
Standard: Cpp11
118124
TabWidth: 4
119-
UseTab: Never
125+
UseTab: Never

examples/chTransparentIdx/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ include(EnableWarnings)
1616
enable_warnings(chTransparentIdx)
1717

1818
if(ClangFormat_FOUND)
19-
add_clangFormat_files(${_sources})
19+
add_clangFormat_files(chTransparentIdx.cpp)
2020
endif()

examples/chTransparentIdx/chTransparentIdx.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ int main(int argc, char* argv[])
4545
bpo::options_description desc("Usage:\n"
4646
"unpack: chTransparentIdx <file.lst>\n"
4747
"Optionally pass a color palette file (bbm/act) to use instead of default one");
48-
desc.add_options()("help,h", "Show help")("file,f", bpo::value<std::vector<bfs::path> >()->multitoken(),
49-
"File(s) to repack")("palette,p", bpo::value<bfs::path>(), "Palette to use")(
48+
desc.add_options()("help,h", "Show help")("file,f", bpo::value<std::vector<std::string>>()->multitoken(),
49+
"File(s) to repack")("palette,p", bpo::value<std::string>(), "Palette to use")(
5050
"from", bpo::value<uint8_t>()->default_value(254), "Original transparent color index")("to", bpo::value<uint8_t>()->default_value(0),
5151
"New transparent color index");
5252
bpo::positional_options_description positionalOptions;
@@ -66,7 +66,7 @@ int main(int argc, char* argv[])
6666

6767
if(options.count("palette"))
6868
{
69-
bfs::path palPath = options["palette"].as<bfs::path>();
69+
const bfs::path palPath = options["palette"].as<std::string>();
7070
if(libsiedler2::Load(palPath.string(), bbm) != 0)
7171
{
7272
bnw::cerr << "Error: Could not load given palette: " << palPath << std::endl;
@@ -88,9 +88,10 @@ int main(int argc, char* argv[])
8888
}
8989
}
9090

91-
libsiedler2::ArchivItem_Palette* palette = (libsiedler2::ArchivItem_Palette*)bbm[0];
91+
libsiedler2::ArchivItem_Palette* palette = dynamic_cast<libsiedler2::ArchivItem_Palette*>(bbm[0]);
9292

93-
for(const bfs::path& inputPath : options["file"].as<std::vector<bfs::path> >())
93+
const auto inputPaths = options["file"].as<std::vector<std::string>>();
94+
for(const bfs::path inputPath : inputPaths)
9495
{
9596
if(!bfs::exists(inputPath))
9697
{

examples/lstpacker/lstpacker.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ int main(int argc, char* argv[])
4949
bpo::options_description desc("Usage:\n"
5050
"pack: lstpacker <directory>\n"
5151
"unpack: lstpacker <file.lst> <file.lst> ...\n");
52-
desc.add_options()("help,h", "Show help")("file,f", bpo::value<std::vector<bfs::path> >()->multitoken(),
53-
"File to unpack or directory to pack")("palette,p", bpo::value<bfs::path>(),
52+
desc.add_options()("help,h", "Show help")("file,f", bpo::value<std::vector<std::string>>()->multitoken(),
53+
"File to unpack or directory to pack")("palette,p", bpo::value<std::string>(),
5454
"Palette (bbm/act) to use instead of default one")(
5555
"palAsTxt,t", "Output palettes as human readable txt files")(
5656
"texFmt", bpo::value<std::string>(&texFmt)->default_value("original"),
@@ -81,8 +81,8 @@ int main(int argc, char* argv[])
8181

8282
if(options.count("palette"))
8383
{
84-
bfs::path palPath = options["palette"].as<bfs::path>();
85-
if(libsiedler2::Load(palPath.string(), bbm) != 0)
84+
const auto palPath = options["palette"].as<std::string>();
85+
if(libsiedler2::Load(palPath, bbm) != 0)
8686
{
8787
bnw::cerr << "Error: Could not load given palette: " << palPath << std::endl;
8888
bnw::cerr << "Retrying with default ones" << std::endl;
@@ -103,10 +103,10 @@ int main(int argc, char* argv[])
103103
}
104104
}
105105

106-
libsiedler2::ArchivItem_Palette* palette = (libsiedler2::ArchivItem_Palette*)bbm[0];
106+
libsiedler2::ArchivItem_Palette* palette = dynamic_cast<libsiedler2::ArchivItem_Palette*>(bbm[0]);
107107

108-
std::vector<bfs::path> inputPaths(options["file"].as<std::vector<bfs::path> >());
109-
for(const bfs::path& inputPath : inputPaths)
108+
const auto inputPaths = options["file"].as<std::vector<std::string>>();
109+
for(const bfs::path inputPath : inputPaths)
110110
{
111111
if(!bfs::exists(inputPath))
112112
{

examples/outline/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ include(EnableWarnings)
1313
enable_warnings(outline)
1414

1515
if(ClangFormat_FOUND)
16-
add_clangFormat_files(${_sources})
16+
add_clangFormat_files(outline.cpp)
1717
endif()

include/libsiedler2/Archiv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class Archiv
7272
ArchivItem* operator[](size_t index) { return get(index); }
7373

7474
private:
75-
std::vector<std::unique_ptr<ArchivItem> > data; /// elements
75+
std::vector<std::unique_ptr<ArchivItem>> data; /// elements
7676
};
7777
} // namespace libsiedler2
7878

src/ArchivItem_Bob.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ int libsiedler2::ArchivItem_Bob::load(std::istream& file, const ArchivItem_Palet
113113
std::vector<bool> loaded(numGoodImgs, false);
114114

115115
std::vector<uint8_t> heights(numGoodImgs);
116-
std::vector<std::vector<uint16_t> > starts(numGoodImgs);
116+
std::vector<std::vector<uint16_t>> starts(numGoodImgs);
117117
std::vector<uint8_t> ny(numGoodImgs);
118118

119119
for(uint16_t i = 0; i < numGoodImgs; ++i)

tests/testClone.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ BOOST_AUTO_TEST_CASE(CloneFromBasePtr)
8989
auto f = std::make_unique<Bar>(42, 1337);
9090
auto* basePtr = static_cast<BarBase*>(f.get());
9191
auto f2 = clone(basePtr);
92-
static_assert(std::is_same<decltype(f2), std::unique_ptr<BarBase> >::value, "Must be the same");
92+
static_assert(std::is_same<decltype(f2), std::unique_ptr<BarBase>>::value, "Must be the same");
9393
BOOST_TEST((f && f2 && basePtr));
9494
BOOST_TEST(f->i == 42);
9595
BOOST_TEST(f->j == 1337);

0 commit comments

Comments
 (0)