summaryrefslogtreecommitdiff
path: root/src/runtime/c
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2013-11-15 10:03:22 +0000
committerkr.angelov <kr.angelov@gmail.com>2013-11-15 10:03:22 +0000
commita6d60f9c8de1dfc6e40f7c73bcdb403dd69d97be (patch)
tree579ddd62b40cc487c2e7a4d581a946d641a70f60 /src/runtime/c
parentd997df2864a29986d7146aa4dc69d9be879718cc (diff)
fixes in the C runtime to avoid warnings when compiling on MacOS
Diffstat (limited to 'src/runtime/c')
-rw-r--r--src/runtime/c/gu/bits.h12
-rw-r--r--src/runtime/c/gu/exn.h3
-rw-r--r--src/runtime/c/gu/string.c2
-rw-r--r--src/runtime/c/pgf/lightning/i386/core-64.h2
4 files changed, 9 insertions, 10 deletions
diff --git a/src/runtime/c/gu/bits.h b/src/runtime/c/gu/bits.h
index 9ba1b0c8e..5a55ff233 100644
--- a/src/runtime/c/gu/bits.h
+++ b/src/runtime/c/gu/bits.h
@@ -111,36 +111,36 @@ extern GU_DECLARE_TYPE(GuIntDecodeExn, abstract);
(((u_) <= (posmax_)) \
? (t_) (u_) \
: (tmin_) + ((t_) ((umax_) - (u_))) < 0 \
- ? -1 - ((t_) ((umax_) - (u_))) \
- : (gu_raise(err_, GuIntDecodeExn), -1))
+ ? (t_) (-1 - ((t_) ((umax_) - (u_)))) \
+ : (t_) (gu_raise(err_, GuIntDecodeExn), -1))
static inline int8_t
gu_decode_2c8(uint8_t u, GuExn* err)
{
return GU_DECODE_2C_(u, int8_t, UINT8_C(0xff),
- INT8_C(0x7f), INT8_MIN, err);
+ UINT8_C(0x7f), INT8_MIN, err);
}
static inline int16_t
gu_decode_2c16(uint16_t u, GuExn* err)
{
return GU_DECODE_2C_(u, int16_t, UINT16_C(0xffff),
- INT16_C(0x7fff), INT16_MIN, err);
+ UINT16_C(0x7fff), INT16_MIN, err);
}
static inline int32_t
gu_decode_2c32(uint32_t u, GuExn* err)
{
return GU_DECODE_2C_(u, int32_t, UINT32_C(0xffffffff),
- INT32_C(0x7fffffff), INT32_MIN, err);
+ UINT32_C(0x7fffffff), INT32_MIN, err);
}
static inline int64_t
gu_decode_2c64(uint64_t u, GuExn* err)
{
return GU_DECODE_2C_(u, int64_t, UINT64_C(0xffffffffffffffff),
- INT64_C(0x7fffffffffffffff), INT64_MIN, err);
+ UINT64_C(0x7fffffffffffffff), INT64_MIN, err);
}
double
diff --git a/src/runtime/c/gu/exn.h b/src/runtime/c/gu/exn.h
index 3fefae738..faf413a96 100644
--- a/src/runtime/c/gu/exn.h
+++ b/src/runtime/c/gu/exn.h
@@ -64,8 +64,7 @@ struct GuExn {
.parent = parent_, \
.catch = gu_kind(catch_), \
.caught = NULL, \
- .data.pool = pool_, \
- .data.data = NULL \
+ .data = {.pool = pool_, .data = NULL} \
}
diff --git a/src/runtime/c/gu/string.c b/src/runtime/c/gu/string.c
index 995812fbf..8c9afd6e7 100644
--- a/src/runtime/c/gu/string.c
+++ b/src/runtime/c/gu/string.c
@@ -179,7 +179,7 @@ gu_string_is_prefix(GuString s1, GuString s2)
if (len1 > len2)
return false;
- for (size_t len = len1; len--; len > 0) {
+ for (size_t len = len1; len > 0; len--) {
if (*s1 != *s2)
return false;
diff --git a/src/runtime/c/pgf/lightning/i386/core-64.h b/src/runtime/c/pgf/lightning/i386/core-64.h
index 4a856d96c..2d5380f40 100644
--- a/src/runtime/c/pgf/lightning/i386/core-64.h
+++ b/src/runtime/c/pgf/lightning/i386/core-64.h
@@ -193,7 +193,7 @@ struct jit_local_state {
#define jit_retval_l(rd) ((void)jit_movr_l ((rd), _EAX))
#define jit_arg_i() (_jitl.nextarg_geti < JIT_ARG_MAX \
? _jitl.nextarg_geti++ \
- : ((_jitl.framesize += sizeof(long)) - sizeof(long)))
+ : (int) ((_jitl.framesize += sizeof(long)) - sizeof(long)))
#define jit_arg_c() jit_arg_i()
#define jit_arg_uc() jit_arg_i()
#define jit_arg_s() jit_arg_i()