summaryrefslogtreecommitdiff
path: root/6
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-09-10 23:45:59 -0700
committerOri Bernstein <ori@eigenstate.org>2016-09-10 23:45:59 -0700
commit52c9fbc7ecefe80d228d7666cdddc72bb7f95ebf (patch)
treeaba8b59e23ea41aa31205164b0a103ba84e7467c /6
parent225486558c1552baf09cae2a17d313b061ee6edd (diff)
downloadmc-52c9fbc7ecefe80d228d7666cdddc72bb7f95ebf.tar.gz
Fix minimized integer encoding.
The bit munging was wrong. Oops.
Diffstat (limited to '6')
-rw-r--r--6/genp9.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/6/genp9.c b/6/genp9.c
index b1edb80..32d9e8b 100644
--- a/6/genp9.c
+++ b/6/genp9.c
@@ -297,7 +297,7 @@ static size_t encodemin(FILE *fd, uvlong val, size_t off, char *lbl)
n = 0;
shift = 8 - i;
b = ~0ull << (shift + 1);
- b |= val & ((1 << (8 - shift)) - 1);
+ b |= val & ~(~0ull << shift);
fprintf(fd, "\tDATA %s+%zd(SB)/1,$%u\n", lbl, off, b);
val >>= shift;
while (val != 0) {