diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2005-08-13 20:53:35 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2005-08-13 20:53:35 (GMT) |
commit | 6b45f5172ccb4311e0be9ae15da3758abb6b0e67 (patch) | |
tree | 5a7a112fe7a8a98c6fecb45b513789d15962eb3d /src | |
parent | 6562465a2c2a58cfbc2f47bf60bb538f7a783933 (diff) | |
download | hdf5-6b45f5172ccb4311e0be9ae15da3758abb6b0e67.zip hdf5-6b45f5172ccb4311e0be9ae15da3758abb6b0e67.tar.gz hdf5-6b45f5172ccb4311e0be9ae15da3758abb6b0e67.tar.bz2 |
[svn-r11245] Purpose:
Code cleanup
Description:
Trim trailing whitespace, which is making 'diff'ing the two branches
difficult.
Solution:
Ran this script in each directory:
foreach f (*.[ch] *.cpp)
sed 's/[[:blank:]]*$//' $f > sed.out && mv sed.out $f
end
Platforms tested:
FreeBSD 4.11 (sleipnir)
Too minor to require h5committest
Diffstat (limited to 'src')
154 files changed, 4410 insertions, 4410 deletions
@@ -61,7 +61,7 @@ static void H5_debug_mask(const char*); * H5_init_library -- Initialize library-global information * USAGE * herr_t H5_init_library() - * + * * RETURNS * Non-negative on success/Negative on failure * @@ -70,7 +70,7 @@ static void H5_debug_mask(const char*); * *-------------------------------------------------------------------------- */ -herr_t +herr_t H5_init_library(void) { herr_t ret_value=SUCCEED; @@ -132,7 +132,7 @@ H5_init_library(void) * Initialize interfaces that might not be able to initialize themselves * soon enough. The file & dataset interfaces must be initialized because * calling H5P_create() might require the file/dataset property classes to be - * initialized. The property interface must be initialized before the file + * initialized. The property interface must be initialized before the file * & dataset interfaces though, in order to provide them with the proper * property classes. */ @@ -181,7 +181,7 @@ H5_term_library(void) unsigned at=0; char loop[1024]; H5E_auto_stack_t func; - + #ifdef H5_HAVE_THREADSAFE /* explicit locking of the API */ H5_FIRST_THREAD_INIT @@ -209,7 +209,7 @@ H5_term_library(void) (sprintf(loop+at, "..."), \ at += HDstrlen(loop+at), \ n):n)) - + do { pending = 0; /* Try to organize these so the "higher" level components get shut @@ -274,7 +274,7 @@ H5_term_library(void) H5_MPEinit_g = FALSE; /* turn it off no matter what */ } #endif - + /* Mark library as closed */ H5_INIT_GLOBAL = FALSE; done: @@ -448,7 +448,7 @@ H5_debug_mask(const char *s) char pkg_name[32], *rest; size_t i; int clear; - + while (s && *s) { if (HDisalpha(*s) || '-'==*s || '+'==*s) { /* Enable or Disable debugging? */ @@ -501,7 +501,7 @@ H5_debug_mask(const char *s) } } } - + /*------------------------------------------------------------------------- * Function: H5get_libversion @@ -577,11 +577,11 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) FUNC_ENTER_API_NOINIT(H5check_version) H5TRACE3("e","IuIuIu",majnum,minnum,relnum); - + /* Don't check again, if we already have */ if (checked) HGOTO_DONE(SUCCEED) - + { const char *s; /* Environment string for disabling version check */ /* Allow different versions of the header files and library? */ @@ -606,7 +606,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) stderr); /* Mention the versions we are referring to */ HDfprintf (stderr, "Headers are %u.%u.%u, library is %u.%u.%u\n", - majnum, minnum, relnum, + majnum, minnum, relnum, (unsigned)H5_VERS_MAJOR, (unsigned)H5_VERS_MINOR, (unsigned)H5_VERS_RELEASE); /* Bail out now. */ @@ -626,7 +626,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) "continue.\n", stderr); /* Mention the versions we are referring to */ HDfprintf (stderr, "Headers are %u.%u.%u, library is %u.%u.%u\n", - majnum, minnum, relnum, + majnum, minnum, relnum, (unsigned)H5_VERS_MAJOR, (unsigned)H5_VERS_MINOR, (unsigned)H5_VERS_RELEASE); break; } /* end switch */ @@ -855,7 +855,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) char *rest, format_templ[128]; const char *s; va_list ap; - + assert (stream); assert (fmt); @@ -894,7 +894,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) } /*lint !e744 Switch statement doesn't _need_ default */ s++; } - + /* Field width */ if (HDisdigit (*s)) { zerofill = ('0'==*s); @@ -986,7 +986,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) if (*modifier) sprintf (format_templ+HDstrlen(format_templ), "%s", modifier); sprintf (format_templ+HDstrlen(format_templ), "%c", conv); - + /* Conversion */ switch (conv) { @@ -1173,13 +1173,13 @@ HDstrtoll(const char *s, const char **rest, int base) { int64_t sign=1, acc=0; hbool_t overflow = FALSE; - + errno = 0; if (!s || (base && (base<2 || base>36))) { if (rest) *rest = s; return 0; } - + /* Skip white space */ while (HDisspace (*s)) s++; @@ -1188,7 +1188,7 @@ HDstrtoll(const char *s, const char **rest, int base) s++; } else if ('-'==*s) { sign = -1; - s++; + s++; } /* Zero base prefix */ @@ -1201,7 +1201,7 @@ HDstrtoll(const char *s, const char **rest, int base) } else if (0==base) { base = 10; } - + /* Digits */ while ((base<=10 && *s>='0' && *s<'0'+base) || (base>10 && ((*s>='0' && *s<='9') || @@ -1328,7 +1328,7 @@ void H5_timer_end (H5_timer_t *sum/*in,out*/, H5_timer_t *timer/*in,out*/) { H5_timer_t now; - + assert (timer); H5_timer_begin (&now); @@ -1361,7 +1361,7 @@ H5_timer_end (H5_timer_t *sum/*in,out*/, H5_timer_t *timer/*in,out*/) * 1.2345e-10 For bandwidth less than 1 * 6.7893e+94 For exceptionally large values * 6.678e+106 For really big values - * + * * Return: void * * Programmer: Robb Matzke @@ -1504,7 +1504,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } else { HDmemset(&event_time, 0, sizeof event_time); } - + /* Print the first part of the line. This is the indication of the * nesting depth followed by the function name and either start of * argument list or start of return value. If this call is for a @@ -1537,7 +1537,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) fputc('+', out); fprintf(out, "%*s%s(", 2*current_depth, "", func); } - + /* Clear array sizes */ for (i=0; i<(hssize_t)NELMTS(asize); i++) asize[i] = -1; @@ -1559,7 +1559,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } else { asize_idx = -1; } - + /* * The argument name. Leave off the `_id' part. If the argument * name is the null pointer then don't print the argument or the @@ -1736,7 +1736,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + case 's': if (ptr) { if (vp) { @@ -1765,7 +1765,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + case 't': if (ptr) { if (vp) { @@ -1788,7 +1788,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + default: fprintf (out, "BADTYPE(D%c)", type[1]); goto error; @@ -1808,7 +1808,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) else fprintf (out, "FAIL"); } break; - + case 'E': switch (type[1]) { case 'd': @@ -1833,7 +1833,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + case 'e': if (ptr) { if (vp) { @@ -1869,7 +1869,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + default: fprintf (out, "BADTYPE(E%c)", type[1]); goto error; @@ -2072,7 +2072,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) asize[argno] = (hssize_t)hssize; } break; - + default: fprintf (out, "BADTYPE(H%c)", type[1]); goto error; @@ -2271,7 +2271,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) asize[argno] = is; } break; - + case 'u': if (ptr) { if (vp) { @@ -2528,7 +2528,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + default: fprintf(out, "BADTYPE(S%c)", type[1]); goto error; @@ -2568,7 +2568,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + case 's': if (ptr) { if (vp) { @@ -60,7 +60,7 @@ NAME H5A_init_interface -- Initialize interface-specific information USAGE herr_t H5A_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -79,7 +79,7 @@ H5A_init_interface(void) */ if (H5I_register_type(H5I_ATTR, (size_t)H5I_ATTRID_HASHSIZE, H5A_RESERVED_ATOMS, (H5I_free_t)H5A_close)<H5I_FILE) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "unable to initialize interface") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -107,7 +107,7 @@ H5A_term_interface(void) int n=0; FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_term_interface) - + if (H5_interface_initialize_g) { if ((n=H5I_nmembers(H5I_ATTR))>0) { (void)H5I_clear_type(H5I_ATTR, FALSE); @@ -135,7 +135,7 @@ H5A_term_interface(void) hid_t plist_id; IN: ID of creation property list (currently not used) RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION @@ -158,7 +158,7 @@ H5A_term_interface(void) * Modifications: * Robb Matzke, 5 Jun 1998 * The LOC_ID can also be a committed datatype. - * + * --------------------------------------------------------------------------*/ /* ARGSUSED */ hid_t @@ -197,7 +197,7 @@ done: /*------------------------------------------------------------------------- * Function: H5A_create * - * Purpose: + * Purpose: * This is the guts of the H5Acreate function. * Usage: * hid_t H5A_create (ent, name, type, space) @@ -297,7 +297,7 @@ H5A_create(const H5G_entry_t *ent, const char *name, const H5T_t *type, attr->ent_opened=1; /* Create the attribute message and save the attribute index */ - if (H5O_modify(&(attr->ent), H5O_ATTR_ID, H5O_NEW_MESG, 0, H5O_UPDATE_TIME, attr, dxpl_id) < 0) + if (H5O_modify(&(attr->ent), H5O_ATTR_ID, H5O_NEW_MESG, 0, H5O_UPDATE_TIME, attr, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to update attribute header messages") /* Register the new attribute and get an ID for it */ @@ -329,7 +329,7 @@ done: void *op_data; IN: Op data passed in RETURNS Non-negative on success, negative on failure - + ERRORS DESCRIPTION @@ -374,7 +374,7 @@ H5A_find_idx_by_name(const void *_mesg, unsigned idx, void *_op_data) const char *name; IN: Name of dataset to find RETURNS non-negative on success, negative on failure - + ERRORS DESCRIPTION @@ -419,7 +419,7 @@ done: const char *name; IN: Name of attribute to locate and open RETURNS ID of attribute on success, negative on failure - + ERRORS DESCRIPTION @@ -459,7 +459,7 @@ H5Aopen_name(hid_t loc_id, const char *name) /* Go do the real work for opening the attribute */ if ((ret_value=H5A_open(ent, (unsigned)idx, H5AC_dxpl_id))<0) HGOTO_ERROR (H5E_ATTR, H5E_CANTINIT, FAIL, "unable to open attribute") - + done: FUNC_LEAVE_API(ret_value) } /* H5Aopen_name() */ @@ -476,7 +476,7 @@ done: unsigned idx; IN: Index (0-based) attribute to open RETURNS ID of attribute on success, negative on failure - + ERRORS DESCRIPTION @@ -490,7 +490,7 @@ done: * Modifications: * Robb Matzke, 5 Jun 1998 * The LOC_ID can also be a named (committed) datatype. - * + * --------------------------------------------------------------------------*/ hid_t H5Aopen_idx(hid_t loc_id, unsigned idx) @@ -510,7 +510,7 @@ H5Aopen_idx(hid_t loc_id, unsigned idx) /* Go do the real work for opening the attribute */ if ((ret_value=H5A_open(ent, idx, H5AC_dxpl_id))<0) HGOTO_ERROR (H5E_ATTR, H5E_CANTINIT, FAIL, "unable to open attribute") - + done: FUNC_LEAVE_API(ret_value) } /* H5Aopen_idx() */ @@ -519,7 +519,7 @@ done: /*------------------------------------------------------------------------- * Function: H5A_open * - * Purpose: + * Purpose: * This is the guts of the H5Aopen_xxx functions * Usage: * herr_t H5A_open (ent, idx) @@ -554,7 +554,7 @@ H5A_open(H5G_entry_t *ent, unsigned idx, hid_t dxpl_id) if (NULL==(attr=H5O_read(ent, H5O_ATTR_ID, (int)idx, NULL, dxpl_id))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to load attribute info from dataset header") attr->initialized=1; - + /* Deep copy of the symbol table entry */ if (H5G_ent_copy(&(attr->ent),ent,H5G_COPY_DEEP)<0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to copy entry") @@ -590,7 +590,7 @@ done: const void *buf; IN: Buffer of data to write RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION @@ -635,7 +635,7 @@ done: const void *buf; IN: Buffer of data to write RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION @@ -720,7 +720,7 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) HGOTO_ERROR(H5E_ATTR, H5E_BADVALUE, FAIL, "attribute not found") /* Modify the attribute data */ - if (H5O_modify(&(attr->ent), H5O_ATTR_ID, idx, 0, H5O_UPDATE_DATA_ONLY|H5O_UPDATE_TIME, attr, dxpl_id) < 0) + if (H5O_modify(&(attr->ent), H5O_ATTR_ID, idx, 0, H5O_UPDATE_DATA_ONLY|H5O_UPDATE_TIME, attr, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to update attribute header messages") } /* end if */ @@ -729,9 +729,9 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) done: /* Release resources */ - if (src_id >= 0) + if (src_id >= 0) (void)H5I_dec_ref(src_id); - if (dst_id >= 0) + if (dst_id >= 0) (void)H5I_dec_ref(dst_id); if (bkg_buf) H5FL_BLK_FREE(attr_buf, bkg_buf); @@ -752,7 +752,7 @@ done: void *buf; IN: Buffer for data to read RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION @@ -797,7 +797,7 @@ done: void *buf; IN: Buffer for data to read RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION @@ -876,9 +876,9 @@ H5A_read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) done: /* Release resources */ - if (src_id >= 0) + if (src_id >= 0) (void)H5I_dec_ref(src_id); - if (dst_id >= 0) + if (dst_id >= 0) (void)H5I_dec_ref(dst_id); if (tconv_buf) H5FL_BLK_FREE(attr_buf, tconv_buf); @@ -899,7 +899,7 @@ done: hid_t attr_id; IN: Attribute to get dataspace of RETURNS A dataspace ID on success, negative on failure - + ERRORS DESCRIPTION @@ -944,7 +944,7 @@ done: hid_t attr_id; IN: Attribute to get datatype of RETURNS A datatype ID on success, negative on failure - + ERRORS DESCRIPTION @@ -986,7 +986,7 @@ H5Aget_type(hid_t attr_id) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid datatype location") if (H5T_lock(dst, FALSE)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to lock transient datatype") - + /* Atomize */ if ((ret_value=H5I_register(H5I_DATATYPE, dst))<0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype atom") @@ -1014,7 +1014,7 @@ done: RETURNS This function returns the length of the attribute's name (which may be longer than 'buf_size') on success or negative for failure. - + ERRORS DESCRIPTION @@ -1067,10 +1067,10 @@ done: * Function: H5Aget_storage_size * * Purpose: Returns the amount of storage size that is required for this - * attribute. + * attribute. * * Return: Success: The amount of storage size allocated for the - * attribute. The return value may be zero + * attribute. The return value may be zero * if no data has been stored. * * Failure: Zero @@ -1087,7 +1087,7 @@ H5Aget_storage_size(hid_t attr_id) { H5A_t *attr=NULL; hsize_t ret_value; /* Return value */ - + FUNC_ENTER_API(H5Aget_storage_size, 0) H5TRACE1("h","i",attr_id); @@ -1106,12 +1106,12 @@ done: /*------------------------------------------------------------------------- * Function: H5A_get_storage_size * - * Purpose: Private function for H5Aget_storage_size. Returns the + * Purpose: Private function for H5Aget_storage_size. Returns the * amount of storage size that is required for this - * attribute. + * attribute. * * Return: Success: The amount of storage size allocated for the - * attribute. The return value may be zero + * attribute. The return value may be zero * if no data has been stored. * * Failure: Zero @@ -1127,7 +1127,7 @@ static hsize_t H5A_get_storage_size(const H5A_t *attr) { hsize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_get_storage_size) /* Set return value */ @@ -1135,7 +1135,7 @@ H5A_get_storage_size(const H5A_t *attr) FUNC_LEAVE_NOAPI(ret_value) } - + /*-------------------------------------------------------------------------- NAME @@ -1147,7 +1147,7 @@ H5A_get_storage_size(const H5A_t *attr) hid_t loc_id; IN: Object (dataset or group) to be queried RETURNS Number of attributes on success, negative on failure - + ERRORS DESCRIPTION @@ -1199,9 +1199,9 @@ done: /*------------------------------------------------------------------------- * Function: H5Arename * - * Purpose: Rename an attribute + * Purpose: Rename an attribute * - * Return: Success: Non-negative + * Return: Success: Non-negative * * Failure: Negative * @@ -1217,7 +1217,7 @@ H5Arename(hid_t loc_id, const char *old_name, const char *new_name) { H5G_entry_t *ent = NULL; /*symtab ent of object to attribute */ herr_t ret_value; /* Return value */ - + FUNC_ENTER_API(H5Arename, FAIL) H5TRACE3("e","iss",loc_id,old_name,new_name); @@ -1240,9 +1240,9 @@ done: /*------------------------------------------------------------------------- * Function: H5A_rename * - * Purpose: Private function for H5Arename. Rename an attribute + * Purpose: Private function for H5Arename. Rename an attribute * - * Return: Success: Non-negative + * Return: Success: Non-negative * * Failure: Negative * @@ -1259,14 +1259,14 @@ H5A_rename(H5G_entry_t *ent, const char *old_name, const char *new_name, hid_t d int seq, idx=FAIL; /* Index of attribute being querried */ H5A_t found_attr; /* Attribute with OLD_NAME */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5A_rename) /* Check arguments */ assert(ent); assert(old_name); assert(new_name); - + /* Read in the existing attributes to check for duplicates */ seq=0; while(H5O_read(ent, H5O_ATTR_ID, seq, &found_attr, dxpl_id)!=NULL) { @@ -1284,12 +1284,12 @@ H5A_rename(H5G_entry_t *ent, const char *old_name, const char *new_name, hid_t d H5E_clear_stack(NULL); if(idx<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "attribute cannot be found") - + /* Copy the attribute name. */ if(found_attr.name) HDfree(found_attr.name); - found_attr.name = HDstrdup(new_name); - if(!found_attr.name) + found_attr.name = HDstrdup(new_name); + if(!found_attr.name) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "String copy failed") /* Indicate entry is not opened and the attribute doesn't need fill-values. */ @@ -1297,9 +1297,9 @@ H5A_rename(H5G_entry_t *ent, const char *old_name, const char *new_name, hid_t d found_attr.initialized=TRUE; /* Modify the attribute message */ - if (H5O_modify(ent, H5O_ATTR_ID, idx, 0, H5O_UPDATE_TIME, &found_attr, dxpl_id) < 0) + if (H5O_modify(ent, H5O_ATTR_ID, idx, 0, H5O_UPDATE_TIME, &found_attr, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to update attribute header messages") - + /* Close the attribute */ if(H5A_free(&found_attr)<0) HGOTO_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "unable to close renamed attribute") @@ -1323,7 +1323,7 @@ done: RETURNS Returns a negative value if something is wrong, the return value of the last operator if it was non-zero, or zero if all attributes were processed. - + ERRORS DESCRIPTION @@ -1337,7 +1337,7 @@ done: over ('loc_id'), the name of the current attribute about the object ('attr_name') and the pointer to the operator data passed in to H5Aiterate ('op_data'). The return values from an operator are: - A. Zero causes the iterator to continue, returning zero when all + A. Zero causes the iterator to continue, returning zero when all attributes have been processed. B. Positive causes the iterator to immediately return that positive value, indicating short-circuit success. The iterator can be @@ -1353,7 +1353,7 @@ done: * Robb Matzke, 5 Jun 1998 * Like the group iterator, if ATTR_NUM is the null pointer then all * attributes are processed. - * + * --------------------------------------------------------------------------*/ herr_t H5Aiterate(hid_t loc_id, unsigned *attr_num, H5A_operator_t op, void *op_data) @@ -1418,19 +1418,19 @@ done: const char *name; IN: Name of attribute to delete RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION This function removes the named attribute from a dataset or group. This function should not be used when attribute IDs are open on 'loc_id' - as it may cause the internal indexes of the attributes to change and future + as it may cause the internal indexes of the attributes to change and future writes to the open attributes to produce incorrect results. * * Modifications: * Robb Matzke, 5 Jun 1998 * The LOC_ID can also be a named (committed) datatype. - * + * --------------------------------------------------------------------------*/ herr_t H5Adelete(hid_t loc_id, const char *name) @@ -1457,7 +1457,7 @@ H5Adelete(hid_t loc_id, const char *name) /* Delete the attribute from the location */ if ((ret_value=H5O_remove(ent, H5O_ATTR_ID, found, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute header message") - + done: FUNC_LEAVE_API(ret_value) } /* H5Adelete() */ @@ -1473,7 +1473,7 @@ done: hid_t attr_id; IN: Attribute to release access to RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION @@ -1563,7 +1563,7 @@ H5A_copy(H5A_t *_new_attr, const H5A_t *old_attr, unsigned update_flags) /* Set the return value */ ret_value=new_attr; - + done: if(ret_value==NULL) { if(new_attr!=NULL && allocated_attr) @@ -1618,7 +1618,7 @@ done: /*------------------------------------------------------------------------- * Function: H5A_close * - * Purpose: Frees an attribute and all associated memory. + * Purpose: Frees an attribute and all associated memory. * * Return: Non-negative on success/Negative on failure * @@ -1662,7 +1662,7 @@ H5A_close(H5A_t *attr) HGOTO_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't release object header info") H5FL_FREE(H5A_t, attr); - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_close() */ @@ -32,7 +32,7 @@ * Turned on "H5AC_SORT_BY_ADDR" * * John Mainzer, 5/19/04 - * Complete redesign and rewrite. See the header comments for + * Complete redesign and rewrite. See the header comments for * H5AC_t for an overview of what is going on. * * John Mainzer, 6/4/04 @@ -86,7 +86,7 @@ hid_t H5AC_ind_dxpl_id=(-1); * Private file-scope function declarations: */ -static herr_t H5AC_check_if_write_permitted(const H5F_t *f, +static herr_t H5AC_check_if_write_permitted(const H5F_t *f, hid_t dxpl_id, hbool_t * write_permitted_ptr); @@ -318,10 +318,10 @@ H5AC_term_interface(void) * Modifications: * * Complete re-design and re-write to support the re-designed - * metadata cache. + * metadata cache. * - * At present, the size_hint is ignored, and the - * max_cache_size and min_clean_size fields are hard + * At present, the size_hint is ignored, and the + * max_cache_size and min_clean_size fields are hard * coded. This should be fixed, but a parameter * list change will be required, so I will leave it * for now. @@ -331,17 +331,17 @@ H5AC_term_interface(void) * JRM - 4/28/04 * * Reworked the function again after abstracting its guts to - * the similar function in H5C.c. The function is now a + * the similar function in H5C.c. The function is now a * wrapper for H5C_create(). * JRM - 6/4/04 * - * Deleted the old size_hint parameter and added the + * Deleted the old size_hint parameter and added the * max_cache_size, and min_clean_size parameters. * * JRM - 3/10/05 * * Deleted the max_cache_size, and min_clean_size parameters, - * and added the config_ptr parameter. Added code to + * and added the config_ptr parameter. Added code to * validate the resize configuration before we do anything. * * JRM - 3/24/05 @@ -371,7 +371,7 @@ static const char * H5AC_entry_type_names[H5AC_NTYPES] = }; herr_t -H5AC_create(const H5F_t *f, +H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -390,7 +390,7 @@ H5AC_create(const H5F_t *f, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad cache configuration"); } - /* The default max cache size and min clean size will frequently be + /* The default max cache size and min clean size will frequently be * overwritten shortly by the subsequent set resize config call. * -- JRM */ @@ -437,14 +437,14 @@ done: * Modifications: * * Complete re-design and re-write to support the re-designed - * metadata cache. + * metadata cache. * JRM - 5/12/04 * * Abstracted the guts of the function to H5C_dest() in H5C.c, * and then re-wrote the function as a wrapper for H5C_dest(). * * JRM - 6/7/04 - * + * *------------------------------------------------------------------------- */ herr_t @@ -477,34 +477,34 @@ done: * Function: H5AC_flush * * Purpose: Flush (and possibly destroy) the metadata cache associated - * with the specified file. + * with the specified file. * * This is a re-write of an earlier version of the function * which was reputedly capable of flushing (and destroying - * if requested) individual entries, individual entries if - * they match the supplied type, all entries of a given type, - * as well as all entries in the cache. + * if requested) individual entries, individual entries if + * they match the supplied type, all entries of a given type, + * as well as all entries in the cache. * * As only this last capability is actually used at present, - * I have not implemented the other capabilities in this - * version of the function. + * I have not implemented the other capabilities in this + * version of the function. * - * The type and addr parameters are retained to avoid source - * code changed, but values other than NULL and HADDR_UNDEF - * respectively are errors. If all goes well, they should + * The type and addr parameters are retained to avoid source + * code changed, but values other than NULL and HADDR_UNDEF + * respectively are errors. If all goes well, they should * be removed, and the function renamed to something more * descriptive -- perhaps H5AC_flush_cache. * * If the cache contains protected entries, the function will - * fail, as protected entries cannot be flushed. However - * all unprotected entries should be flushed before the + * fail, as protected entries cannot be flushed. However + * all unprotected entries should be flushed before the * function returns failure. - * - * For historical purposes, the original version of the + * + * For historical purposes, the original version of the * purpose section is reproduced below: * * ============ Original Version of "Purpose:" ============ - * + * * Flushes (and destroys if DESTROY is non-zero) the specified * entry from the cache. If the entry TYPE is CACHE_FREE and * ADDR is HADDR_UNDEF then all types of entries are @@ -547,10 +547,10 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id, unsigned flags) HDassert(f); HDassert(f->shared->cache); - status = H5C_flush_cache(f, - dxpl_id, - H5AC_noblock_dxpl_id, - f->shared->cache, + status = H5C_flush_cache(f, + dxpl_id, + H5AC_noblock_dxpl_id, + f->shared->cache, flags); if ( status < 0 ) { @@ -597,16 +597,16 @@ done: * at the beginning of the function. * * JRM - 6/7/04 - * Abstracted the guts of the function to H5C_insert_entry() - * in H5C.c, and then re-wrote the function as a wrapper for + * Abstracted the guts of the function to H5C_insert_entry() + * in H5C.c, and then re-wrote the function as a wrapper for * H5C_insert_entry(). * * JRM - 1/6/05 * Added the flags parameter. At present, this parameter is * only used to set the new flush_marker field on the new * entry. Since this doesn't apply to the SAP code, no change - * is needed there. Thus the only change to the body of the - * code is to pass the flags parameter through to + * is needed there. Thus the only change to the body of the + * code is to pass the flags parameter through to * H5C_insert_entry(). * * JRM - 6/6/05 @@ -659,7 +659,7 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void * lf = f->shared->lf; if ( H5FD_is_fphdf5_driver(lf) ) { - + /* Newly inserted entry are presumed to be dirty */ info->is_dirty = TRUE; @@ -667,7 +667,7 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void * * This is the FPHDF5 driver. Grab a lock for this piece of * metadata from the SAP. Bail-out quickly if we're unable to do * that. In the case of the FPHDF5 driver, the local cache is - * turned off. We lock the address then write the data to the SAP. + * turned off. We lock the address then write the data to the SAP. * We do this because the cache is off and thus cannot retain the * data which has just been added to it. We will get it from the * SAP as needed in the future. @@ -719,7 +719,7 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void * result = H5C_insert_entry(f, dxpl_id, - H5AC_noblock_dxpl_id, + H5AC_noblock_dxpl_id, cache, type, addr, @@ -762,8 +762,8 @@ done: * Complete rewrite for the new meta-data cache. * * JRM - 6/7/04 - * Abstracted the guts of the function to H5C_rename_entry() - * in H5C.c, and then re-wrote the function as a wrapper for + * Abstracted the guts of the function to H5C_rename_entry() + * in H5C.c, and then re-wrote the function as a wrapper for * H5C_rename_entry(). * *------------------------------------------------------------------------- @@ -785,7 +785,7 @@ H5AC_rename(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_ad #ifdef H5_HAVE_PARALLEL #ifdef H5_HAVE_FPHDF5 - /* In the flexible parallel case, the cache is always empty. + /* In the flexible parallel case, the cache is always empty. * Thus H5AC_rename() has nothing to do by definition. */ { @@ -837,7 +837,7 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_protect * - * Purpose: If the target entry is not in the cache, load it. If + * Purpose: If the target entry is not in the cache, load it. If * necessary, attempt to evict one or more entries to keep * the cache within its maximum size. * @@ -845,8 +845,8 @@ done: * to the caller. The caller must call H5AC_unprotect() when * finished with the entry. * - * While it is protected, the entry may not be either evicted - * or flushed -- nor may it be accessed by another call to + * While it is protected, the entry may not be either evicted + * or flushed -- nor may it be accessed by another call to * H5AC_protect. Any attempt to do so will result in a failure. * * This comment is a re-write of the original Purpose: section. @@ -887,19 +887,19 @@ done: * Purpose section above. * * JRM - 6/7/04 - * Abstracted the guts of the function to H5C_protect() - * in H5C.c, and then re-wrote the function as a wrapper for + * Abstracted the guts of the function to H5C_protect() + * in H5C.c, and then re-wrote the function as a wrapper for * H5C_protect(). * *------------------------------------------------------------------------- */ void * -H5AC_protect(H5F_t *f, - hid_t dxpl_id, - const H5AC_class_t *type, +H5AC_protect(H5F_t *f, + hid_t dxpl_id, + const H5AC_class_t *type, haddr_t addr, - const void *udata1, - void *udata2, + const void *udata1, + void *udata2, H5AC_protect_t #ifndef H5_HAVE_FPHDF5 UNUSED @@ -957,7 +957,7 @@ H5AC_protect(H5F_t *f, * by some other process, we can loop and wait or bail * out of this function */ - HDfprintf(stderr, + HDfprintf(stderr, "Couldn't get lock for metadata at address %a\n", addr); #endif /* 0 */ @@ -966,7 +966,7 @@ H5AC_protect(H5F_t *f, } /* Load a thing from the SAP. */ - if ( NULL == (thing = type->load(f, dxpl_id, addr, + if ( NULL == (thing = type->load(f, dxpl_id, addr, udata1, udata2)) ) { #if 0 @@ -985,7 +985,7 @@ H5AC_protect(H5F_t *f, HGOTO_DONE(NULL) } - + info = (H5AC_info_t *)thing; HDassert(info->is_dirty == FALSE); @@ -1000,7 +1000,7 @@ H5AC_protect(H5F_t *f, "Can't get size of thing") } - HDassert(info->size < H5C_MAX_ENTRY_SIZE); + HDassert(info->size < H5C_MAX_ENTRY_SIZE); info->next = NULL; info->prev = NULL; @@ -1015,7 +1015,7 @@ H5AC_protect(H5F_t *f, thing = H5C_protect(f, dxpl_id, - H5AC_noblock_dxpl_id, + H5AC_noblock_dxpl_id, f->shared->cache, type, addr, @@ -1045,15 +1045,15 @@ done: * and give it back to the replacement policy. * * The TYPE and ADDR arguments must be the same as those in - * the corresponding call to H5AC_protect() and the THING - * argument must be the value returned by that call to + * the corresponding call to H5AC_protect() and the THING + * argument must be the value returned by that call to * H5AC_protect(). * * If the deleted flag is TRUE, simply remove the target entry - * from the cache, clear it, and free it without writing it to + * from the cache, clear it, and free it without writing it to * disk. * - * This verion of the function is a complete re-write to + * This verion of the function is a complete re-write to * use the new metadata cache. While there isn't all that * much difference between the old and new Purpose sections, * the original version is given below. @@ -1092,20 +1092,20 @@ done: * Complete re-write for the new metadata cache. * * JRM - 6/7/04 - * Abstracted the guts of the function to H5C_unprotect() - * in H5C.c, and then re-wrote the function as a wrapper for + * Abstracted the guts of the function to H5C_unprotect() + * in H5C.c, and then re-wrote the function as a wrapper for * H5C_unprotect(). - * + * * JRM - 1/6/05 * Replaced the deleted parameter with the new flags parameter. * Since the deleted parameter is not used by the FPHDF5 code, - * the only change in the body is to replace the deleted - * parameter with the flags parameter in the call to + * the only change in the body is to replace the deleted + * parameter with the flags parameter in the call to * H5C_unprotect(). * * JRM - 6/6/05 - * Added the dirtied flag and supporting code. This is - * part of a collection of changes directed at moving + * Added the dirtied flag and supporting code. This is + * part of a collection of changes directed at moving * management of cache entry dirty flags into the H5C code. * *------------------------------------------------------------------------- @@ -1152,7 +1152,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, ((H5AC_info_t *)thing)->is_protected = FALSE; /* mark the entry as dirty if appropriate. JRM - 6/6/05 */ - ((H5AC_info_t *)thing)->is_dirty |= + ((H5AC_info_t *)thing)->is_dirty |= (flags & H5AC__DIRTIED_FLAG) ? TRUE : FALSE; /* @@ -1160,7 +1160,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, * (deleted == TRUE), we need to send a request to the SAP * telling it to remove that bit of metadata from its cache. */ - /* the deleted parameter has been replaced with the flags + /* the deleted parameter has been replaced with the flags * parameter. The actual value of deleted is still passed * in as a bit in flags. If it is needed, it can be extracted * as follows: @@ -1204,7 +1204,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, result = H5C_unprotect(f, dxpl_id, - H5AC_noblock_dxpl_id, + H5AC_noblock_dxpl_id, f->shared->cache, type, addr, @@ -1239,8 +1239,8 @@ done: * Re-write to support the new metadata cache. * * JRM - 6/7/04 - * Abstracted the guts of the function to H5C_stats() - * in H5C.c, and then re-wrote the function as a wrapper for + * Abstracted the guts of the function to H5C_stats() + * in H5C.c, and then re-wrote the function as a wrapper for * H5C_stats(). * *------------------------------------------------------------------------- @@ -1334,7 +1334,7 @@ H5AC_get_cache_auto_resize_config(H5AC_t * cache_ptr, config_ptr->decrement = internal_config.decrement; config_ptr->apply_max_decrement = internal_config.apply_max_decrement; config_ptr->max_decrement = internal_config.max_decrement; - config_ptr->epochs_before_eviction = + config_ptr->epochs_before_eviction = (int)(internal_config.epochs_before_eviction); config_ptr->apply_empty_reserve = internal_config.apply_empty_reserve; config_ptr->empty_reserve = internal_config.empty_reserve; @@ -1522,7 +1522,7 @@ H5AC_set_cache_auto_resize_config(H5AC_t * cache_ptr, if ( ( config_ptr->rpt_fcn_enabled != TRUE ) && ( config_ptr->rpt_fcn_enabled != FALSE ) ) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->rpt_fcn_enabled must be either TRUE or FALSE.") } @@ -1536,13 +1536,13 @@ H5AC_set_cache_auto_resize_config(H5AC_t * cache_ptr, internal_config.rpt_fcn = NULL; } - + internal_config.set_initial_size = config_ptr->set_initial_size; internal_config.initial_size = config_ptr->initial_size; internal_config.min_clean_fraction = config_ptr->min_clean_fraction; internal_config.max_size = config_ptr->max_size; internal_config.min_size = config_ptr->min_size; - internal_config.epoch_length = + internal_config.epoch_length = (int64_t)(config_ptr->epoch_length); internal_config.incr_mode = config_ptr->incr_mode; @@ -1556,12 +1556,12 @@ H5AC_set_cache_auto_resize_config(H5AC_t * cache_ptr, internal_config.decrement = config_ptr->decrement; internal_config.apply_max_decrement = config_ptr->apply_max_decrement; internal_config.max_decrement = config_ptr->max_decrement; - internal_config.epochs_before_eviction = + internal_config.epochs_before_eviction = (int32_t)(config_ptr->epochs_before_eviction); internal_config.apply_empty_reserve = config_ptr->apply_empty_reserve; internal_config.empty_reserve = config_ptr->empty_reserve; - result = H5C_set_cache_auto_resize_config((H5C_t *)cache_ptr, + result = H5C_set_cache_auto_resize_config((H5C_t *)cache_ptr, &internal_config); if ( result < 0 ) { @@ -1579,7 +1579,7 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_validate_config() * - * Purpose: Run a sanity check on the contents of the supplied + * Purpose: Run a sanity check on the contents of the supplied * instance of H5AC_cache_config_t. * * Do nothing and return SUCCEED if no errors are detected, @@ -1587,7 +1587,7 @@ done: * * At present, this function operates by packing the data * from the instance of H5AC_cache_config_t into an instance - * of H5C_auto_size_ctl_t, and then calling + * of H5C_auto_size_ctl_t, and then calling * H5C_validate_resize_config(). As H5AC_cache_config_t and * H5C_auto_size_ctl_t diverge, we may have to change this. * @@ -1640,13 +1640,13 @@ H5AC_validate_config(H5AC_cache_config_t * config_ptr) internal_config.rpt_fcn = NULL; } - + internal_config.set_initial_size = config_ptr->set_initial_size; internal_config.initial_size = config_ptr->initial_size; internal_config.min_clean_fraction = config_ptr->min_clean_fraction; internal_config.max_size = config_ptr->max_size; internal_config.min_size = config_ptr->min_size; - internal_config.epoch_length = + internal_config.epoch_length = (int64_t)(config_ptr->epoch_length); internal_config.incr_mode = config_ptr->incr_mode; @@ -1660,7 +1660,7 @@ H5AC_validate_config(H5AC_cache_config_t * config_ptr) internal_config.decrement = config_ptr->decrement; internal_config.apply_max_decrement = config_ptr->apply_max_decrement; internal_config.max_decrement = config_ptr->max_decrement; - internal_config.epochs_before_eviction = + internal_config.epochs_before_eviction = (int32_t)(config_ptr->epochs_before_eviction); internal_config.apply_empty_reserve = config_ptr->apply_empty_reserve; internal_config.empty_reserve = config_ptr->empty_reserve; @@ -1688,10 +1688,10 @@ done: * * Function: H5AC_check_if_write_permitted * - * Purpose: Determine if a write is permitted under the current - * circumstances, and set *write_permitted_ptr accordingly. - * As a general rule it is, but when we are running in parallel - * mode with collective I/O, we must ensure that a read cannot + * Purpose: Determine if a write is permitted under the current + * circumstances, and set *write_permitted_ptr accordingly. + * As a general rule it is, but when we are running in parallel + * mode with collective I/O, we must ensure that a read cannot * cause a write. * * In the event of failure, the value of *write_permitted_ptr diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 3d35028..450907f 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -53,8 +53,8 @@ #define H5AC_BPT_LEAF_ID 11 /*B+ tree leaf */ #define H5AC_NTYPES 12 -/* H5AC_DUMP_STATS_ON_CLOSE should always be FALSE when - * H5C_COLLECT_CACHE_STATS is FALSE. +/* H5AC_DUMP_STATS_ON_CLOSE should always be FALSE when + * H5C_COLLECT_CACHE_STATS is FALSE. * * When H5C_COLLECT_CACHE_STATS is TRUE, H5AC_DUMP_STATS_ON_CLOSE must * be FALSE for "make check" to succeed, but may be set to TRUE at other @@ -208,7 +208,7 @@ extern hid_t H5AC_ind_dxpl_id; */ /* #defines of flags used in the flags parameters in some of the - * following function calls. Note that they are just copies of + * following function calls. Note that they are just copies of * the equivalent flags from H5Cprivate.h. */ @@ -224,12 +224,12 @@ extern hid_t H5AC_ind_dxpl_id; H5_DLL herr_t H5AC_init(void); H5_DLL herr_t H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr); -H5_DLL herr_t H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, +H5_DLL herr_t H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned int flags); H5_DLL void *H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, const void *udata1, void *udata2, H5AC_protect_t rw); -H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id, +H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned flags); H5_DLL herr_t H5AC_flush(H5F_t *f, hid_t dxpl_id, unsigned flags); diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h index f8f3b6d..2381ccc 100644 --- a/src/H5ACpublic.h +++ b/src/H5ACpublic.h @@ -55,7 +55,7 @@ extern "C" { * version number, or an error will be flagged. * * rpt_fcn_enabled: Boolean field used to enable and disable the default - * reporting function. This function is invoked every time the + * reporting function. This function is invoked every time the * automatic cache resize code is run, and reports on its activities. * * This is a debugging function, and should normally be turned off. @@ -47,7 +47,7 @@ * e. left[x] is a pointer to the node's left sibling * or the null pointer if this is the left-most * node at this level in the tree. - * + * * f. right[x] is a pointer to the node's right * sibling or the null pointer if this is the * right-most node at this level in the tree. @@ -251,7 +251,7 @@ H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, void *udata, #ifdef H5B_DEBUG H5B_assert(f, dxpl_id, *addr_p, shared->type, udata); #endif - + done: if (ret_value<0) { if(shared && shared->sizeof_rnode>0) { @@ -261,7 +261,7 @@ done: if (bt) (void)H5B_dest(f,bt); } - + FUNC_LEAVE_NOAPI(ret_value) } /*lint !e818 Can't make udata a pointer to const */ @@ -580,7 +580,7 @@ H5B_clear(H5F_t *f, H5B_t *bt, hbool_t destroy) /* Reset the dirty flag. */ bt->cache_info.is_dirty = FALSE; - + if (destroy) if (H5B_dest(f, bt) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node") @@ -593,8 +593,8 @@ done: /*------------------------------------------------------------------------- * Function: H5B_compute_size * - * Purpose: Compute the size in bytes of the specified instance of - * H5B_t on disk, and return it in *len_ptr. On failure, + * Purpose: Compute the size in bytes of the specified instance of + * H5B_t on disk, and return it in *len_ptr. On failure, * the value of *len_ptr is undefined. * * Return: Non-negative on success/Negative on failure @@ -713,7 +713,7 @@ H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *u #else /* OLD_WAY */ HGOTO_DONE(FAIL) #endif /* OLD_WAY */ - + /* * Follow the link to the subtree or to the data node. */ @@ -782,8 +782,8 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new - * old_bt_dirtied_ptr parameter to the function's argument + * In this case, that required adding the new + * old_bt_dirtied_ptr parameter to the function's argument * list. * *------------------------------------------------------------------------- @@ -870,7 +870,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, unsigned *old_bt_flags, if (H5DEBUG(B)) fprintf(H5DEBUG(B), " split %3d/%-3d\n", nleft, nright); #endif - + /* * Create the new B-tree node. */ @@ -883,9 +883,9 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, unsigned *old_bt_flags, /* * Copy data from the old node to the new node. */ - + /* this function didn't used to mark the new bt entry as dirty. Since - * we just inserted the entry, this doesn't matter unless the entry + * we just inserted the entry, this doesn't matter unless the entry * somehow gets flushed between the insert and the protect. At present, * I don't think this can happen, but it doesn't hurt to mark the entry * dirty again. @@ -906,7 +906,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, unsigned *old_bt_flags, */ *old_bt_flags |= H5AC__DIRTIED_FLAG; old_bt->nchildren = nleft; - + /* * Update sibling pointers. */ @@ -921,7 +921,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, unsigned *old_bt_flags, tmp_bt->left = *new_addr_p; - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, old_bt->right, tmp_bt, + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, old_bt->right, tmp_bt, H5AC__DIRTIED_FLAG) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node") } @@ -929,7 +929,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, unsigned *old_bt_flags, old_bt->right = *new_addr_p; done: - if (new_bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_addr_p, new_bt, + if (new_bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_addr_p, new_bt, new_bt_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node") @@ -1020,14 +1020,14 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release new child") bt = NULL; - + /* the new node */ if (NULL == (bt = H5AC_protect(f, dxpl_id, H5AC_BT, child, type, udata, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load new node") if (!rt_key_changed) HDmemcpy(rt_key, H5B_NKEY(bt,shared,bt->nchildren), type->sizeof_nkey); - + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, child, bt, H5AC__NO_FLAGS_SET) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release new child") bt = NULL; @@ -1103,11 +1103,11 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, #ifdef H5B_DEBUG H5B_assert(f, dxpl_id, addr, type, udata); #endif - + done: FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5B_insert_child @@ -1137,7 +1137,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B_insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, +H5B_insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, haddr_t child, H5B_ins_t anchor, const void *md_key) { H5B_shared_t *shared; /* Pointer to shared B-tree info */ @@ -1476,7 +1476,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type if (H5B_insert_child(tmp_bt, tmp_bt_flags_ptr, idx, child_addr, my_ins, md_key) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert child") } - + /* * If this node split, return the mid key (the one that is shared * by the left and right node). @@ -1499,9 +1499,9 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type done: { - herr_t e1 = (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, + herr_t e1 = (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, bt_flags) < 0); - herr_t e2 = (twin && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_node_p, + herr_t e2 = (twin && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_node_p, twin, twin_flags)<0); if (e1 || e2) /*use vars to prevent short-circuit of side effects */ HDONE_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node(s)") @@ -1554,7 +1554,7 @@ H5B_iterate (H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, H5B_operator_t op unsigned level; haddr_t left_child; herr_t ret_value; - + FUNC_ENTER_NOAPI(H5B_iterate, FAIL) /* @@ -1677,7 +1677,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type unsigned idx=0, lt=0, rt; /* Final, left & right indices */ int cmp=1; /* Key comparison value */ H5B_ins_t ret_value = H5B_INS_ERROR; - + FUNC_ENTER_NOAPI(H5B_remove_helper, H5B_INS_ERROR) assert(f); @@ -1809,7 +1809,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type sibling->right = bt->right; - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->left, sibling, + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->left, sibling, H5AC__DIRTIED_FLAG) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling=NULL; /* Make certain future references will be caught */ @@ -1823,7 +1823,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type sibling->left = bt->left; - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, H5AC__DIRTIED_FLAG) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling=NULL; /* Make certain future references will be caught */ @@ -1851,7 +1851,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type */ bt_flags |= H5AC__DIRTIED_FLAG; bt->nchildren -= 1; - + HDmemmove(bt->native, bt->native + type->sizeof_nkey, (bt->nchildren+1) * type->sizeof_nkey); @@ -1885,7 +1885,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type HDmemcpy(H5B_NKEY(sibling,shared,0), H5B_NKEY(bt,shared,bt->nchildren), type->sizeof_nkey); - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, H5AC__DIRTIED_FLAG) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling=NULL; /* Make certain future references will be caught */ @@ -1904,7 +1904,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type */ bt_flags |= H5AC__DIRTIED_FLAG; bt->nchildren -= 1; - + HDmemmove(bt->native + idx * type->sizeof_nkey, bt->native + (idx+1) * type->sizeof_nkey, (bt->nchildren+1-idx) * type->sizeof_nkey); @@ -1912,7 +1912,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type bt->child+idx+1, (bt->nchildren-idx) * sizeof(haddr_t)); ret_value = H5B_INS_NOOP; - + } else { ret_value = H5B_INS_NOOP; } @@ -1962,7 +1962,7 @@ H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void unsigned bt_flags = H5AC__NO_FLAGS_SET; H5B_t *bt = NULL; /*btree node */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5B_remove, FAIL) /* Check args */ @@ -1987,7 +1987,7 @@ H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void bt->level = 0; bt_flags |= H5AC__DIRTIED_FLAG; } - + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, bt_flags) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release node") bt=NULL; /* Make certain future references will be caught */ @@ -2027,7 +2027,7 @@ H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void H5B_shared_t *shared; /* Pointer to shared B-tree info */ unsigned u; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5B_delete, FAIL) /* Check args */ @@ -2067,7 +2067,7 @@ H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void /* Delete this node from disk */ if (H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, addr, (hsize_t)shared->sizeof_rnode)<0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree node") - + done: if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5C__DELETED_FLAG)<0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node in cache") @@ -2283,7 +2283,7 @@ H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f HDfprintf(stream, "%*sChild %d...\n", indent, "", u); HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", MAX(0, fwidth - 3), "Address:", bt->child[u]); - + /* If there is a key debugging routine, use it to display the left & right keys */ if (type->debug_key) { /* Decode the 'left' key & print it */ @@ -67,25 +67,25 @@ static herr_t H5B2_split_root(H5F_t *f, hid_t dxpl_id, H5B2_t *bt2, static herr_t H5B2_redistribute2(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_internal_t *internal, unsigned idx); static herr_t H5B2_split2(H5F_t *f, hid_t dxpl_id, unsigned depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned * parent_cache_info_flags_ptr, + H5B2_node_ptr_t *curr_node_ptr, unsigned * parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); -static herr_t H5B2_split3(H5F_t *f, hid_t dxpl_id, unsigned depth, +static herr_t H5B2_split3(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags, H5B2_internal_t *internal, unsigned *internal_flags, unsigned idx); static herr_t H5B2_redistribute3(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); static herr_t H5B2_merge2(H5F_t *f, hid_t dxpl_id, unsigned depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, + H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); static herr_t H5B2_merge3(H5F_t *f, hid_t dxpl_id, unsigned depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, + H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); static herr_t H5B2_swap_leaf(H5F_t *f, hid_t dxpl_id, unsigned depth, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, + H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx, void *swap_loc); static herr_t H5B2_insert_internal(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, unsigned depth, H5AC_info_t *parent_cache_info, - unsigned *parent_cache_info_flags_ptr, + unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, void *udata); static herr_t H5B2_insert_leaf(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, H5B2_node_ptr_t *curr_node_ptr, void *udata); @@ -354,7 +354,7 @@ done: if (bt2) (void)H5B2_cache_hdr_dest(f,bt2); } /* end if */ - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5B2_create() */ @@ -854,7 +854,7 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new + * In this case, that required adding the new * parent_cache_info_dirtied_ptr and internal_dirtied_ptr * parameters to the function's argument list. * @@ -862,7 +862,7 @@ done: */ static herr_t H5B2_split2(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *curr_node_ptr, - unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, + unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ @@ -1135,8 +1135,8 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new - * internal_dirtied_ptr parameter to the function's + * In this case, that required adding the new + * internal_dirtied_ptr parameter to the function's * argument list. * *------------------------------------------------------------------------- @@ -1516,16 +1516,16 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new + * In this case, that required adding the new * parent_cache_info_dirtied_ptr and internal_dirtied_ptr * parameters to the function's argument list. * *------------------------------------------------------------------------- */ static herr_t -H5B2_split3(H5F_t *f, hid_t dxpl_id, unsigned depth, +H5B2_split3(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *curr_node_ptr, - unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, + unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ @@ -1711,7 +1711,7 @@ H5B2_split3(H5F_t *f, hid_t dxpl_id, unsigned depth, /* Move records from middle node to new node */ HDmemcpy(H5B2_NAT_NREC(new_native,shared,0),H5B2_NAT_NREC(middle_native,shared,(*middle_nrec-new_nrec_move)),shared->type->nrec_size*new_nrec_move); - + /* Move record from middle node up to parent node */ HDmemcpy(H5B2_INT_NREC(internal,shared,idx),H5B2_NAT_NREC(middle_native,shared,((*middle_nrec-new_nrec_move)-1)),shared->type->nrec_size); @@ -1856,14 +1856,14 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new + * In this case, that required adding the new * parent_cache_info_dirtied_ptr and internal_dirtied_ptr * parameters to the function's argument list. * *------------------------------------------------------------------------- */ static herr_t -H5B2_merge2(H5F_t *f, hid_t dxpl_id, unsigned depth, +H5B2_merge2(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) { @@ -2023,15 +2023,15 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new + * In this case, that required adding the new * parent_cache_info_dirtied_ptr and internal_dirtied_ptr * parameters to the function's argument list. * *------------------------------------------------------------------------- */ static herr_t -H5B2_merge3(H5F_t *f, hid_t dxpl_id, unsigned depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, +H5B2_merge3(H5F_t *f, hid_t dxpl_id, unsigned depth, + H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ @@ -2258,15 +2258,15 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new - * internal_dirtied_ptr parameter to the function's + * In this case, that required adding the new + * internal_dirtied_ptr parameter to the function's * argument list. * *------------------------------------------------------------------------- */ static herr_t H5B2_swap_leaf(H5F_t *f, hid_t dxpl_id, unsigned depth, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, + H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx, void *swap_loc) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ @@ -2457,7 +2457,7 @@ done: */ static herr_t H5B2_insert_internal(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, - unsigned depth, H5AC_info_t *parent_cache_info, + unsigned depth, H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, void *udata) { @@ -2648,7 +2648,7 @@ H5B2_insert(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, if(H5B2_split_root(f, dxpl_id, bt2, &bt2_flags, bt2->shared)<0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to split root node") } /* end if */ - + /* Attempt to insert record into B-tree */ if(bt2->depth>0) { if(H5B2_insert_internal(f,dxpl_id,bt2->shared,bt2->depth,&(bt2->cache_info),&bt2_flags,&bt2->root,udata)<0) @@ -2686,7 +2686,7 @@ done: * Modifications: * * John Mainzer, 6/15/05 - * Modified the function to avoid modifying the is_dirty + * Modified the function to avoid modifying the is_dirty * field of the cache info, as that field is now maintained * by the cache code. Since this function uses a call to * H5AC_set(), and that function presumes that the newly @@ -2767,7 +2767,7 @@ done: * Modifications: * * John Mainzer, 6/15/05 - * Modified the function to avoid modifying the is_dirty + * Modified the function to avoid modifying the is_dirty * field of the cache info, as that field is now maintained * by the cache code. Since this function uses a call to * H5AC_set(), and that function presumes that the newly @@ -3030,7 +3030,7 @@ done: * UDATA pointer depending on the type of leaf node * requested. The UDATA can point to additional data passed * to the key comparison function. - * + * * The 'OP' routine is called with the record found and the * OP_DATA pointer, to allow caller to return information about * the record. @@ -3189,7 +3189,7 @@ H5B2_find(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, if (H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } - + done: /* Check if we need to decrement the reference count for the B-tree's shared info */ if(incr_rc) @@ -3204,7 +3204,7 @@ done: * * Purpose: Locate the IDX'th record in a B-tree according to the * ordering used by the B-tree. The IDX values are 0-based. - * + * * The 'OP' routine is called with the record found and the * OP_DATA pointer, to allow caller to return information about * the record. @@ -3373,7 +3373,7 @@ H5B2_index(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, if (H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } - + done: /* Check if we need to decrement the reference count for the B-tree's shared info */ if(incr_rc) @@ -3458,7 +3458,7 @@ H5B2_remove_leaf(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, /* Release space for B-tree node on disk */ if (H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, leaf_addr, (hsize_t)shared->node_size)<0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree leaf node") - + /* Let the cache know that the object is deleted */ leaf_flags |= H5AC__DELETED_FLAG; @@ -3496,8 +3496,8 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new - * parent_cache_info_dirtied_ptr parameter to the + * In this case, that required adding the new + * parent_cache_info_dirtied_ptr parameter to the * function's argument list. * *------------------------------------------------------------------------- @@ -3559,7 +3559,7 @@ H5B2_remove_internal(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, /* Release space for root B-tree node on disk */ if (H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, internal_addr, (hsize_t)shared->node_size)<0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree leaf node") - + /* Let the cache know that the object is deleted */ internal_flags |= H5AC__DELETED_FLAG; @@ -3702,7 +3702,7 @@ done: * Function: H5B2_remove * * Purpose: Removes a record from a B-tree. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol @@ -3780,7 +3780,7 @@ done: * Function: H5B2_get_nrec * * Purpose: Retrieves the number of records in a B-tree - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol @@ -3836,7 +3836,7 @@ done: * caller-supplied UDATA pointer depending on the type of leaf node * requested. The UDATA can point to additional data passed * to the key comparison function. - * + * * The 'OP' routine is called with the record found and the * OP_DATA pointer, to allow caller to return information about * the record. @@ -3936,7 +3936,7 @@ done: * caller-supplied UDATA pointer depending on the type of leaf node * requested. The UDATA can point to additional data passed * to the key comparison function. - * + * * The 'OP' routine is called with the record found and the * OP_DATA pointer, to allow caller to return information about * the record. @@ -4033,7 +4033,7 @@ done: * caller-supplied UDATA pointer depending on the type of leaf node * requested. The UDATA can point to additional data passed * to the key comparison function. - * + * * The 'OP' routine is called with the record found and the * OP_DATA pointer, to allow caller to return information about * the record. @@ -4228,7 +4228,7 @@ H5B2_delete(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr) /* Release space for B-tree node on disk */ if (H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, addr, (hsize_t)H5B2_HEADER_SIZE(f))<0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree header info") - + done: /* Release the B-tree header info */ if (bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__DELETED_FLAG) < 0) @@ -4244,7 +4244,7 @@ done: * Purpose: Locate the specified information in a B-tree and modify it. * The UDATA can point to additional data passed * to the key comparison function. - * + * * The 'OP' routine is called with the record found and the * OP_DATA pointer, to allow caller to modify information about * the record. @@ -4418,7 +4418,7 @@ H5B2_modify(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, if (H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, leaf_flags) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } - + done: /* Check if we need to decrement the reference count for the B-tree's shared info */ if(incr_rc) diff --git a/src/H5B2cache.c b/src/H5B2cache.c index 9f7d9db..7810aae 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -345,7 +345,7 @@ H5B2_cache_hdr_clear(H5F_t *f, H5B2_t *bt2, hbool_t destroy) /* Reset the dirty flag. */ bt2->cache_info.is_dirty = FALSE; - + if (destroy) if (H5B2_cache_hdr_dest(f, bt2) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree header") @@ -359,7 +359,7 @@ done: * Function: H5B2_cache_hdr_size * * Purpose: Compute the size in bytes of a B-tree header - * on disk, and return it in *size_ptr. On failure, + * on disk, and return it in *size_ptr. On failure, * the value of *size_ptr is undefined. * * Return: Non-negative on success/Negative on failure @@ -627,7 +627,7 @@ H5B2_cache_leaf_clear(H5F_t *f, H5B2_leaf_t *leaf, hbool_t destroy) /* Reset the dirty flag. */ leaf->cache_info.is_dirty = FALSE; - + if (destroy) if (H5B2_cache_leaf_dest(f, leaf) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree leaf node") @@ -641,7 +641,7 @@ done: * Function: H5B2_cache_leaf_size * * Purpose: Compute the size in bytes of a B-tree leaf node - * on disk, and return it in *size_ptr. On failure, + * on disk, and return it in *size_ptr. On failure, * the value of *size_ptr is undefined. * * Return: Non-negative on success/Negative on failure @@ -949,7 +949,7 @@ H5B2_cache_internal_clear(H5F_t *f, H5B2_internal_t *internal, hbool_t destroy) /* Reset the dirty flag. */ internal->cache_info.is_dirty = FALSE; - + if (destroy) if (H5B2_cache_internal_dest(f, internal) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree internal node") @@ -963,7 +963,7 @@ done: * Function: H5B2_cache_internal_size * * Purpose: Compute the size in bytes of a B-tree internal node - * on disk, and return it in *size_ptr. On failure, + * on disk, and return it in *size_ptr. On failure, * the value of *size_ptr is undefined. * * Return: Non-negative on success/Negative on failure diff --git a/src/H5B2private.h b/src/H5B2private.h index da67213..3be4413 100644 --- a/src/H5B2private.h +++ b/src/H5B2private.h @@ -44,7 +44,7 @@ #define H5B2_ITER_CONT (0) #define H5B2_ITER_STOP (1) - + /****************************/ /* Library Private Typedefs */ /****************************/ @@ -229,7 +229,7 @@ done: if (bpt) (void)H5BP_cache_hdr_dest(f,bpt); } /* end if */ - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BP_create() */ @@ -443,7 +443,7 @@ HDfprintf(stderr,"%s: attempting to split root node\n",FUNC); HGOTO_ERROR(H5E_BTREE, H5E_UNSUPPORTED, FAIL, "Can't split root yet!") #endif /* LATER */ } /* end if */ - + /* Attempt to insert record into B+ tree */ if(bpt->depth>0) { #ifdef LATER diff --git a/src/H5BPcache.c b/src/H5BPcache.c index e511ae2..57e1677 100644 --- a/src/H5BPcache.c +++ b/src/H5BPcache.c @@ -328,7 +328,7 @@ H5BP_cache_hdr_clear(H5F_t *f, H5BP_t *bpt, hbool_t destroy) /* Reset the dirty flag. */ bpt->cache_info.is_dirty = FALSE; - + if (destroy) if (H5BP_cache_hdr_dest(f, bpt) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B+ tree header") @@ -342,7 +342,7 @@ done: * Function: H5BP_cache_hdr_size * * Purpose: Compute the size in bytes of a B+ tree header - * on disk, and return it in *size_ptr. On failure, + * on disk, and return it in *size_ptr. On failure, * the value of *size_ptr is undefined. * * Return: Non-negative on success/Negative on failure @@ -662,7 +662,7 @@ H5BP_cache_leaf_clear(H5F_t *f, H5BP_leaf_t *leaf, hbool_t destroy) /* Reset the dirty flag. */ leaf->cache_info.is_dirty = FALSE; - + if (destroy) if (H5BP_cache_leaf_dest(f, leaf) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B+ tree leaf node") @@ -676,7 +676,7 @@ done: * Function: H5BP_cache_leaf_size * * Purpose: Compute the size in bytes of a B+ tree leaf node - * on disk, and return it in *size_ptr. On failure, + * on disk, and return it in *size_ptr. On failure, * the value of *size_ptr is undefined. * * Return: Non-negative on success/Negative on failure diff --git a/src/H5BPprivate.h b/src/H5BPprivate.h index 88048ef..9921a73 100644 --- a/src/H5BPprivate.h +++ b/src/H5BPprivate.h @@ -37,7 +37,7 @@ /* Library Private Macros */ /**************************/ - + /****************************/ /* Library Private Typedefs */ /****************************/ @@ -121,7 +121,7 @@ done: if (bt) (void)H5BT_cache_dest(f,bt); } /* end if */ - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_create() */ @@ -445,7 +445,7 @@ done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, bt_flags) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_insert() */ @@ -496,7 +496,7 @@ done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_get_total_size() */ @@ -706,7 +706,7 @@ done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, bt_flags) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_remove() */ @@ -807,7 +807,7 @@ done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_locate() */ @@ -862,7 +862,7 @@ done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_iterate() */ @@ -955,7 +955,7 @@ done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_neighbor() */ @@ -1005,12 +1005,12 @@ H5BT_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) /* Release space for block tracker info on disk */ if (H5MF_xfree(f, H5FD_MEM_BLKTRK, dxpl_id, addr, (hsize_t)H5BT_SIZE(f))<0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free block tracker info") - + done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_remove() */ diff --git a/src/H5BTcache.c b/src/H5BTcache.c index f5f6a4e..d579c05 100644 --- a/src/H5BTcache.c +++ b/src/H5BTcache.c @@ -289,7 +289,7 @@ H5BT_cache_clear(H5F_t *f, H5BT_t *bt, hbool_t destroy) /* Reset the dirty flag. */ bt->cache_info.is_dirty = FALSE; - + if (destroy) if (H5BT_cache_dest(f, bt) < 0) HGOTO_ERROR(H5E_BLKTRK, H5E_CANTFREE, FAIL, "unable to destroy block tracker info") @@ -303,7 +303,7 @@ done: * Function: H5BT_cache_size * * Purpose: Compute the size in bytes of a block tracker info - * on disk, and return it in *size_ptr. On failure, + * on disk, and return it in *size_ptr. On failure, * the value of *size_ptr is undefined. * * Return: Non-negative on success/Negative on failure diff --git a/src/H5BTprivate.h b/src/H5BTprivate.h index 3eab872..e7de549 100644 --- a/src/H5BTprivate.h +++ b/src/H5BTprivate.h @@ -45,7 +45,7 @@ #define H5BT_ITER_CONT H5B2_ITER_CONT #define H5BT_ITER_STOP H5B2_ITER_STOP - + /****************************/ /* Library Private Typedefs */ /****************************/ diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h index b4b1a97..28494f7 100644 --- a/src/H5Bprivate.h +++ b/src/H5Bprivate.h @@ -47,7 +47,7 @@ #endif #define H5B_MAGIC "TREE" /*tree node magic number */ #define H5B_SIZEOF_MAGIC 4 /*size of magic number */ - + typedef enum H5B_ins_t { H5B_INS_ERROR = -1, /*error return value */ H5B_INS_NOOP = 0, /*insert made no changes */ @@ -103,7 +103,7 @@ typedef struct H5B_class_t { int (*cmp2)(H5F_t*, hid_t, void*, void*, void*); /*compare 2 keys */ int (*cmp3)(H5F_t*, hid_t, void*, void*, void*); /*compare 3 keys */ herr_t (*found)(H5F_t*, hid_t, haddr_t, const void*, void*); - + /* insert new data */ H5B_ins_t (*insert)(H5F_t*, hid_t, haddr_t, void*, hbool_t*, void*, void*, void*, hbool_t*, haddr_t*); @@ -111,7 +111,7 @@ typedef struct H5B_class_t { /* min insert uses min leaf, not new(), similarily for max insert */ hbool_t follow_min; hbool_t follow_max; - + /* remove existing data */ H5B_ins_t (*remove)(H5F_t*, hid_t, haddr_t, void*, hbool_t*, void*, void*, hbool_t*); @@ -19,13 +19,13 @@ * John Mainzer * * Purpose: Functions in this file implement a generic cache for - * things which exist on disk, and which may be + * things which exist on disk, and which may be * unambiguously referenced by their disk addresses. * - * The code in this module was initially written in + * The code in this module was initially written in * support of a complete re-write of the metadata cache * in H5AC.c However, other uses for the cache code - * suggested themselves, and thus this file was created + * suggested themselves, and thus this file was created * in an attempt to support re-use. * * For a detailed overview of the cache, please see the @@ -43,9 +43,9 @@ * an overview. * * Some elements of the automatic cache resize code depend on - * the LRU list. Thus if we ever choose to support a new + * the LRU list. Thus if we ever choose to support a new * replacement policy, we will either have to disable those - * elements of the auto resize code when running the new + * elements of the auto resize code when running the new * policy, or modify them to make use of similar information * maintained by the new policy code. * @@ -69,7 +69,7 @@ * unprotect -- or some other way should be found to advise the * cache of changes in entry size. * - * - Flush entries in increasing address order in + * - Flush entries in increasing address order in * H5C_make_space_in_cache(). * * - Also in H5C_make_space_in_cache(), use high and low water marks @@ -87,7 +87,7 @@ * * Tests: * - * - Trim execution time. (This is no longer a major issue with the + * - Trim execution time. (This is no longer a major issue with the * shift from the TBBT to a hash table for indexing.) * * - Add random tests. @@ -113,11 +113,11 @@ /**************************************************************************** * - * We maintain doubly linked lists of instances of H5C_cache_entry_t for a - * variety of reasons -- protected list, LRU list, and the clean and dirty - * LRU lists at present. The following macros support linking and unlinking - * of instances of H5C_cache_entry_t by both their regular and auxilary next - * and previous pointers. + * We maintain doubly linked lists of instances of H5C_cache_entry_t for a + * variety of reasons -- protected list, LRU list, and the clean and dirty + * LRU lists at present. The following macros support linking and unlinking + * of instances of H5C_cache_entry_t by both their regular and auxilary next + * and previous pointers. * * The size and length fields are also maintained. * @@ -145,7 +145,7 @@ * size, but this would break the index_size = LRU_list_size + pl_size * invarient. * - * Alternatively, I could pass the current decr_mode in to the macro, + * Alternatively, I could pass the current decr_mode in to the macro, * and just skip the check whenever epoch markers may be in use. * * However, any size errors should be caught when the cache is flushed @@ -156,10 +156,10 @@ * * - In the H5C__DLL_PRE_INSERT_SC macro, replaced the lines: * - * ( ( (len) == 1 ) && + * ( ( (len) == 1 ) && * ( ( (head_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || - * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) - * ) + * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) + * ) * ) || * * with: @@ -167,7 +167,7 @@ * ( ( (len) == 1 ) && * ( ( (head_ptr) != (tail_ptr) ) || * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) - * ) + * ) * ) || * * Epoch markers have size 0, so we can now have a non-empty list with @@ -185,7 +185,7 @@ * ) * ) || * - * with + * with * * ( ( (len) == 1 ) && * ( ( (head_ptr) != (tail_ptr) ) || @@ -199,7 +199,7 @@ * take on negative values, and thus the revised clause "( (Size) < 0 )" * caused compiler warnings. * JRM - 1/10/05 - * + * ****************************************************************************/ #if H5C_DO_SANITY_CHECKS @@ -495,7 +495,7 @@ if ( ( (entry_ptr) == NULL ) || \ * The following macros must handle stats collection when this collection * is enabled, and evaluate to the empty string when it is not. * - * The sole exception to this rule is + * The sole exception to this rule is * H5C__UPDATE_CACHE_HIT_RATE_STATS(), which is always active as * the cache hit rate stats are always collected and available. * @@ -529,7 +529,7 @@ if ( ( (entry_ptr) == NULL ) || \ if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \ (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \ if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ - (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; + (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; #define H5C__UPDATE_STATS_FOR_RENAME(cache_ptr, entry_ptr) \ (((cache_ptr)->renames)[(entry_ptr)->type->id])++; @@ -614,16 +614,16 @@ if ( ( (entry_ptr) == NULL ) || \ #else /* H5C_COLLECT_CACHE_ENTRY_STATS */ -#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) +#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) #define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \ - (((cache_ptr)->clears)[(entry_ptr)->type->id])++; + (((cache_ptr)->clears)[(entry_ptr)->type->id])++; #define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \ - (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; + (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; #define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) \ - (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; + (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; #define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) \ if ( hit ) \ @@ -643,7 +643,7 @@ if ( ( (entry_ptr) == NULL ) || \ #else /* H5C_COLLECT_CACHE_STATS */ -#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) +#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) #define H5C__UPDATE_STATS_FOR_UNPROTECT(cache_ptr) #define H5C__UPDATE_STATS_FOR_RENAME(cache_ptr, entry_ptr) #define H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) @@ -838,12 +838,12 @@ if ( ( (cache_ptr) == NULL ) || \ } \ } \ H5C__UPDATE_STATS_FOR_HT_SEARCH(cache_ptr, (entry_ptr != NULL), depth) \ -} +} /************************************************************************** * - * Skip list insertion and deletion macros: + * Skip list insertion and deletion macros: * * These used to be functions, but I converted them to macros to avoid some * function call overhead. @@ -854,7 +854,7 @@ if ( ( (cache_ptr) == NULL ) || \ * * Macro: H5C__INSERT_ENTRY_IN_SLIST * - * Purpose: Insert the specified instance of H5C_cache_entry_t into + * Purpose: Insert the specified instance of H5C_cache_entry_t into * the skip list in the specified instance of H5C_t. Update * the associated length and size fields. * @@ -866,8 +866,8 @@ if ( ( (cache_ptr) == NULL ) || \ * * JRM -- 7/21/04 * Updated function to set the in_tree flag when inserting - * an entry into the tree. Also modified the function to - * update the tree size and len fields instead of the similar + * an entry into the tree. Also modified the function to + * update the tree size and len fields instead of the similar * index fields. * * All of this is part of the modifications to support the @@ -875,7 +875,7 @@ if ( ( (cache_ptr) == NULL ) || \ * * JRM -- 7/27/04 * Converted the function H5C_insert_entry_in_tree() into - * the macro H5C__INSERT_ENTRY_IN_TREE in the hopes of + * the macro H5C__INSERT_ENTRY_IN_TREE in the hopes of * wringing a little more speed out of the cache. * * Note that we don't bother to check if the entry is already @@ -915,7 +915,7 @@ if ( ( (cache_ptr) == NULL ) || \ * * Function: H5C__REMOVE_ENTRY_FROM_SLIST * - * Purpose: Remove the specified instance of H5C_cache_entry_t from the + * Purpose: Remove the specified instance of H5C_cache_entry_t from the * index skip list in the specified instance of H5C_t. Update * the associated length and size fields. * @@ -965,7 +965,7 @@ if ( ( (cache_ptr) == NULL ) || \ /************************************************************************** * - * Replacement policy update macros: + * Replacement policy update macros: * * These used to be functions, but I converted them to macros to avoid some * function call overhead. @@ -976,10 +976,10 @@ if ( ( (cache_ptr) == NULL ) || \ * * Macro: H5C__UPDATE_RP_FOR_EVICTION * - * Purpose: Update the replacement policy data structures for an + * Purpose: Update the replacement policy data structures for an * eviction of the specified cache entry. * - * At present, we only support the modified LRU policy, so + * At present, we only support the modified LRU policy, so * this function deals with that case unconditionally. If * we ever support other replacement policies, the function * should switch on the current policy and act accordingly. @@ -1073,10 +1073,10 @@ if ( ( (cache_ptr) == NULL ) || \ * * Macro: H5C__UPDATE_RP_FOR_FLUSH * - * Purpose: Update the replacement policy data structures for a flush + * Purpose: Update the replacement policy data structures for a flush * of the specified cache entry. * - * At present, we only support the modified LRU policy, so + * At present, we only support the modified LRU policy, so * this function deals with that case unconditionally. If * we ever support other replacement policies, the function * should switch on the current policy and act accordingly. @@ -1193,7 +1193,7 @@ if ( ( (cache_ptr) == NULL ) || \ * Purpose: Update the replacement policy data structures for an * insertion of the specified cache entry. * - * At present, we only support the modified LRU policy, so + * At present, we only support the modified LRU policy, so * this function deals with that case unconditionally. If * we ever support other replacement policies, the function * should switch on the current policy and act accordingly. @@ -1288,14 +1288,14 @@ if ( ( (cache_ptr) == NULL ) || \ * * Macro: H5C__UPDATE_RP_FOR_PROTECT * - * Purpose: Update the replacement policy data structures for a + * Purpose: Update the replacement policy data structures for a * protect of the specified cache entry. * - * To do this, unlink the specified entry from any data + * To do this, unlink the specified entry from any data * structures used by the replacement policy, and add the * entry to the protected list. * - * At present, we only support the modified LRU policy, so + * At present, we only support the modified LRU policy, so * this function deals with that case unconditionally. If * we ever support other replacement policies, the function * should switch on the current policy and act accordingly. @@ -1409,10 +1409,10 @@ if ( ( (cache_ptr) == NULL ) || \ * * Macro: H5C__UPDATE_RP_FOR_RENAME * - * Purpose: Update the replacement policy data structures for a + * Purpose: Update the replacement policy data structures for a * rename of the specified cache entry. * - * At present, we only support the modified LRU policy, so + * At present, we only support the modified LRU policy, so * this function deals with that case unconditionally. If * we ever support other replacement policies, the function * should switch on the current policy and act accordingly. @@ -1438,7 +1438,7 @@ if ( ( (cache_ptr) == NULL ) || \ * at optimization. * * JRM - 6/23/05 - * Added the was_dirty parameter. It is possible that + * Added the was_dirty parameter. It is possible that * the entry was clean when it was renamed -- if so it * it is in the clean LRU regardless of the current * value of the is_dirty field. @@ -1554,7 +1554,7 @@ if ( ( (cache_ptr) == NULL ) || \ * list, and re-insert it in the data structures used by the * current replacement policy. * - * At present, we only support the modified LRU policy, so + * At present, we only support the modified LRU policy, so * this function deals with that case unconditionally. If * we ever support other replacement policies, the function * should switch on the current policy and act accordingly. @@ -1566,8 +1566,8 @@ if ( ( (cache_ptr) == NULL ) || \ * Modifications: * * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_unprotect() to - * the macro H5C__UPDATE_RP_FOR_UNPROTECT in an effort to + * Converted the function H5C_update_rp_for_unprotect() to + * the macro H5C__UPDATE_RP_FOR_UNPROTECT in an effort to * squeeze a bit more performance out of the cache. * * At least for the first cut, I am leaving the comments and @@ -1779,10 +1779,10 @@ const H5C_class_t epoch_marker_class = ***************************************************************************/ static void * -H5C_epoch_marker_load(UNUSED H5F_t *f, - UNUSED hid_t dxpl_id, +H5C_epoch_marker_load(UNUSED H5F_t *f, + UNUSED hid_t dxpl_id, UNUSED haddr_t addr, - UNUSED const void *udata1, + UNUSED const void *udata1, UNUSED void *udata2) { void * ret_value = NULL; /* Return value */ @@ -1796,11 +1796,11 @@ done: FUNC_LEAVE_NOAPI(ret_value) } -static herr_t -H5C_epoch_marker_flush(UNUSED H5F_t *f, - UNUSED hid_t dxpl_id, +static herr_t +H5C_epoch_marker_flush(UNUSED H5F_t *f, + UNUSED hid_t dxpl_id, UNUSED hbool_t dest, - UNUSED haddr_t addr, + UNUSED haddr_t addr, UNUSED void *thing) { herr_t ret_value = FAIL; /* Return value */ @@ -1814,8 +1814,8 @@ done: FUNC_LEAVE_NOAPI(ret_value) } -static herr_t -H5C_epoch_marker_dest(UNUSED H5F_t *f, +static herr_t +H5C_epoch_marker_dest(UNUSED H5F_t *f, UNUSED void *thing) { herr_t ret_value = FAIL; /* Return value */ @@ -1829,9 +1829,9 @@ done: FUNC_LEAVE_NOAPI(ret_value) } -static herr_t -H5C_epoch_marker_clear(UNUSED H5F_t *f, - UNUSED void *thing, +static herr_t +H5C_epoch_marker_clear(UNUSED H5F_t *f, + UNUSED void *thing, UNUSED hbool_t dest) { herr_t ret_value = FAIL; /* Return value */ @@ -1845,9 +1845,9 @@ done: FUNC_LEAVE_NOAPI(ret_value) } -static herr_t -H5C_epoch_marker_size(UNUSED const H5F_t *f, - UNUSED const void *thing, +static herr_t +H5C_epoch_marker_size(UNUSED const H5F_t *f, + UNUSED const void *thing, UNUSED size_t *size_ptr) { herr_t ret_value = FAIL; /* Return value */ @@ -1865,16 +1865,16 @@ done: /*------------------------------------------------------------------------- * Function: H5C_create * - * Purpose: Allocate, initialize, and return the address of a new + * Purpose: Allocate, initialize, and return the address of a new * instance of H5C_t. * - * In general, the max_cache_size parameter must be positive, - * and the min_clean_size parameter must lie in the closed - * interval [0, max_cache_size]. + * In general, the max_cache_size parameter must be positive, + * and the min_clean_size parameter must lie in the closed + * interval [0, max_cache_size]. * * The check_write_permitted parameter must either be NULL, * or point to a function of type H5C_write_permitted_func_t. - * If it is NULL, the cache will presume that writes are + * If it is NULL, the cache will presume that writes are * always permitted. * * Return: Success: Pointer to the new instance. @@ -1891,7 +1891,7 @@ done: * * JRM -- 10/5/04 * Added call to H5C_reset_cache_hit_rate_stats(). Also - * added initialization for cache_is_full flag and for + * added initialization for cache_is_full flag and for * resize_ctl. * * JRM -- 11/12/04 @@ -1938,7 +1938,7 @@ H5C_create(size_t max_cache_size, "memory allocation failed") } - if ( (cache_ptr->slist_ptr = H5SL_create(H5SL_TYPE_HADDR,0.5,(size_t)16)) + if ( (cache_ptr->slist_ptr = H5SL_create(H5SL_TYPE_HADDR,0.5,(size_t)16)) == NULL ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, NULL, "can't create skip list.") @@ -2093,7 +2093,7 @@ done: * * This function should only be used where HDprintf() behaves * well -- i.e. not on Windows. - * + * * Return: void * * Programmer: John Mainzer @@ -2102,12 +2102,12 @@ done: * Modifications: * * JRM -- 11/22/04 - * Reworked function to adapt it to the addition of the + * Reworked function to adapt it to the addition of the * ageout method of cache size reduction. * *------------------------------------------------------------------------- */ -void +void H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, int32_t version, double hit_rate, @@ -2137,7 +2137,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, HDfprintf(stdout, "out of bounds low (%6.5lf).\n", (cache_ptr->resize_ctl).lower_hr_threshold); - HDfprintf(stdout, + HDfprintf(stdout, " cache size increased from (%Zu/%Zu) to (%Zu/%Zu).\n", old_max_cache_size, old_min_clean_size, @@ -2154,11 +2154,11 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, HDassert( hit_rate > (cache_ptr->resize_ctl).upper_hr_threshold ); - HDfprintf(stdout, + HDfprintf(stdout, "Auto cache resize -- decrease by threshold. "); - HDfprintf(stdout, "HR = %lf > %6.5lf\n", - hit_rate, + HDfprintf(stdout, "HR = %lf > %6.5lf\n", + hit_rate, (cache_ptr->resize_ctl).upper_hr_threshold); HDfprintf(stdout, "out of bounds high (%6.5lf).\n", @@ -2166,7 +2166,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, break; case H5C_decr__age_out: - HDfprintf(stdout, + HDfprintf(stdout, "Auto cache resize -- decrease by ageout. "); HDfprintf(stdout, "HR = %lf\n", hit_rate); break; @@ -2175,20 +2175,20 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, HDassert( hit_rate > (cache_ptr->resize_ctl).upper_hr_threshold ); - HDfprintf(stdout, + HDfprintf(stdout, "Auto cache resize -- decrease by ageout with "); HDfprintf(stdout, "threshold. HR = %lf > %6.5lf\n", - hit_rate, + hit_rate, (cache_ptr->resize_ctl).upper_hr_threshold); break; default: - HDfprintf(stdout, + HDfprintf(stdout, "Auto cache resize -- decrease by unknown mode."); HDfprintf(stdout, " HR = %lf\n", hit_rate); } - HDfprintf(stdout, + HDfprintf(stdout, " cache size decreased from (%Zu/%Zu) to (%Zu/%Zu).\n", old_max_cache_size, old_min_clean_size, @@ -2246,11 +2246,11 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, * This function fails if any object are protected since the * resulting file might not be consistent. * - * The primary_dxpl_id and secondary_dxpl_id parameters + * The primary_dxpl_id and secondary_dxpl_id parameters * specify the dxpl_ids used on the first write occasioned - * by the destroy (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the metadata - * cache, but may not be needed elsewhere. If so, just use the + * by the destroy (primary_dxpl_id), and on all subsequent + * writes (secondary_dxpl_id). This is useful in the metadata + * cache, but may not be needed elsewhere. If so, just use the * same dxpl_id for both parameters. * * Note that *cache_ptr has been freed upon successful return. @@ -2267,9 +2267,9 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, *------------------------------------------------------------------------- */ herr_t -H5C_dest(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, +H5C_dest(H5F_t * f, + hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, H5C_t * cache_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2280,7 +2280,7 @@ H5C_dest(H5F_t * f, HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( cache_ptr->skip_file_checks || f ); - if ( H5C_flush_cache(f, primary_dxpl_id, secondary_dxpl_id, + if ( H5C_flush_cache(f, primary_dxpl_id, secondary_dxpl_id, cache_ptr, H5C__FLUSH_INVALIDATE_FLAG) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") @@ -2332,8 +2332,8 @@ H5C_dest_empty(H5C_t * cache_ptr) /* This would normally be an assert, but we need to use an HGOTO_ERROR * call to shut up the compiler. */ - if ( ( ! cache_ptr ) || - ( cache_ptr->magic != H5C__H5C_T_MAGIC ) || + if ( ( ! cache_ptr ) || + ( cache_ptr->magic != H5C__H5C_T_MAGIC ) || ( cache_ptr->index_len != 0 ) ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ @@ -2364,18 +2364,18 @@ done: * specified cache. * * If the cache contains protected entries, the function will - * fail, as protected entries cannot be flushed. However - * all unprotected entries should be flushed before the + * fail, as protected entries cannot be flushed. However + * all unprotected entries should be flushed before the * function returns failure. * - * The primary_dxpl_id and secondary_dxpl_id parameters + * The primary_dxpl_id and secondary_dxpl_id parameters * specify the dxpl_ids used on the first write occasioned - * by the flush (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the metadata - * cache, but may not be needed elsewhere. If so, just use the + * by the flush (primary_dxpl_id), and on all subsequent + * writes (secondary_dxpl_id). This is useful in the metadata + * cache, but may not be needed elsewhere. If so, just use the * same dxpl_id for both parameters. - * - * Return: Non-negative on success/Negative on failure or if there was + * + * Return: Non-negative on success/Negative on failure or if there was * a request to flush all items and something was protected. * * Programmer: John Mainzer @@ -2390,32 +2390,32 @@ done: * Added code to remove all epoch markers (if any) from the * LRU list before a destroy. Strictly speaking, this isn't * necessary, as the marker entries reside only in the LRU - * list, never in the index or in the tree. However, it + * list, never in the index or in the tree. However, it * never hurts to tidy up. * * JRM -- 1/6/05 - * Reworked code to support the new + * Reworked code to support the new * H5C__FLUSH_MARKED_ENTRIES_FLAG, and for the replacement of * H5F_FLUSH_INVALIDATE flag with H5C__FLUSH_INVALIDATE_FLAG. * * Note that the H5C__FLUSH_INVALIDATE_FLAG takes precidence * over the H5C__FLUSH_MARKED_ENTRIES_FLAG. Thus if both are - * set, the functions behaves as if just the + * set, the functions behaves as if just the * H5C__FLUSH_INVALIDATE_FLAG was set. * - * The H5C__FLUSH_CLEAR_ONLY_FLAG flag can co-exist with - * either the H5C__FLUSH_MARKED_ENTRIES_FLAG, or the + * The H5C__FLUSH_CLEAR_ONLY_FLAG flag can co-exist with + * either the H5C__FLUSH_MARKED_ENTRIES_FLAG, or the * H5C__FLUSH_INVALIDATE_FLAG. In all cases, it is simply * passed along to H5C_flush_single_entry(). In the case of - * H5C__FLUSH_MARKED_ENTRIES_FLAG, it will only apply to + * H5C__FLUSH_MARKED_ENTRIES_FLAG, it will only apply to * the marked entries. * *------------------------------------------------------------------------- */ herr_t -H5C_flush_cache(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, +H5C_flush_cache(H5F_t * f, + hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, H5C_t * cache_ptr, unsigned flags) { @@ -2486,21 +2486,21 @@ H5C_flush_cache(H5F_t * f, if ( entry_ptr->is_protected ) { - /* we have major problems -- but lets flush everything + /* we have major problems -- but lets flush everything * we can before we flag an error. */ protected_entries++; - } else { + } else { - status = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + status = H5C_flush_single_entry(f, + primary_dxpl_id, + secondary_dxpl_id, cache_ptr, - NULL, - entry_ptr->addr, - flags, - &first_flush, + NULL, + entry_ptr->addr, + flags, + &first_flush, FALSE); if ( status < 0 ) { @@ -2549,7 +2549,7 @@ H5C_flush_cache(H5F_t * f, /* we have major problems -- but lets flush and destroy * everything we can before we flag an error. */ - + H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr) if ( !entry_ptr->in_slist ) { @@ -2562,14 +2562,14 @@ H5C_flush_cache(H5F_t * f, HDassert( !(entry_ptr->is_dirty) ); HDassert( !(entry_ptr->in_slist) ); - status = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + status = H5C_flush_single_entry(f, + primary_dxpl_id, + secondary_dxpl_id, cache_ptr, - NULL, - entry_ptr->addr, - flags, - &first_flush, + NULL, + entry_ptr->addr, + flags, + &first_flush, FALSE); if ( status < 0 ) { @@ -2587,10 +2587,10 @@ H5C_flush_cache(H5F_t * f, if ( protected_entries > 0 ) { - /* the caller asked us to flush and destroy a cache that + /* the caller asked us to flush and destroy a cache that * contains one or more protected entries. Since we can't * flush protected entries, we haven't destroyed them either. - * Since they are all on the protected list, just re-insert + * Since they are all on the protected list, just re-insert * them into the cache before we flag an error. */ entry_ptr = cache_ptr->pl_head_ptr; @@ -2627,7 +2627,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C_get_cache_auto_resize_config * - * Purpose: Copy the current configuration of the cache automatic + * Purpose: Copy the current configuration of the cache automatic * re-sizing function into the instance of H5C_auto_size_ctl_t * pointed to by config_ptr. * @@ -2644,7 +2644,7 @@ done: */ herr_t -H5C_get_cache_auto_resize_config(H5C_t * cache_ptr, +H5C_get_cache_auto_resize_config(H5C_t * cache_ptr, H5C_auto_size_ctl_t *config_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2676,10 +2676,10 @@ done: /*------------------------------------------------------------------------- * Function: H5C_get_cache_size * - * Purpose: Return the cache maximum size, the minimum clean size, the - * current size, and the current number of entries in + * Purpose: Return the cache maximum size, the minimum clean size, the + * current size, and the current number of entries in * *max_size_ptr, *min_clean_size_ptr, *cur_size_ptr, and - * *cur_num_entries_ptr respectively. If any of these + * *cur_num_entries_ptr respectively. If any of these * parameters are NULL, skip that value. * * Return: SUCCEED on success, and FAIL on failure. @@ -2695,7 +2695,7 @@ done: */ herr_t -H5C_get_cache_size(H5C_t * cache_ptr, +H5C_get_cache_size(H5C_t * cache_ptr, size_t * max_size_ptr, size_t * min_clean_size_ptr, size_t * cur_size_ptr, @@ -2740,10 +2740,10 @@ done: /*------------------------------------------------------------------------- * Function: H5C_get_cache_hit_rate * - * Purpose: Compute and return the current cache hit rate in - * *hit_rate_ptr. If there have been no accesses since the + * Purpose: Compute and return the current cache hit rate in + * *hit_rate_ptr. If there have been no accesses since the * last time the cache hit rate stats were reset, set - * *hit_rate_ptr to 0.0. On error, *hit_rate_ptr is + * *hit_rate_ptr to 0.0. On error, *hit_rate_ptr is * undefined. * * Return: SUCCEED on success, and FAIL on failure. @@ -2804,15 +2804,15 @@ done: * exist on disk yet, but it must have an address and disk * space reserved. * - * The primary_dxpl_id and secondary_dxpl_id parameters + * The primary_dxpl_id and secondary_dxpl_id parameters * specify the dxpl_ids used on the first write occasioned - * by the insertion (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the - * metadata cache, but may not be needed elsewhere. If so, + * by the insertion (primary_dxpl_id), and on all subsequent + * writes (secondary_dxpl_id). This is useful in the + * metadata cache, but may not be needed elsewhere. If so, * just use the same dxpl_id for both parameters. * - * The primary_dxpl_id is the dxpl_id passed to the - * check_write_permitted function if such a function has been + * The primary_dxpl_id is the dxpl_id passed to the + * check_write_permitted function if such a function has been * provided. * * Observe that this function cannot occasion a read. @@ -2837,24 +2837,24 @@ done: * * JRM -- 1/6/05 * Added the flags parameter, and code supporting - * H5C__SET_FLUSH_MARKER_FLAG. Note that this flag is + * H5C__SET_FLUSH_MARKER_FLAG. Note that this flag is * ignored unless the new entry is dirty. * * JRM -- 6/6/05 * Added code to force all inserted entries to be dirty. - * This is part of a set of changes moving management of the + * This is part of a set of changes moving management of the * is_dirty field of H5C_cache_entry_t into the H5C code. * *------------------------------------------------------------------------- */ herr_t -H5C_insert_entry(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, +H5C_insert_entry(H5F_t * f, + hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, H5C_t * cache_ptr, - const H5C_class_t * type, - haddr_t addr, + const H5C_class_t * type, + haddr_t addr, void * thing, unsigned int flags) { @@ -2893,7 +2893,7 @@ H5C_insert_entry(H5F_t * f, "Can't get size of thing") } - HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE ); + HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE ); entry_ptr->in_slist = FALSE; @@ -2901,12 +2901,12 @@ H5C_insert_entry(H5F_t * f, entry_ptr->ht_prev = NULL; entry_ptr->next = NULL; - entry_ptr->prev = NULL; + entry_ptr->prev = NULL; entry_ptr->aux_next = NULL; entry_ptr->aux_prev = NULL; - H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) + H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) if ((cache_ptr->index_size + entry_ptr->size) > cache_ptr->max_cache_size) { @@ -2916,8 +2916,8 @@ H5C_insert_entry(H5F_t * f, if ( cache_ptr->check_write_permitted != NULL ) { - result = (cache_ptr->check_write_permitted)(f, - primary_dxpl_id, + result = (cache_ptr->check_write_permitted)(f, + primary_dxpl_id, &write_permitted); if ( result < 0 ) { @@ -2936,13 +2936,13 @@ H5C_insert_entry(H5F_t * f, space_needed = cache_ptr->max_cache_size; } - /* Note that space_needed is just the amount of space that + /* Note that space_needed is just the amount of space that * needed to insert the new entry without exceeding the cache * size limit. The subsequent call to H5C_make_space_in_cache() * may evict the entries required to free more or less space * depending on conditions. It MAY be less if the cache is * currently undersized, or more if the cache is oversized. - * + * * The cache can exceed its maximum size limit via the following * mechanisms: * @@ -2952,20 +2952,20 @@ H5C_insert_entry(H5F_t * f, * Second, when writes are not permitted it is also possible * for the cache to grow without bound. * - * Finally, we usually don't check to see if the cache is - * oversized at the end of an unprotect. As a result, it is - * possible to have a vastly oversized cache with no protected + * Finally, we usually don't check to see if the cache is + * oversized at the end of an unprotect. As a result, it is + * possible to have a vastly oversized cache with no protected * entries as long as all the protects preceed the unprotects. * * Since items 1 and 2 are not changing any time soon, I see * no point in worrying about the third. */ - result = H5C_make_space_in_cache(f, - primary_dxpl_id, + result = H5C_make_space_in_cache(f, + primary_dxpl_id, secondary_dxpl_id, - cache_ptr, - space_needed, + cache_ptr, + space_needed, write_permitted, &first_flush); @@ -2997,7 +2997,7 @@ H5C_insert_entry(H5F_t * f, } /* we don't initialize the protected field until here as it is - * possible that the entry is already in the cache, and already + * possible that the entry is already in the cache, and already * protected. If it is, we don't want to make things worse by * marking it unprotected. */ @@ -3007,8 +3007,8 @@ H5C_insert_entry(H5F_t * f, H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, FAIL) /* New entries are presumed to be dirty, so this if statement is - * unnecessary. Rework it once the rest of the code changes are - * in and tested. -- JRM + * unnecessary. Rework it once the rest of the code changes are + * in and tested. -- JRM */ if ( entry_ptr->is_dirty ) { @@ -3051,7 +3051,7 @@ done: * JRM -- 6/6/05 * Updated function to force all renamed entries to be * dirty. This is part of a series of code modifications - * moving management of the is_dirty field of + * moving management of the is_dirty field of * H5C_cache_entry_t into the H5C code. * *------------------------------------------------------------------------- @@ -3059,7 +3059,7 @@ done: herr_t H5C_rename_entry(H5C_t * cache_ptr, - const H5C_class_t * type, + const H5C_class_t * type, haddr_t old_addr, haddr_t new_addr) { @@ -3091,7 +3091,7 @@ H5C_rename_entry(H5C_t * cache_ptr, H5C__SEARCH_INDEX(cache_ptr, new_addr, test_entry_ptr, FAIL) if ( test_entry_ptr != NULL ) { /* we are hosed */ - + if ( test_entry_ptr->type == type ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTRENAME, FAIL, \ @@ -3106,7 +3106,7 @@ H5C_rename_entry(H5C_t * cache_ptr, } /* If we get this far, we have work to do. Remove *entry_ptr from - * the hash table (and skip list if necessary), change its address to the + * the hash table (and skip list if necessary), change its address to the * new address, mark it as dirty (if it isn't already) and then re-insert. * * Update the replacement policy for a hit to avoid an eviction before @@ -3154,7 +3154,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C_protect * - * Purpose: If the target entry is not in the cache, load it. If + * Purpose: If the target entry is not in the cache, load it. If * necessary, attempt to evict one or more entries to keep * the cache within its maximum size. * @@ -3162,20 +3162,20 @@ done: * to the caller. The caller must call H5C_unprotect() when * finished with the entry. * - * While it is protected, the entry may not be either evicted - * or flushed -- nor may it be accessed by another call to + * While it is protected, the entry may not be either evicted + * or flushed -- nor may it be accessed by another call to * H5C_protect. Any attempt to do so will result in a failure. * - * The primary_dxpl_id and secondary_dxpl_id parameters + * The primary_dxpl_id and secondary_dxpl_id parameters * specify the dxpl_ids used on the first write occasioned - * by the insertion (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the - * metadata cache, but may not be needed elsewhere. If so, + * by the insertion (primary_dxpl_id), and on all subsequent + * writes (secondary_dxpl_id). This is useful in the + * metadata cache, but may not be needed elsewhere. If so, * just use the same dxpl_id for both parameters. * * All reads are performed with the primary_dxpl_id. * - * Similarly, the primary_dxpl_id is passed to the + * Similarly, the primary_dxpl_id is passed to the * check_write_permitted function if it is called. * * Return: Success: Ptr to the desired entry @@ -3190,17 +3190,17 @@ done: * Updated for the addition of the hash table. * * JRM -- 10/28/04 - * Added code to set cache_full to TRUE whenever we try to + * Added code to set cache_full to TRUE whenever we try to * make space in the cache. * * JRM -- 11/12/04 - * Added code to call to H5C_make_space_in_cache() after the - * call to H5C__auto_adjust_cache_size() if that function + * Added code to call to H5C_make_space_in_cache() after the + * call to H5C__auto_adjust_cache_size() if that function * sets the size_decreased flag is TRUE. * * JRM -- 4/25/05 - * The size_decreased flag can also be set to TRUE in - * H5C_set_cache_auto_resize_config() if a new configuration + * The size_decreased flag can also be set to TRUE in + * H5C_set_cache_auto_resize_config() if a new configuration * forces an immediate reduction in cache size. Modified * the code to deal with this eventuallity. * @@ -3208,13 +3208,13 @@ done: */ void * -H5C_protect(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, +H5C_protect(H5F_t * f, + hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, H5C_t * cache_ptr, - const H5C_class_t * type, + const H5C_class_t * type, haddr_t addr, - const void * udata1, + const void * udata1, void * udata2) { hbool_t hit = FALSE; @@ -3260,7 +3260,7 @@ H5C_protect(H5F_t * f, entry_ptr = (H5C_cache_entry_t *)thing; /* try to free up some space if necessay */ - if ( (cache_ptr->index_size + entry_ptr->size) > + if ( (cache_ptr->index_size + entry_ptr->size) > cache_ptr->max_cache_size ) { size_t space_needed; @@ -3269,8 +3269,8 @@ H5C_protect(H5F_t * f, if ( cache_ptr->check_write_permitted != NULL ) { - result = (cache_ptr->check_write_permitted)(f, - primary_dxpl_id, + result = (cache_ptr->check_write_permitted)(f, + primary_dxpl_id, &write_permitted); if ( result < 0 ) { @@ -3321,8 +3321,8 @@ H5C_protect(H5F_t * f, * no point in worrying about the third. */ - result = H5C_make_space_in_cache(f, primary_dxpl_id, - secondary_dxpl_id, cache_ptr, + result = H5C_make_space_in_cache(f, primary_dxpl_id, + secondary_dxpl_id, cache_ptr, space_needed, write_permitted, &first_flush); @@ -3333,7 +3333,7 @@ H5C_protect(H5F_t * f, } } - /* Insert the entry in the hash table. It can't be dirty yet, so + /* Insert the entry in the hash table. It can't be dirty yet, so * we don't even check to see if it should go in the skip list. */ H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, NULL) @@ -3375,8 +3375,8 @@ H5C_protect(H5F_t * f, if ( cache_ptr->check_write_permitted != NULL ) { - result = (cache_ptr->check_write_permitted)(f, - primary_dxpl_id, + result = (cache_ptr->check_write_permitted)(f, + primary_dxpl_id, &write_permitted); if ( result < 0 ) { @@ -3414,17 +3414,17 @@ H5C_protect(H5F_t * f, if ( cache_ptr->size_decreased ) { cache_ptr->size_decreased = FALSE; - + /* check to see if the cache is now oversized due to the cache - * size reduction. If it is, try to evict enough entries to + * size reduction. If it is, try to evict enough entries to * bring the cache size down to the current maximum cache size. */ if ( cache_ptr->index_size > cache_ptr->max_cache_size ) { cache_ptr->cache_full = TRUE; - result = H5C_make_space_in_cache(f, primary_dxpl_id, - secondary_dxpl_id, cache_ptr, + result = H5C_make_space_in_cache(f, primary_dxpl_id, + secondary_dxpl_id, cache_ptr, (size_t)0, write_permitted, &first_flush); @@ -3486,7 +3486,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C_set_cache_auto_resize_config * - * Purpose: Set the cache automatic resize configuration to the + * Purpose: Set the cache automatic resize configuration to the * provided values if they are in range, and fail if they * are not. * @@ -3503,8 +3503,8 @@ done: * Modifications: * * JRM -- 11/18/04 - * Reworked function to match major changes in - * H5C_auto_size_ctl_t. + * Reworked function to match major changes in + * H5C_auto_size_ctl_t. * * JRM -- 4/25/05 * Added code to set cache_ptr->size_decreased to TRUE @@ -3515,7 +3515,7 @@ done: */ herr_t -H5C_set_cache_auto_resize_config(H5C_t * cache_ptr, +H5C_set_cache_auto_resize_config(H5C_t * cache_ptr, H5C_auto_size_ctl_t *config_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -3588,7 +3588,7 @@ H5C_set_cache_auto_resize_config(H5C_t * cache_ptr, ( config_ptr->max_increment <= 0 ) ) ) { cache_ptr->size_increase_possible = FALSE; - } + } break; default: /* should be unreachable */ @@ -3647,18 +3647,18 @@ H5C_set_cache_auto_resize_config(H5C_t * cache_ptr, cache_ptr->resize_ctl = *config_ptr; - /* Resize the cache to the supplied initial value if requested, or as - * necessary to force it within the bounds of the current automatic + /* Resize the cache to the supplied initial value if requested, or as + * necessary to force it within the bounds of the current automatic * cache resizing configuration. * - * Note that the min_clean_fraction may have changed, so we + * Note that the min_clean_fraction may have changed, so we * go through the exercise even if the current size is within * range and an initial size has not been provided. */ if ( (cache_ptr->resize_ctl).set_initial_size ) { - + new_max_cache_size = (cache_ptr->resize_ctl).initial_size; - } + } else if ( cache_ptr->max_cache_size > (cache_ptr->resize_ctl).max_size ) { new_max_cache_size = (cache_ptr->resize_ctl).max_size; @@ -3740,9 +3740,9 @@ done: * Function: H5C_set_skip_flags * * Purpose: Set the values of the skip sanity check flags. - * + * * This function and the skip sanity check flags were created - * for the convenience of the test bed. However it is + * for the convenience of the test bed. However it is * possible that there may be other uses for the flags. * * Return: Non-negative on success/Negative on failure @@ -3834,8 +3834,8 @@ H5C_stats(H5C_t * cache_ptr, /* This would normally be an assert, but we need to use an HGOTO_ERROR * call to shut up the compiler. */ - if ( ( ! cache_ptr ) || - ( cache_ptr->magic != H5C__H5C_T_MAGIC ) || + if ( ( ! cache_ptr ) || + ( cache_ptr->magic != H5C__H5C_T_MAGIC ) || ( !cache_name ) ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr or cache_name") @@ -3858,7 +3858,7 @@ H5C_stats(H5C_t * cache_ptr, if ( aggregate_min_accesses > aggregate_max_accesses ) aggregate_min_accesses = aggregate_max_accesses; if ( aggregate_min_accesses > cache_ptr->min_accesses[i] ) - aggregate_min_accesses = cache_ptr->min_accesses[i]; + aggregate_min_accesses = cache_ptr->min_accesses[i]; if ( aggregate_max_clears < cache_ptr->max_clears[i] ) aggregate_max_clears = cache_ptr->max_clears[i]; if ( aggregate_max_flushes < cache_ptr->max_flushes[i] ) @@ -3878,54 +3878,54 @@ H5C_stats(H5C_t * cache_ptr, if ( cache_ptr->successful_ht_searches > 0 ) { - average_successful_search_depth = + average_successful_search_depth = ((double)(cache_ptr->total_successful_ht_search_depth)) / ((double)(cache_ptr->successful_ht_searches)); } if ( cache_ptr->failed_ht_searches > 0 ) { - average_failed_search_depth = + average_failed_search_depth = ((double)(cache_ptr->total_failed_ht_search_depth)) / ((double)(cache_ptr->failed_ht_searches)); } - + HDfprintf(stdout, "\nH5C: cache statistics for %s\n", cache_name); HDfprintf(stdout, "\n"); - HDfprintf(stdout, + HDfprintf(stdout, " hash table insertion / deletions = %ld / %ld\n", (long)(cache_ptr->total_ht_insertions), (long)(cache_ptr->total_ht_deletions)); - HDfprintf(stdout, + HDfprintf(stdout, " HT successful / failed searches = %ld / %ld\n", (long)(cache_ptr->successful_ht_searches), (long)(cache_ptr->failed_ht_searches)); - HDfprintf(stdout, + HDfprintf(stdout, " Av. HT suc / failed search depth = %f / %f\n", average_successful_search_depth, average_failed_search_depth); - HDfprintf(stdout, + HDfprintf(stdout, " current (max) index size / length = %ld (%ld) / %ld (%ld)\n", (long)(cache_ptr->index_size), (long)(cache_ptr->max_index_size), (long)(cache_ptr->index_len), (long)(cache_ptr->max_index_len)); - HDfprintf(stdout, + HDfprintf(stdout, " current (max) slist size / length = %ld (%ld) / %ld (%ld)\n", (long)(cache_ptr->slist_size), (long)(cache_ptr->max_slist_size), (long)(cache_ptr->slist_len), (long)(cache_ptr->max_slist_len)); - HDfprintf(stdout, + HDfprintf(stdout, " current (max) PL size / length = %ld (%ld) / %ld (%ld)\n", (long)(cache_ptr->pl_size), (long)(cache_ptr->max_pl_size), @@ -3947,13 +3947,13 @@ H5C_stats(H5C_t * cache_ptr, (long)(cache_ptr->dLRU_list_size), (long)(cache_ptr->dLRU_list_len)); - HDfprintf(stdout, + HDfprintf(stdout, " Total hits / misses / hit_rate = %ld / %ld / %f\n", - (long)total_hits, - (long)total_misses, + (long)total_hits, + (long)total_misses, hit_rate); - HDfprintf(stdout, + HDfprintf(stdout, " Total clears / flushes / evictions = %ld / %ld / %ld\n", (long)total_clears, (long)total_flushes, @@ -3986,7 +3986,7 @@ H5C_stats(H5C_t * cache_ptr, HDfprintf(stdout, "\n"); - HDfprintf(stdout, " Stats on %s:\n", + HDfprintf(stdout, " Stats on %s:\n", ((cache_ptr->type_name_table_ptr))[i]); if ( ( cache_ptr->hits[i] > 0 ) || ( cache_ptr->misses[i] > 0 ) ) { @@ -3997,36 +3997,36 @@ H5C_stats(H5C_t * cache_ptr, hit_rate = 0.0; } - HDfprintf(stdout, - " hits / misses / hit_rate = %ld / %ld / %f\n", + HDfprintf(stdout, + " hits / misses / hit_rate = %ld / %ld / %f\n", (long)(cache_ptr->hits[i]), (long)(cache_ptr->misses[i]), hit_rate); - HDfprintf(stdout, + HDfprintf(stdout, " clears / flushes / evictions = %ld / %ld / %ld\n", (long)(cache_ptr->clears[i]), (long)(cache_ptr->flushes[i]), (long)(cache_ptr->evictions[i])); - HDfprintf(stdout, + HDfprintf(stdout, " insertions / renames = %ld / %ld\n", (long)(cache_ptr->insertions[i]), (long)(cache_ptr->renames[i])); #if H5C_COLLECT_CACHE_ENTRY_STATS - HDfprintf(stdout, + HDfprintf(stdout, " entry max / min accesses = %d / %d\n", cache_ptr->max_accesses[i], cache_ptr->min_accesses[i]); - HDfprintf(stdout, + HDfprintf(stdout, " entry max_clears / max_flushes = %d / %d\n", cache_ptr->max_clears[i], cache_ptr->max_flushes[i]); - HDfprintf(stdout, + HDfprintf(stdout, " entry max_size = %d\n", (int)(cache_ptr->max_size[i])); @@ -4107,7 +4107,7 @@ H5C_stats__reset(H5C_t * cache_ptr) for ( i = 0; i <= cache_ptr->max_type_id; i++ ) { cache_ptr->max_accesses[i] = 0; - cache_ptr->min_accesses[i] = 1000000; + cache_ptr->min_accesses[i] = 1000000; cache_ptr->max_clears[i] = 0; cache_ptr->max_flushes[i] = 0; cache_ptr->max_size[i] = (size_t)0; @@ -4129,17 +4129,17 @@ H5C_stats__reset(H5C_t * cache_ptr) * and give it back to the replacement policy. * * The TYPE and ADDR arguments must be the same as those in - * the corresponding call to H5C_protect() and the THING - * argument must be the value returned by that call to + * the corresponding call to H5C_protect() and the THING + * argument must be the value returned by that call to * H5C_protect(). * - * The primary_dxpl_id and secondary_dxpl_id parameters + * The primary_dxpl_id and secondary_dxpl_id parameters * specify the dxpl_ids used on the first write occasioned - * by the unprotect (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). Since an uprotect cannot - * occasion a write at present, all this is moot for now. - * However, things change, and in any case, - * H5C_flush_single_entry() needs primary_dxpl_id and + * by the unprotect (primary_dxpl_id), and on all subsequent + * writes (secondary_dxpl_id). Since an uprotect cannot + * occasion a write at present, all this is moot for now. + * However, things change, and in any case, + * H5C_flush_single_entry() needs primary_dxpl_id and * secondary_dxpl_id in its parameter list. * * The function can't cause a read either, so the dxpl_id @@ -4148,7 +4148,7 @@ H5C_stats__reset(H5C_t * cache_ptr) * Return: Non-negative on success/Negative on failure * * If the deleted flag is TRUE, simply remove the target entry - * from the cache, clear it, and free it without writing it to + * from the cache, clear it, and free it without writing it to * disk. * * Return: Non-negative on success/Negative on failure @@ -4165,27 +4165,27 @@ H5C_stats__reset(H5C_t * cache_ptr) * * JRM -- 1/6/05 * Added the flags parameter, and code supporting - * H5C__SET_FLUSH_MARKER_FLAG. Note that this flag is - * ignored unless the new entry is dirty. Also note that - * once the flush_marker field of an entry is set, the + * H5C__SET_FLUSH_MARKER_FLAG. Note that this flag is + * ignored unless the new entry is dirty. Also note that + * once the flush_marker field of an entry is set, the * only way it can be reset is by being flushed. * * JRM -- 6/3/05 - * Added the dirtied parameter and supporting code. This + * Added the dirtied parameter and supporting code. This * is part of an effort to move management of the is_dirty - * field into the cache code. This has become necessary + * field into the cache code. This has become necessary * to repair a cache coherency bug in PHDF5. * *------------------------------------------------------------------------- */ herr_t -H5C_unprotect(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, +H5C_unprotect(H5F_t * f, + hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, H5C_t * cache_ptr, - const H5C_class_t * type, + const H5C_class_t * type, haddr_t addr, - void * thing, + void * thing, unsigned int flags) { hbool_t deleted; @@ -4224,7 +4224,7 @@ H5C_unprotect(H5F_t * f, H5C__UPDATE_RP_FOR_UNPROTECT(cache_ptr, entry_ptr, FAIL) - entry_ptr->is_protected = FALSE; + entry_ptr->is_protected = FALSE; /* if the entry is dirty, or its flush_marker with the set flush flag, * and then add it to the skip list if it isn't there already. @@ -4243,17 +4243,17 @@ H5C_unprotect(H5F_t * f, /* this implementation of the "deleted" option is a bit inefficient, as * we re-insert the entry to be deleted into the replacement policy * data structures, only to remove them again. Depending on how often - * we do this, we may want to optimize a bit. + * we do this, we may want to optimize a bit. * - * On the other hand, this implementation is reasonably clean, and + * On the other hand, this implementation is reasonably clean, and * makes good use of existing code. * JRM - 5/19/04 */ if ( deleted ) { /* the following first flush flag will never be used as we are - * calling H5C_flush_single_entry with both the - * H5C__FLUSH_CLEAR_ONLY_FLAG and H5C__FLUSH_INVALIDATE_FLAG flags. + * calling H5C_flush_single_entry with both the + * H5C__FLUSH_CLEAR_ONLY_FLAG and H5C__FLUSH_INVALIDATE_FLAG flags. * However, it is needed for the function call. */ hbool_t dummy_first_flush = TRUE; @@ -4273,15 +4273,15 @@ H5C_unprotect(H5F_t * f, "hash table contains multiple entries for addr?!?.") } - if ( H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + if ( H5C_flush_single_entry(f, + primary_dxpl_id, + secondary_dxpl_id, cache_ptr, - type, - addr, - (H5C__FLUSH_CLEAR_ONLY_FLAG | + type, + addr, + (H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_INVALIDATE_FLAG), - &dummy_first_flush, + &dummy_first_flush, TRUE) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't flush.") @@ -4300,7 +4300,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C_validate_resize_config() * - * Purpose: Run a sanity check on the specified sections of the + * Purpose: Run a sanity check on the specified sections of the * provided instance of struct H5C_auto_size_ctl_t. * * Do nothing and return SUCCEED if no errors are detected, @@ -4339,7 +4339,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, if ( (tests & H5C_RESIZE_CFG__VALIDATE_GENERAL) != 0 ) { - if ( ( config_ptr->set_initial_size != TRUE ) && + if ( ( config_ptr->set_initial_size != TRUE ) && ( config_ptr->set_initial_size != FALSE ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ @@ -4362,14 +4362,14 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, } if ( ( config_ptr->set_initial_size ) && - ( ( config_ptr->initial_size < config_ptr->min_size ) || + ( ( config_ptr->initial_size < config_ptr->min_size ) || ( config_ptr->initial_size > config_ptr->max_size ) ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ "initial_size must be in the interval [min_size, max_size]"); } - if ( ( config_ptr->min_clean_fraction < 0.0 ) || + if ( ( config_ptr->min_clean_fraction < 0.0 ) || ( config_ptr->min_clean_fraction > 1.0 ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ @@ -4397,8 +4397,8 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, } if ( config_ptr->incr_mode == H5C_incr__threshold ) { - - if ( ( config_ptr->lower_hr_threshold < 0.0 ) || + + if ( ( config_ptr->lower_hr_threshold < 0.0 ) || ( config_ptr->lower_hr_threshold > 1.0 ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ @@ -4445,7 +4445,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, "upper_hr_threshold must be <= 1.0"); } - if ( ( config_ptr->decrement > 1.0 ) || + if ( ( config_ptr->decrement > 1.0 ) || ( config_ptr->decrement < 0.0 ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ @@ -4481,7 +4481,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, } if ( ( config_ptr->apply_empty_reserve ) && - ( ( config_ptr->empty_reserve > 1.0 ) || + ( ( config_ptr->empty_reserve > 1.0 ) || ( config_ptr->empty_reserve < 0.0 ) ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ @@ -4495,12 +4495,12 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, if ( config_ptr->decr_mode == H5C_decr__age_out_with_threshold ) { - if ( ( config_ptr->upper_hr_threshold > 1.0 ) || + if ( ( config_ptr->upper_hr_threshold > 1.0 ) || ( config_ptr->upper_hr_threshold < 0.0 ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ "upper_hr_threshold must be in the interval [0.0, 1.0]"); - } + } } /* H5C_decr__age_out_with_threshold */ } /* H5C_RESIZE_CFG__VALIDATE_DECREMENT */ @@ -4515,9 +4515,9 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, ( config_ptr->decr_mode == H5C_decr__age_out_with_threshold ) ) && - ( config_ptr->lower_hr_threshold - >= - config_ptr->upper_hr_threshold + ( config_ptr->lower_hr_threshold + >= + config_ptr->upper_hr_threshold ) ) { @@ -4541,15 +4541,15 @@ done: * * Function: H5C__auto_adjust_cache_size * - * Purpose: Obtain the current full cache hit rate, and compare it - * with the hit rate thresholds for modifying cache size. - * If one of the thresholds has been crossed, adjusts the + * Purpose: Obtain the current full cache hit rate, and compare it + * with the hit rate thresholds for modifying cache size. + * If one of the thresholds has been crossed, adjusts the * size of the cache accordingly. * - * The function then resets the full cache hit rate + * The function then resets the full cache hit rate * statistics, and exits. * - * Return: Non-negative on success/Negative on failure or if there was + * Return: Non-negative on success/Negative on failure or if there was * an attempt to flush a protected item. * * @@ -4559,7 +4559,7 @@ done: * * JRM -- 11/18/04 * Major re-write to support ageout method of cache size - * reduction, and to adjust to changes in the + * reduction, and to adjust to changes in the * H5C_auto_size_ctl_t structure. * *------------------------------------------------------------------------- @@ -4587,7 +4587,7 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( cache_ptr->cache_accesses >= + HDassert( cache_ptr->cache_accesses >= (cache_ptr->resize_ctl).epoch_length ); HDassert( 0.0 <= (cache_ptr->resize_ctl).min_clean_fraction ); HDassert( (cache_ptr->resize_ctl).min_clean_fraction <= 100.0 ); @@ -4623,8 +4623,8 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, if ( ! cache_ptr->size_increase_possible ) { status = increase_disabled; - - } else if ( cache_ptr->max_cache_size >= + + } else if ( cache_ptr->max_cache_size >= (cache_ptr->resize_ctl).max_size ) { HDassert( cache_ptr->max_cache_size == \ @@ -4642,7 +4642,7 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, (cache_ptr->resize_ctl).increment); /* clip to max size if necessary */ - if ( new_max_cache_size > + if ( new_max_cache_size > (cache_ptr->resize_ctl).max_size ) { new_max_cache_size = (cache_ptr->resize_ctl).max_size; @@ -4650,7 +4650,7 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, /* clip to max increment if necessary */ if ( ( (cache_ptr->resize_ctl).apply_max_increment ) && - ( (cache_ptr->max_cache_size + + ( (cache_ptr->max_cache_size + (cache_ptr->resize_ctl).max_increment) < new_max_cache_size ) ) { @@ -4667,28 +4667,28 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unknown incr_mode.") } - /* If the decr_mode is either age out or age out with threshold, we + /* If the decr_mode is either age out or age out with threshold, we * must run the marker maintenance code, whether we run the size - * reduction code or not. We do this in two places -- here we + * reduction code or not. We do this in two places -- here we * insert a new marker if the number of active epoch markers is * is less than the the current epochs before eviction, and after * the ageout call, we cycle the markers. * * However, we can't call the ageout code or cycle the markers - * unless there was a full complement of markers in place on + * unless there was a full complement of markers in place on * entry. The inserted_epoch_marker flag is used to track this. */ - if ( ( ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out ) + if ( ( ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out ) || - ( (cache_ptr->resize_ctl).decr_mode == + ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out_with_threshold ) ) && - ( cache_ptr->epoch_markers_active < - (cache_ptr->resize_ctl).epochs_before_eviction - ) + ( cache_ptr->epoch_markers_active < + (cache_ptr->resize_ctl).epochs_before_eviction + ) ) { result = H5C__autoadjust__ageout__insert_new_marker(cache_ptr); @@ -4722,8 +4722,8 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, if ( ! cache_ptr->size_decrease_possible ) { status = decrease_disabled; - - } else if ( cache_ptr->max_cache_size <= + + } else if ( cache_ptr->max_cache_size <= (cache_ptr->resize_ctl).min_size ) { HDassert( cache_ptr->max_cache_size == @@ -4737,20 +4737,20 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, (cache_ptr->resize_ctl).decrement); /* clip to min size if necessary */ - if ( new_max_cache_size < + if ( new_max_cache_size < (cache_ptr->resize_ctl).min_size ) { - new_max_cache_size = + new_max_cache_size = (cache_ptr->resize_ctl).min_size; } /* clip to max decrement if necessary */ if ( ( (cache_ptr->resize_ctl).apply_max_decrement ) && ( ((cache_ptr->resize_ctl).max_decrement + - new_max_cache_size) < + new_max_cache_size) < cache_ptr->max_cache_size ) ) { - new_max_cache_size = cache_ptr->max_cache_size - + new_max_cache_size = cache_ptr->max_cache_size - (cache_ptr->resize_ctl).max_decrement; } @@ -4794,9 +4794,9 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, } /* cycle the epoch markers here if appropriate */ - if ( ( ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out ) + if ( ( ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out ) || - ( (cache_ptr->resize_ctl).decr_mode == + ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out_with_threshold ) ) @@ -4820,7 +4820,7 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, old_min_clean_size = cache_ptr->min_clean_size; new_min_clean_size = (size_t) - ((double)new_max_cache_size * + ((double)new_max_cache_size * ((cache_ptr->resize_ctl).min_clean_fraction)); /* new_min_clean_size is of size_t, and thus must be non-negative. @@ -4878,11 +4878,11 @@ done: * * Function: H5C__autoadjust__ageout * - * Purpose: Implement the ageout automatic cache size decrement + * Purpose: Implement the ageout automatic cache size decrement * algorithm. Note that while this code evicts aged out * entries, the code does not change the maximum cache size. * Instead, the function simply computes the new value (if - * any change is indicated) and reports this value in + * any change is indicated) and reports this value in * *new_max_cache_size_ptr. * * Return: Non-negative on success/Negative on failure or if there was @@ -4933,10 +4933,10 @@ H5C__autoadjust__ageout(H5C_t * cache_ptr, } } - if ( ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out ) + if ( ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out ) || - ( ( (cache_ptr->resize_ctl).decr_mode == - H5C_decr__age_out_with_threshold + ( ( (cache_ptr->resize_ctl).decr_mode == + H5C_decr__age_out_with_threshold ) && ( hit_rate >= (cache_ptr->resize_ctl).upper_hr_threshold ) @@ -4987,17 +4987,17 @@ H5C__autoadjust__ageout(H5C_t * cache_ptr, if ( *new_max_cache_size_ptr < (cache_ptr->resize_ctl).min_size ) { - *new_max_cache_size_ptr = + *new_max_cache_size_ptr = (cache_ptr->resize_ctl).min_size; } /* clip to max decrement if necessary */ if ( ( (cache_ptr->resize_ctl).apply_max_decrement ) && ( ((cache_ptr->resize_ctl).max_decrement + - *new_max_cache_size_ptr) < + *new_max_cache_size_ptr) < cache_ptr->max_cache_size ) ) { - *new_max_cache_size_ptr = cache_ptr->max_cache_size - + *new_max_cache_size_ptr = cache_ptr->max_cache_size - (cache_ptr->resize_ctl).max_decrement; } } @@ -5047,7 +5047,7 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - if ( cache_ptr->epoch_markers_active <= 0 ) { + if ( cache_ptr->epoch_markers_active <= 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "No active epoch markers on entry?!?!?.") @@ -5057,8 +5057,8 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) i = cache_ptr->epoch_marker_ringbuf[cache_ptr->epoch_marker_ringbuf_first]; - cache_ptr->epoch_marker_ringbuf_first = - (cache_ptr->epoch_marker_ringbuf_first + 1) % + cache_ptr->epoch_marker_ringbuf_first = + (cache_ptr->epoch_marker_ringbuf_first + 1) % (H5C__MAX_EPOCH_MARKERS + 1); cache_ptr->epoch_marker_ringbuf_size -= 1; @@ -5082,14 +5082,14 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) /* now, re-insert it at the head of the LRU list, and at the tail of * the ring buffer. - */ + */ HDassert( ((cache_ptr->epoch_markers)[i]).addr == (haddr_t)i ); HDassert( ((cache_ptr->epoch_markers)[i]).next == NULL ); HDassert( ((cache_ptr->epoch_markers)[i]).prev == NULL ); - cache_ptr->epoch_marker_ringbuf_last = - (cache_ptr->epoch_marker_ringbuf_last + 1) % + cache_ptr->epoch_marker_ringbuf_last = + (cache_ptr->epoch_marker_ringbuf_last + 1) % (H5C__MAX_EPOCH_MARKERS + 1); (cache_ptr->epoch_marker_ringbuf)[cache_ptr->epoch_marker_ringbuf_last] = i; @@ -5119,26 +5119,26 @@ done: * Function: H5C__autoadjust__ageout__evict_aged_out_entries * * Purpose: Evict clean entries in the cache that haven't - * been accessed for at least + * been accessed for at least * (cache_ptr->resize_ctl).epochs_before_eviction epochs, * and flush dirty entries that haven't been accessed for * that amount of time. * - * Depending on configuration, the function will either + * Depending on configuration, the function will either * flush or evict all such entries, or all such entries it * encounters until it has freed the maximum amount of space * allowed under the maximum decrement. * * If we are running in parallel mode, writes may not be - * permitted. If so, the function simply skips any dirty + * permitted. If so, the function simply skips any dirty * entries it may encounter. * - * The function makes no attempt to maintain the minimum + * The function makes no attempt to maintain the minimum * clean size, as there is no guarantee that the cache size - * will be changed. + * will be changed. * - * If there is no cache size change, the minimum clean size - * constraint will be met through a combination of clean + * If there is no cache size change, the minimum clean size + * constraint will be met through a combination of clean * entries and free space in the cache. * * If there is a cache size reduction, the minimum clean size @@ -5146,13 +5146,13 @@ done: * we have to make space in the cache. * * The primary_dxpl_id and secondary_dxpl_id parameters - * specify the dxpl_ids used depending on the value of + * specify the dxpl_ids used depending on the value of * *first_flush_ptr. The idea is to use the primary_dxpl_id * on the first write in a sequence of writes, and to use * the secondary_dxpl_id on all subsequent writes. * - * This is useful in the metadata cache, but may not be - * needed elsewhere. If so, just use the same dxpl_id for + * This is useful in the metadata cache, but may not be + * needed elsewhere. If so, just use the same dxpl_id for * both parameters. * * Observe that this function cannot occasion a read. @@ -5189,7 +5189,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); /* if there is a limit on the amount that the cache size can be decrease - * in any one round of the cache size reduction algorithm, load that + * in any one round of the cache size reduction algorithm, load that * limit into eviction_size_limit. Otherwise, set eviction_size_limit * to the equivalent of infinity. The current size of the index will * do nicely. @@ -5252,7 +5252,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, } /* end while */ /* for now at least, don't bother to maintain the minimum clean size, - * as the cache should now be less than its maximum size. Due to + * as the cache should now be less than its maximum size. Due to * the vaguries of the cache size reduction algorthim, we may not * reduce the size of the cache. * @@ -5261,7 +5261,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, * * If we don't, no action is necessary, as we have just evicted and/or * or flushed a bunch of entries and therefore the sum of the clean - * and free space in the cache must be greater than or equal to the + * and free space in the cache must be greater than or equal to the * min clean space requirement (assuming that requirement was met on * entry). */ @@ -5269,16 +5269,16 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, } else /* ! write_permitted */ { /* since we are not allowed to write, all we can do is evict - * any clean entries that we may encounter before we either + * any clean entries that we may encounter before we either * hit the eviction size limit, or encounter the epoch marker. * * If we are operating read only, this isn't an issue, as there * will not be any dirty entries. * - * If we are operating in R/W mode, all the dirty entries we + * If we are operating in R/W mode, all the dirty entries we * skip will be flushed the next time we attempt to make space - * when writes are permitted. This may have some local - * performance implications, but it shouldn't cause any net + * when writes are permitted. This may have some local + * performance implications, but it shouldn't cause any net * slowdown. */ @@ -5312,7 +5312,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, "unable to flush clean entry") } } - /* just skip the entry if it is dirty, as we can't do + /* just skip the entry if it is dirty, as we can't do * anything with it now since we can't write. */ @@ -5337,8 +5337,8 @@ done: * * Function: H5C__autoadjust__ageout__insert_new_marker * - * Purpose: Find an unused marker cache entry, mark it as used, and - * insert it at the head of the LRU list. Also add the + * Purpose: Find an unused marker cache entry, mark it as used, and + * insert it at the head of the LRU list. Also add the * marker's index in the epoch_markers array. * * Return: SUCCEED on success/FAIL on failure. @@ -5372,8 +5372,8 @@ H5C__autoadjust__ageout__insert_new_marker(H5C_t * cache_ptr) /* find an unused marker */ i = 0; - while ( ( (cache_ptr->epoch_marker_active)[i] ) && - ( i < H5C__MAX_EPOCH_MARKERS ) ) + while ( ( (cache_ptr->epoch_marker_active)[i] ) && + ( i < H5C__MAX_EPOCH_MARKERS ) ) { i++; } @@ -5391,8 +5391,8 @@ H5C__autoadjust__ageout__insert_new_marker(H5C_t * cache_ptr) (cache_ptr->epoch_marker_active)[i] = TRUE; - cache_ptr->epoch_marker_ringbuf_last = - (cache_ptr->epoch_marker_ringbuf_last + 1) % + cache_ptr->epoch_marker_ringbuf_last = + (cache_ptr->epoch_marker_ringbuf_last + 1) % (H5C__MAX_EPOCH_MARKERS + 1); (cache_ptr->epoch_marker_ringbuf)[cache_ptr->epoch_marker_ringbuf_last] = i; @@ -5424,7 +5424,7 @@ done: * * Function: H5C__autoadjust__ageout__remove_all_markers * - * Purpose: Remove all epoch markers from the LRU list and mark them + * Purpose: Remove all epoch markers from the LRU list and mark them * as inactive. * * Return: SUCCEED on success/FAIL on failure. @@ -5452,15 +5452,15 @@ H5C__autoadjust__ageout__remove_all_markers(H5C_t * cache_ptr) while ( cache_ptr->epoch_markers_active > 0 ) { - /* get the index of the last epoch marker in the LRU list + /* get the index of the last epoch marker in the LRU list * and remove it from the ring buffer. */ ring_buf_index = cache_ptr->epoch_marker_ringbuf_first; i = (cache_ptr->epoch_marker_ringbuf)[ring_buf_index]; - cache_ptr->epoch_marker_ringbuf_first = - (cache_ptr->epoch_marker_ringbuf_first + 1) % + cache_ptr->epoch_marker_ringbuf_first = + (cache_ptr->epoch_marker_ringbuf_first + 1) % (H5C__MAX_EPOCH_MARKERS + 1); cache_ptr->epoch_marker_ringbuf_size -= 1; @@ -5508,9 +5508,9 @@ done: * * Function: H5C__autoadjust__ageout__remove_excess_markers * - * Purpose: Remove epoch markers from the end of the LRU list and + * Purpose: Remove epoch markers from the end of the LRU list and * mark them as inactive until the number of active markers - * equals the the current value of + * equals the the current value of * (cache_ptr->resize_ctl).epochs_before_eviction. * * Return: SUCCEED on success/FAIL on failure. @@ -5542,18 +5542,18 @@ H5C__autoadjust__ageout__remove_excess_markers(H5C_t * cache_ptr) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "no excess markers on entry.") } - while ( cache_ptr->epoch_markers_active > + while ( cache_ptr->epoch_markers_active > (cache_ptr->resize_ctl).epochs_before_eviction ) { - /* get the index of the last epoch marker in the LRU list + /* get the index of the last epoch marker in the LRU list * and remove it from the ring buffer. */ ring_buf_index = cache_ptr->epoch_marker_ringbuf_first; i = (cache_ptr->epoch_marker_ringbuf)[ring_buf_index]; - cache_ptr->epoch_marker_ringbuf_first = - (cache_ptr->epoch_marker_ringbuf_first + 1) % + cache_ptr->epoch_marker_ringbuf_first = + (cache_ptr->epoch_marker_ringbuf_first + 1) % (H5C__MAX_EPOCH_MARKERS + 1); cache_ptr->epoch_marker_ringbuf_size -= 1; @@ -5601,24 +5601,24 @@ done: * * Function: H5C_flush_single_entry * - * Purpose: Flush or clear (and evict if requested) the cache entry + * Purpose: Flush or clear (and evict if requested) the cache entry * with the specified address and type. If the type is NULL, - * any unprotected entry at the specified address will be + * any unprotected entry at the specified address will be * flushed (and possibly evicted). * - * Attempts to flush a protected entry will result in an + * Attempts to flush a protected entry will result in an * error. * - * *first_flush_ptr should be true if only one + * *first_flush_ptr should be true if only one * flush is contemplated before the next load, or if this - * is the first of a sequence of flushes that will be + * is the first of a sequence of flushes that will be * completed before the next load. *first_flush_ptr is set - * to false if a flush actually takes place, and should be + * to false if a flush actually takes place, and should be * left false until the end of the sequence. * * The primary_dxpl_id is used if *first_flush_ptr is TRUE - * on entry, and a flush actually takes place. The - * secondary_dxpl_id is used in any subsequent flush where + * on entry, and a flush actually takes place. The + * secondary_dxpl_id is used in any subsequent flush where * *first_flush_ptr is FALSE on entry. * * If the H5C__FLUSH_INVALIDATE_FLAG flag is set, the entry will @@ -5626,17 +5626,17 @@ done: * primary_dxpl_id, and secondary_dxpl_id are all irrelevent, * and the call can't be part of a sequence of flushes. * - * If the caller knows the address of the TBBT node at - * which the target entry resides, it can avoid a lookup + * If the caller knows the address of the TBBT node at + * which the target entry resides, it can avoid a lookup * by supplying that address in the tgt_node_ptr parameter. * If this parameter is NULL, the function will do a TBBT * search for the entry instead. * * The function does nothing silently if there is no entry - * at the supplied address, or if the entry found has the + * at the supplied address, or if the entry found has the * wrong type. * - * Return: Non-negative on success/Negative on failure or if there was + * Return: Non-negative on success/Negative on failure or if there was * an attempt to flush a protected item. * * Programmer: John Mainzer, 5/5/04 @@ -5652,19 +5652,19 @@ done: * JRM -- 1/6/05 * Updated function to reset the flush_marker field. * Also replace references to H5F_FLUSH_INVALIDATE and - * H5F_FLUSH_CLEAR_ONLY with references to + * H5F_FLUSH_CLEAR_ONLY with references to * H5C__FLUSH_INVALIDATE_FLAG and H5C__FLUSH_CLEAR_ONLY_FLAG * respectively. * *------------------------------------------------------------------------- */ static herr_t -H5C_flush_single_entry(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, +H5C_flush_single_entry(H5F_t * f, + hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, H5C_t * cache_ptr, - const H5C_class_t * type_ptr, - haddr_t addr, + const H5C_class_t * type_ptr, + haddr_t addr, unsigned flags, hbool_t * first_flush_ptr, hbool_t del_entry_from_slist_on_destroy) @@ -5684,7 +5684,7 @@ H5C_flush_single_entry(H5F_t * f, HDassert( first_flush_ptr ); destroy = ( (flags & H5C__FLUSH_INVALIDATE_FLAG) != 0 ); - clear_only = ( (flags & H5C__FLUSH_CLEAR_ONLY_FLAG) != 0); + clear_only = ( (flags & H5C__FLUSH_CLEAR_ONLY_FLAG) != 0); /* attempt to find the target entry in the hash table */ H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) @@ -5702,7 +5702,7 @@ H5C_flush_single_entry(H5F_t * f, } } else { - if ( ( entry_ptr->is_dirty ) || + if ( ( entry_ptr->is_dirty ) || ( entry_ptr->flush_marker ) || ( entry_ptr->addr != addr ) ) { @@ -5711,12 +5711,12 @@ H5C_flush_single_entry(H5F_t * f, } } } -#if 0 +#if 0 /* this should be useful for debugging from time to time. * lets leave it in for now. -- JRM 12/15/04 */ else { - HDfprintf(stdout, + HDfprintf(stdout, "H5C_flush_single_entry(): non-existant entry. addr = %a\n", addr); HDfflush(stdout); @@ -5737,12 +5737,12 @@ H5C_flush_single_entry(H5F_t * f, { /* we have work to do */ -#ifdef H5_HAVE_PARALLEL +#ifdef H5_HAVE_PARALLEL #ifndef NDEBUG /* If MPI based VFD is used, do special parallel I/O sanity checks. * Note that we only do these sanity checks when the clear_only flag - * is not set, and the entry to be flushed is dirty. Don't bother + * is not set, and the entry to be flushed is dirty. Don't bother * otherwise as no file I/O can result. * * There are also cases (testing for instance) where it is convenient @@ -5750,9 +5750,9 @@ H5C_flush_single_entry(H5F_t * f, * this isn't a problem -- but we do have to turn off sanity checks * involving them. We use cache_ptr->skip_dxpl_id_checks to do this. */ - if ( ( ! cache_ptr->skip_dxpl_id_checks ) && - ( ! clear_only ) && - ( entry_ptr->is_dirty ) && + if ( ( ! cache_ptr->skip_dxpl_id_checks ) && + ( ! clear_only ) && + ( entry_ptr->is_dirty ) && ( IS_H5FD_MPI(f) ) ) { H5P_genplist_t *dxpl; /* Dataset transfer property list */ @@ -5791,19 +5791,19 @@ H5C_flush_single_entry(H5F_t * f, H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) } - /* Always remove the entry from the hash table on a destroy. On a - * flush with destroy, it is cheaper to discard the skip list all at - * once rather than remove the entries one by one, so we only delete + /* Always remove the entry from the hash table on a destroy. On a + * flush with destroy, it is cheaper to discard the skip list all at + * once rather than remove the entries one by one, so we only delete * from the list if requested. * - * We must do deletions now as the callback routines will free the + * We must do deletions now as the callback routines will free the * entry if destroy is true. */ if ( destroy ) { H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr) - if ( ( entry_ptr->in_slist ) && + if ( ( entry_ptr->in_slist ) && ( del_entry_from_slist_on_destroy ) ) { H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr) @@ -5811,7 +5811,7 @@ H5C_flush_single_entry(H5F_t * f, } /* Update the replacement policy for the flush or eviction. - * Again, do this now so we don't have to reference freed + * Again, do this now so we don't have to reference freed * memory in the destroy case. */ if ( destroy ) { /* AKA eviction */ @@ -5837,21 +5837,21 @@ H5C_flush_single_entry(H5F_t * f, HDfprintf(stdout, "cache_ptr->dLRU_list_size < entry_ptr->size.\n"); - if ( ( (cache_ptr->dLRU_list_size) == entry_ptr->size ) && + if ( ( (cache_ptr->dLRU_list_size) == entry_ptr->size ) && ( ! ( (cache_ptr->dLRU_list_len) == 1 ) ) ) HDfprintf(stdout, "dLRU_list_size == size && dLRU_list_len != 1\n"); - if ( ( entry_ptr->aux_prev == NULL ) && + if ( ( entry_ptr->aux_prev == NULL ) && ( cache_ptr->dLRU_head_ptr != entry_ptr ) ) HDfprintf(stdout, "entry_ptr->aux_prev == NULL && dLRU_head_ptr != entry_ptr\n"); - if ( ( entry_ptr->aux_next == NULL ) && + if ( ( entry_ptr->aux_next == NULL ) && ( cache_ptr->dLRU_tail_ptr != entry_ptr ) ) HDfprintf(stdout, "entry_ptr->aux_next == NULL && dLRU_tail_ptr != entry_ptr\n"); if ( ( cache_ptr->dLRU_list_len == 1 ) && - ( ! ( ( cache_ptr->dLRU_head_ptr == entry_ptr ) && + ( ! ( ( cache_ptr->dLRU_head_ptr == entry_ptr ) && ( cache_ptr->dLRU_tail_ptr == entry_ptr ) && ( entry_ptr->aux_next == NULL ) && ( entry_ptr->aux_prev == NULL ) && @@ -5863,8 +5863,8 @@ H5C_flush_single_entry(H5F_t * f, HDfprintf(stdout, "single entry dlru sanity check fails\n"); } - } - else + } + else { if ( cache_ptr->cLRU_head_ptr == NULL ) HDfprintf(stdout,"cache_ptr->cLRU_head_ptr == NULL.\n"); @@ -5882,21 +5882,21 @@ H5C_flush_single_entry(H5F_t * f, HDfprintf(stdout, "cache_ptr->cLRU_list_size < entry_ptr->size.\n"); - if ( ( (cache_ptr->cLRU_list_size) == entry_ptr->size ) && + if ( ( (cache_ptr->cLRU_list_size) == entry_ptr->size ) && ( ! ( (cache_ptr->cLRU_list_len) == 1 ) ) ) HDfprintf(stdout, "cLRU_list_size == size && cLRU_list_len != 1\n"); - if ( ( entry_ptr->aux_prev == NULL ) && + if ( ( entry_ptr->aux_prev == NULL ) && ( cache_ptr->cLRU_head_ptr != entry_ptr ) ) HDfprintf(stdout, "entry_ptr->aux_prev == NULL && cLRU_head_ptr != entry_ptr\n"); - if ( ( entry_ptr->aux_next == NULL ) && + if ( ( entry_ptr->aux_next == NULL ) && ( cache_ptr->cLRU_tail_ptr != entry_ptr ) ) HDfprintf(stdout, "entry_ptr->aux_next == NULL && cLRU_tail_ptr != entry_ptr\n"); if ( ( cache_ptr->cLRU_list_len == 1 ) && - ( ! ( ( cache_ptr->cLRU_head_ptr == entry_ptr ) && + ( ! ( ( cache_ptr->cLRU_head_ptr == entry_ptr ) && ( cache_ptr->cLRU_tail_ptr == entry_ptr ) && ( entry_ptr->aux_next == NULL ) && ( entry_ptr->aux_prev == NULL ) && @@ -5928,19 +5928,19 @@ H5C_flush_single_entry(H5F_t * f, } } else { - /* Only block for all the processes on the first piece of metadata + /* Only block for all the processes on the first piece of metadata */ if ( *first_flush_ptr && entry_ptr->is_dirty ) { - status = (entry_ptr->type->flush)(f, primary_dxpl_id, destroy, + status = (entry_ptr->type->flush)(f, primary_dxpl_id, destroy, entry_ptr->addr, entry_ptr); *first_flush_ptr = FALSE; } else { - status = (entry_ptr->type->flush)(f, secondary_dxpl_id, - destroy, entry_ptr->addr, + status = (entry_ptr->type->flush)(f, secondary_dxpl_id, + destroy, entry_ptr->addr, entry_ptr); } @@ -5952,7 +5952,7 @@ H5C_flush_single_entry(H5F_t * f, } if ( ! destroy ) { - + HDassert( !(entry_ptr->is_dirty) ); HDassert( !(entry_ptr->flush_marker) ); } @@ -5974,7 +5974,7 @@ done: * return the in memory address of the entry. Return NULL * on failure. * - * Note that this function simply loads the entry into + * Note that this function simply loads the entry into * core. It does not insert it into the cache. * * Return: Non-NULL on success / NULL on failure. @@ -5990,11 +5990,11 @@ done: */ static void * -H5C_load_entry(H5F_t * f, - hid_t dxpl_id, - const H5C_class_t * type, +H5C_load_entry(H5F_t * f, + hid_t dxpl_id, + const H5C_class_t * type, haddr_t addr, - const void * udata1, + const void * udata1, void * udata2, hbool_t skip_file_checks) { @@ -6031,7 +6031,7 @@ H5C_load_entry(H5F_t * f, "Can't get size of thing") } - HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE ); + HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE ); entry_ptr->ht_next = NULL; entry_ptr->ht_prev = NULL; @@ -6060,24 +6060,24 @@ done: * Purpose: Attempt to evict cache entries until the index_size * is at least needed_space below max_cache_size. * - * In passing, also attempt to bring cLRU_list_size to a + * In passing, also attempt to bring cLRU_list_size to a * value greater than min_clean_size. * * Depending on circumstances, both of these goals may * be impossible, as in parallel mode, we must avoid generating * a write as part of a read (to avoid deadlock in collective * I/O), and in all cases, it is possible (though hopefully - * highly unlikely) that the protected list may exceed the + * highly unlikely) that the protected list may exceed the * maximum size of the cache. - * + * * Thus the function simply does its best, returning success * unless an error is encountered. * - * The primary_dxpl_id and secondary_dxpl_id parameters + * The primary_dxpl_id and secondary_dxpl_id parameters * specify the dxpl_ids used on the first write occasioned - * by the call (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the metadata - * cache, but may not be needed elsewhere. If so, just use the + * by the call (primary_dxpl_id), and on all subsequent + * writes (secondary_dxpl_id). This is useful in the metadata + * cache, but may not be needed elsewhere. If so, just use the * same dxpl_id for both parameters. * * Observe that this function cannot occasion a read. @@ -6093,7 +6093,7 @@ done: * table to facilitate lookups. * * JRM -- 11/22/04 - * Added the first_flush_ptr parameter, which replaces the + * Added the first_flush_ptr parameter, which replaces the * old first_flush local variable. This allows the function * to coordinate on the first flush issue with other functions. * @@ -6131,8 +6131,8 @@ H5C_make_space_in_cache(H5F_t * f, initial_list_len = cache_ptr->LRU_list_len; entry_ptr = cache_ptr->LRU_tail_ptr; - while ( ( (cache_ptr->index_size + space_needed) - > + while ( ( (cache_ptr->index_size + space_needed) + > cache_ptr->max_cache_size ) && @@ -6149,25 +6149,25 @@ H5C_make_space_in_cache(H5F_t * f, if ( entry_ptr->is_dirty ) { - result = H5C_flush_single_entry(f, - primary_dxpl_id, + result = H5C_flush_single_entry(f, + primary_dxpl_id, secondary_dxpl_id, cache_ptr, - entry_ptr->type, - entry_ptr->addr, - H5C__NO_FLAGS_SET, - first_flush_ptr, + entry_ptr->type, + entry_ptr->addr, + H5C__NO_FLAGS_SET, + first_flush_ptr, FALSE); } else { - result = H5C_flush_single_entry(f, - primary_dxpl_id, + result = H5C_flush_single_entry(f, + primary_dxpl_id, secondary_dxpl_id, cache_ptr, - entry_ptr->type, - entry_ptr->addr, + entry_ptr->type, + entry_ptr->addr, H5C__FLUSH_INVALIDATE_FLAG, - first_flush_ptr, + first_flush_ptr, TRUE); } } else { @@ -6203,14 +6203,14 @@ H5C_make_space_in_cache(H5F_t * f, prev_ptr = entry_ptr->aux_prev; - result = H5C_flush_single_entry(f, - primary_dxpl_id, + result = H5C_flush_single_entry(f, + primary_dxpl_id, secondary_dxpl_id, cache_ptr, - entry_ptr->type, - entry_ptr->addr, - H5C__NO_FLAGS_SET, - first_flush_ptr, + entry_ptr->type, + entry_ptr->addr, + H5C__NO_FLAGS_SET, + first_flush_ptr, FALSE); if ( result < 0 ) { @@ -6231,12 +6231,12 @@ H5C_make_space_in_cache(H5F_t * f, initial_list_len = cache_ptr->cLRU_list_len; entry_ptr = cache_ptr->cLRU_tail_ptr; - while ( ( (cache_ptr->index_size + space_needed) - > + while ( ( (cache_ptr->index_size + space_needed) + > cache_ptr->max_cache_size ) && - ( entries_examined <= initial_list_len ) + ( entries_examined <= initial_list_len ) && ( entry_ptr != NULL ) ) @@ -6246,14 +6246,14 @@ H5C_make_space_in_cache(H5F_t * f, prev_ptr = entry_ptr->aux_prev; - result = H5C_flush_single_entry(f, - primary_dxpl_id, + result = H5C_flush_single_entry(f, + primary_dxpl_id, secondary_dxpl_id, cache_ptr, - entry_ptr->type, - entry_ptr->addr, + entry_ptr->type, + entry_ptr->addr, H5C__FLUSH_INVALIDATE_FLAG, - first_flush_ptr, + first_flush_ptr, TRUE); if ( result < 0 ) { @@ -16,7 +16,7 @@ * Purpose: Provides internal function tracing in the form of a stack. * The FUNC_ENTER() macro adds the function name to the function * stack whenever a function is entered. - * As the functions return with FUNC_LEAVE, + * As the functions return with FUNC_LEAVE, * entries are removed from the stack. * * A function stack has a fixed maximum size. If this size is @@ -112,10 +112,10 @@ H5FS_print(FILE *stream) H5FS_t *fstack = H5FS_get_my_stack (); /* Get the correct function stack */ const int indent = 2; /* Indention level */ int i; /* Local index ariable */ - + /* Don't push this function on the function stack... :-) */ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_print); - + /* Sanity check */ assert(fstack); @@ -136,7 +136,7 @@ H5FS_print(FILE *stream) for (i=fstack->nused-1; i>=0; --i) HDfprintf(stream, "%*s#%03d: Routine: %s\n", indent, "", i, fstack->slot[i]); - + FUNC_LEAVE_NOAPI_NOFS(SUCCEED); } /* end H5FS_print() */ @@ -160,7 +160,7 @@ herr_t H5FS_push(const char *func_name) { H5FS_t *fstack = H5FS_get_my_stack (); - + /* Don't push this function on the function stack... :-) */ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_push); @@ -174,7 +174,7 @@ H5FS_push(const char *func_name) if (fstack->nused<H5FS_NSLOTS) fstack->slot[fstack->nused] = func_name; fstack->nused++; - + FUNC_LEAVE_NOAPI_NOFS(SUCCEED); } /* end H5FS_push() */ @@ -197,7 +197,7 @@ herr_t H5FS_pop(void) { H5FS_t *fstack = H5FS_get_my_stack (); - + /* Don't push this function on the function stack... :-) */ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_pop); @@ -207,7 +207,7 @@ H5FS_pop(void) /* Pop the function. */ fstack->nused--; - + FUNC_LEAVE_NOAPI_NOFS(SUCCEED); } /* end H5FS_pop() */ diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 2ab2e9b..54a8f48 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -16,14 +16,14 @@ * Programmer: John Mainzer -- 10/12/04 * * Purpose: This file contains declarations which are normally visible - * only within the H5C package (just H5C.c at present). + * only within the H5C package (just H5C.c at present). * - * Source files outside the H5C package should include + * Source files outside the H5C package should include * H5Cprivate.h instead. * * The one exception to this rule is test/cache.c. The test - * code is easier to write if it can look at the cache's - * internal data structures. Indeed, this is the main + * code is easier to write if it can look at the cache's + * internal data structures. Indeed, this is the main * reason why this file was created. */ @@ -50,27 +50,27 @@ * * structure H5C_t * - * Catchall structure for all variables specific to an instance of the cache. + * Catchall structure for all variables specific to an instance of the cache. * - * While the individual fields of the structure are discussed below, the + * While the individual fields of the structure are discussed below, the * following overview may be helpful. * * Entries in the cache are stored in an instance of H5TB_TREE, indexed on - * the entry's disk address. While the H5TB_TREE is less efficient than + * the entry's disk address. While the H5TB_TREE is less efficient than * hash table, it keeps the entries in address sorted order. As flushes - * in parallel mode are more efficient if they are issued in increasing + * in parallel mode are more efficient if they are issued in increasing * address order, this is a significant benefit. Also the H5TB_TREE code * was readily available, which reduced development time. * * While the cache was designed with multiple replacement policies in mind, - * at present only a modified form of LRU is supported. + * at present only a modified form of LRU is supported. * * JRM - 4/26/04 * * Profiling has indicated that searches in the instance of H5TB_TREE are - * too expensive. To deal with this issue, I have augmented the cache - * with a hash table in which all entries will be stored. Given the - * advantages of flushing entries in increasing address order, the TBBT + * too expensive. To deal with this issue, I have augmented the cache + * with a hash table in which all entries will be stored. Given the + * advantages of flushing entries in increasing address order, the TBBT * is retained, but only dirty entries are stored in it. At least for * now, we will leave entries in the TBBT after they are flushed. * @@ -83,12 +83,12 @@ * field is used to validate pointers to instances of H5C_t. * * max_type_id: Integer field containing the maximum type id number assigned - * to a type of entry in the cache. All type ids from 0 to - * max_type_id inclusive must be defined. The names of the + * to a type of entry in the cache. All type ids from 0 to + * max_type_id inclusive must be defined. The names of the * types are stored in the type_name_table discussed below, and * indexed by the ids. * - * type_name_table_ptr: Pointer to an array of pointer to char of length + * type_name_table_ptr: Pointer to an array of pointer to char of length * max_type_id + 1. The strings pointed to by the entries * in the array are the names of the entry types associated * with the indexing type IDs. @@ -103,11 +103,11 @@ * max_cache_size, it will do so. The cache will attempt * to reduce its size as entries are unprotected. * - * b) When running in parallel mode, the cache may not be - * permitted to flush a dirty entry in response to a read. - * If there are no clean entries available to evict, the - * cache will exceed its maximum size. Again the cache - * will attempt to reduce its size to the max_cache_size + * b) When running in parallel mode, the cache may not be + * permitted to flush a dirty entry in response to a read. + * If there are no clean entries available to evict, the + * cache will exceed its maximum size. Again the cache + * will attempt to reduce its size to the max_cache_size * limit on the next cache write. * * min_clean_size: Nominal minimum number of clean bytes in the cache. @@ -116,11 +116,11 @@ * a soft limit. * * - * In addition to the call back functions required for each entry, the + * In addition to the call back functions required for each entry, the * cache requires the following call back functions for this instance of * the cache as a whole: - * - * check_write_permitted: In certain applications, the cache may not + * + * check_write_permitted: In certain applications, the cache may not * be allowed to write to disk at certain time. If specified, * the check_write_permitted function is used to determine if * a write is permissible at any given point in time. @@ -132,7 +132,7 @@ * The cache requires an index to facilitate searching for entries. The * following fields support that index. * - * index_len: Number of entries currently in the hash table used to index + * index_len: Number of entries currently in the hash table used to index * the cache. * * index_size: Number of bytes of cache entries currently stored in the @@ -146,16 +146,16 @@ * * index: Array of pointer to H5C_cache_entry_t of size * H5C__HASH_TABLE_LEN. At present, this value is a power - * of two, not the usual prime number. + * of two, not the usual prime number. * - * I hope that the variable size of cache elements, the large + * I hope that the variable size of cache elements, the large * hash table size, and the way in which HDF5 allocates space - * will combine to avoid problems with periodicity. If so, we - * can use a trivial hash function (a bit-and and a 3 bit left - * shift) with some small savings. + * will combine to avoid problems with periodicity. If so, we + * can use a trivial hash function (a bit-and and a 3 bit left + * shift) with some small savings. * * If not, it will become evident in the statistics. Changing - * to the usual prime number length hash table will require + * to the usual prime number length hash table will require * changing the H5C__HASH_FCN macro and the deletion of the * H5C__HASH_MASK #define. No other changes should be required. * @@ -330,7 +330,7 @@ * Automatic cache size adjustment: * * While the default cache size is adequate for most cases, we can run into - * cases where the default is too small. Ideally, we will let the user + * cases where the default is too small. Ideally, we will let the user * adjust the cache size as required. However, this is not possible in all * cases. Thus I have added automatic cache size adjustment code. * @@ -349,25 +349,25 @@ * all the ways this can happen, we simply set this flag when * we receive a new configuration. * - * cache_full: Boolean flag used to keep track of whether the cache is - * full, so we can refrain from increasing the size of a + * cache_full: Boolean flag used to keep track of whether the cache is + * full, so we can refrain from increasing the size of a * cache which hasn't used up the space alotted to it. * * The field is initialized to FALSE, and then set to TRUE * whenever we attempt to make space in the cache. * * resize_enabled: This is another convenience flag which is set whenever - * a new set of values for resize_ctl are provided. Very - * simply, + * a new set of values for resize_ctl are provided. Very + * simply, * - * resize_enabled = size_increase_possible || + * resize_enabled = size_increase_possible || * size_decrease_possible; * - * size_decreased: Boolean flag set to TRUE whenever the maximun cache - * size is decreased. The flag triggers a call to + * size_decreased: Boolean flag set to TRUE whenever the maximun cache + * size is decreased. The flag triggers a call to * H5C_make_space_in_cache() on the next call to H5C_protect(). * - * resize_ctl: Instance of H5C_auto_size_ctl_t containing configuration + * resize_ctl: Instance of H5C_auto_size_ctl_t containing configuration * data for automatic cache resizing. * * epoch_markers_active: Integer field containing the number of epoch @@ -381,37 +381,37 @@ * epoch_marker_ringbuf: Array of int of length H5C__MAX_EPOCH_MARKERS + 1. * * To manage the epoch marker cache entries, it is necessary - * to track their order in the LRU list. This is done with - * epoch_marker_ringbuf. When markers are inserted at the - * head of the LRU list, the index of the marker in the + * to track their order in the LRU list. This is done with + * epoch_marker_ringbuf. When markers are inserted at the + * head of the LRU list, the index of the marker in the * epoch_markers array is inserted at the tail of the ring * buffer. When it becomes the epoch_marker_active'th marker * in the LRU list, it will have worked its way to the head - * of the ring buffer as well. This allows us to remove it + * of the ring buffer as well. This allows us to remove it * without scanning the LRU list if such is required. * * epoch_marker_ringbuf_first: Integer field containing the index of the * first entry in the ring buffer. * - * epoch_marker_ringbuf_last: Integer field containing the index of the + * epoch_marker_ringbuf_last: Integer field containing the index of the * last entry in the ring buffer. * * epoch_marker_ringbuf_size: Integer field containing the number of entries * in the ring buffer. - * + * * epoch_markers: Array of instances of H5C_cache_entry_t of length * H5C__MAX_EPOCH_MARKERS. The entries are used as markers * in the LRU list to identify cache entries that haven't - * been accessed for some (small) specified number of - * epochs. These entries (if any) can then be evicted and + * been accessed for some (small) specified number of + * epochs. These entries (if any) can then be evicted and * the cache size reduced -- ideally without evicting any * of the current working set. Needless to say, the epoch * length and the number of epochs before an unused entry * must be chosen so that all, or almost all, the working * set will be accessed before the limit. * - * Epoch markers only appear in the LRU list, never in - * the index or slist. While they are of type + * Epoch markers only appear in the LRU list, never in + * the index or slist. While they are of type * H5C__EPOCH_MARKER_TYPE, and have associated class * functions, these functions should never be called. * @@ -419,7 +419,7 @@ * are set to the index of the instance in the epoch_markers * array, the size is set to 0, and the type field points * to the constant structure epoch_marker_class defined - * in H5C.c. The next and prev fields are used as usual + * in H5C.c. The next and prev fields are used as usual * to link the entry into the LRU list. * * All other fields are unused. @@ -427,18 +427,18 @@ * * Cache hit rate collection fields: * - * We supply the current cache hit rate on request, so we must keep a - * simple cache hit rate computation regardless of whether statistics + * We supply the current cache hit rate on request, so we must keep a + * simple cache hit rate computation regardless of whether statistics * collection is enabled. The following fields support this capability. * - * cache_hits: Number of cache hits since the last time the cache hit - * rate statistics were reset. Note that when automatic cache - * re-sizing is enabled, this field will be reset every automatic + * cache_hits: Number of cache hits since the last time the cache hit + * rate statistics were reset. Note that when automatic cache + * re-sizing is enabled, this field will be reset every automatic * resize epoch. * * cache_accesses: Number of times the cache has been accessed while - * since the last since the last time the cache hit rate statistics - * were reset. Note that when automatic cache re-sizing is enabled, + * since the last since the last time the cache hit rate statistics + * were reset. Note that when automatic cache re-sizing is enabled, * this field will be reset every automatic resize epoch. * * @@ -448,39 +448,39 @@ * below. The first set are collected only when H5C_COLLECT_CACHE_STATS * is true. * - * hits: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type id - * equal to the array index has been in cache when requested in + * hits: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type id + * equal to the array index has been in cache when requested in * the current epoch. * - * misses: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type id - * equal to the array index has not been in cache when + * misses: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type id + * equal to the array index has not been in cache when * requested in the current epoch. * - * insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type - * id equal to the array index has been inserted into the + * insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type + * id equal to the array index has been inserted into the * cache in the current epoch. * - * clears: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type - * id equal to the array index has been cleared in the current + * clears: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type + * id equal to the array index has been cleared in the current * epoch. * - * flushes: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type id + * flushes: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type id * equal to the array index has been written to disk in the * current epoch. * - * evictions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type id - * equal to the array index has been evicted from the cache in + * evictions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type id + * equal to the array index has been evicted from the cache in * the current epoch. * - * renames: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type - * id equal to the array index has been renamed in the current + * renames: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type + * id equal to the array index has been renamed in the current * epoch. * * total_ht_insertions: Number of times entries have been inserted into the @@ -489,10 +489,10 @@ * total_ht_deletions: Number of times entries have been deleted from the * hash table in the current epoch. * - * successful_ht_searches: int64 containing the total number of successful + * successful_ht_searches: int64 containing the total number of successful * searches of the hash table in the current epoch. * - * total_successful_ht_search_depth: int64 containing the total number of + * total_successful_ht_search_depth: int64 containing the total number of * entries other than the targets examined in successful * searches of the hash table in the current epoch. * @@ -500,7 +500,7 @@ * searches of the hash table in the current epoch. * * total_failed_ht_search_depth: int64 containing the total number of - * entries examined in unsuccessful searches of the hash + * entries examined in unsuccessful searches of the hash * table in the current epoch. * * max_index_len: Largest value attained by the index_len field in the @@ -524,28 +524,28 @@ * The remaining stats are collected only when both H5C_COLLECT_CACHE_STATS * and H5C_COLLECT_CACHE_ENTRY_STATS are true. * - * max_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the maximum number of times any single - * entry with type id equal to the array index has been + * max_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the maximum number of times any single + * entry with type id equal to the array index has been * accessed in the current epoch. * - * min_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the minimum number of times any single - * entry with type id equal to the array index has been + * min_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the minimum number of times any single + * entry with type id equal to the array index has been * accessed in the current epoch. * - * max_clears: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the maximum number of times any single - * entry with type id equal to the array index has been cleared + * max_clears: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the maximum number of times any single + * entry with type id equal to the array index has been cleared * in the current epoch. * - * max_flushes: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the maximum number of times any single - * entry with type id equal to the array index has been + * max_flushes: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the maximum number of times any single + * entry with type id equal to the array index has been * flushed in the current epoch. * * max_size: Array of size_t of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the maximum size of any single entry + * are used to record the maximum size of any single entry * with type id equal to the array index that has resided in * the cache in the current epoch. * @@ -563,9 +563,9 @@ * When this flag is set, all sanity checks on the file * parameters are skipped. The field defaults to FALSE. * - * skip_dxpl_id_checks: Boolean flag used to skip sanity checks on the + * skip_dxpl_id_checks: Boolean flag used to skip sanity checks on the * dxpl_id parameters passed to the cache. These are not - * used directly by the cache, so skipping the checks + * used directly by the cache, so skipping the checks * simplifies the test bed. * * When this flag is set, all sanity checks on the dxpl_id diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index ed3f394..7c0151b 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -51,10 +51,10 @@ #define H5C_COLLECT_CACHE_STATS 0 /* H5C_COLLECT_CACHE_ENTRY_STATS controls collection of statistics - * in individual cache entries. - * - * H5C_COLLECT_CACHE_ENTRY_STATS should only be defined to true if - * H5C_COLLECT_CACHE_STATS is also defined to true. + * in individual cache entries. + * + * H5C_COLLECT_CACHE_ENTRY_STATS should only be defined to true if + * H5C_COLLECT_CACHE_STATS is also defined to true. */ #if H5C_COLLECT_CACHE_STATS @@ -114,23 +114,23 @@ typedef struct H5C_t H5C_t; * Note that the space allocated on disk may not be contiguous. */ -typedef void *(*H5C_load_func_t)(H5F_t *f, - hid_t dxpl_id, - haddr_t addr, - const void *udata1, +typedef void *(*H5C_load_func_t)(H5F_t *f, + hid_t dxpl_id, + haddr_t addr, + const void *udata1, void *udata2); -typedef herr_t (*H5C_flush_func_t)(H5F_t *f, - hid_t dxpl_id, - hbool_t dest, - haddr_t addr, +typedef herr_t (*H5C_flush_func_t)(H5F_t *f, + hid_t dxpl_id, + hbool_t dest, + haddr_t addr, void *thing); -typedef herr_t (*H5C_dest_func_t)(H5F_t *f, +typedef herr_t (*H5C_dest_func_t)(H5F_t *f, void *thing); -typedef herr_t (*H5C_clear_func_t)(H5F_t *f, - void *thing, +typedef herr_t (*H5C_clear_func_t)(H5F_t *f, + void *thing, hbool_t dest); -typedef herr_t (*H5C_size_func_t)(const H5F_t *f, - const void *thing, +typedef herr_t (*H5C_size_func_t)(const H5F_t *f, + const void *thing, size_t *size_ptr); typedef struct H5C_class_t { @@ -153,8 +153,8 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * out of a hat -- you should be able to change them as necessary. * * However, if you need a very big cache, you should also increase the - * size of the hash table (H5C__HASH_TABLE_LEN in H5Cpkg.h). The current - * upper bound on cache size is rather large for the current hash table + * size of the hash table (H5C__HASH_TABLE_LEN in H5Cpkg.h). The current + * upper bound on cache size is rather large for the current hash table * size. */ @@ -174,11 +174,11 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * * structure H5C_cache_entry_t * - * Instances of the H5C_cache_entry_t structure are used to store cache - * entries in a hash table and sometimes in a skip list. + * Instances of the H5C_cache_entry_t structure are used to store cache + * entries in a hash table and sometimes in a skip list. * See H5SL.c for the particulars of the skip list. * - * In typical application, this structure is the first field in a + * In typical application, this structure is the first field in a * structure to be cached. For historical reasons, the external module * is responsible for managing the is_dirty field. All other fields are * managed by the cache. @@ -212,12 +212,12 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * * NOTE: For historical reasons, this field is not maintained * by the cache. Instead, the module using the cache - * sets this flag when it modifies the entry, and the + * sets this flag when it modifies the entry, and the * flush and clear functions supplied by that module * reset the dirty when appropriate. * * This is a bit quirky, so we may want to change this - * someday. However it will require a change in the + * someday. However it will require a change in the * cache interface. * * is_protected: Boolean flag indicating whether this entry is protected @@ -235,7 +235,7 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * being flushed. * * flush_marker: Boolean flag indicating that the entry is to be flushed - * the next time H5C_flush_cache() is called with the + * the next time H5C_flush_cache() is called with the * H5AC__FLUSH_MARKED_ENTRIES_FLAG. The flag is reset when * the entry is flushed for whatever reason. * @@ -248,63 +248,63 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * * ht_next: Next pointer used by the hash table to store multiple * entries in a single hash bin. This field points to the - * next entry in the doubly linked list of entries in the + * next entry in the doubly linked list of entries in the * hash bin, or NULL if there is no next entry. * * ht_prev: Prev pointer used by the hash table to store multiple * entries in a single hash bin. This field points to the - * previous entry in the doubly linked list of entries in + * previous entry in the doubly linked list of entries in * the hash bin, or NULL if there is no previuos entry. * * * Fields supporting replacement policies: * - * The cache must have a replacement policy, and it will usually be + * The cache must have a replacement policy, and it will usually be * necessary for this structure to contain fields supporting that policy. * - * While there has been interest in several replacement policies for + * While there has been interest in several replacement policies for * this cache, the initial development schedule is tight. Thus I have * elected to support only a modified LRU policy for the first cut. * * When additional replacement policies are added, the fields in this - * section will be used in different ways or not at all. Thus the + * section will be used in different ways or not at all. Thus the * documentation of these fields is repeated for each replacement policy. - * + * * Modified LRU: - * + * * When operating in parallel mode, we must ensure that a read does not * cause a write. If it does, the process will hang, as the write will * be collective and the other processes will not know to participate. * * To deal with this issue, I have modified the usual LRU policy by adding - * clean and dirty LRU lists to the usual LRU list. When reading in + * clean and dirty LRU lists to the usual LRU list. When reading in * parallel mode, we evict from the clean LRU list only. This implies - * that we must try to ensure that the clean LRU list is reasonably well + * that we must try to ensure that the clean LRU list is reasonably well * stocked. See the comments on H5C_t in H5Cpkg.h for more details. - * + * * Note that even if we start with a completely clean cache, a sequence * of protects without unprotects can empty the clean LRU list. In this - * case, the cache must grow temporarily. At the next write, we will + * case, the cache must grow temporarily. At the next write, we will * attempt to evict enough entries to get the cache down to its nominal * maximum size. * * The use of the replacement policy fields under the Modified LRU policy * is discussed below: * - * next: Next pointer in either the LRU or the protected list, - * depending on the current value of protected. If there - * is no next entry on the list, this field should be set + * next: Next pointer in either the LRU or the protected list, + * depending on the current value of protected. If there + * is no next entry on the list, this field should be set * to NULL. * - * prev: Prev pointer in either the LRU or the protected list, - * depending on the current value of protected. If there - * is no previous entry on the list, this field should be + * prev: Prev pointer in either the LRU or the protected list, + * depending on the current value of protected. If there + * is no previous entry on the list, this field should be * set to NULL. * * aux_next: Next pointer on either the clean or dirty LRU lists. * This entry should be NULL when protected is true. When * protected is false, and dirty is true, it should point - * to the next item on the dirty LRU list. When protected + * to the next item on the dirty LRU list. When protected * is false, and dirty is false, it should point to the * next item on the clean LRU list. In either case, when * there is no next item, it should be NULL. @@ -312,7 +312,7 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * aux_prev: Previous pointer on either the clean or dirty LRU lists. * This entry should be NULL when protected is true. When * protected is false, and dirty is true, it should point - * to the previous item on the dirty LRU list. When protected + * to the previous item on the dirty LRU list. When protected * is false, and dirty is false, it should point to the * previous item on the clean LRU list. In either case, when * there is no previous item, it should be NULL. @@ -322,7 +322,7 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * * These fields should only be compiled in when both H5C_COLLECT_CACHE_STATS * and H5C_COLLECT_CACHE_ENTRY_STATS are true. When present, they allow - * collection of statistics on individual cache entries. + * collection of statistics on individual cache entries. * * accesses: int32_t containing the number of times this cache entry has * been referenced in its lifetime. @@ -331,8 +331,8 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * been cleared in its life time. * * flushes: int32_t containing the number of times this cache entry has - * been flushed to file in its life time. - * + * been flushed to file in its life time. + * ****************************************************************************/ typedef struct H5C_cache_entry_t @@ -367,7 +367,7 @@ typedef struct H5C_cache_entry_t #endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ -} H5C_cache_entry_t; +} H5C_cache_entry_t; /**************************************************************************** @@ -375,13 +375,13 @@ typedef struct H5C_cache_entry_t * structure H5C_auto_size_ctl_t * * Instances of H5C_auto_size_ctl_t are used to get and set the control - * fields for automatic cache re-sizing. + * fields for automatic cache re-sizing. * * The fields of the structure are discussed individually below: * - * version: Integer field containing the version number of this version - * of the H5C_auto_size_ctl_t structure. Any instance of - * H5C_auto_size_ctl_t passed to the cache must have a known + * version: Integer field containing the version number of this version + * of the H5C_auto_size_ctl_t structure. Any instance of + * H5C_auto_size_ctl_t passed to the cache must have a known * version number, or an error will be flagged. * * report_fcn: Pointer to the function that is to be called to report @@ -391,9 +391,9 @@ typedef struct H5C_cache_entry_t * If the field is not NULL, it must contain the address of a function * of type H5C_auto_resize_report_fcn. * - * set_initial_size: Boolean flag indicating whether the size of the - * initial size of the cache is to be set to the value given in - * the initial_size field. If set_initial_size is FALSE, the + * set_initial_size: Boolean flag indicating whether the size of the + * initial size of the cache is to be set to the value given in + * the initial_size field. If set_initial_size is FALSE, the * initial_size field is ignored. * * initial_size: If enabled, this field contain the size the cache is @@ -404,21 +404,21 @@ typedef struct H5C_cache_entry_t * of the cache that is to be kept clean. This field is only used * in parallel mode. Typical values are 0.1 to 0.5. * - * max_size: Maximum size to which the cache can be adjusted. The + * max_size: Maximum size to which the cache can be adjusted. The * supplied value must fall in the closed interval - * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, max_size must + * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, max_size must * be greater than or equal to min_size. * * min_size: Minimum size to which the cache can be adjusted. The * supplied value must fall in the closed interval - * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, min_size must + * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, min_size must * be less than or equal to max_size. * * epoch_length: Number of accesses on the cache over which to collect * hit rate stats before running the automatic cache resize code, - * if it is enabled. - * - * At the end of an epoch, we discard prior hit rate data and start + * if it is enabled. + * + * At the end of an epoch, we discard prior hit rate data and start * collecting afresh. The epoch_length must lie in the closed * interval [H5C__MIN_AR_EPOCH_LENGTH, H5C__MAX_AR_EPOCH_LENGTH]. * @@ -429,15 +429,15 @@ typedef struct H5C_cache_entry_t * value indicates how we determine whether the cache size should be * increased. At present there are two possible values: * - * H5C_incr__off: Don't attempt to increase the size of the cache + * H5C_incr__off: Don't attempt to increase the size of the cache * automatically. * * When this increment mode is selected, the remaining fields * in the cache size increase section ar ignored. * - * H5C_incr__threshold: Attempt to increase the size of the cache - * whenever the average hit rate over the last epoch drops - * below the value supplied in the lower_hr_threshold + * H5C_incr__threshold: Attempt to increase the size of the cache + * whenever the average hit rate over the last epoch drops + * below the value supplied in the lower_hr_threshold * field. * * Note that this attempt will fail if the cache is already @@ -445,9 +445,9 @@ typedef struct H5C_cache_entry_t * all available space. * * lower_hr_threshold: Lower hit rate threshold. If the increment mode - * (incr_mode) is H5C_incr__threshold and the hit rate drops below the - * value supplied in this field in an epoch, increment the cache size by - * size_increment. Note that cache size may not be incremented above + * (incr_mode) is H5C_incr__threshold and the hit rate drops below the + * value supplied in this field in an epoch, increment the cache size by + * size_increment. Note that cache size may not be incremented above * max_size, and that the increment may be further restricted by the * max_increment field if it is enabled. * @@ -460,73 +460,73 @@ typedef struct H5C_cache_entry_t * The increment must be greater than 1.0, and should not exceed 2.0. * * The new cache size is obtained by multiplying the current max cache - * size by the increment, and then clamping to max_size and to stay + * size by the increment, and then clamping to max_size and to stay * within the max_increment as necessary. * * apply_max_increment: Boolean flag indicating whether the max_increment * field should be used to limit the maximum cache size increment. * - * max_increment: If enabled by the apply_max_increment field described - * above, this field contains the maximum number of bytes by which the - * cache size can be increased in a single re-size. + * max_increment: If enabled by the apply_max_increment field described + * above, this field contains the maximum number of bytes by which the + * cache size can be increased in a single re-size. * * * Cache size decrease control fields: * - * decr_mode: Instance of the H5C_cache_decr_mode enumerated type whose + * decr_mode: Instance of the H5C_cache_decr_mode enumerated type whose * value indicates how we determine whether the cache size should be * decreased. At present there are four possibilities. * - * H5C_decr__off: Don't attempt to decrease the size of the cache + * H5C_decr__off: Don't attempt to decrease the size of the cache * automatically. * * When this increment mode is selected, the remaining fields * in the cache size decrease section are ignored. * - * H5C_decr__threshold: Attempt to decrease the size of the cache - * whenever the average hit rate over the last epoch rises - * above the value supplied in the upper_hr_threshold + * H5C_decr__threshold: Attempt to decrease the size of the cache + * whenever the average hit rate over the last epoch rises + * above the value supplied in the upper_hr_threshold * field. * - * H5C_decr__age_out: At the end of each epoch, search the cache for - * entries that have not been accessed for at least the number + * H5C_decr__age_out: At the end of each epoch, search the cache for + * entries that have not been accessed for at least the number * of epochs specified in the epochs_before_eviction field, and - * evict these entries. Conceptually, the maximum cache size + * evict these entries. Conceptually, the maximum cache size * is then decreased to match the new actual cache size. However, - * this reduction may be modified by the min_size, the + * this reduction may be modified by the min_size, the * max_decrement, and/or the empty_reserve. * - * H5C_decr__age_out_with_threshold: Same as age_out, but we only - * attempt to reduce the cache size when the hit rate observed - * over the last epoch exceeds the value provided in the + * H5C_decr__age_out_with_threshold: Same as age_out, but we only + * attempt to reduce the cache size when the hit rate observed + * over the last epoch exceeds the value provided in the * upper_hr_threshold field. * * upper_hr_threshold: Upper hit rate threshold. The use of this field * varies according to the current decr_mode: * - * H5C_decr__off or H5C_decr__age_out: The value of this field is + * H5C_decr__off or H5C_decr__age_out: The value of this field is * ignored. * - * H5C_decr__threshold: If the hit rate exceeds this threshold in any + * H5C_decr__threshold: If the hit rate exceeds this threshold in any * epoch, attempt to decrement the cache size by size_decrement. * * Note that cache size may not be decremented below min_size. * - * Note also that if the upper_threshold is 1.0, the cache size + * Note also that if the upper_threshold is 1.0, the cache size * will never be reduced. * - * H5C_decr__age_out_with_threshold: If the hit rate exceeds this - * threshold in any epoch, attempt to reduce the cache size - * by evicting entries that have not been accessed for more + * H5C_decr__age_out_with_threshold: If the hit rate exceeds this + * threshold in any epoch, attempt to reduce the cache size + * by evicting entries that have not been accessed for more * than the specified number of epochs. * - * decrement: This field is only used when the decr_mode is + * decrement: This field is only used when the decr_mode is * H5C_decr__threshold. * - * The field is a double containing the multiplier used to derive the - * new cache size from the old if a cache size decrement is triggered. + * The field is a double containing the multiplier used to derive the + * new cache size from the old if a cache size decrement is triggered. * The decrement must be in the range 0.0 (in which case the cache will - * try to contract to its minimum size) to 1.0 (in which case the + * try to contract to its minimum size) to 1.0 (in which case the * cache will never shrink). * * apply_max_decrement: Boolean flag used to determine whether decrements @@ -537,21 +537,21 @@ typedef struct H5C_cache_entry_t * restricted by the min_size of the cache, and (in age out modes) by * the empty_reserve field. * - * epochs_before_eviction: Integer field used in H5C_decr__age_out and + * epochs_before_eviction: Integer field used in H5C_decr__age_out and * H5C_decr__age_out_with_threshold decrement modes. * - * This field contains the number of epochs an entry must remain - * unaccessed before it is evicted in an attempt to reduce the + * This field contains the number of epochs an entry must remain + * unaccessed before it is evicted in an attempt to reduce the * cache size. If applicable, this field must lie in the range * [1, H5C__MAX_EPOCH_MARKERS]. * * apply_empty_reserve: Boolean field controlling whether the empty_reserve - * field is to be used in computing the new cache size when the + * field is to be used in computing the new cache size when the * decr_mode is H5C_decr__age_out or H5C_decr__age_out_with_threshold. * * empty_reserve: To avoid a constant racheting down of cache size by small - * amounts in the H5C_decr__age_out and H5C_decr__age_out_with_threshold - * modes, this field allows one to require that any cache size + * amounts in the H5C_decr__age_out and H5C_decr__age_out_with_threshold + * modes, this field allows one to require that any cache size * reductions leave the specified fraction of unused space in the cache. * * The value of this field must be in the range [0.0, 1.0]. I would @@ -639,7 +639,7 @@ typedef struct H5C_auto_size_ctl_t hbool_t apply_max_increment; size_t max_increment; - + /* size decrease control fields: */ enum H5C_cache_decr_mode decr_mode; @@ -663,7 +663,7 @@ typedef struct H5C_auto_size_ctl_t * Library prototypes. */ -/* #defines of flags used in the flags parameters in some of the +/* #defines of flags used in the flags parameters in some of the * following function calls. Note that not all flags are applicable * to all function calls. Flags that don't apply to a particular * function are ignored in that function. @@ -34,7 +34,7 @@ /* Local functions */ static herr_t H5D_init_storage(H5D_t *dataset, hbool_t full_overwrite, hid_t dxpl_id); static H5D_shared_t * H5D_new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type); -static H5D_t * H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, +static H5D_t * H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t dxpl_id); static H5D_t * H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id); static herr_t H5D_get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id); @@ -115,7 +115,7 @@ NAME H5D_init_interface -- Initialize interface-specific information USAGE herr_t H5D_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -150,26 +150,26 @@ H5D_init_interface(void) * - Default value for filter callback * - Default value for datatype conversion callback */ - H5P_genclass_t *xfer_pclass; + H5P_genclass_t *xfer_pclass; size_t def_max_temp_buf = H5D_XFER_MAX_TEMP_BUF_DEF; void *def_tconv_buf = H5D_XFER_TCONV_BUF_DEF; - void *def_bkgr_buf = H5D_XFER_BKGR_BUF_DEF; - H5T_bkg_t def_bkgr_buf_type = H5D_XFER_BKGR_BUF_TYPE_DEF; + void *def_bkgr_buf = H5D_XFER_BKGR_BUF_DEF; + H5T_bkg_t def_bkgr_buf_type = H5D_XFER_BKGR_BUF_TYPE_DEF; double def_btree_split_ratio[3] = H5D_XFER_BTREE_SPLIT_RATIO_DEF; - H5MM_allocate_t def_vlen_alloc = H5D_XFER_VLEN_ALLOC_DEF; + H5MM_allocate_t def_vlen_alloc = H5D_XFER_VLEN_ALLOC_DEF; void *def_vlen_alloc_info = H5D_XFER_VLEN_ALLOC_INFO_DEF; - H5MM_free_t def_vlen_free = H5D_XFER_VLEN_FREE_DEF; + H5MM_free_t def_vlen_free = H5D_XFER_VLEN_FREE_DEF; void *def_vlen_free_info = H5D_XFER_VLEN_FREE_INFO_DEF; - hid_t def_vfl_id = H5D_XFER_VFL_ID_DEF; - void *def_vfl_info = H5D_XFER_VFL_INFO_DEF; - size_t def_hyp_vec_size = H5D_XFER_HYPER_VECTOR_SIZE_DEF; + hid_t def_vfl_id = H5D_XFER_VFL_ID_DEF; + void *def_vfl_info = H5D_XFER_VFL_INFO_DEF; + size_t def_hyp_vec_size = H5D_XFER_HYPER_VECTOR_SIZE_DEF; #ifdef H5_HAVE_PARALLEL H5FD_mpio_xfer_t def_io_xfer_mode = H5D_XFER_IO_XFER_MODE_DEF; #endif /* H5_HAVE_PARALLEL */ H5Z_EDC_t enable_edc = H5D_XFER_EDC_DEF; H5Z_cb_t filter_cb = H5D_XFER_FILTER_CB_DEF; H5T_conv_cb_t conv_cb = H5D_XFER_CONV_CB_DEF; - void *def_xfer_xform = H5D_XFER_XFORM_DEF; + void *def_xfer_xform = H5D_XFER_XFORM_DEF; /* Dataset creation property class variables. In sequence, they are, * - Creation property list class to modify @@ -187,7 +187,7 @@ H5D_init_interface(void) H5O_fill_t fill = H5D_CRT_FILL_VALUE_DEF; H5D_alloc_time_t alloc_time = H5D_CRT_ALLOC_TIME_DEF; unsigned alloc_time_state = H5D_CRT_ALLOC_TIME_STATE_DEF; - H5D_fill_time_t fill_time = H5D_CRT_FILL_TIME_DEF; + H5D_fill_time_t fill_time = H5D_CRT_FILL_TIME_DEF; H5O_efl_t efl = H5D_CRT_EXT_FILE_LIST_DEF; H5O_pline_t pline = H5D_CRT_DATA_PIPELINE_DEF; @@ -201,7 +201,7 @@ H5D_init_interface(void) if (H5I_register_type(H5I_DATASET, H5I_DATASETID_HASHSIZE, H5D_RESERVED_ATOMS, (H5I_free_t)H5D_close)<H5I_FILE) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize interface") - /* =========Dataset Transfer Property Class Initialization========= */ + /* =========Dataset Transfer Property Class Initialization========= */ /* Register the default dataset transfer properties */ assert(H5P_CLS_DATASET_XFER_g!=(-1)); @@ -272,11 +272,11 @@ H5D_init_interface(void) /* Register the EDC property */ if(H5P_register(xfer_pclass,H5D_XFER_EDC_NAME,H5D_XFER_EDC_SIZE,&enable_edc,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - + /* Register the filter callback property */ if(H5P_register(xfer_pclass,H5D_XFER_FILTER_CB_NAME,H5D_XFER_FILTER_CB_SIZE,&filter_cb,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - + /* Register the type conversion callback property */ if(H5P_register(xfer_pclass,H5D_XFER_CONV_CB_NAME,H5D_XFER_CONV_CB_SIZE,&conv_cb,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -296,29 +296,29 @@ H5D_init_interface(void) /* =========Dataset Creation Property Class Initialization========== */ /* Register the default dataset creation properties */ assert(H5P_CLS_DATASET_CREATE_g != -1); - + /* Get the pointer to the dataset creation class */ if(NULL == (crt_pclass = H5I_object(H5P_CLS_DATASET_CREATE_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class") - + /* Get the number of properties in the class */ if(H5P_get_nprops_pclass(crt_pclass,&nprops,FALSE)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't query number of properties") /* Assume that if there are properties in the class, they are the default ones */ if(nprops==0) { - /* Register the storage layout property */ + /* Register the storage layout property */ if(H5P_register(crt_pclass, H5D_CRT_LAYOUT_NAME, H5D_CRT_LAYOUT_SIZE, &layout, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - + /* Register the chunking dimensionality property */ if(H5P_register(crt_pclass, H5D_CRT_CHUNK_DIM_NAME, H5D_CRT_CHUNK_DIM_SIZE, &chunk_ndims, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - /* Register the chunking size property */ + /* Register the chunking size property */ if(H5P_register(crt_pclass, H5D_CRT_CHUNK_SIZE_NAME, H5D_CRT_CHUNK_SIZE_SIZE, chunk_size, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - + /* Register the fill value property */ if(H5P_register(crt_pclass, H5D_CRT_FILL_VALUE_NAME, H5D_CRT_FILL_VALUE_SIZE, &fill, NULL, NULL, NULL, NULL, NULL, H5D_CRT_FILL_VALUE_CMP, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -338,7 +338,7 @@ H5D_init_interface(void) /* Register the external file list property */ if(H5P_register(crt_pclass, H5D_CRT_EXT_FILE_LIST_NAME, H5D_CRT_EXT_FILE_LIST_SIZE, &efl, NULL, NULL, NULL, NULL, NULL, H5D_CRT_EXT_FILE_LIST_CMP, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - + /* Register the data pipeline property */ if(H5P_register(crt_pclass, H5D_CRT_DATA_PIPELINE_NAME, H5D_CRT_DATA_PIPELINE_SIZE, &pline, NULL, NULL, NULL, NULL, NULL, H5D_CRT_DATA_PIPELINE_CMP, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -453,12 +453,12 @@ H5D_term_interface(void) /*------------------------------------------------------------------------- * Function: H5D_xfer_xform_del * - * Purpose: Frees memory allocated by H5D_xfer_xform_set + * Purpose: Frees memory allocated by H5D_xfer_xform_set * * Return: Success: SUCCEED, Failure: FAIL * * Programmer: Leon Arber larber@uiuc.edu - * + * * * Date: April 9, 2004 * @@ -473,11 +473,11 @@ static herr_t H5D_xfer_xform_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UNUSED size, void *value) { herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5D_xfer_xform_del, FAIL) assert(value); - + if(H5Z_xform_destroy(*(H5Z_data_xform_t **)value)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCLOSEOBJ, FAIL, "error closing the parse tree") @@ -495,7 +495,7 @@ done: * Return: Success: SUCCEED, Failure: FAIL * * Programmer: Leon Arber larber@uiuc.edu - * + * * * Date: April 9, 2004 * @@ -510,7 +510,7 @@ static herr_t H5D_xfer_xform_copy(const char UNUSED *name, size_t UNUSED size, void *value) { herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5D_xfer_xform_copy, FAIL) if(H5Z_xform_copy((H5Z_data_xform_t **)value)<0) @@ -544,11 +544,11 @@ static herr_t H5D_xfer_xform_close(const char UNUSED *name, size_t UNUSED size, void *value) { herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5D_xfer_xform_close, FAIL) - + assert(value); - + if(H5Z_xform_destroy(*(H5Z_data_xform_t **)value)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCLOSEOBJ, FAIL, "error closing the parse tree") @@ -560,7 +560,7 @@ done: /*------------------------------------------------------------------------- * Function: H5D_crt_copy * - * Purpose: Callback routine which is called whenever any dataset + * Purpose: Callback routine which is called whenever any dataset * creation property list is copied. This routine copies * the properties from the old list to the new list. * @@ -571,7 +571,7 @@ done: * Programmer: Raymond Lu * Tuesday, October 2, 2001 * - * Modification: + * Modification: * *------------------------------------------------------------------------- */ @@ -596,7 +596,7 @@ H5D_crt_copy(hid_t new_plist_id, hid_t old_plist_id, void UNUSED *copy_data) /* Get the fill value, external file list, and data pipeline properties * from the old property list */ - if(H5P_get(old_plist, H5D_CRT_FILL_VALUE_NAME, &src_fill) < 0) + if(H5P_get(old_plist, H5D_CRT_FILL_VALUE_NAME, &src_fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value") if(H5P_get(old_plist, H5D_CRT_EXT_FILE_LIST_NAME, &src_efl) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list") @@ -613,12 +613,12 @@ H5D_crt_copy(hid_t new_plist_id, hid_t old_plist_id, void UNUSED *copy_data) dst_fill.size = src_fill.size; } HDmemset(&dst_efl,0,sizeof(H5O_efl_t)); - if(NULL==H5O_copy(H5O_EFL_ID, &src_efl, &dst_efl)) + if(NULL==H5O_copy(H5O_EFL_ID, &src_efl, &dst_efl)) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't copy external file list") - if(NULL==H5O_copy(H5O_PLINE_ID, &src_pline, &dst_pline)) + if(NULL==H5O_copy(H5O_PLINE_ID, &src_pline, &dst_pline)) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't copy data pipeline") - /* Set the fill value, external file list, and data pipeline property + /* Set the fill value, external file list, and data pipeline property * for the new property list */ if(H5P_set(new_plist, H5D_CRT_FILL_VALUE_NAME, &dst_fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set fill value") @@ -668,7 +668,7 @@ H5D_crt_close(hid_t dcpl_id, void UNUSED *close_data) /* Get the fill value, external file list, and data pipeline properties * from the old property list */ - if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) + if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value") if(H5P_get(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list") @@ -702,7 +702,7 @@ done: * Programmer: Quincey Koziol * Wednesday, January 7, 2004 * - * Modification: + * Modification: * *------------------------------------------------------------------------- */ @@ -758,7 +758,7 @@ done: * Programmer: Quincey Koziol * Wednesday, January 7, 2004 * - * Modification: + * Modification: * *------------------------------------------------------------------------- */ @@ -840,7 +840,7 @@ done: * Programmer: Quincey Koziol * Wednesday, January 7, 2004 * - * Modification: + * Modification: * *------------------------------------------------------------------------- */ @@ -973,7 +973,7 @@ done: /*------------------------------------------------------------------------- * Function: H5D_xfer_copy * - * Purpose: Callback routine which is called whenever any dataset + * Purpose: Callback routine which is called whenever any dataset * transfer property list is copied. This routine copies * the properties from the old list to the new list. * @@ -984,7 +984,7 @@ done: * Programmer: Raymond Lu * Tuesday, October 2, 2001 * - * Modification: + * Modification: * *------------------------------------------------------------------------- */ @@ -1010,7 +1010,7 @@ H5D_xfer_copy(hid_t new_dxpl_id, hid_t old_dxpl_id, void UNUSED *copy_data) HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve VFL driver ID") if(H5P_get(old_plist, H5D_XFER_VFL_INFO_NAME, &driver_info)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get drver info") - + if(driver_id > 0) { /* Set the driver for the property list */ if(H5FD_dxpl_open(new_plist, driver_id, driver_info)<0) @@ -1148,13 +1148,13 @@ done: * Failure: FAIL * * Errors: - * ARGS BADTYPE Not a data space. - * ARGS BADTYPE Not a dataset creation plist. - * ARGS BADTYPE Not a file. - * ARGS BADTYPE Not a type. - * ARGS BADVALUE No name. - * DATASET CANTINIT Can't create dataset. - * DATASET CANTREGISTER Can't register dataset. + * ARGS BADTYPE Not a data space. + * ARGS BADTYPE Not a dataset creation plist. + * ARGS BADTYPE Not a file. + * ARGS BADTYPE Not a type. + * ARGS BADVALUE No name. + * DATASET CANTINIT Can't create dataset. + * DATASET CANTREGISTER Can't register dataset. * * Programmer: Robb Matzke * Wednesday, December 3, 1997 @@ -1248,7 +1248,7 @@ H5Dopen(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - + /* Find the dataset object */ if (H5G_find(loc, name, NULL, &ent, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL, "not found") @@ -1291,8 +1291,8 @@ done: * Return: Non-negative on success/Negative on failure * * Errors: - * ARGS BADTYPE Not a dataset. - * DATASET CANTINIT Can't free. + * ARGS BADTYPE Not a dataset. + * DATASET CANTINIT Can't free. * * Programmer: Robb Matzke * Thursday, December 4, 1997 @@ -1329,7 +1329,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Dget_space + * Function: H5Dget_space * * Purpose: Returns a copy of the file data space for a dataset. * @@ -1354,7 +1354,7 @@ H5Dget_space(hid_t dset_id) H5D_t *dset = NULL; H5S_t *space = NULL; hid_t ret_value; - + FUNC_ENTER_API(H5Dget_space, FAIL) H5TRACE1("i","i",dset_id); @@ -1387,9 +1387,9 @@ done: * * Purpose: Returns the status of data space allocation. * - * Return: + * Return: * Success: Non-negative - * + * * Failture: Negative * * Programmer: Raymond Lu @@ -1512,11 +1512,11 @@ done: hid_t H5Dget_type(hid_t dset_id) { - + H5D_t *dset = NULL; H5T_t *copied_type = NULL; hid_t ret_value = FAIL; - + FUNC_ENTER_API(H5Dget_type, FAIL) H5TRACE1("i","i",dset_id); @@ -1535,7 +1535,7 @@ H5Dget_type(hid_t dset_id) /* Unlock copied type */ if (H5T_lock (copied_type, FALSE)<0) HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to lock transient data type") - + /* Create an atom */ if ((ret_value=H5I_register (H5I_DATATYPE, copied_type))<0) HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register data type") @@ -1567,10 +1567,10 @@ done: * Tuesday, February 3, 1998 * * Modifications: - * + * * Raymond Lu * Tuesday, October 2, 2001 - * The way to retrieve and set property is changed for the + * The way to retrieve and set property is changed for the * generic property list. * *------------------------------------------------------------------------- @@ -1584,7 +1584,7 @@ H5Dget_create_plist(hid_t dset_id) H5P_genplist_t *new_plist; hid_t new_dcpl_id = FAIL; hid_t ret_value = FAIL; - + FUNC_ENTER_API(H5Dget_create_plist, FAIL) H5TRACE1("i","i",dset_id); @@ -1647,7 +1647,7 @@ H5Dextend(hid_t dset_id, const hsize_t *size) { H5D_t *dset = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Dextend, FAIL) H5TRACE2("e","i*h",dset_id,size); @@ -1695,7 +1695,7 @@ H5D_new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type) H5P_genplist_t *plist; /* Property list created */ H5D_shared_t *new_dset = NULL; /* New dataset object */ H5D_shared_t *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_new) if (NULL==(new_dset = H5FL_MALLOC(H5D_shared_t))) @@ -1754,7 +1754,7 @@ done: * Thursday, June 24, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1828,10 +1828,10 @@ done: * Modifications: * * John Mainzer 6/6/05 - * Modified function to use the new dirtied parameter of + * Modified function to use the new dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * field of the cache info directly. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1939,7 +1939,7 @@ H5D_update_entry_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, H5P_genplist_t *p fill.alloc_time = alloc_time; fill.fill_time = fill_time; - + if (fill.fill_defined == FALSE && fill_time == H5D_FILL_TIME_ALLOC) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT,FAIL, "unable to create dataset") @@ -2032,7 +2032,7 @@ H5D_update_entry_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, H5P_genplist_t *p if (H5O_bogus_oh(file, dxpl_id, oh))<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to update 'bogus' message") #endif /* H5O_ENABLE_BOGUS */ - + /* Add a modification time message. */ if (H5O_touch_oh(file, oh, TRUE, &oh_flags) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update modification time message") @@ -2067,8 +2067,8 @@ done: * Failure: NULL * * Errors: - * DATASET CANTINIT Can't update dataset header. - * DATASET CANTINIT Problem with the dataset name. + * DATASET CANTINIT Can't update dataset header. + * DATASET CANTINIT Problem with the dataset name. * DATASET CANTINIT Fail in file space allocation for * chunks * @@ -2089,13 +2089,13 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to retrieve and set property for generic property + * Changed the way to retrieve and set property for generic property * list. * * Raymond Lu, 26 Feb 2002 * A new fill value message is added. Two properties, space allocation * time and fill value writing time, govern space allocation and fill - * value writing. + * value writing. * * Bill Wendling, 1. November 2002 * Removed the cache updating mechanism. This was done so that it @@ -2113,7 +2113,7 @@ done: * Peter X. Cao * May 09, 2005 * Add property to create intermediate groups - * + * *------------------------------------------------------------------------- */ static H5D_t * @@ -2225,13 +2225,13 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space new_dset->shared->alloc_time=alloc_time; /* If MPI VFD is used, no filter support yet. */ - if(IS_H5FD_MPI(file) && dcpl_pline.nused > 0) + if(IS_H5FD_MPI(file) && dcpl_pline.nused > 0) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, NULL, "Parallel I/O does not support filters yet") /* Chunked datasets are non-default, so retrieve their info here */ if(H5P_get(dc_plist, H5D_CRT_CHUNK_DIM_NAME, &chunk_ndims) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't retrieve chunk dimensions") - + /* Get the dataset's external file list information */ if(H5P_get(dc_plist, H5D_CRT_EXT_FILE_LIST_NAME, &new_dset->shared->efl) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't retrieve external file list") @@ -2322,7 +2322,7 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space /* * The chunk size of a dimension with a fixed size cannot exceed - * the maximum dimension size + * the maximum dimension size */ if(H5P_get(dc_plist, H5D_CRT_CHUNK_SIZE_NAME, new_dset->shared->layout.u.chunk.dim) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't retrieve chunk size") @@ -2357,7 +2357,7 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space hsize_t comp_data_size; /* - * Compact dataset is stored in dataset object header message of + * Compact dataset is stored in dataset object header message of * layout. */ tmp_size = H5S_GET_EXTENT_NPOINTS(space) * @@ -2389,7 +2389,7 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space if (H5D_get_dcpl_cache(new_dset->shared->dcpl_id,&new_dset->shared->dcpl_cache)<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't fill DCPL cache") - /* + /* * Give the dataset a name. That is, create and add a new * "H5G_entry_t" object to the group this dataset is being initially * created in. @@ -2467,7 +2467,7 @@ H5D_isa(H5G_entry_t *ent, hid_t dxpl_id) { htri_t exists; htri_t ret_value=TRUE; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_isa, FAIL) assert(ent); @@ -2485,7 +2485,7 @@ H5D_isa(H5G_entry_t *ent, hid_t dxpl_id) } else if (!exists) { HGOTO_DONE(FALSE) } - + done: FUNC_LEAVE_NOAPI(ret_value) @@ -2493,7 +2493,7 @@ done: /* - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- * Function: H5D_open * * Purpose: Checks if dataset is already open, or opens a dataset for @@ -2517,7 +2517,7 @@ H5D_open(const H5G_entry_t *ent, hid_t dxpl_id) H5D_shared_t *shared_fo=NULL; H5D_t *dataset=NULL; H5D_t *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_open, NULL) /* check args */ @@ -2599,18 +2599,18 @@ static H5D_t * H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) { H5D_t *dataset = NULL; /*new dataset struct */ - H5O_fill_new_t fill = {NULL, 0, NULL, H5D_ALLOC_TIME_LATE, H5D_CRT_FILL_TIME_DEF, TRUE}; + H5O_fill_new_t fill = {NULL, 0, NULL, H5D_ALLOC_TIME_LATE, H5D_CRT_FILL_TIME_DEF, TRUE}; unsigned alloc_time_state; /* Allocation time state */ H5O_fill_t *fill_prop; /* Pointer to dataset's fill value area */ H5O_pline_t pline; /* I/O pipeline information */ H5P_genplist_t *plist; /* Property list */ H5D_t *ret_value = NULL; /*return value */ - + FUNC_ENTER_NOAPI(H5D_open_oid, NULL) /* check args */ assert (ent); - + /* Allocate the dataset structure */ if(NULL==(dataset=H5FL_CALLOC(H5D_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -2626,7 +2626,7 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) /* Find the dataset object */ if (H5O_open(&(dataset->ent)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, NULL, "unable to open") - + /* Get the type and space */ if (NULL==(dataset->shared->type=H5O_read(&(dataset->ent), H5O_DTYPE_ID, 0, NULL, dxpl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to load type info from dataset header") @@ -2691,7 +2691,7 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) unsigned chunk_ndims; /* Dimensionality of chunk */ chunk_ndims = dataset->shared->layout.u.chunk.ndims - 1; - + if(H5P_set(plist, H5D_CRT_CHUNK_DIM_NAME, &chunk_ndims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set chunk dimensions") if(H5P_set(plist, H5D_CRT_CHUNK_SIZE_NAME, dataset->shared->layout.u.chunk.dim) < 0) @@ -2706,7 +2706,7 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) dataset->shared->io_ops.readvv=H5D_istore_readvv; dataset->shared->io_ops.writevv=H5D_istore_writevv; break; - + case H5D_COMPACT: /* Set the I/O functions for this layout type */ dataset->shared->io_ops.readvv=H5D_compact_readvv; @@ -2744,7 +2744,7 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) case H5D_CHUNKED: fill.alloc_time=H5D_ALLOC_TIME_INCR; break; - + default: HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, NULL, "not implemented yet") } /* end switch */ /*lint !e788 All appropriate cases are covered */ @@ -2772,8 +2772,8 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) || (dataset->shared->layout.type==H5D_CONTIGUOUS && fill.alloc_time==H5D_ALLOC_TIME_LATE) || (dataset->shared->layout.type==H5D_CHUNKED && fill.alloc_time==H5D_ALLOC_TIME_INCR)) alloc_time_state=1; - - /* Set revised fill value properties */ + + /* Set revised fill value properties */ if(H5P_set(plist, H5D_CRT_FILL_VALUE_NAME, fill_prop) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set fill value") dataset->shared->alloc_time=fill.alloc_time; /* Cache this for later */ @@ -2856,7 +2856,7 @@ done: * * Errors: * DATASET CANTINIT Couldn't free the type or space, - * but the dataset was freed anyway. + * but the dataset was freed anyway. * * Programmer: Robb Matzke * Thursday, December 4, 1997 @@ -2916,7 +2916,7 @@ H5D_close(H5D_t *dataset) HGOTO_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy chunk cache") break; - case H5D_COMPACT: + case H5D_COMPACT: /* Update header message of layout for compact dataset. */ if(dataset->shared->layout.u.compact.dirty) { if(H5O_modify(&(dataset->ent), H5O_LAYOUT_ID, 0, 0, H5O_UPDATE_TIME, &(dataset->shared->layout), H5AC_dxpl_id)<0) @@ -2991,7 +2991,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to retrieve property for generic property + * Changed the way to retrieve property for generic property * list. * * Nat Furrer and James Laird @@ -3035,7 +3035,7 @@ H5D_extend (H5D_t *dataset, const hsize_t *size, hid_t dxpl_id) if(H5Z_can_apply(dataset->shared->dcpl_id, dataset->shared->type_id) <0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "can't apply filters") - dataset->shared->checked_filters = TRUE; + dataset->shared->checked_filters = TRUE; } } } @@ -3183,7 +3183,7 @@ H5D_alloc_storage (H5F_t *f, hid_t dxpl_id, H5D_t *dset/*in,out*/, H5D_time_allo unsigned init_space=0; /* Flag to indicate that space should be initialized */ unsigned addr_set=0; /* Flag to indicate that the dataset's storage address was set */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_alloc_storage) /* check args */ @@ -3235,7 +3235,7 @@ H5D_alloc_storage (H5F_t *f, hid_t dxpl_id, H5D_t *dset/*in,out*/, H5D_time_allo break; - case H5D_COMPACT: + case H5D_COMPACT: /* Check if space is already allocated */ if(layout->u.compact.buf==NULL) { /* Reserve space in layout header message for the entire array. */ @@ -3251,7 +3251,7 @@ H5D_alloc_storage (H5F_t *f, hid_t dxpl_id, H5D_t *dset/*in,out*/, H5D_time_allo init_space=1; } /* end if */ break; - + default: assert ("not implemented yet" && 0); #ifdef NDEBUG @@ -3322,7 +3322,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to retrieve property for generic property + * Changed the way to retrieve property for generic property * list. * *------------------------------------------------------------------------- @@ -3369,9 +3369,9 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hid_t dxpl_id) break; case H5D_CHUNKED: - /* - * Allocate file space - * for all chunks now and initialize each chunk with the fill value. + /* + * Allocate file space + * for all chunks now and initialize each chunk with the fill value. */ if (H5D_istore_allocate(dset, dxpl_id, full_overwrite)<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to allocate all chunks of dataset") @@ -3383,7 +3383,7 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hid_t dxpl_id) HGOTO_ERROR (H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout") #endif /* NDEBUG */ } /* end switch */ /*lint !e788 All appropriate cases are covered */ - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_init_storage() */ @@ -3414,7 +3414,7 @@ H5Dget_storage_size(hid_t dset_id) { H5D_t *dset=NULL; hsize_t ret_value; /* Return value */ - + FUNC_ENTER_API(H5Dget_storage_size, 0) H5TRACE1("h","i",dset_id); @@ -3451,7 +3451,7 @@ static hsize_t H5D_get_storage_size(H5D_t *dset, hid_t dxpl_id) { hsize_t ret_value; - + FUNC_ENTER_NOAPI(H5D_get_storage_size, 0) switch(dset->shared->layout.type) { @@ -3477,7 +3477,7 @@ H5D_get_storage_size(H5D_t *dset, hid_t dxpl_id) default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a dataset type") } /*lint !e788 All appropriate cases are covered */ - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -3488,12 +3488,12 @@ done: * * Purpose: Returns the address of dataset in file. * - * Return: Success: the address of dataset + * Return: Success: the address of dataset * * Failure: HADDR_UNDEF * - * Programmer: Raymond Lu - * November 6, 2002 + * Programmer: Raymond Lu + * November 6, 2002 * * Modifications: * @@ -3504,7 +3504,7 @@ H5Dget_offset(hid_t dset_id) { H5D_t *dset=NULL; haddr_t ret_value; /* Return value */ - + FUNC_ENTER_API(H5Dget_offset, HADDR_UNDEF) H5TRACE1("a","i",dset_id); @@ -3523,15 +3523,15 @@ done: /*------------------------------------------------------------------------- * Function: H5D_get_offset * - * Purpose: Private function for H5D_get_offset. Returns the address + * Purpose: Private function for H5D_get_offset. Returns the address * of dataset in file. * - * Return: Success: the address of dataset + * Return: Success: the address of dataset * * Failure: HADDR_UNDEF * - * Programmer: Raymond Lu - * November 6, 2002 + * Programmer: Raymond Lu + * November 6, 2002 * * Modifications: * @@ -3543,7 +3543,7 @@ H5D_get_offset(const H5D_t *dset) haddr_t ret_value=HADDR_UNDEF; haddr_t base_addr; H5F_t *f; - + FUNC_ENTER_NOAPI(H5D_get_offset, HADDR_UNDEF) assert(dset); @@ -3554,11 +3554,11 @@ H5D_get_offset(const H5D_t *dset) break; case H5D_CONTIGUOUS: - /* If dataspace hasn't been allocated or dataset is stored in + /* If dataspace hasn't been allocated or dataset is stored in * an external file, the value will be HADDR_UNDEF. */ f = H5D_get_file(dset); base_addr = H5F_get_base_addr(f); - + /* If there's user block in file, returns the absolute dataset offset * from the beginning of file. */ if(base_addr!=HADDR_UNDEF) @@ -3573,7 +3573,7 @@ H5D_get_offset(const H5D_t *dset) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "unknown dataset layout type") #endif /* NDEBUG */ } /*lint !e788 All appropriate cases are covered */ - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -3619,12 +3619,12 @@ done: * void *operator_data; IN/OUT: Pointer to any user-defined data * associated with the operation. * - * The return values from an operator are: + * The return values from an operator are: * Zero causes the iterator to continue, returning zero when all - * elements have been processed. + * elements have been processed. * Positive causes the iterator to immediately return that positive * value, indicating short-circuit success. The iterator can be - * restarted at the next element. + * restarted at the next element. * Negative causes the iterator to immediately return that value, * indicating failure. The iterator can be restarted at the next * element. @@ -3869,7 +3869,7 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, /* Get a copy of the dataspace ID */ if((vlen_bufsize.fspace_id=H5Dget_space(dataset_id))<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy dataspace") - + /* Create a scalar for the memory dataspace */ if((vlen_bufsize.mspace_id=H5Screate(H5S_SCALAR))<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't create dataspace") @@ -3931,7 +3931,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Dset_extent * - * Purpose: Modifies the dimensions of a dataset, based on H5Dextend. + * Purpose: Modifies the dimensions of a dataset, based on H5Dextend. * Can change to a lower dimension. * * Return: Success: SUCCEED, Failure: FAIL @@ -3974,7 +3974,7 @@ done: /*------------------------------------------------------------------------- * Function: H5D_set_extent * - * Purpose: Based in H5D_extend, allows change to a lower dimension, + * Purpose: Based in H5D_extend, allows change to a lower dimension, * calls H5S_set_extent and H5D_istore_prune_by_extent instead * * Return: Success: SUCCEED, Failure: FAIL @@ -4065,7 +4065,7 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) H5D_io_info_t io_info; /* Dataset I/O info */ H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ H5D_dxpl_cache_t *dxpl_cache=&_dxpl_cache; /* Data transfer property cache */ - + /* Fill the DXPL cache values for later use */ if (H5D_get_dxpl_cache(dxpl_id,&dxpl_cache)<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") @@ -4157,14 +4157,14 @@ H5D_flush(const H5F_t *f, hid_t dxpl_id, unsigned flags) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush raw data cache") break; - case H5D_COMPACT: + case H5D_COMPACT: if(dataset->shared->layout.u.compact.dirty) { if(H5O_modify(&(dataset->ent), H5O_LAYOUT_ID, 0, 0, H5O_UPDATE_TIME, &(dataset->shared->layout), dxpl_id)<0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") dataset->shared->layout.u.compact.dirty = FALSE; } /* end if */ break; - + default: assert ("not implemented yet" && 0); #ifdef NDEBUG @@ -4218,7 +4218,7 @@ H5Ddebug(hid_t dset_id) } else if (H5D_CONTIGUOUS==dset->shared->layout.type) { HDfprintf(stdout, " %-10s %a\n", "Address:", dset->shared->layout.u.contig.addr); } - + done: FUNC_LEAVE_API(ret_value) } diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index a13bf5d..85d78eb 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -13,8 +13,8 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu <slu@ncsa.uiuc.edu> - * August 5, 2002 + * Programmer: Raymond Lu <slu@ncsa.uiuc.edu> + * August 5, 2002 * * Purpose: Compact dataset I/O functions. These routines are similar * H5D_contig_* and H5D_istore_*. @@ -35,32 +35,32 @@ /*------------------------------------------------------------------------- * Function: H5D_compact_readvv - * + * * Purpose: Reads some data vectors from a dataset into a buffer. - * The data is in compact dataset. The address is relative + * The data is in compact dataset. The address is relative * to the beginning address of the dataset. The offsets and * sequence lengths are in bytes. - * + * * Return: Non-negative on success/Negative on failure - * + * * Programmer: Quincey Koziol * May 7, 2003 - * - * Notes: + * + * Notes: * Offsets in the sequences must be monotonically increasing - * + * * Modifications: - * + * *------------------------------------------------------------------------- */ ssize_t H5D_compact_readvv(const H5D_io_info_t *io_info, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[], + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[], void *buf) { ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_compact_readvv, FAIL) assert(io_info->dset); @@ -69,42 +69,42 @@ H5D_compact_readvv(const H5D_io_info_t *io_info, if((ret_value=H5V_memcpyvv(buf,mem_max_nseq,mem_curr_seq,mem_size_arr,mem_offset_arr,io_info->dset->shared->layout.u.compact.buf,dset_max_nseq,dset_curr_seq,dset_size_arr,dset_offset_arr))<0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed") -done: +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_compact_readvv() */ /*------------------------------------------------------------------------- * Function: H5D_compact_writevv - * + * * Purpose: Writes some data vectors from a dataset into a buffer. - * The data is in compact dataset. The address is relative + * The data is in compact dataset. The address is relative * to the beginning address for the file. The offsets and * sequence lengths are in bytes. This function only copies - * data into the buffer in the LAYOUT struct and mark it - * as DIRTY. Later in H5D_close, the data is copied into - * header message in memory. - * + * data into the buffer in the LAYOUT struct and mark it + * as DIRTY. Later in H5D_close, the data is copied into + * header message in memory. + * * Return: Non-negative on success/Negative on failure - * + * * Programmer: Quincey Koziol * May 2, 2003 - * - * Notes: + * + * Notes: * Offsets in the sequences must be monotonically increasing - * + * * Modifications: - * + * *------------------------------------------------------------------------- */ ssize_t H5D_compact_writevv(const H5D_io_info_t *io_info, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[], + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[], const void *buf) { ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_compact_writevv, FAIL) assert(io_info->dset); @@ -115,6 +115,6 @@ H5D_compact_writevv(const H5D_io_info_t *io_info, io_info->dset->shared->layout.u.compact.dirty = TRUE; -done: +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_compact_writevv() */ diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index fd4dde0..bec3615 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -125,7 +125,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) #endif /* H5_HAVE_PARALLEL */ int non_zero_fill_f=(-1); /* Indicate that a non-zero fill-value was used */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_contig_fill, FAIL) /* Check args */ @@ -216,7 +216,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) /* Indicate that a zero fill buffer was used */ non_zero_fill_f=0; } /* end else */ - + /* Start at the beginning of the dataset */ offset = 0; @@ -249,7 +249,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) npoints -= MIN(ptsperbuf, npoints); offset += size; } /* end while */ - + #ifdef H5_HAVE_PARALLEL /* Only need to block at the barrier if we actually wrote fill values */ /* And if we are using an MPI-capable file driver */ @@ -422,7 +422,7 @@ H5D_contig_readvv(const H5D_io_info_t *io_info, size_t u; /* Counting variable */ size_t v; /* Counting variable */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_contig_readvv, FAIL) /* Check args */ @@ -689,7 +689,7 @@ H5D_contig_writevv(const H5D_io_info_t *io_info, size_t u; /* Counting variable */ size_t v; /* Counting variable */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_contig_writevv, FAIL) /* Check args */ @@ -717,7 +717,7 @@ H5D_contig_writevv(const H5D_io_info_t *io_info, sieve_size=dset_contig->sieve_size; sieve_end=sieve_start+sieve_size; } /* end if */ - + /* Works through sequences as fast as possible */ for(; u<dset_max_nseq && v<mem_max_nseq; ) { /* Choose smallest buffer to write */ @@ -835,7 +835,7 @@ H5D_contig_writevv(const H5D_io_info_t *io_info, /* Adjust sieve location */ dset_contig->sieve_loc=addr; - + } /* end if */ /* Append to existing sieve buffer */ else { @@ -845,7 +845,7 @@ H5D_contig_writevv(const H5D_io_info_t *io_info, /* Adjust sieve size */ dset_contig->sieve_size += size; - + /* Update local copies of sieve information */ sieve_start=dset_contig->sieve_loc; sieve_size=dset_contig->sieve_size; diff --git a/src/H5Defl.c b/src/H5Defl.c index cfe10d6..aaba3a6 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -63,7 +63,7 @@ H5D_efl_read (const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf) ssize_t n; size_t u; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_efl_read) /* Check args */ @@ -80,7 +80,7 @@ H5D_efl_read (const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf) } cur += efl->slot[u].size; } - + /* Read the data */ while (size) { assert(buf); @@ -111,14 +111,14 @@ H5D_efl_read (const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf) skip = 0; u++; } - + done: if (fd>=0) HDclose (fd); FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5D_efl_write @@ -150,7 +150,7 @@ H5D_efl_write (const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *b hsize_t skip=0; size_t u; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_efl_write) /* Check args */ @@ -167,7 +167,7 @@ H5D_efl_write (const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *b } cur += efl->slot[u].size; } - + /* Write the data */ while (size) { assert(buf); @@ -200,14 +200,14 @@ H5D_efl_write (const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *b skip = 0; u++; } - + done: if (fd>=0) HDclose (fd); FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5D_efl_readvv @@ -240,7 +240,7 @@ H5D_efl_readvv(const H5D_io_info_t *io_info, size_t u; /* Counting variable */ size_t v; /* Counting variable */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_efl_readvv, FAIL) /* Check args */ @@ -291,7 +291,7 @@ H5D_efl_readvv(const H5D_io_info_t *io_info, done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_efl_readvv() */ - + /*------------------------------------------------------------------------- * Function: H5D_efl_writevv @@ -324,7 +324,7 @@ H5D_efl_writevv(const H5D_io_info_t *io_info, size_t u; /* Counting variable */ size_t v; /* Counting variable */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_efl_writevv, FAIL) /* Check args */ @@ -375,4 +375,4 @@ H5D_efl_writevv(const H5D_io_info_t *io_info, done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_efl_writevv() */ - + diff --git a/src/H5Dio.c b/src/H5Dio.c index df9e1b7..ffff901 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -1136,7 +1136,7 @@ H5D_contig_read(H5D_io_info_t *io_info, hsize_t nelmts, /* Go figure out how many elements to read from the file */ assert(H5S_SELECT_ITER_NELMTS(&file_iter)==(nelmts-smine_start)); smine_nelmts = (size_t)MIN(request_nelmts, (nelmts-smine_start)); - + /* * Gather the data from disk into the data type conversion * buffer. Also gather data from application to background buffer @@ -1161,7 +1161,7 @@ H5D_contig_read(H5D_io_info_t *io_info, hsize_t nelmts, #endif if (n!=smine_nelmts) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file gather failed") - + if (H5T_BKG_YES==need_bkg) { #ifdef H5S_DEBUG H5_timer_begin(&timer); @@ -1176,7 +1176,7 @@ H5D_contig_read(H5D_io_info_t *io_info, hsize_t nelmts, if (n!=smine_nelmts) HGOTO_ERROR (H5E_IO, H5E_READERROR, FAIL, "mem gather failed") } /* end if */ - + /* * Perform data type conversion. */ @@ -1203,7 +1203,7 @@ H5D_contig_read(H5D_io_info_t *io_info, hsize_t nelmts, #endif if (status<0) HGOTO_ERROR (H5E_DATASET, H5E_READERROR, FAIL, "scatter failed") - + } /* end for */ done: @@ -1397,7 +1397,7 @@ H5D_contig_write(H5D_io_info_t *io_info, hsize_t nelmts, /* Go figure out how many elements to read from the file */ assert(H5S_SELECT_ITER_NELMTS(&file_iter)==(nelmts-smine_start)); smine_nelmts = (size_t)MIN(request_nelmts, (nelmts-smine_start)); - + /* * Gather data from application buffer into the data type conversion * buffer. Also gather data from the file into the background buffer @@ -1432,7 +1432,7 @@ H5D_contig_write(H5D_io_info_t *io_info, hsize_t nelmts, if (n!=smine_nelmts) HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "file gather failed") } /* end if */ - + /* * Perform data type conversion. */ @@ -3383,7 +3383,7 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: + * Programmer: * * Modifications: * diff --git a/src/H5Distore.c b/src/H5Distore.c index 661ab2d..688b5d4 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -348,7 +348,7 @@ H5D_istore_decode_key(const H5F_t UNUSED *f, const H5B_t *bt, const uint8_t *raw * Friday, October 10, 1997 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -403,7 +403,7 @@ H5D_istore_debug_key (FILE *stream, H5F_t UNUSED *f, hid_t UNUSED dxpl_id, int i const H5D_istore_key_t *key = (const H5D_istore_key_t *)_key; const H5D_istore_ud1_t *udata = (const H5D_istore_ud1_t *)_udata; unsigned u; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_debug_key) assert (key); @@ -486,7 +486,7 @@ H5D_istore_cmp2(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_uda * would describe the UDATA min_corner address * would fall lexicographically between LT_KEY * and RT_KEY. - * + * * Failure: FAIL (same as UDATA < LT_KEY) * * Programmer: Robb Matzke @@ -746,7 +746,7 @@ H5D_istore_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, if (cmp < 0) { /* Negative indices not supported yet */ HGOTO_ERROR(H5E_STORAGE, H5E_UNSUPPORTED, H5B_INS_ERROR, "internal error") - + } else if (H5V_vector_eq_u (udata->mesg->u.chunk.ndims, udata->key.offset, lt_key->offset) && lt_key->nbytes>0) { @@ -758,7 +758,7 @@ H5D_istore_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, /* Currently, the old chunk data is "thrown away" after the space is reallocated, * so avoid data copy in H5MF_realloc() call by just free'ing the space and * allocating new space. - * + * * This should keep the file smaller also, by freeing the space and then * allocating new space, instead of vice versa (in H5MF_realloc). * @@ -842,7 +842,7 @@ done: *------------------------------------------------------------------------- */ /* ARGSUSED */ -static int +static int H5D_istore_iter_allocated (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_lt_key, haddr_t UNUSED addr, const void UNUSED *_rt_key, void *_udata) { @@ -931,7 +931,7 @@ H5D_istore_init (const H5F_t *f, const H5D_t *dset) { H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_init, FAIL) if (H5F_RDCC_NBYTES(f)>0 && H5F_RDCC_NELMTS(f)>0) { @@ -975,7 +975,7 @@ H5D_istore_flush_entry(const H5D_io_info_t *io_info, H5D_rdcc_ent_t *ent, hbool_ void *buf=NULL; /*temporary buffer */ size_t alloc; /*bytes allocated for BUF */ hbool_t point_of_no_return = FALSE; - + FUNC_ENTER_NOAPI_NOINIT(H5D_istore_flush_entry) assert(io_info); @@ -1018,7 +1018,7 @@ H5D_istore_flush_entry(const H5D_io_info_t *io_info, H5D_rdcc_ent_t *ent, hbool_ point_of_no_return = TRUE; ent->chunk = NULL; } - if (H5Z_pipeline(&(io_info->dset->shared->dcpl_cache.pline), 0, &(udata.key.filter_mask), io_info->dxpl_cache->err_detect, + if (H5Z_pipeline(&(io_info->dset->shared->dcpl_cache.pline), 0, &(udata.key.filter_mask), io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, &(udata.key.nbytes), &alloc, &buf)<0) HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "output pipeline failed") } @@ -1038,7 +1038,7 @@ H5D_istore_flush_entry(const H5D_io_info_t *io_info, H5D_rdcc_ent_t *ent, hbool_ io_info->dset->shared->cache.chunk.nflushes++; #endif /* H5D_ISTORE_DEBUG */ } /* end if */ - + /* Reset, but do not free or removed from list */ if (reset) { point_of_no_return = FALSE; @@ -1047,12 +1047,12 @@ H5D_istore_flush_entry(const H5D_io_info_t *io_info, H5D_rdcc_ent_t *ent, hbool_ if(ent->chunk!=NULL) ent->chunk = H5D_istore_chunk_xfree(ent->chunk,&(io_info->dset->shared->dcpl_cache.pline)); } /* end if */ - + done: /* Free the temp buffer only if it's different than the entry chunk */ if (buf!=ent->chunk) H5MM_xfree(buf); - + /* * If we reached the point of no return then we have no choice but to * reset the entry. This can only happen if RESET is true but the @@ -1081,7 +1081,7 @@ done: * * Modifications: * Pedro Vicente, March 28, 2002 - * Added flush parameter that switches the call to H5F_istore_flush_entry + * Added flush parameter that switches the call to H5F_istore_flush_entry * The call with FALSE is used by the H5F_istore_prune_by_extent function * *------------------------------------------------------------------------- @@ -1162,7 +1162,7 @@ H5D_istore_flush (H5D_t *dset, hid_t dxpl_id, unsigned flags) int nerrors=0; H5D_rdcc_ent_t *ent=NULL, *next=NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_flush, FAIL) /* Fill the DXPL cache values for later use */ @@ -1186,7 +1186,7 @@ H5D_istore_flush (H5D_t *dset, hid_t dxpl_id, unsigned flags) nerrors++; } } /* end for */ - + if (nerrors) HGOTO_ERROR (H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") @@ -1222,7 +1222,7 @@ H5D_istore_dest (H5D_t *dset, hid_t dxpl_id) int nerrors=0; H5D_rdcc_ent_t *ent=NULL, *next=NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_dest, FAIL) assert(dset); @@ -1407,7 +1407,7 @@ H5D_istore_prune (const H5D_io_info_t *io_info, size_t size) for (i=0; i<nmeth-1; i++) if (0==w[i]) p[i+1] = rdcc->head; - + /* Compute next value for each pointer */ for (i=0; i<nmeth; i++) n[i] = p[i] ? p[i]->next : NULL; @@ -1428,7 +1428,7 @@ H5D_istore_prune (const H5D_io_info_t *io_info, size_t size) HDputc('.', stderr); HDfflush(stderr); #endif - + } else if (1==i && p[1] && !p[1]->locked) { /* * Method 1: Preempt the entry without regard to @@ -1440,7 +1440,7 @@ H5D_istore_prune (const H5D_io_info_t *io_info, size_t size) HDputc(':', stderr); HDfflush(stderr); #endif - + } else { /* Nothing to preempt at this point */ cur= NULL; @@ -1457,7 +1457,7 @@ H5D_istore_prune (const H5D_io_info_t *io_info, size_t size) nerrors++; } } - + /* Advance pointers */ for (i=0; i<nmeth; i++) p[i] = n[i]; @@ -1526,7 +1526,7 @@ H5D_istore_lock(const H5D_io_info_t *io_info, void *ret_value; /*return value */ FUNC_ENTER_NOAPI_NOINIT(H5D_istore_lock) - + assert(io_info); assert(dset); assert(io_info->dxpl_cache); @@ -1541,7 +1541,7 @@ H5D_istore_lock(const H5D_io_info_t *io_info, if (rdcc->nslots>0) { idx=H5D_HASH(dset->shared,io_info->store->chunk.index); ent = rdcc->slot[idx]; - + if (ent) { for (u=0, found=TRUE; u<layout->u.chunk.ndims; u++) { if (io_info->store->chunk.offset[u]!=ent->offset[u]) { @@ -1574,7 +1574,7 @@ H5D_istore_lock(const H5D_io_info_t *io_info, #endif if (NULL==(chunk=H5D_istore_chunk_alloc (chunk_size,pline))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for raw data chunk") - + } else { H5D_istore_ud1_t tmp_udata; /*B-tree pass-through */ haddr_t chunk_addr; /* Address of chunk on disk */ @@ -1607,7 +1607,7 @@ H5D_istore_lock(const H5D_io_info_t *io_info, HGOTO_ERROR (H5E_IO, H5E_READERROR, NULL, "unable to read raw data chunk") if (pline->nused) - if (H5Z_pipeline(pline, H5Z_FLAG_REVERSE, &(udata->key.filter_mask), io_info->dxpl_cache->err_detect, + if (H5Z_pipeline(pline, H5Z_FLAG_REVERSE, &(udata->key.filter_mask), io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, &(udata->key.nbytes), &chunk_alloc, &chunk)<0) { HGOTO_ERROR(H5E_PLINE, H5E_READERROR, NULL, "data pipeline read failed") } @@ -1657,7 +1657,7 @@ else } /* end else */ } assert (found || chunk_size>0); - + if (!found && rdcc->nslots>0 && chunk_size<=rdcc->nbytes && (!ent || !ent->locked)) { /* @@ -1686,7 +1686,7 @@ else ent->rd_count = chunk_size; ent->wr_count = chunk_size; ent->chunk = chunk; - + /* Add it to the cache */ assert(NULL==rdcc->slot[idx]); rdcc->slot[idx] = ent; @@ -1749,7 +1749,7 @@ else /* Set return value */ ret_value = chunk; - + done: if (!ret_value) if(chunk) @@ -1793,7 +1793,7 @@ H5D_istore_unlock(const H5D_io_info_t *io_info, H5D_rdcc_ent_t *ent = NULL; unsigned u; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_istore_unlock) assert(io_info); @@ -1842,7 +1842,7 @@ H5D_istore_unlock(const H5D_io_info_t *io_info, } ent->locked = FALSE; } - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_istore_unlock() */ @@ -1874,7 +1874,7 @@ H5D_istore_readvv(const H5D_io_info_t *io_info, haddr_t chunk_addr; /* Chunk address on disk */ size_t u; /* Local index variables */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_readvv, FAIL) /* Check args */ @@ -1956,7 +1956,7 @@ HDfprintf(stderr,"%s: buf=%p\n",FUNC,buf); if (rdcc->nslots>0) { unsigned idx=H5D_HASH(dset->shared,io_info->store->chunk.index); /* Cache entry index */ H5D_rdcc_ent_t *ent = rdcc->slot[idx]; /* Cache entry */ - + /* Potential match... */ if (ent) { for (u=0, found=TRUE; u<dset->shared->layout.u.chunk.ndims; u++) { @@ -2035,7 +2035,7 @@ HDfprintf(stderr,"%s: buf=%p\n",FUNC,buf); /* Set return value */ ret_value=naccessed; } /* end else */ - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D_istore_readvv() */ @@ -2067,7 +2067,7 @@ H5D_istore_writevv(const H5D_io_info_t *io_info, haddr_t chunk_addr; /* Chunk address on disk */ size_t u; /* Local index variables */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_writevv, FAIL) /* Check args */ @@ -2185,7 +2185,7 @@ HDfprintf(stderr,"%s: mem_offset_arr[%Zu]=%Hu\n",FUNC,*mem_curr_seq,mem_offset_a /* Set return value */ ret_value=naccessed; } /* end else */ - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D_istore_writevv() */ @@ -2236,7 +2236,7 @@ H5D_istore_create(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout /*out */ ) if (H5B_create(f, dxpl_id, H5B_ISTORE, &udata, &(layout->u.chunk.addr)/*out*/) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "can't create B-tree") - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_istore_create() */ @@ -2328,7 +2328,7 @@ H5D_istore_get_addr(const H5D_io_info_t *io_info, H5D_istore_ud1_t *_udata) H5D_istore_ud1_t *udata; /* Pointer to information about a chunk */ unsigned u; haddr_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_get_addr) assert(io_info); @@ -2388,7 +2388,7 @@ static void * H5D_istore_chunk_alloc(size_t size, const H5O_pline_t *pline) { void *ret_value=NULL; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_chunk_alloc) assert(size); @@ -2513,7 +2513,7 @@ H5D_istore_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite) int space_ndims; /* Dataset's space rank */ hsize_t space_dim[H5O_LAYOUT_NDIMS]; /* Dataset's dataspace dimensions */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_allocate, FAIL) /* Check args */ @@ -2682,7 +2682,7 @@ H5D_istore_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite) #endif /* H5_HAVE_PARALLEL */ } /* end if */ } /* end if */ - + /* Increment indices */ for (i=(int)dset->shared->layout.u.chunk.ndims-1, carry=1; i>=0 && carry; --i) { chunk_offset[i] += dset->shared->layout.u.chunk.dim[i]; @@ -2719,7 +2719,7 @@ done: * Function: H5D_istore_prune_by_extent * * Purpose: This function searches for chunks that are no longer necessary both in the - * raw data cache and in the B-tree. + * raw data cache and in the B-tree. * * Return: Success: 0, Failure: -1 * @@ -2732,12 +2732,12 @@ done: * * For chunks that are no longer necessary: * - * 1. Search in the raw data cache for each chunk + * 1. Search in the raw data cache for each chunk * 2. If found then preempt it from the cache - * 3. Search in the B-tree for each chunk + * 3. Search in the B-tree for each chunk * 4. If found then remove it from the B-tree and deallocate file storage for the chunk * - * This example shows a 2d dataset of 90x90 with a chunk size of 20x20. + * This example shows a 2d dataset of 90x90 with a chunk size of 20x20. * * * 0 20 40 60 80 90 100 @@ -2763,7 +2763,7 @@ done: * | : ::::::::::: : | : * 80+.........:.........:::::::::::.........:.....+...: O Fill Val * | : : ::::::::::: | : Explicitly - * | : : ::::::X:::: | : Written + * | : : ::::::X:::: | : Written * 90+---------+---------+---------+---------+-----+ : * : : : ::::::::::: : * 100:.........:.........:.........:::::::::::.........: @@ -2780,27 +2780,27 @@ done: * 0 20 40 60 70 80 90 100 * 0 +---------+---------+---------+----+----+-----+...+ * |:::::X:::::::::::::: : | : | : - * |:::::::X:::::::::::: : | : | : Key - * |::::::::::X::::::::: : | : | : -------- - * |::::::::::::X::::::: : | : | : +-+ Dataset - * 20+::::::::::::::::::::.........:....+....:.....|...: | | Extent - * | :::::X::::: : | : | : +-+ - * | ::::::::::: : | : | : - * | ::::::::::: : | : | : ... Chunk - * | :::::::X::: : | : | : : : Boundary - * 40+.........:::::::::::.........:....+....:.....|...: :.: - * | : : : | : | : - * | : : : | : | : ... Allocated - * | : : : | : | : ::: & Filled - * | : : : | : | : ::: Chunk - * 60+.........:.........:.........:....+....:.....|...: - * | : :::::::X::: | : | : X Element - * | : ::::::::::: | : | : Written - * +---------+---------+---------+----+ : | : - * | : ::::::::::: : | : - * 80+.........:.........:::::::::X:.........:.....|...: O Fill Val - * | : : ::::::::::: | : Explicitly - * | : : ::::::X:::: | : Written + * |:::::::X:::::::::::: : | : | : Key + * |::::::::::X::::::::: : | : | : -------- + * |::::::::::::X::::::: : | : | : +-+ Dataset + * 20+::::::::::::::::::::.........:....+....:.....|...: | | Extent + * | :::::X::::: : | : | : +-+ + * | ::::::::::: : | : | : + * | ::::::::::: : | : | : ... Chunk + * | :::::::X::: : | : | : : : Boundary + * 40+.........:::::::::::.........:....+....:.....|...: :.: + * | : : : | : | : + * | : : : | : | : ... Allocated + * | : : : | : | : ::: & Filled + * | : : : | : | : ::: Chunk + * 60+.........:.........:.........:....+....:.....|...: + * | : :::::::X::: | : | : X Element + * | : ::::::::::: | : | : Written + * +---------+---------+---------+----+ : | : + * | : ::::::::::: : | : + * 80+.........:.........:::::::::X:.........:.....|...: O Fill Val + * | : : ::::::::::: | : Explicitly + * | : : ::::::X:::: | : Written * 90+---------+---------+---------+---------+-----+ : * : : : ::::::::::: : * 100:.........:.........:.........:::::::::::.........: @@ -2808,7 +2808,7 @@ done: * * That means that the nine chunks along the bottom and right side should * no longer exist. Of those nine chunks, (0,80), (20,80), (40,80), - * (60,80), (80,80), (80,60), (80,40), (80,20), and (80,0), one is actually allocated + * (60,80), (80,80), (80,60), (80,40), (80,20), and (80,0), one is actually allocated * that needs to be released. * To release the chunks, we traverse the B-tree to obtain a list of unused * allocated chunks, and then call H5B_remove() for each chunk. @@ -2840,7 +2840,7 @@ H5D_istore_prune_by_extent(const H5D_io_info_t *io_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions") /*------------------------------------------------------------------------- - * Figure out what chunks are no longer in use for the specified extent + * Figure out what chunks are no longer in use for the specified extent * and release them from the linked list raw data cache *------------------------------------------------------------------------- */ @@ -2892,7 +2892,7 @@ done: /*------------------------------------------------------------------------- * Function: H5D_istore_prune_extent * - * Purpose: Search for chunks that are no longer necessary in the B-tree. + * Purpose: Search for chunks that are no longer necessary in the B-tree. * * Return: Success: 0, Failure: -1 * @@ -2917,7 +2917,7 @@ H5D_istore_prune_extent(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t UN H5D_istore_ud1_t udata; int ret_value=H5B_ITER_CONT; /* Return value */ - /* The LT_KEY is the left key (the one that describes the chunk). It points to a chunk of + /* The LT_KEY is the left key (the one that describes the chunk). It points to a chunk of * storage that contains the beginning of the logical address space represented by UDATA. */ @@ -2951,7 +2951,7 @@ done: /*------------------------------------------------------------------------- * Function: H5D_istore_remove * - * Purpose: Removes chunks that are no longer necessary in the B-tree. + * Purpose: Removes chunks that are no longer necessary in the B-tree. * * Return: Success: 0, Failure: -1 * @@ -2996,7 +2996,7 @@ done: * Function: H5D_istore_initialize_by_extent * * Purpose: This function searches for chunks that have to be initialized with the fill - * value both in the raw data cache and in the B-tree. + * value both in the raw data cache and in the B-tree. * * Return: Success: 0, Failure: -1 * @@ -3004,12 +3004,12 @@ done: * * Date: April 4, 2002 * - * Comments: + * Comments: * * (See the example of H5D_istore_prune_by_extent) * Next, there are seven chunks where the database extent boundary is * within the chunk. We find those seven just like we did with the previous nine. - * Fot the ones that are allocated we initialize the part that lies outside the boundary + * Fot the ones that are allocated we initialize the part that lies outside the boundary * with the fill value. * * Modifications: @@ -3121,8 +3121,8 @@ H5D_istore_initialize_by_extent(H5D_io_info_t *io_info) naccessed *= sub_size[u]; } /* end for */ - /* - * Figure out what chunks have to be initialized. These are the chunks where the dataspace + /* + * Figure out what chunks have to be initialized. These are the chunks where the dataspace * extent boundary is within the chunk */ for(u = 0, found = 0; u < rank; u++) { @@ -3410,7 +3410,7 @@ H5D_istore_stats (H5D_t *dset, hbool_t headers) double miss_rate; char ascii[32]; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_stats, FAIL) if (!H5DEBUG(AC)) @@ -3474,7 +3474,7 @@ H5D_istore_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int inden H5O_layout_t layout; H5D_istore_ud1_t udata; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_debug,FAIL) layout.u.chunk.ndims = ndims; diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 479db17..43b736d 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -306,7 +306,7 @@ done: * * Return: non-negative on success, negative on failure. * - * Programmer: + * Programmer: * * Modifications: * @@ -336,7 +336,7 @@ H5D_mpio_select_read(H5D_io_info_t *io_info, * * Return: non-negative on success, negative on failure. * - * Programmer: + * Programmer: * * Modifications: * diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 732af1f..df97218 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -39,7 +39,7 @@ /* Definitions for storage layout property */ #define H5D_CRT_LAYOUT_NAME "layout" #define H5D_CRT_LAYOUT_SIZE sizeof(H5D_layout_t) -#define H5D_CRT_LAYOUT_DEF H5D_CONTIGUOUS +#define H5D_CRT_LAYOUT_DEF H5D_CONTIGUOUS /* Definitions for chunk dimensionality property */ #define H5D_CRT_CHUNK_DIM_NAME "chunk_ndims" #define H5D_CRT_CHUNK_DIM_SIZE sizeof(unsigned) @@ -49,7 +49,7 @@ #define H5D_CRT_CHUNK_SIZE_SIZE sizeof(size_t[H5O_LAYOUT_NDIMS]) #define H5D_CRT_CHUNK_SIZE_DEF {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} -/* Definitions for fill value. size=0 means fill value will be 0 as +/* Definitions for fill value. size=0 means fill value will be 0 as * library default; size=-1 means fill value is undefined. */ #define H5D_CRT_FILL_VALUE_NAME "fill_value" #define H5D_CRT_FILL_VALUE_SIZE sizeof(H5O_fill_t) @@ -65,7 +65,7 @@ /* Definitions for time of fill value writing */ #define H5D_CRT_FILL_TIME_NAME "fill_time" #define H5D_CRT_FILL_TIME_SIZE sizeof(H5D_fill_time_t) -#define H5D_CRT_FILL_TIME_DEF H5D_FILL_TIME_IFSET +#define H5D_CRT_FILL_TIME_DEF H5D_FILL_TIME_IFSET /* Definitions for external file list */ #define H5D_CRT_EXT_FILE_LIST_NAME "efl" #define H5D_CRT_EXT_FILE_LIST_SIZE sizeof(H5O_efl_t) @@ -74,7 +74,7 @@ /* Definitions for data filter pipeline */ #define H5D_CRT_DATA_PIPELINE_NAME "pline" #define H5D_CRT_DATA_PIPELINE_SIZE sizeof(H5O_pline_t) -#define H5D_CRT_DATA_PIPELINE_DEF {0, 0, NULL} +#define H5D_CRT_DATA_PIPELINE_DEF {0, 0, NULL} #define H5D_CRT_DATA_PIPELINE_CMP H5D_crt_data_pipeline_cmp /* ======== Data transfer properties ======== */ @@ -216,11 +216,11 @@ H5_DLL herr_t H5D_close(H5D_t *dataset); H5_DLL htri_t H5D_isa(H5G_entry_t *ent, hid_t dxpl_id); H5_DLL H5G_entry_t *H5D_entof(H5D_t *dataset); H5_DLL H5T_t *H5D_typeof(const H5D_t *dset); -H5_DLL herr_t H5D_crt_copy(hid_t new_plist_t, hid_t old_plist_t, +H5_DLL herr_t H5D_crt_copy(hid_t new_plist_t, hid_t old_plist_t, void *copy_data); H5_DLL herr_t H5D_crt_close(hid_t dxpl_id, void *close_data); H5_DLL herr_t H5D_xfer_create(hid_t dxpl_id, void *create_data); -H5_DLL herr_t H5D_xfer_copy(hid_t new_plist_id, hid_t old_plist_id, +H5_DLL herr_t H5D_xfer_copy(hid_t new_plist_id, hid_t old_plist_id, void *copy_data); H5_DLL herr_t H5D_xfer_close(hid_t dxpl_id, void *close_data); H5_DLL herr_t H5D_flush(const H5F_t *f, hid_t dxpl_id, unsigned flags); diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index 09556c2..3595bf2 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -39,7 +39,7 @@ typedef enum H5D_alloc_time_t { H5D_ALLOC_TIME_EARLY =1, H5D_ALLOC_TIME_LATE =2, H5D_ALLOC_TIME_INCR =3 -} H5D_alloc_time_t; +} H5D_alloc_time_t; /* Values for the status of space allocation */ typedef enum H5D_space_status_t { @@ -78,7 +78,7 @@ H5_DLL hid_t H5Dcreate (hid_t file_id, const char *name, hid_t type_id, H5_DLL hid_t H5Dopen (hid_t file_id, const char *name); H5_DLL herr_t H5Dclose (hid_t dset_id); H5_DLL hid_t H5Dget_space (hid_t dset_id); -H5_DLL herr_t H5Dget_space_status(hid_t dset_id, +H5_DLL herr_t H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation); H5_DLL hid_t H5Dget_type (hid_t dset_id); H5_DLL hid_t H5Dget_create_plist (hid_t dset_id); diff --git a/src/H5Dselect.c b/src/H5Dselect.c index 125d22f..596937f 100644 --- a/src/H5Dselect.c +++ b/src/H5Dselect.c @@ -314,7 +314,7 @@ done: * Purpose: Gathers dataset elements from application memory BUF and * copies them into the gather buffer TGATH_BUF. * Each element is ELMT_SIZE bytes and arranged in application - * memory according to SPACE. + * memory according to SPACE. * The caller is requesting that at most NELMTS be gathered. * * Return: Success: Number of elements copied. @@ -447,7 +447,7 @@ H5D_select_read(H5D_io_info_t *io_info, assert(io_info->store); assert(buf); assert(TRUE==H5P_isa_class(io_info->dxpl_id,H5P_DATASET_XFER)); - + /* Initialize file iterator */ if (H5S_select_iter_init(&file_iter, file_space, elmt_size)<0) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator"); @@ -591,7 +591,7 @@ H5D_select_write(H5D_io_info_t *io_info, assert(io_info->store); assert(TRUE==H5P_isa_class(io_info->dxpl_id,H5P_DATASET_XFER)); assert(buf); - + /* Allocate the vector I/O arrays */ if(io_info->dxpl_cache->vec_size!=H5D_XFER_HYPER_VECTOR_SIZE_DEF) { if((mem_len = H5FL_SEQ_MALLOC(size_t,io_info->dxpl_cache->vec_size))==NULL) @@ -619,7 +619,7 @@ H5D_select_write(H5D_io_info_t *io_info, if (H5S_select_iter_init(&mem_iter, mem_space, elmt_size)<0) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator"); mem_iter_init=1; /* Memory selection iteration info has been initialized */ - + /* Initialize sequence counts */ curr_mem_seq=curr_file_seq=0; mem_nseq=file_nseq=0; @@ -93,7 +93,7 @@ int H5E_mpi_error_str_len; #endif /* Static function declarations */ -static H5E_cls_t *H5E_register_class(const char *cls_name, const char *lib_name, +static H5E_cls_t *H5E_register_class(const char *cls_name, const char *lib_name, const char *version); static herr_t H5E_unregister_class(H5E_cls_t *cls); static ssize_t H5E_get_class_name(const H5E_cls_t *cls, char *name, size_t size); @@ -108,7 +108,7 @@ static ssize_t H5E_get_num(const H5E_t *err_stack); static herr_t H5E_pop(H5E_t *err_stack, size_t count); static herr_t H5E_clear_entries(H5E_t *estack, size_t nentries); static herr_t H5E_print_stack(const H5E_t *estack, FILE *stream); -static herr_t H5E_walk_stack(const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func, +static herr_t H5E_walk_stack(const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func, void *client_data); static herr_t H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data); static herr_t H5E_get_auto_stack(const H5E_t *estack, hbool_t new_api, void **func, void **client_data); @@ -161,7 +161,7 @@ done: * * Programmer: Raymond Lu * Friday, July 11, 2003 - * + * *-------------------------------------------------------------------------- */ static herr_t @@ -175,15 +175,15 @@ H5E_init_interface(void) FUNC_ENTER_NOAPI_NOINIT(H5E_init_interface) /* Initialize the atom group for the error class IDs */ - if(H5I_register_type(H5I_ERROR_CLASS, H5I_ERRCLS_HASHSIZE, H5E_RESERVED_ATOMS, + if(H5I_register_type(H5I_ERROR_CLASS, H5I_ERRCLS_HASHSIZE, H5E_RESERVED_ATOMS, (H5I_free_t)H5E_unregister_class)<H5I_FILE) HGOTO_ERROR(H5E_ATOM, H5E_CANTINIT, FAIL, "unable to initialize ID group") /* Initialize the atom group for the major error IDs */ - if(H5I_register_type(H5I_ERROR_MSG, H5I_ERRMSG_HASHSIZE, H5E_RESERVED_ATOMS, + if(H5I_register_type(H5I_ERROR_MSG, H5I_ERRMSG_HASHSIZE, H5E_RESERVED_ATOMS, (H5I_free_t)H5E_close_msg)<H5I_FILE) HGOTO_ERROR(H5E_ATOM, H5E_CANTINIT, FAIL, "unable to initialize ID group") /* Initialize the atom group for the error stacks */ - if(H5I_register_type(H5I_ERROR_STACK, H5I_ERRSTK_HASHSIZE, H5E_RESERVED_ATOMS, + if(H5I_register_type(H5I_ERROR_STACK, H5I_ERRSTK_HASHSIZE, H5E_RESERVED_ATOMS, (H5I_free_t)H5E_close_stack)<H5I_FILE) HGOTO_ERROR(H5E_ATOM, H5E_CANTINIT, FAIL, "unable to initialize ID group") @@ -226,10 +226,10 @@ done: * Failure: Negative. * * Programmer: Raymond Lu - * Tuesday, July 22, 2003 + * Tuesday, July 22, 2003 * * Modifications: - * + * *------------------------------------------------------------------------- */ int @@ -250,20 +250,20 @@ H5E_term_interface(void) /* Clear any outstanding error stacks */ if (nstk>0) H5I_clear_type(H5I_ERROR_STACK, FALSE); - + /* Clear all the error classes */ if (ncls>0) { H5I_clear_type(H5I_ERROR_CLASS, FALSE); - + /* Reset the HDF5 error class, if its been closed */ if(H5I_nmembers(H5I_ERROR_CLASS)==0) H5E_ERR_CLS_g = -1; } - + /* Clear all the error messages */ if (nmsg>0) { H5I_clear_type(H5I_ERROR_MSG, FALSE); - + /* Reset the HDF5 error messages, if they've been closed */ if(H5I_nmembers(H5I_ERROR_MSG)==0) { /* Include the automatically generated error code termination */ @@ -352,7 +352,7 @@ H5Eregister_class(const char *cls_name, const char *lib_name, const char *versio FUNC_ENTER_API(H5Eregister_class, FAIL) H5TRACE3("i","sss",cls_name,lib_name,version); - + /* Check arguments */ if (cls_name==NULL || lib_name==NULL || version==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid string") @@ -389,9 +389,9 @@ H5E_register_class(const char *cls_name, const char *lib_name, const char *versi { H5E_cls_t *cls; /* Pointer to error class */ H5E_cls_t *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5E_register_class) - + /* Check arguments */ assert(cls_name); assert(lib_name); @@ -438,7 +438,7 @@ H5Eunregister_class(hid_t class_id) FUNC_ENTER_API(H5Eunregister_class, FAIL) H5TRACE1("e","i",class_id); - + /* Check arguments */ if (H5I_ERROR_CLASS != H5I_get_type(class_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an error class") @@ -482,14 +482,14 @@ H5E_unregister_class(H5E_cls_t *cls) (void)H5I_search(H5I_ERROR_MSG, H5E_close_msg_cb, cls); /* Free error class structure */ - if(cls->cls_name) + if(cls->cls_name) H5MM_xfree((void*)cls->cls_name); if(cls->lib_name) H5MM_xfree((void*)cls->lib_name); if(cls->lib_vers) H5MM_xfree((void*)cls->lib_vers); H5FL_FREE(H5E_cls_t, cls); - + FUNC_LEAVE_NOAPI(SUCCEED) } @@ -500,7 +500,7 @@ H5E_unregister_class(H5E_cls_t *cls) * Purpose: Retrieves error class name. * * Return: Non-negative for name length if succeeds(zero means no name); - * otherwise returns negative value. + * otherwise returns negative value. * * Programmer: Raymond Lu * Friday, July 11, 2003 @@ -517,7 +517,7 @@ H5Eget_class_name(hid_t class_id, char *name, size_t size) FUNC_ENTER_API(H5Eget_class_name, FAIL) H5TRACE3("Zs","isz",class_id,name,size); - + /* Get the error class */ if(NULL==(cls = H5I_object_verify(class_id, H5I_ERROR_CLASS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error class ID") @@ -535,9 +535,9 @@ done: * Function: H5E_get_class_name * * Purpose: Private function to retrieve error class name. - * + * * Return: Non-negative for name length if succeeds(zero means no name); - * otherwise returns negative value. + * otherwise returns negative value. * * Programmer: Raymond Lu * Friday, July 11, 2003 @@ -550,7 +550,7 @@ static ssize_t H5E_get_class_name(const H5E_cls_t *cls, char *name, size_t size) { ssize_t len; /* Length of rror class's name */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_get_class_name) /* Check arguments */ @@ -564,8 +564,8 @@ H5E_get_class_name(const H5E_cls_t *cls, char *name, size_t size) HDstrncpy(name, cls->cls_name, MIN((size_t)(len+1), size)); if((size_t)len >= size) name[size-1]='\0'; - } - + } + /* Return the full length */ FUNC_LEAVE_NOAPI(len) } @@ -579,7 +579,7 @@ H5E_get_class_name(const H5E_cls_t *cls, char *name, size_t size) * * Programmer: Raymond Lu * July 14, 2003 - * + * * Return: Non-negative value on success/Negative on failure * * Modifications: @@ -592,9 +592,9 @@ H5E_close_msg_cb(void *obj_ptr, hid_t obj_id, void *key) H5E_msg_t *err_msg = (H5E_msg_t*)obj_ptr; H5E_cls_t *cls = (H5E_cls_t*)key; herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5E_close_msg_cb) - + /* Check arguments */ assert(err_msg); @@ -602,7 +602,7 @@ H5E_close_msg_cb(void *obj_ptr, hid_t obj_id, void *key) if(err_msg->cls == cls) if(H5I_dec_ref(obj_id)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTDEC, FAIL, "unable to decrement ref count on error message") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -626,7 +626,7 @@ herr_t H5Eclose_msg(hid_t err_id) { herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eclose_msg, FAIL) H5TRACE1("e","i",err_id); @@ -664,7 +664,7 @@ H5E_close_msg(H5E_msg_t *err) /* Check arguments */ assert(err); - if(err->msg) + if(err->msg) H5MM_xfree((void*)err->msg); /* Don't free err->cls here */ @@ -693,10 +693,10 @@ H5Ecreate_msg(hid_t class_id, H5E_type_t msg_type, const char *msg_str) H5E_cls_t *cls; /* Pointer to error class */ H5E_msg_t *msg; /* Pointer to new error message */ hid_t ret_value; /* Return value */ - + FUNC_ENTER_API(H5Ecreate_msg, FAIL) H5TRACE3("i","iEts",class_id,msg_type,msg_str); - + /* Check arguments */ if(msg_type!=H5E_MAJOR && msg_type!=H5E_MINOR) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid message type") @@ -738,9 +738,9 @@ H5E_create_msg(H5E_cls_t *cls, H5E_type_t msg_type, const char *msg_str) { H5E_msg_t *msg; /* Pointer to new error message */ H5E_msg_t *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5E_create_msg) - + /* Check arguments */ assert(cls); assert(msg_type==H5E_MAJOR || msg_type==H5E_MINOR); @@ -770,7 +770,7 @@ done: * Purpose: Retrieves a major error message. * * Return: Returns message if succeeds. - * otherwise returns NULL. + * otherwise returns NULL. * * Programmer: Raymond Lu * Friday, July 14, 2003 @@ -789,7 +789,7 @@ H5Eget_major(H5E_major_t maj) char *ret_value = NULL; FUNC_ENTER_API_NOCLEAR(H5Eget_major,NULL) - + /* Get the message object */ if((msg = H5I_object_verify(maj, H5I_ERROR_MSG))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a error message ID") @@ -797,7 +797,7 @@ H5Eget_major(H5E_major_t maj) /* Get the message's text */ if((size = H5E_get_msg(msg, &type, NULL, 0))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "can't get error message text"); - + if(type != H5E_MAJOR) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "Error message isn't a major one"); @@ -808,7 +808,7 @@ H5Eget_major(H5E_major_t maj) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "can't get error message text") ret_value = msg_str; - + done: FUNC_LEAVE_API(ret_value) } @@ -820,7 +820,7 @@ done: * Purpose: Retrieves a minor error message. * * Return: Returns message if succeeds. - * otherwise returns NULL. + * otherwise returns NULL. * * Programmer: Raymond Lu * Friday, July 14, 2003 @@ -839,7 +839,7 @@ H5Eget_minor(H5E_minor_t min) char *ret_value = NULL; FUNC_ENTER_API_NOCLEAR(H5Eget_minor,NULL) - + /* Get the message object */ if((msg = H5I_object_verify(min, H5I_ERROR_MSG))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a error message ID") @@ -847,10 +847,10 @@ H5Eget_minor(H5E_minor_t min) /* Get the message's text */ if((size = H5E_get_msg(msg, &type, NULL, 0))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "can't get error message text"); - + if(type != H5E_MINOR) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "Error message isn't a minor one"); - + /* Don't know who is going to free it */ msg_str = (char*)H5MM_malloc((size_t)(++size)*sizeof(char)); @@ -858,7 +858,7 @@ H5Eget_minor(H5E_minor_t min) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "can't get error message text") ret_value = msg_str; - + done: FUNC_LEAVE_API(ret_value) } @@ -870,7 +870,7 @@ done: * Purpose: Retrieves an error message. * * Return: Non-negative for message length if succeeds(zero means no message); - * otherwise returns negative value. + * otherwise returns negative value. * * Programmer: Raymond Lu * Friday, July 14, 2003 @@ -887,7 +887,7 @@ H5Eget_msg(hid_t msg_id, H5E_type_t *type, char *msg_str, size_t size) FUNC_ENTER_API(H5Eget_msg, FAIL) H5TRACE4("Zs","i*Etsz",msg_id,type,msg_str,size); - + /* Get the message object */ if((msg = H5I_object_verify(msg_id, H5I_ERROR_MSG))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error message ID") @@ -905,9 +905,9 @@ done: * Function: H5E_get_msg * * Purpose: Private function to retrieve an error message. - * + * * Return: Non-negative for name length if succeeds(zero means no name); - * otherwise returns negative value. + * otherwise returns negative value. * * Programmer: Raymond Lu * Friday, July 14, 2003 @@ -920,7 +920,7 @@ static ssize_t H5E_get_msg(const H5E_msg_t *msg, H5E_type_t *type, char *msg_str, size_t size) { ssize_t len; /* Length of rror class's name */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_get_msg) /* Check arguments */ @@ -934,8 +934,8 @@ H5E_get_msg(const H5E_msg_t *msg, H5E_type_t *type, char *msg_str, size_t size) HDstrncpy(msg_str, msg->msg, MIN((size_t)(len+1), size)); if((size_t)len >= size) msg_str[size-1]='\0'; - } - + } + /* Give the message type, if asked */ if(type) *type = msg->type; @@ -969,7 +969,7 @@ H5Eget_current_stack(void) /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Eget_current_stack, FAIL) H5TRACE0("i",""); - + /* Get the current stack */ if((stk=H5E_get_current_stack())==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTCREATE, FAIL, "can't create error stack") @@ -1004,7 +1004,7 @@ H5E_get_current_stack(void) H5E_t *estack_copy=NULL; /* Pointer to new error stack to return */ unsigned u; /* Local index variable */ H5E_t *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5E_get_current_stack) /* Get a pointer to the current error stack */ @@ -1016,24 +1016,24 @@ H5E_get_current_stack(void) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Make a copy of current error stack */ - estack_copy->nused = current_stack->nused; + estack_copy->nused = current_stack->nused; for(u=0; u<current_stack->nused; u++) { H5E_error_t *current_error, *new_error; /* Pointers to errors on each stack */ /* Get pointers into the current error stack location */ current_error = &(current_stack->slot[u]); new_error = &(estack_copy->slot[u]); - + /* Increment the IDs to indicate that they are used in this stack */ if(H5I_inc_ref(current_error->cls_id)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, NULL, "unable to increment ref count on error class") - new_error->cls_id = current_error->cls_id; + new_error->cls_id = current_error->cls_id; if(H5I_inc_ref(current_error->maj_num)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, NULL, "unable to increment ref count on error message") - new_error->maj_num = current_error->maj_num; + new_error->maj_num = current_error->maj_num; if(H5I_inc_ref(current_error->min_num)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, NULL, "unable to increment ref count on error message") - new_error->min_num = current_error->min_num; + new_error->min_num = current_error->min_num; if((new_error->func_name = HDstrdup(current_error->func_name))==NULL) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") if((new_error->file_name = HDstrdup(current_error->file_name))==NULL) @@ -1042,10 +1042,10 @@ H5E_get_current_stack(void) if((new_error->desc = HDstrdup(current_error->desc))==NULL) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") } /* end for */ - - /* Empty current error stack */ + + /* Empty current error stack */ H5E_clear_stack(current_stack); - + /* Set the return value */ ret_value = estack_copy; @@ -1062,7 +1062,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Eset_current_stack * - * Purpose: Replaces current stack with specified stack. + * Purpose: Replaces current stack with specified stack. * * Return: Non-negative value on success/Negative on failure * @@ -1078,10 +1078,10 @@ H5Eset_current_stack(hid_t err_stack) { H5E_t *estack; herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eset_current_stack, FAIL) H5TRACE1("e","i",err_stack); - + if(err_stack != H5E_DEFAULT) { if((estack = H5I_object_verify(err_stack, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") @@ -1116,7 +1116,7 @@ H5E_set_current_stack(H5E_t *estack) H5E_t *current_stack; /* Default error stack */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5E_set_current_stack) /* Sanity check */ @@ -1126,18 +1126,18 @@ H5E_set_current_stack(H5E_t *estack) if((current_stack = H5E_get_my_stack ())==NULL) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack") - /* Empty current error stack */ + /* Empty current error stack */ H5E_clear_stack(current_stack); /* Copy new stack to current error stack */ - current_stack->nused = estack->nused; + current_stack->nused = estack->nused; for(u=0; u<current_stack->nused; u++) { H5E_error_t *current_error, *new_error; /* Pointers to errors on each stack */ /* Get pointers into the current error stack location */ current_error = &(current_stack->slot[u]); new_error = &(estack->slot[u]); - + /* Increment the IDs to indicate that they are used in this stack */ if(H5I_inc_ref(new_error->cls_id)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, FAIL, "unable to decrement ref count on error class") @@ -1220,7 +1220,7 @@ static herr_t H5E_close_stack(H5E_t *estack) { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_close_stack) - + /* Sanity check */ assert(estack); @@ -1229,7 +1229,7 @@ H5E_close_stack(H5E_t *estack) /* Free the stack structure */ H5FL_FREE(H5E_t, estack); - + FUNC_LEAVE_NOAPI(SUCCEED) } @@ -1260,7 +1260,7 @@ H5Eget_num(hid_t error_stack_id) /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Eget_num, FAIL) H5TRACE1("Is","i",error_stack_id); - + /* Need to check for errors */ if(error_stack_id == H5E_DEFAULT) { if((estack = H5E_get_my_stack())==NULL) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ @@ -1274,7 +1274,7 @@ H5Eget_num(hid_t error_stack_id) if((estack = H5I_object_verify(error_stack_id, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") } /* end else */ - + /* Get the number of errors on stack */ if((ret_value=H5E_get_num(estack))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get number of errors") @@ -1305,8 +1305,8 @@ static ssize_t H5E_get_num(const H5E_t *estack) { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_get_num) - - assert(estack); + + assert(estack); FUNC_LEAVE_NOAPI((ssize_t)estack->nused) } @@ -1335,7 +1335,7 @@ H5Epop(hid_t err_stack, size_t count) /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Epop, FAIL) H5TRACE2("e","iz",err_stack,count); - + /* Need to check for errors */ if(err_stack == H5E_DEFAULT) { if((estack = H5E_get_my_stack())==NULL) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ @@ -1382,7 +1382,7 @@ static herr_t H5E_pop(H5E_t *estack, size_t count) { herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5E_pop) /* Sanity check */ @@ -1403,17 +1403,17 @@ done: * * Purpose: This function definition is for backward compatibility only. * It doesn't have error stack and error class as parameters. - * The old definition of major and minor is casted as HID_T - * in H5Epublic.h + * The old definition of major and minor is casted as HID_T + * in H5Epublic.h * * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Tuesday, Sep 16, 2003 * - * Notes: Basically a public API wrapper around the H5E_push_stack + * Notes: Basically a public API wrapper around the H5E_push_stack * function. For backward compatibility, it maintains the - * same parameter as the old function, in contrary to + * same parameter as the old function, in contrary to * H5Epush_stack. * * Modifications: @@ -1421,7 +1421,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Epush(const char *file, const char *func, unsigned line, +H5Epush(const char *file, const char *func, unsigned line, H5E_major_t maj, H5E_minor_t min, const char *str) { H5E_t *estack = NULL; /* Default error stack */ @@ -1430,7 +1430,7 @@ H5Epush(const char *file, const char *func, unsigned line, /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Epush, FAIL) H5TRACE6("e","ssIuiis",file,func,line,maj,min,str); - + /* Push the error on the stack */ if(H5E_push_stack(estack, file, func, line, H5E_ERR_CLS_g, maj, min, str)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't push error on stack") @@ -1456,7 +1456,7 @@ done: * Programmer: Quincey Koziol * Monday, October 18, 1999 * - * Notes: Basically a new public API wrapper around the H5E_push_stack + * Notes: Basically a new public API wrapper around the H5E_push_stack * function. * * Modifications: @@ -1470,7 +1470,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line, +H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *fmt, ...) { va_list ap; /* Varargs info */ @@ -1486,7 +1486,7 @@ H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Epush_stack, FAIL) H5TRACE7("e","issIuiis",err_stack,file,func,line,maj_id,min_id,fmt); - + if(err_stack == H5E_DEFAULT) estack = NULL; else { @@ -1497,7 +1497,7 @@ H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line if((estack = H5I_object_verify(err_stack, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") } /* end else */ - + /* Check for mis-matches in major & minor error classes */ if((maj_ptr = H5I_object_verify(maj_id, H5I_ERROR_MSG))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error message ID") @@ -1581,10 +1581,10 @@ done: * Programmer: Robb Matzke * Friday, December 12, 1997 * - * Modifications: + * Modifications: * Raymond Lu * Tuesday, July 15, 2003 - * + * * Added the ID of the error stack to which the error is pushed * on. The error message can be appended more message in the * same control format as printf and fprintf. @@ -1592,7 +1592,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, +H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc) { herr_t ret_value=SUCCEED; /* Return value */ @@ -1675,7 +1675,7 @@ H5Eclear(void) { H5E_t *estack = NULL; /* Default error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Eclear, FAIL) H5TRACE0("e",""); @@ -1708,7 +1708,7 @@ H5Eclear_stack(hid_t err_stack) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Eclear_stack, FAIL) H5TRACE1("e","i",err_stack); @@ -1723,7 +1723,7 @@ H5Eclear_stack(hid_t err_stack) if((estack = H5I_object_verify(err_stack, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") } /* end else */ - + /* Clear the error stack */ if(H5E_clear_stack(estack)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't clear error stack") @@ -1761,7 +1761,7 @@ H5E_clear_entries(H5E_t *estack, size_t nentries) assert(estack); assert(estack->nused>=nentries); - /* Empty the error stack from the top down */ + /* Empty the error stack from the top down */ for(u=0; nentries>0; nentries--,u++) { error = &(estack->slot[estack->nused-(u+1)]); @@ -1785,7 +1785,7 @@ H5E_clear_entries(H5E_t *estack, size_t nentries) /* Decrement number of errors on stack */ estack->nused-=u; - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -1818,12 +1818,12 @@ H5E_clear_stack(H5E_t *estack) if((estack = H5E_get_my_stack())==NULL) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack") - /* Empty the error stack */ + /* Empty the error stack */ assert(estack); if(estack->nused) if(H5E_clear_entries(estack, estack->nused)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't clear error stack") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -1855,14 +1855,14 @@ H5Eprint(FILE *stream) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Eprint, FAIL) /*NO TRACE*/ if((estack = H5E_get_my_stack())==NULL) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack") - + /* Print error stack */ if(H5E_print_stack(estack, stream)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't display error stack") @@ -1895,7 +1895,7 @@ done: * Print for specified error stack. A line will appear before the error * messages of each error class. It states the information of library * name, version number and thread ID. - * + * *------------------------------------------------------------------------- */ herr_t @@ -1903,7 +1903,7 @@ H5Eprint_stack(hid_t err_stack, FILE *stream) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Eprint_stack, FAIL) /*NO TRACE*/ @@ -1920,7 +1920,7 @@ H5Eprint_stack(hid_t err_stack, FILE *stream) if((estack = H5I_object_verify(err_stack, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") } /* end else */ - + /* Print error stack */ if(H5E_print_stack(estack, stream)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't display error stack") @@ -1933,10 +1933,10 @@ done: /*------------------------------------------------------------------------- * Function: H5E_print_stack * - * Purpose: Private function to print the error stack in some default + * Purpose: Private function to print the error stack in some default * way. This is just a convenience function for H5Ewalk() and - * H5Ewalk_stack() with a function that prints error messages. - * Users are encouraged to write there own more specific error + * H5Ewalk_stack() with a function that prints error messages. + * Users are encouraged to write there own more specific error * handlers. * * Return: Non-negative on success/Negative on failure @@ -1954,7 +1954,7 @@ done: * Print for specified error stack. A line will appear before the error * messages of each error class. It states the information of library * name, version number and thread ID. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1965,23 +1965,23 @@ H5E_print_stack(const H5E_t *estack, FILE *stream) /* Don't clear the error stack! :-) */ FUNC_ENTER_NOAPI_NOINIT(H5E_print_stack) - + /* Sanity check */ assert(estack); /* If no stream was given, use stderr */ - if (!stream) + if (!stream) eprint.stream = stderr; else eprint.stream = stream; /* Reset the original error class information */ HDmemset(&eprint.cls,0,sizeof(H5E_cls_t)); - + /* Walk the error stack */ if(H5E_walk_stack(estack, H5E_WALK_DOWNWARD, H5E_walk_cb, (void*)&eprint)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't walk error stack") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -2041,7 +2041,7 @@ done: * Raymond Lu * Wednesday, July 16, 2003 * Let it walk through specified error stack. - * + * *------------------------------------------------------------------------- */ herr_t @@ -2104,7 +2104,7 @@ done: * Raymond Lu * Wednesday, July 16, 2003 * Let it walk through specified error stack. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -2138,7 +2138,7 @@ H5E_walk_stack(const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func, if(status<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't walk error stack") } /* end if */ - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -2197,7 +2197,7 @@ H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data) /* If no client data was passed, output to stderr */ if (!client_data) stream = stderr; else stream = eprint->stream; - + /* Get descriptions for the major and minor error numbers */ maj_ptr = H5I_object_verify(err_desc->maj_num, H5I_ERROR_MSG); min_ptr = H5I_object_verify(err_desc->min_num, H5I_ERROR_MSG); @@ -2209,7 +2209,7 @@ H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data) /* Get error class info */ cls_ptr = maj_ptr->cls; - + /* Print error class header if new class */ if(eprint->cls.lib_name==NULL || HDstrcmp(cls_ptr->lib_name, eprint->cls.lib_name)) { /* update to the new class information */ @@ -2218,7 +2218,7 @@ H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data) if(cls_ptr->lib_vers) eprint->cls.lib_vers = cls_ptr->lib_vers; fprintf (stream, "%s-DIAG: Error detected in %s (%s) ", cls_ptr->cls_name, cls_ptr->lib_name, cls_ptr->lib_vers); - + /* try show the process or thread id in multiple processes cases*/ #ifdef H5_HAVE_PARALLEL { int mpi_rank, mpi_initialized; @@ -2262,15 +2262,15 @@ H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data) * * Purpose: This function is for backward compatbility. * Returns the current settings for the automatic error stack - * traversal function and its data for specific error stack. - * Either (or both) arguments may be null in which case the + * traversal function and its data for specific error stack. + * Either (or both) arguments may be null in which case the * value is not returned. * * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Sep 16, 2003 - * + * * Modifications: * *------------------------------------------------------------------------- @@ -2280,11 +2280,11 @@ H5Eget_auto(H5E_auto_t *func, void **client_data) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eget_auto, FAIL) H5TRACE2("e","*xx",func,client_data); - /* Retrieve default error stack */ + /* Retrieve default error stack */ if((estack = H5E_get_my_stack())==NULL) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack") @@ -2301,8 +2301,8 @@ done: * Function: H5Eget_auto_stack * * Purpose: Returns the current settings for the automatic error stack - * traversal function and its data for specific error stack. - * Either (or both) arguments may be null in which case the + * traversal function and its data for specific error stack. + * Either (or both) arguments may be null in which case the * value is not returned. * * Return: Non-negative on success/Negative on failure @@ -2313,7 +2313,7 @@ done: * Modifications: * Raymond Lu * July 18, 2003 - * Added error stack in the parameters. It returns the + * Added error stack in the parameters. It returns the * traversal function and data for that error stack. * *------------------------------------------------------------------------- @@ -2323,10 +2323,10 @@ H5Eget_auto_stack(hid_t estack_id, H5E_auto_stack_t *func, void **client_data) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eget_auto_stack, FAIL) H5TRACE3("e","i*xx",estack_id,func,client_data); - + if(estack_id == H5E_DEFAULT) { if((estack = H5E_get_my_stack())==NULL) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack") @@ -2347,9 +2347,9 @@ done: /*------------------------------------------------------------------------- * Function: H5E_get_auto_stack * - * Purpose: Private function to return the current settings for the - * automatic error stack traversal function and its data - * for specific error stack. Either (or both) arguments may + * Purpose: Private function to return the current settings for the + * automatic error stack traversal function and its data + * for specific error stack. Either (or both) arguments may * be null in which case the value is not returned. * * Return: Non-negative on success/Negative on failure @@ -2367,7 +2367,7 @@ H5E_get_auto_stack(const H5E_t *estack, hbool_t new_api, void * *func, void **cl FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_get_auto_stack) assert (estack); - + /* Retrieve the requested information */ if(func) *func = new_api ? (void *)estack->u.func_stack : (void *)estack->u.func; @@ -2382,8 +2382,8 @@ H5E_get_auto_stack(const H5E_t *estack, hbool_t new_api, void * *func, void **cl * Function: H5Eset_auto * * Purpose: This function is for backward compatbility. - * Turns on or off automatic printing of errors for certain - * error stack. When turned on (non-null FUNC pointer) any + * Turns on or off automatic printing of errors for certain + * error stack. When turned on (non-null FUNC pointer) any * API function which returns an error indication will first * call FUNC passing it CLIENT_DATA as an argument. * @@ -2393,7 +2393,7 @@ H5E_get_auto_stack(const H5E_t *estack, hbool_t new_api, void * *func, void **cl * * Automatic stack traversal is always in the H5E_WALK_DOWNWARD * direction. - * + * * See Also: H5Ewalk() * * Return: Non-negative on success/Negative on failure @@ -2410,13 +2410,13 @@ H5Eset_auto(H5E_auto_t func, void *client_data) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eset_auto, FAIL) H5TRACE2("e","xx",func,client_data); if((estack = H5E_get_my_stack())==NULL) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack") - + /* Set the automatic error reporting information */ if(H5E_set_auto_stack(estack, FALSE, (void *)func, client_data)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't set automatic error info") @@ -2429,8 +2429,8 @@ done: /*------------------------------------------------------------------------- * Function: H5Eset_auto_stack * - * Purpose: Turns on or off automatic printing of errors for certain - * error stack. When turned on (non-null FUNC pointer) any + * Purpose: Turns on or off automatic printing of errors for certain + * error stack. When turned on (non-null FUNC pointer) any * API function which returns an error indication will first * call FUNC passing it CLIENT_DATA as an argument. * @@ -2440,7 +2440,7 @@ done: * * Automatic stack traversal is always in the H5E_WALK_DOWNWARD * direction. - * + * * See Also: H5Ewalk() * * Return: Non-negative on success/Negative on failure @@ -2457,7 +2457,7 @@ H5Eset_auto_stack(hid_t estack_id, H5E_auto_stack_t func, void *client_data) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eset_auto_stack, FAIL) H5TRACE3("e","ixx",estack_id,func,client_data); @@ -2468,7 +2468,7 @@ H5Eset_auto_stack(hid_t estack_id, H5E_auto_stack_t func, void *client_data) else if((estack = H5I_object_verify(estack_id, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") - + /* Set the automatic error reporting information */ if(H5E_set_auto_stack(estack, TRUE, (void *)func, client_data)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't set automatic error info") @@ -2481,10 +2481,10 @@ done: /*------------------------------------------------------------------------- * Function: H5E_set_auto_stack * - * Purpose: Private function to turn on or off automatic printing of - * errors for certain error stack. When turned on (non-null - * FUNC pointer) any API function which returns an error - * indication will first call FUNC passing it CLIENT_DATA + * Purpose: Private function to turn on or off automatic printing of + * errors for certain error stack. When turned on (non-null + * FUNC pointer) any API function which returns an error + * indication will first call FUNC passing it CLIENT_DATA * as an argument. * * The default values before this function is called are @@ -2493,7 +2493,7 @@ done: * * Automatic stack traversal is always in the H5E_WALK_DOWNWARD * direction. - * + * * See Also: H5Ewalk() * * Return: Non-negative on success/Negative on failure @@ -2530,7 +2530,7 @@ H5E_set_auto_stack(H5E_t *estack, hbool_t new_api, void *func, void *client_data * Purpose: Private function to dump the error stack during an error in * an API function if a callback function is defined for the * current error stack. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol @@ -2574,7 +2574,7 @@ done: * error stack conforms to the H5E_auto_stack_t typedef * or the H5E_auto_t typedef. The IS_STACK parameter is set * to 1 for the first case and 0 for the latter case. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol @@ -2589,7 +2589,7 @@ H5Eauto_is_stack(hid_t estack_id, unsigned *is_stack) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eauto_is_stack, FAIL) H5TRACE2("e","i*Iu",estack_id,is_stack); @@ -2600,7 +2600,7 @@ H5Eauto_is_stack(hid_t estack_id, unsigned *is_stack) else if((estack = H5I_object_verify(estack_id, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") - + /* Check if the error stack reporting function is the "newer" stack type */ if(is_stack) *is_stack=estack->new_api; diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index a1d8f0b..0c99f9f 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -113,7 +113,7 @@ typedef struct H5E_print_t { /* Library-private functions defined in H5E package */ H5_DLL herr_t H5E_init(void); -H5_DLL herr_t H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, +H5_DLL herr_t H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc); H5_DLL herr_t H5E_clear_stack(H5E_t *estack); H5_DLL herr_t H5E_dump_api_stack(int is_api); diff --git a/src/H5Epublic.h b/src/H5Epublic.h index 883e8c6..001f0a5 100644 --- a/src/H5Epublic.h +++ b/src/H5Epublic.h @@ -162,10 +162,10 @@ H5_DLL herr_t H5Eauto_is_stack(hid_t err_stack, unsigned *is_stack); /* These old APIs are kept for backward compatibility. They don't have * the error stack in the parameters. */ -H5_DLL herr_t H5Epush(const char *file, const char *func, unsigned line, +H5_DLL herr_t H5Epush(const char *file, const char *func, unsigned line, H5E_major_t maj, H5E_minor_t min, const char *str); H5_DLL herr_t H5Eprint(FILE *stream); -H5_DLL herr_t H5Ewalk(H5E_direction_t direction, H5E_walk_t func, +H5_DLL herr_t H5Ewalk(H5E_direction_t direction, H5E_walk_t func, void *client_data); H5_DLL herr_t H5Eget_auto(H5E_auto_t *func, void **client_data); H5_DLL herr_t H5Eset_auto(H5E_auto_t func, void *client_data); @@ -173,12 +173,12 @@ H5_DLL herr_t H5Eclear(void); H5_DLL const char * H5Eget_major(H5E_major_t maj); H5_DLL const char * H5Eget_minor(H5E_minor_t min); -/* New APIs function the same as the old ones above, with the error stack +/* New APIs function the same as the old ones above, with the error stack * in the parameters */ -H5_DLL herr_t H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line, +H5_DLL herr_t H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *msg, ...); H5_DLL herr_t H5Eprint_stack(hid_t err_stack, FILE *stream); -H5_DLL herr_t H5Ewalk_stack(hid_t err_stack, H5E_direction_t direction, H5E_walk_t func, +H5_DLL herr_t H5Ewalk_stack(hid_t err_stack, H5E_direction_t direction, H5E_walk_t func, void *client_data); H5_DLL herr_t H5Eget_auto_stack(hid_t estack_id, H5E_auto_stack_t *func, void **client_data); H5_DLL herr_t H5Eset_auto_stack(hid_t estack_id, H5E_auto_stack_t func, void *client_data); diff --git a/src/H5Eterm.h b/src/H5Eterm.h index 987315a..1d89d87 100644 --- a/src/H5Eterm.h +++ b/src/H5Eterm.h @@ -20,168 +20,168 @@ #define _H5Eterm_H /* Reset major error IDs */ - -H5E_DATASET_g= -H5E_FUNC_g= -H5E_STORAGE_g= -H5E_FILE_g= -H5E_FPHDF5_g= -H5E_SYM_g= -H5E_VFL_g= -H5E_INTERNAL_g= -H5E_BTREE_g= -H5E_REFERENCE_g= -H5E_DATASPACE_g= -H5E_RESOURCE_g= -H5E_PLIST_g= -H5E_DATATYPE_g= -H5E_RS_g= -H5E_HEAP_g= -H5E_OHDR_g= -H5E_ATOM_g= -H5E_ATTR_g= -H5E_IO_g= -H5E_BLKTRK_g= -H5E_SLIST_g= -H5E_EFL_g= -H5E_TST_g= -H5E_ARGS_g= -H5E_ERROR_g= -H5E_PLINE_g= + +H5E_DATASET_g= +H5E_FUNC_g= +H5E_STORAGE_g= +H5E_FILE_g= +H5E_FPHDF5_g= +H5E_SYM_g= +H5E_VFL_g= +H5E_INTERNAL_g= +H5E_BTREE_g= +H5E_REFERENCE_g= +H5E_DATASPACE_g= +H5E_RESOURCE_g= +H5E_PLIST_g= +H5E_DATATYPE_g= +H5E_RS_g= +H5E_HEAP_g= +H5E_OHDR_g= +H5E_ATOM_g= +H5E_ATTR_g= +H5E_IO_g= +H5E_BLKTRK_g= +H5E_SLIST_g= +H5E_EFL_g= +H5E_TST_g= +H5E_ARGS_g= +H5E_ERROR_g= +H5E_PLINE_g= H5E_CACHE_g= (-1); /* Reset minor error IDs */ -/* Generic low-level file I/O errors */ -H5E_SEEKERROR_g= -H5E_READERROR_g= -H5E_WRITEERROR_g= -H5E_CLOSEERROR_g= -H5E_OVERFLOW_g= +/* Generic low-level file I/O errors */ +H5E_SEEKERROR_g= +H5E_READERROR_g= +H5E_WRITEERROR_g= +H5E_CLOSEERROR_g= +H5E_OVERFLOW_g= H5E_FCNTL_g= -/* Resource errors */ -H5E_NOSPACE_g= -H5E_CANTCOPY_g= -H5E_CANTFREE_g= -H5E_ALREADYEXISTS_g= -H5E_CANTLOCK_g= -H5E_CANTUNLOCK_g= -H5E_CANTGC_g= +/* Resource errors */ +H5E_NOSPACE_g= +H5E_CANTCOPY_g= +H5E_CANTFREE_g= +H5E_ALREADYEXISTS_g= +H5E_CANTLOCK_g= +H5E_CANTUNLOCK_g= +H5E_CANTGC_g= H5E_CANTGETSIZE_g= -/* Heap errors */ +/* Heap errors */ H5E_CANTRESTORE_g= -/* Function entry/exit interface errors */ -H5E_CANTINIT_g= -H5E_ALREADYINIT_g= +/* Function entry/exit interface errors */ +H5E_CANTINIT_g= +H5E_ALREADYINIT_g= H5E_CANTRELEASE_g= -/* Property list errors */ -H5E_CANTGET_g= -H5E_CANTSET_g= +/* Property list errors */ +H5E_CANTGET_g= +H5E_CANTSET_g= H5E_DUPCLASS_g= -/* Object header related errors */ -H5E_LINKCOUNT_g= -H5E_VERSION_g= -H5E_ALIGNMENT_g= -H5E_BADMESG_g= +/* Object header related errors */ +H5E_LINKCOUNT_g= +H5E_VERSION_g= +H5E_ALIGNMENT_g= +H5E_BADMESG_g= H5E_CANTDELETE_g= -/* FPHDF5 errors */ -H5E_CANTRECV_g= -H5E_CANTSENDMDATA_g= -H5E_CANTCHANGE_g= +/* FPHDF5 errors */ +H5E_CANTRECV_g= +H5E_CANTSENDMDATA_g= +H5E_CANTCHANGE_g= H5E_CANTALLOC_g= -/* System level errors */ +/* System level errors */ H5E_SYSERRSTR_g= -/* I/O pipeline errors */ -H5E_NOFILTER_g= -H5E_CALLBACK_g= -H5E_CANAPPLY_g= -H5E_SETLOCAL_g= +/* I/O pipeline errors */ +H5E_NOFILTER_g= +H5E_CALLBACK_g= +H5E_CANAPPLY_g= +H5E_SETLOCAL_g= H5E_NOENCODER_g= -/* Group related errors */ -H5E_CANTOPENOBJ_g= -H5E_CANTCLOSEOBJ_g= -H5E_COMPLEN_g= -H5E_CWG_g= -H5E_LINK_g= +/* Group related errors */ +H5E_CANTOPENOBJ_g= +H5E_CANTCLOSEOBJ_g= +H5E_COMPLEN_g= +H5E_CWG_g= +H5E_LINK_g= H5E_SLINK_g= -/* File accessability errors */ -H5E_FILEEXISTS_g= -H5E_FILEOPEN_g= -H5E_CANTCREATE_g= -H5E_CANTOPENFILE_g= -H5E_CANTCLOSEFILE_g= -H5E_NOTHDF5_g= -H5E_BADFILE_g= -H5E_TRUNCATED_g= +/* File accessability errors */ +H5E_FILEEXISTS_g= +H5E_FILEOPEN_g= +H5E_CANTCREATE_g= +H5E_CANTOPENFILE_g= +H5E_CANTCLOSEFILE_g= +H5E_NOTHDF5_g= +H5E_BADFILE_g= +H5E_TRUNCATED_g= H5E_MOUNT_g= -/* Object atom related errors */ -H5E_BADATOM_g= -H5E_BADGROUP_g= -H5E_CANTREGISTER_g= -H5E_CANTINC_g= -H5E_CANTDEC_g= +/* Object atom related errors */ +H5E_BADATOM_g= +H5E_BADGROUP_g= +H5E_CANTREGISTER_g= +H5E_CANTINC_g= +H5E_CANTDEC_g= H5E_NOIDS_g= -/* Cache related errors */ -H5E_CANTFLUSH_g= -H5E_CANTSERIALIZE_g= -H5E_CANTLOAD_g= -H5E_PROTECT_g= -H5E_NOTCACHED_g= -H5E_SYSTEM_g= -H5E_CANTINS_g= -H5E_CANTRENAME_g= -H5E_CANTPROTECT_g= +/* Cache related errors */ +H5E_CANTFLUSH_g= +H5E_CANTSERIALIZE_g= +H5E_CANTLOAD_g= +H5E_PROTECT_g= +H5E_NOTCACHED_g= +H5E_SYSTEM_g= +H5E_CANTINS_g= +H5E_CANTRENAME_g= +H5E_CANTPROTECT_g= H5E_CANTUNPROTECT_g= -/* Parallel MPI errors */ -H5E_MPI_g= +/* Parallel MPI errors */ +H5E_MPI_g= H5E_MPIERRSTR_g= -/* Block tracker errors */ +/* Block tracker errors */ H5E_OVERLAPS_g= -/* Dataspace errors */ -H5E_CANTCLIP_g= -H5E_CANTCOUNT_g= -H5E_CANTSELECT_g= -H5E_CANTNEXT_g= -H5E_BADSELECT_g= +/* Dataspace errors */ +H5E_CANTCLIP_g= +H5E_CANTCOUNT_g= +H5E_CANTSELECT_g= +H5E_CANTNEXT_g= +H5E_BADSELECT_g= H5E_CANTCOMPARE_g= -/* B-tree related errors */ -H5E_NOTFOUND_g= -H5E_EXISTS_g= -H5E_CANTENCODE_g= -H5E_CANTDECODE_g= -H5E_CANTSPLIT_g= -H5E_CANTREDISTRIBUTE_g= -H5E_CANTSWAP_g= -H5E_CANTINSERT_g= -H5E_CANTLIST_g= +/* B-tree related errors */ +H5E_NOTFOUND_g= +H5E_EXISTS_g= +H5E_CANTENCODE_g= +H5E_CANTDECODE_g= +H5E_CANTSPLIT_g= +H5E_CANTREDISTRIBUTE_g= +H5E_CANTSWAP_g= +H5E_CANTINSERT_g= +H5E_CANTLIST_g= H5E_CANTMODIFY_g= -/* Argument errors */ -H5E_UNINITIALIZED_g= -H5E_UNSUPPORTED_g= -H5E_BADTYPE_g= -H5E_BADRANGE_g= +/* Argument errors */ +H5E_UNINITIALIZED_g= +H5E_UNSUPPORTED_g= +H5E_BADTYPE_g= +H5E_BADRANGE_g= H5E_BADVALUE_g= -/* Datatype conversion errors */ -H5E_CANTCONVERT_g= +/* Datatype conversion errors */ +H5E_CANTCONVERT_g= H5E_BADSIZE_g= (-1); #endif /* H5Eterm_H */ @@ -58,7 +58,7 @@ typedef struct H5F_olist_t { } file_info; unsigned list_index; /* Current index in open ID array */ int max_index; /* Maximum # of IDs to put into array */ -} H5F_olist_t; +} H5F_olist_t; /* PRIVATE PROTOTYPES */ #ifdef NOT_YET @@ -143,10 +143,10 @@ done: * J. Mainzer, 2005-03-10 * Updated function for changes in property list entries required * by the new metadata cache. - * + * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5F_init_interface(void) { size_t nprops; /* Number of properties */ @@ -154,7 +154,7 @@ H5F_init_interface(void) /* File creation property class variables. In sequence, they are * - File create property list class to modify - * - Default value for size of file user block + * - Default value for size of file user block * - Default value for 1/2 rank for symbol table leaf nodes * - Default value for 1/2 rank for btree internal nodes * - Default value for byte number in an address @@ -162,7 +162,7 @@ H5F_init_interface(void) * - Default value for version number of superblock * - Default value for free-space version number * - Default value for object directory version number - * - Default value for share-header format version + * - Default value for share-header format version */ H5P_genclass_t *crt_pclass; hsize_t userblock_size = H5F_CRT_USER_BLOCK_DEF; @@ -174,7 +174,7 @@ H5F_init_interface(void) unsigned freespace_ver = H5F_CRT_FREESPACE_VERS_DEF; unsigned objectdir_ver = H5F_CRT_OBJ_DIR_VERS_DEF; unsigned sharedheader_ver = H5F_CRT_SHARE_HEAD_VERS_DEF; - /* File access property class variables. In sequence, they are + /* File access property class variables. In sequence, they are * - File access property class to modify * - Initial metadata cache resize configuration * - Size of raw data chunk cache(elements) @@ -186,10 +186,10 @@ H5F_init_interface(void) * - Maximum sieve buffer size * - Garbage-collect reference * - File driver ID - * - File driver info + * - File driver info */ H5P_genclass_t *acs_pclass; - H5AC_cache_config_t + H5AC_cache_config_t mdc_initCacheCfg = H5F_ACS_META_CACHE_INIT_CONFIG_DEF; size_t rdcc_nelmts = H5F_ACS_DATA_CACHE_ELMT_SIZE_DEF; size_t rdcc_nbytes = H5F_ACS_DATA_CACHE_BYTE_SIZE_DEF; @@ -208,13 +208,13 @@ H5F_init_interface(void) hbool_t family_to_sec2 = H5F_ACS_FAMILY_TO_SEC2_DEF; H5FD_mem_t mem_type = H5F_ACS_MULTI_TYPE_DEF; - /* File mount property class variable. + /* File mount property class variable. * - Mount property class to modify - * - whether absolute symlinks is local to file + * - whether absolute symlinks is local to file */ H5P_genclass_t *mnt_pclass; hbool_t local = H5F_MNT_SYM_LOCAL_DEF; - + FUNC_ENTER_NOAPI_NOINIT(H5F_init_interface) /* @@ -222,8 +222,8 @@ H5F_init_interface(void) */ if (H5I_register_type(H5I_FILE, (size_t)H5I_FILEID_HASHSIZE, 0, (H5I_free_t)H5F_close)<H5I_FILE) HGOTO_ERROR (H5E_FILE, H5E_CANTINIT, FAIL, "unable to initialize interface") - - /* ========== File Creation Property Class Initialization ============*/ + + /* ========== File Creation Property Class Initialization ============*/ assert(H5P_CLS_FILE_CREATE_g!=-1); /* Get the pointer to file creation class */ @@ -237,39 +237,39 @@ H5F_init_interface(void) /* Assume that if there are properties in the class, they are the default ones */ if(nprops==0) { /* Register the user block size */ - if(H5P_register(crt_pclass,H5F_CRT_USER_BLOCK_NAME,H5F_CRT_USER_BLOCK_SIZE, &userblock_size,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(crt_pclass,H5F_CRT_USER_BLOCK_NAME,H5F_CRT_USER_BLOCK_SIZE, &userblock_size,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 1/2 rank for symbol table leaf nodes */ - if(H5P_register(crt_pclass,H5F_CRT_SYM_LEAF_NAME,H5F_CRT_SYM_LEAF_SIZE, &sym_leaf_k,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(crt_pclass,H5F_CRT_SYM_LEAF_NAME,H5F_CRT_SYM_LEAF_SIZE, &sym_leaf_k,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 1/2 rank for btree internal nodes */ - if(H5P_register(crt_pclass,H5F_CRT_BTREE_RANK_NAME,H5F_CRT_BTREE_RANK_SIZE, btree_k,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(crt_pclass,H5F_CRT_BTREE_RANK_NAME,H5F_CRT_BTREE_RANK_SIZE, btree_k,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the byte number for an address */ - if(H5P_register(crt_pclass,H5F_CRT_ADDR_BYTE_NUM_NAME, H5F_CRT_ADDR_BYTE_NUM_SIZE, &sizeof_addr,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(crt_pclass,H5F_CRT_ADDR_BYTE_NUM_NAME, H5F_CRT_ADDR_BYTE_NUM_SIZE, &sizeof_addr,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the byte number for object size */ - if(H5P_register(crt_pclass,H5F_CRT_OBJ_BYTE_NUM_NAME, H5F_CRT_OBJ_BYTE_NUM_SIZE,&sizeof_size,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(crt_pclass,H5F_CRT_OBJ_BYTE_NUM_NAME, H5F_CRT_OBJ_BYTE_NUM_SIZE,&sizeof_size,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the superblock version number */ - if(H5P_register(crt_pclass,H5F_CRT_SUPER_VERS_NAME,H5F_CRT_SUPER_VERS_SIZE, &superblock_ver,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(crt_pclass,H5F_CRT_SUPER_VERS_NAME,H5F_CRT_SUPER_VERS_SIZE, &superblock_ver,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the free-space version number */ - if(H5P_register(crt_pclass,H5F_CRT_FREESPACE_VERS_NAME, H5F_CRT_FREESPACE_VERS_SIZE,&freespace_ver,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(crt_pclass,H5F_CRT_FREESPACE_VERS_NAME, H5F_CRT_FREESPACE_VERS_SIZE,&freespace_ver,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the object directory version number */ - if(H5P_register(crt_pclass,H5F_CRT_OBJ_DIR_VERS_NAME, H5F_CRT_OBJ_DIR_VERS_SIZE,&objectdir_ver,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(crt_pclass,H5F_CRT_OBJ_DIR_VERS_NAME, H5F_CRT_OBJ_DIR_VERS_SIZE,&objectdir_ver,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the shared-header version number */ - if(H5P_register(crt_pclass,H5F_CRT_SHARE_HEAD_VERS_NAME, H5F_CRT_SHARE_HEAD_VERS_SIZE, &sharedheader_ver,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(crt_pclass,H5F_CRT_SHARE_HEAD_VERS_NAME, H5F_CRT_SHARE_HEAD_VERS_SIZE, &sharedheader_ver,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") } /* end if */ @@ -295,51 +295,51 @@ H5F_init_interface(void) if(nprops==0) { /* Register the initial metadata cache resize configuration */ - if(H5P_register(acs_pclass,H5F_ACS_META_CACHE_INIT_CONFIG_NAME,H5F_ACS_META_CACHE_INIT_CONFIG_SIZE, &mdc_initCacheCfg,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_META_CACHE_INIT_CONFIG_NAME,H5F_ACS_META_CACHE_INIT_CONFIG_SIZE, &mdc_initCacheCfg,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of raw data chunk cache (elements) */ - if(H5P_register(acs_pclass,H5F_ACS_DATA_CACHE_ELMT_SIZE_NAME,H5F_ACS_DATA_CACHE_ELMT_SIZE_SIZE, &rdcc_nelmts,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_DATA_CACHE_ELMT_SIZE_NAME,H5F_ACS_DATA_CACHE_ELMT_SIZE_SIZE, &rdcc_nelmts,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of raw data chunk cache(bytes) */ - if(H5P_register(acs_pclass,H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME,H5F_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &rdcc_nbytes,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME,H5F_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &rdcc_nbytes,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the preemption for reading chunks */ - if(H5P_register(acs_pclass,H5F_ACS_PREEMPT_READ_CHUNKS_NAME,H5F_ACS_PREEMPT_READ_CHUNKS_SIZE, &rdcc_w0,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_PREEMPT_READ_CHUNKS_NAME,H5F_ACS_PREEMPT_READ_CHUNKS_SIZE, &rdcc_w0,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the threshold for alignment */ - if(H5P_register(acs_pclass,H5F_ACS_ALIGN_THRHD_NAME,H5F_ACS_ALIGN_THRHD_SIZE, &threshold,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_ALIGN_THRHD_NAME,H5F_ACS_ALIGN_THRHD_SIZE, &threshold,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the alignment */ - if(H5P_register(acs_pclass,H5F_ACS_ALIGN_NAME,H5F_ACS_ALIGN_SIZE, &alignment,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_ALIGN_NAME,H5F_ACS_ALIGN_SIZE, &alignment,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the minimum metadata allocation block size */ - if(H5P_register(acs_pclass,H5F_ACS_META_BLOCK_SIZE_NAME,H5F_ACS_META_BLOCK_SIZE_SIZE, &meta_block_size,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_META_BLOCK_SIZE_NAME,H5F_ACS_META_BLOCK_SIZE_SIZE, &meta_block_size,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the maximum sieve buffer size */ - if(H5P_register(acs_pclass,H5F_ACS_SIEVE_BUF_SIZE_NAME,H5F_ACS_SIEVE_BUF_SIZE_SIZE, &sieve_buf_size,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_SIEVE_BUF_SIZE_NAME,H5F_ACS_SIEVE_BUF_SIZE_SIZE, &sieve_buf_size,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the minimum "small data" allocation block size */ - if(H5P_register(acs_pclass,H5F_ACS_SDATA_BLOCK_SIZE_NAME,H5F_ACS_SDATA_BLOCK_SIZE_SIZE, &sdata_block_size,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_SDATA_BLOCK_SIZE_NAME,H5F_ACS_SDATA_BLOCK_SIZE_SIZE, &sdata_block_size,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the garbage collection reference */ - if(H5P_register(acs_pclass,H5F_ACS_GARBG_COLCT_REF_NAME,H5F_ACS_GARBG_COLCT_REF_SIZE, &gc_ref,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_GARBG_COLCT_REF_NAME,H5F_ACS_GARBG_COLCT_REF_SIZE, &gc_ref,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file driver ID */ - if(H5P_register(acs_pclass,H5F_ACS_FILE_DRV_ID_NAME,H5F_ACS_FILE_DRV_ID_SIZE, &driver_id,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_FILE_DRV_ID_NAME,H5F_ACS_FILE_DRV_ID_SIZE, &driver_id,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file driver info */ - if(H5P_register(acs_pclass,H5F_ACS_FILE_DRV_INFO_NAME,H5F_ACS_FILE_DRV_INFO_SIZE, &driver_info,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_FILE_DRV_INFO_NAME,H5F_ACS_FILE_DRV_INFO_SIZE, &driver_info,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file close degree */ @@ -349,7 +349,7 @@ H5F_init_interface(void) /* Register the offset of family driver info */ if(H5P_register(acs_pclass,H5F_ACS_FAMILY_OFFSET_NAME,H5F_ACS_FAMILY_OFFSET_SIZE, &family_offset,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - + /* Register the private property of new family file size. It's used by h5repart only. */ if(H5P_register(acs_pclass,H5F_ACS_FAMILY_NEWSIZE_NAME,H5F_ACS_FAMILY_NEWSIZE_SIZE, &family_newsize,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -357,7 +357,7 @@ H5F_init_interface(void) /* Register the private property of whether convert family to sec2 driver. It's used by h5repart only. */ if(H5P_register(acs_pclass,H5F_ACS_FAMILY_TO_SEC2_NAME,H5F_ACS_FAMILY_TO_SEC2_SIZE, &family_to_sec2,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - + /* Register the data type of multi driver info */ if(H5P_register(acs_pclass,H5F_ACS_MULTI_TYPE_NAME,H5F_ACS_MULTI_TYPE_SIZE, &mem_type,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -384,7 +384,7 @@ H5F_init_interface(void) /* Assume that if there are properties in the class, they are the default ones */ if(nprops==0) { /* Register property of whether symlinks is local to file */ - if(H5P_register(mnt_pclass,H5F_MNT_SYM_LOCAL_NAME,H5F_MNT_SYM_LOCAL_SIZE, &local,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(mnt_pclass,H5F_MNT_SYM_LOCAL_NAME,H5F_MNT_SYM_LOCAL_SIZE, &local,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") } /* end if */ @@ -445,15 +445,15 @@ H5F_term_interface(void) /*---------------------------------------------------------------------------- * Function: H5F_acs_create - * - * Purpose: Callback routine which is called whenever a file access + * + * Purpose: Callback routine which is called whenever a file access * property list is closed. This routine performs any generic * initialization needed on the properties the library put into * the list. - * + * * Return: Success: Non-negative * Failure: Negative - * + * * Programmer: Raymond Lu * Tuesday, Oct 23, 2001 * @@ -462,7 +462,7 @@ H5F_term_interface(void) *---------------------------------------------------------------------------- */ /* ARGSUSED */ -herr_t +herr_t H5F_acs_create(hid_t fapl_id, void UNUSED *copy_data) { hid_t driver_id; @@ -481,7 +481,7 @@ H5F_acs_create(hid_t fapl_id, void UNUSED *copy_data) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get drver ID") if(H5P_get(plist, H5F_ACS_FILE_DRV_INFO_NAME, &driver_info) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get drver info") - + if(driver_id > 0) { /* Set the driver for the property list */ if(H5FD_fapl_open(plist, driver_id, driver_info)<0) @@ -496,7 +496,7 @@ done: /*-------------------------------------------------------------------------- * Function: H5F_acs_copy * - * Purpose: Callback routine which is called whenever a file access + * Purpose: Callback routine which is called whenever a file access * property list is copied. This routine performs any generic * copy needed on the properties. * @@ -505,12 +505,12 @@ done: * Programmer: Raymond Lu * Tuesday, Oct 23, 2001 * - * Modifications: + * Modifications: * *-------------------------------------------------------------------------- - */ + */ /* ARGSUSED */ -herr_t +herr_t H5F_acs_copy(hid_t new_fapl_id, hid_t old_fapl_id, void UNUSED *copy_data) { hid_t driver_id; @@ -531,7 +531,7 @@ H5F_acs_copy(hid_t new_fapl_id, hid_t old_fapl_id, void UNUSED *copy_data) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get drver ID") if(H5P_get(old_plist, H5F_ACS_FILE_DRV_INFO_NAME, &driver_info) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get drver info") - + if(driver_id > 0) { /* Set the driver for the property list */ if(H5FD_fapl_open(new_plist, driver_id, driver_info)<0) @@ -545,24 +545,24 @@ done: /*-------------------------------------------------------------------------- * Function: H5F_acs_close - * - * Purpose: Callback routine which is called whenever a file access - * property list is closed. This routine performs any generic + * + * Purpose: Callback routine which is called whenever a file access + * property list is closed. This routine performs any generic * cleanup needed on the properties. * * Return: Success: Non-negative - * + * * Failure: Negative * * Programmer: Raymond Lu * Tuesday, Oct 23, 2001 - * + * * Modifications: * *--------------------------------------------------------------------------- - */ + */ /* ARGSUSED */ -herr_t +herr_t H5F_acs_close(hid_t fapl_id, void UNUSED *close_data) { hid_t driver_id; @@ -673,7 +673,7 @@ done: DESCRIPTION Encode non-standard (i.e. not 2, 4 or 8-byte) lengths in file meta-data. --------------------------------------------------------------------------*/ -void +void H5F_encode_length_unusual(const H5F_t *f, uint8_t **p, uint8_t *l) { int i = (int)H5F_SIZEOF_SIZE(f)-1; @@ -732,11 +732,11 @@ H5Fget_create_plist(hid_t file_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") if(NULL == (plist = H5I_object(file->shared->fcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - + /* Create the property list object to return */ if((ret_value=H5P_copy_plist(plist)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "unable to copy file creation properties") - + done: FUNC_LEAVE_API(ret_value) } @@ -763,7 +763,7 @@ done: * * Modifications: * Raymond Lu, Oct 23, 2001 - * Changed file access property list to the new generic + * Changed file access property list to the new generic * property list. * * Bill Wendling, Apr 21, 2003 @@ -772,12 +772,12 @@ done: * weren't being close. * * J Mainzer, Mar 10, 2005 - * Updated function for changes in the property list entries + * Updated function for changes in the property list entries * used by the new metadata cache. - * + * * Quincey Koziol, May 25, 2005 * Extracted guts into new internal routine. - * + * *------------------------------------------------------------------------- */ hid_t @@ -785,7 +785,7 @@ H5Fget_access_plist(hid_t file_id) { H5F_t *f = NULL; hid_t ret_value = SUCCEED; - + FUNC_ENTER_API(H5Fget_access_plist, FAIL) H5TRACE1("i","i",file_id); @@ -822,7 +822,7 @@ done: * Wednesday, May 25, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ hid_t @@ -830,9 +830,9 @@ H5F_get_access_plist(H5F_t *f) { H5P_genplist_t *new_plist; /* New property list */ H5P_genplist_t *old_plist; /* Old property list */ - void *driver_info=NULL; + void *driver_info=NULL; hid_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5F_get_access_plist, FAIL) /* Check args */ @@ -893,7 +893,7 @@ H5F_get_access_plist(H5F_t *f) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file close degree") } else if(f->shared->fc_degree != H5F_CLOSE_DEFAULT && H5P_set(new_plist, H5F_CLOSE_DEGREE_NAME, &(f->shared->fc_degree)) < 0) { HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file close degree") - } + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -903,11 +903,11 @@ done: /*------------------------------------------------------------------------- * Function: H5Fget_obj_count * - * Purpose: Public function returning the number of opened object IDs - * (files, datasets, groups and datatypes) in the same file. + * Purpose: Public function returning the number of opened object IDs + * (files, datasets, groups and datatypes) in the same file. * * Return: Non-negative on success; negative on failure. - * + * * Programmer: Raymond Lu * Wednesday, Dec 5, 2001 * @@ -1006,20 +1006,20 @@ done: * * Purpose: Private function to return a list of opened object IDs. * - * Return: Non-negative on success; negative on failure. - * - * Programmer: Raymond Lu - * Wednesday, Dec 5, 2001 - * - * Modification: - * + * Return: Non-negative on success; negative on failure. + * + * Programmer: Raymond Lu + * Wednesday, Dec 5, 2001 + * + * Modification: + * *------------------------------------------------------------------------- */ unsigned H5F_get_obj_ids(const H5F_t *f, unsigned types, int max_objs, hid_t *oid_list) { unsigned ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_get_obj_ids) ret_value = H5F_get_objects(f, types, max_objs, oid_list); @@ -1031,10 +1031,10 @@ H5F_get_obj_ids(const H5F_t *f, unsigned types, int max_objs, hid_t *oid_list) /*--------------------------------------------------------------------------- * Function: H5F_get_objects * - * Purpose: This function is called by H5F_get_obj_count or - * H5F_get_obj_ids to get number of object IDs and/or a + * Purpose: This function is called by H5F_get_obj_count or + * H5F_get_obj_ids to get number of object IDs and/or a * list of opened object IDs (in return value). - * Return: Non-negative on success; negative on failure. + * Return: Non-negative on success; negative on failure. * * Programmer: Raymond Lu * Wednesday, Dec 5, 2001 @@ -1075,28 +1075,28 @@ H5F_get_objects(const H5F_t *f, unsigned types, int max_index, hid_t *obj_id_lis (void)H5I_search(H5I_FILE, H5F_get_objects_cb, &olist); } /* end if */ - /* Search through dataset IDs to count number of datasets, and put their + /* Search through dataset IDs to count number of datasets, and put their * IDs on the object list */ if( (max_index < 0 || (int)olist.list_index < max_index) && (types & H5F_OBJ_DATASET) ) { olist.obj_type = H5I_DATASET; (void)H5I_search(H5I_DATASET, H5F_get_objects_cb, &olist); } - /* Search through group IDs to count number of groups, and put their + /* Search through group IDs to count number of groups, and put their * IDs on the object list */ if( (max_index < 0 || (int)olist.list_index < max_index) && (types & H5F_OBJ_GROUP) ) { olist.obj_type = H5I_GROUP; (void)H5I_search(H5I_GROUP, H5F_get_objects_cb, &olist); } - /* Search through datatype IDs to count number of named datatypes, and put their + /* Search through datatype IDs to count number of named datatypes, and put their * IDs on the object list */ if( (max_index < 0 || (int)olist.list_index < max_index) && (types & H5F_OBJ_DATATYPE) ) { olist.obj_type = H5I_DATATYPE; (void)H5I_search(H5I_DATATYPE, H5F_get_objects_cb, &olist); } - /* Search through attribute IDs to count number of attributes, and put their + /* Search through attribute IDs to count number of attributes, and put their * IDs on the object list */ if( (max_index < 0 || (int)olist.list_index < max_index) && (types & H5F_OBJ_ATTR) ) { olist.obj_type = H5I_ATTR; @@ -1111,9 +1111,9 @@ H5F_get_objects(const H5F_t *f, unsigned types, int max_index, hid_t *obj_id_lis /*------------------------------------------------------------------------- - * Function: H5F_get_objects_cb + * Function: H5F_get_objects_cb * - * Purpose: H5F_get_objects' callback function. It verifies if an + * Purpose: H5F_get_objects' callback function. It verifies if an * object is in the file, and either count it or put its ID * on the list. * @@ -1129,13 +1129,13 @@ H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) { H5F_olist_t *olist = (H5F_olist_t *)key; /* Alias for search info */ int ret_value = FALSE; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5F_get_objects_cb) assert(obj_ptr); assert(olist); - /* Count file IDs */ + /* Count file IDs */ if(olist->obj_type == H5I_FILE) { if((olist->file_info.local && (!olist->file_info.ptr.file || (olist->file_info.ptr.file && (H5F_t*)obj_ptr == olist->file_info.ptr.file) )) @@ -1179,12 +1179,12 @@ H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) } if((olist->file_info.local && - ( (!olist->file_info.ptr.file && olist->obj_type==H5I_DATATYPE && H5T_is_immutable((H5T_t*)obj_ptr)==FALSE) - || (!olist->file_info.ptr.file && olist->obj_type!=H5I_DATATYPE) + ( (!olist->file_info.ptr.file && olist->obj_type==H5I_DATATYPE && H5T_is_immutable((H5T_t*)obj_ptr)==FALSE) + || (!olist->file_info.ptr.file && olist->obj_type!=H5I_DATATYPE) || (ent && ent->file == olist->file_info.ptr.file) )) || (!olist->file_info.local && - ((!olist->file_info.ptr.shared && olist->obj_type==H5I_DATATYPE && H5T_is_immutable((H5T_t*)obj_ptr)==FALSE) - || (!olist->file_info.ptr.shared && olist->obj_type!=H5I_DATATYPE) + ((!olist->file_info.ptr.shared && olist->obj_type==H5I_DATATYPE && H5T_is_immutable((H5T_t*)obj_ptr)==FALSE) + || (!olist->file_info.ptr.shared && olist->obj_type!=H5I_DATATYPE) || (ent && ent->file && ent->file->shared == olist->file_info.ptr.shared) ))) { /* Add the object's ID to the ID list, if appropriate */ if(olist->obj_id_list) { @@ -1213,10 +1213,10 @@ done: * Purpose: Returns a pointer to the file handle of the low-level file * driver. * - * Return: Success: non-negative value. + * Return: Success: non-negative value. + * + * Failture: negative. * - * Failture: negative. - * * Programmer: Raymond Lu * Sep. 16, 2002 * @@ -1229,7 +1229,7 @@ H5Fget_vfd_handle(hid_t file_id, hid_t fapl, void **file_handle) { H5F_t *file=NULL; herr_t ret_value; - + FUNC_ENTER_API(H5Fget_vfd_handle, FAIL) H5TRACE3("e","iix",file_id,fapl,file_handle); @@ -1263,7 +1263,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, void**file_handle) +H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, void**file_handle) { herr_t ret_value; @@ -1419,11 +1419,11 @@ done: * Modifications: * * Raymond Lu, Oct 14, 2001 - * Changed the file creation and access property list to the + * Changed the file creation and access property list to the * new generic property list. * * J Mainzer, Mar 10, 2005 - * Updated for the new metadata cache, and associated + * Updated for the new metadata cache, and associated * property list changes. * *------------------------------------------------------------------------- @@ -1433,7 +1433,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id) { H5F_t *f=NULL, *ret_value; H5P_genplist_t *plist; /* Property list */ - + FUNC_ENTER_NOAPI_NOINIT(H5F_new) if (NULL==(f=H5FL_CALLOC(H5F_t))) @@ -1448,7 +1448,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id) f->shared->base_addr = HADDR_UNDEF; f->shared->freespace_addr = HADDR_UNDEF; f->shared->driver_addr = HADDR_UNDEF; - + /* * Copy the file creation and file access property lists into the * new file handle. We do this early because some values might need @@ -1493,7 +1493,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get data cache cache size") if(H5P_get(plist, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, &(f->shared->rdcc_w0)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get preempt read chunk") - + if(H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, &(f->shared->threshold))<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get alignment threshold") if(H5P_get(plist, H5F_ACS_ALIGN_NAME, &(f->shared->alignment)) < 0) @@ -1519,7 +1519,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id) if(H5F_sfile_add(f->shared) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to append to list of open files") } /* end else */ - + f->shared->nrefs++; /* Set return value */ @@ -1531,7 +1531,7 @@ done: H5FL_FREE(H5F_file_t,f->shared); H5FL_FREE(H5F_t,f); } - + FUNC_LEAVE_NOAPI(ret_value) } @@ -1574,7 +1574,7 @@ static herr_t H5F_dest(H5F_t *f, hid_t dxpl_id) { herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI_NOINIT(H5F_dest) /* Sanity check */ @@ -1628,7 +1628,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id) /* Destroy shared file struct */ f->shared = H5FL_FREE(H5F_file_t,f->shared); - + } else if (f->shared->nrefs>0) { /* * There are other references to the shared part of the file. @@ -1718,7 +1718,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id) * arguments would be the same. * * Raymond Lu, 2001-10-14 - * Changed the file creation and access property lists to the + * Changed the file creation and access property lists to the * new generic property list. * * Bill Wendling, 2003-03-18 @@ -1855,9 +1855,9 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d /* This step is for h5repart tool only. If user wants to change file driver from * family to sec2 while using h5repart, this private property should be set so that - * in the later step, the library can ignore the family driver information saved + * in the later step, the library can ignore the family driver information saved * in the superblock. - */ + */ if(H5P_exist_plist(a_plist, H5F_ACS_FAMILY_TO_SEC2_NAME) > 0) if(H5P_get(a_plist, H5F_ACS_FAMILY_TO_SEC2_NAME, &fam_sec2) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get property of changing family to sec2") @@ -1953,8 +1953,8 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock") } - /* The following barrier ensures that all set eoa operations - * associated with creating the superblock are complete before + /* The following barrier ensures that all set eoa operations + * associated with creating the superblock are complete before * we attempt any allocations. * JRM - 4/13/04 */ @@ -1981,10 +1981,10 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d if (H5F_read_superblock(file, dxpl_id, &root_ent, HADDR_UNDEF, NULL, (size_t)0) < 0) HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock") -#ifdef H5_HAVE_FPHDF5 +#ifdef H5_HAVE_FPHDF5 if (H5FD_is_fphdf5_driver(lf)) { - /* reading the superblock generates lots of set_eoa calls. To avoid - * race conditions with allocations, make sure that everyone is done + /* reading the superblock generates lots of set_eoa calls. To avoid + * race conditions with allocations, make sure that everyone is done * reading the superblock before we proceed. */ if ( (mrc = MPI_Barrier(H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS ) { @@ -2000,7 +2000,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d /* * Decide the file close degree. If it's the first time to open the - * file, set the degree to access property list value; if it's the + * file, set the degree to access property list value; if it's the * second time or later, verify the access property list value matches * the degree in shared file structure. */ @@ -2061,10 +2061,10 @@ done: * File struct creation and destruction is through H5F_new() and * H5F_dest(). Writing the root symbol table entry is done with * H5G_encode(). - * + * * Robb Matzke, 1997-08-29 * Moved creation of the boot block to H5F_flush(). - * + * * Robb Matzke, 1997-09-23 * Most of the work is now done by H5F_open() since H5Fcreate() * and H5Fopen() originally contained almost identical code. @@ -2078,9 +2078,9 @@ done: * Robb Matzke, 1999-08-02 * The file creation and file access property lists are passed * to the H5F_open() as object IDs. - * + * * Raymond Lu, 2001-10-14 - * Changed the file creation and access property list to the + * Changed the file creation and access property list to the * new generic property list. * *------------------------------------------------------------------------- @@ -2170,7 +2170,7 @@ done: * File struct creation and destruction is through H5F_new() and * H5F_dest(). Reading the root symbol table entry is done with * H5G_decode(). - * + * * Robb Matzke, 1997-09-23 * Most of the work is now done by H5F_open() since H5Fcreate() * and H5Fopen() originally contained almost identical code. @@ -2258,7 +2258,7 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) H5A_t *attr = NULL; H5G_entry_t *ent = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Fflush, FAIL) H5TRACE2("e","iFs",object_id,scope); @@ -2346,10 +2346,10 @@ done: * Robb Matzke, 1999-08-16 * The driver information block is encoded and either allocated * or written to disk. - * + * * Raymond Lu, 2001-10-14 * Changed to new generic property list. - * + * * Quincey Koziol, 2002-05-20 * Added 'closing' parameter * @@ -2360,14 +2360,14 @@ done: * Quincey Koziol, 2002-06-06 * Return the remainders of the metadata & "small data" blocks to * the free list of blocks for the file. - * + * * Bill Wendling, 2003-03-18 * Modified the flags being passed in to be one flag instead * of several. * * John Mainzer, 2005-01-07 * H5AC (and H5C) now have their own system of flags. Hence - * we must now translate between the H5F_FLUSH flags and the + * we must now translate between the H5F_FLUSH flags and the * H5AC flags. Added code to handle this detail. * *------------------------------------------------------------------------- @@ -2626,16 +2626,16 @@ H5F_try_close(H5F_t *f) * H5F_CLOSE_SEMI: if there are still objects open, return fail; * otherwise, close file. * H5F_CLOSE_STRONG: if there are still objects open, close them - * first, then close file. - */ + * first, then close file. + */ switch(f->shared->fc_degree) { case H5F_CLOSE_WEAK: /* - * If file or object IDS are still open then delay deletion of - * resources until they have all been closed. Flush all + * If file or object IDS are still open then delay deletion of + * resources until they have all been closed. Flush all * caches and update the object header anyway so that failing to * close all objects isn't a major problem. - */ + */ if ((nopen_files + nopen_objs) > 0) HGOTO_DONE(SUCCEED) break; @@ -2679,7 +2679,7 @@ H5F_try_close(H5F_t *f) /* Get the list of IDs of open dataset, group, named datatype & attribute objects */ while((obj_count = H5F_get_obj_ids(f, H5F_OBJ_LOCAL|H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_DATATYPE|H5F_OBJ_ATTR, (int)(sizeof(objs)/sizeof(objs[0])), objs)) != 0) { - + /* Try to close all the open objects in this file */ for(u = 0; u < obj_count; u++) if(H5I_dec_ref(objs[u]) < 0) @@ -2820,7 +2820,7 @@ H5Freopen(hid_t file_id) H5F_t *old_file=NULL; H5F_t *new_file=NULL; hid_t ret_value; - + FUNC_ENTER_API(H5Freopen, FAIL) H5TRACE1("i","i",file_id); @@ -3225,7 +3225,7 @@ hid_t H5F_get_id(H5F_t *file) { hid_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5F_get_id) assert(file); @@ -3239,7 +3239,7 @@ H5F_get_id(H5F_t *file) if (H5I_inc_ref(file->file_id)<0) HGOTO_ERROR (H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed") } - + ret_value = file->file_id; done: @@ -3263,7 +3263,7 @@ done: * *------------------------------------------------------------------------- */ -haddr_t +haddr_t H5F_get_base_addr(const H5F_t *f) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ @@ -3290,7 +3290,7 @@ H5F_get_base_addr(const H5F_t *f) * *------------------------------------------------------------------------- */ -haddr_t +haddr_t H5F_get_eoa(const H5F_t *f) { haddr_t ret_value; @@ -3334,7 +3334,7 @@ H5F_mpi_get_rank(const H5F_t *f) FUNC_ENTER_NOAPI(H5F_mpi_get_rank, FAIL) assert(f && f->shared); - + /* Dispatch to driver */ if ((ret_value=H5FD_mpi_get_rank(f->shared->lf))<0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "driver get_rank request failed") @@ -3368,7 +3368,7 @@ H5F_mpi_get_comm(const H5F_t *f) FUNC_ENTER_NOAPI(H5F_mpi_get_comm, MPI_COMM_NULL) assert(f && f->shared); - + /* Dispatch to driver */ if ((ret_value=H5FD_mpi_get_comm(f->shared->lf))==MPI_COMM_NULL) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, MPI_COMM_NULL, "driver get_comm request failed") @@ -3483,7 +3483,7 @@ H5F_get_fcpl(const H5F_t *f) * address for the file. * * Errors: - * IO READERROR Low-level read failed. + * IO READERROR Low-level read failed. * * Return: Non-negative on success/Negative on failure * @@ -3538,8 +3538,8 @@ done: * address. * * Errors: - * IO WRITEERROR Low-level write failed. - * IO WRITEERROR No write intent. + * IO WRITEERROR Low-level write failed. + * IO WRITEERROR No write intent. * * Return: Non-negative on success/Negative on failure * @@ -3722,7 +3722,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Fget_filesize * - * Purpose: Retrieves the file size of the HDF5 file. This function + * Purpose: Retrieves the file size of the HDF5 file. This function * is called after an existing file is opened in order * to learn the true size of the underlying file. * @@ -3769,7 +3769,7 @@ done: * from the metadata cache, and return it in *config_ptr. * * Note that the version field of *config_Ptr must be correctly - * filled in by the caller. This allows us to adapt for + * filled in by the caller. This allows us to adapt for * obsolete versions of the structure. * * Return: Success: SUCCEED @@ -3803,7 +3803,7 @@ H5Fget_mdc_config(hid_t file_id, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") } - if ( ( NULL == config_ptr ) || + if ( ( NULL == config_ptr ) || ( config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad config_ptr") @@ -3828,8 +3828,8 @@ done: /*------------------------------------------------------------------------- * Function: H5Fset_mdc_config * - * Purpose: Sets the current metadata cache automatic resize - * configuration, using the contents of the instance of + * Purpose: Sets the current metadata cache automatic resize + * configuration, using the contents of the instance of * H5AC_cache_config_t pointed to by config_ptr. * * Return: Success: SUCCEED @@ -3883,7 +3883,7 @@ done: * * Purpose: Retrieves the current hit rate from the metadata cache. * This rate is the overall hit rate since the last time - * the hit rate statistics were reset either manually or + * the hit rate statistics were reset either manually or * automatically. * * Return: Success: SUCCEED @@ -3900,7 +3900,7 @@ done: */ herr_t -H5Fget_mdc_hit_rate(hid_t file_id, +H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate_ptr) { H5F_t *file=NULL; /* File object for file ID */ @@ -3942,8 +3942,8 @@ done: * * Purpose: Retrieves the maximum size, minimum clean size, current * size, and current number of entries from the metadata - * cache associated with the specified file. If any of - * the ptr parameters are NULL, the associated datum is + * cache associated with the specified file. If any of + * the ptr parameters are NULL, the associated datum is * not returned. * * Return: Success: SUCCEED @@ -3960,7 +3960,7 @@ done: */ herr_t -H5Fget_mdc_size(hid_t file_id, +H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, size_t *cur_size_ptr, @@ -4009,7 +4009,7 @@ done: * Function: H5Freset_mdc_hit_rate_stats * * Purpose: Reset the hit rate statistic whose current value can - * be obtained via the H5Fget_mdc_hit_rate() call. Note + * be obtained via the H5Fget_mdc_hit_rate() call. Note * that this statistic will also be reset once per epoch * by the automatic cache resize code if it is enabled. * @@ -4054,7 +4054,7 @@ H5Freset_mdc_hit_rate_stats(hid_t file_id) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "H5AC_reset_cache_hit_rate_stats() failed."); } - + done: @@ -4073,8 +4073,8 @@ done: * just returning the number of characters required to store the name. * If an error occurs then the buffer pointed to by `name' (NULL or non-NULL) * is unchanged and the function returns a negative value. - * - * Return: Success: The length of the file name + * + * Return: Success: The length of the file name * Failure: Negative * * Programmer: Raymond Lu @@ -397,9 +397,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -460,7 +460,7 @@ hsize_t H5FD_sb_size(H5FD_t *file) { hsize_t ret_value=0; - + FUNC_ENTER_NOAPI(H5FD_sb_size, 0) assert(file && file->cls); @@ -505,7 +505,7 @@ H5FD_sb_encode(H5FD_t *file, char *name/*out*/, uint8_t *buf) if (file->cls->sb_encode && (file->cls->sb_encode)(file, name/*out*/, buf/*out*/)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver sb_encode request failed") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -567,7 +567,7 @@ H5FD_pl_copy(void *(*copy_func)(const void *), size_t pl_size, const void *old_p { void *new_pl = NULL; /* Copy of property list */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5FD_pl_copy) /* Copy old pl, if one exists */ @@ -661,7 +661,7 @@ void * H5FD_fapl_get(H5FD_t *file) { void *ret_value=NULL; - + FUNC_ENTER_NOAPI(H5FD_fapl_get, NULL) assert(file); @@ -695,7 +695,7 @@ H5FD_fapl_open(H5P_genplist_t *plist, hid_t driver_id, const void *driver_info) { void *copied_driver_info; /* Temporary VFL driver info */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_fapl_open, FAIL) /* Increment the reference count on driver and copy driver info */ @@ -737,7 +737,7 @@ H5FD_fapl_copy(hid_t driver_id, const void *old_fapl, void **copied_fapl) { H5FD_class_t *driver=NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_fapl_copy, FAIL) /* Check args */ @@ -780,7 +780,7 @@ H5FD_fapl_close(hid_t driver_id, void *fapl) if(driver_id>0) { if (NULL==(driver=H5I_object(driver_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a driver ID") - + /* Close the driver for the property list */ if(H5FD_pl_close(driver_id,driver->fapl_free,fapl)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver fapl_free request failed") @@ -812,7 +812,7 @@ H5FD_dxpl_open(H5P_genplist_t *plist, hid_t driver_id, const void *driver_info) { void *copied_driver_info; /* Temporary VFL driver info */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_dxpl_open, FAIL) /* Increment the reference count on the driver and copy the driver info */ @@ -820,7 +820,7 @@ H5FD_dxpl_open(H5P_genplist_t *plist, hid_t driver_id, const void *driver_info) HGOTO_ERROR (H5E_DATASET, H5E_CANTINC, FAIL, "can't increment VFL driver ID") if(H5FD_dxpl_copy(driver_id, driver_info, &copied_driver_info)<0) HGOTO_ERROR (H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy VFL driver") - + /* Set the driver information for the new property list */ if(H5P_set(plist, H5D_XFER_VFL_ID_NAME, &driver_id)<0) HGOTO_ERROR (H5E_PLIST, H5E_CANTSET, FAIL, "can't set VFL driver ID") @@ -854,7 +854,7 @@ H5FD_dxpl_copy(hid_t driver_id, const void *old_dxpl, void **copied_dxpl) { H5FD_class_t *driver=NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_dxpl_copy, FAIL) /* Check args */ @@ -897,7 +897,7 @@ H5FD_dxpl_close(hid_t driver_id, void *dxpl) if(driver_id>0) { if (NULL==(driver=H5I_object(driver_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a driver ID") - + /* Close the driver for the property list */ if(H5FD_pl_close(driver_id,driver->dxpl_free,dxpl)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver fapl_free request failed") @@ -999,9 +999,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -1012,17 +1012,17 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) H5FD_class_t *driver; H5FD_t *file=NULL; hid_t driver_id = -1; - hsize_t meta_block_size=0; - hsize_t sdata_block_size=0; + hsize_t meta_block_size=0; + hsize_t sdata_block_size=0; H5P_genplist_t *plist; /* Property list pointer */ H5FD_t *ret_value; - + FUNC_ENTER_NOAPI(H5FD_open, NULL) /* Get file access property list */ if(NULL == (plist = H5I_object(fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") - + if (0==maxaddr) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "zero format address range") @@ -1034,7 +1034,7 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "invalid driver ID in file access property list") if (NULL==driver->open) HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, NULL, "file driver has no `open' method") - + /* Dispatch to file driver */ if (HADDR_UNDEF==maxaddr) maxaddr = driver->maxaddr; @@ -1152,7 +1152,7 @@ H5FD_close(H5FD_t *file) { const H5FD_class_t *driver; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_close, FAIL) /* check args */ @@ -1278,10 +1278,10 @@ int H5FDcmp(const H5FD_t *f1, const H5FD_t *f2) { int ret_value; - + FUNC_ENTER_API(H5FDcmp, -1) /*return value is arbitrary*/ H5TRACE2("Is","xx",f1,f2); - + ret_value = H5FD_cmp(f1, f2); done: @@ -1362,10 +1362,10 @@ H5FDquery(const H5FD_t *f, unsigned long *flags/*out*/) FUNC_ENTER_API(H5FDquery, FAIL) H5TRACE2("Is","xx",f,flags); - + assert(f); assert(flags); - + ret_value = H5FD_query(f, flags); done: @@ -1398,7 +1398,7 @@ H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/) assert(f); assert(flags); - + /* Check for query driver and call it */ if (f->cls->query) ret_value = (f->cls->query)(f, flags); @@ -1455,7 +1455,7 @@ haddr_t H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { haddr_t ret_value = HADDR_UNDEF; - + FUNC_ENTER_API(H5FDalloc, HADDR_UNDEF) H5TRACE4("a","xMtih",file,type,dxpl_id,size); @@ -1535,9 +1535,9 @@ H5FD_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) if ( H5FD_is_fphdf5_driver(file) && !H5FD_fphdf5_is_sap(file) ) { haddr_t addr; - if ( (addr = H5FP_client_alloc(file, type, dxpl_id, size)) + if ( (addr = H5FP_client_alloc(file, type, dxpl_id, size)) == HADDR_UNDEF) { - HGOTO_ERROR(H5E_FPHDF5, H5E_CANTALLOC, HADDR_UNDEF, + HGOTO_ERROR(H5E_FPHDF5, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed.") } else { HGOTO_DONE(addr) @@ -1561,7 +1561,7 @@ H5FD_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) if ((ret_value = H5FD_alloc_from_free_list(file, type, mapped_type, size)) != HADDR_UNDEF) HGOTO_DONE(ret_value) - + #ifdef H5F_DEBUG if (H5DEBUG(F)) HDfprintf(H5DEBUG(F), "%s: Could not allocate from freelists\n", FUNC); @@ -1778,7 +1778,7 @@ H5FD_alloc_from_free_list(H5FD_t *file, H5FD_mem_t type, H5F_addr_overlap(ret_value, size, file->accum_loc, file->accum_size)) { ret_value = HADDR_UNDEF; } else { - /* Attempt to allocate memory for temporary node */ + /* Attempt to allocate memory for temporary node */ if((tmp = H5FL_MALLOC(H5FD_free_t))==NULL) HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "free block allocation failed") @@ -2060,7 +2060,7 @@ H5FD_real_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) assert(file->cls); assert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); assert(size > 0); - + /* * Dispatch to driver `alloc' callback or extend the end-of-address * marker @@ -2192,7 +2192,7 @@ H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t siz FUNC_ENTER_API(H5FDfree, FAIL) H5TRACE5("e","xMtiah",file,type,dxpl_id,addr,size); - + /* Check args */ if (!file || !file->cls) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") @@ -2238,7 +2238,7 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si { H5FD_mem_t mapped_type; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_free, FAIL) /* Check args */ @@ -2447,7 +2447,7 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si /* Check if we increased the size of the largest block on the list */ file->maxsize = MAX(file->maxsize, last->size); - /* Check if this free block is at the end of file allocated space. + /* Check if this free block is at the end of file allocated space. * Truncate it if this is true. */ if(file->cls->get_eoa) { haddr_t eoa; @@ -2463,7 +2463,7 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si file->maxsize=0; /*unknown*/ H5FL_FREE(H5FD_free_t, last); } - } + } } else if (file->cls->free) { if ((file->cls->free)(file, type, dxpl_id, addr, size)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver free request failed") @@ -2546,12 +2546,12 @@ H5FD_realloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t old_addr, hsi uint8_t _buf[8192]; uint8_t *buf=_buf; haddr_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_realloc, HADDR_UNDEF) if (new_size==old_size) { /*nothing to do*/ - + } else if (0==old_size) { /* allocate memory */ assert(!H5F_addr_defined(old_addr)); @@ -2563,7 +2563,7 @@ H5FD_realloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t old_addr, hsi if(H5FD_free(file, type, dxpl_id, old_addr, old_size)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "file deallocation request failed") new_addr = HADDR_UNDEF; - + } else if (new_size<old_size) { /* free the end of the block */ if(H5FD_free(file, type, dxpl_id, old_addr+old_size, old_size-new_size)<0) @@ -2590,7 +2590,7 @@ H5FD_realloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t old_addr, hsi H5MM_xfree(buf); HGOTO_ERROR(H5E_FILE, H5E_READERROR, HADDR_UNDEF, "unable to move file block") } - + if (buf!=_buf) H5MM_xfree(buf); if(H5FD_free(file, type, dxpl_id, old_addr, old_size)<0) @@ -2626,7 +2626,7 @@ H5FD_can_extend(const H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsize_t size, { haddr_t eoa; /* End of address space in the file */ htri_t ret_value=FALSE; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_can_extend, FAIL) /* Retrieve the end of the address space */ @@ -2718,7 +2718,7 @@ H5FD_extend(H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsize_t size, hsize_t e hbool_t at_end=FALSE; /* Block is at end of file */ H5FD_mem_t mapped_type; /* Memory type, after mapping */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_extend, FAIL) /* Retrieve the end of the address space */ @@ -2886,10 +2886,10 @@ haddr_t H5FD_get_eoa(const H5FD_t *file) { haddr_t ret_value; - + FUNC_ENTER_NOAPI(H5FD_get_eoa, HADDR_UNDEF) assert(file && file->cls); - + /* Dispatch to driver */ if (HADDR_UNDEF==(ret_value=(file->cls->get_eoa)(file))) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eoa request failed") @@ -2975,7 +2975,7 @@ H5FD_set_eoa(H5FD_t *file, haddr_t addr) assert(file && file->cls); assert(H5F_addr_defined(addr) && addr<=file->maxaddr); - + /* Dispatch to driver */ if ((file->cls->set_eoa)(file, addr)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver set_eoa request failed") @@ -3015,7 +3015,7 @@ haddr_t H5FDget_eof(H5FD_t *file) { haddr_t ret_value; - + FUNC_ENTER_API(H5FDget_eof, HADDR_UNDEF) H5TRACE1("a","x",file); @@ -3056,7 +3056,7 @@ H5FD_get_eof(const H5FD_t *file) FUNC_ENTER_NOAPI(H5FD_get_eof, HADDR_UNDEF) assert(file && file->cls); - + /* Dispatch to driver */ if (file->cls->get_eof) { if (HADDR_UNDEF==(ret_value=(file->cls->get_eof)(file))) @@ -3384,7 +3384,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); assert(buf); - + #ifndef H5_HAVE_PARALLEL /* Do not return early for Parallel mode since the I/O could be a */ /* collective transfer. */ @@ -3734,7 +3734,7 @@ done: /*-------------------------------------------------------------------------- * Function: H5FDget_vfd_handle * - * Purpose: Returns a pointer to the file handle of low-level virtual + * Purpose: Returns a pointer to the file handle of low-level virtual * file driver. * * Return: Non-negative if succeed; negative otherwise. @@ -3751,7 +3751,7 @@ herr_t H5FDget_vfd_handle(H5FD_t *file, hid_t fapl, void** file_handle) herr_t ret_value; FUNC_ENTER_API(H5FDget_vfd_handle, FAIL) - + /* Check arguments */ assert(file); assert(file_handle); @@ -3768,7 +3768,7 @@ done: * Purpose: Retrieve the file handle for file driver. * * Return: Non-negative if succeed; negative if fails. - * + * * Programmer: Raymond Lu * Sep. 16, 2002 * @@ -3779,7 +3779,7 @@ done: herr_t H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl, void** file_handle) { herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_get_vfd_handle, FAIL) assert(file_handle); @@ -3788,7 +3788,7 @@ herr_t H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl, void** file_handle) done: FUNC_LEAVE_NOAPI(ret_value) -} +} /*------------------------------------------------------------------------- diff --git a/src/H5FDcore.c b/src/H5FDcore.c index b72887c..492e06f 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -65,7 +65,7 @@ typedef struct H5FD_core_fapl_t { /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. - * + * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument * of the file seek function. @@ -137,7 +137,7 @@ NAME H5FD_core_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_core_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -221,7 +221,7 @@ H5FD_core_term(void) * Purpose: Modify the file access property list to use the H5FD_CORE * driver defined in this source file. The INCREMENT specifies * how much to grow the memory each time we need more. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -277,7 +277,7 @@ done: * Modifications: * Robb Matzke, 1999-10-19 * Added the BACKING_STORE argument. - * + * * Raymond Lu * 2001-10-25 * Changed file access list to the new generic property list. @@ -301,12 +301,12 @@ H5Pget_fapl_core(hid_t fapl_id, size_t *increment/*out*/, HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver") if (NULL==(fa=H5P_get_driver_info(plist))) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info") - + if (increment) *increment = fa->increment; if (backing_store) *backing_store = fa->backing_store; - + done: FUNC_LEAVE_API(ret_value) } @@ -381,7 +381,7 @@ H5FD_core_open(const char *name, unsigned UNUSED flags, hid_t fapl_id, H5FD_t *ret_value; FUNC_ENTER_NOAPI(H5FD_core_open, NULL) - + /* Check arguments */ if (!(H5F_ACC_CREAT & flags)) HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL, "must create core files, not open them") @@ -499,7 +499,7 @@ H5FD_core_cmp(const H5FD_t *_f1, const H5FD_t *_f2) HGOTO_DONE(1) HGOTO_DONE(0) } - + if (NULL==f1->name) HGOTO_DONE(-1) if (NULL==f2->name) @@ -536,7 +536,7 @@ H5FD_core_get_eoa(const H5FD_t *_file) haddr_t ret_value; /* Return value */ const H5FD_core_t *file = (const H5FD_core_t*)_file; - + FUNC_ENTER_NOAPI(H5FD_core_get_eoa, HADDR_UNDEF) /* Set return value */ @@ -622,25 +622,25 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_core_get_handle - * + * * Purpose: Returns the file handle of CORE file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * - * Modifications: - * + * + * Modifications: + * *------------------------------------------------------------------------- */ /* ARGSUSED */ static herr_t H5FD_core_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ +{ H5FD_core_t *file = (H5FD_core_t *)_file; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_core_get_handle, FAIL) if(!file_handle) @@ -648,9 +648,9 @@ H5FD_core_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) *file_handle = &(file->mem); -done: +done: FUNC_LEAVE_NOAPI(ret_value) -} +} /*------------------------------------------------------------------------- @@ -679,7 +679,7 @@ H5FD_core_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, hadd { H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_core_read, FAIL) assert(file && file->pub.cls); @@ -746,7 +746,7 @@ H5FD_core_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, had { H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_core_write, FAIL) assert(file && file->pub.cls); @@ -814,7 +814,7 @@ H5FD_core_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned UNUSED closing) { H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_core_flush, FAIL) /* Write to backing store */ diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index 73cb11c..832495f 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -30,7 +30,7 @@ * (actually, this happens when the file family is flushed, and * can be quite time consuming on file systems that don't * implement holes, like nfs). - * + * */ /* Interface initialization */ @@ -60,7 +60,7 @@ typedef struct H5FD_family_t { hid_t memb_fapl_id; /*file access property list for members */ hsize_t memb_size; /*actual size of each member file */ hsize_t pmem_size; /*member size passed in from property */ - hsize_t mem_newsize; /*new member size passed in as private property. + hsize_t mem_newsize; /*new member size passed in as private property. *It's used only by h5repart */ unsigned nmembs; /*number of family members */ unsigned amembs; /*number of member slots allocated */ @@ -90,7 +90,7 @@ static herr_t H5FD_family_dxpl_free(void *_dx); static hsize_t H5FD_family_sb_size(H5FD_t *_file); static herr_t H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/); -static herr_t H5FD_family_sb_decode(H5FD_t *_file, const char *name, +static herr_t H5FD_family_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf); static H5FD_t *H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); @@ -146,7 +146,7 @@ NAME H5FD_family_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_family_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -242,9 +242,9 @@ H5FD_family_term(void) * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -255,11 +255,11 @@ H5Pset_fapl_family(hid_t fapl_id, hsize_t msize, hid_t memb_fapl_id) herr_t ret_value; H5FD_family_fapl_t fa={0, -1}; H5P_genplist_t *plist; /* Property list pointer */ - + FUNC_ENTER_API(H5Pset_fapl_family, FAIL) H5TRACE3("e","ihi",fapl_id,msize,memb_fapl_id); - + /* Check arguments */ if(TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") @@ -300,9 +300,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -314,7 +314,7 @@ H5Pget_fapl_family(hid_t fapl_id, hsize_t *msize/*out*/, H5FD_family_fapl_t *fa; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Pget_fapl_family, FAIL) H5TRACE3("e","ixx",fapl_id,msize,memb_fapl_id); @@ -583,7 +583,7 @@ H5FD_family_sb_size(H5FD_t UNUSED *_file) FUNC_ENTER_NOAPI(H5FD_family_sb_size, UFAIL) - /* 8 bytes field for the size of member file size field should be + /* 8 bytes field for the size of member file size field should be * enough for now. */ ret_value += 8; @@ -630,7 +630,7 @@ H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, /* copy member file size */ msize = (uint64_t)file->memb_size; UINT64ENCODE(p, msize); - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -639,11 +639,11 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_family_sb_decode * - * Purpose: This function has 2 seperate purpose. One is to decodes the - * superblock information for this driver. The NAME argument is + * Purpose: This function has 2 seperate purpose. One is to decodes the + * superblock information for this driver. The NAME argument is * the eight-character (plus null termination) name stored in i - * the file. The FILE argument is updated according to the - * information in the superblock. + * the file. The FILE argument is updated according to the + * information in the superblock. * * Return: Success: 0 * @@ -663,14 +663,14 @@ H5FD_family_sb_decode(H5FD_t *_file, const char UNUSED *name, const unsigned cha uint64_t msize = 0; char err_msg[128]; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_family_sb_decode, FAIL) /* Read member file size. Skip name template for now although it's saved. */ UINT64DECODE(buf, msize); - - /* For h5repart only. Private property of new member size is used to signal - * h5repart is being used to change member file size. h5repart will open + + /* For h5repart only. Private property of new member size is used to signal + * h5repart is being used to change member file size. h5repart will open * files for read and write. When the files are closed, metadata will be * flushed to the files and updated this new size */ if(file->mem_newsize) { @@ -678,7 +678,7 @@ H5FD_family_sb_decode(H5FD_t *_file, const char UNUSED *name, const unsigned cha HGOTO_DONE(ret_value) } - /* Default - use the saved member size */ + /* Default - use the saved member size */ if(file->pmem_size == H5F_FAMILY_DEFAULT) { file->pmem_size = msize; } @@ -690,7 +690,7 @@ H5FD_family_sb_decode(H5FD_t *_file, const char UNUSED *name, const unsigned cha } /* Update member file size to the size saved in the superblock. - * That's the size intended to be. */ + * That's the size intended to be. */ file->memb_size = msize; done: @@ -716,17 +716,17 @@ done: * Raymond Lu * Thursday, November 18, 2004 * When file is re-opened, member size passed in from access property - * is checked to see if it's reasonable. If there is only 1 member - * file, member size can't be smaller than current member size. - * If there are at least 2 member files, member size can only be equal + * is checked to see if it's reasonable. If there is only 1 member + * file, member size can't be smaller than current member size. + * If there are at least 2 member files, member size can only be equal * the 1st member size. * * Raymond Lu * Tuesday, May 24, 2005 * The modification described above has been changed. The major checking - * is done in H5F_read_superblock. Member file size is saved in the + * is done in H5F_read_superblock. Member file size is saved in the * superblock now. H5F_read_superblock() reads this saved size and compare - * to the size passed in from file access property. Wrong size will + * to the size passed in from file access property. Wrong size will * result in a failure. * *------------------------------------------------------------------------- @@ -767,7 +767,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, if(NULL == (plist = H5I_object(fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") fa = H5P_get_driver_info(plist); - + /* New family file size. It's used by h5repart only. */ if(H5P_exist_plist(plist, H5F_ACS_FAMILY_NEWSIZE_NAME) > 0) if(H5P_get(plist, H5F_ACS_FAMILY_NEWSIZE_NAME, &fam_newsize) < 0) @@ -789,11 +789,11 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, } file->name = H5MM_strdup(name); file->flags = flags; - + /* Check that names are unique */ sprintf(memb_name, name, 0); sprintf(temp, name, 1); - + if (!strcmp(memb_name, temp)) HGOTO_ERROR(H5E_FILE, H5E_FILEEXISTS, NULL, "file names not unique") @@ -811,7 +811,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, file->amembs = n; file->memb = x; } - + /* * Attempt to open file. If the first file cannot be opened then fail; * otherwise an open failure means that we've reached the last member. @@ -830,7 +830,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, file->nmembs++; } - /* If the file is reopened and there's only one member file existing, this file maybe + /* If the file is reopened and there's only one member file existing, this file maybe * smaller than the size specified through H5Pset_fapl_family(). Update the actual * member size. */ @@ -949,7 +949,7 @@ H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2) assert(f1->nmembs>=1 && f1->memb[0]); assert(f2->nmembs>=1 && f2->memb[0]); - + ret_value= H5FDcmp(f1->memb[0], f2->memb[0]); done: @@ -986,7 +986,7 @@ H5FD_family_query(const H5FD_t UNUSED * _f, unsigned long *flags /* out */) if(flags) { *flags=0; *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ - /**flags|=H5FD_FEAT_ACCUMULATE_METADATA;*/ /* OK to accumulate metadata for faster writes. + /**flags|=H5FD_FEAT_ACCUMULATE_METADATA;*/ /* OK to accumulate metadata for faster writes. * - Turn it off temporarily because there's a bug * when trying to flush metadata during closing. */ *flags|=H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ @@ -1084,7 +1084,7 @@ H5FD_family_set_eoa(H5FD_t *_file, haddr_t eoa) if (NULL==file->memb[u]) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to open member file") } - + /* Set the EOA marker for the member */ H5_CHECK_OVERFLOW(file->memb_size,hsize_t,haddr_t); if (addr>(haddr_t)file->memb_size) { @@ -1163,27 +1163,27 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_family_get_handle - * + * * Purpose: Returns the file handle of FAMILY file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * + * * Modifications: - * + * *------------------------------------------------------------------------- - */ -static herr_t + */ +static herr_t H5FD_family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) -{ +{ H5FD_family_t *file = (H5FD_family_t *)_file; H5P_genplist_t *plist; hsize_t offset; int memb; herr_t ret_value; - + FUNC_ENTER_NOAPI(H5FD_family_get_handle, FAIL) /* Get the plist structure and family offset */ @@ -1259,7 +1259,7 @@ H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si sub = addr % file->memb_size; /* This check is for mainly for IA32 architecture whose size_t's size - * is 4 bytes, to prevent overflow when user application is trying to + * is 4 bytes, to prevent overflow when user application is trying to * write files bigger than 4GB. */ tempreq = file->memb_size-sub; if(tempreq > SIZET_MAX) @@ -1336,7 +1336,7 @@ H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s sub = addr % file->memb_size; /* This check is for mainly for IA32 architecture whose size_t's size - * is 4 bytes, to prevent overflow when user application is trying to + * is 4 bytes, to prevent overflow when user application is trying to * write files bigger than 4GB. */ tempreq = file->memb_size-sub; if(tempreq > SIZET_MAX) diff --git a/src/H5FDfphdf5.c b/src/H5FDfphdf5.c index de25c33..c600715 100644 --- a/src/H5FDfphdf5.c +++ b/src/H5FDfphdf5.c @@ -122,7 +122,7 @@ NAME H5FD_fphdf5_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_fphdf5_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -231,7 +231,7 @@ H5Pset_fapl_fphdf5(hid_t fapl_id, MPI_Comm comm, MPI_Comm barrier_comm, H5P_genplist_t *plist; int mrc, comm_size; herr_t ret_value; - + FUNC_ENTER_API(H5Pset_fapl_fphdf5, FAIL) H5TRACE5("e","iMcMcMiIu",fapl_id,comm,barrier_comm,info,sap_rank); @@ -284,7 +284,7 @@ H5Pget_fapl_fphdf5(hid_t fapl_id, MPI_Comm *comm, MPI_Comm *barrier_comm, H5FD_fphdf5_fapl_t *fa; H5P_genplist_t *plist; herr_t ret_value = SUCCEED; - + FUNC_ENTER_API(H5Pget_fapl_fphdf5, FAIL) H5TRACE6("e","i*Mc*Mc*Mi*Iu*Iu",fapl_id,comm,barrier_comm,info,sap_rank, capt_rank); @@ -332,7 +332,7 @@ unsigned H5FD_fphdf5_file_id(H5FD_t *_file) { H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file; - unsigned ret_value; + unsigned ret_value; FUNC_ENTER_NOAPI(H5FD_fphdf5_file_id, 0) @@ -464,7 +464,7 @@ H5Pset_dxpl_fphdf5(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode) FUNC_ENTER_API(H5Pset_dxpl_fphdf5, FAIL) H5TRACE2("e","iDt",dxpl_id,xfer_mode); - + if (dxpl_id == H5P_DEFAULT) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list") @@ -950,17 +950,17 @@ done: * Modifications: *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FD_fphdf5_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ +{ H5FD_fphdf5_t *file = (H5FD_fphdf5_t *)_file; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_fphdf5_get_handle, FAIL) /* check args */ assert(file); - + if (!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -1496,7 +1496,7 @@ static int H5FD_fphdf5_mpi_size(const H5FD_t *_file) { const H5FD_fphdf5_t *file = (const H5FD_fphdf5_t*)_file; - int ret_value; + int ret_value; FUNC_ENTER_NOAPI(H5FD_fphdf5_mpi_size, FAIL) diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 75c3c20..5725f87 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -150,7 +150,7 @@ typedef struct H5FD_log_t { /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. - * + * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument * of the file seek function. @@ -242,7 +242,7 @@ NAME H5FD_log_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_log_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -326,7 +326,7 @@ H5FD_log_term(void) * Purpose: Modify the file access property list to use the H5FD_LOG * driver defined in this source file. There are no driver * specific properties. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -337,7 +337,7 @@ H5FD_log_term(void) * * Raymond Lu, 2001-10-25 * Changed the file access list to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -349,10 +349,10 @@ H5Pset_fapl_log(hid_t fapl_id, const char *logfile, unsigned flags, size_t buf_s FUNC_ENTER_API(H5Pset_fapl_log, FAIL) H5TRACE4("e","isIuz",fapl_id,logfile,flags,buf_size); - + if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - + fa.logfile=(char*)logfile; fa.flags=flags; fa.buf_size=buf_size; @@ -420,7 +420,7 @@ H5FD_log_fapl_copy(const void *_old_fa) const H5FD_log_fapl_t *old_fa = (const H5FD_log_fapl_t*)_old_fa; H5FD_log_fapl_t *new_fa = H5MM_malloc(sizeof(H5FD_log_fapl_t)); void *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_log_fapl_copy, NULL) assert(new_fa); @@ -976,36 +976,36 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_log_get_handle - * + * * Purpose: Returns the file handle of LOG file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * - * Modifications: - * + * + * Modifications: + * *------------------------------------------------------------------------- */ /* ARGSUSED */ static herr_t H5FD_log_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ +{ H5FD_log_t *file = (H5FD_log_t *)_file; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_log_get_handle, FAIL) if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") *file_handle = &(file->fd); - -done: + +done: FUNC_LEAVE_NOAPI(ret_value) -} - +} + /*------------------------------------------------------------------------- * Function: H5FD_log_read @@ -1034,7 +1034,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr H5FD_log_t *file = (H5FD_log_t*)_file; ssize_t nbytes; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_log_read, FAIL) assert(file && file->pub.cls); @@ -1111,7 +1111,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr addr += (haddr_t)nbytes; buf = (char*)buf + nbytes; } - + /* Update current position */ file->pos = addr; file->op = OP_READ; @@ -1153,7 +1153,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add struct timeval timeval_diff; #endif /* H5_HAVE_GETTIMEOFDAY */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_log_write, FAIL) assert(file && file->pub.cls); @@ -1165,13 +1165,13 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add assert(type==H5FD_MEM_DEFAULT || type==(H5FD_mem_t)file->flavor[(addr+size)-1] || (H5FD_mem_t)file->flavor[(addr+size)-1]==H5FD_MEM_DEFAULT); /* Check for overflow conditions */ - if (HADDR_UNDEF==addr) + if (HADDR_UNDEF==addr) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined") if (REGION_OVERFLOW(addr, size)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") if (addr+size>file->eoa) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") - + /* Log the I/O information about the write */ if(file->fa.flags&H5FD_LOG_FILE_WRITE) { size_t tmp_size=size; @@ -1212,7 +1212,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add } /* end if */ HDfprintf(file->logfp," (%f s)\n",(double)timeval_diff.tv_sec+((double)timeval_diff.tv_usec/(double)1000000.0)); } /* end if */ - else + else HDfprintf(file->logfp,"\n"); #else /* H5_HAVE_GETTIMEOFDAY */ HDfprintf(file->logfp,"Seek: From %10a To %10a\n",file->pos,addr); @@ -1252,7 +1252,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add if(file->fa.flags&H5FD_LOG_TIME_WRITE) HDgettimeofday(&timeval_stop,NULL); #endif /* H5_HAVE_GETTIMEOFDAY */ - + /* Log information about the write */ if(file->fa.flags&H5FD_LOG_LOC_WRITE) { /* Output the flavor information, if desired */ diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index 671eccb..2c1e526 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -62,7 +62,7 @@ H5FD_mpi_get_rank(const H5FD_t *file) assert(file && cls); assert(cls->get_rank); /* All MPI drivers must implement this */ - + /* Dispatch to driver */ if ((ret_value=(cls->get_rank)(file))<0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "driver get_rank request failed") @@ -98,7 +98,7 @@ H5FD_mpi_get_size(const H5FD_t *file) assert(file && cls); assert(cls->get_size); /* All MPI drivers must implement this */ - + /* Dispatch to driver */ if ((ret_value=(cls->get_size)(file))<0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "driver get_size request failed") @@ -134,7 +134,7 @@ H5FD_mpi_get_comm(const H5FD_t *file) assert(file && cls); assert(cls->get_comm); /* All MPI drivers must implement this */ - + /* Dispatch to driver */ if ((ret_value=(cls->get_comm)(file))==MPI_COMM_NULL) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, MPI_COMM_NULL, "driver get_comm request failed") @@ -151,7 +151,7 @@ done: * * Return: Success: The haddr_t equivalent of the MPI_OFF * argument. - * + * * Failure: HADDR_UNDEF * * Programmer: Unknown @@ -164,7 +164,7 @@ done: * * Robb Matzke, 1999-08-06 * Modified to work with the virtual file layer. - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- */ haddr_t H5FD_mpi_MPIOff_to_haddr(MPI_Offset mpi_off) @@ -255,7 +255,7 @@ H5FD_mpi_comm_info_dup(MPI_Comm comm, MPI_Info info, MPI_Comm *comm_new, MPI_Inf MPI_Comm comm_dup=MPI_COMM_NULL; MPI_Info info_dup=MPI_INFO_NULL; int mpi_code; - + FUNC_ENTER_NOAPI(H5FD_mpi_comm_info_dup, FAIL) /* Check arguments */ @@ -297,7 +297,7 @@ done: * * Purpose: Free the communicator and Info object. * If comm or info is in fact MPI_COMM_NULL or MPI_INFO_NULL - * respectively, no action occurs to it. + * respectively, no action occurs to it. * * Return: Success: Non-negative. The values the pointers refer * to will be set to the corresponding NULL @@ -381,7 +381,7 @@ H5FD_mpio_wait_for_left_neighbor(H5FD_t *_file) file->mpi_rank-1, MPI_ANY_TAG, file->comm, &rcvstat ))) HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mpi_code) } - + done: FUNC_LEAVE_NOAPI(ret_value) } diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 920d1e2..f285f1a 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -155,7 +155,7 @@ NAME H5FD_mpio_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_mpio_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -217,7 +217,7 @@ H5FD_mpio_init(void) H5FD_mpio_Debug_inited++; } #endif /* H5FDmpio_DEBUG */ - + /* Set return value */ ret_value=H5FD_MPIO_g; @@ -300,7 +300,7 @@ H5FD_mpio_term(void) * Modified to work with the virtual file layer. * * Raymond Lu, 2001-10-23 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * * Albert Cheng, 2003-04-17 @@ -317,7 +317,7 @@ H5Pset_fapl_mpio(hid_t fapl_id, MPI_Comm comm, MPI_Info info) H5FD_mpio_fapl_t fa; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - + FUNC_ENTER_API(H5Pset_fapl_mpio, FAIL) H5TRACE3("e","iMcMi",fapl_id,comm,info); @@ -372,7 +372,7 @@ done: * read/write calls. * * Raymond Lu, 2001-10-23 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * * Albert Cheng, 2003-04-17 @@ -388,7 +388,7 @@ H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm/*out*/, MPI_Info *info/*out*/) MPI_Comm comm_tmp=MPI_COMM_NULL; int mpi_code; /* mpi return code */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Pget_fapl_mpio, FAIL) H5TRACE3("e","ixx",fapl_id,comm,info); @@ -407,7 +407,7 @@ H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm/*out*/, MPI_Info *info/*out*/) if (MPI_SUCCESS != (mpi_code=MPI_Comm_dup(fa->comm, &comm_tmp))) HMPI_GOTO_ERROR(FAIL, "MPI_Comm_dup failed", mpi_code) } - + if (info){ if (MPI_INFO_NULL != fa->info){ if (MPI_SUCCESS != (mpi_code=MPI_Info_dup(fa->info, info))) @@ -444,7 +444,7 @@ done: * * H5FD_MPIO_COLLECTIVE: * Use collective I/O access. - * + * * Return: Success: Non-negative * * Failure: Negative @@ -465,7 +465,7 @@ H5Pset_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode) FUNC_ENTER_API(H5Pset_dxpl_mpio, FAIL) H5TRACE2("e","iDt",dxpl_id,xfer_mode); - + if(dxpl_id==H5P_DEFAULT) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list") @@ -601,7 +601,7 @@ H5FD_mpio_fapl_copy(const void *_old_fa) void *ret_value = NULL; const H5FD_mpio_fapl_t *old_fa = (const H5FD_mpio_fapl_t*)_old_fa; H5FD_mpio_fapl_t *new_fa = NULL; - + FUNC_ENTER_NOAPI(H5FD_mpio_fapl_copy, NULL) #ifdef H5FDmpio_DEBUG if (H5FD_mpio_Debug[(int)'t']) @@ -692,7 +692,7 @@ fprintf(stderr, "leaving H5FD_mpio_fapl_free\n"); * * Failure: NULL * - * Programmer: + * Programmer: * January 30, 1998 * * Modifications: @@ -710,7 +710,7 @@ fprintf(stderr, "leaving H5FD_mpio_fapl_free\n"); * Added barrier after MPI_File_set_size to prevent race * condition -- subsequent writes were being truncated, causing * holes in file. - * + * * Robb Matzke, 1999-08-06 * Modified to work with the virtual file layer. * @@ -1087,26 +1087,26 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_mpio_get_handle - * + * * Purpose: Returns the file handle of MPIO file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * + * * Modifications: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FD_mpio_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ +{ H5FD_mpio_t *file = (H5FD_mpio_t *)_file; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_mpio_get_handle, FAIL) - + if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -1115,7 +1115,7 @@ H5FD_mpio_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) done: FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5FD_mpio_read @@ -1159,7 +1159,7 @@ done: * * Robb Matzke, 1999-07-28 * The ADDR argument is passed by value. - * + * * Robb Matzke, 1999-08-06 * Modified to work with the virtual file layer. * @@ -1240,7 +1240,7 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add if(NULL == (plist = H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") xfer_mode=(H5FD_mpio_xfer_t)H5P_peek_unsigned(plist, H5D_XFER_IO_XFER_MODE_NAME); - + /* * Set up for a fancy xfer using complex types, or single byte block. We * wouldn't need to rely on the use_view field if MPI semantics allowed @@ -1412,7 +1412,7 @@ done: * * Kim Yates, Pat Weidhaas, 2000-09-26 * Move block of coding where only p0 writes after the - * MPI_File_set_view call. + * MPI_File_set_view call. * * Quincey Koziol, 2002-05-10 * Instead of always writing metadata from process 0, spread the @@ -1498,7 +1498,7 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, /* Obtain the data transfer properties */ if(NULL == (plist = H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - + if(type==H5FD_MEM_DRAW) { H5FD_mpio_xfer_t xfer_mode; /* I/O tranfer mode */ @@ -1614,7 +1614,7 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, /* Forget the EOF value (see H5FD_mpio_get_eof()) --rpm 1999-08-06 */ file->eof = HADDR_UNDEF; - + done: /* if only one process writes, need to broadcast the ret_value to other processes */ if (type!=H5FD_MEM_DRAW) { @@ -1655,7 +1655,7 @@ done: * allocated byte. * * Quincey Koziol, 2002-06-?? - * Changed file extension method to use MPI_File_set_size instead + * Changed file extension method to use MPI_File_set_size instead * read->write method. * *------------------------------------------------------------------------- diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c index b6bfa80..16c4de6 100644 --- a/src/H5FDmpiposix.c +++ b/src/H5FDmpiposix.c @@ -150,7 +150,7 @@ typedef struct H5FD_mpiposix_t { /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. - * + * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument * of the file seek function. @@ -243,7 +243,7 @@ NAME H5FD_mpiposix_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_mpiposix_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -361,7 +361,7 @@ H5Pset_fapl_mpiposix(hid_t fapl_id, MPI_Comm comm, hbool_t use_gpfs) H5FD_mpiposix_fapl_t fa; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - + FUNC_ENTER_API(H5Pset_fapl_mpiposix, FAIL) H5TRACE3("e","iMcb",fapl_id,comm,use_gpfs); @@ -392,7 +392,7 @@ done: * of the application to free the returned communicator. * * Return: Success: Non-negative with the communicator and - * information returned through the COMM + * information returned through the COMM * argument if non-null. Since it is a duplicate * of the stored object, future modifications to * the access property list do not affect it and @@ -420,7 +420,7 @@ H5Pget_fapl_mpiposix(hid_t fapl_id, MPI_Comm *comm/*out*/, hbool_t *use_gpfs/*ou H5P_genplist_t *plist; /* Property list pointer */ int mpi_code; /* mpi return code */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Pget_fapl_mpiposix, FAIL) H5TRACE3("e","ixx",fapl_id,comm,use_gpfs); @@ -485,7 +485,7 @@ H5FD_mpiposix_fapl_get(H5FD_t *_file) /* Duplicate the communicator. */ if (MPI_SUCCESS != (mpi_code=MPI_Comm_dup(file->comm, &fa->comm))) HMPI_GOTO_ERROR(NULL, "MPI_Comm_dup failed", mpi_code) - + fa->use_gpfs = file->use_gpfs; /* Set return value */ @@ -519,7 +519,7 @@ H5FD_mpiposix_fapl_copy(const void *_old_fa) const H5FD_mpiposix_fapl_t *old_fa = (const H5FD_mpiposix_fapl_t*)_old_fa; H5FD_mpiposix_fapl_t *new_fa = NULL; int mpi_code; /* MPI return code */ - + FUNC_ENTER_NOAPI(H5FD_mpiposix_fapl_copy, NULL) if (NULL==(new_fa=H5MM_malloc(sizeof(H5FD_mpiposix_fapl_t)))) @@ -621,7 +621,7 @@ H5FD_mpiposix_open(const char *name, unsigned flags, hid_t fapl_id, #ifdef WIN32 HFILE filehandle; struct _BY_HANDLE_FILE_INFORMATION fileinfo; - int results; + int results; #endif H5FD_t *ret_value=NULL; /* Return value */ MPI_Comm comm_dup=MPI_COMM_NULL; @@ -734,7 +734,7 @@ H5FD_mpiposix_open(const char *name, unsigned flags, hid_t fapl_id, hint.fr.structType = GPFS_FREE_RANGE; hint.fr.start = 0; hint.fr.length = 0; - + if (gpfs_fcntl(fd, &hint)<0) HGOTO_ERROR(H5E_FILE, H5E_FCNTL, NULL, "failed to send hints to GPFS") } @@ -1048,26 +1048,26 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_mpiposix_get_handle - * + * * Purpose: Returns the file handle of MPI-POSIX file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * + * * Modifications: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FD_mpiposix_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ +{ H5FD_mpiposix_t *file = (H5FD_mpiposix_t *)_file; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_mpiposix_get_handle, FAIL) - + if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -1157,7 +1157,7 @@ H5FD_mpiposix_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, addr += (haddr_t)nbytes; buf = (char*)buf + nbytes; } - + /* Update current position */ file->pos = addr; file->op = OP_READ; @@ -1217,13 +1217,13 @@ H5FD_mpiposix_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, assert(buf); /* Check for overflow conditions */ - if (HADDR_UNDEF==addr) + if (HADDR_UNDEF==addr) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined") if (REGION_OVERFLOW(addr, size)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") if (addr+size>file->eoa) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") - + /* Obtain the data transfer properties */ if(NULL == (plist = H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") @@ -1288,7 +1288,7 @@ H5FD_mpiposix_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, } #endif /* H5_HAVE_GPFS */ } - + /* Seek to the correct location */ if ((addr!=file->pos || OP_WRITE!=file->op) && file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0) diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 155ec68..71b5c91 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -78,10 +78,10 @@ #define ALL_MEMBERS(LOOPVAR) { \ H5FD_mem_t LOOPVAR; \ for (LOOPVAR=H5FD_MEM_DEFAULT; LOOPVAR<H5FD_MEM_NTYPES; LOOPVAR=(H5FD_mem_t)(LOOPVAR+1)) { - + #define END_MEMBERS }} - + /* The driver identification number, initialized at runtime */ static hid_t H5FD_MULTI_g = 0; @@ -382,7 +382,7 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, * `o' (H5FD_MEM_OHDR). * * memb_addr: The value HADDR_UNDEF for each element. - * + * * * Example: To set up a multi file access property list which partitions * data into meta and raw files each being 1/2 of the address @@ -411,7 +411,7 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, * hid_t fapl = H5Pcreate(H5P_FILE_ACCESS); * H5Pset_fapl_multi(fapl, memb_map, memb_fapl, * memb_name, memb_addr, TRUE); - * + * * * Return: Success: Non-negative * @@ -441,15 +441,15 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, haddr_t _memb_addr[H5FD_MEM_NTYPES]; static const char *letters = "Xsbrglo"; static const char *func="H5FDset_fapl_multi"; /* Function Name for error reporting */ - + /*NO TRACE*/ - + /* Clear the error stack */ H5Eclear_stack(H5E_DEFAULT); /* Check arguments and supply default values */ if(H5I_GENPROP_LST != H5Iget_type(fapl_id) || - TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) + TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "not an access list", -1) if (!memb_map) { for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) @@ -474,7 +474,7 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, _memb_addr[mt] = (mt?mt-1:0) * HADDR_MAX/H5FD_MEM_NTYPES; memb_addr = _memb_addr; } - + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { /* Map usage type */ mmt = memb_map[mt]; @@ -493,7 +493,7 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, if (!memb_name[mmt] || !memb_name[mmt][0]) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type not set", -1) } - + /* * Initialize driver specific information. No need to copy it into the FA * struct since all members will be copied by H5Pset_driver(). @@ -542,14 +542,14 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/, H5FD_multi_fapl_t *fa; H5FD_mem_t mt; static const char *func="H5FDget_fapl_multi"; /* Function Name for error reporting */ - + /*NO TRACE*/ /* Clear the error stack */ H5Eclear_stack(H5E_DEFAULT); if(H5I_GENPROP_LST != H5Iget_type(fapl_id) || - TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) + TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not an access list", -1) if (H5FD_MULTI!=H5Pget_driver(fapl_id)) H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "incorrect VFL driver", -1) @@ -579,7 +579,7 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/, memcpy(memb_addr, fa->memb_addr, H5FD_MEM_NTYPES*sizeof(haddr_t)); if (relax) *relax = fa->relax; - + return 0; } @@ -867,7 +867,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) memb_eoa[mt] = HADDR_UNDEF; memb_name[mt] = NULL; } END_MEMBERS; - + /* * Read the map and count the unique members. */ @@ -925,7 +925,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) ALL_MEMBERS(mt) { file->fa.memb_map[mt] = map[mt]; } END_MEMBERS; - + /* Close files which are unused now */ memset(in_use, 0, sizeof in_use); UNIQUE_MEMBERS(map, mt) { @@ -1026,7 +1026,7 @@ H5FD_multi_fapl_copy(const void *_old_fa) H5FD_multi_fapl_t *new_fa = malloc(sizeof(H5FD_multi_fapl_t)); int nerrors = 0; static const char *func="H5FD_multi_fapl_copy"; /* Function Name for error reporting */ - + assert(new_fa); /* Clear the error stack */ @@ -1118,7 +1118,7 @@ H5FD_multi_dxpl_copy(const void *_old_dx) H5FD_multi_dxpl_t *new_dx = malloc(sizeof(H5FD_multi_dxpl_t)); int nerrors = 0; static const char *func="H5FD_multi_dxpl_copy"; /* Function Name for error reporting */ - + assert(new_dx); /* Clear the error stack */ @@ -1206,7 +1206,7 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id, H5FD_multi_fapl_t *fa; H5FD_mem_t m; static const char *func="H5FD_multi_open"; /* Function Name for error reporting */ - + /* Clear the error stack */ H5Eclear_stack(H5E_DEFAULT); @@ -1500,7 +1500,7 @@ H5FD_multi_set_eoa(H5FD_t *_file, haddr_t eoa) if (status<0) H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "member H5FDset_eoa failed", -1) } - + /* Save new eoa for return later */ file->eoa = eoa; @@ -1545,7 +1545,7 @@ H5FD_multi_get_eof(const H5FD_t *_file) if (HADDR_UNDEF==tmp) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof", HADDR_UNDEF) if (tmp>0) tmp += file->fa.memb_addr[mt]; - + } else if (file->fa.relax) { /* * The member is not open yet (maybe it doesn't exist). Make the @@ -1553,27 +1553,27 @@ H5FD_multi_get_eof(const H5FD_t *_file) */ tmp = file->memb_next[mt]; assert(HADDR_UNDEF!=tmp); - + } else { H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF) } if (tmp>eof) eof = tmp; } END_MEMBERS; - + return MAX(file->eoa, eof); } /*------------------------------------------------------------------------- * Function: H5FD_multi_get_handle - * + * * Purpose: Returns the file handle of MULTI file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * - * Programmer: Raymond Lu - * Sept. 16, 2002 + * + * Programmer: Raymond Lu + * Sept. 16, 2002 * * Modifications: * @@ -1581,7 +1581,7 @@ H5FD_multi_get_eof(const H5FD_t *_file) */ static herr_t H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) -{ +{ H5FD_multi_t *file = (H5FD_multi_t *)_file; H5FD_mem_t type, mmt; static const char *func="H5FD_multi_get_handle"; /* Function Name for error reporting */ @@ -1593,7 +1593,7 @@ H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "data type is out of range", -1) mmt = file->fa.memb_map[type]; if(H5FD_MEM_DEFAULT==mmt) mmt = type; - + return (H5FDget_vfd_handle(file->memb[mmt], fapl, file_handle)); } @@ -1624,7 +1624,7 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) mmt = file->fa.memb_map[type]; if (H5FD_MEM_DEFAULT==mmt) mmt = type; - + if (HADDR_UNDEF==(addr=H5FDalloc(file->memb[mmt], type, dxpl_id, size))) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file can't alloc", HADDR_UNDEF) addr += file->fa.memb_addr[mmt]; @@ -1660,7 +1660,7 @@ H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsi mmt = file->fa.memb_map[type]; if (H5FD_MEM_DEFAULT==mmt) mmt = type; - + assert(addr>=file->fa.memb_addr[mmt]); assert(addr+size<=file->memb_next[mmt]); return H5FDfree(file->memb[mmt], type, dxpl_id, addr-file->fa.memb_addr[mmt], size); @@ -1702,7 +1702,7 @@ H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz if (H5P_FILE_ACCESS_DEFAULT!=dxpl_id && H5FD_MULTI==H5Pget_driver(dxpl_id)) { dx = H5Pget_driver_info(dxpl_id); } - + /* Find the file to which this address belongs */ for (mt=H5FD_MEM_SUPER; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { mmt = file->fa.memb_map[mt]; @@ -1757,7 +1757,7 @@ H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si if (H5P_FILE_ACCESS_DEFAULT!=dxpl_id && H5FD_MULTI==H5Pget_driver(dxpl_id)) { dx = H5Pget_driver_info(dxpl_id); } - + /* Find the file to which this address belongs */ for (mt=H5FD_MEM_SUPER; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { mmt = file->fa.memb_map[mt]; @@ -1804,7 +1804,7 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) #if 0 H5FD_mem_t mmt; - + /* Debugging stuff... */ fprintf(stderr, "multifile access information:\n"); @@ -1821,7 +1821,7 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) fprintf(stderr, " File Starting Allocated Next Member\n"); fprintf(stderr, " Number Address Size Address Name\n"); fprintf(stderr, " ------ -------------------- -------------------- -------------------- ------------------------------\n"); - + for (mt=1; mt<H5FD_MEM_NTYPES; mt++) { if (HADDR_UNDEF!=file->memb_addr[mt]) { haddr_t eoa = H5FDget_eoa(file->memb[mt]); @@ -1847,7 +1847,7 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) } if (nerrors) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error flushing member files", -1) - + return 0; } @@ -1878,7 +1878,7 @@ compute_next(H5FD_multi_t *file) ALL_MEMBERS(mt) { file->memb_next[mt] = HADDR_UNDEF; } END_MEMBERS; - + UNIQUE_MEMBERS(file->fa.memb_map, mt1) { UNIQUE_MEMBERS(file->fa.memb_map, mt2) { if (file->fa.memb_addr[mt1]<file->fa.memb_addr[mt2] && @@ -1891,7 +1891,7 @@ compute_next(H5FD_multi_t *file) file->memb_next[mt1] = HADDR_MAX; /*last member*/ } } END_MEMBERS; - + return 0; } @@ -1918,7 +1918,7 @@ open_members(H5FD_multi_t *file) char tmp[1024]; int nerrors=0; static const char *func="(H5FD_multi)open_members"; /* Function Name for error reporting */ - + /* Clear the error stack */ H5Eclear_stack(H5E_DEFAULT); diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index 94e215b..285404a 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -115,7 +115,7 @@ typedef enum H5FD_mem_t { * the library will attempt to cache metadata as it is written to the file * and build up a larger block of metadata to eventually pass to the VFL * 'write' routine. - * + * * Distinguish between updating the metadata accumulator on writes and * reads. This is particularly (perhaps only, even) important for MPI-I/O * where we guarantee that writes are collective, but reads may not be. @@ -139,7 +139,7 @@ typedef enum H5FD_mem_t { * and then sub-allocate "small" raw data requests from that larger block. */ #define H5FD_FEAT_AGGREGATE_SMALLDATA 0x00000010 - + /* Forward declaration */ typedef struct H5FD_t H5FD_t; diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 41c9e62..f45deb1 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -119,7 +119,7 @@ typedef struct H5FD_sec2_t { /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. - * + * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument * of the file seek function. @@ -196,7 +196,7 @@ NAME H5FD_sec2_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_sec2_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -280,7 +280,7 @@ H5FD_sec2_term(void) * Purpose: Modify the file access property list to use the H5FD_SEC2 * driver defined in this source file. There are no driver * specific properties. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -298,7 +298,7 @@ H5Pset_fapl_sec2(hid_t fapl_id) FUNC_ENTER_API(H5Pset_fapl_sec2, FAIL) H5TRACE1("e","i",fapl_id); - + if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") @@ -632,27 +632,27 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_sec2_get_handle - * + * * Purpose: Returns the file handle of sec2 file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * + * * Modifications: * *------------------------------------------------------------------------- */ /* ARGSUSED */ -static herr_t +static herr_t H5FD_sec2_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ +{ H5FD_sec2_t *file = (H5FD_sec2_t *)_file; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_sec2_get_handle, FAIL) - + if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") *file_handle = &(file->fd); @@ -689,7 +689,7 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, hadd H5FD_sec2_t *file = (H5FD_sec2_t*)_file; ssize_t nbytes; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_sec2_read, FAIL) assert(file && file->pub.cls); @@ -731,7 +731,7 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, hadd addr += (haddr_t)nbytes; buf = (char*)buf + nbytes; } - + /* Update current position */ file->pos = addr; file->op = OP_READ; @@ -773,20 +773,20 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, had H5FD_sec2_t *file = (H5FD_sec2_t*)_file; ssize_t nbytes; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_sec2_write, FAIL) assert(file && file->pub.cls); assert(buf); /* Check for overflow conditions */ - if (HADDR_UNDEF==addr) + if (HADDR_UNDEF==addr) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined") if (REGION_OVERFLOW(addr, size)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") if (addr+size>file->eoa) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") - + /* Seek to the correct location */ if ((addr!=file->pos || OP_WRITE!=file->op) && file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0) @@ -810,7 +810,7 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, had addr += (haddr_t)nbytes; buf = (const char*)buf + nbytes; } - + /* Update current position and eof */ file->pos = addr; file->op = OP_WRITE; diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 99aae42..fc7dd1c 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -115,7 +115,7 @@ typedef struct H5FD_stdio_t { /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. - * + * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument * of the file seek function. @@ -254,7 +254,7 @@ H5FD_stdio_term(void) * Purpose: Modify the file access property list to use the H5FD_STDIO * driver defined in this source file. There are no driver * specific properties. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -277,7 +277,7 @@ H5Pset_fapl_stdio(hid_t fapl_id) if(0 == H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1) - + return H5Pset_driver(fapl_id, H5FD_STDIO, NULL); } @@ -291,10 +291,10 @@ H5Pset_fapl_stdio(hid_t fapl_id) * * Errors: * IO CANTOPENFILE File doesn't exist and CREAT wasn't - * specified. - * IO CANTOPENFILE Fopen failed. + * specified. + * IO CANTOPENFILE Fopen failed. * IO FILEEXISTS File exists but CREAT and EXCL were - * specified. + * specified. * * Return: Success: A pointer to a new file data structure. The * public fields will be initialized by the @@ -402,7 +402,7 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, * Purpose: Closes a file. * * Errors: - * IO CLOSEERROR Fclose failed. + * IO CLOSEERROR Fclose failed. * * Return: Non-negative on success/Negative on failure * @@ -622,34 +622,34 @@ H5FD_stdio_get_eof(const H5FD_t *_file) /*------------------------------------------------------------------------- * Function: H5FD_stdio_get_handle - * + * * Purpose: Returns the file handle of stdio file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * + * * Modifications: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FD_stdio_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) -{ +{ H5FD_stdio_t *file = (H5FD_stdio_t *)_file; static const char *func="H5FD_stdio_get_handle"; /* Function Name for error reporting */ /* Shut compiler up */ fapl=fapl; - + /* Clear the error stack */ H5Eclear_stack(H5E_DEFAULT); *file_handle = &(file->fp); if(*file_handle==NULL) H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "get handle failed", -1) - return(0); + return(0); } @@ -661,8 +661,8 @@ H5FD_stdio_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) * physical end of file returns zeros instead of failing. * * Errors: - * IO READERROR Fread failed. - * IO SEEKERROR Fseek failed. + * IO READERROR Fread failed. + * IO SEEKERROR Fseek failed. * * Return: Non-negative on success/Negative on failure * @@ -693,7 +693,7 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz H5Eclear_stack(H5E_DEFAULT); /* Check for overflow */ - if (HADDR_UNDEF==addr) + if (HADDR_UNDEF==addr) H5Epush_ret (func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) if (REGION_OVERFLOW(addr, size)) H5Epush_ret (func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) @@ -729,7 +729,7 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz memset((unsigned char *)buf + size - nbytes, 0, nbytes); size -= nbytes; } - + /* * Read the data. Since we're reading single-byte values, a partial read * will advance the file position by N. If N is zero or an error @@ -743,7 +743,7 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz } else if (n < size) { memset((unsigned char *)buf + n, 0, (size - n)); } - + /* * Update the file position data. */ @@ -760,8 +760,8 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz * file address ADDR. * * Errors: - * IO SEEKERROR Fseek failed. - * IO WRITEERROR Fwrite failed. + * IO SEEKERROR Fseek failed. + * IO WRITEERROR Fwrite failed. * * Return: Non-negative on success/Negative on failure * @@ -797,7 +797,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, H5Epush_ret (func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) if (addr+size>file->eoa) H5Epush_ret (func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) - + /* * Seek to the correct file position. */ @@ -810,7 +810,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, } file->pos = addr; } - + /* * Write the buffer. On successful return, the file position will be * advanced by the number of bytes read. Otherwise nobody knows where it @@ -821,7 +821,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, file->pos = HADDR_UNDEF; H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fwrite failed", -1) } - + /* * Update seek optimizing data. */ @@ -842,8 +842,8 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, * Purpose: Makes sure that all data is on disk. * * Errors: - * IO SEEKERROR fseek failed. - * IO WRITEERROR fflush or fwrite failed. + * IO SEEKERROR fseek failed. + * IO WRITEERROR fflush or fwrite failed. * * Return: Non-negative on success/Negative on failure * diff --git a/src/H5FDstream.c b/src/H5FDstream.c index d23db5b..a798539 100644 --- a/src/H5FDstream.c +++ b/src/H5FDstream.c @@ -1,7 +1,7 @@ /* * Copyright © 2000 The author. * The author prefers this code not be used for military purposes. - * + * * * Author: Thomas Radke <tradke@aei-potsdam.mpg.de> * Tuesday, September 12, 2000 @@ -126,7 +126,7 @@ static const H5FD_stream_fapl_t default_fapl = /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. - * + * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument * of the file seek function. @@ -207,7 +207,7 @@ NAME H5FD_stream_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_stream_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -300,7 +300,7 @@ H5FD_stream_term(void) * If a valid socket argument is given this will be used * by the driver instead of parsing the 'hostname:port' filename * and opening a socket internally. - * + * * Return: Success: Non-negative * Failure: Negative * @@ -426,7 +426,7 @@ H5FD_stream_open_socket (const char *filename, int o_flags, H5FD_STREAM_SOCKET_TYPE sock=H5FD_STREAM_INVALID_SOCKET; char *hostname=NULL; unsigned short int first_port; - const char *separator, *tmp; + const char *separator, *tmp; int on = 1; H5FD_STREAM_SOCKET_TYPE ret_value=H5FD_STREAM_INVALID_SOCKET; @@ -446,7 +446,7 @@ H5FD_stream_open_socket (const char *filename, int o_flags, HGOTO_ERROR(H5E_ARGS,H5E_BADVALUE,H5FD_STREAM_INVALID_SOCKET,"invalid port number") } } - + hostname = (char *) H5MM_malloc ((size_t)(separator - filename + 1)); /* Return if out of memory */ @@ -986,7 +986,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FD_stream_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) { H5FD_stream_t *file = (H5FD_stream_t *)_file; diff --git a/src/H5FDstream.h b/src/H5FDstream.h index 450726b..e59d092 100644 --- a/src/H5FDstream.h +++ b/src/H5FDstream.h @@ -18,7 +18,7 @@ #ifdef H5_HAVE_STREAM # define H5FD_STREAM (H5FD_stream_init()) -#else +#else # define H5FD_STREAM (-1) #endif /*H5_HAVE_STREAM */ @@ -118,7 +118,7 @@ NAME H5FL_init_interface -- Initialize interface-specific information USAGE herr_t H5FL_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -151,7 +151,7 @@ H5FL_init_interface(void) * Tuesday, August 1, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static void * @@ -190,7 +190,7 @@ done: * Friday, March 24, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -236,7 +236,7 @@ done: * Friday, March 24, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -302,7 +302,7 @@ done: * Friday, March 24, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -362,7 +362,7 @@ done: * Monday, December 23, 2002 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -399,7 +399,7 @@ done: * Tuesday, July 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -408,7 +408,7 @@ H5FL_reg_gc_list(H5FL_reg_head_t *head) H5FL_reg_node_t *free_list; /* Pointer to nodes in free list being garbage collected */ void *tmp; /* Temporary node pointer */ size_t total_mem; /* Total memory used on list */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_reg_gc_list) /* Calculate the total memory used on this list */ @@ -458,7 +458,7 @@ H5FL_reg_gc_list(H5FL_reg_head_t *head) * Modifications: * Broke into two parts, one for looping over all the free lists and * another for freeing each list - QAK 7/25/00 - * + * *------------------------------------------------------------------------- */ static herr_t @@ -466,7 +466,7 @@ H5FL_reg_gc(void) { H5FL_reg_gc_node_t *gc_node; /* Pointer into the list of things to garbage collect */ herr_t ret_value=SUCCEED; /* return value*/ - + FUNC_ENTER_NOAPI_NOINIT(H5FL_reg_gc) /* Walk through all the free lists, free()'ing the nodes */ @@ -618,7 +618,7 @@ H5FL_blk_find_list(H5FL_blk_node_t **head, size_t size) temp=temp->next; } /* end while */ } /* end if */ - + FUNC_LEAVE_NOAPI(temp) } /* end H5FL_blk_find_list() */ @@ -651,7 +651,7 @@ H5FL_blk_create_list(H5FL_blk_node_t **head, size_t size) /* Allocate room for the new free list node */ if(NULL==(temp=H5FL_MALLOC(H5FL_blk_node_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for chunk info") - + /* Set the correct values for the new free list */ temp->size=size; temp->list=NULL; @@ -688,7 +688,7 @@ done: * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -814,7 +814,7 @@ H5FL_blk_malloc(H5FL_blk_head_t *head, size_t size) } /* end if */ /* No free list available, or there are no nodes on the list, allocate a new node to give to the user */ - else { + else { /* Allocate new node, with room for the page info header and the actual page data */ if(NULL==(temp=H5FL_malloc(sizeof(H5FL_blk_list_t)+size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for chunk") @@ -1034,7 +1034,7 @@ H5FL_blk_unlink(H5FL_blk_head_t *pq) herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5FL_blk_unlink) - + /* Find the node to remove from the global list */ last=NULL; tmp=H5FL_blk_gc_head.first; @@ -1079,7 +1079,7 @@ done: * Thursday, March 23, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1088,7 +1088,7 @@ H5FL_blk_gc_list(H5FL_blk_head_t *head) H5FL_blk_list_t *list; /* The free list of native nodes of a particular size */ void *next; /* Temp. ptr to the free list list node */ void *temp; /* Temp. ptr to the free list page node */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_blk_gc_list) /* Loop through all the nodes in the block free list queue */ @@ -1143,7 +1143,7 @@ H5FL_blk_gc_list(H5FL_blk_head_t *head) * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1151,7 +1151,7 @@ H5FL_blk_gc(void) { H5FL_blk_gc_node_t *gc_node; /* Pointer into the list of things to garbage collect */ herr_t ret_value=SUCCEED; /* return value*/ - + FUNC_ENTER_NOAPI_NOINIT(H5FL_blk_gc) /* Walk through all the free lists, free()'ing the nodes */ @@ -1199,7 +1199,7 @@ H5FL_blk_term(void) H5FL_blk_gc_node_t *tmp; /* Temporary pointer to a garbage collection node */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_blk_term) - + /* Free the nodes on the garbage collection list, keeping nodes with allocations outstanding */ left=NULL; while(H5FL_blk_gc_head.first!=NULL) { @@ -1229,7 +1229,7 @@ printf("H5FL_blk_term: head->name=%s, head->allocated=%d\n", H5FL_blk_gc_head.fi /* Point to the list of nodes left with allocations open, if any */ H5FL_blk_gc_head.first=left; - + FUNC_LEAVE_NOAPI(H5FL_blk_gc_head.first!=NULL ? 1 : 0) } /* end H5FL_blk_term() */ @@ -1247,7 +1247,7 @@ printf("H5FL_blk_term: head->name=%s, head->allocated=%d\n", H5FL_blk_gc_head.fi * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1277,7 +1277,7 @@ H5FL_arr_init(H5FL_arr_head_t *head) /* Initialize the size of each array */ for(u = 0; u<(size_t)head->maxelem; u++) head->list_arr[u].size = head->base_size + (head->elem_size * u); - + /* Indicate that the free list is initialized */ head->init=1; @@ -1298,7 +1298,7 @@ done: * Friday, March 24, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1374,7 +1374,7 @@ done: * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1449,7 +1449,7 @@ done: * Monday, December 23, 2002 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1487,7 +1487,7 @@ done: * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1548,7 +1548,7 @@ done: * Tuesday, July 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1558,7 +1558,7 @@ H5FL_arr_gc_list(H5FL_arr_head_t *head) void *tmp; /* Temporary node pointer */ unsigned u; /* Counter for array of free lists */ size_t total_mem; /* Total memory used on list */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_arr_gc_list) /* Walk through the array of free lists */ @@ -1610,7 +1610,7 @@ H5FL_arr_gc_list(H5FL_arr_head_t *head) * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1618,7 +1618,7 @@ H5FL_arr_gc(void) { H5FL_gc_arr_node_t *gc_arr_node; /* Pointer into the list of things to garbage collect */ herr_t ret_value=SUCCEED; /* return value*/ - + FUNC_ENTER_NOAPI_NOINIT(H5FL_arr_gc) /* Walk through all the free lists, free()'ing the nodes */ @@ -1664,7 +1664,7 @@ H5FL_arr_term(void) { H5FL_gc_arr_node_t *left; /* pointer to garbage collection lists with work left */ H5FL_gc_arr_node_t *tmp; /* Temporary pointer to a garbage collection node */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_arr_term) /* Free the nodes on the garbage collection list, keeping nodes with allocations outstanding */ @@ -1698,7 +1698,7 @@ printf("H5FL_arr_term: head->name=%s, head->allocated=%d\n", H5FL_arr_gc_head.fi /* Point to the list of nodes left with allocations open, if any */ H5FL_arr_gc_head.first=left; - + FUNC_LEAVE_NOAPI(H5FL_arr_gc_head.first!=NULL ? 1 : 0) } /* end H5FL_arr_term() */ @@ -1715,7 +1715,7 @@ printf("H5FL_arr_term: head->name=%s, head->allocated=%d\n", H5FL_arr_gc_head.fi * Saturday, April 3, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1749,7 +1749,7 @@ H5FL_seq_free(H5FL_seq_head_t *head, void *obj) * Saturday, April 3, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1783,7 +1783,7 @@ done: * Saturday, April 3, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1817,7 +1817,7 @@ done: * Saturday, April 3, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1851,7 +1851,7 @@ done: * Wednesday, February 2, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ H5FL_fac_head_t * @@ -1868,7 +1868,7 @@ H5FL_fac_init(size_t size) /* Allocate room for the new factory */ if(NULL==(factory=H5FL_MALLOC(H5FL_fac_head_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for factory object") - + /* Initialize block header information */ HDmemset(&(factory->queue),0,sizeof(H5FL_blk_head_t)); @@ -1895,7 +1895,7 @@ done: * Wednesday, February 2, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1929,7 +1929,7 @@ H5FL_fac_free(H5FL_fac_head_t *head, void *obj) * Wednesday, February 2, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1962,7 +1962,7 @@ done: * Wednesday, February 2, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1995,7 +1995,7 @@ done: * Wednesday, February 2, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ herr_t @@ -2039,7 +2039,7 @@ done: * Friday, March 24, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ herr_t @@ -2095,7 +2095,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +herr_t H5FL_set_free_list_limits(int reg_global_lim, int reg_list_lim, int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim) { @@ -2145,7 +2145,7 @@ int H5FL_term_interface(void) { int ret_value=0; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_term_interface) /* Garbage collect any nodes on the free lists */ diff --git a/src/H5FLprivate.h b/src/H5FLprivate.h index 4c8fa94..b7b2030 100644 --- a/src/H5FLprivate.h +++ b/src/H5FLprivate.h @@ -134,7 +134,7 @@ typedef struct H5FL_blk_head_t { } H5FL_blk_head_t; /* - * Macros for defining & using priority queues + * Macros for defining & using priority queues */ #define H5FL_BLK_NAME(t) H5_##t##_blk_free_list #ifndef H5_NO_BLK_FREE_LISTS @@ -335,7 +335,7 @@ done: /* * Function: H5FP_commit_sap_datatypes - * Purpose: Commit the H5FP_request, H5FP_reply, H5FP_read, + * Purpose: Commit the H5FP_request, H5FP_reply, H5FP_read, * H5FP_alloc, H5FP_eoa and H5FP_super structure datatypes * to MPI. * Return: Success: SUCCEED diff --git a/src/H5FPclient.c b/src/H5FPclient.c index a01bfaf..274324a 100644 --- a/src/H5FPclient.c +++ b/src/H5FPclient.c @@ -327,7 +327,7 @@ H5FP_request_read_metadata(H5FD_t *file, unsigned file_id, hid_t dxpl_id, HDmemset(&mpi_status, 0, sizeof(mpi_status)); /* the following code is a bit odd and doubtless needs a bit - * of explanation. I certainly stumbled over it the first + * of explanation. I certainly stumbled over it the first * time I read it. * * For reasons unknown, read requests sent to the SAP only @@ -345,7 +345,7 @@ H5FP_request_read_metadata(H5FD_t *file, unsigned file_id, hid_t dxpl_id, * * JRM - 4/13/04 */ - if (size < sap_read.md_size) + if (size < sap_read.md_size) { char *mdata; @@ -361,7 +361,7 @@ HDfprintf(stderr, "Metadata Read Failed!!!!\n"); H5FP_SAP_COMM, &mpi_status)) != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mrc); } else { - HDfprintf(stdout, + HDfprintf(stdout, "H5FP_request_read_metadata: size = %d > md_size = %d.\n", (int)size, (int)(sap_read.md_size)); HDfprintf(stdout, "Mssg received from SAP is too small!!!!\n"); @@ -569,7 +569,7 @@ H5FP_request_flush_metadata(H5FD_t *file, unsigned file_id, hid_t dxpl_id, if ((mrc = MPI_Recv(&sap_reply, 1, H5FP_reply, (int)H5FP_sap_rank, H5FP_TAG_REPLY, H5FP_SAP_COMM, &mpi_status)) != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mrc); - + if (sap_reply.status != H5FP_STATUS_OK) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCHANGE, FAIL, "can't write metadata to server"); @@ -649,15 +649,15 @@ done: /* * Function: H5FP_client_alloc * Purpose: Handle the client side of an allocation in the FP case. - * In essence, this is simply a matter of referring the + * In essence, this is simply a matter of referring the * request to the SAP, and then returning the reply. * * A modified version of this code used to live in H5FD_alloc(), * but I move it here to encapsulate it and generally tidy up. - * - * One can argue that we should all be done in an alloc - * routine in H5FDfdhdf5.c, but this invlves a smaller - * change to the code, and thus a smaller loss if I missed + * + * One can argue that we should all be done in an alloc + * routine in H5FDfdhdf5.c, but this invlves a smaller + * change to the code, and thus a smaller loss if I missed * a major gotcha. If things go well, and we don't heave * the current implementation of FP, I'll probably go that * route eventually. @@ -707,14 +707,14 @@ H5FP_client_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) if ( !capt_only || H5FD_fphdf5_is_captain(file) ) { /* Send the request to the SAP */ if ( H5FP_request_allocate(file, type, size, &fp_alloc.addr, - &fp_alloc.eoa, &req_id, &status) + &fp_alloc.eoa, &req_id, &status) != SUCCEED ) { HGOTO_ERROR(H5E_FPHDF5, H5E_CANTALLOC, HADDR_UNDEF, "server couldn't allocate from file") } } - /* It should be impossible for this assertion to fail, but then + /* It should be impossible for this assertion to fail, but then * that is what assertions are for. */ HDassert(status == H5FP_STATUS_OK); @@ -730,7 +730,7 @@ H5FP_client_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) } /* we used to send the eoa to the sap here, but that is silly, - * as the sap already knows, and it is possible that another + * as the sap already knows, and it is possible that another * interleaving allocation will result in a corrupted eoa. * * JRM - 4/7/04 @@ -745,7 +745,7 @@ done: } /* H5FP_client_alloc() */ -/* This function is now called only by H5FP_client_alloc() above. +/* This function is now called only by H5FP_client_alloc() above. * Should we make it a private function only accessible from this * file? JRM - 4/8/04 */ @@ -964,8 +964,8 @@ H5FP_request_set_eoa(H5FD_t *file, haddr_t eoa, unsigned *req_id, H5FP_status_t req.proc_rank = H5FD_mpi_get_rank(file); req.addr = eoa; -#if 0 - /* This is useful debugging code -- lets keep for a while. +#if 0 + /* This is useful debugging code -- lets keep for a while. * JRM -- 4/13/04 */ /* dump stack each time we set the eoa */ @@ -974,7 +974,7 @@ H5FP_request_set_eoa(H5FD_t *file, haddr_t eoa, unsigned *req_id, H5FP_status_t MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); - HDfprintf(stdout, + HDfprintf(stdout, "%d: %s: setting eoa: last eoa = %a, new eoa = %a.\n", mpi_rank, "H5FP_request_set_eoa", last_eoa_received, eoa); H5FS_print(stdout); @@ -1051,7 +1051,7 @@ H5FP_request_update_eoma_eosda(H5FD_t *file, unsigned *req_id, H5FP_status_t *st H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed!", mrc); -#if 0 +#if 0 /* The following set_eoa just parrots back to the SAP the eoa * we just received from it. While I don't think it is a problem * in this case, there are obvious potentials for race conditions, @@ -1096,7 +1096,7 @@ H5FP_gen_request_id() /* * Function: H5FP_dump_to_file - * Purpose: Dump the updated metadata to the file. + * Purpose: Dump the updated metadata to the file. * Return: Success: SUCCEED * Failure: FAIL * Programmer: Bill Wendling, 03. February 2003 diff --git a/src/H5FPprivate.h b/src/H5FPprivate.h index e309982..da34a6c 100644 --- a/src/H5FPprivate.h +++ b/src/H5FPprivate.h @@ -317,14 +317,14 @@ extern herr_t H5FP_request_flush_metadata(H5FD_t *file, unsigned file_id, extern herr_t H5FP_request_close(H5FD_t *file, unsigned sap_file_id, unsigned *req_id, H5FP_status_t *status); -/* the following function should probably become a private function +/* the following function should probably become a private function * in H5FPclient.c if H5FP_client_alloc() does the job. -- JRM */ extern herr_t H5FP_request_allocate(H5FD_t *file, H5FD_mem_t mem_type, hsize_t size, haddr_t *addr, haddr_t *eoa, unsigned *req_id, H5FP_status_t *status); -extern haddr_t H5FP_client_alloc(H5FD_t *file, H5FD_mem_t type, +extern haddr_t H5FP_client_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); extern herr_t H5FP_request_free(H5FD_t *file, H5FD_mem_t mem_type, haddr_t addr, hsize_t size, diff --git a/src/H5FPserver.c b/src/H5FPserver.c index 9eee898..d7bd97a 100644 --- a/src/H5FPserver.c +++ b/src/H5FPserver.c @@ -184,7 +184,7 @@ H5FP_sap_receive_loop(void) herr_t ret_value = SUCCEED; int comm_size; int stop = 0; - H5FP_request_t req; + H5FP_request_t req; FUNC_ENTER_NOAPI(H5FP_sap_receive_loop, FAIL) @@ -318,7 +318,7 @@ H5FP_new_object_lock(hobj_ref_t oid, unsigned rank, H5FP_obj_t obj_type, { int comm_size; H5FP_object_lock *ret_value = NULL; - + FUNC_ENTER_NOAPI_NOINIT(H5FP_new_object_lock) if (MPI_Comm_size(H5FP_SAP_COMM, &comm_size) != MPI_SUCCESS) @@ -547,7 +547,7 @@ H5FP_merge_mod_node_with_next(H5SL_t *slist, H5SL_node_t *node_ptr) unsigned offset; unsigned i,j; - /* The next node address range is not completely subsumed in + /* The next node address range is not completely subsumed in * that of the current node. Must allocate a new buffer, and * copy over the contents of the two buffers. Where the buffers * overlap, give precidence to the data from *node_ptr @@ -565,7 +565,7 @@ H5FP_merge_mod_node_with_next(H5SL_t *slist, H5SL_node_t *node_ptr) combined_metadata_ptr[i++] = (mod_ptr->metadata)[j]; offset = (mod_ptr->addr + mod_ptr->md_size) - next_mod_ptr->addr; - + for ( j = offset; j < next_mod_ptr->md_size; j++ ) combined_metadata_ptr[i++] = (next_mod_ptr->metadata)[j]; @@ -583,7 +583,7 @@ H5FP_merge_mod_node_with_next(H5SL_t *slist, H5SL_node_t *node_ptr) H5SL_remove(slist, &next_mod_ptr->addr); H5FP_free_mod_node(next_mod_ptr); - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5FP_merge_mod_node_with_next() */ @@ -631,7 +631,7 @@ H5FP_merge_mod_node_with_prev(H5SL_t *slist, H5SL_node_t *node_ptr) char *combined_metadata_ptr; unsigned limit; - /* The node address range is not completely subsumed in + /* The node address range is not completely subsumed in * that of the previous node. Must allocate a new buffer, and * copy over the contents of the two buffers. Where the buffers * overlap, give precidence to the data from *node_ptr @@ -661,7 +661,7 @@ H5FP_merge_mod_node_with_prev(H5SL_t *slist, H5SL_node_t *node_ptr) prev_mod_ptr->md_size = combined_md_size; } else { /* supplied node is completely inside previous node */ /* no need to allocate a new buffer. Just copy data from - * mod_ptr->metadata to the appropriate locations in + * mod_ptr->metadata to the appropriate locations in * prev_mod_ptr->metadata. */ @@ -673,15 +673,15 @@ H5FP_merge_mod_node_with_prev(H5SL_t *slist, H5SL_node_t *node_ptr) HDassert(i <= prev_mod_ptr->md_size); } /* end else */ - /* We have copied metadata from the current node into the previous - * node. All that remains is to delete the current node from the + /* We have copied metadata from the current node into the previous + * node. All that remains is to delete the current node from the * tree and free it. */ H5SL_remove(slist, &mod_ptr->addr); H5FP_free_mod_node(mod_ptr); - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5FP_merge_mod_node_with_prev() */ @@ -689,9 +689,9 @@ done: /* * Function: H5FP_mod_node_overlaps_with_next * - * Purpose: Given a node in a mod tree, see if there is an overlap - * between the address range of the supplied node, and that - * of the next node in the tree (if any). + * Purpose: Given a node in a mod tree, see if there is an overlap + * between the address range of the supplied node, and that + * of the next node in the tree (if any). * * Return: TRUE if there is an overlap, and FALSE if there * isn't. @@ -715,7 +715,7 @@ H5FP_mod_node_overlaps_with_next(H5SL_node_t *node_ptr) next_node_ptr = H5SL_next(node_ptr); if ( next_node_ptr != NULL ) { -#if 0 +#if 0 if ( ( ((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr > 100000 ) || ( (((H5FP_mdata_mod *)H5SL_item(node_ptr))->md_size) > 1024 ) ) { HDfprintf(stdout, "%s: addr = %a, size = %u, mem_type = %d.\n", @@ -726,7 +726,7 @@ H5FP_mod_node_overlaps_with_next(H5SL_node_t *node_ptr) } if ( (((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) - >= + >= (((H5FP_mdata_mod *)H5SL_item(next_node_ptr))->addr) ) { HDfprintf(stdout, "%s: addr,len = %a,%u, next_addr,len = %a,%u.\n", @@ -736,7 +736,7 @@ H5FP_mod_node_overlaps_with_next(H5SL_node_t *node_ptr) (((H5FP_mdata_mod *)H5SL_item(next_node_ptr))->addr), ((H5FP_mdata_mod *)H5SL_item(next_node_ptr))->md_size); - HDassert((((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) + HDassert((((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) < (((H5FP_mdata_mod *)H5SL_item(next_node_ptr))->addr) ); @@ -745,15 +745,15 @@ H5FP_mod_node_overlaps_with_next(H5SL_node_t *node_ptr) if ( ( (((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) + (((H5FP_mdata_mod *)H5SL_item(node_ptr))->md_size) - ) + ) > (((H5FP_mdata_mod *)H5SL_item(next_node_ptr))->addr) ) { -#if 0 +#if 0 /* This is useful debugging code -- keep it around for * a while. JRM -- 4/13/03 */ - HDfprintf(stdout, + HDfprintf(stdout, "H5FP_mod_node_overlaps_with_next: addr = %a, next_addr = %a.\n", (((H5FP_mdata_mod *)(node_ptr->data))->addr), (((H5FP_mdata_mod *)(next_node_ptr->data))->addr)); @@ -768,9 +768,9 @@ H5FP_mod_node_overlaps_with_next(H5SL_node_t *node_ptr) /* * Function: H5FP_mod_node_overlaps_with_prev * - * Purpose: Givena node in a mod tree, see if there is an overlap - * between the address range of the supplied node, and that - * of the previous node in the tree (if any). + * Purpose: Givena node in a mod tree, see if there is an overlap + * between the address range of the supplied node, and that + * of the previous node in the tree (if any). * * Return: TRUE if there is an overlap, and FALSE if there * isn't. @@ -795,7 +795,7 @@ H5FP_mod_node_overlaps_with_prev(H5SL_node_t *node_ptr) if ( prev_node_ptr != NULL ) { - HDassert((((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) + HDassert((((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) > (((H5FP_mdata_mod *)H5SL_item(prev_node_ptr))->addr) ); @@ -803,15 +803,15 @@ H5FP_mod_node_overlaps_with_prev(H5SL_node_t *node_ptr) if ( ( (((H5FP_mdata_mod *)H5SL_item(prev_node_ptr))->addr) + (((H5FP_mdata_mod *)H5SL_item(prev_node_ptr))->md_size) - ) + ) > (((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) ) { -#if 0 +#if 0 /* This is useful debugging code -- keep it around for * a while. JRM - 4/13/04 */ - HDfprintf(stdout, + HDfprintf(stdout, "H5FP_mod_node_overlaps_with_prev: addr = %a, prev_addr = %a.\n", (((H5FP_mdata_mod *)(node_ptr->data))->addr), (((H5FP_mdata_mod *)(prev_node_ptr->data))->addr)); @@ -839,7 +839,7 @@ H5FP_mod_node_overlaps_with_prev(H5SL_node_t *node_ptr) * JRM -- 3/29/04 */ static herr_t -H5FP_add_file_mod_to_list(H5FP_file_info *info, H5FD_mem_t mem_type, +H5FP_add_file_mod_to_list(H5FP_file_info *info, H5FD_mem_t mem_type, haddr_t addr, unsigned md_size, char *metadata) { @@ -853,13 +853,13 @@ H5FP_add_file_mod_to_list(H5FP_file_info *info, H5FD_mem_t mem_type, assert(info); #if 0 - /* This is useful debugging code -- keep it around for a + /* This is useful debugging code -- keep it around for a * while. JRM -- 4/13/04 */ - HDfprintf(stdout, - "H5FP_add_file_mod_to_list: Adding chunk at %a of length %u.\n", + HDfprintf(stdout, + "H5FP_add_file_mod_to_list: Adding chunk at %a of length %u.\n", addr, md_size); -#endif +#endif if ((node = H5SL_find(info->mod_list, &addr)) != NULL) { /* * The metadata is in the cache already. All we have to do is @@ -883,7 +883,7 @@ H5FP_add_file_mod_to_list(H5FP_file_info *info, H5FD_mem_t mem_type, (info->num_mods)--; /* since we just merged */ } - } else { /* fm->md_size == md_size */ + } else { /* fm->md_size == md_size */ HDfree(fm->metadata); fm->metadata = metadata; } @@ -907,7 +907,7 @@ H5FP_add_file_mod_to_list(H5FP_file_info *info, H5FD_mem_t mem_type, } /* if the tree was valid to begin with, we must merge with at - * most one previous node. + * most one previous node. */ if ( H5FP_mod_node_overlaps_with_prev(node) ) { if ( H5FP_merge_mod_node_with_prev(info->mod_list, node) < 0 ) @@ -1313,7 +1313,7 @@ H5FP_sap_handle_lock_request(H5FP_request_t *req) exit_state = H5FP_STATUS_BAD_FILE_ID; HGOTO_DONE(FAIL) } - + if (oids[j].info->closing) { /* we're closing the file - don't accept anymore locks */ exit_state = H5FP_STATUS_FILE_CLOSING; @@ -1446,7 +1446,7 @@ assert(0); HDfree(oids); H5FP_send_reply(req->proc_rank, req->req_id, req->file_id, exit_state); FUNC_LEAVE_NOAPI(ret_value) -} +} /* * Function: H5FP_sap_handle_release_lock_request @@ -1575,10 +1575,10 @@ H5FP_sap_handle_read_request(H5FP_request_t *req) int mrc; FUNC_ENTER_NOAPI_NOINIT(H5FP_sap_handle_read_request) -#if 0 +#if 0 /* More useful debugging code to keep for a time. JRM - 4/13/04 */ - HDfprintf(stdout, - "H5FP_sap_handle_read_request: req->addr = %a.\n", + HDfprintf(stdout, + "H5FP_sap_handle_read_request: req->addr = %a.\n", req->addr); #endif @@ -1659,8 +1659,8 @@ H5FP_sap_handle_write_request(H5FP_request_t *req, char *mdata, unsigned md_size FUNC_ENTER_NOAPI_NOINIT(H5FP_sap_handle_write_request) #if 0 /* Debugging code -- lets keep it for a time. JRM -- 4/13/04 */ - HDfprintf(stdout, - "H5FP_sap_handle_write_request: addr = %a, md_size = %d.\n", + HDfprintf(stdout, + "H5FP_sap_handle_write_request: addr = %a, md_size = %d.\n", (haddr_t)(req->addr), (int)md_size); #endif if ((info = H5SL_search(file_info_list,&req->file_id)) != NULL) { @@ -1850,9 +1850,9 @@ H5FP_sap_handle_alloc_request(H5FP_request_t *req) sap_alloc.eoa = HADDR_UNDEF; sap_alloc.status = H5FP_STATUS_CANT_ALLOC; } -#if 0 +#if 0 /* Debugging code -- lets keep it for a time. JRM -- 4/13/04 */ - HDfprintf(stdout, + HDfprintf(stdout, "%s: req_size = %d, req_type = %d, addr = %a, eoa = %a, status = %d, rp_rank = %d.\n", "H5FP_sap_handle_alloc_request", (int)(req->meta_block_size), @@ -1897,7 +1897,7 @@ H5FP_sap_handle_free_request(H5FP_request_t *req) #if 0 /* Debugging code -- lets keep it for a time. JRM -- 4/13/04 */ - HDfprintf(stdout, + HDfprintf(stdout, "%s: addr = %a, block_size = %a, mem_type = %d, rp_rank = %d.\n", "H5FP_sap_handle_free_request", req->addr, @@ -2006,10 +2006,10 @@ H5FP_sap_handle_set_eoa_request(H5FP_request_t *req) if ((info = H5SL_search(file_info_list,&req->file_id)) != NULL) { -#if 0 +#if 0 /* Debugging code -- lets keep it for a time. JRM -- 4/13/04 */ if ( req->addr < ((H5FD_fphdf5_t*)&info->file)->eoa ) { - HDfprintf(stdout, + HDfprintf(stdout, "%s: old eoa = %a, new eoa = %a, rp_rank = %d. %s\n", "H5FP_sap_handle_set_eoa_request", ((H5FD_fphdf5_t*)&info->file)->eoa, @@ -2019,14 +2019,14 @@ H5FP_sap_handle_set_eoa_request(H5FP_request_t *req) } #if 0 else { - HDfprintf(stdout, + HDfprintf(stdout, "%s: old eoa = %a, new eoa = %a, rp_rank = %d.\n", "H5FP_sap_handle_set_eoa_request", ((H5FD_fphdf5_t*)&info->file)->eoa, req->addr, (int)(req->proc_rank)); } -#endif +#endif #endif /* Get the EOA. */ @@ -2035,7 +2035,7 @@ H5FP_sap_handle_set_eoa_request(H5FP_request_t *req) } else { #if 1 /* Debugging code -- lets keep it for a time. JRM -- 4/13/04 */ - HDfprintf(stdout, + HDfprintf(stdout, "%s: Function failed -- Couldn't get info. new eoa = %a.\n", "H5FP_sap_handle_set_eoa_request", req->addr); @@ -16,7 +16,7 @@ * Purpose: Provides internal function tracing in the form of a stack. * The FUNC_ENTER() macro adds the function name to the function * stack whenever a function is entered. - * As the functions return with FUNC_LEAVE, + * As the functions return with FUNC_LEAVE, * entries are removed from the stack. * * A function stack has a fixed maximum size. If this size is @@ -112,10 +112,10 @@ H5FS_print(FILE *stream) H5FS_t *fstack = H5FS_get_my_stack (); /* Get the correct function stack */ const int indent = 2; /* Indention level */ int i; /* Local index ariable */ - + /* Don't push this function on the function stack... :-) */ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_print); - + /* Sanity check */ assert(fstack); @@ -136,7 +136,7 @@ H5FS_print(FILE *stream) for (i=fstack->nused-1; i>=0; --i) HDfprintf(stream, "%*s#%03d: Routine: %s\n", indent, "", i, fstack->slot[i]); - + FUNC_LEAVE_NOAPI_NOFS(SUCCEED); } /* end H5FS_print() */ @@ -160,7 +160,7 @@ herr_t H5FS_push(const char *func_name) { H5FS_t *fstack = H5FS_get_my_stack (); - + /* Don't push this function on the function stack... :-) */ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_push); @@ -174,7 +174,7 @@ H5FS_push(const char *func_name) if (fstack->nused<H5FS_NSLOTS) fstack->slot[fstack->nused] = func_name; fstack->nused++; - + FUNC_LEAVE_NOAPI_NOFS(SUCCEED); } /* end H5FS_push() */ @@ -197,7 +197,7 @@ herr_t H5FS_pop(void) { H5FS_t *fstack = H5FS_get_my_stack (); - + /* Don't push this function on the function stack... :-) */ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_pop); @@ -207,7 +207,7 @@ H5FS_pop(void) /* Pop the function. */ fstack->nused--; - + FUNC_LEAVE_NOAPI_NOFS(SUCCEED); } /* end H5FS_pop() */ diff --git a/src/H5Fdbg.c b/src/H5Fdbg.c index ee42963..4048ba0 100644 --- a/src/H5Fdbg.c +++ b/src/H5Fdbg.c @@ -46,7 +46,7 @@ * Modifications: * Robb Matzke, 1999-07-28 * The ADDR argument is passed by value. - * + * * Raymond Lu, 2001-10-14 * Changed to the new generic property list. * diff --git a/src/H5Fmount.c b/src/H5Fmount.c index 18feb9c..0bff83b 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -35,7 +35,7 @@ NAME H5F_init_mount_interface -- Initialize interface-specific information USAGE herr_t H5F_init_mount_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -71,7 +71,7 @@ H5F_close_mounts(H5F_t *f) { unsigned u; /* Local index */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5F_close_mounts, FAIL) HDassert(f); @@ -132,7 +132,7 @@ H5F_mount(H5G_entry_t *loc, const char *name, H5F_t *child, H5G_entry_t mp_open_ent; /* entry of moint point to be opened */ H5RS_str_t *name_r; /* Ref-counted version of name */ herr_t ret_value = SUCCEED; /*return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5F_mount) assert(loc); @@ -161,7 +161,7 @@ H5F_mount(H5G_entry_t *loc, const char *name, H5F_t *child, if(parent->shared->fc_degree != child->shared->fc_degree) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mounted file has different file close degree than parent") - + /* * Use a binary search to locate the position that the child should be * inserted into the parent mount table. At the end of this paragraph @@ -184,7 +184,7 @@ H5F_mount(H5G_entry_t *loc, const char *name, H5F_t *child, md++; if (!cmp) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mount point is already in use") - + /* Make room in the table */ if (parent->mtab.nmounts>=parent->mtab.nalloc) { unsigned n = MAX(16, 2*parent->mtab.nalloc); @@ -249,7 +249,7 @@ done: * * Pedro Vicente, <pvn@ncsa.uiuc.edu> 22 Aug 2002 * Added `id to name' support. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -265,7 +265,7 @@ H5F_unmount(H5G_entry_t *loc, const char *name, hid_t dxpl_id) H5G_entry_t mnt_open_ent; /* entry used to open mount point*/ int child_idx; /* Index of child in parent's mtab */ herr_t ret_value = SUCCEED; /*return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5F_unmount) assert(loc); @@ -391,7 +391,7 @@ H5F_mountpoint(H5G_entry_t *find/*in,out*/) int cmp; H5G_entry_t *ent = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5F_mountpoint, FAIL) assert(find); @@ -432,7 +432,7 @@ H5F_mountpoint(H5G_entry_t *find/*in,out*/) parent = ent->file; } } while (!cmp); - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -457,7 +457,7 @@ htri_t H5F_has_mount(const H5F_t *file) { htri_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5F_has_mount, FAIL) assert(file); @@ -466,7 +466,7 @@ H5F_has_mount(const H5F_t *file) ret_value=TRUE; else ret_value=FALSE; - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_has_mount() */ @@ -491,7 +491,7 @@ htri_t H5F_is_mount(const H5F_t *file) { htri_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5F_is_mount, FAIL) assert(file); @@ -500,7 +500,7 @@ H5F_is_mount(const H5F_t *file) ret_value=TRUE; else ret_value=FALSE; - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_is_mount() */ @@ -527,7 +527,7 @@ H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id) H5G_entry_t *loc = NULL; H5F_t *child = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Fmount, FAIL) H5TRACE4("e","isii",loc_id,name,child_id,plist_id); @@ -579,7 +579,7 @@ H5Funmount(hid_t loc_id, const char *name) { H5G_entry_t *loc = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Funmount, FAIL) H5TRACE2("e","is",loc_id,name); @@ -629,7 +629,7 @@ H5F_mount_count_ids_recurse(H5F_t *f, unsigned *nopen_files, unsigned *nopen_obj if(f->file_id > 0) *nopen_files += 1; - /* Increment number of open objects in file + /* Increment number of open objects in file * (Reduced by number of mounted files, we'll add back in the mount point's * groups later, if they are open) */ @@ -666,7 +666,7 @@ herr_t H5F_mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs) { herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5F_mount_count_ids, FAIL) /* Sanity check */ diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 8e68d0b..4458c7a 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -123,7 +123,7 @@ typedef struct H5F_mount_t { struct H5G_t *group; /* Mount point group held open */ struct H5F_t *file; /* File mounted at that point */ } H5F_mount_t; - + /* * The mount table describes what files are attached to (mounted on) the file * to which this table belongs. diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 211a2aa..d3f6cd8 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -282,7 +282,7 @@ typedef struct H5F_t H5F_t; #else # define H5F_OVERFLOW_HSIZET2OFFT(X) 0 #endif - + /* ========= File Creation properties ============ */ /* Definitions for the size of the file user block in bytes */ #define H5F_CRT_USER_BLOCK_NAME "block_size" @@ -317,7 +317,7 @@ typedef struct H5F_t H5F_t; #define H5F_CRT_OBJ_DIR_VERS_SIZE sizeof(unsigned) #define H5F_CRT_OBJ_DIR_VERS_DEF HDF5_OBJECTDIR_VERSION /* Definitions for shared-header format version */ -#define H5F_CRT_SHARE_HEAD_VERS_NAME "share_head_version" +#define H5F_CRT_SHARE_HEAD_VERS_NAME "share_head_version" #define H5F_CRT_SHARE_HEAD_VERS_SIZE sizeof(unsigned) #define H5F_CRT_SHARE_HEAD_VERS_DEF HDF5_SHAREDHEADER_VERSION @@ -340,7 +340,7 @@ typedef struct H5F_t H5F_t; /* Definition for preemption read chunks first */ #define H5F_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" #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.75 /* Definition for threshold for alignment */ #define H5F_ACS_ALIGN_THRHD_NAME "threshold" @@ -358,7 +358,7 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_META_BLOCK_SIZE_SIZE sizeof(hsize_t) #define H5F_ACS_META_BLOCK_SIZE_DEF 2048 -/* Definition for maximum sieve buffer size (when data sieving +/* Definition for maximum sieve buffer size (when data sieving is allowed by file driver */ #define H5F_ACS_SIEVE_BUF_SIZE_NAME "sieve_buf_size" #define H5F_ACS_SIEVE_BUF_SIZE_SIZE sizeof(size_t) @@ -395,18 +395,18 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_FAMILY_OFFSET_SIZE sizeof(hsize_t) #define H5F_ACS_FAMILY_OFFSET_DEF 0 -/* Definition for new member size of family driver. It's private +/* Definition for new member size of family driver. It's private * property only used by h5repart */ #define H5F_ACS_FAMILY_NEWSIZE_NAME "family_newsize" #define H5F_ACS_FAMILY_NEWSIZE_SIZE sizeof(hsize_t) #define H5F_ACS_FAMILY_NEWSIZE_DEF 0 - -/* Definition for whether to conver family to sec2 driver. It's private + +/* Definition for whether to conver family to sec2 driver. It's private * property only used by h5repart */ #define H5F_ACS_FAMILY_TO_SEC2_NAME "family_to_sec2" #define H5F_ACS_FAMILY_TO_SEC2_SIZE sizeof(hbool_t) #define H5F_ACS_FAMILY_TO_SEC2_DEF FALSE - + /* Definition for data type in multi file driver */ #define H5F_ACS_MULTI_TYPE_NAME "multi_type" #define H5F_ACS_MULTI_TYPE_SIZE sizeof(H5FD_mem_t) @@ -415,8 +415,8 @@ typedef struct H5F_t H5F_t; /* ======================== File Mount properties ====================*/ /* Definition for whether absolute symlinks local to file. */ #define H5F_MNT_SYM_LOCAL_NAME "local" -#define H5F_MNT_SYM_LOCAL_SIZE sizeof(hbool_t) -#define H5F_MNT_SYM_LOCAL_DEF FALSE +#define H5F_MNT_SYM_LOCAL_SIZE sizeof(hbool_t) +#define H5F_MNT_SYM_LOCAL_DEF FALSE #ifdef H5_HAVE_PARALLEL /* Which process writes metadata */ @@ -481,7 +481,7 @@ H5_DLL void H5F_addr_decode(const H5F_t *, const uint8_t** /*in,out*/, /* Callback functions for file access class */ H5_DLL herr_t H5F_acs_create(hid_t fapl_id, void *close_data); H5_DLL herr_t H5F_acs_close(hid_t fapl_id, void *close_data); -H5_DLL herr_t H5F_acs_copy(hid_t new_fapl_id, hid_t old_fapl_id, +H5_DLL herr_t H5F_acs_copy(hid_t new_fapl_id, hid_t old_fapl_id, void *close_data); /* Shared file list related routines */ diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index a829b97..a38fe25 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -86,7 +86,7 @@ typedef enum H5F_scope_t { /* How does file close behave? * H5F_CLOSE_DEFAULT - Use the degree pre-defined by underlining VFL - * H5F_CLOSE_WEAK - file closes only after all opened objects are closed + * H5F_CLOSE_WEAK - file closes only after all opened objects are closed * H5F_CLOSE_SEMI - if no opened objects, file is close; otherwise, file close fails * H5F_CLOSE_STRONG - if there are opened objects, close them first, then @@ -121,7 +121,7 @@ H5_DLL herr_t H5Fmount(hid_t loc, const char *name, hid_t child, hid_t plist); H5_DLL herr_t H5Funmount(hid_t loc, const char *name); H5_DLL hssize_t H5Fget_freespace(hid_t file_id); H5_DLL herr_t H5Fget_filesize(hid_t file_id, hsize_t *size); -H5_DLL herr_t H5Fget_mdc_config(hid_t file_id, +H5_DLL herr_t H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t * config_ptr); H5_DLL herr_t H5Fset_mdc_config(hid_t file_id, H5AC_cache_config_t * config_ptr); diff --git a/src/H5Fsfile.c b/src/H5Fsfile.c index 70eb420..e269776 100644 --- a/src/H5Fsfile.c +++ b/src/H5Fsfile.c @@ -105,7 +105,7 @@ H5F_sfile_add(H5F_file_t *shared) { H5F_sfile_node_t *new_shared; /* New shared file node */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5F_sfile_add) /* Sanity check */ @@ -147,7 +147,7 @@ H5F_sfile_search(H5FD_t *lf) { H5F_sfile_node_t *curr; /* Current shared file node */ H5F_file_t *ret_value = NULL; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_sfile_search) /* Sanity check */ @@ -189,7 +189,7 @@ H5F_sfile_remove(H5F_file_t *shared) H5F_sfile_node_t *curr; /* Current shared file node */ H5F_sfile_node_t *last; /* Last shared file node */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5F_sfile_remove) /* Sanity check */ diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 4cb1646..1676fe3 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -34,7 +34,7 @@ NAME H5F_init_super_interface -- Initialize interface-specific information USAGE herr_t H5T_init_super_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -69,10 +69,10 @@ H5F_init_super_interface(void) * Modifications: * Raymond Lu * May 24, 2005 - * Started to check if driver(only family and multi drivers) + * Started to check if driver(only family and multi drivers) * matches driver information saved in the superblock. Wrong * driver will result in a failure. - * + * *------------------------------------------------------------------------- */ herr_t @@ -138,21 +138,21 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr /* Superblock version */ super_vers = *p++; - if (super_vers > HDF5_SUPERBLOCK_VERSION_MAX) + if (super_vers > HDF5_SUPERBLOCK_VERSION_MAX) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "bad superblock version number") if (H5P_set(c_plist, H5F_CRT_SUPER_VERS_NAME, &super_vers) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set superblock version") /* Freespace version */ freespace_vers = *p++; - if (HDF5_FREESPACE_VERSION != freespace_vers) + if (HDF5_FREESPACE_VERSION != freespace_vers) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "bad free space version number") if (H5P_set(c_plist, H5F_CRT_FREESPACE_VERS_NAME, &freespace_vers) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to free space version") /* Root group version number */ obj_dir_vers = *p++; - if (HDF5_OBJECTDIR_VERSION != obj_dir_vers) + if (HDF5_OBJECTDIR_VERSION != obj_dir_vers) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "bad object directory version number") if (H5P_set(c_plist, H5F_CRT_OBJ_DIR_VERS_NAME, &obj_dir_vers) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set object directory version") @@ -162,7 +162,7 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr /* Shared header version number */ share_head_vers = *p++; - if (HDF5_SHAREDHEADER_VERSION != share_head_vers) + if (HDF5_SHAREDHEADER_VERSION != share_head_vers) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "bad shared-header format version number") if (H5P_set(c_plist, H5F_CRT_SHARE_HEAD_VERS_NAME, &share_head_vers) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set shared-header format version") @@ -184,7 +184,7 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr if (H5P_set(c_plist, H5F_CRT_OBJ_BYTE_NUM_NAME, &sizeof_size) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set byte number for object size") shared->sizeof_size = sizeof_size; /* Keep a local copy also */ - + /* Skip over reserved byte */ p++; @@ -277,10 +277,10 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr /* This step is for h5repart tool only. If user wants to change file driver from * family to sec2 while using h5repart, set the driver address to undefined to let * the library ignore the family driver information saved in the superblock. - */ + */ if(shared->fam_to_sec2) shared->driver_addr = HADDR_UNDEF; - + /* Decode the optional driver information block */ if (H5F_addr_defined(shared->driver_addr)) { haddr_t drv_addr = shared->base_addr + shared->driver_addr; @@ -324,13 +324,13 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to read file driver information") } /* end if */ - /* Check if driver matches driver information saved. Unfortunately, we can't push this + /* Check if driver matches driver information saved. Unfortunately, we can't push this * function to each specific driver because we're checking if the driver is correct.*/ if(!HDstrncmp(driver_name, "NCSAfami", 8) && HDstrcmp(lf->cls->name, "family")) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "family driver should be used") if(!HDstrncmp(driver_name, "NCSAmult", 8) && HDstrcmp(lf->cls->name, "multi")) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "multi driver should be used") - + if (H5FD_sb_decode(lf, driver_name, p) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to decode driver information") @@ -342,7 +342,7 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr /* Set the driver info block checksum */ shared->drvr_chksum = chksum; } /* end if */ - + /* * The user-defined data is the area of the file before the base * address. @@ -363,7 +363,7 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr #endif /* !H5_HAVE_FPHDF5 */ if (eof < stored_eoa) HGOTO_ERROR(H5E_FILE, H5E_TRUNCATED, FAIL, "truncated file") - + /* * Tell the file driver how much address space has already been * allocated so that it knows how to allocate additional memory. @@ -545,7 +545,7 @@ H5F_write_superblock(H5F_t *f, hid_t dxpl_id, uint8_t *buf) *p++ = 0; /* reserved */ UINT16ENCODE(p, f->shared->sym_leaf_k); UINT16ENCODE(p, f->shared->btree_k[H5B_SNODE_ID]); - UINT32ENCODE(p, f->shared->consist_flags); + UINT32ENCODE(p, f->shared->consist_flags); /* * Versions of the superblock >0 have the indexed storage B-tree @@ -24,7 +24,7 @@ * * The functions that begin with `H5G_node_' operate on the leaf * nodes of a symbol table B-tree. They should be defined in - * the H5Gnode.c file. + * the H5Gnode.c file. * * The remaining functions know how to traverse the group * directed graph. @@ -132,7 +132,7 @@ typedef struct H5G_names_t { H5RS_str_t *dst_name; H5G_entry_t *dst_loc; H5G_names_op_t op; -} H5G_names_t; +} H5G_names_t; /* Enum for H5G_namei actions */ typedef enum { @@ -177,14 +177,14 @@ static herr_t H5G_namei(const H5G_entry_t *loc_ent, const char *name, H5G_entry_t *ent, hid_t dxpl_id); static herr_t H5G_traverse_slink(H5G_entry_t *grp_ent/*in,out*/, H5G_entry_t *obj_ent/*in,out*/, int *nlinks/*in,out*/, hid_t dxpl_id); -static H5G_t *H5G_create(H5G_entry_t *loc, const char *name, size_t size_hint, +static H5G_t *H5G_create(H5G_entry_t *loc, const char *name, size_t size_hint, hid_t dxpl_id, hid_t gcpl_id, hid_t gapl_id); static htri_t H5G_isa(H5G_entry_t *ent, hid_t dxpl_id); static htri_t H5G_link_isa(H5G_entry_t *ent, hid_t dxpl_id); static H5G_t * H5G_open_oid(H5G_entry_t *ent, hid_t dxpl_id); static H5G_t *H5G_rootof(H5F_t *f); -static herr_t H5G_link(H5G_entry_t *cur_loc, const char *cur_name, - H5G_entry_t *new_loc, const char *new_name, +static herr_t H5G_link(H5G_entry_t *cur_loc, const char *cur_name, + H5G_entry_t *new_loc, const char *new_name, H5G_link_t type, unsigned namei_flags, hid_t dxpl_id); static herr_t H5G_get_num_objs(H5G_entry_t *grp, hsize_t *num_objs, hid_t dxpl_id); static ssize_t H5G_get_objname_by_idx(H5G_entry_t *loc, hsize_t idx, char* name, size_t size, hid_t dxpl_id); @@ -247,7 +247,7 @@ H5Gcreate(hid_t loc_id, const char *name, size_t size_hint) HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a location"); if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name given"); - + /* Create the group */ if (NULL == (grp = H5G_create(loc, name, size_hint, H5AC_dxpl_id, H5P_GROUP_CREATE_DEFAULT, H5P_DEFAULT))) @@ -270,7 +270,7 @@ done: * * Purpose: Creates a new group relative to LOC_ID and gives it the * specified NAME, and creation property list GCPL_ID and access - * property list GAPL_ID. + * property list GAPL_ID. * * The optional SIZE_HINT specifies how much file space to * reserve to store the names that will appear in this @@ -278,7 +278,7 @@ done: * then a default size is chosen. * * Given the default setting, H5Gcreate_expand() will have the - * same function of H5Gcreate() + * same function of H5Gcreate() * * See also: H5Gcreate(), H5Dcreate_expand() * @@ -290,8 +290,8 @@ done: * * Failure: FAIL * - * Programmer: Peter Cao - * May 08, 2005 + * Programmer: Peter Cao + * May 08, 2005 *------------------------------------------------------------------------- */ hid_t @@ -308,7 +308,7 @@ H5Gcreate_expand(hid_t loc_id, const char *name, size_t size_hint, hid_t gcpl_id HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name given") - + /* Check group creation property list */ if(H5P_DEFAULT == gcpl_id) gcpl_id = H5P_GROUP_CREATE_DEFAULT; @@ -473,7 +473,7 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_bt_ud2_t udata; H5G_t *grp = NULL; herr_t ret_value; - + FUNC_ENTER_API(H5Giterate, FAIL); H5TRACE5("e","is*Isxx",loc_id,name,idx_p,op,op_data); @@ -535,15 +535,15 @@ done: /*------------------------------------------------------------------------- * Function: H5Gget_num_objs * - * Purpose: Returns the number of objects in the group. It iterates + * Purpose: Returns the number of objects in the group. It iterates * all B-tree leaves and sum up total number of group members. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * * Programmer: Raymond Lu - * Nov 20, 2002 + * Nov 20, 2002 * * Modifications: * @@ -554,7 +554,7 @@ H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs) { H5G_entry_t *loc = NULL; /* Pointer to symbol table entry */ herr_t ret_value; - + FUNC_ENTER_API(H5Gget_num_objs, FAIL); H5TRACE2("e","i*h",loc_id,num_objs); @@ -587,12 +587,12 @@ done: * If a zero is returned for the name's length, then there is no name * associated with the ID. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * * Programmer: Raymond Lu - * Nov 20, 2002 + * Nov 20, 2002 * * Modifications: * @@ -625,14 +625,14 @@ done: * Function: H5Gget_objtype_by_idx * * Purpose: Returns the type of objects in the group by giving index. - * * - * Return: Success: H5G_GROUP(1), H5G_DATASET(2), H5G_TYPE(3) * - * Failure: H5G_UNKNOWN + * Return: Success: H5G_GROUP(1), H5G_DATASET(2), H5G_TYPE(3) + * + * Failure: H5G_UNKNOWN * * Programmer: Raymond Lu - * Nov 20, 2002 + * Nov 20, 2002 * * Modifications: * @@ -643,7 +643,7 @@ H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx) { H5G_entry_t *loc = NULL; /* Pointer to symbol table entry */ H5G_obj_t ret_value; - + FUNC_ENTER_API(H5Gget_objtype_by_idx, H5G_UNKNOWN); H5TRACE2("Go","ih",loc_id,idx); @@ -668,7 +668,7 @@ done: * Purpose: Renames an object within an HDF5 file. The original name SRC * is unlinked from the group graph and the new name DST is * inserted as an atomic operation. Both names are interpreted - * relative to SRC_LOC_ID and DST_LOC_ID, which are either a file + * relative to SRC_LOC_ID and DST_LOC_ID, which are either a file * ID or a group ID. * * Return: Non-negative on success/Negative on failure @@ -684,7 +684,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, +H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name) { H5G_entry_t *src_loc=NULL; @@ -713,7 +713,7 @@ H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, } else if(src_loc->file != dst_loc->file) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source and destination should be in the same file."); - + if (H5G_move(src_loc, src_name, dst_loc, dst_name, H5AC_dxpl_id)<0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to change object name"); @@ -729,8 +729,8 @@ done: * CUR_NAME. * * If TYPE is H5G_LINK_HARD then CUR_NAME must name an existing - * object. CUR_NAME and NEW_NAME are interpreted relative to - * CUR_LOC_ID and NEW_LOC_ID, which is either a file ID or a + * object. CUR_NAME and NEW_NAME are interpreted relative to + * CUR_LOC_ID and NEW_LOC_ID, which is either a file ID or a * group ID. * * If TYPE is H5G_LINK_SOFT then CUR_NAME can be anything and is @@ -750,7 +750,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, +H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, hid_t new_loc_id, const char *new_name) { H5G_entry_t *cur_loc = NULL; @@ -816,7 +816,7 @@ H5Gunlink(hid_t loc_id, const char *name) { H5G_entry_t *loc = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Gunlink, FAIL); H5TRACE2("e","is",loc_id,name); @@ -858,7 +858,7 @@ H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link, { H5G_entry_t *loc = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Gget_objinfo, FAIL); H5TRACE4("e","isbx",loc_id,name,follow_link,statbuf); @@ -900,7 +900,7 @@ H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/) { H5G_entry_t *loc = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Gget_linkval, FAIL); H5TRACE4("e","iszx",loc_id,name,size,buf); @@ -941,7 +941,7 @@ H5Gset_comment(hid_t loc_id, const char *name, const char *comment) { H5G_entry_t *loc = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Gset_comment, FAIL); H5TRACE3("e","iss",loc_id,name,comment); @@ -986,7 +986,7 @@ H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf) { H5G_entry_t *loc = NULL; int ret_value; - + FUNC_ENTER_API(H5Gget_comment, FAIL); H5TRACE4("Is","iszs",loc_id,name,bufsize,buf); @@ -1009,7 +1009,7 @@ done: *------------------------------------------------------------------------- * N O A P I F U N C T I O N S B E Y O N D T H I S P O I N T *------------------------------------------------------------------------- - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- */ /*------------------------------------------------------------------------- @@ -1096,7 +1096,7 @@ H5G_term_interface(void) int n=0; FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_term_interface); - + if (H5_interface_initialize_g) { if ((n=H5I_nmembers(H5I_GROUP))) { H5I_clear_type(H5I_GROUP, FALSE); @@ -1106,7 +1106,7 @@ H5G_term_interface(void) H5MM_xfree(H5G_type_g[i].desc); H5G_ntypes_g = H5G_atypes_g = 0; H5G_type_g = H5MM_xfree(H5G_type_g); - + /* Destroy the group object id group */ H5I_dec_type_ref(H5I_GROUP); @@ -1119,7 +1119,7 @@ H5G_term_interface(void) n = 1; /*H5I*/ } } - + FUNC_LEAVE_NOAPI(n); } @@ -1150,7 +1150,7 @@ H5G_register_type(H5G_obj_t type, htri_t(*isa)(H5G_entry_t*, hid_t), const char char *desc = NULL; size_t i; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_register_type); assert(type>=0); @@ -1184,7 +1184,7 @@ H5G_register_type(H5G_obj_t type, htri_t(*isa)(H5G_entry_t*, hid_t), const char H5G_atypes_g = n; H5G_type_g = x; } - + /* Add a new entry */ H5G_type_g[H5G_ntypes_g].type = type; H5G_type_g[H5G_ntypes_g].isa = isa; @@ -1263,7 +1263,7 @@ static const char * H5G_basename(const char *name, size_t *size_p) { size_t i; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_basename); /* Find the end of the base name */ @@ -1306,7 +1306,7 @@ H5G_normalize(const char *name) size_t s,d; /* Positions within the strings */ unsigned last_slash; /* Flag to indicate last character was a slash */ char *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_normalize); /* Sanity check */ @@ -1402,7 +1402,7 @@ done: * component of the name is a mount point then H5F_mountpoint() * is not called and information about the mount point itself is * returned. - * + * * Errors: * * Return: Success: Non-negative if name can be fully resolved. @@ -1458,7 +1458,7 @@ H5G_namei(const H5G_entry_t *loc_ent, const char *name, const char **rest/*out*/ unsigned last_comp = 0; /* Flag to indicate that a component is the last component in the name */ unsigned did_insert = 0; /* Flag to indicate that H5G_stab_insert was called */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_namei); /* Set up "out" parameters */ @@ -1478,7 +1478,7 @@ H5G_namei(const H5G_entry_t *loc_ent, const char *name, const char **rest/*out*/ null_obj = 0; if (!nlinks) nlinks = &_nlinks; - + /* Check args */ if (!name || !*name) HGOTO_ERROR (H5E_SYM, H5E_NOTFOUND, FAIL, "no name given"); @@ -1492,7 +1492,7 @@ H5G_namei(const H5G_entry_t *loc_ent, const char *name, const char **rest/*out*/ /* Check if we need to get the root group's entry */ if ('/' == *name) { H5G_t *tmp_grp; /* Temporary pointer to root group of file */ - + tmp_grp=H5G_rootof(loc_ent->file); assert(tmp_grp); @@ -1503,7 +1503,7 @@ H5G_namei(const H5G_entry_t *loc_ent, const char *name, const char **rest/*out*/ /* Deep copy of the symbol table entry */ if (H5G_ent_copy(obj_ent, loc_ent,H5G_COPY_DEEP)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to copy entry"); - + HDmemset(grp_ent, 0, sizeof(H5G_entry_t)); grp_ent->header = HADDR_UNDEF; @@ -1631,11 +1631,11 @@ H5G_namei(const H5G_entry_t *loc_ent, const char *name, const char **rest/*out*/ */ if (0==(target & H5G_TARGET_MOUNT) || !last_comp) H5F_mountpoint(obj_ent/*in,out*/); - + /* next component */ name += nchars; } /* end while */ - + /* Update the "rest of name" pointer */ if (rest) *rest = name; /*final null */ @@ -1697,7 +1697,7 @@ H5G_traverse_slink (H5G_entry_t *grp_ent/*in,out*/, H5RS_str_t *tmp_user_path_r=NULL, *tmp_canon_path_r=NULL; /* Temporary pointer to object's user path & canonical path */ const H5HL_t *heap; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_traverse_slink); /* Portably initialize the temporary group entry */ @@ -1717,7 +1717,7 @@ H5G_traverse_slink (H5G_entry_t *grp_ent/*in,out*/, if (H5HL_unprotect(grp_ent->file, dxpl_id, heap, stab_mesg.heap_addr, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR (H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read unprotect link value") - + /* Hold the entry's name (& old_name) to restore later */ tmp_user_path_r=obj_ent->user_path_r; obj_ent->user_path_r=NULL; @@ -1910,7 +1910,7 @@ H5G_create(H5G_entry_t *loc, const char *name, size_t size_hint, if (H5G_stab_create(file, dxpl_id, size_hint, &(grp->ent)/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "can't create grp"); stab_init=1; /* Indicate that the symbol table information is valid */ - + /* Get the property list */ if (NULL == (gc_plist = H5I_object(gcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a property list") @@ -1971,7 +1971,7 @@ static htri_t H5G_isa(H5G_entry_t *ent, hid_t dxpl_id) { htri_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5G_isa); assert(ent); @@ -2006,7 +2006,7 @@ static htri_t H5G_link_isa(H5G_entry_t *ent, hid_t UNUSED dxpl_id) { htri_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_link_isa); assert(ent); @@ -2211,7 +2211,7 @@ H5G_close(H5G_t *grp) if(H5G_free_ent_name(&(grp->ent))<0) { H5FL_FREE (H5G_t,grp); - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't free group entry name"); + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't free group entry name"); } } @@ -2501,7 +2501,7 @@ H5G_loc (hid_t loc_id) case H5I_GENPROP_CLS: case H5I_GENPROP_LST: HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to get symbol table entry of property list"); - + case H5I_ERROR_CLASS: case H5I_ERROR_MSG: case H5I_ERROR_STACK: @@ -2537,7 +2537,7 @@ H5G_loc (hid_t loc_id) if (NULL==(ret_value=H5A_entof(attr))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to get symbol table entry of attribute"); break; - + case H5I_REFERENCE: HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to get symbol table entry of reference"); @@ -2582,7 +2582,7 @@ H5G_link (H5G_entry_t *cur_loc, const char *cur_name, H5G_entry_t *new_loc, size_t nchars; /*characters in component */ size_t offset; /*offset to sym-link value */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_link); /* Check args */ @@ -2603,7 +2603,7 @@ H5G_link (H5G_entry_t *cur_loc, const char *cur_name, H5G_entry_t *new_loc, * Lookup the the new_name so we can get the group which will contain * the new entry. The entry shouldn't exist yet. */ - if (H5G_namei(new_loc, norm_new_name, &rest, &grp_ent, NULL, + if (H5G_namei(new_loc, norm_new_name, &rest, &grp_ent, NULL, H5G_TARGET_NORMAL, NULL, H5G_NAMEI_TRAVERSE, NULL, dxpl_id)>=0) HGOTO_ERROR (H5E_SYM, H5E_EXISTS, FAIL, "already exists"); H5E_clear_stack (NULL); /*it's okay that we didn't find it*/ @@ -2664,7 +2664,7 @@ done: /* Free the group's ID to name buffer, if creating a soft link */ if(type == H5G_LINK_SOFT) H5G_free_ent_name(&grp_ent); - + /* Free the ID to name buffer */ if(cur_obj_init) H5G_free_ent_name(&cur_obj); @@ -2701,7 +2701,7 @@ H5G_get_type(H5G_entry_t *ent, hid_t dxpl_id) htri_t isa; size_t i; H5G_obj_t ret_value=H5G_UNKNOWN; /* Return value */ - + FUNC_ENTER_NOAPI(H5G_get_type, H5G_UNKNOWN); for (i=H5G_ntypes_g; i>0; --i) { @@ -2752,7 +2752,7 @@ H5G_get_objinfo (H5G_entry_t *loc, const char *name, hbool_t follow_link, { H5G_entry_t grp_ent, obj_ent; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5G_get_objinfo, FAIL); assert (loc); @@ -2828,27 +2828,27 @@ done: /*------------------------------------------------------------------------- * Function: H5G_get_num_objs * - * Purpose: Private function for H5Gget_num_objs. Returns the number - * of objects in the group. It iterates all B-tree leaves + * Purpose: Private function for H5Gget_num_objs. Returns the number + * of objects in the group. It iterates all B-tree leaves * and sum up total number of group members. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * * Programmer: Raymond Lu - * Nov 20, 2002 + * Nov 20, 2002 * * Modifications: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5G_get_num_objs(H5G_entry_t *loc, hsize_t *num_objs, hid_t dxpl_id) { H5O_stab_t stab_mesg; /*info about B-tree */ herr_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5G_get_num_objs); /* Sanity check */ @@ -2866,9 +2866,9 @@ H5G_get_num_objs(H5G_entry_t *loc, hsize_t *num_objs, hid_t dxpl_id) if ((ret_value = H5B_iterate (loc->file, dxpl_id, H5B_SNODE, H5G_node_sumup, stab_mesg.btree_addr, num_objs))<0) HERROR (H5E_SYM, H5E_CANTINIT, "iteration operator failed"); - + done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value); } @@ -2878,24 +2878,24 @@ done: * Purpose: Private function for H5Gget_objname_by_idx. * Returns the name of objects in the group by giving index. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * * Programmer: Raymond Lu - * Nov 20, 2002 + * Nov 20, 2002 * * Modifications: * *------------------------------------------------------------------------- */ -static ssize_t +static ssize_t H5G_get_objname_by_idx(H5G_entry_t *loc, hsize_t idx, char* name, size_t size, hid_t dxpl_id) { H5O_stab_t stab_mesg; /*info about local heap & B-tree */ H5G_bt_ud3_t udata; /* Iteration information */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_get_objname_by_idx); /* Sanity check */ @@ -2915,7 +2915,7 @@ H5G_get_objname_by_idx(H5G_entry_t *loc, hsize_t idx, char* name, size_t size, h if ((ret_value = H5B_iterate (loc->file, dxpl_id, H5B_SNODE, H5G_node_name, stab_mesg.btree_addr, &udata))<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "iteration operator failed"); - + /* If we don't know the name now, we almost certainly went out of bounds */ if(udata.name==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "index out of bound"); @@ -2944,26 +2944,26 @@ done: * Purpose: Private function for H5Gget_objtype_by_idx. * Returns the type of objects in the group by giving index. * - * Return: Success: H5G_GROUP(1), H5G_DATASET(2), H5G_TYPE(3) + * Return: Success: H5G_GROUP(1), H5G_DATASET(2), H5G_TYPE(3) * - * Failure: UNKNOWN + * Failure: UNKNOWN * * Programmer: Raymond Lu - * Nov 20, 2002 + * Nov 20, 2002 * * Modifications: * *------------------------------------------------------------------------- */ -static H5G_obj_t +static H5G_obj_t H5G_get_objtype_by_idx(H5G_entry_t *loc, hsize_t idx, hid_t dxpl_id) { H5O_stab_t stab_mesg; /*info about local heap & B-tree */ H5G_bt_ud3_t udata; /* User data for B-tree callback */ H5G_obj_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_get_objtype_by_idx); - + /* Sanity check */ assert(loc); @@ -2976,12 +2976,12 @@ H5G_get_objtype_by_idx(H5G_entry_t *loc, hsize_t idx, hid_t dxpl_id) udata.num_objs = 0; udata.mesg = &stab_mesg; udata.type = H5G_UNKNOWN; - + /* Iterate over the group members */ if (H5B_iterate (loc->file, dxpl_id, H5B_SNODE, H5G_node_type, stab_mesg.btree_addr, &udata)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "iteration operator failed"); - + /* If we don't know the type now, we almost certainly went out of bounds */ if(udata.type==H5G_UNKNOWN) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "index out of bound"); @@ -3029,7 +3029,7 @@ H5G_linkval (H5G_entry_t *loc, const char *name, size_t size, char *buf/*out*/, H5O_stab_t stab_mesg; const H5HL_t *heap; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_linkval); /* @@ -3051,7 +3051,7 @@ H5G_linkval (H5G_entry_t *loc, const char *name, size_t size, char *buf/*out*/, if (NULL == (heap = H5HL_protect(grp_ent.file, dxpl_id, stab_mesg.heap_addr))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read protect link value") - + s = H5HL_offset_into(grp_ent.file, heap, obj_ent.cache.slink.lval_offset); /* Copy to output buffer */ @@ -3093,7 +3093,7 @@ H5G_set_comment(H5G_entry_t *loc, const char *name, const char *buf, hid_t dxpl_ H5G_entry_t obj_ent; H5O_name_t comment; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_set_comment); /* Get the symbol table entry for the object */ @@ -3148,7 +3148,7 @@ H5G_get_comment(H5G_entry_t *loc, const char *name, size_t bufsize, char *buf, h H5O_name_t comment; H5G_entry_t obj_ent; int ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5G_get_comment); /* Get the symbol table entry for the object */ @@ -3175,7 +3175,7 @@ done: FUNC_LEAVE_NOAPI(ret_value); } - + /*------------------------------------------------------------------------- * Function: H5G_unlink @@ -3204,7 +3204,7 @@ H5G_unlink(H5G_entry_t *loc, const char *name, hid_t dxpl_id) H5G_stat_t statbuf; /* Info about object to unlink */ H5RS_str_t *name_r; /* Ref-counted version of name */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_unlink); /* Sanity check */ @@ -3231,7 +3231,7 @@ H5G_unlink(H5G_entry_t *loc, const char *name, hid_t dxpl_id) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "no containing group specified"); if (NULL==(base=H5G_basename(norm_name, &len)) || '/'==*base) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "problems obtaining object base name"); - + /* Remove the name from the symbol table */ if (H5G_stab_remove(&grp_ent, base, dxpl_id)<0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to unlink name from symbol table"); @@ -3277,7 +3277,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_move(H5G_entry_t *src_loc, const char *src_name, H5G_entry_t *dst_loc, +H5G_move(H5G_entry_t *src_loc, const char *src_name, H5G_entry_t *dst_loc, const char *dst_name, hid_t dxpl_id) { H5G_stat_t sb; @@ -3287,7 +3287,7 @@ H5G_move(H5G_entry_t *src_loc, const char *src_name, H5G_entry_t *dst_loc, H5RS_str_t *src_name_r; /* Ref-counted version of src name */ H5RS_str_t *dst_name_r; /* Ref-counted version of dest name */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_move); /* Sanity check */ @@ -3314,7 +3314,7 @@ H5G_move(H5G_entry_t *src_loc, const char *src_name, H5G_entry_t *dst_loc, H5G_TARGET_NORMAL, dxpl_id)<0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to rename symbolic link"); H5MM_xfree(linkval); - + } else { /* * Rename the object. @@ -3325,7 +3325,7 @@ H5G_move(H5G_entry_t *src_loc, const char *src_name, H5G_entry_t *dst_loc, } /* Search the open ID list and replace names for the move operation - * This has to be done here because H5G_link and H5G_unlink have + * This has to be done here because H5G_link and H5G_unlink have * internal object entries, and do not modify the entries list */ if (H5G_namei(src_loc, src_name, NULL, NULL, &obj_ent, H5G_TARGET_NORMAL|H5G_TARGET_SLINK, NULL, H5G_NAMEI_TRAVERSE, NULL, dxpl_id)) @@ -3446,9 +3446,9 @@ H5G_free_grp_name(H5G_t *grp) { H5G_entry_t *ent; /* Group object's entry */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5G_free_grp_name, FAIL); - + /* Check args */ assert(grp && grp->shared); assert(grp->shared->fo_count > 0); @@ -3476,7 +3476,7 @@ done: * * Date: August 22, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -3486,9 +3486,9 @@ herr_t H5G_free_ent_name(H5G_entry_t *ent) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5G_free_ent_name, FAIL); - + /* Check args */ assert(ent); @@ -3500,7 +3500,7 @@ H5G_free_ent_name(H5G_entry_t *ent) H5RS_decr(ent->canon_path_r); ent->canon_path_r=NULL; } /* end if */ - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -3522,7 +3522,7 @@ done: * * Date: June 11, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -3537,7 +3537,7 @@ H5G_replace_name(H5G_obj_t type, H5G_entry_t *loc, unsigned search_group=0; /* Flag to indicate that groups are to be searched */ unsigned search_dataset=0; /* Flag to indicate that datasets are to be searched */ unsigned search_datatype=0; /* Flag to indicate that datatypes are to be searched */ - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(H5G_replace_name, FAIL); @@ -3600,7 +3600,7 @@ H5G_replace_name(H5G_obj_t type, H5G_entry_t *loc, if(search_datatype) H5I_search(H5I_DATATYPE, H5G_replace_ent, &names); -done: +done: FUNC_LEAVE_NOAPI(ret_value); } @@ -3617,7 +3617,7 @@ done: * * Date: September 24, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -3630,9 +3630,9 @@ H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) const char *prefix; /* Pointer to actual prefix string */ size_t nchars1,nchars2; /* Number of characters in components */ htri_t ret_value=FALSE; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_common_path); - + /* Get component of each name */ fullpath=H5RS_get_str(fullpath_r); assert(fullpath); @@ -3686,7 +3686,7 @@ done: * * Date: June 5, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -3700,11 +3700,11 @@ H5G_replace_ent(void *obj_ptr, hid_t obj_id, void *key) H5F_t *top_ent_file; /* Top file in entry's mounted file chain */ H5F_t *top_loc_file; /* Top file in location's mounted file chain */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_replace_ent); - + assert(obj_ptr); - + /* Get the symbol table entry */ switch(H5I_get_type(obj_id)) { case H5I_GROUP: @@ -3719,7 +3719,7 @@ H5G_replace_ent(void *obj_ptr, hid_t obj_id, void *key) /* Avoid non-named datatypes */ if(!H5T_is_named((H5T_t*)obj_ptr)) HGOTO_DONE(SUCCEED); /* Do not exit search over IDs */ - + ent = H5T_entof((H5T_t*)obj_ptr); break; @@ -3727,7 +3727,7 @@ H5G_replace_ent(void *obj_ptr, hid_t obj_id, void *key) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unknown data object"); } /* end switch */ assert(ent); - + switch(names->op) { /*------------------------------------------------------------------------- * OP_MOUNT @@ -4006,11 +4006,11 @@ H5G_replace_ent(void *obj_ptr, hid_t obj_id, void *key) /* Allocate space for the new user path */ if(NULL==(new_user_path = H5FL_BLK_MALLOC(str_buf,user_dst_len+1))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); - + /* Allocate space for the new canonical path */ if(NULL==(new_canon_path = H5FL_BLK_MALLOC(str_buf,canon_dst_len+1))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); - + /* Create the new names */ HDstrcpy(new_user_path,user_prefix); HDstrcat(new_user_path,dst_canon_prefix); @@ -4054,9 +4054,9 @@ H5G_replace_ent(void *obj_ptr, hid_t obj_id, void *key) default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid call"); } /* end switch */ - + done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value); } diff --git a/src/H5Gent.c b/src/H5Gent.c index d6219ab..fa58ca7 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -117,7 +117,7 @@ done: * symbol table entries. * * Errors: - * SYM CANTDECODE Can't decode. + * SYM CANTDECODE Can't decode. * * Return: Success: Non-negative, with *pp pointing to the first byte * after the last symbol. @@ -233,7 +233,7 @@ H5G_ent_decode(H5F_t *f, const uint8_t **pp, H5G_entry_t *ent) * symbol table entries. * * Errors: - * SYM CANTENCODE Can't encode. + * SYM CANTENCODE Can't encode. * * Return: Success: Non-negative, with *pp pointing to the first byte * after the last symbol. @@ -344,7 +344,7 @@ H5G_ent_encode(H5F_t *f, uint8_t **pp, const H5G_entry_t *ent) /* fill with zero */ while (*pp < p_ret) *(*pp)++ = 0; *pp = p_ret; - + FUNC_LEAVE_NOAPI(SUCCEED); } @@ -360,7 +360,7 @@ H5G_ent_encode(H5F_t *f, uint8_t **pp, const H5G_entry_t *ent) * * Date: August 2002 * - * Comments: + * Comments: * * Modifications: * Quincey Koziol, Sept. 25, 2002: @@ -448,7 +448,7 @@ H5G_ent_debug(H5F_t UNUSED *f, hid_t dxpl_id, const H5G_entry_t *ent, FILE * str { const char *lval = NULL; int nested_indent, nested_fwidth; - + FUNC_ENTER_NOAPI_NOFUNC(H5G_ent_debug); /* Calculate the indent & field width values for nested information */ @@ -504,7 +504,7 @@ H5G_ent_debug(H5F_t UNUSED *f, hid_t dxpl_id, const H5G_entry_t *ent, FILE * str else HDfprintf(stream, "%*s%-*s\n", nested_indent, "", nested_fwidth, "Warning: Invalid heap address given, name not displayed!"); break; - + default: HDfprintf(stream, "*** Unknown symbol type %d\n", ent->type); break; diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 4c08b9c..214e3fe 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -300,7 +300,7 @@ H5G_node_debug_key (FILE *stream, H5F_t *f, hid_t dxpl_id, int indent, int fwidt const H5HL_t *heap = NULL; const char *s; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_node_debug_key); assert (key); @@ -462,7 +462,7 @@ done: * * Pedro Vicente, <pvn@ncsa.uiuc.edu> 18 Sep 2002 * Added `id to name' support. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -679,7 +679,7 @@ done: * 5/13/04 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1006,7 +1006,7 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *_lt_key HGOTO_ERROR(H5E_SYM, H5E_UNSUPPORTED, FAIL, "internal erorr (unknown symbol find operation)"); done: - if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, + if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node"); @@ -1343,7 +1343,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, if (H5O_link(sn->entry+idx, -1, dxpl_id)<0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5B_INS_ERROR, "unable to decrement object link count"); } - + /* Remove the name from the local heap */ if (NULL == (heap = H5HL_protect(f, dxpl_id, bt_udata->heap_addr))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5B_INS_ERROR, "unable to protect symbol name"); @@ -1385,7 +1385,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, } sn = NULL; ret_value = H5B_INS_REMOVE; - + } else if (0==idx) { /* * We are about to remove the left-most entry from the symbol table @@ -1397,7 +1397,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, HDmemmove(sn->entry+idx, sn->entry+idx+1, (sn->nsyms-idx)*sizeof(H5G_entry_t)); ret_value = H5B_INS_NOOP; - + } else if (idx+1==sn->nsyms) { /* * We are about to remove the right-most entry from the symbol table @@ -1409,7 +1409,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, rt_key->offset = sn->entry[sn->nsyms-1].name_off; *rt_key_changed = TRUE; ret_value = H5B_INS_NOOP; - + } else { /* * We are about to remove an entry from the middle of a symbol table @@ -1451,7 +1451,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, sn = NULL; ret_value = H5B_INS_REMOVE; } /* end else */ - + done: if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, sn_flags)<0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node"); @@ -1582,7 +1582,7 @@ done: * Function: H5G_node_sumup * * Purpose: This function gets called during a group iterate operation - * to return total number of members in the group. + * to return total number of members in the group. * * Return: Non-negative on success/Negative on failure * @@ -1635,10 +1635,10 @@ done: * Purpose: This function gets called during a group iterate operation * to return object name by giving idx. * - * Return: 0 if object isn't found in this node; 1 if object is found; + * Return: 0 if object isn't found in this node; 1 if object is found; * Negative on failure * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Nov 20, 2002 * * Modifications: @@ -1658,7 +1658,7 @@ H5G_node_name(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, const H5HL_t *heap = NULL; size_t name_off; hsize_t loc_idx; - const char *name; + const char *name; H5G_node_t *sn = NULL; int ret_value = H5B_ITER_CONT; @@ -1673,11 +1673,11 @@ H5G_node_name(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, if (NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_ITER_ERROR, "unable to load symbol table node"); - - /* Find the node, locate the object symbol table entry and retrieve the name */ + + /* Find the node, locate the object symbol table entry and retrieve the name */ if(bt_udata->idx >= bt_udata->num_objs && bt_udata->idx < (bt_udata->num_objs+sn->nsyms)) { - loc_idx = bt_udata->idx - bt_udata->num_objs; - name_off = sn->entry[loc_idx].name_off; + loc_idx = bt_udata->idx - bt_udata->num_objs; + name_off = sn->entry[loc_idx].name_off; if (NULL == (heap = H5HL_protect(f, dxpl_id, bt_udata->mesg->heap_addr))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5B_ITER_ERROR, "unable to protect symbol name"); @@ -1713,7 +1713,7 @@ done: * Return: 0 if object isn't found in this node; 1 if found; * Negative on failure * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Nov 20, 2002 * * Modifications: @@ -1741,13 +1741,13 @@ H5G_node_type(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, assert(H5F_addr_defined(addr)); assert(bt_udata); - /* Find the node, locate the object symbol table entry and retrieve the type */ + /* Find the node, locate the object symbol table entry and retrieve the type */ if (NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_ITER_ERROR, "unable to load symbol table node"); if(bt_udata->idx >= bt_udata->num_objs && bt_udata->idx < (bt_udata->num_objs+sn->nsyms)) { - loc_idx = bt_udata->idx - bt_udata->num_objs; - bt_udata->type = H5G_get_type(&(sn->entry[loc_idx]), dxpl_id); + loc_idx = bt_udata->idx - bt_udata->num_objs; + bt_udata->type = H5G_get_type(&(sn->entry[loc_idx]), dxpl_id); ret_value = H5B_ITER_STOP; } else { bt_udata->num_objs += sn->nsyms; @@ -1756,7 +1756,7 @@ H5G_node_type(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, done: if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) != SUCCEED) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_ITER_ERROR, "unable to release object header"); - + FUNC_LEAVE_NOAPI(ret_value); } diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 9b299ed..78d1bbd 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -105,7 +105,7 @@ typedef struct H5G_bt_ud2_t { /* upward */ int final_ent; /*final entry looked at */ - + } H5G_bt_ud2_t; /* diff --git a/src/H5Gpublic.h b/src/H5Gpublic.h index 094a4a2..d38a8cb 100644 --- a/src/H5Gpublic.h +++ b/src/H5Gpublic.h @@ -63,7 +63,7 @@ typedef enum H5G_obj_t { H5G_RESERVED_5, /* Reserved for future use */ H5G_RESERVED_6, /* Reserved for future use */ H5G_RESERVED_7 /* Reserved for future use */ -} H5G_obj_t; +} H5G_obj_t; #define H5G_NTYPES 256 /* Max possible number of types */ #define H5G_NLIBTYPES 8 /* Number of internal types */ @@ -80,7 +80,7 @@ typedef struct H5G_stat_t { size_t linklen; /*symbolic link value length */ H5O_stat_t ohdr; /* Object header information */ } H5G_stat_t; - + #define H5G_SAME_LOC 0 #define H5Glink(cur_loc_id, type, cur_name, new_name) \ H5Glink2(cur_loc_id, cur_name, type, H5G_SAME_LOC, new_name) @@ -98,7 +98,7 @@ H5_DLL herr_t H5Giterate(hid_t loc_id, const char *name, int *idx, H5_DLL herr_t H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs); H5_DLL ssize_t H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char* name, size_t size); H5_DLL H5G_obj_t H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx); -H5_DLL herr_t H5Gmove2(hid_t src_loc, const char *src, hid_t dst_loc, +H5_DLL herr_t H5Gmove2(hid_t src_loc, const char *src, hid_t dst_loc, const char *dst); H5_DLL herr_t H5Glink2(hid_t src_loc, const char *cur_name, H5G_link_t type, hid_t dst_loc, const char *new_name); @@ -111,7 +111,7 @@ H5_DLL herr_t H5Gset_comment(hid_t loc_id, const char *name, const char *comment); H5_DLL int H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf); -H5_DLL hid_t H5Gcreate_expand(hid_t loc_id, const char *name, size_t size_hint, +H5_DLL hid_t H5Gcreate_expand(hid_t loc_id, const char *name, size_t size_hint, hid_t gcpl_id, hid_t gapl_id); #ifdef __cplusplus diff --git a/src/H5Gstab.c b/src/H5Gstab.c index 01c439e..94378a8 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -238,7 +238,7 @@ H5G_stab_insert(H5G_entry_t *grp_ent, const char *name, H5G_entry_t *obj_ent, hi /* insert */ if (H5B_insert(grp_ent->file, dxpl_id, H5B_SNODE, stab.btree_addr, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert entry"); - + /* update the name offset in the entry */ obj_ent->name_off = udata.ent.name_off; @@ -267,7 +267,7 @@ H5G_stab_remove(H5G_entry_t *grp_ent, const char *name, hid_t dxpl_id) H5O_stab_t stab; /*symbol table message */ H5G_bt_ud1_t udata; /*data to pass through B-tree */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5G_stab_remove, FAIL); assert(grp_ent && grp_ent->file); @@ -307,18 +307,18 @@ done: * *------------------------------------------------------------------------- */ -herr_t +herr_t H5G_stab_insert_name(H5G_entry_t *loc, H5G_entry_t *obj, const char *name) { size_t name_len; /* Length of name to append */ - herr_t ret_value = SUCCEED; - + herr_t ret_value = SUCCEED; + FUNC_ENTER_NOAPI_NOINIT(H5G_stab_insert_name); assert(loc); assert(obj); assert(name); - + /* Reset the object's previous names, if they exist */ if(obj->user_path_r) { H5RS_decr(obj->user_path_r); @@ -430,8 +430,8 @@ herr_t H5G_stab_delete(H5F_t *f, hid_t dxpl_id, haddr_t btree_addr, haddr_t heap_addr) { H5G_bt_ud1_t udata; /*data to pass through B-tree */ - herr_t ret_value = SUCCEED; - + herr_t ret_value = SUCCEED; + FUNC_ENTER_NOAPI(H5G_stab_delete, FAIL); assert(f); @@ -176,21 +176,21 @@ H5FL_BLK_DEFINE_STATIC(heap_chunk); * Modified function to return the disk address of the new * global heap collection, or HADDR_UNDEF on failure. This * is necessary, as in some cases (i.e. flexible parallel) - * H5AC_set() will imediately flush and destroy the in memory - * version of the new collection. For the same reason, I + * H5AC_set() will imediately flush and destroy the in memory + * version of the new collection. For the same reason, I * moved the code which places the new collection on the cwfs * list to just before the call to H5AC_set(). * * John Mainzer 6/8/05 * Removed code setting the is_dirty field of the cache info. - * This is no longer pemitted, as the cache code is now + * This is no longer pemitted, as the cache code is now * manageing this field. Since this function uses a call to * H5AC_set() (which marks the entry dirty automaticly), no * other change is required. * *------------------------------------------------------------------------- */ -static haddr_t +static haddr_t H5HG_create (H5F_t *f, hid_t dxpl_id, size_t size) { H5HG_heap_t *heap = NULL; @@ -198,7 +198,7 @@ H5HG_create (H5F_t *f, hid_t dxpl_id, size_t size) uint8_t *p = NULL; haddr_t addr; size_t n; - + FUNC_ENTER_NOAPI(H5HG_create, HADDR_UNDEF); /* Check args */ @@ -275,7 +275,7 @@ HDmemset(heap->chunk,0,size); f->shared->cwfs[0] = heap; f->shared->ncwfs = 1; } else { - HDmemmove (f->shared->cwfs+1, f->shared->cwfs, + HDmemmove (f->shared->cwfs+1, f->shared->cwfs, MIN (f->shared->ncwfs, H5HG_NCWFS-1)*sizeof(H5HG_heap_t*)); f->shared->cwfs[0] = heap; f->shared->ncwfs = MIN (H5HG_NCWFS, f->shared->ncwfs+1); @@ -330,7 +330,7 @@ H5HG_load (H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * udata1, size_t nalloc, need; size_t max_idx=0; /* The maximum index seen */ H5HG_heap_t *ret_value = NULL; /* Return value */ - + FUNC_ENTER_NOAPI(H5HG_load, NULL); /* check arguments */ @@ -476,9 +476,9 @@ H5HG_load (H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * udata1, f->shared->cwfs[0] = heap; } } - + ret_value = heap; - + done: if (!ret_value && heap) { if(H5HG_dest(f,heap)<0) @@ -512,7 +512,7 @@ static herr_t H5HG_flush (H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HG_heap_t *heap) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5HG_flush, FAIL); /* Check arguments */ @@ -555,7 +555,7 @@ static herr_t H5HG_dest (H5F_t *f, H5HG_heap_t *heap) { int i; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HG_dest); /* Check arguments */ @@ -668,7 +668,7 @@ H5HG_compute_size(const H5F_t UNUSED *f, const H5HG_heap_t *heap, size_t *size_p * Modified the function to use the new dirtied parameter of * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. - * + * * In this case, that required adding the new heap_dirtied_ptr * parameter to the function's argument list. * @@ -737,7 +737,7 @@ H5HG_alloc (H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned * heap_flags_ptr) */ heap->obj[0].size = 0; heap->obj[0].begin = NULL; - + } else if (heap->obj[0].size-need >= H5HG_SIZEOF_OBJHDR (f)) { /* * Some free space remains and it's larger than a heap object header, @@ -751,7 +751,7 @@ H5HG_alloc (H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned * heap_flags_ptr) UINT32ENCODE(p, 0); /*reserved*/ H5F_ENCODE_LENGTH (f, p, heap->obj[0].size); assert(H5HG_ISALIGNED(heap->obj[0].size)); - + } else { /* * Some free space remains but it's smaller than a heap object header, @@ -794,7 +794,7 @@ done: * Modified the function to use the new dirtied parameter of * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. - * + * * In this case, that required adding the new heap_dirtied_ptr * parameter to the function's argument list. * @@ -906,14 +906,14 @@ done: * * John Mainzer - 5/26/04 * Modified H5HG_create() to return the disk address of the - * new collection, instead of the address of its + * new collection, instead of the address of its * representation in core. This was necessary as in FP * mode, the cache will immediately flush and destroy any * entry inserted in it via H5AC_set(). I then modified * this function to account for the change in H5HG_create(). * * John Mainzer - 6/8/05 - * Modified function to use the dirtied parameter of + * Modified function to use the dirtied parameter of * H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * @@ -930,7 +930,7 @@ H5HG_insert (H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out* unsigned heap_flags = H5AC__NO_FLAGS_SET; hbool_t found=0; /* Flag to indicate a heap with enough space was found */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5HG_insert, FAIL); /* Check args */ @@ -944,24 +944,24 @@ H5HG_insert (H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out* /* Find a large enough collection on the CWFS list */ need = H5HG_SIZEOF_OBJHDR(f) + H5HG_ALIGN(size); - /* Note that we don't have metadata cache locks on the entries in - * f->shared->cwfs. + /* Note that we don't have metadata cache locks on the entries in + * f->shared->cwfs. * * In the current situation, this doesn't matter, as we are single - * threaded, and as best I can tell, entries are added to and deleted - * from f->shared->cwfs as they are added to and deleted from the + * threaded, and as best I can tell, entries are added to and deleted + * from f->shared->cwfs as they are added to and deleted from the * metadata cache. * * To be proper, we should either lock each entry in f->shared->cwfs - * as we examine it, or lock the whole array. However, at present + * as we examine it, or lock the whole array. However, at present * I don't see the point as there will be significant overhead, - * and protecting and unprotecting all the collections in the global + * and protecting and unprotecting all the collections in the global * heap on a regular basis will skew the replacement policy. * - * However, there is a bigger issue -- as best I can tell, we only look - * for free space in global heap chunks that are in cache. If we can't + * However, there is a bigger issue -- as best I can tell, we only look + * for free space in global heap chunks that are in cache. If we can't * find any, we allocate a new chunk. This may be a problem in FP mode, - * as the metadata cache is disabled. Do we allocate a new heap + * as the metadata cache is disabled. Do we allocate a new heap * collection for every entry in this case? * * Note that all this comes from a cursory read of the source. Don't @@ -1014,8 +1014,8 @@ H5HG_insert (H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out* } /* end if */ else { - /* Move the collection forward in the CWFS list, if it's not - * already at the front + /* Move the collection forward in the CWFS list, if it's not + * already at the front */ if (cwfsno>0) { H5HG_heap_t *tmp = f->shared->cwfs[cwfsno]; @@ -1026,13 +1026,13 @@ H5HG_insert (H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out* } /* end else */ HDassert(H5F_addr_defined(addr)); - + if ( NULL == (heap = H5AC_protect(f, dxpl_id, H5AC_GHEAP, addr, NULL, NULL, H5AC_WRITE)) ) HGOTO_ERROR (H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load heap"); /* Split the free space to make room for the new object */ idx = H5HG_alloc (f, heap, size, &heap_flags); - + /* Copy data into the heap */ if(size>0) { HDmemcpy(heap->obj[idx].begin+H5HG_SIZEOF_OBJHDR(f), obj, size); @@ -1088,7 +1088,7 @@ H5HG_read (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object/*out*/) size_t size; uint8_t *p = NULL; void *ret_value; - + FUNC_ENTER_NOAPI(H5HG_read, NULL); /* Check args */ @@ -1153,7 +1153,7 @@ done: * Modifications: * * John Mainzer - 6/8/05 - * Modified function to use the dirtied parameter of + * Modified function to use the dirtied parameter of * H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * @@ -1165,9 +1165,9 @@ H5HG_link (H5F_t *f, hid_t dxpl_id, const H5HG_t *hobj, int adjust) H5HG_heap_t *heap = NULL; unsigned heap_flags = H5AC__NO_FLAGS_SET; int ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5HG_link, FAIL); - + /* Check args */ assert (f); assert (hobj); @@ -1213,7 +1213,7 @@ done: * Modifications: * * John Mainzer - 6/8/05 - * Modified function to use the dirtied parameter of + * Modified function to use the dirtied parameter of * H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * @@ -1229,7 +1229,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) unsigned u; unsigned flags=H5AC__NO_FLAGS_SET;/* Whether the heap gets deleted */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5HG_remove, FAIL); /* Check args */ @@ -1247,7 +1247,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) obj_start = heap->obj[hobj->idx].begin; /* Include object header size */ need = H5HG_ALIGN(heap->obj[hobj->idx].size)+H5HG_SIZEOF_OBJHDR(f); - + /* Move the new free space to the end of the heap */ for (u=0; u<heap->nused; u++) { if (heap->obj[u].begin > heap->obj[hobj->idx].begin) @@ -1300,7 +1300,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) f->shared->cwfs[f->shared->ncwfs-1] = heap; } } - + done: if (heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, flags) != SUCCEED) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header"); @@ -870,11 +870,11 @@ H5HL_offset_into(H5F_t *f, const H5HL_t *heap, size_t offset) * Modifications: * * John Mainzer - 6/8/05/ - * Modified function to use the new dirtied parmeter of + * Modified function to use the new dirtied parmeter of * H5AC_unprotect(), which allows management of the is_dirty * field of the cache info to be moved into the cache code. * - * This required the addition of the heap_dirtied parameter + * This required the addition of the heap_dirtied parameter * to the function's parameter list. * *------------------------------------------------------------------------- @@ -947,7 +947,7 @@ H5HL_remove_free(H5HL_t *heap, H5HL_free_t *fl) * The ADDR argument is passed by value. * * John Mainzer, 6/7/05 - * Modified code to use the dirtied parameter of + * Modified code to use the dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * field of the cache info directly. * @@ -1100,7 +1100,7 @@ H5HL_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t buf_size, const void * (sizeof_hdr + heap->mem_alloc)); if (NULL==heap->chunk) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, (size_t)(-1), "memory allocation failed"); - + /* clear new section so junk doesn't appear in the file */ HDmemset(heap->chunk + sizeof_hdr + old_size, 0, need_more); } @@ -1143,7 +1143,7 @@ done: * The ADDR argument is passed by value. * * John Mainzer, 6/7/05 - * Modified code to use the dirtied parameter of + * Modified code to use the dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * field of the cache info directly. * @@ -1177,7 +1177,7 @@ H5HL_write(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t offset, size_t size, co HDmemcpy(heap->chunk + H5HL_SIZEOF_HDR(f) + offset, buf, size); done: - if (heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, heap_flags) != SUCCEED && + if (heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, heap_flags) != SUCCEED && ret_value != FAIL) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header"); @@ -1213,7 +1213,7 @@ done: * The ADDR argument is passed by value. * * John Mainzer, 6/7/05 - * Modified code to use the dirtied parameter of + * Modified code to use the dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * field of the cache info directly. * @@ -1343,7 +1343,7 @@ done: * Modifications: * * John Mainzer - 6/17/05 - * Modified function to use the new dirtied parmeter of + * Modified function to use the new dirtied parmeter of * H5AC_unprotect(), which allows management of the is_dirty * field of the cache info to be moved into the cache code. * diff --git a/src/H5HLprivate.h b/src/H5HLprivate.h index 7321bb9..001c3a1 100644 --- a/src/H5HLprivate.h +++ b/src/H5HLprivate.h @@ -64,7 +64,7 @@ typedef struct H5HL_t H5HL_t; H5_DLL herr_t H5HL_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, haddr_t *addr/*out*/); H5_DLL const H5HL_t *H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr); H5_DLL void *H5HL_offset_into(H5F_t *f, const H5HL_t *heap, size_t offset); -H5_DLL herr_t H5HL_unprotect(H5F_t *f, hid_t dxpl_id, const H5HL_t *heap, +H5_DLL herr_t H5HL_unprotect(H5F_t *f, hid_t dxpl_id, const H5HL_t *heap, haddr_t addr, unsigned heap_flags); H5_DLL size_t H5HL_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf); @@ -14,17 +14,17 @@ /* * FILE: H5I.c - Internal storage routines for handling "IDs" - * + * * REMARKS: ID's which allow objects (void *'s currently) to be bundled * into "types" for more general storage. - * + * * DESIGN: The types are stored in an array of pointers to store each * type in an element. Each "type" node contains a link to a * hash table to manage the IDs in each type. Allowed types are * values within the range 1 to MAX_NUM_TYPES and are given out * at run-time. Types used by the library are stored in global * variables defined in H5Ipublic.h. - * + * * AUTHOR: Quincey Koziol * * MODIFICATIONS: @@ -109,7 +109,7 @@ typedef struct { /*-------------------- Locally scoped variables -----------------------------*/ /* Array of pointers to atomic types */ -static H5I_id_type_t *H5I_id_type_list_g[MAX_NUM_TYPES]; +static H5I_id_type_t *H5I_id_type_list_g[MAX_NUM_TYPES]; /* Variable to keep track of the number of types allocated. Its value is the */ /* next type ID to be handed out, so it is always one greater than the number */ @@ -135,7 +135,7 @@ NAME H5I_init_interface -- Initialize interface-specific information USAGE herr_t H5I_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -163,7 +163,7 @@ H5I_init_interface(void) * * Failure: Negative. * - * Programmer: + * Programmer: * * Modifications: * @@ -205,10 +205,10 @@ H5I_term_interface(void) * Function: H5Iregister_type * * Purpose: Public interface to H5I_register_type. Creates a new type - * of ID's to give out. A specific number (RESERVED) of type - * entries may be reserved to enable "constant" values to be handed - * out which are valid IDs in the type, but which do not map to any - * data structures and are not allocated dynamically later. HASH_SIZE is + * of ID's to give out. A specific number (RESERVED) of type + * entries may be reserved to enable "constant" values to be handed + * out which are valid IDs in the type, but which do not map to any + * data structures and are not allocated dynamically later. HASH_SIZE is * the minimum hash table size to use for the type. FREE_FUNC is * called with an object pointer when the object is removed from * the type. @@ -322,7 +322,7 @@ H5I_type_t H5I_register_type(H5I_type_t type_id, size_t hash_size, unsigned rese { ret_value = type_id; } - + /* Initialize the type */ /* Check arguments */ #ifdef HASH_SIZE_POWER_2 @@ -372,10 +372,10 @@ H5I_type_t H5I_register_type(H5I_type_t type_id, size_t hash_size, unsigned rese /*------------------------------------------------------------------------- * Function: H5Itype_exists * - * Purpose: Query function to inform the user if a given type is - * currently registered with the library. + * Purpose: Query function to inform the user if a given type is + * currently registered with the library. * - * Return: Success: 1 if the type is registered, 0 if it is not + * Return: Success: 1 if the type is registered, 0 if it is not * * Failure: Negative * @@ -579,7 +579,7 @@ H5I_clear_type(H5I_type_t type, hbool_t force) if (type <= H5I_BADID || type >= H5I_next_type) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number"); - + type_ptr = H5I_id_type_list_g[type]; if (type_ptr == NULL || type_ptr->count <= 0) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type"); @@ -666,7 +666,7 @@ H5I_clear_type(H5I_type_t type, hbool_t force) } /* end else */ } /* end for */ } /* end for */ - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -680,7 +680,7 @@ done: * involves calling the free-func for each ID's object and * then adding the ID struct to the ID free list. Public * interface to H5I_destroy_type. - * + * * Return: Zero on success/Negative on failure * * Programmer: Nathaniel Furrer @@ -807,7 +807,7 @@ hid_t H5Iregister(H5I_type_t type, void *object) * *------------------------------------------------------------------------- */ -hid_t +hid_t H5I_register(H5I_type_t type, void *object) { H5I_id_type_t *type_ptr=NULL; /*ptr to the type */ @@ -818,7 +818,7 @@ H5I_register(H5I_type_t type, void *object) hid_t ret_value=SUCCEED; /*return value */ H5I_id_info_t *curr_id; /*ptr to the current atom */ unsigned i; /*counter */ - + FUNC_ENTER_NOAPI(H5I_register, FAIL); /* Check arguments */ @@ -911,13 +911,13 @@ H5I_register(H5I_type_t type, void *object) * * Failure: NULL * - * Programmer: + * Programmer: * * Modifications: * *------------------------------------------------------------------------- */ -void * +void * H5I_object(hid_t id) { H5I_id_info_t *id_ptr = NULL; /*ptr to the new atom */ @@ -940,7 +940,7 @@ done: * Function: H5Iobject_verify * * Purpose: Find an object pointer for the specified ID, verifying that - * its in a particular type. Public interface to + * its in a particular type. Public interface to * H5I_object_verify. * * Return: Success: Non-null object pointer associated with the @@ -993,7 +993,7 @@ done: * *------------------------------------------------------------------------- */ -void * +void * H5I_object_verify(hid_t id, H5I_type_t id_type) { H5I_id_info_t *id_ptr = NULL; /*ptr to the new atom */ @@ -1033,7 +1033,7 @@ done: * *------------------------------------------------------------------------- */ -H5I_type_t +H5I_type_t H5I_get_type(hid_t id) { H5I_type_t ret_value = H5I_BADID; @@ -1062,7 +1062,7 @@ done: * * Failure: H5I_BADID, a negative value * - * Programmer: + * Programmer: * * Modifications: * Robb Matzke, 1999-08-23 @@ -1144,7 +1144,7 @@ void *H5Iremove_verify(hid_t id, H5I_type_t id_type) * *------------------------------------------------------------------------- */ -void * +void * H5I_remove_verify(hid_t id, H5I_type_t id_type) { void * ret_value = NULL; /*return value */ @@ -1176,13 +1176,13 @@ done: * * Failure: NULL * - * Programmer: + * Programmer: * * Modifications: * *------------------------------------------------------------------------- */ -void * +void * H5I_remove(hid_t id) { H5I_id_type_t *type_ptr = NULL;/*ptr to the atomic type */ @@ -1334,7 +1334,7 @@ H5I_dec_ref(hid_t id) type_ptr = H5I_id_type_list_g[type]; if (type_ptr == NULL || type_ptr->count <= 0) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number"); - + /* General lookup of the ID */ if ((id_ptr=H5I_find_id(id))==NULL) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID"); @@ -1632,7 +1632,7 @@ done: * return value of 0 means that the type will have to be * re-initialized before it can be used again (and should probably * be set to H5I_UNINIT). - * + * * Return: Number of references to type on success/Negative on failure * * Programmer: Nathaniel Furrer @@ -1673,7 +1673,7 @@ herr_t H5Idec_type_ref(H5I_type_t type) * return value of 0 means that the type will have to be * re-initialized before it can be used again (and should probably * be set to H5I_UNINIT). - * + * * Return: Number of references to type on success/Negative on failure * * Programmer: Unknown @@ -1716,7 +1716,7 @@ H5I_dec_type_ref(H5I_type_t type) --(type_ptr->count); ret_value = type_ptr->count; } - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -1921,7 +1921,7 @@ done: * * Failure: NULL * - * Programmer: + * Programmer: * * Modifications: * @@ -1976,10 +1976,10 @@ H5I_find_id(hid_t id) /*------------------------------------------------------------------------- * Function: H5Iget_name * - * Purpose: Gets a name of an object from its ID. + * Purpose: Gets a name of an object from its ID. * * Return: Success: The length of name. - * + * * Failure: -1 * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu @@ -2126,14 +2126,14 @@ done: * Function: H5Iget_file_id * * Purpose: The public version of H5I_get_file_id(), obtains the file - * ID given an object ID. User has to close this ID. + * ID given an object ID. User has to close this ID. * * Return: Success: file ID * * Failure: a negative value * * Programmer: Raymond Lu - * Oct 27, 2003 + * Oct 27, 2003 * * Modifications: * @@ -2159,14 +2159,14 @@ done: * Function: H5I_get_file_id * * Purpose: The private version of H5Iget_file_id(), obtains the file - * ID given an object ID. + * ID given an object ID. * * Return: Success: file ID * * Failure: a negative value * * Programmer: Raymond Lu - * Oct 27, 2003 + * Oct 27, 2003 * * Modifications: * @@ -2185,7 +2185,7 @@ H5I_get_file_id(hid_t obj_id) type = H5I_TYPE(obj_id); if(type == H5I_FILE) { ret_value = obj_id; - + /* Increment reference count on atom. */ if (H5I_inc_ref(ret_value)<0) HGOTO_ERROR (H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed"); diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h index bda034c..1efa6ad 100644 --- a/src/H5Ipublic.h +++ b/src/H5Ipublic.h @@ -47,7 +47,7 @@ typedef enum H5I_type_t { H5I_GENPROP_LST, /*type ID for generic property lists */ H5I_ERROR_CLASS, /*type ID for error classes */ H5I_ERROR_MSG, /*type ID for error messages */ - H5I_ERROR_STACK, /*type ID for error stacks */ + H5I_ERROR_STACK, /*type ID for error stacks */ H5I_NTYPES /*number of library types, MUST BE LAST! */ } H5I_type_t; @@ -65,20 +65,20 @@ haddr_t H5MF_alloc(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { haddr_t ret_value; - + FUNC_ENTER_NOAPI(H5MF_alloc, HADDR_UNDEF); /* check arguments */ assert(f); assert(size > 0); - + /* Fail if we don't have write access */ if (0==(f->intent & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, "file is read-only"); /* Check that the file can address the new space */ if( H5MF_alloc_overflow(f, size) ) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "not enough address space in file"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "not enough address space in file"); /* Allocate space from the virtual file layer */ if (HADDR_UNDEF==(ret_value=H5FD_alloc(f->shared->lf, type, dxpl_id, size))) @@ -187,7 +187,7 @@ H5MF_realloc(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, haddr_t old_addr, hsize_t hsize_t new_size) { haddr_t ret_value; - + FUNC_ENTER_NOAPI(H5MF_realloc, HADDR_UNDEF); /* Convert old relative address to absolute address */ @@ -331,7 +331,7 @@ H5MF_alloc_overflow(H5F_t *f, hsize_t size) /* Also add space that is "reserved" for data to be flushed * to disk (e.g., for object headers and the heap). - * This is the total amount of file space that will be + * This is the total amount of file space that will be * allocated. */ space_needed += f->shared->lf->reserved_alloc; @@ -20,7 +20,7 @@ * * Purpose: Memory management functions. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -265,7 +265,7 @@ HDfprintf(stderr,"%s: request = %Zu, needed = %Zu\n", FUNC, request, needed); size_t page_size; /* Size of page needed */ /* Check if the request is too large for a standard page */ - page_size = (needed > mp->max_size) ? + page_size = (needed > mp->max_size) ? (needed + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_t))) : mp->page_size; /* Allocate new page */ diff --git a/src/H5MPtest.c b/src/H5MPtest.c index 7962457..45d5179 100644 --- a/src/H5MPtest.c +++ b/src/H5MPtest.c @@ -158,7 +158,7 @@ HDfprintf(stderr,"%s: page_free = %Zu, page->free_size = %Zu\n", "H5MP_pool_is_f page = page->next; } /* end while */ - /* Check that the free space from the pages + /* Check that the free space from the pages * corresponds to free space in pool */ #ifdef QAK HDfprintf(stderr,"%s: pool_free = %Zu, mp->free_size = %Zu\n", "H5MP_pool_is_free_size_correct", pool_free, mp->free_size); @@ -20,7 +20,7 @@ * * Purpose: Object header virtual functions. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -67,7 +67,7 @@ static int H5O_modify_real(H5G_entry_t *ent, const H5O_class_t *type, int overwrite, unsigned flags, unsigned update_flags, const void *mesg, hid_t dxpl_id); static int H5O_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - const H5O_class_t *type, unsigned flags, const void *mesg, + const H5O_class_t *type, unsigned flags, const void *mesg, unsigned * oh_flags_ptr); static herr_t H5O_remove_real(H5G_entry_t *ent, const H5O_class_t *type, int sequence, hid_t dxpl_id); @@ -82,7 +82,7 @@ static unsigned H5O_new_mesg(H5F_t *f, H5O_t *oh, unsigned *flags, const H5O_class_t **new_type, const void **new_mesg, hid_t dxpl_id, unsigned * oh_flags_ptr); static herr_t H5O_write_mesg(H5O_t *oh, unsigned idx, const H5O_class_t *type, - const void *mesg, unsigned flags, unsigned update_flags, + const void *mesg, unsigned flags, unsigned update_flags, unsigned * oh_flags_ptr); /* Metadata cache callbacks */ @@ -262,9 +262,9 @@ done: * Modifications: * * JRM -- 6/6/05 - * Removed code modifying the is_dirty field of the + * Removed code modifying the is_dirty field of the * cache_info. This field is now managed by the cache - * proper. + * proper. * *------------------------------------------------------------------------- */ @@ -306,7 +306,7 @@ H5O_init(H5F_t *f, hid_t dxpl_id, size_t size_hint, H5G_entry_t *ent/*out*/, had if (NULL == (oh->chunk[0].image = H5FL_BLK_CALLOC(chunk_image, size_hint))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); - + /* create the message list and initialize the first message */ oh->nmesgs = 1; oh->alloc_nmesgs = H5O_NMESGS; @@ -421,7 +421,7 @@ H5O_close(H5G_entry_t *obj_ent) } } #endif - + /* * If the file open object count has reached the number of open mount points * (each of which has a group open in the file) attempt to close the file. @@ -509,10 +509,10 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * _udata1, oh->version = *p++; if (H5O_VERSION != oh->version) HGOTO_ERROR(H5E_OHDR, H5E_VERSION, NULL, "bad object header version number"); - + /* reserved */ p++; - + /* decode number of messages */ UINT16DECODE(p, nmesgs); @@ -540,7 +540,7 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * _udata1, oh->alloc_nchunks = na; oh->chunk = x; } - + /* read the chunk raw data */ chunkno = oh->nchunks++; oh->chunk[chunkno].dirty = FALSE; @@ -551,7 +551,7 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * _udata1, if (H5F_block_read(f, H5FD_MEM_OHDR, chunk_addr, chunk_size, dxpl_id, oh->chunk[chunkno].image) < 0) HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read object header data"); - + /* load messages from this chunk */ for (p = oh->chunk[chunkno].image; p < oh->chunk[chunkno].image + chunk_size; p += mesg_size) { UINT16DECODE(p, id); @@ -694,11 +694,11 @@ H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_t *oh) combine=1; } /* end if */ else { - if (H5F_block_write(f, H5FD_MEM_OHDR, addr, (size_t)H5O_SIZEOF_HDR(f), + if (H5F_block_write(f, H5FD_MEM_OHDR, addr, (size_t)H5O_SIZEOF_HDR(f), dxpl_id, buf) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to write object header hdr to disk"); } /* end else */ - + /* encode messages */ for (u = 0, curr_msg=&oh->mesg[0]; u < oh->nmesgs; u++,curr_msg++) { if (curr_msg->dirty) { @@ -712,7 +712,7 @@ H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_t *oh) *p++ = 0; /*reserved*/ *p++ = 0; /*reserved*/ *p++ = 0; /*reserved*/ - + if (curr_msg->native) { assert(curr_msg->type->encode); @@ -731,7 +731,7 @@ H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_t *oh) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate space for object header data"); oh->chunk[cont->chunkno].addr = cont->addr; } - + /* * Encode the message. If the message is shared then we * encode a Shared Object message instead of the object @@ -917,7 +917,7 @@ done: * The value returned will probably be low unless the object * has just been flushed, as we simply total up the size of * the header with the sizes of the chunks. Thus any message - * that has been added since the last flush will not be + * that has been added since the last flush will not be * reflected in the total. * * Return: Non-negative on success/Negative on failure @@ -944,7 +944,7 @@ H5O_compute_size(const H5F_t *f, const H5O_t *oh, size_t *size_ptr) size = H5O_SIZEOF_HDR(f); - for (u = 0; u < oh->nchunks; u++) + for (u = 0; u < oh->nchunks; u++) size += oh->chunk[u].size; HDassert(size >= H5O_SIZEOF_HDR(f)); @@ -1068,7 +1068,7 @@ H5O_free (unsigned type_id, void *mesg) assert(type_id<NELMTS(message_type_g)); type=message_type_g[type_id]; /* map the type ID to the actual type object */ assert(type); - + /* Call the "real" free routine */ ret_value=H5O_free_real(type, mesg); @@ -1100,7 +1100,7 @@ H5O_free_real(const H5O_class_t *type, void *mesg) void * ret_value=NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_free_real); - + /* check args */ assert(type); @@ -1142,7 +1142,7 @@ H5O_copy (unsigned type_id, const void *mesg, void *dst) { const H5O_class_t *type; /* Actual H5O class type for the ID */ void *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_copy, NULL); /* check args */ @@ -1180,7 +1180,7 @@ static void * H5O_copy_real (const H5O_class_t *type, const void *mesg, void *dst) { void *ret_value = NULL; - + FUNC_ENTER_NOAPI_NOINIT(H5O_copy_real); /* check args */ @@ -1220,7 +1220,7 @@ done: * for write access on the file. * * John Mainzer, 6/6/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * *------------------------------------------------------------------------- @@ -1229,8 +1229,8 @@ int H5O_link(const H5G_entry_t *ent, int adjust, hid_t dxpl_id) { H5O_t *oh = NULL; - unsigned oh_flags=H5AC__NO_FLAGS_SET; /* used to indicate whether the - * object was deleted as a result + unsigned oh_flags=H5AC__NO_FLAGS_SET; /* used to indicate whether the + * object was deleted as a result * of this action. */ int ret_value = FAIL; @@ -1325,7 +1325,7 @@ H5O_count (H5G_entry_t *ent, unsigned type_id, hid_t dxpl_id) { const H5O_class_t *type; /* Actual H5O class type for the ID */ int ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_count, FAIL); /* Check args */ @@ -1369,7 +1369,7 @@ H5O_count_real (H5G_entry_t *ent, const H5O_class_t *type, hid_t dxpl_id) int acc; unsigned u; int ret_value; - + FUNC_ENTER_NOAPI(H5O_count_real, FAIL); /* Check args */ @@ -1427,7 +1427,7 @@ H5O_exists(H5G_entry_t *ent, unsigned type_id, int sequence, hid_t dxpl_id) { const H5O_class_t *type; /* Actual H5O class type for the ID */ htri_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_exists, FAIL); assert(ent); @@ -1465,7 +1465,7 @@ done: * Modifications: * * John Mainzer, 6/6/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * *------------------------------------------------------------------------- @@ -1476,7 +1476,7 @@ H5O_exists_real(H5G_entry_t *ent, const H5O_class_t *type, int sequence, hid_t d H5O_t *oh=NULL; unsigned u; htri_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5O_exists_real); assert(ent); @@ -1593,7 +1593,7 @@ done: * actually destroys the object in the cache. * * John Mainzer, 6/6/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * *------------------------------------------------------------------------- @@ -1854,7 +1854,7 @@ done: * be modified. * * John Mainzer, 6/6/05 - * Updated function to use the new dirtied parameter of + * Updated function to use the new dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * field of the cache info directly. * @@ -1913,13 +1913,13 @@ H5O_modify_real(H5G_entry_t *ent, const H5O_class_t *type, int overwrite, /* Set the correct sequence number for the message created */ sequence++; - + } else if (oh->mesg[idx].flags & H5O_FLAG_CONSTANT) { HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to modify constant message"); } else if (oh->mesg[idx].flags & H5O_FLAG_SHARED) { HGOTO_ERROR (H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to modify shared (constant) message"); } - + /* Write the information to the message */ if(H5O_write_mesg(oh,idx,type,mesg,flags,update_flags,&oh_flags)<0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to write message"); @@ -1927,14 +1927,14 @@ H5O_modify_real(H5G_entry_t *ent, const H5O_class_t *type, int overwrite, /* Update the modification time message if any */ if(update_flags&H5O_UPDATE_TIME) H5O_touch_oh(ent->file, oh, FALSE, &oh_flags); - + /* Set return value */ ret_value = sequence; done: if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, oh_flags) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header"); - + FUNC_LEAVE_NOAPI(ret_value); } /* end H5O_modify_real() */ @@ -2000,7 +2000,7 @@ done: * Modifications: * * John Mainzer, 6/6/05 - * Updated function to use the new dirtied parameter of + * Updated function to use the new dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * field of the cache info directly. * @@ -2049,7 +2049,7 @@ done: * Feb 14 2003 * * John Mainzer, 6/6/05 - * Updated function to use the new dirtied parameter of + * Updated function to use the new dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * field of the cache info directly. * @@ -2101,14 +2101,14 @@ done: * Modifications: * * John Mainzer, 6/6/05 - * Updated function to use the new dirtied parameter of + * Updated function to use the new dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * of the cache info. * *------------------------------------------------------------------------- */ static int -H5O_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_class_t *type, +H5O_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_class_t *type, unsigned flags, const void *mesg, unsigned * oh_flags_ptr) { unsigned idx; /* Index of message to modify */ @@ -2155,7 +2155,7 @@ done: * Modifications: * * John Mainzer, 6/7/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * In this case, that requires the addition of the oh_dirtied_ptr * parameter to track whether *oh is dirty. @@ -2237,7 +2237,7 @@ done: * Modifications: * * John Mainzer, 6/6/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * In this case, that requires the addition of the oh_dirtied_ptr * parameter to track whether *oh is dirty. @@ -2246,7 +2246,7 @@ done: */ static herr_t H5O_write_mesg(H5O_t *oh, unsigned idx, const H5O_class_t *type, - const void *mesg, unsigned flags, unsigned update_flags, + const void *mesg, unsigned flags, unsigned update_flags, unsigned * oh_flags_ptr) { H5O_mesg_t *idx_msg; /* Pointer to message to modify */ @@ -2295,7 +2295,7 @@ done: * Modifications: * * John Mainzer, 6/6/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * In this case, that requires the addition of the oh_dirtied_ptr * parameter to track whether *oh is dirty. @@ -2312,7 +2312,7 @@ H5O_touch_oh(H5F_t *f, H5O_t *oh, hbool_t force, unsigned * oh_flags_ptr) time_t now; size_t size; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5O_touch_oh); assert(oh); @@ -2370,7 +2370,7 @@ done: * Modifications: * * John Mainzer, 6/16/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * *------------------------------------------------------------------------- @@ -2381,7 +2381,7 @@ H5O_touch(H5G_entry_t *ent, hbool_t force, hid_t dxpl_id) H5O_t *oh = NULL; unsigned oh_flags = H5AC__NO_FLAGS_SET; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_touch, FAIL); /* check args */ @@ -2422,7 +2422,7 @@ done: * Modifications: * * John Mainzer, 6/16/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * In this case, that requires the addition of the oh_dirtied_ptr * parameter to track whether *oh is dirty. @@ -2435,7 +2435,7 @@ H5O_bogus_oh(H5F_t *f, H5O_t *oh, hbool_t * oh_flags_ptr) int idx; size_t size; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER(H5O_bogus_oh, FAIL); assert(f); @@ -2484,7 +2484,7 @@ done: * Modifications: * * John Mainzer, 6/16/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * *------------------------------------------------------------------------- @@ -2495,7 +2495,7 @@ H5O_bogus(H5G_entry_t *ent, hid_t dxpl_id) H5O_t *oh = NULL; unsigned oh_flags = H5AC__NO_FLAGS_SET; herr_t ret_value = SUCCEED; - + FUNC_ENTER(H5O_bogus, FAIL); /* check args */ @@ -2632,7 +2632,7 @@ H5O_remove_real(H5G_entry_t *ent, const H5O_class_t *type, int sequence, hid_t d /* load the object header */ if (NULL == (oh = H5AC_protect(ent->file, dxpl_id, H5AC_OHDR, ent->header, NULL, NULL, H5AC_WRITE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header"); - + for (u = seq = 0, curr_msg=&oh->mesg[0]; u < oh->nmesgs; u++,curr_msg++) { if (type->id != curr_msg->type->id) continue; @@ -2805,7 +2805,7 @@ H5O_alloc_extend_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno, size_t size) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, UFAIL, "memory allocation failed"); HDmemset(oh->chunk[chunkno].image+old_size, 0, oh->chunk[chunkno].size - old_size); - + /* adjust raw addresses for messages of this chunk */ if (old_addr != oh->chunk[chunkno].image) { for (u = 0; u < oh->nmesgs; u++) { @@ -2936,7 +2936,7 @@ H5O_alloc_new_chunk(H5F_t *f, H5O_t *oh, size_t size) oh->chunk[chunkno].size = size; if (NULL==(oh->chunk[chunkno].image = p = H5FL_BLK_CALLOC(chunk_image,size))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, UFAIL, "memory allocation failed"); - + /* * Make sure we have enough space for all possible new messages * that could be generated below. @@ -3181,7 +3181,7 @@ H5O_share (H5F_t *f, hid_t dxpl_id, const H5O_class_t *type, const void *mesg, size_t size; void *buf = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5O_share); /* Check args */ @@ -3230,7 +3230,7 @@ H5O_raw_size(unsigned type_id, const H5F_t *f, const void *mesg) { const H5O_class_t *type; /* Actual H5O class type for the ID */ size_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_raw_size,0); /* Check args */ @@ -3274,7 +3274,7 @@ H5O_get_share(unsigned type_id, H5F_t *f, const void *mesg, H5O_shared_t *share) { const H5O_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_get_share,FAIL); /* Check args */ @@ -3318,7 +3318,7 @@ H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) { H5O_t *oh=NULL; /* Object header information */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_delete,FAIL); /* Check args */ @@ -3334,7 +3334,7 @@ H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't delete object from file"); done: - if (oh && + if (oh && H5AC_unprotect(f, dxpl_id, H5AC_OHDR, addr, oh, H5AC__DIRTIED_FLAG | H5C__DELETED_FLAG)<0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header"); @@ -3368,7 +3368,7 @@ H5O_delete_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh) H5O_chunk_t *curr_chk; /* Pointer to current chunk being operated on */ unsigned u; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5O_delete_oh); /* Check args */ @@ -3430,7 +3430,7 @@ H5O_delete_mesg(H5F_t *f, hid_t dxpl_id, H5O_mesg_t *mesg) { const H5O_class_t *type; /* Type of object to free */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5O_delete_mesg); /* Check args */ @@ -3492,7 +3492,7 @@ H5O_get_info(H5G_entry_t *ent, H5O_stat_t *ostat, hid_t dxpl_id) hsize_t free_space; /* Free space in object header */ unsigned u; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_get_info,FAIL); /* Check args */ @@ -3532,7 +3532,7 @@ done: /*------------------------------------------------------------------------- * Function: H5O_encode * - * Purpose: Encode an object(data type and simple data space only) + * Purpose: Encode an object(data type and simple data space only) * description into a buffer. * * Return: Success: Non-negative @@ -3560,7 +3560,7 @@ H5O_encode(H5F_t *f, unsigned char *buf, void *obj, unsigned type_id) type=message_type_g[type_id]; /* map the type ID to the actual type object */ assert(type); - /* Encode */ + /* Encode */ if ((type->encode)(f, buf, obj)<0) HGOTO_ERROR (H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to encode message"); @@ -3572,10 +3572,10 @@ done: /*------------------------------------------------------------------------- * Function: H5O_decode * - * Purpose: Decode a binary object(data type and data space only) + * Purpose: Decode a binary object(data type and data space only) * description and return a new object handle. * - * Return: Success: Pointer to object(data type or space) + * Return: Success: Pointer to object(data type or space) * * Failure: NULL * @@ -3631,7 +3631,7 @@ done: * object being iterated over ('mesg'), and the pointer to the operator data * passed in to H5O_iterate ('op_data'). The return values from an operator * are: - * A. Zero causes the iterator to continue, returning zero when all + * A. Zero causes the iterator to continue, returning zero when all * object headers of that type have been processed. * B. Positive causes the iterator to immediately return that positive * value, indicating short-circuit success. @@ -3730,7 +3730,7 @@ H5O_debug_id(hid_t type_id, H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *str { const H5O_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_debug_id,FAIL); /* Check args */ @@ -3868,7 +3868,7 @@ H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f "Constant:", (oh->mesg[i].flags & H5O_FLAG_CONSTANT) ? "Yes" : "No"); if (oh->mesg[i].flags & ~H5O_FLAG_BITS) { - HDfprintf (stream, "%*s%-*s 0x%02x\n", indent+3,"",MAX(0,fwidth-3), + HDfprintf (stream, "%*s%-*s 0x%02x\n", indent+3,"",MAX(0,fwidth-3), "*** ADDITIONAL UNKNOWN FLAGS --->", oh->mesg[i].flags & ~H5O_FLAG_BITS); } @@ -3881,14 +3881,14 @@ H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f chunkno = oh->mesg[i].chunkno; if (chunkno >= oh->nchunks) HDfprintf(stream, "*** BAD CHUNK NUMBER\n"); - + /* check the size */ if ((oh->mesg[i].raw + oh->mesg[i].raw_size > oh->chunk[chunkno].image + oh->chunk[chunkno].size) || (oh->mesg[i].raw < oh->chunk[chunkno].image)) { HDfprintf(stream, "*** BAD MESSAGE RAW ADDRESS\n"); } - + /* decode the message */ if (oh->mesg[i].flags & H5O_FLAG_SHARED) { decode = H5O_SHARED->decode; @@ -3901,7 +3901,7 @@ H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f oh->mesg[i].native = (decode)(f, dxpl_id, oh->mesg[i].raw, NULL); if (NULL==oh->mesg[i].native) debug = NULL; - + /* print the message */ HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), "Message Information:"); diff --git a/src/H5Oattr.c b/src/H5Oattr.c index be48782..d0ed251 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -143,7 +143,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED * UINT16DECODE(p, name_len); /*including null*/ UINT16DECODE(p, attr->dt_size); UINT16DECODE(p, attr->ds_size); - + /* Decode and store the name */ if (NULL==(attr->name=H5MM_strdup((const char *)p))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); @@ -179,7 +179,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED * /* decode the attribute dataspace */ if (NULL==(attr->ds = H5FL_CALLOC(H5S_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + if((extent=(H5O_SDSPACE->decode)(f,dxpl_id,p,NULL))==NULL) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute dataspace"); @@ -188,7 +188,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED * /* Release temporary extent information */ H5FL_FREE(H5S_extent_t,extent); - + /* Default to entire dataspace being selected */ if(H5S_select_all(attr->ds,0)<0) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTSET, NULL, "unable to set all selection"); @@ -210,7 +210,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED * /* Indicate that the fill values aren't to be written out */ attr->initialized=1; - + /* Set return value */ ret_value=attr; @@ -223,7 +223,7 @@ done: NAME H5O_attr_encode PURPOSE - Encode a simple attribute message + Encode a simple attribute message USAGE herr_t H5O_attr_encode(f, raw_size, p, mesg) H5F_t *f; IN: pointer to the HDF5 file struct @@ -243,7 +243,7 @@ done: * Added a version number at the beginning. * * Raymond Lu, 8 April 2004 - * For data space, changed the operation on H5S_simple_t to + * For data space, changed the operation on H5S_simple_t to * H5S_extent_t * --------------------------------------------------------------------------*/ @@ -341,7 +341,7 @@ H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg) } /* end if */ else p += attr->ds_size; - + /* Store attribute data */ if(attr->data) HDmemcpy(p,attr->data,attr->data_size); @@ -360,8 +360,8 @@ done: Copies a message from MESG to DEST, allocating DEST if necessary. USAGE void *H5O_attr_copy(mesg, dest) - const void *mesg; IN: Pointer to the source attribute struct - const void *dest; IN: Pointer to the destination attribute struct + const void *mesg; IN: Pointer to the source attribute struct + const void *dest; IN: Pointer to the destination attribute struct RETURNS Pointer to DEST on success, NULL on failure DESCRIPTION @@ -609,7 +609,7 @@ done: RETURNS Non-negative on success/Negative on failure DESCRIPTION - This function prints debugging output to the stream passed as a + This function prints debugging output to the stream passed as a parameter. --------------------------------------------------------------------------*/ static herr_t @@ -642,7 +642,7 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in fprintf(stream, "%*sSymbol table entry...\n", indent, ""); H5G_ent_debug(f, dxpl_id, &(mesg->ent), stream, indent+3, MAX(0, fwidth-3), HADDR_UNDEF); - + fprintf(stream, "%*sData type...\n", indent, ""); fprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX(0,fwidth-3), "Size:", diff --git a/src/H5Obogus.c b/src/H5Obogus.c index 4da3f89..54a52b2 100644 --- a/src/H5Obogus.c +++ b/src/H5Obogus.c @@ -24,7 +24,7 @@ * correct operation when parsing unknown object header * messages. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ diff --git a/src/H5Ocont.c b/src/H5Ocont.c index 23c501e..b28186c 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -23,7 +23,7 @@ * the H5O package. Therefore, do not change * any definitions in this file! * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 0ab8bc5..7a7972b 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -207,7 +207,7 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt) UINT32DECODE(*pp, dt->shared->u.compnd.memb[i].offset); /* Older versions of the library allowed a field to have - * intrinsic 'arrayness'. Newer versions of the library + * intrinsic 'arrayness'. Newer versions of the library * use the separate array datatypes. */ if(version==H5O_DTYPE_VERSION_COMPAT) { /* Decode the number of dimensions */ @@ -220,7 +220,7 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt) /* Skip reserved bytes */ *pp += 4; - + /* Decode array dimension sizes */ for (j=0; j<4; j++) UINT32DECODE(*pp, dim[j]); @@ -261,7 +261,7 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt) /* Close the base type for the array */ H5T_close(temp_type); - + /* Make the array type the type that is set for the field */ temp_type=array_dt; } /* end if */ @@ -723,7 +723,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) /* Parent type */ if (H5O_dtype_encode_helper(pp, dt->shared->parent)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "unable to encode parent data type"); - + /* Names, each a multiple of eight bytes */ for (i=0; i<dt->shared->u.enumer.nmembs; i++) { HDstrcpy((char*)(*pp), dt->shared->u.enumer.name[i]); @@ -737,11 +737,11 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) HDmemcpy(*pp, dt->shared->u.enumer.value, dt->shared->u.enumer.nmembs * dt->shared->parent->shared->size); *pp += dt->shared->u.enumer.nmembs * dt->shared->parent->shared->size; break; - + case H5T_REFERENCE: flags |= (dt->shared->u.atomic.u.r.rtype & 0x0f); break; - + case H5T_STRING: /* * Character string types... (not fully implemented) @@ -880,7 +880,7 @@ done: NAME H5O_dtype_encode PURPOSE - Encode a simple datatype message + Encode a simple datatype message USAGE herr_t H5O_dtype_encode(f, raw_size, p, mesg) H5F_t *f; IN: pointer to the HDF5 file struct @@ -923,9 +923,9 @@ done: USAGE void *H5O_dtype_copy(mesg, dest) const void *mesg; IN: Pointer to the source simple datatype - struct + struct const void *dest; IN: Pointer to the destination simple - datatype struct + datatype struct RETURNS Pointer to DEST on success, NULL on failure DESCRIPTION @@ -1133,7 +1133,7 @@ H5O_dtype_get_share(H5F_t UNUSED *f, const void *_mesg, { const H5T_t *dt = (const H5T_t *)_mesg; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5O_dtype_get_share); assert (dt); @@ -1175,7 +1175,7 @@ H5O_dtype_set_share (H5F_t UNUSED *f, void *_mesg/*in,out*/, const H5O_shared_t *sh) { H5T_t *dt = (H5T_t *)_mesg; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_dtype_set_share); assert (dt); @@ -1208,7 +1208,7 @@ H5O_dtype_set_share (H5F_t UNUSED *f, void *_mesg/*in,out*/, RETURNS Non-negative on success/Negative on failure DESCRIPTION - This function prints debugging output to the stream passed as a + This function prints debugging output to the stream passed as a parameter. --------------------------------------------------------------------------*/ static herr_t @@ -1220,7 +1220,7 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, char buf[256]; unsigned i; size_t k; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_dtype_debug); /* check args */ @@ -1311,7 +1311,7 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, } fprintf(stream, "\n"); } - + } else if (H5T_OPAQUE==dt->shared->type) { fprintf(stream, "%*s%-*s \"%s\"\n", indent, "", fwidth, "Tag:", dt->shared->u.opaque.tag); diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 8959233..9106310 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -73,7 +73,7 @@ const H5O_class_t H5O_EFL[1] = {{ * Modifications: * Robb Matzke, 1998-07-20 * Rearranged the message to add a version number near the beginning. - * + * *------------------------------------------------------------------------- */ static void * @@ -118,7 +118,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED *s if (NULL == (heap = H5HL_protect(f, dxpl_id, mesg->heap_addr))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read protect link value") - + s = H5HL_offset_into(f, heap, 0); assert (s && !*s); @@ -137,7 +137,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED *s if (NULL == (heap = H5HL_protect(f, dxpl_id, mesg->heap_addr))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read protect link value") - + s = H5HL_offset_into(f, heap, mesg->slot[u].name_offset); assert (s && *s); mesg->slot[u].name = H5MM_xstrdup (s); @@ -145,7 +145,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED *s if (H5HL_unprotect(f, dxpl_id, heap, mesg->heap_addr, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read unprotect link value") - + /* File offset */ H5F_DECODE_LENGTH (f, p, mesg->slot[u].offset); @@ -184,7 +184,7 @@ done: * Entering the name into the local heap happens when the dataset is * created. Otherwise we could end up in infinite recursion if the heap * happens to hash to the same cache slot as the object header. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -267,7 +267,7 @@ H5O_efl_copy(const void *_mesg, void *_dest, unsigned UNUSED update_flags) if (NULL==(dest = H5MM_calloc(sizeof(H5O_efl_t))) || NULL==(dest->slot=H5MM_malloc(mesg->nalloc* sizeof(H5O_efl_entry_t)))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + } else if (dest->nalloc<mesg->nalloc) { H5MM_xfree(dest->slot); if (NULL==(dest->slot = H5MM_malloc(mesg->nalloc* @@ -354,7 +354,7 @@ H5O_efl_reset(void *_mesg) { H5O_efl_t *mesg = (H5O_efl_t *) _mesg; size_t u; /* Local index variable */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_efl_reset); /* check args */ @@ -393,7 +393,7 @@ hsize_t H5O_efl_total_size (H5O_efl_t *efl) { hsize_t ret_value = 0, tmp; - + FUNC_ENTER_NOAPI_NOINIT(H5O_efl_total_size); if (efl->nused>0 && @@ -455,11 +455,11 @@ H5O_efl_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * s for (u = 0; u < mesg->nused; u++) { sprintf (buf, "File %u", (unsigned)u); HDfprintf (stream, "%*s%s:\n", indent, "", buf); - + HDfprintf(stream, "%*s%-*s \"%s\"\n", indent+3, "", MAX (fwidth-3, 0), "Name:", mesg->slot[u].name); - + HDfprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX (fwidth-3, 0), "Name offset:", (unsigned long)(mesg->slot[u].name_offset)); diff --git a/src/H5Ofill.c b/src/H5Ofill.c index a7c0af9..32b772f 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -87,8 +87,8 @@ const H5O_class_t H5O_FILL_NEW[1] = {{ /* Initial version of the "old" fill value information */ #define H5O_FILL_VERSION 1 /* Revised version of the "new" fill value information */ -#define H5O_FILL_VERSION_2 2 - +#define H5O_FILL_VERSION_2 2 + /* Declare a free list to manage the H5O_fill_new_t struct */ H5FL_DEFINE(H5O_fill_new_t); @@ -99,16 +99,16 @@ H5FL_DEFINE(H5O_fill_t); /*------------------------------------------------------------------------- * Function: H5O_fill_new_decode * - * Purpose: Decode a new fill value message. The new fill value - * message is fill value plus space allocation time and + * Purpose: Decode a new fill value message. The new fill value + * message is fill value plus space allocation time and * fill value writing time and whether fill value is defined. * * Return: Success: Ptr to new message in native struct. * * Failure: NULL * - * Programmer: Raymond Lu - * Feb 26, 2002 + * Programmer: Raymond Lu + * Feb 26, 2002 * * Modifications: * @@ -121,7 +121,7 @@ H5O_fill_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, H5O_fill_new_t *mesg=NULL; int version; void *ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5O_fill_new_decode); assert(f); @@ -130,12 +130,12 @@ H5O_fill_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, if (NULL==(mesg=H5FL_CALLOC(H5O_fill_new_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill value message"); - + /* Version */ version = *p++; if( version != H5O_FILL_VERSION && version !=H5O_FILL_VERSION_2) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for fill value message"); - + /* Space allocation time */ mesg->alloc_time = (H5D_alloc_time_t)*p++; @@ -160,7 +160,7 @@ H5O_fill_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, /* Set return value */ ret_value = (void*)mesg; - + done: if (!ret_value && mesg) { if(mesg->buf) @@ -194,7 +194,7 @@ H5O_fill_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, { H5O_fill_t *mesg=NULL; void *ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5O_fill_decode); assert(f); @@ -209,10 +209,10 @@ H5O_fill_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill value"); HDmemcpy(mesg->buf, p, mesg->size); } - + /* Set return value */ ret_value = (void*)mesg; - + done: if (!ret_value && mesg) { if(mesg->buf) @@ -233,8 +233,8 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * Feb 26, 2002 + * Programmer: Raymond Lu + * Feb 26, 2002 * * Modifications: * @@ -244,7 +244,7 @@ static herr_t H5O_fill_new_encode(H5F_t UNUSED *f, uint8_t *p, const void *_mesg) { const H5O_fill_new_t *mesg = (const H5O_fill_new_t *)_mesg; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_new_encode); assert(f); @@ -311,16 +311,16 @@ H5O_fill_encode(H5F_t UNUSED *f, uint8_t *p, const void *_mesg) * Function: H5O_fill_new_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if - * necessary. The new fill value message is fill value plus - * space allocation time and fill value writing time and + * necessary. The new fill value message is fill value plus + * space allocation time and fill value writing time and * whether fill value is defined. * * Return: Success: Ptr to _DEST * * Failure: NULL * - * Programmer: Raymond Lu - * Feb 26, 2002 + * Programmer: Raymond Lu + * Feb 26, 2002 * * Modifications: * @@ -450,7 +450,7 @@ done: * * Purpose: Returns the size of the raw message in bytes not counting the * message type or size fields, but only the data fields. This - * function doesn't take into account alignment. The new fill + * function doesn't take into account alignment. The new fill * value message is fill value plus space allocation time and * fill value writing time and whether fill value is defined. * @@ -470,7 +470,7 @@ H5O_fill_new_size(const H5F_t UNUSED *f, const void *_mesg) { const H5O_fill_new_t *mesg = (const H5O_fill_new_t *)_mesg; size_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_new_size); assert(f); @@ -510,7 +510,7 @@ static size_t H5O_fill_size(const H5F_t UNUSED *f, const void *_mesg) { const H5O_fill_t *mesg = (const H5O_fill_t *)_mesg; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_size); assert(f); @@ -544,8 +544,8 @@ H5O_fill_new_reset(void *_mesg) FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_new_reset); assert(mesg); - - if(mesg->buf) + + if(mesg->buf) mesg->buf = H5MM_xfree(mesg->buf); mesg->size = -1; if (mesg->type) { @@ -582,15 +582,15 @@ H5O_fill_reset(void *_mesg) FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_reset); assert(mesg); - - if(mesg->buf) + + if(mesg->buf) mesg->buf = H5MM_xfree(mesg->buf); mesg->size = 0; if (mesg->type) { H5T_close(mesg->type); mesg->type = NULL; } - + FUNC_LEAVE_NOAPI(SUCCEED); } @@ -669,7 +669,7 @@ H5O_fill_new_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FIL { const H5O_fill_new_t *mesg = (const H5O_fill_new_t *)_mesg; H5D_fill_value_t fill_status; /* Whether the fill value is defined */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_new_debug); assert(f); @@ -747,7 +747,7 @@ H5O_fill_new_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FIL } else { fprintf(stream, "<dataset type>\n"); } - + FUNC_LEAVE_NOAPI(SUCCEED); } @@ -771,7 +771,7 @@ H5O_fill_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *s int indent, int fwidth) { const H5O_fill_t *mesg = (const H5O_fill_t *)_mesg; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_debug); assert(f); @@ -789,7 +789,7 @@ H5O_fill_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *s } else { fprintf(stream, "<dataset type>\n"); } - + FUNC_LEAVE_NOAPI(SUCCEED); } diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 1d50f94..b488e57 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -58,7 +58,7 @@ const H5O_class_t H5O_LAYOUT[1] = {{ H5O_layout_debug, /*debug the message */ }}; -/* For forward and backward compatibility. Version is 1 when space is +/* For forward and backward compatibility. Version is 1 when space is * allocated; 2 when space is delayed for allocation; 3 is default now and * is revised to just store information needed for each storage type. */ #define H5O_LAYOUT_VERSION_1 1 @@ -352,7 +352,7 @@ H5O_layout_copy(const void *_mesg, void *_dest, unsigned UNUSED update_flags) assert(mesg); if (!dest && NULL==(dest=H5FL_MALLOC(H5O_layout_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + /* copy */ *dest = *mesg; @@ -376,20 +376,20 @@ done: /*------------------------------------------------------------------------- * Function: H5O_layout_meta_size - * + * * Purpose: Returns the size of the raw message in bytes except raw data - * part for compact dataset. This function doesn't take into + * part for compact dataset. This function doesn't take into * account message alignment. - * + * * Return: Success: Message data size in bytes(except raw data * for compact dataset) * Failure: 0 - * + * * Programmer: Raymond Lu - * August 14, 2002 - * + * August 14, 2002 + * * Modifications: - * + * *------------------------------------------------------------------------- */ size_t @@ -397,20 +397,20 @@ H5O_layout_meta_size(const H5F_t *f, const void *_mesg) { const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg; size_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5O_layout_meta_size); - + /* check args */ assert(f); assert(mesg); - + ret_value = 1 + /* Version number */ 1; /* layout class type */ switch(mesg->type) { case H5D_CONTIGUOUS: - ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ - ret_value += H5F_SIZEOF_SIZE(f); /* Length of data */ + ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ + ret_value += H5F_SIZEOF_SIZE(f); /* Length of data */ break; case H5D_CHUNKED: @@ -419,7 +419,7 @@ H5O_layout_meta_size(const H5F_t *f, const void *_mesg) ret_value++; /* B-tree address */ - ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ + ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ /* Dimension sizes */ ret_value += mesg->u.chunk.ndims*4; @@ -434,15 +434,15 @@ H5O_layout_meta_size(const H5F_t *f, const void *_mesg) HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, 0, "Invalid layout class"); } /* end switch */ -done: +done: FUNC_LEAVE_NOAPI(ret_value); -} - +} + /*------------------------------------------------------------------------- * Function: H5O_layout_size * - * Purpose: Returns the size of the raw message in bytes. If it's + * Purpose: Returns the size of the raw message in bytes. If it's * compact dataset, the data part is also included. * This function doesn't take into account message alignment. * diff --git a/src/H5Omtime.c b/src/H5Omtime.c index ad398ae..c113676 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -26,7 +26,7 @@ #include "H5MMprivate.h" #include "H5Opkg.h" /* Object header functions */ -#if defined (WIN32) && !defined (__MWERKS__) +#if defined (WIN32) && !defined (__MWERKS__) #include <sys/types.h> #include <sys/timeb.h> #endif @@ -83,8 +83,8 @@ const H5O_class_t H5O_MTIME_NEW[1] = {{ }}; /* Current version of new mtime information */ -#define H5O_MTIME_VERSION 1 - +#define H5O_MTIME_VERSION 1 + /* Track whether tzset routine was called */ static int ntzset=0; @@ -243,12 +243,12 @@ H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, the_time -= tz.tz_minuteswest * 60 - (tm.tm_isdst ? 3600 : 0); } -#elif defined (WIN32) +#elif defined (WIN32) #if !defined (__MWERKS__) /* MSVC */ { struct timeb timebuffer; long tz; - + ftime(&timebuffer); tz = timebuffer.timezone; /* daylight is not handled properly. Currently we just hard-code @@ -272,7 +272,7 @@ H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, /* Irix64 */ HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to obtain local timezone information"); #endif - + /* The return value */ if (NULL==(mesg = H5FL_MALLOC(time_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); @@ -305,7 +305,7 @@ static herr_t H5O_mtime_new_encode(H5F_t UNUSED *f, uint8_t *p, const void *_mesg) { const time_t *mesg = (const time_t *) _mesg; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_new_encode); /* check args */ @@ -348,7 +348,7 @@ H5O_mtime_encode(H5F_t UNUSED *f, uint8_t *p, const void *_mesg) { const time_t *mesg = (const time_t *) _mesg; struct tm *tm; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_encode); /* check args */ @@ -397,7 +397,7 @@ H5O_mtime_copy(const void *_mesg, void *_dest, unsigned UNUSED update_flags) assert(mesg); if (!dest && NULL==(dest = H5FL_MALLOC(time_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + /* copy */ *dest = *mesg; @@ -548,7 +548,7 @@ H5O_mtime_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * const time_t *mesg = (const time_t *)_mesg; struct tm *tm; char buf[128]; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_debug); /* check args */ @@ -560,7 +560,7 @@ H5O_mtime_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * /* debug */ tm = HDlocaltime(mesg); - + HDstrftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm); fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Time:", buf); diff --git a/src/H5Oname.c b/src/H5Oname.c index 9fb5b3f..64477af 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -20,7 +20,7 @@ * * Purpose: Object name message. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -177,7 +177,7 @@ H5O_name_copy(const void *_mesg, void *_dest, unsigned UNUSED update_flags) assert(mesg); if (!dest && NULL==(dest = H5MM_calloc(sizeof(H5O_name_t)))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + /* copy */ *dest = *mesg; if((dest->s = H5MM_xstrdup(mesg->s))==NULL) diff --git a/src/H5Onull.c b/src/H5Onull.c index 376b3ec..028a535 100644 --- a/src/H5Onull.c +++ b/src/H5Onull.c @@ -20,7 +20,7 @@ * * Purpose: The null message. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ diff --git a/src/H5Opkg.h b/src/H5Opkg.h index bec95d7..7217e53 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -124,8 +124,8 @@ H5_DLLVAR const H5O_class_t H5O_DTYPE[1]; H5_DLLVAR const H5O_class_t H5O_FILL[1]; /* - * New Fill Value Message. The new fill value message is fill value plus - * space allocation time and fill value writing time and whether fill + * New Fill Value Message. The new fill value message is fill value plus + * space allocation time and fill value writing time and whether fill * value is defined. */ H5_DLLVAR const H5O_class_t H5O_FILL_NEW[1]; diff --git a/src/H5Opline.c b/src/H5Opline.c index 7c1dba6f..280c8db 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -178,7 +178,7 @@ H5O_pline_encode (H5F_t UNUSED *f, uint8_t *p/*out*/, const void *mesg) size_t i, j, name_length; const char *name=NULL; H5Z_class_t *cls=NULL; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_encode); /* Check args */ @@ -251,7 +251,7 @@ H5O_pline_copy (const void *_src, void *_dst/*out*/, unsigned UNUSED update_flag H5O_pline_t *dst = (H5O_pline_t *)_dst; size_t i; H5O_pline_t *ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5O_pline_copy); if (!dst && NULL==(dst = H5FL_MALLOC (H5O_pline_t))) @@ -266,7 +266,7 @@ H5O_pline_copy (const void *_src, void *_dst/*out*/, unsigned UNUSED update_flag } else { dst->filter = NULL; } - + for (i=0; i<src->nused; i++) { dst->filter[i] = src->filter[i]; if (src->filter[i].name) { @@ -326,7 +326,7 @@ H5O_pline_size (const H5F_t UNUSED *f, const void *mesg) const char *name = NULL; H5Z_class_t *cls = NULL; size_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_size); /* Message header */ @@ -340,14 +340,14 @@ H5O_pline_size (const H5F_t UNUSED *f, const void *mesg) (cls=H5Z_find(pline->filter[i].id))) name = cls->name; name_len = name ? HDstrlen(name)+1 : 0; - + ret_value += 2 + /*filter identification number */ 2 + /*name length */ 2 + /*flags */ 2 + /*number of client data values */ H5O_ALIGN(name_len); /*length of the filter name */ - + ret_value += pline->filter[i].cd_nelmts * 4; if (pline->filter[i].cd_nelmts % 2) ret_value += 4; @@ -377,7 +377,7 @@ H5O_pline_reset (void *mesg) { H5O_pline_t *pline = (H5O_pline_t*)mesg; size_t i; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_reset); assert (pline); @@ -487,6 +487,6 @@ H5O_pline_debug (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *mesg, FILE * (unsigned long)(pline->filter[i].cd_values[j])); } } - + FUNC_LEAVE_NOAPI(SUCCEED); } diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index ed2c56d..2e0d21f 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -85,8 +85,8 @@ typedef struct H5O_fill_t { } H5O_fill_t; /* - * New Fill Value Message. The new fill value message is fill value plus - * space allocation time and fill value writing time and whether fill + * New Fill Value Message. The new fill value message is fill value plus + * space allocation time and fill value writing time and whether fill * value is defined. */ @@ -95,8 +95,8 @@ typedef struct H5O_fill_new_t { ssize_t size; /*number of bytes in the fill value */ void *buf; /*the fill value */ H5D_alloc_time_t alloc_time; /* time to allocate space */ - H5D_fill_time_t fill_time; /* time to write fill value */ - hbool_t fill_defined; /* whether fill value is defined */ + H5D_fill_time_t fill_time; /* time to write fill value */ + hbool_t fill_defined; /* whether fill value is defined */ } H5O_fill_new_t; /* @@ -127,12 +127,12 @@ typedef struct H5O_efl_t { #define H5O_LAYOUT_NDIMS (H5S_MAX_RANK+1) typedef struct H5O_layout_contig_t { - haddr_t addr; /* File address of data */ + haddr_t addr; /* File address of data */ hsize_t size; /* Size of data in bytes */ } H5O_layout_contig_t; typedef struct H5O_layout_chunk_t { - haddr_t addr; /* File address of B-tree */ + haddr_t addr; /* File address of B-tree */ unsigned ndims; /* Num dimensions in chunk */ size_t dim[H5O_LAYOUT_NDIMS]; /* Size of chunk in elements */ size_t size; /* Size of chunk in bytes */ @@ -140,7 +140,7 @@ typedef struct H5O_layout_chunk_t { } H5O_layout_chunk_t; typedef struct H5O_layout_compact_t { - hbool_t dirty; /* Dirty flag for compact dataset */ + hbool_t dirty; /* Dirty flag for compact dataset */ size_t size; /* Size of buffer in bytes */ void *buf; /* Buffer for compact dataset */ } H5O_layout_compact_t; @@ -242,16 +242,16 @@ H5_DLL void *H5O_read(const H5G_entry_t *ent, unsigned type_id, int sequence, H5_DLL int H5O_modify(H5G_entry_t *ent, unsigned type_id, int overwrite, unsigned flags, unsigned update_flags, const void *mesg, hid_t dxpl_id); H5_DLL struct H5O_t * H5O_protect(H5G_entry_t *ent, hid_t dxpl_id); -H5_DLL herr_t H5O_unprotect(H5G_entry_t *ent, struct H5O_t *oh, hid_t dxpl_id, +H5_DLL herr_t H5O_unprotect(H5G_entry_t *ent, struct H5O_t *oh, hid_t dxpl_id, unsigned oh_flags); -H5_DLL int H5O_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, unsigned type_id, +H5_DLL int H5O_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, unsigned type_id, unsigned flags, const void *mesg, unsigned * oh_flags_ptr); H5_DLL herr_t H5O_touch(H5G_entry_t *ent, hbool_t force, hid_t dxpl_id); -H5_DLL herr_t H5O_touch_oh(H5F_t *f, struct H5O_t *oh, hbool_t force, +H5_DLL herr_t H5O_touch_oh(H5F_t *f, struct H5O_t *oh, hbool_t force, unsigned * oh_flags_ptr); #ifdef H5O_ENABLE_BOGUS H5_DLL herr_t H5O_bogus(H5G_entry_t *ent, hid_t dxpl_id); -H5_DLL herr_t H5O_bogus_oh(H5F_t *f, struct H5O_t *oh, +H5_DLL herr_t H5O_bogus_oh(H5F_t *f, struct H5O_t *oh, unsigned * oh_flags_ptr); #endif /* H5O_ENABLE_BOGUS */ H5_DLL herr_t H5O_remove(H5G_entry_t *ent, unsigned type_id, int sequence, diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 70249ea..cc3beb1 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -86,7 +86,7 @@ H5FL_ARR_EXTERN(hsize_t); Robb Matzke, 1998-04-09 The current and maximum dimensions are now H5F_SIZEOF_SIZET bytes instead of just four bytes. - + Robb Matzke, 1998-07-20 Added a version number and reformatted the message for aligment. @@ -103,7 +103,7 @@ H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p, H5O_shared_ void *ret_value; unsigned i; /* local counting variable */ unsigned flags, version; - + FUNC_ENTER_NOAPI_NOINIT(H5O_sdspace_decode); /* check args */ @@ -139,9 +139,9 @@ H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p, H5O_shared_ /* Increment past reserved byte */ p++; } /* end else */ - + p += 4; /*reserved*/ - + if (sdim->rank > 0) { if (NULL==(sdim->size=H5FL_ARR_MALLOC(hsize_t,sdim->rank))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); @@ -166,7 +166,7 @@ H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p, H5O_shared_ /* Set return value */ ret_value = (void*)sdim; /*success*/ - + done: if (!ret_value && sdim) { H5S_extent_release(sdim); @@ -181,7 +181,7 @@ done: NAME H5O_sdspace_encode PURPOSE - Encode a simple dimensionality message + Encode a simple dimensionality message USAGE herr_t H5O_sdspace_encode(f, raw_size, p, mesg) H5F_t *f; IN: pointer to the HDF5 file struct @@ -198,7 +198,7 @@ done: Robb Matzke, 1998-04-09 The current and maximum dimensions are now H5F_SIZEOF_SIZET bytes instead of just four bytes. - + Robb Matzke, 1998-07-20 Added a version number and reformatted the message for aligment. @@ -246,7 +246,7 @@ H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *mesg) for (u = 0; u < sdim->rank; u++) H5F_ENCODE_LENGTH (f, p, sdim->size[u]); if (flags & H5S_VALID_MAX) { - for (u = 0; u < sdim->rank; u++) + for (u = 0; u < sdim->rank; u++) H5F_ENCODE_LENGTH (f, p, sdim->max[u]); } } @@ -326,7 +326,7 @@ static size_t H5O_sdspace_size(const H5F_t *f, const void *mesg) { const H5S_extent_t *space = (const H5S_extent_t *) mesg; - + /* * All dimensionality messages are at least 8 bytes long. */ @@ -363,7 +363,7 @@ static herr_t H5O_sdspace_reset(void *_mesg) { H5S_extent_t *mesg = (H5S_extent_t*)_mesg; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_reset); H5S_extent_release(mesg); @@ -414,7 +414,7 @@ H5O_sdspace_free (void *mesg) RETURNS Non-negative on success/Negative on failure DESCRIPTION - This function prints debugging output to the stream passed as a + This function prints debugging output to the stream passed as a parameter. --------------------------------------------------------------------------*/ static herr_t @@ -436,13 +436,13 @@ H5O_sdspace_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *mesg, HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, "Rank:", (unsigned long) (sdim->rank)); - + if(sdim->rank>0) { HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Dim Size:"); for (u = 0; u < sdim->rank; u++) HDfprintf (stream, "%s%Hu", u?", ":"", sdim->size[u]); HDfprintf (stream, "}\n"); - + HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Dim Max:"); if (sdim->max) { HDfprintf (stream, "{"); diff --git a/src/H5Oshared.c b/src/H5Oshared.c index 8f4f558..c898a10 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -209,7 +209,7 @@ H5O_shared_decode (H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *buf, H5O_share H5O_shared_t *mesg=NULL; unsigned flags, version; void *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5O_shared_decode); /* Check args */ @@ -283,7 +283,7 @@ H5O_shared_encode (H5F_t *f, uint8_t *buf/*out*/, const void *_mesg) { const H5O_shared_t *mesg = (const H5O_shared_t *)_mesg; unsigned flags; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_shared_encode); /* Check args */ @@ -353,7 +353,7 @@ H5O_shared_copy(const void *_mesg, void *_dest, unsigned UNUSED update_flags) assert(mesg); if (!dest && NULL==(dest = H5MM_malloc (sizeof(H5O_shared_t)))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + /* copy */ *dest = *mesg; @@ -386,12 +386,12 @@ H5O_shared_size (const H5F_t *f, const void *_mesg) { const H5O_shared_t *shared = (const H5O_shared_t *) _mesg; size_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_shared_size); ret_value = 1 + /*version */ 1 + /*the flags field */ - (shared->in_gh ? + (shared->in_gh ? (H5F_SIZEOF_ADDR(f)+4) : /*sharing via global heap */ H5F_SIZEOF_ADDR(f)); /*sharing by another obj hdr */ @@ -516,6 +516,6 @@ H5O_shared_debug (H5F_t UNUSED *f, hid_t dxpl_id, const void *_mesg, H5G_ent_debug (f, dxpl_id, &(mesg->u.ent), stream, indent, fwidth, HADDR_UNDEF); } - + FUNC_LEAVE_NOAPI(SUCCEED); } diff --git a/src/H5Ostab.c b/src/H5Ostab.c index b3a3fd5..7bb06d5 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -20,7 +20,7 @@ * * Purpose: Symbol table messages. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -231,7 +231,7 @@ H5O_stab_copy(const void *_mesg, void *_dest, unsigned UNUSED update_flags) assert(stab); if (!dest && NULL==(dest = H5FL_MALLOC(H5O_stab_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + /* copy */ *dest = *stab; @@ -39,7 +39,7 @@ /* Local variables */ /* - * Predefined property list classes. These are initialized at runtime by + * Predefined property list classes. These are initialized at runtime by * H5P_init_interface() in this source file. */ hid_t H5P_CLS_NO_CLASS_g = FAIL; @@ -206,14 +206,14 @@ NAME H5P_init_interface -- Initialize interface-specific information USAGE herr_t H5P_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION Initializes any interface-specific data or routines. Modification: - + Peter Cao May 08, 2005 Add Group creation property, Add object creation property class. @@ -271,7 +271,7 @@ H5P_init_interface(void) /* Assume that if there are properties in the class, they are the default ones */ if(nprops==0) { /* register create intermediate groups */ - if(H5P_register(obj_class,H5G_CRT_INTERMEDIATE_GROUP_NAME,H5G_CRT_INTERMEDIATE_GROUP_SIZE, + if(H5P_register(obj_class,H5G_CRT_INTERMEDIATE_GROUP_NAME,H5G_CRT_INTERMEDIATE_GROUP_SIZE, &intmd_group,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") } @@ -498,7 +498,7 @@ H5P_copy_pclass(H5P_genclass_t *pclass) assert(pclass); - /* + /* * Create new property class object */ @@ -574,12 +574,12 @@ H5P_copy_plist(H5P_genplist_t *old_plist) size_t nseen; /* Number of items 'seen' */ hbool_t has_parent_class; /* Flag to indicate that this property list's class has a parent */ hid_t ret_value=FAIL; /* return value */ - + FUNC_ENTER_NOAPI(H5P_copy_plist, FAIL); assert(old_plist); - /* + /* * Create new property list object */ @@ -1533,7 +1533,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ hid_t -H5Pcreate_class(hid_t parent, const char *name, +H5Pcreate_class(hid_t parent, const char *name, H5P_cls_create_func_t cls_create, void *create_data, H5P_cls_copy_func_t cls_copy, void *copy_data, H5P_cls_close_func_t cls_close, void *close_data @@ -1556,7 +1556,7 @@ H5Pcreate_class(hid_t parent, const char *name, || (copy_data!=NULL && cls_copy==NULL) || (close_data!=NULL && cls_close==NULL)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "data specified, but no callback provided"); - + /* Get the pointer to the parent class */ if(parent==H5P_DEFAULT) par_class=NULL; @@ -1617,7 +1617,7 @@ H5P_create(H5P_genclass_t *pclass) assert(pclass); - /* + /* * Create new property list object */ @@ -2239,7 +2239,7 @@ herr_t H5Pregister(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, H5P_prp_delete_func_t prp_delete, - H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, + H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close) #endif /* H5_WANT_H5_V1_6_COMPAT */ { @@ -2402,7 +2402,7 @@ done: transformation, etc. A single 'get' or 'set' callback could handle multiple properties by performing different actions based on the property name or other properties in the property list. - + There is no 'create' callback routine for temporary property list objects, the initial value is assumed to have any necessary setup already performed on it. @@ -2420,7 +2420,7 @@ done: herr_t H5P_insert(H5P_genplist_t *plist, const char *name, size_t size, void *value, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, - H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, + H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close) { H5P_genprop_t *new_prop=NULL; /* Temporary property pointer */ @@ -2615,7 +2615,7 @@ done: transformation, etc. A single 'get' or 'set' callback could handle multiple properties by performing different actions based on the property name or other properties in the property list. - + There is no 'create' callback routine for temporary property list objects, the initial value is assumed to have any necessary setup already performed on it. @@ -2634,13 +2634,13 @@ done: herr_t H5Pinsert(hid_t plist_id, const char *name, size_t size, void *value, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, - H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, + H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, H5P_prp_close_func_t prp_close) #else /* H5_WANT_H5_V1_6_COMPAT */ herr_t H5Pinsert(hid_t plist_id, const char *name, size_t size, void *value, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, - H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, + H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close) #endif /* H5_WANT_H5_V1_6_COMPAT */ { @@ -3042,7 +3042,7 @@ H5Pexist(hid_t id, const char *name) if ((ret_value=H5P_exist_plist(plist,name))<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property does not exist in list"); } /* end if */ - else + else if(H5I_GENPROP_CLS == H5I_get_type(id)) { if (NULL == (pclass = H5I_object(id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property class"); @@ -3198,7 +3198,7 @@ H5Pget_size(hid_t id, const char *name, size_t *size) if ((ret_value=H5P_get_size_plist(plist,name,size))<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to query size in plist"); } /* end if */ - else + else if (H5I_GENPROP_CLS == H5I_get_type(id)) { if (NULL == (pclass = H5I_object(id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); @@ -3207,7 +3207,7 @@ H5Pget_size(hid_t id, const char *name, size_t *size) if ((ret_value=H5P_get_size_pclass(pclass,name,size))<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to query size in plist"); } /* end if */ - else + else HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); done: @@ -3430,7 +3430,7 @@ H5Pget_nprops(hid_t id, size_t *nprops) if (H5P_get_nprops_plist(plist,nprops)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to query # of properties in plist"); } /* end if */ - else + else if(H5I_GENPROP_CLS == H5I_get_type(id)) { if (NULL == (pclass = H5I_object(id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property class"); @@ -3539,7 +3539,7 @@ done: NAME H5P_cmp_class PURPOSE - Internal routine to compare two generic property classes + Internal routine to compare two generic property classes USAGE int H5P_cmp_class(pclass1, pclass2) H5P_genclass_t *pclass1; IN: 1st property class to compare @@ -3645,7 +3645,7 @@ done: NAME H5P_cmp_plist PURPOSE - Internal routine to compare two generic property lists + Internal routine to compare two generic property lists USAGE int H5P_cmp_plist(plist1, plist2) H5P_genplist_t *plist1; IN: 1st property list to compare @@ -4018,27 +4018,27 @@ The iteration begins with the IDX property in the object and the next element to be processed by the operator is returned in IDX. If IDX is NULL, then the iterator starts at the first property; since no stopping point is returned in this case, the iterator cannot be restarted if one of the calls to its operator -returns non-zero. +returns non-zero. -The prototype for H5P_iterate_t is: - typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); +The prototype for H5P_iterate_t is: + typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); The operation receives the property list or class identifier for the object being iterated over, ID, the name of the current property within the object, -NAME, and the pointer to the operator data passed in to H5Piterate, ITER_DATA. +NAME, and the pointer to the operator data passed in to H5Piterate, ITER_DATA. -The return values from an operator are: +The return values from an operator are: Zero causes the iterator to continue, returning zero when all properties - have been processed. + have been processed. Positive causes the iterator to immediately return that positive value, indicating short-circuit success. The iterator can be restarted at the - index of the next property. + index of the next property. Negative causes the iterator to immediately return that value, indicating failure. The iterator can be restarted at the index of the next property. H5Piterate assumes that the properties in the object identified by ID remains unchanged through the iteration. If the membership changes during the -iteration, the function's behavior is undefined. +iteration, the function's behavior is undefined. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS @@ -4176,27 +4176,27 @@ The iteration begins with the IDX property in the object and the next element to be processed by the operator is returned in IDX. If IDX is NULL, then the iterator starts at the first property; since no stopping point is returned in this case, the iterator cannot be restarted if one of the calls to its operator -returns non-zero. +returns non-zero. -The prototype for H5P_iterate_t is: - typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); +The prototype for H5P_iterate_t is: + typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); The operation receives the property list or class identifier for the object being iterated over, ID, the name of the current property within the object, -NAME, and the pointer to the operator data passed in to H5Piterate, ITER_DATA. +NAME, and the pointer to the operator data passed in to H5Piterate, ITER_DATA. -The return values from an operator are: +The return values from an operator are: Zero causes the iterator to continue, returning zero when all properties - have been processed. + have been processed. Positive causes the iterator to immediately return that positive value, indicating short-circuit success. The iterator can be restarted at the - index of the next property. + index of the next property. Negative causes the iterator to immediately return that value, indicating failure. The iterator can be restarted at the index of the next property. H5Piterate assumes that the properties in the object identified by ID remains unchanged through the iteration. If the membership changes during the -iteration, the function's behavior is undefined. +iteration, the function's behavior is undefined. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS @@ -4280,25 +4280,25 @@ is returned in this case, the iterator cannot be restarted if one of the calls to its operator returns non-zero. The IDX value is 0-based (ie. to start at the "first" property, the IDX value should be 0). -The prototype for H5P_iterate_t is: - typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); +The prototype for H5P_iterate_t is: + typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); The operation receives the property list or class identifier for the object being iterated over, ID, the name of the current property within the object, -NAME, and the pointer to the operator data passed in to H5Piterate, ITER_DATA. +NAME, and the pointer to the operator data passed in to H5Piterate, ITER_DATA. -The return values from an operator are: +The return values from an operator are: Zero causes the iterator to continue, returning zero when all properties - have been processed. + have been processed. Positive causes the iterator to immediately return that positive value, indicating short-circuit success. The iterator can be restarted at the - index of the next property. + index of the next property. Negative causes the iterator to immediately return that value, indicating failure. The iterator can be restarted at the index of the next property. H5Piterate assumes that the properties in the object identified by ID remains unchanged through the iteration. If the membership changes during the -iteration, the function's behavior is undefined. +iteration, the function's behavior is undefined. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS @@ -4325,13 +4325,13 @@ H5Piterate(hid_t id, int *idx, H5P_iterate_t iter_func, void *iter_data) if ((ret_value=H5P_iterate_plist(id,(idx ? idx : &fake_idx),iter_func,iter_data))<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to iterate over list"); } /* end if */ - else + else if (H5I_GENPROP_CLS == H5I_get_type(id)) { /* Iterate over a property class */ if ((ret_value=H5P_iterate_pclass(id,(idx ? idx : &fake_idx),iter_func,iter_data))<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to iterate over class"); } /* end if */ - else + else HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); done: @@ -4917,7 +4917,7 @@ done: Failure: negative value. DESCRIPTION Copies a property from one property list to another. - + If a property is copied from one list to another, the property will be first deleted from the destination list (generating a call to the 'close' callback for the property, if one exists) and then the property is copied @@ -5026,12 +5026,12 @@ done: Failure: negative value. DESCRIPTION Copies a property from one property class to another. - + If a property is copied from one class to another, all the property information will be first deleted from the destination class and then the property information will be copied from the source class into the destination class. - + If the property does not exist in the destination class or list, this call is equivalent to calling H5Pregister. @@ -5089,12 +5089,12 @@ done: Failure: negative value. DESCRIPTION Copies a property from one property list or class to another. - + If a property is copied from one class to another, all the property information will be first deleted from the destination class and then the property information will be copied from the source class into the destination class. - + If a property is copied from one list to another, the property will be first deleted from the destination list (generating a call to the 'close' callback for the property, if one exists) and then the property is copied diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 3359b52..8977a51 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -106,7 +106,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for + * Changed the way to check parameter and set property for * generic property list. * *------------------------------------------------------------------------- @@ -153,7 +153,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and get property for + * Changed the way to check parameter and get property for * generic property list. * *------------------------------------------------------------------------- @@ -199,7 +199,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for + * Changed the way to check parameter and set property for * generic property list. * *------------------------------------------------------------------------- @@ -268,7 +268,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for + * Changed the way to check parameter and set property for * generic property list. * *------------------------------------------------------------------------- @@ -289,10 +289,10 @@ H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t dim[]/*out*/) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); if(H5P_get(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout"); - if(H5D_CHUNKED != layout) + HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout"); + if(H5D_CHUNKED != layout) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a chunked storage layout"); - + if(H5P_get(plist, H5D_CRT_CHUNK_DIM_NAME, &ndims) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get chunk dimensionality"); @@ -341,7 +341,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for + * Changed the way to check parameter and set property for * generic property list. * *------------------------------------------------------------------------- @@ -382,7 +382,7 @@ H5Pset_external(hid_t plist_id, const char *name, off_t offset, hsize_t size) HGOTO_ERROR (H5E_EFL, H5E_OVERFLOW, FAIL, "total external data size overflowed"); } /* end for */ } /* end if */ - + /* Add to the list */ if (efl.nused >= efl.nalloc) { @@ -400,7 +400,7 @@ H5Pset_external(hid_t plist_id, const char *name, off_t offset, hsize_t size) efl.slot[idx].offset = offset; efl.slot[idx].size = size; efl.nused++; - + if(H5P_set(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't set external file list"); @@ -425,7 +425,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for + * Changed the way to check parameter and set property for * generic property list. * *------------------------------------------------------------------------- @@ -439,7 +439,7 @@ H5Pget_external_count(hid_t plist_id) FUNC_ENTER_API(H5Pget_external_count, FAIL); H5TRACE1("Is","i",plist_id); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -447,10 +447,10 @@ H5Pget_external_count(hid_t plist_id) /* Get value */ if(H5P_get(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list"); - + /* Set return value */ ret_value=(int)efl.nused; - + done: FUNC_LEAVE_API(ret_value); } @@ -482,7 +482,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and get property for + * Changed the way to check parameter and get property for * generic property list. * *------------------------------------------------------------------------- @@ -497,7 +497,7 @@ H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name/*out* FUNC_ENTER_API(H5Pget_external, FAIL); H5TRACE6("e","iIuzxxx",plist_id,idx,name_size,name,offset,size); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -505,7 +505,7 @@ H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name/*out* /* Get value */ if(H5P_get(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list"); - + if (idx>=efl.nused) HGOTO_ERROR (H5E_ARGS, H5E_BADRANGE, FAIL, "external file index is out of range"); @@ -638,7 +638,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for + * Changed the way to check parameter and set property for * generic property list. * *------------------------------------------------------------------------- @@ -747,7 +747,7 @@ done: * should be a value between zero and N-1 as described for * H5Pget_nfilters() and the function will return failure if the * filter number is out of range. - * + * * Return: Success: Filter identification number. * * Failure: H5Z_FILTER_ERROR (Negative) @@ -759,7 +759,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check paramter and set property for + * Changed the way to check paramter and set property for * generic property list. * * James Laird and Nat Furrer @@ -786,7 +786,7 @@ H5Pget_filter(hid_t plist_id, unsigned idx, unsigned int *flags/*out*/, H5P_genplist_t *plist; /* Property list pointer */ size_t i; /* Local index variable */ H5Z_filter_t ret_value; /* return value */ - + FUNC_ENTER_API(H5Pget_filter, H5Z_FILTER_ERROR); #ifdef H5_WANT_H5_V1_6_COMPAT H5TRACE7("Zf","iIux*zxzx",plist_id,idx,flags,cd_nelmts,cd_values,namelen, @@ -795,7 +795,7 @@ H5Pget_filter(hid_t plist_id, unsigned idx, unsigned int *flags/*out*/, H5TRACE7("Zf","iIux*zxzx",plist_id,idx,flags,cd_nelmts,cd_values,namelen, name); #endif /* H5_WANT_H5_V1_6_COMPAT */ - + /* Check args */ if (cd_nelmts || cd_values) { @@ -884,7 +884,7 @@ done: * field contaning encode/decode flags from H5Zpublic.h. The ID * should be the filter ID to retrieve the parameters for. If the * filter is not set for the property list, an error will be returned. - * + * * Return: Success: Non-negative * Failure: Negative * @@ -915,11 +915,11 @@ H5Pget_filter_by_id(hid_t plist_id, H5Z_filter_t id, unsigned int *flags/*out*/, H5P_genplist_t *plist; /* Property list pointer */ size_t i; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Pget_filter_by_id, FAIL); H5TRACE7("e","iZfx*zxzx",plist_id,id,flags,cd_nelmts,cd_values,namelen, name); - + /* Check args */ if (cd_nelmts || cd_values) { @@ -994,7 +994,7 @@ done: * * Purpose: This is a query routine to verify that all the filters set * in the dataset creation property list are available currently. - * + * * Return: Success: TRUE if all filters available, FALSE if one or * more filters not currently available. * Failure: FAIL on error @@ -1012,10 +1012,10 @@ H5Pall_filters_avail(hid_t plist_id) H5O_pline_t pline; /* Filter pipeline */ H5P_genplist_t *plist; /* Property list pointer */ hbool_t ret_value=TRUE; /* return value */ - + FUNC_ENTER_API(H5Pall_filters_avail, UFAIL); H5TRACE1("t","i",plist_id); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, UFAIL, "can't find object for ID"); @@ -1053,8 +1053,8 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for - * generic property list. + * Changed the way to check parameter and set property for + * generic property list. * *------------------------------------------------------------------------- */ @@ -1064,14 +1064,14 @@ H5Pset_deflate(hid_t plist_id, unsigned level) H5O_pline_t pline; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_deflate, FAIL); H5TRACE2("e","iIu",plist_id,level); /* Check arguments */ if (level>9) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid deflate level"); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -1120,7 +1120,7 @@ H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block) unsigned cd_values[2]; /* Filter parameters */ unsigned int config_flags; herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_szip, FAIL); H5TRACE3("e","iIuIu",plist_id,options_mask,pixels_per_block); @@ -1135,7 +1135,7 @@ H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "pixels_per_block is not even"); if (pixels_per_block>H5_SZIP_MAX_PIXELS_PER_BLOCK) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "pixels_per_block is too large"); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -1171,10 +1171,10 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_shuffle * - * Purpose: Sets the shuffling method for a permanent + * Purpose: Sets the shuffling method for a permanent * filter to H5Z_FILTER_SHUFFLE - * and bytes of the datatype of the array to be shuffled - * + * and bytes of the datatype of the array to be shuffled + * * Return: Non-negative on success/Negative on failure * * Programmer: Kent Yang @@ -1190,14 +1190,14 @@ H5Pset_shuffle(hid_t plist_id) H5O_pline_t pline; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_shuffle, FAIL); H5TRACE1("e","i",plist_id); /* Check arguments */ if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); - + /* Get the plist structure */ if(NULL == (plist = H5I_object(plist_id))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -1226,7 +1226,7 @@ done: * Wednesday, December 22, 2004 * * Modifications: - * + * * *------------------------------------------------------------------------- */ @@ -1267,28 +1267,28 @@ done: * Purpose: Sets scaleoffset filter for a dataset creation property list * and user-supplied parameters * - * Parameters: scale_factor: - for integer datatype, - this parameter will be - minimum-bits, if this value is set to 0, + * Parameters: scale_factor: + for integer datatype, + this parameter will be + minimum-bits, if this value is set to 0, scaleoffset filter will calculate the minimum-bits. - + For floating-point datatype, - For variable-minimum-bits method, this will be + For variable-minimum-bits method, this will be the decimal precision of the filter, - For fixed-minimum-bits method, this will be + For fixed-minimum-bits method, this will be the minimum-bit of the filter. scale_type: 0 for floating-point variable-minimum-bits, 1 for floating-point fixed-minimum-bits, other values, for integer datatype - + * Return: Non-negative on success/Negative on failure * * Programmer: Xiaowen Wu * Thursday, April 14, 2005 * * Modifications: - * + * * *------------------------------------------------------------------------- */ @@ -1311,13 +1311,13 @@ H5Pset_scaleoffset(hid_t plist_id, int scale_factor, unsigned scale_type) if(NULL == (plist = H5I_object(plist_id))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); - /* Set parameters for the filter + /* Set parameters for the filter * scale_type = 0: floating-point type, filter uses variable-minimum-bits method, * scale_factor is decimal scale factor * scale_type = 1: floating-point type, filter uses fixed-minimum-bits method, * scale_factor is the fixed minimum number of bits * scale type = other: integer type, scale_factor is minimum number of bits - * if scale_factor = 0, then filter calculates minimum number of bits + * if scale_factor = 0, then filter calculates minimum number of bits */ cd_values[0] = scale_factor; cd_values[1] = scale_type; @@ -1338,7 +1338,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_fletcher32 * - * Purpose: Sets Fletcher32 checksum of EDC for a dataset creation + * Purpose: Sets Fletcher32 checksum of EDC for a dataset creation * property list. * * Return: Non-negative on success/Negative on failure @@ -1356,10 +1356,10 @@ H5Pset_fletcher32(hid_t plist_id) H5O_pline_t pline; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_fletcher32, FAIL); H5TRACE1("e","i",plist_id); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -1384,7 +1384,7 @@ done: * VALUE is interpretted as being of type TYPE, which need not * be the same type as the dataset but the library must be able * to convert VALUE to the dataset type when the dataset is - * created. If VALUE is NULL, it will be interpreted as + * created. If VALUE is NULL, it will be interpreted as * undefining fill value. * * Return: Non-negative on success/Negative on failure @@ -1396,8 +1396,8 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for - * generic property list. + * Changed the way to check parameter and set property for + * generic property list. * *------------------------------------------------------------------------- */ @@ -1408,7 +1408,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) H5T_t *type = NULL; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_fill_value, FAIL); H5TRACE3("e","iix",plist_id,type_id,value); @@ -1442,7 +1442,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) if(H5P_set(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set fill value"); - + done: FUNC_LEAVE_API(ret_value); } @@ -1466,7 +1466,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and get property for + * Changed the way to check parameter and get property for * generic property list. * *------------------------------------------------------------------------- @@ -1482,7 +1482,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) hid_t src_id = -1; /*source data type id */ herr_t ret_value=SUCCEED; /* Return value */ H5P_genplist_t *plist; /* Property list pointer */ - + FUNC_ENTER_API(H5Pget_fill_value, FAIL); H5TRACE3("e","iix",plist_id,type_id,value); @@ -1491,7 +1491,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); if (!value) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,"no fill value output buffer"); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -1503,14 +1503,14 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) * is undefined, also return error. */ if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value"); + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value"); if(fill.size == (size_t)-1) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "fill value is undefined"); if(fill.size == 0) { HDmemset(value, 0, H5T_get_size(type)); HGOTO_DONE(SUCCEED); - } + } /* * Can we convert between the source and destination data types? */ @@ -1525,7 +1525,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) * other than the fill value buffer that is large enough for both source * and destination. The app-supplied buffer might do okay. */ - if (H5T_get_size(type)>=H5T_get_size(fill.type)) { + if (H5T_get_size(type)>=H5T_get_size(fill.type)) { buf = value; if (H5T_path_bkg(tpath) && NULL==(bkg=H5MM_malloc(H5T_get_size(type)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion"); @@ -1536,7 +1536,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) bkg = value; } HDmemcpy(buf, fill.buf, H5T_get_size(fill.type)); - + /* Do the conversion */ if (H5T_convert(tpath, src_id, type_id, 1, 0, 0, buf, bkg, H5AC_dxpl_id)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed"); @@ -1558,7 +1558,7 @@ done: * Function: H5P_is_fill_value_defined * * Purpose: Check if fill value is defined. Internal version of function - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu @@ -1590,7 +1590,7 @@ H5P_is_fill_value_defined(const struct H5O_fill_t *fill, H5D_fill_value_t *statu *status = H5D_FILL_VALUE_USER_DEFINED; else { *status = H5D_FILL_VALUE_ERROR; - HGOTO_ERROR(H5E_PLIST, H5E_BADRANGE, FAIL, "invalid combination of fill-value info"); + HGOTO_ERROR(H5E_PLIST, H5E_BADRANGE, FAIL, "invalid combination of fill-value info"); } done: @@ -1602,14 +1602,14 @@ done: * Function: H5Pfill_value_defined * * Purpose: Check if fill value is defined. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Wednesday, January 16, 2002 * * Modifications: - * + * * *------------------------------------------------------------------------- */ @@ -1631,11 +1631,11 @@ H5Pfill_value_defined(hid_t plist_id, H5D_fill_value_t *status) /* Get the fill value struct */ if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value"); + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value"); /* Get the fill-value status */ if(H5P_is_fill_value_defined(&fill, status) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't check fill value status"); + HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't check fill value status"); done: FUNC_LEAVE_API(ret_value); @@ -1648,14 +1648,14 @@ done: * Purpose: Set space allocation time for dataset during creation. * Valid values are H5D_ALLOC_TIME_DEFAULT, H5D_ALLOC_TIME_EARLY, * H5D_ALLOC_TIME_LATE, H5D_ALLOC_TIME_INCR - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Wednesday, January 16, 2002 * * Modifications: - * + * * *------------------------------------------------------------------------- */ @@ -1676,7 +1676,7 @@ H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time) /* Check for resetting to default for layout type */ if(alloc_time==H5D_ALLOC_TIME_DEFAULT) { H5D_layout_t layout; /* Type of storage layout */ - + /* Retrieve the storage layout */ if(H5P_get(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get layout"); @@ -1713,7 +1713,7 @@ H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set space allocation time"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value); } @@ -1723,14 +1723,14 @@ done: * Purpose: Get space allocation time for dataset creation. * Valid values are H5D_ALLOC_TIME_DEFAULT, H5D_ALLOC_TIME_EARLY, * H5D_ALLOC_TIME_LATE, H5D_ALLOC_TIME_INCR - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Wednesday, January 16, 2002 * * Modifications: - * + * * *------------------------------------------------------------------------- */ @@ -1838,8 +1838,8 @@ done: * Function: H5Premove_filter * * Purpose: Deletes a filter from the dataset creation property list; - * deletes all filters if FILTER is H5Z_FILTER_NONE - * + * deletes all filters if FILTER is H5Z_FILTER_NONE + * * Return: Non-negative on success/Negative on failure * * Programmer: Pedro Vicente diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 3515c55..a9642ef 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -30,15 +30,15 @@ * Function: H5Pset_data_transform * * Purpose: - * Sets data transform expression. + * Sets data transform expression. + * + * + * Return: Returns a non-negative value if successful; otherwise returns a negative value. + * * - * - * Return: Returns a non-negative value if successful; otherwise returns a negative value. - * - * * Programmer: Leon Arber * Monday, March 07, 2004 - * + * * Modifications: * *------------------------------------------------------------------------- @@ -50,7 +50,7 @@ herr_t H5Pset_data_transform(hid_t plist_id, const char* expression) herr_t ret_value=SUCCEED; /* return value */ FUNC_ENTER_API(H5Pset_data_transform, FAIL); - + /* Check arguments */ if (expression == NULL) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "expression cannot be NULL"); @@ -82,10 +82,10 @@ done: * Function: H5Pget_data_transform * * Purpose: - * Gets data transform expression. - * - * Return: Returns a non-negative value if successful; otherwise returns a negative value. - * + * Gets data transform expression. + * + * Return: Returns a non-negative value if successful; otherwise returns a negative value. + * * Comments: * If `expression' is non-NULL then write up to `size' bytes into that * buffer and always return the length of the transform name. @@ -95,10 +95,10 @@ done: * is unchanged and the function returns a negative value. * If a zero is returned for the name's length, then there is no name * associated with the ID. - * + * * Programmer: Leon Arber * August 27, 2004 - * + * * Modifications: * October 20, 2004 LA: Changed API to use size and return ssize_t *------------------------------------------------------------------------- @@ -123,13 +123,13 @@ ssize_t H5Pget_data_transform(hid_t plist_id, char* expression /*out*/, size_t s if(NULL == data_xform_prop) HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Cannot get a data transform that has not been set"); - + /* Get the data transform string */ - pexp = H5Z_xform_extract_xform_str(data_xform_prop); + pexp = H5Z_xform_extract_xform_str(data_xform_prop); if(!pexp) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Failed to retrieve transform expression"); - + len = HDstrlen(pexp); if(expression) { @@ -137,9 +137,9 @@ ssize_t H5Pget_data_transform(hid_t plist_id, char* expression /*out*/, size_t s if(len >= size) expression[size-1]='\0'; } - + ret_value = (ssize_t)len; - + done: if(ret_value<0) { if(data_xform_prop) @@ -278,7 +278,7 @@ H5Pset_preserve(hid_t plist_id, hbool_t status) H5T_bkg_t need_bkg; /* Value for background buffer type */ H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_preserve, FAIL); H5TRACE2("e","ib",plist_id,status); @@ -318,7 +318,7 @@ H5Pget_preserve(hid_t plist_id) H5T_bkg_t need_bkg; /* Background value */ H5P_genplist_t *plist; /* Property list pointer */ int ret_value; /* return value */ - + FUNC_ENTER_API(H5Pget_preserve, FAIL); H5TRACE1("Is","i",plist_id); @@ -341,9 +341,9 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_edc_check * - * Purpose: Enable or disable error-detecting for a dataset reading - * process. This error-detecting algorithm is whichever - * user chooses earlier. This function cannot control + * Purpose: Enable or disable error-detecting for a dataset reading + * process. This error-detecting algorithm is whichever + * user chooses earlier. This function cannot control * writing process. * * Return: Non-negative on success/Negative on failure @@ -360,14 +360,14 @@ H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_edc_check, FAIL); H5TRACE2("e","iZe",plist_id,check); /* Check argument */ if (check != H5Z_ENABLE_EDC && check != H5Z_DISABLE_EDC) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid value"); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -375,7 +375,7 @@ H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check) /* Update property list */ if (H5P_set(plist,H5D_XFER_EDC_NAME,&check)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value"); - + done: FUNC_LEAVE_API(ret_value); } @@ -384,9 +384,9 @@ done: /*------------------------------------------------------------------------- * Function: H5Pget_edc_check * - * Purpose: Enable or disable error-detecting for a dataset reading - * process. This error-detecting algorithm is whichever - * user chooses earlier. This function cannot control + * Purpose: Enable or disable error-detecting for a dataset reading + * process. This error-detecting algorithm is whichever + * user chooses earlier. This function cannot control * writing process. * * Return: Non-negative on success/Negative on failure @@ -403,7 +403,7 @@ H5Pget_edc_check(hid_t plist_id) { H5P_genplist_t *plist; /* Property list pointer */ H5Z_EDC_t ret_value; /* return value */ - + FUNC_ENTER_API(H5Pget_edc_check, H5Z_ERROR_EDC); H5TRACE1("Ze","i",plist_id); @@ -422,7 +422,7 @@ H5Pget_edc_check(hid_t plist_id) done: FUNC_LEAVE_API(ret_value); } - + /*------------------------------------------------------------------------- * Function: H5Pset_filter_callback @@ -446,7 +446,7 @@ H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, void *op_data) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ H5Z_cb_t cb_struct; - + FUNC_ENTER_API(H5Pset_filter_callback, FAIL); H5TRACE3("e","ixx",plist_id,func,op_data); @@ -457,7 +457,7 @@ H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, void *op_data) /* Update property list */ cb_struct.func = func; cb_struct.op_data = op_data; - + if (H5P_set(plist,H5D_XFER_FILTER_CB_NAME,&cb_struct)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value"); @@ -488,7 +488,7 @@ H5Pset_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t op, void *operate_dat H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ H5T_conv_cb_t cb_struct; - + FUNC_ENTER_API(H5Pset_type_conv_cb, FAIL); H5TRACE3("e","ixx",plist_id,op,operate_data); @@ -499,7 +499,7 @@ H5Pset_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t op, void *operate_dat /* Update property list */ cb_struct.func = op; cb_struct.user_data = operate_data; - + if (H5P_set(plist,H5D_XFER_CONV_CB_NAME,&cb_struct)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value"); @@ -530,7 +530,7 @@ H5Pget_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t *op, void **operate_d H5P_genplist_t *plist; /* Property list pointer */ H5T_conv_cb_t cb_struct; herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pget_type_conv_cb, FAIL); H5TRACE3("e","i*xx",plist_id,op,operate_data); @@ -637,7 +637,7 @@ H5Pset_btree_ratios(hid_t plist_id, double left, double middle, if (left<0.0 || left>1.0 || middle<0.0 || middle>1.0 || right<0.0 || right>1.0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "split ratio must satisfy 0.0<=X<=1.0"); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 9868627..0a9e29e 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -62,7 +62,7 @@ static herr_t H5P_get_multi_type(H5P_genplist_t *plist, H5FD_mem_t *type); * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed file access property list mechanism to the new + * Changed file access property list mechanism to the new * generic property list. *------------------------------------------------------------------------- */ @@ -71,7 +71,7 @@ H5Pset_alignment(hid_t fapl_id, hsize_t threshold, hsize_t alignment) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_alignment, FAIL); H5TRACE3("e","ihh",fapl_id,threshold,alignment); @@ -108,9 +108,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list design to the new generic + * Changed the file access list design to the new generic * property list. * *------------------------------------------------------------------------- @@ -164,7 +164,7 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list design to the new generic + * Changed the file access list design to the new generic * property list. * *------------------------------------------------------------------------- @@ -175,7 +175,7 @@ H5P_set_driver(H5P_genplist_t *plist, hid_t new_driver_id, const void *new_drive hid_t driver_id; /* VFL driver ID */ void *driver_info; /* VFL driver info */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5P_set_driver, FAIL); if (NULL==H5I_object_verify(new_driver_id, H5I_VFL)) @@ -240,7 +240,7 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list design to the new generic + * Changed the file access list design to the new generic * property list. * *------------------------------------------------------------------------- @@ -250,7 +250,7 @@ H5Pset_driver(hid_t plist_id, hid_t new_driver_id, const void *new_driver_info) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Pset_driver, FAIL); H5TRACE3("e","iix",plist_id,new_driver_id,new_driver_info); @@ -290,15 +290,15 @@ done: * Rewritten to use the virtual file layer. * * Robb Matzke, 1999-08-05 - * If the driver ID is H5FD_VFD_DEFAULT then substitute the + * If the driver ID is H5FD_VFD_DEFAULT then substitute the * current value of H5FD_SEC2. * * Quincey Koziol 2000-11-28 * Added internal function.. * * Raymond Lu, 2001-10-23 - * Changed the file access list design to the new generic - * property list. + * Changed the file access list design to the new generic + * property list. * *------------------------------------------------------------------------- */ @@ -396,9 +396,9 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list design to the new generic + * Changed the file access list design to the new generic * property list. - * + * *------------------------------------------------------------------------- */ void * @@ -418,7 +418,7 @@ H5P_get_driver_info(H5P_genplist_t *plist) } else { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access or data transfer property list"); } - + done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5P_get_driver_info() */ @@ -445,9 +445,9 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list design to the new generic + * Changed the file access list design to the new generic * property list. - * + * *------------------------------------------------------------------------- */ void * @@ -463,7 +463,7 @@ H5Pget_driver_info(hid_t plist_id) if((ret_value=H5P_get_driver_info(plist))==NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTGET,NULL,"can't get driver info"); - + done: FUNC_LEAVE_API(ret_value); } /* end H5Pget_driver_info() */ @@ -471,20 +471,20 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_family_offset - * + * * Purpose: Set offset for family driver. This file access property * list will be passed to H5Fget_vfd_handle or H5FDget_vfd_handle * to retrieve VFD file handle. - * - * Return: Success: Non-negative value. - * - * Failure: Negative value. - * - * Programmer: Raymond Lu - * Sep 17, 2002 - * + * + * Return: Success: Non-negative value. + * + * Failure: Negative value. + * + * Programmer: Raymond Lu + * Sep 17, 2002 + * * Modifications: - * + * *------------------------------------------------------------------------- */ herr_t @@ -504,7 +504,7 @@ H5Pset_family_offset(hid_t fapl_id, hsize_t offset) /* Set values */ if((ret_value=H5P_set_family_offset(plist, offset)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set family offset"); - + done: FUNC_LEAVE_API(ret_value); } @@ -512,19 +512,19 @@ done: /*------------------------------------------------------------------------- * Function: H5P_set_family_offset - * - * Purpose: Set offset for family driver. Private function for + * + * Purpose: Set offset for family driver. Private function for * H5Pset_family_offset - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu + * + * Programmer: Raymond Lu * Sep 17, 2002 - * + * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -544,24 +544,24 @@ H5P_set_family_offset(H5P_genplist_t *plist, hsize_t offset) done: FUNC_LEAVE_NOAPI(ret_value); } - + /*------------------------------------------------------------------------- * Function: H5Pget_family_offset - * + * * Purpose: Get offset for family driver. This file access property * list will be passed to H5Fget_vfd_handle or H5FDget_vfd_handle * to retrieve VFD file handle. - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu - * Sep 17, 2002 - * + * + * Programmer: Raymond Lu + * Sep 17, 2002 + * * Modifications: - * + * *------------------------------------------------------------------------- */ herr_t @@ -569,10 +569,10 @@ H5Pget_family_offset(hid_t fapl_id, hsize_t *offset) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pget_family_offset, FAIL); H5TRACE2("e","i*h",fapl_id,offset); - + /* Get the plist structure */ if(H5P_DEFAULT == fapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list"); @@ -581,64 +581,64 @@ H5Pget_family_offset(hid_t fapl_id, hsize_t *offset) /* Set values */ if((ret_value=H5P_get_family_offset(plist, offset)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get family offset"); - -done: + +done: FUNC_LEAVE_API(ret_value); -} +} /*------------------------------------------------------------------------- * Function: H5P_get_family_offset - * + * * Purpose: Get offset for family driver. Private function for * H5Pget_family_offset - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu - * Sep 17, 2002 - * + * + * Programmer: Raymond Lu + * Sep 17, 2002 + * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t H5P_get_family_offset(H5P_genplist_t *plist, hsize_t *offset) { herr_t ret_value=SUCCEED; - + FUNC_ENTER_NOAPI(H5P_get_family_offset, FAIL); - + if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) { if(H5P_get(plist, H5F_ACS_FAMILY_OFFSET_NAME, offset) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't set offset for family file"); - } else { + } else { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access or data transfer property list"); - } - + } + done: FUNC_LEAVE_NOAPI(ret_value); } - + /*------------------------------------------------------------------------- * Function: H5Pset_multi_type - * + * * Purpose: Set data type for multi driver. This file access property * list will be passed to H5Fget_vfd_handle or H5FDget_vfd_handle * to retrieve VFD file handle. - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu + * + * Programmer: Raymond Lu * Sep 17, 2002 - * + * * Modifications: - * + * *------------------------------------------------------------------------- */ herr_t @@ -658,7 +658,7 @@ H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type) /* Set values */ if((ret_value=H5P_set_multi_type(plist, type)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set data type for multi driver"); - + done: FUNC_LEAVE_API(ret_value); } @@ -666,19 +666,19 @@ done: /*------------------------------------------------------------------------- * Function: H5P_set_multi_type - * + * * Purpose: Set data type for multi file driver. Private function for * H5Pset_multi_type. - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu + * + * Programmer: Raymond Lu * Sep 17, 2002 - * + * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -697,25 +697,25 @@ H5P_set_multi_type(H5P_genplist_t *plist, H5FD_mem_t type) done: FUNC_LEAVE_NOAPI(ret_value); -} +} /*------------------------------------------------------------------------- * Function: H5Pget_multi_type - * + * * Purpose: Get data type for multi driver. This file access property * list will be passed to H5Fget_vfd_handle or H5FDget_vfd_handle * to retrieve VFD file handle. - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu - * Sep 17, 2002 - * + * + * Programmer: Raymond Lu + * Sep 17, 2002 + * * Modifications: - * + * *------------------------------------------------------------------------- */ herr_t @@ -723,10 +723,10 @@ H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pget_multi_type, FAIL); H5TRACE2("e","i*Mt",fapl_id,type); - + /* Get the plist structure */ if(H5P_DEFAULT == fapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list"); @@ -735,46 +735,46 @@ H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type) /* Set values */ if((ret_value=H5P_get_multi_type(plist, type)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get data type for multi driver"); - -done: - FUNC_LEAVE_API(ret_value); -} + +done: + FUNC_LEAVE_API(ret_value); +} /*------------------------------------------------------------------------- * Function: H5P_get_multi_type - * + * * Purpose: Get data type for multi file driver. Private function for * H5Pget_multi_type. - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu - * Sep 17, 2002 - * + * + * Programmer: Raymond Lu + * Sep 17, 2002 + * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t H5P_get_multi_type(H5P_genplist_t *plist, H5FD_mem_t *type) { herr_t ret_value=SUCCEED; - + FUNC_ENTER_NOAPI(H5P_get_multi_type, FAIL); - + if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) { - if(H5P_get(plist, H5F_ACS_MULTI_TYPE_NAME, type) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't get type for multi driver"); - } else { - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); - } - + if(H5P_get(plist, H5F_ACS_MULTI_TYPE_NAME, type) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't get type for multi driver"); + } else { + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); + } + done: FUNC_LEAVE_NOAPI(ret_value); -} +} /*------------------------------------------------------------------------- @@ -799,7 +799,7 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 * Changed the file access list to the new generic property list. * @@ -807,7 +807,7 @@ done: * Thurs. 3/17/05 * The mdc_nelmts entry is no more in the FAPL, so I modified * the code to ignore it. - * + * *------------------------------------------------------------------------- */ herr_t @@ -816,7 +816,7 @@ H5Pset_cache(hid_t plist_id, int UNUSED mdc_nelmts, { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_cache, FAIL); H5TRACE5("e","iIszzd",plist_id,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0); @@ -859,14 +859,14 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * 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 @@ -875,7 +875,7 @@ H5Pget_cache(hid_t plist_id, int *mdc_nelmts, { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pget_cache, FAIL); H5TRACE5("e","i*Is*z*z*d",plist_id,mdc_nelmts,rdcc_nelmts,rdcc_nbytes, rdcc_w0); @@ -908,7 +908,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_mdc_config * - * Purpose: Set the initial metadata cache resize configuration in the + * Purpose: Set the initial metadata cache resize configuration in the * target FAPL. * * Return: Non-negative on success/Negative on failure @@ -919,16 +919,16 @@ done: * Modifications: * * Done. - * + * *------------------------------------------------------------------------- */ herr_t -H5Pset_mdc_config(hid_t plist_id, +H5Pset_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_mdc_config, FAIL); H5TRACE2("e","ix",plist_id,config_ptr); @@ -947,7 +947,7 @@ H5Pset_mdc_config(hid_t plist_id, /* set the modified config */ - /* If we ever support multiple versions of H5AC_cache_config_t, we + /* If we ever support multiple versions of H5AC_cache_config_t, we * will have to test the version and do translation here. */ @@ -956,7 +956,7 @@ H5Pset_mdc_config(hid_t plist_id, HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, \ "can't set metadata cache initial config"); } - + done: FUNC_LEAVE_API(ret_value); @@ -982,17 +982,17 @@ done: * Modifications: * * None. - * + * *------------------------------------------------------------------------- */ herr_t -H5Pget_mdc_config(hid_t plist_id, +H5Pget_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pget_mdc_config, FAIL); H5TRACE2("e","ix",plist_id,config_ptr); @@ -1056,11 +1056,11 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -1100,9 +1100,9 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -1135,8 +1135,8 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * November, 2001 + * Programmer: Raymond Lu + * November, 2001 * * Modifications: * @@ -1167,12 +1167,12 @@ done: /*------------------------------------------------------------------------- * Function: H5Pget_fclose_degree * - * Purpose: Returns the degree for the file close behavior. + * Purpose: Returns the degree for the file close behavior. * * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * November, 2001 + * Programmer: Raymond Lu + * November, 2001 * * Modifications: * @@ -1189,12 +1189,12 @@ herr_t H5Pget_fclose_degree(hid_t plist_id, H5F_close_degree_t *degree) if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); - if( degree && (H5P_get(plist, H5F_CLOSE_DEGREE_NAME, degree) < 0) ) + if( degree && (H5P_get(plist, H5F_CLOSE_DEGREE_NAME, degree) < 0) ) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file close degree"); done: FUNC_LEAVE_API(ret_value); -} +} /*------------------------------------------------------------------------- @@ -1205,7 +1205,7 @@ done: * Each "raw" metadata block is allocated to be this size and then * specific pieces of metadata (object headers, local heaps, B-trees, etc) * are sub-allocated from this block. - * + * * The default value is set to 2048 (bytes), indicating that metadata * will be attempted to be bunched together in (at least) 2K blocks in * the file. Setting the value to 0 with this API function will @@ -1221,8 +1221,8 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -1261,9 +1261,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -1301,7 +1301,7 @@ done: * buffer which is large anough to hold several pieces of the dataset * being read in for hyperslab selections boosts performance by quite a * bit. - * + * * The default value is set to 64KB, indicating that file I/O for raw data * reads and writes will occur in at least 64KB blocks. * Setting the value to 0 with this API function will turn off the @@ -1314,9 +1314,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -1326,7 +1326,7 @@ H5Pset_sieve_buf_size(hid_t plist_id, size_t size) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_sieve_buf_size, FAIL); H5TRACE2("e","iz",plist_id,size); @@ -1356,9 +1356,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -1394,7 +1394,7 @@ done: * Each "small" raw data block is allocated to be this size and then * pieces of raw data which are small enough to fit are sub-allocated from * this block. - * + * * The default value is set to 2048 (bytes), indicating that raw data * smaller than this value will be attempted to be bunched together in (at * least) 2K blocks in the file. Setting the value to 0 with this API diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c index 04f5d1d..48ae10d 100644 --- a/src/H5Pfcpl.c +++ b/src/H5Pfcpl.c @@ -53,7 +53,7 @@ * * Raymond Lu, Oct 14, 2001 * Change to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -104,7 +104,7 @@ done: * * Raymond Lu, Oct 14, 2001 * Changed to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -157,7 +157,7 @@ done: * * Raymond Lu, Oct 14, 2001 * Changed to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -308,7 +308,7 @@ done: * Modifications: * * Raymond Lu, Oct 14, 2001 - * Changed to the new generic property list. + * Changed to the new generic property list. * *------------------------------------------------------------------------- */ @@ -325,7 +325,7 @@ H5Pset_sym_k(hid_t plist_id, unsigned ik, unsigned lk) /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); - + /* Set values */ if (ik > 0) { if(H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0) @@ -360,7 +360,7 @@ done: * * Raymond Lu * Changed to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -408,7 +408,7 @@ done: * * Raymond Lu, Oct 14, 2001 * Changed to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -459,7 +459,7 @@ done: * * Raymond Lu, Oct 14, 2001 * Changed to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index e0f7da7..14a477d 100755 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -26,15 +26,15 @@ /*------------------------------------------------------------------------- - * Function: H5Pset_create_intermediate_group + * Function: H5Pset_create_intermediate_group * * Purpose: set crt_intmd_group so that H5Gcreate(), H5Dcreate, etc. * will create missing groups along the given path "name" * * Return: Non-negative on success/Negative on failure * - * Programmer: Peter Cao - * May 08, 2005 + * Programmer: Peter Cao + * May 08, 2005 *------------------------------------------------------------------------- */ herr_t @@ -60,15 +60,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_create_intermediate_group + * Function: H5Pget_create_intermediate_group * - * Purpose: Returns the crt_intmd_group, which is set at H5Gcreate(hid_t loc_id, + * Purpose: Returns the crt_intmd_group, which is set at H5Gcreate(hid_t loc_id, * const char* name, ... ) for create missing groups * * Return: Non-negative on success/Negative on failure * - * Programmer: Peter Cao - * May 08, 2005 + * Programmer: Peter Cao + * May 08, 2005 *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index 0d09b96..12b3e93 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -40,7 +40,7 @@ H5_DLL herr_t H5P_get(H5P_genplist_t *plist, const char *name, void *value); H5_DLL herr_t H5P_set(H5P_genplist_t *plist, const char *name, const void *value); H5_DLL herr_t H5P_insert(H5P_genplist_t *plist, const char *name, size_t size, void *value, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, - H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, + H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close); H5_DLL herr_t H5P_remove(hid_t plist_id, H5P_genplist_t *plist, const char *name); H5_DLL htri_t H5P_exist_plist(H5P_genplist_t *plist, const char *name); diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 49d8288..0a37721 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -47,7 +47,7 @@ extern "C" { /* Define property list class callback function pointer types */ typedef herr_t (*H5P_cls_create_func_t)(hid_t prop_id, void *create_data); -typedef herr_t (*H5P_cls_copy_func_t)(hid_t new_prop_id, hid_t old_prop_id, +typedef herr_t (*H5P_cls_copy_func_t)(hid_t new_prop_id, hid_t old_prop_id, void *copy_data); typedef herr_t (*H5P_cls_close_func_t)(hid_t prop_id, void *close_data); @@ -63,7 +63,7 @@ typedef int (*H5P_prp_compare_func_t)(const void *value1, const void *value2, si typedef H5P_prp_cb1_t H5P_prp_close_func_t; /* Define property list iteration function type */ -typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); +typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); /* * The library created property list classes @@ -134,7 +134,7 @@ H5_DLLVAR hid_t H5P_LST_DATATYPE_CREATE_g; H5_DLLVAR hid_t H5P_LST_DATATYPE_ACCESS_g; /* Public functions */ -H5_DLL hid_t H5Pcreate_class(hid_t parent, const char *name, +H5_DLL hid_t H5Pcreate_class(hid_t parent, const char *name, H5P_cls_create_func_t cls_create, void *create_data, H5P_cls_copy_func_t cls_copy, void *copy_data, H5P_cls_close_func_t cls_close, void *close_data); @@ -144,7 +144,7 @@ H5_DLL hid_t H5Pcreate(hid_t cls_id); H5_DLL herr_t H5Pregister(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, - H5P_prp_delete_func_t prp_del, + H5P_prp_delete_func_t prp_del, H5P_prp_copy_func_t prp_copy, H5P_prp_close_func_t prp_close); H5_DLL herr_t H5Pinsert(hid_t plist_id, const char *name, size_t size, @@ -156,7 +156,7 @@ H5_DLL herr_t H5Pinsert(hid_t plist_id, const char *name, size_t size, H5_DLL herr_t H5Pregister(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, - H5P_prp_delete_func_t prp_del, + H5P_prp_delete_func_t prp_del, H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close); @@ -272,10 +272,10 @@ H5_DLL herr_t H5Pset_scaleoffset(hid_t plist_id, int scale_factor, unsigned scal H5_DLL herr_t H5Pset_fletcher32(hid_t plist_id); H5_DLL herr_t H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check); H5_DLL H5Z_EDC_t H5Pget_edc_check(hid_t plist_id); -H5_DLL herr_t H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, +H5_DLL herr_t H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, void* op_data); H5_DLL herr_t H5Pset_cache(hid_t plist_id, int mdc_nelmts, - size_t rdcc_nelmts, size_t rdcc_nbytes, + size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0); H5_DLL herr_t H5Pget_cache(hid_t plist_id, int *mdc_nelmts, /* out */ @@ -295,12 +295,12 @@ H5_DLL herr_t H5Pset_fill_value(hid_t plist_id, hid_t type_id, H5_DLL herr_t H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/); H5_DLL herr_t H5Pfill_value_defined(hid_t plist, H5D_fill_value_t *status); -H5_DLL herr_t H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t +H5_DLL herr_t H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time); -H5_DLL herr_t H5Pget_alloc_time(hid_t plist_id, H5D_alloc_time_t +H5_DLL herr_t H5Pget_alloc_time(hid_t plist_id, H5D_alloc_time_t *alloc_time/*out*/); H5_DLL herr_t H5Pset_fill_time(hid_t plist_id, H5D_fill_time_t fill_time); -H5_DLL herr_t H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t +H5_DLL herr_t H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t *fill_time/*out*/); H5_DLL herr_t H5Pset_gc_references(hid_t fapl_id, unsigned gc_ref); H5_DLL herr_t H5Pget_gc_references(hid_t fapl_id, unsigned *gc_ref/*out*/); @@ -43,7 +43,7 @@ NAME H5R_init_interface -- Initialize interface-specific information USAGE herr_t H5R_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -90,7 +90,7 @@ H5R_term_interface(void) int n=0; FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5R_term_interface); - + if (H5_interface_initialize_g) { if ((n=H5I_nmembers(H5I_REFERENCE))) { H5I_clear_type(H5I_REFERENCE, FALSE); @@ -100,7 +100,7 @@ H5R_term_interface(void) n = 1; /*H5I*/ } } - + FUNC_LEAVE_NOAPI(n); } @@ -119,7 +119,7 @@ H5R_term_interface(void) H5R_type_t ref_type; IN: Type of reference to create H5S_t *space; IN: Dataspace ID with selection, used for Dataset Region references. - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -177,7 +177,7 @@ H5R_create(void *_ref, H5G_entry_t *loc, const char *name, H5R_type_t ref_type, heapid_found=1; break; } /* end if */ - + if(heapid_found!=0) { /* Return heap block to free list */ } /* end if */ @@ -250,7 +250,7 @@ done: H5R_type_t ref_type; IN: Type of reference to create hid_t space_id; IN: Dataspace ID with selection, used for Dataset Region references. - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -306,7 +306,7 @@ done: H5F_t *file; IN: File the object being dereferenced is within H5R_type_t ref_type; IN: Type of reference void *ref; IN: Reference to open. - + RETURNS Valid ID on success, Negative on failure DESCRIPTION @@ -444,7 +444,7 @@ done: object that the dataset is located within. H5R_type_t ref_type; IN: Type of reference to create void *ref; IN: Reference to open. - + RETURNS Valid ID on success, Negative on failure DESCRIPTION @@ -495,7 +495,7 @@ done: H5F_t *file; IN: File the object being dereferenced is within H5R_type_t ref_type; UNUSED void *ref; IN: Reference to open. - + RETURNS Pointer to the dataspace on success, NULL on failure DESCRIPTION @@ -568,7 +568,7 @@ done: object that the dataset is located within. H5R_type_t ref_type; IN: Type of reference to get region of void *ref; IN: Reference to open. - + RETURNS Valid ID on success, Negative on failure DESCRIPTION @@ -625,7 +625,7 @@ done: H5F_t *file; IN: File the object being dereferenced is within H5R_type_t ref_type; IN: Type of reference to query void *ref; IN: Reference to query. - + RETURNS Success: An object type defined in H5Gpublic.h Failure: H5G_UNKNOWN @@ -721,7 +721,7 @@ done: object that the dataset is located within. H5R_type_t ref_type; IN: Type of reference to query void *ref; IN: Reference to query. - + RETURNS Success: An object type defined in H5Gpublic.h Failure: H5G_UNKNOWN @@ -757,7 +757,7 @@ H5Rget_obj_type(hid_t id, H5R_type_t ref_type, void *_ref) /* Get the object information */ if ((ret_value=H5R_get_obj_type(file,H5AC_ind_dxpl_id,ref_type,_ref))<0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5G_UNKNOWN, "unable to determine object type"); - + done: FUNC_LEAVE_API(ret_value); } /* end H5Rget_obj_type() */ @@ -72,7 +72,7 @@ NAME H5S_init_interface -- Initialize interface-specific information USAGE herr_t H5S_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -182,8 +182,8 @@ H5S_term_interface(void) "%10s\n", "gather", path->stats[j].gath_nbytes, path->stats[j].gath_ncalls, - path->stats[j].gath_timer.utime, - path->stats[j].gath_timer.stime, + path->stats[j].gath_timer.utime, + path->stats[j].gath_timer.stime, path->stats[j].gath_timer.etime, buf); } @@ -198,8 +198,8 @@ H5S_term_interface(void) "%10s\n", "scatter", path->stats[j].scat_nbytes, path->stats[j].scat_ncalls, - path->stats[j].scat_timer.utime, - path->stats[j].scat_timer.stime, + path->stats[j].scat_timer.utime, + path->stats[j].scat_timer.stime, path->stats[j].scat_timer.etime, buf); } @@ -214,8 +214,8 @@ H5S_term_interface(void) "%10s\n", "background", path->stats[j].bkg_nbytes, path->stats[j].bkg_ncalls, - path->stats[j].bkg_timer.utime, - path->stats[j].bkg_timer.stime, + path->stats[j].bkg_timer.utime, + path->stats[j].bkg_timer.stime, path->stats[j].bkg_timer.etime, buf); } @@ -235,7 +235,7 @@ H5S_term_interface(void) path->stats[j].read_timer.etime, buf); } - + /* Write */ if (path->stats[j].write_ncalls) { H5_bandwidth(buf, @@ -272,7 +272,7 @@ H5S_term_interface(void) n = 1; /*H5I*/ } } - + FUNC_LEAVE_NOAPI(n); } @@ -514,7 +514,7 @@ H5Scopy(hid_t space_id) H5S_t *src = NULL; H5S_t *dst = NULL; hid_t ret_value; - + FUNC_ENTER_API(H5Scopy, FAIL); H5TRACE1("i","i",space_id); @@ -560,7 +560,7 @@ H5Sextent_copy(hid_t dst_id,hid_t src_id) H5S_t *src = NULL; H5S_t *dst = NULL; hid_t ret_value = SUCCEED; - + FUNC_ENTER_API(H5Sextent_copy, FAIL); H5TRACE2("e","ii",dst_id,src_id); @@ -1097,7 +1097,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, const H5S_t *ds, +H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, const H5S_t *ds, unsigned * oh_flags_ptr) { herr_t ret_value=SUCCEED; /* Return value */ @@ -1404,7 +1404,7 @@ done: * Purpose: Given two data spaces (MEM_SPACE and FILE_SPACE) this * function returns a pointer to the conversion path information, * creating a new conversion path entry if necessary. - * + * * Return: Success: Ptr to a conversion path entry * * Failure: NULL @@ -1427,7 +1427,7 @@ done: * statistics). * * John Mainzer, 8/30/04 - * Modified code to check with all other processes that have the + * Modified code to check with all other processes that have the * file open before OKing collective I/O. * *------------------------------------------------------------------------- @@ -1438,7 +1438,7 @@ H5S_find (const H5S_t *mem_space, const H5S_t *file_space) H5S_iostats_t *path=NULL; /* Space conversion path */ size_t u; /* Index variable */ H5S_iostats_t *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5S_find, NULL); /* Check args */ @@ -1457,7 +1457,7 @@ H5S_find (const H5S_t *mem_space, const H5S_t *file_space) if (H5S_iostats_g[u]->ftype==H5S_GET_SELECT_TYPE(file_space) && H5S_iostats_g[u]->mtype==H5S_GET_SELECT_TYPE(mem_space)) HGOTO_DONE(H5S_iostats_g[u]); - + /* * The path wasn't found. Create a new path. */ @@ -1517,7 +1517,7 @@ H5S_extend (H5S_t *space, const hsize_t *size) { int ret_value=0; unsigned u; - + FUNC_ENTER_NOAPI(H5S_extend, FAIL); /* Check args */ @@ -1619,11 +1619,11 @@ H5Screate_simple(int rank, const hsize_t dims[/*rank*/], /* Create the space and set the extent */ if(NULL==(space=H5S_create_simple((unsigned)rank,dims,maxdims))) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace"); - + /* Atomize */ if ((ret_value=H5I_register (H5I_DATASPACE, space))<0) HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID"); - + done: if (ret_value<0) { if (space!=NULL) @@ -1669,7 +1669,7 @@ H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/], HGOTO_ERROR (H5E_DATASPACE, H5E_CANTCREATE, NULL, "can't create simple dataspace"); if(H5S_set_extent_simple(ret_value,rank,dims,maxdims)<0) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, NULL, "can't set dimensions"); - + done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5S_create_simple() */ @@ -1698,7 +1698,7 @@ H5Sencode(hid_t obj_id, void *buf, size_t *nalloc) { H5S_t *dspace; herr_t ret_value=SUCCEED; - + FUNC_ENTER_API (H5Sencode, FAIL); H5TRACE3("e","ix*z",obj_id,buf,nalloc); @@ -1717,8 +1717,8 @@ done: /*------------------------------------------------------------------------- * Function: H5S_encode * - * Purpose: Private function for H5Sencode. Converts an object - * description for data space and its selection into binary + * Purpose: Private function for H5Sencode. Converts an object + * description for data space and its selection into binary * in a buffer. * * Return: Success: non-negative @@ -1762,7 +1762,7 @@ H5S_encode(H5S_t *obj, unsigned char *buf, size_t *nalloc) *nalloc = extent_size+select_size+1+1+1+4; HGOTO_DONE(ret_value); } - + /* Encode the type of the information */ *buf++ = H5O_SDSPACE_ID; @@ -1774,7 +1774,7 @@ H5S_encode(H5S_t *obj, unsigned char *buf, size_t *nalloc) /* Encode size of extent information. Pointer is actually moved in this macro. */ UINT32ENCODE(buf, extent_size); - + /* Encode the extent part of dataspace */ if(H5O_encode(&f, buf, obj, H5O_SDSPACE_ID)<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode extent space"); @@ -1795,7 +1795,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Sdecode * - * Purpose: Decode a binary object description of data space and + * Purpose: Decode a binary object description of data space and * return a new object handle. * * Return: Success: dataspace ID(non-negative) @@ -1815,7 +1815,7 @@ H5Sdecode(const void *buf) { H5S_t *ds; hid_t ret_value; - + FUNC_ENTER_API (H5Sdecode, FAIL); H5TRACE1("i","x",buf); @@ -1824,7 +1824,7 @@ H5Sdecode(const void *buf) if((ds = H5S_decode(buf))==NULL) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, FAIL, "can't decode object"); - + /* Register the type and return the ID */ if ((ret_value=H5I_register (H5I_DATASPACE, ds))<0) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTREGISTER, FAIL, "unable to register dataspace"); @@ -1838,7 +1838,7 @@ done: * Function: H5S_decode * * Purpose: Private function for H5Sdecode. Reconstructs a binary - * description of dataspace and returns a new object handle. + * description of dataspace and returns a new object handle. * * Return: Success: dataspace ID(non-negative) * @@ -1882,7 +1882,7 @@ H5S_decode(const unsigned char *buf) /* Decode size of extent information */ UINT32DECODE(buf, extent_size); - + /* Decode the extent part of dataspace */ if((extent = H5O_decode(&f, buf, H5O_SDSPACE_ID))==NULL) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, NULL, "can't decode object"); @@ -1978,7 +1978,7 @@ H5S_get_simple_extent_type(const H5S_t *space) assert(space); ret_value=H5S_GET_EXTENT_TYPE(space); - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -2016,7 +2016,7 @@ H5Sget_simple_extent_type(hid_t sid) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5S_NO_CLASS, "not a dataspace"); ret_value=H5S_GET_EXTENT_TYPE(space); - + done: FUNC_LEAVE_API(ret_value); } @@ -2123,7 +2123,7 @@ H5S_set_extent( H5S_t *space, const hsize_t *size ) { unsigned u; herr_t ret_value=0; - + FUNC_ENTER_NOAPI( H5S_set_extent, FAIL ); /* Check args */ @@ -2200,7 +2200,7 @@ H5S_set_extent_real( H5S_t *space, const hsize_t *size ) hsize_t nelem; /* Number of elements in extent */ unsigned u; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5S_set_extent_real, FAIL ); /* Check args */ @@ -2243,9 +2243,9 @@ H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, int indent, { const H5S_t *mesg = (const H5S_t*)_mesg; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5S_debug, FAIL); - + switch (H5S_GET_EXTENT_TYPE(mesg)) { case H5S_NULL: fprintf(stream, "%*s%-*s H5S_NULL\n", indent, "", fwidth, @@ -2256,14 +2256,14 @@ H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, int indent, fprintf(stream, "%*s%-*s H5S_SCALAR\n", indent, "", fwidth, "Space class:"); break; - + case H5S_SIMPLE: fprintf(stream, "%*s%-*s H5S_SIMPLE\n", indent, "", fwidth, "Space class:"); H5O_debug_id(H5O_SDSPACE_ID, f, dxpl_id, &(mesg->extent), stream, indent+3, MAX(0, fwidth-3)); break; - + default: fprintf(stream, "%*s%-*s **UNKNOWN-%ld**\n", indent, "", fwidth, "Space class:", (long)(H5S_GET_EXTENT_TYPE(mesg))); @@ -72,8 +72,8 @@ H5FL_DEFINE(H5SH_t); * Mar 23 2005 * * Changes: John Mainzer -- 6/7/05 - * Removed code modifying the is_dirty field of the cache - * info. Management of this field is in the process of + * Removed code modifying the is_dirty field of the cache + * info. Management of this field is in the process of * being moved to the H5C code. * *------------------------------------------------------------------------- @@ -173,7 +173,7 @@ H5SH_alloc_extend_cb(const H5BT_blk_info_t *record, void *_op_data) H5BT_COMPARE_LESS, (record->addr + record->len + 1), &free_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, H5BT_ITER_ERROR, "can't search for free space") - + /* Check if we can use free space for part of block to allocate */ if(H5F_addr_defined(free_block.addr) && (free_block.addr + free_block.len) == (record->addr + record->len)) { diff --git a/src/H5SHcache.c b/src/H5SHcache.c index 5a57084..aa4c981 100644 --- a/src/H5SHcache.c +++ b/src/H5SHcache.c @@ -289,7 +289,7 @@ H5SH_cache_clear(H5F_t *f, H5SH_t *sh, hbool_t destroy) /* Reset the dirty flag. */ sh->cache_info.is_dirty = FALSE; - + if (destroy) if (H5SH_cache_dest(f, sh) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy segmented heap info") @@ -303,7 +303,7 @@ done: * Function: H5SH_cache_size * * Purpose: Compute the size in bytes of a segmented heap info - * on disk, and return it in *size_ptr. On failure, + * on disk, and return it in *size_ptr. On failure, * the value of *size_ptr is undefined. * * Return: Non-negative on success/Negative on failure diff --git a/src/H5SHprivate.h b/src/H5SHprivate.h index b6f2306..375be19 100644 --- a/src/H5SHprivate.h +++ b/src/H5SHprivate.h @@ -36,7 +36,7 @@ /* Library Private Macros */ /**************************/ - + /****************************/ /* Library Private Typedefs */ /****************************/ @@ -1231,7 +1231,7 @@ H5SL_item(H5SL_node_t *slist_node) The operator callback receives a pointer to the item and key for the list being iterated over ('mesg'), and the pointer to the operator data passed in to H5SL_iterate ('op_data'). The return values from an operator are: - A. Zero causes the iterator to continue, returning zero when all + A. Zero causes the iterator to continue, returning zero when all nodes of that type have been processed. B. Positive causes the iterator to immediately return that positive value, indicating short-circuit success. @@ -402,7 +402,7 @@ done: --------------------------------------------------------------------------*/ static H5ST_ptr_t H5ST_findfirst_internal(H5ST_ptr_t p) -{ +{ H5ST_ptr_t ret_value=NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_findfirst_internal); @@ -422,7 +422,7 @@ H5ST_findfirst_internal(H5ST_ptr_t p) p=p->eqkid; } /* end else */ } /* end while */ - + done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5ST_findfirst_internal() */ @@ -448,14 +448,14 @@ done: --------------------------------------------------------------------------*/ H5ST_ptr_t H5ST_findfirst(H5ST_tree_t *tree) -{ +{ H5ST_ptr_t ret_value; /* Return value */ FUNC_ENTER_NOAPI(H5ST_findfirst,NULL); if((ret_value=H5ST_findfirst_internal(tree->root))==NULL) HGOTO_ERROR(H5E_TST,H5E_NOTFOUND,NULL,"no nodes in TST"); - + done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5ST_findfirst() */ @@ -539,7 +539,7 @@ done: --------------------------------------------------------------------------*/ H5ST_ptr_t H5ST_findnext(H5ST_ptr_t p) -{ +{ H5ST_ptr_t q; /* Temporary pointer to TST node */ H5ST_ptr_t ret_value=NULL; /* Return value */ @@ -582,7 +582,7 @@ done: --------------------------------------------------------------------------*/ static herr_t H5ST_delete_internal(H5ST_ptr_t *root, H5ST_ptr_t p) -{ +{ H5ST_ptr_t q, /* Temporary pointer to TST node */ newp; /* Pointer to node which will replace deleted node in tree */ @@ -658,7 +658,7 @@ H5ST_delete_internal(H5ST_ptr_t *root, H5ST_ptr_t p) --------------------------------------------------------------------------*/ herr_t H5ST_delete(H5ST_tree_t *tree, H5ST_ptr_t p) -{ +{ herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5ST_delete,FAIL); diff --git a/src/H5Sall.c b/src/H5Sall.c index eb4c4c8..e6d9644 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -377,7 +377,7 @@ H5S_all_release (H5S_t UNUSED * space) /* Reset the number of elements in the selection */ space->select.num_elem=0; - + FUNC_LEAVE_NOAPI(SUCCEED); } /* H5S_all_release() */ @@ -474,7 +474,7 @@ H5S_all_serial_size (const H5S_t UNUSED *space) assert(space); /* Basic number of bytes required to serialize point selection: - * <type (4 bytes)> + <version (4 bytes)> + <padding (4 bytes)> + + * <type (4 bytes)> + <version (4 bytes)> + <padding (4 bytes)> + * <length (4 bytes)> = 16 bytes */ FUNC_LEAVE_NOAPI(16); diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 563e118..92f4b10 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -1047,7 +1047,7 @@ H5S_hyper_new_span (hsize_t low, hsize_t high, H5S_hyper_span_info_t *down, H5S_ /* Allocate a new span node */ if((ret_value = H5FL_MALLOC(H5S_hyper_span_t))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); - + /* Copy the span's basic information */ ret_value->low=low; ret_value->high=high; @@ -1258,7 +1258,7 @@ H5S_hyper_copy_span_helper (H5S_hyper_span_info_t *spans) /* Allocate a new span_info node */ if((ret_value = H5FL_MALLOC(H5S_hyper_span_info_t))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); - + /* Copy the span_info information */ ret_value->count=1; ret_value->scratch=NULL; @@ -1374,7 +1374,7 @@ H5S_hyper_cmp_spans (H5S_hyper_span_info_t *span_info1, H5S_hyper_span_info_t *s FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_cmp_spans); /* Check for redundant comparison */ - if(span_info1==span_info2) + if(span_info1==span_info2) ret_value=TRUE; else { /* Check for both spans being NULL */ @@ -1783,7 +1783,7 @@ H5S_hyper_span_nblocks (H5S_hyper_span_info_t *spans) /* If there are no down spans, just count the block in this span */ else ret_value++; - + /* Advance to next span */ span=span->next; } /* end while */ @@ -1903,7 +1903,7 @@ H5S_hyper_serial_size (const H5S_t *space) assert(space); /* Basic number of bytes required to serialize hyperslab selection: - * <type (4 bytes)> + <version (4 bytes)> + <padding (4 bytes)> + + * <type (4 bytes)> + <version (4 bytes)> + <padding (4 bytes)> + * <length (4 bytes)> + <rank (4 bytes)> + <# of blocks (4 bytes)> = 24 bytes */ ret_value=24; @@ -2124,7 +2124,7 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf) /* Reset the block count in this dimension */ tmp_count[temp_dim]=diminfo[temp_dim].count; - + /* Wrapped a dimension, go up to next dimension */ temp_dim--; } /* end while */ @@ -2157,7 +2157,7 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf) /* Encode length */ UINT32ENCODE(lenp, (uint32_t)len); /* Store the length of the extra information */ - + FUNC_LEAVE_NOAPI(SUCCEED); } /* H5S_hyper_serialize() */ @@ -2477,7 +2477,7 @@ H5S_get_select_hyper_blocklist(H5S_t *space, hbool_t internal, hsize_t startbloc /* Reset the block count in this dimension */ tmp_count[temp_dim]=diminfo[temp_dim].count; - + /* Wrapped a dimension, go up to next dimension */ temp_dim--; } /* end while */ @@ -2490,7 +2490,7 @@ H5S_get_select_hyper_blocklist(H5S_t *space, hbool_t internal, hsize_t startbloc } /* end for */ } /* end while */ } /* end if */ - else + else ret_value=H5S_hyper_span_blocklist(space->select.sel_info.hslab->span_lst,start,end,(hsize_t)0,&startblock,&numblocks,&buf); FUNC_LEAVE_NOAPI(ret_value); @@ -2927,7 +2927,7 @@ H5S_hyper_is_single(const H5S_t *space) } /* end if */ else { /* - * For a region to be single, it must have only one block + * For a region to be single, it must have only one block */ /* Get information for slowest changing information */ spans=space->select.sel_info.hslab->span_lst; @@ -3217,7 +3217,7 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran /* Before we create another span at this level in the tree, check if * the last span's "down tree" was equal to any other spans in this * list of spans in the span tree. - * + * * If so, release last span information and make last span merge into * previous span (if possible), or at least share their "down tree" * information. @@ -3283,7 +3283,7 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran /* Before we create another span at this level in the tree, check if * the last span's "down tree" was equal to any other spans in this * list of spans in the span tree. - * + * * If so, release last span information and make last span merge into * previous span (if possible), or at least share their "down tree" * information. @@ -3620,7 +3620,7 @@ done: EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -htri_t +htri_t H5S_hyper_intersect (H5S_t *space1, H5S_t *space2) { htri_t ret_value=FAIL; /* Return value */ @@ -3739,7 +3739,7 @@ done: EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -htri_t +htri_t H5S_hyper_intersect_block (H5S_t *space, hsize_t *start, hsize_t *end) { htri_t ret_value=FAIL; /* Return value */ @@ -4235,7 +4235,7 @@ H5S_hyper_append_span (H5S_hyper_span_t **prev_span, H5S_hyper_span_info_t ** sp /* Allocate new span node to append to list */ if((new_span = H5S_hyper_new_span(low,high,down,next))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); - + /* Make first node in span list */ /* Check that we haven't already allocated a span tree */ @@ -4244,7 +4244,7 @@ H5S_hyper_append_span (H5S_hyper_span_t **prev_span, H5S_hyper_span_info_t ** sp /* Allocate a new span_info node */ if((*span_tree = H5FL_MALLOC(H5S_hyper_span_info_t))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); - + /* Set the span tree's basic information */ (*span_tree)->count=1; (*span_tree)->scratch=NULL; @@ -4256,7 +4256,7 @@ H5S_hyper_append_span (H5S_hyper_span_t **prev_span, H5S_hyper_span_info_t ** sp /* Merge or append to existing merged spans list */ else { /* Check if span can just extend the previous merged span */ - if((((*prev_span)->high+1)==low) && + if((((*prev_span)->high+1)==low) && H5S_hyper_cmp_spans(down,(*prev_span)->down)==TRUE) { /* Extend previous merged span to include new high bound */ (*prev_span)->high=high; @@ -4266,7 +4266,7 @@ H5S_hyper_append_span (H5S_hyper_span_t **prev_span, H5S_hyper_span_info_t ** sp /* Allocate new span node to append to list */ if((new_span = H5S_hyper_new_span(low,high,down,next))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); - + /* Check if there is actually a down span */ if(new_span->down) { /* Check if the down spans for the new span node are the same as the previous span node */ @@ -4443,7 +4443,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for overlaps in the 'down spans' of span 'a' & 'b' */ if(H5S_hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information"); - + /* Check for additions to the a_not_b list */ if(down_a_not_b!=NULL) { /* Merge/add overlapped part with/to a_not_b list */ @@ -4530,7 +4530,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for overlaps in the 'down spans' of span 'a' & 'b' */ if(H5S_hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information"); - + /* Check for additions to the a_not_b list */ if(down_a_not_b!=NULL) { /* Merge/add overlapped part with/to a_not_b list */ @@ -4613,7 +4613,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for overlaps in the 'down spans' of span 'a' & 'b' */ if(H5S_hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information"); - + /* Check for additions to the a_not_b list */ if(down_a_not_b!=NULL) { /* Merge/add overlapped part with/to a_not_b list */ @@ -4705,7 +4705,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for overlaps in the 'down spans' of span 'a' & 'b' */ if(H5S_hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information"); - + /* Check for additions to the a_not_b list */ if(down_a_not_b!=NULL) { /* Merge/add overlapped part with/to a_not_b list */ @@ -5089,7 +5089,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf H5S_hyper_recover_span(&recover_a,&span_a,span_a->next); } /* end while */ } /* end if */ - + /* Clean up 'b' spans which haven't been added to the list of merged spans */ if(span_a==NULL && span_b!=NULL) { while(span_b!=NULL) { @@ -5210,7 +5210,7 @@ H5S_hyper_spans_nelem (H5S_hyper_span_info_t *spans) /* If there are no down spans, just count the elements in this span */ else ret_value+=span->nelem; - + /* Advance to next span */ span=span->next; } /* end while */ @@ -5292,7 +5292,7 @@ H5S_hyper_make_spans (unsigned rank, const hsize_t *start, const hsize_t *stride head=span; else last_span->next=span; - + /* Move current pointer */ last_span=span; @@ -5541,7 +5541,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op, assert(stride); assert(count); assert(block); - + /* Generate span tree for new hyperslab information */ if((new_spans=H5S_hyper_make_spans(space->extent.rank,start,stride,count,block))==NULL) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't create hyperslab information"); @@ -5787,7 +5787,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, assert(start); assert(count); assert(op>H5S_SELECT_NOOP && op<H5S_SELECT_INVALID); - + /* Point to the correct stride values */ if(stride==NULL) stride = _ones; @@ -6096,7 +6096,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper assert(result); assert(spans2); assert(op>H5S_SELECT_NOOP && op<H5S_SELECT_INVALID); - + /* Just copy the selection from spans2 if we are setting the selection */ /* ('space1' to 'result' aliasing happens at the next layer up) */ if(op==H5S_SELECT_SET) { @@ -6312,7 +6312,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op, assert(stride); assert(count); assert(block); - + /* Generate span tree for new hyperslab information */ if((new_spans=H5S_hyper_make_spans(space->extent.rank,start,stride,count,block))==NULL) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't create hyperslab information"); @@ -6387,7 +6387,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, assert(start); assert(count); assert(op>H5S_SELECT_NOOP && op<H5S_SELECT_INVALID); - + /* Point to the correct stride values */ if(stride==NULL) stride = _ones; @@ -6765,7 +6765,7 @@ H5S_combine_select (H5S_t *space1, H5S_seloper_t op, H5S_t *space2) assert(space1); assert(space2); assert(op>H5S_SELECT_NOOP && op<H5S_SELECT_INVALID); - + /* Check that the space selections both have span trees */ if(space1->select.sel_info.hslab->span_lst==NULL) if(H5S_hyper_generate_spans(space1)<0) @@ -6809,7 +6809,7 @@ done: with the resulting selection. USAGE hid_t H5Scombine_select(space1, op, space2) - hid_t space1; IN: First Dataspace ID + hid_t space1; IN: First Dataspace ID H5S_seloper_t op; IN: Selection operation hid_t space2; IN: Second Dataspace ID RETURNS @@ -6893,7 +6893,7 @@ H5S_select_select (H5S_t *space1, H5S_seloper_t op, H5S_t *space2) assert(space1); assert(space2); assert(op>H5S_SELECT_NOOP && op<H5S_SELECT_INVALID); - + /* Check that the space selections both have span trees */ if(space1->select.sel_info.hslab->span_lst==NULL) if(H5S_hyper_generate_spans(space1)<0) @@ -6935,7 +6935,7 @@ done: to modify it. USAGE herr_t H5Sselect_select(space1, op, space2) - hid_t space1; IN/OUT: First Dataspace ID + hid_t space1; IN/OUT: First Dataspace ID H5S_seloper_t op; IN: Selection operation hid_t space2; IN: Second Dataspace ID RETURNS @@ -7253,7 +7253,7 @@ partial_done: /* Yes, goto's are evil, so sue me... :-) */ else { off[curr_seq]=loc_off; len[curr_seq]=span_size; - + /* Increment the number of sequences in arrays */ curr_seq++; } /* end else */ @@ -7285,7 +7285,7 @@ partial_done: /* Yes, goto's are evil, so sue me... :-) */ else { off[curr_seq]=loc_off; len[curr_seq]=span_size; - + /* Increment the number of sequences in arrays */ curr_seq++; } /* end else */ diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 48f2358..7105ef9 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -530,7 +530,7 @@ H5S_mpio_span_hyper_type( const H5S_t *space, *new_type = span_type; /* fill in the remaining return values */ - *count = 1; + *count = 1; *extra_offset = 0; *is_derived_type = 1; diff --git a/src/H5Snone.c b/src/H5Snone.c index b50af6a..154758c 100644 --- a/src/H5Snone.c +++ b/src/H5Snone.c @@ -442,7 +442,7 @@ H5S_none_serial_size (const H5S_t UNUSED *space) assert(space); /* Basic number of bytes required to serialize point selection: - * <type (4 bytes)> + <version (4 bytes)> + <padding (4 bytes)> + + * <type (4 bytes)> + <version (4 bytes)> + <padding (4 bytes)> + * <length (4 bytes)> = 16 bytes */ FUNC_LEAVE_NOAPI(16); diff --git a/src/H5Spkg.h b/src/H5Spkg.h index ce858a2..c32032d 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -36,7 +36,7 @@ #define H5S_VALID_MAX 0x01 #define H5S_VALID_PERM 0x02 -/* +/* * Dataspace extent information */ /* Extent container */ @@ -49,7 +49,7 @@ typedef struct { hsize_t *max; /* Maximum size of the dimensions */ } H5S_extent_t; -/* +/* * Dataspace selection information */ /* Node in point selection list (typedef'd in H5Sprivate.h) */ @@ -79,7 +79,7 @@ struct H5S_hyper_span_info_t { unsigned count; /* Ref. count of number of spans which share this span */ struct H5S_hyper_span_info_t *scratch; /* Scratch pointer * (used during copies, as mark - * during precomputes for I/O & + * during precomputes for I/O & * to point to the last span in a * list during single element adds) */ diff --git a/src/H5Spoint.c b/src/H5Spoint.c index a948cd2..a394e20 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -125,7 +125,7 @@ H5S_point_iter_init(H5S_sel_iter_t *iter, const H5S_t *space) /* Start at the head of the list of points */ iter->u.pnt.curr=space->select.sel_info.pnt_lst->head; - + /* Initialize type of selection iterator */ iter->type=H5S_sel_iter_point; @@ -430,7 +430,7 @@ H5S_point_add (H5S_t *space, H5S_seloper_t op, size_t num_elem, const hsize_t ** /* Append new list to point selection */ new_node->next=top; } /* end if */ - else + else space->select.sel_info.pnt_lst->head=top; } /* end else */ @@ -480,14 +480,14 @@ H5S_point_release (H5S_t *space) H5FL_FREE(H5S_pnt_node_t,curr); curr=next; } /* end while */ - + /* Free & reset the point list header */ H5FL_FREE(H5S_pnt_list_t,space->select.sel_info.pnt_lst); space->select.sel_info.pnt_lst=NULL; /* Reset the number of elements in the selection */ space->select.num_elem=0; - + FUNC_LEAVE_NOAPI(SUCCEED); } /* H5S_point_release() */ @@ -741,7 +741,7 @@ H5S_point_serial_size (const H5S_t *space) assert(space); /* Basic number of bytes required to serialize point selection: - * <type (4 bytes)> + <version (4 bytes)> + <padding (4 bytes)> + + * <type (4 bytes)> + <version (4 bytes)> + <padding (4 bytes)> + * <length (4 bytes)> + <rank (4 bytes)> + <# of points (4 bytes)> = 24 bytes */ ret_value=24; @@ -819,7 +819,7 @@ H5S_point_serialize (const H5S_t *space, uint8_t *buf) /* Encode length */ UINT32ENCODE(lenp, (uint32_t)len); /* Store the length of the extra information */ - + FUNC_LEAVE_NOAPI(SUCCEED); } /* H5S_point_serialize() */ @@ -869,7 +869,7 @@ H5S_point_deserialize (H5S_t *space, const uint8_t *buf) /* Allocate space for the coordinates */ if((coord = H5MM_malloc(num_elem*rank*sizeof(hsize_t)))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate coordinate information"); - + /* Retrieve the coordinates from the buffer */ for(tcoord=coord,i=0; i<num_elem; i++) for(j=0; j<(unsigned)rank; j++,tcoord++) diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index 3fa0dc3..fe982b6 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -200,7 +200,7 @@ H5_DLL int H5S_get_simple_extent_dims(const H5S_t *ds, hsize_t dims[]/*out*/, hsize_t max_dims[]/*out*/); H5_DLL herr_t H5S_modify(struct H5G_entry_t *ent, const H5S_t *space, hbool_t update_time, hid_t dxpl_id); -H5_DLL herr_t H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, +H5_DLL herr_t H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, const H5S_t *ds, unsigned * oh_flags_ptr); H5_DLL size_t H5S_raw_size(const H5F_t *f, const H5S_t *space); H5_DLL H5S_t *H5S_read(const struct H5G_entry_t *ent, hid_t dxpl_id); @@ -147,7 +147,7 @@ hid_t H5T_NATIVE_UINT_FAST64_g = FAIL; /* * Alignment constraints for native types. These are initialized at run time - * in H5Tinit.c. These alignments are mainly for offsets in HDF5 compound + * in H5Tinit.c. These alignments are mainly for offsets in HDF5 compound * datatype or C structures, which are different from the alignments for memory * address below this group of variables. */ @@ -660,7 +660,7 @@ NAME H5T_init_interface -- Initialize interface-specific information USAGE herr_t H5T_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -764,30 +764,30 @@ H5T_init_interface(void) /*------------------------------------------------------------ * Native types - *------------------------------------------------------------ + *------------------------------------------------------------ */ /* 1-byte bit field */ H5T_INIT_TYPE(BITFIELD,H5T_NATIVE_B8_g,COPY,native_uint,SET,1) - + /* 2-byte bit field */ H5T_INIT_TYPE(BITFIELD,H5T_NATIVE_B16_g,COPY,native_uint,SET,2) - + /* 4-byte bit field */ H5T_INIT_TYPE(BITFIELD,H5T_NATIVE_B32_g,COPY,native_uint,SET,4) - + /* 8-byte bit field */ H5T_INIT_TYPE(BITFIELD,H5T_NATIVE_B64_g,COPY,native_uint,SET,8) - + /* haddr_t */ H5T_INIT_TYPE(OFFSET,H5T_NATIVE_HADDR_g,COPY,native_uint,SET,sizeof(haddr_t)) /* hsize_t */ H5T_INIT_TYPE(OFFSET,H5T_NATIVE_HSIZE_g,COPY,native_uint,SET,sizeof(hsize_t)) - + /* hssize_t */ H5T_INIT_TYPE(OFFSET,H5T_NATIVE_HSSIZE_g,COPY,native_int,SET,sizeof(hssize_t)) - + /* herr_t */ H5T_INIT_TYPE(OFFSET,H5T_NATIVE_HERR_g,COPY,native_int,SET,sizeof(herr_t)) @@ -796,7 +796,7 @@ H5T_init_interface(void) /*------------------------------------------------------------ * IEEE Types - *------------------------------------------------------------ + *------------------------------------------------------------ */ /* IEEE 4-byte little-endian float */ @@ -814,69 +814,69 @@ H5T_init_interface(void) /*------------------------------------------------------------ * Other "standard" types - *------------------------------------------------------------ + *------------------------------------------------------------ */ /* 1-byte little-endian (endianness is irrelevant) signed integer */ H5T_INIT_TYPE(SINTLE,H5T_STD_I8LE_g,COPY,native_int,SET,1) - + /* 1-byte big-endian (endianness is irrelevant) signed integer */ H5T_INIT_TYPE(SINTBE,H5T_STD_I8BE_g,COPY,native_int,SET,1) - + /* 2-byte little-endian signed integer */ H5T_INIT_TYPE(SINTLE,H5T_STD_I16LE_g,COPY,native_int,SET,2) - + /* 2-byte big-endian signed integer */ H5T_INIT_TYPE(SINTBE,H5T_STD_I16BE_g,COPY,native_int,SET,2) - + /* 4-byte little-endian signed integer */ H5T_INIT_TYPE(SINTLE,H5T_STD_I32LE_g,COPY,native_int,SET,4) std_i32le=dt; /* Keep type for later */ - + /* 4-byte big-endian signed integer */ H5T_INIT_TYPE(SINTBE,H5T_STD_I32BE_g,COPY,native_int,SET,4) - + /* 8-byte little-endian signed integer */ H5T_INIT_TYPE(SINTLE,H5T_STD_I64LE_g,COPY,native_int,SET,8) - + /* 8-byte big-endian signed integer */ H5T_INIT_TYPE(SINTBE,H5T_STD_I64BE_g,COPY,native_int,SET,8) - + /* 1-byte little-endian (endianness is irrelevant) unsigned integer */ H5T_INIT_TYPE(UINTLE,H5T_STD_U8LE_g,COPY,native_uint,SET,1) std_u8le=dt; /* Keep type for later */ - + /* 1-byte big-endian (endianness is irrelevant) unsigned integer */ H5T_INIT_TYPE(UINTBE,H5T_STD_U8BE_g,COPY,native_uint,SET,1) std_u8be=dt; /* Keep type for later */ - + /* 2-byte little-endian unsigned integer */ H5T_INIT_TYPE(UINTLE,H5T_STD_U16LE_g,COPY,native_uint,SET,2) std_u16le=dt; /* Keep type for later */ - + /* 2-byte big-endian unsigned integer */ H5T_INIT_TYPE(UINTBE,H5T_STD_U16BE_g,COPY,native_uint,SET,2) std_u16be=dt; /* Keep type for later */ - + /* 4-byte little-endian unsigned integer */ H5T_INIT_TYPE(UINTLE,H5T_STD_U32LE_g,COPY,native_uint,SET,4) std_u32le=dt; /* Keep type for later */ - + /* 4-byte big-endian unsigned integer */ H5T_INIT_TYPE(UINTBE,H5T_STD_U32BE_g,COPY,native_uint,SET,4) std_u32be=dt; /* Keep type for later */ - + /* 8-byte little-endian unsigned integer */ H5T_INIT_TYPE(UINTLE,H5T_STD_U64LE_g,COPY,native_uint,SET,8) std_u64le=dt; /* Keep type for later */ - + /* 8-byte big-endian unsigned integer */ H5T_INIT_TYPE(UINTBE,H5T_STD_U64BE_g,COPY,native_uint,SET,8) std_u64be=dt; /* Keep type for later */ /*------------------------------------------------------------ * Little- & Big-endian bitfields - *------------------------------------------------------------ + *------------------------------------------------------------ */ /* little-endian (order is irrelevant) 8-bit bitfield */ @@ -906,7 +906,7 @@ H5T_init_interface(void) /*------------------------------------------------------------ * The Unix architecture for dates and times. - *------------------------------------------------------------ + *------------------------------------------------------------ */ /* Little-endian 32-bit UNIX time_t */ @@ -932,7 +932,7 @@ H5T_init_interface(void) /*------------------------------------------------------------ * The `C' architecture - *------------------------------------------------------------ + *------------------------------------------------------------ */ /* One-byte character string */ @@ -941,7 +941,7 @@ H5T_init_interface(void) /*------------------------------------------------------------ * The `Fortran' architecture - *------------------------------------------------------------ + *------------------------------------------------------------ */ /* One-byte character string */ @@ -949,13 +949,13 @@ H5T_init_interface(void) /*------------------------------------------------------------ * Pointer types - *------------------------------------------------------------ + *------------------------------------------------------------ */ /* Object pointer (i.e. object header address in file) */ H5T_INIT_TYPE(OBJREF,H5T_STD_REF_OBJ_g,ALLOC,-,SET,H5R_OBJ_REF_BUF_SIZE) objref=dt; /* Keep type for later */ - + /* Dataset Region pointer (i.e. selection inside a dataset) */ H5T_INIT_TYPE(REGREF,H5T_STD_REF_DSETREG_g,ALLOC,-,SET,H5R_DSET_REG_REF_BUF_SIZE) @@ -1031,7 +1031,7 @@ H5T_init_interface(void) status |= H5T_register(H5T_PERS_HARD, "llong_uchar", native_llong, native_uchar, H5T_conv_llong_uchar, H5AC_dxpl_id); status |= H5T_register(H5T_PERS_HARD, "ullong_schar", native_ullong, native_schar, H5T_conv_ullong_schar, H5AC_dxpl_id); status |= H5T_register(H5T_PERS_HARD, "ullong_uchar", native_ullong, native_uchar, H5T_conv_ullong_uchar, H5AC_dxpl_id); - + /* From long */ status |= H5T_register(H5T_PERS_HARD, "long_llong", native_long, native_llong, H5T_conv_long_llong, H5AC_dxpl_id); status |= H5T_register(H5T_PERS_HARD, "long_ullong", native_long, native_ullong, H5T_conv_long_ullong, H5AC_dxpl_id); @@ -1051,7 +1051,7 @@ H5T_init_interface(void) status |= H5T_register(H5T_PERS_HARD, "long_uchar", native_long, native_uchar, H5T_conv_long_uchar, H5AC_dxpl_id); status |= H5T_register(H5T_PERS_HARD, "ulong_schar", native_ulong, native_schar, H5T_conv_ulong_schar, H5AC_dxpl_id); status |= H5T_register(H5T_PERS_HARD, "ulong_uchar", native_ulong, native_uchar, H5T_conv_ulong_uchar, H5AC_dxpl_id); - + /* From short */ status |= H5T_register(H5T_PERS_HARD, "short_llong", native_short, native_llong, H5T_conv_short_llong, H5AC_dxpl_id); status |= H5T_register(H5T_PERS_HARD, "short_ullong", native_short, native_ullong, H5T_conv_short_ullong, H5AC_dxpl_id); @@ -1071,7 +1071,7 @@ H5T_init_interface(void) status |= H5T_register(H5T_PERS_HARD, "short_uchar", native_short, native_uchar, H5T_conv_short_uchar, H5AC_dxpl_id); status |= H5T_register(H5T_PERS_HARD, "ushort_schar", native_ushort, native_schar, H5T_conv_ushort_schar, H5AC_dxpl_id); status |= H5T_register(H5T_PERS_HARD, "ushort_uchar", native_ushort, native_uchar, H5T_conv_ushort_uchar, H5AC_dxpl_id); - + /* From int */ status |= H5T_register(H5T_PERS_HARD, "int_llong", native_int, native_llong, H5T_conv_int_llong, H5AC_dxpl_id); status |= H5T_register(H5T_PERS_HARD, "int_ullong", native_int, native_ullong, H5T_conv_int_ullong, H5AC_dxpl_id); @@ -1132,7 +1132,7 @@ H5T_init_interface(void) #if H5_SW_INTEGER_TO_LDOUBLE_WORKS status |= H5T_register(H5T_PERS_HARD, "short_ldbl", native_short, native_ldouble, H5T_conv_short_ldouble, H5AC_dxpl_id); #endif /*H5_SW_INTEGER_TO_LDOUBLE_WORKS*/ - + /* From unsigned short to floats */ status |= H5T_register(H5T_PERS_HARD, "ushort_flt", native_ushort, native_float, H5T_conv_ushort_float, H5AC_dxpl_id); status |= H5T_register(H5T_PERS_HARD, "ushort_dbl", native_ushort, native_double, H5T_conv_ushort_double, H5AC_dxpl_id); @@ -1146,7 +1146,7 @@ H5T_init_interface(void) #if H5_SW_INTEGER_TO_LDOUBLE_WORKS status |= H5T_register(H5T_PERS_HARD, "int_ldbl", native_int, native_ldouble, H5T_conv_int_ldouble, H5AC_dxpl_id); #endif /*H5_SW_INTEGER_TO_LDOUBLE_WORKS*/ - + /* From unsigned int to floats */ status |= H5T_register(H5T_PERS_HARD, "uint_flt", native_uint, native_float, H5T_conv_uint_float, H5AC_dxpl_id); status |= H5T_register(H5T_PERS_HARD, "uint_dbl", native_uint, native_double, H5T_conv_uint_double, H5AC_dxpl_id); @@ -1160,7 +1160,7 @@ H5T_init_interface(void) #if H5_SW_INTEGER_TO_LDOUBLE_WORKS status |= H5T_register(H5T_PERS_HARD, "long_ldbl", native_long, native_ldouble, H5T_conv_long_ldouble, H5AC_dxpl_id); #endif /*H5_SW_INTEGER_TO_LDOUBLE_WORKS*/ - + /* From unsigned long to floats */ #if H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS status |= H5T_register(H5T_PERS_HARD, "ulong_flt", native_ulong, native_float, H5T_conv_ulong_float, H5AC_dxpl_id); @@ -1176,7 +1176,7 @@ H5T_init_interface(void) #if H5_SW_INTEGER_TO_LDOUBLE_WORKS status |= H5T_register(H5T_PERS_HARD, "llong_ldbl", native_llong, native_ldouble, H5T_conv_llong_ldouble, H5AC_dxpl_id); #endif /* H5_SW_INTEGER_TO_LDOUBLE_WORKS */ - + /* From unsigned long long to floats */ #if H5_ULLONG_TO_FP_CAST_WORKS && H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS status |= H5T_register(H5T_PERS_HARD, "ullong_flt", native_ullong, native_float, H5T_conv_ullong_float, H5AC_dxpl_id); @@ -1199,7 +1199,7 @@ H5T_init_interface(void) #if H5_SW_LDOUBLE_TO_INTEGER_WORKS status |= H5T_register(H5T_PERS_HARD, "ldbl_uchar", native_ldouble, native_uchar, H5T_conv_ldouble_uchar, H5AC_dxpl_id); #endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */ - + /* From floats to short */ status |= H5T_register(H5T_PERS_HARD, "flt_short", native_float, native_short, H5T_conv_float_short, H5AC_dxpl_id); status |= H5T_register(H5T_PERS_HARD, "dbl_short", native_double, native_short, H5T_conv_double_short, H5AC_dxpl_id); @@ -1213,7 +1213,7 @@ H5T_init_interface(void) #if H5_SW_LDOUBLE_TO_INTEGER_WORKS status |= H5T_register(H5T_PERS_HARD, "ldbl_ushort", native_ldouble, native_ushort, H5T_conv_ldouble_ushort, H5AC_dxpl_id); #endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */ - + /* From floats to int */ status |= H5T_register(H5T_PERS_HARD, "flt_int", native_float, native_int, H5T_conv_float_int, H5AC_dxpl_id); status |= H5T_register(H5T_PERS_HARD, "dbl_int", native_double, native_int, H5T_conv_double_int, H5AC_dxpl_id); @@ -1245,7 +1245,7 @@ H5T_init_interface(void) #ifndef H5_HW_FP_TO_LLONG_NOT_WORKS status |= H5T_register(H5T_PERS_HARD, "flt_llong", native_float, native_llong, H5T_conv_float_llong, H5AC_dxpl_id); status |= H5T_register(H5T_PERS_HARD, "dbl_llong", native_double, native_llong, H5T_conv_double_llong, H5AC_dxpl_id); -#if H5_SW_LDOUBLE_TO_INTEGER_WORKS +#if H5_SW_LDOUBLE_TO_INTEGER_WORKS status |= H5T_register(H5T_PERS_HARD, "ldbl_llong", native_ldouble, native_llong, H5T_conv_ldouble_llong, H5AC_dxpl_id); #endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */ #endif /* !H5_HW_FP_TO_LLONG_NOT_WORKS */ @@ -1271,7 +1271,7 @@ H5T_init_interface(void) if (status<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to register conversion function(s)"); - + /* ========== Datatype Creation Property Class Initialization ============*/ assert(H5P_CLS_DATATYPE_CREATE_g!=-1); @@ -1339,7 +1339,7 @@ static int H5T_unlock_cb (void *_dt, hid_t UNUSED id, void UNUSED *key) { H5T_t *dt = (H5T_t *)_dt; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_unlock_cb); assert (dt); @@ -1534,9 +1534,9 @@ H5T_term_interface(void) * Failure: Negative * * Errors: - * ARGS BADVALUE Invalid size. - * DATATYPE CANTINIT Can't create type. - * DATATYPE CANTREGISTER Can't register data type atom. + * ARGS BADVALUE Invalid size. + * DATATYPE CANTINIT Can't create type. + * DATATYPE CANTREGISTER Can't register data type atom. * * Programmer: Robb Matzke * Friday, December 5, 1997 @@ -1596,7 +1596,7 @@ H5Topen(hid_t loc_id, const char *name) hbool_t ent_found = FALSE; /* Entry at 'name' found */ hid_t dxpl_id = H5AC_dxpl_id; /* dxpl to use to open datatype */ hid_t ret_value =FAIL; - + FUNC_ENTER_API(H5Topen, FAIL); H5TRACE2("i","is",loc_id,name); @@ -1701,7 +1701,7 @@ H5Tcopy(hid_t type_id) /* Atomize result */ if ((ret_value = H5I_register(H5I_DATATYPE, new_dt)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type atom"); - + done: if(ret_value<0) { if(new_dt!=NULL) @@ -1744,7 +1744,7 @@ H5Tclose(hid_t type_id) /* When the reference count reaches zero the resources are freed */ if (H5I_dec_ref(type_id) < 0) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "problem freeing id"); - + done: FUNC_LEAVE_API(ret_value); } @@ -1831,7 +1831,7 @@ H5Tlock(hid_t type_id) if (H5T_lock (dt, TRUE)<0) HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to lock transient data type"); - + done: FUNC_LEAVE_API(ret_value); } @@ -1869,7 +1869,7 @@ H5Tget_class(hid_t type_id) /* Set return value */ ret_value= H5T_get_class(dt, FALSE); - + done: FUNC_LEAVE_API(ret_value); } @@ -1901,15 +1901,15 @@ H5T_get_class(const H5T_t *dt, htri_t internal) FUNC_ENTER_NOAPI(H5T_get_class, H5T_NO_CLASS); assert(dt); - + /* Lie to the user if they have a VL string and tell them it's in the string class */ if(dt->shared->type==H5T_VLEN && dt->shared->u.vlen.type==H5T_VLEN_STRING) ret_value=H5T_STRING; else ret_value=dt->shared->type; - /* Externally, a VL string is a string; internally, a VL string is a VL. */ - if(internal) { + /* Externally, a VL string is a string; internally, a VL string is a VL. */ + if(internal) { ret_value=dt->shared->type; } else { if(H5T_IS_VL_STRING(dt->shared)) @@ -1946,7 +1946,7 @@ H5Tdetect_class(hid_t type, H5T_class_t cls) FUNC_ENTER_API(H5Tdetect_class, FAIL); H5TRACE2("t","iTt",type,cls); - + /* Check args */ if (NULL == (dt = H5I_object_verify(type,H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_NO_CLASS, "not a data type"); @@ -1987,7 +1987,7 @@ H5T_detect_class (const H5T_t *dt, H5T_class_t cls) htri_t ret_value=FALSE; /* Return value */ FUNC_ENTER_NOAPI(H5T_detect_class, FAIL); - + assert(dt); assert(cls>H5T_NO_CLASS && cls<H5T_NCLASSES); @@ -2048,7 +2048,7 @@ H5Tis_variable_str(hid_t dtype_id) FUNC_ENTER_API(H5Tis_variable_str, FAIL); H5TRACE1("t","i",dtype_id); - + /* Check args */ if (NULL == (dt = H5I_object_verify(dtype_id,H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); @@ -2057,9 +2057,9 @@ H5Tis_variable_str(hid_t dtype_id) ret_value=H5T_IS_VL_STRING(dt->shared); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value); } - + /*------------------------------------------------------------------------- * Function: H5Tget_size @@ -2091,7 +2091,7 @@ H5Tget_size(hid_t type_id) /* Check args */ if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype"); - + /* size */ ret_value = H5T_get_size(dt); @@ -2184,7 +2184,7 @@ H5Tget_super(hid_t type) { H5T_t *dt=NULL, *super=NULL; hid_t ret_value; - + FUNC_ENTER_API(H5Tget_super, FAIL); H5TRACE1("i","i",type); @@ -2208,16 +2208,16 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_super * - * Purpose: Private function for H5Tget_super. Returns the type from - * which TYPE is derived. In the case of an enumeration type + * Purpose: Private function for H5Tget_super. Returns the type from + * which TYPE is derived. In the case of an enumeration type * the return value is an integer type. * * Return: Success: Data type for base data type. * - * Failure: NULL + * Failure: NULL * * Programmer: Raymond Lu - * October 9, 2002 + * October 9, 2002 * * Modifications: * @@ -2227,7 +2227,7 @@ H5T_t * H5T_get_super(H5T_t *dt) { H5T_t *ret_value=NULL; - + FUNC_ENTER_NOAPI(H5T_get_super, NULL); assert(dt); @@ -2290,7 +2290,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, /* Locate or create a new conversion path */ if (NULL==(new_path=H5T_path_find(src, dst, name, func, dxpl_id))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to locate/allocate conversion path"); - + /* * Notify all other functions to recalculate private data since some * functions might cache a list of conversion functions. For @@ -2369,7 +2369,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, /* Free old path */ H5T_print_stats(old_path, &nprint); old_path->cdata.command = H5T_CONV_FREE; - if ((old_path->func)(tmp_sid, tmp_did, &(old_path->cdata), + if ((old_path->func)(tmp_sid, tmp_did, &(old_path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id)<0) { #ifdef H5T_DEBUG if (H5DEBUG(T)) { @@ -2392,7 +2392,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5E_clear_stack(NULL); } /* end for */ } /* end else */ - + done: if (ret_value<0) { if (new_path) { @@ -2643,7 +2643,7 @@ H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type"); if (!pcdata) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, NULL, "no address to receive cdata pointer"); - + /* Find it */ if (NULL==(path=H5T_path_find(src, dst, NULL, NULL, H5AC_ind_dxpl_id))) HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "conversion function not found"); @@ -2653,7 +2653,7 @@ H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata) /* Set return value */ ret_value = path->func; - + done: FUNC_LEAVE_API(ret_value); } @@ -2693,7 +2693,7 @@ H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, H5T_path_t *tpath=NULL; /*type conversion info */ H5T_t *src=NULL, *dst=NULL; /*unatomized types */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Tconvert, FAIL); H5TRACE6("e","iizxxi",src_id,dst_id,nelmts,buf,background,dxpl_id); @@ -2722,7 +2722,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Tencode * - * Purpose: Given an datatype ID, converts the object description into + * Purpose: Given an datatype ID, converts the object description into * binary in a buffer. * * Return: Success: non-negative @@ -2742,7 +2742,7 @@ H5Tencode(hid_t obj_id, void *buf, size_t *nalloc) { H5T_t *dtype; herr_t ret_value=SUCCEED; - + FUNC_ENTER_API (H5Tencode, FAIL); H5TRACE3("e","ix*z",obj_id,buf,nalloc); @@ -2783,7 +2783,7 @@ H5Tdecode(const void *buf) { H5T_t *dt; hid_t ret_value; - + FUNC_ENTER_API (H5Tdecode, FAIL); H5TRACE1("i","x",buf); @@ -2792,7 +2792,7 @@ H5Tdecode(const void *buf) if((dt = H5T_decode(buf))==NULL) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "can't decode object"); - + /* Register the type and return the ID */ if ((ret_value=H5I_register (H5I_DATATYPE, dt))<0) HGOTO_ERROR (H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type"); @@ -2803,14 +2803,14 @@ done: /*------------------------------------------------------------------------- * API functions are above; library-private functions are below... - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- */ /*------------------------------------------------------------------------- * Function: H5T_encode * - * Purpose: Private function for H5Tencode. Converts an object + * Purpose: Private function for H5Tencode. Converts an object * description into binary in a buffer. * * Return: Success: non-negative @@ -2833,7 +2833,7 @@ H5T_encode(H5T_t *obj, unsigned char *buf, size_t *nalloc) herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(H5T_encode, FAIL); - + /* Find out the size of buffer needed */ if((buf_size=H5O_raw_size(H5O_DTYPE_ID, &f, obj))==0) HGOTO_ERROR(H5E_DATATYPE, H5E_BADSIZE, FAIL, "can't find datatype size"); @@ -2862,7 +2862,7 @@ done: * Function: H5T_decode * * Purpose: Private function for H5Tdecode. Reconstructs a binary - * description of datatype and returns a new object handle. + * description of datatype and returns a new object handle. * * Return: Success: datatype ID(non-negative) * @@ -2946,7 +2946,7 @@ H5T_create(H5T_class_t type, size_t size) if(type==H5T_COMPOUND) dt->shared->u.compnd.packed=TRUE; /* Start out packed */ else if(type==H5T_OPAQUE) - /* Initialize the tag in case it's not set later. A null tag will + /* Initialize the tag in case it's not set later. A null tag will * cause problems for later operations. */ dt->shared->u.opaque.tag = H5MM_strdup(""); break; @@ -3026,7 +3026,7 @@ htri_t H5T_isa(H5G_entry_t *ent, hid_t dxpl_id) { htri_t ret_value; - + FUNC_ENTER_NOAPI(H5T_isa, FAIL); assert(ent); @@ -3061,7 +3061,7 @@ H5T_open (H5G_entry_t *ent, hid_t dxpl_id) H5T_shared_t *shared_fo=NULL; H5T_t *dt=NULL; H5T_t *ret_value; - + FUNC_ENTER_NOAPI(H5T_open, NULL); assert (ent); @@ -3136,7 +3136,7 @@ H5T_open_oid (H5G_entry_t *ent, hid_t dxpl_id) { H5T_t *dt=NULL; H5T_t *ret_value; - + FUNC_ENTER_NOAPI(H5T_open_oid, NULL); assert (ent); @@ -3236,7 +3236,7 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method) */ new_dt->shared->state = H5T_STATE_TRANSIENT; break; - + case H5T_COPY_ALL: /* * Return a transient type (locked or unlocked) or an unopened named @@ -3284,7 +3284,7 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method) } break; } /* end switch */ - + switch(new_dt->shared->type) { case H5T_COMPOUND: { @@ -3363,7 +3363,7 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method) for (i=0; i<new_dt->shared->u.enumer.nmembs; i++) { s = old_dt->shared->u.enumer.name[i]; new_dt->shared->u.enumer.name[i] = H5MM_xstrdup(s); - } + } break; case H5T_VLEN: @@ -3405,7 +3405,7 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method) /* Set return value */ ret_value=new_dt; - + done: if(ret_value==NULL) { if(new_dt->shared != NULL) @@ -3541,7 +3541,7 @@ H5T_free(H5T_t *dt) /* Close the parent */ if (dt->shared->parent && H5T_close(dt->shared->parent)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close parent data type"); - + done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5T_free() */ @@ -3584,7 +3584,7 @@ H5T_close(H5T_t *dt) if(dt->shared->state != H5T_STATE_OPEN || dt->shared->fo_count == 1) { - if(H5T_free(dt)<0) + if(H5T_free(dt)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "unable to free datatype"); H5FL_FREE(H5T_shared_t, dt->shared); @@ -3689,7 +3689,7 @@ H5T_set_size(H5T_t *dt, size_t size) size_t memb_offset, max_offset=0; size_t max_size; - if((num_membs = H5T_get_nmembers(dt))<0) + if((num_membs = H5T_get_nmembers(dt))<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to get number of members"); for(i=0; i<(unsigned)num_membs; i++) { @@ -3699,7 +3699,7 @@ H5T_set_size(H5T_t *dt, size_t size) max_index = i; } } - + max_size = H5T_get_member_size(dt, max_index); if(size<(max_offset+max_size)) @@ -3723,12 +3723,12 @@ H5T_set_size(H5T_t *dt, size_t size) dt->shared->type = H5T_VLEN; /* - * Force conversions (i.e. memory to memory conversions + * Force conversions (i.e. memory to memory conversions * should duplicate data, not point to the same VL strings) */ dt->shared->force_conv = TRUE; - /* Before we mess with the info in the union, extract the + /* Before we mess with the info in the union, extract the * values we need */ tmp_cset=dt->shared->u.atomic.u.s.cset; tmp_strpad=dt->shared->u.atomic.u.s.pad; @@ -3781,7 +3781,7 @@ H5T_set_size(H5T_t *dt, size_t size) } } /* end if */ } - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -4331,7 +4331,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, lt = md = 1; rt = H5T_g.npaths; cmp = -1; - + while (cmp && lt<rt) { md = (lt+rt) / 2; assert(H5T_g.path[md]); @@ -4352,7 +4352,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, * added to the table - QAK, 1/26/02 */ old_npaths=H5T_g.npaths; - + /* * If we didn't find the path or if the caller is specifying a new hard * conversion function then create a new path and add the new function to @@ -4397,7 +4397,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, path->func = func; path->is_hard = TRUE; } - + /* * If the path doesn't have a function by now (because it's a new path * and the caller didn't supply a hard function) then scan the soft list @@ -4439,7 +4439,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, lt = md = 1; rt = H5T_g.npaths; cmp = -1; - + while (cmp && lt<rt) { md = (lt+rt) / 2; assert(H5T_g.path[md]); @@ -4506,7 +4506,7 @@ done: } if (src_id>=0) H5I_dec_ref(src_id); if (dst_id>=0) H5I_dec_ref(dst_id); - + FUNC_LEAVE_NOAPI(ret_value); } @@ -4657,7 +4657,7 @@ H5G_entry_t * H5T_entof (H5T_t *dt) { H5G_entry_t *ret_value = NULL; - + FUNC_ENTER_NOAPI(H5T_entof, NULL); assert (dt); @@ -4681,14 +4681,14 @@ done: /*------------------------------------------------------------------------- * Function: H5T_is_immutable * - * Purpose: Check if a datatype is immutable. + * Purpose: Check if a datatype is immutable. * - * Return: TRUE + * Return: TRUE * - * FALSE + * FALSE * - * Programmer: Raymond Lu - * Friday, Dec 7, 2001 + * Programmer: Raymond Lu + * Friday, Dec 7, 2001 * * Modifications: * @@ -4714,13 +4714,13 @@ done: /*------------------------------------------------------------------------- * Function: H5T_is_named * - * Purpose: Check if a datatype is named. + * Purpose: Check if a datatype is named. * - * Return: TRUE + * Return: TRUE * - * FALSE + * FALSE * - * Programmer: Pedro Vicente + * Programmer: Pedro Vicente * Tuesday, Sep 3, 2002 * * Modifications: @@ -4752,7 +4752,7 @@ done: USAGE H5R_type_t H5Tget_ref_type(dt) H5T_t *dt; IN: datatype pointer for the reference datatype - + RETURNS Success: A reference type defined in H5Rpublic.h Failure: H5R_BADTYPE @@ -4802,7 +4802,7 @@ htri_t H5T_is_sensible(const H5T_t *dt) { htri_t ret_value; - + FUNC_ENTER_NOAPI(H5T_is_sensible, FAIL); assert(dt); @@ -4845,7 +4845,7 @@ done: H5T_t *dt; IN/OUT: Pointer to the datatype to mark H5F_t *f; IN: Pointer to the file the datatype is in H5T_vlen_type_t loc IN: location of type - + RETURNS One of two values on success: TRUE - If the location of any vlen types changed @@ -4889,7 +4889,7 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location"); if(changed>0) ret_value=changed; - + /* Check if the field changed size */ if(old_size != dt->shared->parent->shared->size) { /* Adjust the size of the array */ @@ -4901,7 +4901,7 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) case H5T_COMPOUND: /* Check each field and recurse on VL, compound and array type */ /* Sort the fields based on offsets */ H5T_sort_value(dt,NULL); - + for (i=0,accum_change=0; i<dt->shared->u.compnd.nmembs; i++) { H5T_t *memb_type; /* Member's datatype pointer */ @@ -4922,7 +4922,7 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location"); if(changed>0) ret_value=changed; - + /* Check if the field changed size */ if(old_size != memb_type->shared->size) { /* Adjust the size of the member */ @@ -5055,7 +5055,7 @@ H5T_print_stats(H5T_path_t UNUSED * path, int UNUSED * nprint/*in,out*/) #endif FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_print_stats); - + #ifdef H5T_DEBUG if (H5DEBUG(T) && path->stats.ncalls>0) { if (nprint && 0==(*nprint)++) { @@ -5083,8 +5083,8 @@ H5T_print_stats(H5T_path_t UNUSED * path, int UNUSED * nprint/*in,out*/) path->name, path->stats.nelmts, path->stats.ncalls, - path->stats.timer.utime, - path->stats.timer.stime, + path->stats.timer.utime, + path->stats.timer.stime, path->stats.timer.etime, bandwidth); } @@ -5254,7 +5254,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) /* No additional info */ break; } - + } else if (H5T_COMPOUND==dt->shared->type) { /* Compound data type */ for (i=0; i<dt->shared->u.compnd.nmembs; i++) { @@ -5275,7 +5275,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) H5T_debug(dt->shared->u.compnd.memb[i].type, stream); } fprintf(stream, "\n"); - + } else if (H5T_ENUM==dt->shared->type) { /* Enumeration data type */ fprintf(stream, " "); @@ -5289,7 +5289,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) } } fprintf(stream, "\n"); - + } else if (H5T_OPAQUE==dt->shared->type) { fprintf(stream, ", tag=\"%s\"", dt->shared->u.opaque.tag); @@ -46,7 +46,7 @@ static void H5TS_mutex_init(H5TS_mutex_t *mutex); * * USAGE * H5TS_key_destructor() - * + * * RETURNS * * DESCRIPTION @@ -75,7 +75,7 @@ H5TS_key_destructor(void *key_val) * * USAGE * H5TS_first_thread_init() - * + * * RETURNS * * DESCRIPTION @@ -119,7 +119,7 @@ H5TS_first_thread_init(void) * * USAGE * H5TS_mutex_lock(&mutex_var) - * + * * RETURNS * 0 on success and non-zero on error. * @@ -156,7 +156,7 @@ H5TS_mutex_lock(H5TS_mutex_t *mutex) mutex->owner_thread = H5MM_malloc(sizeof(pthread_t)); if (!mutex->owner_thread) { - H5E_push_stack(NULL, "H5TS_mutex_lock", __FILE__, __LINE__, + H5E_push_stack(NULL, "H5TS_mutex_lock", __FILE__, __LINE__, H5E_ERR_CLS_g, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed"); return FAIL; } @@ -193,7 +193,7 @@ H5TS_mutex_lock(H5TS_mutex_t *mutex) * * USAGE * H5TS_mutex_unlock(&mutex_var) - * + * * RETURNS * 0 on success and non-zero on error. * @@ -245,7 +245,7 @@ H5TS_mutex_unlock(H5TS_mutex_t *mutex) * * USAGE * H5TS_cancel_count_inc() - * + * * RETURNS * 0 on success non-zero error code on error. * @@ -309,7 +309,7 @@ H5TS_cancel_count_inc(void) * * USAGE * H5TS_cancel_count_dec() - * + * * RETURNS * 0 on success and a non-zero error code on error. * diff --git a/src/H5Tarray.c b/src/H5Tarray.c index b33d3bf..cb78a6f 100644 --- a/src/H5Tarray.c +++ b/src/H5Tarray.c @@ -39,7 +39,7 @@ NAME H5T_init_array_interface -- Initialize interface-specific information USAGE herr_t H5T_init_array_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -88,7 +88,7 @@ H5Tarray_create(hid_t base_id, int ndims, const hsize_t dim[/* ndims */], H5T_t *dt = NULL; /* new array data type */ int i; /* local index variable */ hid_t ret_value; /* return value */ - + FUNC_ENTER_API(H5Tarray_create, FAIL); H5TRACE4("i","iIs*h*Is",base_id,ndims,dim,perm); @@ -210,7 +210,7 @@ H5Tget_array_ndims(hid_t type_id) { H5T_t *dt = NULL; /* pointer to array data type */ int ret_value; /* return value */ - + FUNC_ENTER_API(H5Tget_array_ndims, FAIL); H5TRACE1("Is","i",type_id); @@ -231,7 +231,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_array_ndims * - * Purpose: Private function for H5T_get_array_ndims. Query the number + * Purpose: Private function for H5T_get_array_ndims. Query the number * of dimensions for an array datatype. * * Return: Success: Number of dimensions of the array datatype @@ -248,7 +248,7 @@ int H5T_get_array_ndims(H5T_t *dt) { int ret_value; /* return value */ - + FUNC_ENTER_NOAPI(H5T_get_array_ndims, FAIL); assert(dt); @@ -282,7 +282,7 @@ H5Tget_array_dims(hid_t type_id, hsize_t dims[], int perm[]) { H5T_t *dt = NULL; /* pointer to array data type */ int ret_value; /* return value */ - + FUNC_ENTER_API(H5Tget_array_dims, FAIL); H5TRACE3("Is","i*h*Is",type_id,dims,perm); @@ -303,7 +303,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_array_dims * - * Purpose: Private function for H5T_get_array_dims. Query the sizes + * Purpose: Private function for H5T_get_array_dims. Query the sizes * of dimensions for an array datatype. * * Return: Success: Number of dimensions of the array type @@ -321,19 +321,19 @@ H5T_get_array_dims(H5T_t *dt, hsize_t dims[], int perm[]) { int ret_value; /* return value */ int i; /* Local index variable */ - + FUNC_ENTER_NOAPI(H5T_get_array_dims, FAIL); assert(dt); assert(dt->shared->type==H5T_ARRAY); /* Retrieve the sizes of the dimensions */ - if(dims) + if(dims) for(i=0; i<dt->shared->u.array.ndims; i++) dims[i]=dt->shared->u.array.dim[i]; /* Retrieve the dimension permutations */ - if(perm) + if(perm) for(i=0; i<dt->shared->u.array.ndims; i++) perm[i]=dt->shared->u.array.perm[i]; diff --git a/src/H5Tbit.c b/src/H5Tbit.c index 0049682..e3769fe 100644 --- a/src/H5Tbit.c +++ b/src/H5Tbit.c @@ -58,7 +58,7 @@ H5T_bit_copy (uint8_t *dst, size_t dst_offset, const uint8_t *src, d_idx = (int)dst_offset / 8; src_offset %= 8; dst_offset %= 8; - + /* * Get things rolling. This means copying bits until we're aligned on a * source byte. This the following example, five bits are copied to the @@ -94,7 +94,7 @@ H5T_bit_copy (uint8_t *dst, size_t dst_offset, const uint8_t *src, } size -= nbits; } - + /* * The middle bits. We are aligned on a source byte which needs to be * copied to two (or one in the degenerate case) destination bytes. @@ -110,7 +110,7 @@ H5T_bit_copy (uint8_t *dst, size_t dst_offset, const uint8_t *src, * +---------------+---------------+ * dst[d_idx+1] dst[d_idx] * - * + * * Calculate shifts and masks. See diagrams below. MASK_LO in this * example is 0x1f (the low five bits) and MASK_HI is 0xe0 (the high three * bits). SHIFT is three since the source must be shifted right three bits @@ -119,7 +119,7 @@ H5T_bit_copy (uint8_t *dst, size_t dst_offset, const uint8_t *src, shift = (int)dst_offset; mask_lo = (1<<(8-shift))-1; mask_hi = (~mask_lo) & 0xff; - + for (/*void*/; size>8; size-=8, d_idx++, s_idx++) { if (shift) { dst[d_idx+0] &= ~(mask_lo<<shift); @@ -159,13 +159,13 @@ H5T_bit_copy (uint8_t *dst, size_t dst_offset, const uint8_t *src, * * Purpose: Simulation of hardware shifting. Shifts a bit vector * in a way similar to shifting a variable value, like - * value <<= 3, or value >>= 16. SHIFT_DIST is positive for + * value <<= 3, or value >>= 16. SHIFT_DIST is positive for * left shift, negative for right shift. The bit vector starts * at OFFSET and is SIZE long. The caller has to make sure * SIZE+OFFSET doesn't exceed the size of BUF. * * For example, if we have a bit sequence 00011100, offset=2, - * size=3, shift_dist=2, the result will be 00010000. + * size=3, shift_dist=2, the result will be 00010000. * * Return: void * @@ -188,23 +188,23 @@ H5T_bit_shift (uint8_t *buf, ssize_t shift_dist, size_t offset, size_t size) assert(size); if(!shift_dist) - goto done; + goto done; if((size_t)ABS(shift_dist) >= size) { H5T_bit_set(buf, offset, size, 0); goto done; } - + tmp_buf = (uint8_t*)H5MM_calloc(size/8+1); assert(tmp_buf); - /* Shift vector by making copies */ - if(shift_dist > 0) { /* left shift */ + /* Shift vector by making copies */ + if(shift_dist > 0) { /* left shift */ /* Copy part to be shifted to a temporary buffer */ H5T_bit_copy (tmp_buf, 0, buf, offset, (size_t)(size-shift_dist)); - + /* Copy it back to the original buffer */ H5T_bit_copy (buf, offset+shift_dist, tmp_buf, 0, (size_t)(size-shift_dist)); - + /* Zero-set the left part*/ H5T_bit_set(buf, offset, (size_t)shift_dist, 0); } else { /* right shift */ @@ -246,7 +246,7 @@ H5T_bit_get_d (uint8_t *buf, size_t offset, size_t size) hsize_t val=0; size_t i, hs; hsize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOFUNC(H5T_bit_get_d); assert (8*sizeof(val)>=size); @@ -293,7 +293,7 @@ void H5T_bit_set_d (uint8_t *buf, size_t offset, size_t size, hsize_t val) { size_t i, hs; - + assert (8*sizeof(val)>=size); switch (H5T_native_order_g) { @@ -351,7 +351,7 @@ H5T_bit_set (uint8_t *buf, size_t offset, size_t size, hbool_t value) } size -= nbits; } - + /* The middle bytes */ while (size>=8) { buf[idx++] = value ? 0xff : 0x00; @@ -376,7 +376,7 @@ H5T_bit_set (uint8_t *buf, size_t offset, size_t size, hbool_t value) * of a bit vector. The region begins at OFFSET and continues * for SIZE bits, but the region can be searched from the least * significat end toward the most significant end(H5T_BIT_LSB - * as DIRECTION), or from the most significant end to the least + * as DIRECTION), or from the most significant end to the least * significant end(H5T_BIT_MSB as DIRECTION). * * Return: Success: The position of the bit found, relative to @@ -411,7 +411,7 @@ H5T_bit_find (uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, /* Calculate index */ idx = (ssize_t)(offset / 8); offset %= 8; - + /* Beginning */ if (offset) { for (iu=offset; iu<8 && size>0; iu++, size--) { @@ -443,7 +443,7 @@ H5T_bit_find (uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, /* Calculate index */ idx = (ssize_t)((offset+size-1) / 8); offset %= 8; - + /* Beginning */ if (size>8-offset && (offset+size)%8) { for (iu=(offset+size)%8; iu>0; --iu, --size) { @@ -472,7 +472,7 @@ H5T_bit_find (uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, } break; } - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -481,10 +481,10 @@ done: /*------------------------------------------------------------------------- * Function: H5T_bit_inc * - * Purpose: Increment part of a bit field by adding 1. The bit field + * Purpose: Increment part of a bit field by adding 1. The bit field * starts with bit position START and is SIZE bits long. * - * Return: Success: The carry-out value. One if overflows, + * Return: Success: The carry-out value. One if overflows, * zero otherwise. * * Failure: Negative @@ -550,7 +550,7 @@ H5T_bit_inc(uint8_t *buf, size_t start, size_t size) /*------------------------------------------------------------------------- * Function: H5T_bit_dec * - * Purpose: decrement part of a bit field by substracting 1. The bit + * Purpose: decrement part of a bit field by substracting 1. The bit * field starts with bit position START and is SIZE bits long. * * Return: Success: The "borrow-in" value. It's one if underflows, @@ -572,7 +572,7 @@ H5T_bit_dec(uint8_t *buf, size_t start, size_t size) size_t pos = start % 8; uint8_t tmp; unsigned borrow = 0; - + /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_bit_dec); @@ -581,21 +581,21 @@ H5T_bit_dec(uint8_t *buf, size_t start, size_t size) /* The first partial byte */ if ((size+start-1)/8 > idx) { /*bit sequence doesn't end in the same byte as starts*/ - /* Example: a sequence like 11000100 and start = 3. We substract 00001000 from - * it and get 10111100. If a sequence is 00000111, we do right shift for START + /* Example: a sequence like 11000100 and start = 3. We substract 00001000 from + * it and get 10111100. If a sequence is 00000111, we do right shift for START * bits and get 00000000. So we need to borrow from higher byte when we substract * 00001000. - */ + */ if(!(buf[idx] >> pos)) borrow = 1; buf[idx] -= 1 << pos; idx++; size -= (8 - pos); } else { /* bit sequence ends in the same byte as starts */ - /* Example: a sequence like 11000100 and pos=3, size=3. We substract 00001000 + /* Example: a sequence like 11000100 and pos=3, size=3. We substract 00001000 * and get 10111100. A bit is borrowed from 6th bit(buf[idx]>>6=00000010, tmp>>6=00000011, * not equal). We need to put this bit back by increment 1000000. - */ + */ tmp = buf[idx]; buf[idx] -= 1 << pos; if((buf[idx] >> (pos+size)) != tmp >> (pos+size)) { @@ -604,7 +604,7 @@ H5T_bit_dec(uint8_t *buf, size_t start, size_t size) } goto done; } - + /* The middle bytes */ while (borrow && size>=8) { if(buf[idx]) @@ -632,7 +632,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_bit_neg * - * Purpose: negate part of a bit sequence. The bit + * Purpose: negate part of a bit sequence. The bit * field starts with bit position START and is SIZE bits long. * * Return: void @@ -650,7 +650,7 @@ H5T_bit_neg(uint8_t *buf, size_t start, size_t size) size_t idx = start / 8; size_t pos = start % 8; uint8_t tmp; - + /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_bit_neg); diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index cd2929c..c98543d 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -41,7 +41,7 @@ NAME H5T_init_commit_interface -- Initialize interface-specific information USAGE herr_t H5T_init_commit_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -79,7 +79,7 @@ H5Tcommit(hid_t loc_id, const char *name, hid_t type_id) H5G_entry_t *loc = NULL; H5T_t *type = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Tcommit, FAIL) H5TRACE3("e","isi",loc_id,name,type_id); @@ -110,8 +110,8 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Peter Cao - * May 17, 2005 + * Programmer: Peter Cao + * May 17, 2005 * * Modifications: * @@ -123,7 +123,7 @@ H5Tcommit_expand(hid_t loc_id, const char *name, hid_t type_id, hid_t tcpl_id, h H5G_entry_t *loc = NULL; H5T_t *type = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Tcommit_expand, FAIL) /* Check arguments */ @@ -172,8 +172,8 @@ done: * * Modifications: * Added datatype creation & access property lists - * Peter Cao - * May 17, 2005 + * Peter Cao + * May 17, 2005 * *------------------------------------------------------------------------- */ @@ -184,7 +184,7 @@ H5T_commit(H5G_entry_t *loc, const char *name, H5T_t *type, hid_t dxpl_id, H5F_t *file = NULL; H5P_genplist_t *tc_plist; /* Property list created */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5T_commit) HDassert (loc); @@ -282,7 +282,7 @@ H5Tcommitted(hid_t type_id) { H5T_t *type = NULL; htri_t ret_value; /* Return value */ - + FUNC_ENTER_API(H5Tcommitted, FAIL) H5TRACE1("t","i",type_id); diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c index 37c79ed..62681ce 100644 --- a/src/H5Tcompound.c +++ b/src/H5Tcompound.c @@ -41,7 +41,7 @@ NAME H5T_init_compound_interface -- Initialize interface-specific information USAGE herr_t H5T_init_compound_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -104,7 +104,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_member_offset * - * Purpose: Private function for H5Tget_member_offset. Returns the byte + * Purpose: Private function for H5Tget_member_offset. Returns the byte * offset of the beginning of a member with respect to the * beginning of the compound datatype datum. * @@ -221,7 +221,7 @@ H5Tget_member_type(hid_t type_id, unsigned membno) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to retrieve member type") if ((ret_value = H5I_register(H5I_DATATYPE, memb_dt)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable register datatype atom") - + done: if(ret_value<0) { if(memb_dt!=NULL) @@ -236,17 +236,17 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_member_type * - * Purpose: Private function for H5Tget_member_type. Returns the data + * Purpose: Private function for H5Tget_member_type. Returns the data * type of the specified member. * * Return: Success: A copy of the member datatype; * modifying the returned datatype does not * modify the member type. * - * Failure: NULL + * Failure: NULL * * Programmer: Raymond Lu - * October 8, 2002 + * October 8, 2002 * * Modifications: * @@ -261,11 +261,11 @@ H5T_get_member_type(const H5T_t *dt, unsigned membno) assert(dt); assert(membno < dt->shared->u.compnd.nmembs); - + /* Copy datatype into an atom */ if (NULL == (ret_value = H5T_copy(dt->shared->u.compnd.memb[membno].type, H5T_COPY_REOPEN))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy member datatype") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -296,7 +296,7 @@ H5T_get_member_size(const H5T_t *dt, unsigned membno) assert(dt); assert(membno < dt->shared->u.compnd.nmembs); - + /* Value */ ret_value = dt->shared->u.compnd.memb[membno].type->shared->size; @@ -390,7 +390,7 @@ H5Tpack(hid_t type_id) /* Pack */ if (H5T_pack(dt) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to pack compound datatype") - + done: FUNC_LEAVE_API(ret_value) } @@ -420,7 +420,7 @@ H5T_insert(const H5T_t *parent, const char *name, size_t offset, const H5T_t *me unsigned idx, i; size_t total_size; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_insert, FAIL) /* check args */ @@ -572,7 +572,7 @@ H5T_pack(const H5T_t *dt) dt->shared->u.compnd.packed=TRUE; } /* end if */ } /* end if */ - + done: FUNC_LEAVE_NOAPI(ret_value) } diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 4746b10..2076a7c 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -123,12 +123,12 @@ H5FL_BLK_DEFINE_STATIC(array_seq); * least as large as the destination. Overflows can occur when * the destination is narrower than the source. * - * xF: Integers to float-point(float or double) values where the desination - * is at least as wide as the source. This case cannot generate + * xF: Integers to float-point(float or double) values where the desination + * is at least as wide as the source. This case cannot generate * overflows. * * Fx: Float-point(float or double) values to integer where the source is - * at least as wide as the destination. Overflow can occur + * at least as wide as the destination. Overflow can occur * when the source magnitude is too large for the destination. * * The macros take a subset of these arguments in the order listed here: @@ -156,15 +156,15 @@ H5FL_BLK_DEFINE_STATIC(array_seq); * * D_MAX: The maximum possible destination value. Source values which * are larger than D_MAX generate overflows. - * + * * The macros are implemented with a generic programming technique, similar * to templates in C++. The macro which defines the "core" part of the * conversion (which actually moves the data from the source to the destination) * is invoked inside the H5T_CONV "template" macro by "gluing" it together, * which allows the core conversion macro to be invoked as necessary. - * + * * The generic "core" macros are: (others are specific to particular conversion) - * + * * Suffix Description * ------ ----------- * xX: Generic Conversion where the destination is at least as @@ -738,7 +738,7 @@ H5T_conv_noop(hid_t UNUSED src_id, hid_t UNUSED dst_id, H5T_cdata_t *cdata, case H5T_CONV_FREE: break; - + default: HGOTO_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unknown conversion command"); } @@ -857,43 +857,43 @@ H5T_conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, case 2: for (/*void*/; nelmts>=20; nelmts-=20) { H5_SWAP_BYTES(buf, 0, 1); /* 0 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 1 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 2 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 3 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 4 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 5 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 6 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 7 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 8 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 9 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 10 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 11 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 12 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 13 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 14 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 15 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 16 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 17 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 18 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 19 */ buf += buf_stride; } @@ -1329,7 +1329,7 @@ H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if (src->shared->size>=dst->shared->size) { double olap_d = HDceil((double)(dst->shared->size)/ (double)(src->shared->size-dst->shared->size)); - + olap = (size_t)olap_d; sp = dp = (uint8_t*)buf; direction = 1; @@ -1352,7 +1352,7 @@ H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Allocate space for order-reversed source buffer */ src_rev = (uint8_t*)H5MM_calloc(src->shared->size); - + /* The conversion loop */ for (elmtno=0; elmtno<nelmts; elmtno++) { @@ -1377,7 +1377,7 @@ H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, (sp<dp && sp+src->shared->size<=dp)); } #endif - + /* * Put the data in little endian order so our loops aren't so * complicated. We'll do all the conversion stuff assuming @@ -1405,11 +1405,11 @@ H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { + + if(except_ret == H5T_CONV_UNHANDLED) { H5T_bit_copy(d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, dst->shared->u.atomic.prec); } else if(except_ret == H5T_CONV_ABORT) @@ -1478,7 +1478,7 @@ H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, dp += direction * dst->shared->size; } } - + break; default: @@ -1490,7 +1490,7 @@ done: H5MM_free(src_rev); FUNC_LEAVE_NOAPI(ret_value); } - + /*------------------------------------------------------------------------- * Function: H5T_conv_struct_init @@ -1528,9 +1528,9 @@ H5T_conv_struct_init (H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, hid_t dxpl_id) H5T_t *type = NULL; hid_t tid; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5T_conv_struct_init); - + if (!priv) { /* * Allocate private data structure and arrays. @@ -1625,7 +1625,7 @@ done: } -/*------------------------------------------------------------------------- +/*------------------------------------------------------------------------- * Function: H5T_conv_struct * * Purpose: Converts between compound data types. This is a soft @@ -1636,7 +1636,7 @@ done: * If sizeof detination type <= sizeof source type then * Convert member to destination type; * Move member as far left as possible; - * + * * For I=NELMTS..1 do * If not destination type then * Convert member to destination type; @@ -1839,7 +1839,7 @@ H5T_conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Some other command we don't know about yet.*/ HGOTO_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unknown conversion command"); } - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -1860,7 +1860,7 @@ done: * Move memb to BKG buffer for all elements * Else * Move member as far left as possible for all elements - * + * * For each member of the struct (in reverse order) * If not destination type then * Convert member to destination type for all elements @@ -1888,7 +1888,7 @@ done: * all of the field1's, then all field2's, etc. This can * drastically reduce the number of calls to H5T_convert() and * thereby eliminate most of the conversion constant overhead. - * + * * Robb Matzke, 2000-05-17 * Added the BKG_STRIDE argument to fix a design bug. If * BUF_STRIDE and BKG_STRIDE are both non-zero then each @@ -1940,7 +1940,7 @@ H5T_conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data"); priv = (H5T_conv_struct_t *)(cdata->priv); src2dst = priv->src2dst; - + /* * If the destination type is not larger than the source type then * this conversion function is guaranteed to work (provided all @@ -2014,7 +2014,7 @@ H5T_conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, H5T_sort_value(src, NULL); H5T_sort_value(dst, NULL); - /* + /* * Calculate strides. If BUF_STRIDE is non-zero then convert one * data element at every BUF_STRIDE bytes through the main buffer * (BUF), leaving the result of each conversion at the same @@ -2106,7 +2106,7 @@ H5T_conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /* Some other command we don't know about yet.*/ HGOTO_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unknown conversion command"); } - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -2138,7 +2138,7 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) unsigned length; /*nelmts in map array */ unsigned i, j; /*counters */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5T_conv_enum_init); cdata->need_bkg = H5T_BKG_NO; @@ -2174,7 +2174,7 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) * * A: The source data type size matches one of our native data type * sizes. - * + * * B: After casting the source value bit pattern to a native type * the size of the range of values is less than 20% larger than * the number of values. @@ -2284,7 +2284,7 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_conv_cb_t cb_struct; /*conversion callback structure */ H5T_conv_ret_t except_ret; /*return of callback function */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_enum, FAIL); switch (cdata->command) { @@ -2332,7 +2332,7 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * conversion algorithm, which is turned on by non-zero priv->length */ H5T_sort_name(dst, NULL); if (!priv->length) H5T_sort_value(src, NULL); - + /* * Direction of conversion. */ @@ -2349,7 +2349,7 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, s = buf + (nelmts-1) * src->shared->size; d = buf + (nelmts-1) * dst->shared->size; } - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID"); @@ -2357,7 +2357,7 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Get conversion exception callback property */ if (H5P_get(plist,H5D_XFER_CONV_CB_NAME,&cb_struct)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get conversion exception callback"); - + for (i=0; i<nelmts; i++, s+=src_delta, d+=dst_delta) { if (priv->length) { /* Use O(1) lookup */ @@ -2373,11 +2373,11 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /*overflow*/ except_ret = H5T_CONV_UNHANDLED; if(cb_struct.func) { /*If user's exception handler is present, use it*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, s, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { + + if(except_ret == H5T_CONV_UNHANDLED) { HDmemset(d, 0xff, dst->shared->size); } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") @@ -2406,11 +2406,11 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (lt>=rt) { except_ret = H5T_CONV_UNHANDLED; if(cb_struct.func) { /*If user's exception handler is present, use it*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { + + if(except_ret == H5T_CONV_UNHANDLED) { HDmemset(d, 0xff, dst->shared->size); } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") @@ -2442,7 +2442,7 @@ done: * * For every VL struct in the main buffer: * 1. Allocate space for temporary dst VL data (reuse buffer - * if possible) + * if possible) * 2. Copy VL data from src buffer into dst buffer * 3. Convert VL data into dst representation * 4. Allocate buffer in dst heap @@ -2464,9 +2464,9 @@ done: * destination values are packed. * * Raymond Lu, 26 June, 2002 - * Background buffer is used for freeing heap objects storing - * old data. At this moment, it only frees the first level of - * VL datatype. It doesn't handle nested VL datatypes. + * Background buffer is used for freeing heap objects storing + * old data. At this moment, it only frees the first level of + * VL datatype. It doesn't handle nested VL datatypes. * *------------------------------------------------------------------------- */ @@ -2581,7 +2581,7 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if ((tmp_buf=H5FL_BLK_MALLOC(vlen_seq,tmp_buf_size))==NULL) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion"); } /* end if */ - + /* Get the allocation info */ if(H5T_vlen_get_alloc_info(dxpl_id,&vl_alloc_info)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve VL allocation info"); @@ -2654,7 +2654,7 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, dst_size=seq_len*dst_base_size; /* Check if conversion buffer is large enough, resize if - * necessary */ + * necessary */ if(conv_buf_size<MAX(src_size,dst_size)) { /* Only allocate conversion buffer in H5T_VLEN_MIN_CONF_BUF_SIZE increments */ conv_buf_size=((MAX(src_size,dst_size)/H5T_VLEN_MIN_CONF_BUF_SIZE)+1)*H5T_VLEN_MIN_CONF_BUF_SIZE; @@ -2677,7 +2677,7 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion"); } /* end if */ - /* If we are writing and there is a nested VL type, read + /* If we are writing and there is a nested VL type, read * the sequence into the background buffer */ if(nested) { uint8_t *tmp=b; @@ -2754,7 +2754,7 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, default: /* Some other command we don't know about yet.*/ HGOTO_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unknown conversion command"); } /* end switch */ - + done: /* If the conversion buffer doesn't need to be freed, reset its pointer */ if(write_to_file && noop_conv) @@ -2916,7 +2916,7 @@ H5T_conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, default: /* Some other command we don't know about yet.*/ HGOTO_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unknown conversion command"); } /* end switch */ - + done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5T_conv_array() */ @@ -2972,7 +2972,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_conv_ret_t except_ret; /*return of callback function */ hbool_t reverse; /*if reverse the order of destination */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_i_i, FAIL); switch (cdata->command) { @@ -2990,7 +2990,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "destination size is too large"); cdata->need_bkg = H5T_BKG_NO; break; - + case H5T_CONV_FREE: break; @@ -3012,7 +3012,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if (src->shared->size>=dst->shared->size) { double olap_d = HDceil((double)(dst->shared->size)/ (double)(src->shared->size-dst->shared->size)); - + olap = (size_t)olap_d; sp = dp = (uint8_t*)buf; direction = 1; @@ -3058,7 +3058,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, assert ((dp<sp && dp+dst->shared->size<=sp) || (sp<dp && sp+src->shared->size<=dp)); } #endif - + /* * Put the data in little endian order so our loops aren't so * complicated. We'll do all the conversion stuff assuming @@ -3091,7 +3091,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Set the destination to zero. */ H5T_bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, FALSE); - + } else if (H5T_SGN_NONE==src->shared->u.atomic.u.i.sign && H5T_SGN_NONE==dst->shared->u.atomic.u.i.sign) { /* @@ -3109,11 +3109,11 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { + + if(except_ret == H5T_CONV_UNHANDLED) { H5T_bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, TRUE); } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") @@ -3124,7 +3124,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, dst->shared->u.atomic.prec); } - + } else if (H5T_SGN_2==src->shared->u.atomic.u.i.sign && H5T_SGN_NONE==dst->shared->u.atomic.u.i.sign) { /* @@ -3138,11 +3138,11 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /*overflow - source is negative*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { + + if(except_ret == H5T_CONV_UNHANDLED) { H5T_bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, FALSE); } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") @@ -3158,10 +3158,10 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /*overflow - source is positive*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } - + if(except_ret == H5T_CONV_UNHANDLED) H5T_bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, TRUE); else if(except_ret == H5T_CONV_ABORT) @@ -3173,7 +3173,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, dst->shared->u.atomic.prec); } - + } else if (H5T_SGN_NONE==src->shared->u.atomic.u.i.sign && H5T_SGN_2==dst->shared->u.atomic.u.i.sign) { /* @@ -3185,11 +3185,11 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { + + if(except_ret == H5T_CONV_UNHANDLED) { H5T_bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec-1, TRUE); H5T_bit_set (d, (dst->shared->u.atomic.offset + dst->shared->u.atomic.prec-1), 1, FALSE); } else if(except_ret == H5T_CONV_ABORT) @@ -3217,16 +3217,16 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, ssize_t sfz = H5T_bit_find (s, src->shared->u.atomic.offset, src->shared->u.atomic.prec-1, H5T_BIT_MSB, FALSE); size_t fz = (size_t)sfz; - + if (sfz>=0 && fz+1>=dst->shared->u.atomic.prec) { /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { + + if(except_ret == H5T_CONV_UNHANDLED) { H5T_bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec-1, FALSE); H5T_bit_set (d, (dst->shared->u.atomic.offset + dst->shared->u.atomic.prec-1), 1, TRUE); } else if(except_ret == H5T_CONV_ABORT) @@ -3240,7 +3240,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else { H5T_bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, dst->shared->u.atomic.prec); } - + } else { /* * Source and destination are both signed but the source @@ -3252,11 +3252,11 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { + + if(except_ret == H5T_CONV_UNHANDLED) { H5T_bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec-1, TRUE); H5T_bit_set (d, (dst->shared->u.atomic.offset + dst->shared->u.atomic.prec-1), 1, FALSE); } else if(except_ret == H5T_CONV_ABORT) @@ -3316,7 +3316,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, dp += direction * dst->shared->size; } } - + break; default: @@ -3393,7 +3393,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_conv_ret_t except_ret; /*return of callback function */ hbool_t reverse; /*if reverse the order of destination */ herr_t ret_value=SUCCEED; /*return value */ - + FUNC_ENTER_NOAPI(H5T_conv_f_f, FAIL); switch (cdata->command) { @@ -3488,7 +3488,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, (sp<dp && sp+src_p->shared->size<=dp)); } #endif - + /* * Put the data in little endian order so our loops aren't so * complicated. We'll do all the conversion stuff assuming @@ -3538,9 +3538,9 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_bit_copy (d, dst.u.f.sign, s, src.u.f.sign, 1); H5T_bit_set (d, dst.u.f.epos, dst.u.f.esize, TRUE); H5T_bit_set (d, dst.u.f.mpos, dst.u.f.msize, FALSE); - /*If the destination no implied mantissa bit, we'll need to set + /*If the destination no implied mantissa bit, we'll need to set *the 1st bit of mantissa to 1. The Intel-Linux long double is - *this case.*/ + *this case.*/ if (H5T_NORM_NONE==dst.u.f.norm) H5T_bit_set (d, dst.u.f.mpos+dst.u.f.msize-1, 1, TRUE); } else if(except_ret == H5T_CONV_HANDLED) { @@ -3556,7 +3556,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_BIT_LSB, TRUE)<0 && H5T_bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { /*This is a special case for the source of no implied mantissa bit. - *If the exponent bits are all 1s and only the 1st bit of mantissa + *If the exponent bits are all 1s and only the 1st bit of mantissa *is set to 1. It's infinity. The Intel-Linux "long double" is this case.*/ /* +Inf or -Inf */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ @@ -3574,9 +3574,9 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_bit_copy (d, dst.u.f.sign, s, src.u.f.sign, 1); H5T_bit_set (d, dst.u.f.epos, dst.u.f.esize, TRUE); H5T_bit_set (d, dst.u.f.mpos, dst.u.f.msize, FALSE); - /*If the destination no implied mantissa bit, we'll need to set + /*If the destination no implied mantissa bit, we'll need to set *the 1st bit of mantissa to 1. The Intel-Linux long double is - *this case.*/ + *this case.*/ if (H5T_NORM_NONE==dst.u.f.norm) H5T_bit_set (d, dst.u.f.mpos+dst.u.f.msize-1, 1, TRUE); } else if(except_ret == H5T_CONV_HANDLED) { @@ -3619,7 +3619,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * the exponent bias yet. */ expo = H5T_bit_get_d(s, src.u.f.epos, src.u.f.esize); - + if(expo==0) denormalized=TRUE; @@ -3644,7 +3644,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, assert("normalization method not implemented yet" && 0); HDabort(); } - + /* * The sign for the destination is the same as the sign for the * source in all cases. @@ -3706,11 +3706,11 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { + + if(except_ret == H5T_CONV_UNHANDLED) { expo = expo_max; H5T_bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); msize = 0; @@ -3742,7 +3742,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, implied = 2; } } else if(H5T_bit_get_d(s, mpos+bitno-1, 1) && denormalized) - /*For either source or destination, denormalized value doesn't increment carry.*/ + /*For either source or destination, denormalized value doesn't increment carry.*/ H5T_bit_inc(s, mpos+bitno-1, 1+msize-bitno); } else @@ -3768,7 +3768,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } if (mrsh+msize>=dst.u.f.msize) { H5T_bit_copy(d, dst.u.f.mpos, - s, (mpos+msize+mrsh-dst.u.f.msize), + s, (mpos+msize+mrsh-dst.u.f.msize), dst.u.f.msize-mrsh); } else { H5T_bit_copy(d, dst.u.f.mpos+dst.u.f.msize-(mrsh+msize), @@ -3777,7 +3777,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, FALSE); } } - + /* Write the exponent */ if (carry) { expo++; @@ -3793,11 +3793,11 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { + + if(except_ret == H5T_CONV_UNHANDLED) { expo = expo_max; H5T_bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); } else if(except_ret == H5T_CONV_ABORT) @@ -3857,9 +3857,9 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, dp += direction * dst_p->shared->size; } } - + break; - + default: HGOTO_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unknown conversion command"); } @@ -3904,7 +3904,7 @@ H5T_conv_s_s (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, uint8_t *s, *sp, *d, *dp; /*src and dst traversal pointers*/ uint8_t *dbuf=NULL; /*temp buf for overlap convers. */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_s_s, FAIL); switch (cdata->command) { @@ -3966,7 +3966,7 @@ H5T_conv_s_s (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Allocate the overlap buffer */ if (NULL==(dbuf=H5MM_malloc(dst->shared->size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for string conversion"); - + /* The conversion loop. */ for (elmtno=0; elmtno<nelmts; elmtno++) { @@ -3993,7 +3993,7 @@ H5T_conv_s_s (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, (sp<dp && sp+src->shared->size<=dp)); } #endif - + /* Copy characters from source to destination */ switch (src->shared->u.atomic.u.s.pad) { case H5T_STR_NULLTERM: @@ -4044,12 +4044,12 @@ H5T_conv_s_s (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, d[nchars++] = '\0'; d[dst->shared->size-1] = '\0'; break; - + case H5T_STR_NULLPAD: while (nchars<dst->shared->size) d[nchars++] = '\0'; break; - + case H5T_STR_SPACEPAD: while (nchars<dst->shared->size) d[nchars++] = ' '; @@ -4777,7 +4777,7 @@ H5T_conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5T_conv_ushort_schar, FAIL); - + H5T_CONV_Us(USHORT, SCHAR, unsigned short, signed char, -, SCHAR_MAX); done: @@ -4843,7 +4843,7 @@ H5T_conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5T_conv_short_ushort, FAIL); - + H5T_CONV_su(SHORT, USHORT, short, unsigned short, -, -); done: @@ -5404,7 +5404,7 @@ H5T_conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5T_conv_uint_uchar, FAIL); - + H5T_CONV_Uu(UINT, UCHAR, unsigned, unsigned char, -, UCHAR_MAX); done: @@ -7276,7 +7276,7 @@ H5T_conv_schar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_schar_float, FAIL); H5T_CONV_xF(SCHAR, FLOAT, signed char, float, -, -); @@ -7308,7 +7308,7 @@ H5T_conv_schar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_schar_double, FAIL); H5T_CONV_xF(SCHAR, DOUBLE, signed char, double, -, -); @@ -7321,7 +7321,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_schar_ldouble * - * Purpose: Convert native signed char to native long double using + * Purpose: Convert native signed char to native long double using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -7341,7 +7341,7 @@ H5T_conv_schar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_schar_ldouble, FAIL); H5T_CONV_xF(SCHAR, LDOUBLE, signed char, long double, -, -); @@ -7374,7 +7374,7 @@ H5T_conv_uchar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_uchar_float, FAIL); H5T_CONV_xF(UCHAR, FLOAT, unsigned char, float, -, -); @@ -7406,7 +7406,7 @@ H5T_conv_uchar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_uchar_double, FAIL); H5T_CONV_xF(UCHAR, DOUBLE, unsigned char, double, -, -); @@ -7419,7 +7419,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_uchar_ldouble * - * Purpose: Convert native unsigned char to native long double using + * Purpose: Convert native unsigned char to native long double using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -7439,7 +7439,7 @@ H5T_conv_uchar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_uchar_ldouble, FAIL); H5T_CONV_xF(UCHAR, LDOUBLE, unsigned char, long double, -, -); @@ -7472,7 +7472,7 @@ H5T_conv_short_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_short_float, FAIL); H5T_CONV_xF(SHORT, FLOAT, short, float, -, -); @@ -7504,7 +7504,7 @@ H5T_conv_short_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_short_double, FAIL); H5T_CONV_xF(SHORT, DOUBLE, short, double, -, -); @@ -7537,7 +7537,7 @@ H5T_conv_short_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_short_ldouble, FAIL); H5T_CONV_xF(SHORT, LDOUBLE, short, long double, -, -); @@ -7570,7 +7570,7 @@ H5T_conv_ushort_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ushort_float, FAIL); H5T_CONV_xF(USHORT, FLOAT, unsigned short, float, -, -); @@ -7602,7 +7602,7 @@ H5T_conv_ushort_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ushort_double, FAIL); H5T_CONV_xF(USHORT, DOUBLE, unsigned short, double, -, -); @@ -7635,7 +7635,7 @@ H5T_conv_ushort_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ushort_ldouble, FAIL); H5T_CONV_xF(USHORT, LDOUBLE, unsigned short, long double, -, -); @@ -7668,7 +7668,7 @@ H5T_conv_int_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_int_float, FAIL); H5T_CONV_xF(INT, FLOAT, int, float, -, -); @@ -7700,7 +7700,7 @@ H5T_conv_int_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_int_double, FAIL); H5T_CONV_xF(INT, DOUBLE, int, double, -, -); @@ -7733,7 +7733,7 @@ H5T_conv_int_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_int_ldouble, FAIL); H5T_CONV_xF(INT, LDOUBLE, int, long double, -, -); @@ -7747,7 +7747,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_uint_float * - * Purpose: Convert native unsigned integer to native float using + * Purpose: Convert native unsigned integer to native float using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -7766,7 +7766,7 @@ H5T_conv_uint_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_uint_float, FAIL); H5T_CONV_xF(UINT, FLOAT, unsigned int, float, -, -); @@ -7779,7 +7779,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_uint_double * - * Purpose: Convert native unsigned integer to native double using + * Purpose: Convert native unsigned integer to native double using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -7798,7 +7798,7 @@ H5T_conv_uint_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_uint_double, FAIL); H5T_CONV_xF(UINT, DOUBLE, unsigned int, double, -, -); @@ -7811,7 +7811,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_uint_ldouble * - * Purpose: Convert native unsigned integer to native long double using + * Purpose: Convert native unsigned integer to native long double using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -7831,7 +7831,7 @@ H5T_conv_uint_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_uint_ldouble, FAIL); H5T_CONV_xF(UINT, LDOUBLE, unsigned int, long double, -, -); @@ -7864,7 +7864,7 @@ H5T_conv_long_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_long_float, FAIL); H5T_CONV_xF(LONG, FLOAT, long, float, -, -); @@ -7896,7 +7896,7 @@ H5T_conv_long_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_long_double, FAIL); H5T_CONV_xF(LONG, DOUBLE, long, double, -, -); @@ -7929,7 +7929,7 @@ H5T_conv_long_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_long_ldouble, FAIL); H5T_CONV_xF(LONG, LDOUBLE, long, long double, -, -); @@ -7963,7 +7963,7 @@ H5T_conv_ulong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ulong_float, FAIL); H5T_CONV_xF(ULONG, FLOAT, unsigned long, float, -, -); @@ -7997,7 +7997,7 @@ H5T_conv_ulong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ulong_double, FAIL); H5T_CONV_xF(ULONG, DOUBLE, unsigned long, double, -, -); @@ -8011,7 +8011,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ulong_ldouble * - * Purpose: Convert native unsigned long to native long double using + * Purpose: Convert native unsigned long to native long double using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8031,7 +8031,7 @@ H5T_conv_ulong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ulong_ldouble, FAIL); H5T_CONV_xF(ULONG, LDOUBLE, unsigned long, long double, -, -); @@ -8064,7 +8064,7 @@ H5T_conv_llong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_llong_float, FAIL); H5T_CONV_xF(LLONG, FLOAT, long_long, float, -, -); @@ -8096,7 +8096,7 @@ H5T_conv_llong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_llong_double, FAIL); H5T_CONV_xF(LLONG, DOUBLE, long_long, double, -, -); @@ -8109,7 +8109,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_llong_ldouble * - * Purpose: Convert native long long to native long double using + * Purpose: Convert native long long to native long double using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8129,7 +8129,7 @@ H5T_conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_llong_ldouble, FAIL); H5T_CONV_xF(LLONG, LDOUBLE, long_long, long double, -, -); @@ -8144,7 +8144,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ullong_float * - * Purpose: Convert native unsigned long long to native float using + * Purpose: Convert native unsigned long long to native float using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8163,7 +8163,7 @@ H5T_conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ullong_float, FAIL); H5T_CONV_xF(ULLONG, FLOAT, unsigned long_long, float, -, -); @@ -8176,7 +8176,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ullong_double * - * Purpose: Convert native unsigned long long to native double using + * Purpose: Convert native unsigned long long to native double using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8195,7 +8195,7 @@ H5T_conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ullong_double, FAIL); H5T_CONV_xF(ULLONG, DOUBLE, unsigned long_long, double, -, -); @@ -8208,7 +8208,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ullong_ldouble * - * Purpose: Convert native unsigned long long to native long double using + * Purpose: Convert native unsigned long long to native long double using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8228,7 +8228,7 @@ H5T_conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ullong_ldouble, FAIL); H5T_CONV_xF(ULLONG, LDOUBLE, unsigned long_long, long double, -, -); @@ -8243,7 +8243,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_float_schar * - * Purpose: Convert native float to native signed char using + * Purpose: Convert native float to native signed char using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8262,7 +8262,7 @@ H5T_conv_float_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_float_schar, FAIL); H5T_CONV_Fx(FLOAT, SCHAR, float, signed char, SCHAR_MIN, SCHAR_MAX); @@ -8275,7 +8275,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_float_uchar * - * Purpose: Convert native float to native unsigned char using + * Purpose: Convert native float to native unsigned char using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8294,7 +8294,7 @@ H5T_conv_float_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_float_uchar, FAIL); H5T_CONV_Fx(FLOAT, UCHAR, float, unsigned char, 0, UCHAR_MAX); @@ -8307,7 +8307,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_double_schar * - * Purpose: Convert native double to native signed char using + * Purpose: Convert native double to native signed char using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8326,7 +8326,7 @@ H5T_conv_double_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_double_schar, FAIL); H5T_CONV_Fx(DOUBLE, SCHAR, double, signed char, SCHAR_MIN, SCHAR_MAX); @@ -8339,7 +8339,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_double_uchar * - * Purpose: Convert native double to native unsigned char using + * Purpose: Convert native double to native unsigned char using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8358,7 +8358,7 @@ H5T_conv_double_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_double_uchar, FAIL); H5T_CONV_Fx(DOUBLE, UCHAR, double, unsigned char, 0, UCHAR_MAX); @@ -8371,7 +8371,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ldouble_schar * - * Purpose: Convert native long double to native signed char using + * Purpose: Convert native long double to native signed char using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8391,7 +8391,7 @@ H5T_conv_ldouble_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ldouble_schar, FAIL); H5T_CONV_Fx(LDOUBLE, SCHAR, long double, signed char, SCHAR_MIN, SCHAR_MAX); @@ -8405,7 +8405,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ldouble_uchar * - * Purpose: Convert native long double to native unsigned char using + * Purpose: Convert native long double to native unsigned char using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8425,7 +8425,7 @@ H5T_conv_ldouble_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ldouble_uchar, FAIL); H5T_CONV_Fx(LDOUBLE, UCHAR, long double, unsigned char, 0, UCHAR_MAX); @@ -8439,7 +8439,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_float_short * - * Purpose: Convert native float to native short using + * Purpose: Convert native float to native short using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8458,7 +8458,7 @@ H5T_conv_float_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_float_short, FAIL); H5T_CONV_Fx(FLOAT, SHORT, float, short, SHRT_MIN, SHRT_MAX); @@ -8471,7 +8471,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_float_ushort * - * Purpose: Convert native float to native unsigned short using + * Purpose: Convert native float to native unsigned short using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8490,7 +8490,7 @@ H5T_conv_float_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_float_ushort, FAIL); H5T_CONV_Fx(FLOAT, USHORT, float, unsigned short, 0, USHRT_MAX); @@ -8503,7 +8503,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_double_short * - * Purpose: Convert native double to native short using + * Purpose: Convert native double to native short using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8522,7 +8522,7 @@ H5T_conv_double_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_double_short, FAIL); H5T_CONV_Fx(DOUBLE, SHORT, double, short, SHRT_MIN, SHRT_MAX); @@ -8535,7 +8535,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_double_ushort * - * Purpose: Convert native double to native unsigned short using + * Purpose: Convert native double to native unsigned short using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8554,7 +8554,7 @@ H5T_conv_double_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_double_ushort, FAIL); H5T_CONV_Fx(DOUBLE, USHORT, double, unsigned short, 0, USHRT_MAX); @@ -8567,7 +8567,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ldouble_short * - * Purpose: Convert native long double to native short using + * Purpose: Convert native long double to native short using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8587,7 +8587,7 @@ H5T_conv_ldouble_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ldouble_short, FAIL); H5T_CONV_Fx(LDOUBLE, SHORT, long double, short, SHRT_MIN, SHRT_MAX); @@ -8601,7 +8601,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ldouble_ushort * - * Purpose: Convert native long double to native unsigned short using + * Purpose: Convert native long double to native unsigned short using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8621,7 +8621,7 @@ H5T_conv_ldouble_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ldouble_ushort, FAIL); H5T_CONV_Fx(LDOUBLE, USHORT, long double, unsigned short, 0, USHRT_MAX); @@ -8635,7 +8635,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_float_int * - * Purpose: Convert native float to native int using + * Purpose: Convert native float to native int using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8654,7 +8654,7 @@ H5T_conv_float_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_float_int, FAIL); H5T_CONV_Fx(FLOAT, INT, float, int, INT_MIN, INT_MAX); @@ -8667,7 +8667,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_float_uint * - * Purpose: Convert native float to native unsigned int using + * Purpose: Convert native float to native unsigned int using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8686,7 +8686,7 @@ H5T_conv_float_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_float_uint, FAIL); H5T_CONV_Fx(FLOAT, UINT, float, unsigned int, 0, UINT_MAX); @@ -8699,7 +8699,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_double_int * - * Purpose: Convert native double to native int using + * Purpose: Convert native double to native int using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8718,7 +8718,7 @@ H5T_conv_double_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_double_int, FAIL); H5T_CONV_Fx(DOUBLE, INT, double, int, INT_MIN, INT_MAX); @@ -8731,7 +8731,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_double_uint * - * Purpose: Convert native double to native unsigned int using + * Purpose: Convert native double to native unsigned int using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8750,7 +8750,7 @@ H5T_conv_double_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_double_uint, FAIL); H5T_CONV_Fx(DOUBLE, UINT, double, unsigned int, 0, UINT_MAX); @@ -8763,7 +8763,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ldouble_int * - * Purpose: Convert native long double to native int using + * Purpose: Convert native long double to native int using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8783,7 +8783,7 @@ H5T_conv_ldouble_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ldouble_int, FAIL); H5T_CONV_Fx(LDOUBLE, INT, long double, int, INT_MIN, INT_MAX); @@ -8797,7 +8797,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ldouble_uint * - * Purpose: Convert native long double to native unsigned int using + * Purpose: Convert native long double to native unsigned int using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8817,7 +8817,7 @@ H5T_conv_ldouble_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ldouble_uint, FAIL); H5T_CONV_Fx(LDOUBLE, UINT, long double, unsigned int, 0, UINT_MAX); @@ -8831,7 +8831,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_float_long * - * Purpose: Convert native float to native long using + * Purpose: Convert native float to native long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8850,7 +8850,7 @@ H5T_conv_float_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_float_long, FAIL); H5T_CONV_Fx(FLOAT, LONG, float, long, LONG_MIN, LONG_MAX); @@ -8863,7 +8863,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_float_ulong * - * Purpose: Convert native float to native unsigned long using + * Purpose: Convert native float to native unsigned long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8882,7 +8882,7 @@ H5T_conv_float_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_float_ulong, FAIL); H5T_CONV_Fx(FLOAT, ULONG, float, unsigned long, 0, ULONG_MAX); @@ -8895,7 +8895,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_double_long * - * Purpose: Convert native double to native long using + * Purpose: Convert native double to native long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8914,7 +8914,7 @@ H5T_conv_double_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_double_long, FAIL); H5T_CONV_Fx(DOUBLE, LONG, double, long, LONG_MIN, LONG_MAX); @@ -8927,7 +8927,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_double_ulong * - * Purpose: Convert native double to native unsigned long using + * Purpose: Convert native double to native unsigned long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8946,7 +8946,7 @@ H5T_conv_double_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_double_ulong, FAIL); H5T_CONV_Fx(DOUBLE, ULONG, double, unsigned long, 0, ULONG_MAX); @@ -8959,7 +8959,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ldouble_long * - * Purpose: Convert native long double to native long using + * Purpose: Convert native long double to native long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8979,7 +8979,7 @@ H5T_conv_ldouble_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ldouble_long, FAIL); H5T_CONV_Fx(LDOUBLE, LONG, long double, long, LONG_MIN, LONG_MAX); @@ -8993,7 +8993,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ldouble_ulong * - * Purpose: Convert native long double to native unsigned long using + * Purpose: Convert native long double to native unsigned long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -9013,7 +9013,7 @@ H5T_conv_ldouble_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ldouble_ulong, FAIL); H5T_CONV_Fx(LDOUBLE, ULONG, long double, unsigned long, 0, ULONG_MAX); @@ -9027,7 +9027,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_float_llong * - * Purpose: Convert native float to native long long using + * Purpose: Convert native float to native long long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -9047,7 +9047,7 @@ H5T_conv_float_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_float_llong, FAIL); H5T_CONV_Fx(FLOAT, LLONG, float, long_long, LLONG_MIN, LLONG_MAX); @@ -9061,7 +9061,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_float_ullong * - * Purpose: Convert native float to native unsigned long long using + * Purpose: Convert native float to native unsigned long long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -9081,7 +9081,7 @@ H5T_conv_float_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_float_ullong, FAIL); H5T_CONV_Fx(FLOAT, ULLONG, float, unsigned long_long, 0, ULLONG_MAX); @@ -9095,7 +9095,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_double_llong * - * Purpose: Convert native double to native long long using + * Purpose: Convert native double to native long long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -9115,7 +9115,7 @@ H5T_conv_double_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_double_llong, FAIL); H5T_CONV_Fx(DOUBLE, LLONG, double, long_long, LLONG_MIN, LLONG_MAX); @@ -9129,7 +9129,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_double_ullong * - * Purpose: Convert native double to native unsigned long long using + * Purpose: Convert native double to native unsigned long long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -9149,7 +9149,7 @@ H5T_conv_double_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_double_ullong, FAIL); H5T_CONV_Fx(DOUBLE, ULLONG, double, unsigned long_long, 0, ULLONG_MAX); @@ -9163,7 +9163,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ldouble_llong * - * Purpose: Convert native long double to native long long using + * Purpose: Convert native long double to native long long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -9175,7 +9175,7 @@ done: * *------------------------------------------------------------------------- */ -#if !H5_HW_FP_TO_LLONG_NOT_WORKS && H5_SW_LDOUBLE_TO_INTEGER_WORKS +#if !H5_HW_FP_TO_LLONG_NOT_WORKS && H5_SW_LDOUBLE_TO_INTEGER_WORKS herr_t H5T_conv_ldouble_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, @@ -9183,7 +9183,7 @@ H5T_conv_ldouble_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ldouble_llong, FAIL); H5T_CONV_Fx(LDOUBLE, LLONG, long double, long_long, LLONG_MIN, LLONG_MAX); @@ -9197,7 +9197,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ldouble_ullong * - * Purpose: Convert native long double to native unsigned long long using + * Purpose: Convert native long double to native unsigned long long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -9217,7 +9217,7 @@ H5T_conv_ldouble_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ldouble_ullong, FAIL); H5T_CONV_Fx(LDOUBLE, ULLONG, long double, unsigned long_long, 0, ULLONG_MAX); @@ -9231,8 +9231,8 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_f_i * - * Purpose: Convert one floating-point type to an integer. This is - * the catch-all function for float-integer conversions and + * Purpose: Convert one floating-point type to an integer. This is + * the catch-all function for float-integer conversions and * is probably not particularly fast. * * Return: Non-negative on success/Negative on failure @@ -9246,7 +9246,7 @@ done: * Wednesday, April 21, 2004 * There is a new design for exception handling like overflow, * which is passed in as a transfer property. - * + * *------------------------------------------------------------------------- */ herr_t @@ -9270,7 +9270,7 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Conversion-related variables */ hssize_t expo; /*source exponent */ hssize_t sign; /*source sign bit value */ - uint8_t *int_buf=NULL; /*buffer for temporary value */ + uint8_t *int_buf=NULL; /*buffer for temporary value */ size_t buf_size; /*buffer size for temporary value */ size_t i; /*miscellaneous counters */ size_t first; /*first bit(MSB) in an integer */ @@ -9281,7 +9281,7 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, hbool_t reverse; /*if reverse order of destination at the end */ H5T_conv_ret_t except_ret; /*return of callback function */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_f_i, FAIL); switch (cdata->command) { @@ -9335,9 +9335,9 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, direction = -1; } - /* Allocate enough space for the buffer holding temporary + /* Allocate enough space for the buffer holding temporary * converted value - */ + */ buf_size = (size_t)HDpow((double)2.0, (double)src.u.f.esize) / 8 + 1; int_buf = (uint8_t*)H5MM_calloc(buf_size); @@ -9393,10 +9393,10 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, s[i] = tmp; } } - - /*zero-set all destination bits*/ + + /*zero-set all destination bits*/ H5T_bit_set (d, dst.offset, dst.prec, FALSE); - + /* * Find the sign bit value of the source. */ @@ -9424,7 +9424,7 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } if(except_ret == H5T_CONV_UNHANDLED) { - if (H5T_SGN_2==dst.u.i.sign) + if (H5T_SGN_2==dst.u.i.sign) H5T_bit_set (d, dst.prec-1, 1, TRUE); } else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ @@ -9441,9 +9441,9 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } if(except_ret == H5T_CONV_UNHANDLED) { - if (H5T_SGN_NONE==dst.u.i.sign) + if (H5T_SGN_NONE==dst.u.i.sign) H5T_bit_set (d, dst.offset, dst.prec, TRUE); - else if (H5T_SGN_2==dst.u.i.sign) + else if (H5T_SGN_2==dst.u.i.sign) H5T_bit_set (d, dst.offset, dst.prec-1, TRUE); } else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ @@ -9451,26 +9451,26 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, goto next; } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") - } + } goto padding; } } else if (H5T_NORM_NONE==src.u.f.norm && H5T_bit_find (s, src.u.f.mpos, src.u.f.msize-1, H5T_BIT_LSB, TRUE)<0 && H5T_bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { /*This is a special case for the source of no implied mantissa bit. - *If the exponent bits are all 1s and only the 1st bit of mantissa + *If the exponent bits are all 1s and only the 1st bit of mantissa *is set to 1. It's infinity. The Intel-Linux "long double" is this case.*/ /* +Infinity or -Infinity */ if(sign) { /* -Infinity */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NINF, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NINF, src_id, dst_id, src_rev, d, cb_struct.user_data); } if(except_ret == H5T_CONV_UNHANDLED) { - if (H5T_SGN_2==dst.u.i.sign) + if (H5T_SGN_2==dst.u.i.sign) H5T_bit_set (d, dst.prec-1, 1, TRUE); } else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ @@ -9487,17 +9487,17 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } if(except_ret == H5T_CONV_UNHANDLED) { - if (H5T_SGN_NONE==dst.u.i.sign) + if (H5T_SGN_NONE==dst.u.i.sign) H5T_bit_set (d, dst.offset, dst.prec, TRUE); - else if (H5T_SGN_2==dst.u.i.sign) + else if (H5T_SGN_2==dst.u.i.sign) H5T_bit_set (d, dst.offset, dst.prec-1, TRUE); } else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ - reverse = FALSE; + reverse = FALSE; goto next; } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") - } + } goto padding; } else if (H5T_bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { @@ -9521,14 +9521,14 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, goto padding; } - + /* * Get the exponent as an unsigned quantity from the section of - * the source bit field where it's located. Not expecting + * the source bit field where it's located. Not expecting * exponent to be greater than the maximal value of hssize_t. */ expo = H5T_bit_get_d(s, src.u.f.epos, src.u.f.esize); - + /* * Calculate the true source exponent by adjusting according to * the source exponent bias. @@ -9545,15 +9545,15 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* * Get the mantissa as bit vector from the section of * the source bit field where it's located. - * Keep the little-endian order in the buffer. + * Keep the little-endian order in the buffer. * A sequence 0x01020304 will be like in the buffer, * 04 03 02 01 * | | | | * V V V V - * buf[0] buf[1] buf[2] buf[3] + * buf[0] buf[1] buf[2] buf[3] */ H5T_bit_copy(int_buf, 0, s, src.u.f.mpos, src.u.f.msize); - + /* * Restore the implicit bit for mantissa if it's implied. * Equivalent to mantissa |= (hsize_t)1<<src.u.f.msize. @@ -9561,10 +9561,10 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (H5T_NORM_IMPLIED==src.u.f.norm) H5T_bit_inc(int_buf, src.u.f.msize, 8*buf_size-src.u.f.msize); - /* - * Shift mantissa part by exponent minus mantissa size(right shift), + /* + * Shift mantissa part by exponent minus mantissa size(right shift), * or by mantissa size minus exponent(left shift). Example: Sequence - * 10...010111, expo=20, expo-msize=-3. Right-shift the sequence, we get + * 10...010111, expo=20, expo-msize=-3. Right-shift the sequence, we get * 00010...10. The last three bits were dropped. */ H5T_bit_shift(int_buf, (ssize_t)(expo-src.u.f.msize), 0, buf_size*8); @@ -9578,7 +9578,7 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* * What is the bit position for the most significant bit(MSB) of S - * which is set? This is checked before converted to negative + * which is set? This is checked before converted to negative * integer. */ sfirst = H5T_bit_find(int_buf, 0, 8*buf_size, H5T_BIT_MSB, TRUE); @@ -9591,18 +9591,18 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, */ } else if (H5T_SGN_NONE==dst.u.i.sign) { /*destination is unsigned*/ /* - * Destination is unsigned. Library's default way: If the source value - * is greater than the maximal destination value then it overflows, the + * Destination is unsigned. Library's default way: If the source value + * is greater than the maximal destination value then it overflows, the * destination will be set to the maximum possible value. When the * source is negative, underflow happens. Set the destination to be - * zero(do nothing). If user's exception handler is set, call it and - * let user handle it. + * zero(do nothing). If user's exception handler is set, call it and + * let user handle it. */ if(sign) { /*source is negative*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, src_rev, d, cb_struct.user_data); if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") @@ -9618,11 +9618,11 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } - if(except_ret == H5T_CONV_UNHANDLED) + if(except_ret == H5T_CONV_UNHANDLED) H5T_bit_set (d, dst.offset, dst.prec, TRUE); else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ @@ -9634,12 +9634,12 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(truncated && cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) - /*copy source value into it if case is ignored by user handler*/ + + if(except_ret == H5T_CONV_UNHANDLED) + /*copy source value into it if case is ignored by user handler*/ H5T_bit_copy (d, dst.offset, int_buf, 0, first+1); else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ @@ -9648,23 +9648,23 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") } - } + } } else if (H5T_SGN_2==dst.u.i.sign) { /*Destination is signed*/ if(sign) { /*source is negative*/ if(first < dst.prec-1) { if(truncated && cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { /*If this case ignored by user handler*/ + + if(except_ret == H5T_CONV_UNHANDLED) { /*If this case ignored by user handler*/ /*Convert to integer representation. Equivalent to ~(value - 1).*/ H5T_bit_dec(int_buf, 0, 8*buf_size); H5T_bit_neg(int_buf, 0, 8*buf_size); - /*copy source value into destination*/ + /*copy source value into destination*/ H5T_bit_copy (d, dst.offset, int_buf, 0, dst.prec-1); H5T_bit_set (d, (dst.offset + dst.prec-1), 1, TRUE); } else if(except_ret == H5T_CONV_ABORT) @@ -9675,13 +9675,13 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, goto next; } } else { - /* if underflows and no callback, do nothing except turn on + /* if underflows and no callback, do nothing except turn on * the sign bit because 0x80...00 is the biggest negative value. */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -9698,10 +9698,10 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else { /*source is positive*/ if (first >= dst.prec-1) { /*overflow*/ - if(cb_struct.func) { /*If user's exception handler is present, use it*/ + if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -9718,12 +9718,12 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(truncated && cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { - /*copy source value into it if case is ignored by user handler*/ + + if(except_ret == H5T_CONV_UNHANDLED) { + /*copy source value into it if case is ignored by user handler*/ H5T_bit_copy (d, dst.offset, int_buf, 0, first+1); } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") @@ -9763,7 +9763,7 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, d[i] = tmp; } } - + next: /* * If we had used a temporary buffer for the destination then we @@ -9781,9 +9781,9 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HDmemset(int_buf, 0, buf_size); } - + break; - + default: HGOTO_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unknown conversion command"); } @@ -9800,8 +9800,8 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_i_f * - * Purpose: Convert one integer type to a floating-point type. This is - * the catch-all function for integer-float conversions and + * Purpose: Convert one integer type to a floating-point type. This is + * the catch-all function for integer-float conversions and * is probably not particularly fast. * * Return: Non-negative on success/Negative on failure @@ -9810,12 +9810,12 @@ done: * Friday, Feb 6, 2004 * * Modifications: - * + * * Raymond Lu * Wednesday, April 21, 2004 * There is a new design for exception handling like overflow, * which is passed in as a transfer property. - * + * *------------------------------------------------------------------------- */ herr_t @@ -9842,7 +9842,7 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t sign; /*source sign bit value */ hbool_t is_max_neg; /*source is maximal negative value*/ hbool_t do_round; /*whether there is roundup */ - uint8_t *int_buf=NULL; /*buffer for temporary value */ + uint8_t *int_buf=NULL; /*buffer for temporary value */ size_t buf_size; /*buffer size for temporary value */ size_t i; /*miscellaneous counters */ size_t first; /*first bit(MSB) in an integer */ @@ -9852,7 +9852,7 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_conv_ret_t except_ret; /*return of callback function */ hbool_t reverse; /*if reverse the order of destination */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_i_f, FAIL); switch (cdata->command) { @@ -9906,9 +9906,9 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, direction = -1; } - /* Allocate enough space for the buffer holding temporary + /* Allocate enough space for the buffer holding temporary * converted value - */ + */ buf_size = (src.prec > dst.u.f.msize ? src.prec : dst.u.f.msize)/8 + 1; int_buf = (uint8_t*)H5MM_calloc(buf_size); @@ -9970,10 +9970,10 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, s[i] = tmp; } } - - /*zero-set all destination bits*/ + + /*zero-set all destination bits*/ H5T_bit_set (d, dst.offset, dst.prec, FALSE); - + /* Copy source into a temporary buffer */ H5T_bit_copy(int_buf, 0, s, src.offset, src.prec); @@ -9984,21 +9984,21 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, sign = (size_t)H5T_bit_get_d(int_buf, src.prec-1, 1); /* - * What is the bit position(starting from 0 as first one) for the most significant + * What is the bit position(starting from 0 as first one) for the most significant * bit(MSB) of S which is set? */ if(H5T_SGN_2 == src.u.i.sign) { sfirst = H5T_bit_find(int_buf, 0, src.prec-1, H5T_BIT_MSB, TRUE); if(sign && sfirst < 0) /* The case 0x80...00, which is negative with maximal value */ - is_max_neg = 1; + is_max_neg = 1; } else if(H5T_SGN_NONE == src.u.i.sign) sfirst = H5T_bit_find(int_buf, 0, src.prec, H5T_BIT_MSB, TRUE); /* Handle special cases here. Integer is zero */ if(!sign && sfirst < 0) goto padding; - + /* * Convert source integer if it's negative */ @@ -10017,7 +10017,7 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, is_max_neg = 0; } - /* Sign bit has been negated if bit vector isn't 0x80...00. Set all bits in front of + /* Sign bit has been negated if bit vector isn't 0x80...00. Set all bits in front of * sign bit to 0 in the temporary buffer because they're all negated from the previous * step. */ H5T_bit_set(int_buf, src.prec, buf_size*8-src.prec, 0); @@ -10048,29 +10048,29 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, first++; } - /* Roundup for mantissa */ + /* Roundup for mantissa */ if(first > dst.u.f.msize) { - /* If the bit sequence is bigger than the mantissa part, there'll be some - * precision loss. Let user's handler deal with the case if it's present + /* If the bit sequence is bigger than the mantissa part, there'll be some + * precision loss. Let user's handler deal with the case if it's present */ - if(cb_struct.func) { + if(cb_struct.func) { H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_PRECISION, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_PRECISION, src_id, dst_id, src_rev, d, cb_struct.user_data); } - + if(except_ret == H5T_CONV_HANDLED) { reverse = FALSE; goto padding; } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") - /* If user's exception handler does deal with it, we do it by dropping off the - * extra bits at the end and do rounding. If we have .50...0(decimal) after radix - * point, we do roundup when the least significant digit before radix is odd, we do + /* If user's exception handler does deal with it, we do it by dropping off the + * extra bits at the end and do rounding. If we have .50...0(decimal) after radix + * point, we do roundup when the least significant digit before radix is odd, we do * rounddown if it's even. */ - + /* Check 1st dropoff bit, see if it's set. */ if(H5T_bit_get_d(int_buf, ((first-dst.u.f.msize)-1), 1)) { /* Check all bits after 1st dropoff bit, see if any of them is set. */ @@ -10081,7 +10081,7 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(H5T_bit_get_d(int_buf, (first-dst.u.f.msize), 1)) do_round = 1; } - } + } /* Right shift to drop off extra bits */ H5T_bit_shift(int_buf, (ssize_t)(dst.u.f.msize-first), 0, buf_size*8); @@ -10090,22 +10090,22 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_bit_inc(int_buf, 0, buf_size*8); do_round = 0; - /* If integer is like 0x0ff...fff and we need to round up the + /* If integer is like 0x0ff...fff and we need to round up the * last f, we get 0x100...000. Treat this special case here. - */ + */ if(H5T_bit_get_d(int_buf, dst.u.f.msize, 1)) { if (H5T_NORM_IMPLIED==dst.u.f.norm) { - /* The bit at this 1's position was impled already, so this - * number should be 0x200...000. We need to increment the - * exponent in this case. - */ + /* The bit at this 1's position was impled already, so this + * number should be 0x200...000. We need to increment the + * exponent in this case. + */ expo++; } else if (H5T_NORM_NONE==dst.u.f.norm) { /* Right shift 1 bit to let the carried 1 fit in the mantissa, * and increment exponent by 1. */ H5T_bit_shift(int_buf, -1, 0, buf_size*8); - expo++; + expo++; } } } @@ -10113,16 +10113,16 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* The bit sequence can fit mantissa part. Left shift to fit in from high-order of * bit position. */ H5T_bit_shift(int_buf, (ssize_t)(dst.u.f.msize-first), 0, dst.u.f.msize); - } - + } + /* Check if the exponent is too big */ - expo_max = (hsize_t)HDpow((double)2.0, (double)dst.u.f.esize) - 1; + expo_max = (hsize_t)HDpow((double)2.0, (double)dst.u.f.esize) - 1; if(expo > expo_max) { /*overflows*/ if(cb_struct.func) { /*user's exception handler. Reverse back source order*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); if(except_ret == H5T_CONV_ABORT) @@ -10131,9 +10131,9 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, reverse = FALSE; goto padding; } - } else { + } else { /*make destination infinity by setting exponent to maximal number and - *mantissa to zero.*/ + *mantissa to zero.*/ expo = expo_max; HDmemset(int_buf, 0, buf_size); } @@ -10174,7 +10174,7 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, d[i] = tmp; } } - + /* * If we had used a temporary buffer for the destination then we * should copy the value to the true destination buffer. @@ -10191,9 +10191,9 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HDmemset(int_buf, 0, buf_size); } - + break; - + default: HGOTO_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unknown conversion command"); } @@ -10210,19 +10210,19 @@ done: /*------------------------------------------------------------------------- * Function: H5T_reverse_order * - * Purpose: Internal assisting function to reverse the order of - * a sequence of byte when it's big endian. The byte sequence + * Purpose: Internal assisting function to reverse the order of + * a sequence of byte when it's big endian. The byte sequence * simulates the endian order. * * Return: Success: A pointer to the reversed byte sequence * - * Failure: Null + * Failure: Null * * Programmer: Raymond Lu * April 26, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -10241,6 +10241,6 @@ H5T_reverse_order(uint8_t *rev, uint8_t *s, size_t size, H5T_order_t order) else for (i=0; i<size; i++) rev[i] = s[i]; - + FUNC_LEAVE_NOAPI(SUCCEED); } diff --git a/src/H5Tcset.c b/src/H5Tcset.c index 1c86b96..bc687ac 100644 --- a/src/H5Tcset.c +++ b/src/H5Tcset.c @@ -34,7 +34,7 @@ NAME H5T_init_cset_interface -- Initialize interface-specific information USAGE herr_t H5T_init_cset_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -57,7 +57,7 @@ H5T_init_cset_interface(void) * Purpose: HDF5 is able to distinguish between character sets of * different nationalities and to convert between them to the * extent possible. - * + * * Return: Success: The character set of a string type. * * Failure: H5T_CSET_ERROR (Negative) @@ -87,11 +87,11 @@ H5Tget_cset(hid_t type_id) dt = dt->shared->parent; /*defer to parent*/ if (!H5T_IS_STRING(dt->shared)) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, H5T_CSET_ERROR, "operation not defined for data type class") - + /* result */ if(H5T_IS_FIXED_STRING(dt->shared)) ret_value = dt->shared->u.atomic.u.s.cset; - else + else ret_value = dt->shared->u.vlen.cset; done: @@ -137,11 +137,11 @@ H5Tset_cset(hid_t type_id, H5T_cset_t cset) dt = dt->shared->parent; /*defer to parent*/ if (!H5T_IS_STRING(dt->shared)) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for data type class") - + /* Commit */ if(H5T_IS_FIXED_STRING(dt->shared)) dt->shared->u.atomic.u.s.cset = cset; - else + else dt->shared->u.vlen.cset = cset; done: diff --git a/src/H5Tenum.c b/src/H5Tenum.c index 84a71b0..2e0af76 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -46,7 +46,7 @@ NAME H5T_init_enum_interface -- Initialize interface-specific information USAGE herr_t H5T_init_enum_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -86,7 +86,7 @@ H5Tenum_create(hid_t parent_id) H5T_t *parent = NULL; /*base integer data type */ H5T_t *dt = NULL; /*new enumeration data type */ hid_t ret_value; /*return value */ - + FUNC_ENTER_API(H5Tenum_create, FAIL) H5TRACE1("i","i",parent_id); @@ -109,16 +109,16 @@ done: /*------------------------------------------------------------------------- * Function: H5T_enum_create * - * Purpose: Private function for H5Tenum_create. Create a new + * Purpose: Private function for H5Tenum_create. Create a new * enumeration data type based on the specified * TYPE, which must be an integer type. * * Return: Success: new enumeration data type * - * Failure: NULL + * Failure: NULL * * Programmer: Raymond Lu - * October 9, 2002 + * October 9, 2002 * * Modifications: * @@ -128,7 +128,7 @@ H5T_t * H5T_enum_create(const H5T_t *parent) { H5T_t *ret_value; /*new enumeration data type */ - + FUNC_ENTER_NOAPI(H5T_enum_create, NULL) assert(parent); @@ -177,7 +177,7 @@ H5Tenum_insert(hid_t type, const char *name, const void *value) { H5T_t *dt=NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Tenum_insert, FAIL) H5TRACE3("e","isx",type,name,value); @@ -226,7 +226,7 @@ H5T_enum_insert(const H5T_t *dt, const char *name, const void *value) char **names=NULL; uint8_t *values=NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_enum_insert, FAIL) assert(dt); @@ -287,7 +287,7 @@ H5Tget_member_value(hid_t type, unsigned membno, void *value/*out*/) { H5T_t *dt=NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Tget_member_value, FAIL) H5TRACE3("e","iIux",type,membno,value); @@ -310,7 +310,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_member_value * - * Purpose: Private function for H5T_get_member_value. Return the + * Purpose: Private function for H5T_get_member_value. Return the * value for an enumeration data type member. * * Return: Success: non-negative with the member value copied @@ -319,7 +319,7 @@ done: * Failure: negative, VALUE memory is undefined. * * Programmer: Raymond Lu - * October 9, 2002 + * October 9, 2002 * * Modifications: * @@ -329,7 +329,7 @@ herr_t H5T_get_member_value(const H5T_t *dt, unsigned membno, void *value/*out*/) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_get_member_value, FAIL) assert(dt); @@ -427,7 +427,7 @@ H5T_enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, size_t si int cmp=(-1); /*comparison result */ H5T_t *copied_dt = NULL; /*do sorting in copied datatype */ char *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_enum_nameof, NULL) /* Check args */ @@ -561,7 +561,7 @@ H5T_enum_valueof(const H5T_t *dt, const char *name, void *value/*out*/) int cmp=(-1); /*comparison result */ H5T_t *copied_dt = NULL; /*do sorting in copied datatype */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_enum_valueof, FAIL) /* Check args */ diff --git a/src/H5Tfields.c b/src/H5Tfields.c index 813690c..a453e57 100644 --- a/src/H5Tfields.c +++ b/src/H5Tfields.c @@ -35,7 +35,7 @@ NAME H5T_init_fields_interface -- Initialize interface-specific information USAGE herr_t H5T_init_fields_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -87,7 +87,7 @@ H5Tget_nmembers(hid_t type_id) if((ret_value = H5T_get_nmembers(dt))<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "cannot return member number") - + done: FUNC_LEAVE_API(ret_value) } @@ -96,7 +96,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_nmembers * - * Purpose: Private function for H5Tget_nmembers. Determines how many + * Purpose: Private function for H5Tget_nmembers. Determines how many * members DTYPE has. The type must be either a compound data * type or an enumeration datatype. * @@ -106,8 +106,8 @@ done: * * Errors: * - * Programmer: Raymond Lu - * October 8, 2002 + * Programmer: Raymond Lu + * October 8, 2002 * * Modifications: * @@ -128,7 +128,7 @@ H5T_get_nmembers(const H5T_t *dt) ret_value = (int)dt->shared->u.enumer.nmembs; else HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "operation not supported for type class") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -178,9 +178,9 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_member_name * - * Purpose: Private function for H5Tget_member_name. Returns the name + * Purpose: Private function for H5Tget_member_name. Returns the name * of a member of a compound or enumeration datatype. Members - * are stored in no particular order with numbers 0 through + * are stored in no particular order with numbers 0 through * N-1 where N is the value returned by H5Tget_nmembers(). * * Return: Success: Ptr to a string allocated with malloc(). The @@ -189,7 +189,7 @@ done: * Failure: NULL * * Programmer: Raymond Lu - * October 9, 2002 + * October 9, 2002 * * Modifications: *------------------------------------------------------------------------- @@ -215,7 +215,7 @@ H5T_get_member_name(H5T_t const *dt, unsigned membno) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid member number") ret_value = H5MM_xstrdup(dt->shared->u.enumer.name[membno]); break; - + default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "operation not supported for type class") } /*lint !e788 All appropriate cases are covered */ @@ -229,10 +229,10 @@ done: * Function: H5Tget_member_index * * Purpose: Returns the index of a member in a compound or enumeration - * datatype by given name.Members are stored in no particular - * order with numbers 0 through N-1 where N is the value + * datatype by given name.Members are stored in no particular + * order with numbers 0 through N-1 where N is the value * returned by H5Tget_nmembers(). - * + * * Return: Success: index of the member if exists. * Failure: -1. * @@ -265,7 +265,7 @@ H5Tget_member_index(hid_t type_id, const char *name) if(!HDstrcmp(dt->shared->u.compnd.memb[i].name, name)) HGOTO_DONE((int)i) } - break; + break; case H5T_ENUM: for(i=0; i< dt->shared->u.enumer.nmembs; i++) { if(!HDstrcmp(dt->shared->u.enumer.name[i], name)) @@ -364,7 +364,7 @@ H5T_sort_value(const H5T_t *dt, int *map) HDmemcpy(dt->shared->u.enumer.value+j*size, dt->shared->u.enumer.value+(j+1)*size, size); HDmemcpy(dt->shared->u.enumer.value+(j+1)*size, tbuf, size); - + /* Swap map */ if (map) { int x = map[j]; @@ -386,7 +386,7 @@ H5T_sort_value(const H5T_t *dt, int *map) #endif } } - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -449,7 +449,7 @@ H5T_sort_name(const H5T_t *dt, int *map) #ifndef NDEBUG /* I never trust a sort :-) -RPM */ for (i=0; i<nmembs-1; i++) { - assert(HDstrcmp(dt->shared->u.compnd.memb[i].name, + assert(HDstrcmp(dt->shared->u.compnd.memb[i].name, dt->shared->u.compnd.memb[i+1].name)<0); } #endif @@ -493,7 +493,7 @@ H5T_sort_name(const H5T_t *dt, int *map) #endif } } - + done: FUNC_LEAVE_NOAPI(ret_value) } diff --git a/src/H5Tfixed.c b/src/H5Tfixed.c index 4219377..1d0817e 100644 --- a/src/H5Tfixed.c +++ b/src/H5Tfixed.c @@ -34,7 +34,7 @@ NAME H5T_init_fixed_interface -- Initialize interface-specific information USAGE herr_t H5T_init_fixed_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -80,7 +80,7 @@ H5Tget_sign(hid_t type_id) /* Check args */ if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_SGN_ERROR, "not an integer datatype") - + ret_value = H5T_get_sign(dt); done: @@ -91,7 +91,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_sign * - * Purpose: Private function for H5Tget_sign. Retrieves the sign type + * Purpose: Private function for H5Tget_sign. Retrieves the sign type * for an integer type. * * Return: Success: The sign type. @@ -121,7 +121,7 @@ H5T_get_sign(H5T_t const *dt) /* Check args */ if (H5T_INTEGER!=dt->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5T_SGN_ERROR, "operation not defined for datatype class") - + /* Sign */ ret_value = dt->shared->u.atomic.u.i.sign; @@ -169,7 +169,7 @@ H5Tset_sign(hid_t type_id, H5T_sign_t sign) dt = dt->shared->parent; /*defer to parent*/ if (H5T_INTEGER!=dt->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for datatype class") - + /* Commit */ dt->shared->u.atomic.u.i.sign = sign; diff --git a/src/H5Tfloat.c b/src/H5Tfloat.c index dbf0cb0..e216606 100644 --- a/src/H5Tfloat.c +++ b/src/H5Tfloat.c @@ -34,7 +34,7 @@ NAME H5T_init_float_interface -- Initialize interface-specific information USAGE herr_t H5T_init_float_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -92,7 +92,7 @@ H5Tget_fields(hid_t type_id, size_t *spos/*out*/, dt = dt->shared->parent; /*defer to parent*/ if (H5T_FLOAT != dt->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for datatype class") - + /* Get values */ if (spos) *spos = dt->shared->u.atomic.u.f.sign; if (epos) *epos = dt->shared->u.atomic.u.f.epos; @@ -115,7 +115,7 @@ done: * * Fields are not allowed to extend beyond the number of bits of * precision, nor are they allowed to overlap with one another. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -124,7 +124,7 @@ done: * Modifications: * Robb Matzke, 22 Dec 1998 * Also works for derived datatypes. - * + * *------------------------------------------------------------------------- */ herr_t @@ -152,7 +152,7 @@ H5Tset_fields(hid_t type_id, size_t spos, size_t epos, size_t esize, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "mantissa bit field size/location is invalid") if (spos >= dt->shared->u.atomic.prec) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "sign location is not valid") - + /* Check for overlap */ if (spos >= epos && spos < epos + esize) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "sign bit appears within exponent field") @@ -161,7 +161,7 @@ H5Tset_fields(hid_t type_id, size_t spos, size_t epos, size_t esize, if ((mpos < epos && mpos + msize > epos) || (epos < mpos && epos + esize > mpos)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "exponent and mantissa fields overlap") - + /* Commit */ dt->shared->u.atomic.u.f.sign = spos; dt->shared->u.atomic.u.f.epos = epos; @@ -207,7 +207,7 @@ H5Tget_ebias(hid_t type_id) dt = dt->shared->parent; /*defer to parent*/ if (H5T_FLOAT != dt->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, 0, "operation not defined for datatype class") - + /* bias */ H5_ASSIGN_OVERFLOW(ret_value,dt->shared->u.atomic.u.f.ebias,uint64_t,size_t); @@ -294,7 +294,7 @@ H5Tget_norm(hid_t type_id) dt = dt->shared->parent; /*defer to parent*/ if (H5T_FLOAT != dt->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5T_NORM_ERROR, "operation not defined for datatype class") - + /* norm */ ret_value = dt->shared->u.atomic.u.f.norm; @@ -340,7 +340,7 @@ H5Tset_norm(hid_t type_id, H5T_norm_t norm) dt = dt->shared->parent; /*defer to parent*/ if (H5T_FLOAT != dt->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for datatype class") - + /* Commit */ dt->shared->u.atomic.u.f.norm = norm; @@ -386,7 +386,7 @@ H5Tget_inpad(hid_t type_id) dt = dt->shared->parent; /*defer to parent*/ if (H5T_FLOAT != dt->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5T_PAD_ERROR, "operation not defined for datatype class") - + /* pad */ ret_value = dt->shared->u.atomic.u.f.pad; @@ -434,7 +434,7 @@ H5Tset_inpad(hid_t type_id, H5T_pad_t pad) dt = dt->shared->parent; /*defer to parent*/ if (H5T_FLOAT != dt->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for datatype class") - + /* Commit */ dt->shared->u.atomic.u.f.pad = pad; diff --git a/src/H5Tnative.c b/src/H5Tnative.c index 986d440..56694c2 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -31,11 +31,11 @@ #include "H5Tpkg.h" /* Datatypes */ /* Static local functions */ -static H5T_t *H5T_get_native_type(H5T_t *dt, H5T_direction_t direction, +static H5T_t *H5T_get_native_type(H5T_t *dt, H5T_direction_t direction, size_t *struct_align, size_t *offset, size_t *comp_size); -static H5T_t *H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, +static H5T_t *H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, size_t *struct_align, size_t *offset, size_t *comp_size); -static H5T_t *H5T_get_native_float(size_t size, H5T_direction_t direction, +static H5T_t *H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_align, size_t *offset, size_t *comp_size); static herr_t H5T_cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size, size_t nelems, size_t align, size_t *struct_align); @@ -46,7 +46,7 @@ NAME H5T_init_native_interface -- Initialize interface-specific information USAGE herr_t H5T_init_native_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -66,9 +66,9 @@ H5T_init_native_interface(void) /*------------------------------------------------------------------------- * Function: H5Tget_native_type * - * Purpose: High-level API to return the native type of a datatype. - * The native type is chosen by matching the size and class of - * querried datatype from the following native premitive + * Purpose: High-level API to return the native type of a datatype. + * The native type is chosen by matching the size and class of + * querried datatype from the following native premitive * datatypes: * H5T_NATIVE_CHAR H5T_NATIVE_UCHAR * H5T_NATIVE_SHORT H5T_NATIVE_USHORT @@ -80,16 +80,16 @@ H5T_init_native_interface(void) * H5T_NATIVE_DOUBLE * H5T_NATIVE_LDOUBLE * - * Compound, array, enum, and VL types all choose among these + * Compound, array, enum, and VL types all choose among these * types for theire members. Time, Bifield, Opaque, Reference * types are only copy out. - * + * * Return: Success: Returns the native data type if successful. * * Failure: negative * * Programmer: Raymond Lu - * Oct 3, 2002 + * Oct 3, 2002 * * Modifications: * @@ -110,7 +110,7 @@ H5Tget_native_type(hid_t type_id, H5T_direction_t direction) if(NULL==(dt=H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") - if(direction!=H5T_DIR_DEFAULT && direction!=H5T_DIR_ASCEND + if(direction!=H5T_DIR_DEFAULT && direction!=H5T_DIR_ASCEND && direction!=H5T_DIR_DESCEND) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not valid direction value") @@ -119,7 +119,7 @@ H5Tget_native_type(hid_t type_id, H5T_direction_t direction) if((ret_value=H5I_register(H5I_DATATYPE, new_dt)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type") - + done: /* Error cleanup */ if(ret_value<0) { @@ -127,30 +127,30 @@ done: if(H5T_close(new_dt)<0) HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release datatype") } /* end if */ - + FUNC_LEAVE_API(ret_value) } /*------------------------------------------------------------------------- * Function: H5T_get_native_type - * + * * Purpose: Returns the native type of a datatype. - * + * * Return: Success: Returns the native data type if successful. - * + * * Failure: negative - * + * * Programmer: Raymond Lu * Oct 3, 2002 - * + * * Modifications: - * + * *------------------------------------------------------------------------- */ static H5T_t* H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_align, size_t *offset, size_t *comp_size) -{ +{ H5T_t *dt; /* Datatype to make native */ H5T_class_t h5_class; /* Class of datatype to make native */ size_t size; /* Size of datatype to make native */ @@ -164,15 +164,15 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig H5T_t *ret_value; /* Return value */ FUNC_ENTER_NOAPI(H5T_get_native_type, NULL) - - assert(dtype); + + assert(dtype); if((h5_class = H5T_get_class(dtype, FALSE))==H5T_NO_CLASS) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a valid class") - + if((size = H5T_get_size(dtype))==0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a valid size") - + switch(h5_class) { case H5T_INTEGER: { @@ -182,12 +182,12 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a valid signess") prec = dtype->shared->u.atomic.prec; - + if((ret_value = H5T_get_native_integer(prec, sign, direction, struct_align, offset, comp_size))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve integer type") } break; - + case H5T_FLOAT: if((ret_value = H5T_get_native_float(size, direction, struct_align, offset, comp_size))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type") @@ -202,14 +202,14 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig /* Update size, offset and compound alignment for parent. */ if(H5T_cmp_offset(comp_size, offset, sizeof(char *), 1, H5T_POINTER_COMP_ALIGN_g, struct_align)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") - } else { + } else { /* Update size, offset and compound alignment for parent. */ if(H5T_cmp_offset(comp_size, offset, sizeof(char), size, H5T_NATIVE_SCHAR_COMP_ALIGN_g, struct_align)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") } break; - /* These 2 types will be supported in the future. Simply return "not supported" + /* These 2 types will be supported in the future. Simply return "not supported" * message for now.*/ case H5T_TIME: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "time type is not supported yet") @@ -234,21 +234,21 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig if((ret_value=H5T_copy(dtype, H5T_COPY_TRANSIENT))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type") - + /* Decide if the data type is object or dataset region reference. */ if(NULL==(dt=H5I_object(H5T_STD_REF_OBJ_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type") not_equal = H5T_cmp(ret_value, dt, FALSE); /* Update size, offset and compound alignment for parent. */ - if(!not_equal) { + if(!not_equal) { align = H5T_HOBJREF_COMP_ALIGN_g; ref_size = sizeof(hobj_ref_t); } else { align = H5T_HDSETREGREF_COMP_ALIGN_g; ref_size = sizeof(hdset_reg_ref_t); } - + if(H5T_cmp_offset(comp_size, offset, ref_size, 1, align, struct_align)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") } @@ -259,14 +259,14 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig H5T_t *memb_type; /* Datatype of member */ H5T_t **memb_list; /* List of compound member IDs */ size_t *memb_offset; /* List of member offsets in compound type, including member size and alignment */ - size_t children_size=0;/* Total size of compound members */ + size_t children_size=0;/* Total size of compound members */ size_t children_st_align=0; /* The max alignment among compound members. This'll be the compound alignment */ char **comp_mname; /* List of member names in compound type */ if((snmemb = H5T_get_nmembers(dtype))<=0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "compound data type doesn't have any member") H5_ASSIGN_OVERFLOW(nmemb,snmemb,int,unsigned); - + if((memb_list = (H5T_t**)H5MM_malloc(nmemb*sizeof(H5T_t*)))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot allocate memory") if((memb_offset = (size_t*)H5MM_calloc(nmemb*sizeof(size_t)))==NULL) @@ -274,43 +274,43 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig if((comp_mname = (char**)H5MM_malloc(nmemb*sizeof(char*)))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot allocate memory") - /* Construct child compound type and retrieve a list of their IDs, offsets, total size, and alignment for compound type. */ + /* Construct child compound type and retrieve a list of their IDs, offsets, total size, and alignment for compound type. */ for(i=0; i<nmemb; i++) { if((memb_type = H5T_get_member_type(dtype, i))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "member type retrieval failed") - + if((comp_mname[i] = H5T_get_member_name(dtype, i))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "member type retrieval failed") - + if((memb_list[i] = H5T_get_native_type(memb_type, direction, &children_st_align, &(memb_offset[i]), &children_size))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "member identifier retrieval failed") if(H5T_close(memb_type)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype") } - + /* The alignment for whole compound type */ if(children_st_align && children_size % children_st_align) children_size += children_st_align-(children_size % children_st_align); - /* Construct new compound type based on native type */ + /* Construct new compound type based on native type */ if((new_type=H5T_create(H5T_COMPOUND, children_size))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot create a compound type") - /* Insert members for the new compound type */ + /* Insert members for the new compound type */ for(i=0; i<nmemb; i++) { if(H5T_insert(new_type, comp_mname[i], memb_offset[i], memb_list[i])<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot insert member to compound datatype") } - + /* Update size, offset and compound alignment for parent. */ if(offset) *offset = *comp_size; if(struct_align && *struct_align < children_st_align) *struct_align = children_st_align; *comp_size += children_size; - - /* Close member data type */ + + /* Close member data type */ for(i=0; i<nmemb; i++) { if(H5T_close(memb_list[i])<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype") @@ -318,12 +318,12 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig /* Free member names in list */ H5MM_xfree(comp_mname[i]); } - + /* Free lists for members */ H5MM_xfree(memb_list); H5MM_xfree(memb_offset); H5MM_xfree(comp_mname); - + ret_value = new_type; } break; @@ -333,7 +333,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig char *memb_name; /* Enum's member name */ void *memb_value, *tmp_memb_value; /* Enum's member value */ hid_t super_type_id, nat_super_type_id; - + /* Don't need to do anything special for alignment, offset since the ENUM type usually is integer. */ /* Retrieve base type for enumarate type */ @@ -346,17 +346,17 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot register datatype") if((nat_super_type_id=H5I_register(H5I_DATATYPE, nat_super_type))<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot register datatype") - + /* Allocate room for the enum values */ if((tmp_memb_value = H5MM_calloc(H5T_get_size(super_type)))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot allocate memory") if((memb_value = H5MM_calloc(H5T_get_size(nat_super_type)))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot allocate memory") - /* Construct new enum type based on native type */ + /* Construct new enum type based on native type */ if((new_type=H5T_enum_create(nat_super_type))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create enum type") - + /* Retrieve member info and insert members into new enum type */ if((snmemb = H5T_get_nmembers(dtype))<=0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "enumarate data type doesn't have any member") @@ -367,10 +367,10 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig if(H5T_get_member_value(dtype, i, tmp_memb_value)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member value") HDmemcpy(memb_value, tmp_memb_value, H5T_get_size(super_type)); - + if(H5Tconvert(super_type_id, nat_super_type_id, 1, memb_value, NULL, H5P_DEFAULT)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member value") - + if(H5T_enum_insert(new_type, memb_name, memb_value)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot insert member") H5MM_xfree(memb_name); @@ -384,7 +384,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig /* Close super type */ if(H5Tclose(super_type_id)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype") - + ret_value = new_type; } break; @@ -395,9 +395,9 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig unsigned array_rank; /* Array's rank */ hsize_t *dims = NULL; /* Dimension sizes for array */ hsize_t nelems = 1; - size_t super_offset=0; - size_t super_size=0; - size_t super_align=0; + size_t super_offset=0; + size_t super_size=0; + size_t super_align=0; /* Retrieve dimension information for array data type */ if((sarray_rank=H5T_get_array_ndims(dtype))<=0) @@ -411,7 +411,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig /* Retrieve base type for array type */ if((super_type=H5T_get_super(dtype))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to get parent type for enumarate type") - if((nat_super_type = H5T_get_native_type(super_type, direction, &super_align, + if((nat_super_type = H5T_get_native_type(super_type, direction, &super_align, &super_offset, &super_size))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "parent native type retrieval failed") @@ -420,19 +420,19 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_CLOSEERROR, NULL, "cannot close datatype") /* Create a new array type based on native type */ - if((new_type=H5T_array_create(nat_super_type, sarray_rank, dims, NULL))==NULL) + if((new_type=H5T_array_create(nat_super_type, sarray_rank, dims, NULL))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create array type") /* Close base type */ if(H5T_close(nat_super_type)<0) HGOTO_ERROR(H5E_ARGS, H5E_CLOSEERROR, NULL, "cannot close datatype") - + for(i=0; i<array_rank; i++) - nelems *= dims[i]; + nelems *= dims[i]; H5_CHECK_OVERFLOW(nelems,hsize_t,size_t); if(H5T_cmp_offset(comp_size, offset, super_size, (size_t)nelems, super_align, struct_align)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") - + H5MM_xfree(dims); ret_value = new_type; } @@ -442,7 +442,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig { size_t vl_align = 0; size_t vl_size = 0; - size_t super_size=0; + size_t super_size=0; /* Retrieve base type for array type */ if((super_type=H5T_get_super(dtype))==NULL) @@ -457,29 +457,29 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_CLOSEERROR, NULL, "cannot close datatype") /* Create a new array type based on native type */ - if((new_type=H5T_vlen_create(nat_super_type))==NULL) + if((new_type=H5T_vlen_create(nat_super_type))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create VL type") - + /* Close base type */ if(H5T_close(nat_super_type)<0) HGOTO_ERROR(H5E_ARGS, H5E_CLOSEERROR, NULL, "cannot close datatype") - + /* Update size, offset and compound alignment for parent compound type directly. */ vl_align = H5T_HVL_COMP_ALIGN_g; vl_size = sizeof(hvl_t); - + if(H5T_cmp_offset(comp_size, offset, vl_size, 1, vl_align, struct_align)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") - + ret_value = new_type; } - break; + break; case H5T_NO_CLASS: case H5T_NCLASSES: default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "data type doesn't match any native type") - } + } done: /* Error cleanup */ @@ -495,29 +495,29 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_native_integer - * + * * Purpose: Returns the native integer type of a datatype. - * + * * Return: Success: Returns the native data type if successful. - * + * * Failure: negative - * + * * Programmer: Raymond Lu * Oct 3, 2002 - * + * * Modifications: Pedro Vicente * Sep 4, 2004 * Choose the type based on the precision; this is to support cases * like the Cray SV1, where the size of short is 8 but precision is 32 * (e.g an INT (size 8, prec 64) would be converted to a SHORT * (size 8, prec 32) if the size was the deciding factor) - * + * *------------------------------------------------------------------------- */ static H5T_t* -H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, +H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, size_t *struct_align, size_t *offset, size_t *comp_size) -{ +{ H5T_t *dt; /* Appropriate native datatype to copy */ hid_t tid=(-1); /* Datatype ID of appropriate native datatype */ size_t align=0; /* Alignment necessary for native datatype */ @@ -537,66 +537,66 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) { if(prec<=H5Tget_precision(H5T_NATIVE_SCHAR)) { match=H5T_NATIVE_INT_MATCH_CHAR; - native_size = sizeof(char); + native_size = sizeof(char); } else if(prec<=H5Tget_precision(H5T_NATIVE_SHORT)) { match=H5T_NATIVE_INT_MATCH_SHORT; - native_size = sizeof(short); + native_size = sizeof(short); } else if(prec<=H5Tget_precision(H5T_NATIVE_INT)) { match=H5T_NATIVE_INT_MATCH_INT; - native_size = sizeof(int); + native_size = sizeof(int); } else if(prec<=H5Tget_precision(H5T_NATIVE_LONG)) { match=H5T_NATIVE_INT_MATCH_LONG; - native_size = sizeof(long); + native_size = sizeof(long); } else if(prec<=H5Tget_precision(H5T_NATIVE_LLONG)) { match=H5T_NATIVE_INT_MATCH_LLONG; - native_size = sizeof(long_long); + native_size = sizeof(long_long); } else { /* If no native type matches the querried datatype, simply choose the type of biggest size. */ match=H5T_NATIVE_INT_MATCH_LLONG; - native_size = sizeof(long_long); + native_size = sizeof(long_long); } } else if(direction == H5T_DIR_DESCEND) { - if(prec>=H5Tget_precision(H5T_NATIVE_LLONG)) { + if(prec>=H5Tget_precision(H5T_NATIVE_LLONG)) { match=H5T_NATIVE_INT_MATCH_LLONG; - native_size = sizeof(long_long); + native_size = sizeof(long_long); } else if(prec>=H5Tget_precision(H5T_NATIVE_LONG)) { if(prec==H5Tget_precision(H5T_NATIVE_LONG)) { match=H5T_NATIVE_INT_MATCH_LONG; - native_size = sizeof(long); + native_size = sizeof(long); } else { match=H5T_NATIVE_INT_MATCH_LLONG; - native_size = sizeof(long_long); + native_size = sizeof(long_long); } } else if(prec>=H5Tget_precision(H5T_NATIVE_INT)) { if(prec==H5Tget_precision(H5T_NATIVE_INT)) { match=H5T_NATIVE_INT_MATCH_INT; - native_size = sizeof(int); + native_size = sizeof(int); } else { match=H5T_NATIVE_INT_MATCH_LONG; - native_size = sizeof(long); + native_size = sizeof(long); } } else if(prec>=H5Tget_precision(H5T_NATIVE_SHORT)) { if(prec==H5Tget_precision(H5T_NATIVE_SHORT)) { match=H5T_NATIVE_INT_MATCH_SHORT; - native_size = sizeof(short); + native_size = sizeof(short); } else { match=H5T_NATIVE_INT_MATCH_INT; - native_size = sizeof(int); + native_size = sizeof(int); } } else if(prec>=H5Tget_precision(H5T_NATIVE_SCHAR)) { if(prec==H5Tget_precision(H5T_NATIVE_SCHAR)) { match=H5T_NATIVE_INT_MATCH_CHAR; - native_size = sizeof(char); + native_size = sizeof(char); } else { match=H5T_NATIVE_INT_MATCH_SHORT; - native_size = sizeof(short); + native_size = sizeof(short); } } else { /* If no native type matches the queried datatype, simply choose the type of smallest size. */ match=H5T_NATIVE_INT_MATCH_CHAR; - native_size = sizeof(char); + native_size = sizeof(char); } } @@ -607,50 +607,50 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, tid = H5T_NATIVE_SCHAR; else tid = H5T_NATIVE_UCHAR; - - align = H5T_NATIVE_SCHAR_COMP_ALIGN_g; + + align = H5T_NATIVE_SCHAR_COMP_ALIGN_g; break; - + case H5T_NATIVE_INT_MATCH_SHORT: if(sign==H5T_SGN_2) tid = H5T_NATIVE_SHORT; - else + else tid = H5T_NATIVE_USHORT; - align = H5T_NATIVE_SHORT_COMP_ALIGN_g; + align = H5T_NATIVE_SHORT_COMP_ALIGN_g; break; - + case H5T_NATIVE_INT_MATCH_INT: if(sign==H5T_SGN_2) tid = H5T_NATIVE_INT; - else + else tid = H5T_NATIVE_UINT; - align = H5T_NATIVE_INT_COMP_ALIGN_g; + align = H5T_NATIVE_INT_COMP_ALIGN_g; break; - + case H5T_NATIVE_INT_MATCH_LONG: if(sign==H5T_SGN_2) tid = H5T_NATIVE_LONG; - else + else tid = H5T_NATIVE_ULONG; - align = H5T_NATIVE_LONG_COMP_ALIGN_g; + align = H5T_NATIVE_LONG_COMP_ALIGN_g; break; - + case H5T_NATIVE_INT_MATCH_LLONG: if(sign==H5T_SGN_2) tid = H5T_NATIVE_LLONG; - else + else tid = H5T_NATIVE_ULLONG; - align = H5T_NATIVE_LLONG_COMP_ALIGN_g; + align = H5T_NATIVE_LLONG_COMP_ALIGN_g; break; - + case H5T_NATIVE_INT_MATCH_UNKNOWN: default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "Unknown native integer match") } /* end switch */ - + /* Create new native type */ assert(tid>=0); if(NULL==(dt=H5I_object(tid))) @@ -658,11 +658,11 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, if((ret_value=H5T_copy(dt, H5T_COPY_TRANSIENT))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot copy type") - + /* compute size and offset of compound type member. */ if(H5T_cmp_offset(comp_size, offset, native_size, 1, align, struct_align)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -671,23 +671,23 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_native_float - * + * * Purpose: Returns the native floatt type of a datatype. - * + * * Return: Success: Returns the native data type if successful. - * + * * Failure: negative - * + * * Programmer: Raymond Lu * Oct 3, 2002 - * + * * Modifications: - * + * *------------------------------------------------------------------------- */ static H5T_t* H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_align, size_t *offset, size_t *comp_size) -{ +{ H5T_t *dt=NULL; /* Appropriate native datatype to copy */ hid_t tid=(-1); /* Datatype ID of appropriate native datatype */ size_t align=0; /* Alignment necessary for native datatype */ @@ -705,21 +705,21 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig FUNC_ENTER_NOAPI(H5T_get_native_float, NULL) assert(size>0); - - if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) { + + if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) { if(size<=sizeof(float)) { match=H5T_NATIVE_FLOAT_MATCH_FLOAT; - native_size = sizeof(float); + native_size = sizeof(float); } else if(size<=sizeof(double)) { match=H5T_NATIVE_FLOAT_MATCH_DOUBLE; - native_size = sizeof(double); + native_size = sizeof(double); } -#if H5_SIZEOF_LONG_DOUBLE !=0 +#if H5_SIZEOF_LONG_DOUBLE !=0 else if(size<=sizeof(long double)) { match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE; - native_size = sizeof(long double); - } + native_size = sizeof(long double); + } #endif else { /* If not match, return the biggest datatype */ #if H5_SIZEOF_LONG_DOUBLE !=0 @@ -729,53 +729,53 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig match=H5T_NATIVE_FLOAT_MATCH_DOUBLE; native_size = sizeof(double); #endif - } + } } else { -#if H5_SIZEOF_LONG_DOUBLE !=0 +#if H5_SIZEOF_LONG_DOUBLE !=0 if(size>=sizeof(long double)) { match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE; - native_size = sizeof(long double); - } + native_size = sizeof(long double); + } else if(size>=sizeof(double)) { if(size==sizeof(double)) { match=H5T_NATIVE_FLOAT_MATCH_DOUBLE; - native_size = sizeof(double); + native_size = sizeof(double); } else { match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE; native_size = sizeof(long double); - } + } } else if(size>=sizeof(float)) { if(size==sizeof(float)) { match=H5T_NATIVE_FLOAT_MATCH_FLOAT; - native_size = sizeof(float); + native_size = sizeof(float); } else { match=H5T_NATIVE_FLOAT_MATCH_DOUBLE; native_size = sizeof(double); - } - } + } + } else { match=H5T_NATIVE_FLOAT_MATCH_FLOAT; native_size = sizeof(float); - } + } #else if(size>=sizeof(double)) { match=H5T_NATIVE_FLOAT_MATCH_DOUBLE; - native_size = sizeof(double); + native_size = sizeof(double); } else if(size>=sizeof(float)) { if(size==sizeof(float)) { match=H5T_NATIVE_FLOAT_MATCH_FLOAT; - native_size = sizeof(float); + native_size = sizeof(float); } else { match=H5T_NATIVE_FLOAT_MATCH_DOUBLE; native_size = sizeof(double); - } - } + } + } else { match=H5T_NATIVE_FLOAT_MATCH_FLOAT; native_size = sizeof(float); - } + } #endif } @@ -791,7 +791,7 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig align = H5T_NATIVE_DOUBLE_COMP_ALIGN_g; break; -#if H5_SIZEOF_LONG_DOUBLE !=0 +#if H5_SIZEOF_LONG_DOUBLE !=0 case H5T_NATIVE_FLOAT_MATCH_LDOUBLE: tid = H5T_NATIVE_LDOUBLE; align = H5T_NATIVE_LDOUBLE_COMP_ALIGN_g; @@ -801,18 +801,18 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "Unknown native floating-point match") } /* end switch */ - + /* Create new native type */ assert(tid>=0); if(NULL==(dt=H5I_object(tid))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type") if((ret_value=H5T_copy(dt, H5T_COPY_TRANSIENT))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type") - + /* compute offset of compound type member. */ if(H5T_cmp_offset(comp_size, offset, native_size, 1, align, struct_align)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -821,23 +821,23 @@ done: /*------------------------------------------------------------------------- * Function: H5T_cmp_offset * - * Purpose: This function is only for convenience. It computes the + * Purpose: This function is only for convenience. It computes the * compound type size, offset of the member being considered * and the alignment for the whole compound type. * - * Return: Success: Non-negative value. + * Return: Success: Non-negative value. * - * Failure: Negative value. + * Failure: Negative value. * * Programmer: Raymond Lu - * December 10, 2002 + * December 10, 2002 * * Modifications: * *------------------------------------------------------------------------- */ static herr_t -H5T_cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size, +H5T_cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size, size_t nelems, size_t align, size_t *struct_align) { herr_t ret_value = SUCCEED; @@ -852,7 +852,7 @@ H5T_cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size, } else *offset = *comp_size; - /* compute size of compound type member. */ + /* compute size of compound type member. */ *comp_size += nelems*elem_size; } diff --git a/src/H5Toffset.c b/src/H5Toffset.c index 6090851..8cf278f 100644 --- a/src/H5Toffset.c +++ b/src/H5Toffset.c @@ -37,7 +37,7 @@ NAME H5T_init_offset_interface -- Initialize interface-specific information USAGE herr_t H5T_init_offset_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -104,7 +104,7 @@ H5Tget_offset(hid_t type_id) dt = dt->shared->parent; /*defer to parent*/ if (!H5T_IS_ATOMIC(dt->shared)) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for specified data type") - + /* Offset */ ret_value = (int)dt->shared->u.atomic.offset; @@ -139,7 +139,7 @@ done: * the value from hanging over the edge of the data type. * * The offset of an H5T_STRING cannot be set to anything but - * zero. + * zero. * * Return: Non-negative on success/Negative on failure * @@ -208,7 +208,7 @@ done: * the value from hanging over the edge of the data type. * * The offset of an H5T_STRING cannot be set to anything but - * zero. + * zero. * * Return: Non-negative on success/Negative on failure * @@ -250,7 +250,7 @@ H5T_set_offset(const H5T_t *dt, size_t offset) dt->shared->size = (offset + dt->shared->u.atomic.prec + 7) / 8; dt->shared->u.atomic.offset = offset; } - + done: FUNC_LEAVE_NOAPI(ret_value) } diff --git a/src/H5Topaque.c b/src/H5Topaque.c index 0121957..eb14d58 100644 --- a/src/H5Topaque.c +++ b/src/H5Topaque.c @@ -35,7 +35,7 @@ NAME H5T_init_opaque_interface -- Initialize interface-specific information USAGE herr_t H5T_init_opaque_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -128,7 +128,7 @@ H5Tget_tag(hid_t type_id) dt = dt->shared->parent; /*defer to parent*/ if (H5T_OPAQUE != dt->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "operation not defined for data type class") - + /* result */ if (NULL==(ret_value=H5MM_strdup(dt->shared->u.opaque.tag))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") diff --git a/src/H5Torder.c b/src/H5Torder.c index 6d9a713..0628609 100644 --- a/src/H5Torder.c +++ b/src/H5Torder.c @@ -34,7 +34,7 @@ NAME H5T_init_order_interface -- Initialize interface-specific information USAGE herr_t H5T_init_order_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION diff --git a/src/H5Tpad.c b/src/H5Tpad.c index 3a59bca..96d456a 100644 --- a/src/H5Tpad.c +++ b/src/H5Tpad.c @@ -34,7 +34,7 @@ NAME H5T_init_pad_interface -- Initialize interface-specific information USAGE herr_t H5T_init_pad_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -85,7 +85,7 @@ H5Tget_pad(hid_t type_id, H5T_pad_t *lsb/*out*/, H5T_pad_t *msb/*out*/) dt = dt->shared->parent; /*defer to parent*/ if (!H5T_IS_ATOMIC(dt->shared)) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for specified data type") - + /* Get values */ if (lsb) *lsb = dt->shared->u.atomic.lsb_pad; @@ -110,7 +110,7 @@ done: * Modifications: * Robb Matzke, 22 Dec 1998 * Also works with derived data types. - * + * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index 7763dd9..6854bc2 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -163,8 +163,8 @@ typedef struct H5T_vlen_t { H5T_vlen_type_t type; /* Type of VL data in buffer */ H5T_loc_t loc; /* Location of VL data in buffer */ H5T_cset_t cset; /* For VL string. character set */ - H5T_str_t pad; /* For VL string. space or null padding of - * extra bytes */ + H5T_str_t pad; /* For VL string. space or null padding of + * extra bytes */ H5F_t *f; /* File ID (if VL data is on disk) */ H5T_vlen_getptrfunc_t getptr; /* Function to get VL sequence pointer */ H5T_vlen_getlenfunc_t getlen; /* Function to get VL sequence size (in element units, not bytes) */ diff --git a/src/H5Tprecis.c b/src/H5Tprecis.c index 3e492c3..0a132c0 100644 --- a/src/H5Tprecis.c +++ b/src/H5Tprecis.c @@ -37,7 +37,7 @@ NAME H5T_init_precis_interface -- Initialize interface-specific information USAGE herr_t H5T_init_precis_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -92,7 +92,7 @@ H5Tget_precision(hid_t type_id) dt = dt->shared->parent; /*defer to parent*/ if (!H5T_IS_ATOMIC(dt->shared)) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, 0, "operation not defined for specified datatype") - + /* Precision */ ret_value = dt->shared->u.atomic.prec; @@ -246,7 +246,7 @@ H5T_set_precision(const H5T_t *dt, size_t prec) dt->shared->u.atomic.u.f.epos + dt->shared->u.atomic.u.f.esize > prec+offset || dt->shared->u.atomic.u.f.mpos + dt->shared->u.atomic.u.f.msize > prec+offset) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "adjust sign, mantissa, and exponent fields first") - break; + break; default: HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "operation not defined for datatype class") } /* end switch */ /*lint !e788 All appropriate cases are covered */ @@ -259,7 +259,7 @@ H5T_set_precision(const H5T_t *dt, size_t prec) else HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for specified datatype") } /* end else */ - + done: FUNC_LEAVE_NOAPI(ret_value) } diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h index fdc25c0..6eeb21b 100644 --- a/src/H5Tpublic.h +++ b/src/H5Tpublic.h @@ -553,7 +553,7 @@ H5_DLL hid_t H5Tget_member_type(hid_t type_id, unsigned membno); H5_DLL herr_t H5Tget_member_value(hid_t type_id, unsigned membno, void *value/*out*/); H5_DLL H5T_cset_t H5Tget_cset(hid_t type_id); H5_DLL htri_t H5Tis_variable_str(hid_t type_id); -H5_DLL hid_t H5Tget_native_type(hid_t type_id, H5T_direction_t direction); +H5_DLL hid_t H5Tget_native_type(hid_t type_id, H5T_direction_t direction); /* Setting property values */ H5_DLL herr_t H5Tset_size(hid_t type_id, size_t size); diff --git a/src/H5Tstrpad.c b/src/H5Tstrpad.c index 1c8ce2f..2c9b7d6 100644 --- a/src/H5Tstrpad.c +++ b/src/H5Tstrpad.c @@ -34,7 +34,7 @@ NAME H5T_init_strpad_interface -- Initialize interface-specific information USAGE herr_t H5T_init_strpad_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -58,7 +58,7 @@ H5T_init_strpad_interface(void) * programming language: C usually null terminates strings while * Fortran left-justifies and space-pads strings. This property * defines the storage mechanism for the string. - * + * * Return: Success: The character set of a string type. * * Failure: H5T_STR_ERROR (Negative) @@ -88,7 +88,7 @@ H5Tget_strpad(hid_t type_id) dt = dt->shared->parent; /*defer to parent*/ if (!H5T_IS_STRING(dt->shared)) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, H5T_STR_ERROR, "operation not defined for datatype class") - + /* result */ if(H5T_IS_FIXED_STRING(dt->shared)) ret_value = dt->shared->u.atomic.u.s.pad; @@ -149,7 +149,7 @@ H5Tset_strpad(hid_t type_id, H5T_str_t strpad) dt = dt->shared->parent; /*defer to parent*/ if (!H5T_IS_STRING(dt->shared)) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for datatype class") - + /* Commit */ if(H5T_IS_FIXED_STRING(dt->shared)) dt->shared->u.atomic.u.s.pad = strpad; diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 4c93842..39f85c1 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -74,7 +74,7 @@ NAME H5T_init_vlen_interface -- Initialize interface-specific information USAGE herr_t H5T_init_vlen_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -114,7 +114,7 @@ H5Tvlen_create(hid_t base_id) H5T_t *base = NULL; /*base datatype */ H5T_t *dt = NULL; /*new datatype */ hid_t ret_value; /*return value */ - + FUNC_ENTER_API(H5Tvlen_create, FAIL) H5TRACE1("i","i",base_id); @@ -157,7 +157,7 @@ H5T_vlen_create(const H5T_t *base) { H5T_t *dt = NULL; /*new VL datatype */ H5T_t *ret_value; /*return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5T_vlen_create) /* Check args */ @@ -200,7 +200,7 @@ done: * * Purpose: Sets the location of a VL datatype to be either on disk or in memory * - * Return: + * Return: * One of two values on success: * TRUE - If the location of any vlen types changed * FALSE - If the location of any vlen types is the same @@ -272,7 +272,7 @@ H5T_vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_loc_t loc) /* Mark this type as being stored on disk */ dt->shared->u.vlen.loc=H5T_LOC_DISK; - /* + /* * Size of element on disk is 4 bytes for the length, plus the size * of an address in this file, plus 4 bytes for the size of a heap * ID. Memory size is different @@ -832,7 +832,7 @@ H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t UNUSED /* Skip the length of the sequence */ vl += 4; - + /* Get the heap information */ H5F_addr_decode(f,(const uint8_t **)&vl,&(hobjid.addr)); INT32DECODE(vl,hobjid.idx); @@ -883,7 +883,7 @@ H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t UNUSED assert(vl); assert(seq_len==0 || buf); assert(f); - + /* Free heap object for old data. */ if(bg!=NULL) { H5HG_t bg_hobjid; /* "Background" VL info sequence's ID info */ @@ -905,7 +905,7 @@ H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t UNUSED /* Set the length of the sequence */ UINT32ENCODE(vl, seq_len); - + /* Write the VL information to disk (allocates space also) */ len=(seq_len*base_size); if(H5HG_insert(f,dxpl_id,len,buf,&hobjid)<0) @@ -947,7 +947,7 @@ H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg) /* check parameters */ assert(f); assert(vl); - + /* Free heap object for old data. */ if(bg!=NULL) { H5HG_t bg_hobjid; /* "Background" VL info sequence's ID info */ @@ -969,7 +969,7 @@ H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg) /* Set the length of the sequence */ UINT32ENCODE(vl, seq_len); - + /* Encode the "nil" heap pointer information */ H5F_addr_encode(f,&vl,(haddr_t)0); INT32ENCODE(vl,0); @@ -988,7 +988,7 @@ done: herr_t H5T_vlen_reclaim(elem,dt) void *elem; IN/OUT: Pointer to the dataset element H5T_t *dt; IN: Datatype of dataset element - + RETURNS SUCCEED/FAIL DESCRIPTION @@ -1000,7 +1000,7 @@ done: EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -static herr_t +static herr_t H5T_vlen_reclaim_recurse(void *elem, const H5T_t *dt, H5MM_free_t free_func, void *free_info) { unsigned i; /* local index variable */ @@ -1100,7 +1100,7 @@ done: unsigned ndim; IN: Number of dimensions in dataspace hsize_t *point; IN: Coordinate location of element in dataspace void *op_data IN: Operator data - + RETURNS SUCCEED/FAIL DESCRIPTION @@ -1113,7 +1113,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ /* ARGSUSED */ -herr_t +herr_t H5T_vlen_reclaim(void *elem, hid_t type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void *op_data) { H5T_vlen_alloc_info_t *vl_alloc_info = (H5T_vlen_alloc_info_t *)op_data; /* VL allocation info from iterator */ @@ -1146,8 +1146,8 @@ done: USAGE herr_t H5T_vlen_get_alloc_info(dxpl_id,vl_alloc_info) hid_t dxpl_id; IN: Data transfer property list to query - H5T_vlen_alloc_info_t *vl_alloc_info; IN/OUT: Pointer to VL allocation information to fill - + H5T_vlen_alloc_info_t *vl_alloc_info; IN/OUT: Pointer to VL allocation information to fill + RETURNS SUCCEED/FAIL DESCRIPTION @@ -1161,7 +1161,7 @@ done: EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -herr_t +herr_t H5T_vlen_get_alloc_info(hid_t dxpl_id, H5T_vlen_alloc_info_t **vl_alloc_info) { H5P_genplist_t *plist; /* DX property list */ @@ -438,7 +438,7 @@ done: * will be filled with VAL begins at byte offset OFFSET[] from * the minimum corner of BUF and continues for SIZE[] bytes in * each dimension. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -545,7 +545,7 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, hsize_t dst_start, src_start; /*offset to start at */ hsize_t elmt_size = 1; /*element size in bytes */ herr_t ret_value; /*return status */ -#ifndef NDEBUG +#ifndef NDEBUG unsigned u; #endif @@ -1190,7 +1190,7 @@ H5V_array_calc(hsize_t offset, unsigned n, const hsize_t *total_size, hsize_t *c * a "chunk index" for the chunk that the coordinate offset is * located in. * - * The chunk index starts at 0 and increases according to the + * The chunk index starts at 0 and increases according to the * fastest changing dimension, then the next fastest, etc. * * For example, with a 3x5 chunk size and 6 chunks in the fastest @@ -96,7 +96,7 @@ H5Z_init_interface (void) #endif /* H5_HAVE_FILTER_FLETCHER32 */ #ifdef H5_HAVE_FILTER_SZIP H5Z_SZIP->encoder_present = SZ_encoder_enabled(); - if (H5Z_SZIP->encoder_present < 0) + if (H5Z_SZIP->encoder_present < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "szip filter reports bad status") if (H5Z_register (H5Z_SZIP)<0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter") @@ -178,7 +178,7 @@ H5Z_term_interface (void) /* Print the statistics */ HDfprintf (H5DEBUG(Z), " %s%-15s %10Hd %10Hd %8.2f %8.2f %8.2f " - "%10s\n", dir?"<":">", comment, + "%10s\n", dir?"<":">", comment, H5Z_stat_table_g[i].stats[dir].total, H5Z_stat_table_g[i].stats[dir].errors, H5Z_stat_table_g[i].stats[dir].timer.utime, @@ -271,7 +271,7 @@ H5Z_register (const H5Z_class_t *cls) { size_t i; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5Z_register, FAIL) assert (cls); @@ -378,7 +378,7 @@ H5Z_unregister (H5Z_filter_t id) { size_t i; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5Z_unregister,FAIL) assert (id>=0 && id<=H5Z_FILTER_MAX); @@ -387,7 +387,7 @@ H5Z_unregister (H5Z_filter_t id) for (i=0; i<H5Z_table_used_g; i++) if (H5Z_table_g[i].id==id) break; - + /* Fail if filter not found */ if (i>=H5Z_table_used_g) HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter is not registered") @@ -438,7 +438,7 @@ H5Zfilter_avail(H5Z_filter_t id) ret_value=TRUE; break; } /* end if */ - + done: FUNC_LEAVE_API(ret_value) } /* end H5Zfilter_avail() */ @@ -468,7 +468,7 @@ static herr_t H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_type) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5Z_prelude_callback) assert (H5I_GENPROP_LST==H5I_get_type(dcpl_id)); @@ -521,7 +521,7 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty (void)H5S_close(space); HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") } /* end if */ - + /* Iterate over filters */ for (u=0; u<dcpl_pline.nused; u++) { H5Z_class_t *fclass; /* Individual filter information */ @@ -664,7 +664,7 @@ herr_t H5Z_set_local (hid_t dcpl_id, hid_t type_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5Z_set_local,FAIL) assert (H5I_GENPROP_LST==H5I_get_type(dcpl_id)); @@ -700,7 +700,7 @@ H5Z_modify(const H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, size_t idx; /* Index of filter in pipeline */ size_t i; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5Z_modify, FAIL) assert(pline); @@ -761,7 +761,7 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, { size_t idx, i; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5Z_append, FAIL) assert(pline); @@ -786,7 +786,7 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, pline->nalloc = x.nalloc; pline->filter = x.filter; } - + /* Add the new filter to the pipeline */ idx = pline->nused; pline->filter[idx].id = filter; @@ -911,7 +911,7 @@ done: herr_t H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask/*in,out*/, H5Z_EDC_t edc_read, - H5Z_cb_t cb_struct, size_t *nbytes/*in,out*/, + H5Z_cb_t cb_struct, size_t *nbytes/*in,out*/, size_t *buf_size/*in,out*/, void **buf/*in,out*/) { size_t i, idx, new_nbytes; @@ -924,9 +924,9 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned failed = 0; unsigned tmp_flags; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5Z_pipeline, FAIL) - + assert(0==(flags & ~((unsigned)H5Z_FLAG_INVMASK))); assert(filter_mask); assert(nbytes && *nbytes>0); @@ -937,7 +937,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, if (pline && (flags & H5Z_FLAG_REVERSE)) { /* Read */ for (i=pline->nused; i>0; --i) { idx = i-1; - + if (*filter_mask & ((unsigned)1<<idx)) { failed |= (unsigned)1 << idx; continue;/*filter excluded*/ @@ -952,7 +952,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, #endif tmp_flags=flags|(pline->filter[idx].flags); tmp_flags|=(edc_read== H5Z_DISABLE_EDC) ? H5Z_FLAG_SKIP_EDC : 0; - new_nbytes = (fclass->filter)(tmp_flags, pline->filter[idx].cd_nelmts, + new_nbytes = (fclass->filter)(tmp_flags, pline->filter[idx].cd_nelmts, pline->filter[idx].cd_values, *nbytes, buf_size, buf); #ifdef H5Z_DEBUG @@ -1043,7 +1043,7 @@ H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) { size_t idx; /* Index of filter in pipeline */ H5Z_filter_info_t *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5Z_filter_info, NULL) assert(pline); @@ -1104,7 +1104,7 @@ H5Z_all_filters_avail(const H5O_pline_t *pline) if(j==H5Z_table_used_g) HGOTO_DONE(FALSE) } /* end for */ - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_all_filters_avail() */ @@ -1114,8 +1114,8 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_delete * - * Purpose: Delete filter FILTER from pipeline PLINE; - * deletes all filters if FILTER is H5Z_FILTER_NONE + * Purpose: Delete filter FILTER from pipeline PLINE; + * deletes all filters if FILTER is H5Z_FILTER_NONE * * Return: Non-negative on success/Negative on failure * @@ -1180,7 +1180,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) done: FUNC_LEAVE_NOAPI(ret_value) -} +} /*------------------------------------------------------------------------- * Function: H5Zget_filter_info diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c index 53a330d..8e7428b 100644 --- a/src/H5Zdeflate.c +++ b/src/H5Zdeflate.c @@ -57,7 +57,7 @@ const H5Z_class_t H5Z_DEFLATE[1] = {{ * libz * * Return: Success: Size of buffer filtered - * Failure: 0 + * Failure: 0 * * Programmer: Robb Matzke * Thursday, April 16, 1998 @@ -74,7 +74,7 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts, void *outbuf = NULL; /* Pointer to new buffer */ int status; /* Status from zlib operation */ size_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5Z_filter_deflate, 0) /* Check arguments */ @@ -131,7 +131,7 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts, } } /* end else */ } while(status==Z_OK); - + /* Free the input buffer */ H5MM_xfree(*buf); @@ -155,7 +155,7 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts, uLongf z_dst_nbytes = (uLongf)H5Z_DEFLATE_SIZE_ADJUST(nbytes); uLong z_src_nbytes = (uLong)nbytes; int aggression; /* Compression aggression setting */ - + /* Set the compression aggression level */ H5_ASSIGN_OVERFLOW(aggression,cd_values[0],unsigned,int); diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c index 04741b4..b0c120a 100644 --- a/src/H5Zfletcher32.c +++ b/src/H5Zfletcher32.c @@ -52,7 +52,7 @@ const H5Z_class_t H5Z_FLETCHER32[1] = {{ * * Purpose: Implement an Fletcher32 Checksum using 1's complement. * - * Return: Success: Fletcher32 value + * Return: Success: Fletcher32 value * * Failure: Can't fail * @@ -120,7 +120,7 @@ H5Z_filter_fletcher32_compute(void *_src, size_t len) * Purpose: Implement an I/O filter of Fletcher32 Checksum * * Return: Success: Size of buffer filtered - * Failure: 0 + * Failure: 0 * * Programmer: Raymond Lu * Jan 3, 2003 @@ -128,19 +128,19 @@ H5Z_filter_fletcher32_compute(void *_src, size_t len) * Modifications: * Raymond Lu * July 8, 2005 - * There was a bug in the calculating code of the Fletcher32 - * checksum in the library before v1.6.3. The checksum + * There was a bug in the calculating code of the Fletcher32 + * checksum in the library before v1.6.3. The checksum * value wasn't consistent between big-endian and little-endian - * systems. This bug was fixed in Release 1.6.3. However, - * after fixing the bug, the checksum value is no longer the - * same as before on little-endian system. We'll check both - * the correct checksum and the wrong checksum to be consistent - * with Release 1.6.2 and before. + * systems. This bug was fixed in Release 1.6.3. However, + * after fixing the bug, the checksum value is no longer the + * same as before on little-endian system. We'll check both + * the correct checksum and the wrong checksum to be consistent + * with Release 1.6.2 and before. *------------------------------------------------------------------------- */ /* ARGSUSED */ static size_t -H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned UNUSED cd_values[], +H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned UNUSED cd_values[], size_t nbytes, size_t *buf_size, void **buf) { void *outbuf = NULL; /* Pointer to new buffer */ @@ -150,11 +150,11 @@ H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned U uint8_t c[4]; uint8_t tmp; size_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5Z_filter_fletcher32, 0) assert(sizeof(uint32_t)>=4); - + if (flags & H5Z_FLAG_REVERSE) { /* Read */ /* Do checksum if it's enabled for read; otherwise skip it * to save performance. */ @@ -171,20 +171,20 @@ H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned U /* Compute checksum (can't fail) */ fletcher = H5Z_filter_fletcher32_compute(src,src_nbytes); - /* The reversed checksum. There was a bug in the calculating code of - * the Fletcher32 checksum in the library before v1.6.3. The checksum - * value wasn't consistent between big-endian and little-endian systems. - * This bug was fixed in Release 1.6.3. However, after fixing the bug, - * the checksum value is no longer the same as before on little-endian - * system. We'll check both the correct checksum and the wrong - * checksum to be consistent with Release 1.6.2 and before. - */ + /* The reversed checksum. There was a bug in the calculating code of + * the Fletcher32 checksum in the library before v1.6.3. The checksum + * value wasn't consistent between big-endian and little-endian systems. + * This bug was fixed in Release 1.6.3. However, after fixing the bug, + * the checksum value is no longer the same as before on little-endian + * system. We'll check both the correct checksum and the wrong + * checksum to be consistent with Release 1.6.2 and before. + */ HDmemcpy(c, &fletcher, 4); tmp = c[1]; c[1] = c[0]; c[0] = tmp; - + tmp = c[3]; c[3] = c[2]; c[2] = tmp; @@ -195,7 +195,7 @@ H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned U if(stored_fletcher != fletcher && stored_fletcher != reversed_fletcher) HGOTO_ERROR(H5E_STORAGE, H5E_READERROR, 0, "data error detected by Fletcher32 checksum") } - + /* Set return values */ /* (Re-use the input buffer, just note that the size is smaller by the size of the checksum) */ ret_value = nbytes-FLETCHER_LEN; @@ -204,10 +204,10 @@ H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned U /* Compute checksum (can't fail) */ fletcher = H5Z_filter_fletcher32_compute(src,nbytes); - + if (NULL==(dst=outbuf=H5MM_malloc(nbytes+FLETCHER_LEN))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "unable to allocate Fletcher32 checksum destination buffer") - + /* Copy raw data */ HDmemcpy((void*)dst, (void*)(*buf), nbytes); @@ -222,7 +222,7 @@ H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned U *buf_size = nbytes + FLETCHER_LEN; *buf = outbuf; outbuf = NULL; - ret_value = *buf_size; + ret_value = *buf_size; } done: diff --git a/src/H5Znbit.c b/src/H5Znbit.c index 938528c..96c71d9 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -24,7 +24,7 @@ #ifdef H5_HAVE_FILTER_NBIT -/* Struct of parameters needed for compressing/decompressing +/* Struct of parameters needed for compressing/decompressing * one nbit atomic datatype: integer or floating-point */ typedef struct { @@ -32,12 +32,12 @@ typedef struct { int order; /* datatype endianness order */ int precision; /* datatype precision */ int offset; /* datatype offset */ -} parms_atomic; +} parms_atomic; /* Local function prototypes */ static herr_t H5Z_can_apply_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id); static herr_t H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static size_t H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], +static size_t H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); static void H5Z_calc_parms_nooptype(void); @@ -51,31 +51,31 @@ static herr_t H5Z_set_parms_array(hid_t type_id, unsigned cd_values[]); static herr_t H5Z_set_parms_compound(hid_t type_id, unsigned cd_values[]); static void H5Z_nbit_next_byte(size_t *j, int *buf_len); -static void H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, +static void H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, int end_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int datatype_len); -static void H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, +static void H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, int end_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int datatype_len); -static void H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, +static void H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, int *buf_len, unsigned size); -static void H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, +static void H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p); -static void H5Z_nbit_decompress_one_array(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]); -static void H5Z_nbit_decompress_one_compound(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]); -static void H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, +static void H5Z_nbit_decompress_one_array(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]); +static void H5Z_nbit_decompress_one_compound(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]); +static void H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, const unsigned parms[]); -static void H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, +static void H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, int *buf_len, unsigned size); -static void H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, +static void H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p); -static void H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]); -static void H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]); -static void H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, +static void H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]); +static void H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]); +static void H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t *buffer_size, const unsigned parms[]); - + /* This message derives from H5Z */ H5Z_class_t H5Z_NBIT[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ @@ -123,7 +123,7 @@ static unsigned parms_index = 0; * Programmer: Xiaowen Wu * Tuesday, December 21, 2004 * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -165,18 +165,18 @@ static void H5Z_calc_parms_nooptype(void) { /* Store datatype class code */ ++cd_values_actual_nparms; - + /* Store datatype size */ ++cd_values_actual_nparms; -} +} /*------------------------------------------------------------------------- * Function: H5Z_calc_parms_atomic * * Purpose: Calculate the number of parameters of array cd_values[] - * of atomic datatype whose datatype class is integer - * or floating point + * of atomic datatype whose datatype class is integer + * or floating point * * Programmer: Xiaowen Wu * Saturday, January 29, 2005 @@ -189,7 +189,7 @@ static void H5Z_calc_parms_atomic(void) { /* Store datatype class code */ ++cd_values_actual_nparms; - + /* Store datatype size */ ++cd_values_actual_nparms; @@ -201,7 +201,7 @@ static void H5Z_calc_parms_atomic(void) /* Store datatype's offset */ ++cd_values_actual_nparms; -} +} /*------------------------------------------------------------------------- @@ -231,7 +231,7 @@ static herr_t H5Z_calc_parms_array(hid_t type_id) /* Store datatype class code */ ++cd_values_actual_nparms; - + /* Store array datatype's size */ ++cd_values_actual_nparms; @@ -246,10 +246,10 @@ static herr_t H5Z_calc_parms_array(hid_t type_id) /* Calculate number of the rest parameters according to base datatype's class */ switch(dtype_base_class) { case H5T_INTEGER: - case H5T_FLOAT: + case H5T_FLOAT: H5Z_calc_parms_atomic(); break; - case H5T_ARRAY: + case H5T_ARRAY: if(H5Z_calc_parms_array(dtype_base)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot compute parameters for datatype") break; @@ -286,7 +286,7 @@ done: */ static herr_t H5Z_calc_parms_compound(hid_t type_id) { - int i; /* local index variable */ + int i; /* local index variable */ int nmembers; /* Compound datatype's number of members */ hid_t dtype_member; /* Compound datatype's member datatype */ H5T_class_t dtype_member_class; /* Compound datatype's member datatype's class */ @@ -296,7 +296,7 @@ static herr_t H5Z_calc_parms_compound(hid_t type_id) /* Store compound datatype class code */ ++cd_values_actual_nparms; - + /* Store compound datatype's size */ ++cd_values_actual_nparms; @@ -323,10 +323,10 @@ static herr_t H5Z_calc_parms_compound(hid_t type_id) /* Calculate parameters according to member's datatype class */ switch(dtype_member_class) { case H5T_INTEGER: - case H5T_FLOAT: + case H5T_FLOAT: H5Z_calc_parms_atomic(); break; - case H5T_ARRAY: + case H5T_ARRAY: if(H5Z_calc_parms_array(dtype_member)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot compute parameters for datatype") break; @@ -347,10 +347,10 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_set_parms_nooptype * - * Purpose: Set the array cd_values[] for a given datatype identifier + * Purpose: Set the array cd_values[] for a given datatype identifier * type_id if its datatype class is not integer, nor * floating-point, nor array, nor compound, nor VL datatype, - * and nor VL string + * and nor VL string * * Return: Success: Non-negative * Failure: Negative @@ -371,7 +371,7 @@ static herr_t H5Z_set_parms_nooptype(hid_t type_id, unsigned cd_values[]) /* Set datatype class code */ cd_values[cd_values_index++] = H5Z_NBIT_NOOPTYPE; - + /* Get datatype's size */ if((dtype_size=H5Tget_size(type_id))==0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") @@ -387,8 +387,8 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_set_parms_atomic * - * Purpose: Set the array cd_values[] for a given datatype identifier - * type_id if its datatype class is integer or floating point + * Purpose: Set the array cd_values[] for a given datatype identifier + * type_id if its datatype class is integer or floating point * * Return: Success: Non-negative * Failure: Negative @@ -412,7 +412,7 @@ static herr_t H5Z_set_parms_atomic(hid_t type_id, unsigned cd_values[]) /* Set datatype class code */ cd_values[cd_values_index++] = H5Z_NBIT_ATOMIC; - + /* Get datatype's size */ if((dtype_size=H5Tget_size(type_id))==0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") @@ -455,13 +455,13 @@ static herr_t H5Z_set_parms_atomic(hid_t type_id, unsigned cd_values[]) /* Set "local" parameter for datatype offset */ cd_values[cd_values_index++] = dtype_offset; - /* If before this point, there is no need to compress, check the need to - * compress at this point. If current datatype is not full-precision, - * flag need_not_compress should be set to FALSE. + /* If before this point, there is no need to compress, check the need to + * compress at this point. If current datatype is not full-precision, + * flag need_not_compress should be set to FALSE. */ if(need_not_compress) /* so far no need to compress */ if(dtype_offset != 0 || dtype_precision != dtype_size * 8) - need_not_compress = FALSE; + need_not_compress = FALSE; done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_set_parms_atomic() */ @@ -470,7 +470,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_set_parms_array * - * Purpose: Set the array cd_values[] for a given datatype identifier + * Purpose: Set the array cd_values[] for a given datatype identifier * type_id if its datatype class is array datatype * * Return: Success: Non-negative @@ -495,7 +495,7 @@ static herr_t H5Z_set_parms_array(hid_t type_id, unsigned cd_values[]) /* Set datatype class code */ cd_values[cd_values_index++] = H5Z_NBIT_ARRAY; - + /* Get array datatype's size */ if((dtype_size=H5Tget_size(type_id))==0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") @@ -514,15 +514,15 @@ static herr_t H5Z_set_parms_array(hid_t type_id, unsigned cd_values[]) /* Call appropriate function according to base datatype's class */ switch(dtype_base_class) { case H5T_INTEGER: - case H5T_FLOAT: + case H5T_FLOAT: if(H5Z_set_parms_atomic(dtype_base, cd_values)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") break; - case H5T_ARRAY: + case H5T_ARRAY: if(H5Z_set_parms_array(dtype_base, cd_values)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") break; - case H5T_COMPOUND: + case H5T_COMPOUND: if(H5Z_set_parms_compound(dtype_base, cd_values)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") break; @@ -548,7 +548,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_set_parms_compound * - * Purpose: Set the array cd_values[] for a given datatype identifier + * Purpose: Set the array cd_values[] for a given datatype identifier * type_id if its datatype class is compound datatype * * Return: Success: Non-negative @@ -577,7 +577,7 @@ static herr_t H5Z_set_parms_compound(hid_t type_id, unsigned cd_values[]) /* Set "local" parameter for compound datatype class code */ cd_values[cd_values_index++] = H5Z_NBIT_COMPOUND; - + /* Get datatype's size */ if((dtype_size=H5Tget_size(type_id))==0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") @@ -611,28 +611,28 @@ static herr_t H5Z_set_parms_compound(hid_t type_id, unsigned cd_values[]) /* Call appropriate function according to member's datatype class */ switch(dtype_member_class) { case H5T_INTEGER: - case H5T_FLOAT: + case H5T_FLOAT: if(H5Z_set_parms_atomic(dtype_member, cd_values)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") break; - case H5T_ARRAY: + case H5T_ARRAY: if(H5Z_set_parms_array(dtype_member, cd_values)==FAIL) - HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") + HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") break; case H5T_COMPOUND: if(H5Z_set_parms_compound(dtype_member, cd_values)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") break; - default: /* other datatype that nbit does no compression */ + default: /* other datatype that nbit does no compression */ /* Check if datatype is a variable-length string */ if((is_vlstring=H5Tis_variable_str(dtype_member))<0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot determine if datatype is a variable-length string") - /* Because for some no-op datatype (VL datatype and VL string datatype), its - * size can not be retrieved correctly by using function call H5Tget_size, - * special handling is needed for getting the size. Here the difference between - * adjacent member offset is used (if alignment is present, the result can be + /* Because for some no-op datatype (VL datatype and VL string datatype), its + * size can not be retrieved correctly by using function call H5Tget_size, + * special handling is needed for getting the size. Here the difference between + * adjacent member offset is used (if alignment is present, the result can be * larger, but it does not affect the nbit filter's correctness). */ if(dtype_member_class == H5T_VLEN || is_vlstring) { @@ -646,7 +646,7 @@ static herr_t H5Z_set_parms_compound(hid_t type_id, unsigned cd_values[]) /* Set "local" parameter for datatype size */ cd_values[cd_values_index++] = dtype_next_member_offset - dtype_member_offset; - } else + } else if(H5Z_set_parms_nooptype(dtype_member, cd_values)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") break; @@ -666,10 +666,10 @@ done: * Failure: Negative * * Programmer: Xiaowen Wu - * Tuesday, January 11, 2005 + * Tuesday, January 11, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -688,30 +688,30 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) if((dtype_class = H5Tget_class(type_id)) == H5T_NO_CLASS ) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype class") - /* Calculate how many parameters will fill the cd_values array + /* Calculate how many parameters will fill the cd_values array * First three parameters reserved for: - * 1. number of parameters in array cd_values - * 2. flag if TRUE indicating no need to do nbit compression + * 1. number of parameters in array cd_values + * 2. flag if TRUE indicating no need to do nbit compression * 3. number of elements in the chunk - */ - cd_values_actual_nparms = 3; + */ + cd_values_actual_nparms = 3; switch(dtype_class) { case H5T_INTEGER: - case H5T_FLOAT: + case H5T_FLOAT: H5Z_calc_parms_atomic(); break; - case H5T_ARRAY: + case H5T_ARRAY: if(H5Z_calc_parms_array(type_id)==FAIL) - HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot compute parameters for datatype") + HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot compute parameters for datatype") break; - case H5T_COMPOUND: + case H5T_COMPOUND: if(H5Z_calc_parms_compound(type_id)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot compute parameters for datatype") break; default: /* no need to calculate other datatypes at top level */ break; } /* end switch */ - + /* Check if the number of parameters exceed what cd_values[] can store */ if(cd_values_actual_nparms > H5Z_NBIT_MAX_NPARMS) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "datatype needs too many nbit parameters") @@ -737,24 +737,24 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Set "local" parameter for number of elements in the chunk */ H5_ASSIGN_OVERFLOW(cd_values[cd_values_index++],npoints,hssize_t,unsigned); - + /* Assume no need to compress now, will be changed to FALSE later if not */ need_not_compress = TRUE; /* Call appropriate function according to the datatype class */ switch(dtype_class) { case H5T_INTEGER: - case H5T_FLOAT: + case H5T_FLOAT: if(H5Z_set_parms_atomic(type_id, cd_values)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") break; - case H5T_ARRAY: + case H5T_ARRAY: if(H5Z_set_parms_array(type_id, cd_values)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") break; case H5T_COMPOUND: if(H5Z_set_parms_compound(type_id, cd_values)==FAIL) - HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") + HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") break; default: /* no need to set parameters for other datatypes at top level */ break; @@ -781,35 +781,35 @@ done: * Function: H5Z_filter_nbit * * Purpose: Implement an I/O filter for storing packed nbit data - * + * * Return: Success: Size of buffer filtered - * Failure: 0 + * Failure: 0 * * Programmer: Xiaowen Wu * Friday, January 21, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ static size_t -H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], +H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf) { size_t ret_value = 0; /* return value */ size_t size_out = 0; /* size of output buffer */ unsigned d_nelmts = 0; /* number of elements in the chunk */ unsigned char *outbuf = NULL; /* pointer to new output buffer */ - + FUNC_ENTER_NOAPI(H5Z_filter_nbit, 0) /* check arguments * cd_values[0] stores actual number of parameters in cd_values[] */ - if (cd_nelmts!=cd_values[0]) + if (cd_nelmts!=cd_values[0]) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid nbit aggression level") - /* check if need to do nbit compress or decompress + /* check if need to do nbit compress or decompress * cd_values[1] stores the flag if true indicating no need to compress */ if (cd_values[1]) { @@ -827,12 +827,12 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], /* allocate memory space for decompressed buffer */ if(NULL==(outbuf = H5MM_malloc(size_out))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for nbit decompression") - + /* decompress the buffer */ - H5Z_nbit_decompress(outbuf, d_nelmts, *buf, cd_values); + H5Z_nbit_decompress(outbuf, d_nelmts, *buf, cd_values); } /* output; compress */ - else { + else { assert(nbytes == d_nelmts * cd_values[4]); size_out = nbytes; @@ -840,7 +840,7 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], /* allocate memory space for compressed buffer */ if(NULL==(outbuf = H5MM_malloc(size_out))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for nbit compression") - + /* compress the buffer, size_out will be changed */ H5Z_nbit_compress(*buf, d_nelmts, outbuf, &size_out, cd_values); } @@ -854,7 +854,7 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], *buf_size = size_out; ret_value = size_out; -done: +done: if(outbuf) H5MM_xfree(outbuf); FUNC_LEAVE_NOAPI(ret_value) @@ -864,17 +864,17 @@ done: * assume one byte has 8 bit * assume padding bit is 0 * assume size of unsigned char is one byte - * assume one data item of certain datatype is stored continously in bytes - * atomic datatype is treated on byte basis + * assume one data item of certain datatype is stored continously in bytes + * atomic datatype is treated on byte basis */ static void H5Z_nbit_next_byte(size_t *j, int *buf_len) { - ++(*j); + ++(*j); *buf_len = 8 * sizeof(unsigned char); } -static void H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, +static void H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, int end_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int datatype_len) { int dat_len; /* dat_len is the number of bits to be copied in each data byte */ @@ -886,7 +886,7 @@ int end_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int d uchar_offset = 0; if(begin_i != end_i) { /* significant bits occupy >1 unsigned char */ - if(k == begin_i) + if(k == begin_i) dat_len = 8 - (datatype_len - p.precision - p.offset) % 8; else if(k == end_i) { dat_len = 8 - p.offset %8; @@ -899,7 +899,7 @@ int end_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int d dat_len = p.precision; } - if(*buf_len > dat_len) { + if(*buf_len > dat_len) { data[data_offset + k] = ((val >> (*buf_len - dat_len)) & ~(~0 << dat_len)) << uchar_offset; *buf_len -= dat_len; @@ -913,11 +913,11 @@ int end_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int d val = buffer[*j]; data[data_offset + k] |= ((val >> (*buf_len - dat_len)) & ~(~0 << dat_len)) << uchar_offset; - *buf_len -= dat_len; + *buf_len -= dat_len; } } -static void H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, +static void H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, int *buf_len, unsigned size) { unsigned i; /* index */ @@ -936,12 +936,12 @@ static void H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_of val = buffer[*j]; data[data_offset + i] |= ((val >> (*buf_len - dat_len)) & ~(~0 << dat_len)); - *buf_len -= dat_len; + *buf_len -= dat_len; } } -static void H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p) +static void H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p) { /* begin_i: the index of byte having first significant bit end_i: the index of byte having last significant bit */ @@ -957,8 +957,8 @@ static void H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offs begin_i = (p.precision + p.offset) / 8 - 1; end_i = p.offset / 8; - for(k = begin_i; k >= end_i; k--) - H5Z_nbit_decompress_one_byte(data, data_offset, k, begin_i, end_i, + for(k = begin_i; k >= end_i; k--) + H5Z_nbit_decompress_one_byte(data, data_offset, k, begin_i, end_i, buffer, j, buf_len, p, datatype_len); } @@ -970,14 +970,14 @@ static void H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offs else end_i = (datatype_len - p.offset) / 8 - 1; - for(k = begin_i; k <= end_i; k++) - H5Z_nbit_decompress_one_byte(data, data_offset, k, begin_i, end_i, + for(k = begin_i; k <= end_i; k++) + H5Z_nbit_decompress_one_byte(data, data_offset, k, begin_i, end_i, buffer, j, buf_len, p, datatype_len); - } + } } -static void H5Z_nbit_decompress_one_array(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]) +static void H5Z_nbit_decompress_one_array(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]) { unsigned i, total_size, base_class, base_size, n, begin_index; parms_atomic p; @@ -1018,13 +1018,13 @@ static void H5Z_nbit_decompress_one_array(unsigned char *data, size_t data_offse break; case H5Z_NBIT_NOOPTYPE: parms_index++; /* skip size of no-op type */ - H5Z_nbit_decompress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); + H5Z_nbit_decompress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); break; } /* end switch */ } -static void H5Z_nbit_decompress_one_compound(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]) +static void H5Z_nbit_decompress_one_compound(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]) { unsigned i, nmembers, member_offset, member_class, size; parms_atomic p; @@ -1041,15 +1041,15 @@ static void H5Z_nbit_decompress_one_compound(unsigned char *data, size_t data_of p.order = parms[parms_index++]; p.precision = parms[parms_index++]; p.offset = parms[parms_index++]; - H5Z_nbit_decompress_one_atomic(data, data_offset + member_offset, + H5Z_nbit_decompress_one_atomic(data, data_offset + member_offset, buffer, j, buf_len, p); break; case H5Z_NBIT_ARRAY: - H5Z_nbit_decompress_one_array(data, data_offset + member_offset, + H5Z_nbit_decompress_one_array(data, data_offset + member_offset, buffer, j, buf_len, parms); break; case H5Z_NBIT_COMPOUND: - H5Z_nbit_decompress_one_compound(data, data_offset+member_offset, + H5Z_nbit_decompress_one_compound(data, data_offset+member_offset, buffer, j, buf_len, parms); break; case H5Z_NBIT_NOOPTYPE: @@ -1061,24 +1061,24 @@ static void H5Z_nbit_decompress_one_compound(unsigned char *data, size_t data_of } } -static void H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, - const unsigned parms[]) +static void H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, + const unsigned parms[]) { - /* i: index of data, j: index of buffer, + /* i: index of data, j: index of buffer, buf_len: number of bits to be filled in current byte */ size_t i, j, size; - int buf_len; + int buf_len; parms_atomic p; - /* may not have to initialize to zeros */ - for(i = 0; i < d_nelmts*parms[4]; i++) data[i] = 0; - - /* initialization before the loop */ - j = 0; - buf_len = sizeof(unsigned char) * 8; + /* may not have to initialize to zeros */ + for(i = 0; i < d_nelmts*parms[4]; i++) data[i] = 0; + + /* initialization before the loop */ + j = 0; + buf_len = sizeof(unsigned char) * 8; switch(parms[3]) { - case H5Z_NBIT_ATOMIC: + case H5Z_NBIT_ATOMIC: /* set the index before goto function call */ p.size = parms[4]; p.order = parms[5]; @@ -1090,13 +1090,13 @@ static void H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned break; case H5Z_NBIT_ARRAY: size = parms[4]; - parms_index = 4; + parms_index = 4; for(i = 0; i < d_nelmts; i++) { H5Z_nbit_decompress_one_array(data, i*size, buffer, &j, &buf_len, parms); parms_index = 4; } break; - case H5Z_NBIT_COMPOUND: + case H5Z_NBIT_COMPOUND: size = parms[4]; parms_index = 4; for(i = 0; i < d_nelmts; i++) { @@ -1107,7 +1107,7 @@ static void H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned } /* end switch */ } -static void H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, +static void H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, int end_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int datatype_len) { int dat_len; /* dat_len is the number of bits to be copied in each data byte */ @@ -1116,7 +1116,7 @@ int end_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int d /* initialize value and bits of unsigned char to be copied */ val = data[data_offset + k]; if(begin_i != end_i) { /* significant bits occupy >1 unsigned char */ - if(k == begin_i) + if(k == begin_i) dat_len = 8 - (datatype_len - p.precision - p.offset) % 8; else if(k == end_i) { dat_len = 8 - p.offset % 8; @@ -1129,7 +1129,7 @@ int end_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int d dat_len = p.precision; } - if(*buf_len > dat_len) { + if(*buf_len > dat_len) { buffer[*j] |= (val & ~(~0 << dat_len)) << (*buf_len - dat_len); *buf_len -= dat_len; } else { @@ -1139,11 +1139,11 @@ int end_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int d if(dat_len == 0) return; buffer[*j] = (val & ~(~0 << dat_len)) << (*buf_len - dat_len); - *buf_len -= dat_len; + *buf_len -= dat_len; } } -static void H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, +static void H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, int *buf_len, unsigned size) { unsigned i; /* index */ @@ -1154,22 +1154,22 @@ static void H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offs /* initialize value and bits of unsigned char to be copied */ val = data[data_offset + i]; dat_len = sizeof(unsigned char) * 8; - + buffer[*j] |= (val >> (dat_len - *buf_len)) & ~(~0 << *buf_len); dat_len -= *buf_len; H5Z_nbit_next_byte(j, buf_len); if(dat_len == 0) continue; buffer[*j] = (val & ~(~0 << dat_len)) << (*buf_len - dat_len); - *buf_len -= dat_len; + *buf_len -= dat_len; } } -static void H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p) +static void H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p) { /* begin_i: the index of byte having first significant bit - end_i: the index of byte having last significant bit */ + end_i: the index of byte having last significant bit */ int k, begin_i, end_i, datatype_len; datatype_len = p.size * 8; @@ -1182,8 +1182,8 @@ static void H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset begin_i = (p.precision + p.offset) / 8 - 1; end_i = p.offset / 8; - for(k = begin_i; k >= end_i; k--) - H5Z_nbit_compress_one_byte(data, data_offset, k, begin_i, end_i, + for(k = begin_i; k >= end_i; k--) + H5Z_nbit_compress_one_byte(data, data_offset, k, begin_i, end_i, buffer, j, buf_len, p, datatype_len); } @@ -1195,19 +1195,19 @@ static void H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset else end_i = (datatype_len - p.offset) / 8 - 1; - for(k = begin_i; k <= end_i; k++) - H5Z_nbit_compress_one_byte(data, data_offset, k, begin_i, end_i, + for(k = begin_i; k <= end_i; k++) + H5Z_nbit_compress_one_byte(data, data_offset, k, begin_i, end_i, buffer, j, buf_len, p, datatype_len); - } + } } -static void H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer, - size_t *j, int *buf_len, const unsigned parms[]) +static void H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer, + size_t *j, int *buf_len, const unsigned parms[]) { unsigned i, total_size, base_class, base_size, n, begin_index; parms_atomic p; - total_size = parms[parms_index++]; + total_size = parms[parms_index++]; base_class = parms[parms_index++]; switch(base_class) { @@ -1218,7 +1218,7 @@ static void H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, p.offset = parms[parms_index++]; n = total_size/p.size; for(i = 0; i < n; i++) - H5Z_nbit_compress_one_atomic(data, data_offset + i*p.size, + H5Z_nbit_compress_one_atomic(data, data_offset + i*p.size, buffer, j, buf_len, p); break; case H5Z_NBIT_ARRAY: @@ -1226,7 +1226,7 @@ static void H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, n = total_size/base_size; /* number of base_type elements inside the array datatype */ begin_index = parms_index; for(i = 0; i < n; i++) { - H5Z_nbit_compress_one_array(data, data_offset + i*base_size, + H5Z_nbit_compress_one_array(data, data_offset + i*base_size, buffer, j, buf_len, parms); parms_index = begin_index; } @@ -1236,20 +1236,20 @@ static void H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, n = total_size/base_size; /* number of base_type elements inside the array datatype */ begin_index = parms_index; for(i = 0; i < n; i++) { - H5Z_nbit_compress_one_compound(data, data_offset + i*base_size, + H5Z_nbit_compress_one_compound(data, data_offset + i*base_size, buffer, j, buf_len, parms); parms_index = begin_index; } break; case H5Z_NBIT_NOOPTYPE: parms_index++; /* skip size of no-op type */ - H5Z_nbit_compress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); + H5Z_nbit_compress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); break; } /* end switch */ } -static void H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]) +static void H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]) { unsigned i, nmembers, member_offset, member_class, size; parms_atomic p; @@ -1262,20 +1262,20 @@ static void H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offs member_class = parms[parms_index++]; switch(member_class) { - case H5Z_NBIT_ATOMIC: + case H5Z_NBIT_ATOMIC: p.size = parms[parms_index++]; p.order = parms[parms_index++]; p.precision = parms[parms_index++]; p.offset = parms[parms_index++]; - H5Z_nbit_compress_one_atomic(data, data_offset + member_offset, + H5Z_nbit_compress_one_atomic(data, data_offset + member_offset, buffer, j, buf_len, p); break; - case H5Z_NBIT_ARRAY: - H5Z_nbit_compress_one_array(data, data_offset + member_offset, + case H5Z_NBIT_ARRAY: + H5Z_nbit_compress_one_array(data, data_offset + member_offset, buffer, j, buf_len, parms); break; case H5Z_NBIT_COMPOUND: - H5Z_nbit_compress_one_compound(data, data_offset+member_offset, + H5Z_nbit_compress_one_compound(data, data_offset+member_offset, buffer, j, buf_len, parms); break; case H5Z_NBIT_NOOPTYPE: @@ -1287,24 +1287,24 @@ static void H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offs } } -static void H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, - size_t *buffer_size, const unsigned parms[]) +static void H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, + size_t *buffer_size, const unsigned parms[]) { - /* i: index of data, j: index of buffer, + /* i: index of data, j: index of buffer, buf_len: number of bits to be filled in current byte */ size_t i, j, size; - int buf_len; + int buf_len; parms_atomic p; /* must initialize buffer to be zeros */ for(j = 0; j < *buffer_size; j++) buffer[j] = 0; - /* initialization before the loop */ - j = 0; - buf_len = sizeof(unsigned char) * 8; + /* initialization before the loop */ + j = 0; + buf_len = sizeof(unsigned char) * 8; switch(parms[3]) { - case H5Z_NBIT_ATOMIC: + case H5Z_NBIT_ATOMIC: /* set the index before goto function call */ p.size = parms[4]; p.order = parms[5]; @@ -1315,10 +1315,10 @@ static void H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned c H5Z_nbit_compress_one_atomic(data, i*p.size, buffer, &j, &buf_len, p); } break; - case H5Z_NBIT_ARRAY: + case H5Z_NBIT_ARRAY: size = parms[4]; parms_index = 4; - for(i = 0; i < d_nelmts; i++) { + for(i = 0; i < d_nelmts; i++) { H5Z_nbit_compress_one_array(data, i*size, buffer, &j, &buf_len, parms); parms_index = 4; } @@ -1326,7 +1326,7 @@ static void H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned c case H5Z_NBIT_COMPOUND: size = parms[4]; parms_index = 4; - for(i = 0; i < d_nelmts; i++) { + for(i = 0; i < d_nelmts; i++) { H5Z_nbit_compress_one_compound(data, i*size, buffer, &j, &buf_len, parms); parms_index = 4; } diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index 2c1072d..e13876a 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -54,7 +54,7 @@ H5_DLL herr_t H5Z_modify(const struct H5O_pline_t *pline, H5Z_filter_t filter, H5_DLL herr_t H5Z_pipeline(const struct H5O_pline_t *pline, unsigned flags, unsigned *filter_mask/*in,out*/, H5Z_EDC_t edc_read, H5Z_cb_t cb_struct, - size_t *nbytes/*in,out*/, size_t *buf_size/*in,out*/, + size_t *nbytes/*in,out*/, size_t *buf_size/*in,out*/, void **buf/*in,out*/); H5_DLL H5Z_class_t *H5Z_find(H5Z_filter_t id); H5_DLL herr_t H5Z_can_apply(hid_t dcpl_id, hid_t type_id); diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index a4eeb5e..38134f3 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -55,11 +55,11 @@ typedef int H5Z_filter_t; * include directly due to the duplication of various symbols with the zlib.h * header file] */ #define H5_SZIP_ALLOW_K13_OPTION_MASK 1 -#define H5_SZIP_CHIP_OPTION_MASK 2 +#define H5_SZIP_CHIP_OPTION_MASK 2 #define H5_SZIP_EC_OPTION_MASK 4 #define H5_SZIP_NN_OPTION_MASK 32 #define H5_SZIP_MAX_PIXELS_PER_BLOCK 32 - + /* Special parameters for ScaleOffset filter*/ #define H5_SO_FLOAT_DSCALE 0 #define H5_SO_FLOAT_ESCALE 1 @@ -75,7 +75,7 @@ typedef enum H5Z_EDC_t { H5Z_DISABLE_EDC = 0, H5Z_ENABLE_EDC = 1, H5Z_NO_EDC = 2 /* must be the last */ -} H5Z_EDC_t; +} H5Z_EDC_t; /* Bit flags for H5Zget_filter_info */ #define H5Z_FILTER_CONFIG_ENCODE_ENABLED (0x0001) @@ -108,18 +108,18 @@ extern "C" { * in the dataset creation property list are called * with the dataset's dataset creation property list, the dataset's datatype and * a dataspace describing a chunk (for chunked dataset storage). - * + * * The "can_apply" callback must determine if the combination of the dataset * creation property list setting, the datatype and the dataspace represent a * valid combination to apply this filter to. For example, some cases of * invalid combinations may involve the filter not operating correctly on * certain datatypes (or certain datatype sizes), or certain sizes of the chunk * dataspace. - * + * * The "can_apply" callback can be the NULL pointer, in which case, the library * will assume that it can apply to any combination of dataset creation * property list values, datatypes and dataspaces. - * + * * The "can_apply" callback returns positive a valid combination, zero for an * invalid combination and negative for an error. */ @@ -133,16 +133,16 @@ typedef herr_t (*H5Z_can_apply_func_t)(hid_t dcpl_id, hid_t type_id, hid_t space * list passed in to H5Dcreate) and the datatype ID passed in to H5Dcreate * (which is not copied and should not be modified) and a dataspace describing * the chunk (for chunked dataset storage) (which should also not be modified). - * + * * The "set_local" callback must set any parameters that are specific to this * dataset, based on the combination of the dataset creation property list * values, the datatype and the dataspace. For example, some filters perform * different actions based on different datatypes (or datatype sizes) or * different number of dimensions or dataspace sizes. - * + * * The "set_local" callback can be the NULL pointer, in which case, the library * will assume that there are no dataset-specific settings for this filter. - * + * * The "set_local" callback must return non-negative on success and negative * for an error. */ diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index da7df7f..2dc8692 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -24,15 +24,15 @@ #ifdef H5_HAVE_FILTER_SCALEOFFSET -/* Struct of parameters needed for compressing/decompressing one atomic datatype */ +/* Struct of parameters needed for compressing/decompressing one atomic datatype */ typedef struct { size_t size; /* datatype size */ uint32_t minbits; /* minimum bits to compress one value of such datatype */ unsigned mem_order; /* current memory endianness order */ -} parms_atomic; +} parms_atomic; enum H5Z_scaleoffset_type {t_bad=0, t_uchar=1, t_ushort, t_uint, t_ulong, t_ulong_long, - t_schar, t_short, t_int, t_long, t_long_long, + t_schar, t_short, t_int, t_long, t_long_long, t_float, t_double}; /* Local function prototypes */ @@ -40,7 +40,7 @@ static double H5Z_scaleoffset_rnd(double val); static herr_t H5Z_can_apply_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id); static enum H5Z_scaleoffset_type H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dtype_sign); -static herr_t H5Z_scaleoffset_set_parms_fillval(hid_t dcpl_id, hid_t type_id, +static herr_t H5Z_scaleoffset_set_parms_fillval(hid_t dcpl_id, hid_t type_id, enum H5Z_scaleoffset_type type, unsigned cd_values[], int need_convert); static herr_t H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id); static size_t H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, @@ -55,7 +55,7 @@ static void H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, uint32_t minbits, unsigned long_long minval); static herr_t H5Z_scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, unsigned filavail, const void *filval_buf, - uint32_t *minbits, unsigned long_long *minval, double D_val); + uint32_t *minbits, unsigned long_long *minval, double D_val); static herr_t H5Z_scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, unsigned filavail, const void *filval_buf, uint32_t minbits, unsigned long_long minval, double D_val); @@ -66,11 +66,11 @@ static void H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data static void H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int dtype_len); -static void H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, +static void H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p); -static void H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, +static void H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p); -static void H5Z_scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, +static void H5Z_scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, parms_atomic p); static void H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t buffer_size, parms_atomic p); @@ -567,7 +567,7 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{ /*------------------------------------------------------------------------- * Function: H5Z_can_apply_scaleoffset * - * Purpose: Check the parameters for scaleoffset compression for + * Purpose: Check the parameters for scaleoffset compression for * validity and whether they fit a particular dataset. * * Return: Success: Non-negative @@ -576,7 +576,7 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{ * Programmer: Xiaowen Wu * Friday, February 4, 2005 * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -618,51 +618,51 @@ done: * * Purpose: Get the specific integer type based on datatype size and sign * or floating-point type based on size - * + * * Return: Success: id number of integer type - * Failure: 0 + * Failure: 0 * * Programmer: Xiaowen Wu * Wednesday, April 13, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ -static enum H5Z_scaleoffset_type +static enum H5Z_scaleoffset_type H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dtype_sign) { enum H5Z_scaleoffset_type type; /* integer type */ enum H5Z_scaleoffset_type ret_value; /* return value */ FUNC_ENTER_NOAPI_NOINIT(H5Z_scaleoffset_get_type) - + if(dtype_class==H5Z_SCALEOFFSET_CLS_INTEGER) { if(dtype_sign==H5Z_SCALEOFFSET_SGN_NONE) { /* unsigned integer */ if (dtype_size == sizeof(unsigned char)) type = t_uchar; - else if(dtype_size == sizeof(unsigned short)) type = t_ushort; - else if(dtype_size == sizeof(unsigned int)) type = t_uint; + else if(dtype_size == sizeof(unsigned short)) type = t_ushort; + else if(dtype_size == sizeof(unsigned int)) type = t_uint; else if(dtype_size == sizeof(unsigned long)) type = t_ulong; - else if(dtype_size == sizeof(unsigned long_long)) type = t_ulong_long; - else + else if(dtype_size == sizeof(unsigned long_long)) type = t_ulong_long; + else HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, t_bad, "cannot find matched memory dataype") } if(dtype_sign==H5Z_SCALEOFFSET_SGN_2) { /* signed integer */ if (dtype_size == sizeof(signed char)) type = t_schar; - else if(dtype_size == sizeof(short)) type = t_short; - else if(dtype_size == sizeof(int)) type = t_int; + else if(dtype_size == sizeof(short)) type = t_short; + else if(dtype_size == sizeof(int)) type = t_int; else if(dtype_size == sizeof(long)) type = t_long; - else if(dtype_size == sizeof(long_long)) type = t_long_long; - else + else if(dtype_size == sizeof(long_long)) type = t_long_long; + else HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, t_bad, "cannot find matched memory dataype") } } if(dtype_class==H5Z_SCALEOFFSET_CLS_FLOAT) { if(dtype_size == sizeof(float)) type = t_float; - else if(dtype_size == sizeof(double)) type = t_double; - else + else if(dtype_size == sizeof(double)) type = t_double; + else HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, t_bad, "cannot find matched memory dataype") } @@ -677,7 +677,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_scaleoffset_set_parms_fillval * - * Purpose: Get the fill value of the dataset and store in cd_values[] + * Purpose: Get the fill value of the dataset and store in cd_values[] * * Return: Success: Non-negative * Failure: Negative @@ -685,11 +685,11 @@ done: * Programmer: Xiaowen Wu * Monday, March 7, 2005 * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ -static herr_t H5Z_scaleoffset_set_parms_fillval(hid_t dcpl_id, hid_t type_id, +static herr_t H5Z_scaleoffset_set_parms_fillval(hid_t dcpl_id, hid_t type_id, enum H5Z_scaleoffset_type type, unsigned cd_values[], int need_convert) { herr_t ret_value=SUCCEED; /* Return value */ @@ -697,34 +697,34 @@ static herr_t H5Z_scaleoffset_set_parms_fillval(hid_t dcpl_id, hid_t type_id, FUNC_ENTER_NOAPI(H5Z_scaleoffset_set_parms_fillval, FAIL) if(type == t_uchar) - H5Z_scaleoffset_set_filval_3(unsigned char, dcpl_id, type_id, + H5Z_scaleoffset_set_filval_3(unsigned char, dcpl_id, type_id, cd_values, need_convert) - else if(type == t_ushort) - H5Z_scaleoffset_set_filval_1(unsigned short, dcpl_id, type_id, + else if(type == t_ushort) + H5Z_scaleoffset_set_filval_1(unsigned short, dcpl_id, type_id, cd_values, need_convert) - else if(type == t_uint) - H5Z_scaleoffset_set_filval_1(unsigned int, dcpl_id, type_id, + else if(type == t_uint) + H5Z_scaleoffset_set_filval_1(unsigned int, dcpl_id, type_id, cd_values, need_convert) - else if(type == t_ulong) - H5Z_scaleoffset_set_filval_1(unsigned long, dcpl_id, type_id, + else if(type == t_ulong) + H5Z_scaleoffset_set_filval_1(unsigned long, dcpl_id, type_id, cd_values, need_convert) - else if(type == t_ulong_long) - H5Z_scaleoffset_set_filval_1(unsigned long_long, dcpl_id, type_id, + else if(type == t_ulong_long) + H5Z_scaleoffset_set_filval_1(unsigned long_long, dcpl_id, type_id, cd_values, need_convert) - else if(type == t_schar) - H5Z_scaleoffset_set_filval_3(signed char, dcpl_id, type_id, + else if(type == t_schar) + H5Z_scaleoffset_set_filval_3(signed char, dcpl_id, type_id, cd_values, need_convert) else if(type == t_short) - H5Z_scaleoffset_set_filval_2(short, dcpl_id, type_id, + H5Z_scaleoffset_set_filval_2(short, dcpl_id, type_id, cd_values, need_convert) - else if(type == t_int) - H5Z_scaleoffset_set_filval_2(int, dcpl_id, type_id, + else if(type == t_int) + H5Z_scaleoffset_set_filval_2(int, dcpl_id, type_id, cd_values, need_convert) - else if(type == t_long) - H5Z_scaleoffset_set_filval_2(long, dcpl_id, type_id, + else if(type == t_long) + H5Z_scaleoffset_set_filval_2(long, dcpl_id, type_id, cd_values, need_convert) - else if(type == t_long_long) - H5Z_scaleoffset_set_filval_2(long_long, dcpl_id, type_id, + else if(type == t_long_long) + H5Z_scaleoffset_set_filval_2(long_long, dcpl_id, type_id, cd_values, need_convert) else if(type == t_float) H5Z_scaleoffset_set_filval_4(float, dcpl_id, type_id, @@ -751,7 +751,7 @@ done: * Friday, February 4, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -826,7 +826,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad integer sign") } /* end switch */ } - + /* Get datatype's endianness order */ if((dtype_order=H5Tget_order(type_id))==H5T_ORDER_ERROR) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype endianness order") @@ -895,19 +895,19 @@ done: * * Purpose: Implement an I/O filter for storing packed integer * data using scale and offset method. - * + * * Return: Success: Size of buffer filtered - * Failure: 0 + * Failure: 0 * * Programmer: Xiaowen Wu * Monday, February 7, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ static size_t -H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], +H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf) { size_t ret_value = 0; /* return value */ @@ -928,7 +928,7 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu unsigned buf_offset = 21; /* buffer offset because of parameters stored in file */ unsigned i; /* index */ parms_atomic p; /* paramters needed for compress/decompress functions */ - + FUNC_ENTER_NOAPI(H5Z_filter_scaleoffset, 0) /* check arguments */ @@ -965,18 +965,18 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu * scale type can be H5_SO_FLOAT_DSCALE (0), H5_SO_FLOAT_ESCALE (1) or H5_SO_INT (other) * H5_SO_FLOAT_DSCALE : floating-point type, variable-minimum-bits method, * scale factor is decimal scale factor - * H5_SO_FLOAT_ESCALE : floating-point type, fixed-minimum-bits method, + * H5_SO_FLOAT_ESCALE : floating-point type, fixed-minimum-bits method, * scale factor is the fixed minimum number of bits - * H5_SO_INT : integer type, scale_factor is minimum number of bits + * H5_SO_INT : integer type, scale_factor is minimum number of bits */ if(dtype_class==H5Z_SCALEOFFSET_CLS_FLOAT) { /* floating-point type */ if(scale_type!=H5_SO_FLOAT_DSCALE && scale_type!=H5_SO_FLOAT_ESCALE) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "scale type must be 0 or 1") - } + } else if(dtype_class==H5Z_SCALEOFFSET_CLS_INTEGER) { /* integer type */ if(scale_type==H5_SO_FLOAT_DSCALE || scale_type==H5_SO_FLOAT_ESCALE) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "scale type cannot be 0 or 1") - /* check here when scale_factor is less than 0 for integer, library will reset it to 0 + /* check here when scale_factor is less than 0 for integer, library will reset it to 0 in this case, library will calculate the minimum-bits */ if(scale_factor < 0) scale_factor = 0; } @@ -986,7 +986,7 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu if(scale_type==H5_SO_FLOAT_DSCALE) { /* floating-point type, variable-minimum-bits */ D_val = (double)scale_factor; } else { /* integer type, or floating-point type with fixed-minimum-bits method */ - if(scale_factor>cd_values[H5Z_SCALEOFFSET_PARM_SIZE]*8) + if(scale_factor>cd_values[H5Z_SCALEOFFSET_PARM_SIZE]*8) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "minimum number of bits exceeds maximum") /* no need to process data */ @@ -1041,11 +1041,11 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for scaleoffset decompression") /* special case: minbits equal to full precision */ - if(minbits == p.size * 8) { + if(minbits == p.size * 8) { HDmemcpy(outbuf, (unsigned char*)(*buf)+buf_offset, size_out); /* convert to dataset datatype endianness order if needed */ - if(need_convert) + if(need_convert) H5Z_scaleoffset_convert(outbuf, d_nelmts, p.size); *buf = outbuf; @@ -1055,11 +1055,11 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu goto done; } - /* decompress the buffer if minbits not equal to zero */ - if(minbits != 0) - H5Z_scaleoffset_decompress(outbuf, d_nelmts, (unsigned char*)(*buf)+buf_offset, p); - else { - /* fill value is not defined and all data elements have the same value */ + /* decompress the buffer if minbits not equal to zero */ + if(minbits != 0) + H5Z_scaleoffset_decompress(outbuf, d_nelmts, (unsigned char*)(*buf)+buf_offset, p); + else { + /* fill value is not defined and all data elements have the same value */ for(i = 0; i < size_out; i++) outbuf[i] = 0; } @@ -1069,26 +1069,26 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu /* postprocess after decompression */ if(dtype_class==H5Z_SCALEOFFSET_CLS_INTEGER) - H5Z_scaleoffset_postdecompress_i(outbuf, d_nelmts, type, filavail, + H5Z_scaleoffset_postdecompress_i(outbuf, d_nelmts, type, filavail, &cd_values[H5Z_SCALEOFFSET_PARM_FILVAL], minbits, minval); if(dtype_class==H5Z_SCALEOFFSET_CLS_FLOAT) - if(scale_type==0) { /* variable-minimum-bits method */ - if(H5Z_scaleoffset_postdecompress_fd(outbuf, d_nelmts, type, filavail, + if(scale_type==0) { /* variable-minimum-bits method */ + if(H5Z_scaleoffset_postdecompress_fd(outbuf, d_nelmts, type, filavail, &cd_values[H5Z_SCALEOFFSET_PARM_FILVAL], minbits, minval, D_val)==FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "post-decompression failed") } /* after postprocess, convert to dataset datatype endianness order if needed */ - if(need_convert) + if(need_convert) H5Z_scaleoffset_convert(outbuf, d_nelmts, p.size); } /* output; compress */ - else { + else { assert(nbytes == d_nelmts * p.size); /* before preprocess, convert to memory endianness order if needed */ - if(need_convert) + if(need_convert) H5Z_scaleoffset_convert(*buf, d_nelmts, p.size); /* before preprocess, get memory type */ @@ -1097,11 +1097,11 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu /* preprocess before compression */ if(dtype_class==H5Z_SCALEOFFSET_CLS_INTEGER) - H5Z_scaleoffset_precompress_i(*buf, d_nelmts, type, filavail, + H5Z_scaleoffset_precompress_i(*buf, d_nelmts, type, filavail, &cd_values[H5Z_SCALEOFFSET_PARM_FILVAL], &minbits, &minval); - + if(dtype_class==H5Z_SCALEOFFSET_CLS_FLOAT) - if(scale_type==0) { /* variable-minimum-bits method */ + if(scale_type==0) { /* variable-minimum-bits method */ if(H5Z_scaleoffset_precompress_fd(*buf, d_nelmts, type, filavail, &cd_values[H5Z_SCALEOFFSET_PARM_FILVAL], &minbits, &minval, D_val)==FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "pre-compression failed") @@ -1142,10 +1142,10 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu goto done; } - /* compress the buffer if minbits not equal to zero - * minbits equal to zero only when fill value is not defined and - * all data elements have the same value - */ + /* compress the buffer if minbits not equal to zero + * minbits equal to zero only when fill value is not defined and + * all data elements have the same value + */ if(minbits != 0) H5Z_scaleoffset_compress(*buf, d_nelmts, outbuf+buf_offset, size_out-buf_offset, p); } @@ -1169,13 +1169,13 @@ done: * assume one byte has 8 bit * assume padding bit is 0 * assume size of unsigned char is one byte - * assume one data item of certain datatype is stored continously in bytes - * atomic datatype is treated on byte basis + * assume one data item of certain datatype is stored continously in bytes + * atomic datatype is treated on byte basis */ /* change byte order of input buffer either from little-endian to big-endian - * or from big-endian to little-endian 2/21/2005 + * or from big-endian to little-endian 2/21/2005 */ static void H5Z_scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size) { @@ -1195,28 +1195,28 @@ static void H5Z_scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype } /* Round a floating-point value to the nearest integer value 4/19/05 */ -/* rounding to the bigger absolute value if val is in the middle, +/* rounding to the bigger absolute value if val is in the middle, 0.5 -> 1, -0.5 ->-1 5/9/05, KY */ -static double H5Z_scaleoffset_rnd(double val) -{ - double u_val, l_val; - - u_val = HDceil(val); +static double H5Z_scaleoffset_rnd(double val) +{ + double u_val, l_val; + + u_val = HDceil(val); l_val = HDfloor(val); if(val > 0) { - if((u_val - val)<=(val - l_val)) return u_val; - else return l_val; - } + if((u_val - val)<=(val - l_val)) return u_val; + else return l_val; + } else { - if((val - l_val)<=(u_val - val)) return l_val; - else return u_val; - } -} + if((val - l_val)<=(u_val - val)) return l_val; + else return u_val; + } +} /* return ceiling of floating-point log2 function - * receive unsigned integer as argument 3/10/2005 + * receive unsigned integer as argument 3/10/2005 */ static unsigned H5Z_scaleoffset_log2(unsigned long_long num) { @@ -1231,119 +1231,119 @@ static unsigned H5Z_scaleoffset_log2(unsigned long_long num) } /* precompress for integer type */ -static void -H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, +static void +H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, unsigned filavail, const void *filval_buf, uint32_t *minbits, unsigned long_long *minval) { if(type == t_uchar) - H5Z_scaleoffset_precompress_1(unsigned char, data, d_nelmts, + H5Z_scaleoffset_precompress_1(unsigned char, data, d_nelmts, filavail, filval_buf, minbits, minval) - else if(type == t_ushort) - H5Z_scaleoffset_precompress_1(unsigned short, data, d_nelmts, + else if(type == t_ushort) + H5Z_scaleoffset_precompress_1(unsigned short, data, d_nelmts, filavail, filval_buf, minbits, minval) - else if(type == t_uint) - H5Z_scaleoffset_precompress_1(unsigned int, data, d_nelmts, + else if(type == t_uint) + H5Z_scaleoffset_precompress_1(unsigned int, data, d_nelmts, filavail, filval_buf, minbits, minval) else if(type == t_ulong) - H5Z_scaleoffset_precompress_1(unsigned long, data, d_nelmts, + H5Z_scaleoffset_precompress_1(unsigned long, data, d_nelmts, filavail, filval_buf, minbits, minval) - else if(type == t_ulong_long) - H5Z_scaleoffset_precompress_1(unsigned long_long, data, d_nelmts, + else if(type == t_ulong_long) + H5Z_scaleoffset_precompress_1(unsigned long_long, data, d_nelmts, filavail, filval_buf, minbits, minval) else if(type == t_schar) { - signed char *buf = data, min = 0, max = 0, filval = 0; - unsigned char span; unsigned i; - - if(filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */ - H5Z_scaleoffset_get_filval_1(i, signed char, filval_buf, filval); - if(*minbits == H5_SO_INT_MINIMUMBITS_DEFAULT ) { /* minbits not set yet, calculate max, min, and minbits */ + signed char *buf = data, min = 0, max = 0, filval = 0; + unsigned char span; unsigned i; + + if(filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */ + H5Z_scaleoffset_get_filval_1(i, signed char, filval_buf, filval); + if(*minbits == H5_SO_INT_MINIMUMBITS_DEFAULT ) { /* minbits not set yet, calculate max, min, and minbits */ H5Z_scaleoffset_max_min_1(i, d_nelmts, buf, filval, max, min) - if((unsigned char)(max - min) > (unsigned char)(~(unsigned char)0 - 2)) - { *minbits = sizeof(signed char)*8; return; } - span = max - min + 1; + if((unsigned char)(max - min) > (unsigned char)(~(unsigned char)0 - 2)) + { *minbits = sizeof(signed char)*8; return; } + span = max - min + 1; *minbits = H5Z_scaleoffset_log2((unsigned long_long)(span+1)); - } else /* minbits already set, only calculate min */ - H5Z_scaleoffset_min_1(i, d_nelmts, buf, filval, min) - if(*minbits != sizeof(signed char)*8) /* change values if minbits != full precision */ - for(i = 0; i < d_nelmts; i++) - buf[i] = (buf[i] == filval)?(((unsigned char)1 << *minbits) - 1):(buf[i] - min); - } else { /* fill value undefined */ - if(*minbits == H5_SO_INT_MINIMUMBITS_DEFAULT ) { /* minbits not set yet, calculate max, min, and minbits */ - H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max, min) + } else /* minbits already set, only calculate min */ + H5Z_scaleoffset_min_1(i, d_nelmts, buf, filval, min) + if(*minbits != sizeof(signed char)*8) /* change values if minbits != full precision */ + for(i = 0; i < d_nelmts; i++) + buf[i] = (buf[i] == filval)?(((unsigned char)1 << *minbits) - 1):(buf[i] - min); + } else { /* fill value undefined */ + if(*minbits == H5_SO_INT_MINIMUMBITS_DEFAULT ) { /* minbits not set yet, calculate max, min, and minbits */ + H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max, min) if((unsigned char)(max - min) > (unsigned char)(~(unsigned char)0 - 2)) { *minbits = sizeof(signed char)*8; *minval = min; return; - } - span = max - min + 1; + } + span = max - min + 1; *minbits = H5Z_scaleoffset_log2((unsigned long_long)span); - } else /* minbits already set, only calculate min */ - H5Z_scaleoffset_min_2(i, d_nelmts, buf, min) - if(*minbits != sizeof(signed char)*8) /* change values if minbits != full precision */ - for(i = 0; i < d_nelmts; i++) buf[i] -= min; - } - *minval = min; - } + } else /* minbits already set, only calculate min */ + H5Z_scaleoffset_min_2(i, d_nelmts, buf, min) + if(*minbits != sizeof(signed char)*8) /* change values if minbits != full precision */ + for(i = 0; i < d_nelmts; i++) buf[i] -= min; + } + *minval = min; + } else if(type == t_short) - H5Z_scaleoffset_precompress_2(short, data, d_nelmts, + H5Z_scaleoffset_precompress_2(short, data, d_nelmts, filavail, filval_buf, minbits, minval) else if(type == t_int) - H5Z_scaleoffset_precompress_2(int, data, d_nelmts, + H5Z_scaleoffset_precompress_2(int, data, d_nelmts, filavail, filval_buf, minbits, minval) - else if(type == t_long) - H5Z_scaleoffset_precompress_2(long, data, d_nelmts, + else if(type == t_long) + H5Z_scaleoffset_precompress_2(long, data, d_nelmts, filavail, filval_buf, minbits, minval) - else if(type == t_long_long) - H5Z_scaleoffset_precompress_2(long_long, data, d_nelmts, + else if(type == t_long_long) + H5Z_scaleoffset_precompress_2(long_long, data, d_nelmts, filavail, filval_buf, minbits, minval) } /* postdecompress for integer type */ -static void -H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, +static void +H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, unsigned filavail, const void *filval_buf, uint32_t minbits, unsigned long_long minval) { long_long sminval = *(long_long*)&minval; /* for signed integer types */ - if(type == t_uchar) - H5Z_scaleoffset_postdecompress_1(unsigned char, data, d_nelmts, filavail, + if(type == t_uchar) + H5Z_scaleoffset_postdecompress_1(unsigned char, data, d_nelmts, filavail, filval_buf, minbits, minval) - else if(type == t_ushort) - H5Z_scaleoffset_postdecompress_1(unsigned short, data, d_nelmts, filavail, + else if(type == t_ushort) + H5Z_scaleoffset_postdecompress_1(unsigned short, data, d_nelmts, filavail, filval_buf, minbits, minval) - else if(type == t_uint) - H5Z_scaleoffset_postdecompress_1(unsigned int, data, d_nelmts, filavail, + else if(type == t_uint) + H5Z_scaleoffset_postdecompress_1(unsigned int, data, d_nelmts, filavail, filval_buf, minbits, minval) - else if(type == t_ulong) - H5Z_scaleoffset_postdecompress_1(unsigned long, data, d_nelmts, filavail, + else if(type == t_ulong) + H5Z_scaleoffset_postdecompress_1(unsigned long, data, d_nelmts, filavail, filval_buf, minbits, minval) - else if(type == t_ulong_long) - H5Z_scaleoffset_postdecompress_1(unsigned long_long, data, d_nelmts, filavail, + else if(type == t_ulong_long) + H5Z_scaleoffset_postdecompress_1(unsigned long_long, data, d_nelmts, filavail, filval_buf, minbits, minval) else if(type == t_schar) { signed char *buf = data, filval = 0; unsigned i; if(filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */ H5Z_scaleoffset_get_filval_1(i, signed char, filval_buf, filval) - for(i = 0; i < d_nelmts; i++) + for(i = 0; i < d_nelmts; i++) buf[i] = (buf[i] == (((unsigned char)1 << minbits) - 1))?filval:(buf[i] + sminval); } else /* fill value undefined */ for(i = 0; i < d_nelmts; i++) buf[i] += sminval; - } - else if(type == t_short) - H5Z_scaleoffset_postdecompress_2(short, data, d_nelmts, filavail, + } + else if(type == t_short) + H5Z_scaleoffset_postdecompress_2(short, data, d_nelmts, filavail, filval_buf, minbits, sminval) - else if(type == t_int) - H5Z_scaleoffset_postdecompress_2(int, data, d_nelmts, filavail, + else if(type == t_int) + H5Z_scaleoffset_postdecompress_2(int, data, d_nelmts, filavail, filval_buf, minbits, sminval) - else if(type == t_long) - H5Z_scaleoffset_postdecompress_2(long, data, d_nelmts, filavail, + else if(type == t_long) + H5Z_scaleoffset_postdecompress_2(long, data, d_nelmts, filavail, filval_buf, minbits, sminval) - else if(type == t_long_long) - H5Z_scaleoffset_postdecompress_2(long_long, data, d_nelmts, filavail, + else if(type == t_long_long) + H5Z_scaleoffset_postdecompress_2(long_long, data, d_nelmts, filavail, filval_buf, minbits, sminval) } -/* precompress for floating-point type, variable-minimum-bits method +/* precompress for floating-point type, variable-minimum-bits method success: non-negative, failure: negative 4/15/05 */ static herr_t H5Z_scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, @@ -1353,18 +1353,18 @@ unsigned filavail, const void *filval_buf, uint32_t *minbits, unsigned long_long FUNC_ENTER_NOAPI(H5Z_scaleoffset_precompress_fd, FAIL) - if(type == t_float) - H5Z_scaleoffset_precompress_3(float, data, d_nelmts, + if(type == t_float) + H5Z_scaleoffset_precompress_3(float, data, d_nelmts, filavail, filval_buf, minbits, minval, D_val) - else if(type == t_double) - H5Z_scaleoffset_precompress_3(double, data, d_nelmts, + else if(type == t_double) + H5Z_scaleoffset_precompress_3(double, data, d_nelmts, filavail, filval_buf, minbits, minval, D_val) done: FUNC_LEAVE_NOAPI(ret_value) } -/* postdecompress for floating-point type, variable-minimum-bits method +/* postdecompress for floating-point type, variable-minimum-bits method success: non-negative, failure: negative 4/15/05 */ static herr_t H5Z_scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, @@ -1375,23 +1375,23 @@ unsigned filavail, const void *filval_buf, uint32_t minbits, unsigned long_long FUNC_ENTER_NOAPI(H5Z_scaleoffset_postdecompress_fd, FAIL) - if(type == t_float) - H5Z_scaleoffset_postdecompress_3(float, data, d_nelmts, filavail, + if(type == t_float) + H5Z_scaleoffset_postdecompress_3(float, data, d_nelmts, filavail, filval_buf, minbits, sminval, D_val) - else if(type == t_double) - H5Z_scaleoffset_postdecompress_3(double, data, d_nelmts, filavail, + else if(type == t_double) + H5Z_scaleoffset_postdecompress_3(double, data, d_nelmts, filavail, filval_buf, minbits, sminval, D_val) done: FUNC_LEAVE_NOAPI(ret_value) -} +} static void H5Z_scaleoffset_next_byte(size_t *j, int *buf_len) { ++(*j); *buf_len = 8 * sizeof(unsigned char); } -static void H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, int k, +static void H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int dtype_len) { int dat_len; /* dat_len is the number of bits to be copied in each data byte */ @@ -1399,12 +1399,12 @@ int begin_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int /* initialize value and bits of unsigned char to be copied */ val = buffer[*j]; - if(k == begin_i) + if(k == begin_i) dat_len = 8 - (dtype_len - p.minbits) % 8; - else + else dat_len = 8; - if(*buf_len > dat_len) { + if(*buf_len > dat_len) { data[data_offset + k] = ((val >> (*buf_len - dat_len)) & ~(~0 << dat_len)); *buf_len -= dat_len; @@ -1418,12 +1418,12 @@ int begin_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int val = buffer[*j]; data[data_offset + k] |= ((val >> (*buf_len - dat_len)) & ~(~0 << dat_len)); - *buf_len -= dat_len; + *buf_len -= dat_len; } } -static void H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p) +static void H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p) { /* begin_i: the index of byte having first significant bit */ int k, begin_i, dtype_len; @@ -1435,41 +1435,41 @@ static void H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t da if(p.mem_order == H5Z_SCALEOFFSET_ORDER_LE) { /* little endian */ begin_i = p.size - 1 - (dtype_len - p.minbits) / 8; - for(k = begin_i; k >= 0; k--) - H5Z_scaleoffset_decompress_one_byte(data, data_offset, k, begin_i, + for(k = begin_i; k >= 0; k--) + H5Z_scaleoffset_decompress_one_byte(data, data_offset, k, begin_i, buffer, j, buf_len, p, dtype_len); } if(p.mem_order == H5Z_SCALEOFFSET_ORDER_BE) { /* big endian */ begin_i = (dtype_len - p.minbits) / 8; - for(k = begin_i; k <= p.size - 1; k++) - H5Z_scaleoffset_decompress_one_byte(data, data_offset, k, begin_i, + for(k = begin_i; k <= p.size - 1; k++) + H5Z_scaleoffset_decompress_one_byte(data, data_offset, k, begin_i, buffer, j, buf_len, p, dtype_len); - } + } } -static void H5Z_scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, - unsigned char *buffer, parms_atomic p) +static void H5Z_scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, + unsigned char *buffer, parms_atomic p) { - /* i: index of data, j: index of buffer, + /* i: index of data, j: index of buffer, buf_len: number of bits to be filled in current byte */ size_t i, j; - int buf_len; + int buf_len; - /* must initialize to zeros */ - for(i = 0; i < d_nelmts*p.size; i++) data[i] = 0; - - /* initialization before the loop */ - j = 0; - buf_len = sizeof(unsigned char) * 8; + /* must initialize to zeros */ + for(i = 0; i < d_nelmts*p.size; i++) data[i] = 0; + + /* initialization before the loop */ + j = 0; + buf_len = sizeof(unsigned char) * 8; /* decompress */ - for(i = 0; i < d_nelmts; i++) + for(i = 0; i < d_nelmts; i++) H5Z_scaleoffset_decompress_one_atomic(data, i*p.size, buffer, &j, &buf_len, p); } -static void H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, int k, +static void H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int dtype_len) { int dat_len; /* dat_len is the number of bits to be copied in each data byte */ @@ -1477,12 +1477,12 @@ int begin_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int /* initialize value and bits of unsigned char to be copied */ val = data[data_offset + k]; - if(k == begin_i) + if(k == begin_i) dat_len = 8 - (dtype_len - p.minbits) % 8; else dat_len = 8; - if(*buf_len > dat_len) { + if(*buf_len > dat_len) { buffer[*j] |= (val & ~(~0 << dat_len)) << (*buf_len - dat_len); *buf_len -= dat_len; } else { @@ -1492,12 +1492,12 @@ int begin_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int if(dat_len == 0) return; buffer[*j] = (val & ~(~0 << dat_len)) << (*buf_len - dat_len); - *buf_len -= dat_len; + *buf_len -= dat_len; } } -static void H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p) +static void H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p) { /* begin_i: the index of byte having first significant bit */ int k, begin_i, dtype_len; @@ -1509,38 +1509,38 @@ static void H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data if(p.mem_order == H5Z_SCALEOFFSET_ORDER_LE) { /* little endian */ begin_i = p.size - 1 - (dtype_len - p.minbits) / 8; - for(k = begin_i; k >= 0; k--) - H5Z_scaleoffset_compress_one_byte(data, data_offset, k, begin_i, + for(k = begin_i; k >= 0; k--) + H5Z_scaleoffset_compress_one_byte(data, data_offset, k, begin_i, buffer, j, buf_len, p, dtype_len); } if(p.mem_order == H5Z_SCALEOFFSET_ORDER_BE) { /* big endian */ begin_i = (dtype_len - p.minbits) / 8; - for(k = begin_i; k <= p.size - 1; k++) - H5Z_scaleoffset_compress_one_byte(data, data_offset, k, begin_i, + for(k = begin_i; k <= p.size - 1; k++) + H5Z_scaleoffset_compress_one_byte(data, data_offset, k, begin_i, buffer, j, buf_len, p, dtype_len); - } + } } -static void H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, - size_t buffer_size, parms_atomic p) +static void H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, + size_t buffer_size, parms_atomic p) { - /* i: index of data, j: index of buffer, + /* i: index of data, j: index of buffer, buf_len: number of bits to be filled in current byte */ size_t i, j; - int buf_len; + int buf_len; /* must initialize buffer to be zeros */ - for(j = 0; j < buffer_size; j++) + for(j = 0; j < buffer_size; j++) buffer[j] = 0; - /* initialization before the loop */ - j = 0; - buf_len = sizeof(unsigned char) * 8; + /* initialization before the loop */ + j = 0; + buf_len = sizeof(unsigned char) * 8; /* compress */ - for(i = 0; i < d_nelmts; i++) + for(i = 0; i < d_nelmts; i++) H5Z_scaleoffset_compress_one_atomic(data, i*p.size, buffer, &j, &buf_len, p); } #endif /* H5_HAVE_FILTER_SCALEOFFSET */ diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c index d97676e..0082bea 100644 --- a/src/H5Zshuffle.c +++ b/src/H5Zshuffle.c @@ -106,7 +106,7 @@ done: * each other and putting them together will increase compression. * * Return: Success: Size of buffer filtered - * Failure: 0 + * Failure: 0 * * Programmer: Kent Yang * Wednesday, November 13, 2002 @@ -118,7 +118,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], +H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf) { void *dest = NULL; /* Buffer to deposit [un]shuffled bytes into */ @@ -202,7 +202,7 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], #undef DUFF_GUTS } /* end for */ - /* Add leftover to the end of data */ + /* Add leftover to the end of data */ if(leftover>0) { /* Adjust back to end of shuffled bytes */ _dest -= (bytesoftype - 1); /*lint !e794 _dest is initialized */ @@ -257,7 +257,7 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], #undef DUFF_GUTS } /* end for */ - /* Add leftover to the end of data */ + /* Add leftover to the end of data */ if(leftover>0) { /* Adjust back to end of shuffled bytes */ _src -= (bytesoftype - 1); /*lint !e794 _src is initialized */ diff --git a/src/H5Zszip.c b/src/H5Zszip.c index d2c8416..1da1b39 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -127,7 +127,7 @@ done: * of any shape and size with only one restriction: the number * of elements in the chunk has to be not less than number * of elements (pixels) in the block (cd_values[H5Z_SZIP_PARM_PPB] - * parameter). + * parameter). * Elena Pourmal, July 20, 2004 * *------------------------------------------------------------------------- @@ -190,8 +190,8 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* (Use the chunk's fastest changing dimension size) */ assert(ndims>0); scanline=dims[ndims-1]; - - /* Adjust scanline if it is smaller than number of pixels per block or + + /* Adjust scanline if it is smaller than number of pixels per block or if it is bigger than maximum pixels per scanline, or there are more than SZ_MAX_BLOCKS_PER_SCANLINE blocks per scanline */ @@ -199,12 +199,12 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) if(scanline<cd_values[H5Z_SZIP_PARM_PPB]) { hssize_t npoints; /* Number of points in the dataspace */ - /* Get number of elements for the dataspace; use + /* Get number of elements for the dataspace; use total number of elements in the chunk to define the new 'scanline' size */ if ((npoints=H5Sget_simple_extent_npoints(space_id))<0) HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get number of points in the dataspace") if(npoints<cd_values[H5Z_SZIP_PARM_PPB]) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "pixels per block greater than total number of elements in the chunk") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "pixels per block greater than total number of elements in the chunk") scanline = MIN((cd_values[H5Z_SZIP_PARM_PPB] * SZ_MAX_BLOCKS_PER_SCANLINE), npoints); } else { @@ -253,7 +253,7 @@ done: * libsz * * Return: Success: Size of buffer filtered - * Failure: 0 + * Failure: 0 * * Programmer: Kent Yang * Tuesday, April 1, 2003 @@ -265,7 +265,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], +H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf) { size_t ret_value = 0; /* Return value */ @@ -305,7 +305,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], newbuf = *buf; UINT32DECODE(newbuf,stored_nalloc); H5_ASSIGN_OVERFLOW(nalloc,stored_nalloc,uint32_t,size_t); - + /* Allocate space for the uncompressed buffer */ if(NULL==(outbuf = H5MM_malloc(nalloc))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for szip decompression") @@ -353,7 +353,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], ret_value = size_out+4; } -done: +done: if(outbuf) H5MM_xfree(outbuf); FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index 8e2f92d..cbf21b7 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -2,7 +2,7 @@ * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * - + * terms governing use, modification, and redistribution, is contained in * * the files COPYING and Copyright.html. COPYING can be found at the root * * of the source code distribution tree; Copyright.html can be found at the * @@ -321,14 +321,14 @@ H5Z_unget_token(H5Z_token *current) FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5Z_unget_token) - + current->tok_type = current->tok_last_type; current->tok_begin = current->tok_last_begin; current->tok_end = current->tok_last_end; FUNC_LEAVE_NOAPI_VOID - - + + } @@ -351,12 +351,12 @@ H5Z_unget_token(H5Z_token *current) static H5Z_token * H5Z_get_token(H5Z_token *current) { - + void* ret_value=current; - + FUNC_ENTER_NOAPI(H5Z_get_token, NULL) - + /* check args */ assert(current); @@ -466,7 +466,7 @@ H5Z_get_token(H5Z_token *current) done: FUNC_LEAVE_NOAPI(ret_value) - + } @@ -485,7 +485,7 @@ void H5Z_xform_destroy_parse_tree(H5Z_node *tree) { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5Z_xform_destroy_parse_tree) - + if (tree) { H5Z_xform_destroy_parse_tree(tree->lchild); @@ -516,20 +516,20 @@ H5Z_xform_parse(const char *expression, H5Z_datval_ptrs* dat_val_pointers) { H5Z_token tok; void* ret_value; - + FUNC_ENTER_NOAPI_NOFUNC(H5Z_xform_parse) - + if (!expression) HGOTO_DONE(NULL) - - + + /* Set up the initial H5Z_token for parsing */ tok.tok_expr = tok.tok_begin = tok.tok_end = expression; - + ret_value = (void*)H5Z_parse_expression(&tok, dat_val_pointers); H5Z_xform_reduce_tree((H5Z_node*)ret_value); - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -643,13 +643,13 @@ H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) { H5Z_node *term = NULL; void* ret_value; - + FUNC_ENTER_NOAPI(H5Z_parse_term, NULL); term = H5Z_parse_factor(current, dat_val_pointers); - + for (;;) { H5Z_node *new_node; - + current = H5Z_get_token(current); switch (current->tok_type) { @@ -887,7 +887,7 @@ H5Z_new_node(H5Z_token_type type) /*------------------------------------------------------------------------- * Function: H5Z_xform_eval * Purpose: If the transform is trivial, this function applies it. - * Otherwise, it calls H5Z_xform_eval_full to do the full + * Otherwise, it calls H5Z_xform_eval_full to do the full * transform. * Return: SUCCEED if transform applied succesfully, FAIL otherwise * Programmer: Leon Arber @@ -913,12 +913,12 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size tree=data_xform_prop->parse_root; /* Get the datatype ID for the buffer's type */ - if( (array_type = H5Z_xform_find_type(buf_type)) < 0) + if( (array_type = H5Z_xform_find_type(buf_type)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Cannot perform data transform on this type.") /*After this point, we're assured that the type of the array is handled by the eval code, so we no * longer have to check for valid types */ - + /* If it's a trivial data transform, perform it */ if( tree->type == H5Z_XFORM_INTEGER || tree->type == H5Z_XFORM_FLOAT) { @@ -991,7 +991,7 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size done: if(ret_value < 0) { - /* If we ran out of memory above copying the array for temp storage (which we easily can for + /* If we ran out of memory above copying the array for temp storage (which we easily can for * polynomial transforms of high order) we free those arrays which we already allocated */ if(data_xform_prop->dat_val_pointers->num_ptrs > 1) for(i=0; i<data_xform_prop->dat_val_pointers->num_ptrs; i++) @@ -1030,42 +1030,42 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_ /* check args */ assert(tree); - if (tree->type == H5Z_XFORM_INTEGER) + if (tree->type == H5Z_XFORM_INTEGER) { res->type = H5Z_XFORM_INTEGER; res->value.int_val = tree->value.int_val; - } - else if (tree->type == H5Z_XFORM_FLOAT) + } + else if (tree->type == H5Z_XFORM_FLOAT) { res->type = H5Z_XFORM_FLOAT; res->value.float_val = tree->value.float_val; - } - else if (tree->type == H5Z_XFORM_SYMBOL) + } + else if (tree->type == H5Z_XFORM_SYMBOL) { res->type = H5Z_XFORM_SYMBOL; /*since dat_val stores the address of the array which is really stored in the dat_val_pointers, - * here we make dat_val store a pointer to the array itself instead of the address of it so that the + * here we make dat_val store a pointer to the array itself instead of the address of it so that the * rest of the code below works normally. */ res->value.dat_val = *((void**)(tree->value.dat_val)); - } - else + } + else { if(H5Z_xform_eval_full(tree->lchild, array_size, array_type, &resl) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform") if(H5Z_xform_eval_full(tree->rchild, array_size, array_type, &resr) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform") - res->type = H5Z_XFORM_SYMBOL; + res->type = H5Z_XFORM_SYMBOL; /* For each type of operation: * 1. See if "x" is on left hand side, right hand side, or if both sides are "x" * 2. Figure out what type of data we're going to be manipulating * 3. Do the operation on the data. */ - + switch (tree->type) { - case H5Z_XFORM_PLUS: + case H5Z_XFORM_PLUS: H5Z_XFORM_TYPE_OP(resl, resr, array_type, +=, array_size) break; @@ -1076,12 +1076,12 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_ case H5Z_XFORM_MULT: H5Z_XFORM_TYPE_OP(resl, resr, array_type, *=, array_size) break; - - case H5Z_XFORM_DIVIDE: + + case H5Z_XFORM_DIVIDE: H5Z_XFORM_TYPE_OP(resl, resr, array_type, /=, array_size) break; - default: + default: HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid expression tree") } /* The result stores a pointer to the new data */ @@ -1108,7 +1108,7 @@ done: * Return: Native type of datatype that is passed in * Programmer: Leon Arber, 4/20/04 * Modifications: - * + * * *------------------------------------------------------------------------- */ @@ -1201,12 +1201,12 @@ done: */ void * H5Z_xform_copy_tree(H5Z_node* tree, H5Z_datval_ptrs* dat_val_pointers, H5Z_datval_ptrs* new_dat_val_pointers) -{ +{ H5Z_node* ret_value=NULL; FUNC_ENTER_NOAPI(H5Z_xform_copy_tree, NULL) - - assert(tree); + + assert(tree); if(tree->type == H5Z_XFORM_INTEGER) { @@ -1221,40 +1221,40 @@ H5Z_xform_copy_tree(H5Z_node* tree, H5Z_datval_ptrs* dat_val_pointers, H5Z_datva } } else if (tree->type == H5Z_XFORM_FLOAT) - { + { if ((ret_value = (H5Z_node*) H5MM_malloc(sizeof(H5Z_node))) == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Ran out of memory trying to copy parse tree") else - { + { ret_value -> type = H5Z_XFORM_FLOAT; ret_value ->value.float_val = tree->value.float_val; ret_value -> lchild = NULL; ret_value -> rchild = NULL; - } + } } else if(tree->type == H5Z_XFORM_SYMBOL) - { + { if ((ret_value = (H5Z_node*) H5MM_malloc(sizeof(H5Z_node))) == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Ran out of memory trying to copy parse tree") else - { + { ret_value -> type = H5Z_XFORM_SYMBOL; ret_value -> value.dat_val = &(new_dat_val_pointers->ptr_dat_val[new_dat_val_pointers->num_ptrs]); new_dat_val_pointers->num_ptrs++; ret_value -> lchild = NULL; ret_value -> rchild = NULL; - } - } + } + } else if(tree->type == H5Z_XFORM_MULT) - H5Z_XFORM_DO_OP4(H5Z_XFORM_MULT) + H5Z_XFORM_DO_OP4(H5Z_XFORM_MULT) else if(tree->type == H5Z_XFORM_PLUS) - H5Z_XFORM_DO_OP4(H5Z_XFORM_PLUS) + H5Z_XFORM_DO_OP4(H5Z_XFORM_PLUS) else if(tree->type == H5Z_XFORM_MINUS) - H5Z_XFORM_DO_OP4(H5Z_XFORM_MINUS) + H5Z_XFORM_DO_OP4(H5Z_XFORM_MINUS) else if(tree->type == H5Z_XFORM_DIVIDE) - H5Z_XFORM_DO_OP4(H5Z_XFORM_DIVIDE) - + H5Z_XFORM_DO_OP4(H5Z_XFORM_DIVIDE) + else HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error in parse tree while trying to copy") @@ -1281,7 +1281,7 @@ void H5Z_xform_reduce_tree(H5Z_node* tree) { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5Z_xform_reduce_tree) - + if(tree) { if((tree->type == H5Z_XFORM_PLUS) || (tree->type == H5Z_XFORM_DIVIDE) ||(tree->type == H5Z_XFORM_MULT) ||(tree->type == H5Z_XFORM_MINUS)) { @@ -1322,9 +1322,9 @@ H5Z_xform_reduce_tree(H5Z_node* tree) static void H5Z_do_op(H5Z_node* tree) { - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5Z_do_op) - + if(tree->type == H5Z_XFORM_DIVIDE) H5Z_XFORM_DO_OP3(/) @@ -1334,9 +1334,9 @@ H5Z_do_op(H5Z_node* tree) H5Z_XFORM_DO_OP3(+) else if(tree->type == H5Z_XFORM_MINUS) H5Z_XFORM_DO_OP3(-) - + FUNC_LEAVE_NOAPI_VOID; - + } @@ -1353,7 +1353,7 @@ H5Z_do_op(H5Z_node* tree) * * Date: May 4, 2004 * - * Comments: + * Comments: * * Modifications: * @@ -1374,32 +1374,32 @@ H5Z_xform_create(const char *expr) /* Allocate space for the data transform information */ if((data_xform_prop = H5MM_calloc(sizeof(H5Z_data_xform_t)))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate memory for data transform info") - + if((data_xform_prop->dat_val_pointers = HDmalloc(sizeof(H5Z_datval_ptrs))) == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate memory for data transform array storage") - + /* copy the user's string into the property */ if((data_xform_prop->xform_exp = H5MM_xstrdup(expr))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate memory for data transform expression") - + /* Find the number of times "x" is used in this equation, and allocate room for storing that many points */ for(i=0; i<strlen(expr); i++) { if(isalpha(expr[i])) count++; } - + /* When there are no "x"'s in the equation (ie, simple transform case), - * we don't need to allocate any space since no array will have to be + * we don't need to allocate any space since no array will have to be * stored */ if(count > 0) if((data_xform_prop->dat_val_pointers->ptr_dat_val = (void**) HDcalloc(count, sizeof(void**))) == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate memory for pointers in transform array") /* Initialize the num_ptrs field, which will be used to keep track of the number of copies - * of the data we have for polynomial transforms */ + * of the data we have for polynomial transforms */ data_xform_prop->dat_val_pointers->num_ptrs = 0; - + /* we generate the parse tree right here and store a poitner to its root in the property. */ if((data_xform_prop->parse_root = H5Z_xform_parse(expr, data_xform_prop->dat_val_pointers))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to generate parse tree from expression") @@ -1424,8 +1424,8 @@ done: H5MM_xfree(data_xform_prop); } /* end if */ } /* end if */ - - FUNC_LEAVE_NOAPI(ret_value) + + FUNC_LEAVE_NOAPI(ret_value) } /* H5Z_xform_create() */ @@ -1442,7 +1442,7 @@ done: * * Date: May 4, 2004 * - * Comments: + * Comments: * * Modifications: * @@ -1463,15 +1463,15 @@ H5Z_xform_destroy(H5Z_data_xform_t *data_xform_prop) /* Free the pointers to the temp. arrays, if there are any */ if(data_xform_prop->dat_val_pointers->num_ptrs > 0) H5MM_xfree(data_xform_prop->dat_val_pointers->ptr_dat_val); - + /* Free the data storage struct */ H5MM_xfree(data_xform_prop->dat_val_pointers); - + /* Free the node */ H5MM_xfree(data_xform_prop); } /* end if */ - FUNC_LEAVE_NOAPI(SUCCEED) + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5Z_xform_destroy() */ @@ -1514,29 +1514,29 @@ H5Z_xform_copy(H5Z_data_xform_t **data_xform_prop) /* Copy string */ if((new_data_xform_prop->xform_exp = H5MM_xstrdup((*data_xform_prop)->xform_exp))==NULL) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory for data transform expression") - + if((new_data_xform_prop->dat_val_pointers = HDmalloc(sizeof(H5Z_datval_ptrs))) == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory for data transform array storage") - + /* Find the number of times "x" is used in this equation, and allocate room for storing that many points */ for(i=0; i<strlen(new_data_xform_prop->xform_exp); i++) { if(isalpha(new_data_xform_prop->xform_exp[i])) count++; } - + if(count > 0) if((new_data_xform_prop->dat_val_pointers->ptr_dat_val = (void**) HDcalloc(count, sizeof(void**))) == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory for pointers in transform array") - + /* Zero out num_pointers prior to H5Z_xform_cop_tree call; that call will increment it to the right amount */ new_data_xform_prop->dat_val_pointers->num_ptrs = 0; - + /* Copy parse tree */ if((new_data_xform_prop->parse_root = (H5Z_node*)H5Z_xform_copy_tree((*data_xform_prop)->parse_root, (*data_xform_prop)->dat_val_pointers, new_data_xform_prop->dat_val_pointers)) == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "error copying the parse tree") - + /* Sanity check * count should be the same num_ptrs */ if(count != new_data_xform_prop->dat_val_pointers->num_ptrs) @@ -1558,7 +1558,7 @@ done: } /* end if */ } /* end if */ - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* H5Z_xform_copy() */ @@ -1588,7 +1588,7 @@ H5Z_xform_noop(const H5Z_data_xform_t *data_xform_prop) ret_value=(data_xform_prop ? FALSE : TRUE); - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* H5Z_xform_noop() */ @@ -1619,9 +1619,9 @@ H5Z_xform_extract_xform_str(const H5Z_data_xform_t *data_xform_prop) * that calls this one checks to make sure it isn't before * pasing them */ assert(data_xform_prop); - + ret_value = data_xform_prop->xform_exp; - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* H5Z_xform_extract_xform_str() */ diff --git a/src/H5api_adpt.h b/src/H5api_adpt.h index 7312c4f..96b87dd 100644 --- a/src/H5api_adpt.h +++ b/src/H5api_adpt.h @@ -110,7 +110,7 @@ #else /*WIN32*/ #define H5_DLL #define H5_HLDLL -#define H5_HLCPPDLL +#define H5_HLCPPDLL #define HDF5_HL_F90CSTUBDLL #define H5_DLLVAR extern #define H5_DLLCPP diff --git a/src/H5detect.c b/src/H5detect.c index 1b8f635..62bdd1f 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -46,7 +46,7 @@ static const char *FileHeader = "\n\ * features which aren't available. We're not * running on a Vax or other machine with mixed * endianess. - * + * * Modifications: * *------------------------------------------------------------------------- @@ -75,10 +75,10 @@ typedef struct detected_t { size_t comp_align; /*alignment for structure */ } detected_t; -/* This structure holds structure alignment for pointers, hvl_t, hobj_ref_t, +/* This structure holds structure alignment for pointers, hvl_t, hobj_ref_t, * hdset_reg_ref_t */ typedef struct malign_t { - const char *name; + const char *name; size_t comp_align; /*alignment for structure */ } malign_t; @@ -86,7 +86,7 @@ typedef struct malign_t { static detected_t d_g[MAXDETECT]; static malign_t m_g[MAXDETECT]; static volatile int nd_g = 0, na_g = 0; - + static void print_results(int nd, detected_t *d, int na, malign_t *m); static void iprint(detected_t *); static int byte_cmp(int, void *, void *); @@ -127,7 +127,7 @@ static void precision (detected_t *d) { int n; - + if (0==d->msize) { /* * An integer. The permutation can have negative values at the @@ -322,7 +322,7 @@ precision (detected_t *d) * Function: DETECT_M * * Purpose: This macro takes only miscellaneous structures or pointer - * (pointer, hvl_t, hobj_ref_t, hdset_reg_ref_t). It + * (pointer, hvl_t, hobj_ref_t, hdset_reg_ref_t). It * constructs the names and decides the alignment in structure. * * Return: void @@ -462,7 +462,7 @@ sigsegv_handler(int UNUSED signo) signal(SIGSEGV, sigsegv_handler); longjmp(jbuf_g, 1); } - + /*------------------------------------------------------------------------- * Function: sigbus_handler @@ -487,7 +487,7 @@ sigbus_handler(int UNUSED signo) signal(SIGBUS, sigbus_handler); longjmp(jbuf_g, 1); } - + /*------------------------------------------------------------------------- * Function: print_results @@ -614,10 +614,10 @@ H5TN_init_interface(void)\n\ d[i].varname, (unsigned long)(d[i].align)); /* Variables for alignment of compound datatype */ - if(!strcmp(d[i].varname, "SCHAR") || !strcmp(d[i].varname, "SHORT") || - !strcmp(d[i].varname, "INT") || !strcmp(d[i].varname, "LONG") || - !strcmp(d[i].varname, "LLONG") || !strcmp(d[i].varname, "FLOAT") || - !strcmp(d[i].varname, "DOUBLE") || !strcmp(d[i].varname, "LDOUBLE")) { + if(!strcmp(d[i].varname, "SCHAR") || !strcmp(d[i].varname, "SHORT") || + !strcmp(d[i].varname, "INT") || !strcmp(d[i].varname, "LONG") || + !strcmp(d[i].varname, "LLONG") || !strcmp(d[i].varname, "FLOAT") || + !strcmp(d[i].varname, "DOUBLE") || !strcmp(d[i].varname, "LDOUBLE")) { printf(" H5T_NATIVE_%s_COMP_ALIGN_g = %lu;\n", d[i].varname, (unsigned long)(d[i].comp_align)); } @@ -632,7 +632,7 @@ H5TN_init_interface(void)\n\ printf("\n /* Structure alignment for pointers, hvl_t, hobj_ref_t, hdset_reg_ref_t */\n"); for(j=0; j<na; j++) printf(" H5T_%s_COMP_ALIGN_g = %lu;\n", misc_align[j].name, (unsigned long)(misc_align[j].comp_align)); - + printf("\ \n\ done:\n\ @@ -875,7 +875,7 @@ fix_order(int n, int first, int last, int *perm, const char **mesg) * order bits than the mantissa and that the most significant * bit of the mantissa is next to the least signficant bit * of the exponent. - * + * * * Return: Success: Non-zero if the most significant bit * of the mantissa is discarded (ie, the @@ -932,7 +932,7 @@ imp_bit(int n, int *perm, void *_a, void *_b) * * Return: Success: The exponent bias. * - * Failure: + * Failure: * * Programmer: Robb Matzke * matzke@llnl.gov @@ -1067,7 +1067,7 @@ bit.\n"; * The FQDM of this host or the empty string. */ #ifdef H5_HAVE_GETHOSTNAME -#ifdef WIN32 +#ifdef WIN32 /* windows DLL cannot recognize gethostname, so turn off on windows for the time being! KY, 2003-1-14 */ host_name[0] = '\0'; @@ -1079,7 +1079,7 @@ bit.\n"; #else host_name[0] = '\0'; #endif - + /* * The file header: warning, copyright notice, build information. */ @@ -1134,7 +1134,7 @@ detect_C89_integers(void) { DETECT_I(signed char, SCHAR, d_g[nd_g]); nd_g++; DETECT_I(unsigned char, UCHAR, d_g[nd_g]); nd_g++; - DETECT_I(short, SHORT, d_g[nd_g]); nd_g++; + DETECT_I(short, SHORT, d_g[nd_g]); nd_g++; DETECT_I(unsigned short, USHORT, d_g[nd_g]); nd_g++; DETECT_I(int, INT, d_g[nd_g]); nd_g++; DETECT_I(unsigned int, UINT, d_g[nd_g]); nd_g++; @@ -1314,7 +1314,7 @@ detect_C99_integers64(void) #if H5_SIZEOF_UINT_FAST64_T>0 DETECT_I(uint_fast64_t, UINT_FAST64, d_g[nd_g]); nd_g++; #endif - + #if H5_SIZEOF_LONG_LONG>0 DETECT_I(long_long, LLONG, d_g[nd_g]); nd_g++; DETECT_I(unsigned long_long, ULLONG, d_g[nd_g]); nd_g++; @@ -1437,7 +1437,7 @@ detect_alignments(void) int main(void) { - + #if defined(H5_HAVE_SETSYSINFO) && defined(SSI_NVPAIRS) #if defined(UAC_NOPRINT) && defined(UAC_SIGBUS) /* @@ -1453,7 +1453,7 @@ main(void) } #endif #endif - + print_header(); /* C89 integer types */ @@ -1470,8 +1470,8 @@ main(void) /* Detect structure alignment */ detect_alignments(); - + print_results (nd_g, d_g, na_g, m_g); - + return 0; } diff --git a/src/H5private.h b/src/H5private.h index dac97b9..6ccb14a 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -165,7 +165,7 @@ /*------------------------------------------------------------------------ * Purpose: Begin to collect MPE log information for a function. It should * be ahead of the actual function's process. - * + * * Programmer: Long Wang * *------------------------------------------------------------------------ @@ -203,7 +203,7 @@ /*------------------------------------------------------------------------ - * Purpose: Finish the collection of MPE log information for a function. + * Purpose: Finish the collection of MPE log information for a function. * It should be after the actual function's process. * * Programmer: Long Wang @@ -214,9 +214,9 @@ } #else /* H5_HAVE_MPE */ -#define MPE_LOG_VARS(func_name) /* void */ -#define BEGIN_MPE_LOG(func_name) /* void */ -#define FINISH_MPE_LOG /* void */ +#define MPE_LOG_VARS(func_name) /* void */ +#define BEGIN_MPE_LOG(func_name) /* void */ +#define FINISH_MPE_LOG /* void */ #endif /* H5_HAVE_MPE */ @@ -228,11 +228,11 @@ #endif /* H5_HAVE_DMALLOC_H */ /* - * NT doesn't define SIGBUS, but since NT only runs on processors - * that do not have alignment constraints a SIGBUS would never be - * raised, so we just replace it with SIGILL (which also should - * never be raised by the hdf5 library). - */ + * NT doesn't define SIGBUS, but since NT only runs on processors + * that do not have alignment constraints a SIGBUS would never be + * raised, so we just replace it with SIGILL (which also should + * never be raised by the hdf5 library). + */ #ifndef SIGBUS # define SIGBUS SIGILL #endif @@ -706,7 +706,7 @@ typedef off_t h5_stat_size_t; #define HDlog10(X) log10(X) #define HDlongjmp(J,N) longjmp(J,N) #ifdef WIN32 - #ifdef __MWERKS__ + #ifdef __MWERKS__ #define HDlseek(F,O,W) lseek(F,O,W) #else /*MSVS */ #define HDlseek(F,O,W) _lseeki64(F,O,W) @@ -904,7 +904,7 @@ H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base); #define HDstrdup(S) _strdup(S) #else /* WIN32 */ -#if !defined strdup && !defined H5_HAVE_STRDUP +#if !defined strdup && !defined H5_HAVE_STRDUP extern char *strdup(const char *s); #endif @@ -979,7 +979,7 @@ extern H5_debug_t H5_debug_g; * Programmer: Robb Matzke * * Modifications: - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- */ #ifdef H5_DEBUG_API #define H5TRACE_DECL const char *RTYPE=NULL; \ @@ -1265,10 +1265,10 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); * initialized. * - functions which are called during library shutdown, since we don't * want to re-initialize the library. - * + * * This macro is used for functions which fit the above categories _and_ * also don't use the 'FUNC' variable (i.e. don't push errors on the error stack) - * + * */ #define FUNC_ENTER_NOAPI_NOINIT_NOFUNC(func_name) { \ FUNC_ENTER_COMMON_NOFUNC(func_name,!H5_IS_API(#func_name)); \ @@ -1279,10 +1279,10 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); * Use this macro for non-API functions which fall into these categories: * - functions which shouldn't push their name on the function stack * (so far, just the H5FS routines themselves) - * + * * This macro is used for functions which fit the above categories _and_ * also don't use the 'FUNC' variable (i.e. don't push errors on the error stack) - * + * */ #define FUNC_ENTER_NOAPI_NOFUNC_NOFS(func_name) { \ FUNC_ENTER_COMMON_NOFUNC(func_name,!H5_IS_API(#func_name)); \ diff --git a/src/H5public.h b/src/H5public.h index a629060..4c35554 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -43,8 +43,8 @@ # include <stdint.h> /*for C9x types */ #endif #endif -#ifdef H5_HAVE_INTTYPES_H -# include <inttypes.h> /* For uint64_t on some platforms */ +#ifdef H5_HAVE_INTTYPES_H +# include <inttypes.h> /* For uint64_t on some platforms */ #endif #ifdef H5_HAVE_STDDEF_H # include <stddef.h> |