summaryrefslogtreecommitdiffstats
path: root/libtommath/bn_mp_init_multi.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)
commitd4e73bcab52ca3c76e007a1acc7cb76f50b8feb5 (patch)
tree4598f9d64ea232476fcf18bbef6bd413444c0c07 /libtommath/bn_mp_init_multi.c
parentce32fdecb2337a3ce69b0fb71295c46478019e86 (diff)
downloadtcl-d4e73bcab52ca3c76e007a1acc7cb76f50b8feb5.zip
tcl-d4e73bcab52ca3c76e007a1acc7cb76f50b8feb5.tar.gz
tcl-d4e73bcab52ca3c76e007a1acc7cb76f50b8feb5.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_init_multi.c')
-rw-r--r--libtommath/bn_mp_init_multi.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/libtommath/bn_mp_init_multi.c b/libtommath/bn_mp_init_multi.c
index 73d6a0f..0da7803 100644
--- a/libtommath/bn_mp_init_multi.c
+++ b/libtommath/bn_mp_init_multi.c
@@ -16,37 +16,37 @@
*/
#include <stdarg.h>
-int mp_init_multi(mp_int *mp, ...)
+int mp_init_multi(mp_int *mp, ...)
{
- mp_err res = MP_OKAY; /* Assume ok until proven otherwise */
- int n = 0; /* Number of ok inits */
- mp_int* cur_arg = mp;
- va_list args;
+ mp_err res = MP_OKAY; /* Assume ok until proven otherwise */
+ int n = 0; /* Number of ok inits */
+ mp_int *cur_arg = mp;
+ va_list args;
- va_start(args, mp); /* init args to next argument from caller */
- while (cur_arg != NULL) {
- if (mp_init(cur_arg) != MP_OKAY) {
- /* Oops - error! Back-track and mp_clear what we already
- succeeded in init-ing, then return error.
- */
- va_list clean_args;
-
- /* now start cleaning up */
- cur_arg = mp;
- va_start(clean_args, mp);
- while (n-- != 0) {
- mp_clear(cur_arg);
- cur_arg = va_arg(clean_args, mp_int*);
- }
- va_end(clean_args);
- res = MP_MEM;
- break;
- }
- n++;
- cur_arg = va_arg(args, mp_int*);
- }
- va_end(args);
- return res; /* Assumed ok, if error flagged above. */
+ va_start(args, mp); /* init args to next argument from caller */
+ while (cur_arg != NULL) {
+ if (mp_init(cur_arg) != MP_OKAY) {
+ /* Oops - error! Back-track and mp_clear what we already
+ succeeded in init-ing, then return error.
+ */
+ va_list clean_args;
+
+ /* now start cleaning up */
+ cur_arg = mp;
+ va_start(clean_args, mp);
+ while (n-- != 0) {
+ mp_clear(cur_arg);
+ cur_arg = va_arg(clean_args, mp_int *);
+ }
+ va_end(clean_args);
+ res = MP_MEM;
+ break;
+ }
+ n++;
+ cur_arg = va_arg(args, mp_int *);
+ }
+ va_end(args);
+ return res; /* Assumed ok, if error flagged above. */
}
#endif