Skip to content

Commit b95b266

Browse files
committed
Clang-format
1 parent 16d3e97 commit b95b266

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

src/Debug/debugger.cpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ bool Debugger::checkDebugMessages(Module *m, RunningState *program_state) {
195195
case interruptPAUSE:
196196
this->pauseRuntime(m);
197197
// Make a checkpoint so the debugger knows the current state and
198-
// knows how many instructions were executed since the last checkpoint.
198+
// knows how many instructions were executed since the last
199+
// checkpoint.
199200
if (snapshotPolicy == SnapshotPolicy::checkpointing) {
200201
checkpoint(m, true);
201202
}
@@ -219,7 +220,7 @@ bool Debugger::checkDebugMessages(Module *m, RunningState *program_state) {
219220
uint8_t *data = interruptData + 1;
220221
uint32_t amount = read_B32(&data);
221222
printf("Continue for %d instruction(s)\n", amount);
222-
remaining_instructions = (int32_t) amount;
223+
remaining_instructions = (int32_t)amount;
223224
*program_state = WARDUINOrun;
224225
free(interruptData);
225226
break;
@@ -954,8 +955,7 @@ void Debugger::handleSnapshotPolicy(Module *m) {
954955
this->channel->write("SNAPSHOT ");
955956
snapshot(m);
956957
this->channel->write("\n");
957-
}
958-
else if (snapshotPolicy == SnapshotPolicy::checkpointing) {
958+
} else if (snapshotPolicy == SnapshotPolicy::checkpointing) {
959959
if (instructions_executed >= checkpointInterval || fidx_called) {
960960
checkpoint(m);
961961
}
@@ -965,11 +965,11 @@ void Debugger::handleSnapshotPolicy(Module *m) {
965965
if ((fidx_called = isPrimitiveBeingCalled(m, m->pc_ptr))) {
966966
const Type *type = m->functions[*fidx_called].type;
967967
for (uint32_t i = 0; i < type->param_count; i++) {
968-
prim_args[type->param_count - i - 1] = m->stack[m->sp - i].value.uint32;
968+
prim_args[type->param_count - i - 1] =
969+
m->stack[m->sp - i].value.uint32;
969970
}
970971
}
971-
}
972-
else if (snapshotPolicy != SnapshotPolicy::none) {
972+
} else if (snapshotPolicy != SnapshotPolicy::none) {
973973
this->channel->write("WARNING: Invalid snapshot policy.");
974974
}
975975
}
@@ -979,7 +979,8 @@ void Debugger::checkpoint(Module *m, bool force) {
979979
return;
980980
}
981981

982-
this->channel->write(R"(CHECKPOINT {"instructions_executed": %d, )", instructions_executed);
982+
this->channel->write(R"(CHECKPOINT {"instructions_executed": %d, )",
983+
instructions_executed);
983984
if (fidx_called) {
984985
this->channel->write("\"fidx_called\": %d, \"args\": [", *fidx_called);
985986
const Block &func_block = m->functions[*fidx_called];
@@ -1582,7 +1583,8 @@ Debugger::~Debugger() {
15821583
delete this->supervisor;
15831584
}
15841585

1585-
std::optional<uint32_t> Debugger::isPrimitiveBeingCalled(Module *m, uint8_t *pc_ptr) {
1586+
std::optional<uint32_t> Debugger::isPrimitiveBeingCalled(Module *m,
1587+
uint8_t *pc_ptr) {
15861588
if (!pc_ptr) {
15871589
return {};
15881590
}
@@ -1598,8 +1600,7 @@ std::optional<uint32_t> Debugger::isPrimitiveBeingCalled(Module *m, uint8_t *pc_
15981600
}
15991601

16001602
bool Debugger::handleContinueFor(Module *m) {
1601-
if (remaining_instructions < 0)
1602-
return false;
1603+
if (remaining_instructions < 0) return false;
16031604

16041605
if (remaining_instructions == 0) {
16051606
remaining_instructions = -1;
@@ -1616,7 +1617,8 @@ bool Debugger::handleContinueFor(Module *m) {
16161617

16171618
void Debugger::notifyCompleteStep(Module *m) const {
16181619
// Upon completing a step in checkpointing mode, make a checkpoint.
1619-
if (m->warduino->debugger->getSnapshotPolicy() == SnapshotPolicy::checkpointing) {
1620+
if (m->warduino->debugger->getSnapshotPolicy() ==
1621+
SnapshotPolicy::checkpointing) {
16201622
m->warduino->debugger->checkpoint(m);
16211623
}
16221624
this->channel->write("STEP!\n");

src/Edward/proxy_supervisor.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@ bool ProxySupervisor::send(
134134
}
135135

136136
nlohmann::basic_json<> ProxySupervisor::readReply() {
137-
while (!this->hasReplied)
138-
;
137+
while (!this->hasReplied);
139138
WARDuino::instance()->debugger->channel->write("read reply: succeeded\n");
140139
this->hasReplied = false;
141140
return this->proxyResult;

src/Interpreter/interpreter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,8 @@ bool Interpreter::interpret(Module *m, bool waiting) {
453453
}
454454

455455
// Resolve all unhandled callback events
456-
while (CallbackHandler::resolving_event && CallbackHandler::resolve_event())
457-
;
456+
while (CallbackHandler::resolving_event &&
457+
CallbackHandler::resolve_event());
458458

459459
dbg_trace("Interpretation ended %s with status %s\n",
460460
program_done ? "expectedly" : "unexpectedly",

0 commit comments

Comments
 (0)