diff options
Diffstat (limited to 'dynasm/dasm_arm64.h')
-rw-r--r-- | dynasm/dasm_arm64.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/dynasm/dasm_arm64.h b/dynasm/dasm_arm64.h index 975f5867..47c9c37d 100644 --- a/dynasm/dasm_arm64.h +++ b/dynasm/dasm_arm64.h | |||
@@ -158,10 +158,10 @@ void dasm_setup(Dst_DECL, const void *actionlist) | |||
158 | #ifdef DASM_CHECKS | 158 | #ifdef DASM_CHECKS |
159 | #define CK(x, st) \ | 159 | #define CK(x, st) \ |
160 | do { if (!(x)) { \ | 160 | do { if (!(x)) { \ |
161 | D->status = DASM_S_##st|(p-D->actionlist-1); return; } } while (0) | 161 | D->status = DASM_S_##st|(int)(p-D->actionlist-1); return; } } while (0) |
162 | #define CKPL(kind, st) \ | 162 | #define CKPL(kind, st) \ |
163 | do { if ((size_t)((char *)pl-(char *)D->kind##labels) >= D->kind##size) { \ | 163 | do { if ((size_t)((char *)pl-(char *)D->kind##labels) >= D->kind##size) { \ |
164 | D->status = DASM_S_RANGE_##st|(p-D->actionlist-1); return; } } while (0) | 164 | D->status = DASM_S_RANGE_##st|(int)(p-D->actionlist-1); return; } } while (0) |
165 | #else | 165 | #else |
166 | #define CK(x, st) ((void)0) | 166 | #define CK(x, st) ((void)0) |
167 | #define CKPL(kind, st) ((void)0) | 167 | #define CKPL(kind, st) ((void)0) |
@@ -190,7 +190,9 @@ static int dasm_imm13(int lo, int hi) | |||
190 | unsigned long long n = (((unsigned long long)hi) << 32) | (unsigned int)lo; | 190 | unsigned long long n = (((unsigned long long)hi) << 32) | (unsigned int)lo; |
191 | unsigned long long m = 1ULL, a, b, c; | 191 | unsigned long long m = 1ULL, a, b, c; |
192 | if (n & 1) { n = ~n; inv = 1; } | 192 | if (n & 1) { n = ~n; inv = 1; } |
193 | a = n & -n; b = (n+a)&-(n+a); c = (n+a-b)&-(n+a-b); | 193 | a = n & (unsigned long long)-(long long)n; |
194 | b = (n+a)&(unsigned long long)-(long long)(n+a); | ||
195 | c = (n+a-b)&(unsigned long long)-(long long)(n+a-b); | ||
194 | xa = dasm_ffs(a); xb = dasm_ffs(b); | 196 | xa = dasm_ffs(a); xb = dasm_ffs(b); |
195 | if (c) { | 197 | if (c) { |
196 | w = dasm_ffs(c) - xa; | 198 | w = dasm_ffs(c) - xa; |
@@ -406,7 +408,7 @@ int dasm_link(Dst_DECL, size_t *szp) | |||
406 | 408 | ||
407 | #ifdef DASM_CHECKS | 409 | #ifdef DASM_CHECKS |
408 | #define CK(x, st) \ | 410 | #define CK(x, st) \ |
409 | do { if (!(x)) return DASM_S_##st|(p-D->actionlist-1); } while (0) | 411 | do { if (!(x)) return DASM_S_##st|(int)(p-D->actionlist-1); } while (0) |
410 | #else | 412 | #else |
411 | #define CK(x, st) ((void)0) | 413 | #define CK(x, st) ((void)0) |
412 | #endif | 414 | #endif |
@@ -554,7 +556,7 @@ int dasm_checkstep(Dst_DECL, int secmatch) | |||
554 | } | 556 | } |
555 | if (D->status == DASM_S_OK && secmatch >= 0 && | 557 | if (D->status == DASM_S_OK && secmatch >= 0 && |
556 | D->section != &D->sections[secmatch]) | 558 | D->section != &D->sections[secmatch]) |
557 | D->status = DASM_S_MATCH_SEC|(D->section-D->sections); | 559 | D->status = DASM_S_MATCH_SEC|(int)(D->section-D->sections); |
558 | return D->status; | 560 | return D->status; |
559 | } | 561 | } |
560 | #endif | 562 | #endif |