1
1

Merge pull request #6993 from awlauria/fix_warnings_master

Fix miscellaneous compiler warnings.
Этот коммит содержится в:
Geoff Paulsen 2019-10-09 09:17:02 -05:00 коммит произвёл GitHub
родитель 096da7b3b5 0d4004cc3c
Коммит 4e1e6f8972
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 50 добавлений и 31 удалений

Просмотреть файл

@ -247,9 +247,7 @@ static long int init_mat_mmap(char *filename,int N, double **mat, double *sum_ro
return nnz;
}
#ifdef __MACH__
static long int init_mat_long(char *filename,int N, double **mat, double *sum_row){
int i;
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);
return nnz;
}
#endif
tm_affinity_mat_t * new_affinity_mat(double **mat, double *sum_row, int order, long int nnz){
tm_affinity_mat_t * aff_mat;

Просмотреть файл

@ -41,7 +41,7 @@ opal_convertor_merge_iov( struct iovec* iov, uint32_t* iov_count,
uint32_t* idx )
{
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 */
return 0;
} /* cannot merge, move to the next position */

Просмотреть файл

@ -89,13 +89,14 @@ struct bit80 {
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)
{
#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)) {
#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;
struct bit128 * b = (struct bit128 *)to;
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
} else if (!(opal_local_arch&OPAL_ARCH_LDISINTEL) && (remoteArch&OPAL_ARCH_LDISINTEL)) {
#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;
struct bit80 * b = (struct bit80 *)to;
ld.ieee.mantissa3 = 0;

Просмотреть файл

@ -68,7 +68,7 @@ struct mca_btl_tcp_addr_t {
#if OPAL_ENABLE_IPV6
struct in6_addr addr_inet6; /* IPv6 listen address */
#endif
};
} addr_union;
in_port_t addr_port; /**< listen port */
int addr_ifkindex; /**< remote interface index assigned with
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 */
for (i = 0 ; i < btl_proc->proc_addr_count ; i++) {
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));
btl_proc->proc_addrs[i].addr_port = remote_addrs[i].addr_port;
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;
} else if (MCA_BTL_TCP_AF_INET6 == remote_addrs[i].addr_family) {
#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));
btl_proc->proc_addrs[i].addr_port = remote_addrs[i].addr_port;
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) {
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),
sizeof(struct in_addr) ) ) {
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),
inet_ntop(AF_INET, (void*)&((struct sockaddr_in*)addr)->sin_addr,
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),
(int)i, (int)btl_proc->proc_endpoint_count);
continue;
@ -890,7 +890,7 @@ void mca_btl_tcp_proc_accept(mca_btl_tcp_proc_t* btl_proc, struct sockaddr* addr
break;
#if OPAL_ENABLE_IPV6
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),
sizeof(struct in6_addr) ) ) {
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),
inet_ntop(AF_INET6, (void*)&((struct sockaddr_in6*)addr)->sin6_addr,
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),
(int)i, (int)btl_proc->proc_endpoint_count);
continue;
@ -941,7 +941,7 @@ void mca_btl_tcp_proc_accept(mca_btl_tcp_proc_t* btl_proc, struct sockaddr* addr
continue;
}
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);
if (NULL == addr_str) {
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:
output->ss_family = AF_INET;
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;
break;
#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;
output->ss_family = AF_INET6;
memcpy(&inaddr->sin6_addr, &proc_addr->addr_inet,
sizeof (proc_addr->addr_inet));
memcpy(&inaddr->sin6_addr, &proc_addr->addr_union.addr_inet,
sizeof (proc_addr->addr_union.addr_inet));
inaddr->sin6_port = proc_addr->addr_port;
inaddr->sin6_scope_id = 0;
inaddr->sin6_flowinfo = 0;

Просмотреть файл

@ -334,12 +334,20 @@ static int intercept_brk (void *addr)
#endif
#define HAS_SHMDT (defined(SYS_shmdt) || \
(defined(IPCOP_shmdt) && defined(SYS_ipc)))
#define HAS_SHMAT (defined(SYS_shmat) || \
(defined(IPCOP_shmat) && defined(SYS_ipc)))
#if defined(SYS_shmdt) || (defined(IPCOP_shmdt) && defined(SYS_ipc))
#define HAS_SHMDT 1
#else
#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 <fcntl.h>
@ -415,8 +423,10 @@ static size_t get_shm_size(int shmid)
return ds.shm_segsz;
}
#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 *_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;
}
#endif
#endif
#if HAS_SHMDT && defined(__linux__)
#if HAS_SHMDT
#if defined(__linux__)
static int (*original_shmdt) (const void *);
static int _intercept_shmdt (const void *shmaddr)
@ -495,6 +507,7 @@ static int intercept_shmdt (const void *shmaddr)
return result;
}
#endif
#endif
static int patcher_register (void)
{
@ -570,19 +583,23 @@ static int patcher_open (void)
}
#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);
if (OPAL_SUCCESS != rc) {
return rc;
}
#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);
if (OPAL_SUCCESS != rc) {
return rc;
}
#endif
#endif
#if defined (SYS_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;
#if OPAL_ENABLE_DEBUG
/*
* Private variables
*/
static opal_output_stream_t malloc_stream;
#if OPAL_ENABLE_DEBUG
/*
* Finalize the malloc debug interface
*/