Merge pull request #6993 from awlauria/fix_warnings_master
Fix miscellaneous compiler warnings.
Этот коммит содержится в:
Коммит
4e1e6f8972
@ -247,9 +247,7 @@ static long int init_mat_mmap(char *filename,int N, double **mat, double *sum_ro
|
|||||||
return nnz;
|
return nnz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __MACH__
|
||||||
|
|
||||||
|
|
||||||
static long int init_mat_long(char *filename,int N, double **mat, double *sum_row){
|
static long int init_mat_long(char *filename,int N, double **mat, double *sum_row){
|
||||||
int i;
|
int i;
|
||||||
unsigned int vl = tm_get_verbose_level();
|
unsigned int vl = tm_get_verbose_level();
|
||||||
@ -275,7 +273,7 @@ static long int init_mat_long(char *filename,int N, double **mat, double *sum_ro
|
|||||||
fclose (pf);
|
fclose (pf);
|
||||||
return nnz;
|
return nnz;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
tm_affinity_mat_t * new_affinity_mat(double **mat, double *sum_row, int order, long int nnz){
|
tm_affinity_mat_t * new_affinity_mat(double **mat, double *sum_row, int order, long int nnz){
|
||||||
tm_affinity_mat_t * aff_mat;
|
tm_affinity_mat_t * aff_mat;
|
||||||
|
@ -41,7 +41,7 @@ opal_convertor_merge_iov( struct iovec* iov, uint32_t* iov_count,
|
|||||||
uint32_t* idx )
|
uint32_t* idx )
|
||||||
{
|
{
|
||||||
if( 0 != iov[*idx].iov_len ) {
|
if( 0 != iov[*idx].iov_len ) {
|
||||||
if( (base == ((char*)iov[*idx].iov_base + iov[*idx].iov_len)) ) {
|
if( base == ((char*)iov[*idx].iov_base + iov[*idx].iov_len) ) {
|
||||||
iov[*idx].iov_len += len; /* merge with previous iovec */
|
iov[*idx].iov_len += len; /* merge with previous iovec */
|
||||||
return 0;
|
return 0;
|
||||||
} /* cannot merge, move to the next position */
|
} /* cannot merge, move to the next position */
|
||||||
|
@ -89,13 +89,14 @@ struct bit80 {
|
|||||||
static inline void
|
static inline void
|
||||||
opal_dt_swap_long_double(void *to_p, const void *from_p, const size_t size, size_t count, uint32_t remoteArch)
|
opal_dt_swap_long_double(void *to_p, const void *from_p, const size_t size, size_t count, uint32_t remoteArch)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef HAVE_IEEE754_H
|
#ifdef HAVE_IEEE754_H
|
||||||
size_t i;
|
|
||||||
long double*to = (long double *) to_p;
|
|
||||||
|
|
||||||
if ((opal_local_arch&OPAL_ARCH_LDISINTEL) && !(remoteArch&OPAL_ARCH_LDISINTEL)) {
|
if ((opal_local_arch&OPAL_ARCH_LDISINTEL) && !(remoteArch&OPAL_ARCH_LDISINTEL)) {
|
||||||
#ifdef __x86_64
|
#ifdef __x86_64
|
||||||
for (i=0; i<count; i++, to++) {
|
long double*to = (long double *) to_p;
|
||||||
|
|
||||||
|
for (size_t i=0; i<count; i++, to++) {
|
||||||
union ieee854_long_double ld;
|
union ieee854_long_double ld;
|
||||||
struct bit128 * b = (struct bit128 *)to;
|
struct bit128 * b = (struct bit128 *)to;
|
||||||
ld.ieee.empty = 0;
|
ld.ieee.empty = 0;
|
||||||
@ -108,7 +109,9 @@ opal_dt_swap_long_double(void *to_p, const void *from_p, const size_t size, size
|
|||||||
#endif
|
#endif
|
||||||
} else if (!(opal_local_arch&OPAL_ARCH_LDISINTEL) && (remoteArch&OPAL_ARCH_LDISINTEL)) {
|
} else if (!(opal_local_arch&OPAL_ARCH_LDISINTEL) && (remoteArch&OPAL_ARCH_LDISINTEL)) {
|
||||||
#ifdef __sparcv9
|
#ifdef __sparcv9
|
||||||
for (i=0; i<count; i++, to++) {
|
long double*to = (long double *) to_p;
|
||||||
|
|
||||||
|
for (size_t i=0; i<count; i++, to++) {
|
||||||
union ieee854_long_double ld;
|
union ieee854_long_double ld;
|
||||||
struct bit80 * b = (struct bit80 *)to;
|
struct bit80 * b = (struct bit80 *)to;
|
||||||
ld.ieee.mantissa3 = 0;
|
ld.ieee.mantissa3 = 0;
|
||||||
|
@ -68,7 +68,7 @@ struct mca_btl_tcp_addr_t {
|
|||||||
#if OPAL_ENABLE_IPV6
|
#if OPAL_ENABLE_IPV6
|
||||||
struct in6_addr addr_inet6; /* IPv6 listen address */
|
struct in6_addr addr_inet6; /* IPv6 listen address */
|
||||||
#endif
|
#endif
|
||||||
};
|
} addr_union;
|
||||||
in_port_t addr_port; /**< listen port */
|
in_port_t addr_port; /**< listen port */
|
||||||
int addr_ifkindex; /**< remote interface index assigned with
|
int addr_ifkindex; /**< remote interface index assigned with
|
||||||
this address */
|
this address */
|
||||||
|
@ -172,7 +172,7 @@ mca_btl_tcp_proc_t* mca_btl_tcp_proc_create(opal_proc_t* proc)
|
|||||||
fields needed in the proc version */
|
fields needed in the proc version */
|
||||||
for (i = 0 ; i < btl_proc->proc_addr_count ; i++) {
|
for (i = 0 ; i < btl_proc->proc_addr_count ; i++) {
|
||||||
if (MCA_BTL_TCP_AF_INET == remote_addrs[i].addr_family) {
|
if (MCA_BTL_TCP_AF_INET == remote_addrs[i].addr_family) {
|
||||||
memcpy(&btl_proc->proc_addrs[i].addr_inet,
|
memcpy(&btl_proc->proc_addrs[i].addr_union.addr_inet,
|
||||||
remote_addrs[i].addr, sizeof(struct in_addr));
|
remote_addrs[i].addr, sizeof(struct in_addr));
|
||||||
btl_proc->proc_addrs[i].addr_port = remote_addrs[i].addr_port;
|
btl_proc->proc_addrs[i].addr_port = remote_addrs[i].addr_port;
|
||||||
btl_proc->proc_addrs[i].addr_ifkindex = remote_addrs[i].addr_ifkindex;
|
btl_proc->proc_addrs[i].addr_ifkindex = remote_addrs[i].addr_ifkindex;
|
||||||
@ -180,7 +180,7 @@ mca_btl_tcp_proc_t* mca_btl_tcp_proc_create(opal_proc_t* proc)
|
|||||||
btl_proc->proc_addrs[i].addr_inuse = false;
|
btl_proc->proc_addrs[i].addr_inuse = false;
|
||||||
} else if (MCA_BTL_TCP_AF_INET6 == remote_addrs[i].addr_family) {
|
} else if (MCA_BTL_TCP_AF_INET6 == remote_addrs[i].addr_family) {
|
||||||
#if OPAL_ENABLE_IPV6
|
#if OPAL_ENABLE_IPV6
|
||||||
memcpy(&btl_proc->proc_addrs[i].addr_inet6,
|
memcpy(&btl_proc->proc_addrs[i].addr_union.addr_inet6,
|
||||||
remote_addrs[i].addr, sizeof(struct in6_addr));
|
remote_addrs[i].addr, sizeof(struct in6_addr));
|
||||||
btl_proc->proc_addrs[i].addr_port = remote_addrs[i].addr_port;
|
btl_proc->proc_addrs[i].addr_port = remote_addrs[i].addr_port;
|
||||||
btl_proc->proc_addrs[i].addr_ifkindex = remote_addrs[i].addr_ifkindex;
|
btl_proc->proc_addrs[i].addr_ifkindex = remote_addrs[i].addr_ifkindex;
|
||||||
@ -869,7 +869,7 @@ void mca_btl_tcp_proc_accept(mca_btl_tcp_proc_t* btl_proc, struct sockaddr* addr
|
|||||||
}
|
}
|
||||||
switch (addr->sa_family) {
|
switch (addr->sa_family) {
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
if( memcmp( &btl_endpoint->endpoint_addr->addr_inet,
|
if( memcmp( &btl_endpoint->endpoint_addr->addr_union.addr_inet,
|
||||||
&(((struct sockaddr_in*)addr)->sin_addr),
|
&(((struct sockaddr_in*)addr)->sin_addr),
|
||||||
sizeof(struct in_addr) ) ) {
|
sizeof(struct in_addr) ) ) {
|
||||||
char tmp[2][16];
|
char tmp[2][16];
|
||||||
@ -878,7 +878,7 @@ void mca_btl_tcp_proc_accept(mca_btl_tcp_proc_t* btl_proc, struct sockaddr* addr
|
|||||||
OPAL_NAME_PRINT(btl_proc->proc_opal->proc_name),
|
OPAL_NAME_PRINT(btl_proc->proc_opal->proc_name),
|
||||||
inet_ntop(AF_INET, (void*)&((struct sockaddr_in*)addr)->sin_addr,
|
inet_ntop(AF_INET, (void*)&((struct sockaddr_in*)addr)->sin_addr,
|
||||||
tmp[0], 16),
|
tmp[0], 16),
|
||||||
inet_ntop(AF_INET, (void*)(struct in_addr*)&btl_endpoint->endpoint_addr->addr_inet,
|
inet_ntop(AF_INET, (void*)(struct in_addr*)&btl_endpoint->endpoint_addr->addr_union.addr_inet,
|
||||||
tmp[1], 16),
|
tmp[1], 16),
|
||||||
(int)i, (int)btl_proc->proc_endpoint_count);
|
(int)i, (int)btl_proc->proc_endpoint_count);
|
||||||
continue;
|
continue;
|
||||||
@ -890,7 +890,7 @@ void mca_btl_tcp_proc_accept(mca_btl_tcp_proc_t* btl_proc, struct sockaddr* addr
|
|||||||
break;
|
break;
|
||||||
#if OPAL_ENABLE_IPV6
|
#if OPAL_ENABLE_IPV6
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
if( memcmp( &btl_endpoint->endpoint_addr->addr_inet,
|
if( memcmp( &btl_endpoint->endpoint_addr->addr_union.addr_inet,
|
||||||
&(((struct sockaddr_in6*)addr)->sin6_addr),
|
&(((struct sockaddr_in6*)addr)->sin6_addr),
|
||||||
sizeof(struct in6_addr) ) ) {
|
sizeof(struct in6_addr) ) ) {
|
||||||
char tmp[2][INET6_ADDRSTRLEN];
|
char tmp[2][INET6_ADDRSTRLEN];
|
||||||
@ -899,7 +899,7 @@ void mca_btl_tcp_proc_accept(mca_btl_tcp_proc_t* btl_proc, struct sockaddr* addr
|
|||||||
OPAL_NAME_PRINT(btl_proc->proc_opal->proc_name),
|
OPAL_NAME_PRINT(btl_proc->proc_opal->proc_name),
|
||||||
inet_ntop(AF_INET6, (void*)&((struct sockaddr_in6*)addr)->sin6_addr,
|
inet_ntop(AF_INET6, (void*)&((struct sockaddr_in6*)addr)->sin6_addr,
|
||||||
tmp[0], INET6_ADDRSTRLEN),
|
tmp[0], INET6_ADDRSTRLEN),
|
||||||
inet_ntop(AF_INET6, (void*)(struct in6_addr*)&btl_endpoint->endpoint_addr->addr_inet,
|
inet_ntop(AF_INET6, (void*)(struct in6_addr*)&btl_endpoint->endpoint_addr->addr_union.addr_inet,
|
||||||
tmp[1], INET6_ADDRSTRLEN),
|
tmp[1], INET6_ADDRSTRLEN),
|
||||||
(int)i, (int)btl_proc->proc_endpoint_count);
|
(int)i, (int)btl_proc->proc_endpoint_count);
|
||||||
continue;
|
continue;
|
||||||
@ -941,7 +941,7 @@ void mca_btl_tcp_proc_accept(mca_btl_tcp_proc_t* btl_proc, struct sockaddr* addr
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
inet_ntop(btl_endpoint->endpoint_addr->addr_family,
|
inet_ntop(btl_endpoint->endpoint_addr->addr_family,
|
||||||
(void*) &(btl_endpoint->endpoint_addr->addr_inet),
|
(void*) &(btl_endpoint->endpoint_addr->addr_union.addr_inet),
|
||||||
ip, sizeof(ip) - 1);
|
ip, sizeof(ip) - 1);
|
||||||
if (NULL == addr_str) {
|
if (NULL == addr_str) {
|
||||||
opal_asprintf(&tmp, "\n\t%s", ip);
|
opal_asprintf(&tmp, "\n\t%s", ip);
|
||||||
@ -978,7 +978,7 @@ bool mca_btl_tcp_proc_tosocks(mca_btl_tcp_addr_t* proc_addr,
|
|||||||
case AF_INET:
|
case AF_INET:
|
||||||
output->ss_family = AF_INET;
|
output->ss_family = AF_INET;
|
||||||
memcpy(&((struct sockaddr_in*)output)->sin_addr,
|
memcpy(&((struct sockaddr_in*)output)->sin_addr,
|
||||||
&proc_addr->addr_inet, sizeof(struct in_addr));
|
&proc_addr->addr_union.addr_inet, sizeof(struct in_addr));
|
||||||
((struct sockaddr_in*)output)->sin_port = proc_addr->addr_port;
|
((struct sockaddr_in*)output)->sin_port = proc_addr->addr_port;
|
||||||
break;
|
break;
|
||||||
#if OPAL_ENABLE_IPV6
|
#if OPAL_ENABLE_IPV6
|
||||||
@ -986,8 +986,8 @@ bool mca_btl_tcp_proc_tosocks(mca_btl_tcp_addr_t* proc_addr,
|
|||||||
{
|
{
|
||||||
struct sockaddr_in6* inaddr = (struct sockaddr_in6*)output;
|
struct sockaddr_in6* inaddr = (struct sockaddr_in6*)output;
|
||||||
output->ss_family = AF_INET6;
|
output->ss_family = AF_INET6;
|
||||||
memcpy(&inaddr->sin6_addr, &proc_addr->addr_inet,
|
memcpy(&inaddr->sin6_addr, &proc_addr->addr_union.addr_inet,
|
||||||
sizeof (proc_addr->addr_inet));
|
sizeof (proc_addr->addr_union.addr_inet));
|
||||||
inaddr->sin6_port = proc_addr->addr_port;
|
inaddr->sin6_port = proc_addr->addr_port;
|
||||||
inaddr->sin6_scope_id = 0;
|
inaddr->sin6_scope_id = 0;
|
||||||
inaddr->sin6_flowinfo = 0;
|
inaddr->sin6_flowinfo = 0;
|
||||||
|
@ -334,12 +334,20 @@ static int intercept_brk (void *addr)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define HAS_SHMDT (defined(SYS_shmdt) || \
|
#if defined(SYS_shmdt) || (defined(IPCOP_shmdt) && defined(SYS_ipc))
|
||||||
(defined(IPCOP_shmdt) && defined(SYS_ipc)))
|
#define HAS_SHMDT 1
|
||||||
#define HAS_SHMAT (defined(SYS_shmat) || \
|
#else
|
||||||
(defined(IPCOP_shmat) && defined(SYS_ipc)))
|
#define HAS_SHMDT 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#if (HAS_SHMDT || HAS_SHMAT) && defined(__linux__)
|
#if defined(SYS_shmat) ||(defined(IPCOP_shmat) && defined(SYS_ipc))
|
||||||
|
#define HAS_SHMAT 1
|
||||||
|
#else
|
||||||
|
#define HAS_SHMAT 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if HAS_SHMDT || HAS_SHMAT
|
||||||
|
#if defined(__linux__)
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@ -415,8 +423,10 @@ static size_t get_shm_size(int shmid)
|
|||||||
return ds.shm_segsz;
|
return ds.shm_segsz;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAS_SHMAT && defined(__linux__)
|
#if HAS_SHMAT
|
||||||
|
#if defined(__linux__)
|
||||||
static void *(*original_shmat)(int shmid, const void *shmaddr, int shmflg);
|
static void *(*original_shmat)(int shmid, const void *shmaddr, int shmflg);
|
||||||
|
|
||||||
static void *_intercept_shmat(int shmid, const void *shmaddr, int shmflg)
|
static void *_intercept_shmat(int shmid, const void *shmaddr, int shmflg)
|
||||||
@ -462,8 +472,10 @@ static void* intercept_shmat (int shmid, const void * shmaddr, int shmflg)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAS_SHMDT && defined(__linux__)
|
#if HAS_SHMDT
|
||||||
|
#if defined(__linux__)
|
||||||
static int (*original_shmdt) (const void *);
|
static int (*original_shmdt) (const void *);
|
||||||
|
|
||||||
static int _intercept_shmdt (const void *shmaddr)
|
static int _intercept_shmdt (const void *shmaddr)
|
||||||
@ -495,6 +507,7 @@ static int intercept_shmdt (const void *shmaddr)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
static int patcher_register (void)
|
static int patcher_register (void)
|
||||||
{
|
{
|
||||||
@ -570,19 +583,23 @@ static int patcher_open (void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_SHMAT && defined(__linux__)
|
#if HAS_SHMAT
|
||||||
|
#if defined(__linux__)
|
||||||
rc = opal_patcher->patch_symbol ("shmat", (uintptr_t) intercept_shmat, (uintptr_t *) &original_shmat);
|
rc = opal_patcher->patch_symbol ("shmat", (uintptr_t) intercept_shmat, (uintptr_t *) &original_shmat);
|
||||||
if (OPAL_SUCCESS != rc) {
|
if (OPAL_SUCCESS != rc) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAS_SHMDT && defined(__linux__)
|
#if defined(__linux__)
|
||||||
|
#if HAS_SHMDT
|
||||||
rc = opal_patcher->patch_symbol ("shmdt", (uintptr_t) intercept_shmdt, (uintptr_t *) &original_shmdt);
|
rc = opal_patcher->patch_symbol ("shmdt", (uintptr_t) intercept_shmdt, (uintptr_t *) &original_shmdt);
|
||||||
if (OPAL_SUCCESS != rc) {
|
if (OPAL_SUCCESS != rc) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined (SYS_brk)
|
#if defined (SYS_brk)
|
||||||
rc = opal_patcher->patch_symbol ("brk", (uintptr_t)intercept_brk, (uintptr_t *) &original_brk);
|
rc = opal_patcher->patch_symbol ("brk", (uintptr_t)intercept_brk, (uintptr_t *) &original_brk);
|
||||||
|
@ -52,13 +52,14 @@ int opal_malloc_debug_level = OPAL_MALLOC_DEBUG_LEVEL;
|
|||||||
int opal_malloc_output = -1;
|
int opal_malloc_output = -1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if OPAL_ENABLE_DEBUG
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Private variables
|
* Private variables
|
||||||
*/
|
*/
|
||||||
static opal_output_stream_t malloc_stream;
|
static opal_output_stream_t malloc_stream;
|
||||||
|
|
||||||
|
|
||||||
#if OPAL_ENABLE_DEBUG
|
|
||||||
/*
|
/*
|
||||||
* Finalize the malloc debug interface
|
* Finalize the malloc debug interface
|
||||||
*/
|
*/
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user