Skip to content

Commit

Permalink
chore: Update to clang-format18
Browse files Browse the repository at this point in the history
  • Loading branch information
kbinani committed Nov 6, 2024
1 parent 90e378f commit 9ac341c
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://pkgs.alpinelinux.org/packages?name=clang-extra-tools&branch=v3.15&repo=main&arch=x86_64&maintainer=
# https://pkgs.alpinelinux.org/packages?name=clang18-extra-tools&branch=v3.20&repo=main&arch=x86_64&maintainer=
# https://hub.docker.com/_/alpine/tags
FROM alpine:3.15.6
FROM alpine:3.20.3
RUN apk add --no-cache clang-extra-tools git bash \
&& mkdir /workspace \
&& echo "[safe]" > /.gitconfig \
Expand Down
6 changes: 3 additions & 3 deletions src/bedrock-block-data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ class BlockData::Impl {
}

static String Leaves2(String const &bName, CompoundTag const &s, Props &p) {
auto newLeafType = s.string(u8"new_leaf_type", u8"acacia"); //TODO: acacia?
auto newLeafType = s.string(u8"new_leaf_type", u8"acacia"); // TODO: acacia?
PersistentFromPersistentBit(s, p);
Submergible(s, p);
return Ns() + newLeafType + u8"_leaves";
Expand Down Expand Up @@ -1019,7 +1019,7 @@ class BlockData::Impl {
}

static String Log2Legacy(String const &bName, CompoundTag const &s, Props &p) {
auto logType = s.string(u8"new_log_type", u8"acacia"); //TODO: acacia?
auto logType = s.string(u8"new_log_type", u8"acacia"); // TODO: acacia?
AxisFromPillarAxis(s, p);
return Ns() + logType + u8"_log";
}
Expand Down Expand Up @@ -1104,7 +1104,7 @@ class BlockData::Impl {
}

static String PlanksLegacy(String const &bName, CompoundTag const &s, Props &p) {
auto woodType = s.string(u8"wood_type", u8"acacia"); //TODO: acacia?
auto woodType = s.string(u8"wood_type", u8"acacia"); // TODO: acacia?
return Ns() + woodType + u8"_planks";
}

Expand Down
2 changes: 1 addition & 1 deletion src/bedrock/terraform/_piston.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class Piston {
tileEntityJ->set(u8"y", Int(y));
tileEntityJ->set(u8"z", Int(z));
tileEntityJ->set(u8"extending", Bool(extending));
tileEntityJ->set(u8"progress", Float(lastProgress)); //TODO(1.21) state == 3 ? 0 : 0.5));
tileEntityJ->set(u8"progress", Float(lastProgress)); // TODO(1.21) state == 3 ? 0 : 0.5));
tileEntityJ->set(u8"facing", Int(facingDirectionB));
tileEntityJ->set(u8"source", Bool(false));

Expand Down
2 changes: 1 addition & 1 deletion src/db/_null-db.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class NullDb : public DbInterface {
Status put(std::string const &key, leveldb::Slice const &value) override { return Status::Ok(); }
Status del(std::string const &key) override { return Status::Ok(); }
Status close(std::function<bool(Rational<u64> const &progress)> progress = nullptr) override { return Status::Ok(); }
void abandon() override{};
void abandon() override {};
};

} // namespace je2be
8 changes: 4 additions & 4 deletions src/entity/_entity-attributes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,12 @@ class EntityAttributes {
table->insert(make_pair(u8"minecraft:stray", Attributes(Attribute(20, 20, 20), Attribute(0, 0, 1), Attribute(0.25, 0.25), Attribute(0.02, 0.02), Attribute(0.02, 0.02), Attribute(16, 16, 2048), nullopt)));
table->insert(make_pair(u8"minecraft:strider", Attributes(Attribute(20, 20, 20), Attribute(0, 0, 1), Attribute(0.16, 0.16), Attribute(0.02, 0.02), Attribute(0.32, 0.32), Attribute(16, 16, 2048), nullopt)));
table->insert(make_pair(u8"minecraft:tropical_fish", Attributes(Attribute(3, 3, 3), // health
Attribute(0, 0, 1), //knockback_resistance
Attribute(0, 0, 1), // knockback_resistance
Attribute(0.12, 0.12), // movement
Attribute(0.12, 0.12), // underwater_movement
Attribute(0.02, 0.02), //lava_movement
Attribute(16, 16, 2048), //follow_range
nullopt))); //attack_damage
Attribute(0.02, 0.02), // lava_movement
Attribute(16, 16, 2048), // follow_range
nullopt))); // attack_damage
table->insert(make_pair(u8"minecraft:turtle", Attributes(Attribute(30, 30, 30), Attribute(0, 0, 1), Attribute(0.1, 0.1), Attribute(0.12, 0.12), Attribute(0.02, 0.02), Attribute(1024, 1024, 2048), nullopt)));
table->insert(make_pair(u8"minecraft:vex", Attributes(Attribute(14, 14, 14), Attribute(0, 0, 1), Attribute(1, 1), Attribute(0.02, 0.02), Attribute(0.02, 0.02), Attribute(16, 16, 2048), Attribute(3, 3, 3))));
table->insert(make_pair(u8"minecraft:villager", Attributes(Attribute(20, 20, 20), Attribute(0, 0, 1), Attribute(0.5, 0.5), Attribute(0.02, 0.02), Attribute(0.02, 0.02), Attribute(128, 128, 2048), nullopt)));
Expand Down
4 changes: 2 additions & 2 deletions src/java-block-data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2107,13 +2107,13 @@ class BlockData::Impl {
CardinalDirectionFromFacing4(s, block, o);
auto tilt = block.property(u8"tilt", u8"none");
if (tilt == u8"none") {
//nop
// nop
} else if (tilt == u8"partial") {
tilt = u8"partial_tilt";
} else if (tilt == u8"full") {
tilt = u8"full_tilt";
} else if (tilt == u8"unstable") {
//nop
// nop
}
s->set(u8"big_dripleaf_tilt", std::u8string(tilt));
return AttachStates(c, s);
Expand Down
2 changes: 1 addition & 1 deletion src/java-chunk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class Chunk::Impl {
}

ChunkConversionMode mode = ConversionMode(*chunk);
//TODO: Change the line below to "DataVersion dataVersion(chunk->getDataVersion(), mode);"
// TODO: Change the line below to "DataVersion dataVersion(chunk->getDataVersion(), mode);"
DataVersion dataVersion(chunk->getDataVersion(), kJavaDataVersion);

PreprocessChunk(loader, *chunk, dataVersion);
Expand Down
2 changes: 1 addition & 1 deletion src/java-entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1741,7 +1741,7 @@ class Entity::Impl {
}
}

