Skip to content

Commit 887d1e1

Browse files
fix(format): add Standard: Cpp03 and fix nested-template spacing
Add Standard: Cpp03 to .clang-format so nested templates keep '> >' spacing (not '>>'), which is required for the macOS C++03-compatible build (clang -std=c++03 rejects '>>' inside template argument lists). Fix cluster_client.h:43 (m_staged_monitor_commands) to use '> >' and reformat cluster_client.cpp / cluster_client.h to satisfy the clang-format check. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent eab2a28 commit 887d1e1

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

.clang-format

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ AllowShortFunctionsOnASingleLine: Inline
5353
AllowShortIfStatementsOnASingleLine: WithoutElse
5454
AllowShortLoopsOnASingleLine: false
5555

56+
# C++ standard: keep Cpp03 so nested templates use "> >" (not ">>"),
57+
# which is required for the macOS C++03-compatible build.
58+
Standard: Cpp03
59+
5660
# Other
5761
AlignTrailingComments: true
5862
AlwaysBreakAfterReturnType: None

cluster_client.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -690,8 +690,7 @@ void cluster_client::process_staged_monitor_command(struct timeval /*timestamp*/
690690
// format_arbitrary_command mutates arg->data in-place; call it here at drain time
691691
// (not at staging time) so the RESP framing is applied on the correct connection's protocol.
692692
if (!m_connections[conn_id]->get_protocol()->format_arbitrary_command(staged.parsed_cmd)) {
693-
benchmark_error_log("warning: skipping unformattable staged monitor command at line %zu\n",
694-
staged.source_line);
693+
benchmark_error_log("warning: skipping unformattable staged monitor command at line %zu\n", staged.source_line);
695694
// m_reqs_generated was incremented when this command was staged. Undo it now so
696695
// a --requests run doesn't hang waiting for a response that will never arrive.
697696
m_reqs_generated--;
@@ -749,8 +748,7 @@ bool cluster_client::create_monitor_request_cluster(unsigned int command_index,
749748
if (!key.empty()) {
750749
uint32_t slot = calc_hslot_crc16_with_hash_tag(key.c_str(), key.size());
751750
uint32_t shard = m_slot_to_shard[slot];
752-
if (shard < m_connections.size() &&
753-
m_connections[shard]->get_connection_state() != conn_disconnected &&
751+
if (shard < m_connections.size() && m_connections[shard]->get_connection_state() != conn_disconnected &&
754752
m_connections[shard]->get_cluster_slots_state() == setup_done) {
755753
target_conn = shard;
756754
}

cluster_client.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@
2626

2727
typedef std::queue<unsigned long long> key_index_pool;
2828

29-
struct staged_monitor_cmd {
29+
struct staged_monitor_cmd
30+
{
3031
arbitrary_command parsed_cmd; // already split (split_command_to_args done); format at drain
3132
size_t stats_index;
3233
struct timeval enqueue_time; // latency measured from selection, not drain
33-
size_t source_line; // original monitor file line (1-based) for error messages
34+
size_t source_line; // original monitor file line (1-based) for error messages
3435
};
3536

3637
// forward decleration
@@ -40,7 +41,7 @@ class cluster_client : public client
4041
{
4142
protected:
4243
std::vector<key_index_pool *> m_key_index_pools;
43-
std::vector<std::queue<staged_monitor_cmd>> m_staged_monitor_commands;
44+
std::vector<std::queue<staged_monitor_cmd> > m_staged_monitor_commands;
4445
unsigned int m_slot_to_shard[16384];
4546
// --transaction: shard connection that owns the in-flight rotation of
4647
// --command entries. -1 = no pin (rotation has not started or just ended).

0 commit comments

Comments
 (0)