diff options
Diffstat (limited to 'src/H5Ofill.c')
-rw-r--r-- | src/H5Ofill.c | 207 |
1 files changed, 104 insertions, 103 deletions
diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 53abff3..df39d19 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -14,15 +14,15 @@ /* Programmer: Robb Matzke <matzke@llnl.gov> * Wednesday, September 30, 1998 * - * Purpose: The fill message indicates a bit pattern to use for - * uninitialized data points of a dataset. + * Purpose: The fill message indicates a bit pattern to use for + * uninitialized data points of a dataset. */ #include "H5Omodule.h" /* This source code file is part of the H5O module */ #include "H5private.h" /* Generic Functions */ -#include "H5Dprivate.h" /* Datasets */ +#include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ @@ -49,61 +49,61 @@ static herr_t H5O__fill_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); /* Set up & include shared message "interface" info */ -#define H5O_SHARED_TYPE H5O_MSG_FILL -#define H5O_SHARED_DECODE H5O_fill_shared_decode -#define H5O_SHARED_DECODE_REAL H5O_fill_old_decode -#define H5O_SHARED_ENCODE H5O_fill_shared_encode -#define H5O_SHARED_ENCODE_REAL H5O_fill_old_encode -#define H5O_SHARED_SIZE H5O_fill_shared_size -#define H5O_SHARED_SIZE_REAL H5O_fill_old_size -#define H5O_SHARED_DELETE H5O__fill_shared_delete +#define H5O_SHARED_TYPE H5O_MSG_FILL +#define H5O_SHARED_DECODE H5O_fill_shared_decode +#define H5O_SHARED_DECODE_REAL H5O_fill_old_decode +#define H5O_SHARED_ENCODE H5O_fill_shared_encode +#define H5O_SHARED_ENCODE_REAL H5O_fill_old_encode +#define H5O_SHARED_SIZE H5O_fill_shared_size +#define H5O_SHARED_SIZE_REAL H5O_fill_old_size +#define H5O_SHARED_DELETE H5O__fill_shared_delete #undef H5O_SHARED_DELETE_REAL -#define H5O_SHARED_LINK H5O__fill_shared_link +#define H5O_SHARED_LINK H5O__fill_shared_link #undef H5O_SHARED_LINK_REAL -#define H5O_SHARED_COPY_FILE H5O__fill_shared_copy_file +#define H5O_SHARED_COPY_FILE H5O__fill_shared_copy_file #undef H5O_SHARED_COPY_FILE_REAL -#define H5O_SHARED_POST_COPY_FILE H5O_fill_shared_post_copy_file +#define H5O_SHARED_POST_COPY_FILE H5O_fill_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE_UPD -#define H5O_SHARED_DEBUG H5O_fill_shared_debug -#define H5O_SHARED_DEBUG_REAL H5O__fill_debug -#include "H5Oshared.h" /* Shared Object Header Message Callbacks */ +#define H5O_SHARED_DEBUG H5O_fill_shared_debug +#define H5O_SHARED_DEBUG_REAL H5O__fill_debug +#include "H5Oshared.h" /* Shared Object Header Message Callbacks */ /* Set up & include shared message "interface" info */ /* (Kludgy 'undef's in order to re-include the H5Oshared.h header) */ #undef H5O_SHARED_TYPE -#define H5O_SHARED_TYPE H5O_MSG_FILL_NEW +#define H5O_SHARED_TYPE H5O_MSG_FILL_NEW #undef H5O_SHARED_DECODE -#define H5O_SHARED_DECODE H5O_fill_new_shared_decode +#define H5O_SHARED_DECODE H5O_fill_new_shared_decode #undef H5O_SHARED_DECODE_REAL -#define H5O_SHARED_DECODE_REAL H5O_fill_new_decode +#define H5O_SHARED_DECODE_REAL H5O_fill_new_decode #undef H5O_SHARED_ENCODE -#define H5O_SHARED_ENCODE H5O_fill_new_shared_encode +#define H5O_SHARED_ENCODE H5O_fill_new_shared_encode #undef H5O_SHARED_ENCODE_REAL -#define H5O_SHARED_ENCODE_REAL H5O_fill_new_encode +#define H5O_SHARED_ENCODE_REAL H5O_fill_new_encode #undef H5O_SHARED_SIZE -#define H5O_SHARED_SIZE H5O_fill_new_shared_size +#define H5O_SHARED_SIZE H5O_fill_new_shared_size #undef H5O_SHARED_SIZE_REAL -#define H5O_SHARED_SIZE_REAL H5O_fill_new_size +#define H5O_SHARED_SIZE_REAL H5O_fill_new_size #undef H5O_SHARED_DELETE -#define H5O_SHARED_DELETE H5O__fill_new_shared_delete +#define H5O_SHARED_DELETE H5O__fill_new_shared_delete #undef H5O_SHARED_DELETE_REAL #undef H5O_SHARED_LINK -#define H5O_SHARED_LINK H5O__fill_new_shared_link +#define H5O_SHARED_LINK H5O__fill_new_shared_link #undef H5O_SHARED_LINK_REAL #undef H5O_SHARED_COPY_FILE -#define H5O_SHARED_COPY_FILE H5O__fill_new_shared_copy_file +#define H5O_SHARED_COPY_FILE H5O__fill_new_shared_copy_file #undef H5O_SHARED_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE -#define H5O_SHARED_POST_COPY_FILE H5O_fill_new_shared_post_copy_file +#define H5O_SHARED_POST_COPY_FILE H5O_fill_new_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE_UPD #undef H5O_SHARED_DEBUG -#define H5O_SHARED_DEBUG H5O_fill_new_shared_debug +#define H5O_SHARED_DEBUG H5O_fill_new_shared_debug #undef H5O_SHARED_DEBUG_REAL -#define H5O_SHARED_DEBUG_REAL H5O__fill_debug +#define H5O_SHARED_DEBUG_REAL H5O__fill_debug #undef H5Oshared_H -#include "H5Oshared.h" /* Shared Object Header Message Callbacks */ +#include "H5Oshared.h" /* Shared Object Header Message Callbacks */ /* This message derives from H5O message class, for old fill value before version 1.5 */ const H5O_msg_class_t H5O_MSG_FILL[1] = {{ @@ -150,7 +150,7 @@ const H5O_msg_class_t H5O_MSG_FILL_NEW[1] = {{ H5O_fill_new_shared_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_fill_new_shared_debug /*debug the message */ + H5O_fill_new_shared_debug /*debug the message */ }}; /* Format version bounds for fill value */ @@ -158,6 +158,7 @@ const unsigned H5O_fill_ver_bounds[] = { H5O_FILL_VERSION_1, /* H5F_LIBVER_EARLIEST */ H5O_FILL_VERSION_3, /* H5F_LIBVER_V18 */ H5O_FILL_VERSION_3, /* H5F_LIBVER_V110 */ + H5O_FILL_VERSION_3, /* H5F_LIBVER_V112 */ H5O_FILL_VERSION_LATEST /* H5F_LIBVER_LATEST */ }; @@ -176,15 +177,15 @@ H5FL_DEFINE(H5O_fill_t); /* Declare extern the free list to manage blocks of type conversion data */ H5FL_BLK_EXTERN(type_conv); - + /*------------------------------------------------------------------------- - * Function: H5O_fill_new_decode + * Function: H5O_fill_new_decode * - * Purpose: Decode a new fill value message. The new fill value + * 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. + * Return: Success: Ptr to new message in native struct. * Failure: NULL * * Programmer: Raymond Lu @@ -197,7 +198,7 @@ H5O_fill_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, const uint8_t *p) { - H5O_fill_t *fill = NULL; + H5O_fill_t *fill = NULL; void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -295,7 +296,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_fill_new_decode() */ - + /*------------------------------------------------------------------------- * Function: H5O_fill_old_decode * @@ -314,7 +315,7 @@ H5O_fill_old_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, const uint8_t *p) { - H5O_fill_t *fill = NULL; /* Decoded fill value message */ + H5O_fill_t *fill = NULL; /* Decoded fill value message */ htri_t exists = FALSE; H5T_t *dt = NULL; void *ret_value = NULL; /* Return value */ @@ -376,15 +377,15 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_fill_old_decode() */ - + /*------------------------------------------------------------------------- - * Function: H5O_fill_new_encode + * Function: H5O_fill_new_encode * - * Purpose: Encode a new fill value message. The new fill value + * Purpose: Encode 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: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Feb 26, 2002 @@ -394,7 +395,7 @@ done: static herr_t H5O_fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) { - const H5O_fill_t *fill = (const H5O_fill_t *)_fill; + const H5O_fill_t *fill = (const H5O_fill_t *)_fill; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -474,7 +475,7 @@ H5O_fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_fill_new_encode() */ - + /*------------------------------------------------------------------------- * Function: H5O_fill_old_encode * @@ -505,17 +506,17 @@ H5O_fill_old_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_fill_old_encode() */ - + /*------------------------------------------------------------------------- - * Function: H5O_fill_copy + * Function: H5O_fill_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 - * whether fill value is defined. + * 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 + * whether fill value is defined. * - * Return: Success: Ptr to _DEST - * Failure: NULL + * Return: Success: Ptr to _DEST + * Failure: NULL * * Programmer: Raymond Lu * Feb 26, 2002 @@ -622,18 +623,18 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_fill_copy() */ - + /*------------------------------------------------------------------------- - * Function: H5O_fill_new_size + * Function: H5O_fill_new_size * - * Purpose: Returns the size of the raw message in bytes not counting the + * 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 * value message is fill value plus space allocation time and * fill value writing time and whether fill value is defined. * - * Return: Success: Message data size in bytes w/o alignment. - * Failure: 0 + * Return: Success: Message data size in bytes w/o alignment. + * Failure: 0 * * Programmer: Raymond Lu * Feb 26, 2002 @@ -653,26 +654,26 @@ H5O_fill_new_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill) /* Determine size for different versions */ if(fill->version < H5O_FILL_VERSION_3) { - ret_value = 1 + /* Version number */ - 1 + /* Space allocation time */ - 1 + /* Fill value write time */ - 1; /* Fill value defined */ + ret_value = 1 + /* Version number */ + 1 + /* Space allocation time */ + 1 + /* Fill value write time */ + 1; /* Fill value defined */ if(fill->fill_defined) - ret_value += 4 + /* Fill value size */ - (fill->size > 0 ? (size_t)fill->size : 0); /* Size of fill value */ + ret_value += 4 + /* Fill value size */ + (fill->size > 0 ? (size_t)fill->size : 0); /* Size of fill value */ } /* end if */ else { - ret_value = 1 + /* Version number */ - 1; /* Status flags */ + ret_value = 1 + /* Version number */ + 1; /* Status flags */ if(fill->size > 0) - ret_value += 4 + /* Fill value size */ - (size_t)fill->size; /* Size of fill value */ + ret_value += 4 + /* Fill value size */ + (size_t)fill->size; /* Size of fill value */ } /* end else */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_fill_new_size() */ - + /*------------------------------------------------------------------------- * Function: H5O_fill_old_size * @@ -700,15 +701,15 @@ H5O_fill_old_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill) FUNC_LEAVE_NOAPI(4 + (size_t)fill->size) } /* end H5O_fill_old_size() */ - + /*------------------------------------------------------------------------- - * Function: H5O_fill_reset_dyn + * Function: H5O_fill_reset_dyn * - * Purpose: Resets dynamic fill value fields + * Purpose: Resets dynamic fill value fields * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, January 22, 2007 * *------------------------------------------------------------------------- @@ -766,15 +767,15 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_fill_reset_dyn() */ - + /*------------------------------------------------------------------------- - * Function: H5O__fill_reset + * Function: H5O__fill_reset * - * Purpose: Resets a message to an initial state. + * Purpose: Resets a message to an initial state. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, October 1, 1998 * *------------------------------------------------------------------------- @@ -782,7 +783,7 @@ done: static herr_t H5O__fill_reset(void *_fill) { - H5O_fill_t *fill = (H5O_fill_t *)_fill; + H5O_fill_t *fill = (H5O_fill_t *)_fill; FUNC_ENTER_STATIC_NOERR @@ -799,15 +800,15 @@ H5O__fill_reset(void *_fill) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O__fill_reset() */ - + /*------------------------------------------------------------------------- - * Function: H5O__fill_free + * Function: H5O__fill_free * - * Purpose: Frees the message + * Purpose: Frees the message * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, December 5, 2002 * *------------------------------------------------------------------------- @@ -824,7 +825,7 @@ H5O__fill_free(void *fill) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O__fill_free() */ - + /*------------------------------------------------------------------------- * Function: H5O__fill_pre_copy_file * @@ -842,7 +843,7 @@ static herr_t H5O__fill_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) { - const H5O_fill_t *fill_src = (const H5O_fill_t *)mesg_src; /* Source fill value */ + const H5O_fill_t *fill_src = (const H5O_fill_t *)mesg_src; /* Source fill value */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -860,15 +861,15 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__fill_pre_copy_file() */ - + /*------------------------------------------------------------------------- - * Function: H5O__fill_debug + * Function: H5O__fill_debug * - * Purpose: Prints debugging info for the message. + * Purpose: Prints debugging info for the message. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, October 1, 1998 * *------------------------------------------------------------------------- @@ -950,7 +951,7 @@ H5O__fill_debug(H5F_t H5_ATTR_UNUSED *f, const void *_fill, FILE *stream, } /* end switch */ HDfprintf(stream, "%*s%-*s %Zd\n", indent, "", fwidth, - "Size:", fill->size); + "Size:", fill->size); HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Data type:"); if(fill->type) { H5T_debug(fill->type, stream); @@ -962,18 +963,18 @@ H5O__fill_debug(H5F_t H5_ATTR_UNUSED *f, const void *_fill, FILE *stream, FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O__fill_debug() */ - + /*------------------------------------------------------------------------- - * Function: H5O_fill_convert + * Function: H5O_fill_convert * - * Purpose: Convert a fill value from whatever data type it currently has + * Purpose: Convert a fill value from whatever data type it currently has * to the specified dataset type. The `type' field of the fill * value struct will be set to NULL to indicate that it has the * same type as the dataset. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, October 1, 1998 * *------------------------------------------------------------------------- @@ -981,10 +982,10 @@ H5O__fill_debug(H5F_t H5_ATTR_UNUSED *f, const void *_fill, FILE *stream, herr_t H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed) { - H5T_path_t *tpath; /* Type conversion info */ - void *buf = NULL, *bkg = NULL; /* Conversion buffers */ - hid_t src_id = -1, dst_id = -1; /* Datatype identifiers */ - herr_t ret_value = SUCCEED; /* Return value */ + H5T_path_t *tpath; /* Type conversion info */ + void *buf = NULL, *bkg = NULL; /* Conversion buffers */ + hid_t src_id = -1, dst_id = -1; /* Datatype identifiers */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1065,7 +1066,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_fill_convert() */ - + /*------------------------------------------------------------------------- * Function: H5O_fill_set_version * |