diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5C.c | 2 | ||||
-rw-r--r-- | src/H5D.c | 12 | ||||
-rw-r--r-- | src/H5Dcontig.c | 4 | ||||
-rw-r--r-- | src/H5Dselect.c | 4 | ||||
-rw-r--r-- | src/H5E.c | 16 | ||||
-rw-r--r-- | src/H5FD.c | 6 | ||||
-rw-r--r-- | src/H5FDfamily.c | 2 | ||||
-rw-r--r-- | src/H5FDlog.c | 6 | ||||
-rw-r--r-- | src/H5FDmulti.c | 4 | ||||
-rw-r--r-- | src/H5FDstdio.c | 10 | ||||
-rw-r--r-- | src/H5FO.c | 4 | ||||
-rw-r--r-- | src/H5Fsuper.c | 4 | ||||
-rw-r--r-- | src/H5HFpkg.h | 3 | ||||
-rw-r--r-- | src/H5HFtest.c | 4 | ||||
-rw-r--r-- | src/H5HG.c | 10 | ||||
-rw-r--r-- | src/H5HL.c | 6 | ||||
-rw-r--r-- | src/H5HP.c | 6 | ||||
-rw-r--r-- | src/H5O.c | 2 | ||||
-rw-r--r-- | src/H5Oefl.c | 2 | ||||
-rw-r--r-- | src/H5Ofill.c | 6 | ||||
-rw-r--r-- | src/H5Oginfo.c | 8 | ||||
-rw-r--r-- | src/H5Osdspace.c | 16 | ||||
-rw-r--r-- | src/H5P.c | 36 | ||||
-rw-r--r-- | src/H5Pdcpl.c | 16 | ||||
-rw-r--r-- | src/H5R.c | 3 | ||||
-rw-r--r-- | src/H5S.c | 36 | ||||
-rw-r--r-- | src/H5Sselect.c | 12 | ||||
-rw-r--r-- | src/H5Tbit.c | 35 | ||||
-rw-r--r-- | src/H5Tcommit.c | 6 | ||||
-rw-r--r-- | src/H5Tconv.c | 56 |
30 files changed, 164 insertions, 173 deletions
@@ -3458,7 +3458,7 @@ H5C_flush_to_min_clean(H5F_t * f, primary_dxpl_id, secondary_dxpl_id, cache_ptr, - 0, + (size_t)0, write_permitted, &first_flush); @@ -236,7 +236,7 @@ H5D_init_interface(void) FUNC_ENTER_NOAPI_NOINIT(H5D_init_interface) /* Initialize the atom group for the dataset IDs */ - if (H5I_register_type(H5I_DATASET, H5I_DATASETID_HASHSIZE, H5D_RESERVED_ATOMS, (H5I_free_t)H5D_close)<H5I_FILE) + if(H5I_register_type(H5I_DATASET, (size_t)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========= */ @@ -2190,7 +2190,7 @@ H5D_update_entry_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, H5P_genplist_t *p heap_size += H5HL_ALIGN(HDstrlen(efl->slot[u].name) + 1); if (H5HL_create(file, dxpl_id, heap_size, &efl->heap_addr/*out*/) < 0 || - H5HL_insert(file, dxpl_id, efl->heap_addr, 1, "") == (size_t)(-1)) + H5HL_insert(file, dxpl_id, efl->heap_addr, (size_t)1, "") == (size_t)(-1)) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create external file list name heap") for (u = 0; u < efl->nused; ++u) { @@ -3949,7 +3949,7 @@ H5D_vlen_get_buf_size(void UNUSED *elem, hid_t type_id, unsigned UNUSED ndim, co HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't resize tbuf") /* Select point to read in */ - if(H5Sselect_elements(vlen_bufsize->fspace_id, H5S_SELECT_SET, 1, (const hsize_t **)point)<0) + if(H5Sselect_elements(vlen_bufsize->fspace_id, H5S_SELECT_SET, (size_t)1, (const hsize_t **)point)<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't select point") /* Read in the point (with the custom VL memory allocator) */ @@ -4016,13 +4016,13 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, 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) + if((vlen_bufsize.mspace_id = H5Screate(H5S_SCALAR)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't create dataspace") /* Grab the temporary buffers required */ - if((vlen_bufsize.fl_tbuf=H5FL_BLK_MALLOC(vlen_fl_buf,1))==NULL) + if((vlen_bufsize.fl_tbuf = H5FL_BLK_MALLOC(vlen_fl_buf, (size_t)1)) == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "no temporary buffers available") - if((vlen_bufsize.vl_tbuf=H5FL_BLK_MALLOC(vlen_vl_buf,1))==NULL) + if((vlen_bufsize.vl_tbuf = H5FL_BLK_MALLOC(vlen_vl_buf, (size_t)1)) == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "no temporary buffers available") /* Get the pointer to the dataset transfer class */ diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index d39c8c5..5b4b0d2 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -391,8 +391,8 @@ H5D_contig_write(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, assert (buf); H5D_BUILD_IO_INFO(&io_info,dset,dxpl_cache,dxpl_id,store); - if (H5D_contig_writevv(&io_info, - 1, &dset_curr_seq, &dset_len, &dset_off, 1, &mem_curr_seq, &mem_len, &mem_off, buf)<0) + if(H5D_contig_writevv(&io_info, (size_t)1, &dset_curr_seq, &dset_len, + &dset_off, (size_t)1, &mem_curr_seq, &mem_len, &mem_off, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vector write failed") done: diff --git a/src/H5Dselect.c b/src/H5Dselect.c index 928f90d..07038c7 100644 --- a/src/H5Dselect.c +++ b/src/H5Dselect.c @@ -128,7 +128,7 @@ H5D_select_fscat (H5D_io_info_t *io_info, mem_off=0; /* Write sequence list out */ - if ((*io_info->ops.writevv)(io_info, nseq, &dset_curr_seq, len, off, 1, &mem_curr_seq, &mem_len, &mem_off, buf)<0) + if((*io_info->ops.writevv)(io_info, nseq, &dset_curr_seq, len, off, (size_t)1, &mem_curr_seq, &mem_len, &mem_off, buf) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error"); /* Update buffer */ @@ -223,7 +223,7 @@ H5D_select_fgath (H5D_io_info_t *io_info, mem_off=0; /* Read sequence list in */ - if ((*io_info->ops.readvv)(io_info, nseq, &dset_curr_seq, len, off, 1, &mem_curr_seq, &mem_len, &mem_off, buf)<0) + if((*io_info->ops.readvv)(io_info, nseq, &dset_curr_seq, len, off, (size_t)1, &mem_curr_seq, &mem_len, &mem_off, buf) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, 0, "read error"); /* Update buffer */ @@ -176,16 +176,16 @@ 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, - (H5I_free_t)H5E_unregister_class)<H5I_FILE) + if(H5I_register_type(H5I_ERROR_CLASS, (size_t)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, - (H5I_free_t)H5E_close_msg)<H5I_FILE) + if(H5I_register_type(H5I_ERROR_MSG, (size_t)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, - (H5I_free_t)H5E_close_stack)<H5I_FILE) + if(H5I_register_type(H5I_ERROR_STACK, (size_t)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") #ifndef H5_HAVE_THREADSAFE @@ -804,7 +804,7 @@ H5Eget_major(H5E_major_t maj) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a error message ID") /* Get the message's text */ - if((size = H5E_get_msg(msg, &type, NULL, 0))<0) + if((size = H5E_get_msg(msg, &type, NULL, (size_t)0)) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "can't get error message text"); if(type != H5E_MAJOR) @@ -854,7 +854,7 @@ H5Eget_minor(H5E_minor_t min) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a error message ID") /* Get the message's text */ - if((size = H5E_get_msg(msg, &type, NULL, 0))<0) + if((size = H5E_get_msg(msg, &type, NULL, (size_t)0)) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "can't get error message text"); if(type != H5E_MINOR) @@ -116,7 +116,7 @@ H5FD_init_interface(void) FUNC_ENTER_NOAPI_NOINIT(H5FD_init_interface) - if(H5I_register_type(H5I_VFL, H5I_VFL_HASHSIZE, 0, (H5I_free_t)H5FD_free_cls)<H5I_FILE) + if(H5I_register_type(H5I_VFL, (size_t)H5I_VFL_HASHSIZE, 0, (H5I_free_t)H5FD_free_cls)<H5I_FILE) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize interface") /* Reset the file serial numbers */ @@ -3806,9 +3806,9 @@ H5FD_get_freespace(const H5FD_t *file) H5FD_free_t *free_node; /* Pointer to node on free list */ H5FD_mem_t type; /* Type of memory */ haddr_t ma_addr = HADDR_UNDEF; /* Base "metadata aggregator" address */ - hsize_t ma_size; /* Size of "metadata aggregator" */ + hsize_t ma_size = 0; /* Size of "metadata aggregator" */ haddr_t sda_addr = HADDR_UNDEF; /* Base "small data aggregator" address */ - hsize_t sda_size; /* Size of "small data aggregator" */ + hsize_t sda_size = 0; /* Size of "small data aggregator" */ haddr_t eoa; /* End of allocated space in the file */ hssize_t ret_value = 0; /* Return value */ diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index c826163..cacc758 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -623,7 +623,7 @@ H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, FUNC_ENTER_NOAPI(H5FD_family_sb_encode, FAIL) /* Name and version number */ - strncpy(name, "NCSAfami",8); + strncpy(name, "NCSAfami", (size_t)8); name[8] = '\0'; /* copy member file size */ diff --git a/src/H5FDlog.c b/src/H5FDlog.c index b933182..33a218a 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -1322,10 +1322,10 @@ H5FD_log_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned UNUSED closing) FUNC_ENTER_NOAPI(H5FD_log_flush, FAIL) - if (file->eoa>file->eof) { - if (-1==file_seek(file->fd, (file_offset_t)(file->eoa-1), SEEK_SET)) + if(file->eoa>file->eof) { + if(-1 == file_seek(file->fd, (file_offset_t)(file->eoa - 1), SEEK_SET)) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") - if (write(file->fd, "", 1)!=1) + if(write(file->fd, "", (size_t)1) != 1) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") file->eof = file->eoa; file->pos = file->eoa; diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index e7de49f..b4c4277 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -773,7 +773,7 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/, H5Eclear_stack(H5E_DEFAULT); /* Name and version number */ - strncpy(name, "NCSAmulti",8); + strncpy(name, "NCSAmulti", (size_t)8); name[8] = '\0'; assert(7==H5FD_MEM_NTYPES); @@ -1220,7 +1220,7 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id, * Initialize the file from the file access properties, using default * values if necessary. */ - if (NULL==(file=calloc(1, sizeof(H5FD_multi_t)))) + if (NULL==(file=calloc((size_t)1, sizeof(H5FD_multi_t)))) H5Epush_ret(func, H5E_ERR_CLS, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed", NULL) if (H5P_FILE_ACCESS_DEFAULT==fapl_id || H5FD_MULTI!=H5Pget_driver(fapl_id)) { close_fapl = fapl_id = H5Pcreate(H5P_FILE_ACCESS); diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index fc7dd1c..92ea653 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -365,13 +365,13 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_CANTOPENFILE, "fopen failed", NULL) /* Build the return value */ - if (NULL==(file = calloc(1,sizeof(H5FD_stdio_t)))) + if(NULL==(file = calloc((size_t)1, sizeof(H5FD_stdio_t)))) H5Epush_ret(func, H5E_ERR_CLS, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed", NULL) file->fp = f; file->op = H5FD_STDIO_OP_SEEK; file->pos = HADDR_UNDEF; file->write_access=write_access; /* Note the write_access for later */ - if (fseek(file->fp, 0, SEEK_END) < 0) { + if(fseek(file->fp, (long)0, SEEK_END) < 0) { file->op = H5FD_STDIO_OP_UNKNOWN; } else { long x = ftell (file->fp); @@ -735,8 +735,8 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz * will advance the file position by N. If N is zero or an error * occurs then the file position is undefined. */ - n = fread(buf, 1, size, file->fp); - if (n == 0 && ferror(file->fp)) { + n = fread(buf, (size_t)1, size, file->fp); + if(n == 0 && ferror(file->fp)) { file->op = H5FD_STDIO_OP_UNKNOWN; file->pos = HADDR_UNDEF; H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_READERROR, "fread failed", -1) @@ -816,7 +816,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, * advanced by the number of bytes read. Otherwise nobody knows where it * is. */ - if (size != fwrite(buf, 1, size, file->fp)) { + if(size != fwrite(buf, (size_t)1, size, file->fp)) { file->op = H5FD_STDIO_OP_UNKNOWN; file->pos = HADDR_UNDEF; H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fwrite failed", -1) @@ -81,7 +81,7 @@ H5FO_create(const H5F_t *f) assert(f->shared); /* Create container used to store open object info */ - if((f->shared->open_objs=H5SL_create(H5SL_TYPE_HADDR,0.5,16))==NULL) + if((f->shared->open_objs = H5SL_create(H5SL_TYPE_HADDR, 0.5, (size_t)16)) == NULL) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to create open object container") done: @@ -399,7 +399,7 @@ H5FO_top_create(H5F_t *f) HDassert(f); /* Create container used to store open object info */ - if((f->obj_count = H5SL_create(H5SL_TYPE_HADDR, 0.5, 16)) == NULL) + if((f->obj_count = H5SL_create(H5SL_TYPE_HADDR, 0.5, (size_t)16)) == NULL) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to create open object container") done: diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index b7306b4..d7fa782 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -319,9 +319,9 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc, haddr_t addr, /* 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")) + if(!HDstrncmp(driver_name, "NCSAfami", (size_t)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")) + if(!HDstrncmp(driver_name, "NCSAmult", (size_t)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) diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index 0b9c74d..638d996 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -726,8 +726,7 @@ H5_DLL unsigned H5HF_get_iblock_max_drows_test(const H5HF_t *fh, unsigned pos); H5_DLL hsize_t H5HF_get_dblock_size_test(const H5HF_t *fh, unsigned row); H5_DLL hsize_t H5HF_get_dblock_free_test(const H5HF_t *fh, unsigned row); H5_DLL herr_t H5HF_get_id_off_test(const H5HF_t *fh, const void *id, hsize_t *obj_off); -H5_DLL herr_t H5HF_get_id_type_test(const H5HF_t *fh, const void *id, - unsigned char *obj_type); +H5_DLL herr_t H5HF_get_id_type_test(const void *id, unsigned char *obj_type); H5_DLL herr_t H5HF_get_tiny_info_test(const H5HF_t *fh, size_t *max_len, hbool_t *len_extended); H5_DLL herr_t H5HF_get_huge_info_test(const H5HF_t *fh, hsize_t *next_id, diff --git a/src/H5HFtest.c b/src/H5HFtest.c index bbe93ca..61ad00d 100644 --- a/src/H5HFtest.c +++ b/src/H5HFtest.c @@ -450,15 +450,13 @@ H5HF_get_id_off_test(const H5HF_t *fh, const void *_id, hsize_t *obj_off) *------------------------------------------------------------------------- */ herr_t -H5HF_get_id_type_test(const H5HF_t *fh, const void *_id, unsigned char *obj_type) +H5HF_get_id_type_test(const void *_id, unsigned char *obj_type) { const uint8_t *id = (const uint8_t *)_id; /* Object ID */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_get_id_type_test) /* Check arguments. */ - HDassert(fh); - HDassert(fh->hdr); HDassert(id); HDassert(obj_type); @@ -232,7 +232,7 @@ HDmemset(heap->chunk,0,size); "memory allocation failed"); /* Initialize the header */ - HDmemcpy (heap->chunk, H5HG_MAGIC, H5HG_SIZEOF_MAGIC); + HDmemcpy (heap->chunk, H5HG_MAGIC, (size_t)H5HG_SIZEOF_MAGIC); p = heap->chunk + H5HG_SIZEOF_MAGIC; *p++ = H5HG_VERSION; *p++ = 0; /*reserved*/ @@ -340,16 +340,16 @@ H5HG_load (H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * udata1, assert (!udata2); /* Read the initial 4k page */ - if (NULL==(heap = H5FL_CALLOC (H5HG_heap_t))) + if(NULL == (heap = H5FL_CALLOC (H5HG_heap_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); heap->addr = addr; - if (NULL==(heap->chunk = H5FL_BLK_MALLOC (heap_chunk,H5HG_MINSIZE))) + if(NULL == (heap->chunk = H5FL_BLK_MALLOC(heap_chunk, (size_t)H5HG_MINSIZE))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - if (H5F_block_read(f, H5FD_MEM_GHEAP, addr, H5HG_MINSIZE, dxpl_id, heap->chunk)<0) + if(H5F_block_read(f, H5FD_MEM_GHEAP, addr, (size_t)H5HG_MINSIZE, dxpl_id, heap->chunk)<0) HGOTO_ERROR (H5E_HEAP, H5E_READERROR, NULL, "unable to read global heap collection"); /* Magic number */ - if (HDmemcmp (heap->chunk, H5HG_MAGIC, H5HG_SIZEOF_MAGIC)) + if(HDmemcmp(heap->chunk, H5HG_MAGIC, (size_t)H5HG_SIZEOF_MAGIC)) HGOTO_ERROR (H5E_HEAP, H5E_CANTLOAD, NULL, "bad global heap collection signature"); p = heap->chunk + H5HG_SIZEOF_MAGIC; @@ -237,7 +237,7 @@ H5HL_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * udata1, p = hdr; /* Check magic number */ - if (HDmemcmp(hdr, H5HL_MAGIC, H5HL_SIZEOF_MAGIC)) + if(HDmemcmp(hdr, H5HL_MAGIC, (size_t)H5HL_SIZEOF_MAGIC)) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "bad heap signature"); p += H5HL_SIZEOF_MAGIC; @@ -490,7 +490,7 @@ H5HL_serialize(H5F_t *f, H5HL_t *heap, uint8_t *buf) /* serialize the header */ p = buf; fl = heap->freelist; - HDmemcpy(p, H5HL_MAGIC, H5HL_SIZEOF_MAGIC); + HDmemcpy(p, H5HL_MAGIC, (size_t)H5HL_SIZEOF_MAGIC); p += H5HL_SIZEOF_MAGIC; *p++ = H5HL_VERSION; *p++ = 0; /*reserved*/ @@ -894,7 +894,7 @@ H5HL_unprotect(H5F_t *f, hid_t dxpl_id, const H5HL_t *heap, haddr_t addr, unsign assert(heap); assert(H5F_addr_defined(addr)); - if (H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, (void *)heap, heap_flags) != SUCCEED) + if(H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, (void *)heap, heap_flags) != SUCCEED) HGOTO_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header"); done: @@ -348,7 +348,7 @@ H5HP_create(H5HP_type_t heap_type) HGOTO_ERROR(H5E_HEAP,H5E_NOSPACE,NULL,"memory allocation failed"); /* Allocate the array to store the heap entries */ - if((new_heap->heap=H5FL_SEQ_MALLOC(H5HP_ent_t, H5HP_START_SIZE+1))==NULL) + if((new_heap->heap = H5FL_SEQ_MALLOC(H5HP_ent_t, (size_t)(H5HP_START_SIZE + 1)))==NULL) HGOTO_ERROR(H5E_HEAP,H5E_NOSPACE,NULL,"memory allocation failed"); /* Set the internal fields */ @@ -620,11 +620,11 @@ H5HP_remove(H5HP_t *heap, int *val, void **obj) /* Restore heap condition, if there are objects on the heap */ if(heap->nobjs>0) { if(heap->type==H5HP_MAX_HEAP) { - if(H5HP_sink_max(heap,1)<0) + if(H5HP_sink_max(heap, (size_t)1) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDELETE, FAIL, "unable to restore heap condition"); } /* end if */ else { - if(H5HP_sink_min(heap,1)<0) + if(H5HP_sink_min(heap, (size_t)1) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDELETE, FAIL, "unable to restore heap condition"); } /* end else */ } /* end if */ @@ -5008,7 +5008,7 @@ H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, cpy_info.copy_without_attr = TRUE; /* Create a skip list to keep track of which objects are copied */ - if((cpy_info.map_list = H5SL_create(H5SL_TYPE_HADDR, 0.5, 16)) == NULL) + if((cpy_info.map_list = H5SL_create(H5SL_TYPE_HADDR, 0.5, (size_t)16)) == NULL) HGOTO_ERROR(H5E_SLIST, H5E_CANTCREATE, FAIL, "cannot make skip list") /* copy the object from the source file to the destination file */ diff --git a/src/H5Oefl.c b/src/H5Oefl.c index cd94d69..1d201db 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -464,7 +464,7 @@ H5O_efl_copy_file(H5F_t UNUSED *file_src, void *mesg_src, H5F_t *file_dst, if(H5HL_create(file_dst, dxpl_id, heap_size, &efl_dst->heap_addr/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "can't create heap") - name_offset = H5HL_insert(file_dst, dxpl_id, efl_dst->heap_addr, 1, ""); + name_offset = H5HL_insert(file_dst, dxpl_id, efl_dst->heap_addr, (size_t)1, ""); if((size_t)(-1) == name_offset) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "can't initialize heap") HDassert(0 == name_offset); diff --git a/src/H5Ofill.c b/src/H5Ofill.c index e7c5537..37841ad 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -860,15 +860,15 @@ H5O_fill_convert(void *_fill, H5T_t *dset_type, hid_t dxpl_id) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion"); HDmemcpy(buf, fill->buf, H5T_get_size(fill->type)); } - if (H5T_path_bkg(tpath) && NULL==(bkg=H5MM_malloc(H5T_get_size(dset_type)))) + if(H5T_path_bkg(tpath) && NULL == (bkg = H5MM_malloc(H5T_get_size(dset_type)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion"); /* Do the conversion */ - if (H5T_convert(tpath, src_id, dst_id, 1, 0, 0, buf, bkg, dxpl_id)<0) + if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed"); /* Update the fill message */ - if (buf!=fill->buf) { + if(buf != fill->buf) { H5MM_xfree(fill->buf); fill->buf = buf; } diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c index f4e7064..54caa35 100644 --- a/src/H5Oginfo.c +++ b/src/H5Oginfo.c @@ -93,7 +93,7 @@ H5FL_DEFINE_STATIC(H5O_ginfo_t); *------------------------------------------------------------------------- */ static void * -H5O_ginfo_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p) +H5O_ginfo_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p) { H5O_ginfo_t *ginfo = NULL; /* Pointer to group information message */ unsigned char flags; /* Flags for encoding group info */ @@ -102,7 +102,6 @@ H5O_ginfo_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p) FUNC_ENTER_NOAPI_NOINIT(H5O_ginfo_decode) /* check args */ - HDassert(f); HDassert(p); /* Version of message */ @@ -154,7 +153,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_ginfo_encode(H5F_t *f, uint8_t *p, const void *_mesg) +H5O_ginfo_encode(H5F_t UNUSED *f, uint8_t *p, const void *_mesg) { const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *) _mesg; unsigned char flags; /* Flags for encoding group info */ @@ -162,7 +161,6 @@ H5O_ginfo_encode(H5F_t *f, uint8_t *p, const void *_mesg) FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_ginfo_encode) /* check args */ - HDassert(f); HDassert(p); HDassert(ginfo); @@ -249,7 +247,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5O_ginfo_size(const H5F_t *f, const void UNUSED *_mesg) +H5O_ginfo_size(const H5F_t UNUSED *f, const void UNUSED *_mesg) { size_t ret_value; /* Return value */ diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 63eb122..f6be82b 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -144,10 +144,10 @@ H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p) 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"); - for (i = 0; i < sdim->rank; i++) { + if(sdim->rank > 0) { + if(NULL == (sdim->size = H5FL_ARR_MALLOC(hsize_t, (size_t)sdim->rank))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + for(i = 0; i < sdim->rank; i++) { H5F_DECODE_LENGTH (f, p, sdim->size[i]); #ifndef H5_HAVE_LARGE_HSIZET /* Rudimentary check for overflow of the dimension size */ @@ -156,10 +156,10 @@ H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p) #endif /* H5_HAVE_LARGE_HSIZET */ } /* end for */ - if (flags & H5S_VALID_MAX) { - if (NULL==(sdim->max=H5FL_ARR_MALLOC(hsize_t,sdim->rank))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - for (i = 0; i < sdim->rank; i++) + if(flags & H5S_VALID_MAX) { + if(NULL == (sdim->max = H5FL_ARR_MALLOC(hsize_t, (size_t)sdim->rank))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + for(i = 0; i < sdim->rank; i++) H5F_DECODE_LENGTH (f, p, sdim->max[i]); } } @@ -275,9 +275,9 @@ H5P_init_interface(void) /* * Initialize the Generic Property class & object groups. */ - if (H5I_register_type(H5I_GENPROP_CLS, H5I_GENPROPCLS_HASHSIZE, 0, (H5I_free_t)H5P_close_class) < 0) + if (H5I_register_type(H5I_GENPROP_CLS, (size_t)H5I_GENPROPCLS_HASHSIZE, 0, (H5I_free_t)H5P_close_class) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTINIT, FAIL, "unable to initialize ID group"); - if (H5I_register_type(H5I_GENPROP_LST, H5I_GENPROPOBJ_HASHSIZE, 0, (H5I_free_t)H5P_close) < 0) + if (H5I_register_type(H5I_GENPROP_LST, (size_t)H5I_GENPROPOBJ_HASHSIZE, 0, (H5I_free_t)H5P_close) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTINIT, FAIL, "unable to initialize ID group"); /* Create root property list class */ @@ -742,11 +742,11 @@ H5P_copy_plist(H5P_genplist_t *old_plist) new_plist->class_init = 0; /* Initially, wait until the class callback finishes to set */ /* Initialize the skip list to hold the changed properties */ - if((new_plist->props=H5SL_create(H5SL_TYPE_STR,0.5,H5P_DEFAULT_SKIPLIST_HEIGHT))==NULL) + if((new_plist->props = H5SL_create(H5SL_TYPE_STR, 0.5, (size_t)H5P_DEFAULT_SKIPLIST_HEIGHT)) == NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for changed properties"); /* Create the skip list for deleted properties */ - if((new_plist->del=H5SL_create(H5SL_TYPE_STR,0.5,H5P_DEFAULT_SKIPLIST_HEIGHT))==NULL) + if((new_plist->del = H5SL_create(H5SL_TYPE_STR, 0.5, (size_t)H5P_DEFAULT_SKIPLIST_HEIGHT)) == NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for deleted properties"); /* Create the skip list to hold names of properties already seen @@ -754,9 +754,9 @@ H5P_copy_plist(H5P_genplist_t *old_plist) * 'create' callback called, if a property in the class hierarchy has * already been seen) */ - if((seen=H5SL_create(H5SL_TYPE_STR,0.5,H5P_DEFAULT_SKIPLIST_HEIGHT))==NULL) + if((seen = H5SL_create(H5SL_TYPE_STR, 0.5, (size_t)H5P_DEFAULT_SKIPLIST_HEIGHT))== NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for seen properties"); - nseen=0; + nseen = 0; /* Cycle through the deleted properties & copy them into the new list's deleted section */ if(H5SL_count(old_plist->del)>0) { @@ -1616,7 +1616,7 @@ H5P_create_class(H5P_genclass_t *par_class, const char *name, unsigned internal, pclass->revision = H5P_GET_NEXT_REV; /* Get a revision number for the class */ /* Create the skip list for properties */ - if((pclass->props=H5SL_create(H5SL_TYPE_STR,0.5,H5P_DEFAULT_SKIPLIST_HEIGHT))==NULL) + if((pclass->props = H5SL_create(H5SL_TYPE_STR, 0.5, (size_t)H5P_DEFAULT_SKIPLIST_HEIGHT)) == NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,NULL,"can't create skip list for properties"); /* Set callback functions and pass-along data */ @@ -1780,11 +1780,11 @@ H5P_create(H5P_genclass_t *pclass) plist->class_init = 0; /* Initially, wait until the class callback finishes to set */ /* Create the skip list for changed properties */ - if((plist->props=H5SL_create(H5SL_TYPE_STR,0.5,H5P_DEFAULT_SKIPLIST_HEIGHT))==NULL) + if((plist->props = H5SL_create(H5SL_TYPE_STR, 0.5, (size_t)H5P_DEFAULT_SKIPLIST_HEIGHT)) == NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,NULL,"can't create skip list for changed properties"); /* Create the skip list for deleted properties */ - if((plist->del=H5SL_create(H5SL_TYPE_STR,0.5,H5P_DEFAULT_SKIPLIST_HEIGHT))==NULL) + if((plist->del = H5SL_create(H5SL_TYPE_STR, 0.5, (size_t)H5P_DEFAULT_SKIPLIST_HEIGHT)) == NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,NULL,"can't create skip list for deleted properties"); /* Create the skip list to hold names of properties already seen @@ -1792,7 +1792,7 @@ H5P_create(H5P_genclass_t *pclass) * 'create' callback called, if a property in the class hierarchy has * already been seen) */ - if((seen=H5SL_create(H5SL_TYPE_STR,0.5,H5P_DEFAULT_SKIPLIST_HEIGHT))==NULL) + if((seen = H5SL_create(H5SL_TYPE_STR, 0.5, (size_t)H5P_DEFAULT_SKIPLIST_HEIGHT)) == NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,NULL,"can't create skip list for seen properties"); /* @@ -4211,19 +4211,19 @@ H5P_iterate_plist(hid_t plist_id, int *idx, H5P_iterate_t iter_func, void *iter_ assert(iter_func); /* Get the property list object */ - if (NULL == (plist = H5I_object_verify(plist_id, H5I_GENPROP_LST))) + if(NULL == (plist = H5I_object_verify(plist_id, H5I_GENPROP_LST))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); /* Create the skip list to hold names of properties already seen */ - if((seen=H5SL_create(H5SL_TYPE_STR,0.5,H5P_DEFAULT_SKIPLIST_HEIGHT))==NULL) + if((seen = H5SL_create(H5SL_TYPE_STR, 0.5, (size_t)H5P_DEFAULT_SKIPLIST_HEIGHT)) == NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for seen properties"); /* Walk through the changed properties in the list */ - if(H5SL_count(plist->props)>0) { - curr_node=H5SL_first(plist->props); - while(curr_node!=NULL) { + if(H5SL_count(plist->props) > 0) { + curr_node = H5SL_first(plist->props); + while(curr_node != NULL) { /* Get pointer to property from node */ - tmp=H5SL_item(curr_node); + tmp = H5SL_item(curr_node); /* Check if we've found the correctly indexed property */ if(curr_idx>=*idx) { @@ -5449,9 +5449,9 @@ H5P_close(void *_plist) * 'close' callback called, if a property in the class hierarchy has * already been seen) */ - if((seen=H5SL_create(H5SL_TYPE_STR,0.5,H5P_DEFAULT_SKIPLIST_HEIGHT))==NULL) + if((seen = H5SL_create(H5SL_TYPE_STR, 0.5, (size_t)H5P_DEFAULT_SKIPLIST_HEIGHT)) == NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for seen properties"); - nseen=0; + nseen = 0; /* Walk through the changed properties in the list */ if(H5SL_count(plist->props)>0) { diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index c13d807..b941908 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -1084,7 +1084,7 @@ H5Pset_deflate(hid_t plist_id, unsigned level) /* Add the filter */ if(H5P_get(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline"); - if(H5Z_append(&pline, H5Z_FILTER_DEFLATE, H5Z_FLAG_OPTIONAL, 1, &level)<0) + if(H5Z_append(&pline, H5Z_FILTER_DEFLATE, H5Z_FLAG_OPTIONAL, (size_t)1, &level) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to add deflate filter to pipeline"); if(H5P_set(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to set pipeline"); @@ -1163,7 +1163,7 @@ H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block) /* Add the filter */ if(H5P_get(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline"); - if(H5Z_append(&pline, H5Z_FILTER_SZIP, H5Z_FLAG_OPTIONAL, 2, cd_values)<0) + if(H5Z_append(&pline, H5Z_FILTER_SZIP, H5Z_FLAG_OPTIONAL, (size_t)2, cd_values) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to add szip filter to pipeline"); if(H5P_set(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to set pipeline"); @@ -1210,7 +1210,7 @@ H5Pset_shuffle(hid_t plist_id) /* Add the filter */ if(H5P_get(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline"); - if(H5Z_append(&pline, H5Z_FILTER_SHUFFLE, H5Z_FLAG_OPTIONAL, 0, NULL)<0) + if(H5Z_append(&pline, H5Z_FILTER_SHUFFLE, H5Z_FLAG_OPTIONAL, (size_t)0, NULL) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to shuffle the data"); if(H5P_set(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to set pipeline"); @@ -1256,7 +1256,7 @@ H5Pset_nbit(hid_t plist_id) /* Add the nbit filter */ if(H5P_get(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline"); - if(H5Z_append(&pline, H5Z_FILTER_NBIT, H5Z_FLAG_OPTIONAL, 0, NULL)<0) + if(H5Z_append(&pline, H5Z_FILTER_NBIT, H5Z_FLAG_OPTIONAL, (size_t)0, NULL) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to add nbit filter to pipeline"); if(H5P_set(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to set pipeline"); @@ -1333,7 +1333,7 @@ H5Pset_scaleoffset(hid_t plist_id, H5Z_SO_scale_type_t scale_type, int scale_fac /* Add the scaleoffset filter */ if(H5P_get(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline"); - if(H5Z_append(&pline, H5Z_FILTER_SCALEOFFSET, H5Z_FLAG_OPTIONAL, 2, cd_values)<0) + if(H5Z_append(&pline, H5Z_FILTER_SCALEOFFSET, H5Z_FLAG_OPTIONAL, (size_t)2, cd_values) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to add scaleoffset filter to pipeline"); if(H5P_set(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to set pipeline"); @@ -1375,7 +1375,7 @@ H5Pset_fletcher32(hid_t plist_id) /* Add the Fletcher32 checksum as a filter */ if(H5P_get(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline"); - if(H5Z_append(&pline, H5Z_FILTER_FLETCHER32, H5Z_FLAG_MANDATORY, 0, NULL)<0) + if(H5Z_append(&pline, H5Z_FILTER_FLETCHER32, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to add deflate filter to pipeline"); if(H5P_set(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to set pipeline"); @@ -1546,9 +1546,9 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) 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) + if(H5T_convert(tpath, src_id, type_id, (size_t)1, (size_t)0, (size_t)0, buf, bkg, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed"); - if (buf!=value) + if(buf != value) HDmemcpy(value, buf, H5T_get_size(type)); done: @@ -60,8 +60,7 @@ H5R_init_interface(void) FUNC_ENTER_NOAPI_NOINIT(H5R_init_interface); /* Initialize the atom group for the file IDs */ - if (H5I_register_type(H5I_REFERENCE, H5I_REFID_HASHSIZE, H5R_RESERVED_ATOMS, - (H5I_free_t)NULL)<0) + if(H5I_register_type(H5I_REFERENCE, (size_t)H5I_REFID_HASHSIZE, H5R_RESERVED_ATOMS, (H5I_free_t)NULL) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to initialize interface"); done: @@ -93,8 +93,7 @@ H5S_init_interface(void) FUNC_ENTER_NOAPI_NOINIT(H5S_init_interface); /* Initialize the atom group for the file IDs */ - if (H5I_register_type(H5I_DATASPACE, H5I_DATASPACEID_HASHSIZE, - H5S_RESERVED_ATOMS, (H5I_free_t)H5S_close)<0) + if(H5I_register_type(H5I_DATASPACE, (size_t)H5I_DATASPACEID_HASHSIZE, H5S_RESERVED_ATOMS, (H5I_free_t)H5S_close) < 0) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize interface"); #ifdef H5_HAVE_PARALLEL @@ -620,18 +619,18 @@ H5S_extent_copy(H5S_extent_t *dst, const H5S_extent_t *src) break; case H5S_SIMPLE: - if (src->size) { - dst->size = H5FL_ARR_MALLOC(hsize_t,src->rank); - for (u = 0; u < src->rank; u++) + if(src->size) { + dst->size = H5FL_ARR_MALLOC(hsize_t, (size_t)src->rank); + for(u = 0; u < src->rank; u++) dst->size[u] = src->size[u]; - } + } /* end if */ else - dst->size=NULL; - if (src->max) { - dst->max = H5FL_ARR_MALLOC(hsize_t,src->rank); - for (u = 0; u < src->rank; u++) + dst->size = NULL; + if(src->max) { + dst->max = H5FL_ARR_MALLOC(hsize_t, (size_t)src->rank); + for(u = 0; u < src->rank; u++) dst->max[u] = src->max[u]; - } + } /* end if */ else dst->max=NULL; break; @@ -1343,23 +1342,22 @@ H5S_set_extent_simple (H5S_t *space, unsigned rank, const hsize_t *dims, /* Set the rank and allocate space for the dims */ space->extent.rank = rank; - space->extent.size = H5FL_ARR_MALLOC(hsize_t,rank); + space->extent.size = H5FL_ARR_MALLOC(hsize_t, (size_t)rank); /* Copy the dimensions & compute the number of elements in the extent */ - for(u=0, nelem=1; u<space->extent.rank; u++) { - space->extent.size[u]=dims[u]; - nelem*=dims[u]; + for(u = 0, nelem = 1; u < space->extent.rank; u++) { + space->extent.size[u] = dims[u]; + nelem *= dims[u]; } /* end for */ space->extent.nelem = nelem; /* Copy the maximum dimensions if specified */ - if(max!=NULL) { - space->extent.max = H5FL_ARR_MALLOC(hsize_t,rank); + if(max != NULL) { + space->extent.max = H5FL_ARR_MALLOC(hsize_t, (size_t)rank); HDmemcpy(space->extent.max, max, sizeof(hsize_t) * rank); } /* end if */ - else { + else space->extent.max = NULL; - } } /* Selection related cleanup */ diff --git a/src/H5Sselect.c b/src/H5Sselect.c index c351a40..a7d8106 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -1112,7 +1112,7 @@ H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t /* Loop, while elements left in selection */ while(max_elem>0 && user_ret==0) { /* Get the sequences of bytes */ - if(H5S_SELECT_GET_SEQ_LIST(space,0,&iter,H5D_XFER_HYPER_VECTOR_SIZE_DEF,max_elem,&nseq,&nelem,off,len)<0) + if(H5S_SELECT_GET_SEQ_LIST(space, 0, &iter, (size_t)H5D_XFER_HYPER_VECTOR_SIZE_DEF, max_elem, &nseq, &nelem, off, len) < 0) HGOTO_ERROR (H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "sequence length generation failed"); /* Loop, while sequences left to process */ @@ -1327,12 +1327,12 @@ H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2) * that the selection iterator shouldn't be "flattened", since we * aren't actually going to be doing I/O with the iterators. */ - if (H5S_select_iter_init(&iter1, space1, 0)<0) + if(H5S_select_iter_init(&iter1, space1, (size_t)0) < 0) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator"); - iter1_init=1; - if (H5S_select_iter_init(&iter2, space2, 0)<0) + iter1_init = 1; + if(H5S_select_iter_init(&iter2, space2, (size_t)0) < 0) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator"); - iter2_init=1; + iter2_init = 1; /* Iterate over all the blocks in each selection */ while(1) { @@ -1474,7 +1474,7 @@ H5S_select_fill(void *_fill, size_t fill_size, const H5S_t *space, void *_buf) /* Loop, while elements left in selection */ while(max_elem>0) { /* Get the sequences of bytes */ - if(H5S_SELECT_GET_SEQ_LIST(space,0,&iter,H5D_XFER_HYPER_VECTOR_SIZE_DEF,max_elem,&nseq,&nelem,off,len)<0) + if(H5S_SELECT_GET_SEQ_LIST(space, 0, &iter, (size_t)H5D_XFER_HYPER_VECTOR_SIZE_DEF, max_elem, &nseq, &nelem, off, len) < 0) HGOTO_ERROR (H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "sequence length generation failed"); /* Loop over sequences */ diff --git a/src/H5Tbit.c b/src/H5Tbit.c index 6ae8836..a6eb84c 100644 --- a/src/H5Tbit.c +++ b/src/H5Tbit.c @@ -200,18 +200,18 @@ H5T_bit_shift (uint8_t *buf, ssize_t shift_dist, size_t offset, size_t size) /* 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)); + H5T_bit_copy(tmp_buf, (size_t)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)); + H5T_bit_copy(buf, offset + shift_dist, tmp_buf, (size_t)0, (size_t)(size - shift_dist)); /* Zero-set the left part*/ H5T_bit_set(buf, offset, (size_t)shift_dist, 0); } else { /* right shift */ shift_dist = - shift_dist; - H5T_bit_copy(tmp_buf, 0, buf, offset+shift_dist, (size_t)(size-shift_dist)); - H5T_bit_copy (buf, offset, tmp_buf, 0, (size_t)(size-shift_dist)); - H5T_bit_set(buf, offset+size-shift_dist, (size_t)shift_dist, 0); + H5T_bit_copy(tmp_buf, (size_t)0, buf, offset + shift_dist, (size_t)(size - shift_dist)); + H5T_bit_copy (buf, offset, tmp_buf, (size_t)0, (size_t)(size - shift_dist)); + H5T_bit_set(buf, offset + size - shift_dist, (size_t)shift_dist, 0); } /* Free temporary buffer */ @@ -247,32 +247,33 @@ H5T_bit_get_d (uint8_t *buf, size_t offset, size_t size) size_t i, hs; uint64_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5T_bit_get_d); + FUNC_ENTER_NOAPI_NOFUNC(H5T_bit_get_d) assert (8*sizeof(val)>=size); - H5T_bit_copy ((uint8_t*)&val, 0, buf, offset, size); - switch (H5T_native_order_g) { + H5T_bit_copy((uint8_t*)&val, (size_t)0, buf, offset, size); + switch(H5T_native_order_g) { case H5T_ORDER_LE: break; case H5T_ORDER_BE: - for (i=0, hs=sizeof(val)/2; i<hs; i++) { + for(i = 0, hs = sizeof(val) / 2; i < hs; i++) { uint8_t tmp = ((uint8_t*)&val)[i]; - ((uint8_t*)&val)[i] = ((uint8_t*)&val)[sizeof(val)-(i+1)]; - ((uint8_t*)&val)[sizeof(val)-(i+1)] = tmp; + ((uint8_t*)&val)[i] = ((uint8_t*)&val)[sizeof(val) - (i + 1)]; + ((uint8_t*)&val)[sizeof(val) - (i + 1)] = tmp; } break; default: /* Unknown endianness. Bail out. */ - return -1; + HGOTO_DONE(UFAIL) } /* Set return value */ - ret_value=val; + ret_value = val; - FUNC_LEAVE_NOAPI(ret_value); +done: + FUNC_LEAVE_NOAPI(ret_value) } @@ -313,7 +314,7 @@ H5T_bit_set_d (uint8_t *buf, size_t offset, size_t size, uint64_t val) HDabort (); } - H5T_bit_copy (buf, offset, (uint8_t*)&val, 0, size); + H5T_bit_copy(buf, offset, (uint8_t*)&val, (size_t)0, size); } @@ -680,11 +681,11 @@ H5T_bit_neg(uint8_t *buf, size_t start, size_t size) } /* The last partial byte */ - if (size>0) { + if(size > 0) { /* Similar to the first byte case, where sequence ends in the same byte as starts */ tmp = buf[idx]; tmp = ~tmp; - H5T_bit_copy (&(buf[idx]), 0, &tmp, 0, size); + H5T_bit_copy(&(buf[idx]), (size_t)0, &tmp, (size_t)0, size); } done: diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 4b64dcc..8210c82 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -83,10 +83,10 @@ H5Tcommit(hid_t loc_id, const char *name, hid_t type_id) H5G_name_t insert_path; /* Path of group in which to create object */ H5O_loc_t insert_oloc; /* oloc of group in which to create object */ hbool_t insert_loc_valid = FALSE; /* Is insertion_loc valid? */ - H5F_t *file; + H5F_t *file = NULL; H5T_t *type = NULL; hbool_t uncommit = FALSE; /* TRUE if H5T_commit needs to be undone */ - H5T_state_t old_state; /* The state of the datatype before H5T_commit. */ + H5T_state_t old_state = H5T_STATE_TRANSIENT; /* The state of the datatype before H5T_commit. */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(H5Tcommit, FAIL) @@ -269,7 +269,7 @@ H5T_commit(H5F_t *file, H5T_t *type, hid_t dxpl_id, * Create the object header and open it for write access. Insert the data * type message and then give the object header a name. */ - if(H5O_create(file, dxpl_id, 64, &(type->oloc)) < 0) + if(H5O_create(file, dxpl_id, (size_t)64, &(type->oloc)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create datatype object header") if(H5O_modify(&(type->oloc), H5O_DTYPE_ID, 0, H5O_FLAG_CONSTANT, H5O_UPDATE_TIME, type, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to update type header message") diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 50c73fb..575dda7 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -1614,10 +1614,10 @@ H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, */ switch (dst->shared->u.atomic.lsb_pad) { case H5T_PAD_ZERO: - H5T_bit_set(d, 0, dst->shared->u.atomic.offset, FALSE); + H5T_bit_set(d, (size_t)0, dst->shared->u.atomic.offset, FALSE); break; case H5T_PAD_ONE: - H5T_bit_set(d, 0, dst->shared->u.atomic.offset, TRUE); + H5T_bit_set(d, (size_t)0, dst->shared->u.atomic.offset, TRUE); break; default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported LSB padding"); @@ -1953,15 +1953,14 @@ H5T_conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, src_memb = src->shared->u.compnd.memb + u; dst_memb = dst->shared->u.compnd.memb + src2dst[u]; - if (dst_memb->size <= src_memb->size) { - if (H5T_convert(priv->memb_path[u], priv->src_memb_id[u], + if(dst_memb->size <= src_memb->size) { + if(H5T_convert(priv->memb_path[u], priv->src_memb_id[u], priv->dst_memb_id[src2dst[u]], - 1, 0, 0, /*no striding (packed array)*/ - xbuf+src_memb->offset, xbkg+dst_memb->offset, - dxpl_id)<0) + (size_t)1, (size_t)0, (size_t)0, /*no striding (packed array)*/ + xbuf + src_memb->offset, xbkg + dst_memb->offset, + dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert compound data type member"); - HDmemmove (xbuf+offset, xbuf+src_memb->offset, - dst_memb->size); + HDmemmove(xbuf + offset, xbuf + src_memb->offset, dst_memb->size); offset += dst_memb->size; } else { HDmemmove (xbuf+offset, xbuf+src_memb->offset, @@ -1982,18 +1981,17 @@ H5T_conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, src_memb = src->shared->u.compnd.memb + i; dst_memb = dst->shared->u.compnd.memb + src2dst[i]; - if (dst_memb->size > src_memb->size) { + if(dst_memb->size > src_memb->size) { offset -= src_memb->size; - if (H5T_convert(priv->memb_path[i], + if(H5T_convert(priv->memb_path[i], priv->src_memb_id[i], priv->dst_memb_id[src2dst[i]], - 1, 0, 0, /*no striding (packed array)*/ - xbuf+offset, xbkg+dst_memb->offset, - dxpl_id)<0) + (size_t)1, (size_t)0, (size_t)0, /*no striding (packed array)*/ + xbuf + offset, xbkg + dst_memb->offset, + dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert compound data type member"); - } else { + } else offset -= dst_memb->size; - } - HDmemmove (xbkg+dst_memb->offset, xbuf+offset, dst_memb->size); + HDmemmove(xbkg + dst_memb->offset, xbuf + offset, dst_memb->size); } assert (0==offset); @@ -2888,7 +2886,7 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Convert VL sequence */ H5_CHECK_OVERFLOW(seq_len,ssize_t,size_t); - if (H5T_convert(tpath, tsrc_id, tdst_id, (size_t)seq_len, 0, 0, conv_buf, tmp_buf, dxpl_id)<0) + if(H5T_convert(tpath, tsrc_id, tdst_id, (size_t)seq_len, (size_t)0, (size_t)0, conv_buf, tmp_buf, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed"); } /* end if */ @@ -3078,8 +3076,8 @@ H5T_conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HDmemmove(dp, sp, src->shared->size); /* Convert array */ - if (H5T_convert(tpath, tsrc_id, tdst_id, src->shared->u.array.nelem, 0, bkg_stride, dp, bkg_buf, dxpl_id)<0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed"); + if(H5T_convert(tpath, tsrc_id, tdst_id, src->shared->u.array.nelem, (size_t)0, bkg_stride, dp, bkg_buf, dxpl_id) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") /* Advance the source & destination pointers */ sp += src_delta; @@ -3374,8 +3372,8 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } 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); + 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), (size_t)1, FALSE); } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") else if(except_ret == H5T_CONV_HANDLED) @@ -3411,8 +3409,8 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } 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); + 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), (size_t)1, TRUE); } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") else if(except_ret == H5T_CONV_HANDLED) @@ -3441,8 +3439,8 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } 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); + 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), (size_t)1, FALSE); } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") else if(except_ret == H5T_CONV_HANDLED) @@ -3463,8 +3461,8 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Set padding areas in destination. */ if (dst->shared->u.atomic.offset>0) { - assert (H5T_PAD_ZERO==dst->shared->u.atomic.lsb_pad || H5T_PAD_ONE==dst->shared->u.atomic.lsb_pad); - H5T_bit_set (d, 0, dst->shared->u.atomic.offset, (hbool_t)(H5T_PAD_ONE==dst->shared->u.atomic.lsb_pad)); + assert(H5T_PAD_ZERO==dst->shared->u.atomic.lsb_pad || H5T_PAD_ONE==dst->shared->u.atomic.lsb_pad); + H5T_bit_set(d, (size_t)0, dst->shared->u.atomic.offset, (hbool_t)(H5T_PAD_ONE==dst->shared->u.atomic.lsb_pad)); } if (dst->shared->u.atomic.offset+dst->shared->u.atomic.prec!=8*dst->shared->size) { assert (H5T_PAD_ZERO==dst->shared->u.atomic.msb_pad || H5T_PAD_ONE==dst->shared->u.atomic.msb_pad); @@ -3709,7 +3707,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* * Find the sign bit value of the source. */ - sign = H5T_bit_get_d(s, src.u.f.sign, 1); + sign = H5T_bit_get_d(s, src.u.f.sign, (size_t)1); /* * Check for special cases: +0, -0, +Inf, -Inf, NaN |