]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: event filter - Move add_node higher up in the file to avoid a prototype
authorJosef 'Jeff' Sipek <jeff.sipek@open-xchange.com>
Wed, 21 Apr 2021 15:52:27 +0000 (11:52 -0400)
committerjeff.sipek <jeff.sipek@open-xchange.com>
Tue, 27 Apr 2021 17:46:14 +0000 (17:46 +0000)
src/lib/event-filter.c

index 57fda3896931bac470037e5a11f994db6a9d8eca..9e5a00b9f07d37477707b275ffab4d7e8d2bc9a5 100644 (file)
@@ -103,6 +103,28 @@ void event_filter_unref(struct event_filter **_filter)
        }
 }
 
+static void add_node(pool_t pool, struct event_filter_node **root,
+                    struct event_filter_node *new,
+                    enum event_filter_node_op op)
+{
+       struct event_filter_node *parent;
+
+       i_assert((op == EVENT_FILTER_OP_AND) || (op == EVENT_FILTER_OP_OR));
+
+       if (*root == NULL) {
+               *root = new;
+               return;
+       }
+
+       parent = p_new(pool, struct event_filter_node, 1);
+       parent->type = EVENT_FILTER_NODE_TYPE_LOGIC;
+       parent->op = op;
+       parent->children[0] = *root;
+       parent->children[1] = new;
+
+       *root = parent;
+}
+
 int event_filter_parse(const char *str, struct event_filter *filter,
                       const char **error_r)
 {
@@ -173,28 +195,6 @@ event_filter_category_from_log_type(enum event_filter_log_type log_type)
        i_unreached();
 }
 
-static void add_node(pool_t pool, struct event_filter_node **root,
-                    struct event_filter_node *new,
-                    enum event_filter_node_op op)
-{
-       struct event_filter_node *parent;
-
-       i_assert((op == EVENT_FILTER_OP_AND) || (op == EVENT_FILTER_OP_OR));
-
-       if (*root == NULL) {
-               *root = new;
-               return;
-       }
-
-       parent = p_new(pool, struct event_filter_node, 1);
-       parent->type = EVENT_FILTER_NODE_TYPE_LOGIC;
-       parent->op = op;
-       parent->children[0] = *root;
-       parent->children[1] = new;
-
-       *root = parent;
-}
-
 static void
 event_filter_add_categories(pool_t pool,
                            struct event_filter_node **root,