From: Vsevolod Stakhov Date: Tue, 17 Mar 2015 17:08:02 +0000 (+0000) Subject: Constify subr structure. X-Git-Tag: 0.9.0~488^2~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=03d07c2a7511c5a56d92d7373d54275182a2bcf6;p=rspamd.git Constify subr structure. --- diff --git a/src/libutil/expression.c b/src/libutil/expression.c index c24f139b8..001689355 100644 --- a/src/libutil/expression.c +++ b/src/libutil/expression.c @@ -58,7 +58,7 @@ struct rspamd_expression_elt { }; struct rspamd_expression { - struct rspamd_atom_subr *subr; + const struct rspamd_atom_subr *subr; GArray *expressions; GArray *expression_stack; }; @@ -279,7 +279,7 @@ rspamd_expression_destroy (struct rspamd_expression *expr) gboolean rspamd_parse_expression (const gchar *line, gsize len, - struct rspamd_atom_subr *subr, gpointer subr_data, + const struct rspamd_atom_subr *subr, gpointer subr_data, rspamd_mempool_t *pool, GError **err, struct rspamd_expression **target) { @@ -313,6 +313,7 @@ rspamd_parse_expression (const gchar *line, gsize len, e->expressions = g_array_new (FALSE, FALSE, sizeof (struct rspamd_expression_elt)); e->expression_stack = g_array_sized_new (FALSE, FALSE, sizeof (gpointer), 32); + e->subr = subr; /* Shunting-yard algorithm */ while (p < end) { diff --git a/src/libutil/expression.h b/src/libutil/expression.h index 7d771963d..8605bbbda 100644 --- a/src/libutil/expression.h +++ b/src/libutil/expression.h @@ -65,7 +65,7 @@ struct rspamd_expression; * @return TRUE if an expression have been parsed */ gboolean rspamd_parse_expression (const gchar *line, gsize len, - struct rspamd_atom_subr *subr, gpointer subr_data, + const struct rspamd_atom_subr *subr, gpointer subr_data, rspamd_mempool_t *pool, GError **err, struct rspamd_expression **target);