about summary refs log tree commit diff stats
path: root/miasm2/jitter/op_semantics.c
diff options
context:
space:
mode:
authorAxel Souchet <0vercl0k@tuxfamily.org>2018-09-09 06:11:00 -0700
committerserpilliere <serpilliere@users.noreply.github.com>2018-09-09 15:11:00 +0200
commit8e6b39d80e9f8db8389bd2a8106d0f64b91c19e9 (patch)
treedbf342089690704e89c10532b83d1d81709a49f4 /miasm2/jitter/op_semantics.c
parente61116884ac7879db08313542c6c28a8b00297c5 (diff)
downloadfocaccia-miasm-8e6b39d80e9f8db8389bd2a8106d0f64b91c19e9.tar.gz
focaccia-miasm-8e6b39d80e9f8db8389bd2a8106d0f64b91c19e9.zip
Adds Windows support and AppVeyor CI (#835)
* Get miasm to work on Windows, also add AppVeyor CI

* Fix gcc jitter on Linux

* Make the dse_crackme tests work on Windows

* calling build and then install is less confusing than install twice

* fix os.rename race condition on Windows

* clean it up

* Clean up after the unused cl.exe's artifacts

* Use is_win instead of an additional check

* Fix issue on Windows where 'w' and 'wb' modes are different

* Address review feedback

* setuptools is actually not required, so reverting
Diffstat (limited to 'miasm2/jitter/op_semantics.c')
-rw-r--r--miasm2/jitter/op_semantics.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/miasm2/jitter/op_semantics.c b/miasm2/jitter/op_semantics.c
index a0c2316e..33a07054 100644
--- a/miasm2/jitter/op_semantics.c
+++ b/miasm2/jitter/op_semantics.c
@@ -140,21 +140,21 @@ int imul_hi_op_08(char a, char b)
 {
 	int64_t res = 0;
 	res = a*b;
-	return res>>8;
+	return (int)(res>>8);
 }
 
 int imul_hi_op_16(short a, short b)
 {
 	int64_t res = 0;
 	res = a*b;
-	return res>>16;
+	return (int)(res>>16);
 }
 
 int imul_hi_op_32(int a, int b)
 {
 	int64_t res = 0;
 	res = (int64_t)a*(int64_t)b;
-	return res>>32ULL;
+	return (int)(res>>32ULL);
 }
 
 unsigned int umul16_lo(unsigned short a, unsigned short b)
@@ -259,9 +259,9 @@ unsigned int cntleadzeros(uint64_t size, uint64_t src)
 
 	for (i=(int64_t)size-1; i>=0; i--){
 		if (src & (1ull << i))
-			return size - (i + 1);
+			return (unsigned int)(size - (i + 1));
 	}
-	return size;
+	return (unsigned int)size;
 }
 
 /*
@@ -277,9 +277,9 @@ unsigned int cnttrailzeros(uint64_t size, uint64_t src)
 	uint64_t i;
 	for (i=0; i<size; i++){
 		if (src & (1ull << i))
-			return i;
+			return (unsigned int)i;
 	}
-	return size;
+	return (unsigned int)size;
 }