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,14 +760,13 @@ 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 (
|
||||||
qse_awk_rtx_t* rtx, const qse_char_t* str, qse_size_t str_len,
|
qse_awk_rtx_t* rtx, const qse_char_t* str, qse_size_t str_len,
|
||||||
@ -843,14 +839,11 @@ 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 (
|
||||||
qse_awk_rtx_t* rtx, const qse_awk_val_int_t* v,
|
qse_awk_rtx_t* rtx, const qse_awk_val_int_t* v,
|
||||||
@ -1116,9 +1109,8 @@ 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"),
|
||||||
@ -1128,8 +1120,6 @@ int qse_awk_rtx_valtostr (
|
|||||||
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 (
|
||||||
qse_awk_rtx_t* rtx, const qse_awk_val_t* v, qse_size_t* len)
|
qse_awk_rtx_t* rtx, const qse_awk_val_t* v, qse_size_t* len)
|
||||||
@ -1175,9 +1165,8 @@ 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"),
|
||||||
@ -1188,9 +1177,6 @@ int qse_awk_rtx_valtonum (
|
|||||||
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 (
|
||||||
qse_awk_rtx_t* rtx, int strict,
|
qse_awk_rtx_t* rtx, int strict,
|
||||||
|
Loading…
Reference in New Issue
Block a user