minor code change for type consisitency
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
hyung-hwan 2024-09-23 20:31:11 +09:00
parent 2abda37861
commit 568166b4e2
5 changed files with 7 additions and 6 deletions

View File

@ -1180,7 +1180,7 @@ static int fmt_outv (hcl_t* hcl, hcl_fmtout_t* fmtout, va_list ap)
{
/*HCL_ASSERT (hcl, fb.out.ptr == fb.out.sbuf);*/
fb.out.ptr = HCL_MMGR_ALLOC(fmtout->mmgr, HCL_SIZEOF(hcl_bch_t) * (newcapa + 1));
fb.out.ptr = (hcl_bch_t*)HCL_MMGR_ALLOC(fmtout->mmgr, HCL_SIZEOF(hcl_bch_t) * (newcapa + 1));
if (!fb.out.ptr) goto oops;
fb.out.capa = newcapa;
}

View File

@ -1393,7 +1393,7 @@ void hcl_popvolats (hcl_t* hcl, hcl_oow_t count)
hcl_oop_t hcl_shallowcopy (hcl_t* hcl, hcl_oop_t oop)
{
if (HCL_OOP_IS_POINTER(oop) && HCL_OBJ_GET_CLASS(oop) != hcl->c_symbol)
if (HCL_OOP_IS_POINTER(oop) && HCL_OBJ_GET_CLASS(oop) != (hcl_oop_t)hcl->c_symbol)
{
hcl_oop_t z;
hcl_oow_t total_bytes;

View File

@ -477,13 +477,13 @@ static hcl_pfrc_t pf_gets (hcl_t* hcl, hcl_mod_t* mod, hcl_ooi_t nargs)
newcapa = capa + HCL_COUNTOF(buf);
if (ptr == buf)
{
tmp = hcl_allocmem(hcl, HCL_SIZEOF(*ptr) * newcapa);
tmp = (hcl_ooch_t*)hcl_allocmem(hcl, HCL_SIZEOF(*ptr) * newcapa);
if (HCL_UNLIKELY(!tmp)) return HCL_PF_FAILURE;
HCL_MEMCPY (tmp, buf, HCL_SIZEOF(buf));
}
else
{
tmp = hcl_reallocmem(hcl, ptr, HCL_SIZEOF(*ptr) * newcapa);
tmp = (hcl_ooch_t*)hcl_reallocmem(hcl, ptr, HCL_SIZEOF(*ptr) * newcapa);
if (HCL_UNLIKELY(!tmp))
{
hcl_freemem(hcl, ptr);

View File

@ -2852,7 +2852,7 @@ static void cb_opt_set (hcl_t* hcl, hcl_option_t id, const void* value)
#if defined(_WIN32)
#if defined(HCL_OOCH_IS_UCH) && (HCL_SIZEOF_UCH_T == HCL_SIZEOF_WCHAR_T)
fd = _wopen(hcl->option.log_target_u, _O_CREAT | _O_WRONLY | _O_APPEND | _O_BINARY , 0644);
fd = _wopen((const wchar_t*)hcl->option.log_target_u, _O_CREAT | _O_WRONLY | _O_APPEND | _O_BINARY , 0644);
#else
fd = _open(hcl->option.log_target_b, _O_CREAT | _O_WRONLY | _O_APPEND | _O_BINARY , 0644);
#endif

View File

@ -1,6 +1,7 @@
unit HCL;
{$mode objfpc}{$H+}
{$macro on}
{$linklib hcl}
{$linklib c}
{$linklib dl}
@ -267,7 +268,7 @@ begin
(* included file *)
nf := NamedHandlePtr(arg^.includer^.handle);
basedir := SysUtils.ExtractFilePath(nf^.name);
name := UTF8Encode(arg^.name);
name := System.UTF8Encode(WideString(arg^.name));
if SysUtils.CompareStr(basedir, '') <> 0 then
name := SysUtils.ConcatPaths([basedir, name]);
end;