typedef struct {
uint64_t low;
uint64_t cache_size;
uint32_t range;
uint8_t cache;
/// Number of symbols in the tables
size_t count;
/// rc_encode()'s position in the tables
size_t pos;
/// Symbols to encode
enum {
RC_BIT_0,
RC_BIT_1,
RC_DIRECT_0,
RC_DIRECT_1,
RC_FLUSH,
} symbols[RC_SYMBOLS_MAX];
/// Probabilities associated with RC_BIT_0 or RC_BIT_1
probability *probs[RC_SYMBOLS_MAX];
} lzma_range_encoder;
//上面是结构。
//下面是函数
static inline void
rc_bit(lzma_range_encoder *rc, probability *prob, uint32_t bit)
{
rc->symbols[rc->count] = bit; // problem code line 69
rc->probs[rc->count] = prob;
++rc->count;
}
//Error: error C2440: '=' : cannot convert from 'uint32_t' to 'lzma_range_encoder::' Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
'bit' 是 uint32_t,需要存储(类型转换)在 lzma_range_encoder->symbols 中,但我无法以某种方式做到这一点。尝试了每一个 p&c。此外,搜索了有关此的早期问题(static_cast 和所有但没有运气)
我猜这是一个简单的问题。但我被困住了两天。请帮忙。谢谢