summaryrefslogtreecommitdiffstats
path: root/tools/h5import/h5import.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2008-09-25 20:38:21 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2008-09-25 20:38:21 (GMT)
commita6e2a45d15bc066072d01c4792b810ff47bae377 (patch)
tree0820b696f13c14f6391cc6946c13128633ad55d8 /tools/h5import/h5import.c
parent41e1d56e32ffc4600068e8a61dd499adad1db5f2 (diff)
downloadhdf5-a6e2a45d15bc066072d01c4792b810ff47bae377.zip
hdf5-a6e2a45d15bc066072d01c4792b810ff47bae377.tar.gz
hdf5-a6e2a45d15bc066072d01c4792b810ff47bae377.tar.bz2
[svn-r15699] Bug fix #1281
The TEXTFPE was described in the usage (read floats in scientific notation) but was not implemeneted. Solution: remove TEXTFPE from the help system and have the TEXTFPE input type do the same thing as TEXTPF currently does to support backwards compatibility (the format read for both TEXTFPE and TEXTPF is %f) added a test tested: windows, linux
Diffstat (limited to 'tools/h5import/h5import.c')
-rwxr-xr-xtools/h5import/h5import.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c
index 6352c52..89d14f9 100755
--- a/tools/h5import/h5import.c
+++ b/tools/h5import/h5import.c
@@ -764,8 +764,20 @@ readFloatData(FILE **strm, struct Input *in)
fp32 = (H5DT_FLOAT32 *) in->data;
break;
+ /* same as TEXTFP */
case 2: /*TEXTFPE */
- break;
+
+ for (i = 0; i < len; i++, fp32++)
+ {
+ if (fscanf(*strm, "%f", fp32) != 1)
+ {
+ (void) fprintf(stderr, err1);
+ return (-1);
+ }
+ }
+
+ fp32 = (H5DT_FLOAT32 *) in->data;
+ break;
case 3: /* FP */
for (i = 0; i < len; i++, fp32++)
@@ -801,8 +813,20 @@ readFloatData(FILE **strm, struct Input *in)
fp64 = (H5DT_FLOAT64 *) in->data;
break;
+ /* same as TEXTFP */
case 2: /*TEXTFPE */
- break;
+
+ for (i = 0; i < len; i++, fp64++)
+ {
+ if (fscanf(*strm, "%lf", fp64) != 1)
+ {
+ (void) fprintf(stderr, err1);
+ return (-1);
+ }
+ }
+
+ fp64 = (H5DT_FLOAT64 *) in->data;
+ break;
case 3: /* FP */
for (i = 0; i < len; i++, fp64++)
@@ -2733,7 +2757,7 @@ help(char *name)
(void) fprintf(stdout, "\t to be created.\n\n");
(void) fprintf(stdout, "\t INPUT-CLASS:\n");
(void) fprintf(stdout, "\t String denoting the type of input data.\n");
- (void) fprintf(stdout, "\t (\"TEXTIN\", \"TEXTFP\", \"TEXTFPE\", \"FP\", \"IN\", \n");
+ (void) fprintf(stdout, "\t (\"TEXTIN\", \"TEXTFP\", \"FP\", \"IN\", \n");
(void) fprintf(stdout, "\t \"STR\", \"TEXTUIN\", \"UIN\"). \n");
(void) fprintf(stdout, "\t INPUT-CLASS \"TEXTIN\" denotes an ASCII text \n");
(void) fprintf(stdout, "\t file with signed integer data in ASCII form,\n");
@@ -2742,9 +2766,6 @@ help(char *name)
(void) fprintf(stdout, "\t \"TEXTFP\" denotes an ASCII text file containing\n");
(void) fprintf(stdout, "\t floating point data in the fixed notation\n");
(void) fprintf(stdout, "\t (325.34),\n");
- (void) fprintf(stdout, "\t \"TEXTFPE\" denotes an ASCII text file containing\n");
- (void) fprintf(stdout, "\t floating point data in the scientific notation\n");
- (void) fprintf(stdout, "\t (3.2534E+02),\n");
(void) fprintf(stdout, "\t \"FP\" denotes a floating point binary file,\n");
(void) fprintf(stdout, "\t \"IN\" denotes a signed integer binary file,\n");
(void) fprintf(stdout, "\t \"UIN\" denotes an unsigned integer binary file,\n");