Re: [PATCH/RFC 1/4] grep: prepare for re-using the space of the regexp member in struct grep_pat
- From
Bert Wesarg <bert.wesarg@googlemail.com>
- Date
- May 2, 2011, 14:25 UTC
- Message-ID
- <BANLkTimMOg45VrfftbMWQdu6gkF35gwZBw@mail.gmail.com>
- In-Reply-To
- <BANLkTi=5Rr2t-u9dJCg6EpcbfEALJDY4wQ@mail.gmail.com>
On Mon, May 2, 2011 at 15:27, Thiago Farina <tfransosi@gmail.com> wrote:
Show 15 quoted lines
> On Mon, May 2, 2011 at 8:39 AM, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
>> diff --git a/grep.h b/grep.h
>> index 06621fe..9912c11 100644
>> --- a/grep.h
>> +++ b/grep.h
>> @@ -32,7 +32,9 @@ struct grep_pat {
>> const char *pattern;
>> size_t patternlen;
>> enum grep_header_field field;
>> - regex_t regexp;
>> + union {
>> + regex_t regexp;
>> + } u;
>
> Instead of u, would be worth to rename it to something more descriptive?I followed struct grep_expr, where u is also used. But I'm open for a better name, if you have one.
Bert