Skip to content

Commit

Permalink
Merge pull request #94 from prj-/jolivet/fix-warnings
Browse files Browse the repository at this point in the history
Fix -Wextra-semi-stmt -Wparentheses
  • Loading branch information
langou authored Feb 26, 2024
2 parents d052a77 + e1b43e3 commit 0234af9
Show file tree
Hide file tree
Showing 31 changed files with 91 additions and 91 deletions.
2 changes: 1 addition & 1 deletion BLACS/SRC/BI_MringComb.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void BI_MringComb(BLACSCONTEXT *ctxt, BLACBUFF *bp, BLACBUFF *bp2,
if (Np < 2) return;
Iam = ctxt->scp->Iam;
msgid = Mscopeid(ctxt);
if (REBS = (dest == -1)) dest = 0;
if ( ( REBS = (dest == -1) ) ) dest = 0;

if (nrings > 0)
{
Expand Down
2 changes: 1 addition & 1 deletion BLACS/SRC/BI_TreeComb.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void BI_TreeComb(BLACSCONTEXT *ctxt, BLACBUFF *bp, BLACBUFF *bp2,
Iam = ctxt->scp->Iam;
msgid = Mscopeid(ctxt);
Rmsgid = Mscopeid(ctxt);
if (REBS = (dest == -1)) dest = 0;
if ( ( REBS = (dest == -1) ) ) dest = 0;

mydist = (Np + Iam - dest) % Np;
if (REBS)
Expand Down
16 changes: 8 additions & 8 deletions BLACS/SRC/Bdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Int BI_ContxtNum(BLACSCONTEXT *ctxt);
(npcol0) = (ctxt)->rscp.Np;\
(myrow0) = (ctxt)->cscp.Iam;\
(mycol0) = (ctxt)->rscp.Iam;\
}
} (void)0

/*
* These routines return coordinates based on nodes number, or node number
Expand All @@ -166,9 +166,9 @@ Int BI_ContxtNum(BLACSCONTEXT *ctxt);
{\
(prow) = (node) / (ctxt)->rscp.Np;\
(pcol) = (node) % (ctxt)->rscp.Np;\
}
} (void)0
#define Mvpcoord(ctxt, node, prow, pcol) \
Mpcoord((ctxt), (node), (prow), (pcol));
Mpcoord((ctxt), (node), (prow), (pcol))

#define Mkpnum(ctxt, prow, pcol) ( (prow)*(ctxt)->rscp.Np+(pcol) )
#define Mvkpnum(ctxt, prow, pcol) ( (prow)*(ctxt)->rscp.Np+(pcol) )
Expand All @@ -178,7 +178,7 @@ Int BI_ContxtNum(BLACSCONTEXT *ctxt);
*/
#define Mscopeid(ctxt) (ctxt)->scp->ScpId; \
if (++(ctxt)->scp->ScpId == (ctxt)->scp->MaxId) \
(ctxt)->scp->ScpId = (ctxt)->scp->MinId;
(ctxt)->scp->ScpId = (ctxt)->scp->MinId

/*
* Get context, and check for validity if debug level is high
Expand All @@ -195,13 +195,13 @@ Int BI_ContxtNum(BLACSCONTEXT *ctxt);
BI_BlacsErr(-1, __LINE__, __FILE__, "Invalid context, handle=%d",\
(Context));\
(ctxtptr) = BI_MyContxts[(Context)];\
}
} (void)0
#else
#define MGetConTxt(Context, ctxtptr)\
{\
extern BLACSCONTEXT **BI_MyContxts;\
(ctxtptr) = BI_MyContxts[(Context)];\
}
} (void)0
#endif
/*
* This macro handles MPI errors
Expand All @@ -223,7 +223,7 @@ Int BI_ContxtNum(BLACSCONTEXT *ctxt);
{ \
extern Int BI_Iam; \
fprintf(stderr, "%d: line %d of file %s\n", BI_Iam, __LINE__, __FILE__); \
}
} (void)0

/*
* These macros allow for the funky function declarations and character handling
Expand Down Expand Up @@ -282,7 +282,7 @@ Int BI_ContxtNum(BLACSCONTEXT *ctxt);
else\
(length) = ( (m) * ( (n) - (m) ) + ( (m)*(m) ) - ( (m)*(m) )/2 +\
(m)/2 - (m) * (length) ) * (bytes);\
}
} (void)0

/*
* These macros call the correct packing/unpacking routines
Expand Down
24 changes: 12 additions & 12 deletions PBLAS/SRC/PBtools.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
inbt_ = (inb_) - (i_); \
if( inbt_ <= 0 ) \
inbt_ = ( (-inbt_) / (nb_) + 1 ) * (nb_) + inbt_; \
inbt_ = MIN( inbt_, (n_) );
inbt_ = MIN( inbt_, (n_) )

#define Mlastnb( inbt_, n_, i_, inb_, nb_ ) \
inbt_ = (i_) + (n_) - (inb_); \
Expand All @@ -149,7 +149,7 @@
inbt_ = -( ( (nb_)+inbt_-1 )/(nb_)-1 )*(nb_) + inbt_; \
inbt_ = MIN( inbt_, (n_) ); \
} \
else { inbt_ = (n_); };
else { inbt_ = (n_); } (void)0
/*
* Does the index interval i_:i_+n_-1 spans more than one process rows
* or columns ?
Expand Down Expand Up @@ -194,7 +194,7 @@
{ \
ig_ = (il_); \
} \
}
} (void)0
/*
* Mindxg2p returns the process coodinate owning the entry globally
* indexed by ig_.
Expand All @@ -211,7 +211,7 @@
{ \
proc_ = (srcproc_); \
} \
}
} (void)0
/*
* Mnumroc computes the # of local indexes np_ residing in the process
* of coordinate proc_ corresponding to the interval of global indexes
Expand Down Expand Up @@ -294,7 +294,7 @@
{ \
np_ = (n_); \
} \
}
} (void)0

#define Mnpreroc( np_, n_, i_, inb_, nb_, proc_, srcproc_, nprocs_ ) \
{ \
Expand Down Expand Up @@ -367,7 +367,7 @@
{ \
np_ = 0; \
} \
}
} (void)0

#define Mnnxtroc( np_, n_, i_, inb_, nb_, proc_, srcproc_, nprocs_ ) \
{ \
Expand Down Expand Up @@ -422,7 +422,7 @@
} \
else \
{ np_ = 0; } \
}
} (void)0


#define Minfog2l( i_, j_, desc_, nr_, nc_, r_, c_, ii_, jj_, pr_, pc_ ) \
Expand Down Expand Up @@ -491,7 +491,7 @@
{ \
jj_ = (j_); \
} \
}
} (void)0

/*
* The following macros initialize or translate descriptors.
Expand All @@ -509,7 +509,7 @@
(desc)[RSRC_ ] = (rsrc); \
(desc)[CSRC_ ] = (csrc); \
(desc)[LLD_ ] = (lld); \
}
} (void)0

#define MDescCopy(DescIn, DescOut) \
{ \
Expand All @@ -524,7 +524,7 @@
(DescOut)[CSRC_ ] = (DescIn)[CSRC_ ]; \
(DescOut)[CTXT_ ] = (DescIn)[CTXT_ ]; \
(DescOut)[LLD_ ] = (DescIn)[LLD_ ]; \
}
} (void)0

#define MDescTrans(DescIn, DescOut) \
{ \
Expand Down Expand Up @@ -570,13 +570,13 @@
(DescOut)[CSRC_ ] = 0; \
(DescOut)[LLD_ ] = 1; \
} \
}
} (void)0

#define MIndxTrans( I, J, i, j ) \
{ \
i = *I - 1; \
j = *J - 1; \
}
} (void)0

#if( _F2C_CALL_ == _F2C_ADD_ )
/*
Expand Down
2 changes: 1 addition & 1 deletion PBLAS/SRC/PTOOLS/PB_Cpaxpby.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ void PB_Cpaxpby( TYPE, CONJUG, M, N, ALPHA, A, IA, JA, DESCA, AROC,
BnprocsD );
PB_CVMinit( &VM, 0, AnpD, BnpD, Ainb1D, Binb1D, AnbD, BnbD,
p, q, AnprocsD, BnprocsD, lcmb );
if( npq = PB_CVMnpq( &VM ) )
if( ( npq = PB_CVMnpq( &VM ) ) )
{
if( ( RRorCC && ( Aroc == Broc ) &&
( AisR || ( AprocR == BprocR ) ) ) ||
Expand Down
2 changes: 1 addition & 1 deletion PBLAS/SRC/pcdotc_.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ void pcdotc_( N, DOT, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
* distributed in the same direction, or there is just one block to be exchanged
* or if both operands are similarly distributed in their respective direction.
*/
if( ( YmyprocR == YprocR ) )
if( YmyprocR == YprocR )
{
/*
* The processes owning a piece of sub( Y ) send it to the corresponding
Expand Down
2 changes: 1 addition & 1 deletion PBLAS/SRC/pcdotu_.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ void pcdotu_( N, DOT, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
* distributed in the same direction, or there is just one block to be exchanged
* or if both operands are similarly distributed in their respective direction.
*/
if( ( YmyprocR == YprocR ) )
if( YmyprocR == YprocR )
{
/*
* The processes owning a piece of sub( Y ) send it to the corresponding
Expand Down
2 changes: 1 addition & 1 deletion PBLAS/SRC/pcswap_.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ void pcswap_( N, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
YnprocsD );
PB_CVMinit( &VM, 0, XnpD, YnpD, Xinb1D, Yinb1D, XnbD, YnbD,
p, q, XnprocsD, YnprocsD, lcmb );
if( npq = PB_CVMnpq( &VM ) )
if( ( npq = PB_CVMnpq( &VM ) ) )
{
if( ( RRorCC && ( Xroc == Yroc ) &&
( XprocR == YprocR ) ) ||
Expand Down
2 changes: 1 addition & 1 deletion PBLAS/SRC/pddot_.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ void pddot_( N, DOT, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
* distributed in the same direction, or there is just one block to be exchanged
* or if both operands are similarly distributed in their respective direction.
*/
if( ( YmyprocR == YprocR ) )
if( YmyprocR == YprocR )
{
/*
* The processes owning a piece of sub( Y ) send it to the corresponding
Expand Down
2 changes: 1 addition & 1 deletion PBLAS/SRC/pdswap_.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ void pdswap_( N, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
YnprocsD );
PB_CVMinit( &VM, 0, XnpD, YnpD, Xinb1D, Yinb1D, XnbD, YnbD,
p, q, XnprocsD, YnprocsD, lcmb );
if( npq = PB_CVMnpq( &VM ) )
if( ( npq = PB_CVMnpq( &VM ) ) )
{
if( ( RRorCC && ( Xroc == Yroc ) &&
( XprocR == YprocR ) ) ||
Expand Down
2 changes: 1 addition & 1 deletion PBLAS/SRC/psdot_.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ void psdot_( N, DOT, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
* distributed in the same direction, or there is just one block to be exchanged
* or if both operands are similarly distributed in their respective direction.
*/
if( ( YmyprocR == YprocR ) )
if( YmyprocR == YprocR )
{
/*
* The processes owning a piece of sub( Y ) send it to the corresponding
Expand Down
2 changes: 1 addition & 1 deletion PBLAS/SRC/psswap_.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ void psswap_( N, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
YnprocsD );
PB_CVMinit( &VM, 0, XnpD, YnpD, Xinb1D, Yinb1D, XnbD, YnbD,
p, q, XnprocsD, YnprocsD, lcmb );
if( npq = PB_CVMnpq( &VM ) )
if( ( npq = PB_CVMnpq( &VM ) ) )
{
if( ( RRorCC && ( Xroc == Yroc ) &&
( XprocR == YprocR ) ) ||
Expand Down
2 changes: 1 addition & 1 deletion PBLAS/SRC/pzdotc_.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ void pzdotc_( N, DOT, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
* distributed in the same direction, or there is just one block to be exchanged
* or if both operands are similarly distributed in their respective direction.
*/
if( ( YmyprocR == YprocR ) )
if( YmyprocR == YprocR )
{
/*
* The processes owning a piece of sub( Y ) send it to the corresponding
Expand Down
2 changes: 1 addition & 1 deletion PBLAS/SRC/pzdotu_.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ void pzdotu_( N, DOT, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
* distributed in the same direction, or there is just one block to be exchanged
* or if both operands are similarly distributed in their respective direction.
*/
if( ( YmyprocR == YprocR ) )
if( YmyprocR == YprocR )
{
/*
* The processes owning a piece of sub( Y ) send it to the corresponding
Expand Down
2 changes: 1 addition & 1 deletion PBLAS/SRC/pzswap_.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ void pzswap_( N, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
YnprocsD );
PB_CVMinit( &VM, 0, XnpD, YnpD, Xinb1D, Yinb1D, XnbD, YnbD,
p, q, XnprocsD, YnprocsD, lcmb );
if( npq = PB_CVMnpq( &VM ) )
if( ( npq = PB_CVMnpq( &VM ) ) )
{
if( ( RRorCC && ( Xroc == Yroc ) &&
( XprocR == YprocR ) ) ||
Expand Down
10 changes: 5 additions & 5 deletions REDIST/SRC/pcgemr.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,11 +459,11 @@ Cpcgemr2d(m, n,
if (myprow0 >= 0 && mypcol0 >= 0) {
/* Initialize pointer variables */
setmemory(&ptrsendbuff, memoryblocksize(ma));
}; /* if (mypnum < p0 * q0) */
} /* if (mypnum < p0 * q0) */
if (myprow1 >= 0 && mypcol1 >= 0) {
/* Initialize pointer variables */
setmemory(&ptrrecvbuff, memoryblocksize(mb));
}; /* if (mypnum < p1 * q1) */
} /* if (mypnum < p1 * q1) */
/* allocing room for the tabs, alloc for the worst case,local_n or local_m
* intervals, in fact the worst case should be less, perhaps half that,I
* should think of that one day. */
Expand Down Expand Up @@ -554,10 +554,10 @@ Cpcgemr2d(m, n,
/* don't forget to clean up things! */
if (myprow1 >= 0 && mypcol1 >= 0) {
freememory((char *) ptrrecvbuff);
};
}
if (myprow0 >= 0 && mypcol0 >= 0) {
freememory((char *) ptrsendbuff);
};
}
if (nprow != 1)
Cblacs_gridexit(gcontext);
free(v_inter);
Expand Down Expand Up @@ -634,7 +634,7 @@ Int _m,_n,_lda,_ldb; \
_b += _ldb; \
_a += _lda; \
} \
}
} (void)0
static2 Int
block2buff(IDESC *vi, Int vinb, IDESC *hi, Int hinb, complex *ptra, MDESC *ma, complex *buff)
{
Expand Down
8 changes: 4 additions & 4 deletions REDIST/SRC/pctrmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,11 +476,11 @@ Cpctrmr2d(uplo, diag, m, n,
if (myprow0 >= 0 && mypcol0 >= 0) {
/* Initialize pointer variables */
setmemory(&ptrsendbuff, memoryblocksize(ma));
}; /* if (mypnum < p0 * q0) */
} /* if (mypnum < p0 * q0) */
if (myprow1 >= 0 && mypcol1 >= 0) {
/* Initialize pointer variables */
setmemory(&ptrrecvbuff, memoryblocksize(mb));
}; /* if (mypnum < p1 * q1) */
} /* if (mypnum < p1 * q1) */
/* allocing room for the tabs, alloc for the worst case,local_n or local_m
* intervals, in fact the worst case should be less, perhaps half that,I
* should think of that one day. */
Expand Down Expand Up @@ -576,10 +576,10 @@ Cpctrmr2d(uplo, diag, m, n,
/* don't forget to clean up things! */
if (myprow1 >= 0 && mypcol1 >= 0) {
freememory((char *) ptrrecvbuff);
};
}
if (myprow0 >= 0 && mypcol0 >= 0) {
freememory((char *) ptrsendbuff);
};
}
if (nprow != 1)
Cblacs_gridexit(gcontext);
free(v_inter);
Expand Down
4 changes: 2 additions & 2 deletions REDIST/SRC/pctrmr2.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ insidemat(uplo, diag, i, j, m, n, offset)
Int virtualline; /* virtual first line if the matrix was extended with
* negative indices */
Int off;
diagcol = max(n - m, 0);;
diagcol = max(n - m, 0);
virtualline = j - diagcol + (toupper(*diag) == 'U');
firstline = max(0, virtualline);
off = max(firstline - i, 0);
Expand Down Expand Up @@ -233,7 +233,7 @@ intersect(uplo, diag,
printf("action is %d outside the scope of the case [0..2] !! \n ", action);
exit(0);
break;
}; /* switch (action) */
} /* switch (action) */
}/* intersect() */
/* scan_intervals: scans two distributions in one dimension, and compute the
* intersections on the local processor. result must be long enough to
Expand Down
Loading

0 comments on commit 0234af9

Please sign in to comment.