@@ -147,7 +147,9 @@ static void Icheck(IntegerRep *rep)
147147
148148static void Iclear_from (IntegerRep *rep, int p)
149149{
150+ // NOLINTBEGIN(misc-const-correctness)
150151 unsigned short *cp = &(rep->s [p]);
152+ // NOLINTEND(misc-const-correctness)
151153 const unsigned short *cf = &(rep->s [rep->len ]);
152154 while (cp < cf) {
153155 *cp++ = 0 ;
@@ -723,7 +725,9 @@ IntegerRep *add(const IntegerRep *x, int negatex, const IntegerRep *y, int negat
723725 else {
724726 r = Icalloc (r, calc_len (xl, yl, 0 ));
725727 }
728+ // NOLINTBEGIN(misc-const-correctness)
726729 unsigned short *rs = r->s ;
730+ // NOLINTEND(misc-const-correctness)
727731 const unsigned short *as;
728732 const unsigned short *bs;
729733 const unsigned short *topa;
@@ -834,7 +838,9 @@ IntegerRep *add(const IntegerRep *x, int negatex, long y, IntegerRep *r)
834838 else {
835839 r = Icalloc (r, calc_len (xl, yl, 0 ));
836840 }
841+ // NOLINTBEGIN(misc-const-correctness)
837842 unsigned short *rs = r->s ;
843+ // NOLINTEND(misc-const-correctness)
838844 const unsigned short *as;
839845 const unsigned short *bs;
840846 const unsigned short *topa;
@@ -904,7 +910,9 @@ IntegerRep *multiply(const IntegerRep *x, const IntegerRep *y, IntegerRep *r)
904910 r = Icalloc (r, rl);
905911 }
906912 unsigned short *rs = r->s ;
913+ // NOLINTBEGIN(misc-const-correctness)
907914 unsigned short *topr = &(rs[rl]);
915+ // NOLINTEND(misc-const-correctness)
908916
909917 // use best inner/outer loop params given constraints
910918 unsigned short *currentr;
@@ -965,7 +973,9 @@ IntegerRep *multiply(const IntegerRep *x, const IntegerRep *y, IntegerRep *r)
965973 {
966974 r = Iresize (r, rl);
967975 unsigned short *botr = r->s ;
976+ // NOLINTBEGIN(misc-const-correctness)
968977 unsigned short *topr = &(botr[rl]);
978+ // NOLINTEND(misc-const-correctness)
969979 unsigned short *rs = &(botr[rl - 2 ]);
970980
971981 const unsigned short *bota = (xrsame) ? botr : x->s ;
@@ -979,7 +989,9 @@ IntegerRep *multiply(const IntegerRep *x, const IntegerRep *y, IntegerRep *r)
979989 *rs = 0 ;
980990
981991 for (;;) {
992+ // NOLINTBEGIN(misc-const-correctness)
982993 unsigned short *rt = rs;
994+ // NOLINTEND(misc-const-correctness)
983995 unsigned long sum = prod + (unsigned long )(*rt);
984996 *rt++ = extract (sum);
985997 sum = down (sum);
@@ -1054,7 +1066,9 @@ IntegerRep *multiply(const IntegerRep *x, long y, IntegerRep *r)
10541066 }
10551067
10561068 unsigned short *rs = r->s ;
1069+ // NOLINTBEGIN(misc-const-correctness)
10571070 unsigned short *topr = &(rs[rl]);
1071+ // NOLINTEND(misc-const-correctness)
10581072 unsigned short *currentr;
10591073 const unsigned short *bota;
10601074 const unsigned short *as;
@@ -1191,7 +1205,9 @@ static int unscale(const unsigned short *x, int xl, unsigned short y, unsigned s
11911205 }
11921206 else if (q != nullptr ) {
11931207 unsigned short *botq = q;
1208+ // NOLINTBEGIN(misc-const-correctness)
11941209 unsigned short *qs = &(botq[xl - 1 ]);
1210+ // NOLINTEND(misc-const-correctness)
11951211 const unsigned short *xs = &(x[xl - 1 ]);
11961212 unsigned long rem = 0 ;
11971213 while (qs >= botq) {
@@ -1646,7 +1662,9 @@ IntegerRep *lshift(const IntegerRep *x, long y, IntegerRep *r)
16461662 }
16471663
16481664 unsigned short *botr = r->s ;
1665+ // NOLINTBEGIN(misc-const-correctness)
16491666 unsigned short *rs = &(botr[rl - 1 ]);
1667+ // NOLINTEND(misc-const-correctness)
16501668 const unsigned short *botx = (xrsame) ? botr : x->s ;
16511669 const unsigned short *xs = &(botx[xl - 1 ]);
16521670 unsigned long a = 0 ;
@@ -1673,7 +1691,9 @@ IntegerRep *lshift(const IntegerRep *x, long y, IntegerRep *r)
16731691 }
16741692 const int rw = I_SHIFT - sw;
16751693 unsigned short *rs = r->s ;
1694+ // NOLINTBEGIN(misc-const-correctness)
16761695 unsigned short *topr = &(rs[rl]);
1696+ // NOLINTEND(misc-const-correctness)
16771697 const unsigned short *botx = (xrsame) ? rs : x->s ;
16781698 const unsigned short *xs = &(botx[bw]);
16791699 const unsigned short *topx = &(botx[xl]);
@@ -1724,7 +1744,9 @@ IntegerRep *bitop(const IntegerRep *x, const IntegerRep *y, IntegerRep *r, char
17241744 }
17251745 r->sgn = xsgn;
17261746 unsigned short *rs = r->s ;
1747+ // NOLINTBEGIN(misc-const-correctness)
17271748 unsigned short *topr = &(rs[r->len ]);
1749+ // NOLINTEND(misc-const-correctness)
17281750 const unsigned short *as;
17291751 const unsigned short *bs;
17301752 const unsigned short *topb;
@@ -1800,7 +1822,9 @@ IntegerRep *bitop(const IntegerRep *x, long y, IntegerRep *r, char op)
18001822 }
18011823 r->sgn = xsgn;
18021824 unsigned short *rs = r->s ;
1825+ // NOLINTBEGIN(misc-const-correctness)
18031826 unsigned short *topr = &(rs[r->len ]);
1827+ // NOLINTEND(misc-const-correctness)
18041828 const unsigned short *as;
18051829 const unsigned short *bs;
18061830 const unsigned short *topb;
@@ -1850,7 +1874,9 @@ IntegerRep *Compl(const IntegerRep *src, IntegerRep *r)
18501874 nonnil (src);
18511875 r = Icopy (r, src);
18521876 unsigned short *s = r->s ;
1877+ // NOLINTBEGIN(misc-const-correctness)
18531878 unsigned short *top = &(s[r->len - 1 ]);
1879+ // NOLINTEND(misc-const-correctness)
18541880 while (s < top) {
18551881 const unsigned short cmp = ~(*s);
18561882 *s++ = cmp;
@@ -2240,7 +2266,9 @@ std::string cvtItoa(const IntegerRep *x, std::string fmt, int &fmtlen, int base,
22402266 int width, int align_right, char fillchar, char Xcase, int showpos)
22412267{
22422268 char *e = const_cast <char *>(fmt.c_str ()) + fmtlen - 1 ;
2269+ // NOLINTBEGIN(misc-const-correctness)
22432270 char *s = e;
2271+ // NOLINTEND(misc-const-correctness)
22442272 *--s = 0 ;
22452273
22462274 if (x->len == 0 ) {
@@ -2323,7 +2351,7 @@ std::string cvtItoa(const IntegerRep *x, std::string fmt, int &fmtlen, int base,
23232351#ifdef UNUSED
23242352 int gap = (int )(s - p);
23252353#endif // UNUSED
2326- for (char *t = s; *t != 0 ; ++t, ++p) {
2354+ for (const char *t = s; *t != 0 ; ++t, ++p) {
23272355 *p = *t;
23282356 }
23292357 while (w++ < width) {
0 commit comments