diff options
author | Dwayne C. Litzenberger <dlitz@dlitz.net> | 2012-07-03 12:16:53 -0400 |
---|---|---|
committer | Dwayne C. Litzenberger <dlitz@dlitz.net> | 2012-07-03 12:16:53 -0400 |
commit | 3103b3789fb26d9cf9aba2d27f6458fc072ed85a (patch) | |
tree | c10e8a49763e66ab816247546a8a0e8137a6a33e /src | |
parent | daed1020833cb3c3258600300e48244e27ade086 (diff) | |
download | pycrypto-3103b3789fb26d9cf9aba2d27f6458fc072ed85a.tar.gz |
setup.py: Add more compiler warnings and fix unsigned-signed comparisons
Diffstat (limited to 'src')
-rw-r--r-- | src/MD2.c | 4 | ||||
-rw-r--r-- | src/_fastmath.c | 4 |
2 files changed, 4 insertions, 4 deletions
@@ -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 |