(have a negative array count) and an inscrutable error will come
out of the compiler and hopefully mention "name".
*/
-#define __cgo_compile_assert_eq(x, y, name) typedef char name[(x-y)*(x-y)*-2+1];
+#define __cgo_compile_assert_eq(x, y, name) typedef char name[(x-y)*(x-y)*-2UL+1UL];
/* Check at compile time that the sizes we use match our expectations. */
-#define __cgo_size_assert(t, n) __cgo_compile_assert_eq(sizeof(t), n, _cgo_sizeof_##t##_is_not_##n)
+#define __cgo_size_assert(t, n) __cgo_compile_assert_eq(sizeof(t), (size_t)n, _cgo_sizeof_##t##_is_not_##n)
__cgo_size_assert(char, 1)
__cgo_size_assert(short, 2)
sigemptyset(&act.sa_mask);
for (i = 0; i < 8 * sizeof(goact->mask); i++) {
if (goact->mask & ((uint64_t)(1)<<i)) {
- sigaddset(&act.sa_mask, i+1);
+ sigaddset(&act.sa_mask, (int)(i+1));
}
}
- act.sa_flags = goact->flags & ~SA_RESTORER;
+ act.sa_flags = (int)(goact->flags & ~(uint64_t)SA_RESTORER);
}
- ret = sigaction(signum, goact ? &act : NULL, oldgoact ? &oldact : NULL);
+ ret = sigaction((int)signum, goact ? &act : NULL, oldgoact ? &oldact : NULL);
if (ret == -1) {
// runtime.rt_sigaction expects _cgo_sigaction to return errno on error.
_cgo_tsan_release();
}
oldgoact->mask = 0;
for (i = 0; i < 8 * sizeof(oldgoact->mask); i++) {
- if (sigismember(&oldact.sa_mask, i+1) == 1) {
+ if (sigismember(&oldact.sa_mask, (int)(i+1)) == 1) {
oldgoact->mask |= (uint64_t)(1)<<i;
}
}
- oldgoact->flags = oldact.sa_flags;
+ oldgoact->flags = (uint64_t)oldact.sa_flags;
}
_cgo_tsan_release();