From 6b2f384a3cd6c4ff4334fe6b590aad1ea9e1178f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 20 Jun 2017 16:40:39 -0500 Subject: HDFFV-10219 default input binary to NATIVE --- tools/src/h5import/h5import.c | 28 +++++++++++++++++++++++----- tools/src/h5import/h5import.h | 1 + tools/test/h5import/CMakeTests.cmake | 4 ++-- 3 files changed, 26 insertions(+), 7 deletions(-) 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=$" - -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=$" - -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" -- cgit v0.12