simple type casting
This commit is contained in:
@ -587,7 +587,7 @@ static int index_or_rindex (hawk_rtx_t* rtx, int rindex)
|
|||||||
len0 = 1;
|
len0 = 1;
|
||||||
}
|
}
|
||||||
/* this part isn't needed because hawk_val_mbs_t and hawk_val_mbs_t
|
/* this part isn't needed because hawk_val_mbs_t and hawk_val_mbs_t
|
||||||
* are almost the same except the type of the val field
|
* are almost the same except the type of the val field
|
||||||
else if (vtype == HAWK_VAL_BOB)
|
else if (vtype == HAWK_VAL_BOB)
|
||||||
{
|
{
|
||||||
str0 = (hawk_bch_t*)((hawk_val_bob_t*)a0)->val.ptr;
|
str0 = (hawk_bch_t*)((hawk_val_bob_t*)a0)->val.ptr;
|
||||||
|
@ -344,7 +344,7 @@ typedef struct hawk_val_ref_t hawk_val_ref_t;
|
|||||||
* You can create a value of this type with hawk_rtx_makebobval() inside a module
|
* You can create a value of this type with hawk_rtx_makebobval() inside a module
|
||||||
* function or built-in functions to convey internal data between them. The language
|
* function or built-in functions to convey internal data between them. The language
|
||||||
* doesn't provide a way to create and/or change the value.
|
* doesn't provide a way to create and/or change the value.
|
||||||
*
|
*
|
||||||
* You must keep the structure of hawk_val_mbs_t and hawk_val_bob_t the same
|
* You must keep the structure of hawk_val_mbs_t and hawk_val_bob_t the same
|
||||||
* except the type of the val field;
|
* except the type of the val field;
|
||||||
*/
|
*/
|
||||||
|
@ -643,7 +643,7 @@ static void* _realloc_merge (hawk_xma_t* xma, void* b, hawk_oow_t size)
|
|||||||
/* link the leftover block to the free list */
|
/* link the leftover block to the free list */
|
||||||
mblk_size(blk) = size;
|
mblk_size(blk) = size;
|
||||||
|
|
||||||
y = next_mblk(blk); /* update y to the leftover block with the new block size set above */
|
y = (hawk_uint8_t*)next_mblk(blk); /* update y to the leftover block with the new block size set above */
|
||||||
mblk_free(y) = 1;
|
mblk_free(y) = 1;
|
||||||
mblk_size(y) = rem - MBLKHDRSIZE;
|
mblk_size(y) = rem - MBLKHDRSIZE;
|
||||||
mblk_prev_size(y) = mblk_size(blk);
|
mblk_prev_size(y) = mblk_size(blk);
|
||||||
@ -753,7 +753,7 @@ void hawk_xma_free (hawk_xma_t* xma, void* b)
|
|||||||
|
|
||||||
hawk_uint8_t* z;
|
hawk_uint8_t* z;
|
||||||
hawk_oow_t ns = MBLKHDRSIZE + org_blk_size + MBLKHDRSIZE;
|
hawk_oow_t ns = MBLKHDRSIZE + org_blk_size + MBLKHDRSIZE;
|
||||||
/* blk's header size + blk->size + y's header size */
|
/* blk's header size + blk->size + y's header size */
|
||||||
hawk_oow_t bs = ns + mblk_size(y);
|
hawk_oow_t bs = ns + mblk_size(y);
|
||||||
|
|
||||||
detach_from_freelist(xma, (hawk_xma_fblk_t*)x);
|
detach_from_freelist(xma, (hawk_xma_fblk_t*)x);
|
||||||
|
Reference in New Issue
Block a user