From b8fffd71ca12372b3d64121520e958ab66485e23 Mon Sep 17 00:00:00 2001
From: Etienne Brateau <etienne.brateau@ensiie.fr>
Date: Sun, 10 Feb 2019 18:36:20 +0100
Subject: [PATCH] Fix setsize for x64

---
 src/logsimh.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/logsimh.c b/src/logsimh.c
index 95069a2..dc65bbb 100644
--- a/src/logsimh.c
+++ b/src/logsimh.c
@@ -1446,9 +1446,9 @@ static void getpindata(pdrec **pindata, long numpins, uchar *proc, struct LOC_co
 }
 
 
-static long setbytes(long bits, struct LOC_compilepage *LINK)
+static size_t setbytes(size_t bits, struct LOC_compilepage *LINK)
 {
-	return ((bits + 63) / 32 * 4);
+	return ((bits + 63) / 32 * sizeof(long));
 }
 
 /* Local variables for parsegates: */
@@ -1488,7 +1488,8 @@ static void subupdate(log_grec *g1, struct LOC_parsegates *LINK)
 static void parsegates(struct LOC_compilepage *LINK)
 {
 	struct LOC_parsegates V;
-	long i, j, num, best, setsize, first, numg, previnstrcount;
+	long i, j, num, best, first, numg, previnstrcount;
+	size_t setsize;
 	long *defs, *tdefs;
 	log_grec *g1;
 	gaterec *glist;
@@ -2890,7 +2891,7 @@ static void trymoveif(struct LOC_simplstmt *LINK)
 	long *defv1, *usev1, *defv2, *usev2;
 	int good1, good2, localchg;
 	instrops otherif;
-	long i;
+	size_t i;
 
 	otherif = numbertoif(~iftonumber(LINK->ip, LINK), LINK);
 	defv1 = NULL;
-- 
GitLab