diff options
| author | Allen Byrne <byrn@hdfgroup.org> | 2017-05-10 21:38:36 (GMT) |
|---|---|---|
| committer | Allen Byrne <byrn@hdfgroup.org> | 2017-05-10 21:38:36 (GMT) |
| commit | fcdf2ace7d2461360bd7dd54575dbd61c88c0561 (patch) | |
| tree | 12d706111c045815abca648eef84b05c362e79c3 /java | |
| parent | 46937e903264d035aae78df5a6baf1fc9dc97fff (diff) | |
| parent | ec0935a924a84b18b29473b4fcec7c3f4e1aca76 (diff) | |
| download | hdf5-fcdf2ace7d2461360bd7dd54575dbd61c88c0561.zip hdf5-fcdf2ace7d2461360bd7dd54575dbd61c88c0561.tar.gz hdf5-fcdf2ace7d2461360bd7dd54575dbd61c88c0561.tar.bz2 | |
Merge pull request #503 in HDFFV/hdf5 from ~BYRN/hdf5_adb:bugfix/HDFFV-10186-tbitnopaque-test to develop
* commit 'ec0935a924a84b18b29473b4fcec7c3f4e1aca76':
HDFFV-10186 xml test also needs endianess aware files
HDFFV-10186 - h5tools_str_append is not printf
HDFFV-10186 braces formatting
Fix reference file contents
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: |
