update controller code
This commit is contained in:
parent
2836d196da
commit
41f56fa6ed
54 changed files with 9688 additions and 214 deletions
|
|
@ -35,10 +35,10 @@ static int xlist_ensure(xlist_t* l)
|
|||
}
|
||||
|
||||
l->data = p;
|
||||
for(i = l->caps; i < nc; i ++) {
|
||||
l->data[i] = NULL;
|
||||
for (i = l->caps; i < nc; i++) {
|
||||
l->data[i] = NULL;
|
||||
}
|
||||
|
||||
|
||||
l->caps = nc;
|
||||
|
||||
return 1;
|
||||
|
|
@ -64,25 +64,27 @@ int xlist_store(xlist_t* l,
|
|||
return 1;
|
||||
}
|
||||
|
||||
void xlist_clear(xlist_t *l) {
|
||||
void xlist_clear(xlist_t* l)
|
||||
{
|
||||
if (l == NULL) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
l->count = 0;
|
||||
}
|
||||
|
||||
int xlist_iter(xlist_t *l,
|
||||
xlist_iter_fn_t fn,
|
||||
void *data) {
|
||||
int xlist_iter(xlist_t* l,
|
||||
xlist_iter_fn_t fn,
|
||||
void* data)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
if ((l == NULL) || (fn == NULL)) {
|
||||
return -EINVAL;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
for(i = 0; i < l->count; i ++) {
|
||||
(*fn)((void *)l->data[i], data);
|
||||
for (i = 0; i < l->count; i++) {
|
||||
(*fn)((void*)l->data[i], data);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue