Skip to content

Commit

Permalink
Use prototype form for functions
Browse files Browse the repository at this point in the history
Convert from K&R C to modern C prototype form.  Use MPE_CONST to
permit backward compatibility to MPI-2.  Added missing .gitignore
files as part of cleanup
  • Loading branch information
wgropp committed Aug 24, 2014
1 parent dfab464 commit bbb2446
Show file tree
Hide file tree
Showing 34 changed files with 843 additions and 1,912 deletions.
57 changes: 57 additions & 0 deletions .gitignore
@@ -0,0 +1,57 @@
*~
configure
configure.lineno
config.log
config.status
config.cache
*conf.cache
config.system
config.h.in
autom4te.cache
autom4te-*.cache
Makefile
lib
f77tmpdir
mpe_conf.h
mpe_conf.h.in
mpe_conf.h.in~
*ebug*
*elease*
*.user
old
bin/mpecc
bin/mpefc
bin/bt2line
bin/check_callstack
bin/clog2_join
bin/clog2_print
bin/clog2_repair
etc/mpe_f77env.conf
etc/mpe_help.conf
etc/mpe_mpilog.conf
etc/mpe_mpitrace.conf
etc/mpe_nolog.conf
etc/mpe_log.conf
etc/mpe_log_postlib.conf
etc/mpe_callstack_ldflags.conf
etc/mpe_mpicheck.conf
sbin/mpecheckbuild
sbin/mpecheckinstall
sbin/mpeinstall
sbin/mpetestexec
sbin/mpetestexeclog
sbin/mpetestlink
include/mpe_callstack.h
include/mpe_log.h
include/mpe_graphics.h
include/mpe_logf.h
include/mpe_misc.h
include/clog_commset.h
include/clog_const.h
include/clog_inttypes.h
include/clog_uuid.h
include/mpe_log_thread.h
*.o
*.po
*.no
make.log
1 change: 1 addition & 0 deletions cross_spec/.gitignore
@@ -0,0 +1 @@
cross_conf.h.in
5 changes: 5 additions & 0 deletions src/callstack/.gitignore
@@ -0,0 +1,5 @@
mpe_callstack_conf.h.in
mpe_callstack_conf.h
bin/bt2line
etc/mpe_callstack_ldflags.conf
include/mpe_callstack.h
3 changes: 3 additions & 0 deletions src/collchk/.gitignore
@@ -0,0 +1,3 @@
mpe_collchk_conf.h.in
mpe_collchk_conf.h
etc/mpe_mpicheck.conf
4 changes: 4 additions & 0 deletions src/collchk/src/same_dtype.c
Expand Up @@ -529,6 +529,10 @@ int CollChk_dtype_scatter(MPI_Comm comm,
CollChk_dtype_hash(sendtype, sendcnt, &root_hash);

/* broadcast root's datatype hash to all other processes */
/* Note: root_hash is really a structure of two unsigneds, so it is
a happy coincidence that we should be able to send it as
2 MPI_UNSIGNED. Some versions of MPICH will complain about
a compile-time type mismatch here */
PMPI_Bcast(&root_hash, 2, MPI_UNSIGNED, root, comm);

/* Compare root_hash with the input/local hash */
Expand Down
2 changes: 2 additions & 0 deletions src/graphics/.gitignore
@@ -0,0 +1,2 @@
mpe_graphics_conf.h.in
mpe_graphics_conf.h
36 changes: 36 additions & 0 deletions src/graphics/configure.ac
Expand Up @@ -12,6 +12,14 @@ AC_PREREQ(2.52)
AC_CONFIG_HEADER(mpe_graphics_conf.h)
dnl
echo "Configuring MPE X Graphics Library with $ac_configure_args"
AH_BOTTOM([
/* Define MPE_CONST=const if mpi.h uses const in MPI function declaration. */
#if defined(HAVE_CONST_IN_MPI_DECL) || MPI_VERSION >= 3
#define MPE_CONST const
#else
#define MPE_CONST
#endif
])
dnl
dnl Set top_srcdir_abs to be the ABSOLUTE path to the home directory of MPE
dnl top_srcdir is in relative path.
Expand All @@ -33,6 +41,13 @@ AC_ARG_ENABLE( softerror,
are used. The default is enable=no.],
, enable_softerror=${mpe_enable_softerror:-no} )

AC_ARG_ENABLE( checkMPI,
[--enable-checkMPI - Turn on/off the linking test for the MPI
include files, MPI libraries and MPI_CC
compiler. The default is enable=yes.], ,
enable_checkMPI=yes )


MAKE=${MAKE:-make}
MPI_IMPL=${MPI_IMPL:-UserSupplied}
MPE_BUILD_FORTRAN2C=${MPE_BUILD_FORTRAN2C:-no}
Expand Down Expand Up @@ -234,6 +249,27 @@ if test "$MPE_BUILD_FORTRAN2C" = "yes" ; then
fi
fi

