From d8457359c4534b004985f9b9343068a907dea267 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Mon, 14 Jul 2025 23:13:27 +0900 Subject: [PATCH] simple type casting --- lib/fnc.c | 2 +- lib/hawk.h | 2 +- lib/xma.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/fnc.c b/lib/fnc.c index d4925a53..b605d464 100644 --- a/lib/fnc.c +++ b/lib/fnc.c @@ -587,7 +587,7 @@ static int index_or_rindex (hawk_rtx_t* rtx, int rindex) len0 = 1; } /* 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) { str0 = (hawk_bch_t*)((hawk_val_bob_t*)a0)->val.ptr; diff --git a/lib/hawk.h b/lib/hawk.h index 8fd49024..1483b788 100644 --- a/lib/hawk.h +++ b/lib/hawk.h @@ -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 * 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. - * + * * You must keep the structure of hawk_val_mbs_t and hawk_val_bob_t the same * except the type of the val field; */ diff --git a/lib/xma.c b/lib/xma.c index 5539547f..39f68ddc 100644 --- a/lib/xma.c +++ b/lib/xma.c @@ -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 */ 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_size(y) = rem - MBLKHDRSIZE; 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_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); detach_from_freelist(xma, (hawk_xma_fblk_t*)x);