C++: don't use C++ keywords as names (this, new, etc.)
authorBrian Norris <banorris@uci.edu>
Tue, 13 Mar 2012 18:35:55 +0000 (11:35 -0700)
committerBrian Norris <banorris@uci.edu>
Tue, 13 Mar 2012 18:41:34 +0000 (11:41 -0700)
libthreads.c
schedule.c

index dbaf9e96435a7c04bb3e5301974ef0f315f36cdc..1b7f3db6ac79d37afc20b954f3423b4bd95dfae5 100644 (file)
@@ -51,9 +51,9 @@ static int create_initial_thread(struct thread *t)
        return create_context(t);
 }
 
        return create_context(t);
 }
 
-static int thread_swap(struct thread *old, struct thread *new)
+static int thread_swap(struct thread *t1, struct thread *t2)
 {
 {
-       return swapcontext(&old->context, &new->context);
+       return swapcontext(&t1->context, &t2->context);
 }
 
 static void thread_dispose(struct thread *t)
 }
 
 static void thread_dispose(struct thread *t)
index 290bdf73a6eaf30489e888d4f570d6a4f58e4713..f4f1c13df96232f545423b00fbc968c9c8bd1361 100644 (file)
@@ -6,7 +6,7 @@
 #include "model.h"
 
 struct thread_list_node {
 #include "model.h"
 
 struct thread_list_node {
-       struct thread *this;
+       struct thread *t;
        struct thread_list_node *next;
        int live;
 };
        struct thread_list_node *next;
        int live;
 };
@@ -27,7 +27,7 @@ static void enqueue_thread(struct thread *t)
                printf("ran out of nodes\n");
                exit(1);
        }
                printf("ran out of nodes\n");
                exit(1);
        }
-       node->this = t;
+       node->t = t;
        node->next = NULL;
        node->live = 1;
 
        node->next = NULL;
        node->live = 1;
 
@@ -45,7 +45,7 @@ static struct thread *dequeue_thread(void)
        if (!head)
                return NULL;
 
        if (!head)
                return NULL;
 
-       pop = head->this;
+       pop = head->t;
        head->live = 0;
        if (head == tail)
                tail = NULL;
        head->live = 0;
        if (head == tail)
                tail = NULL;