summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDwayne C. Litzenberger <dlitz@dlitz.net>2012-07-03 12:16:53 -0400
committerDwayne C. Litzenberger <dlitz@dlitz.net>2012-07-03 12:16:53 -0400
commit3103b3789fb26d9cf9aba2d27f6458fc072ed85a (patch)
treec10e8a49763e66ab816247546a8a0e8137a6a33e /src
parentdaed1020833cb3c3258600300e48244e27ade086 (diff)
downloadpycrypto-3103b3789fb26d9cf9aba2d27f6458fc072ed85a.tar.gz
setup.py: Add more compiler warnings and fix unsigned-signed comparisons
Diffstat (limited to 'src')
-rw-r--r--src/MD2.c4
-rw-r--r--src/_fastmath.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/MD2.c b/src/MD2.c
index 3054fb2..f670ec4 100644
--- a/src/MD2.c
+++ b/src/MD2.c
@@ -51,7 +51,7 @@ typedef unsigned int U32;
typedef struct {
U8 C[16], X[48];
- int count;
+ unsigned int count;
U8 buf[16];
} hash_state;
@@ -134,7 +134,7 @@ hash_digest (const hash_state *self)
U8 padding[16];
U32 padlen;
hash_state temp;
- int i;
+ unsigned int i;
memcpy(&temp, self, sizeof(hash_state));
padlen= 16-self->count;
diff --git a/src/_fastmath.c b/src/_fastmath.c
index 959500c..1317765 100644
--- a/src/_fastmath.c
+++ b/src/_fastmath.c
@@ -1372,9 +1372,9 @@ rabinMillerTest (mpz_t n, int rounds, PyObject *randfunc)
b = mpz_scan1 (n_1, 0);
mpz_fdiv_q_2exp (m, n_1, b);
- if (mpz_fits_ulong_p (n) && (mpz_get_ui (n) - 2 < rounds))
+ if (mpz_fits_ulong_p (n) && (mpz_get_ui (n) - 2 < (unsigned long)rounds))
rounds = mpz_get_ui (n) - 2;
- for (i = 0; i < rounds; ++i)
+ for (i = 0; i < (unsigned long)rounds; ++i)
{
mpz_set_ui (tmp, 2);
do