Skip to content

Commit c96d8b2

Browse files
committed
style(cpp): apply clang-format to C++ files
Automatic formatting by clang-format to match project style.
1 parent b3d77d8 commit c96d8b2

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

algorithms/rle/cpp/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
// Format:
1212
// - Magic number: 4 bytes "RLE\x00" for format identification
1313
// - Followed by (count, value) pairs until EOF:
14-
// - count: 4-byte unsigned integer, little-endian, represents how many times value repeats, must be > 0.
14+
// - count: 4-byte unsigned integer, little-endian, represents how many times value repeats, must
15+
// be > 0.
1516
// - value: 1 byte, represents the byte value to repeat.
1617
// This format is simple; all three language implementations are fully consistent for cross-decoding
1718
// and benchmarking.

algorithms/shared/cpp/src/buffer_api.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#include <unistd.h>
44

55
#include <algorithm>
6-
#include <cstdlib>
76
#include <cstdio>
7+
#include <cstdlib>
88
#include <fstream>
99
#include <limits>
1010
#include <stdexcept>
@@ -23,9 +23,12 @@ class ScopedTempFile {
2323
explicit ScopedTempFile(const char* prefix) {
2424
// Use platform-appropriate temp directory
2525
const char* tmp_dir = std::getenv("TMPDIR");
26-
if (!tmp_dir) tmp_dir = std::getenv("TMP");
27-
if (!tmp_dir) tmp_dir = std::getenv("TEMP");
28-
if (!tmp_dir) tmp_dir = "/tmp";
26+
if (!tmp_dir)
27+
tmp_dir = std::getenv("TMP");
28+
if (!tmp_dir)
29+
tmp_dir = std::getenv("TEMP");
30+
if (!tmp_dir)
31+
tmp_dir = "/tmp";
2932
std::string pattern = std::string(tmp_dir) + "/" + prefix + "-XXXXXX";
3033
std::vector<char> buffer(pattern.begin(), pattern.end());
3134
buffer.push_back('\0');

0 commit comments

Comments
 (0)