diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-11-29 17:40:24 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-11-29 17:40:24 (GMT) |
commit | 3e99d8411ccf441b3172a21617d1323ebfff56f2 (patch) | |
tree | 08a516811a3d237be7aa8c71a65109236cabdef0 /src | |
parent | 9f4d8be1d1c026a9528e2e67d33a74fc23c2c788 (diff) | |
download | hdf5-3e99d8411ccf441b3172a21617d1323ebfff56f2.zip hdf5-3e99d8411ccf441b3172a21617d1323ebfff56f2.tar.gz hdf5-3e99d8411ccf441b3172a21617d1323ebfff56f2.tar.bz2 |
[svn-r9592] Purpose:
Bug fix
Description:
Re-work array of 'forward' pointers in a way that makes the PGI compiler
more happy.
Solution:
Change from 'H5SL_node_t *forward[1]' to 'H5SL_node_t **forward' and
change how array of forward pointers is dealt with.
Platforms tested:
Linux 2.4 (verbena) w/PGI
FreeBSD 4.10 (sleipnir)
Configuration not tested w/h5committest
Diffstat (limited to 'src')
-rw-r--r-- | src/H5SL.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -114,7 +114,7 @@ struct H5SL_node_t { void *key; /* Pointer to node's key */ void *item; /* Pointer to node's item */ size_t level; /* The level of this node */ - struct H5SL_node_t *forward[1]; /* Array of forward pointers from this node */ + struct H5SL_node_t **forward; /* Array of forward pointers from this node */ }; /* Main skip list data structure */ @@ -245,13 +245,14 @@ H5SL_new_node(size_t lvl, void *item, void *key) FUNC_ENTER_NOAPI_NOINIT(H5SL_new_node); /* Allocate the node */ - if((ret_value=H5MM_malloc(sizeof(H5SL_node_t)+(sizeof(H5SL_node_t *)*lvl)))==NULL) + if((ret_value=H5MM_malloc(sizeof(H5SL_node_t)+(sizeof(H5SL_node_t *)*(lvl+1))))==NULL) HGOTO_ERROR(H5E_SLIST,H5E_NOSPACE,NULL,"memory allocation failed"); /* Initialize node */ ret_value->key=key; ret_value->item=item; ret_value->level=lvl; + ret_value->forward=(H5SL_node_t **)((unsigned char *)ret_value+sizeof(H5SL_node_t)); done: FUNC_LEAVE_NOAPI(ret_value); |