re_intuit_start(): reduce use of *_offset macros
authorDavid Mitchell <davem@iabyn.com>
Sun, 2 Feb 2014 13:44:07 +0000 (13:44 +0000)
committerDavid Mitchell <davem@iabyn.com>
Sat, 8 Feb 2014 13:50:09 +0000 (13:50 +0000)
commit826b9972dca076598a5c28b611d681f45b586318
tree00151b0e25cbcf30f701e6f31a5d856709b9a00c
parent7d4ad9f90baf4256bba3cc273851b52721d4074c
re_intuit_start(): reduce use of *_offset macros

There are a number of macros with definitions like

    #define anchored_offset substrs->data[0].min_offset
    #define float_min_offset substrs->data[1].min_offset

In the two "other substr" branches, replace uses of these macros, e.g.

    {
        ...
        foo = prog->float_min_offset;
        ...
    }

with

    {
        struct reg_substr_datum *other = &prog->substrs->data[other_ix];
        ...
        foo = other->min_offset;
        ...
    }

As well as making debugging easier (a debugger might display real fields
but not macros), and potentially making the binary more compact and faster
(unless the compiler is clever enough to optimise away every use of the
'prog->substrs->data[0]' dereference), it also helps make the two "other
substr" branches more similar, bringing us closer to eventually merging
them.
regexec.c