summaryrefslogtreecommitdiffstats
path: root/src/H5Pfapl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Pfapl.c')
-rw-r--r--src/H5Pfapl.c114
1 files changed, 46 insertions, 68 deletions
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index 9707357..889cdc6 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -67,7 +67,7 @@
#define H5F_ACS_DATA_CACHE_BYTE_SIZE_DEF (1024*1024)
/* Definition for preemption read chunks first */
#define H5F_ACS_PREEMPT_READ_CHUNKS_SIZE sizeof(double)
-#define H5F_ACS_PREEMPT_READ_CHUNKS_DEF 0.75
+#define H5F_ACS_PREEMPT_READ_CHUNKS_DEF 0.75f
/* Definition for threshold for alignment */
#define H5F_ACS_ALIGN_THRHD_SIZE sizeof(hsize_t)
#define H5F_ACS_ALIGN_THRHD_DEF 1
@@ -155,6 +155,7 @@ static herr_t H5P_file_image_info_del(hid_t prop_id, const char *name, size_t si
static herr_t H5P_file_image_info_copy(const char *name, size_t size, void *value);
static herr_t H5P_file_image_info_close(const char *name, size_t size, void *value);
+
/*********************/
/* Package Variables */
/*********************/
@@ -508,18 +509,18 @@ H5Pset_alignment(hid_t fapl_id, hsize_t threshold, hsize_t alignment)
H5TRACE3("e", "ihh", fapl_id, threshold, alignment);
/* Check args */
- if (alignment<1)
- HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "alignment must be positive");
+ if(alignment < 1)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "alignment must be positive")
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Set values */
if(H5P_set(plist, H5F_ACS_ALIGN_THRHD_NAME, &threshold) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set threshold");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set threshold")
if(H5P_set(plist, H5F_ACS_ALIGN_NAME, &alignment) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set alignment");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set alignment")
done:
FUNC_LEAVE_API(ret_value)
@@ -692,10 +693,10 @@ H5P_get_driver(H5P_genplist_t *plist)
/* Get the current driver ID */
if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
if(H5P_get(plist, H5F_ACS_FILE_DRV_ID_NAME, &ret_value) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get driver ID");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get driver ID")
} /* end if */
else
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
if(H5FD_VFD_DEFAULT == ret_value)
ret_value = H5_DEFAULT_VFD;
@@ -1002,17 +1003,6 @@ done:
* Programmer: Robb Matzke
* Tuesday, May 19, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list to the new generic property list.
- *
- * J. Mainzer
- * Thurs. 3/17/05
- * The mdc_nelmts entry is no more in the FAPL, so I modified
- * the code to ignore it.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1027,24 +1017,24 @@ H5Pset_cache(hid_t plist_id, int UNUSED mdc_nelmts,
rdcc_w0);
/* Check arguments */
- if (rdcc_w0<0.0 || rdcc_w0>1.0)
- HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "raw data cache w0 value must be between 0.0 and 1.0 inclusive");
+ if(rdcc_w0 < 0.0 || rdcc_w0 > 1.0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "raw data cache w0 value must be between 0.0 and 1.0 inclusive")
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Set sizes */
if(H5P_set(plist, H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME, &rdcc_nslots) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL, "can't set data cache number of slots");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL, "can't set data cache number of slots")
if(H5P_set(plist, H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME, &rdcc_nbytes) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL, "can't set data cache byte size");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL, "can't set data cache byte size")
if(H5P_set(plist, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, &rdcc_w0) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL, "can't set preempt read chunks");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL, "can't set preempt read chunks")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pset_cache() */
/*-------------------------------------------------------------------------
@@ -1061,18 +1051,6 @@ done:
* Programmer: Robb Matzke
* Tuesday, May 19, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list to the new generic property
- * list.
- *
- * J Mainzer
- * Thurs, 3/17/05
- * The mdc_nelmts fapl entry is no more, so we now just
- * return a constant when that value is requested.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1088,27 +1066,27 @@ H5Pget_cache(hid_t plist_id, int *mdc_nelmts,
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Get sizes */
/* the mdc_nelmts FAPL entry no longer exists, so just return a constant */
- if (mdc_nelmts)
+ if(mdc_nelmts)
*mdc_nelmts = 0;
- if (rdcc_nslots)
+ if(rdcc_nslots)
if(H5P_get(plist, H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME, rdcc_nslots) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET,FAIL, "can't get data cache number of slots");
- if (rdcc_nbytes)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET,FAIL, "can't get data cache number of slots")
+ if(rdcc_nbytes)
if(H5P_get(plist, H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME, rdcc_nbytes) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET,FAIL, "can't get data cache byte size");
- if (rdcc_w0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET,FAIL, "can't get data cache byte size")
+ if(rdcc_w0)
if(H5P_get(plist, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, rdcc_w0) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET,FAIL, "can't get preempt read chunks");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET,FAIL, "can't get preempt read chunks")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_cache() */
/*-------------------------------------------------------------------------
@@ -1248,11 +1226,11 @@ H5Pset_gc_references(hid_t plist_id, unsigned gc_ref)
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Set values */
if(H5P_set(plist, H5F_ACS_GARBG_COLCT_REF_NAME, &gc_ref) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set garbage collect reference");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set garbage collect reference")
done:
FUNC_LEAVE_API(ret_value)
@@ -1290,12 +1268,12 @@ H5Pget_gc_references(hid_t plist_id, unsigned *gc_ref/*out*/)
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Get values */
- if (gc_ref)
+ if(gc_ref)
if(H5P_get(plist, H5F_ACS_GARBG_COLCT_REF_NAME, gc_ref) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get garbage collect reference");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get garbage collect reference")
done:
FUNC_LEAVE_API(ret_value)
@@ -1413,11 +1391,11 @@ H5Pset_meta_block_size(hid_t plist_id, hsize_t size)
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Set values */
if(H5P_set(plist, H5F_ACS_META_BLOCK_SIZE_NAME, &size) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set meta data block size");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set meta data block size")
done:
FUNC_LEAVE_API(ret_value)
@@ -1455,12 +1433,12 @@ H5Pget_meta_block_size(hid_t plist_id, hsize_t *size/*out*/)
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Get values */
- if (size) {
+ if(size) {
if(H5P_get(plist, H5F_ACS_META_BLOCK_SIZE_NAME, size) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get meta data block size");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get meta data block size")
} /* end if */
done:
@@ -1508,11 +1486,11 @@ H5Pset_sieve_buf_size(hid_t plist_id, size_t size)
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Set values */
if(H5P_set(plist, H5F_ACS_SIEVE_BUF_SIZE_NAME, &size) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set sieve buffer size");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set sieve buffer size")
done:
FUNC_LEAVE_API(ret_value)
@@ -1550,12 +1528,12 @@ H5Pget_sieve_buf_size(hid_t plist_id, size_t *size/*out*/)
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Get values */
- if (size)
+ if(size)
if(H5P_get(plist, H5F_ACS_SIEVE_BUF_SIZE_NAME, size) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get sieve buffer size");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get sieve buffer size")
done:
FUNC_LEAVE_API(ret_value)
@@ -1597,11 +1575,11 @@ H5Pset_small_data_block_size(hid_t plist_id, hsize_t size)
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Set values */
if(H5P_set(plist, H5F_ACS_SDATA_BLOCK_SIZE_NAME, &size) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'small data' block size");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'small data' block size")
done:
FUNC_LEAVE_API(ret_value)
@@ -1634,12 +1612,12 @@ H5Pget_small_data_block_size(hid_t plist_id, hsize_t *size/*out*/)
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Get values */
- if (size) {
+ if(size) {
if(H5P_get(plist, H5F_ACS_SDATA_BLOCK_SIZE_NAME, size) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get 'small data' block size");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get 'small data' block size")
} /* end if */
done:
@@ -1911,7 +1889,7 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len)
/* validate parameters */
if(!(((buf_ptr == NULL) && (buf_len == 0)) || ((buf_ptr != NULL) && (buf_len > 0))))
- HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "inconsistant buf_ptr and buf_len");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "inconsistant buf_ptr and buf_len")
/* Get the plist structure */
if(NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))