Browse Source

A few assert fixes (remove compiler warning)

pull/30/head
Sami Vaarala 10 years ago
parent
commit
e7d745d722
  1. 6
      src/duk_bi_array.c
  2. 2
      src/duk_hstring_misc.c

6
src/duk_bi_array.c

@ -734,7 +734,7 @@ duk_ret_t duk_bi_array_prototype_splice(duk_context *ctx) {
if (act_start < 0) {
act_start = len + act_start;
}
DUK_ASSERT(act_start >= 0 && act_start <= len);
DUK_ASSERT(act_start >= 0 && act_start <= (duk_int_t) len);
#ifdef DUK_USE_NONSTD_ARRAY_SPLICE_DELCOUNT
if (have_delcount) {
@ -751,8 +751,8 @@ duk_ret_t duk_bi_array_prototype_splice(duk_context *ctx) {
}
#endif
DUK_ASSERT(del_count >= 0 && del_count <= len - act_start);
DUK_ASSERT(del_count + act_start <= len);
DUK_ASSERT(del_count >= 0 && del_count <= (duk_int_t) len - act_start);
DUK_ASSERT(del_count + act_start <= (duk_int_t) len);
duk_push_array(ctx);

2
src/duk_hstring_misc.c

@ -13,7 +13,7 @@ duk_ucodepoint_t duk_hstring_char_code_at_raw(duk_hthread *thr, duk_hstring *h,
DUK_ASSERT(thr != NULL);
DUK_ASSERT(h != NULL);
DUK_ASSERT_DISABLE(pos >= 0); /* unsigned */
DUK_ASSERT(pos < (duk_int_t) DUK_HSTRING_GET_CHARLEN(h));
DUK_ASSERT(pos < (duk_uint_t) DUK_HSTRING_GET_CHARLEN(h));
boff = duk_heap_strcache_offset_char2byte(thr, h, (duk_uint32_t) pos);
DUK_DDD(DUK_DDDPRINT("charCodeAt: pos=%ld -> boff=%ld, str=%!O",

Loading…
Cancel
Save