refactor cast in ternary op
diff --git a/bn_mp_read_radix.c b/bn_mp_read_radix.c
index 31b12ac..8d3c710 100644
--- a/bn_mp_read_radix.c
+++ b/bn_mp_read_radix.c
@@ -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
* [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++) {
if (ch == mp_s_rmap[y]) {
break;
diff --git a/bn_mp_to_signed_bin.c b/bn_mp_to_signed_bin.c
index 0c0149e..2898908 100644
--- a/bn_mp_to_signed_bin.c
+++ b/bn_mp_to_signed_bin.c
@@ -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) {
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;
}
#endif