mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Merge pull request #25 from atsampson/doubleassign
Remove redundant assignments when byteswapping
This commit is contained in:
24
byteswap.c
24
byteswap.c
@@ -126,8 +126,8 @@ swap_b8_in_ZVALUE(ZVALUE *dest, ZVALUE *src, BOOL all)
|
|||||||
* swap or copy the rest of the ZVALUE elements
|
* swap or copy the rest of the ZVALUE elements
|
||||||
*/
|
*/
|
||||||
if (all) {
|
if (all) {
|
||||||
dest->len = (LEN)SWAP_B8_IN_LEN(&dest->len, &src->len);
|
SWAP_B8_IN_LEN(&dest->len, &src->len);
|
||||||
dest->sign = (BOOL)SWAP_B8_IN_BOOL(&dest->sign, &src->sign);
|
SWAP_B8_IN_BOOL(&dest->sign, &src->sign);
|
||||||
} else {
|
} else {
|
||||||
dest->len = src->len;
|
dest->len = src->len;
|
||||||
dest->sign = src->sign;
|
dest->sign = src->sign;
|
||||||
@@ -192,7 +192,7 @@ swap_b8_in_NUMBER(NUMBER *dest, NUMBER *src, BOOL all)
|
|||||||
* swap or copy the rest of the NUMBER elements
|
* swap or copy the rest of the NUMBER elements
|
||||||
*/
|
*/
|
||||||
if (all) {
|
if (all) {
|
||||||
dest->links = (long)SWAP_B8_IN_LONG(&dest->links, &src->links);
|
SWAP_B8_IN_LONG(&dest->links, &src->links);
|
||||||
} else {
|
} else {
|
||||||
dest->links = src->links;
|
dest->links = src->links;
|
||||||
}
|
}
|
||||||
@@ -256,7 +256,7 @@ swap_b8_in_COMPLEX(COMPLEX *dest, COMPLEX *src, BOOL all)
|
|||||||
* swap or copy the rest of the NUMBER elements
|
* swap or copy the rest of the NUMBER elements
|
||||||
*/
|
*/
|
||||||
if (all) {
|
if (all) {
|
||||||
dest->links = (long)SWAP_B8_IN_LONG(&dest->links, &src->links);
|
SWAP_B8_IN_LONG(&dest->links, &src->links);
|
||||||
} else {
|
} else {
|
||||||
dest->links = src->links;
|
dest->links = src->links;
|
||||||
}
|
}
|
||||||
@@ -361,8 +361,8 @@ swap_b16_in_ZVALUE(ZVALUE *dest, ZVALUE *src, BOOL all)
|
|||||||
* swap or copy the rest of the ZVALUE elements
|
* swap or copy the rest of the ZVALUE elements
|
||||||
*/
|
*/
|
||||||
if (all) {
|
if (all) {
|
||||||
dest->len = (LEN)SWAP_B16_IN_LEN(&dest->len, &src->len);
|
SWAP_B16_IN_LEN(&dest->len, &src->len);
|
||||||
dest->sign = (BOOL)SWAP_B16_IN_BOOL(&dest->sign, &src->sign);
|
SWAP_B16_IN_BOOL(&dest->sign, &src->sign);
|
||||||
} else {
|
} else {
|
||||||
dest->len = src->len;
|
dest->len = src->len;
|
||||||
dest->sign = src->sign;
|
dest->sign = src->sign;
|
||||||
@@ -427,7 +427,7 @@ swap_b16_in_NUMBER(NUMBER *dest, NUMBER *src, BOOL all)
|
|||||||
* swap or copy the rest of the NUMBER elements
|
* swap or copy the rest of the NUMBER elements
|
||||||
*/
|
*/
|
||||||
if (all) {
|
if (all) {
|
||||||
dest->links = (long)SWAP_B16_IN_LONG(&dest->links, &src->links);
|
SWAP_B16_IN_LONG(&dest->links, &src->links);
|
||||||
} else {
|
} else {
|
||||||
dest->links = src->links;
|
dest->links = src->links;
|
||||||
}
|
}
|
||||||
@@ -491,7 +491,7 @@ swap_b16_in_COMPLEX(COMPLEX *dest, COMPLEX *src, BOOL all)
|
|||||||
* swap or copy the rest of the NUMBER elements
|
* swap or copy the rest of the NUMBER elements
|
||||||
*/
|
*/
|
||||||
if (all) {
|
if (all) {
|
||||||
dest->links = (long)SWAP_B16_IN_LONG(&dest->links, &src->links);
|
SWAP_B16_IN_LONG(&dest->links, &src->links);
|
||||||
} else {
|
} else {
|
||||||
dest->links = src->links;
|
dest->links = src->links;
|
||||||
}
|
}
|
||||||
@@ -557,8 +557,8 @@ swap_HALF_in_ZVALUE(ZVALUE *dest, ZVALUE *src, BOOL all)
|
|||||||
* swap or copy the rest of the ZVALUE elements
|
* swap or copy the rest of the ZVALUE elements
|
||||||
*/
|
*/
|
||||||
if (all) {
|
if (all) {
|
||||||
dest->len = (LEN)SWAP_HALF_IN_LEN(&dest->len, &src->len);
|
SWAP_HALF_IN_LEN(&dest->len, &src->len);
|
||||||
dest->sign = (BOOL)SWAP_HALF_IN_BOOL(&dest->sign, &src->sign);
|
SWAP_HALF_IN_BOOL(&dest->sign, &src->sign);
|
||||||
} else {
|
} else {
|
||||||
dest->len = src->len;
|
dest->len = src->len;
|
||||||
dest->sign = src->sign;
|
dest->sign = src->sign;
|
||||||
@@ -623,7 +623,7 @@ swap_HALF_in_NUMBER(NUMBER *dest, NUMBER *src, BOOL all)
|
|||||||
* swap or copy the rest of the NUMBER elements
|
* swap or copy the rest of the NUMBER elements
|
||||||
*/
|
*/
|
||||||
if (all) {
|
if (all) {
|
||||||
dest->links = (long)SWAP_HALF_IN_LONG(&dest->links,&src->links);
|
SWAP_HALF_IN_LONG(&dest->links, &src->links);
|
||||||
} else {
|
} else {
|
||||||
dest->links = src->links;
|
dest->links = src->links;
|
||||||
}
|
}
|
||||||
@@ -687,7 +687,7 @@ swap_HALF_in_COMPLEX(COMPLEX *dest, COMPLEX *src, BOOL all)
|
|||||||
* swap or copy the rest of the NUMBER elements
|
* swap or copy the rest of the NUMBER elements
|
||||||
*/
|
*/
|
||||||
if (all) {
|
if (all) {
|
||||||
dest->links = (long)SWAP_HALF_IN_LONG(&dest->links,&src->links);
|
SWAP_HALF_IN_LONG(&dest->links, &src->links);
|
||||||
} else {
|
} else {
|
||||||
dest->links = src->links;
|
dest->links = src->links;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user