Browse Source

Fix harmless coercion warnings

pull/264/head
Sami Vaarala 9 years ago
parent
commit
39576333db
  1. 2
      src/duk_api_stack.c
  2. 4
      src/duk_bi_buffer.c
  3. 2
      src/duk_hbufferobject_misc.c

2
src/duk_api_stack.c

@ -2430,7 +2430,7 @@ DUK_EXTERNAL void duk_to_object(duk_context *ctx, duk_idx_t index) {
h_bufobj->buf = h_val;
DUK_HBUFFER_INCREF(thr, h_val);
DUK_ASSERT(h_bufobj->offset == 0);
h_bufobj->length = DUK_HBUFFER_GET_SIZE(h_val);
h_bufobj->length = (duk_uint_t) DUK_HBUFFER_GET_SIZE(h_val);
DUK_ASSERT(h_bufobj->shift == 0);
DUK_ASSERT(h_bufobj->elem_type == DUK_HBUFFEROBJECT_ELEM_UINT8);

4
src/duk_bi_buffer.c

@ -172,7 +172,7 @@ DUK_LOCAL void duk__set_bufobj_buffer(duk_context *ctx, duk_hbufferobject *h_buf
h_bufobj->buf = h_val;
DUK_HBUFFER_INCREF(thr, h_val);
h_bufobj->length = DUK_HBUFFER_GET_SIZE(h_val);
h_bufobj->length = (duk_uint_t) DUK_HBUFFER_GET_SIZE(h_val);
DUK_ASSERT(h_bufobj->shift == 0);
DUK_ASSERT(h_bufobj->elem_type == DUK_HBUFFEROBJECT_ELEM_UINT8);
@ -1386,7 +1386,7 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_write(duk_context *ctx) {
/* XXX: encoding is ignored now. */
if (length > str_len) {
length = str_len;
length = (duk_uint_t) str_len;
}
if (DUK_HBUFFEROBJECT_VALID_SLICE(h_this)) {

2
src/duk_hbufferobject_misc.c

@ -7,7 +7,7 @@ DUK_INTERNAL duk_uint_t duk_hbufferobject_clamp_bytelength(duk_hbufferobject *h_
DUK_ASSERT(h_bufobj != NULL);
DUK_ASSERT(h_bufobj->buf != NULL);
buf_size = DUK_HBUFFER_GET_SIZE(h_bufobj->buf);
buf_size = (duk_uint_t) DUK_HBUFFER_GET_SIZE(h_bufobj->buf);
if (h_bufobj->offset > buf_size) {
/* Slice starting point is beyond current length. */
return 0;

Loading…
Cancel
Save