diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2012-03-26 19:08:58 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2012-03-26 19:08:58 +0000 |
commit | ba4c74667682b00c7535eec3338a5299517abcaf (patch) | |
tree | 8f21d4f2c153fd748e850923e2c7dff07df5003a | |
parent | 6876abd27e99124195705802e4e8ea06b5bd293b (diff) | |
download | mpfr-ba4c74667682b00c7535eec3338a5299517abcaf.tar.gz |
[src/fpif.c,tests/tfpif.c] changed to GNU style
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8132 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | src/fpif.c | 3 | ||||
-rw-r--r-- | tests/tfpif.c | 22 |
2 files changed, 12 insertions, 13 deletions
diff --git a/src/fpif.c b/src/fpif.c index aa77ff1ed..d672b9867 100644 --- a/src/fpif.c +++ b/src/fpif.c @@ -533,8 +533,7 @@ mpfr_fpif_import (mpfr_t x, FILE *fh) if (mpfr_regular_p (x)) { - /*used_size = (precision / 8) + ((precision % 8) == 0 ? 0 : 1);*/ - used_size = (precision + 7) >> 3; + used_size = (precision + 7) >> 3; /* ceil(precision/8) */ buffer = (unsigned char*) (*__gmp_allocate_func) (used_size); if (buffer == NULL) { diff --git a/tests/tfpif.c b/tests/tfpif.c index 9c1765927..1655949a6 100644 --- a/tests/tfpif.c +++ b/tests/tfpif.c @@ -139,13 +139,13 @@ main (int argc, char *argv[]) remove (FILE_NAME_RW); mpfr_init2 (y, 2); - status = mpfr_fpif_export(NULL, y); + status = mpfr_fpif_export (NULL, y); if (status == 0) { printf ("mpfr_fpif_export did not fail with a NULL file\n"); exit(1); } - status = mpfr_fpif_import(y, NULL); + status = mpfr_fpif_import (y, NULL); if (status == 0) { printf ("mpfr_fpif_import did not fail with a NULL file\n"); @@ -161,7 +161,7 @@ main (int argc, char *argv[]) remove (FILE_NAME_RW); exit (1); } - status = mpfr_fpif_import(y, fh); + status = mpfr_fpif_import (y, fh); if (status == 0) { printf ("mpfr_fpif_import did not fail on a empty file\n"); @@ -170,10 +170,10 @@ main (int argc, char *argv[]) exit(1); } - for(i=0;i<6;i++) + for (i = 0; i < 6; i++) { - rewind(fh); - status = fwrite(&badData[i][0], badDataSize[i], 1, fh); + rewind (fh); + status = fwrite (&badData[i][0], badDataSize[i], 1, fh); if (status != 1) { printf ("Write error on the test file\n"); @@ -181,12 +181,12 @@ main (int argc, char *argv[]) remove (FILE_NAME_RW); exit(1); } - rewind(fh); - status = mpfr_fpif_import(y, fh); + rewind (fh); + status = mpfr_fpif_import (y, fh); if (status == 0) { printf ("mpfr_fpif_import did not fail on a bad imported data\n"); - switch(i) + switch (i) { case 0: printf (" not enough precision data\n"); @@ -207,7 +207,7 @@ main (int argc, char *argv[]) printf (" no limb data\n"); break; default: - printf ("Test fatal error, unknow case\n"); + printf ("Test fatal error, unknown case\n"); break; } fclose (fh); @@ -228,7 +228,7 @@ main (int argc, char *argv[]) } mpfr_init2 (y, 2); - status = mpfr_fpif_export(fh, y); + status = mpfr_fpif_export (fh, y); if (status == 0) { printf ("mpfr_fpif_export did not fail on a read only stream\n"); |