summaryrefslogtreecommitdiffstats
path: root/libtommath/bn_mp_get_long.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-09-15 14:44:00 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-09-15 14:44:00 (GMT)
commit30f7e69b182d1267056ee2628a860891f6555aa3 (patch)
tree4598f9d64ea232476fcf18bbef6bd413444c0c07 /libtommath/bn_mp_get_long.c
parentb167e2845e3a2d5b2ffe3a877cb19c3f430aeacf (diff)
downloadtcl-30f7e69b182d1267056ee2628a860891f6555aa3.zip
tcl-30f7e69b182d1267056ee2628a860891f6555aa3.tar.gz
tcl-30f7e69b182d1267056ee2628a860891f6555aa3.tar.bz2
re-format everything through astyle. Taken from libtom/libtommath (pull request [https://github.com/libtom/libtommath/pull/85|85])
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 7c3d0fe..053930c 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(mp_int * a)
+unsigned long mp_get_long(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