summaryrefslogtreecommitdiffstats
path: root/mpi
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-04-22 19:53:18 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-04-22 19:53:18 -0700
commitbef6eaf25f2e1308504fd940015ceb8cbd6ed8ff (patch)
treee2f0aa8900abc9e76299d80830208fd820a2890f /mpi
parentb59969be0d3254e336abcde112528a4fc4179880 (diff)
downloadtxr-bef6eaf25f2e1308504fd940015ceb8cbd6ed8ff.tar.gz
txr-bef6eaf25f2e1308504fd940015ceb8cbd6ed8ff.tar.bz2
txr-bef6eaf25f2e1308504fd940015ceb8cbd6ed8ff.zip
fix-warnings patch
* mpi/mpi.c (mp_to_unsigned_bin, s_mp_mod_2d): Fix signed/unsigned warning. (mp_toradix): Fix shadowing local variable name warning. * mpi/mplogic.c (mpl_num_set, mpl_num_clear): Fix signed/unsigned warning.
Diffstat (limited to 'mpi')
-rw-r--r--mpi/mpi.c10
-rw-r--r--mpi/mplogic.c4
2 files changed, 7 insertions, 7 deletions
diff --git a/mpi/mpi.c b/mpi/mpi.c
index 52346301..4c5ec56a 100644
--- a/mpi/mpi.c
+++ b/mpi/mpi.c
@@ -2401,7 +2401,7 @@ mp_err mp_to_unsigned_bin(mp_int *mp, unsigned char *str)
int ix;
d = *dp;
- for(ix = 0; ix < sizeof(mp_digit); ++ix) {
+ for(ix = 0; ix < (int) sizeof(mp_digit); ++ix) {
*spos = d & UCHAR_MAX;
d >>= CHAR_BIT;
++spos;
@@ -2598,10 +2598,10 @@ mp_err mp_toradix(mp_int *mp, unsigned char *str, int radix)
/* Reverse the digits and sign indicator */
ix = 0;
while(ix < pos) {
- char tmp = str[ix];
+ char tmp2 = str[ix];
str[ix] = str[pos];
- str[pos] = tmp;
+ str[pos] = tmp2;
++ix;
--pos;
}
@@ -2952,10 +2952,10 @@ mp_err s_mp_mul_2(mp_int *mp)
void s_mp_mod_2d(mp_int *mp, mp_digit d)
{
unsigned int ndig = (d / DIGIT_BIT), nbit = (d % DIGIT_BIT);
- unsigned int ix;
+ int ix;
mp_digit dmask, *dp = DIGITS(mp);
- if(ndig >= USED(mp))
+ if((int) ndig >= USED(mp))
return;
/* Flush all the bits above 2^d in its digit */
diff --git a/mpi/mplogic.c b/mpi/mplogic.c
index 5e647b88..2d1cf7bf 100644
--- a/mpi/mplogic.c
+++ b/mpi/mplogic.c
@@ -290,7 +290,7 @@ mp_err mpl_num_set(mp_int *a, int *num)
for(ix = 0; ix < USED(a); ix++) {
cur = DIGIT(a, ix);
- for(db = 0; db < sizeof(mp_digit); db++) {
+ for(db = 0; db < (int) sizeof(mp_digit); db++) {
reg = (cur >> (CHAR_BIT * db)) & UCHAR_MAX;
nset += bitc[reg];
@@ -319,7 +319,7 @@ mp_err mpl_num_clear(mp_int *a, int *num)
for(ix = 0; ix < USED(a); ix++) {
cur = DIGIT(a, ix);
- for(db = 0; db < sizeof(mp_digit); db++) {
+ for(db = 0; db < (int) sizeof(mp_digit); db++) {
reg = (cur >> (CHAR_BIT * db)) & UCHAR_MAX;
nset += bitc[UCHAR_MAX - reg];