enhanced qse_awk_rtx_valtostr()
This commit is contained in:
@ -342,13 +342,15 @@ static qse_htb_pair_t* test5_cbserter (
|
||||
/* allocate a new pair, but without filling the actual value.
|
||||
* note vptr is given QSE_NULL for that purpose */
|
||||
new_pair = qse_htb_allocpair (
|
||||
htb, kptr, klen, QSE_NULL, pair->vlen + 1 + v->len);
|
||||
htb, kptr, klen, QSE_NULL,
|
||||
QSE_HTB_VLEN(pair) + 1 + v->len);
|
||||
if (new_pair == QSE_NULL) return QSE_NULL;
|
||||
|
||||
/* fill in the value space */
|
||||
vptr = new_pair->vptr;
|
||||
qse_memcpy (vptr, pair->vptr, pair->vlen*QSE_SIZEOF(qse_char_t));
|
||||
vptr += pair->vlen*QSE_SIZEOF(qse_char_t);
|
||||
vptr = QSE_HTB_VPTR(new_pair);
|
||||
qse_memcpy (vptr, QSE_HTB_VPTR(pair),
|
||||
QSE_HTB_VLEN(pair)*QSE_SIZEOF(qse_char_t));
|
||||
vptr += QSE_HTB_VLEN(pair) * QSE_SIZEOF(qse_char_t);
|
||||
qse_memcpy (vptr, &comma, QSE_SIZEOF(qse_char_t));
|
||||
vptr += QSE_SIZEOF(qse_char_t);
|
||||
qse_memcpy (vptr, v->ptr, v->len*QSE_SIZEOF(qse_char_t));
|
||||
|
@ -119,7 +119,7 @@ qse_lda_setcapa (s1, 3);
|
||||
static int test2 ()
|
||||
{
|
||||
qse_lda_t* s1;
|
||||
qse_lda_node_t* p;
|
||||
qse_lda_slot_t* p;
|
||||
const qse_char_t* x[] =
|
||||
{
|
||||
QSE_T("this is so good"),
|
||||
@ -168,7 +168,7 @@ static int test2 ()
|
||||
|
||||
for (i = 0; i < QSE_LDA_SIZE(s1); i++)
|
||||
{
|
||||
if (QSE_LDA_NODE(s1,i))
|
||||
if (QSE_LDA_SLOT(s1,i))
|
||||
{
|
||||
qse_printf (QSE_T("[%d] %d => [%.*s]\n"),
|
||||
j, i, (int)QSE_LDA_DLEN(s1,i), QSE_LDA_DPTR(s1,i));
|
||||
@ -258,7 +258,7 @@ static int test3 ()
|
||||
{
|
||||
if (i < QSE_LDA_SIZE(s1))
|
||||
{
|
||||
if (QSE_LDA_NODE(s1,i))
|
||||
if (QSE_LDA_SLOT(s1,i))
|
||||
{
|
||||
qse_printf (QSE_T("deleted at %d => [%.*s]\n"),
|
||||
i, (int)QSE_LDA_DLEN(s1,i), QSE_LDA_DPTR(s1,i));
|
||||
@ -287,7 +287,7 @@ static int test3 ()
|
||||
|
||||
for (i = 0; i < QSE_LDA_SIZE(s1); i++)
|
||||
{
|
||||
if (QSE_LDA_NODE(s1,i))
|
||||
if (QSE_LDA_SLOT(s1,i))
|
||||
{
|
||||
qse_printf (QSE_T("[%d] %d => [%.*s]\n"),
|
||||
j, i, (int)QSE_LDA_DLEN(s1,i), QSE_LDA_DPTR(s1,i));
|
||||
@ -303,7 +303,7 @@ static int test3 ()
|
||||
|
||||
for (i = 0; i < QSE_LDA_SIZE(s1); i++)
|
||||
{
|
||||
if (QSE_LDA_NODE(s1,i))
|
||||
if (QSE_LDA_SLOT(s1,i))
|
||||
{
|
||||
qse_printf (QSE_T("[%d] %d => [%.*s]\n"),
|
||||
j, i, (int)QSE_LDA_DLEN(s1,i), QSE_LDA_DPTR(s1,i));
|
||||
|
@ -150,13 +150,15 @@ static qse_rbt_pair_t* test5_cbserter (
|
||||
/* allocate a new pair, but without filling the actual value.
|
||||
* note vptr is given QSE_NULL for that purpose */
|
||||
new_pair = qse_rbt_allocpair (
|
||||
rbt, kptr, klen, QSE_NULL, pair->vlen + 1 + v->len);
|
||||
rbt, kptr, klen, QSE_NULL,
|
||||
QSE_RBT_VLEN(pair) + 1 + v->len);
|
||||
if (new_pair == QSE_NULL) return QSE_NULL;
|
||||
|
||||
/* fill in the value space */
|
||||
vptr = new_pair->vptr;
|
||||
qse_memcpy (vptr, pair->vptr, pair->vlen*QSE_SIZEOF(qse_char_t));
|
||||
vptr += pair->vlen*QSE_SIZEOF(qse_char_t);
|
||||
vptr = QSE_RBT_VPTR(new_pair);
|
||||
qse_memcpy (vptr, QSE_RBT_VPTR(pair),
|
||||
QSE_RBT_VLEN(pair) * QSE_SIZEOF(qse_char_t));
|
||||
vptr += QSE_RBT_VLEN(pair) * QSE_SIZEOF(qse_char_t);
|
||||
qse_memcpy (vptr, &comma, QSE_SIZEOF(qse_char_t));
|
||||
vptr += QSE_SIZEOF(qse_char_t);
|
||||
qse_memcpy (vptr, v->ptr, v->len*QSE_SIZEOF(qse_char_t));
|
||||
|
Reference in New Issue
Block a user