Skip to content

Commit 9275e28

Browse files
committed
Format with clang-format 19
1 parent f0f659d commit 9275e28

6 files changed

Lines changed: 19 additions & 25 deletions

File tree

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
BasedOnStyle: Chromium
2+
InsertBraces: true

lib/file_node.h

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,23 +96,15 @@ struct FileNode {
9696
using ByPath = bi::unordered_set_member_hook<LinkMode, bi::store_hash<true>>;
9797
ByPath by_path, by_original_path;
9898

99-
const DataNode& GetTarget() const {
100-
return link ? *link : data;
101-
}
99+
const DataNode& GetTarget() const { return link ? *link : data; }
102100

103101
// Gets attributes.
104102
using Stat = struct stat;
105-
operator Stat() const {
106-
return GetTarget();
107-
}
103+
operator Stat() const { return GetTarget(); }
108104

109-
FileType GetType() const {
110-
return GetFileType(GetTarget().mode);
111-
}
105+
FileType GetType() const { return GetFileType(GetTarget().mode); }
112106

113-
bool IsDir() const {
114-
return GetType() == FileType::Directory;
115-
}
107+
bool IsDir() const { return GetType() == FileType::Directory; }
116108

117109
// Gets the full absolute path of this node.
118110
std::string GetPath() const {
@@ -192,9 +184,7 @@ struct FileNode {
192184
}
193185

194186
// Gets a Reader to read file contents.
195-
Reader::Ptr GetReader() const {
196-
return GetTarget().GetReader(zip, *this);
197-
}
187+
Reader::Ptr GetReader() const { return GetTarget().GetReader(zip, *this); }
198188

199189
// Output operator for debugging.
200190
friend std::ostream& operator<<(std::ostream& out, const FileNode& node) {

mount-zip.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
#ifdef __APPLE__
3636

37-
#ifndef typeof // work around the -pedantic -std=c++20
37+
#ifndef typeof // work around the -pedantic -std=c++20
3838
#define typeof(x) __typeof__(x)
3939
#endif
4040

tests/whitebox/extra_field_test.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@ void unix_pkware_regular() {
103103
*/
104104
void unix_pkware_device() {
105105
const u8 data[] = {
106-
0xC8, 0x76, 0x45, 0x5D, // atime
107-
0xC8, 0x76, 0x45, 0x5D, // mtime
108-
0x00, 0x00, // UID
109-
0x06, 0x00, // GID
110-
0x08, 0x00, 0x00, 0x00, // major
111-
0x01, 0x00, 0x00, 0x00 // minor
106+
0xC8, 0x76, 0x45, 0x5D, // atime
107+
0xC8, 0x76, 0x45, 0x5D, // mtime
108+
0x00, 0x00, // UID
109+
0x06, 0x00, // GID
110+
0x08, 0x00, 0x00, 0x00, // major
111+
0x01, 0x00, 0x00, 0x00 // minor
112112
};
113113

114114
ExtraFields f;

utils/create-content-size.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ zip_int64_t callback(void* user,
3838
return 0;
3939
case ZIP_SOURCE_READ: {
4040
size_t nr = std::numeric_limits<size_t>::max();
41-
if (len < nr)
41+
if (len < nr) {
4242
nr = static_cast<size_t>(len);
43-
if (ctx->size - ctx->offset < nr)
43+
}
44+
if (ctx->size - ctx->offset < nr) {
4445
nr = static_cast<size_t>(ctx->size - ctx->offset);
46+
}
4547
memset(data, 0, nr);
4648
ctx->offset += nr;
4749
return nr;

utils/dump-extrafld.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,9 @@ int main(int argc, char** argv) {
135135
int len = 0;
136136
const char* const comment =
137137
zip_get_archive_comment(z.get(), &len, ZIP_FL_ENC_RAW);
138-
if (comment != nullptr && len > 0)
138+
if (comment != nullptr && len > 0) {
139139
std::println(" comment: {}", std::string_view(comment, len));
140+
}
140141
}
141142

142143
zip_int64_t const n = zip_get_num_entries(z.get(), 0);

0 commit comments

Comments
 (0)