@ -443,7 +443,7 @@ DUK_INTERNAL void duk_hbufobj_push_uint8array_from_plain(duk_hthread *thr, duk_h
DUK_INTERNAL void duk_hbufobj_push_validated_read ( duk_hthread * thr , duk_hbufobj * h_bufobj , duk_uint8_t * p , duk_small_uint_t elem_size ) {
duk_double_union du ;
DUK_MEMCPY ( ( void * ) du . uc , ( const void * ) p , ( size_t ) elem_size ) ;
duk_memcpy ( ( void * ) du . uc , ( const void * ) p , ( size_t ) elem_size ) ;
switch ( h_bufobj - > elem_type ) {
case DUK_HBUFOBJ_ELEM_UINT8 :
@ -524,7 +524,7 @@ DUK_INTERNAL void duk_hbufobj_validated_write(duk_hthread *thr, duk_hbufobj *h_b
DUK_UNREACHABLE ( ) ;
}
DUK_MEMCPY ( ( void * ) p , ( const void * ) du . uc , ( size_t ) elem_size ) ;
duk_memcpy ( ( void * ) p , ( const void * ) du . uc , ( size_t ) elem_size ) ;
}
/* Helper to create a fixed buffer from argument value at index 0.
@ -953,7 +953,7 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_constructor(duk_hthread *thr) {
DUK_DDD ( DUK_DDDPRINT ( " using memcpy: p_src=%p, p_dst=%p, byte_length=%ld " ,
( void * ) p_src , ( void * ) p_dst , ( long ) byte_length ) ) ;
DUK_MEMCPY ( ( void * ) p_dst , ( const void * ) p_src , ( size_t ) byte_length ) ;
duk_memcpy ( ( void * ) p_dst , ( const void * ) p_src , ( size_t ) byte_length ) ;
break ;
}
case 1 : {
@ -1220,7 +1220,7 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_tostring(duk_hthread *thr) {
*/
DUK_ASSERT ( DUK_HBUFOBJ_VALID_BYTEOFFSET_EXCL ( h_this , ( duk_size_t ) start_offset + slice_length ) ) ;
DUK_MEMCPY ( ( void * ) buf_slice ,
duk_memcpy ( ( void * ) buf_slice ,
( const void * ) ( DUK_HBUFOBJ_GET_SLICE_BASE ( thr - > heap , h_this ) + start_offset ) ,
( size_t ) slice_length ) ;
@ -1384,7 +1384,7 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_fill(duk_hthread *thr) {
/* Handle single character fills as memset() even when
* the fill data comes from a one - char argument .
*/
DUK_MEMSET ( ( void * ) p , ( int ) fill_str_ptr [ 0 ] , ( size_t ) fill_length ) ;
duk_memset ( ( void * ) p , ( int ) fill_str_ptr [ 0 ] , ( size_t ) fill_length ) ;
} else if ( fill_str_len > 1 ) {
duk_size_t i , n , t ;
@ -1435,7 +1435,7 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_write(duk_hthread *thr) {
if ( DUK_HBUFOBJ_VALID_SLICE ( h_this ) ) {
/* Cannot overlap. */
DUK_MEMCPY ( ( void * ) ( DUK_HBUFOBJ_GET_SLICE_BASE ( thr - > heap , h_this ) + offset ) ,
duk_memcpy ( ( void * ) ( DUK_HBUFOBJ_GET_SLICE_BASE ( thr - > heap , h_this ) + offset ) ,
( const void * ) str_data ,
( size_t ) length ) ;
} else {
@ -1533,7 +1533,7 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_copy(duk_hthread *thr) {
/* Must use memmove() because copy area may overlap (source and target
* buffer may be the same , or from different slices .
*/
DUK_MEMMOVE ( ( void * ) ( DUK_HBUFOBJ_GET_SLICE_BASE ( thr - > heap , h_bufarg ) + target_ustart ) ,
duk_memmove ( ( void * ) ( DUK_HBUFOBJ_GET_SLICE_BASE ( thr - > heap , h_bufarg ) + target_ustart ) ,
( const void * ) ( DUK_HBUFOBJ_GET_SLICE_BASE ( thr - > heap , h_this ) + source_ustart ) ,
( size_t ) copy_size ) ;
} else {
@ -1721,7 +1721,7 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_set(duk_hthread *thr) {
DUK_ASSERT ( src_length = = dst_length ) ;
DUK_DDD ( DUK_DDDPRINT ( " fast path: able to use memmove() because views are compatible " ) ) ;
DUK_MEMMOVE ( ( void * ) p_dst_base , ( const void * ) p_src_base , ( size_t ) dst_length ) ;
duk_memmove ( ( void * ) p_dst_base , ( const void * ) p_src_base , ( size_t ) dst_length ) ;
return 0 ;
}
DUK_DDD ( DUK_DDDPRINT ( " fast path: views are not compatible with a byte copy, copy by item " ) ) ;
@ -1764,7 +1764,7 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_set(duk_hthread *thr) {
DUK_DDD ( DUK_DDDPRINT ( " there is overlap, make a copy of the source " ) ) ;
p_src_copy = ( duk_uint8_t * ) duk_push_fixed_buffer_nozero ( thr , src_length ) ;
DUK_ASSERT ( p_src_copy ! = NULL ) ;
DUK_MEMCPY ( ( void * ) p_src_copy , ( const void * ) p_src_base , ( size_t ) src_length ) ;
duk_memcpy ( ( void * ) p_src_copy , ( const void * ) p_src_base , ( size_t ) src_length ) ;
p_src_base = p_src_copy ; /* use p_src_base from now on */
}
@ -1891,7 +1891,7 @@ DUK_LOCAL void duk__arraybuffer_plain_slice(duk_hthread *thr, duk_hbuffer *h_val
DUK_ASSERT ( p_copy ! = NULL ) ;
copy_length = slice_length ;
DUK_MEMCPY ( ( void * ) p_copy ,
duk_memcpy ( ( void * ) p_copy ,
( const void * ) ( ( duk_uint8_t * ) DUK_HBUFFER_GET_DATA_PTR ( thr - > heap , h_val ) + start_offset ) ,
copy_length ) ;
}
@ -2015,7 +2015,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_slice_shared(duk_hthread *thr) {
* is left as zero .
*/
copy_length = DUK_HBUFOBJ_CLAMP_BYTELENGTH ( h_this , slice_length ) ;
DUK_MEMCPY ( ( void * ) p_copy ,
duk_memcpy ( ( void * ) p_copy ,
( const void * ) ( DUK_HBUFOBJ_GET_SLICE_BASE ( thr - > heap , h_this ) + start_offset ) ,
copy_length ) ;
@ -2209,7 +2209,7 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_concat(duk_hthread *thr) {
if ( h_bufobj - > buf ! = NULL & &
DUK_HBUFOBJ_VALID_SLICE ( h_bufobj ) ) {
DUK_MEMCPY ( ( void * ) p ,
duk_memcpy ( ( void * ) p ,
( const void * ) DUK_HBUFOBJ_GET_SLICE_BASE ( thr - > heap , h_bufobj ) ,
copy_size ) ;
} else {
@ -2361,7 +2361,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_readfield(duk_hthread *thr) {
if ( offset + 2U > check_length ) {
goto fail_bounds ;
}
DUK_MEMCPY ( ( void * ) du . uc , ( const void * ) ( buf + offset ) , 2 ) ;
duk_memcpy ( ( void * ) du . uc , ( const void * ) ( buf + offset ) , 2 ) ;
tmp = du . us [ 0 ] ;
if ( endswap ) {
tmp = DUK_BSWAP16 ( tmp ) ;
@ -2378,7 +2378,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_readfield(duk_hthread *thr) {
if ( offset + 4U > check_length ) {
goto fail_bounds ;
}
DUK_MEMCPY ( ( void * ) du . uc , ( const void * ) ( buf + offset ) , 4 ) ;
duk_memcpy ( ( void * ) du . uc , ( const void * ) ( buf + offset ) , 4 ) ;
tmp = du . ui [ 0 ] ;
if ( endswap ) {
tmp = DUK_BSWAP32 ( tmp ) ;
@ -2395,7 +2395,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_readfield(duk_hthread *thr) {
if ( offset + 4U > check_length ) {
goto fail_bounds ;
}
DUK_MEMCPY ( ( void * ) du . uc , ( const void * ) ( buf + offset ) , 4 ) ;
duk_memcpy ( ( void * ) du . uc , ( const void * ) ( buf + offset ) , 4 ) ;
if ( endswap ) {
tmp = du . ui [ 0 ] ;
tmp = DUK_BSWAP32 ( tmp ) ;
@ -2408,7 +2408,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_readfield(duk_hthread *thr) {
if ( offset + 8U > check_length ) {
goto fail_bounds ;
}
DUK_MEMCPY ( ( void * ) du . uc , ( const void * ) ( buf + offset ) , 8 ) ;
duk_memcpy ( ( void * ) du . uc , ( const void * ) ( buf + offset ) , 8 ) ;
if ( endswap ) {
DUK_DBLUNION_BSWAP64 ( & du ) ;
}
@ -2646,7 +2646,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_writefield(duk_hthread *thr) {
}
du . us [ 0 ] = tmp ;
/* sign doesn't matter when writing */
DUK_MEMCPY ( ( void * ) ( buf + offset ) , ( const void * ) du . uc , 2 ) ;
duk_memcpy ( ( void * ) ( buf + offset ) , ( const void * ) du . uc , 2 ) ;
break ;
}
case DUK__FLD_32BIT : {
@ -2660,7 +2660,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_writefield(duk_hthread *thr) {
}
du . ui [ 0 ] = tmp ;
/* sign doesn't matter when writing */
DUK_MEMCPY ( ( void * ) ( buf + offset ) , ( const void * ) du . uc , 4 ) ;
duk_memcpy ( ( void * ) ( buf + offset ) , ( const void * ) du . uc , 4 ) ;
break ;
}
case DUK__FLD_FLOAT : {
@ -2675,7 +2675,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_writefield(duk_hthread *thr) {
du . ui [ 0 ] = tmp ;
}
/* sign doesn't matter when writing */
DUK_MEMCPY ( ( void * ) ( buf + offset ) , ( const void * ) du . uc , 4 ) ;
duk_memcpy ( ( void * ) ( buf + offset ) , ( const void * ) du . uc , 4 ) ;
break ;
}
case DUK__FLD_DOUBLE : {
@ -2687,7 +2687,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_writefield(duk_hthread *thr) {
DUK_DBLUNION_BSWAP64 ( & du ) ;
}
/* sign doesn't matter when writing */
DUK_MEMCPY ( ( void * ) ( buf + offset ) , ( const void * ) du . uc , 8 ) ;
duk_memcpy ( ( void * ) ( buf + offset ) , ( const void * ) du . uc , 8 ) ;
break ;
}
case DUK__FLD_VARINT : {