diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2017-05-10 15:59:13 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2017-05-10 15:59:13 (GMT) |
commit | 445c805a4cd1222703e0294afa3af9631c7d6c99 (patch) | |
tree | fd23d7bd1bc9fa2ed6390483e7d4c926e92582b5 /java | |
parent | 9d50ed52875549dad6e5253111c0356aca3c2c05 (diff) | |
download | hdf5-445c805a4cd1222703e0294afa3af9631c7d6c99.zip hdf5-445c805a4cd1222703e0294afa3af9631c7d6c99.tar.gz hdf5-445c805a4cd1222703e0294afa3af9631c7d6c99.tar.bz2 |
HDFFV-10186 Add endianess to bitfield and fix tests
Diffstat (limited to 'java')
-rw-r--r-- | java/src/jni/h5util.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index 8454815..bd9fc0f 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -350,7 +350,7 @@ h5str_sprintf this_str = (char*)HDmalloc(4 * (nll + 1)); if (1 == nll) { - sprintf(this_str, "0x%02x", ucptr[0]); + sprintf(this_str, "%#02x", ucptr[0]); } else { for (i = 0; i < (int)nll; i++) @@ -481,7 +481,7 @@ h5str_sprintf this_str = (char*)HDmalloc(4 * (nll + 1)); if (1 == nll) { - sprintf(this_str, "0x%02x", ucptr[0]); + sprintf(this_str, "%#02x", ucptr[0]); } else { for (i = 0; i < (int)nll; i++) @@ -1051,8 +1051,20 @@ h5str_get_little_endian_type p_type=H5Tcopy(H5T_IEEE_F64LE); break; - case H5T_TIME: case H5T_BITFIELD: + { + if ( size == 1) + p_type=H5Tcopy(H5T_STD_B8LE); + else if ( size == 2) + p_type=H5Tcopy(H5T_STD_B16LE); + else if ( size == 4) + p_type=H5Tcopy(H5T_STD_B32LE); + else if ( size == 8) + p_type=H5Tcopy(H5T_STD_B64LE); + } + break; + + case H5T_TIME: case H5T_OPAQUE: case H5T_STRING: case H5T_COMPOUND: @@ -1122,8 +1134,20 @@ h5str_get_big_endian_type p_type=H5Tcopy(H5T_IEEE_F64BE); break; - case H5T_TIME: case H5T_BITFIELD: + { + if ( size == 1) + p_type=H5Tcopy(H5T_STD_B8BE); + else if ( size == 2) + p_type=H5Tcopy(H5T_STD_B16BE); + else if ( size == 4) + p_type=H5Tcopy(H5T_STD_B32BE); + else if ( size == 8) + p_type=H5Tcopy(H5T_STD_B64BE); + } + break; + + case H5T_TIME: case H5T_OPAQUE: case H5T_STRING: case H5T_COMPOUND: |