Skip to content

Commit 3e86bd0

Browse files
committed
fix lint errors
1 parent fc8334f commit 3e86bd0

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ make
1010

1111
This runs `cmake -S . -B cmake-build ...` followed by `cmake --build cmake-build`.
1212

13+
## C++
14+
15+
When a multiplication produces a size or count for a wider integer type, make
16+
an operand the destination type so the multiplication itself is evaluated in
17+
that type. For example, use `std::size_t{16} * 1024U`, not `16 * 1024` or a cast
18+
of the completed product.
19+
1320
## Generated Files
1421

1522
Never edit generated files by hand. Update the source schema/config and run the

src/api/server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ bool read_gzip_file(const std::filesystem::path& path, std::string& output) {
109109
gzFile file = gzopen(path.c_str(), "rb");
110110
if (!file) return false;
111111

112-
std::array<char, 16 * 1024> buffer{};
112+
std::array<char, std::size_t{16} * 1024U> buffer{};
113113
bool ok = true;
114114
for (;;) {
115115
const int count = gzread(file, buffer.data(), static_cast<unsigned>(buffer.size()));

0 commit comments

Comments
 (0)