Patchwork [03/16] petitboot: Rename symbol new

login
register
mail settings
Submitter Geoff Levand
Date Feb. 28, 2009, 12:53 a.m.
Message ID <20090228005350.381392551@am.sony.com>
Download mbox | patch
Permalink /patch/23847/
State Accepted
Headers show

Comments

Geoff Levand - Feb. 28, 2009, 12:53 a.m.
Change the symbol 'new' to an alternative.  The symbol new is
reserved for C++ compilers.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
 lib/list/list.c |   20 ++++++++++----------
 lib/list/list.h |   12 ++++++------
 2 files changed, 16 insertions(+), 16 deletions(-)

Patch

--- a/lib/list/list.c
+++ b/lib/list/list.c
@@ -7,20 +7,20 @@  void list_init(struct list *list)
 	list->head.prev = &list->head;
 }
 
-void list_insert_before(struct list_item *next, struct list_item *new)
+void list_insert_before(struct list_item *next, struct list_item *item)
 {
-	new->next = next;
-	new->prev = next->prev;
-	next->prev->next = new;
-	next->prev = new;
+	item->next = next;
+	item->prev = next->prev;
+	next->prev->next = item;
+	next->prev = item;
 }
 
-void list_insert_after(struct list_item *prev, struct list_item *new)
+void list_insert_after(struct list_item *prev, struct list_item *item)
 {
-	new->next = prev->next;
-	new->prev = prev;
-	prev->next->prev = new;
-	prev->next = new;
+	item->next = prev->next;
+	item->prev = prev;
+	prev->next->prev = item;
+	prev->next = item;
 }
 
 void list_remove(struct list_item *item)
--- a/lib/list/list.h
+++ b/lib/list/list.h
@@ -35,17 +35,17 @@  struct list {
 		_pos = list_entry(_pos->_member.next, typeof(*_pos), _member))
 
 void list_init(struct list *list);
-void list_insert_before(struct list_item *next, struct list_item *new);
-void list_insert_after(struct list_item *prev, struct list_item *new);
+void list_insert_before(struct list_item *next, struct list_item *item);
+void list_insert_after(struct list_item *prev, struct list_item *item);
 void list_remove(struct list_item *item);
 
-static inline void list_add(struct list *list, struct list_item *new)
+static inline void list_add(struct list *list, struct list_item *item)
 {
-	list_insert_after(&list->head, new);
+	list_insert_after(&list->head, item);
 }
-static inline void list_add_tail(struct list *list, struct list_item *new)
+static inline void list_add_tail(struct list *list, struct list_item *item)
 {
-	list_insert_before(&list->head, new);
+	list_insert_before(&list->head, item);
 }
 
 #endif /* _LIST_H */