diff --git a/lfs.c b/lfs.c index cbc68ee1..be1434a0 100644 --- a/lfs.c +++ b/lfs.c @@ -636,6 +636,11 @@ enum lfsr_tag_type { LFSR_TAG_MOVE = 0x0800, }; +// LFSR_TAG_TAG just provides and escape hatch to pass raw tags +// through the LFSR_ATTR macro +#define LFSR_TAG_TAG(tag) (tag) + +// some other tag encodings with their own subfields #define LFSR_TAG_ALTLE(red, key) \ (LFSR_TAG_ALTLE \ | ((0x1 & (lfsr_tag_t)(red)) << 12) \ @@ -1023,56 +1028,79 @@ static lfs_ssize_t lfsr_bd_progtag(lfs_t *lfs, /// lfsr_data_t stuff /// // either an on-disk or in-device data pointer -typedef union lfsr_data { - // sign(size)=0 => in-device - // sign(size)=1 => on-disk - lfs_size_t size; - struct { +typedef struct lfsr_data { + union { + // sign(size)=0 => in-device + // sign(size)=1 => on-disk lfs_size_t size; - const uint8_t *buffer; - lfs_ssize_t did; - } buf; - struct { - lfs_size_t size; - lfs_block_t block; - lfs_off_t off; - } disk; + struct { + lfs_size_t size; + lfs_ssize_t did; + const uint8_t *buffer; + } b; + struct { + lfs_size_t size; + lfs_off_t off; + lfs_block_t block; + } d; + } u; } lfsr_data_t; -#define LFSR_DATA_NULL LFSR_DATA_BUF(NULL, 0) +// the most common use is to pass a buffer with explicit size +#define LFSR_DATA(_buffer, _size) \ + ((lfsr_data_t){ \ + .u.b.size=_size, \ + .u.b.did=-1, \ + .u.b.buffer=(const void*)(_buffer)}) -#define LFSR_DATA_BUF(_buffer, _size) \ - ((lfsr_data_t){.buf={ \ - .size=_size, \ - .buffer=(const void*)(_buffer), \ - .did=-1}}) +// LFSR_DATA_DATA just provides and escape hatch to pass raw datas +// through the LFSR_ATTR macro +#define LFSR_DATA_DATA(_data) (_data) + +#define LFSR_DATA_NULL LFSR_DATA(NULL, 0) + +#define LFSR_DATA_BUF(_buffer, _size) LFSR_DATA(_buffer, _size) #define LFSR_DATA_NAME(_did, _buffer, _size) \ - ((lfsr_data_t){.buf={ \ - /* note this find the effective leb128 size */ \ - .size=_size + (lfs_nlog2((_did)+1)+7-1)/7, \ - .buffer=(const void*)(_buffer), \ - .did=_did}}) + ((lfsr_data_t){ \ + /* note this finds the effective leb128 size */ \ + .u.b.size=_size + (lfs_nlog2((_did)+1)+7-1)/7, \ + .u.b.did=_did, \ + .u.b.buffer=(const void*)(_buffer)}) #define LFSR_DATA_LEB128(_did) \ - ((lfsr_data_t){.buf={ \ - /* note this find the effective leb128 size */ \ - .size=(lfs_nlog2((_did)+1)+7-1)/7, \ - .buffer=NULL, \ - .did=_did}}) + ((lfsr_data_t){ \ + /* note this finds the effective leb128 size */ \ + .u.b.size=(lfs_nlog2((_did)+1)+7-1)/7, \ + .u.b.did=_did, \ + .u.b.buffer=NULL}) #define LFSR_DATA_DISK(_block, _off, _size) \ - ((lfsr_data_t){.disk={ \ - .size=(0x80000000 | (_size)), \ - .block=_block, \ - .off=_off}}) + ((lfsr_data_t){ \ + .u.d.size=(0x80000000 | (_size)), \ + .u.d.block=_block, \ + .u.d.off=_off}) + +// These aren't true runtime-typed datas, but allows some special cases to +// bypass data encoding. External context is required to access these +// correctly. + +// a move of all attrs from an mdir entry +#define LFSR_DATA_MOVE(_mdir) \ + ((lfsr_data_t){.u.b.buffer=(const void*)(const lfsr_mdir_t*){_mdir}}) + +// a grm update, note this is mutable! we may update the grm during +// mdir commits +#define LFSR_DATA_GRM(_grm) \ + ((lfsr_data_t){.u.b.buffer=(const void*)(lfsr_grm_t*){_grm}}) + static inline bool lfsr_data_ondisk(lfsr_data_t data) { - return data.size & 0x80000000; + return data.u.size & 0x80000000; } static inline lfs_size_t lfsr_data_size(lfsr_data_t data) { - return data.size & 0x7fffffff; + return data.u.size & 0x7fffffff; } static inline lfs_size_t lfsr_data_setondisk(lfs_size_t size) { @@ -1088,7 +1116,7 @@ static lfs_ssize_t lfsr_data_read(lfs_t *lfs, lfsr_data_t data, lfs_size_t size_ = lfs_min32(size, hint_); if (lfsr_data_ondisk(data)) { - int err = lfsr_bd_read(lfs, data.disk.block, data.disk.off+off_, + int err = lfsr_bd_read(lfs, data.u.d.block, data.u.d.off+off_, // note our hint includes the full data range hint_, buffer, size_); @@ -1096,7 +1124,7 @@ static lfs_ssize_t lfsr_data_read(lfs_t *lfs, lfsr_data_t data, return err; } } else { - memcpy(buffer, data.buf.buffer+off_, size_); + memcpy(buffer, data.u.b.buffer+off_, size_); } return size_; @@ -1138,13 +1166,13 @@ static lfs_scmp_t lfsr_data_cmp(lfs_t *lfs, lfsr_data_t data, // compare our data if (lfsr_data_ondisk(data)) { - int cmp = lfsr_bd_cmp(lfs, data.disk.block, data.disk.off+off_, 0, + int cmp = lfsr_bd_cmp(lfs, data.u.d.block, data.u.d.off+off_, 0, buffer, lfs_min32(hint_, size)); if (cmp != LFS_CMP_EQ) { return cmp; } } else { - int cmp = memcmp(data.buf.buffer+off_, buffer, size); + int cmp = memcmp(data.u.b.buffer+off_, buffer, size); if (cmp < 0) { return LFS_CMP_LT; } else if (cmp > 0) { @@ -1191,7 +1219,7 @@ static int lfsr_bd_progdata(lfs_t *lfs, // rcache/pcache directly? uint8_t dat; for (lfs_size_t i = 0; i < lfsr_data_size(data); i++) { - int err = lfsr_bd_read(lfs, data.disk.block, data.disk.off+i, + int err = lfsr_bd_read(lfs, data.u.d.block, data.u.d.off+i, lfsr_data_size(data)-i, &dat, 1); if (err) { @@ -1209,10 +1237,10 @@ static int lfsr_bd_progdata(lfs_t *lfs, } else { // this is kind of a hack, but when lfsr_data_t is in buffer mode, it // can also contain a leb128 encoded directory-id prefix - if (data.buf.did != -1) { + if (data.u.b.did != -1) { // TODO should progleb128 be its own function? rely on caching? uint8_t did_buf[5]; - lfs_ssize_t did_dsize = lfs_toleb128(data.buf.did, did_buf, 5); + lfs_ssize_t did_dsize = lfs_toleb128(data.u.b.did, did_buf, 5); if (did_dsize < 0) { return did_dsize; } @@ -1224,11 +1252,11 @@ static int lfsr_bd_progdata(lfs_t *lfs, } off += did_dsize; - data.buf.size -= did_dsize; + data.u.b.size -= did_dsize; } int err = lfsr_bd_prog(lfs, block, off, - data.buf.buffer, lfsr_data_size(data), + data.u.b.buffer, lfsr_data_size(data), cksum_); if (err) { return err; @@ -1259,60 +1287,17 @@ typedef struct lfsr_attr { lfs_ssize_t rid; lfsr_tag_t tag; lfs_ssize_t delta; - union { - // data, either on-disk or in-device - lfsr_data_t data; - // a move of all attrs from an mdir entry - const lfsr_mdir_t *mdir; - // a grm update, note this is mutable! we may update - // the grm during mdir commits - lfsr_grm_t *grm; - } d; + lfsr_data_t data; } lfsr_attr_t; -#define LFSR_ATTR_DATA_(_rid, _tag, _delta, _data) \ - ((const lfsr_attr_t){_rid, _tag, _delta, {.data=_data}}) +#define LFSR_ATTR(_rid, _type, _delta, _data) \ + ((const lfsr_attr_t){ \ + _rid, \ + LFSR_TAG_##_type, \ + _delta, \ + LFSR_DATA_##_data}) -#define LFSR_ATTR_DATA(_rid, _type, _delta, _data) \ - LFSR_ATTR_DATA_(_rid, LFSR_TAG_##_type, _delta, _data) - -#define LFSR_ATTR_MOVE_(_new_rid, _type, _delta, _mdir) \ - ((const lfsr_attr_t){_new_rid, _type, _delta, {.mdir=_mdir}}) - -#define LFSR_ATTR_MOVE(_new_rid, _type, _delta, _mdir) \ - LFSR_ATTR_MOVE_(_new_rid, LFSR_TAG_##_type, _delta, _mdir) - -#define LFSR_ATTR_GRM_(_new_rid, _type, _delta, _grm) \ - ((const lfsr_attr_t){_new_rid, _type, _delta, {.grm=_grm}}) - -#define LFSR_ATTR_GRM(_new_rid, _type, _delta, _grm) \ - LFSR_ATTR_GRM_(_new_rid, LFSR_TAG_##_type, _delta, _grm) - -#define LFSR_ATTR_NAME_(_rid, _tag, _delta, _did, _buffer, _size) \ - LFSR_ATTR_DATA_(_rid, _tag, _delta, LFSR_DATA_NAME(_did, _buffer, _size)) - -#define LFSR_ATTR_NAME(_rid, _type, _delta, _did, _buffer, _size) \ - LFSR_ATTR_NAME_(_rid, LFSR_TAG_##_type, _delta, _did, _buffer, _size) - -#define LFSR_ATTR_LEB128_(_rid, _tag, _delta, _did) \ - LFSR_ATTR_DATA_(_rid, _tag, _delta, LFSR_DATA_LEB128(_did)) - -#define LFSR_ATTR_LEB128(_rid, _type, _delta, _did) \ - LFSR_ATTR_LEB128_(_rid, LFSR_TAG_##_type, _delta, _did) - -#define LFSR_ATTR_(_rid, _tag, _delta, _buffer, _size) \ - LFSR_ATTR_DATA_(_rid, _tag, _delta, LFSR_DATA_BUF(_buffer, _size)) - -#define LFSR_ATTR(_rid, _type, _delta, _buffer, _size) \ - LFSR_ATTR_(_rid, LFSR_TAG_##_type, _delta, _buffer, _size) - -#define LFSR_ATTR_DISK_(_rid, _tag, _delta, _block, _off, _size) \ - LFSR_ATTR_DATA_(_rid, _tag, _delta, LFSR_DATA_DISK(_block, _off, _size)) - -#define LFSR_ATTR_DISK(_rid, _type, _delta, _block, _off, _size) \ - LFSR_ATTR_DISK_(_rid, LFSR_TAG_##_type, _delta, _block, _off, _size) - -#define LFSR_ATTR_NOOP LFSR_ATTR(-1, UNR, 0, NULL, 0) +#define LFSR_ATTR_NOOP LFSR_ATTR(-1, UNR, 0, NULL) #define LFSR_ATTRS(...) \ (const lfsr_attr_t[]){__VA_ARGS__}, \ @@ -1863,7 +1848,7 @@ static int lfsr_rbyd_fetch(lfs_t *lfs, lfsr_rbyd_t *rbyd, } lfs_ssize_t ecksum_dsize = lfsr_ecksum_fromdisk(lfs, &ecksum, - LFSR_DATA_BUF(ecksum_buf, + LFSR_DATA(ecksum_buf, lfs_min32(size, LFSR_ECKSUM_DSIZE))); if (ecksum_dsize < 0 && ecksum_dsize != LFS_ERR_CORRUPT) { return ecksum_dsize; @@ -2754,6 +2739,8 @@ static int lfsr_rbyd_appendall(lfs_t *lfs, lfsr_rbyd_t *rbyd, } else if (lfsr_tag_suptype(attrs[i].tag) == LFSR_TAG_MOVE) { // weighted moves are not supported LFS_ASSERT(attrs[i].delta == 0); + const lfsr_mdir_t *mdir + = (const lfsr_mdir_t*)attrs[i].data.u.b.buffer; // skip the name tag, this is always replaced by upper layers lfsr_tag_t tag = LFSR_TAG_NAME + 0xff; @@ -2761,14 +2748,12 @@ static int lfsr_rbyd_appendall(lfs_t *lfs, lfsr_rbyd_t *rbyd, lfs_ssize_t rid; lfsr_data_t data; int err = lfsr_rbyd_lookupnext(lfs, - &attrs[i].d.mdir->u.r.rbyd, - attrs[i].d.mdir->mid.rid, lfsr_tag_next(tag), + &mdir->u.r.rbyd, mdir->mid.rid, lfsr_tag_next(tag), &rid, &tag, NULL, &data); if (err && err != LFS_ERR_NOENT) { return err; } - if (err == LFS_ERR_NOENT - || rid != attrs[i].d.mdir->mid.rid) { + if (err == LFS_ERR_NOENT || rid != mdir->mid.rid) { break; } @@ -2787,7 +2772,7 @@ static int lfsr_rbyd_appendall(lfs_t *lfs, lfsr_rbyd_t *rbyd, int err = lfsr_rbyd_append(lfs, rbyd, attrs[i].rid-lfs_smax32(start_rid, 0), - attrs[i].tag, attrs[i].delta, attrs[i].d.data); + attrs[i].tag, attrs[i].delta, attrs[i].data); if (err) { return err; } @@ -2828,7 +2813,7 @@ static int lfsr_rbyd_appendgdelta(lfs_t *lfs, lfsr_rbyd_t *rbyd) { } } - err = lfsr_grm_xor(lfs, grm_buf, LFSR_DATA_BUF( + err = lfsr_grm_xor(lfs, grm_buf, LFSR_DATA( &lfs->dgrm, LFSR_GRM_DSIZE)); if (err) { return err; @@ -2839,7 +2824,7 @@ static int lfsr_rbyd_appendgdelta(lfs_t *lfs, lfsr_rbyd_t *rbyd) { err = lfsr_rbyd_append(lfs, rbyd, -1, // opportunistically remove this tag if delta is all zero (size == 0 ? LFSR_TAG_RMGRM : LFSR_TAG_GRM), 0, - LFSR_DATA_BUF(grm_buf, size)); + LFSR_DATA(grm_buf, size)); if (err) { return err; } @@ -3504,18 +3489,22 @@ static int lfsr_rbyd_namelookup(lfs_t *lfs, const lfsr_rbyd_t *rbyd, // convenience operations // TODO need null btrees? -#define LFSR_BTREE_NULL ((lfsr_btree_t){.u.b.weight=0x80000000}) +#define LFSR_BTREE_NULL ((lfsr_btree_t){.u.weight=0x80000000}) static inline bool lfsr_btree_isinlined(const lfsr_btree_t *btree) { - return btree->u.b.weight & 0x80000000; + return btree->u.weight & 0x80000000; } static inline lfs_size_t lfsr_btree_weight(const lfsr_btree_t *btree) { - return btree->u.b.weight & 0x7fffffff; + return btree->u.weight & 0x7fffffff; } static inline bool lfsr_btree_isnull(const lfsr_btree_t *btree) { - return btree->u.b.weight == 0x80000000; + return btree->u.weight == 0x80000000; +} + +static inline lfs_size_t lfsr_btree_setinlined(lfs_size_t weight) { + return weight | 0x80000000; } @@ -3621,7 +3610,7 @@ static lfs_ssize_t lfsr_btree_fromdisk(lfs_t *lfs, lfsr_btree_t *btree, // inlined? if (tag != btree_tag) { // mark as inlined - btree->u.i.weight = 0x80000000 | weight; + btree->u.i.weight = lfsr_btree_setinlined(weight); btree->u.i.tag = tag; lfs_ssize_t size = lfsr_data_read(lfs, data, 0, btree->u.i.buffer, LFSR_BTREE_INLINESIZE); @@ -3662,7 +3651,7 @@ static int lfsr_btree_lookupnext_(lfs_t *lfs, *weight_ = lfsr_btree_weight(btree); } if (data_) { - *data_ = LFSR_DATA_BUF(btree->u.i.buffer, btree->u.i.size); + *data_ = LFSR_DATA(btree->u.i.buffer, btree->u.i.size); } return 0; } @@ -3939,12 +3928,12 @@ static int lfsr_btree_commit(lfs_t *lfs, // end up removing an rbyd here if (rbyd->weight == 0) { attrs[0] = LFSR_ATTR(pid, UNR, +rbyd->weight-pweight, - scratch_buf, scratch_dsize); + BUF(scratch_buf, scratch_dsize)); attr_count = 1; } else { - attrs[0] = LFSR_ATTR(pid, GROW, +rbyd->weight-pweight, NULL, 0); + attrs[0] = LFSR_ATTR(pid, GROW, +rbyd->weight-pweight, NULL); attrs[1] = LFSR_ATTR(pid+rbyd->weight-pweight, BTREE, 0, - scratch_buf, scratch_dsize); + BUF(scratch_buf, scratch_dsize)); attr_count = 2; } @@ -4050,12 +4039,12 @@ static int lfsr_btree_commit(lfs_t *lfs, // end up removing an rbyd here if (rbyd->weight == 0) { attrs[0] = LFSR_ATTR(pid, UNR, +rbyd->weight-pweight, - scratch_buf, scratch_dsize); + BUF(scratch_buf, scratch_dsize)); attr_count = 1; } else { - attrs[0] = LFSR_ATTR(pid, GROW, +rbyd->weight-pweight, NULL, 0); + attrs[0] = LFSR_ATTR(pid, GROW, +rbyd->weight-pweight, NULL); attrs[1] = LFSR_ATTR(pid+rbyd->weight-pweight, BTREE, 0, - scratch_buf, scratch_dsize); + BUF(scratch_buf, scratch_dsize)); attr_count = 2; } @@ -4168,36 +4157,36 @@ static int lfsr_btree_commit(lfs_t *lfs, // prepare commit to parent, tail recursing upwards attrs[0] = LFSR_ATTR(0, BTREE, +rbyd_.weight, - scratch1_buf, scratch1_dsize); + BUF(scratch1_buf, scratch1_dsize)); attrs[1] = (lfsr_tag_suptype(stag) == LFSR_TAG_NAME - ? LFSR_ATTR_DATA(rbyd_.weight, BRANCH, +sibling.weight, - sdata) + ? LFSR_ATTR(rbyd_.weight, BRANCH, +sibling.weight, + DATA(sdata)) : LFSR_ATTR_NOOP); attrs[2] = (lfsr_tag_suptype(stag) == LFSR_TAG_NAME ? LFSR_ATTR(0+rbyd_.weight+sibling.weight-1, BTREE, 0, - scratch2_buf, scratch2_dsize) + BUF(scratch2_buf, scratch2_dsize)) : LFSR_ATTR(0+rbyd_.weight, BTREE, +sibling.weight, - scratch2_buf, scratch2_dsize)); + BUF(scratch2_buf, scratch2_dsize))); attr_count = 3; // yes parent? push up split } else { // prepare commit to parent, tail recursing upwards - attrs[0] = LFSR_ATTR(pid, GROW, +rbyd_.weight-pweight, NULL, 0); + attrs[0] = LFSR_ATTR(pid, GROW, +rbyd_.weight-pweight, NULL); attrs[1] = LFSR_ATTR(pid-(pweight-1)+rbyd_.weight-1, BTREE, 0, - scratch1_buf, scratch1_dsize); + BUF(scratch1_buf, scratch1_dsize)); attrs[2] = (lfsr_tag_suptype(stag) == LFSR_TAG_NAME - ? LFSR_ATTR_DATA(pid-(pweight-1)+rbyd_.weight, + ? LFSR_ATTR(pid-(pweight-1)+rbyd_.weight, BRANCH, +sibling.weight, - sdata) + DATA(sdata)) : LFSR_ATTR_NOOP); attrs[3] = (lfsr_tag_suptype(stag) == LFSR_TAG_NAME ? LFSR_ATTR(pid-(pweight-1)+rbyd_.weight+sibling.weight-1, BTREE, 0, - scratch2_buf, scratch2_dsize) + BUF(scratch2_buf, scratch2_dsize)) : LFSR_ATTR(pid-(pweight-1)+rbyd_.weight, BTREE, +sibling.weight, - scratch2_buf, scratch2_dsize)); + BUF(scratch2_buf, scratch2_dsize))); attr_count = 4; } @@ -4401,10 +4390,10 @@ static int lfsr_btree_commit(lfs_t *lfs, } // prepare commit to parent, tail recursing upwards - attrs[0] = LFSR_ATTR(sid, UNR, -sweight, NULL, 0); - attrs[1] = LFSR_ATTR(pid, GROW, +rbyd_.weight-pweight, NULL, 0); + attrs[0] = LFSR_ATTR(sid, UNR, -sweight, NULL); + attrs[1] = LFSR_ATTR(pid, GROW, +rbyd_.weight-pweight, NULL); attrs[2] = LFSR_ATTR(pid+rbyd_.weight-pweight, BTREE, 0, - scratch_buf, scratch_dsize); + BUF(scratch_buf, scratch_dsize)); attr_count = 3; } @@ -4427,7 +4416,7 @@ static int lfsr_btree_push(lfs_t *lfs, lfsr_btree_t *btree, LFS_ASSERT(bid == 0); // mark as inlined - btree->u.i.weight = 0x80000000 | weight; + btree->u.i.weight = lfsr_btree_setinlined(weight); btree->u.i.tag = tag; lfs_ssize_t d = lfsr_data_read(lfs, data, 0, @@ -4449,9 +4438,9 @@ static int lfsr_btree_push(lfs_t *lfs, lfsr_btree_t *btree, // commit our entries err = lfsr_rbyd_commit(lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR_(0, btree->u.i.tag, +lfsr_btree_weight(btree), - btree->u.i.buffer, btree->u.i.size), - LFSR_ATTR_DATA_(bid, tag, +weight, data))); + LFSR_ATTR(0, TAG(btree->u.i.tag), +lfsr_btree_weight(btree), + BUF(btree->u.i.buffer, btree->u.i.size)), + LFSR_ATTR(bid, TAG(tag), +weight, DATA(data)))); if (err) { return err; } @@ -4491,7 +4480,7 @@ static int lfsr_btree_push(lfs_t *lfs, lfsr_btree_t *btree, // of the rest int degenerate = lfsr_btree_commit(lfs, btree, bid_, 0, &rbyd, LFSR_BTREE_ATTRS( - LFSR_ATTR_DATA_(rid, tag, +weight, data))); + LFSR_ATTR(rid, TAG(tag), +weight, DATA(data)))); if (degenerate < 0) { return degenerate; } @@ -4499,7 +4488,7 @@ static int lfsr_btree_push(lfs_t *lfs, lfsr_btree_t *btree, // revert to an inlined btree if (degenerate) { // mark as inlined - btree->u.i.weight = 0x80000000 | weight; + btree->u.i.weight = lfsr_btree_setinlined(weight); btree->u.i.tag = tag; lfs_ssize_t d = lfsr_data_read(lfs, data, 0, @@ -4525,7 +4514,7 @@ static int lfsr_btree_set(lfs_t *lfs, lfsr_btree_t *btree, LFS_ASSERT(bid == lfsr_btree_weight(btree)-1); // mark as inlined - btree->u.i.weight = 0x80000000 | weight; + btree->u.i.weight = lfsr_btree_setinlined(weight); btree->u.i.tag = tag; lfs_ssize_t d = lfsr_data_read(lfs, data, 0, @@ -4555,10 +4544,10 @@ static int lfsr_btree_set(lfs_t *lfs, lfsr_btree_t *btree, int degenerate = lfsr_btree_commit(lfs, btree, bid, 1, &rbyd, LFSR_BTREE_ATTRS( (tag != rtag - ? LFSR_ATTR_(rid, lfsr_tag_setrm(rtag), 0, NULL, 0) + ? LFSR_ATTR(rid, TAG(lfsr_tag_setrm(rtag)), 0, NULL) : LFSR_ATTR_NOOP), - LFSR_ATTR_DATA_(rid, tag, 0, data), - LFSR_ATTR(rid, GROW, +weight-rweight, NULL, 0))); + LFSR_ATTR(rid, TAG(tag), 0, DATA(data)), + LFSR_ATTR(rid, GROW, +weight-rweight, NULL))); if (degenerate < 0) { return degenerate; } @@ -4566,7 +4555,7 @@ static int lfsr_btree_set(lfs_t *lfs, lfsr_btree_t *btree, // revert to an inlined btree if (degenerate) { // mark as inlined - btree->u.i.weight = 0x80000000 | weight; + btree->u.i.weight = lfsr_btree_setinlined(weight); btree->u.i.tag = tag; lfs_ssize_t d = lfsr_data_read(lfs, data, 0, @@ -4613,7 +4602,7 @@ static int lfsr_btree_pop(lfs_t *lfs, lfsr_btree_t *btree, lfs_size_t bid) { // revert to an inlined btree int degenerate = lfsr_btree_commit(lfs, btree, bid, 2, &rbyd, LFSR_BTREE_ATTRS( - LFSR_ATTR(rid, UNR, -rweight, NULL, 0))); + LFSR_ATTR(rid, UNR, -rweight, NULL))); if (degenerate < 0) { return degenerate; } @@ -4654,11 +4643,11 @@ static int lfsr_btree_pop(lfs_t *lfs, lfsr_btree_t *btree, lfs_size_t bid) { LFS_ASSERT(sweight+rweight == rbyd.weight); // mark as inlined - btree->u.i.weight = 0x80000000 | sweight; + btree->u.i.weight = lfsr_btree_setinlined(sweight); btree->u.i.tag = stag; LFS_ASSERT(lfsr_data_size(sdata) <= LFSR_BTREE_INLINESIZE); - err = lfsr_bd_read(lfs, sdata.disk.block, sdata.disk.off, 0, + err = lfsr_bd_read(lfs, sdata.u.d.block, sdata.u.d.off, 0, btree->u.i.buffer, lfsr_data_size(sdata)); if (err) { return err; @@ -4693,13 +4682,13 @@ static int lfsr_btree_split(lfs_t *lfs, lfsr_btree_t *btree, // commit our entries err = lfsr_rbyd_commit(lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR_DATA_(0, tag1, +weight1, data1), + LFSR_ATTR(0, TAG(tag1), +weight1, DATA(data1)), (lfsr_data_size(name) > 0 - ? LFSR_ATTR_DATA(weight1, BRANCH, +weight2, name) + ? LFSR_ATTR(weight1, BRANCH, +weight2, DATA(name)) : LFSR_ATTR_NOOP), (lfsr_data_size(name) > 0 - ? LFSR_ATTR_DATA_(weight1+weight2-1, tag2, 0, data2) - : LFSR_ATTR_DATA_(weight1, tag2, +weight2, data2)))); + ? LFSR_ATTR(weight1+weight2-1, TAG(tag2), 0, DATA(data2)) + : LFSR_ATTR(weight1, TAG(tag2), +weight2, DATA(data2))))); if (err) { return err; } @@ -4723,18 +4712,18 @@ static int lfsr_btree_split(lfs_t *lfs, lfsr_btree_t *btree, // of the rest int degenerate = lfsr_btree_commit(lfs, btree, bid, -1, &rbyd, LFSR_BTREE_ATTRS( - LFSR_ATTR(rid, GROW, +weight1-rweight, NULL, 0), - LFSR_ATTR_DATA_(rid-(rweight-1)+weight1-1, tag1, 0, data1), + LFSR_ATTR(rid, GROW, +weight1-rweight, NULL), + LFSR_ATTR(rid-(rweight-1)+weight1-1, TAG(tag1), 0, + DATA(data1)), (lfsr_data_size(name) > 0 - ? LFSR_ATTR_DATA( - rid-(rweight-1)+weight1, BRANCH, +weight2, - name) + ? LFSR_ATTR(rid-(rweight-1)+weight1, + BRANCH, +weight2, DATA(name)) : LFSR_ATTR_NOOP), (lfsr_data_size(name) > 0 - ? LFSR_ATTR_DATA_(rid-(rweight-1)+weight1+weight2-1, - tag2, 0, data2) - : LFSR_ATTR_DATA_(rid-(rweight-1)+weight1, - tag2, +weight2, data2)))); + ? LFSR_ATTR(rid-(rweight-1)+weight1+weight2-1, + TAG(tag2), 0, DATA(data2)) + : LFSR_ATTR(rid-(rweight-1)+weight1, + TAG(tag2), +weight2, DATA(data2))))); if (degenerate < 0) { return degenerate; } @@ -4768,7 +4757,7 @@ static int lfsr_btree_namelookup(lfs_t *lfs, const lfsr_btree_t *btree, *weight_ = lfsr_btree_weight(btree); } if (data_) { - *data_ = LFSR_DATA_BUF(btree->u.i.buffer, btree->u.i.size); + *data_ = LFSR_DATA(btree->u.i.buffer, btree->u.i.size); } return 0; } @@ -4872,7 +4861,7 @@ static int lfsr_btree_traversal_next(lfs_t *lfs, *weight_ = lfsr_btree_weight(btree); } if (data_) { - *data_ = LFSR_DATA_BUF(btree->u.i.buffer, btree->u.i.size); + *data_ = LFSR_DATA(btree->u.i.buffer, btree->u.i.size); } return 0; } @@ -4896,8 +4885,7 @@ static int lfsr_btree_traversal_next(lfs_t *lfs, } if (data_) { // note btrees are returned decoded - *data_ = LFSR_DATA_BUF(&traversal->branch, - sizeof(lfsr_rbyd_t)); + *data_ = LFSR_DATA(&traversal->branch, sizeof(lfsr_rbyd_t)); } return 0; } @@ -4957,8 +4945,7 @@ static int lfsr_btree_traversal_next(lfs_t *lfs, } if (data_) { // note btrees are returned decoded - *data_ = LFSR_DATA_BUF( - &traversal->branch, sizeof(lfsr_rbyd_t)); + *data_ = LFSR_DATA(&traversal->branch, sizeof(lfsr_rbyd_t)); } return 0; } @@ -5560,13 +5547,15 @@ static int lfsr_mdir_commit(lfs_t *lfs, lfsr_mdir_t *mdir, for (lfs_size_t i = 0; i < attr_count; i++) { if (attrs[i].tag == LFSR_TAG_GRM) { // encode to disk - int err = lfsr_grm_todisk(lfs, attrs[i].d.grm, lfs->dgrm); + int err = lfsr_grm_todisk(lfs, + (lfsr_grm_t*)attrs[i].data.u.b.buffer, + lfs->dgrm); if (err) { return err; } // xor with our current gstate to find our initial gdelta - err = lfsr_grm_xor(lfs, lfs->dgrm, LFSR_DATA_BUF( + err = lfsr_grm_xor(lfs, lfs->dgrm, LFSR_DATA( lfs->pgrm, LFSR_GRM_DSIZE)); if (err) { return err; @@ -5695,7 +5684,7 @@ static int lfsr_mdir_commit(lfs_t *lfs, lfsr_mdir_t *mdir, } int err = lfsr_btree_set(lfs, &mtree_, mbid, LFSR_TAG_MDIR, 1, - LFSR_DATA_BUF(mdir_buf, mdir_dsize)); + LFSR_DATA(mdir_buf, mdir_dsize)); if (err) { return err; } @@ -5718,7 +5707,7 @@ static int lfsr_mdir_commit(lfs_t *lfs, lfsr_mdir_t *mdir, } int err = lfsr_btree_set(lfs, &mtree_, mbid, LFSR_TAG_MDIR, 1, - LFSR_DATA_BUF(msibling_buf, msibling_dsize)); + LFSR_DATA(msibling_buf, msibling_dsize)); if (err) { return err; } @@ -5761,10 +5750,8 @@ static int lfsr_mdir_commit(lfs_t *lfs, lfsr_mdir_t *mdir, (lfsr_tag_suptype(stag) == LFSR_TAG_NAME ? sdata : LFSR_DATA_NULL), - LFSR_TAG_MDIR, 1, LFSR_DATA_BUF( - mdir_buf, mdir_dsize), - LFSR_TAG_MDIR, 1, LFSR_DATA_BUF( - msibling_buf, msibling_dsize)); + LFSR_TAG_MDIR, 1, LFSR_DATA(mdir_buf, mdir_dsize), + LFSR_TAG_MDIR, 1, LFSR_DATA(msibling_buf, msibling_dsize)); if (err) { return err; } @@ -5815,7 +5802,7 @@ static int lfsr_mdir_commit(lfs_t *lfs, lfsr_mdir_t *mdir, int err = lfsr_btree_set(lfs, &mtree_, mdir->mid.bid, LFSR_TAG_MDIR, 1, - LFSR_DATA_BUF(mdir_buf, mdir_dsize)); + LFSR_DATA(mdir_buf, mdir_dsize)); if (err) { return err; } @@ -5837,7 +5824,7 @@ static int lfsr_mdir_commit(lfs_t *lfs, lfsr_mdir_t *mdir, // // gd' = gd xor (grm' xor grm) // - lfsr_grm_t *grm = attrs[i].d.grm; + lfsr_grm_t *grm = (lfsr_grm_t*)attrs[i].data.u.b.buffer; uint8_t grm_buf[LFSR_GRM_DSIZE]; int err = lfsr_grm_todisk(lfs, grm, grm_buf); if (err) { @@ -5845,7 +5832,7 @@ static int lfsr_mdir_commit(lfs_t *lfs, lfsr_mdir_t *mdir, } err = lfsr_grm_xor(lfs, lfs->dgrm, - LFSR_DATA_BUF(grm_buf, LFSR_GRM_DSIZE)); + LFSR_DATA(grm_buf, LFSR_GRM_DSIZE)); if (err) { return err; } @@ -5889,7 +5876,7 @@ static int lfsr_mdir_commit(lfs_t *lfs, lfsr_mdir_t *mdir, } err = lfsr_grm_xor(lfs, lfs->dgrm, - LFSR_DATA_BUF(grm_buf, LFSR_GRM_DSIZE)); + LFSR_DATA(grm_buf, LFSR_GRM_DSIZE)); if (err) { return err; } @@ -5911,7 +5898,8 @@ static int lfsr_mdir_commit(lfs_t *lfs, lfsr_mdir_t *mdir, } err = lfsr_mdir_commit_(lfs, &mroot_, -1, 0, NULL, LFSR_ATTRS( - LFSR_ATTR_(-1, mtree_tag, 0, mtree_buf, mtree_dsize))); + LFSR_ATTR(-1, TAG(mtree_tag), 0, + BUF(mtree_buf, mtree_dsize)))); if (err) { LFS_ASSERT(err != LFS_ERR_RANGE); return err; @@ -5951,7 +5939,8 @@ static int lfsr_mdir_commit(lfs_t *lfs, lfsr_mdir_t *mdir, mchildroot = mparentroot; err = lfsr_mdir_commit_(lfs, &mparentroot, -1, -1, NULL, LFSR_ATTRS( - LFSR_ATTR(-1, MROOT, 0, mchildroot_buf, mchildroot_dsize))); + LFSR_ATTR(-1, MROOT, 0, + BUF(mchildroot_buf, mchildroot_dsize)))); if (err) { LFS_ASSERT(err != LFS_ERR_RANGE); return err; @@ -6003,10 +5992,11 @@ static int lfsr_mdir_commit(lfs_t *lfs, lfsr_mdir_t *mdir, lfsr_mdir_t mparentroot = mchildroot; err = lfsr_mdir_compact_(lfs, &mparentroot, LFSR_MDIR_EXTENDING, 0, 0, &mchildroot, NULL, 0, LFSR_ATTRS( - LFSR_ATTR_DATA(-1, SUPERMAGIC, 0, magic), - LFSR_ATTR_DATA(-1, SUPERCONFIG, 0, config), + LFSR_ATTR(-1, SUPERMAGIC, 0, DATA(magic)), + LFSR_ATTR(-1, SUPERCONFIG, 0, DATA(config)), // commit our new mchildroot - LFSR_ATTR(-1, MROOT, 0, mchildroot_buf, mchildroot_dsize))); + LFSR_ATTR(-1, MROOT, 0, + BUF(mchildroot_buf, mchildroot_dsize)))); if (err) { return err; } @@ -6020,7 +6010,7 @@ static int lfsr_mdir_commit(lfs_t *lfs, lfsr_mdir_t *mdir, // update our gstate for (lfs_size_t i = 0; i < attr_count; i++) { if (attrs[i].tag == LFSR_TAG_GRM) { - lfs->grm = *attrs[i].d.grm; + lfs->grm = *(lfsr_grm_t*)attrs[i].data.u.b.buffer; // keep track of the exact encoding on-disk int err = lfsr_grm_todisk(lfs, &lfs->grm, lfs->pgrm); @@ -6379,7 +6369,7 @@ static int lfsr_mtree_traversal_next(lfs_t *lfs, *tag_ = LFSR_TAG_MDIR; } if (data_) { - *data_ = LFSR_DATA_BUF(&traversal->mdir, sizeof(lfsr_mdir_t)); + *data_ = LFSR_DATA(&traversal->mdir, sizeof(lfsr_mdir_t)); } goto cycle_detect; @@ -6416,7 +6406,7 @@ static int lfsr_mtree_traversal_next(lfs_t *lfs, *tag_ = LFSR_TAG_MDIR; } if (data_) { - *data_ = LFSR_DATA_BUF(&traversal->mdir, sizeof(lfsr_mdir_t)); + *data_ = LFSR_DATA(&traversal->mdir, sizeof(lfsr_mdir_t)); } goto cycle_detect; @@ -6464,7 +6454,7 @@ static int lfsr_mtree_traversal_next(lfs_t *lfs, // validate our btree nodes if requested, this just means we need // to do a full rbyd fetch and make sure the checksums match if (traversal->flags & LFSR_MTREE_TRAVERSAL_VALIDATE) { - lfsr_rbyd_t *branch = (lfsr_rbyd_t*)data.buf.buffer; + lfsr_rbyd_t *branch = (lfsr_rbyd_t*)data.u.b.buffer; lfsr_rbyd_t branch_; int err = lfsr_rbyd_fetch(lfs, &branch_, branch->block, branch->trunk); @@ -6535,7 +6525,7 @@ static int lfsr_mtree_traversal_next(lfs_t *lfs, *tag_ = tag; } if (data_) { - *data_ = LFSR_DATA_BUF(&traversal->mdir, sizeof(lfsr_mdir_t)); + *data_ = LFSR_DATA(&traversal->mdir, sizeof(lfsr_mdir_t)); } goto cycle_detect; @@ -6695,7 +6685,7 @@ static int lfsr_mountinited(lfs_t *lfs) { continue; } - lfsr_mdir_t *mdir = (lfsr_mdir_t*)data.buf.buffer; + lfsr_mdir_t *mdir = (lfsr_mdir_t*)data.u.b.buffer; // found an mroot? if (mdir->mid.bid == -1) { // has magic string? @@ -7024,10 +7014,10 @@ static int lfsr_formatinited(lfs_t *lfs) { // - the superconfig, format-time configuration // - the root's bookmark tag, which reserves did = 0 for the root err = lfsr_rbyd_commit(lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, SUPERMAGIC, 0, "littlefs", 8), + LFSR_ATTR(-1, SUPERMAGIC, 0, BUF("littlefs", 8)), LFSR_ATTR(-1, SUPERCONFIG, 0, - superconfig_buf, superconfig_dsize), - LFSR_ATTR_NAME(0, BOOKMARK, +1, 0, NULL, 0))); + BUF(superconfig_buf, superconfig_dsize)), + LFSR_ATTR(0, BOOKMARK, +1, NAME(0, NULL, 0)))); if (err) { return err; } @@ -7188,12 +7178,12 @@ static int lfs_alloc(lfs_t *lfs, lfs_block_t *block) { // mark any blocks we see at in-use, including any btree/mdir blocks if (tag == LFSR_TAG_MDIR) { - lfsr_mdir_t *mdir = (lfsr_mdir_t*)data.buf.buffer; + lfsr_mdir_t *mdir = (lfsr_mdir_t*)data.u.b.buffer; lfs_alloc_setinuse(lfs, mdir->u.m.blocks[1]); lfs_alloc_setinuse(lfs, mdir->u.m.blocks[0]); } else if (tag == LFSR_TAG_BTREE) { - lfsr_rbyd_t *branch = (lfsr_rbyd_t*)data.buf.buffer; + lfsr_rbyd_t *branch = (lfsr_rbyd_t*)data.u.b.buffer; lfs_alloc_setinuse(lfs, branch->block); } } @@ -7297,10 +7287,10 @@ int lfsr_mkdir(lfs_t *lfs, const char *path) { // lose power before writing the entry in our parent // err = lfsr_mdir_commit(lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR_NAME(mdir.mid.rid, BOOKMARK, +1, did, NULL, 0), - LFSR_ATTR_GRM(-1, GRM, 0, &((lfsr_grm_t){{ + LFSR_ATTR(mdir.mid.rid, BOOKMARK, +1, NAME(did, NULL, 0)), + LFSR_ATTR(-1, GRM, 0, GRM(&((lfsr_grm_t){{ mdir.mid, - LFSR_MID(-1, -1)}})))); + LFSR_MID(-1, -1)}}))))); if (err) { goto failed_with_parent; } @@ -7311,12 +7301,12 @@ int lfsr_mkdir(lfs_t *lfs, const char *path) { // commit our new directory into our parent, zeroing out our grm // in the process err = lfsr_mdir_commit(lfs, &parent.mdir, LFSR_ATTRS( - LFSR_ATTR_NAME(parent.mdir.mid.rid, DIR, +1, - parent_did, name, name_size), - LFSR_ATTR_LEB128(parent.mdir.mid.rid, DID, 0, did), - LFSR_ATTR_GRM(-1, GRM, 0, &((lfsr_grm_t){{ + LFSR_ATTR(parent.mdir.mid.rid, DIR, +1, + NAME(parent_did, name, name_size)), + LFSR_ATTR(parent.mdir.mid.rid, DID, 0, LEB128(did)), + LFSR_ATTR(-1, GRM, 0, GRM(&((lfsr_grm_t){{ LFSR_MID(-1, -1), - LFSR_MID(-1, -1)}})))); + LFSR_MID(-1, -1)}}))))); if (err) { return err; } @@ -7404,8 +7394,8 @@ int lfsr_remove(lfs_t *lfs, const char *path) { // remove the metadata entry err = lfsr_mdir_commit(lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(mdir.mid.rid, UNR, -1, NULL, 0), - LFSR_ATTR_GRM(-1, GRM, 0, &grm))); + LFSR_ATTR(mdir.mid.rid, UNR, -1, NULL), + LFSR_ATTR(-1, GRM, 0, GRM(&grm)))); if (err) { return err; } @@ -7533,12 +7523,12 @@ int lfsr_rename(lfs_t *lfs, const char *old_path, const char *new_path) { // new rid, while also marking the old rid for removal err = lfsr_mdir_commit(lfs, &new_mdir, LFSR_ATTRS( (exists - ? LFSR_ATTR(new_mdir.mid.rid, UNR, -1, NULL, 0) + ? LFSR_ATTR(new_mdir.mid.rid, UNR, -1, NULL) : LFSR_ATTR_NOOP), - LFSR_ATTR_NAME_(new_mdir.mid.rid, old_tag, +1, - new_did, new_name, new_name_size), - LFSR_ATTR_MOVE(new_mdir.mid.rid, MOVE, 0, &old_mdir), - LFSR_ATTR_GRM(-1, GRM, 0, &grm))); + LFSR_ATTR(new_mdir.mid.rid, TAG(old_tag), +1, + NAME(new_did, new_name, new_name_size)), + LFSR_ATTR(new_mdir.mid.rid, MOVE, 0, MOVE(&old_mdir)), + LFSR_ATTR(-1, GRM, 0, GRM(&grm)))); // we need to clean up any pending grms, fortunately we can leave // this up to lfsr_fs_fixgrm @@ -7780,8 +7770,8 @@ static int lfsr_fs_fixgrm(lfs_t *lfs) { // remove the rid while also updating our grm LFS_ASSERT(lfs->grm.mids[0].rid < (lfs_ssize_t)mdir.u.m.weight); err = lfsr_mdir_commit(lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(mdir.mid.rid, UNR, -1, NULL, 0), - LFSR_ATTR_GRM(-1, GRM, 0, &grm))); + LFSR_ATTR(mdir.mid.rid, UNR, -1, NULL), + LFSR_ATTR(-1, GRM, 0, GRM(&grm)))); } return 0; diff --git a/lfs.h b/lfs.h index 2a122780..728eabe1 100644 --- a/lfs.h +++ b/lfs.h @@ -371,9 +371,7 @@ typedef struct lfsr_btree { union { // weight is common to both representations and its sign-bit indicates // if the btree is inlined - struct { - lfs_size_t weight; - } b; + lfs_size_t weight; struct { lfs_size_t weight; lfsr_tag_t tag; diff --git a/tests/test_alloc.toml b/tests/test_alloc.toml index b0fd9248..c12ffe0d 100644 --- a/tests/test_alloc.toml +++ b/tests/test_alloc.toml @@ -106,7 +106,7 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; lfsr_mdir_t mdir; lfsr_mtree_lookup(&lfs, LFSR_MID(lfsr_mtree_weight(&lfs)-1, -1), @@ -123,7 +123,8 @@ code = ''' // keep creating new metadata entries until we run out of space int err = lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(mdir.mid.rid, INLINED, +1, &alphas[count % 26], 1))); + LFSR_ATTR(mdir.mid.rid, INLINED, +1, + BUF(&alphas[count % 26], 1)))); assert(!err || err == LFS_ERR_NOSPC); if (err == LFS_ERR_NOSPC) { break; diff --git a/tests/test_btree.toml b/tests/test_btree.toml index 4f4435cd..7cd6d26e 100644 --- a/tests/test_btree.toml +++ b/tests/test_btree.toml @@ -54,7 +54,7 @@ code = ''' // create a single-entry tree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("a", 1)) => 0; + LFSR_DATA("a", 1)) => 0; printf("btree: w%d 0x%x.%x\n", btree.u.r.rbyd.weight, btree.u.r.rbyd.block, @@ -93,9 +93,9 @@ code = ''' // create a two-entry tree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("a", 1)) => 0; + LFSR_DATA("a", 1)) => 0; lfsr_btree_push(&lfs, &btree, 1, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("b", 1)) => 0; + LFSR_DATA("b", 1)) => 0; printf("btree: w%d 0x%x.%x\n", btree.u.r.rbyd.weight, btree.u.r.rbyd.block, @@ -139,9 +139,9 @@ code = ''' // create a two-entry tree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("b", 1)) => 0; + LFSR_DATA("b", 1)) => 0; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("a", 1)) => 0; + LFSR_DATA("a", 1)) => 0; printf("btree: w%d 0x%x.%x\n", btree.u.r.rbyd.weight, btree.u.r.rbyd.block, @@ -186,11 +186,11 @@ code = ''' // create a two-entry tree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("a", 1)) => 0; + LFSR_DATA("a", 1)) => 0; lfsr_btree_push(&lfs, &btree, 1, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("b", 1)) => 0; + LFSR_DATA("b", 1)) => 0; lfsr_btree_push(&lfs, &btree, 2, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("c", 1)) => 0; + LFSR_DATA("c", 1)) => 0; printf("btree: w%d 0x%x.%x\n", btree.u.r.rbyd.weight, btree.u.r.rbyd.block, @@ -240,11 +240,11 @@ code = ''' // create a two-entry tree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("c", 1)) => 0; + LFSR_DATA("c", 1)) => 0; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("b", 1)) => 0; + LFSR_DATA("b", 1)) => 0; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("a", 1)) => 0; + LFSR_DATA("a", 1)) => 0; printf("btree: w%d 0x%x.%x\n", btree.u.r.rbyd.weight, btree.u.r.rbyd.block, @@ -300,7 +300,7 @@ code = ''' lfs_size_t n = 0; for (lfs_size_t i = 0; i < N; i++) { int err = lfsr_btree_push(&lfs, &btree, i, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(&alphas[i % 26], 1)); + LFSR_DATA(&alphas[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -352,7 +352,7 @@ code = ''' lfs_size_t n = 0; for (lfs_size_t i = 0; i < N; i++) { int err = lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(&alphas[(N-1-i) % 26], 1)); + LFSR_DATA(&alphas[(N-1-i) % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -419,7 +419,7 @@ code = ''' // add to btree int err = lfsr_btree_push(&lfs, &btree, bid, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(&alphas[i % 26], 1)); + LFSR_DATA(&alphas[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -490,7 +490,7 @@ code = ''' lfs_size_t n = 0; for (lfs_size_t i = 0; i < N; i++) { int err = lfsr_btree_push(&lfs, &btree, i*W, LFSR_TAG_INLINED, W, - LFSR_DATA_BUF(&alphas[i % 26], 1)); + LFSR_DATA(&alphas[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -585,7 +585,7 @@ code = ''' // add to btree int err = lfsr_btree_push(&lfs, &btree, weighted_bid, LFSR_TAG_INLINED, weight, - LFSR_DATA_BUF(&alphas[i % 26], 1)); + LFSR_DATA(&alphas[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -697,10 +697,10 @@ code = ''' // create a single-entry tree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("a", 1)) => 0; + LFSR_DATA("a", 1)) => 0; // update the tree lfsr_btree_set(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("A", 1)) => 0; + LFSR_DATA("A", 1)) => 0; printf("btree: w%d 0x%x.%x\n", btree.u.r.rbyd.weight, btree.u.r.rbyd.block, @@ -738,14 +738,14 @@ code = ''' // create a two-entry tree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("a", 1)) => 0; + LFSR_DATA("a", 1)) => 0; lfsr_btree_push(&lfs, &btree, 1, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("b", 1)) => 0; + LFSR_DATA("b", 1)) => 0; // update the tree lfsr_btree_set(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("A", 1)) => 0; + LFSR_DATA("A", 1)) => 0; lfsr_btree_set(&lfs, &btree, 1, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("B", 1)) => 0; + LFSR_DATA("B", 1)) => 0; printf("btree: w%d 0x%x.%x\n", btree.u.r.rbyd.weight, btree.u.r.rbyd.block, @@ -789,18 +789,18 @@ code = ''' // create a two-entry tree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("a", 1)) => 0; + LFSR_DATA("a", 1)) => 0; lfsr_btree_push(&lfs, &btree, 1, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("b", 1)) => 0; + LFSR_DATA("b", 1)) => 0; lfsr_btree_push(&lfs, &btree, 2, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("c", 1)) => 0; + LFSR_DATA("c", 1)) => 0; // update the tree lfsr_btree_set(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("A", 1)) => 0; + LFSR_DATA("A", 1)) => 0; lfsr_btree_set(&lfs, &btree, 1, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("B", 1)) => 0; + LFSR_DATA("B", 1)) => 0; lfsr_btree_set(&lfs, &btree, 2, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("C", 1)) => 0; + LFSR_DATA("C", 1)) => 0; printf("btree: w%d 0x%x.%x\n", btree.u.r.rbyd.weight, btree.u.r.rbyd.block, @@ -854,7 +854,7 @@ code = ''' const char *uppers = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; for (lfs_size_t i = 0; i < N; i++) { int err = lfsr_btree_push(&lfs, &btree, i, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(&alphas[i % 26], 1)); + LFSR_DATA(&alphas[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { printf("btree: w%d 0x%x.%x\n", @@ -868,7 +868,7 @@ code = ''' // update the tree for (lfs_size_t i = 0; i < N; i++) { int err = lfsr_btree_set(&lfs, &btree, i, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(&uppers[i % 26], 1)); + LFSR_DATA(&uppers[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { printf("btree: w%d 0x%x.%x\n", @@ -926,7 +926,7 @@ code = ''' lfsr_btree_t btree = LFSR_BTREE_NULL; for (lfs_size_t i = 0; i < N; i++) { int err = lfsr_btree_push(&lfs, &btree, i, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(&alphas[i % 26], 1)); + LFSR_DATA(&alphas[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { printf("btree: w%d 0x%x.%x\n", @@ -954,7 +954,7 @@ code = ''' // update btree int err = lfsr_btree_set(&lfs, &btree, bid, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(&uppers[i % 26], 1)); + LFSR_DATA(&uppers[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -1022,7 +1022,7 @@ code = ''' const char *uppers = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; for (lfs_size_t i = 0; i < N; i++) { int err = lfsr_btree_push(&lfs, &btree, i*W, LFSR_TAG_INLINED, W, - LFSR_DATA_BUF(&alphas[i % 26], 1)); + LFSR_DATA(&alphas[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { printf("btree: w%d 0x%x.%x\n", @@ -1036,7 +1036,7 @@ code = ''' // update the tree for (lfs_size_t i = 0; i < N; i++) { int err = lfsr_btree_set(&lfs, &btree, i*W+W-1, LFSR_TAG_INLINED, W, - LFSR_DATA_BUF(&uppers[i % 26], 1)); + LFSR_DATA(&uppers[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { printf("btree: w%d 0x%x.%x\n", @@ -1110,7 +1110,7 @@ code = ''' lfsr_btree_t btree = LFSR_BTREE_NULL; for (lfs_size_t i = 0; i < N; i++) { int err = lfsr_btree_push(&lfs, &btree, i*W, LFSR_TAG_INLINED, W, - LFSR_DATA_BUF(&alphas[i % 26], 1)); + LFSR_DATA(&alphas[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { printf("btree: w%d 0x%x.%x\n", @@ -1149,7 +1149,7 @@ code = ''' // update btree int err = lfsr_btree_set(&lfs, &btree, weighted_bid+sim_weights[bid]-1, LFSR_TAG_INLINED, weight, - LFSR_DATA_BUF(&uppers[i % 26], 1)); + LFSR_DATA(&uppers[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -1258,7 +1258,7 @@ code = ''' // create a single-entry tree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("a", 1)) => 0; + LFSR_DATA("a", 1)) => 0; // pop! lfsr_btree_pop(&lfs, &btree, 0) => 0; printf("btree: w%d 0x%x.%x\n", @@ -1277,7 +1277,7 @@ code = ''' // try to putting it back to see if things still work lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("A", 1)) => 0; + LFSR_DATA("A", 1)) => 0; printf("btree: w%d 0x%x.%x\n", btree.u.r.rbyd.weight, btree.u.r.rbyd.block, @@ -1311,9 +1311,9 @@ code = ''' // create a single-entry tree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("a", 1)) => 0; + LFSR_DATA("a", 1)) => 0; lfsr_btree_push(&lfs, &btree, 1, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("b", 1)) => 0; + LFSR_DATA("b", 1)) => 0; // pop! lfsr_btree_pop(&lfs, &btree, 1) => 0; printf("btree: w%d 0x%x.%x\n", @@ -1338,7 +1338,7 @@ code = ''' // try to putting it back to see if things still work lfsr_btree_push(&lfs, &btree, 1, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("B", 1)) => 0; + LFSR_DATA("B", 1)) => 0; printf("btree: w%d 0x%x.%x\n", btree.u.r.rbyd.weight, btree.u.r.rbyd.block, @@ -1378,9 +1378,9 @@ code = ''' // create a single-entry tree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("a", 1)) => 0; + LFSR_DATA("a", 1)) => 0; lfsr_btree_push(&lfs, &btree, 1, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("b", 1)) => 0; + LFSR_DATA("b", 1)) => 0; // pop! lfsr_btree_pop(&lfs, &btree, 0) => 0; printf("btree: w%d 0x%x.%x\n", @@ -1405,7 +1405,7 @@ code = ''' // try to putting it back to see if things still work lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("A", 1)) => 0; + LFSR_DATA("A", 1)) => 0; printf("btree: w%d 0x%x.%x\n", btree.u.r.rbyd.weight, btree.u.r.rbyd.block, @@ -1445,11 +1445,11 @@ code = ''' // create a single-entry tree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("a", 1)) => 0; + LFSR_DATA("a", 1)) => 0; lfsr_btree_push(&lfs, &btree, 1, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("b", 1)) => 0; + LFSR_DATA("b", 1)) => 0; lfsr_btree_push(&lfs, &btree, 2, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("c", 1)) => 0; + LFSR_DATA("c", 1)) => 0; // pop! lfsr_btree_pop(&lfs, &btree, 2) => 0; printf("btree: w%d 0x%x.%x\n", @@ -1480,7 +1480,7 @@ code = ''' // try to putting it back to see if things still work lfsr_btree_push(&lfs, &btree, 2, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("C", 1)) => 0; + LFSR_DATA("C", 1)) => 0; printf("btree: w%d 0x%x.%x\n", btree.u.r.rbyd.weight, btree.u.r.rbyd.block, @@ -1531,7 +1531,7 @@ code = ''' const char *alphas = "abcdefghijklmnopqrstuvwxyz"; for (lfs_size_t i = 0; i < N; i++) { int err = lfsr_btree_push(&lfs, &btree, i, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(&alphas[i % 26], 1)); + LFSR_DATA(&alphas[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { printf("btree: w%d 0x%x.%x\n", @@ -1581,7 +1581,7 @@ code = ''' // try recovering lfsr_btree_push(&lfs, &btree, REMAINING, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("R", 1)) => 0; + LFSR_DATA("R", 1)) => 0; for (lfs_size_t i = 0; i < REMAINING; i++) { lfsr_btree_get(&lfs, &btree, i, @@ -1622,7 +1622,7 @@ code = ''' const char *alphas = "abcdefghijklmnopqrstuvwxyz"; for (lfs_size_t i = 0; i < N; i++) { int err = lfsr_btree_push(&lfs, &btree, i, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(&alphas[i % 26], 1)); + LFSR_DATA(&alphas[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { printf("btree: w%d 0x%x.%x\n", @@ -1671,7 +1671,7 @@ code = ''' // try recovering lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("R", 1)) => 0; + LFSR_DATA("R", 1)) => 0; lfsr_btree_get(&lfs, &btree, 0, &tag_, &weight_, buffer, 4) => 1; @@ -1714,7 +1714,7 @@ code = ''' lfsr_btree_t btree = LFSR_BTREE_NULL; for (lfs_size_t i = 0; i < N; i++) { int err = lfsr_btree_push(&lfs, &btree, i, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(&alphas[i % 26], 1)); + LFSR_DATA(&alphas[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { printf("btree: w%d 0x%x.%x\n", @@ -1812,7 +1812,7 @@ code = ''' const char *alphas = "abcdefghijklmnopqrstuvwxyz"; for (lfs_size_t i = 0; i < N; i++) { int err = lfsr_btree_push(&lfs, &btree, i*W, LFSR_TAG_INLINED, W, - LFSR_DATA_BUF(&alphas[i % 26], 1)); + LFSR_DATA(&alphas[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { printf("btree: w%d 0x%x.%x\n", @@ -1861,7 +1861,7 @@ code = ''' // try recovering lfsr_btree_push(&lfs, &btree, REMAINING*W, LFSR_TAG_INLINED, W, - LFSR_DATA_BUF("R", 1)) => 0; + LFSR_DATA("R", 1)) => 0; for (lfs_size_t i = 0; i < REMAINING; i++) { lfsr_btree_get(&lfs, &btree, i*W+W-1, @@ -1952,7 +1952,7 @@ code = ''' int err = lfsr_btree_push(&lfs, &btree, weighted_bid, LFSR_TAG_INLINED, weight, - LFSR_DATA_BUF(&alphas[i % 26], 1)); + LFSR_DATA(&alphas[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { printf("btree: w%d 0x%x.%x\n", @@ -2090,12 +2090,12 @@ code = ''' lfsr_btree_t btree = LFSR_BTREE_NULL; const char *alphas = "abcdefghijklmnopqrstuvwxyz"; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(&alphas[0 % 26], 1)) => 0; + LFSR_DATA(&alphas[0 % 26], 1)) => 0; lfs_size_t n = 1; for (lfs_size_t i = 1; i < N; i++) { int err = lfsr_btree_split(&lfs, &btree, i-1, LFSR_DATA_NULL, - LFSR_TAG_INLINED, 1, LFSR_DATA_BUF(&alphas[(i-1) % 26], 1), - LFSR_TAG_INLINED, 1, LFSR_DATA_BUF(&alphas[(i-0) % 26], 1)); + LFSR_TAG_INLINED, 1, LFSR_DATA(&alphas[(i-1) % 26], 1), + LFSR_TAG_INLINED, 1, LFSR_DATA(&alphas[(i-0) % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -2148,7 +2148,7 @@ code = ''' // create a btree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("_", 1)) => 0; + LFSR_DATA("_", 1)) => 0; // set up a simulation to compare against // @@ -2166,8 +2166,8 @@ code = ''' // split btree int err = lfsr_btree_split(&lfs, &btree, bid, LFSR_DATA_NULL, - LFSR_TAG_INLINED, 1, LFSR_DATA_BUF(&alphas[i % 26], 1), - LFSR_TAG_INLINED, 1, LFSR_DATA_BUF(&uppers[i % 26], 1)); + LFSR_TAG_INLINED, 1, LFSR_DATA(&alphas[i % 26], 1), + LFSR_TAG_INLINED, 1, LFSR_DATA(&uppers[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -2237,12 +2237,12 @@ code = ''' lfsr_btree_t btree = LFSR_BTREE_NULL; const char *alphas = "abcdefghijklmnopqrstuvwxyz"; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, W, - LFSR_DATA_BUF(&alphas[0 % 26], 1)) => 0; + LFSR_DATA(&alphas[0 % 26], 1)) => 0; lfs_size_t n = 1; for (lfs_size_t i = 1; i < N; i++) { int err = lfsr_btree_split(&lfs, &btree, (i-1)*W+W-1, LFSR_DATA_NULL, - LFSR_TAG_INLINED, W, LFSR_DATA_BUF(&alphas[(i-1) % 26], 1), - LFSR_TAG_INLINED, W, LFSR_DATA_BUF(&alphas[(i-0) % 26], 1)); + LFSR_TAG_INLINED, W, LFSR_DATA(&alphas[(i-1) % 26], 1), + LFSR_TAG_INLINED, W, LFSR_DATA(&alphas[(i-0) % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -2296,7 +2296,7 @@ code = ''' // create a btree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, W, - LFSR_DATA_BUF("_", 1)) => 0; + LFSR_DATA("_", 1)) => 0; // set up a simulation to compare against // @@ -2328,9 +2328,9 @@ code = ''' int err = lfsr_btree_split(&lfs, &btree, weighted_bid+sim_weights[bid]-1, LFSR_DATA_NULL, LFSR_TAG_INLINED, weight1, - LFSR_DATA_BUF(&alphas[i % 26], 1), + LFSR_DATA(&alphas[i % 26], 1), LFSR_TAG_INLINED, weight2, - LFSR_DATA_BUF(&uppers[i % 26], 1)); + LFSR_DATA(&uppers[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -2466,7 +2466,7 @@ code = ''' // push to btree int err = lfsr_btree_push(&lfs, &btree, bid, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(&alphas[i % 26], 1)); + LFSR_DATA(&alphas[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -2482,7 +2482,7 @@ code = ''' // update btree int err = lfsr_btree_set(&lfs, &btree, bid, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(&alphas[i % 26], 1)); + LFSR_DATA(&alphas[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -2593,7 +2593,7 @@ code = ''' // push to btree int err = lfsr_btree_push(&lfs, &btree, weighted_bid, LFSR_TAG_INLINED, weight, - LFSR_DATA_BUF(&alphas[i % 26], 1)); + LFSR_DATA(&alphas[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -2612,7 +2612,7 @@ code = ''' // update btree int err = lfsr_btree_set(&lfs, &btree, weighted_bid+sim_weights[bid]-1, LFSR_TAG_INLINED, weight, - LFSR_DATA_BUF(&alphas[i % 26], 1)); + LFSR_DATA(&alphas[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -2768,7 +2768,7 @@ code = ''' // create a single-entry tree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("0", 1)) => 0; + LFSR_DATA("0", 1)) => 0; printf("btree: w%d 0x%x.%x\n", btree.u.r.rbyd.weight, btree.u.r.rbyd.block, @@ -2817,10 +2817,10 @@ code = ''' // create a two-entry tree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("0", 1)) => 0; + LFSR_DATA("0", 1)) => 0; lfsr_btree_split(&lfs, &btree, 0, LFSR_DATA_NAME(0*DID, "aab", 3), - LFSR_TAG_INLINED, 1, LFSR_DATA_BUF("0", 1), - LFSR_TAG_INLINED, 1, LFSR_DATA_BUF("1", 1)) => 0; + LFSR_TAG_INLINED, 1, LFSR_DATA("0", 1), + LFSR_TAG_INLINED, 1, LFSR_DATA("1", 1)) => 0; printf("btree: w%d 0x%x.%x\n", btree.u.r.rbyd.weight, btree.u.r.rbyd.block, @@ -2877,13 +2877,13 @@ code = ''' // create a two-entry tree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("0", 1)) => 0; + LFSR_DATA("0", 1)) => 0; lfsr_btree_split(&lfs, &btree, 0, LFSR_DATA_NAME(1*DID, "aab", 3), - LFSR_TAG_INLINED, 1, LFSR_DATA_BUF("0", 1), - LFSR_TAG_INLINED, 1, LFSR_DATA_BUF("1", 1)) => 0; + LFSR_TAG_INLINED, 1, LFSR_DATA("0", 1), + LFSR_TAG_INLINED, 1, LFSR_DATA("1", 1)) => 0; lfsr_btree_split(&lfs, &btree, 1, LFSR_DATA_NAME(2*DID, "aac", 3), - LFSR_TAG_INLINED, 1, LFSR_DATA_BUF("1", 1), - LFSR_TAG_INLINED, 1, LFSR_DATA_BUF("2", 1)) => 0; + LFSR_TAG_INLINED, 1, LFSR_DATA("1", 1), + LFSR_TAG_INLINED, 1, LFSR_DATA("2", 1)) => 0; printf("btree: w%d 0x%x.%x\n", btree.u.r.rbyd.weight, btree.u.r.rbyd.block, @@ -2948,13 +2948,13 @@ code = ''' // create a two-entry tree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("0", 1)) => 0; + LFSR_DATA("0", 1)) => 0; lfsr_btree_split(&lfs, &btree, 0, LFSR_DATA_NAME(2*DID, "aac", 3), - LFSR_TAG_INLINED, 1, LFSR_DATA_BUF("1", 1), - LFSR_TAG_INLINED, 1, LFSR_DATA_BUF("2", 1)) => 0; + LFSR_TAG_INLINED, 1, LFSR_DATA("1", 1), + LFSR_TAG_INLINED, 1, LFSR_DATA("2", 1)) => 0; lfsr_btree_split(&lfs, &btree, 0, LFSR_DATA_NAME(1*DID, "aab", 3), - LFSR_TAG_INLINED, 1, LFSR_DATA_BUF("0", 1), - LFSR_TAG_INLINED, 1, LFSR_DATA_BUF("1", 1)) => 0; + LFSR_TAG_INLINED, 1, LFSR_DATA("0", 1), + LFSR_TAG_INLINED, 1, LFSR_DATA("1", 1)) => 0; printf("btree: w%d 0x%x.%x\n", btree.u.r.rbyd.weight, btree.u.r.rbyd.block, @@ -3022,7 +3022,7 @@ code = ''' const char *alphas = "abcdefghijklmnopqrstuvwxyz"; const char *nums = "0123456789"; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(&nums[0 % 10], 1)) => 0; + LFSR_DATA(&nums[0 % 10], 1)) => 0; lfs_size_t n = 1; for (lfs_size_t i = 1; i < N; i++) { char name[3] = { @@ -3030,8 +3030,8 @@ code = ''' }; int err = lfsr_btree_split(&lfs, &btree, i-1, LFSR_DATA_NAME(i*DID, name, 3), - LFSR_TAG_INLINED, 1, LFSR_DATA_BUF(&nums[(i-1) % 10], 1), - LFSR_TAG_INLINED, 1, LFSR_DATA_BUF(&nums[(i-0) % 10], 1)); + LFSR_TAG_INLINED, 1, LFSR_DATA(&nums[(i-1) % 10], 1), + LFSR_TAG_INLINED, 1, LFSR_DATA(&nums[(i-0) % 10], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -3088,7 +3088,7 @@ code = ''' // create a btree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("_", 1)) => 0; + LFSR_DATA("_", 1)) => 0; // set up a simulation to compare against // @@ -3123,8 +3123,8 @@ code = ''' // split btree int err = lfsr_btree_split(&lfs, &btree, bid, LFSR_DATA_NAME(0, name, 3), - LFSR_TAG_INLINED, 1, LFSR_DATA_BUF(&nums[i % 10], 1), - LFSR_TAG_INLINED, 1, LFSR_DATA_BUF(&nums[i % 10], 1)); + LFSR_TAG_INLINED, 1, LFSR_DATA(&nums[i % 10], 1), + LFSR_TAG_INLINED, 1, LFSR_DATA(&nums[i % 10], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -3200,7 +3200,7 @@ code = ''' const char *alphas = "abcdefghijklmnopqrstuvwxyz"; const char *nums = "0123456789"; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, W, - LFSR_DATA_BUF(&nums[0 % 10], 1)) => 0; + LFSR_DATA(&nums[0 % 10], 1)) => 0; lfs_size_t n = 1; for (lfs_size_t i = 1; i < N; i++) { char name[3] = { @@ -3208,8 +3208,8 @@ code = ''' }; int err = lfsr_btree_split(&lfs, &btree, (i-1)*W+W-1, LFSR_DATA_NAME(i*DID, name, 3), - LFSR_TAG_INLINED, W, LFSR_DATA_BUF(&nums[(i-1) % 10], 1), - LFSR_TAG_INLINED, W, LFSR_DATA_BUF(&nums[(i-0) % 10], 1)); + LFSR_TAG_INLINED, W, LFSR_DATA(&nums[(i-1) % 10], 1), + LFSR_TAG_INLINED, W, LFSR_DATA(&nums[(i-0) % 10], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -3267,7 +3267,7 @@ code = ''' // create a btree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, W, - LFSR_DATA_BUF("_", 1)) => 0; + LFSR_DATA("_", 1)) => 0; // set up a simulation to compare against // @@ -3315,8 +3315,8 @@ code = ''' int err = lfsr_btree_split(&lfs, &btree, weighted_bid+sim_weights[bid]-1, LFSR_DATA_NAME(0, name, 3), - LFSR_TAG_INLINED, weight1, LFSR_DATA_BUF(&nums[i % 10], 1), - LFSR_TAG_INLINED, weight2, LFSR_DATA_BUF(&nums[i % 10], 1)); + LFSR_TAG_INLINED, weight1, LFSR_DATA(&nums[i % 10], 1), + LFSR_TAG_INLINED, weight2, LFSR_DATA(&nums[i % 10], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -3418,7 +3418,7 @@ code = ''' // create a btree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF("_", 1)) => 0; + LFSR_DATA("_", 1)) => 0; // set up a simulation to compare against // @@ -3469,9 +3469,9 @@ code = ''' split_bid, LFSR_DATA_NAME(0, sim_names[bid+1], 3), LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(&nums[i % 10], 1), + LFSR_DATA(&nums[i % 10], 1), LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(split_buf, 1)); + LFSR_DATA(split_buf, 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -3481,9 +3481,9 @@ code = ''' int err = lfsr_btree_split(&lfs, &btree, split_bid, LFSR_DATA_NAME(0, name, 3), LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(split_buf, 1), + LFSR_DATA(split_buf, 1), LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(&nums[i % 10], 1)); + LFSR_DATA(&nums[i % 10], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -3502,7 +3502,7 @@ code = ''' // update btree int err = lfsr_btree_set(&lfs, &btree, bid, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(&nums[i % 10], 1)); + LFSR_DATA(&nums[i % 10], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -3593,7 +3593,7 @@ code = ''' // create a btree lfsr_btree_t btree = LFSR_BTREE_NULL; lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, W, - LFSR_DATA_BUF("_", 1)) => 0; + LFSR_DATA("_", 1)) => 0; // set up a simulation to compare against // @@ -3662,9 +3662,9 @@ code = ''' int err = lfsr_btree_split(&lfs, &btree, split_bid, LFSR_DATA_NAME(0, sim_names[bid+1], 3), LFSR_TAG_INLINED, weight, - LFSR_DATA_BUF(&nums[i % 10], 1), + LFSR_DATA(&nums[i % 10], 1), LFSR_TAG_INLINED, split_weight, - LFSR_DATA_BUF(split_buf, 1)); + LFSR_DATA(split_buf, 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -3674,9 +3674,9 @@ code = ''' int err = lfsr_btree_split(&lfs, &btree, split_bid, LFSR_DATA_NAME(0, name, 3), LFSR_TAG_INLINED, split_weight, - LFSR_DATA_BUF(split_buf, 1), + LFSR_DATA(split_buf, 1), LFSR_TAG_INLINED, weight, - LFSR_DATA_BUF(&nums[i % 10], 1)); + LFSR_DATA(&nums[i % 10], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -3698,7 +3698,7 @@ code = ''' // update btree int err = lfsr_btree_set(&lfs, &btree, weighted_bid+sim_weights[bid]-1, LFSR_TAG_INLINED, weight, - LFSR_DATA_BUF(&nums[i % 10], 1)); + LFSR_DATA(&nums[i % 10], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -3817,7 +3817,7 @@ code = ''' lfs_size_t n = 0; for (lfs_size_t i = 0; i < N; i++) { int err = lfsr_btree_push(&lfs, &btree, i, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(&alphas[i % 26], 1)); + LFSR_DATA(&alphas[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -3870,7 +3870,7 @@ code = ''' } if (tag_ == LFSR_TAG_BTREE) { - lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.buf.buffer; + lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.b.buffer; printf("traversal: %d 0x%x w%d btree 0x%x.%x\n", bid_, tag_, @@ -3950,7 +3950,7 @@ code = ''' // add to btree int err = lfsr_btree_push(&lfs, &btree, bid, LFSR_TAG_INLINED, 1, - LFSR_DATA_BUF(&alphas[i % 26], 1)); + LFSR_DATA(&alphas[i % 26], 1)); // ignore space issues if (err == LFS_ERR_NOSPC) { break; @@ -4018,7 +4018,7 @@ code = ''' } if (tag_ == LFSR_TAG_BTREE) { - lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.buf.buffer; + lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.b.buffer; printf("traversal: %d 0x%x w%d btree 0x%x.%x\n", bid_, tag_, diff --git a/tests/test_mtree.toml b/tests/test_mtree.toml index afc9ba67..6efce6c9 100644 --- a/tests/test_mtree.toml +++ b/tests/test_mtree.toml @@ -27,7 +27,7 @@ code = ''' for (lfs_size_t i = 0; i < N; i++) { lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(i), 0, &alphas[i % 26], 1))) => 0; + LFSR_ATTR(-1, UATTR(i), 0, BUF(&alphas[i % 26], 1)))) => 0; } for (lfs_size_t i = 0; i < N; i++) { @@ -69,7 +69,7 @@ code = ''' lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(i), 0, &alphas[i % 26], 1))) => 0; + LFSR_ATTR(-1, UATTR(i), 0, BUF(&alphas[i % 26], 1)))) => 0; } for (lfs_size_t i = 0; i < N; i++) { @@ -108,7 +108,7 @@ code = ''' for (lfs_size_t i = 0; i < N; i++) { lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, &alphas[i % 26], 1))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(&alphas[i % 26], 1)))) => 0; uint8_t buffer[4]; lfsr_mdir_get(&lfs, &lfs.mroot, @@ -150,18 +150,18 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // prepare mroot with a large attr so the next entry can not fit uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; // create a large entry that needs to be uninlined (but not split!) memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -225,17 +225,17 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create 2 large entries that needs to be uninlined and split uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -299,17 +299,17 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create an uninlined mdir uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -327,7 +327,7 @@ code = ''' memset(buffer, alphas[2 % 26], SIZE); lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mdir to compact mdir.u.r.rbyd.eoff = BLOCK_SIZE; @@ -401,7 +401,7 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create entries lfsr_mdir_t mdir; @@ -417,7 +417,8 @@ code = ''' } lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(mdir.mid.rid, INLINED, +1, &alphas[i % 26], 1))) => 0; + LFSR_ATTR(mdir.mid.rid, INLINED, +1, + BUF(&alphas[i % 26], 1)))) => 0; uint8_t buffer[4]; lfsr_mdir_get(&lfs, &mdir, mdir.mid.rid, LFSR_TAG_INLINED, @@ -489,7 +490,7 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // at least keep track of the number of entries we expect lfs_size_t count = 0; @@ -514,7 +515,8 @@ code = ''' // add to rbyd, potentially splitting the mdir lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(mdir.mid.rid, INLINED, +1, &alphas[i % 26], 1))) => 0; + LFSR_ATTR(mdir.mid.rid, INLINED, +1, + BUF(&alphas[i % 26], 1)))) => 0; // make sure we can look up the new entry uint8_t buffer[4]; @@ -596,17 +598,17 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create an uninlined mdir uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -623,7 +625,7 @@ code = ''' assert(mdir.u.m.weight == 1); lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // assert mdir was dropped assert(lfsr_mtree_weight(&lfs) == 0); @@ -666,17 +668,17 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create an uninlined mdir uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -696,7 +698,7 @@ code = ''' mdir.u.r.rbyd.eoff = BLOCK_SIZE; lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // assert mdir was dropped assert(lfsr_mtree_weight(&lfs) == 0); @@ -739,24 +741,24 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create an uninlined mdir uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; // remove the entry as we compact, forcing the mdir to be dropped lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // assert mdir was dropped assert(lfsr_mtree_weight(&lfs) == 0); @@ -799,17 +801,17 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create an mdir that needs to be split uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -817,7 +819,7 @@ code = ''' // remove the left entry as we compact, forcing the left // mdir to be dropped lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // assert mdir was dropped assert(lfsr_mtree_weight(&lfs) == 1); @@ -867,17 +869,17 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create an mdir that needs to be split uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -885,7 +887,7 @@ code = ''' // remove the right entry as we compact, forcing the right mdir // to be dropped lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(1, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(1, UNR, -1, NULL))) => 0; // assert mdir was dropped assert(lfsr_mtree_weight(&lfs) == 1); @@ -935,25 +937,25 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create an mdir that needs to be split uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; // remove both entries as we compact, forcing both mdirs to be dropped lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0), - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL), + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // assert mdir was dropped assert(lfsr_mtree_weight(&lfs) == 0); @@ -986,17 +988,17 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create an uninlined mdir uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -1014,7 +1016,7 @@ code = ''' memset(buffer, alphas[2 % 26], SIZE); lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mdir to compact mdir.u.r.rbyd.eoff = BLOCK_SIZE; @@ -1022,7 +1024,7 @@ code = ''' // remove the left entry as we compact, forcing the left // mdir to be dropped lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // assert mdir was dropped assert(lfsr_mtree_weight(&lfs) == 1); @@ -1081,17 +1083,17 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create an uninlined mdir uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -1109,7 +1111,7 @@ code = ''' memset(buffer, alphas[2 % 26], SIZE); lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mdir to compact mdir.u.r.rbyd.eoff = BLOCK_SIZE; @@ -1117,7 +1119,7 @@ code = ''' // remove the right entry as we compact, forcing the right // mdir to be dropped lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(1, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(1, UNR, -1, NULL))) => 0; // assert mdir was dropped assert(lfsr_mtree_weight(&lfs) == 1); @@ -1176,17 +1178,17 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create an uninlined mdir uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -1204,15 +1206,15 @@ code = ''' memset(buffer, alphas[2 % 26], SIZE); lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mdir to compact mdir.u.r.rbyd.eoff = BLOCK_SIZE; // remove both entries as we compact, forcing both mdirs to be dropped lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0), - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL), + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // assert mdir was dropped assert(lfsr_mtree_weight(&lfs) == 0); @@ -1258,7 +1260,7 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create entries lfsr_mdir_t mdir; @@ -1268,7 +1270,8 @@ code = ''' mdir.mid.rid = 0; for (lfs_size_t i = 0; i < N; i++) { lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(mdir.mid.rid, INLINED, +1, &alphas[i % 26], 1))) => 0; + LFSR_ATTR(mdir.mid.rid, INLINED, +1, + BUF(&alphas[i % 26], 1)))) => 0; uint8_t buffer[4]; lfsr_mdir_get(&lfs, &mdir, mdir.mid.rid, LFSR_TAG_INLINED, @@ -1294,7 +1297,7 @@ code = ''' } lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; } // try looking up each entry @@ -1358,7 +1361,7 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; for (lfs_size_t cycle = 0; cycle < CYCLES; cycle++) { // create entries @@ -1370,7 +1373,7 @@ code = ''' for (lfs_size_t i = 0; i < N; i++) { lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( LFSR_ATTR(mdir.mid.rid, INLINED, +1, - &alphas[i % 26], 1))) => 0; + BUF(&alphas[i % 26], 1)))) => 0; uint8_t buffer[4]; lfsr_mdir_get(&lfs, &mdir, mdir.mid.rid, LFSR_TAG_INLINED, @@ -1415,7 +1418,7 @@ code = ''' } lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; } assert(lfsr_mtree_weight(&lfs) == 0); @@ -1448,7 +1451,7 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // at least keep track of the number of entries we expect lfs_size_t count = 0; @@ -1480,7 +1483,7 @@ code = ''' // add to rbyd, potentially splitting the mdir lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( LFSR_ATTR(mdir.mid.rid, INLINED, +1, - &alphas[i % 26], 1))) => 0; + BUF(&alphas[i % 26], 1)))) => 0; // make sure we can look up the new entry uint8_t buffer[4]; @@ -1493,7 +1496,7 @@ code = ''' // delete } else { lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(mdir.mid.rid, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(mdir.mid.rid, UNR, -1, NULL))) => 0; count -= 1; } @@ -1580,18 +1583,18 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // prepare mroot with a large attr so the next entry can not fit uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; // create a large entry that needs to be uninlined (but not split!) memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -1614,7 +1617,7 @@ code = ''' mdir.u.r.rbyd.eoff = BLOCK_SIZE; memset(buffer, alphas[2 % 26], SIZE); lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, 0, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, 0, BUF(buffer, SIZE)))) => 0; // assert we relocated assert(lfsr_mdir_cmp(old_mdir.u.m.blocks, mdir.u.m.blocks) != 0); @@ -1676,17 +1679,17 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create 2 large entries that needs to be uninlined and split uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -1709,7 +1712,7 @@ code = ''' mdir.u.r.rbyd.eoff = BLOCK_SIZE; memset(buffer, alphas[2 % 26], SIZE); lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, 0, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, 0, BUF(buffer, SIZE)))) => 0; // assert we relocated assert(lfsr_mdir_cmp(old_mdir.u.m.blocks, mdir.u.m.blocks) != 0); @@ -1771,17 +1774,17 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create 2 large entries that needs to be uninlined and split uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -1804,7 +1807,7 @@ code = ''' mdir.u.r.rbyd.eoff = BLOCK_SIZE; memset(buffer, alphas[2 % 26], SIZE); lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, 0, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, 0, BUF(buffer, SIZE)))) => 0; // assert we relocated assert(lfsr_mdir_cmp(old_mdir.u.m.blocks, mdir.u.m.blocks) != 0); @@ -1866,13 +1869,13 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // prepare mroot with an attr uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; // force mroot to compact twice, this should extend the mroot lfsr_mdir_t old_mroot = lfs.mroot; @@ -1882,7 +1885,7 @@ code = ''' lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; // assert we relocated assert(lfsr_mdir_cmp(old_mroot.u.m.blocks, lfs.mroot.u.m.blocks) != 0); @@ -1926,13 +1929,13 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // prepare mroot with an attr uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; // force mroot to compact 2x2 times, this should extend the mroot twice lfsr_mdir_t old_mroot = lfs.mroot; @@ -1944,7 +1947,7 @@ code = ''' lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; // assert we relocated assert(lfsr_mdir_cmp(old_mroot.u.m.blocks, lfs.mroot.u.m.blocks) != 0); @@ -1985,13 +1988,13 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // prepare mroot with an attr uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; // force mroot to compact twice, this should extend the mroot lfsr_mdir_t old_mroot = lfs.mroot; @@ -2012,7 +2015,7 @@ code = ''' lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; // assert we relocated assert(lfsr_mdir_cmp(old_mroot.u.m.blocks, lfs.mroot.u.m.blocks) != 0); @@ -2053,18 +2056,18 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // prepare mroot with a large attr so the next entry can not fit uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; // create a large entry that needs to be uninlined (but not split!) memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -2092,7 +2095,7 @@ code = ''' mdir.u.r.rbyd.eoff = BLOCK_SIZE; memset(buffer, alphas[2 % 26], SIZE); lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, 0, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, 0, BUF(buffer, SIZE)))) => 0; // assert we relocated our mdir assert(lfsr_mdir_cmp(old_mdir.u.m.blocks, mdir.u.m.blocks) != 0); @@ -2160,17 +2163,17 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create an uninlined mdir uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -2193,7 +2196,7 @@ code = ''' memset(buffer, alphas[2 % 26], SIZE); lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mdir to compact mdir.u.r.rbyd.eoff = BLOCK_SIZE; @@ -2274,17 +2277,17 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create an uninlined mdir uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -2306,7 +2309,7 @@ code = ''' assert(mdir.u.m.weight == 1); lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // assert mdir was dropped assert(lfsr_mtree_weight(&lfs) == 0); @@ -2357,7 +2360,7 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // force mroot to compact once, so the second compact below will trigger // a relocation @@ -2368,12 +2371,12 @@ code = ''' uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; // create a large entry that needs to be uninlined (but not split!) memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact, this should trigger a relocation lfsr_mdir_t old_mroot = lfs.mroot; @@ -2446,7 +2449,7 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // force mroot to compact once, so the second compact below will trigger // a relocation @@ -2457,11 +2460,11 @@ code = ''' uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact, this should trigger a relocation lfsr_mdir_t old_mroot = lfs.mroot; @@ -2536,7 +2539,7 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // at least keep track of the number of entries we expect lfs_size_t count = 0; @@ -2568,7 +2571,7 @@ code = ''' // add to rbyd lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( LFSR_ATTR(mdir.mid.rid, INLINED, +1, - &alphas[i % 26], 1))) => 0; + BUF(&alphas[i % 26], 1)))) => 0; // make sure we can look up the new entry uint8_t buffer[4]; @@ -2583,7 +2586,7 @@ code = ''' // update rbyd lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( LFSR_ATTR(mdir.mid.rid, INLINED, 0, - &alphas[i % 26], 1))) => 0; + BUF(&alphas[i % 26], 1)))) => 0; // make sure we can look up the new entry uint8_t buffer[4]; @@ -2594,7 +2597,7 @@ code = ''' // delete } else { lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(mdir.mid.rid, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(mdir.mid.rid, UNR, -1, NULL))) => 0; count -= 1; } @@ -2676,12 +2679,12 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // setup our neighbors lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, &alphas[0 % 26], 1), - LFSR_ATTR(1, INLINED, +1, &alphas[1 % 26], 1))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(&alphas[0 % 26], 1)), + LFSR_ATTR(1, INLINED, +1, BUF(&alphas[1 % 26], 1)))) => 0; // this test only works if these all fit in the mroot assert(lfsr_mtree_isinlined(&lfs)); @@ -2694,7 +2697,7 @@ code = ''' // insert a new entry, this should update our neighbors lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, &alphas[2 % 26], 1))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(&alphas[2 % 26], 1)))) => 0; // assert that our entry is still in the mtree assert(lfs.mroot.u.m.weight == 3); @@ -2731,12 +2734,12 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // setup our neighbors lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, &alphas[0 % 26], 1), - LFSR_ATTR(1, INLINED, +1, &alphas[1 % 26], 1))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(&alphas[0 % 26], 1)), + LFSR_ATTR(1, INLINED, +1, BUF(&alphas[1 % 26], 1)))) => 0; // this test only works if these all fit in the mroot assert(lfsr_mtree_isinlined(&lfs)); @@ -2749,7 +2752,7 @@ code = ''' // try removing our left entry lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // assert that an entry was removed assert(lfs.mroot.u.m.weight == 1); @@ -2777,12 +2780,12 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // setup our neighbors lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, &alphas[0 % 26], 1), - LFSR_ATTR(1, INLINED, +1, &alphas[1 % 26], 1))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(&alphas[0 % 26], 1)), + LFSR_ATTR(1, INLINED, +1, BUF(&alphas[1 % 26], 1)))) => 0; // this test only works if these all fit in the mroot assert(lfsr_mtree_isinlined(&lfs)); @@ -2795,7 +2798,7 @@ code = ''' // try removing our left entry lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(1, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(1, UNR, -1, NULL))) => 0; // assert that an entry was removed assert(lfs.mroot.u.m.weight == 1); @@ -2825,12 +2828,12 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // setup our neighbors lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, &alphas[0 % 26], 1), - LFSR_ATTR(1, INLINED, +1, &alphas[1 % 26], 1))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(&alphas[0 % 26], 1)), + LFSR_ATTR(1, INLINED, +1, BUF(&alphas[1 % 26], 1)))) => 0; // this test only works if these all fit in the mroot assert(lfsr_mtree_isinlined(&lfs)); @@ -2845,12 +2848,12 @@ code = ''' uint8_t buffer[SIZE]; memset(buffer, alphas[2 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; // create a large entry that needs to be uninlined (but not split!) memset(buffer, alphas[3 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -2909,12 +2912,12 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // setup our neighbors lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, &alphas[0 % 26], 1), - LFSR_ATTR(1, INLINED, +1, &alphas[1 % 26], 1))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(&alphas[0 % 26], 1)), + LFSR_ATTR(1, INLINED, +1, BUF(&alphas[1 % 26], 1)))) => 0; // this test only works if these all fit in the mroot assert(lfsr_mtree_isinlined(&lfs)); @@ -2929,11 +2932,11 @@ code = ''' uint8_t buffer[SIZE]; memset(buffer, alphas[2 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[3 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(2, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(2, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -2988,17 +2991,17 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create an uninlined mdir uint8_t buffer[SIZE]; memset(buffer, alphas[2 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[3 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -3018,8 +3021,8 @@ code = ''' assert(mdir.u.m.weight == 1); lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, &alphas[0 % 26], 1), - LFSR_ATTR(2, INLINED, +1, &alphas[1 % 26], 1))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(&alphas[0 % 26], 1)), + LFSR_ATTR(2, INLINED, +1, BUF(&alphas[1 % 26], 1)))) => 0; // this test only works if these all fit in the mdir assert(lfsr_mtree_weight(&lfs) == 1); assert(mdir.u.m.weight == 3); @@ -3034,7 +3037,7 @@ code = ''' // now add another large entry to the mdir, forcing a split memset(buffer, alphas[4 % 26], SIZE); lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(2, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(2, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mdir to compact mdir.u.r.rbyd.eoff = BLOCK_SIZE; @@ -3095,12 +3098,12 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // setup our neighbors lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, &alphas[0 % 26], 1), - LFSR_ATTR(1, INLINED, +1, &alphas[1 % 26], 1))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(&alphas[0 % 26], 1)), + LFSR_ATTR(1, INLINED, +1, BUF(&alphas[1 % 26], 1)))) => 0; // this test only works if these all fit in the mroot assert(lfsr_mtree_isinlined(&lfs)); @@ -3115,7 +3118,7 @@ code = ''' uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; // force mroot to compact twice, this should extend the mroot lfsr_mdir_t old_mroot = lfs.mroot; @@ -3125,7 +3128,7 @@ code = ''' lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; // assert we relocated assert(lfsr_mdir_cmp(old_mroot.u.m.blocks, lfs.mroot.u.m.blocks) != 0); @@ -3166,17 +3169,17 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create an uninlined mdir uint8_t buffer[SIZE]; memset(buffer, alphas[2 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[3 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -3196,8 +3199,8 @@ code = ''' assert(mdir.u.m.weight == 1); lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, &alphas[0 % 26], 1), - LFSR_ATTR(2, INLINED, +1, &alphas[1 % 26], 1))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(&alphas[0 % 26], 1)), + LFSR_ATTR(2, INLINED, +1, BUF(&alphas[1 % 26], 1)))) => 0; // this test only works if these all fit in the mdir assert(lfsr_mtree_weight(&lfs) == 1); assert(mdir.u.m.weight == 3); @@ -3217,7 +3220,7 @@ code = ''' mdir.u.r.rbyd.eoff = BLOCK_SIZE; memset(buffer, alphas[4 % 26], SIZE); lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, 0, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, 0, BUF(buffer, SIZE)))) => 0; // assert we relocated assert(lfsr_mdir_cmp(old_mdir.u.m.blocks, mdir.u.m.blocks) != 0); @@ -3264,7 +3267,7 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; //// create a situation where we have 3 mdirs in our tree @@ -3272,10 +3275,10 @@ code = ''' uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -3290,7 +3293,7 @@ code = ''' assert(mdir.u.m.weight == 1); memset(buffer, alphas[2 % 26], SIZE); lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mdir to compact mdir.u.r.rbyd.eoff = BLOCK_SIZE; @@ -3321,7 +3324,7 @@ code = ''' assert(mdir.u.m.weight == 1); memset(buffer, alphas[3 % 26], SIZE); lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mdir to compact mdir.u.r.rbyd.eoff = BLOCK_SIZE; @@ -3361,7 +3364,7 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; //// create a situation where we have 3 mdirs in our tree @@ -3369,10 +3372,10 @@ code = ''' uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -3387,7 +3390,7 @@ code = ''' assert(mdir.u.m.weight == 1); memset(buffer, alphas[2 % 26], SIZE); lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mdir to compact mdir.u.r.rbyd.eoff = BLOCK_SIZE; @@ -3417,7 +3420,7 @@ code = ''' lfsr_mtree_lookup(&lfs, LFSR_MID(1, -1), &mdir) => 0; assert(mdir.u.m.weight == 1); lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // we should now have 2 mdirs assert(lfsr_mtree_weight(&lfs) == 2); @@ -3455,11 +3458,11 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // insert a new entry, this should update our neighbors lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, &alphas[0 % 26], 1))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(&alphas[0 % 26], 1)))) => 0; // assert that our entry is still in the mtree assert(lfs.mroot.u.m.weight == 1); @@ -3491,7 +3494,7 @@ code = ''' } if (tag_ == LFSR_TAG_BTREE) { - lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.buf.buffer; + lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.b.buffer; printf("traversal: %d.%d 0x%x btree 0x%x.%x\n", mid_.bid, mid_.rid, @@ -3501,7 +3504,7 @@ code = ''' // keep track of seen blocks seen[branch->block / 8] |= 1 << (branch->block % 8); } else if (tag_ == LFSR_TAG_MDIR) { - lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.buf.buffer; + lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.b.buffer; printf("traversal: %d.%d 0x%x mdir 0x{%x,%x}\n", mid_.bid, mid_.rid, @@ -3558,18 +3561,18 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // prepare mroot with a large attr so the next entry can not fit uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; // create a large entry that needs to be uninlined (but not split!) memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -3616,7 +3619,7 @@ code = ''' } if (tag_ == LFSR_TAG_BTREE) { - lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.buf.buffer; + lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.b.buffer; printf("traversal: %d.%d 0x%x btree 0x%x.%x\n", mid_.bid, mid_.rid, @@ -3626,7 +3629,7 @@ code = ''' // keep track of seen blocks seen[branch->block / 8] |= 1 << (branch->block % 8); } else if (tag_ == LFSR_TAG_MDIR) { - lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.buf.buffer; + lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.b.buffer; printf("traversal: %d.%d 0x%x mdir 0x{%x,%x}\n", mid_.bid, mid_.rid, @@ -3694,17 +3697,17 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create 2 large entries that needs to be uninlined and split uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(0, INLINED, +1, BUF(buffer, SIZE)))) => 0; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0; + LFSR_ATTR(1, INLINED, +1, BUF(buffer, SIZE)))) => 0; // force mroot to compact lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; @@ -3752,7 +3755,7 @@ code = ''' } if (tag_ == LFSR_TAG_BTREE) { - lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.buf.buffer; + lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.b.buffer; printf("traversal: %d.%d 0x%x btree 0x%x.%x\n", mid_.bid, mid_.rid, @@ -3762,7 +3765,7 @@ code = ''' // keep track of seen blocks seen[branch->block / 8] |= 1 << (branch->block % 8); } else if (tag_ == LFSR_TAG_MDIR) { - lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.buf.buffer; + lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.b.buffer; printf("traversal: %d.%d 0x%x mdir 0x{%x,%x}\n", mid_.bid, mid_.rid, @@ -3832,13 +3835,13 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // prepare mroot with an attr uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; // force mroot to compact twice, this should extend the mroot lfsr_mdir_t old_mroot = lfs.mroot; @@ -3848,7 +3851,7 @@ code = ''' lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; // assert we relocated assert(lfsr_mdir_cmp(old_mroot.u.m.blocks, lfs.mroot.u.m.blocks) != 0); @@ -3880,7 +3883,7 @@ code = ''' } if (tag_ == LFSR_TAG_BTREE) { - lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.buf.buffer; + lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.b.buffer; printf("traversal: %d.%d 0x%x btree 0x%x.%x\n", mid_.bid, mid_.rid, @@ -3890,7 +3893,7 @@ code = ''' // keep track of seen blocks seen[branch->block / 8] |= 1 << (branch->block % 8); } else if (tag_ == LFSR_TAG_MDIR) { - lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.buf.buffer; + lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.b.buffer; printf("traversal: %d.%d 0x%x mdir 0x{%x,%x}\n", mid_.bid, mid_.rid, @@ -3949,7 +3952,7 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // create entries lfsr_mdir_t mdir; @@ -3965,7 +3968,8 @@ code = ''' } lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(mdir.mid.rid, INLINED, +1, &alphas[i % 26], 1))) => 0; + LFSR_ATTR(mdir.mid.rid, INLINED, +1, + BUF(&alphas[i % 26], 1)))) => 0; uint8_t buffer[4]; lfsr_mdir_get(&lfs, &mdir, mdir.mid.rid, LFSR_TAG_INLINED, @@ -4016,7 +4020,7 @@ code = ''' } if (tag_ == LFSR_TAG_BTREE) { - lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.buf.buffer; + lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.b.buffer; printf("traversal: %d.%d 0x%x btree 0x%x.%x\n", mid_.bid, mid_.rid, @@ -4026,7 +4030,7 @@ code = ''' // keep track of seen blocks seen[branch->block / 8] |= 1 << (branch->block % 8); } else if (tag_ == LFSR_TAG_MDIR) { - lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.buf.buffer; + lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.b.buffer; printf("traversal: %d.%d 0x%x mdir 0x{%x,%x}\n", mid_.bid, mid_.rid, @@ -4097,7 +4101,7 @@ code = ''' lfs_alloc_ack(&lfs); // remove root dstart for now lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; // at least keep track of the number of entries we expect lfs_size_t count = 0; @@ -4122,7 +4126,8 @@ code = ''' // add to rbyd, potentially splitting the mdir lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS( - LFSR_ATTR(mdir.mid.rid, INLINED, +1, &alphas[i % 26], 1))) => 0; + LFSR_ATTR(mdir.mid.rid, INLINED, +1, + BUF(&alphas[i % 26], 1)))) => 0; // make sure we can look up the new entry uint8_t buffer[4]; @@ -4179,7 +4184,7 @@ code = ''' } if (tag_ == LFSR_TAG_BTREE) { - lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.buf.buffer; + lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.b.buffer; printf("traversal: %d.%d 0x%x btree 0x%x.%x\n", mid_.bid, mid_.rid, @@ -4189,7 +4194,7 @@ code = ''' // keep track of seen blocks seen[branch->block / 8] |= 1 << (branch->block % 8); } else if (tag_ == LFSR_TAG_MDIR) { - lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.buf.buffer; + lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.b.buffer; printf("traversal: %d.%d 0x%x mdir 0x{%x,%x}\n", mid_.bid, mid_.rid, @@ -4265,7 +4270,7 @@ code = ''' lfs_ssize_t d = lfsr_mdir_todisk(&lfs, LFSR_MDIR_MROOTANCHOR, buffer); assert(d >= 0); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, MROOT, 0, buffer, d))) => 0; + LFSR_ATTR(-1, MROOT, 0, BUF(buffer, d)))) => 0; // technically, cycle detection only needs to work when we're validating lfsr_mtree_traversal_t traversal = LFSR_MTREE_TRAVERSAL_INIT( @@ -4286,14 +4291,14 @@ code = ''' } if (tag_ == LFSR_TAG_BTREE) { - lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.buf.buffer; + lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.b.buffer; printf("traversal: %d.%d 0x%x btree 0x%x.%x\n", mid_.bid, mid_.rid, tag_, branch->block, branch->trunk); } else if (tag_ == LFSR_TAG_MDIR) { - lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.buf.buffer; + lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.b.buffer; printf("traversal: %d.%d 0x%x mdir 0x{%x,%x}\n", mid_.bid, mid_.rid, @@ -4353,7 +4358,7 @@ code = ''' uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; // force mroot to compact twice, this should extend the mroot lfsr_mdir_t old_mroot = lfs.mroot; @@ -4363,7 +4368,7 @@ code = ''' lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; // assert we relocated assert(lfsr_mdir_cmp(old_mroot.u.m.blocks, lfs.mroot.u.m.blocks) != 0); @@ -4408,7 +4413,7 @@ code = ''' uint8_t buffer[SIZE]; memset(buffer, alphas[0 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; // force mroot to compact 2x2 times, this should extend the mroot twice lfsr_mdir_t old_mroot = lfs.mroot; @@ -4420,7 +4425,7 @@ code = ''' lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE; memset(buffer, alphas[1 % 26], SIZE); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0; // assert we relocated assert(lfsr_mdir_cmp(old_mroot.u.m.blocks, lfs.mroot.u.m.blocks) != 0); diff --git a/tests/test_rbyd.toml b/tests/test_rbyd.toml index 5f2181ad..7690fe4e 100644 --- a/tests/test_rbyd.toml +++ b/tests/test_rbyd.toml @@ -32,15 +32,15 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; // commit with two attributes rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; ''' @@ -63,16 +63,16 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; // commit with two attributes rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; ''' @@ -95,12 +95,12 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; // commit with the second attribute lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; ''' @@ -131,7 +131,7 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => 0; @@ -154,8 +154,8 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => 0; @@ -188,8 +188,8 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => 0; @@ -241,7 +241,7 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => 0; @@ -264,9 +264,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => 0; @@ -299,9 +299,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => 0; @@ -351,7 +351,7 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_get(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), buffer, 4) => 4; @@ -370,8 +370,8 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_get(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), buffer, 4) => 4; @@ -392,8 +392,8 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_get(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), buffer, 4) => 4; lfsr_rbyd_get(&lfs, &rbyd, -1, LFSR_TAG_UATTR(2), buffer, 4) @@ -430,7 +430,7 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_get(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), buffer, 4) => 4; @@ -449,9 +449,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_get(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), buffer, 4) => 4; @@ -472,9 +472,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_get(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), buffer, 4) => 4; lfsr_rbyd_get(&lfs, &rbyd, -1, LFSR_TAG_UATTR(2), buffer, 4) @@ -516,8 +516,8 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -538,8 +538,8 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -579,9 +579,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -602,9 +602,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -646,9 +646,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -676,9 +676,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -725,10 +725,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -756,10 +756,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -787,10 +787,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -818,10 +818,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -870,10 +870,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -908,10 +908,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -946,10 +946,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -984,10 +984,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -1041,10 +1041,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -1079,10 +1079,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -1117,10 +1117,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -1155,10 +1155,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -1214,11 +1214,11 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -1255,11 +1255,11 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -1294,11 +1294,11 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -1333,11 +1333,11 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -1395,11 +1395,11 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(5), 0, "\xee\xee\xee\xee", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(5), 0, BUF("\xee\xee\xee\xee", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -1443,11 +1443,11 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(5), 0, "\xee\xee\xee\xee", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(5), 0, BUF("\xee\xee\xee\xee", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -1489,11 +1489,11 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(5), 0, "\xee\xee\xee\xee", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(5), 0, BUF("\xee\xee\xee\xee", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -1535,11 +1535,11 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(5), 0, "\xee\xee\xee\xee", 4), - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(5), 0, BUF("\xee\xee\xee\xee", 4)), + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -1602,12 +1602,12 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(5), 0, "\xee\xee\xee\xee", 4), - LFSR_ATTR(-1, UATTR(5), 0, "\xee\xee\xee\xee", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(5), 0, BUF("\xee\xee\xee\xee", 4)), + LFSR_ATTR(-1, UATTR(5), 0, BUF("\xee\xee\xee\xee", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -1651,12 +1651,12 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(5), 0, "\xee\xee\xee\xee", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(5), 0, BUF("\xee\xee\xee\xee", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -1700,12 +1700,12 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(5), 0, "\xee\xee\xee\xee", 4), - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(5), 0, BUF("\xee\xee\xee\xee", 4)), + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -1770,12 +1770,12 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(5), 0, "\xee\xee\xee\xee", 4), - LFSR_ATTR(-1, UATTR(6), 0, "\xff\xff\xff\xff", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(5), 0, BUF("\xee\xee\xee\xee", 4)), + LFSR_ATTR(-1, UATTR(6), 0, BUF("\xff\xff\xff\xff", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -1824,12 +1824,12 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(5), 0, "\xee\xee\xee\xee", 4), - LFSR_ATTR(-1, UATTR(6), 0, "\xff\xff\xff\xff", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(5), 0, BUF("\xee\xee\xee\xee", 4)), + LFSR_ATTR(-1, UATTR(6), 0, BUF("\xff\xff\xff\xff", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -1878,12 +1878,12 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(5), 0, "\xee\xee\xee\xee", 4), - LFSR_ATTR(-1, UATTR(6), 0, "\xff\xff\xff\xff", 4), - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(5), 0, BUF("\xee\xee\xee\xee", 4)), + LFSR_ATTR(-1, UATTR(6), 0, BUF("\xff\xff\xff\xff", 4)), + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -1966,9 +1966,8 @@ code = ''' // build the attribute list for the current permutation struct lfsr_attr attrs[N]; for (unsigned j = 0; j < N; j++) { - attrs[j] = LFSR_ATTR( - -1, UATTR(perm[j]+1), 0, - "\xaa\xaa\xaa\xaa", 4); + attrs[j] = LFSR_ATTR(-1, UATTR(perm[j]+1), 0, + BUF("\xaa\xaa\xaa\xaa", 4)); } // test the given permutation @@ -2060,7 +2059,7 @@ code = ''' for (unsigned j = 0; j < N; j++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(-1, UATTR(perm[j]+1), 0, - "\xaa\xaa\xaa\xaa", 4))) => 0; + BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; } lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; @@ -2118,8 +2117,8 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, 0, &rid_, &tag_, NULL, &data_) => 0; @@ -2152,8 +2151,8 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, 0, &rid_, &tag_, NULL, &data_) => 0; @@ -2207,9 +2206,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, 0, &rid_, &tag_, NULL, &data_) => 0; @@ -2242,9 +2241,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, 0, &rid_, &tag_, NULL, &data_) => 0; @@ -2318,9 +2317,8 @@ code = ''' // build the attribute list for the current permutation struct lfsr_attr attrs[N]; for (unsigned j = 0; j < N; j++) { - attrs[j] = LFSR_ATTR( - -1, UATTR(perm[j]+1), 0, - "\xaa\xaa\xaa\xaa", 4); + attrs[j] = LFSR_ATTR(-1, UATTR(perm[j]+1), 0, + BUF("\xaa\xaa\xaa\xaa", 4)); } // test the given permutation @@ -2394,7 +2392,7 @@ code = ''' for (unsigned j = 0; j < N; j++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(-1, UATTR(perm[j]+1), 0, - "\xaa\xaa\xaa\xaa", 4))) => 0; + BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; } lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; @@ -2449,7 +2447,7 @@ code = ''' for (unsigned j = 0; j < N; j++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(j+1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(j+1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; } // copy block so we can reset after each remove @@ -2488,7 +2486,7 @@ code = ''' for (unsigned j = 0; j < N; j++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(-1, UATTR(perm[j]+1), 0, - "\xaa\xaa\xaa\xaa\xaa\xaa", 6))) => 0; + BUF("\xaa\xaa\xaa\xaa\xaa\xaa", 6)))) => 0; } // check that all tags have been updated @@ -2565,7 +2563,7 @@ code = ''' : (ORDER == 1) ? (((lfs_size_t)-1) - i) : TEST_PRNG(&prng); int err = lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(x & 0x7f), 0, "\xaa\xaa\xaa\xaa", 4))); + LFSR_ATTR(-1, UATTR(x & 0x7f), 0, BUF("\xaa\xaa\xaa\xaa", 4)))); if (err == LFS_ERR_RANGE) { break; } @@ -2615,9 +2613,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, RMUATTR(1), 0, NULL, 0))) => 0; + LFSR_ATTR(-1, RMUATTR(1), 0, NULL))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => LFS_ERR_NOENT; @@ -2634,10 +2632,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, RMUATTR(1), 0, NULL, 0))) => 0; + LFSR_ATTR(-1, RMUATTR(1), 0, NULL))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => 0; @@ -2670,10 +2668,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, RMUATTR(2), 0, NULL, 0))) => 0; + LFSR_ATTR(-1, RMUATTR(2), 0, NULL))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => 0; @@ -2751,8 +2749,8 @@ code = ''' lfs_bd_erase(&lfs, rbyd.block) => 0; for (unsigned j = 0; j < N; j++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(perm[j]+1), 0, "\xaa\xaa\xaa\xaa", 4))) - => 0; + LFSR_ATTR(-1, UATTR(perm[j]+1), 0, + BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; } // copy block so we can reset after each remove @@ -2773,7 +2771,7 @@ code = ''' lfs_bd_flush(&lfs, &lfs.pcache, &lfs.rcache, false) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, RMUATTR(j+1), 0, NULL, 0))) + LFSR_ATTR(-1, RMUATTR(j+1), 0, NULL))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -2802,8 +2800,7 @@ code = ''' printf("--- append: %d ---\n", j); lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(-1, UATTR(j+1), 0, - "\xaa\xaa\xaa\xaa\xaa\xaa", 6))) - => 0; + BUF("\xaa\xaa\xaa\xaa\xaa\xaa", 6)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; for (unsigned k = 0; k < N; k++) { @@ -2897,8 +2894,8 @@ code = ''' lfs_bd_erase(&lfs, rbyd.block) => 0; for (unsigned j = 0; j < N; j++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(perm[j]+1), 0, "\xaa\xaa\xaa\xaa", 4))) - => 0; + LFSR_ATTR(-1, UATTR(perm[j]+1), 0, + BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; } // copy block so we can reset after each remove @@ -2919,7 +2916,7 @@ code = ''' lfs_bd_flush(&lfs, &lfs.pcache, &lfs.rcache, false) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, RMUATTR(j+1), 0, NULL, 0))) => 0; + LFSR_ATTR(-1, RMUATTR(j+1), 0, NULL))) => 0; // try traversing over the tags lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -2971,8 +2968,8 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4))) => 0; + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => 0; assert(tag_ == LFSR_TAG_UATTR(2)); @@ -2998,7 +2995,7 @@ code = ''' // try to remove tags that aren't there, this should do nothing lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, RMUATTR(1), 0, NULL, 0))) => 0; + LFSR_ATTR(-1, RMUATTR(1), 0, NULL))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => 0; assert(tag_ == LFSR_TAG_UATTR(2)); @@ -3023,7 +3020,7 @@ code = ''' &rid_, &tag_, NULL, &data_) => LFS_ERR_NOENT; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, RMUATTR(3), 0, NULL, 0))) => 0; + LFSR_ATTR(-1, RMUATTR(3), 0, NULL))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => 0; assert(tag_ == LFSR_TAG_UATTR(2)); @@ -3048,7 +3045,7 @@ code = ''' &rid_, &tag_, NULL, &data_) => LFS_ERR_NOENT; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, RMUATTR(5), 0, NULL, 0))) => 0; + LFSR_ATTR(-1, RMUATTR(5), 0, NULL))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => 0; assert(tag_ == LFSR_TAG_UATTR(2)); @@ -3120,16 +3117,16 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(-1, UATTR(3), 0, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(-1, UATTR(4), 0, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(-1, UATTR(5), 0, "\xee\xee\xee\xee", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(-1, UATTR(3), 0, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(-1, UATTR(4), 0, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(-1, UATTR(5), 0, BUF("\xee\xee\xee\xee", 4)))) => 0; // remove several attributes lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, RMUATTR(1), 0, NULL, 0), - LFSR_ATTR(-1, RMUATTR(3), 0, NULL, 0), - LFSR_ATTR(-1, RMUATTR(5), 0, NULL, 0))) => 0; + LFSR_ATTR(-1, RMUATTR(1), 0, NULL), + LFSR_ATTR(-1, RMUATTR(3), 0, NULL), + LFSR_ATTR(-1, RMUATTR(5), 0, NULL))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => 0; @@ -3156,7 +3153,7 @@ code = ''' // try to remove tags that aren't there, this should do nothing lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, RMUATTR(1), 0, NULL, 0))) => 0; + LFSR_ATTR(-1, RMUATTR(1), 0, NULL))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => 0; assert(tag_ == LFSR_TAG_UATTR(2)); @@ -3181,7 +3178,7 @@ code = ''' &rid_, &tag_, NULL, &data_) => LFS_ERR_NOENT; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, RMUATTR(3), 0, NULL, 0))) => 0; + LFSR_ATTR(-1, RMUATTR(3), 0, NULL))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => 0; assert(tag_ == LFSR_TAG_UATTR(2)); @@ -3206,7 +3203,7 @@ code = ''' &rid_, &tag_, NULL, &data_) => LFS_ERR_NOENT; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, RMUATTR(5), 0, NULL, 0))) => 0; + LFSR_ATTR(-1, RMUATTR(5), 0, NULL))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => 0; assert(tag_ == LFSR_TAG_UATTR(2)); @@ -3233,7 +3230,7 @@ code = ''' // try to remove the tags again, just to make sure (keep in mind // these removes still commit to the rbyd) lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, RMUATTR(1), 0, NULL, 0))) => 0; + LFSR_ATTR(-1, RMUATTR(1), 0, NULL))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => 0; assert(tag_ == LFSR_TAG_UATTR(2)); @@ -3258,7 +3255,7 @@ code = ''' &rid_, &tag_, NULL, &data_) => LFS_ERR_NOENT; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, RMUATTR(3), 0, NULL, 0))) => 0; + LFSR_ATTR(-1, RMUATTR(3), 0, NULL))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => 0; assert(tag_ == LFSR_TAG_UATTR(2)); @@ -3283,7 +3280,7 @@ code = ''' &rid_, &tag_, NULL, &data_) => LFS_ERR_NOENT; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, RMUATTR(5), 0, NULL, 0))) => 0; + LFSR_ATTR(-1, RMUATTR(5), 0, NULL))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => 0; assert(tag_ == LFSR_TAG_UATTR(2)); @@ -3355,9 +3352,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, RMUATTR(1), 0, NULL, 0))) => 0; + LFSR_ATTR(-1, RMUATTR(1), 0, NULL))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => LFS_ERR_NOENT; @@ -3374,11 +3371,11 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, RMUATTR(1), 0, NULL, 0), - LFSR_ATTR(-1, RMUATTR(2), 0, NULL, 0))) => 0; + LFSR_ATTR(-1, RMUATTR(1), 0, NULL), + LFSR_ATTR(-1, RMUATTR(2), 0, NULL))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => LFS_ERR_NOENT; @@ -3395,11 +3392,11 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(1), 0, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(-1, UATTR(2), 0, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(-1, UATTR(1), 0, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(-1, UATTR(2), 0, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, RMUATTR(2), 0, NULL, 0), - LFSR_ATTR(-1, RMUATTR(1), 0, NULL, 0))) => 0; + LFSR_ATTR(-1, RMUATTR(2), 0, NULL), + LFSR_ATTR(-1, RMUATTR(1), 0, NULL))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), &rid_, &tag_, NULL, &data_) => LFS_ERR_NOENT; @@ -3449,7 +3446,7 @@ code = ''' for (unsigned j = 0; j < N; j++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(j+1), 0, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(-1, UATTR(j+1), 0, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; } // copy block so we can reset after each remove @@ -3487,7 +3484,7 @@ code = ''' // remove each tag in permutation order for (unsigned j = 0; j < N; j++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, RMUATTR(perm[j]+1), 0, NULL, 0))) => 0; + LFSR_ATTR(-1, RMUATTR(perm[j]+1), 0, NULL))) => 0; } // check that all tags are now removed @@ -3500,7 +3497,7 @@ code = ''' // try resuming from all tags being removed lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(-1, UATTR(1), 0, - "\xaa\xaa\xaa\xaa\xaa\xaa", 6))) => 0; + BUF("\xaa\xaa\xaa\xaa\xaa\xaa", 6)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(1), @@ -3596,13 +3593,14 @@ code = ''' sim[attr] = alpha[i % 26]; // update our rbyd lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(attr), 0, &alpha[i % 26], 1))) => 0; + LFSR_ATTR(-1, UATTR(attr), 0, + BUF(&alpha[i % 26], 1)))) => 0; } else { // update our sim sim[attr] = '\0'; // update our rbyd lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, RMUATTR(attr), 0, NULL, 0))) => 0; + LFSR_ATTR(-1, RMUATTR(attr), 0, NULL))) => 0; } } @@ -3672,7 +3670,7 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; assert(rbyd.weight == 1); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -3687,8 +3685,8 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; assert(rbyd.weight == 2); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -3707,8 +3705,8 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; assert(rbyd.weight == 2); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -3727,9 +3725,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(2, REG, +1, "\xcc\xcc\xcc\xcc", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(2, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)))) => 0; assert(rbyd.weight == 3); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -3752,9 +3750,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(1, REG, +1, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(1, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; assert(rbyd.weight == 3); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -3777,9 +3775,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(1, REG, +1, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(1, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; assert(rbyd.weight == 3); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -3819,7 +3817,7 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; assert(rbyd.weight == 1); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) @@ -3836,9 +3834,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; assert(rbyd.weight == 2); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -3857,9 +3855,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; assert(rbyd.weight == 2); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -3878,11 +3876,11 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(2, REG, +1, "\xcc\xcc\xcc\xcc", 4))) => 0; + LFSR_ATTR(2, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)))) => 0; assert(rbyd.weight == 3); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -3905,11 +3903,11 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, REG, +1, "\xcc\xcc\xcc\xcc", 4))) => 0; + LFSR_ATTR(1, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; assert(rbyd.weight == 3); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -3932,11 +3930,11 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, REG, +1, "\xcc\xcc\xcc\xcc", 4))) => 0; + LFSR_ATTR(1, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; assert(rbyd.weight == 3); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -4018,8 +4016,7 @@ code = ''' } } - attrs[j] = LFSR_ATTR( - rid, REG, +1, names[perm[j] % 6], 4); + attrs[j] = LFSR_ATTR(rid, REG, +1, BUF(names[perm[j] % 6], 4)); } // test the given permutation @@ -4122,7 +4119,7 @@ code = ''' } lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, REG, +1, names[perm[j] % 6], 4))) => 0; + LFSR_ATTR(rid, REG, +1, BUF(names[perm[j] % 6], 4)))) => 0; } lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; @@ -4180,8 +4177,8 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, 0, &rid_, &tag_, NULL, &data_) => 0; @@ -4222,8 +4219,8 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, 0, &rid_, &tag_, NULL, &data_) => 0; @@ -4286,9 +4283,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, 0, &rid_, &tag_, NULL, &data_) => 0; @@ -4329,9 +4326,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, 0, &rid_, &tag_, NULL, &data_) => 0; @@ -4430,8 +4427,7 @@ code = ''' } } - attrs[j] = LFSR_ATTR( - rid, REG, +1, names[perm[j] % 6], 4); + attrs[j] = LFSR_ATTR(rid, REG, +1, BUF(names[perm[j] % 6], 4)); } // test the given permutation @@ -4524,7 +4520,7 @@ code = ''' } lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, REG, +1, names[perm[j] % 6], 4))) => 0; + LFSR_ATTR(rid, REG, +1, BUF(names[perm[j] % 6], 4)))) => 0; } lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; @@ -4594,7 +4590,7 @@ code = ''' x = x % (rbyd.weight+1); int err = lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(x, REG, +1, names[x % 6], 4))); + LFSR_ATTR(x, REG, +1, BUF(names[x % 6], 4)))); if (err == LFS_ERR_RANGE) { break; } @@ -4640,8 +4636,8 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)))) => 0; assert(rbyd.weight == 1); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -4660,10 +4656,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(1, UATTR(1), 0, "\xbb\xbb", 2))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xbb\xbb", 2)))) => 0; assert(rbyd.weight == 2); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -4690,10 +4686,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xbb\xbb", 2), - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xbb\xbb", 2)), + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)))) => 0; assert(rbyd.weight == 2); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -4720,12 +4716,12 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(1, UATTR(1), 0, "\xbb\xbb", 2), - LFSR_ATTR(2, REG, +1, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(2, UATTR(1), 0, "\xcc\xcc", 2))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xbb\xbb", 2)), + LFSR_ATTR(2, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(2, UATTR(1), 0, BUF( "\xcc\xcc", 2)))) => 0; assert(rbyd.weight == 3); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -4777,12 +4773,12 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xbb\xbb", 2), - LFSR_ATTR(1, REG, +1, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(1, UATTR(1), 0, "\xcc\xcc", 2), - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xbb\xbb", 2)), + LFSR_ATTR(1, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xcc\xcc", 2)), + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)))) => 0; assert(rbyd.weight == 3); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -4817,12 +4813,12 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2), - LFSR_ATTR(1, REG, +1, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(1, UATTR(1), 0, "\xcc\xcc", 2), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(1, UATTR(1), 0, "\xbb\xbb", 2))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)), + LFSR_ATTR(1, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xcc\xcc", 2)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xbb\xbb", 2)))) => 0; assert(rbyd.weight == 3); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -4874,9 +4870,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2))) => 0; + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)))) => 0; assert(rbyd.weight == 1); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -4895,13 +4891,13 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2))) => 0; + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, UATTR(1), 0, "\xbb\xbb", 2))) => 0; + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xbb\xbb", 2)))) => 0; assert(rbyd.weight == 2); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -4928,13 +4924,13 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UATTR(1), 0, "\xbb\xbb", 2))) => 0; + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xbb\xbb", 2)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2))) => 0; + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)))) => 0; assert(rbyd.weight == 2); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -4961,17 +4957,17 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2))) => 0; + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, UATTR(1), 0, "\xbb\xbb", 2))) => 0; + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xbb\xbb", 2)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(2, REG, +1, "\xcc\xcc\xcc\xcc", 4))) => 0; + LFSR_ATTR(2, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(2, UATTR(1), 0, "\xcc\xcc", 2))) => 0; + LFSR_ATTR(2, UATTR(1), 0, BUF( "\xcc\xcc", 2)))) => 0; assert(rbyd.weight == 3); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -5023,17 +5019,17 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UATTR(1), 0, "\xbb\xbb", 2))) => 0; + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xbb\xbb", 2)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, REG, +1, "\xcc\xcc\xcc\xcc", 4))) => 0; + LFSR_ATTR(1, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, UATTR(1), 0, "\xcc\xcc", 2))) => 0; + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xcc\xcc", 2)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2))) => 0; + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)))) => 0; assert(rbyd.weight == 3); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -5068,17 +5064,17 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2))) => 0; + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, REG, +1, "\xcc\xcc\xcc\xcc", 4))) => 0; + LFSR_ATTR(1, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, UATTR(1), 0, "\xcc\xcc", 2))) => 0; + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xcc\xcc", 2)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, UATTR(1), 0, "\xbb\xbb", 2))) => 0; + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xbb\xbb", 2)))) => 0; assert(rbyd.weight == 3); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -5173,12 +5169,12 @@ code = ''' } } - attrs[(1+M)*j] = LFSR_ATTR( - rid, REG, +1, names[perm[j] % 6], 4); + attrs[(1+M)*j] = LFSR_ATTR(rid, REG, +1, + BUF(names[perm[j] % 6], 4)); // note uattrs have a smaller size to help debugging for (unsigned u = 0; u < M; u++) { - attrs[(1+M)*j+1+u] = LFSR_ATTR( - rid, UATTR(u+1), 0, names[perm[j] % 6], 2); + attrs[(1+M)*j+1+u] = LFSR_ATTR(rid, UATTR(u+1), 0, + BUF(names[perm[j] % 6], 2)); } } @@ -5289,12 +5285,12 @@ code = ''' } lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, REG, +1, names[perm[j] % 6], 4))) => 0; + LFSR_ATTR(rid, REG, +1, BUF(names[perm[j] % 6], 4)))) => 0; // note uattrs have a smaller size to help debugging for (unsigned u = 0; u < M; u++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(rid, UATTR(u+1), 0, - names[perm[j] % 6], 2))) => 0; + BUF(names[perm[j] % 6], 2)))) => 0; } } @@ -5358,10 +5354,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(1, UATTR(1), 0, "\xbb\xbb", 2))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xbb\xbb", 2)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, 0, &rid_, &tag_, NULL, &data_) => 0; @@ -5430,10 +5426,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xbb\xbb", 2), - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xbb\xbb", 2)), + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, 0, &rid_, &tag_, NULL, &data_) => 0; @@ -5524,13 +5520,13 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2))) => 0; + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, UATTR(1), 0, "\xbb\xbb", 2))) => 0; + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xbb\xbb", 2)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, 0, &rid_, &tag_, NULL, &data_) => 0; @@ -5599,13 +5595,13 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UATTR(1), 0, "\xbb\xbb", 2))) => 0; + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xbb\xbb", 2)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2))) => 0; + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, 0, &rid_, &tag_, NULL, &data_) => 0; @@ -5733,12 +5729,12 @@ code = ''' } } - attrs[(1+M)*j] = LFSR_ATTR( - rid, REG, +1, names[perm[j] % 6], 4); + attrs[(1+M)*j] = LFSR_ATTR(rid, REG, +1, + BUF(names[perm[j] % 6], 4)); // note uattrs have a smaller size to help debugging for (unsigned u = 0; u < M; u++) { - attrs[(1+M)*j+1+u] = LFSR_ATTR( - rid, UATTR(u+1), 0, names[perm[j] % 6], 2); + attrs[(1+M)*j+1+u] = LFSR_ATTR(rid, UATTR(u+1), 0, + BUF(names[perm[j] % 6], 2)); } } @@ -5845,12 +5841,12 @@ code = ''' } lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, REG, +1, names[perm[j] % 6], 4))) => 0; + LFSR_ATTR(rid, REG, +1, BUF(names[perm[j] % 6], 4)))) => 0; // note uattrs have a smaller size to help debugging for (unsigned u = 0; u < M; u++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(rid, UATTR(u+1), 0, - names[perm[j] % 6], 2))) => 0; + BUF(names[perm[j] % 6], 2)))) => 0; } } @@ -5929,11 +5925,11 @@ code = ''' for (unsigned j = 0; j < N; j++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j, REG, +1, names[j % 6], 4))) => 0; + LFSR_ATTR(j, REG, +1, BUF(names[j % 6], 4)))) => 0; // note uattrs have a smaller size to help debugging for (unsigned u = 0; u < M; u++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j, UATTR(u+1), 0, names[j % 6], 2))) => 0; + LFSR_ATTR(j, UATTR(u+1), 0, BUF(names[j % 6], 2)))) => 0; } } @@ -5973,7 +5969,7 @@ code = ''' for (unsigned j = 0; j < N*M; j++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(perm[j]/M, UATTR(perm[j]%M+1), 0, - names[(perm[j]/M) % 6], 3))) => 0; + BUF(names[(perm[j]/M) % 6], 3)))) => 0; } // check that all tags have been updated @@ -6086,12 +6082,12 @@ code = ''' } lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, REG, +1, names[perm[j] % 6], 4))) => 0; + LFSR_ATTR(rid, REG, +1, BUF(names[perm[j] % 6], 4)))) => 0; // note uattrs have a smaller size to help debugging for (unsigned u = 0; u < M; u++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(rid, UATTR(u+1), 0, - names[perm[j] % 6], 2))) => 0; + BUF(names[perm[j] % 6], 2)))) => 0; } } @@ -6113,7 +6109,7 @@ code = ''' lfs_bd_flush(&lfs, &lfs.pcache, &lfs.rcache, false) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j/M, RMUATTR((j%M)+1), 0, NULL, 0))) => 0; + LFSR_ATTR(j/M, RMUATTR((j%M)+1), 0, NULL))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; for (unsigned k = 0; k < N; k++) { @@ -6153,7 +6149,8 @@ code = ''' // try append the tag back to make sure things still work printf("--- append: rid%jd, %jd ---\n", j/M, (j%M)+1); lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j/M, UATTR((j%M)+1), 0, names[(j/M)%6], 3))) => 0; + LFSR_ATTR(j/M, UATTR((j%M)+1), 0, + BUF(names[(j/M)%6], 3)))) => 0; lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; for (unsigned k = 0; k < N; k++) { @@ -6251,11 +6248,11 @@ code = ''' for (unsigned j = 0; j < N; j++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j, REG, +1, names[j % 6], 4))) => 0; + LFSR_ATTR(j, REG, +1, BUF(names[j % 6], 4)))) => 0; // note uattrs have a smaller size to help debugging for (unsigned u = 0; u < M; u++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j, UATTR(u+1), 0, names[j % 6], 2))) => 0; + LFSR_ATTR(j, UATTR(u+1), 0, BUF(names[j % 6], 2)))) => 0; } } @@ -6294,8 +6291,7 @@ code = ''' // remove each tag in permutation order for (unsigned j = 0; j < N*M; j++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(perm[j]/M, RMUATTR(perm[j]%M+1), 0, - NULL, 0))) => 0; + LFSR_ATTR(perm[j]/M, RMUATTR(perm[j]%M+1), 0, NULL))) => 0; } // check that all tags have been removed @@ -6385,11 +6381,9 @@ code = ''' // build a single attribute list with all attributes, if this fails // it should fail atomically struct lfsr_attr attrs[1+M]; - attrs[0] = LFSR_ATTR( - x, REG, +1, names[x % 6], 4); + attrs[0] = LFSR_ATTR(x, REG, +1, BUF(names[x % 6], 4)); for (unsigned u = 0; u < M; u++) { - attrs[1+u] = LFSR_ATTR( - x, UATTR(u+1), 0, names[x % 6], 2); + attrs[1+u] = LFSR_ATTR(x, UATTR(u+1), 0, BUF(names[x % 6], 2)); } int err = lfsr_rbyd_commit(&lfs, &rbyd, attrs, 1+M); @@ -6494,11 +6488,11 @@ code = ''' // note the data size differences here lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(-1, UATTR(perm[j]+1), 0, - names[perm[j] % 6], 1))) => 0; + BUF(names[perm[j] % 6], 1)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(rid, REG, +1, - names[perm[j] % 6], 4))) => 0; + BUF(names[perm[j] % 6], 4)))) => 0; } // try looking up each tag @@ -6633,15 +6627,15 @@ code = ''' // note the data size differences here lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(-1, UATTR(perm[j]+1), 0, - names[perm[j] % 6], 1))) => 0; + BUF(names[perm[j] % 6], 1)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(rid, REG, +1, - names[perm[j] % 6], 4))) => 0; + BUF(names[perm[j] % 6], 4)))) => 0; for (unsigned u = 0; u < M; u++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(rid, UATTR(u+1), 0, - names[perm[j] % 6], 2))) => 0; + BUF(names[perm[j] % 6], 2)))) => 0; } } @@ -6747,10 +6741,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(1, UNR, -1, NULL))) => 0; assert(rbyd.weight == 1); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -6767,10 +6761,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; assert(rbyd.weight == 1); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -6787,11 +6781,11 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(2, REG, +1, "\xcc\xcc\xcc\xcc", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(2, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(2, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(2, UNR, -1, NULL))) => 0; assert(rbyd.weight == 2); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -6810,11 +6804,11 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(2, REG, +1, "\xcc\xcc\xcc\xcc", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(2, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; assert(rbyd.weight == 2); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -6833,11 +6827,11 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(2, REG, +1, "\xcc\xcc\xcc\xcc", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(2, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(1, UNR, -1, NULL))) => 0; assert(rbyd.weight == 2); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -6873,12 +6867,12 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(1, UATTR(1), 0, "\xbb\xbb", 2))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xbb\xbb", 2)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(1, UNR, -1, NULL))) => 0; assert(rbyd.weight == 1); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) @@ -6909,12 +6903,12 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(1, UATTR(1), 0, "\xbb\xbb", 2))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xbb\xbb", 2)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; assert(rbyd.weight == 1); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) @@ -6945,14 +6939,14 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(1, UATTR(1), 0, "\xbb\xbb", 2), - LFSR_ATTR(2, REG, +1, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(2, UATTR(1), 0, "\xcc\xcc", 2))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xbb\xbb", 2)), + LFSR_ATTR(2, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(2, UATTR(1), 0, BUF( "\xcc\xcc", 2)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(2, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(2, UNR, -1, NULL))) => 0; assert(rbyd.weight == 2); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) => 4; @@ -6994,14 +6988,14 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(1, UATTR(1), 0, "\xbb\xbb", 2), - LFSR_ATTR(2, REG, +1, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(2, UATTR(1), 0, "\xcc\xcc", 2))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xbb\xbb", 2)), + LFSR_ATTR(2, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(2, UATTR(1), 0, BUF( "\xcc\xcc", 2)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; assert(rbyd.weight == 2); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) @@ -7044,14 +7038,14 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(1, UATTR(1), 0, "\xbb\xbb", 2), - LFSR_ATTR(2, REG, +1, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(2, UATTR(1), 0, "\xcc\xcc", 2))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xbb\xbb", 2)), + LFSR_ATTR(2, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(2, UATTR(1), 0, BUF( "\xcc\xcc", 2)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(1, UNR, -1, NULL))) => 0; assert(rbyd.weight == 2); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) @@ -7160,7 +7154,7 @@ code = ''' } lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, REG, +1, names[perm[j] % 6], 4))) => 0; + LFSR_ATTR(rid, REG, +1, BUF(names[perm[j] % 6], 4)))) => 0; } assert(rbyd.weight == N); @@ -7182,7 +7176,7 @@ code = ''' lfs_bd_flush(&lfs, &lfs.pcache, &lfs.rcache, false) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(j, UNR, -1, NULL))) => 0; assert(rbyd.weight == N-1); lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -7201,7 +7195,7 @@ code = ''' // try recreating the rid to make sure things still work printf("--- create: %d ---\n", j); lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j, REG, +1, names[j % 6], 6))) => 0; + LFSR_ATTR(j, REG, +1, BUF(names[j % 6], 6)))) => 0; assert(rbyd.weight == N); lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -7314,12 +7308,12 @@ code = ''' } lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, REG, +1, names[perm[j] % 6], 4))) => 0; + LFSR_ATTR(rid, REG, +1, BUF(names[perm[j] % 6], 4)))) => 0; // note uattrs have a smaller size to help debugging for (unsigned u = 0; u < M; u++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(rid, UATTR(u+1), 0, - names[perm[j] % 6], 2))) => 0; + BUF(names[perm[j] % 6], 2)))) => 0; } } assert(rbyd.weight == N); @@ -7342,7 +7336,7 @@ code = ''' lfs_bd_flush(&lfs, &lfs.pcache, &lfs.rcache, false) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(j, UNR, -1, NULL))) => 0; assert(rbyd.weight == N-1); lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -7373,11 +7367,11 @@ code = ''' // try recreating the rid to make sure things still work printf("--- create: %d ---\n", j); lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j, REG, +1, names[j % 6], 6))) => 0; + LFSR_ATTR(j, REG, +1, BUF(names[j % 6], 6)))) => 0; for (unsigned u = 0; u < M; u++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(j, UATTR(u+1), 0, - names[j % 6], 3))) => 0; + BUF(names[j % 6], 3)))) => 0; } assert(rbyd.weight == N); @@ -7503,7 +7497,7 @@ code = ''' } lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, REG, +1, names[perm[j] % 6], 4))) => 0; + LFSR_ATTR(rid, REG, +1, BUF(names[perm[j] % 6], 4)))) => 0; } assert(rbyd.weight == N); @@ -7525,7 +7519,7 @@ code = ''' lfs_bd_flush(&lfs, &lfs.pcache, &lfs.rcache, false) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(j, UNR, -1, NULL))) => 0; assert(rbyd.weight == N-1); // try traversing over the tags @@ -7627,12 +7621,12 @@ code = ''' } lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, REG, +1, names[perm[j] % 6], 4))) => 0; + LFSR_ATTR(rid, REG, +1, BUF(names[perm[j] % 6], 4)))) => 0; // note uattrs have a smaller size to help debugging for (unsigned u = 0; u < M; u++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(rid, UATTR(u+1), 0, - names[perm[j] % 6], 2))) => 0; + BUF(names[perm[j] % 6], 2)))) => 0; } } assert(rbyd.weight == N); @@ -7655,7 +7649,7 @@ code = ''' lfs_bd_flush(&lfs, &lfs.pcache, &lfs.rcache, false) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(j, UNR, -1, NULL))) => 0; assert(rbyd.weight == N-1); // try traversing over the tags @@ -7725,9 +7719,9 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; assert(rbyd.weight == 0); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) @@ -7742,11 +7736,11 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0), - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL), + LFSR_ATTR(0, UNR, -1, NULL))) => 0; assert(rbyd.weight == 0); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) @@ -7761,11 +7755,11 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, UNR, -1, NULL, 0), - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(1, UNR, -1, NULL), + LFSR_ATTR(0, UNR, -1, NULL))) => 0; assert(rbyd.weight == 0); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) @@ -7780,13 +7774,13 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(2, REG, +1, "\xcc\xcc\xcc\xcc", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(2, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0), - LFSR_ATTR(0, UNR, -1, NULL, 0), - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL), + LFSR_ATTR(0, UNR, -1, NULL), + LFSR_ATTR(0, UNR, -1, NULL))) => 0; assert(rbyd.weight == 0); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) @@ -7801,13 +7795,13 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(2, REG, +1, "\xcc\xcc\xcc\xcc", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(2, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(2, UNR, -1, NULL, 0), - LFSR_ATTR(1, UNR, -1, NULL, 0), - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(2, UNR, -1, NULL), + LFSR_ATTR(1, UNR, -1, NULL), + LFSR_ATTR(0, UNR, -1, NULL))) => 0; assert(rbyd.weight == 0); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) @@ -7839,10 +7833,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL))) => 0; assert(rbyd.weight == 0); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) @@ -7857,13 +7851,13 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(1, UATTR(1), 0, "\xbb\xbb", 2))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xbb\xbb", 2)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0), - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL), + LFSR_ATTR(0, UNR, -1, NULL))) => 0; assert(rbyd.weight == 0); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) @@ -7878,13 +7872,13 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(1, UATTR(1), 0, "\xbb\xbb", 2))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xbb\xbb", 2)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, UNR, -1, NULL, 0), - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(1, UNR, -1, NULL), + LFSR_ATTR(0, UNR, -1, NULL))) => 0; assert(rbyd.weight == 0); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) @@ -7899,16 +7893,16 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(1, UATTR(1), 0, "\xbb\xbb", 2), - LFSR_ATTR(2, REG, +1, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(2, UATTR(1), 0, "\xcc\xcc", 2))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xbb\xbb", 2)), + LFSR_ATTR(2, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(2, UATTR(1), 0, BUF( "\xcc\xcc", 2)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UNR, -1, NULL, 0), - LFSR_ATTR(0, UNR, -1, NULL, 0), - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(0, UNR, -1, NULL), + LFSR_ATTR(0, UNR, -1, NULL), + LFSR_ATTR(0, UNR, -1, NULL))) => 0; assert(rbyd.weight == 0); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) @@ -7923,16 +7917,16 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2), - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(1, UATTR(1), 0, "\xbb\xbb", 2), - LFSR_ATTR(2, REG, +1, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(2, UATTR(1), 0, "\xcc\xcc", 2))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF( "\xaa\xaa", 2)), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(1, UATTR(1), 0, BUF( "\xbb\xbb", 2)), + LFSR_ATTR(2, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(2, UATTR(1), 0, BUF( "\xcc\xcc", 2)))) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(2, UNR, -1, NULL, 0), - LFSR_ATTR(1, UNR, -1, NULL, 0), - LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(2, UNR, -1, NULL), + LFSR_ATTR(1, UNR, -1, NULL), + LFSR_ATTR(0, UNR, -1, NULL))) => 0; assert(rbyd.weight == 0); lfsr_rbyd_get(&lfs, &rbyd, 0, LFSR_TAG_REG, buffer, 4) @@ -7986,7 +7980,7 @@ code = ''' for (unsigned j = 0; j < N; j++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j, REG, +1, names[j % 6], 4))) => 0; + LFSR_ATTR(j, REG, +1, BUF(names[j % 6], 4)))) => 0; } assert(rbyd.weight == N); @@ -8034,7 +8028,7 @@ code = ''' lfs_size_t rbyd_weight_before = rbyd.weight; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(rid, UNR, -1, NULL))) => 0; assert(rbyd.weight == rbyd_weight_before-1); } @@ -8047,7 +8041,8 @@ code = ''' // try resuming from all tags being removed lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa\xaa\xaa", 6))) => 0; + LFSR_ATTR(0, REG, +1, + BUF("\xaa\xaa\xaa\xaa\xaa\xaa", 6)))) => 0; assert(rbyd.weight == 1); lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; @@ -8128,11 +8123,11 @@ code = ''' for (unsigned j = 0; j < N; j++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j, REG, +1, names[j % 6], 4))) => 0; + LFSR_ATTR(j, REG, +1, BUF(names[j % 6], 4)))) => 0; // note uattrs have a smaller size to help debugging for (unsigned u = 0; u < M; u++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j, UATTR(u+1), 0, names[j % 6], 2))) => 0; + LFSR_ATTR(j, UATTR(u+1), 0, BUF(names[j % 6], 2)))) => 0; } } assert(rbyd.weight == N); @@ -8181,7 +8176,7 @@ code = ''' lfs_size_t rbyd_weight_before = rbyd.weight; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(rid, UNR, -1, NULL))) => 0; assert(rbyd.weight == rbyd_weight_before-1); } @@ -8194,10 +8189,11 @@ code = ''' // try resuming from all tags being removed lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa\xaa\xaa", 6))) => 0; + LFSR_ATTR(0, REG, +1, + BUF("\xaa\xaa\xaa\xaa\xaa\xaa", 6)))) => 0; for (unsigned u = 0; u < M; u++) { lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, UATTR(u+1), 0, "\xaa\xaa\xaa", 3))) => 0; + LFSR_ATTR(0, UATTR(u+1), 0, BUF("\xaa\xaa\xaa", 3)))) => 0; } assert(rbyd.weight == 1); @@ -8310,14 +8306,14 @@ code = ''' count += 1; // update our rbyd lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, REG, +1, &alpha[i % 26], 1))) => 0; + LFSR_ATTR(rid, REG, +1, BUF(&alpha[i % 26], 1)))) => 0; } else { // update our sim memmove(sim+rid, sim+rid+1, count-rid-1); count -= 1; // update our rbyd lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(rid, UNR, -1, NULL))) => 0; } } @@ -8380,7 +8376,7 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4))) => 0; + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, 0, LFSR_TAG_REG, &rid_, &tag_, &weight_, &data_) => 0; @@ -8399,7 +8395,7 @@ code = ''' // make id2 with weight w2 lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, REG, +2, "\xbb\xbb\xbb\xbb", 4))) => 0; + LFSR_ATTR(1, REG, +2, BUF("\xbb\xbb\xbb\xbb", 4)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, 0, LFSR_TAG_REG, &rid_, &tag_, &weight_, &data_) => 0; @@ -8430,7 +8426,7 @@ code = ''' // make id5 with weight w3 lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(3, REG, +3, "\xcc\xcc\xcc\xcc", 4))) => 0; + LFSR_ATTR(3, REG, +3, BUF("\xcc\xcc\xcc\xcc", 4)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, 0, LFSR_TAG_REG, &rid_, &tag_, &weight_, &data_) => 0; @@ -8473,7 +8469,7 @@ code = ''' // make id9 with weight w4 lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(6, REG, +4, "\xdd\xdd\xdd\xdd", 4))) => 0; + LFSR_ATTR(6, REG, +4, BUF("\xdd\xdd\xdd\xdd", 4)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, 0, LFSR_TAG_REG, &rid_, &tag_, &weight_, &data_) => 0; @@ -8528,7 +8524,7 @@ code = ''' // make id14 with weight w5 lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(10, REG, +5, "\xee\xee\xee\xee", 4))) => 0; + LFSR_ATTR(10, REG, +5, BUF("\xee\xee\xee\xee", 4)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, 0, LFSR_TAG_REG, &rid_, &tag_, &weight_, &data_) => 0; @@ -8617,15 +8613,15 @@ code = ''' lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( // make id0 with weight w1 - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), // make id2 with weight w2 - LFSR_ATTR(1, REG, +2, "\xbb\xbb\xbb\xbb", 4), + LFSR_ATTR(1, REG, +2, BUF("\xbb\xbb\xbb\xbb", 4)), // make id5 with weight w3 - LFSR_ATTR(3, REG, +3, "\xcc\xcc\xcc\xcc", 4), + LFSR_ATTR(3, REG, +3, BUF("\xcc\xcc\xcc\xcc", 4)), // make id9 with weight w4 - LFSR_ATTR(6, REG, +4, "\xdd\xdd\xdd\xdd", 4), + LFSR_ATTR(6, REG, +4, BUF("\xdd\xdd\xdd\xdd", 4)), // make id14 with weight w5 - LFSR_ATTR(10, REG, +5, "\xee\xee\xee\xee", 4))) => 0; + LFSR_ATTR(10, REG, +5, BUF("\xee\xee\xee\xee", 4)))) => 0; // traverse, finding tags and weights lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, 0, @@ -8763,7 +8759,8 @@ code = ''' } lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid*W, REG, +W, names[perm[j] % 6], 4))) => 0; + LFSR_ATTR(rid*W, REG, +W, + BUF(names[perm[j] % 6], 4)))) => 0; } lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; @@ -8849,7 +8846,8 @@ code = ''' } lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid*W, REG, +W, names[perm[j] % 6], 4))) => 0; + LFSR_ATTR(rid*W, REG, +W, + BUF(names[perm[j] % 6], 4)))) => 0; } lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; @@ -8897,10 +8895,10 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(3), 0, "unrelated", 9), - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2), - LFSR_ATTR(0, UATTR(2), 0, "\xaa\xaa", 2))) => 0; + LFSR_ATTR(-1, UATTR(3), 0, BUF("unrelated", 9)), + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF("\xaa\xaa", 2)), + LFSR_ATTR(0, UATTR(2), 0, BUF("\xaa\xaa", 2)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(3), &rid_, &tag_, &weight_, &data_) => 0; @@ -8955,10 +8953,10 @@ code = ''' // make id2 with weight w2 lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(1, UATTR(1), 0, "\xbb\xbb", 2), - LFSR_ATTR(1, UNR, +1, NULL, 0), - LFSR_ATTR(2, UATTR(2), 0, "\xbb\xbb", 2))) => 0; + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(1, UATTR(1), 0, BUF("\xbb\xbb", 2)), + LFSR_ATTR(1, UNR, +1, NULL), + LFSR_ATTR(2, UATTR(2), 0, BUF("\xbb\xbb", 2)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(3), &rid_, &tag_, &weight_, &data_) => 0; @@ -9049,10 +9047,10 @@ code = ''' // make id5 with weight w3 lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(3, REG, +1, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(3, UATTR(1), 0, "\xcc\xcc", 2), - LFSR_ATTR(3, UNR, +2, NULL, 0), - LFSR_ATTR(5, UATTR(2), 0, "\xcc\xcc", 2))) => 0; + LFSR_ATTR(3, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(3, UATTR(1), 0, BUF("\xcc\xcc", 2)), + LFSR_ATTR(3, UNR, +2, NULL), + LFSR_ATTR(5, UATTR(2), 0, BUF("\xcc\xcc", 2)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(3), &rid_, &tag_, &weight_, &data_) => 0; @@ -9179,10 +9177,10 @@ code = ''' // make id9 with weight w4 lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(6, REG, +1, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(6, UATTR(1), 0, "\xdd\xdd", 2), - LFSR_ATTR(6, UNR, +3, NULL, 0), - LFSR_ATTR(9, UATTR(2), 0, "\xdd\xdd", 2))) => 0; + LFSR_ATTR(6, REG, +1, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(6, UATTR(1), 0, BUF("\xdd\xdd", 2)), + LFSR_ATTR(6, UNR, +3, NULL), + LFSR_ATTR(9, UATTR(2), 0, BUF("\xdd\xdd", 2)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(3), &rid_, &tag_, &weight_, &data_) => 0; @@ -9345,10 +9343,10 @@ code = ''' // make id14 with weight w5 lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(10, REG, +1, "\xee\xee\xee\xee", 4), - LFSR_ATTR(10, UATTR(1), 0, "\xee\xee", 2), - LFSR_ATTR(10, UNR, +4, NULL, 0), - LFSR_ATTR(14, UATTR(2), 0, "\xee\xee", 2))) => 0; + LFSR_ATTR(10, REG, +1, BUF("\xee\xee\xee\xee", 4)), + LFSR_ATTR(10, UATTR(1), 0, BUF("\xee\xee", 2)), + LFSR_ATTR(10, UNR, +4, NULL), + LFSR_ATTR(14, UATTR(2), 0, BUF("\xee\xee", 2)))) => 0; lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, LFSR_TAG_UATTR(3), &rid_, &tag_, &weight_, &data_) => 0; @@ -9568,31 +9566,31 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(3), 0, "unrelated", 9), + LFSR_ATTR(-1, UATTR(3), 0, BUF("unrelated", 9)), // make id0 with weight w1 - LFSR_ATTR(0, REG, +1, "\xaa\xaa\xaa\xaa", 4), - LFSR_ATTR(0, UATTR(1), 0, "\xaa\xaa", 2), - LFSR_ATTR(0, UATTR(2), 0, "\xaa\xaa", 2), + LFSR_ATTR(0, REG, +1, BUF("\xaa\xaa\xaa\xaa", 4)), + LFSR_ATTR(0, UATTR(1), 0, BUF("\xaa\xaa", 2)), + LFSR_ATTR(0, UATTR(2), 0, BUF("\xaa\xaa", 2)), // make id2 with weight w2 - LFSR_ATTR(1, REG, +1, "\xbb\xbb\xbb\xbb", 4), - LFSR_ATTR(1, UATTR(1), 0, "\xbb\xbb", 2), - LFSR_ATTR(1, UNR, +1, NULL, 0), - LFSR_ATTR(2, UATTR(2), 0, "\xbb\xbb", 2), + LFSR_ATTR(1, REG, +1, BUF("\xbb\xbb\xbb\xbb", 4)), + LFSR_ATTR(1, UATTR(1), 0, BUF("\xbb\xbb", 2)), + LFSR_ATTR(1, UNR, +1, NULL), + LFSR_ATTR(2, UATTR(2), 0, BUF("\xbb\xbb", 2)), // make id5 with weight w3 - LFSR_ATTR(3, REG, +1, "\xcc\xcc\xcc\xcc", 4), - LFSR_ATTR(3, UATTR(1), 0, "\xcc\xcc", 2), - LFSR_ATTR(3, UNR, +2, NULL, 0), - LFSR_ATTR(5, UATTR(2), 0, "\xcc\xcc", 2), + LFSR_ATTR(3, REG, +1, BUF("\xcc\xcc\xcc\xcc", 4)), + LFSR_ATTR(3, UATTR(1), 0, BUF("\xcc\xcc", 2)), + LFSR_ATTR(3, UNR, +2, NULL), + LFSR_ATTR(5, UATTR(2), 0, BUF("\xcc\xcc", 2)), // make id9 with weight w4 - LFSR_ATTR(6, REG, +1, "\xdd\xdd\xdd\xdd", 4), - LFSR_ATTR(6, UATTR(1), 0, "\xdd\xdd", 2), - LFSR_ATTR(6, UNR, +3, NULL, 0), - LFSR_ATTR(9, UATTR(2), 0, "\xdd\xdd", 2), + LFSR_ATTR(6, REG, +1, BUF("\xdd\xdd\xdd\xdd", 4)), + LFSR_ATTR(6, UATTR(1), 0, BUF("\xdd\xdd", 2)), + LFSR_ATTR(6, UNR, +3, NULL), + LFSR_ATTR(9, UATTR(2), 0, BUF("\xdd\xdd", 2)), // make id14 with weight w5 - LFSR_ATTR(10, REG, +1, "\xee\xee\xee\xee", 4), - LFSR_ATTR(10, UATTR(1), 0, "\xee\xee", 2), - LFSR_ATTR(10, UNR, +4, NULL, 0), - LFSR_ATTR(14, UATTR(2), 0, "\xee\xee", 2))) => 0; + LFSR_ATTR(10, REG, +1, BUF("\xee\xee\xee\xee", 4)), + LFSR_ATTR(10, UATTR(1), 0, BUF("\xee\xee", 2)), + LFSR_ATTR(10, UNR, +4, NULL), + LFSR_ATTR(14, UATTR(2), 0, BUF("\xee\xee", 2)))) => 0; // traverse, finding tags and weights lfsr_rbyd_lookupnext(&lfs, &rbyd, -1, 0, @@ -9853,7 +9851,7 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(3), 0, "unrelated", 9))) => 0; + LFSR_ATTR(-1, UATTR(3), 0, BUF("unrelated", 9)))) => 0; for (unsigned j = 0; j < N; j++) { // adjust rid based on future insertions @@ -9865,11 +9863,11 @@ code = ''' } lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid*W, REG, +1, names[perm[j] % 6], 4), - LFSR_ATTR(rid*W, UATTR(1), 0, names[perm[j] % 6], 2), - LFSR_ATTR(rid*W, UNR, +W-1, NULL, 0), + LFSR_ATTR(rid*W, REG, +1, BUF(names[perm[j] % 6], 4)), + LFSR_ATTR(rid*W, UATTR(1), 0, BUF(names[perm[j] % 6], 2)), + LFSR_ATTR(rid*W, UNR, +W-1, NULL), LFSR_ATTR(rid*W+W-1, UATTR(2), 0, - names[perm[j] % 6], 2))) => 0; + BUF(names[perm[j] % 6], 2)))) => 0; } lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; @@ -9964,7 +9962,7 @@ code = ''' rbyd = init_rbyd; lfs_bd_erase(&lfs, rbyd.block) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(-1, UATTR(3), 0, "unrelated", 9))) => 0; + LFSR_ATTR(-1, UATTR(3), 0, BUF("unrelated", 9)))) => 0; for (unsigned j = 0; j < N; j++) { // adjust rid based on future insertions @@ -9976,11 +9974,11 @@ code = ''' } lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid*W, REG, +1, names[perm[j] % 6], 4), - LFSR_ATTR(rid*W, UATTR(1), 0, names[perm[j] % 6], 2), - LFSR_ATTR(rid*W, UNR, +W-1, NULL, 0), + LFSR_ATTR(rid*W, REG, +1, BUF(names[perm[j] % 6], 4)), + LFSR_ATTR(rid*W, UATTR(1), 0, BUF(names[perm[j] % 6], 2)), + LFSR_ATTR(rid*W, UNR, +W-1, NULL), LFSR_ATTR(rid*W+W-1, UATTR(2), 0, - names[perm[j] % 6], 2))) => 0; + BUF(names[perm[j] % 6], 2)))) => 0; } lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, 0) => 0; @@ -10094,7 +10092,8 @@ code = ''' } lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid*W, REG, +W, names[perm[j] % 6], 4))) => 0; + LFSR_ATTR(rid*W, REG, +W, + BUF(names[perm[j] % 6], 4)))) => 0; } assert(rbyd.weight == N*W); @@ -10116,7 +10115,7 @@ code = ''' lfs_bd_flush(&lfs, &lfs.pcache, &lfs.rcache, false) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j*W+W-1, UNR, +D, NULL, 0))) => 0; + LFSR_ATTR(j*W+W-1, UNR, +D, NULL))) => 0; assert(rbyd.weight == N*W+D); lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -10220,7 +10219,8 @@ code = ''' } lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid*W, REG, +W, names[perm[j] % 6], 4))) => 0; + LFSR_ATTR(rid*W, REG, +W, + BUF(names[perm[j] % 6], 4)))) => 0; } assert(rbyd.weight == N*W); @@ -10243,7 +10243,7 @@ code = ''' lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(j*W+W-1, GROWREG, +D, - names[j % 6], 6))) => 0; + BUF(names[j % 6], 6)))) => 0; assert(rbyd.weight == N*W+D); lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -10356,7 +10356,7 @@ code = ''' lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(rid*W, UATTR(2), +W, - names[perm[j] % 6], 4))) => 0; + BUF(names[perm[j] % 6], 4)))) => 0; } assert(rbyd.weight == N*W); @@ -10379,7 +10379,7 @@ code = ''' lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(j*W+W-1, GROWUATTR(1), +D, - names[j % 6], 6))) => 0; + BUF(names[j % 6], 6)))) => 0; assert(rbyd.weight == N*W+D); lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -10503,7 +10503,8 @@ code = ''' } lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid*W, REG, +W, names[perm[j] % 6], 4))) => 0; + LFSR_ATTR(rid*W, REG, +W, + BUF(names[perm[j] % 6], 4)))) => 0; } assert(rbyd.weight == N*W); @@ -10525,7 +10526,7 @@ code = ''' lfs_bd_flush(&lfs, &lfs.pcache, &lfs.rcache, false) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j*W+W-1, GROW, -D, NULL, 0))) => 0; + LFSR_ATTR(j*W+W-1, GROW, -D, NULL))) => 0; assert(rbyd.weight == N*W-D); lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -10629,7 +10630,8 @@ code = ''' } lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid*W, REG, +W, names[perm[j] % 6], 4))) => 0; + LFSR_ATTR(rid*W, REG, +W, + BUF(names[perm[j] % 6], 4)))) => 0; } assert(rbyd.weight == N*W); @@ -10652,7 +10654,7 @@ code = ''' lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(j*W+W-1, GROWREG, -D, - names[j % 6], 6))) => 0; + BUF(names[j % 6], 6)))) => 0; assert(rbyd.weight == N*W-D); lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -10765,7 +10767,7 @@ code = ''' lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(rid*W, UATTR(2), +W, - names[perm[j] % 6], 4))) => 0; + BUF(names[perm[j] % 6], 4)))) => 0; } assert(rbyd.weight == N*W); @@ -10788,7 +10790,7 @@ code = ''' lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(j*W+W-1, GROWUATTR(1), -D, - names[j % 6], 6))) => 0; + BUF(names[j % 6], 6)))) => 0; assert(rbyd.weight == N*W-D); lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -10911,7 +10913,8 @@ code = ''' } lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid*W, REG, +W, names[perm[j] % 6], 4))) => 0; + LFSR_ATTR(rid*W, REG, +W, + BUF(names[perm[j] % 6], 4)))) => 0; } assert(rbyd.weight == N*W); @@ -10933,7 +10936,7 @@ code = ''' lfs_bd_flush(&lfs, &lfs.pcache, &lfs.rcache, false) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j*W+W-1, UNR, -W, NULL, 0))) => 0; + LFSR_ATTR(j*W+W-1, UNR, -W, NULL))) => 0; assert(rbyd.weight == (N-1)*W); lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -10965,7 +10968,7 @@ code = ''' // try recreating the rid to make sure things still work printf("--- create: %d ---\n", j); lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j*W, REG, +W, names[j % 6], 6))) => 0; + LFSR_ATTR(j*W, REG, +W, BUF(names[j % 6], 6)))) => 0; assert(rbyd.weight == N*W); lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -11064,7 +11067,8 @@ code = ''' } lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid*W, REG, +W, names[perm[j] % 6], 4))) => 0; + LFSR_ATTR(rid*W, REG, +W, + BUF(names[perm[j] % 6], 4)))) => 0; } assert(rbyd.weight == N*W); @@ -11087,7 +11091,8 @@ code = ''' lfs_bd_flush(&lfs, &lfs.pcache, &lfs.rcache, false) => 0; lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j*W+W-1, UATTR(1), 0, names[j % 6], 2))) => 0; + LFSR_ATTR(j*W+W-1, UATTR(1), 0, + BUF(names[j % 6], 2)))) => 0; assert(rbyd.weight == N*W); lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -11117,7 +11122,7 @@ code = ''' // now try removing the attr printf("--- removing: %d ---\n", j); lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j*W+W-1, RMUATTR(1), 0, NULL, 0))) => 0; + LFSR_ATTR(j*W+W-1, RMUATTR(1), 0, NULL))) => 0; assert(rbyd.weight == N*W); lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -11142,7 +11147,8 @@ code = ''' // and try putting the attr back just for good measure printf("--- appending: %d ---\n", j); lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j*W+W-1, UATTR(1), 0, names[j % 6], 2))) => 0; + LFSR_ATTR(j*W+W-1, UATTR(1), 0, + BUF(names[j % 6], 2)))) => 0; assert(rbyd.weight == N*W); lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -11252,27 +11258,27 @@ code = ''' count += 1; // update our rbyd lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, REG, +1, &alpha[i % 26], 1))) => 0; + LFSR_ATTR(rid, REG, +1, BUF(&alpha[i % 26], 1)))) => 0; } else if (op == 1) { // update our sim memmove(sim+rid*(M+1), sim+(rid+1)*(M+1), (count-rid-1)*(M+1)); count -= 1; // update our rbyd lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, UNR, -1, NULL, 0))) => 0; + LFSR_ATTR(rid, UNR, -1, NULL))) => 0; } else if (op == 2) { // update our sim sim[rid*(M+1) + u+1] = alpha[i % 26]; // update our rbyd lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, UATTR(u), 0, &alpha[i % 26], 1))) => 0; + LFSR_ATTR(rid, UATTR(u), 0, BUF(&alpha[i % 26], 1)))) => 0; } else if (op == 3) { // update our sim sim[rid*(M+1) + u+1] = '\0'; // update our rbyd lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, RMUATTR(u), 0, NULL, 0))) => 0; + LFSR_ATTR(rid, RMUATTR(u), 0, NULL))) => 0; } } @@ -11417,8 +11423,8 @@ code = ''' count += 1; // update our rbyd lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(weighted_rid, REG, - +weight, &alpha[i % 26], 1))) => 0; + LFSR_ATTR(weighted_rid, REG, +weight, + BUF(&alpha[i % 26], 1)))) => 0; } else if (op == 1) { // get the correct weight from the sim weight_ = sim_weights[rid]; @@ -11429,8 +11435,8 @@ code = ''' count -= 1; // update our rbyd lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(weighted_rid+weight_-1, UNR, - -weight_, NULL, 0))) => 0; + LFSR_ATTR(weighted_rid+weight_-1, UNR, -weight_, + NULL))) => 0; } else if (op == 2) { // get the correct weight from the sim weight_ = sim_weights[rid]; @@ -11438,8 +11444,8 @@ code = ''' sim_weights[rid] += weight; // update our rbyd lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(weighted_rid+weight_-1, GROW, - +weight, NULL, 0))) => 0; + LFSR_ATTR(weighted_rid+weight_-1, GROW, +weight, + NULL))) => 0; } else if (op == 3) { // get the correct weight from the sim weight_ = sim_weights[rid]; @@ -11450,8 +11456,8 @@ code = ''' sim_weights[rid] -= weight; // update our rbyd lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(weighted_rid+weight_-1, GROW, - -weight, NULL, 0))) => 0; + LFSR_ATTR(weighted_rid+weight_-1, GROW, -weight, + NULL))) => 0; } } @@ -11582,9 +11588,9 @@ code = ''' // give each attr a subtype based on its rid + SHIFT lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, REG, +1, names[perm[j] % 6], 4), + LFSR_ATTR(rid, REG, +1, BUF(names[perm[j] % 6], 4)), LFSR_ATTR(rid, UATTR((perm[j] + SHIFT) & 0x7f), 0, - names[perm[j] % 6], 2))) => 0; + BUF(names[perm[j] % 6], 2)))) => 0; } assert(rbyd.weight == N); @@ -11669,9 +11675,9 @@ code = ''' // give each attr a subtype based on its rid + SHIFT lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, REG, +1, names[perm[j] % 6], 4), + LFSR_ATTR(rid, REG, +1, BUF(names[perm[j] % 6], 4)), LFSR_ATTR(rid, UATTR((perm[j] + SHIFT) & 0x7f), 0, - names[perm[j] % 6], 2))) => 0; + BUF(names[perm[j] % 6], 2)))) => 0; } assert(rbyd.weight == N); @@ -11694,7 +11700,7 @@ code = ''' // remove with a wide tag lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j, RMWIDEUATTR, 0, NULL, 0))) => 0; + LFSR_ATTR(j, RMWIDEUATTR, 0, NULL))) => 0; // try traversing over the tags lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -11806,9 +11812,9 @@ code = ''' // give each attr a subtype based on its rid + SHIFT lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, REG, +1, names[perm[j] % 6], 4), + LFSR_ATTR(rid, REG, +1, BUF(names[perm[j] % 6], 4)), LFSR_ATTR(rid, UATTR((perm[j] + SHIFT) & 0x7f), 0, - names[perm[j] % 6], 2))) => 0; + BUF(names[perm[j] % 6], 2)))) => 0; } assert(rbyd.weight == N); @@ -11832,7 +11838,7 @@ code = ''' // replace with bitwise inverse lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(j, WIDEUATTR(~(j + SHIFT) & 0x7f), 0, - names[j % 6], 3))) => 0; + BUF(names[j % 6], 3)))) => 0; // try traversing over the tags lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -11945,10 +11951,11 @@ code = ''' // give each attr a subtype based on its rid + SHIFT lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, REG, +1, names[perm[j] % 6], 4), + LFSR_ATTR(rid, REG, +1, BUF(names[perm[j] % 6], 4)), LFSR_ATTR(rid, UATTR((perm[j] + SHIFT) & 0x7f), 0, - names[perm[j] % 6], 2), - LFSR_ATTR(rid, SATTR(0), 0, names[perm[j] % 6], 1))) => 0; + BUF(names[perm[j] % 6], 2)), + LFSR_ATTR(rid, SATTR(0), 0, + BUF(names[perm[j] % 6], 1)))) => 0; } assert(rbyd.weight == N); @@ -12033,10 +12040,11 @@ code = ''' // give each attr a subtype based on its rid + SHIFT lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, REG, +1, names[perm[j] % 6], 4), + LFSR_ATTR(rid, REG, +1, BUF(names[perm[j] % 6], 4)), LFSR_ATTR(rid, UATTR((perm[j] + SHIFT) & 0x7f), 0, - names[perm[j] % 6], 2), - LFSR_ATTR(rid, SATTR(0), 0, names[perm[j] % 6], 1))) => 0; + BUF(names[perm[j] % 6], 2)), + LFSR_ATTR(rid, SATTR(0), 0, + BUF(names[perm[j] % 6], 1)))) => 0; } assert(rbyd.weight == N); @@ -12059,7 +12067,7 @@ code = ''' // remove with a wide tag lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j, RMWIDEUATTR, 0, NULL, 0))) => 0; + LFSR_ATTR(j, RMWIDEUATTR, 0, NULL))) => 0; // try traversing over the tags lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -12178,10 +12186,11 @@ code = ''' // give each attr a subtype based on its rid + SHIFT lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(rid, REG, +1, names[perm[j] % 6], 4), + LFSR_ATTR(rid, REG, +1, BUF(names[perm[j] % 6], 4)), LFSR_ATTR(rid, UATTR((perm[j] + SHIFT) & 0x7f), 0, - names[perm[j] % 6], 2), - LFSR_ATTR(rid, SATTR(0), 0, names[perm[j] % 6], 1))) => 0; + BUF(names[perm[j] % 6], 2)), + LFSR_ATTR(rid, SATTR(0), 0, + BUF(names[perm[j] % 6], 1)))) => 0; } assert(rbyd.weight == N); @@ -12205,7 +12214,7 @@ code = ''' // replace with bitwise inverse lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(j, WIDEUATTR(~(j + SHIFT) & 0x7f), 0, - names[j % 6], 3))) => 0; + BUF(names[j % 6], 3)))) => 0; // try traversing over the tags lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -12326,7 +12335,7 @@ code = ''' // give each attr a subtype based on its rid + SHIFT lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(rid, UATTR((perm[j] + SHIFT) & 0x7f), +1, - names[perm[j] % 6], 4))) => 0; + BUF(names[perm[j] % 6], 4)))) => 0; } assert(rbyd.weight == N); @@ -12412,7 +12421,7 @@ code = ''' // give each attr a subtype based on its rid + SHIFT lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(rid, UATTR((perm[j] + SHIFT) & 0x7f), +1, - names[perm[j] % 6], 4))) => 0; + BUF(names[perm[j] % 6], 4)))) => 0; } assert(rbyd.weight == N); @@ -12435,7 +12444,7 @@ code = ''' // remove with a wide tag lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( - LFSR_ATTR(j, RMWIDEUATTR, 0, NULL, 0))) => 0; + LFSR_ATTR(j, RMWIDEUATTR, 0, NULL))) => 0; // try traversing over the tags lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0; @@ -12551,7 +12560,7 @@ code = ''' // give each attr a subtype based on its rid + SHIFT lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(rid, UATTR((perm[j] + SHIFT) & 0x7f), +1, - names[perm[j] % 6], 4))) => 0; + BUF(names[perm[j] % 6], 4)))) => 0; } assert(rbyd.weight == N); @@ -12575,7 +12584,7 @@ code = ''' // replace with bitwise inverse lfsr_rbyd_commit(&lfs, &rbyd, LFSR_ATTRS( LFSR_ATTR(j, WIDEUATTR(~(j + SHIFT) & 0x7f), 0, - names[j % 6], 6))) => 0; + BUF(names[j % 6], 6)))) => 0; // try traversing over the tags lfsr_rbyd_fetch(&lfs, &rbyd, rbyd.block, CFG->block_size) => 0;