Dropped lfsr_data_from* related LFSR_DATA_* macros
With the new internal LFSR_RATTR API, there's really no reason to keep these around. At one point these were useful for both the implicit lvalues and automatic buffer size, but GCC's problems with compound-literals and code size made them almost always backfire. Now, they're mostly obsolete thanks to the new LFSR_RATTR_* macros. We do still have a couple LFSR_DATA_* macros (LFSR_DATA_BUF, LFSR_DATA_SLICE, etc), but these are a bit more fundamental to the lfsr_data_t type.
This commit is contained in:
@@ -1962,9 +1962,6 @@ static int lfsr_bd_progdata(lfs_t *lfs,
|
||||
//
|
||||
#define LFSR_LE32_DSIZE 4
|
||||
|
||||
#define LFSR_DATA_LE32(_word, _buffer) \
|
||||
((struct {lfsr_data_t d;}){lfsr_data_fromle32(_word, _buffer)}.d)
|
||||
|
||||
static inline lfsr_data_t lfsr_data_fromle32(uint32_t word,
|
||||
uint8_t buffer[static LFSR_LE32_DSIZE]) {
|
||||
lfs_tole32_(word, buffer);
|
||||
@@ -1978,9 +1975,6 @@ static inline lfsr_data_t lfsr_data_fromle32(uint32_t word,
|
||||
//
|
||||
#define LFSR_LEB128_DSIZE 5
|
||||
|
||||
#define LFSR_DATA_LEB128(_word, _buffer) \
|
||||
((struct {lfsr_data_t d;}){lfsr_data_fromleb128(_word, _buffer)}.d)
|
||||
|
||||
static inline lfsr_data_t lfsr_data_fromleb128(uint32_t word,
|
||||
uint8_t buffer[static LFSR_LEB128_DSIZE]) {
|
||||
// leb128s should not exceed 31-bits
|
||||
@@ -2001,9 +1995,6 @@ static inline lfsr_data_t lfsr_data_fromleb128(uint32_t word,
|
||||
//
|
||||
#define LFSR_LLEB128_DSIZE 4
|
||||
|
||||
#define LFSR_DATA_LLEB128(_word, _buffer) \
|
||||
((struct {lfsr_data_t d;}){lfsr_data_fromlleb128(_word, _buffer)}.d)
|
||||
|
||||
static inline lfsr_data_t lfsr_data_fromlleb128(uint32_t word,
|
||||
uint8_t buffer[static LFSR_LLEB128_DSIZE]) {
|
||||
// little-leb128s should not exceed 28-bits
|
||||
@@ -2029,9 +2020,6 @@ static inline lfsr_data_t lfsr_data_fromlleb128(uint32_t word,
|
||||
//
|
||||
#define LFSR_ECKSUM_DSIZE (4+4)
|
||||
|
||||
#define LFSR_DATA_ECKSUM(_ecksum, _buffer) \
|
||||
((struct {lfsr_data_t d;}){lfsr_data_fromecksum(_ecksum, _buffer)}.d)
|
||||
|
||||
// branch encoding:
|
||||
// .---+- -+- -+- -+- -. block: 1 leb128 <=5 bytes
|
||||
// | block | trunk: 1 leb128 <=4 bytes
|
||||
@@ -2043,9 +2031,6 @@ static inline lfsr_data_t lfsr_data_fromlleb128(uint32_t word,
|
||||
//
|
||||
#define LFSR_BRANCH_DSIZE (5+4+4)
|
||||
|
||||
#define LFSR_DATA_BRANCH(_branch, _buffer) \
|
||||
((struct {lfsr_data_t d;}){lfsr_data_frombranch(_branch, _buffer)}.d)
|
||||
|
||||
// btree encoding:
|
||||
// .---+- -+- -+- -+- -. weight: 1 leb128 <=5 bytes
|
||||
// | weight | block: 1 leb128 <=5 bytes
|
||||
@@ -2059,9 +2044,6 @@ static inline lfsr_data_t lfsr_data_fromlleb128(uint32_t word,
|
||||
//
|
||||
#define LFSR_BTREE_DSIZE (5+LFSR_BRANCH_DSIZE)
|
||||
|
||||
#define LFSR_DATA_BTREE(_btree, _buffer) \
|
||||
((struct {lfsr_data_t d;}){lfsr_data_frombtree(_btree, _buffer)}.d)
|
||||
|
||||
// bptr encoding:
|
||||
// .---+- -+- -+- -. size: 1 leb128 <=4 bytes
|
||||
// | size | block: 1 leb128 <=5 bytes
|
||||
@@ -2077,9 +2059,6 @@ static inline lfsr_data_t lfsr_data_fromlleb128(uint32_t word,
|
||||
//
|
||||
#define LFSR_BPTR_DSIZE (4+5+4+4+4)
|
||||
|
||||
#define LFSR_DATA_BPTR(_bptr, _buffer) \
|
||||
((struct {lfsr_data_t d;}){lfsr_data_frombptr(_bptr, _buffer)}.d)
|
||||
|
||||
// shrub encoding:
|
||||
// .---+- -+- -+- -+- -. weight: 1 leb128 <=5 bytes
|
||||
// | weight | trunk: 1 leb128 <=4 bytes
|
||||
@@ -2089,9 +2068,6 @@ static inline lfsr_data_t lfsr_data_fromlleb128(uint32_t word,
|
||||
//
|
||||
#define LFSR_SHRUB_DSIZE (5+4)
|
||||
|
||||
#define LFSR_DATA_SHRUB(_rbyd, _buffer) \
|
||||
((struct {lfsr_data_t d;}){lfsr_data_fromshrub(_rbyd, _buffer)}.d)
|
||||
|
||||
// mptr encoding:
|
||||
// .---+- -+- -+- -+- -. blocks: 2 leb128s <=2x5 bytes
|
||||
// | block x 2 | total: <=10 bytes
|
||||
@@ -2101,9 +2077,6 @@ static inline lfsr_data_t lfsr_data_fromlleb128(uint32_t word,
|
||||
//
|
||||
#define LFSR_MPTR_DSIZE (5+5)
|
||||
|
||||
#define LFSR_DATA_MPTR(_mptr, _buffer) \
|
||||
((struct {lfsr_data_t d;}){lfsr_data_frommptr(_mptr, _buffer)}.d)
|
||||
|
||||
// geometry encoding
|
||||
// .---+- -+- -+- -. block_size: 1 leb128 <=4 bytes
|
||||
// | block_size | block_count: 1 leb128 <=5 bytes
|
||||
@@ -2112,9 +2085,6 @@ static inline lfsr_data_t lfsr_data_fromlleb128(uint32_t word,
|
||||
// '---+- -+- -+- -+- -'
|
||||
#define LFSR_GEOMETRY_DSIZE (4+5)
|
||||
|
||||
#define LFSR_DATA_GEOMETRY(_geometry, _buffer) \
|
||||
((struct {lfsr_data_t d;}){lfsr_data_fromgeometry(_geometry, _buffer)}.d)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user