bool negSrc1 = (srcElem1 < 0);
bool negSrc2 = (srcElem2 < 0);
if ((negDest != negSrc1) && (negSrc1 == negSrc2)) {
- destElem = (Element)1 << (sizeof(Element) * 8 - 1);
+ destElem = static_cast<Element>(
+ (Element)1 << (sizeof(Element) * 8 - 1)
+ );
if (negDest)
destElem -= 1;
}
bool negSrc = (srcElem1 < 0);
bool posCount = ((count * imm) >= 0);
if ((negDest != negSrc) && (negSrc == posCount)) {
- destElem = (%(dstType)s)1 << (sizeof(%(dstType)s) * 8 - 1);
+ destElem = static_cast<%(dstType)s>(
+ (%(dstType)s)1 << (sizeof(%(dstType)s) * 8 - 1)
+ );
if (negDest)
destElem -= 1;
}
bool negSrc = (srcElem1 < 0);
bool negCount = ((count * imm) < 0);
if ((negDest != negSrc) && (negSrc == negCount)) {
- destElem = (%(dstType)s)1 << (sizeof(%(dstType)s) * 8 - 1);
+ destElem = static_cast<%(dstType)s>(
+ (%(dstType)s)1 << (sizeof(%(dstType)s) * 8 - 1)
+ );
if (negDest)
destElem -= 1;
}
bool negSrc1 = (srcElem1 < 0);
bool posSrc2 = (srcElem2 >= 0);
if ((negDest != negSrc1) && (negSrc1 == posSrc2)) {
- destElem = (Element)1 << (sizeof(Element) * 8 - 1);
+ destElem = static_cast<Element>(
+ (Element)1 << (sizeof(Element) * 8 - 1)
+ );
if (negDest)
destElem -= 1;
}
assert(size <= sizeof(T));
T output = 0;
- for (auto byte = 0; byte < size; byte++, val >>= 8) {
+ for (auto byte = 0; byte < size; byte++, val = static_cast<T>(val >> 8)) {
output = (output << 8) | reverseLookUpTable[val & 0xFF];
}