diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2017-06-26 16:33:25 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2017-06-26 16:33:25 (GMT) |
commit | 67da953c1ce3c8d909f2414d6dff38da63890c81 (patch) | |
tree | dc13529567d2c124c499a87077eb8850a7714e33 | |
parent | d349bea008d2abea697e6cda3a42590f30460199 (diff) | |
parent | c325dd2a6512ce02287771bfbbe9b81d65b3fd6f (diff) | |
download | hdf5-67da953c1ce3c8d909f2414d6dff38da63890c81.zip hdf5-67da953c1ce3c8d909f2414d6dff38da63890c81.tar.gz hdf5-67da953c1ce3c8d909f2414d6dff38da63890c81.tar.bz2 |
Merge pull request #582 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit 'c325dd2a6512ce02287771bfbbe9b81d65b3fd6f':
HDFFV-10219 another mode change
HDFFV-10219 change subset to use BINARY mode for h5dump
HDFFV-10219 default input binary to NATIVE
Set default of var to NATIVE
-rw-r--r-- | tools/lib/h5tools.c | 2 | ||||
-rw-r--r-- | tools/src/h5import/h5import.c | 28 | ||||
-rw-r--r-- | tools/src/h5import/h5import.h | 1 | ||||
-rw-r--r-- | tools/test/h5import/CMakeTests.cmake | 4 | ||||
-rw-r--r-- | tools/test/h5import/h5importtestutil.sh.in | 4 |
5 files changed, 29 insertions, 10 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 22fd863..3729cac 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -40,7 +40,7 @@ FILE *rawinstream = NULL; /* should initialize to stdin but gcc moa FILE *rawoutstream = NULL; /* should initialize to stdout but gcc moans about it */ FILE *rawerrorstream = NULL; /* should initialize to stderr but gcc moans about it */ int bin_output; /* binary output */ -int bin_form; /* binary form */ +int bin_form = 0; /* binary form, default NATIVE */ int region_output; /* region output */ int oid_output; /* oid output */ int data_output; /* data output */ diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 1afb383..36a8c21 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -524,9 +524,11 @@ static int readIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) *in16 = swap_int16(temp16); else +*/ *in16 = temp16; #ifdef H5DEBUGIMPORT printf("readIntegerData %d (0x%.8X)\n", *in16, temp16); @@ -558,9 +560,11 @@ static int readIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) *in32 = swap_int32(temp32); else +*/ *in32 = temp32; #ifdef H5DEBUGIMPORT printf("readIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32); @@ -594,9 +598,11 @@ static int readIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) *in64 = swap_int64(temp64); else +*/ *in64 = temp64; #ifdef H5DEBUGIMPORT printf("readIntegerData %d (0x%.8X)\n", *in64, temp64); @@ -688,9 +694,11 @@ static int readUIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) *in16 = swap_uint16(temp16); else +*/ *in16 = temp16; #ifdef H5DEBUGIMPORT printf("readUIntegerData %d (0x%.4X = 0x%.4X)\n", *in16, *in16, temp16); @@ -722,9 +730,11 @@ static int readUIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) *in32 = swap_uint32(temp32); else +*/ *in32 = temp32; #ifdef H5DEBUGIMPORT printf("readUIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32); @@ -758,9 +768,11 @@ static int readUIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) *in64 = swap_uint64(temp64); else +*/ *in64 = temp64; #ifdef H5DEBUGIMPORT printf("readUIntegerData %ld (0x%.8X = 0x%.8X)\n", *in64, *in64, temp64); @@ -836,9 +848,11 @@ static int readFloatData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) *bfp32 = swap_uint32(temp32); else +*/ *bfp32 = temp32; #ifdef H5DEBUGIMPORT printf("readFloatData %ld (0x%.8X = 0x%.8X)\n", *bfp32, *bfp32, temp32); @@ -886,9 +900,11 @@ static int readFloatData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) *bfp64 = swap_uint64(temp64); else +*/ *bfp64 = temp64; #ifdef H5DEBUGIMPORT printf("readFloatData %ld (0x%.16lX)\n", *bfp64, temp64); @@ -1423,6 +1439,7 @@ static int processConfigurationFile(char *infile, struct Input *in) #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif + in->inputArchitecture = 0; /* default to NATIVE */ if ((strm = HDfopen(infile, "r")) == NULL) { (void) HDfprintf(stderr, err1, infile); @@ -2110,6 +2127,7 @@ static int processConfigurationFile(char *infile, struct Input *in) printf("\n"); printf("h5dump inputClass=%d\n", in->inputClass); printf("h5dump inputSize=%d\n", in->inputSize); + printf("h5dump inputArchitecture=%d\n", in->inputArchitecture); printf("h5dump inputByteOrder=%d\n", in->inputByteOrder); printf("h5dump rank=%d\n", in->rank); printf("h5dump outputClass=%d\n", in->outputClass); @@ -4107,8 +4125,8 @@ hid_t createInputDataType(struct Input *in) if (in->h5dumpInput) { switch (in->inputClass) { case 4: - switch (in->outputArchitecture) { - case 0: /* NATIVE */ + switch (in->inputArchitecture) { + case 0: /*NATIVE*/ switch (in->inputSize) { case 8: new_type = H5Tcopy(H5T_NATIVE_CHAR); @@ -4147,7 +4165,7 @@ hid_t createInputDataType(struct Input *in) } break; - case 1: /* STD */ + case 1: /*STD*/ switch (in->inputSize) { case 8: switch (in->inputByteOrder) { @@ -4230,7 +4248,7 @@ hid_t createInputDataType(struct Input *in) break; case 3: - switch (in->outputArchitecture) { + switch (in->inputArchitecture) { case 0: switch (in->inputSize) { case 32: @@ -4315,7 +4333,7 @@ hid_t createInputDataType(struct Input *in) break; case 7: - switch (in->outputArchitecture) { + switch (in->inputArchitecture) { case 0: switch (in->inputSize) { case 8: diff --git a/tools/src/h5import/h5import.h b/tools/src/h5import/h5import.h index b27b944..c55717d 100644 --- a/tools/src/h5import/h5import.h +++ b/tools/src/h5import/h5import.h @@ -83,6 +83,7 @@ struct Input struct path_info path; int inputClass; int inputSize; + int inputArchitecture; int inputByteOrder; int rank; hsize_t* sizeOfDimension; diff --git a/tools/test/h5import/CMakeTests.cmake b/tools/test/h5import/CMakeTests.cmake index 20aad47..3c65b0b 100644 --- a/tools/test/h5import/CMakeTests.cmake +++ b/tools/test/h5import/CMakeTests.cmake @@ -171,7 +171,7 @@ NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" - -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-b;FILE;testfiles/${testfile}" + -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-b;NATIVE;testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=d${testfile}.dmp" -D "TEST_EXPECT=0" @@ -244,7 +244,7 @@ NAME H5IMPORT_SUB-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" - -D "TEST_ARGS:STRING=-p;-d;${datasetname};${ARGN};-o;${testname}.bin;-b;FILE;testfiles/${testfile}" + -D "TEST_ARGS:STRING=-p;-d;${datasetname};${ARGN};-o;${testname}.bin;-b;NATIVE;testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${testname}.dmp" -D "TEST_EXPECT=0" diff --git a/tools/test/h5import/h5importtestutil.sh.in b/tools/test/h5import/h5importtestutil.sh.in index fba4517..7dff689 100644 --- a/tools/test/h5import/h5importtestutil.sh.in +++ b/tools/test/h5import/h5importtestutil.sh.in @@ -204,7 +204,7 @@ fi TOOLTEST2() { err=0 -$RUNSERIAL $DUMPER_BIN -p -d $1 -o d$2.bin -b FILE tmp_testfiles/$2 > d$2.dmp +$RUNSERIAL $DUMPER_BIN -p -d $1 -o d$2.bin -b NATIVE tmp_testfiles/$2 > d$2.dmp $RUNSERIAL $H5IMPORT_BIN d$2.bin -c d$2.dmp -o d$2 > d$2.imp $RUNSERIAL $H5DIFF_BIN -v d$2 tmp_testfiles/$2 $1 $1 > log2 $CP -f $SRC_H5IMPORT_TESTFILES/d$2.txt log1 @@ -268,7 +268,7 @@ fi TOOLTEST5() { err=0 -$RUNSERIAL $DUMPER_BIN -p -d $3 $4 -o d-$1.bin -b FILE tmp_testfiles/$2 > d-$1.dmp +$RUNSERIAL $DUMPER_BIN -p -d $3 $4 -o d-$1.bin -b NATIVE tmp_testfiles/$2 > d-$1.dmp $RUNSERIAL $H5IMPORT_BIN d-$1.bin -c d-$1.dmp -o d-$1.h5 > d-$1.imp $RUNSERIAL $DUMPER_BIN -p d-$1.h5 > log2 $CP -f $SRC_H5IMPORT_TESTFILES/$1.ddl log1 |