Cleaned up warnings.

This commit is contained in:
Pavel Machek 2000-05-25 15:20:40 +00:00
parent 69477cad70
commit ad9074e9ba
3 changed files with 15 additions and 21 deletions

View file

@ -5,13 +5,6 @@
* *
* Can be freely distributed and used under the terms of the GNU GPL. * Can be freely distributed and used under the terms of the GNU GPL.
* *
FIXME (nonurgent): define keyword
FIXME (for BGP): whole system of paths, path ~ string, path.prepend(), path.originate
FIXME: create community lists
FIXME: IP addresses in ipv6
FIXME: check messages for \n at the end
*/ */
CF_HDR CF_HDR
@ -77,7 +70,7 @@ type:
| type SET { | type SET {
switch ($1) { switch ($1) {
default: default:
cf_error( "You can not create sets of this type\n" ); cf_error( "You can not create sets of this type" );
case T_INT: case T_IP: case T_PREFIX: case T_PAIR: case T_INT: case T_IP: case T_PREFIX: case T_PAIR:
} }
$$ = $1 | T_SET; $$ = $1 | T_SET;
@ -184,7 +177,7 @@ cmds: /* EMPTY */ { $$ = NULL; }
| cmd cmds { | cmd cmds {
if ($1) { if ($1) {
if ($1->next) if ($1->next)
bug("Command has next already set\n"); bug("Command has next already set");
$1->next = $2; $1->next = $2;
$$ = $1; $$ = $1;
} else $$ = $2; } else $$ = $2;
@ -496,7 +489,7 @@ cmd:
$$ = f_new_inst(); $$ = f_new_inst();
DBG( "Ook, we'll set value\n" ); DBG( "Ook, we'll set value\n" );
if (($1->class & ~T_MASK) != SYM_VARIABLE) if (($1->class & ~T_MASK) != SYM_VARIABLE)
cf_error( "You may only set variables, and this is %x.\n", $1->class ); cf_error( "You may only set variables, and this is %x.", $1->class );
$$->code = 's'; $$->code = 's';
$$->a1.p = $1; $$->a1.p = $1;
$$->a2.p = $3; $$->a2.p = $3;

View file

@ -45,6 +45,14 @@
#define CMP_ERROR 999 #define CMP_ERROR 999
struct adata *
adata_empty(struct linpool *pool)
{
struct adata *res = lp_alloc(pool, sizeof(struct adata));
res->length = 0;
return res;
}
static int static int
pm_path_compare(struct f_path_mask *m1, struct f_path_mask *m2) pm_path_compare(struct f_path_mask *m1, struct f_path_mask *m2)
{ {
@ -173,7 +181,7 @@ val_print(struct f_val v)
case T_ENUM: PRINTF( "(enum %x)%d", v.type, v.val.i ); break; case T_ENUM: PRINTF( "(enum %x)%d", v.type, v.val.i ); break;
case T_PATH: as_path_format(v.val.ad, buf2, 1020); PRINTF( "(path %s)", buf2 ); break; case T_PATH: as_path_format(v.val.ad, buf2, 1020); PRINTF( "(path %s)", buf2 ); break;
case T_CLIST: int_set_format(v.val.ad, buf2, 1020); PRINTF( "(clist %s)", buf2 ); break; case T_CLIST: int_set_format(v.val.ad, buf2, 1020); PRINTF( "(clist %s)", buf2 ); break;
case T_PATH_MASK: debug( "(pathmask " ); { struct f_path_mask *p = v.val.s; while (p) { debug("%d ", p->val); p=p->next; } debug(")" ); } break; case T_PATH_MASK: debug( "(pathmask " ); { struct f_path_mask *p = v.val.path_mask; while (p) { debug("%d ", p->val); p=p->next; } debug(")" ); } break;
default: PRINTF( "[unknown type %x]", v.type ); default: PRINTF( "[unknown type %x]", v.type );
#undef PRINTF #undef PRINTF
} }
@ -423,7 +431,7 @@ interpret(struct f_inst *what)
res.val.ad = e->u.ptr; res.val.ad = e->u.ptr;
break; break;
default: default:
bug("Unknown type in e,a\n"); bug("Unknown type in e,a");
} }
} }
break; break;
@ -727,11 +735,3 @@ filter_same(struct filter *new, struct filter *old)
return 0; return 0;
return i_same(new->root, old->root); return i_same(new->root, old->root);
} }
struct adata *
adata_empty(struct linpool *pool)
{
struct adata *res = lp_alloc(pool, sizeof(struct adata));
res->length = 0;
return res;
}

View file

@ -62,6 +62,7 @@ struct filter {
struct f_inst *f_new_inst(void); struct f_inst *f_new_inst(void);
struct f_inst *f_new_dynamic_attr(int type, int f_type, int code); /* Type as core knows it, type as filters know it, and code of dynamic attribute */ struct f_inst *f_new_dynamic_attr(int type, int f_type, int code); /* Type as core knows it, type as filters know it, and code of dynamic attribute */
struct f_tree *f_new_tree(void); struct f_tree *f_new_tree(void);
struct f_inst *f_generate_complex(int operation, int operation_aux, struct f_inst *dyn, struct f_inst *argument);
struct f_tree *build_tree(struct f_tree *); struct f_tree *build_tree(struct f_tree *);
struct f_tree *find_tree(struct f_tree *t, struct f_val val); struct f_tree *find_tree(struct f_tree *t, struct f_val val);