dnl Check if MPI implementation uses const in function declaration
if test "$enable_checkMPI" = "yes" ; then
AC_MSG_CHECKING( [for the use of const in MPI function declaration] )
PAC_MPI_COMPILE_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], [], [],
[
int MPI_Send(const void *buf, int count, MPI_Datatype datatype,
int dest, int tag, MPI_Comm comm)
{
return 0;
}
],
[ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
if test "$mpe_link_ok" = "yes" ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_CONST_IN_MPI_DECL, 1, [Define MPE_CONST to const])
else
AC_MSG_RESULT(no)
fi
fi


if test ! -d contrib ; then mkdir contrib ; fi

AC_SUBST(MPI_IMPL)
Expand Down
108 changes: 31 additions & 77 deletions src/graphics/src/mpe_graphics.c
Expand Up @@ -134,13 +134,9 @@ N*/
The trailing blanks in Fortran CHARACTER string argument will be
ignored.
@*/
int MPE_Open_graphics( handle, comm, display, x, y, w, h, is_collective )
MPE_XGraph *handle;
MPI_Comm comm;
char display[MPI_MAX_PROCESSOR_NAME+4];
int x, y;
int w, h;
int is_collective;
int MPE_Open_graphics(MPE_XGraph *handle, MPI_Comm comm, char display[],
int x, int y, int w, int h, int is_collective)
/* char display[MPI_MAX_PROCESSOR_NAME+4]; */
{

#ifndef MPE_NOMPI
Expand Down Expand Up @@ -389,10 +385,7 @@ static void SetBackingStoreBitGrav( MPE_XGraph graph )
The trailing blanks in Fortran 'CHARACTER' string argument will be
ignored.
@*/
int MPE_CaptureFile( handle, fname, freq )
MPE_XGraph handle;
char *fname;
int freq;
int MPE_CaptureFile(MPE_XGraph handle, char *fname, int freq)
{
if (handle->Cookie != MPE_G_COOKIE) {
fprintf( stderr, "Handle argument is incorrect or corrupted\n" );
Expand Down Expand Up @@ -429,10 +422,7 @@ int freq;
.N XGRAPHICS_FORTRAN
@*/
int MPE_Draw_point( handle, x, y, color )
MPE_XGraph handle;
int x, y;
MPE_Color color;
int MPE_Draw_point(MPE_XGraph handle, int x, int y, MPE_Color color)
{
if (handle->Cookie != MPE_G_COOKIE) {
fprintf( stderr, "Handle argument is incorrect or corrupted\n" );
Expand Down Expand Up @@ -463,10 +453,7 @@ MPE_Color color;
.N XGRAPHICS_FORTRAN
@*/
int MPE_Draw_points( handle, points, npoints )
MPE_XGraph handle;
MPE_Point *points;
int npoints;
int MPE_Draw_points(MPE_XGraph handle, MPE_Point *points, int npoints)
{
XPoint *sortedPoints;
int *colorRanges, ncolors, colorNum, n;
Expand Down Expand Up @@ -538,11 +525,9 @@ int npoints;



static void SortPoints( lista, a, listb, colorList, boundaryPoints, ncolors )
MPE_Point *lista;
XPoint **listb;
MPE_Color **colorList;
int a, **boundaryPoints, *ncolors;
static void SortPoints(MPE_Point *lista, int a, XPoint **listb,
MPE_Color **colorList, int **boundaryPoints,
int *ncolors)
{
int top, bottom, outoforder;
MPE_Color thisColor, tempColor, *keyList;
Expand Down Expand Up @@ -642,10 +627,8 @@ int a, **boundaryPoints, *ncolors;
.N XGRAPHICS_FORTRAN
@*/
int MPE_Draw_line( handle, x1, y_1, x2, y_2, color )
MPE_XGraph handle;
int x1, y_1, x2, y_2;
MPE_Color color;
int MPE_Draw_line(MPE_XGraph handle, int x1, int y_1, int x2, int y_2,
MPE_Color color)
{
if (handle->Cookie != MPE_G_COOKIE) {
fprintf( stderr, "Handle argument is incorrect or corrupted\n" );
Expand Down Expand Up @@ -686,10 +669,8 @@ MPE_Color color;
.N XGRAPHICS_FORTRAN
@*/
int MPE_Fill_rectangle( handle, x, y, w, h, color )
MPE_XGraph handle;
int x, y, w, h;
MPE_Color color;
int MPE_Fill_rectangle(MPE_XGraph handle, int x, int y, int w, int h,
MPE_Color color)
{
if (handle->Cookie != MPE_G_COOKIE) {
fprintf( stderr, "Handle argument is incorrect or corrupted\n" );
Expand Down Expand Up @@ -724,8 +705,7 @@ MPE_Color color;
.N XGRAPHICS_FORTRAN
@*/
int MPE_Update( handle )
MPE_XGraph handle;
int MPE_Update(MPE_XGraph handle)
{
if (handle->Cookie != MPE_G_COOKIE) {
fprintf( stderr, "Handle argument is incorrect or corrupted\n" );
Expand Down Expand Up @@ -784,8 +764,7 @@ MPE_XGraph handle;
.N XGRAPHICS_FORTRAN
@*/
int MPE_Close_graphics( handle )
MPE_XGraph *handle;
int MPE_Close_graphics(MPE_XGraph *handle)
{
if (!handle || !*handle || (*handle)->Cookie != MPE_G_COOKIE) {
fprintf( stderr, "Handle argument is incorrect or corrupted\n" );
Expand Down Expand Up @@ -816,10 +795,7 @@ MPE_XGraph *handle;
.N XGRAPHICS_FORTRAN
@*/
int MPE_Make_color_array( handle, ncolors, array )
MPE_XGraph handle;
int ncolors;
MPE_Color array[];
int MPE_Make_color_array(MPE_XGraph handle, int ncolors, MPE_Color array[] )
{
int i;
PixVal white;
Expand Down Expand Up @@ -869,9 +845,7 @@ MPE_Color array[];
.N XGRAPHICS_FORTRAN
@*/
int MPE_Num_colors( handle, nc )
MPE_XGraph handle;
int *nc;
int MPE_Num_colors(MPE_XGraph handle, int *nc)
{
if (handle->Cookie != MPE_G_COOKIE) {
fprintf( stderr, "Handle argument is incorrect or corrupted\n" );
Expand All @@ -893,10 +867,8 @@ int *nc;
.N XGRAPHICS_FORTRAN
@*/
int MPE_Draw_circle( graph, centerx, centery, radius, color )
MPE_XGraph graph;
int centerx, centery, radius;
MPE_Color color;
int MPE_Draw_circle(MPE_XGraph graph, int centerx, int centery, int radius,
MPE_Color color)
{
int returnVal;

Expand Down Expand Up @@ -932,10 +904,8 @@ MPE_Color color;
.N XGRAPHICS_FORTRAN
@*/
int MPE_Fill_circle( graph, centerx, centery, radius, color )
MPE_XGraph graph;
int centerx, centery, radius;
MPE_Color color;
int MPE_Fill_circle(MPE_XGraph graph, int centerx, int centery, int radius,
MPE_Color color)
{
int returnVal;

Expand Down Expand Up @@ -968,11 +938,8 @@ MPE_Color color;
The trailing blanks in Fortran CHARACTER string argument will be
ignored.
@*/
int MPE_Draw_string( graph, x, y, color, string )
MPE_XGraph graph;
int x, y;
MPE_Color color;
char *string;
int MPE_Draw_string(MPE_XGraph graph, int x, int y, MPE_Color color,
char *string)
{
int returnVal;

Expand Down Expand Up @@ -1006,9 +973,7 @@ char *string;
.N XGRAPHICS_FORTRAN
@*/
int MPE_Draw_logic( graph, function )
MPE_XGraph graph;
int function;
int MPE_Draw_logic(MPE_XGraph graph, int function)
{
int returnVal;
if (graph->Cookie != MPE_G_COOKIE) {
Expand All @@ -1033,9 +998,7 @@ int function;
.N XGRAPHICS_FORTRAN
@*/
int MPE_Line_thickness( graph, thickness )
MPE_XGraph graph;
int thickness;
int MPE_Line_thickness(MPE_XGraph graph, int thickness)
{
XGCValues gcChanges;

Expand All @@ -1048,9 +1011,7 @@ int thickness;



int MPE_Draw_dashes( graph, dashlen )
MPE_XGraph graph;
int dashlen;
int MPE_Draw_dashes(MPE_XGraph graph, int dashlen)
{
XGCValues gcChanges;

Expand All @@ -1070,9 +1031,7 @@ int dashlen;
}


int MPE_Dash_offset( graph, offset )
MPE_XGraph graph;
int offset;
int MPE_Dash_offset(MPE_XGraph graph, int offset)
{
XGCValues gcChanges;

Expand Down Expand Up @@ -1107,10 +1066,8 @@ int offset;
.N XGRAPHICS_FORTRAN
@*/
int MPE_Add_RGB_color( graph, red, green, blue, mapping )
MPE_XGraph graph;
int red, green, blue;
MPE_Color *mapping;
int MPE_Add_RGB_color(MPE_XGraph graph, int red, int green, int blue,
MPE_Color *mapping)
{
XColor colordef;

Expand Down Expand Up @@ -1175,8 +1132,7 @@ int MPE_Xerror( int returnVal, const char *functionName )
}


static xpand_list_Int *Int_CreateList(initialLen)
int initialLen;
static xpand_list_Int *Int_CreateList(int initialLen)
{
xpand_list_Int *tempPtr;

Expand All @@ -1198,9 +1154,7 @@ int initialLen;
}


static int Int_AddItem(listPtr, newItem)
xpand_list_Int *listPtr;
int newItem;
static int Int_AddItem(xpand_list_Int *listPtr, int newItem)
{
int *tmp;
if (listPtr->nused == listPtr->size) {
Expand Down

0 comments on commit bbb2446

Please sign in to comment.