mirror of git://gcc.gnu.org/git/gcc.git
In libobjc/:
* objc-private/objc-list.h (list_remove_elem): Unused function removed. (list_nth): Unused function removed. (list_find): Unused function removed. (list_lenght): Unused function removed. Also, fixed an error in my last commit by adding back objc/hash.h and objc/objc-list.h that had not been committed. From-SVN: r164374
This commit is contained in:
parent
5be9cdc112
commit
349cfd93f4
|
@ -1,3 +1,9 @@
|
||||||
|
2010-09-17 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||||
|
|
||||||
|
* objc-private/objc-list.h (list_remove_elem): Unused function
|
||||||
|
removed. (list_nth): Unused function removed. (list_find):
|
||||||
|
Unused function removed. (list_lenght): Unused function removed.
|
||||||
|
|
||||||
2010-09-17 Nicola Pero <nicola.pero@meta-innovation.com>
|
2010-09-17 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||||
|
|
||||||
* objc/hash.h: Moved into objc/deprecated/hash.h; objc/hash.h
|
* objc/hash.h: Moved into objc/deprecated/hash.h; objc/hash.h
|
||||||
|
@ -20,7 +26,6 @@
|
||||||
* sarray.c: Same change.
|
* sarray.c: Same change.
|
||||||
* sendmsg.c: Same change.
|
* sendmsg.c: Same change.
|
||||||
* Makefile.in (OBJC_DEPRECATED_H): Added hash.h and objc-list.h.
|
* Makefile.in (OBJC_DEPRECATED_H): Added hash.h and objc-list.h.
|
||||||
(OBJC_H): Removed hash.h and objc-list.h
|
|
||||||
|
|
||||||
2010-09-14 Nicola Pero <nicola.pero@meta-innovation.com>
|
2010-09-14 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||||
|
|
||||||
|
|
|
@ -123,6 +123,8 @@ OBJC_H = \
|
||||||
sarray.h \
|
sarray.h \
|
||||||
thr.h \
|
thr.h \
|
||||||
\
|
\
|
||||||
|
hash.h \
|
||||||
|
objc-list.h \
|
||||||
typedstream.h
|
typedstream.h
|
||||||
|
|
||||||
# User-visible header files containing deprecated APIs, from the
|
# User-visible header files containing deprecated APIs, from the
|
||||||
|
|
|
@ -49,36 +49,6 @@ list_cons(void* head, struct objc_list* tail)
|
||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the length of a list, list_length(NULL) returns zero */
|
|
||||||
|
|
||||||
static inline int
|
|
||||||
list_length(struct objc_list* list)
|
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
while(list)
|
|
||||||
{
|
|
||||||
i += 1;
|
|
||||||
list = list->tail;
|
|
||||||
}
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Return the Nth element of LIST, where N count from zero. If N
|
|
||||||
larger than the list length, NULL is returned */
|
|
||||||
|
|
||||||
static inline void*
|
|
||||||
list_nth(int indx, struct objc_list* list)
|
|
||||||
{
|
|
||||||
while(indx-- != 0)
|
|
||||||
{
|
|
||||||
if(list->tail)
|
|
||||||
list = list->tail;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return list->head;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Remove the element at the head by replacing it by its successor */
|
/* Remove the element at the head by replacing it by its successor */
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
@ -98,18 +68,6 @@ list_remove_head(struct objc_list** list)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Remove the element with `car' set to ELEMENT */
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
list_remove_elem(struct objc_list** list, void* elem)
|
|
||||||
{
|
|
||||||
while (*list) {
|
|
||||||
if ((*list)->head == elem)
|
|
||||||
list_remove_head(list);
|
|
||||||
list = &((*list)->tail);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Map FUNCTION over all elements in LIST */
|
/* Map FUNCTION over all elements in LIST */
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
@ -122,20 +80,6 @@ list_mapcar(struct objc_list* list, void(*function)(void*))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return element that has ELEM as car */
|
|
||||||
|
|
||||||
static inline struct objc_list**
|
|
||||||
list_find(struct objc_list** list, void* elem)
|
|
||||||
{
|
|
||||||
while(*list)
|
|
||||||
{
|
|
||||||
if ((*list)->head == elem)
|
|
||||||
return list;
|
|
||||||
list = &((*list)->tail);
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Free list (backwards recursive) */
|
/* Free list (backwards recursive) */
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
#include "objc.h"
|
||||||
|
#include "deprecated/hash.h"
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
#include "deprecated/objc-list.h"
|
||||||
|
|
Loading…
Reference in New Issue