The previous fix for spacing was (a) totally out of context, (b) wrong.
Please *read* the code when trying to change it. Also killed a couple of type clashes.
This commit is contained in:
parent
2bd2de0188
commit
700bbe60fb
1 changed files with 9 additions and 12 deletions
21
nest/a-set.c
21
nest/a-set.c
|
@ -23,19 +23,16 @@ int_set_format(struct adata *set, byte *buf, unsigned int size)
|
||||||
|
|
||||||
while (l--)
|
while (l--)
|
||||||
{
|
{
|
||||||
if (sp)
|
if (!sp)
|
||||||
{
|
*buf++ = ' ';
|
||||||
sp = 0;
|
|
||||||
*buf++ = ' ';
|
|
||||||
}
|
|
||||||
if (buf > end)
|
if (buf > end)
|
||||||
{
|
{
|
||||||
strcpy(buf, "...");
|
strcpy(buf, "...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* FIXME: should not we use same syntax as in filters (i.e. (x,y) )? */
|
buf += bsprintf(buf, "(%d,%d)", *z >> 16, *z & 0xffff);
|
||||||
buf += bsprintf(buf, "%d:%d ", *z/65536, *z & 0xffff);
|
|
||||||
z++;
|
z++;
|
||||||
|
sp = 0;
|
||||||
}
|
}
|
||||||
*buf = 0;
|
*buf = 0;
|
||||||
}
|
}
|
||||||
|
@ -53,8 +50,8 @@ int_set_add(struct linpool *pool, struct adata *list, u32 val)
|
||||||
int
|
int
|
||||||
int_set_contains(struct adata *list, u32 val)
|
int_set_contains(struct adata *list, u32 val)
|
||||||
{
|
{
|
||||||
u32 *l = &(list->data);
|
u32 *l = (u32 *) list->data;
|
||||||
int i;
|
unsigned int i;
|
||||||
for (i=0; i<list->length/4; i++)
|
for (i=0; i<list->length/4; i++)
|
||||||
if (*l++ == val)
|
if (*l++ == val)
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -66,7 +63,7 @@ int_set_del(struct linpool *pool, struct adata *list, u32 val)
|
||||||
{
|
{
|
||||||
struct adata *res;
|
struct adata *res;
|
||||||
u32 *l, *k;
|
u32 *l, *k;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
if (!int_set_contains(list, val))
|
if (!int_set_contains(list, val))
|
||||||
return list;
|
return list;
|
||||||
|
@ -74,8 +71,8 @@ int_set_del(struct linpool *pool, struct adata *list, u32 val)
|
||||||
res = lp_alloc(pool, list->length + sizeof(struct adata) - 4);
|
res = lp_alloc(pool, list->length + sizeof(struct adata) - 4);
|
||||||
res->length = list->length-4;
|
res->length = list->length-4;
|
||||||
|
|
||||||
l = &(list->data);
|
l = (u32 *) list->data;
|
||||||
k = &(res->data);
|
k = (u32 *) res->data;
|
||||||
for (i=0; i<list->length/4; i++)
|
for (i=0; i<list->length/4; i++)
|
||||||
if (l[i] != val)
|
if (l[i] != val)
|
||||||
*k++ = l[i];
|
*k++ = l[i];
|
||||||
|
|
Loading…
Reference in a new issue