Skip to content

Commit 16661ad

Browse files
committed
io: do not cast way the const modifier when this is not necessary
update the io framework and mpi c bindings (back-ported from commit open-mpi/ompi@fe351f6)
1 parent a1c8774 commit 16661ad

Some content is hidden

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

68 files changed

+431
-320
lines changed

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/fcoll/dynamic/fcoll_dynamic.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
1212
* Copyright (c) 2008-2014 University of Houston. All rights reserved.
13+
* Copyright (c) 2015 Research Organization for Information Science
14+
* and Technology (RIST). All rights reserved.
1315
* $COPYRIGHT$
1416
*
1517
* Additional copyrights may follow
@@ -56,7 +58,7 @@ int mca_fcoll_dynamic_file_read_all (mca_io_ompio_file_t *fh,
5658

5759

5860
int mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh,
59-
void *buf,
61+
const void *buf,
6062
int count,
6163
struct ompi_datatype_t *datatype,
6264
ompi_status_public_t * status);

ompi/mca/fcoll/dynamic/fcoll_dynamic_file_write_all.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
1212
* Copyright (c) 2008-2015 University of Houston. All rights reserved.
13+
* Copyright (c) 2015 Research Organization for Information Science
14+
* and Technology (RIST). All rights reserved.
1315
* $COPYRIGHT$
1416
*
1517
* Additional copyrights may follow
@@ -48,7 +50,7 @@ static int local_heap_sort (mca_io_ompio_local_io_array *io_array,
4850

4951
int
5052
mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh,
51-
void *buf,
53+
const void *buf,
5254
int count,
5355
struct ompi_datatype_t *datatype,
5456
ompi_status_public_t *status)

ompi/mca/fcoll/fcoll.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* Copyright (c) 2008-2015 University of Houston. All rights reserved.
1414
* Copyright (c) 2015 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
@@ -126,14 +128,14 @@ typedef int (*mca_fcoll_base_module_file_iread_all_fn_t)
126128

127129
typedef int (*mca_fcoll_base_module_file_write_all_fn_t)
128130
(struct mca_io_ompio_file_t *fh,
129-
void *buf,
131+
const void *buf,
130132
int count,
131133
struct ompi_datatype_t *datatype,
132134
ompi_status_public_t *status);
133135

134136
typedef int (*mca_fcoll_base_module_file_iwrite_all_fn_t)
135137
(struct mca_io_ompio_file_t *fh,
136-
void *buf,
138+
const void *buf,
137139
int count,
138140
struct ompi_datatype_t *datatype,
139141
ompi_request_t **request);

ompi/mca/fcoll/individual/fcoll_individual.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
1212
* Copyright (c) 2008-2014 University of Houston. All rights reserved.
13+
* Copyright (c) 2015 Research Organization for Information Science
14+
* and Technology (RIST). All rights reserved.
1315
* $COPYRIGHT$
1416
*
1517
* Additional copyrights may follow
@@ -56,7 +58,7 @@ int mca_fcoll_individual_file_read_all (mca_io_ompio_file_t *fh,
5658

5759

5860
int mca_fcoll_individual_file_write_all (mca_io_ompio_file_t *fh,
59-
void *buf,
61+
const void *buf,
6062
int count,
6163
struct ompi_datatype_t *datatype,
6264
ompi_status_public_t * status);

ompi/mca/fcoll/individual/fcoll_individual_file_write_all.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
1212
* Copyright (c) 2008-2015 University of Houston. All rights reserved.
13+
* Copyright (c) 2015 Research Organization for Information Science
14+
* and Technology (RIST). All rights reserved.
1315
* $COPYRIGHT$
1416
*
1517
* Additional copyrights may follow
@@ -30,7 +32,7 @@
3032

3133

3234
int mca_fcoll_individual_file_write_all (mca_io_ompio_file_t *fh,
33-
void *buf,
35+
const void *buf,
3436
int count,
3537
struct ompi_datatype_t *datatype,
3638
ompi_status_public_t *status)

ompi/mca/fcoll/static/fcoll_static.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
1212
* Copyright (c) 2008-2015 University of Houston. All rights reserved.
13+
* Copyright (c) 2015 Research Organization for Information Science
14+
* and Technology (RIST). All rights reserved.
1315
* $COPYRIGHT$
1416
*
1517
* Additional copyrights may follow
@@ -55,7 +57,7 @@ int mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh,
5557

5658

5759
int mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh,
58-
void *buf,
60+
const void *buf,
5961
int count,
6062
struct ompi_datatype_t *datatype,
6163
ompi_status_public_t * status);

ompi/mca/fcoll/static/fcoll_static_file_write_all.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
* All rights reserved.
1212
* Copyright (c) 2008-2015 University of Houston. All rights reserved.
1313
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights reserved.
14-
*
14+
* Copyright (c) 2015 Research Organization for Information Science
15+
* and Technology (RIST). All rights reserved.
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -58,7 +59,7 @@ int get_process_id (int rank,
5859

5960
int
6061
mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh,
61-
void *buf,
62+
const void *buf,
6263
int count,
6364
struct ompi_datatype_t *datatype,
6465
ompi_status_public_t *status)

ompi/mca/fcoll/two_phase/fcoll_two_phase.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
1212
* Copyright (c) 2008-2014 University of Houston. All rights reserved.
13+
* Copyright (c) 2015 Research Organization for Information Science
14+
* and Technology (RIST). All rights reserved.
1315
* $COPYRIGHT$
1416
*
1517
* Additional copyrights may follow
@@ -56,7 +58,7 @@ int mca_fcoll_two_phase_file_read_all (mca_io_ompio_file_t *fh,
5658

5759

5860
int mca_fcoll_two_phase_file_write_all (mca_io_ompio_file_t *fh,
59-
void *buf,
61+
const void *buf,
6062
int count,
6163
struct ompi_datatype_t *datatype,
6264
ompi_status_public_t * status);

0 commit comments

Comments
 (0)