Skip to content

Commit 0234af9

Browse files
authored
Merge pull request Reference-ScaLAPACK#94 from prj-/jolivet/fix-warnings
Fix -Wextra-semi-stmt -Wparentheses
2 parents d052a77 + e1b43e3 commit 0234af9

31 files changed

+91
-91
lines changed

BLACS/SRC/BI_MringComb.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void BI_MringComb(BLACSCONTEXT *ctxt, BLACBUFF *bp, BLACBUFF *bp2,
1616
if (Np < 2) return;
1717
Iam = ctxt->scp->Iam;
1818
msgid = Mscopeid(ctxt);
19-
if (REBS = (dest == -1)) dest = 0;
19+
if ( ( REBS = (dest == -1) ) ) dest = 0;
2020

2121
if (nrings > 0)
2222
{

BLACS/SRC/BI_TreeComb.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void BI_TreeComb(BLACSCONTEXT *ctxt, BLACBUFF *bp, BLACBUFF *bp2,
8585
Iam = ctxt->scp->Iam;
8686
msgid = Mscopeid(ctxt);
8787
Rmsgid = Mscopeid(ctxt);
88-
if (REBS = (dest == -1)) dest = 0;
88+
if ( ( REBS = (dest == -1) ) ) dest = 0;
8989

9090
mydist = (Np + Iam - dest) % Np;
9191
if (REBS)

BLACS/SRC/Bdef.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Int BI_ContxtNum(BLACSCONTEXT *ctxt);
154154
(npcol0) = (ctxt)->rscp.Np;\
155155
(myrow0) = (ctxt)->cscp.Iam;\
156156
(mycol0) = (ctxt)->rscp.Iam;\
157-
}
157+
} (void)0
158158

159159
/*
160160
* These routines return coordinates based on nodes number, or node number
@@ -166,9 +166,9 @@ Int BI_ContxtNum(BLACSCONTEXT *ctxt);
166166
{\
167167
(prow) = (node) / (ctxt)->rscp.Np;\
168168
(pcol) = (node) % (ctxt)->rscp.Np;\
169-
}
169+
} (void)0
170170
#define Mvpcoord(ctxt, node, prow, pcol) \
171-
Mpcoord((ctxt), (node), (prow), (pcol));
171+
Mpcoord((ctxt), (node), (prow), (pcol))
172172

173173
#define Mkpnum(ctxt, prow, pcol) ( (prow)*(ctxt)->rscp.Np+(pcol) )
174174
#define Mvkpnum(ctxt, prow, pcol) ( (prow)*(ctxt)->rscp.Np+(pcol) )
@@ -178,7 +178,7 @@ Int BI_ContxtNum(BLACSCONTEXT *ctxt);
178178
*/
179179
#define Mscopeid(ctxt) (ctxt)->scp->ScpId; \
180180
if (++(ctxt)->scp->ScpId == (ctxt)->scp->MaxId) \
181-
(ctxt)->scp->ScpId = (ctxt)->scp->MinId;
181+
(ctxt)->scp->ScpId = (ctxt)->scp->MinId
182182

183183
/*
184184
* Get context, and check for validity if debug level is high
@@ -195,13 +195,13 @@ Int BI_ContxtNum(BLACSCONTEXT *ctxt);
195195
BI_BlacsErr(-1, __LINE__, __FILE__, "Invalid context, handle=%d",\
196196
(Context));\
197197
(ctxtptr) = BI_MyContxts[(Context)];\
198-
}
198+
} (void)0
199199
#else
200200
#define MGetConTxt(Context, ctxtptr)\
201201
{\
202202
extern BLACSCONTEXT **BI_MyContxts;\
203203
(ctxtptr) = BI_MyContxts[(Context)];\
204-
}
204+
} (void)0
205205
#endif
206206
/*
207207
* This macro handles MPI errors
@@ -223,7 +223,7 @@ Int BI_ContxtNum(BLACSCONTEXT *ctxt);
223223
{ \
224224
extern Int BI_Iam; \
225225
fprintf(stderr, "%d: line %d of file %s\n", BI_Iam, __LINE__, __FILE__); \
226-
}
226+
} (void)0
227227

228228
/*
229229
* These macros allow for the funky function declarations and character handling
@@ -282,7 +282,7 @@ Int BI_ContxtNum(BLACSCONTEXT *ctxt);
282282
else\
283283
(length) = ( (m) * ( (n) - (m) ) + ( (m)*(m) ) - ( (m)*(m) )/2 +\
284284
(m)/2 - (m) * (length) ) * (bytes);\
285-
}
285+
} (void)0
286286

287287
/*
288288
* These macros call the correct packing/unpacking routines

PBLAS/SRC/PBtools.h

+12-12
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
inbt_ = (inb_) - (i_); \
141141
if( inbt_ <= 0 ) \
142142
inbt_ = ( (-inbt_) / (nb_) + 1 ) * (nb_) + inbt_; \
143-
inbt_ = MIN( inbt_, (n_) );
143+
inbt_ = MIN( inbt_, (n_) )
144144

145145
#define Mlastnb( inbt_, n_, i_, inb_, nb_ ) \
146146
inbt_ = (i_) + (n_) - (inb_); \
@@ -149,7 +149,7 @@
149149
inbt_ = -( ( (nb_)+inbt_-1 )/(nb_)-1 )*(nb_) + inbt_; \
150150
inbt_ = MIN( inbt_, (n_) ); \
151151
} \
152-
else { inbt_ = (n_); };
152+
else { inbt_ = (n_); } (void)0
153153
/*
154154
* Does the index interval i_:i_+n_-1 spans more than one process rows
155155
* or columns ?
@@ -194,7 +194,7 @@
194194
{ \
195195
ig_ = (il_); \
196196
} \
197-
}
197+
} (void)0
198198
/*
199199
* Mindxg2p returns the process coodinate owning the entry globally
200200
* indexed by ig_.
@@ -211,7 +211,7 @@
211211
{ \
212212
proc_ = (srcproc_); \
213213
} \
214-
}
214+
} (void)0
215215
/*
216216
* Mnumroc computes the # of local indexes np_ residing in the process
217217
* of coordinate proc_ corresponding to the interval of global indexes
@@ -294,7 +294,7 @@
294294
{ \
295295
np_ = (n_); \
296296
} \
297-
}
297+
} (void)0
298298

299299
#define Mnpreroc( np_, n_, i_, inb_, nb_, proc_, srcproc_, nprocs_ ) \
300300
{ \
@@ -367,7 +367,7 @@
367367
{ \
368368
np_ = 0; \
369369
} \
370-
}
370+
} (void)0
371371

372372
#define Mnnxtroc( np_, n_, i_, inb_, nb_, proc_, srcproc_, nprocs_ ) \
373373
{ \
@@ -422,7 +422,7 @@
422422
} \
423423
else \
424424
{ np_ = 0; } \
425-
}
425+
} (void)0
426426

427427

428428
#define Minfog2l( i_, j_, desc_, nr_, nc_, r_, c_, ii_, jj_, pr_, pc_ ) \
@@ -491,7 +491,7 @@
491491
{ \
492492
jj_ = (j_); \
493493
} \
494-
}
494+
} (void)0
495495

496496
/*
497497
* The following macros initialize or translate descriptors.
@@ -509,7 +509,7 @@
509509
(desc)[RSRC_ ] = (rsrc); \
510510
(desc)[CSRC_ ] = (csrc); \
511511
(desc)[LLD_ ] = (lld); \
512-
}
512+
} (void)0
513513

514514
#define MDescCopy(DescIn, DescOut) \
515515
{ \
@@ -524,7 +524,7 @@
524524
(DescOut)[CSRC_ ] = (DescIn)[CSRC_ ]; \
525525
(DescOut)[CTXT_ ] = (DescIn)[CTXT_ ]; \
526526
(DescOut)[LLD_ ] = (DescIn)[LLD_ ]; \
527-
}
527+
} (void)0
528528

529529
#define MDescTrans(DescIn, DescOut) \
530530
{ \
@@ -570,13 +570,13 @@
570570
(DescOut)[CSRC_ ] = 0; \
571571
(DescOut)[LLD_ ] = 1; \
572572
} \
573-
}
573+
} (void)0
574574

575575
#define MIndxTrans( I, J, i, j ) \
576576
{ \
577577
i = *I - 1; \
578578
j = *J - 1; \
579-
}
579+
} (void)0
580580

581581
#if( _F2C_CALL_ == _F2C_ADD_ )
582582
/*

PBLAS/SRC/PTOOLS/PB_Cpaxpby.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ void PB_Cpaxpby( TYPE, CONJUG, M, N, ALPHA, A, IA, JA, DESCA, AROC,
654654
BnprocsD );
655655
PB_CVMinit( &VM, 0, AnpD, BnpD, Ainb1D, Binb1D, AnbD, BnbD,
656656
p, q, AnprocsD, BnprocsD, lcmb );
657-
if( npq = PB_CVMnpq( &VM ) )
657+
if( ( npq = PB_CVMnpq( &VM ) ) )
658658
{
659659
if( ( RRorCC && ( Aroc == Broc ) &&
660660
( AisR || ( AprocR == BprocR ) ) ) ||

PBLAS/SRC/pcdotc_.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ void pcdotc_( N, DOT, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
526526
* distributed in the same direction, or there is just one block to be exchanged
527527
* or if both operands are similarly distributed in their respective direction.
528528
*/
529-
if( ( YmyprocR == YprocR ) )
529+
if( YmyprocR == YprocR )
530530
{
531531
/*
532532
* The processes owning a piece of sub( Y ) send it to the corresponding

PBLAS/SRC/pcdotu_.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ void pcdotu_( N, DOT, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
526526
* distributed in the same direction, or there is just one block to be exchanged
527527
* or if both operands are similarly distributed in their respective direction.
528528
*/
529-
if( ( YmyprocR == YprocR ) )
529+
if( YmyprocR == YprocR )
530530
{
531531
/*
532532
* The processes owning a piece of sub( Y ) send it to the corresponding

PBLAS/SRC/pcswap_.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ void pcswap_( N, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
658658
YnprocsD );
659659
PB_CVMinit( &VM, 0, XnpD, YnpD, Xinb1D, Yinb1D, XnbD, YnbD,
660660
p, q, XnprocsD, YnprocsD, lcmb );
661-
if( npq = PB_CVMnpq( &VM ) )
661+
if( ( npq = PB_CVMnpq( &VM ) ) )
662662
{
663663
if( ( RRorCC && ( Xroc == Yroc ) &&
664664
( XprocR == YprocR ) ) ||

PBLAS/SRC/pddot_.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ void pddot_( N, DOT, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
525525
* distributed in the same direction, or there is just one block to be exchanged
526526
* or if both operands are similarly distributed in their respective direction.
527527
*/
528-
if( ( YmyprocR == YprocR ) )
528+
if( YmyprocR == YprocR )
529529
{
530530
/*
531531
* The processes owning a piece of sub( Y ) send it to the corresponding

PBLAS/SRC/pdswap_.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ void pdswap_( N, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
658658
YnprocsD );
659659
PB_CVMinit( &VM, 0, XnpD, YnpD, Xinb1D, Yinb1D, XnbD, YnbD,
660660
p, q, XnprocsD, YnprocsD, lcmb );
661-
if( npq = PB_CVMnpq( &VM ) )
661+
if( ( npq = PB_CVMnpq( &VM ) ) )
662662
{
663663
if( ( RRorCC && ( Xroc == Yroc ) &&
664664
( XprocR == YprocR ) ) ||

PBLAS/SRC/psdot_.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ void psdot_( N, DOT, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
525525
* distributed in the same direction, or there is just one block to be exchanged
526526
* or if both operands are similarly distributed in their respective direction.
527527
*/
528-
if( ( YmyprocR == YprocR ) )
528+
if( YmyprocR == YprocR )
529529
{
530530
/*
531531
* The processes owning a piece of sub( Y ) send it to the corresponding

PBLAS/SRC/psswap_.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ void psswap_( N, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
658658
YnprocsD );
659659
PB_CVMinit( &VM, 0, XnpD, YnpD, Xinb1D, Yinb1D, XnbD, YnbD,
660660
p, q, XnprocsD, YnprocsD, lcmb );
661-
if( npq = PB_CVMnpq( &VM ) )
661+
if( ( npq = PB_CVMnpq( &VM ) ) )
662662
{
663663
if( ( RRorCC && ( Xroc == Yroc ) &&
664664
( XprocR == YprocR ) ) ||

PBLAS/SRC/pzdotc_.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ void pzdotc_( N, DOT, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
526526
* distributed in the same direction, or there is just one block to be exchanged
527527
* or if both operands are similarly distributed in their respective direction.
528528
*/
529-
if( ( YmyprocR == YprocR ) )
529+
if( YmyprocR == YprocR )
530530
{
531531
/*
532532
* The processes owning a piece of sub( Y ) send it to the corresponding

PBLAS/SRC/pzdotu_.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ void pzdotu_( N, DOT, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
526526
* distributed in the same direction, or there is just one block to be exchanged
527527
* or if both operands are similarly distributed in their respective direction.
528528
*/
529-
if( ( YmyprocR == YprocR ) )
529+
if( YmyprocR == YprocR )
530530
{
531531
/*
532532
* The processes owning a piece of sub( Y ) send it to the corresponding

PBLAS/SRC/pzswap_.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ void pzswap_( N, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
658658
YnprocsD );
659659
PB_CVMinit( &VM, 0, XnpD, YnpD, Xinb1D, Yinb1D, XnbD, YnbD,
660660
p, q, XnprocsD, YnprocsD, lcmb );
661-
if( npq = PB_CVMnpq( &VM ) )
661+
if( ( npq = PB_CVMnpq( &VM ) ) )
662662
{
663663
if( ( RRorCC && ( Xroc == Yroc ) &&
664664
( XprocR == YprocR ) ) ||

REDIST/SRC/pcgemr.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -459,11 +459,11 @@ Cpcgemr2d(m, n,
459459
if (myprow0 >= 0 && mypcol0 >= 0) {
460460
/* Initialize pointer variables */
461461
setmemory(&ptrsendbuff, memoryblocksize(ma));
462-
}; /* if (mypnum < p0 * q0) */
462+
} /* if (mypnum < p0 * q0) */
463463
if (myprow1 >= 0 && mypcol1 >= 0) {
464464
/* Initialize pointer variables */
465465
setmemory(&ptrrecvbuff, memoryblocksize(mb));
466-
}; /* if (mypnum < p1 * q1) */
466+
} /* if (mypnum < p1 * q1) */
467467
/* allocing room for the tabs, alloc for the worst case,local_n or local_m
468468
* intervals, in fact the worst case should be less, perhaps half that,I
469469
* should think of that one day. */
@@ -554,10 +554,10 @@ Cpcgemr2d(m, n,
554554
/* don't forget to clean up things! */
555555
if (myprow1 >= 0 && mypcol1 >= 0) {
556556
freememory((char *) ptrrecvbuff);
557-
};
557+
}
558558
if (myprow0 >= 0 && mypcol0 >= 0) {
559559
freememory((char *) ptrsendbuff);
560-
};
560+
}
561561
if (nprow != 1)
562562
Cblacs_gridexit(gcontext);
563563
free(v_inter);
@@ -634,7 +634,7 @@ Int _m,_n,_lda,_ldb; \
634634
_b += _ldb; \
635635
_a += _lda; \
636636
} \
637-
}
637+
} (void)0
638638
static2 Int
639639
block2buff(IDESC *vi, Int vinb, IDESC *hi, Int hinb, complex *ptra, MDESC *ma, complex *buff)
640640
{

REDIST/SRC/pctrmr.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -476,11 +476,11 @@ Cpctrmr2d(uplo, diag, m, n,
476476
if (myprow0 >= 0 && mypcol0 >= 0) {
477477
/* Initialize pointer variables */
478478
setmemory(&ptrsendbuff, memoryblocksize(ma));
479-
}; /* if (mypnum < p0 * q0) */
479+
} /* if (mypnum < p0 * q0) */
480480
if (myprow1 >= 0 && mypcol1 >= 0) {
481481
/* Initialize pointer variables */
482482
setmemory(&ptrrecvbuff, memoryblocksize(mb));
483-
}; /* if (mypnum < p1 * q1) */
483+
} /* if (mypnum < p1 * q1) */
484484
/* allocing room for the tabs, alloc for the worst case,local_n or local_m
485485
* intervals, in fact the worst case should be less, perhaps half that,I
486486
* should think of that one day. */
@@ -576,10 +576,10 @@ Cpctrmr2d(uplo, diag, m, n,
576576
/* don't forget to clean up things! */
577577
if (myprow1 >= 0 && mypcol1 >= 0) {
578578
freememory((char *) ptrrecvbuff);
579-
};
579+
}
580580
if (myprow0 >= 0 && mypcol0 >= 0) {
581581
freememory((char *) ptrsendbuff);
582-
};
582+
}
583583
if (nprow != 1)
584584
Cblacs_gridexit(gcontext);
585585
free(v_inter);

REDIST/SRC/pctrmr2.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ insidemat(uplo, diag, i, j, m, n, offset)
159159
Int virtualline; /* virtual first line if the matrix was extended with
160160
* negative indices */
161161
Int off;
162-
diagcol = max(n - m, 0);;
162+
diagcol = max(n - m, 0);
163163
virtualline = j - diagcol + (toupper(*diag) == 'U');
164164
firstline = max(0, virtualline);
165165
off = max(firstline - i, 0);
@@ -233,7 +233,7 @@ intersect(uplo, diag,
233233
printf("action is %d outside the scope of the case [0..2] !! \n ", action);
234234
exit(0);
235235
break;
236-
}; /* switch (action) */
236+
} /* switch (action) */
237237
}/* intersect() */
238238
/* scan_intervals: scans two distributions in one dimension, and compute the
239239
* intersections on the local processor. result must be long enough to

0 commit comments

Comments
 (0)