summaryrefslogtreecommitdiffstats
path: root/libtommath/bn_mp_copy.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_copy.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_copy.c')
-rw-r--r--libtommath/bn_mp_copy.c67
1 files changed, 33 insertions, 34 deletions
diff --git a/libtommath/bn_mp_copy.c b/libtommath/bn_mp_copy.c
index 84e839e..bed03b2 100644
--- a/libtommath/bn_mp_copy.c
+++ b/libtommath/bn_mp_copy.c
@@ -16,50 +16,49 @@
*/
/* copy, b = a */
-int
-mp_copy (mp_int * a, mp_int * b)
+int mp_copy(mp_int *a, mp_int *b)
{
- int res, n;
+ int res, n;
- /* if dst == src do nothing */
- if (a == b) {
- return MP_OKAY;
- }
+ /* if dst == src do nothing */
+ if (a == b) {
+ return MP_OKAY;
+ }
- /* grow dest */
- if (b->alloc < a->used) {
- if ((res = mp_grow (b, a->used)) != MP_OKAY) {
- return res;
- }
- }
+ /* grow dest */
+ if (b->alloc < a->used) {
+ if ((res = mp_grow(b, a->used)) != MP_OKAY) {
+ return res;
+ }
+ }
- /* zero b and copy the parameters over */
- {
- mp_digit *tmpa, *tmpb;
+ /* zero b and copy the parameters over */
+ {
+ mp_digit *tmpa, *tmpb;
- /* pointer aliases */
+ /* pointer aliases */
- /* source */
- tmpa = a->dp;
+ /* source */
+ tmpa = a->dp;
- /* destination */
- tmpb = b->dp;
+ /* destination */
+ tmpb = b->dp;
- /* copy all the digits */
- for (n = 0; n < a->used; n++) {
- *tmpb++ = *tmpa++;
- }
+ /* copy all the digits */
+ for (n = 0; n < a->used; n++) {
+ *tmpb++ = *tmpa++;
+ }
- /* clear high digits */
- for (; n < b->used; n++) {
- *tmpb++ = 0;
- }
- }
+ /* clear high digits */
+ for (; n < b->used; n++) {
+ *tmpb++ = 0;
+ }
+ }
- /* copy used count and sign */
- b->used = a->used;
- b->sign = a->sign;
- return MP_OKAY;
+ /* copy used count and sign */
+ b->used = a->used;
+ b->sign = a->sign;
+ return MP_OKAY;
}
#endif