summary refs log tree commit diff
path: root/src/rt
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2011-07-13 15:44:09 -0700
committerGraydon Hoare <graydon@mozilla.com>2011-07-13 15:44:09 -0700
commit39151f2ad8d18554af1d6787bae0b02345e1d90b (patch)
treec10c032214af521351cd46d6ee23a5007927bc48 /src/rt
parent04b239f3cb9d4b62488dc2d219e9bd9a242bdf8f (diff)
downloadrust-39151f2ad8d18554af1d6787bae0b02345e1d90b.tar.gz
rust-39151f2ad8d18554af1d6787bae0b02345e1d90b.zip
Prohibit trailing whitespace under 'tidy' script. Clean up all caught cases.
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/arch/i386/context.cpp2
-rw-r--r--src/rt/arch/i386/context.h2
-rw-r--r--src/rt/globals.h2
-rw-r--r--src/rt/isaac/randport.cpp2
-rw-r--r--src/rt/memory_region.cpp6
-rw-r--r--src/rt/rust.cpp2
-rw-r--r--src/rt/rust_builtin.cpp2
-rw-r--r--src/rt/rust_chan.cpp2
-rw-r--r--src/rt/rust_kernel.cpp6
-rw-r--r--src/rt/rust_kernel.h4
-rw-r--r--src/rt/rust_message.cpp2
-rw-r--r--src/rt/rust_port.cpp2
-rw-r--r--src/rt/rust_task.cpp6
-rw-r--r--src/rt/rust_task.h2
-rw-r--r--src/rt/rust_timer.cpp2
-rw-r--r--src/rt/rust_upcall.cpp11
-rw-r--r--src/rt/rust_util.h6
-rw-r--r--src/rt/sync/lock_and_signal.cpp2
-rw-r--r--src/rt/sync/lock_and_signal.h2
-rw-r--r--src/rt/sync/sync.h6
20 files changed, 35 insertions, 36 deletions
diff --git a/src/rt/arch/i386/context.cpp b/src/rt/arch/i386/context.cpp
index b68a883a194..a3853d636ee 100644
--- a/src/rt/arch/i386/context.cpp
+++ b/src/rt/arch/i386/context.cpp
@@ -5,7 +5,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-extern "C" uint32_t CDECL swap_registers(registers_t *oregs, 
+extern "C" uint32_t CDECL swap_registers(registers_t *oregs,
                                          registers_t *regs)
   asm ("swap_registers");
 
diff --git a/src/rt/arch/i386/context.h b/src/rt/arch/i386/context.h
index cf14ffe0753..22c331b347e 100644
--- a/src/rt/arch/i386/context.h
+++ b/src/rt/arch/i386/context.h
@@ -22,7 +22,7 @@ class context {
 
 public:
   context();
-  
+
   context *next;
 
   void swap(context &out);
diff --git a/src/rt/globals.h b/src/rt/globals.h
index aa696dd9092..011d4d93218 100644
--- a/src/rt/globals.h
+++ b/src/rt/globals.h
@@ -45,6 +45,6 @@ extern "C" {
                     __FILE__, __LINE__, res, strerror(res));        \
             abort();                                                \
         }                                                           \
-    }                                                               
+    }
 
 #endif /* GLOBALS_H */
diff --git a/src/rt/isaac/randport.cpp b/src/rt/isaac/randport.cpp
index 45ec590dd06..5b40506f856 100644
--- a/src/rt/isaac/randport.cpp
+++ b/src/rt/isaac/randport.cpp
@@ -76,7 +76,7 @@ void randinit(randctx *ctx, word flag)
      mix(a,b,c,d,e,f,g,h);
    }
 
