change: use bincode decoder for decoding offsets

laumann
Sep 23, 2022, 3:26 PM
WGGDK6VO56H2JP26KPSCQEGH5QETOPGWL6JVJVEKG6VK275FX2BAC

Dependencies

  • [2] XTKRT6OQ format the codebase
  • [3] Q7TKZCJP Add initial support for reading the offsets from a (fixed) change
  • [4] AEMTSEJX change: simplify readout of offsets

Change contents

  • replacement in change.c at line 55
    [3.1587][3.0:17]()
    uint64_t *bufp;
    [3.1587]
    [3.1603]
    struct bincode_state binstat;
  • edit in change.c at line 68
    [3.1848]
    [2.727]
    binstat.buf = buf;
    binstat.avail = OFFSETS_SIZE;
  • replacement in change.c at line 72
    [2.728][3.20:266](),[3.20][3.20:266]()
    /** Cast as []uint64_t */
    bufp = (uint64_t *)buf;
    off->version = *bufp++;
    off->hashed_len = *bufp++;
    off->unhashed_off = *bufp++;
    off->unhashed_len = *bufp++;
    off->contents_off = *bufp++;
    off->contents_len = *bufp++;
    off->total = *bufp;
    [2.728]
    [3.2183]
    off->version = bincode_getu64(&binstat);
    off->hashed_len = bincode_getu64(&binstat);
    off->unhashed_off = bincode_getu64(&binstat);
    off->unhashed_len = bincode_getu64(&binstat);
    off->contents_off = bincode_getu64(&binstat);
    off->contents_len = bincode_getu64(&binstat);
    off->total = bincode_getu64(&binstat);