diff options
author | MuQun Yang <ymuqun@hdfgroup.org> | 2002-05-03 22:31:13 (GMT) |
---|---|---|
committer | MuQun Yang <ymuqun@hdfgroup.org> | 2002-05-03 22:31:13 (GMT) |
commit | 68d21ca78b509165fbf530ce34f6f904ad8dbd7c (patch) | |
tree | 87e17d180bf9d89929b954c4117521cd9829d091 /src/H5FL.c | |
parent | c6ddcbe08cb9fd9679cdbd2304d4a4da9f2e9e1e (diff) | |
download | hdf5-68d21ca78b509165fbf530ce34f6f904ad8dbd7c.zip hdf5-68d21ca78b509165fbf530ce34f6f904ad8dbd7c.tar.gz hdf5-68d21ca78b509165fbf530ce34f6f904ad8dbd7c.tar.bz2 |
[svn-r5350]
Purpose:
code clean up to erase warnings on windows
Description:
most warnings are due to casting from data type of large size to that of small size
Solution:
Using H5_CHECK_OVERFLOW and H5_ASSIGN_OVERFLOW
Platforms tested:
linux 2.2.18 and windows 2000
Diffstat (limited to 'src/H5FL.c')
-rw-r--r-- | src/H5FL.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -600,7 +600,7 @@ H5FL_blk_create_list(H5FL_blk_node_t **head, hsize_t size) 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; + H5_ASSIGN_OVERFLOW(temp->size,size,hsize_t,size_t); temp->list=NULL; /* Attach to head of priority queue */ @@ -713,10 +713,12 @@ H5FL_blk_alloc(H5FL_blk_head_t *head, hsize_t size, unsigned clear) /* Decrement the number of blocks & memory used on free list */ head->onlist--; - head->list_mem-=size; + H5_ASSIGN_OVERFLOW(head->list_mem,head->list_mem-size,hsize_t,size_t); + /*head->list_mem-=size;*/ /* Decrement the amount of global "block" free list memory in use */ - H5FL_blk_gc_head.mem_freed-=size; + H5_ASSIGN_OVERFLOW(H5FL_blk_gc_head.mem_freed,H5FL_blk_gc_head.mem_freed-size,hsize_t,size_t); + /*H5FL_blk_gc_head.mem_freed-=size;*/ } /* end if */ /* No free list available, or there are no nodes on the list, allocate a new node to give to the user */ @@ -729,7 +731,7 @@ H5FL_blk_alloc(H5FL_blk_head_t *head, hsize_t size, unsigned clear) head->allocated++; /* Initialize the block allocated */ - temp->size=size; + H5_ASSIGN_OVERFLOW(temp->size,size,hsize_t,size_t); temp->next=NULL; /* Set the return value to the block itself */ @@ -1156,7 +1158,7 @@ H5FL_arr_free(H5FL_arr_head_t *head, void *obj) head->u.list_arr[temp->nelem]=temp; /* Set the amount of memory being freed */ - mem_size=temp->nelem*head->size; + H5_ASSIGN_OVERFLOW(mem_size,temp->nelem*head->size,hsize_t,size_t); /* Increment the number of blocks & memory used on free list */ head->onlist[temp->nelem]++; @@ -1240,7 +1242,7 @@ H5FL_arr_alloc(H5FL_arr_head_t *head, hsize_t elem, unsigned clear) head->list_mem-=mem_size; /* Decrement the amount of global "array" free list memory in use */ - H5FL_arr_gc_head.mem_freed-=mem_size; + H5_ASSIGN_OVERFLOW(H5FL_arr_gc_head.mem_freed,H5FL_arr_gc_head.mem_freed-mem_size,hsize_t,size_t); } /* end if */ /* Otherwise allocate a node */ @@ -1373,7 +1375,7 @@ H5FL_arr_gc_list(H5FL_arr_head_t *head) for(i=0; i<head->maxelem; i++) { if(head->onlist[i]>0) { /* Calculate the total memory used on this list */ - total_mem=head->onlist[i]*i*head->size; + H5_ASSIGN_OVERFLOW(total_mem,head->onlist[i]*i*head->size,hsize_t,size_t); /* For each free list being garbage collected, walk through the nodes and free them */ arr_free_list=head->u.list_arr[i]; |