//static void Debug(CompoundTag &c, CompoundTag const &tag, ConverterContext &) {}
// static void Debug(CompoundTag &c, CompoundTag const &tag, ConverterContext &) {}

static void DetectSuffocation(CompoundTag &c, CompoundTag const &tag, ConverterContext &) {
AddDefinition(c, u8"-minecraft:start_suffocating");
Expand Down
8 changes: 4 additions & 4 deletions src/lce/_lzx-decoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1178,10 +1178,10 @@ class LzxDecoder {
return i;
}

//static long const position_base_minus2[];
//static u8 const extra_bits[];
//u32 position_base[51];
//u8 extra_bits[52];
// static long const position_base_minus2[];
// static u8 const extra_bits[];
// u32 position_base[51];
// u8 extra_bits[52];

enum class e_block_type : u8 {
_lxz_block_type_invalid,
Expand Down
2 changes: 1 addition & 1 deletion test/j2b2j.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ static std::optional<mcfile::je::TickingBlock> FindNearestTickingBlock(int x, in

static void CheckTickingBlockJ(mcfile::je::TickingBlock e, mcfile::je::TickingBlock a) {
CHECK(e.fI == a.fI);
//CHECK(e.fP == a.fP); "P" does not exist in BE
// CHECK(e.fP == a.fP); "P" does not exist in BE
CHECK(e.fT == a.fT);
CHECK(e.fX == a.fX);
CHECK(e.fY == a.fY);
Expand Down
2 changes: 1 addition & 1 deletion test/strings.test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ TEST_CASE("strings") {
CHECK(strings::SnakeFromUpperCamel(u8"Ender_Chest") == u8"ender_chest");
}
SUBCASE("Unquote") {
CHECK(strings::Unquote(u8R"("\"a\"")") == u8R"("a")");
CHECK(strings::Unquote(u8"\"\\\"a\\\"") == u8R"("a")");
CHECK(strings::Unquote(u8R"("'a'")") == u8R"('a')");
CHECK(strings::Unquote(u8"a") == u8"a");
}
Expand Down
2 changes: 1 addition & 1 deletion tool/format
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(
cd "$(dirname "$0")/.."

if clang-format --version | grep 'version 12.' >/dev/null; then
if clang-format --version | grep 'version 18.' >/dev/null; then
bash tool/ls-files | xargs -P$(nproc) -n1 clang-format -i
else
if [ -d .git ]; then
Expand Down

0 comments on commit 9ac341c

Please sign in to comment.