diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2015-10-05 02:49:05 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2015-10-05 02:49:05 (GMT) |
commit | 37c2195cfc2616f1bedb056eefbba12fabf35949 (patch) | |
tree | 8f103f37c308d8b5b8f9f6dc48d92c3368b1e064 | |
parent | b9c4183b5cd7789ce33e13485301fba629465469 (diff) | |
download | hdf5-37c2195cfc2616f1bedb056eefbba12fabf35949.zip hdf5-37c2195cfc2616f1bedb056eefbba12fabf35949.tar.gz hdf5-37c2195cfc2616f1bedb056eefbba12fabf35949.tar.bz2 |
[svn-r27950] Merge of r27296 from the trunk
Description:
Correct error with braces around macro (in production builds), also clean
up a few warnings.
Tested on: Ubuntu 15.04 (Linux 3.19 x86_64), gcc 4.9.2, MPICH 3.1.4
parallel w/ fortran
serial w/ fortran and C++
-rw-r--r-- | src/H5AC.c | 2 | ||||
-rw-r--r-- | src/H5C.c | 27 | ||||
-rw-r--r-- | src/H5Cpkg.h | 8 | ||||
-rw-r--r-- | src/H5Cprivate.h | 4 | ||||
-rw-r--r-- | test/cache.c | 27 | ||||
-rw-r--r-- | test/cache_common.c | 2 | ||||
-rw-r--r-- | testpar/t_cache.c | 2 |
7 files changed, 29 insertions, 43 deletions
@@ -1662,7 +1662,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, } /* end if */ #endif /* H5_HAVE_PARALLEL */ - if(H5C_unprotect(f, dxpl_id, type, addr, thing, flags) < 0) + if(H5C_unprotect(f, dxpl_id, addr, thing, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "H5C_unprotect() failed.") #ifdef H5_HAVE_PARALLEL @@ -175,9 +175,8 @@ static herr_t H5C_mark_tagged_entries_cork(H5C_t *cache_ptr, haddr_t obj_addr, hbool_t val); -static herr_t H5C_flush_marked_entries(H5F_t * f, - hid_t dxpl_id, - H5C_t * cache_ptr); +static herr_t H5C_flush_marked_entries(H5F_t * f, + hid_t dxpl_id); static herr_t H5C__mark_flush_dep_dirty(H5C_cache_entry_t * entry); @@ -5150,7 +5149,6 @@ done: herr_t H5C_unprotect(H5F_t * f, hid_t dxpl_id, - const H5C_class_t * type, haddr_t addr, void * thing, unsigned int flags) @@ -5188,7 +5186,6 @@ H5C_unprotect(H5F_t * f, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( type ); HDassert( H5F_addr_defined(addr) ); HDassert( thing ); HDassert( ! ( pin_entry && unpin_entry ) ); @@ -5199,7 +5196,6 @@ H5C_unprotect(H5F_t * f, entry_ptr = (H5C_cache_entry_t *)thing; HDassert( entry_ptr->addr == addr ); - HDassert( entry_ptr->type == type ); /* also set the dirtied variable if the dirtied field is set in * the entry. @@ -8270,13 +8266,13 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ /* only log a clear if the entry was dirty */ if(was_dirty) { H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) - } + } /* end if */ } else if(write_entry) { HDassert(was_dirty); /* only log a flush if we actually wrote to disk */ H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) - } + } /* end else if */ if(destroy) { if(take_ownership) @@ -8285,7 +8281,7 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ HDassert(destroy_entry); H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr, take_ownership) - } + } /* end if */ /* If the entry's type has a 'notify' callback and the entry is about * to be removed from the cache, send a 'before eviction' notice while @@ -10116,7 +10112,7 @@ H5C_evict_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag) /* If we stop evicting entries and pinned entries still need evicted, then we have a problem. */ if (pinned_entries_need_evicted) { - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Pinned entries still need evicted?!"); + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Pinned entries still need evicted?!"); } /* end if */ done: @@ -10199,15 +10195,14 @@ H5C_mark_tagged_entries(H5C_t * cache_ptr, haddr_t tag, hbool_t mark_clean) *------------------------------------------------------------------------- */ static herr_t -H5C_flush_marked_entries(H5F_t * f, hid_t dxpl_id, H5C_t * cache_ptr) +H5C_flush_marked_entries(H5F_t * f, hid_t dxpl_id) { herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT /* Assertions */ - HDassert(cache_ptr != NULL); - HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(f != NULL); /* Flush all marked entries */ if(H5C_flush_cache(f, dxpl_id, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_IGNORE_PROTECTED_FLAG) < 0) @@ -10249,11 +10244,11 @@ H5C_flush_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag) /* Mark all entries with specified tag */ if(H5C_mark_tagged_entries(cache_ptr, tag, FALSE) < 0 ) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't mark tagged entries") + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't mark tagged entries") /* Flush all marked entries */ - if(H5C_flush_marked_entries(f, dxpl_id, cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush marked entries") + if(H5C_flush_marked_entries(f, dxpl_id) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush marked entries") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index eb5fefc..9c979f7 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -586,7 +586,7 @@ if ( ( (entry_ptr) == NULL ) || \ #define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \ { \ (((cache_ptr)->clears)[(entry_ptr)->type->id])++; \ - if ( (entry_ptr)->is_pinned ) \ + if((entry_ptr)->is_pinned) \ (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \ ((entry_ptr)->clears)++; \ } @@ -594,7 +594,7 @@ if ( ( (entry_ptr) == NULL ) || \ #define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \ { \ (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; \ - if ( (entry_ptr)->is_pinned ) \ + if((entry_ptr)->is_pinned) \ (((cache_ptr)->pinned_flushes)[(entry_ptr)->type->id])++; \ ((entry_ptr)->flushes)++; \ } @@ -700,9 +700,9 @@ if ( ( (entry_ptr) == NULL ) || \ #define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \ { \ - if ( (entry_ptr)->is_pinned ) \ - (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \ (((cache_ptr)->clears)[(entry_ptr)->type->id])++; \ + if((entry_ptr)->is_pinned) \ + (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \ } #define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \ diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 2980a2f..ab44d96 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -2022,8 +2022,8 @@ H5_DLL void H5C_stats__reset(H5C_t *cache_ptr); H5_DLL herr_t H5C_dump_cache(H5C_t *cache_ptr, const char *cache_name); H5_DLL herr_t H5C_unpin_entry(void *thing); H5_DLL herr_t H5C_destroy_flush_dependency(void *parent_thing, void *child_thing); -H5_DLL herr_t H5C_unprotect(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, - haddr_t addr, void *thing, unsigned int flags); +H5_DLL herr_t H5C_unprotect(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *thing, + unsigned int flags); H5_DLL herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests); H5_DLL herr_t H5C_ignore_tags(H5C_t *cache_ptr); diff --git a/test/cache.c b/test/cache.c index eff949e..ccc2f2e 100644 --- a/test/cache.c +++ b/test/cache.c @@ -14208,8 +14208,7 @@ check_resize_entry(void) } else { result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, - &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, - (void *)entry_ptr, H5C__DIRTIED_FLAG); + entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG); if ( result < 0 ) { @@ -14294,8 +14293,7 @@ check_resize_entry(void) } else { result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, - &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, - (void *)entry_ptr, H5C__DIRTIED_FLAG); + entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG); if ( result < 0 ) { @@ -14655,8 +14653,7 @@ check_resize_entry(void) } else { result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, - &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, - (void *)entry_ptr, H5C__DIRTIED_FLAG); + entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG); if ( result < 0 ) { @@ -14743,8 +14740,7 @@ check_resize_entry(void) } else { result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, - &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, - (void *)entry_ptr, H5C__DIRTIED_FLAG); + entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG); if ( result < 0 ) { @@ -16247,8 +16243,7 @@ check_double_pin_err(void) if ( pass ) { result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, - (void *)entry_ptr, H5C__PIN_ENTRY_FLAG); + entry_ptr->addr, (void *)entry_ptr, H5C__PIN_ENTRY_FLAG); if ( result > 0 ) { @@ -16332,8 +16327,7 @@ check_double_unpin_err(void) if ( pass ) { result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, - (void *)entry_ptr, H5C__UNPIN_ENTRY_FLAG); + entry_ptr->addr, (void *)entry_ptr, H5C__UNPIN_ENTRY_FLAG); if ( result > 0 ) { @@ -16613,8 +16607,7 @@ check_double_unprotect_err(void) if ( pass ) { result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, - (void *)entry_ptr, H5C__NO_FLAGS_SET); + entry_ptr->addr, (void *)entry_ptr, H5C__NO_FLAGS_SET); if ( result > 0 ) { @@ -16990,8 +16983,7 @@ check_unprotect_ro_dirty_err(void) if ( pass ) { result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, - (void *)entry_ptr, H5C__DIRTIED_FLAG); + entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG); if ( result >= 0 ) { @@ -17034,8 +17026,7 @@ check_unprotect_ro_dirty_err(void) if ( pass ) { result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, - (void *)entry_ptr, H5C__DIRTIED_FLAG); + entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG); if ( result > 0 ) { diff --git a/test/cache_common.c b/test/cache_common.c index ff457d0..9936e47 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -4230,7 +4230,7 @@ unprotect_entry(H5F_t * file_ptr, } /* end if */ result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, - &(types[type]), entry_ptr->addr, (void *)entry_ptr, flags); + entry_ptr->addr, (void *)entry_ptr, flags); if ( ( result < 0 ) || ( ( entry_ptr->header.is_protected ) && diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 316bd0a..b438725 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -4999,7 +4999,7 @@ unlock_entry(H5F_t * file_ptr, nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: error in H5C_unprotect().\n", + HDfprintf(stdout, "%d:%s: error in H5AC_unprotect().\n", world_mpi_rank, FUNC); } } else { |