- if (_bt_is_signed_type(typeof(v)) \
- && ((ptr)[this_unit] & ((typeof(*(ptr))) 1 << (ts - (start % ts) - 1)))) \
- v = ~(typeof(v)) 0; \
- else \
- v = 0; \
- if (start_unit == end_unit - 1) { \
- cmask = (ptr)[this_unit]; \
- cmask >>= (ts - (end % ts)) % ts; \
- if ((end - start) % ts) {\
- mask = ~((~(typeof(*(ptr))) 0) << (end - start)); \
- cmask &= mask; \
- } \
- v = _bt_piecewise_lshift(v, end - start); \
- v |= _bt_unsigned_cast(typeof(v), cmask); \
- *(vptr) = v; \
- break; \
- } \
- if (start % ts) { \
- mask = ~((~(typeof(*(ptr))) 0) << (ts - (start % ts))); \
- cmask = (ptr)[this_unit]; \
- cmask &= mask; \
- v = _bt_piecewise_lshift(v, ts - (start % ts)); \
- v |= _bt_unsigned_cast(typeof(v), cmask); \
- start += ts - (start % ts); \
- this_unit++; \
- } \
- for (; this_unit < end_unit - 1; this_unit++) { \
- v = _bt_piecewise_lshift(v, ts); \
- v |= _bt_unsigned_cast(typeof(v), (ptr)[this_unit]); \
- start += ts; \
- } \
- if (end % ts) { \
- mask = ~((~(typeof(*(ptr))) 0) << (end % ts)); \
- cmask = (ptr)[this_unit]; \
- cmask >>= ts - (end % ts); \
- cmask &= mask; \
- v = _bt_piecewise_lshift(v, end % ts); \
- v |= _bt_unsigned_cast(typeof(v), cmask); \
- } else { \
- v = _bt_piecewise_lshift(v, ts); \
- v |= _bt_unsigned_cast(typeof(v), (ptr)[this_unit]); \
- } \
- *(vptr) = v; \
+ if (_bt_is_signed_type(typeof(__v)) \
+ && (__ptr[this_unit] & ((type) 1 << (ts - (__start % ts) - 1)))) \
+ __v = ~(typeof(__v)) 0; \
+ else \
+ __v = 0; \
+ if (start_unit == end_unit - 1) { \
+ cmask = __ptr[this_unit]; \
+ cmask >>= (ts - (end % ts)) % ts; \
+ if ((end - __start) % ts) { \
+ mask = ~((~(type) 0) << (end - __start)); \
+ cmask &= mask; \
+ } \
+ __v = _bt_piecewise_lshift(__v, end - __start); \
+ __v |= _bt_unsigned_cast(typeof(__v), cmask); \
+ *__vptr = __v; \
+ break; \
+ } \
+ if (__start % ts) { \
+ cshift = __start % ts; \
+ mask = ~((~(type) 0) << (ts - cshift)); \
+ cmask = __ptr[this_unit]; \
+ cmask &= mask; \
+ __v = _bt_piecewise_lshift(__v, ts - cshift); \
+ __v |= _bt_unsigned_cast(typeof(__v), cmask); \
+ __start += ts - cshift; \
+ this_unit++; \
+ } \
+ for (; this_unit < end_unit - 1; this_unit++) { \
+ __v = _bt_piecewise_lshift(__v, ts); \
+ __v |= _bt_unsigned_cast(typeof(__v), __ptr[this_unit]);\
+ __start += ts; \
+ } \
+ if (end % ts) { \
+ mask = ~((~(type) 0) << (end % ts)); \
+ cmask = __ptr[this_unit]; \
+ cmask >>= ts - (end % ts); \
+ cmask &= mask; \
+ __v = _bt_piecewise_lshift(__v, end % ts); \
+ __v |= _bt_unsigned_cast(typeof(__v), cmask); \
+ } else { \
+ __v = _bt_piecewise_lshift(__v, ts); \
+ __v |= _bt_unsigned_cast(typeof(__v), __ptr[this_unit]);\
+ } \
+ *__vptr = __v; \