Skip to content

Commit 9b14337

Browse files
committed
Merge pull request open-mpi#600 from ggouaillardet/topic/v2.x/no_cast_away_const
Topic/v2.x/no cast away const
2 parents 3e54a95 + f0091c9 commit 9b14337

File tree

267 files changed

+1435
-1141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

267 files changed

+1435
-1141
lines changed

ompi/datatype/ompi_datatype.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
88
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
99
* reserved.
10+
* Copyright (c) 2015 Research Organization for Information Science
11+
* and Technology (RIST). All rights reserved.
1012
* $COPYRIGHT$
1113
*
1214
* Additional copyrights may follow
@@ -283,7 +285,7 @@ OMPI_DECLSPEC const ompi_datatype_t* ompi_datatype_match_size( int size, uint16_
283285
/*
284286
*
285287
*/
286-
OMPI_DECLSPEC int32_t ompi_datatype_sndrcv( void *sbuf, int32_t scount, const ompi_datatype_t* sdtype,
288+
OMPI_DECLSPEC int32_t ompi_datatype_sndrcv( const void *sbuf, int32_t scount, const ompi_datatype_t* sdtype,
287289
void *rbuf, int32_t rcount, const ompi_datatype_t* rdtype);
288290

289291
/*

ompi/datatype/ompi_datatype_sndrcv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Copyright (c) 2004-2006 The Regents of the University of California.
1212
* All rights reserved.
1313
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
14-
* Copyright (c) 2014 Research Organization for Information Science
14+
* Copyright (c) 2014-2015 Research Organization for Information Science
1515
* and Technology (RIST). All rights reserved.
1616
* $COPYRIGHT$
1717
*
@@ -42,7 +42,7 @@
4242
* - communicator
4343
* Returns: - MPI_SUCCESS or error code
4444
*/
45-
int32_t ompi_datatype_sndrcv( void *sbuf, int32_t scount, const ompi_datatype_t* sdtype,
45+
int32_t ompi_datatype_sndrcv( const void *sbuf, int32_t scount, const ompi_datatype_t* sdtype,
4646
void *rbuf, int32_t rcount, const ompi_datatype_t* rdtype)
4747
{
4848
opal_convertor_t send_convertor, recv_convertor;

ompi/file/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ int ompi_file_init(void)
9191
/*
9292
* Back end to MPI_FILE_OPEN
9393
*/
94-
int ompi_file_open(struct ompi_communicator_t *comm, char *filename,
94+
int ompi_file_open(struct ompi_communicator_t *comm, const char *filename,
9595
int amode, struct ompi_info_t *info, ompi_file_t **fh)
9696
{
9797
int ret;

ompi/file/file.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
* All rights reserved.
1313
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
1414
* Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
15+
* Copyright (c) 2015 Research Organization for Information Science
16+
* and Technology (RIST). All rights reserved.
1517
* $COPYRIGHT$
1618
*
1719
* Additional copyrights may follow
@@ -145,7 +147,7 @@ int ompi_file_init(void);
145147
* mainly calls OBJ_RELEASE() but also does some other error
146148
* handling as well.
147149
*/
148-
int ompi_file_open(struct ompi_communicator_t *comm, char *filename,
150+
int ompi_file_open(struct ompi_communicator_t *comm, const char *filename,
149151
int amode, struct ompi_info_t *info,
150152
ompi_file_t **fh);
151153

ompi/mca/coll/base/coll_base_allgather.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Copyright (c) 2009 University of Houston. All rights reserved.
1313
* Copyright (c) 2013 Los Alamos National Security, LLC. All Rights
1414
* reserved.
15-
* Copyright (c) 2014 Research Organization for Information Science
15+
* Copyright (c) 2014-2015 Research Organization for Information Science
1616
* and Technology (RIST). All rights reserved.
1717
* $COPYRIGHT$
1818
*
@@ -82,7 +82,7 @@
8282
* [4] [4] [4] [4] [4] [4]
8383
* [5] [5] [5] [5] [5] [5]
8484
*/
85-
int ompi_coll_base_allgather_intra_bruck(void *sbuf, int scount,
85+
int ompi_coll_base_allgather_intra_bruck(const void *sbuf, int scount,
8686
struct ompi_datatype_t *sdtype,
8787
void* rbuf, int rcount,
8888
struct ompi_datatype_t *rdtype,
@@ -255,7 +255,7 @@ int ompi_coll_base_allgather_intra_bruck(void *sbuf, int scount,
255255
* step, and send them appropriate messages.
256256
*/
257257
int
258-
ompi_coll_base_allgather_intra_recursivedoubling(void *sbuf, int scount,
258+
ompi_coll_base_allgather_intra_recursivedoubling(const void *sbuf, int scount,
259259
struct ompi_datatype_t *sdtype,
260260
void* rbuf, int rcount,
261261
struct ompi_datatype_t *rdtype,
@@ -362,7 +362,7 @@ ompi_coll_base_allgather_intra_recursivedoubling(void *sbuf, int scount,
362362
* No additional memory requirements.
363363
*
364364
*/
365-
int ompi_coll_base_allgather_intra_ring(void *sbuf, int scount,
365+
int ompi_coll_base_allgather_intra_ring(const void *sbuf, int scount,
366366
struct ompi_datatype_t *sdtype,
367367
void* rbuf, int rcount,
368368
struct ompi_datatype_t *rdtype,
@@ -490,7 +490,7 @@ int ompi_coll_base_allgather_intra_ring(void *sbuf, int scount,
490490
* [5] [5] [5] [5] [5] [5]
491491
*/
492492
int
493-
ompi_coll_base_allgather_intra_neighborexchange(void *sbuf, int scount,
493+
ompi_coll_base_allgather_intra_neighborexchange(const void *sbuf, int scount,
494494
struct ompi_datatype_t *sdtype,
495495
void* rbuf, int rcount,
496496
struct ompi_datatype_t *rdtype,
@@ -606,7 +606,7 @@ ompi_coll_base_allgather_intra_neighborexchange(void *sbuf, int scount,
606606
}
607607

608608

609-
int ompi_coll_base_allgather_intra_two_procs(void *sbuf, int scount,
609+
int ompi_coll_base_allgather_intra_two_procs(const void *sbuf, int scount,
610610
struct ompi_datatype_t *sdtype,
611611
void* rbuf, int rcount,
612612
struct ompi_datatype_t *rdtype,
@@ -687,7 +687,7 @@ int ompi_coll_base_allgather_intra_two_procs(void *sbuf, int scount,
687687
* Returns: - MPI_SUCCESS or error code
688688
*/
689689
int
690-
ompi_coll_base_allgather_intra_basic_linear(void *sbuf, int scount,
690+
ompi_coll_base_allgather_intra_basic_linear(const void *sbuf, int scount,
691691
struct ompi_datatype_t *sdtype,
692692
void *rbuf,
693693
int rcount,

ompi/mca/coll/base/coll_base_allgatherv.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ mca_base_var_enum_value_t coll_base_allgatherv_algorithms[] = {
100100
* [5] [5] [5] [5] [5] [5] [5]
101101
* [6] [6] [6] [6] [6] [6] [6]
102102
*/
103-
int ompi_coll_base_allgatherv_intra_bruck(void *sbuf, int scount,
103+
int ompi_coll_base_allgatherv_intra_bruck(const void *sbuf, int scount,
104104
struct ompi_datatype_t *sdtype,
105-
void *rbuf, int *rcounts,
106-
int *rdispls,
105+
void *rbuf, const int *rcounts,
106+
const int *rdispls,
107107
struct ompi_datatype_t *rdtype,
108108
struct ompi_communicator_t *comm,
109109
mca_coll_base_module_t *module)
@@ -230,9 +230,9 @@ int ompi_coll_base_allgatherv_intra_bruck(void *sbuf, int scount,
230230
* No additional memory requirements.
231231
*
232232
*/
233-
int ompi_coll_base_allgatherv_intra_ring(void *sbuf, int scount,
233+
int ompi_coll_base_allgatherv_intra_ring(const void *sbuf, int scount,
234234
struct ompi_datatype_t *sdtype,
235-
void* rbuf, int *rcounts, int *rdisps,
235+
void* rbuf, const int *rcounts, const int *rdisps,
236236
struct ompi_datatype_t *rdtype,
237237
struct ompi_communicator_t *comm,
238238
mca_coll_base_module_t *module)
@@ -359,9 +359,9 @@ int ompi_coll_base_allgatherv_intra_ring(void *sbuf, int scount,
359359
* [5] [5] [5] [5] [5] [5]
360360
*/
361361
int
362-
ompi_coll_base_allgatherv_intra_neighborexchange(void *sbuf, int scount,
362+
ompi_coll_base_allgatherv_intra_neighborexchange(const void *sbuf, int scount,
363363
struct ompi_datatype_t *sdtype,
364-
void* rbuf, int *rcounts, int *rdispls,
364+
void* rbuf, const int *rcounts, const int *rdispls,
365365
struct ompi_datatype_t *rdtype,
366366
struct ompi_communicator_t *comm,
367367
mca_coll_base_module_t *module)
@@ -506,10 +506,10 @@ ompi_coll_base_allgatherv_intra_neighborexchange(void *sbuf, int scount,
506506
}
507507

508508

509-
int ompi_coll_base_allgatherv_intra_two_procs(void *sbuf, int scount,
509+
int ompi_coll_base_allgatherv_intra_two_procs(const void *sbuf, int scount,
510510
struct ompi_datatype_t *sdtype,
511-
void* rbuf, int *rcounts,
512-
int *rdispls,
511+
void* rbuf, const int *rcounts,
512+
const int *rdispls,
513513
struct ompi_datatype_t *rdtype,
514514
struct ompi_communicator_t *comm,
515515
mca_coll_base_module_t *module)
@@ -590,10 +590,10 @@ int ompi_coll_base_allgatherv_intra_two_procs(void *sbuf, int scount,
590590
* Returns: - MPI_SUCCESS or error code
591591
*/
592592
int
593-
ompi_coll_base_allgatherv_intra_basic_default(void *sbuf, int scount,
593+
ompi_coll_base_allgatherv_intra_basic_default(const void *sbuf, int scount,
594594
struct ompi_datatype_t *sdtype,
595-
void *rbuf, int *rcounts,
596-
int *disps,
595+
void *rbuf, const int *rcounts,
596+
const int *disps,
597597
struct ompi_datatype_t *rdtype,
598598
struct ompi_communicator_t *comm,
599599
mca_coll_base_module_t *module)

ompi/mca/coll/base/coll_base_allreduce.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* Copyright (c) 2009 University of Houston. All rights reserved.
1414
* Copyright (c) 2013 Los Alamos National Security, LLC. All Rights
1515
* reserved.
16+
* Copyright (c) 2015 Research Organization for Information Science
17+
* and Technology (RIST). All rights reserved.
1618
* $COPYRIGHT$
1719
*
1820
* Additional copyrights may follow
@@ -47,7 +49,7 @@
4749
*
4850
*/
4951
int
50-
ompi_coll_base_allreduce_intra_nonoverlapping(void *sbuf, void *rbuf, int count,
52+
ompi_coll_base_allreduce_intra_nonoverlapping(const void *sbuf, void *rbuf, int count,
5153
struct ompi_datatype_t *dtype,
5254
struct ompi_op_t *op,
5355
struct ompi_communicator_t *comm,
@@ -123,7 +125,7 @@ ompi_coll_base_allreduce_intra_nonoverlapping(void *sbuf, void *rbuf, int count,
123125
*
124126
*/
125127
int
126-
ompi_coll_base_allreduce_intra_recursivedoubling(void *sbuf, void *rbuf,
128+
ompi_coll_base_allreduce_intra_recursivedoubling(const void *sbuf, void *rbuf,
127129
int count,
128130
struct ompi_datatype_t *dtype,
129131
struct ompi_op_t *op,
@@ -340,7 +342,7 @@ ompi_coll_base_allreduce_intra_recursivedoubling(void *sbuf, void *rbuf,
340342
*
341343
*/
342344
int
343-
ompi_coll_base_allreduce_intra_ring(void *sbuf, void *rbuf, int count,
345+
ompi_coll_base_allreduce_intra_ring(const void *sbuf, void *rbuf, int count,
344346
struct ompi_datatype_t *dtype,
345347
struct ompi_op_t *op,
346348
struct ompi_communicator_t *comm,
@@ -615,7 +617,7 @@ ompi_coll_base_allreduce_intra_ring(void *sbuf, void *rbuf, int count,
615617
*
616618
*/
617619
int
618-
ompi_coll_base_allreduce_intra_ring_segmented(void *sbuf, void *rbuf, int count,
620+
ompi_coll_base_allreduce_intra_ring_segmented(const void *sbuf, void *rbuf, int count,
619621
struct ompi_datatype_t *dtype,
620622
struct ompi_op_t *op,
621623
struct ompi_communicator_t *comm,
@@ -877,7 +879,7 @@ ompi_coll_base_allreduce_intra_ring_segmented(void *sbuf, void *rbuf, int count,
877879
* Returns: - MPI_SUCCESS or error code
878880
*/
879881
int
880-
ompi_coll_base_allreduce_intra_basic_linear(void *sbuf, void *rbuf, int count,
882+
ompi_coll_base_allreduce_intra_basic_linear(const void *sbuf, void *rbuf, int count,
881883
struct ompi_datatype_t *dtype,
882884
struct ompi_op_t *op,
883885
struct ompi_communicator_t *comm,

ompi/mca/coll/base/coll_base_alltoall.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
/* MPI_IN_PLACE all to all algorithm. TODO: implement a better one. */
3838
int
39-
mca_coll_base_alltoall_intra_basic_inplace(void *rbuf, int rcount,
39+
mca_coll_base_alltoall_intra_basic_inplace(const void *rbuf, int rcount,
4040
struct ompi_datatype_t *rdtype,
4141
struct ompi_communicator_t *comm,
4242
mca_coll_base_module_t *module)
@@ -123,7 +123,7 @@ mca_coll_base_alltoall_intra_basic_inplace(void *rbuf, int rcount,
123123
return err;
124124
}
125125

126-
int ompi_coll_base_alltoall_intra_pairwise(void *sbuf, int scount,
126+
int ompi_coll_base_alltoall_intra_pairwise(const void *sbuf, int scount,
127127
struct ompi_datatype_t *sdtype,
128128
void* rbuf, int rcount,
129129
struct ompi_datatype_t *rdtype,
@@ -181,7 +181,7 @@ int ompi_coll_base_alltoall_intra_pairwise(void *sbuf, int scount,
181181
}
182182

183183

184-
int ompi_coll_base_alltoall_intra_bruck(void *sbuf, int scount,
184+
int ompi_coll_base_alltoall_intra_bruck(const void *sbuf, int scount,
185185
struct ompi_datatype_t *sdtype,
186186
void* rbuf, int rcount,
187187
struct ompi_datatype_t *rdtype,
@@ -324,7 +324,7 @@ int ompi_coll_base_alltoall_intra_bruck(void *sbuf, int scount,
324324
* - wait for any request to complete
325325
* - replace that request by the new one of the same type.
326326
*/
327-
int ompi_coll_base_alltoall_intra_linear_sync(void *sbuf, int scount,
327+
int ompi_coll_base_alltoall_intra_linear_sync(const void *sbuf, int scount,
328328
struct ompi_datatype_t *sdtype,
329329
void* rbuf, int rcount,
330330
struct ompi_datatype_t *rdtype,
@@ -471,7 +471,7 @@ int ompi_coll_base_alltoall_intra_linear_sync(void *sbuf, int scount,
471471
}
472472

473473

474-
int ompi_coll_base_alltoall_intra_two_procs(void *sbuf, int scount,
474+
int ompi_coll_base_alltoall_intra_two_procs(const void *sbuf, int scount,
475475
struct ompi_datatype_t *sdtype,
476476
void* rbuf, int rcount,
477477
struct ompi_datatype_t *rdtype,
@@ -545,7 +545,7 @@ int ompi_coll_base_alltoall_intra_two_procs(void *sbuf, int scount,
545545

546546
/* copied function (with appropriate renaming) starts here */
547547

548-
int ompi_coll_base_alltoall_intra_basic_linear(void *sbuf, int scount,
548+
int ompi_coll_base_alltoall_intra_basic_linear(const void *sbuf, int scount,
549549
struct ompi_datatype_t *sdtype,
550550
void* rbuf, int rcount,
551551
struct ompi_datatype_t *rdtype,

ompi/mca/coll/base/coll_base_alltoallv.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Copyright (c) 2013 Los Alamos National Security, LLC. All Rights
1515
* reserved.
1616
* Copyright (c) 2013 FUJITSU LIMITED. All rights reserved.
17-
* Copyright (c) 2014 Research Organization for Information Science
17+
* Copyright (c) 2014-2015 Research Organization for Information Science
1818
* and Technology (RIST). All rights reserved.
1919
* $COPYRIGHT$
2020
*
@@ -37,7 +37,7 @@
3737
#include "coll_base_util.h"
3838

3939
int
40-
mca_coll_base_alltoallv_intra_basic_inplace(void *rbuf, const int *rcounts, const int *rdisps,
40+
mca_coll_base_alltoallv_intra_basic_inplace(const void *rbuf, const int *rcounts, const int *rdisps,
4141
struct ompi_datatype_t *rdtype,
4242
struct ompi_communicator_t *comm,
4343
mca_coll_base_module_t *module)
@@ -130,9 +130,9 @@ mca_coll_base_alltoallv_intra_basic_inplace(void *rbuf, const int *rcounts, cons
130130
}
131131

132132
int
133-
ompi_coll_base_alltoallv_intra_pairwise(void *sbuf, int *scounts, int *sdisps,
133+
ompi_coll_base_alltoallv_intra_pairwise(const void *sbuf, const int *scounts, const int *sdisps,
134134
struct ompi_datatype_t *sdtype,
135-
void* rbuf, int *rcounts, int *rdisps,
135+
void* rbuf, const int *rcounts, const int *rdisps,
136136
struct ompi_datatype_t *rdtype,
137137
struct ompi_communicator_t *comm,
138138
mca_coll_base_module_t *module)
@@ -193,9 +193,9 @@ ompi_coll_base_alltoallv_intra_pairwise(void *sbuf, int *scounts, int *sdisps,
193193
* differently and so will not have to duplicate code.
194194
*/
195195
int
196-
ompi_coll_base_alltoallv_intra_basic_linear(void *sbuf, int *scounts, int *sdisps,
196+
ompi_coll_base_alltoallv_intra_basic_linear(const void *sbuf, const int *scounts, const int *sdisps,
197197
struct ompi_datatype_t *sdtype,
198-
void *rbuf, int *rcounts, int *rdisps,
198+
void *rbuf, const int *rcounts, const int *rdisps,
199199
struct ompi_datatype_t *rdtype,
200200
struct ompi_communicator_t *comm,
201201
mca_coll_base_module_t *module)

0 commit comments

Comments
 (0)