[PATCH v3 2/6] Introduce new filtering architecture

Nikolay Marchuk marchuk.nikolay.a at gmail.com
Wed Jul 5 09:47:18 UTC 2017


>> +void
>> +set_filters_qualify_mode(struct filter **filters, unsigned int *nfilters)
>> +{
>> +	unsigned int i;
>> +	for (i = 0; i < *nfilters - 1; ++i) {
>> +		free_filter(*filters + i);
>> +	}
>> +	**filters = (*filters)[*nfilters - 1];
>> +	*filters = xreallocarray(*filters, 1, sizeof(struct filter));
> I'm pretty sure realloc() can't be expected to be able to handle re-allocating
> memory hunk which is provided by pointer not pointing at the beginning
> of the hunk. IOW, allocators are not expected to work with arbitrary pointers,
> only with ones that are returned by those allocators.
But pointer isn't changed between allocations.
>> +
>> +DECL_FILTER_ACTION_PARSER(null);
>> +DECL_FILTER_ACTION_PARSER(inject);
>> +
>> +#undef DECL_FILTER_ACTION_PARSER
>> +
>> +#define FILTER_ACTION_TYPE(NAME, PRIORITY, PARSER, PREFILTER)		\
>> +{#NAME, sizeof(#NAME) - 1,PRIORITY, parse_ ## PARSER, free_ ## PARSER,	\
>> + PREFILTER, apply_ ## NAME}
> Missing indentation of the macro definition. Incorrect indentation of
> the structure definition continuation.
I can't find any references for multi-line structure definitions.
What indentation should I use?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 213 bytes
Desc: OpenPGP digital signature
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170705/701a2a00/attachment.bin>


More information about the Strace-devel mailing list