Skip to content

Commit df9745a

Browse files
authored
Merge pull request #7299 from awlauria/fix_warnings
Fix some compiler warnings.
2 parents 69bd54c + b65ec27 commit df9745a

File tree

10 files changed

+17
-19
lines changed

10 files changed

+17
-19
lines changed

ompi/communicator/comm_cid.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,8 @@ static int ompi_comm_allreduce_getnextcid (ompi_comm_request_t *request)
304304
ompi_comm_cid_context_t *context = (ompi_comm_cid_context_t *) request->context;
305305
int64_t my_id = ((int64_t) ompi_comm_get_cid (context->comm) << 32 | context->pml_tag);
306306
ompi_request_t *subreq;
307-
bool flag;
308-
int ret;
307+
bool flag = false;
308+
int ret = OMPI_SUCCESS;
309309
int participate = (context->newcomm->c_local_group->grp_my_rank != MPI_UNDEFINED);
310310

311311
if (OPAL_THREAD_TRYLOCK(&ompi_cid_lock)) {

ompi/mca/coll/base/coll_base_util.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ static int free_vecs_callback(struct ompi_request_t **rptr) {
255255
}
256256

257257
int ompi_coll_base_retain_datatypes_w( ompi_request_t *req,
258-
ompi_datatype_t *stypes[], ompi_datatype_t *rtypes[]) {
258+
ompi_datatype_t * const stypes[], ompi_datatype_t * const rtypes[]) {
259259
ompi_coll_base_nbc_request_t *request = (ompi_coll_base_nbc_request_t *)req;
260260
bool retain = false;
261261
ompi_communicator_t *comm = request->super.req_mpi_object.comm;
@@ -282,8 +282,8 @@ int ompi_coll_base_retain_datatypes_w( ompi_request_t *req,
282282
}
283283
}
284284
if (OPAL_UNLIKELY(retain)) {
285-
request->data.vecs.stypes = stypes;
286-
request->data.vecs.rtypes = rtypes;
285+
request->data.vecs.stypes = (ompi_datatype_t **) stypes;
286+
request->data.vecs.rtypes = (ompi_datatype_t **) rtypes;
287287
if (req->req_persistent) {
288288
request->cb.req_free = req->req_free;
289289
req->req_free = free_vecs_callback;

ompi/mca/coll/base/coll_base_util.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ int ompi_coll_base_retain_datatypes( ompi_request_t *request,
124124
ompi_datatype_t *rtype);
125125

126126
int ompi_coll_base_retain_datatypes_w( ompi_request_t *request,
127-
ompi_datatype_t *stypes[],
128-
ompi_datatype_t *rtypes[]);
127+
ompi_datatype_t * const stypes[],
128+
ompi_datatype_t * const rtypes[]);
129129

130130
END_C_DECLS
131131
#endif /* MCA_COLL_BASE_UTIL_EXPORT_H */

ompi/mca/coll/tuned/coll_tuned_decision_fixed.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,10 @@ int ompi_coll_tuned_scatter_intra_dec_fixed(const void *sbuf, int scount,
806806
root, comm, module);
807807
} else if ((communicator_size < ompi_coll_tuned_scatter_min_procs) &&
808808
(communicator_size > intermediate_comm_size) &&
809-
(block_size >= ompi_coll_tuned_scatter_intermediate_msg) &&
810-
(block_size < ompi_coll_tuned_scatter_large_msg)) {
809+
(ompi_coll_tuned_scatter_intermediate_msg > -1) &&
810+
(block_size >= (size_t) ompi_coll_tuned_scatter_intermediate_msg) &&
811+
(ompi_coll_tuned_scatter_large_msg > -1) &&
812+
(block_size < (size_t) ompi_coll_tuned_scatter_large_msg)) {
811813
return ompi_coll_base_scatter_intra_linear_nb(sbuf, scount, sdtype,
812814
rbuf, rcount, rdtype,
813815
root, comm, module,

ompi/mca/io/ompio/io_ompio_file_read.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,8 @@ int mca_io_ompio_file_iread_all (ompi_file_t *fh,
161161
{
162162
int ret = OMPI_SUCCESS;
163163
mca_common_ompio_data_t *data=NULL;
164-
ompio_file_t *fp=NULL;
165164

166165
data = (mca_common_ompio_data_t *) fh->f_io_selected_data;
167-
fp = &data->ompio_fh;
168166

169167
OPAL_THREAD_LOCK(&fh->f_lock);
170168
ret = mca_common_ompio_file_iread_all (&data->ompio_fh,

ompi/mca/io/ompio/io_ompio_file_write.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,8 @@ int mca_io_ompio_file_iwrite_all (ompi_file_t *fh,
185185
{
186186
int ret = OMPI_SUCCESS;
187187
mca_common_ompio_data_t *data=NULL;
188-
ompio_file_t *fp=NULL;
189188

190189
data = (mca_common_ompio_data_t *) fh->f_io_selected_data;
191-
fp = &data->ompio_fh;
192190

193191
OPAL_THREAD_LOCK(&fh->f_lock);
194192
ret = mca_common_ompio_file_iwrite_all (&data->ompio_fh,

ompi/mca/topo/treematch/treematch/tm_tree.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,7 +1769,6 @@ void group_nodes(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t *new
17691769
int mat_order = aff_mat -> order;
17701770
tm_tree_t **cur_group = NULL;
17711771
int j, l;
1772-
unsigned long int list_size;
17731772
unsigned long int i;
17741773
group_list_t list, **best_selection = NULL, **tab_group = NULL;
17751774
double best_val, last_best;
@@ -1829,8 +1828,7 @@ void group_nodes(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t *new
18291828
best_selection = (group_list_t **)MALLOC(sizeof(group_list_t*)*solution_size);
18301829

18311830
list_all_possible_groups(cost_mat, tab_node, 0, arity, 0, cur_group, &list);
1832-
list_size = (int)list.val;
1833-
assert( list_size == nb_groups);
1831+
assert( (int)list.val == nb_groups);
18341832
tab_group = (group_list_t**)MALLOC(sizeof(group_list_t*)*nb_groups);
18351833
list_to_tab(list.next, tab_group, nb_groups);
18361834
if(verbose_level>=INFO)

opal/class/opal_object.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ static inline opal_object_t *opal_obj_new_debug(opal_class_t* type, const char*
330330
OBJ_SET_MAGIC_ID((object), 0); \
331331
opal_obj_run_destructors((opal_object_t *) (object)); \
332332
OBJ_REMEMBER_FILE_AND_LINENO( object, __FILE__, __LINE__ ); \
333-
free(object); \
333+
free((void *) object); \
334334
object = NULL; \
335335
} \
336336
} while (0)
@@ -339,7 +339,7 @@ static inline opal_object_t *opal_obj_new_debug(opal_class_t* type, const char*
339339
do { \
340340
if (0 == opal_obj_update((opal_object_t *) (object), -1)) { \
341341
opal_obj_run_destructors((opal_object_t *) (object)); \
342-
free(object); \
342+
free((void *) object); \
343343
object = NULL; \
344344
} \
345345
} while (0)

opal/util/cmd_line.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ int opal_cmd_line_make_opt3(opal_cmd_line_t *cmd, char short_name,
237237

238238
e.ocl_description = desc;
239239

240+
e.ocl_otype = OPAL_CMD_LINE_TYPE_NULL;
241+
240242
return make_opt(cmd, &e);
241243
}
242244

orte/util/nidmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ int orte_util_decode_nidmap(opal_buffer_t *buf)
231231
orte_node_t *nd;
232232
orte_job_t *daemons;
233233
orte_proc_t *proc;
234-
orte_topology_t *t;
234+
orte_topology_t *t = NULL;
235235

236236
/* unpack the flag indicating if HNP is in allocation */
237237
cnt = 1;

0 commit comments

Comments
 (0)