Date:2010-11-20 02:29:19 (13 years 4 months ago)
Author:Werner Almesberger
Commit:ed0281f306bdc30a018eeb6e6723148c514ec1dc
Message:qpkg/gobble.c (EXPECT): added variant that just skips over expected text

If the package database is sane, then we don't need to check that all
the field names match what we expect. This saves a few more CPU cycles.
However, if anything goes wrong, the consequences may be unpleasant.
Thus, we default to the slow but safe approach.
Files: qpkg/gobble.c (1 diff)

Change Details

qpkg/gobble.c
1515#define CHARS_AFTER_ERROR 20
1616
1717
18#ifdef BREAKNECK_SPEED
19
20#define EXPECT(s) do { buf += sizeof(s)-1; } while (0)
21
22#else /* !BREAKNECK_SPEED */
23
1824#define EXPECT(s) \
1925    do { \
2026        if (end-buf < sizeof(s)-1) \
21            FAIL; \
27            FAIL; \
2228        if (memcmp(buf, s, sizeof(s)-1)) \
2329            FAIL; \
2430        buf += sizeof(s)-1; \
2531    } \
2632    while (0)
2733
34#endif
35
2836
2937#define NEXT (buf == end ? '?' : *buf++)
3038

Archive Download the corresponding diff file

Branches:
master



interactive