Commit 5c799183 authored by Pavan Balaji's avatar Pavan Balaji
Browse files

[svn-r10367] Get rid of MPICH2_CONST and use const directly.

No reviewer.
parent 83e5c56a
......@@ -1650,7 +1650,7 @@ sub clean_args {
my $comma = "";
for $parm (split(',',$args)) {
# Remove any leading or trailing spaces
$parm =~ s/^MPICH2_CONST\s//; # Remove MPICH2_CONST if present
$parm =~ s/^const\s//; # Remove const if present
$parm =~ s/^\s*//;
$parm =~ s/\s*$//;
# Handle parameters with parameter names
......
......@@ -1381,9 +1381,9 @@ sub print_args {
$parm =~ s/restrict\s+//;
$arg_qualifiers[$count] .= "restrict ";
}
if ($parm =~ /^MPICH2_CONST\s+/) {
$parm =~ s/MPICH2_CONST\s+//g;
$arg_qualifiers[$count] .= "MPICH2_CONST ";
if ($parm =~ /^const\s+/) {
$parm =~ s/const\s+//g;
$arg_qualifiers[$count] .= "const ";
}
# Remove arg names from array types
if ($parm =~ /(\w+)\s+(\w+)\s*\[\]/) {
......@@ -1562,7 +1562,7 @@ sub print_call_args {
foreach $parm (@parms) {
$parm =~ s/^const\s+//; # Remove const if present
$parm =~ s/^MPICH2_CONST\s+//; # Remove MPICH2_CONST if present
$parm =~ s/^const\s+//; # Remove const if present
# Remove variable name if present in an array arg
if ($parm =~ /(.*)\s+(\w+)\[\]/) {
$parm = "$1 \[\]";
......@@ -4356,7 +4356,7 @@ MPIR_Comm_delete_attr_f77_proxy(
#undef FUNCNAME
#define FUNCNAME MPI_Status_f2c
int MPI_Status_f2c( MPICH2_CONST MPI_Fint *f_status, MPI_Status *c_status )
int MPI_Status_f2c( const MPI_Fint *f_status, MPI_Status *c_status )
{
int mpi_errno = MPI_SUCCESS;\n";
&specialInitStatement( $OUTFD );
......@@ -4430,7 +4430,7 @@ print $OUTFD "\
#undef FUNCNAME
#define FUNCNAME MPI_Status_c2f
int MPI_Status_c2f( MPICH2_CONST MPI_Status *c_status, MPI_Fint *f_status )
int MPI_Status_c2f( const MPI_Status *c_status, MPI_Fint *f_status )
{
int mpi_errno = MPI_SUCCESS;
if (c_status == MPI_STATUS_IGNORE ||
......@@ -4584,15 +4584,15 @@ sub ReadAndProcessInterface {
$args =~ s/MPICH_ATTR[A-Z_]*\([^)]*\)//g;
$args =~ s/\)\s*;//g;
$args =~ s/[\r\n]*//g;
$args =~ s/MPICH2_CONST\s//g;
$args =~ s/const\s//g;
# remove qualifiers from args
### TEMP - REMEMBER const because we may need it later
#$args =~ s/\s*const\s+//g;
# Convert MPIO_Request to MPI_Request (temporary)
# $args =~ s/MPIO_Request/MPI_Request/g;
### TEMP: REMOVED MPICH2_CONST
#$args =~ s/MPICH2_CONST\s*//g;
### TEMP: REMOVED const
#$args =~ s/const\s*//g;
# Get the name of the Fortran routine (without the prefix).
# Normally, the name is just the lower-case version, but
# some libraries (such as NetCDF) use "real" in Fortran
......@@ -5358,7 +5358,7 @@ sub print_fint_to_int_decls {
}
foreach $parm (@parms) {
$parm =~ s/^MPICH2_CONST\s//; # Remove MPICH2_CONST if present
$parm =~ s/^const\s//; # Remove const if present
$parm =~ s/^const\s//; # Remove const if present
# Remove variable name if present in an array arg
if ($parm =~ /(.*)\s+(\w+)\[\]/) {
......@@ -5408,7 +5408,7 @@ sub print_int_to_fint {
foreach $parm (@parms) {
$parm =~ s/^const\s//; # Remove const if present
$parm =~ s/^MPICH2_CONST\s+//; # Remove MPICH2_CONST if present
$parm =~ s/^const\s+//; # Remove const if present
# Remove variable name if present in an array arg
if ($parm =~ /(.*)\s+(\w+)\[\]/) {
$parm = "$1 \[\]";
......
......@@ -630,7 +630,7 @@ foreach $routine (keys(%mpi_choice_routines)) {
# including scalar.
$nchoice = 0;
for ($i=0; $i<=$#parms; $i++) {
$parms[$i] =~ s/^MPICH2_CONST\s//; # Remove MPICH2_CONST if present
$parms[$i] =~ s/^const\s//; # Remove const if present
$parm = $parms[$i];
# Check for special args
$loc = $i+1;
......@@ -1087,7 +1087,7 @@ sub PrintArgDecls {
my %use_constants = ();
my $found_constants = 0;
for (my $i=0; $i<=$#parms; $i++) {
$parms[$i] =~ s/^MPICH2_CONST\s//; # Remove MPICH2_CONST if present
$parms[$i] =~ s/^const\s//; # Remove const if present
$parm = $parms[$i];
# Check for special args
$loc = $i+1;
......
This diff is collapsed.
......@@ -4,7 +4,7 @@
*/
#include "collchk.h"
int MPI_Allgather(MPICH2_CONST void* sbuff, int scnt, MPI_Datatype stype,
int MPI_Allgather(const void* sbuff, int scnt, MPI_Datatype stype,
void* rbuff, int rcnt, MPI_Datatype rtype,
MPI_Comm comm )
{
......
......@@ -4,8 +4,8 @@
*/
#include "collchk.h"
int MPI_Allgatherv( MPICH2_CONST void* sbuff, int scnt, MPI_Datatype stype,
void* rbuff, MPICH2_CONST int *rcnts, MPICH2_CONST int *displs, MPI_Datatype rtype,
int MPI_Allgatherv( const void* sbuff, int scnt, MPI_Datatype stype,
void* rbuff, const int *rcnts, const int *displs, MPI_Datatype rtype,
MPI_Comm comm )
{
char call[COLLCHK_SM_STRLEN];
......
......@@ -4,7 +4,7 @@
*/
#include "collchk.h"
int MPI_Allreduce( MPICH2_CONST void* sbuff, void* rbuff, int cnt,
int MPI_Allreduce( const void* sbuff, void* rbuff, int cnt,
MPI_Datatype dt, MPI_Op op, MPI_Comm comm)
{
int g2g = 1;
......
......@@ -6,7 +6,7 @@
#define BUFFS_NOT_SHARED 0
int MPI_Alltoall( MPICH2_CONST void* sbuff, int scnt, MPI_Datatype stype,
int MPI_Alltoall( const void* sbuff, int scnt, MPI_Datatype stype,
void* rbuff, int rcnt, MPI_Datatype rtype,
MPI_Comm comm)
{
......
......@@ -4,8 +4,8 @@
*/
#include "collchk.h"
int MPI_Alltoallv(MPICH2_CONST void* sbuff, MPICH2_CONST int *scnts, MPICH2_CONST int *sdispls, MPI_Datatype stype,
void* rbuff, MPICH2_CONST int *rcnts, MPICH2_CONST int *rdispls, MPI_Datatype rtype,
int MPI_Alltoallv(const void* sbuff, const int *scnts, const int *sdispls, MPI_Datatype stype,
void* rbuff, const int *rcnts, const int *rdispls, MPI_Datatype rtype,
MPI_Comm comm)
{
int g2g = 1, rank;
......
......@@ -5,8 +5,8 @@
#include "collchk.h"
int MPI_Alltoallw(MPICH2_CONST void* sbuff, MPICH2_CONST int *scnts, MPICH2_CONST int *sdispls, MPICH2_CONST MPI_Datatype *stypes,
void* rbuff, MPICH2_CONST int *rcnts, MPICH2_CONST int *rdispls, MPICH2_CONST MPI_Datatype *rtypes,
int MPI_Alltoallw(const void* sbuff, const int *scnts, const int *sdispls, const MPI_Datatype *stypes,
void* rbuff, const int *rcnts, const int *rdispls, const MPI_Datatype *rtypes,
MPI_Comm comm)
{
int g2g = 1, r;
......
......@@ -4,7 +4,7 @@
*/
#include "collchk.h"
int MPI_Cart_create(MPI_Comm comm_old, int ndims, MPICH2_CONST int *dims, MPICH2_CONST int *periods,
int MPI_Cart_create(MPI_Comm comm_old, int ndims, const int *dims, const int *periods,
int reorder, MPI_Comm *comm_cart)
{
int g2g = 1;
......
......@@ -4,7 +4,7 @@
*/
#include "collchk.h"
int MPI_Cart_map(MPI_Comm comm, int ndims, MPICH2_CONST int *dims, MPICH2_CONST int *periods,
int MPI_Cart_map(MPI_Comm comm, int ndims, const int *dims, const int *periods,
int *newrank)
{
int g2g = 1;
......
......@@ -4,7 +4,7 @@
*/
#include "collchk.h"
int MPI_Comm_accept(MPICH2_CONST char *portname, MPI_Info info, int root,
int MPI_Comm_accept(const char *portname, MPI_Info info, int root,
MPI_Comm comm, MPI_Comm *newcomm)
{
int g2g = 1;
......
......@@ -4,7 +4,7 @@
*/
#include "collchk.h"
int MPI_Comm_connect(MPICH2_CONST char *portname, MPI_Info info, int root,
int MPI_Comm_connect(const char *portname, MPI_Info info, int root,
MPI_Comm comm, MPI_Comm *newcomm)
{
int g2g = 1;
......
......@@ -4,7 +4,7 @@
*/
#include "collchk.h"
int MPI_Comm_spawn(MPICH2_CONST char *command, char **argv, int maxprocs, MPI_Info info,
int MPI_Comm_spawn(const char *command, char **argv, int maxprocs, MPI_Info info,
int root, MPI_Comm comm, MPI_Comm *intercomm,
int *array_of_errcodes)
{
......
......@@ -5,8 +5,8 @@
#include "collchk.h"
int MPI_Comm_spawn_multiple(int count, char **array_of_commands,
char ***array_of_argv, MPICH2_CONST int *array_of_maxprocs,
MPICH2_CONST MPI_Info *array_of_info, int root, MPI_Comm comm,
char ***array_of_argv, const int *array_of_maxprocs,
const MPI_Info *array_of_info, int root, MPI_Comm comm,
MPI_Comm *intercomm, int *array_of_errcodes)
{
int g2g = 1;
......
......@@ -4,7 +4,7 @@
*/
#include "collchk.h"
int MPI_Exscan(MPICH2_CONST void* sbuff, void* rbuff, int cnt,
int MPI_Exscan(const void* sbuff, void* rbuff, int cnt,
MPI_Datatype dt, MPI_Op op, MPI_Comm comm)
{
int g2g = 1;
......
......@@ -4,7 +4,7 @@
*/
#include "collchk.h"
int MPI_File_open(MPI_Comm comm, MPICH2_CONST char *filename, int amode,
int MPI_File_open(MPI_Comm comm, const char *filename, int amode,
MPI_Info info, MPI_File *fh)
{
int g2g = 1,i;
......
......@@ -5,7 +5,7 @@
#include "collchk.h"
int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype,
MPI_Datatype filetype, MPICH2_CONST char *datarep, MPI_Info info)
MPI_Datatype filetype, const char *datarep, MPI_Info info)
{
int g2g = 1;
char call[COLLCHK_SM_STRLEN];
......
......@@ -4,7 +4,7 @@
*/
#include "collchk.h"
int MPI_File_write_all(MPI_File fh, MPICH2_CONST void *buff, int cnt,
int MPI_File_write_all(MPI_File fh, const void *buff, int cnt,
MPI_Datatype dtype, MPI_Status *st)
{
int g2g = 1;
......
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