projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Two's complement I/O fixes.
[u/mdw/catacomb]
/
mpx.c
diff --git
a/mpx.c
b/mpx.c
index
d7ea70a
..
6375c3e
100644
(file)
--- a/
mpx.c
+++ b/
mpx.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: mpx.c,v 1.1
4 2002/10/19 18:55:08
mdw Exp $
+ * $Id: mpx.c,v 1.1
5 2002/10/20 01:12:31
mdw Exp $
*
* Low-level multiprecision arithmetic
*
*
* Low-level multiprecision arithmetic
*
@@
-30,6
+30,9
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: mpx.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: mpx.c,v $
+ * Revision 1.15 2002/10/20 01:12:31 mdw
+ * Two's complement I/O fixes.
+ *
* Revision 1.14 2002/10/19 18:55:08 mdw
* Fix overflows in shift primitives.
*
* Revision 1.14 2002/10/19 18:55:08 mdw
* Fix overflows in shift primitives.
*
@@
-281,12
+284,12
@@
void mpx_storel2cn(const mpw *v, const mpw *vl, void *pp, size_t sz)
bits -= 8;
}
b = U8(~b + c);
bits -= 8;
}
b = U8(~b + c);
- c = !b;
+ c =
c &&
!b;
*p++ = b;
}
while (p < q) {
b = U8(~b + c);
*p++ = b;
}
while (p < q) {
b = U8(~b + c);
- c = !b;
+ c =
c &&
!b;
*p++ = b;
b = 0;
}
*p++ = b;
b = 0;
}
@@
-318,7
+321,7
@@
void mpx_loadl2cn(mpw *v, mpw *vl, const void *pp, size_t sz)
return;
while (p < q) {
n = U8(~(*p++) + c);
return;
while (p < q) {
n = U8(~(*p++) + c);
- c = !n;
+ c =
c &&
!n;
w |= n << bits;
bits += 8;
if (bits >= MPW_BITS) {
w |= n << bits;
bits += 8;
if (bits >= MPW_BITS) {
@@
-371,12
+374,12
@@
void mpx_storeb2cn(const mpw *v, const mpw *vl, void *pp, size_t sz)
bits -= 8;
}
b = U8(~b + c);
bits -= 8;
}
b = U8(~b + c);
- c = !b;
+ c =
c &&
!b;
*--q = b;
}
while (q > p) {
b = ~b + c;
*--q = b;
}
while (q > p) {
b = ~b + c;
- c = !(b & 0xff);
+ c =
c &&
!(b & 0xff);
*--q = b;
b = 0;
}
*--q = b;
b = 0;
}
@@
-408,7
+411,7
@@
void mpx_loadb2cn(mpw *v, mpw *vl, const void *pp, size_t sz)
return;
while (q > p) {
n = U8(~(*--q) + c);
return;
while (q > p) {
n = U8(~(*--q) + c);
- c = !n;
+ c =
c &&
!n;
w |= n << bits;
bits += 8;
if (bits >= MPW_BITS) {
w |= n << bits;
bits += 8;
if (bits >= MPW_BITS) {