migrated some default actions for switch statements
This commit is contained in:
parent
38b00c0756
commit
ea3550bd19
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: val.c 481 2011-05-25 14:42:26Z hyunghwan.chung $
|
* $Id: val.c 482 2011-05-25 14:50:19Z hyunghwan.chung $
|
||||||
*
|
*
|
||||||
Copyright 2006-2011 Chung, Hyung-Hwan.
|
Copyright 2006-2011 Chung, Hyung-Hwan.
|
||||||
This file is part of QSE.
|
This file is part of QSE.
|
||||||
@ -679,14 +679,11 @@ void qse_awk_rtx_freeval (
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
}
|
||||||
{
|
|
||||||
QSE_ASSERTX (
|
QSE_ASSERTX (
|
||||||
!"should never happen - invalid value type",
|
!"should never happen - invalid value type",
|
||||||
"the type of a value should be one of QSE_AWK_VAL_XXX's defined in awk.h");
|
"the type of a value should be one of QSE_AWK_VAL_XXX's defined in awk.h");
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void qse_awk_rtx_refupval (qse_awk_rtx_t* rtx, qse_awk_val_t* val)
|
void qse_awk_rtx_refupval (qse_awk_rtx_t* rtx, qse_awk_val_t* val)
|
||||||
@ -763,13 +760,12 @@ qse_bool_t qse_awk_rtx_valtobool (qse_awk_rtx_t* run, const qse_awk_val_t* val)
|
|||||||
return QSE_FALSE; /* TODO: is this correct? */
|
return QSE_FALSE; /* TODO: is this correct? */
|
||||||
case QSE_AWK_VAL_REF:
|
case QSE_AWK_VAL_REF:
|
||||||
return QSE_FALSE; /* TODO: is this correct? */
|
return QSE_FALSE; /* TODO: is this correct? */
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
|
||||||
QSE_ASSERTX (
|
QSE_ASSERTX (
|
||||||
!"should never happen - invalid value type",
|
!"should never happen - invalid value type",
|
||||||
"the type of a value should be one of QSE_AWK_VAL_XXX's defined in awk.h");
|
"the type of a value should be one of QSE_AWK_VAL_XXX's defined in awk.h");
|
||||||
return QSE_FALSE;
|
return QSE_FALSE;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int str_to_str (
|
static int str_to_str (
|
||||||
@ -843,13 +839,10 @@ static int str_to_str (
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
qse_awk_rtx_seterrnum (rtx, QSE_AWK_EINVAL, QSE_NULL);
|
qse_awk_rtx_seterrnum (rtx, QSE_AWK_EINVAL, QSE_NULL);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int val_int_to_str (
|
static int val_int_to_str (
|
||||||
@ -1116,19 +1109,16 @@ int qse_awk_rtx_valtostr (
|
|||||||
qse_awk_val_str_t* vs = (qse_awk_val_str_t*)v;
|
qse_awk_val_str_t* vs = (qse_awk_val_str_t*)v;
|
||||||
return str_to_str (rtx, vs->val.ptr, vs->val.len, out);
|
return str_to_str (rtx, vs->val.ptr, vs->val.len, out);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
#ifdef DEBUG_VAL
|
||||||
{
|
|
||||||
#ifdef DEBUG_VAL
|
|
||||||
qse_dprintf (
|
qse_dprintf (
|
||||||
QSE_T(">>WRONG VALUE TYPE [%d] in qse_awk_rtx_valtostr\n"),
|
QSE_T(">>WRONG VALUE TYPE [%d] in qse_awk_rtx_valtostr\n"),
|
||||||
v->type
|
v->type
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
qse_awk_rtx_seterrnum (rtx, QSE_AWK_EVALTYPE, QSE_NULL);
|
qse_awk_rtx_seterrnum (rtx, QSE_AWK_EVALTYPE, QSE_NULL);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qse_char_t* qse_awk_rtx_valtocpldup (
|
qse_char_t* qse_awk_rtx_valtocpldup (
|
||||||
@ -1175,21 +1165,17 @@ int qse_awk_rtx_valtonum (
|
|||||||
l, r
|
l, r
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
#ifdef DEBUG_VAL
|
||||||
{
|
|
||||||
#ifdef DEBUG_VAL
|
|
||||||
qse_dprintf (
|
qse_dprintf (
|
||||||
QSE_T(">>WRONG VALUE TYPE [%d] in qse_awk_rtx_valtonum\n"),
|
QSE_T(">>WRONG VALUE TYPE [%d] in qse_awk_rtx_valtonum\n"),
|
||||||
v->type
|
v->type
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qse_awk_rtx_seterrnum (rtx, QSE_AWK_EVALTYPE, QSE_NULL);
|
qse_awk_rtx_seterrnum (rtx, QSE_AWK_EVALTYPE, QSE_NULL);
|
||||||
return -1; /* error */
|
return -1; /* error */
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int qse_awk_rtx_strtonum (
|
int qse_awk_rtx_strtonum (
|
||||||
|
Loading…
Reference in New Issue
Block a user