From ca42b4367e6451fdc8d55a4baa3013c1dda6902e Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Tue, 13 Mar 2012 11:35:55 -0700 Subject: [PATCH] C++: don't use C++ keywords as names (this, new, etc.) --- libthreads.c | 4 ++-- schedule.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libthreads.c b/libthreads.c index dbaf9e96..1b7f3db6 100644 --- a/libthreads.c +++ b/libthreads.c @@ -51,9 +51,9 @@ static int create_initial_thread(struct thread *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) diff --git a/schedule.c b/schedule.c index 290bdf73..f4f1c13d 100644 --- a/schedule.c +++ b/schedule.c @@ -6,7 +6,7 @@ #include "model.h" struct thread_list_node { - struct thread *this; + struct thread *t; 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); } - node->this = t; + node->t = t; node->next = NULL; node->live = 1; @@ -45,7 +45,7 @@ static struct thread *dequeue_thread(void) if (!head) return NULL; - pop = head->this; + pop = head->t; head->live = 0; if (head == tail) tail = NULL; -- 2.34.1