made moo_rbt_getxtn() inline

This commit is contained in:
hyunghwan.chung 2019-11-27 07:58:12 +00:00
parent 5672b62e27
commit 55a57dbf9e
3 changed files with 8 additions and 11 deletions

View File

@ -324,9 +324,11 @@ MOO_EXPORT void moo_rbt_fini (
moo_rbt_t* rbt /**< red-black tree */ moo_rbt_t* rbt /**< red-black tree */
); );
MOO_EXPORT void* moo_rbt_getxtn ( #if defined(MOO_HAVE_INLINE)
moo_rbt_t* rbt static MOO_INLINE void* moo_rbt_getxtn (moo_rbt_t* rbt) { return (void*)(rbt + 1); }
); #else
#define moo_rbt_getxtn(awk) ((void*)((moo_rbt_t*)(rbt) + 1))
#endif
/** /**
* The moo_rbt_getstyle() function gets manipulation callback function set. * The moo_rbt_getstyle() function gets manipulation callback function set.

View File

@ -243,11 +243,6 @@ void moo_rbt_fini (moo_rbt_t* rbt)
moo_rbt_clear (rbt); moo_rbt_clear (rbt);
} }
void* moo_rbt_getxtn (moo_rbt_t* rbt)
{
return (void*)(rbt + 1);
}
const moo_rbt_style_t* moo_rbt_getstyle (const moo_rbt_t* rbt) const moo_rbt_style_t* moo_rbt_getstyle (const moo_rbt_t* rbt)
{ {
return rbt->style; return rbt->style;

View File

@ -692,7 +692,7 @@ MOO_INLINE int moo_conv_bcstr_to_ucstr_with_cmgr (
for (bp = bcs; *bp != '\0'; bp++) /* nothing */ ; for (bp = bcs; *bp != '\0'; bp++) /* nothing */ ;
mlen = bp - bcs; wlen = *ucslen; mlen = bp - bcs; wlen = *ucslen;
n = moo_conv_bchars_to_uchars_with_cmgr (bcs, &mlen, ucs, &wlen, cmgr, all); n = moo_conv_bchars_to_uchars_with_cmgr(bcs, &mlen, ucs, &wlen, cmgr, all);
if (ucs) if (ucs)
{ {
/* null-terminate the target buffer if it has room for it. */ /* null-terminate the target buffer if it has room for it. */
@ -726,7 +726,7 @@ MOO_INLINE int moo_conv_uchars_to_bchars_with_cmgr (
break; break;
} }
n = cmgr->uctobc (*p, bcs, rem); n = cmgr->uctobc(*p, bcs, rem);
if (n == 0) if (n == 0)
{ {
ret = -1; ret = -1;
@ -751,7 +751,7 @@ MOO_INLINE int moo_conv_uchars_to_bchars_with_cmgr (
{ {
moo_oow_t n; moo_oow_t n;
n = cmgr->uctobc (*p, bcsbuf, MOO_COUNTOF(bcsbuf)); n = cmgr->uctobc(*p, bcsbuf, MOO_COUNTOF(bcsbuf));
if (n == 0) if (n == 0)
{ {
ret = -1; ret = -1;