Skip to content

Commit b2a3cbb

Browse files
committed
libdecnumber/dpd/decimal64: Fix compiler warning from Clang 15
Clang 15 from Fedora 37 complains: ../libdecnumber/dpd/decimal64.c:620:8: error: variable 'n' set but not used [-Werror,-Wunused-but-set-variable] Int n; /* output bunch counter */ ^ 1 error generated. Remove the unused variable to silence the compiler warning. Message-Id: <[email protected]> Reviewed-by: Cédric Le Goater <[email protected]> Signed-off-by: Thomas Huth <[email protected]>
1 parent 5ab8ba9 commit b2a3cbb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

libdecnumber/dpd/decimal64.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,6 @@ static const uInt multies[]={131073, 26215, 5243, 1049, 210};
617617
#endif
618618
void decDigitsToDPD(const decNumber *dn, uInt *targ, Int shift) {
619619
Int cut; /* work */
620-
Int n; /* output bunch counter */
621620
Int digits=dn->digits; /* digit countdown */
622621
uInt dpd; /* densely packed decimal value */
623622
uInt bin; /* binary value 0-999 */
@@ -676,7 +675,7 @@ void decDigitsToDPD(const decNumber *dn, uInt *targ, Int shift) {
676675
bin=0; /* [keep compiler quiet] */
677676
#endif
678677

679-
for(n=0; digits>0; n++) { /* each output bunch */
678+
while (digits > 0) { /* each output bunch */
680679
#if DECDPUN==3 /* fast path, 3-at-a-time */
681680
bin=*inu; /* 3 digits ready for convert */
682681
digits-=3; /* [may go negative] */

0 commit comments

Comments
 (0)