Skip to content

Commit b094ea9

Browse files
committed
src: fix lint on compressed startup blobs
Wrap lines past 80 columns and store the zstd frame size in uint64_t. Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>
1 parent 34ea2c8 commit b094ea9

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎src/node_snapshotable.cc‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,8 +792,9 @@ void FormatBlob(std::ostream& ss,
792792
while (raw.size() % 16 != 0) {
793793
raw.push_back(0);
794794
}
795-
append_bytes(reinterpret_cast<const uint8_t*>(data->v8_snapshot_blob_data.data),
796-
snapshot_size);
795+
const uint8_t* snapshot_bytes =
796+
reinterpret_cast<const uint8_t*>(data->v8_snapshot_blob_data.data);
797+
append_bytes(snapshot_bytes, snapshot_size);
797798
for (const auto& item : data->code_cache) {
798799
append_bytes(item.data.data, item.data.length);
799800
}

‎src/zstd_blob.cc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace node {
1313
uint8_t* ZstdDecompressAligned(const uint8_t* src,
1414
size_t src_size,
1515
size_t* raw_size) {
16-
unsigned long long content = ZSTD_getFrameContentSize(src, src_size);
16+
uint64_t content = ZSTD_getFrameContentSize(src, src_size);
1717
if (content == ZSTD_CONTENTSIZE_ERROR ||
1818
content == ZSTD_CONTENTSIZE_UNKNOWN || content == 0) {
1919
return nullptr;

‎tools/js2c.cc‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,8 @@ Fragment EmitCompressedBuiltins() {
940940
out += " cursor++;\n";
941941
out += " }\n";
942942
out += " }\n";
943-
out += " CHECK_EQ(static_cast<size_t>(sizeof(slots) / sizeof(slots[0])),\n";
943+
out += " CHECK_EQ(static_cast<size_t>(sizeof(slots) /\n";
944+
out += " sizeof(slots[0])),\n";
944945
out += " static_cast<size_t>(count));\n";
945946
}
946947
out += " });\n";

0 commit comments

Comments
 (0)