Commit 3e99d380 authored by Darius Buntinas's avatar Darius Buntinas
Browse files

[svn-r3012] fixed some compiler warnings

parent 926432d3
......@@ -141,7 +141,7 @@ int MPI_Type_match_size(int typeclass, int size, MPI_Datatype *datatype)
int nComplexTypes = sizeof(complex_types) / sizeof(MPI_Datatype);
tname = "MPI_TYPECLASS_COMPLEX";
MPIR_Nest_incr();
for (i=0; i<sizeof(complex_types)/sizeof(MPI_Datatype); i++) {
for (i=0; i<nComplexTypes; i++) {
if (complex_types[i] == MPI_DATATYPE_NULL) { continue; }
NMPI_Type_size( complex_types[i], &tsize );
if (tsize == size) {
......
......@@ -240,7 +240,7 @@ int MPIR_Datatype_builtin_fillin(void)
dptr->contents = NULL; /* should never get referenced? */
}
/* --BEGIN ERROR HANDLING-- */
if (d != -1 && mpi_dtypes[i] != -1) {
if (d != -1 && i < sizeof(mpi_dtypes)/sizeof(*mpi_dtypes) && mpi_dtypes[i] != -1) {
/* We did not hit the end-of-list */
/*MPIU_Internal_error_printf( "Did not initialize all of the predefined datatypes (only did first %d)\n", i-1 );*/
MPIU_Snprintf(error_msg, 1024,
......
......@@ -51,8 +51,10 @@
int MPI_File_call_errhandler(MPI_File fh, int errorcode)
{
int mpi_errno = MPI_SUCCESS;
#ifdef MPI_MODE_RDONLY
MPID_Errhandler *e;
MPI_Errhandler eh;
#endif
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_FILE_CALL_ERRHANDLER);
......
......@@ -54,8 +54,10 @@ int MPI_File_get_errhandler(MPI_File file, MPI_Errhandler *errhandler)
static const char FCNAME[] = "MPI_File_get_errhandler";
#endif
int mpi_errno = MPI_SUCCESS;
#ifdef MPI_MODE_RDONLY
MPI_Errhandler eh;
MPID_Errhandler *e;
#endif
MPID_MPI_STATE_DECL(MPID_STATE_MPI_FILE_GET_ERRHANDLER);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......@@ -94,6 +96,7 @@ int MPI_File_get_errhandler(MPI_File file, MPI_Errhandler *errhandler)
#else
/* Dummy in case ROMIO is not defined */
mpi_errno = MPI_ERR_INTERN;
if (0) goto fn_fail; /* quiet compiler warning about unused label */
#endif
/* ... end of body of routine ... */
......
......@@ -52,9 +52,11 @@ int MPI_File_set_errhandler(MPI_File file, MPI_Errhandler errhandler)
static const char FCNAME[] = "MPI_File_set_errhandler";
#endif
int mpi_errno = MPI_SUCCESS;
#ifdef MPI_MODE_RDONLY
int in_use;
MPID_Errhandler *errhan_ptr = NULL, *old_errhandler_ptr;
MPI_Errhandler old_errhandler;
#endif
MPID_MPI_STATE_DECL(MPID_STATE_MPI_FILE_SET_ERRHANDLER);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......@@ -123,6 +125,7 @@ int MPI_File_set_errhandler(MPI_File file, MPI_Errhandler errhandler)
#else
/* Dummy in case ROMIO is not defined */
mpi_errno = MPI_ERR_INTERN;
if (0) goto fn_fail; /* quiet compiler warning about unused label */
#endif
/* ... end of body of routine ... */
......
......@@ -562,11 +562,9 @@ fn_exit:
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPIR_Grequest_waitall(int count, MPID_Request * const * request_ptrs)
{
MPIX_Grequest_wait_function *wait_fn = NULL;
void ** state_ptrs;
int i, n_greq;
int i;
int mpi_error = MPI_SUCCESS;
MPIX_Grequest_class curr_class;
MPIU_CHKLMEM_DECL(1);
MPIU_CHKLMEM_MALLOC(state_ptrs, void *, sizeof(void*)*count, mpi_error, "state_ptrs");
......@@ -581,6 +579,9 @@ int MPIR_Grequest_waitall(int count, MPID_Request * const * request_ptrs)
Until a waitall_fn is added for greqs, we'll call wait on
each greq individually. */
#if 0
MPIX_Grequest_wait_function *wait_fn = NULL;
int n_greq;
MPIX_Grequest_class curr_class;
/* loop over all requests, group greqs with the same class and
call wait_fn on the groups. (Only consecutive greqs with the
same class are being grouped) */
......
......@@ -413,7 +413,8 @@ static int send_id_info(const sockconn_t *const sc)
MPIDI_FUNC_ENTER(MPID_STATE_SEND_ID_INFO);
MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "my_pg->id=%s my_pg->rank=%d, sc->pg_rank=%d sc->is_same_pg=%s",
MPIDI_Process.my_pg->id, MPIDI_Process.my_pg_rank, sc->pg_rank, (sc->is_same_pg ? "TRUE" : "FALSE")));
(char *)MPIDI_Process.my_pg->id, MPIDI_Process.my_pg_rank, sc->pg_rank,
(sc->is_same_pg ? "TRUE" : "FALSE")));
if (!sc->is_same_pg)
pg_id_len = strlen(MPIDI_Process.my_pg->id) + 1;
......
......@@ -6,9 +6,6 @@
#include "mpid_nem_impl.h"
#include "mpid_nem_datatypes.h"
#include <sys/ipc.h>
#include <sys/shm.h>
#include <errno.h>
#ifdef ENABLE_NO_SCHED_YIELD
#define SCHED_YIELD() do { } while(0)
......
......@@ -29,7 +29,7 @@ int MPID_nem_choose_netmod(void)
{
/* netmod not specified, using the default */
MPID_nem_netmod_func = MPID_nem_netmod_funcs[0];
MPID_nem_netmod_id = i;
MPID_nem_netmod_id = 0;
goto fn_exit;
}
......
......@@ -97,6 +97,7 @@ int MPIDI_CH3U_Handle_connection(MPIDI_VC_t * vc, MPIDI_VC_Event_t event)
MPI_SUCCESS, MPIR_ERR_FATAL, FCNAME, __LINE__,
MPI_ERR_INTERN, "**ch3|unhandled_connection_state",
"**ch3|unhandled_connection_state %p %d", vc, event);
goto fn_fail;
break;
}
}
......
......@@ -350,7 +350,6 @@ static int create_datatype(const MPIDI_RMA_dtype_info *dtype_info,
int *blocklens = &ints[1];
MPI_Aint displaces[3];
MPI_Datatype datatypes[3];
int i;
const int count = 3;
MPI_Datatype combined_datatype;
MPIDI_STATE_DECL(MPID_STATE_CREATE_DATATYPE);
......@@ -427,7 +426,7 @@ static int MPIDI_CH3I_Send_rma_msg(MPIDI_RMA_ops *rma_op, MPID_Win *win_ptr,
MPIDI_CH3_Pkt_accum_t *accum_pkt = &upkt.accum;
MPID_IOV iov[MPID_IOV_LIMIT];
int mpi_errno=MPI_SUCCESS, predefined;
int origin_dt_derived, target_dt_derived, origin_type_size, iovcnt, iov_n;
int origin_dt_derived, target_dt_derived, origin_type_size, iovcnt;
MPIDI_VC_t * vc;
MPID_Comm *comm_ptr;
MPID_Datatype *target_dtp=NULL, *origin_dtp=NULL;
......@@ -1793,7 +1792,7 @@ static int MPIDI_CH3I_Do_passive_target_rma(MPID_Win *win_ptr,
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static int MPIDI_CH3I_Send_lock_put_or_acc(MPID_Win *win_ptr)
{
int mpi_errno=MPI_SUCCESS, lock_type, origin_dt_derived, iov_n, iovcnt;
int mpi_errno=MPI_SUCCESS, lock_type, origin_dt_derived, iovcnt;
MPIDI_RMA_ops *rma_op;
MPID_Request *request=NULL;
MPIDI_VC_t * vc;
......
......@@ -135,10 +135,8 @@ int MPID_VCRT_Release(MPID_VCRT vcrt, int isDisconnect )
/* FIXME: Need a better way to define how vc's are closed that
takes into account pending operations on vcs, including
close events received from other processes. */
/*
mpi_errno = MPIDI_CH3U_VC_FinishPending( vcrt );
if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
*/
/* mpi_errno = MPIDI_CH3U_VC_FinishPending( vcrt ); */
if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
for (i = 0; i < vcrt->size; i++)
{
......
......@@ -280,7 +280,7 @@ int MPIDI_PG_Destroy(MPIDI_PG_t * pg)
else
pg_prev->next = pg->next;
MPIU_DBG_MSG_FMT(CH3_DISCONNECT, VERBOSE, (MPIU_DBG_FDEST, "destroying pg=%p pg->id=%s", pg, pg->id));
MPIU_DBG_MSG_FMT(CH3_DISCONNECT, VERBOSE, (MPIU_DBG_FDEST, "destroying pg=%p pg->id=%s", pg, (char *)pg->id));
for (i = 0; i < pg->size; ++i) {
/* FIXME it would be good if we could make this assertion.
......
......@@ -509,9 +509,9 @@ void MPIDI_Datatype_contents_printf(MPI_Datatype type,
MPID_Datatype *dtp;
MPID_Datatype_contents *cp;
MPI_Aint *aints;
MPI_Datatype *types;
int *ints;
MPI_Aint *aints = NULL;
MPI_Datatype *types = NULL;
int *ints = NULL;
if (HANDLE_GET_KIND(type) == HANDLE_KIND_BUILTIN) {
MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,"# %stype: %s\n",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment