Skip to content

Commit 3f898b5

Browse files
authored
Merge pull request #41 from e-kwsm/ansi
refactor: replace obsolescent K&R syntax
2 parents ea5d206 + 490692f commit 3f898b5

Some content is hidden

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

44 files changed

+245
-1126
lines changed

BLACS/TESTING/Cbt.c

+69-613
Large diffs are not rendered by default.

PBLAS/SRC/PTOOLS/PB_Cctypeset.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "../PBblacs.h"
1717
#include "../PBblas.h"
1818

19-
PBTYP_T * PB_Cctypeset()
19+
PBTYP_T * PB_Cctypeset(void)
2020
{
2121
/*
2222
* Purpose

PBLAS/SRC/PTOOLS/PB_Cdtypeset.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "../PBblacs.h"
1717
#include "../PBblas.h"
1818

19-
PBTYP_T * PB_Cdtypeset()
19+
PBTYP_T * PB_Cdtypeset(void)
2020
{
2121
/*
2222
* Purpose

PBLAS/SRC/PTOOLS/PB_Citypeset.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "../PBblacs.h"
1717
#include "../PBblas.h"
1818

19-
PBTYP_T * PB_Citypeset()
19+
PBTYP_T * PB_Citypeset(void)
2020
{
2121
/*
2222
* Purpose

PBLAS/SRC/PTOOLS/PB_Cstypeset.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "../PBblacs.h"
1717
#include "../PBblas.h"
1818

19-
PBTYP_T * PB_Cstypeset()
19+
PBTYP_T * PB_Cstypeset(void)
2020
{
2121
/*
2222
* Purpose

PBLAS/SRC/PTOOLS/PB_Cztypeset.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "../PBblacs.h"
1717
#include "../PBblas.h"
1818

19-
PBTYP_T * PB_Cztypeset()
19+
PBTYP_T * PB_Cztypeset(void)
2020
{
2121
/*
2222
* Purpose

PBLAS/SRC/PTOOLS/PB_freebuf_.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "../PBblacs.h"
1717
#include "../PBblas.h"
1818

19-
void PB_freebuf_()
19+
void PB_freebuf_(void)
2020
{
2121
/*
2222
* Purpose

REDIST/SRC/pcgemr.c

+10-32
Original file line numberDiff line numberDiff line change
@@ -244,23 +244,16 @@ extern void Cpcgemr2d();
244244
#include <assert.h>
245245
#define DESCLEN 9
246246
void
247-
fortran_mr2d(m, n, A, ia, ja, desc_A,
248-
B, ib, jb, desc_B)
249-
Int *ia, *ib, *ja, *jb, *m, *n;
250-
Int desc_A[DESCLEN], desc_B[DESCLEN];
251-
complex *A, *B;
247+
fortran_mr2d(Int *m, Int *n, complex *A, Int *ia, Int *ja, Int desc_A[DESCLEN],
248+
complex *B, Int *ib, Int *jb, Int desc_B[DESCLEN])
252249
{
253250
Cpcgemr2do(*m, *n, A, *ia, *ja, (MDESC *) desc_A,
254251
B, *ib, *jb, (MDESC *) desc_B);
255252
return;
256253
}
257254
void
258-
fortran_mr2dnew(m, n, A, ia, ja, desc_A,
259-
B, ib, jb, desc_B, gcontext)
260-
Int *ia, *ib, *ja, *jb, *m, *n;
261-
Int desc_A[DESCLEN], desc_B[DESCLEN];
262-
complex *A, *B;
263-
Int *gcontext;
255+
fortran_mr2dnew(Int *m, Int *n, complex *A, Int *ia, Int *ja, Int desc_A[DESCLEN],
256+
complex *B, Int *ib, Int *jb, Int desc_B[DESCLEN], Int *gcontext)
264257
{
265258
Cpcgemr2d(*m, *n, A, *ia, *ja, (MDESC *) desc_A,
266259
B, *ib, *jb, (MDESC *) desc_B, *gcontext);
@@ -572,9 +565,7 @@ Cpcgemr2d(m, n,
572565
free(param);
573566
}/* distrib */
574567
static2 void
575-
init_chenille(mypnum, nprocs, n0, proc0, n1, proc1, psend, precv, myrang)
576-
Int nprocs, mypnum, n0, n1;
577-
Int *proc0, *proc1, **psend, **precv, *myrang;
568+
init_chenille(Int mypnum, Int nprocs, Int n0, Int *proc0, Int n1, Int *proc1, Int **psend, Int **precv, Int *myrang)
578569
{
579570
Int ns, nr, i, tot;
580571
Int *sender, *recver, *g0, *g1;
@@ -645,11 +636,7 @@ Int _m,_n,_lda,_ldb; \
645636
} \
646637
}
647638
static2 Int
648-
block2buff(vi, vinb, hi, hinb, ptra, ma, buff)
649-
Int hinb, vinb;
650-
IDESC *hi, *vi;
651-
MDESC *ma;
652-
complex *buff, *ptra;
639+
block2buff(IDESC *vi, Int vinb, IDESC *hi, Int hinb, complex *ptra, MDESC *ma, complex *buff)
653640
{
654641
Int h, v, sizebuff;
655642
complex *ptr2;
@@ -667,11 +654,7 @@ block2buff(vi, vinb, hi, hinb, ptra, ma, buff)
667654
return sizebuff;
668655
}
669656
static2 void
670-
buff2block(vi, vinb, hi, hinb, buff, ptrb, mb)
671-
Int hinb, vinb;
672-
IDESC *hi, *vi;
673-
MDESC *mb;
674-
complex *buff, *ptrb;
657+
buff2block(IDESC *vi, Int vinb, IDESC *hi, Int hinb, complex *buff, complex *ptrb, MDESC *mb)
675658
{
676659
Int h, v, sizebuff;
677660
complex *ptr2;
@@ -688,9 +671,7 @@ buff2block(vi, vinb, hi, hinb, buff, ptrb, mb)
688671
}
689672
}
690673
static2 Int
691-
inter_len(hinb, hi, vinb, vi)
692-
Int hinb, vinb;
693-
IDESC *hi, *vi;
674+
inter_len(Int hinb, IDESC *hi, Int vinb, IDESC *vi)
694675
{
695676
Int hlen, vlen, h, v;
696677
hlen = 0;
@@ -702,9 +683,7 @@ inter_len(hinb, hi, vinb, vi)
702683
return hlen * vlen;
703684
}
704685
void
705-
Clacpy(m, n, a, lda, b, ldb)
706-
complex *a, *b;
707-
Int m, n, lda, ldb;
686+
Clacpy(Int m, Int n, complex *a, Int lda, complex *b, Int ldb)
708687
{
709688
Int i, j;
710689
lda -= m;
@@ -718,8 +697,7 @@ Clacpy(m, n, a, lda, b, ldb)
718697
}
719698
}
720699
static2 void
721-
gridreshape(ctxtp)
722-
Int *ctxtp;
700+
gridreshape(Int *ctxtp)
723701
{
724702
Int ori, final; /* original context, and new context created, with
725703
* line form */

REDIST/SRC/pcgemr2.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@ extern void Cpcgemr2d();
113113
/************************************************************************/
114114
/* Set the memory space with the malloc function */
115115
void
116-
setmemory(adpointer, blocksize)
117-
complex **adpointer;
118-
Int blocksize;
116+
setmemory(complex **adpointer, Int blocksize)
119117
{
120118
assert(blocksize >= 0);
121119
if (blocksize == 0) {
@@ -128,8 +126,7 @@ setmemory(adpointer, blocksize)
128126
/******************************************************************/
129127
/* Free the memory space after the malloc */
130128
void
131-
freememory(ptrtobefreed)
132-
complex *ptrtobefreed;
129+
freememory(complex *ptrtobefreed)
133130
{
134131
if (ptrtobefreed == NULL)
135132
return;

REDIST/SRC/pctrmr.c

+7-21
Original file line numberDiff line numberDiff line change
@@ -259,25 +259,16 @@ extern void Cpctrmr2d();
259259
#include <assert.h>
260260
#define DESCLEN 9
261261
void
262-
fortran_mr2d(uplo, diag, m, n, A, ia, ja, desc_A,
263-
B, ib, jb, desc_B)
264-
char *uplo, *diag;
265-
Int *ia, *ib, *ja, *jb, *m, *n;
266-
Int desc_A[DESCLEN], desc_B[DESCLEN];
267-
complex *A, *B;
262+
fortran_mr2d(char *uplo, char *diag, Int *m, Int *n, complex *A, Int *ia, Int *ja, Int desc_A[DESCLEN],
263+
complex *B, Int *ib, Int *jb, Int desc_B[DESCLEN])
268264
{
269265
Cpctrmr2do(uplo, diag, *m, *n, A, *ia, *ja, (MDESC *) desc_A,
270266
B, *ib, *jb, (MDESC *) desc_B);
271267
return;
272268
}
273269
void
274-
fortran_mr2dnew(uplo, diag, m, n, A, ia, ja, desc_A,
275-
B, ib, jb, desc_B, gcontext)
276-
char *uplo, *diag;
277-
Int *ia, *ib, *ja, *jb, *m, *n;
278-
Int desc_A[DESCLEN], desc_B[DESCLEN];
279-
complex *A, *B;
280-
Int *gcontext;
270+
fortran_mr2dnew(char *uplo, char *diag, Int *m, Int *n, complex *A, Int *ia, Int *ja, Int desc_A[DESCLEN],
271+
complex *B, Int *ib, Int *jb, Int desc_B[DESCLEN], Int *gcontext)
281272
{
282273
Cpctrmr2d(uplo, diag, *m, *n, A, *ia, *ja, (MDESC *) desc_A,
283274
B, *ib, *jb, (MDESC *) desc_B, *gcontext);
@@ -596,9 +587,7 @@ Cpctrmr2d(uplo, diag, m, n,
596587
free(param);
597588
}/* distrib */
598589
static2 void
599-
init_chenille(mypnum, nprocs, n0, proc0, n1, proc1, psend, precv, myrang)
600-
Int nprocs, mypnum, n0, n1;
601-
Int *proc0, *proc1, **psend, **precv, *myrang;
590+
init_chenille(Int mypnum, Int nprocs, Int n0, Int *proc0, Int n1, Int *proc1, Int **psend, Int **precv, Int *myrang)
602591
{
603592
Int ns, nr, i, tot;
604593
Int *sender, *recver, *g0, *g1;
@@ -652,9 +641,7 @@ init_chenille(mypnum, nprocs, n0, proc0, n1, proc1, psend, precv, myrang)
652641
}
653642
}
654643
void
655-
Clacpy(m, n, a, lda, b, ldb)
656-
complex *a, *b;
657-
Int m, n, lda, ldb;
644+
Clacpy(Int m, Int n, complex *a, Int lda, complex *b, Int ldb)
658645
{
659646
Int i, j;
660647
lda -= m;
@@ -668,8 +655,7 @@ Clacpy(m, n, a, lda, b, ldb)
668655
}
669656
}
670657
static2 void
671-
gridreshape(ctxtp)
672-
Int *ctxtp;
658+
gridreshape(Int *ctxtp)
673659
{
674660
Int ori, final; /* original context, and new context created, with
675661
* line form */

REDIST/SRC/pctrmr2.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@ extern void Cpctrmr2d();
113113
/************************************************************************/
114114
/* Set the memory space with the malloc function */
115115
void
116-
setmemory(adpointer, blocksize)
117-
complex **adpointer;
118-
Int blocksize;
116+
setmemory(complex **adpointer, Int blocksize)
119117
{
120118
assert(blocksize >= 0);
121119
if (blocksize == 0) {
@@ -128,8 +126,7 @@ setmemory(adpointer, blocksize)
128126
/******************************************************************/
129127
/* Free the memory space after the malloc */
130128
void
131-
freememory(ptrtobefreed)
132-
complex *ptrtobefreed;
129+
freememory(complex *ptrtobefreed)
133130
{
134131
if (ptrtobefreed == NULL)
135132
return;

REDIST/SRC/pdgemr.c

+7-19
Original file line numberDiff line numberDiff line change
@@ -241,23 +241,16 @@ extern void Cpdgemr2d();
241241
#include <assert.h>
242242
#define DESCLEN 9
243243
void
244-
fortran_mr2d(m, n, A, ia, ja, desc_A,
245-
B, ib, jb, desc_B)
246-
Int *ia, *ib, *ja, *jb, *m, *n;
247-
Int desc_A[DESCLEN], desc_B[DESCLEN];
248-
double *A, *B;
244+
fortran_mr2d(Int *m, Int *n, double *A, Int *ia, Int *ja, Int desc_A[DESCLEN],
245+
double *B, Int *ib, Int *jb, Int desc_B[DESCLEN])
249246
{
250247
Cpdgemr2do(*m, *n, A, *ia, *ja, (MDESC *) desc_A,
251248
B, *ib, *jb, (MDESC *) desc_B);
252249
return;
253250
}
254251
void
255-
fortran_mr2dnew(m, n, A, ia, ja, desc_A,
256-
B, ib, jb, desc_B, gcontext)
257-
Int *ia, *ib, *ja, *jb, *m, *n;
258-
Int desc_A[DESCLEN], desc_B[DESCLEN];
259-
double *A, *B;
260-
Int *gcontext;
252+
fortran_mr2dnew(Int *m, Int *n, double *A, Int *ia, Int *ja, Int desc_A[DESCLEN],
253+
double *B, Int *ib, Int *jb, Int desc_B[DESCLEN], Int *gcontext)
261254
{
262255
Cpdgemr2d(*m, *n, A, *ia, *ja, (MDESC *) desc_A,
263256
B, *ib, *jb, (MDESC *) desc_B, *gcontext);
@@ -685,9 +678,7 @@ buff2block(vi, vinb, hi, hinb, buff, ptrb, mb)
685678
}
686679
}
687680
static2 Int
688-
inter_len(hinb, hi, vinb, vi)
689-
Int hinb, vinb;
690-
IDESC *hi, *vi;
681+
inter_len(Int hinb, IDESC *hi, Int vinb, IDESC *vi)
691682
{
692683
Int hlen, vlen, h, v;
693684
hlen = 0;
@@ -699,9 +690,7 @@ inter_len(hinb, hi, vinb, vi)
699690
return hlen * vlen;
700691
}
701692
void
702-
Clacpy(m, n, a, lda, b, ldb)
703-
double *a, *b;
704-
Int m, n, lda, ldb;
693+
Clacpy(Int m, Int n, double *a, Int lda, double *b, Int ldb)
705694
{
706695
Int i, j;
707696
lda -= m;
@@ -715,8 +704,7 @@ Clacpy(m, n, a, lda, b, ldb)
715704
}
716705
}
717706
static2 void
718-
gridreshape(ctxtp)
719-
Int *ctxtp;
707+
gridreshape(Int *ctxtp)
720708
{
721709
Int ori, final; /* original context, and new context created, with
722710
* line form */

REDIST/SRC/pdgemr2.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,7 @@ extern void Cpdgemr2d();
110110
/************************************************************************/
111111
/* Set the memory space with the malloc function */
112112
void
113-
setmemory(adpointer, blocksize)
114-
double **adpointer;
115-
Int blocksize;
113+
setmemory(double **adpointer, Int blocksize)
116114
{
117115
assert(blocksize >= 0);
118116
if (blocksize == 0) {
@@ -125,8 +123,7 @@ setmemory(adpointer, blocksize)
125123
/******************************************************************/
126124
/* Free the memory space after the malloc */
127125
void
128-
freememory(ptrtobefreed)
129-
double *ptrtobefreed;
126+
freememory(double *ptrtobefreed)
130127
{
131128
if (ptrtobefreed == NULL)
132129
return;

REDIST/SRC/pdtrmr.c

+7-21
Original file line numberDiff line numberDiff line change
@@ -256,25 +256,16 @@ extern void Cpdtrmr2d();
256256
#include <assert.h>
257257
#define DESCLEN 9
258258
void
259-
fortran_mr2d(uplo, diag, m, n, A, ia, ja, desc_A,
260-
B, ib, jb, desc_B)
261-
char *uplo, *diag;
262-
Int *ia, *ib, *ja, *jb, *m, *n;
263-
Int desc_A[DESCLEN], desc_B[DESCLEN];
264-
double *A, *B;
259+
fortran_mr2d(char *uplo, char *diag, Int *m, Int *n, double *A, Int *ia, Int *ja, Int desc_A[DESCLEN],
260+
double *B, Int *ib, Int *jb, Int desc_B[DESCLEN])
265261
{
266262
Cpdtrmr2do(uplo, diag, *m, *n, A, *ia, *ja, (MDESC *) desc_A,
267263
B, *ib, *jb, (MDESC *) desc_B);
268264
return;
269265
}
270266
void
271-
fortran_mr2dnew(uplo, diag, m, n, A, ia, ja, desc_A,
272-
B, ib, jb, desc_B, gcontext)
273-
char *uplo, *diag;
274-
Int *ia, *ib, *ja, *jb, *m, *n;
275-
Int desc_A[DESCLEN], desc_B[DESCLEN];
276-
double *A, *B;
277-
Int *gcontext;
267+
fortran_mr2dnew(char *uplo, char *diag, Int *m, Int *n, double *A, Int *ia, Int *ja, Int desc_A[DESCLEN],
268+
double *B, Int *ib, Int *jb, Int desc_B[DESCLEN], Int *gcontext)
278269
{
279270
Cpdtrmr2d(uplo, diag, *m, *n, A, *ia, *ja, (MDESC *) desc_A,
280271
B, *ib, *jb, (MDESC *) desc_B, *gcontext);
@@ -593,9 +584,7 @@ Cpdtrmr2d(uplo, diag, m, n,
593584
free(param);
594585
}/* distrib */
595586
static2 void
596-
init_chenille(mypnum, nprocs, n0, proc0, n1, proc1, psend, precv, myrang)
597-
Int nprocs, mypnum, n0, n1;
598-
Int *proc0, *proc1, **psend, **precv, *myrang;
587+
init_chenille(Int mypnum, Int nprocs, Int n0, Int *proc0, Int n1, Int *proc1, Int **psend, Int **precv, Int *myrang)
599588
{
600589
Int ns, nr, i, tot;
601590
Int *sender, *recver, *g0, *g1;
@@ -649,9 +638,7 @@ init_chenille(mypnum, nprocs, n0, proc0, n1, proc1, psend, precv, myrang)
649638
}
650639
}
651640
void
652-
Clacpy(m, n, a, lda, b, ldb)
653-
double *a, *b;
654-
Int m, n, lda, ldb;
641+
Clacpy(Int m, Int n, double *a, Int lda, double *b, Int ldb)
655642
{
656643
Int i, j;
657644
lda -= m;
@@ -665,8 +652,7 @@ Clacpy(m, n, a, lda, b, ldb)
665652
}
666653
}
667654
static2 void
668-
gridreshape(ctxtp)
669-
Int *ctxtp;
655+
gridreshape(Int *ctxtp)
670656
{
671657
Int ori, final; /* original context, and new context created, with
672658
* line form */

0 commit comments

Comments
 (0)