Skip to content

Commit

Permalink
libdecnumber/dpd/decimal64: Fix compiler warning from Clang 15
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
huth committed Nov 11, 2022
1 parent 5ab8ba9 commit b2a3cbb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libdecnumber/dpd/decimal64.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,6 @@ static const uInt multies[]={131073, 26215, 5243, 1049, 210};
#endif
void decDigitsToDPD(const decNumber *dn, uInt *targ, Int shift) {
Int cut; /* work */
Int n; /* output bunch counter */
Int digits=dn->digits; /* digit countdown */
uInt dpd; /* densely packed decimal value */
uInt bin; /* binary value 0-999 */
Expand Down Expand Up @@ -676,7 +675,7 @@ void decDigitsToDPD(const decNumber *dn, uInt *targ, Int shift) {
bin=0; /* [keep compiler quiet] */
#endif

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

0 comments on commit b2a3cbb

Please sign in to comment.