From: Brian Norris Date: Tue, 13 Mar 2012 18:35:55 +0000 (-0700) Subject: C++: don't use C++ keywords as names (this, new, etc.) X-Git-Tag: pldi2013~584 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ca42b4367e6451fdc8d55a4baa3013c1dda6902e;p=model-checker.git C++: don't use C++ keywords as names (this, new, etc.) --- diff --git a/libthreads.c b/libthreads.c index dbaf9e9..1b7f3db 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 290bdf7..f4f1c13 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;