diff options
author | Robb Matzke <matzke@llnl.gov> | 1998-01-22 19:57:48 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1998-01-22 19:57:48 (GMT) |
commit | dec0c95436846315e677c69fdb8c44c0dd0a8c8b (patch) | |
tree | 1f63e3d112762453aac71cf36e4564f50d40efa3 /src/H5T.c | |
parent | a0ee2c57e934c5ff2269e345238a6ee019f6c294 (diff) | |
download | hdf5-dec0c95436846315e677c69fdb8c44c0dd0a8c8b.zip hdf5-dec0c95436846315e677c69fdb8c44c0dd0a8c8b.tar.gz hdf5-dec0c95436846315e677c69fdb8c44c0dd0a8c8b.tar.bz2 |
[svn-r165] Changes since 19980122
----------------------
./src/H5.c
./src/H5B.c
./src/H5Bprivate.h
Changed `new' to something else in 6 places for Fabio.
./src/H5T.c
./src/H5Tconv.c
Beginning to work on compound data type conversion. Don't look
yet :-)
Diffstat (limited to 'src/H5T.c')
-rw-r--r-- | src/H5T.c | 23 |
1 files changed, 16 insertions, 7 deletions
@@ -174,6 +174,7 @@ H5T_init_interface(void) HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't initialize H5T layer"); } + /* STRING */ dt = H5MM_xcalloc(1, sizeof(H5T_t)); dt->locked = TRUE; @@ -190,6 +191,7 @@ H5T_init_interface(void) HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't initialize H5T layer"); } + /* BITFIELD */ dt = H5MM_xcalloc(1, sizeof(H5T_t)); dt->locked = TRUE; @@ -204,6 +206,7 @@ H5T_init_interface(void) HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize H5T layer"); } + /* OPAQUE */ dt = H5MM_xcalloc(1, sizeof(H5T_t)); dt->locked = TRUE; @@ -218,6 +221,7 @@ H5T_init_interface(void) HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize H5T layer"); } + /* * Define aliases. */ @@ -231,7 +235,6 @@ H5T_init_interface(void) * Register conversion functions beginning with the most general and * ending with the most specific. */ - if (H5Tregister_soft(H5T_INTEGER, H5T_INTEGER, H5T_conv_order) < 0) { HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to register conversion function"); @@ -240,6 +243,12 @@ H5T_init_interface(void) HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to register conversion function"); } + if (H5Tregister_soft (H5T_COMPOUND, H5T_COMPOUND, H5T_conv_struct)<0) { + HRETURN_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, + "unable to register conversion function"); + } + + FUNC_LEAVE(ret_value); } @@ -2629,12 +2638,12 @@ H5T_sort_by_offset(H5T_t *dt) /* Use a bubble sort because we can short circuit */ nmembs = dt->u.compnd.nmembs; - for (i = nmembs - 1, swapped = TRUE; i > 0 && swapped; --i) { - for (j = 0, swapped = FALSE; j < i; j++) { - if (dt->u.compnd.memb[j].offset > dt->u.compnd.memb[j + 1].offset) { - H5T_member_t tmp = dt->u.compnd.memb[j]; - dt->u.compnd.memb[j] = dt->u.compnd.memb[j + 1]; - dt->u.compnd.memb[j + 1] = tmp; + for (i=nmembs-1, swapped=TRUE; i>0 && swapped; --i) { + for (j=0, swapped=FALSE; j<i; j++) { + if (dt->u.compnd.memb[j].offset > dt->u.compnd.memb[j+1].offset) { + H5T_member_t tmp = dt->u.compnd.memb[j]; + dt->u.compnd.memb[j] = dt->u.compnd.memb[j+1]; + dt->u.compnd.memb[j+1] = tmp; swapped = 1; } } |