refactor cast in ternary op
This commit is contained in:
parent
64177349fc
commit
0522eef288
@ -48,7 +48,7 @@ int mp_read_radix (mp_int * a, const char *str, int radix)
|
|||||||
* this allows numbers like 1AB and 1ab to represent the same value
|
* this allows numbers like 1AB and 1ab to represent the same value
|
||||||
* [e.g. in hex]
|
* [e.g. in hex]
|
||||||
*/
|
*/
|
||||||
ch = (char) ((radix <= 36) ? toupper ((int)*str) : *str);
|
ch = (radix <= 36) ? (char)toupper((int)*str) : *str;
|
||||||
for (y = 0; y < 64; y++) {
|
for (y = 0; y < 64; y++) {
|
||||||
if (ch == mp_s_rmap[y]) {
|
if (ch == mp_s_rmap[y]) {
|
||||||
break;
|
break;
|
||||||
|
@ -23,7 +23,7 @@ int mp_to_signed_bin (mp_int * a, unsigned char *b)
|
|||||||
if ((res = mp_to_unsigned_bin (a, b + 1)) != MP_OKAY) {
|
if ((res = mp_to_unsigned_bin (a, b + 1)) != MP_OKAY) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
b[0] = (unsigned char) ((a->sign == MP_ZPOS) ? 0 : 1);
|
b[0] = (a->sign == MP_ZPOS) ? (unsigned char)0 : (unsigned char)1;
|
||||||
return MP_OKAY;
|
return MP_OKAY;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user