Merge pull request #5074 from bosilca/topic/remove_warnings
Remove warnings identified by clang.
Этот коммит содержится в:
Коммит
2ab628b92e
@ -361,7 +361,7 @@ static inline int ompi_osc_rdma_lock_try_acquire_exclusive (ompi_osc_rdma_module
|
|||||||
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_DEBUG, "exclusive lock acquired");
|
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_DEBUG, "exclusive lock acquired");
|
||||||
} else {
|
} else {
|
||||||
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_DEBUG, "could not acquire exclusive lock. lock state 0x%" PRIx64,
|
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_DEBUG, "could not acquire exclusive lock. lock state 0x%" PRIx64,
|
||||||
(unsigned long) lock_state);
|
(uint64_t) lock_state);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -110,6 +110,7 @@ static inline unsigned int mca_pml_ob1_param_register_uint(
|
|||||||
return *storage;
|
return *storage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static inline size_t mca_pml_ob1_param_register_sizet(
|
static inline size_t mca_pml_ob1_param_register_sizet(
|
||||||
const char* param_name,
|
const char* param_name,
|
||||||
size_t default_value,
|
size_t default_value,
|
||||||
@ -122,6 +123,7 @@ static inline size_t mca_pml_ob1_param_register_sizet(
|
|||||||
MCA_BASE_VAR_SCOPE_READONLY, storage);
|
MCA_BASE_VAR_SCOPE_READONLY, storage);
|
||||||
return *storage;
|
return *storage;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int mca_pml_ob1_comm_size_notify (mca_base_pvar_t *pvar, mca_base_pvar_event_t event, void *obj_handle, int *count)
|
static int mca_pml_ob1_comm_size_notify (mca_base_pvar_t *pvar, mca_base_pvar_event_t event, void *obj_handle, int *count)
|
||||||
{
|
{
|
||||||
|
@ -119,7 +119,7 @@ void *tm_malloc(size_t size, char *file, int line){
|
|||||||
ptr = malloc(size);
|
ptr = malloc(size);
|
||||||
|
|
||||||
if(tm_get_verbose_level()>=DEBUG)
|
if(tm_get_verbose_level()>=DEBUG)
|
||||||
printf("tm_malloc of size %ld: %p (%s: %d)\n",size-2*EXTRA_BYTE,ptr,file,line);
|
printf("tm_malloc of size %ld: %p (%s: %d)\n",size-2*EXTRA_BYTE,(void*)ptr,file,line);
|
||||||
|
|
||||||
save_ptr(ptr, size, file, line);
|
save_ptr(ptr, size, file, line);
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ void *tm_malloc(size_t size, char *file, int line){
|
|||||||
|
|
||||||
|
|
||||||
if(tm_get_verbose_level()>=DEBUG)
|
if(tm_get_verbose_level()>=DEBUG)
|
||||||
printf("tm_malloc returning: %p\n",ptr+EXTRA_BYTE);
|
printf("tm_malloc returning: %p\n",(void*)(ptr+EXTRA_BYTE));
|
||||||
|
|
||||||
return (void *)(ptr + EXTRA_BYTE);
|
return (void *)(ptr + EXTRA_BYTE);
|
||||||
}
|
}
|
||||||
@ -147,14 +147,14 @@ void *tm_calloc(size_t count, size_t size, char *file, int line){
|
|||||||
save_ptr(ptr, full_size, file, line);
|
save_ptr(ptr, full_size, file, line);
|
||||||
|
|
||||||
if(tm_get_verbose_level()>=DEBUG)
|
if(tm_get_verbose_level()>=DEBUG)
|
||||||
printf("tm_calloc of size %ld: %p (%s: %d)\n",full_size-2*EXTRA_BYTE,ptr, file, line);
|
printf("tm_calloc of size %ld: %p (%s: %d)\n",full_size-2*EXTRA_BYTE,(void*)ptr, file, line);
|
||||||
|
|
||||||
|
|
||||||
memcpy(ptr, extra_data, EXTRA_BYTE);
|
memcpy(ptr, extra_data, EXTRA_BYTE);
|
||||||
memcpy(ptr + full_size - EXTRA_BYTE, extra_data, EXTRA_BYTE);
|
memcpy(ptr + full_size - EXTRA_BYTE, extra_data, EXTRA_BYTE);
|
||||||
|
|
||||||
if(tm_get_verbose_level()>=DEBUG)
|
if(tm_get_verbose_level()>=DEBUG)
|
||||||
printf("tm_calloc returning: %p\n",ptr+EXTRA_BYTE);
|
printf("tm_calloc returning: %p\n", (void*)(ptr+EXTRA_BYTE));
|
||||||
|
|
||||||
return (void *)(ptr+EXTRA_BYTE);
|
return (void *)(ptr+EXTRA_BYTE);
|
||||||
}
|
}
|
||||||
@ -172,7 +172,7 @@ void *tm_realloc(void *old_ptr, size_t size, char *file, int line){
|
|||||||
save_ptr(ptr, full_size, file, line);
|
save_ptr(ptr, full_size, file, line);
|
||||||
|
|
||||||
if(tm_get_verbose_level()>=DEBUG)
|
if(tm_get_verbose_level()>=DEBUG)
|
||||||
printf("tm_realloc of size %ld: %p (%s: %d)\n",full_size-2*EXTRA_BYTE,ptr, file, line);
|
printf("tm_realloc of size %ld: %p (%s: %d)\n",full_size-2*EXTRA_BYTE, (void*)ptr, file, line);
|
||||||
|
|
||||||
|
|
||||||
memcpy(ptr, extra_data, EXTRA_BYTE);
|
memcpy(ptr, extra_data, EXTRA_BYTE);
|
||||||
@ -185,17 +185,17 @@ void *tm_realloc(void *old_ptr, size_t size, char *file, int line){
|
|||||||
memcpy(ptr + EXTRA_BYTE, old_ptr, MIN(old_ptr_size - 2 * EXTRA_BYTE, size));
|
memcpy(ptr + EXTRA_BYTE, old_ptr, MIN(old_ptr_size - 2 * EXTRA_BYTE, size));
|
||||||
|
|
||||||
if((bcmp(original_ptr ,extra_data, EXTRA_BYTE)) && ((tm_get_verbose_level()>=ERROR))){
|
if((bcmp(original_ptr ,extra_data, EXTRA_BYTE)) && ((tm_get_verbose_level()>=ERROR))){
|
||||||
fprintf(stderr,"Realloc: cannot find special string ***before*** %p!\n", original_ptr);
|
fprintf(stderr,"Realloc: cannot find special string ***before*** %p!\n", (void*)original_ptr);
|
||||||
fprintf(stderr,"memory is probably corrupted here!\n");
|
fprintf(stderr,"memory is probably corrupted here!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if((bcmp(original_ptr + old_ptr_size -EXTRA_BYTE ,extra_data, EXTRA_BYTE)) && ((tm_get_verbose_level()>=ERROR))){
|
if((bcmp(original_ptr + old_ptr_size -EXTRA_BYTE ,extra_data, EXTRA_BYTE)) && ((tm_get_verbose_level()>=ERROR))){
|
||||||
fprintf(stderr,"Realloc: cannot find special string ***after*** %p!\n", original_ptr);
|
fprintf(stderr,"Realloc: cannot find special string ***after*** %p!\n", (void*)original_ptr);
|
||||||
fprintf(stderr,"memory is probably corrupted here!\n");
|
fprintf(stderr,"memory is probably corrupted here!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tm_get_verbose_level()>=DEBUG)
|
if(tm_get_verbose_level()>=DEBUG)
|
||||||
printf("tm_free freeing: %p\n",original_ptr);
|
printf("tm_free freeing: %p\n", (void*)original_ptr);
|
||||||
|
|
||||||
|
|
||||||
free(original_ptr);
|
free(original_ptr);
|
||||||
@ -203,7 +203,7 @@ void *tm_realloc(void *old_ptr, size_t size, char *file, int line){
|
|||||||
|
|
||||||
|
|
||||||
if(tm_get_verbose_level()>=DEBUG)
|
if(tm_get_verbose_level()>=DEBUG)
|
||||||
printf("tm_realloc returning: %p (----- %p)\n",ptr+EXTRA_BYTE, ((byte *)ptr) - EXTRA_BYTE);
|
printf("tm_realloc returning: %p (----- %p)\n",(void*)(ptr+EXTRA_BYTE),(void*)(((byte *)ptr) - EXTRA_BYTE));
|
||||||
|
|
||||||
|
|
||||||
return (void *)(ptr+EXTRA_BYTE);
|
return (void *)(ptr+EXTRA_BYTE);
|
||||||
@ -219,17 +219,17 @@ void tm_free(void *ptr){
|
|||||||
size = retreive_size(original_ptr);
|
size = retreive_size(original_ptr);
|
||||||
|
|
||||||
if((bcmp(original_ptr ,extra_data, EXTRA_BYTE)) && ((tm_get_verbose_level()>=ERROR))){
|
if((bcmp(original_ptr ,extra_data, EXTRA_BYTE)) && ((tm_get_verbose_level()>=ERROR))){
|
||||||
fprintf(stderr,"Free: cannot find special string ***before*** %p!\n", original_ptr);
|
fprintf(stderr,"Free: cannot find special string ***before*** %p!\n", (void*)original_ptr);
|
||||||
fprintf(stderr,"memory is probably corrupted here!\n");
|
fprintf(stderr,"memory is probably corrupted here!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if((bcmp(original_ptr + size -EXTRA_BYTE ,extra_data, EXTRA_BYTE)) && ((tm_get_verbose_level()>=ERROR))){
|
if((bcmp(original_ptr + size -EXTRA_BYTE ,extra_data, EXTRA_BYTE)) && ((tm_get_verbose_level()>=ERROR))){
|
||||||
fprintf(stderr,"Free: cannot find special string ***after*** %p!\n", original_ptr);
|
fprintf(stderr,"Free: cannot find special string ***after*** %p!\n", (void*)original_ptr);
|
||||||
fprintf(stderr,"memory is probably corrupted here!\n");
|
fprintf(stderr,"memory is probably corrupted here!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tm_get_verbose_level()>=DEBUG)
|
if(tm_get_verbose_level()>=DEBUG)
|
||||||
printf("tm_free freeing: %p\n",original_ptr);
|
printf("tm_free freeing: %p\n", (void*)original_ptr);
|
||||||
|
|
||||||
|
|
||||||
free(original_ptr);
|
free(original_ptr);
|
||||||
|
@ -546,9 +546,9 @@ int mca_btl_tcp_recv_blocking(int sd, void* data, size_t size)
|
|||||||
int retval = recv(sd, ((char *)ptr) + cnt, size - cnt, 0);
|
int retval = recv(sd, ((char *)ptr) + cnt, size - cnt, 0);
|
||||||
/* remote closed connection */
|
/* remote closed connection */
|
||||||
if (0 == retval) {
|
if (0 == retval) {
|
||||||
OPAL_OUTPUT_VERBOSE((100, opal_btl_base_framework.framework_output,
|
OPAL_OUTPUT_VERBOSE((100, opal_btl_base_framework.framework_output,
|
||||||
"remote peer unexpectedly closed connection while I was waiting for a blocking message"));
|
"remote peer unexpectedly closed connection while I was waiting for a blocking message"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* socket is non-blocking so handle errors */
|
/* socket is non-blocking so handle errors */
|
||||||
@ -557,7 +557,7 @@ int mca_btl_tcp_recv_blocking(int sd, void* data, size_t size)
|
|||||||
opal_socket_errno != EAGAIN &&
|
opal_socket_errno != EAGAIN &&
|
||||||
opal_socket_errno != EWOULDBLOCK) {
|
opal_socket_errno != EWOULDBLOCK) {
|
||||||
BTL_ERROR(("recv(%d) failed: %s (%d)", sd, strerror(opal_socket_errno), opal_socket_errno));
|
BTL_ERROR(("recv(%d) failed: %s (%d)", sd, strerror(opal_socket_errno), opal_socket_errno));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -83,12 +83,6 @@ int mca_rcache_base_vma_tree_find_all (mca_rcache_base_vma_module_t *vma_module,
|
|||||||
return args.reg_cnt;
|
return args.reg_cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void mca_rcache_base_vma_update_byte_count (mca_rcache_base_vma_module_t *vma_module,
|
|
||||||
size_t nbytes)
|
|
||||||
{
|
|
||||||
vma_module->reg_cur_cache_size += nbytes;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct mca_rcache_base_vma_tree_iterate_helper_args_t {
|
struct mca_rcache_base_vma_tree_iterate_helper_args_t {
|
||||||
int (*callback_fn) (struct mca_rcache_base_registration_t *, void *);
|
int (*callback_fn) (struct mca_rcache_base_registration_t *, void *);
|
||||||
void *ctx;
|
void *ctx;
|
||||||
@ -112,11 +106,6 @@ int mca_rcache_base_vma_tree_iterate (mca_rcache_base_vma_module_t *vma_module,
|
|||||||
mca_rcache_base_vma_tree_iterate_helper, &args);
|
mca_rcache_base_vma_tree_iterate_helper, &args);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int mca_rcache_base_vma_can_insert (mca_rcache_base_vma_module_t *vma_module, size_t nbytes, size_t limit)
|
|
||||||
{
|
|
||||||
return (0 == limit || vma_module->reg_cur_cache_size + nbytes <= limit);
|
|
||||||
}
|
|
||||||
|
|
||||||
int mca_rcache_base_vma_tree_insert (mca_rcache_base_vma_module_t *vma_module,
|
int mca_rcache_base_vma_tree_insert (mca_rcache_base_vma_module_t *vma_module,
|
||||||
mca_rcache_base_registration_t *reg, size_t limit)
|
mca_rcache_base_registration_t *reg, size_t limit)
|
||||||
{
|
{
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user