summaryrefslogtreecommitdiffstats
path: root/libtommath/bn_mp_get_long.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-09-18 08:31:55 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-09-18 08:31:55 (GMT)
commita187f65cfd5964971d7ed52f09e18fdbb4bf51cc (patch)
tree6b7bbde03122d1571d4543d10eccfe88610bd680 /libtommath/bn_mp_get_long.c
parent0faaca01de4e9fa2039c7fdd34f60b138f665249 (diff)
parent30f7e69b182d1267056ee2628a860891f6555aa3 (diff)
downloadtcl-a187f65cfd5964971d7ed52f09e18fdbb4bf51cc.zip
tcl-a187f65cfd5964971d7ed52f09e18fdbb4bf51cc.tar.gz
tcl-a187f65cfd5964971d7ed52f09e18fdbb4bf51cc.tar.bz2
Merge libtommath upstream changes (astyle formatting only). No functional changes. All Tcl-specific modifications are kept.
Diffstat (limited to 'libtommath/bn_mp_get_long.c')
-rw-r--r--libtommath/bn_mp_get_long.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/libtommath/bn_mp_get_long.c b/libtommath/bn_mp_get_long.c
index da69080..ea9ac43 100644
--- a/libtommath/bn_mp_get_long.c
+++ b/libtommath/bn_mp_get_long.c
@@ -16,26 +16,26 @@
*/
/* get the lower unsigned long of an mp_int, platform dependent */
-unsigned long mp_get_long(const mp_int * a)
+unsigned long mp_get_long(const mp_int *a)
{
- int i;
- unsigned long res;
+ int i;
+ unsigned long res;
- if (a->used == 0) {
- return 0;
- }
+ if (a->used == 0) {
+ return 0;
+ }
- /* get number of digits of the lsb we have to read */
- i = MIN(a->used,(int)(((sizeof(unsigned long) * CHAR_BIT) + DIGIT_BIT - 1) / DIGIT_BIT)) - 1;
+ /* get number of digits of the lsb we have to read */
+ i = MIN(a->used,(int)(((sizeof(unsigned long) * CHAR_BIT) + DIGIT_BIT - 1) / DIGIT_BIT)) - 1;
- /* get most significant digit of result */
- res = DIGIT(a,i);
+ /* get most significant digit of result */
+ res = DIGIT(a,i);
#if (ULONG_MAX != 0xffffffffuL) || (DIGIT_BIT < 32)
- while (--i >= 0) {
- res = (res << DIGIT_BIT) | DIGIT(a,i);
- }
+ while (--i >= 0) {
+ res = (res << DIGIT_BIT) | DIGIT(a,i);
+ }
#endif
- return res;
+ return res;
}
#endif