summaryrefslogtreecommitdiffstats
path: root/libtommath/bn_mp_fread.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_fread.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_fread.c')
-rw-r--r--libtommath/bn_mp_fread.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libtommath/bn_mp_fread.c b/libtommath/bn_mp_fread.c
index 140721b..d0de595 100644
--- a/libtommath/bn_mp_fread.c
+++ b/libtommath/bn_mp_fread.c
@@ -20,10 +20,10 @@
int mp_fread(mp_int *a, int radix, FILE *stream)
{
int err, ch, neg, y;
-
+
/* clear a */
mp_zero(a);
-
+
/* if first digit is - then set negative */
ch = fgetc(stream);
if (ch == '-') {
@@ -32,18 +32,18 @@ int mp_fread(mp_int *a, int radix, FILE *stream)
} else {
neg = MP_ZPOS;
}
-
+
for (;;) {
/* find y in the radix map */
for (y = 0; y < radix; y++) {
- if (mp_s_rmap[y] == ch) {
- break;
- }
+ if (mp_s_rmap[y] == ch) {
+ break;
+ }
}
if (y == radix) {
break;
}
-
+
/* shift up and add */
if ((err = mp_mul_d(a, radix, a)) != MP_OKAY) {
return err;
@@ -51,13 +51,13 @@ int mp_fread(mp_int *a, int radix, FILE *stream)
if ((err = mp_add_d(a, y, a)) != MP_OKAY) {
return err;
}
-
+
ch = fgetc(stream);
}
if (mp_cmp_d(a, 0) != MP_EQ) {
a->sign = neg;
}
-
+
return MP_OKAY;
}
#endif