diff --git a/lib/filterx/expr-template.c b/lib/filterx/expr-template.c index 70c3f54af53..d4689f47e0d 100644 --- a/lib/filterx/expr-template.c +++ b/lib/filterx/expr-template.c @@ -43,7 +43,8 @@ _eval(FilterXExpr *s) /* FIXME: we could go directly to filterx_string_new() here to avoid a round trip in FilterXMessageValue */ /* FIXME/2: let's make this handle literal and trivial templates */ - log_template_format_value_and_type_with_context(self->template, context->msgs, context->num_msg, context->template_eval_options, value, &t); + log_template_format_value_and_type_with_context(self->template, context->msgs, context->num_msg, + context->template_eval_options, value, &t); /* NOTE: we borrow value->str here which is stored in a scratch buffer * that should be valid as long as we are traversing the filter diff --git a/lib/filterx/filterx-eval.c b/lib/filterx/filterx-eval.c index 28d77536598..393266b7009 100644 --- a/lib/filterx/filterx-eval.c +++ b/lib/filterx/filterx-eval.c @@ -85,7 +85,8 @@ gboolean filterx_eval_exec_statements(GList *statements, LogMessage **pmsg, const LogPathOptions *path_options) { FilterXScope *scope = filterx_scope_new(); - FilterXEvalContext local_context = { + FilterXEvalContext local_context = + { .msgs = pmsg, .num_msg = 1, .template_eval_options = &DEFAULT_TEMPLATE_EVAL_OPTIONS, diff --git a/lib/filterx/filterx-object.h b/lib/filterx/filterx-object.h index dac25cd6cc6..9f91cf99eef 100644 --- a/lib/filterx/filterx-object.h +++ b/lib/filterx/filterx-object.h @@ -57,11 +57,11 @@ void filterx_type_init(FilterXType *type); #define FILTERX_DECLARE_TYPE(_name) \ extern FilterXType FILTERX_TYPE_NAME(_name) #define FILTERX_DEFINE_TYPE(_name, _super_type, ...) \ - FilterXType FILTERX_TYPE_NAME(_name) = \ - { \ - .super_type = &_super_type, \ - .name = # _name, \ - __VA_ARGS__ \ + FilterXType FILTERX_TYPE_NAME(_name) = \ + { \ + .super_type = &_super_type, \ + .name = # _name, \ + __VA_ARGS__ \ } diff --git a/lib/filterx/object-datetime.c b/lib/filterx/object-datetime.c index 4fb1098b728..d13b60dc009 100644 --- a/lib/filterx/object-datetime.c +++ b/lib/filterx/object-datetime.c @@ -94,7 +94,7 @@ filterx_datetime_new(const UnixTime *ut) } FILTERX_DEFINE_TYPE(datetime, FILTERX_TYPE_NAME(object), - .truthy = _truthy, - .map_to_json = _map_to_json, - .marshal = _marshal, -); + .truthy = _truthy, + .map_to_json = _map_to_json, + .marshal = _marshal, + ); diff --git a/lib/filterx/object-json.c b/lib/filterx/object-json.c index adefb38a680..7207133dbb2 100644 --- a/lib/filterx/object-json.c +++ b/lib/filterx/object-json.c @@ -110,7 +110,8 @@ _convert_json_to_object(FilterXJSON *self, struct json_object *object) case json_type_object: case json_type_array: default: - return filterx_json_new_sub(json_object_get(object), filterx_weakref_get(&self->root_container) ? : filterx_object_ref(&self->super)); + return filterx_json_new_sub(json_object_get(object), + filterx_weakref_get(&self->root_container) ? : filterx_object_ref(&self->super)); } } @@ -125,14 +126,14 @@ _convert_json_to_object_cached(FilterXJSON *self, struct json_object *object) if (json_object_get_type(object) == json_type_double) { /* this is a workaround to ditch builtin serializer for double objects - * that are set when parsing from a string representation. + * that are set when parsing from a string representation. * json_object_double_new_ds() will set userdata to the string * representation of the number, as extracted from the JSON source. - * + * * Changing the value of the double to the same value, ditches this, * but only if necessary. */ - + json_object_set_double(object, json_object_get_double(object)); } @@ -256,12 +257,12 @@ filterx_json_associate_cached_object(struct json_object *jso, FilterXObject *obj } FILTERX_DEFINE_TYPE(json, FILTERX_TYPE_NAME(object), - .mutable = TRUE, - .free_fn = _free, - .truthy = _truthy, - .marshal = _marshal, - .clone = _clone, - .getattr = _getattr, - .setattr = _setattr, - .map_to_json = _map_to_json, -); + .mutable = TRUE, + .free_fn = _free, + .truthy = _truthy, + .marshal = _marshal, + .clone = _clone, + .getattr = _getattr, + .setattr = _setattr, + .map_to_json = _map_to_json, + ); diff --git a/lib/filterx/object-list.c b/lib/filterx/object-list.c index 5d0a2f7631f..2f87bdc5225 100644 --- a/lib/filterx/object-list.c +++ b/lib/filterx/object-list.c @@ -122,9 +122,9 @@ _free(FilterXObject *s) } FILTERX_DEFINE_TYPE(list, FILTERX_TYPE_NAME(object), - .mutable = TRUE, - .free_fn = _free, - .map_to_json = _map_to_json, - .marshal = _marshal, - .truthy = _truthy, -); + .mutable = TRUE, + .free_fn = _free, + .map_to_json = _map_to_json, + .marshal = _marshal, + .truthy = _truthy, + ); diff --git a/lib/filterx/object-message-value.c b/lib/filterx/object-message-value.c index c93650ab202..a36dc340d38 100644 --- a/lib/filterx/object-message-value.c +++ b/lib/filterx/object-message-value.c @@ -209,9 +209,9 @@ _free(FilterXObject *s) FILTERX_DEFINE_TYPE(message_value, FILTERX_TYPE_NAME(object), - .free_fn = _free, - .truthy = _truthy, - .marshal = _marshal, - .unmarshal = _unmarshal, - .map_to_json = _map_to_json, -); + .free_fn = _free, + .truthy = _truthy, + .marshal = _marshal, + .unmarshal = _unmarshal, + .map_to_json = _map_to_json, + ); diff --git a/lib/filterx/object-null.c b/lib/filterx/object-null.c index 6389d8cee96..a86de4b9de8 100644 --- a/lib/filterx/object-null.c +++ b/lib/filterx/object-null.c @@ -51,7 +51,7 @@ filterx_null_new(void) } FILTERX_DEFINE_TYPE(null, FILTERX_TYPE_NAME(object), - .map_to_json = _map_to_json, - .marshal = _marshal, - .truthy = _truthy, -); + .map_to_json = _map_to_json, + .marshal = _marshal, + .truthy = _truthy, + ); diff --git a/lib/filterx/object-primitive.c b/lib/filterx/object-primitive.c index 1fa9cb27e72..aa5dbb32f57 100644 --- a/lib/filterx/object-primitive.c +++ b/lib/filterx/object-primitive.c @@ -163,19 +163,19 @@ filterx_boolean_new(gboolean value) } FILTERX_DEFINE_TYPE(integer, FILTERX_TYPE_NAME(object), - .truthy = _truthy, - .marshal = _integer_marshal, - .map_to_json = _integer_map_to_json, -); + .truthy = _truthy, + .marshal = _integer_marshal, + .map_to_json = _integer_map_to_json, + ); FILTERX_DEFINE_TYPE(double, FILTERX_TYPE_NAME(object), - .truthy = _truthy, - .marshal = _double_marshal, - .map_to_json = _double_map_to_json, -); + .truthy = _truthy, + .marshal = _double_marshal, + .map_to_json = _double_map_to_json, + ); FILTERX_DEFINE_TYPE(boolean, FILTERX_TYPE_NAME(object), - .truthy = _truthy, - .marshal = _bool_marshal, - .map_to_json = _bool_map_to_json, -); + .truthy = _truthy, + .marshal = _bool_marshal, + .map_to_json = _bool_map_to_json, + ); diff --git a/lib/filterx/object-string.c b/lib/filterx/object-string.c index 553cd398cf3..038dc1c48cf 100644 --- a/lib/filterx/object-string.c +++ b/lib/filterx/object-string.c @@ -144,19 +144,19 @@ filterx_protobuf_new(const gchar *mem, gssize mem_len) /* these types are independent type-wise but share a lot of the details */ FILTERX_DEFINE_TYPE(string, FILTERX_TYPE_NAME(object), - .marshal = _marshal, - .map_to_json = _map_to_json, - .truthy = _truthy, -); + .marshal = _marshal, + .map_to_json = _map_to_json, + .truthy = _truthy, + ); FILTERX_DEFINE_TYPE(bytes, FILTERX_TYPE_NAME(object), - .marshal = _bytes_marshal, - .map_to_json = _bytes_map_to_json, - .truthy = _truthy, -); + .marshal = _bytes_marshal, + .map_to_json = _bytes_map_to_json, + .truthy = _truthy, + ); FILTERX_DEFINE_TYPE(protobuf, FILTERX_TYPE_NAME(object), - .marshal = _bytes_marshal, - .map_to_json = _bytes_map_to_json, - .truthy = _truthy, -); + .marshal = _bytes_marshal, + .map_to_json = _bytes_map_to_json, + .truthy = _truthy, + ); diff --git a/lib/filterx/tests/test_object_datetime.c b/lib/filterx/tests/test_object_datetime.c index ec77bf5db20..c44a9a851fb 100644 --- a/lib/filterx/tests/test_object_datetime.c +++ b/lib/filterx/tests/test_object_datetime.c @@ -41,7 +41,8 @@ assert_object_json_equals(FilterXObject *obj, const gchar *expected_json_repr) { struct json_object *jso = NULL; - cr_assert(filterx_object_map_to_json(obj, &jso) == TRUE, "error mapping to json, expected json was: %s", expected_json_repr); + cr_assert(filterx_object_map_to_json(obj, &jso) == TRUE, "error mapping to json, expected json was: %s", + expected_json_repr); const gchar *json_repr = json_object_to_json_string_ext(jso, JSON_C_TO_STRING_PLAIN); cr_assert_str_eq(json_repr, expected_json_repr); json_object_put(jso); diff --git a/lib/filterx/tests/test_object_json.c b/lib/filterx/tests/test_object_json.c index 813e81e7eb0..2880e8db543 100644 --- a/lib/filterx/tests/test_object_json.c +++ b/lib/filterx/tests/test_object_json.c @@ -41,7 +41,8 @@ assert_object_json_equals(FilterXObject *obj, const gchar *expected_json_repr) { struct json_object *jso = NULL; - cr_assert(filterx_object_map_to_json(obj, &jso) == TRUE, "error mapping to json, expected json was: %s", expected_json_repr); + cr_assert(filterx_object_map_to_json(obj, &jso) == TRUE, "error mapping to json, expected json was: %s", + expected_json_repr); const gchar *json_repr = json_object_to_json_string_ext(jso, JSON_C_TO_STRING_PLAIN); cr_assert_str_eq(json_repr, expected_json_repr); json_object_put(jso); diff --git a/lib/filterx/tests/test_object_list.c b/lib/filterx/tests/test_object_list.c index 49c5499c218..a82b9d8c3d4 100644 --- a/lib/filterx/tests/test_object_list.c +++ b/lib/filterx/tests/test_object_list.c @@ -41,7 +41,8 @@ assert_object_json_equals(FilterXObject *obj, const gchar *expected_json_repr) { struct json_object *jso = NULL; - cr_assert(filterx_object_map_to_json(obj, &jso) == TRUE, "error mapping to json, expected json was: %s", expected_json_repr); + cr_assert(filterx_object_map_to_json(obj, &jso) == TRUE, "error mapping to json, expected json was: %s", + expected_json_repr); const gchar *json_repr = json_object_to_json_string_ext(jso, JSON_C_TO_STRING_PLAIN); cr_assert_str_eq(json_repr, expected_json_repr); json_object_put(jso); diff --git a/lib/filterx/tests/test_object_message.c b/lib/filterx/tests/test_object_message.c index 4ae668c435e..b3e41c862cc 100644 --- a/lib/filterx/tests/test_object_message.c +++ b/lib/filterx/tests/test_object_message.c @@ -41,7 +41,8 @@ assert_object_json_equals(FilterXObject *obj, const gchar *expected_json_repr) { struct json_object *jso = NULL; - cr_assert(filterx_object_map_to_json(obj, &jso) == TRUE, "error mapping to json, expected json was: %s", expected_json_repr); + cr_assert(filterx_object_map_to_json(obj, &jso) == TRUE, "error mapping to json, expected json was: %s", + expected_json_repr); const gchar *json_repr = json_object_to_json_string_ext(jso, JSON_C_TO_STRING_PLAIN); cr_assert_str_eq(json_repr, expected_json_repr); json_object_put(jso); diff --git a/lib/filterx/tests/test_object_null.c b/lib/filterx/tests/test_object_null.c index 44504abc3b4..d086d98d804 100644 --- a/lib/filterx/tests/test_object_null.c +++ b/lib/filterx/tests/test_object_null.c @@ -41,7 +41,8 @@ assert_object_json_equals(FilterXObject *obj, const gchar *expected_json_repr) { struct json_object *jso = NULL; - cr_assert(filterx_object_map_to_json(obj, &jso) == TRUE, "error mapping to json, expected json was: %s", expected_json_repr); + cr_assert(filterx_object_map_to_json(obj, &jso) == TRUE, "error mapping to json, expected json was: %s", + expected_json_repr); const gchar *json_repr = json_object_to_json_string_ext(jso, JSON_C_TO_STRING_PLAIN); cr_assert_str_eq(json_repr, expected_json_repr); json_object_put(jso); diff --git a/lib/filterx/tests/test_object_primitive.c b/lib/filterx/tests/test_object_primitive.c index 06d46a6e3b3..1bc2d8c08a4 100644 --- a/lib/filterx/tests/test_object_primitive.c +++ b/lib/filterx/tests/test_object_primitive.c @@ -43,7 +43,8 @@ assert_object_json_equals(FilterXObject *obj, const gchar *expected_json_repr) { struct json_object *jso = NULL; - cr_assert(filterx_object_map_to_json(obj, &jso) == TRUE, "error mapping to json, expected json was: %s", expected_json_repr); + cr_assert(filterx_object_map_to_json(obj, &jso) == TRUE, "error mapping to json, expected json was: %s", + expected_json_repr); const gchar *json_repr = json_object_to_json_string_ext(jso, JSON_C_TO_STRING_PLAIN); cr_assert_str_eq(json_repr, expected_json_repr); json_object_put(jso); diff --git a/lib/filterx/tests/test_object_string.c b/lib/filterx/tests/test_object_string.c index fa933e70ca2..3492809aa7d 100644 --- a/lib/filterx/tests/test_object_string.c +++ b/lib/filterx/tests/test_object_string.c @@ -41,7 +41,8 @@ assert_object_json_equals(FilterXObject *obj, const gchar *expected_json_repr) { struct json_object *jso = NULL; - cr_assert(filterx_object_map_to_json(obj, &jso) == TRUE, "error mapping to json, expected json was: %s", expected_json_repr); + cr_assert(filterx_object_map_to_json(obj, &jso) == TRUE, "error mapping to json, expected json was: %s", + expected_json_repr); const gchar *json_repr = json_object_to_json_string_ext(jso, JSON_C_TO_STRING_PLAIN); cr_assert_str_eq(json_repr, expected_json_repr); json_object_put(jso);