Просмотр исходного кода

don't shadow the global type name, "timer_handle"

* exec/coropoll.c (poll_timer_delete): Rename locals and/or params.
* exec/timer.c (corosync_timer_delete): Likewise.
(corosync_timer_expire_time_get): Likewise.
* exec/tlist.h (timerlist_del, timerlist_expire_time): Likewise.
(timerlist_pre_dispatch, timerlist_post_dispatch): Likewise.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2067 fd59a12c-fef9-0310-b244-a6a79926bd2f
Jim Meyering 17 лет назад
Родитель
Сommit
88ee2815da
3 измененных файлов с 20 добавлено и 19 удалено
  1. 4 4
      exec/coropoll.c
  2. 6 6
      exec/timer.c
  3. 10 9
      exec/tlist.h

+ 4 - 4
exec/coropoll.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2003-2004 MontaVista Software, Inc.
- * Copyright (c) 2006-2008 Red Hat, Inc.
+ * Copyright (c) 2006-2009 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -305,12 +305,12 @@ error_exit:
 
 int poll_timer_delete (
 	hdb_handle_t handle,
-	poll_timer_handle timer_handle)
+	poll_timer_handle th)
 {
 	struct poll_instance *poll_instance;
 	int res = 0;
 
-	if (timer_handle == 0) {
+	if (th == 0) {
 		return (0);
 	}
 	res = hdb_handle_get (&poll_instance_database, handle,
@@ -320,7 +320,7 @@ int poll_timer_delete (
 		goto error_exit;
 	}
 
-	timerlist_del (&poll_instance->timerlist, (void *)timer_handle);
+	timerlist_del (&poll_instance->timerlist, (void *)th);
 
 	hdb_handle_put (&poll_instance_database, handle);
 

+ 6 - 6
exec/timer.c

@@ -240,11 +240,11 @@ int corosync_timer_add_duration (
 }
 
 void corosync_timer_delete (
-	timer_handle timer_handle)
+	timer_handle th)
 {
 	int unlock;
 
-	if (timer_handle == 0) {
+	if (th == 0) {
 		return;
 	}
 
@@ -255,7 +255,7 @@ void corosync_timer_delete (
 		pthread_mutex_lock (&timer_mutex);
 	}
 
-	timerlist_del (&timers_timerlist, timer_handle);
+	timerlist_del (&timers_timerlist, th);
 
 	if (unlock) {
 		pthread_mutex_unlock (&timer_mutex);
@@ -278,12 +278,12 @@ unsigned long long corosync_timer_time_get (void)
 }
 
 unsigned long long corosync_timer_expire_time_get (
-	timer_handle timer_handle)
+	timer_handle th)
 {
 	int unlock;
 	unsigned long long expire;
 
-	if (timer_handle == 0) {
+	if (th == 0) {
 		return (0);
 	}
 
@@ -294,7 +294,7 @@ unsigned long long corosync_timer_expire_time_get (
 		pthread_mutex_lock (&timer_mutex);
 	}
 
-	expire = timerlist_expire_time (&timers_timerlist, timer_handle);
+	expire = timerlist_expire_time (&timers_timerlist, th);
 
 	if (unlock) {
 		pthread_mutex_unlock (&timer_mutex);

+ 10 - 9
exec/tlist.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2003-2004 MontaVista Software, Inc.
- * Copyright (c) 2006-2007 Red Hat, Inc.
+ * Copyright (c) 2006-2007, 2009 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -154,9 +154,10 @@ static inline int timerlist_add_duration (struct timerlist *timerlist,
 	return (0);
 }
 
-static inline void timerlist_del (struct timerlist *timerlist, timer_handle timer_handle)
+static inline void timerlist_del (struct timerlist *timerlist,
+				  timer_handle _timer_handle)
 {
-	struct timerlist_timer *timer = (struct timerlist_timer *)timer_handle;
+	struct timerlist_timer *timer = (struct timerlist_timer *)_timer_handle;
 
 	memset (timer->handle_addr, 0, sizeof (struct timerlist_timer *));
 	/*
@@ -172,25 +173,25 @@ static inline void timerlist_del (struct timerlist *timerlist, timer_handle time
 	free (timer);
 }
 
-static inline unsigned long long timerlist_expire_time (struct timerlist *timerlist, timer_handle timer_handle)
+static inline unsigned long long timerlist_expire_time (struct timerlist *timerlist, timer_handle _timer_handle)
 {
-	struct timerlist_timer *timer = (struct timerlist_timer *)timer_handle;
+	struct timerlist_timer *timer = (struct timerlist_timer *)_timer_handle;
 
 	return (timer->nano_from_epoch);
 }
 
-static inline void timerlist_pre_dispatch (struct timerlist *timerlist, timer_handle timer_handle)
+static inline void timerlist_pre_dispatch (struct timerlist *timerlist, timer_handle _timer_handle)
 {
-	struct timerlist_timer *timer = (struct timerlist_timer *)timer_handle;
+	struct timerlist_timer *timer = (struct timerlist_timer *)_timer_handle;
 
 	memset (timer->handle_addr, 0, sizeof (struct timerlist_timer *));
 	list_del (&timer->list);
 	list_init (&timer->list);
 }
 
-static inline void timerlist_post_dispatch (struct timerlist *timerlist, timer_handle timer_handle)
+static inline void timerlist_post_dispatch (struct timerlist *timerlist, timer_handle _timer_handle)
 {
-	struct timerlist_timer *timer = (struct timerlist_timer *)timer_handle;
+	struct timerlist_timer *timer = (struct timerlist_timer *)_timer_handle;
 
 	free (timer);
 }