aboutsummaryrefslogtreecommitdiff
path: root/src/libmp/port/mpvecdigmuladd.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-04-01 19:24:03 +0000
committerrsc <devnull@localhost>2006-04-01 19:24:03 +0000
commitcbeb0b26e4c7caa8d1b47de791a7418dc20a4567 (patch)
treee0f7e445de1aa22a42ef873dc4b1118a8105ae93 /src/libmp/port/mpvecdigmuladd.c
parent226d80b8213821af0cbf092d1507c52b504fd368 (diff)
downloadplan9port-cbeb0b26e4c7caa8d1b47de791a7418dc20a4567.tar.gz
plan9port-cbeb0b26e4c7caa8d1b47de791a7418dc20a4567.tar.bz2
plan9port-cbeb0b26e4c7caa8d1b47de791a7418dc20a4567.zip
Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms.
Diffstat (limited to 'src/libmp/port/mpvecdigmuladd.c')
-rw-r--r--src/libmp/port/mpvecdigmuladd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libmp/port/mpvecdigmuladd.c b/src/libmp/port/mpvecdigmuladd.c
index 28d4205a..909314f0 100644
--- a/src/libmp/port/mpvecdigmuladd.c
+++ b/src/libmp/port/mpvecdigmuladd.c
@@ -11,19 +11,19 @@ mpdigmul(mpdigit a, mpdigit b, mpdigit *p)
mpdigit x, ah, al, bh, bl, p1, p2, p3, p4;
int carry;
- // half digits
+ /* half digits */
ah = HI(a);
al = LO(a);
bh = HI(b);
bl = LO(b);
- // partial products
+ /* partial products */
p1 = ah*bl;
p2 = bh*al;
p3 = bl*al;
p4 = ah*bh;
- // p = ((p1+p2)<<(Dbits/2)) + (p4<<Dbits) + p3
+ /* p = ((p1+p2)<<(Dbits/2)) + (p4<<Dbits) + p3 */
carry = 0;
x = p1<<(Dbits/2);
p3 += x;
@@ -33,12 +33,12 @@ mpdigmul(mpdigit a, mpdigit b, mpdigit *p)
p3 += x;
if(p3 < x)
carry++;
- p4 += carry + HI(p1) + HI(p2); // can't carry out of the high digit
+ p4 += carry + HI(p1) + HI(p2); /* can't carry out of the high digit */
p[0] = p3;
p[1] = p4;
}
-// prereq: p must have room for n+1 digits
+/* prereq: p must have room for n+1 digits */
void
mpvecdigmuladd(mpdigit *b, int n, mpdigit m, mpdigit *p)
{
@@ -66,7 +66,7 @@ mpvecdigmuladd(mpdigit *b, int n, mpdigit m, mpdigit *p)
*p = part[1] + carry;
}
-// prereq: p must have room for n+1 digits
+/* prereq: p must have room for n+1 digits */
int
mpvecdigmulsub(mpdigit *b, int n, mpdigit m, mpdigit *p)
{