diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-02 20:55:18 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-02 20:55:18 +0000 |
commit | 78c0815c4118fe24ab78cce2dc48a6232dcd824a (patch) | |
tree | 8512c50df70b8dd80c919e88ade3419207c95956 /plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-bit.c | |
parent | ce816d83a8c75808e0eb06832592bffefe4a8dc4 (diff) |
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-bit.c')
-rw-r--r-- | plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-bit.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-bit.c b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-bit.c index 32c820c291..5aeedbbf6d 100644 --- a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-bit.c +++ b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-bit.c @@ -54,10 +54,10 @@ _gcry_clz_tab[] = void _gcry_mpi_normalize( gcry_mpi_t a ) { - if( mpi_is_opaque(a) ) + if ( mpi_is_opaque(a) ) return; - for( ; a->nlimbs && !a->d[a->nlimbs-1]; a->nlimbs-- ) + for ( ; a->nlimbs && !a->d[a->nlimbs-1]; a->nlimbs-- ) ; } @@ -71,14 +71,14 @@ gcry_mpi_get_nbits( gcry_mpi_t a ) { unsigned n; - if( mpi_is_opaque(a) ) { + if ( mpi_is_opaque(a) ) { return a->sign; /* which holds the number of bits */ } _gcry_mpi_normalize( a ); - if( a->nlimbs ) { + if ( a->nlimbs ) { mpi_limb_t alimb = a->d[a->nlimbs-1]; - if( alimb ) + if ( alimb ) count_leading_zeros( n, alimb ); else n = BITS_PER_MPI_LIMB; @@ -102,7 +102,7 @@ gcry_mpi_test_bit( gcry_mpi_t a, unsigned int n ) limbno = n / BITS_PER_MPI_LIMB; bitno = n % BITS_PER_MPI_LIMB; - if( limbno >= a->nlimbs ) + if ( limbno >= a->nlimbs ) return 0; /* too far left: this is a 0 */ limb = a->d[limbno]; return (limb & (A_LIMB_1 << bitno))? 1: 0; @@ -161,11 +161,11 @@ gcry_mpi_clear_highbit( gcry_mpi_t a, unsigned int n ) limbno = n / BITS_PER_MPI_LIMB; bitno = n % BITS_PER_MPI_LIMB; - if( limbno >= a->nlimbs ) + if ( limbno >= a->nlimbs ) return; /* not allocated, therefore no need to clear bits :-) */ - for( ; bitno < BITS_PER_MPI_LIMB; bitno++ ) + for ( ; bitno < BITS_PER_MPI_LIMB; bitno++ ) a->d[limbno] &= ~(A_LIMB_1 << bitno); a->nlimbs = limbno+1; } @@ -181,7 +181,7 @@ gcry_mpi_clear_bit( gcry_mpi_t a, unsigned int n ) limbno = n / BITS_PER_MPI_LIMB; bitno = n % BITS_PER_MPI_LIMB; - if( limbno >= a->nlimbs ) + if ( limbno >= a->nlimbs ) return; /* don't need to clear this bit, it's to far to left */ a->d[limbno] &= ~(A_LIMB_1 << bitno); } @@ -198,12 +198,12 @@ _gcry_mpi_rshift_limbs( gcry_mpi_t a, unsigned int count ) mpi_size_t n = a->nlimbs; unsigned int i; - if( count >= n ) { + if ( count >= n ) { a->nlimbs = 0; return; } - for( i = 0; i < n - count; i++ ) + for ( i = 0; i < n - count; i++ ) ap[i] = ap[i+count]; ap[i] = 0; a->nlimbs -= count; |