Skip to content

Commit 2106463

Browse files
committed
rt: Fix whitespace
1 parent cf0c4cd commit 2106463

20 files changed

+109
-99
lines changed

src/rt/arch/x86_64/context.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ struct registers_t {
3131
class context {
3232
public:
3333
registers_t regs;
34-
34+
3535
context();
36-
36+
3737
context *next;
38-
38+
3939
void swap(context &out);
4040
void call(void *f, void *arg, void *sp);
4141
};

src/rt/memory_region.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class memory_region {
4141

4242
inline alloc_header *get_header(void *mem);
4343
inline void *get_data(alloc_header *);
44-
4544

4645
rust_srv *_srv;
4746
memory_region *_parent;

src/rt/rust_box_annihilator.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ class annihilator : public shape::data<annihilator,shape::ptr> {
5858
}
5959

6060
void walk_tag2(shape::tag_info &tinfo, uint32_t tag_variant) {
61-
shape::data<annihilator,shape::ptr>::walk_variant1(tinfo, tag_variant);
61+
shape::data<annihilator,shape::ptr>
62+
::walk_variant1(tinfo, tag_variant);
6263
}
6364

6465
void walk_uniq2() {
@@ -83,7 +84,7 @@ class annihilator : public shape::data<annihilator,shape::ptr> {
8384
if (pair.env) {
8485
// free closed over data:
8586
shape::data<annihilator,shape::ptr>::walk_fn_contents1();
86-
87+
8788
// now free the ptr:
8889
task->kernel->free(pair.env);
8990
}

src/rt/rust_cc.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,11 @@ irc::compute_ircs(rust_task *task, irc_map &ircs) {
210210
type_desc *tydesc = box->td;
211211
uint8_t *body = (uint8_t*) box_body(box);
212212

213-
LOG(task, gc,
213+
LOG(task, gc,
214214
"determining internal ref counts: "
215215
"box=%p tydesc=%p body=%p",
216216
box, tydesc, body);
217-
217+
218218
shape::arena arena;
219219
shape::type_param *params =
220220
shape::type_param::from_tydesc_and_data(tydesc, body, arena);
@@ -425,7 +425,7 @@ void
425425
mark::do_mark(rust_task *task,
426426
const std::vector<rust_opaque_box *> &roots,
427427
std::set<rust_opaque_box *> &marked) {
428-
std::vector<rust_opaque_box *>::const_iterator
428+
std::vector<rust_opaque_box *>::const_iterator
429429
begin(roots.begin()),
430430
end(roots.end());
431431
while (begin != end) {

src/rt/rust_env.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ static size_t
8484
get_max_stk_size() {
8585
char *maxsz = getenv(RUST_MAX_STACK);
8686
if (maxsz) {
87-
return strtol(maxsz, NULL, 0);
87+
return strtol(maxsz, NULL, 0);
8888
}
8989
else {
90-
return 1024*1024*8;
90+
return 1024*1024*8;
9191
}
9292
}
9393

src/rt/rust_kernel.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ rust_kernel::create_scheduler(size_t num_threads) {
6767
sched = new (this, "rust_scheduler")
6868
rust_scheduler(this, srv, num_threads, id);
6969
bool is_new = sched_table
70-
.insert(std::pair<rust_sched_id, rust_scheduler*>(id, sched)).second;
70+
.insert(std::pair<rust_sched_id,
71+
rust_scheduler*>(id, sched)).second;
7172
A(this, is_new, "Reusing a sched id?");
7273
}
7374
sched->start_task_threads();

src/rt/rust_port_selector.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ rust_port_selector::select(rust_task *task, rust_port **dptr,
5050
task->rendezvous_ptr = (uintptr_t*)dptr;
5151
task->block(this, "waiting for select rendezvous");
5252

53-
// Blocking the task might fail if the task has already been
54-
// killed, but in the event of both failure and success the
55-
// task needs to yield. On success, it yields and waits to be
56-
// unblocked. On failure it yields and is then fails the task.
53+
// Blocking the task might fail if the task has already been
54+
// killed, but in the event of both failure and success the
55+
// task needs to yield. On success, it yields and waits to be
56+
// unblocked. On failure it yields and is then fails the task.
5757

5858
*yield = true;
5959
}

src/rt/rust_port_selector.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class rust_port_selector : public rust_cond {
1616
rust_port_selector();
1717

1818
void select(rust_task *task,
19-
rust_port **dptr,
20-
rust_port **ports,
21-
size_t n_ports,
22-
uintptr_t *yield);
19+
rust_port **dptr,
20+
rust_port **ports,
21+
size_t n_ports,
22+
uintptr_t *yield);
2323

2424
void msg_sent_on(rust_port *port);
2525
};

src/rt/rust_scheduler.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#include "rust_util.h"
33

44
rust_scheduler::rust_scheduler(rust_kernel *kernel,
5-
rust_srv *srv,
6-
size_t num_threads,
7-
rust_sched_id id) :
5+
rust_srv *srv,
6+
size_t num_threads,
7+
rust_sched_id id) :
88
kernel(kernel),
99
srv(srv),
1010
env(srv->env),
@@ -107,8 +107,8 @@ rust_scheduler::release_task() {
107107
}
108108
}
109109
if (need_exit) {
110-
// There are no more tasks on this scheduler. Time to leave
111-
exit();
110+
// There are no more tasks on this scheduler. Time to leave
111+
exit();
112112
}
113113
}
114114

src/rt/rust_scheduler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class rust_scheduler : public kernel_owned<rust_scheduler> {
3333

3434
public:
3535
rust_scheduler(rust_kernel *kernel, rust_srv *srv, size_t num_threads,
36-
rust_sched_id id);
36+
rust_sched_id id);
3737
~rust_scheduler();
3838

3939
void start_task_threads();

src/rt/rust_shape.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,8 @@ class cmp : public data<cmp,ptr_pair> {
362362
void walk_fn2(char) { return cmp_two_pointers(); }
363363
void walk_obj2() { return cmp_two_pointers(); }
364364

365-
void walk_tag2(tag_info &tinfo, const data_pair<tag_variant_t> &tag_variants);
365+
void walk_tag2(tag_info &tinfo,
366+
const data_pair<tag_variant_t> &tag_variants);
366367
void walk_struct2(const uint8_t *end_sp);
367368
void walk_res2(const rust_fn *dtor, uint16_t n_ty_params,
368369
const type_param *ty_params_sp, const uint8_t *end_sp,
@@ -400,7 +401,8 @@ cmp::walk_vec2(bool is_pod, const std::pair<ptr_pair,ptr_pair> &data_range) {
400401
}
401402

402403
void
403-
cmp::walk_tag2(tag_info &tinfo, const data_pair<tag_variant_t> &tag_variants) {
404+
cmp::walk_tag2(tag_info &tinfo,
405+
const data_pair<tag_variant_t> &tag_variants) {
404406
cmp_number(tag_variants);
405407
if (result != 0)
406408
return;
@@ -548,8 +550,8 @@ log::walk_res2(const rust_fn *dtor, unsigned n_params,
548550

549551
extern "C" void
550552
shape_cmp_type(int8_t *result, const type_desc *tydesc,
551-
const type_desc **subtydescs, uint8_t *data_0,
552-
uint8_t *data_1, uint8_t cmp_type) {
553+
const type_desc **subtydescs, uint8_t *data_0,
554+
uint8_t *data_1, uint8_t cmp_type) {
553555
rust_task *task = rust_task_thread::get_task();
554556
shape::arena arena;
555557

src/rt/rust_shape.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ ctxt<T>::get_variant_sp(tag_info &tinfo, tag_variant_t variant_id) {
395395
const uint8_t *variant_ptr = tables->tags + variant_offset;
396396
uint16_t variant_len = get_u16_bump(variant_ptr);
397397
const uint8_t *variant_end = variant_ptr + variant_len;
398-
398+
399399
return std::make_pair(variant_ptr, variant_end);
400400
}
401401

@@ -936,7 +936,7 @@ class data : public ctxt< data<T,U> > {
936936
}
937937

938938
template<typename WN>
939-
void walk_number1() {
939+
void walk_number1() {
940940
//DATA_SIMPLE(W, walk_number2<W>());
941941
ALIGN_TO(rust_alignof<WN>());
942942
U end_dp = dp + sizeof(WN);
@@ -1158,7 +1158,8 @@ class log : public data<log,ptr> {
11581158
variant_ptr_and_end);
11591159
void walk_string2(const std::pair<ptr,ptr> &data);
11601160
void walk_res2(const rust_fn *dtor, unsigned n_params,
1161-
const type_param *params, const uint8_t *end_sp, bool live);
1161+
const type_param *params, const uint8_t *end_sp,
1162+
bool live);
11621163

11631164
template<typename T>
11641165
inline void walk_number2() {

src/rt/rust_stack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ reuse_valgrind_stack(stk_seg *stk, uint8_t *sp) {
2222
// old stack segments, since the act of popping the stack previously
2323
// caused valgrind to consider the whole thing inaccessible.
2424
assert(sp >= stk->data && sp <= (uint8_t*) stk->end
25-
&& "Stack pointer must be inside stack segment");
25+
&& "Stack pointer must be inside stack segment");
2626
size_t sz = stk->end - (uintptr_t)sp;
2727
(void) VALGRIND_MAKE_MEM_UNDEFINED(sp, sz);
2828
(void) sz;

src/rt/rust_task.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ rust_task::rust_task(rust_task_thread *thread, rust_task_state state,
4444
supervisor(spawner)
4545
{
4646
LOGPTR(thread, "new task", (uintptr_t)this);
47-
DLOG(thread, task, "sizeof(task) = %d (0x%x)", sizeof *this, sizeof *this);
47+
DLOG(thread, task, "sizeof(task) = %d (0x%x)",
48+
sizeof *this, sizeof *this);
4849

4950
new_stack(init_stack_sz);
5051
if (supervisor) {
@@ -136,7 +137,7 @@ void task_start_wrapper(spawn_args *a)
136137

137138
bool threw_exception = false;
138139
try {
139-
// The first argument is the return pointer; as the task fn
140+
// The first argument is the return pointer; as the task fn
140141
// must have void return type, we can safely pass 0.
141142
a->f(0, a->envptr, a->argptr);
142143
} catch (rust_task *ex) {
@@ -400,7 +401,8 @@ rust_task::wakeup(rust_cond *from) {
400401
A(thread, cond != NULL, "Cannot wake up unblocked task.");
401402
LOG(this, task, "Blocked on 0x%" PRIxPTR " woken up on 0x%" PRIxPTR,
402403
(uintptr_t) cond, (uintptr_t) from);
403-
A(thread, cond == from, "Cannot wake up blocked task on wrong condition.");
404+
A(thread, cond == from,
405+
"Cannot wake up blocked task on wrong condition.");
404406

405407
transition(task_state_blocked, task_state_running, NULL, "none");
406408
}

src/rt/rust_task.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ rust_task : public kernel_owned<rust_task>, rust_cond
252252
void prev_stack();
253253
void record_stack_limit();
254254
void reset_stack_limit();
255-
255+
256256
bool on_rust_stack();
257257
void check_stack_canary();
258258
void delete_all_stacks();

src/rt/rust_task_thread.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ rust_task_thread::log_state() {
176176
if (!blocked_tasks.is_empty()) {
177177
log(NULL, log_debug, "blocked tasks:");
178178
for (size_t i = 0; i < blocked_tasks.length(); i++) {
179-
log(NULL, log_debug, "\t task: %s @0x%" PRIxPTR ", blocked on: 0x%"
180-
PRIxPTR " '%s'",
179+
log(NULL, log_debug, "\t task: %s @0x%" PRIxPTR
180+
", blocked on: 0x%" PRIxPTR " '%s'",
181181
blocked_tasks[i]->name, blocked_tasks[i],
182182
blocked_tasks[i]->get_cond(),
183183
blocked_tasks[i]->get_cond_name());
@@ -300,7 +300,7 @@ rust_task_thread::state_name(rust_task_state state) {
300300
}
301301
}
302302

303-
void
303+
void
304304
rust_task_thread::transition(rust_task *task,
305305
rust_task_state src, rust_task_state dst,
306306
rust_cond *cond, const char* cond_name) {

src/rt/rust_upcall.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ extern "C" CDECL void
118118
upcall_s_fail(s_fail_args *args) {
119119
rust_task *task = rust_task_thread::get_task();
120120
LOG_UPCALL_ENTRY(task);
121-
LOG_ERR(task, upcall, "upcall fail '%s', %s:%" PRIdPTR,
121+
LOG_ERR(task, upcall, "upcall fail '%s', %s:%" PRIdPTR,
122122
args->expr, args->file, args->line);
123123
task->fail();
124124
}
@@ -416,7 +416,8 @@ extern "C" void
416416
upcall_cmp_type(int8_t *result, const type_desc *tydesc,
417417
const type_desc **subtydescs, uint8_t *data_0,
418418
uint8_t *data_1, uint8_t cmp_type) {
419-
s_cmp_type_args args = {result, tydesc, subtydescs, data_0, data_1, cmp_type};
419+
s_cmp_type_args args = {result, tydesc, subtydescs,
420+
data_0, data_1, cmp_type};
420421
UPCALL_SWITCH_STACK(&args, upcall_s_cmp_type);
421422
}
422423

src/rt/rust_util.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ vec_data(rust_vec *v) {
9595

9696
inline void reserve_vec_exact(rust_task* task, rust_vec** vpp, size_t size) {
9797
if (size > (*vpp)->alloc) {
98-
*vpp = (rust_vec*)task->kernel->realloc(*vpp, size + sizeof(rust_vec));
98+
*vpp = (rust_vec*)task->kernel
99+
->realloc(*vpp, size + sizeof(rust_vec));
99100
(*vpp)->alloc = size;
100101
}
101102
}
@@ -107,7 +108,8 @@ inline void reserve_vec(rust_task* task, rust_vec** vpp, size_t size) {
107108
typedef rust_vec rust_str;
108109

109110
inline rust_str *
110-
make_str(rust_kernel* kernel, const char* c, size_t strlen, const char* name) {
111+
make_str(rust_kernel* kernel, const char* c, size_t strlen,
112+
const char* name) {
111113
size_t str_fill = strlen + 1;
112114
size_t str_alloc = str_fill;
113115
rust_str *str = (rust_str *)

0 commit comments

Comments
 (0)