-   if (flag) 
+   if (flag)
    {
      /* initialize using the contents of r[] as the seed */
      for (i=0; i<RANDSIZ; i+=8)
diff --git a/src/rt/memory_region.cpp b/src/rt/memory_region.cpp
index 269f7f7e0cd..13de56a3361 100644
--- a/src/rt/memory_region.cpp
+++ b/src/rt/memory_region.cpp
@@ -67,7 +67,7 @@ memory_region::realloc(void *mem, size_t size) {
     void *newMem = _srv->realloc(mem, size);
 #ifdef TRACK_ALLOCATIONS
     if (_allocation_list[index] != mem) {
-        printf("at index %d, found %p, expected %p\n", 
+        printf("at index %d, found %p, expected %p\n",
                index, _allocation_list[index], mem);
         printf("realloc: ptr 0x%" PRIxPTR " is not in allocation_list\n",
             (uintptr_t) mem);
@@ -76,7 +76,7 @@ memory_region::realloc(void *mem, size_t size) {
     else {
         _allocation_list[index] = newMem;
         (*(int*)newMem) = index;
-        // printf("realloc: stored %p at index %d, replacing %p\n", 
+        // printf("realloc: stored %p at index %d, replacing %p\n",
         //        newMem, index, mem);
     }
 #endif
@@ -101,7 +101,7 @@ memory_region::malloc(size_t size) {
     *p = index;
     // printf("malloc: stored %p at index %d\n", mem, index);
 #endif
-    // printf("malloc: ptr 0x%" PRIxPTR " region=%p\n", 
+    // printf("malloc: ptr 0x%" PRIxPTR " region=%p\n",
     //        (uintptr_t) mem, this);
     if (_synchronized) { _lock.unlock(); }
 #ifdef TRACK_ALLOCATIONS
diff --git a/src/rt/rust.cpp b/src/rt/rust.cpp
index bd2a5ad1b95..76cef811e75 100644
--- a/src/rt/rust.cpp
+++ b/src/rt/rust.cpp
@@ -105,7 +105,7 @@ rust_start(uintptr_t main_fn, int argc, char **argv, void* crate_map) {
     rust_kernel *kernel = new rust_kernel(srv);
     kernel->start();
     rust_scheduler *sched = kernel->get_scheduler();
-    command_line_args *args 
+    command_line_args *args
         = new (kernel) command_line_args(sched->root_task, argc, argv);
 
     DLOG(sched, dom, "startup: %d args in 0x%" PRIxPTR,
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index 998d4aef4c7..1ed2c4ec36d 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -83,7 +83,7 @@ rust_getcwd(rust_task *task) {
     rust_str *st;
     st = new (mem) rust_str(sched, alloc, fill, (const uint8_t *)cbuf);
 
-    return st;    
+    return st;
 }
 
 extern "C" CDECL
diff --git a/src/rt/rust_chan.cpp b/src/rt/rust_chan.cpp
index 5a1da760923..4c176636713 100644
--- a/src/rt/rust_chan.cpp
+++ b/src/rt/rust_chan.cpp
@@ -6,7 +6,7 @@
  */
 rust_chan::rust_chan(rust_task *task,
                      maybe_proxy<rust_port> *port,
-                     size_t unit_sz) 
+                     size_t unit_sz)
     : ref_count(1),
       kernel(task->kernel),
       task(task),
diff --git a/src/rt/rust_kernel.cpp b/src/rt/rust_kernel.cpp
index 92c45f3af91..6a8114e6f52 100644
--- a/src/rt/rust_kernel.cpp
+++ b/src/rt/rust_kernel.cpp
@@ -11,7 +11,7 @@ rust_kernel::rust_kernel(rust_srv *srv) :
     _region(&srv->local_region),
     _log(srv, NULL),
     _srv(srv),
-    _interrupt_kernel_loop(FALSE) 
+    _interrupt_kernel_loop(FALSE)
 {
     sched = create_scheduler("main");
 }
@@ -245,14 +245,14 @@ rust_kernel::signal_kernel_lock() {
 int rust_kernel::start_task_threads(int num_threads)
 {
     rust_task_thread *thread = NULL;
-    
+
     // -1, because this thread will also be a thread.
     for(int i = 0; i < num_threads - 1; ++i) {
         thread = new rust_task_thread(i + 1, this);
         thread->start();
         threads.push(thread);
     }
-    
+
     sched->start_main_loop(0);
 
     while(threads.pop(&thread)) {
diff --git a/src/rt/rust_kernel.h b/src/rt/rust_kernel.h
index 3ed82b22112..9ebd77a0de1 100644
--- a/src/rt/rust_kernel.h
+++ b/src/rt/rust_kernel.h
@@ -126,10 +126,10 @@ public:
 class rust_task_thread : public rust_thread {
     int id;
     rust_kernel *owner;
-    
+
 public:
     rust_task_thread(int id, rust_kernel *owner);
-    
+
     virtual void run();
 };
 
diff --git a/src/rt/rust_message.cpp b/src/rt/rust_message.cpp
index d2f1979a147..85b6ed6b089 100644
--- a/src/rt/rust_message.cpp
+++ b/src/rt/rust_message.cpp
@@ -106,7 +106,7 @@ void data_message::kernel_process() {
 
 }
 
-rust_message_queue::rust_message_queue(rust_srv *srv, rust_kernel *kernel) 
+rust_message_queue::rust_message_queue(rust_srv *srv, rust_kernel *kernel)
     : region(srv, true),
       kernel(kernel),
       sched_handle(NULL) {
diff --git a/src/rt/rust_port.cpp b/src/rt/rust_port.cpp
index d6e794d5d6f..aa909ca109b 100644
--- a/src/rt/rust_port.cpp
+++ b/src/rt/rust_port.cpp
@@ -1,7 +1,7 @@
 #include "rust_internal.h"
 #include "rust_port.h"
 
-rust_port::rust_port(rust_task *task, size_t unit_sz) 
+rust_port::rust_port(rust_task *task, size_t unit_sz)
     : maybe_proxy<rust_port>(this), kernel(task->kernel), task(task),
       unit_sz(unit_sz), writers(task), chans(task) {
 
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 12965568d15..be30f229e7e 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -127,7 +127,7 @@ void task_start_wrapper(spawn_args *a)
     a->f(&rval, task, a->a3, a->a4);
 
     LOG(task, task, "task exited with value %d", rval);
-    
+
 
     LOG(task, task, "task ref_count: %d", task->ref_count);
     A(task->sched, task->ref_count >= 0,
@@ -147,7 +147,7 @@ rust_task::start(uintptr_t spawnee_fn,
     LOGPTR(sched, "from spawnee", spawnee_fn);
 
     I(sched, stk->data != NULL);
-    
+
     char *sp = (char *)rust_sp;
 
     sp -= sizeof(spawn_args);
@@ -481,7 +481,7 @@ rust_task::get_handle() {
 
 bool rust_task::can_schedule(int id)
 {
-    return yield_timer.has_timed_out() && 
+    return yield_timer.has_timed_out() &&
         running_on == -1 &&
         (pinned_on == -1 || pinned_on == id);
 }
diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h
index 721a75b7eb2..0babf4ab7e7 100644
--- a/src/rt/rust_task.h
+++ b/src/rt/rust_task.h
@@ -74,7 +74,7 @@ rust_task : public maybe_proxy<rust_task>,
     rust_handle<rust_task> *handle;
 
     context ctx;
-    
+
     // This flag indicates that a worker is either currently running the task
     // or is about to run this task.
     int running_on;
diff --git a/src/rt/rust_timer.cpp b/src/rt/rust_timer.cpp
index 41e321d9aeb..eb1f30b93ee 100644
--- a/src/rt/rust_timer.cpp
+++ b/src/rt/rust_timer.cpp
@@ -71,7 +71,7 @@ rust_timer::~rust_timer() {
     exit_flag = 1;
 #if defined(__WIN32__)
     sched->kernel->win32_require("WaitForSingleObject",
-                               WaitForSingleObject(thread, INFINITE) == 
+                               WaitForSingleObject(thread, INFINITE) ==
                                WAIT_OBJECT_0);
 #else
     pthread_join(thread, NULL);
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index 1cf2e935e1a..16d7f7c4f83 100644
--- a/src/rt/rust_upcall.cpp
+++ b/src/rt/rust_upcall.cpp
@@ -192,20 +192,20 @@ upcall_recv(rust_task *task, uintptr_t *dptr, rust_port *port) {
     {
         scoped_lock with(port->lock);
         LOG_UPCALL_ENTRY(task);
-    
+
         LOG(task, comm, "port: 0x%" PRIxPTR ", dptr: 0x%" PRIxPTR
             ", size: 0x%" PRIxPTR ", chan_no: %d",
             (uintptr_t) port, (uintptr_t) dptr, port->unit_sz,
             port->chans.length());
-    
+
         if (port->receive(dptr)) {
             return;
         }
-    
+
         // No data was buffered on any incoming channel, so block this task on
         // the port. Remember the rendezvous location so that any sender task
         // can write to it before waking up this task.
-    
+
         LOG(task, comm, "<=== waiting for rendezvous data ===");
         task->rendezvous_ptr = dptr;
         task->block(port, "waiting for rendezvous data");
@@ -351,7 +351,6 @@ rust_str *make_str(rust_task *task, char const *s, size_t fill) {
 extern "C" CDECL rust_str *
 upcall_new_str(rust_task *task, char const *s, size_t fill) {
     LOG_UPCALL_ENTRY(task);
-    
     return make_str(task, s, fill);
 }
 
@@ -537,7 +536,7 @@ upcall_start_task(rust_task *spawner,
     rust_scheduler *sched = spawner->sched;
     DLOG(sched, task,
          "upcall start_task(task %s @0x%" PRIxPTR
-         ", spawnee 0x%" PRIxPTR ")", 
+         ", spawnee 0x%" PRIxPTR ")",
          task->name, task,
          spawnee_fn);
 
diff --git a/src/rt/rust_util.h b/src/rt/rust_util.h
index 90513eab8f2..cf0e4ea20c9 100644
--- a/src/rt/rust_util.h
+++ b/src/rt/rust_util.h
@@ -157,7 +157,7 @@ isaac_init(rust_scheduler *sched, randctx *rctx)
         } else {
             int fd = open("/dev/urandom", O_RDONLY);
             I(sched, fd > 0);
-            I(sched, 
+            I(sched,
               read(fd, (void*) &rctx->randrsl, sizeof(rctx->randrsl))
               == sizeof(rctx->randrsl));
             I(sched, close(fd) == 0);
@@ -175,8 +175,8 @@ rust_vec : public rc_base<rust_vec>
     size_t fill;
     size_t pad; // Pad to align data[0] to 16 bytes.
     uint8_t data[];
-    rust_vec(rust_scheduler *sched, size_t alloc, size_t fill, 
-             uint8_t const *d) 
+    rust_vec(rust_scheduler *sched, size_t alloc, size_t fill,
+             uint8_t const *d)
         : alloc(alloc),
           fill(fill)
     {
diff --git a/src/rt/sync/lock_and_signal.cpp b/src/rt/sync/lock_and_signal.cpp
index f67e3ee310d..3d0d1013889 100644
--- a/src/rt/sync/lock_and_signal.cpp
+++ b/src/rt/sync/lock_and_signal.cpp
@@ -21,7 +21,7 @@ lock_and_signal::lock_and_signal() {
 }
 
 #else
-lock_and_signal::lock_and_signal() 
+lock_and_signal::lock_and_signal()
     : _locked(false)
 {
     CHECKED(pthread_cond_init(&_cond, NULL));
diff --git a/src/rt/sync/lock_and_signal.h b/src/rt/sync/lock_and_signal.h
index 608c1fcbe3e..60c22958342 100644
--- a/src/rt/sync/lock_and_signal.h
+++ b/src/rt/sync/lock_and_signal.h
@@ -30,7 +30,7 @@ public:
 
 class scoped_lock {
   lock_and_signal &lock;
-  
+
 public:
   scoped_lock(lock_and_signal &lock);
   ~scoped_lock();
diff --git a/src/rt/sync/sync.h b/src/rt/sync/sync.h
index 360fff1fabd..a932ef1c2ca 100644
--- a/src/rt/sync/sync.h
+++ b/src/rt/sync/sync.h
@@ -11,7 +11,7 @@ public:
         T oldValue, T newValue) {
         return __sync_bool_compare_and_swap(address, oldValue, newValue);
     }
-    
+
     template <class T>
     static T increment(T *address) {
         return __sync_add_and_fetch(address, 1);
@@ -20,7 +20,7 @@ public:
     template <class T>
     static T decrement(T *address) {
         return __sync_sub_and_fetch(address, 1);
-    }    
+    }
 
     template <class T>
     static T increment(T &address) {
@@ -30,7 +30,7 @@ public:
     template <class T>
     static T decrement(T &address) {
         return __sync_sub_and_fetch(&address, 1);
-    }    
+    }
 };
 
 /**