VirtualBox

Changeset 3400 in kBuild for trunk/src/kmk/expreval.c


Ignore:
Timestamp:
Jul 2, 2020 11:53:42 AM (5 years ago)
Author:
bird
Message:

kmk/expreval.c: Build fix. strlen() operator/function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/expreval.c

    r3399 r3400  
    6363 *  operator, omitting isspace. */
    6464#define EXPR_IS_OP_SEPARATOR_NO_SPACE(a_ch) \
    65     (ispunct((a_ch)) && (a_ch) != '@' && (a_ch) != '_'))
     65    (ispunct((a_ch)) && (a_ch) != '@' && (a_ch) != '_')
    6666
    6767/** Check if @a a_ch is a valid separator for a alphabetical binary operator. */
     
    995995
    996996/**
     997 * Performs a strlen() on the simplified/converted string argument.
     998 *
     999 * @returns Status code.
     1000 * @param   pThis       The instance.
     1001 */
     1002static EXPRRET expr_op_strlen(PEXPR pThis)
     1003{
     1004    PEXPRVAR pVar = &pThis->aVars[pThis->iVar];
     1005
     1006    expr_var_make_simple_string(pVar);
     1007    expr_var_assign_num(pVar, strlen(pVar->uVal.psz));
     1008
     1009    return kExprRet_Ok;
     1010}
     1011
     1012
     1013/**
    9971014 * Convert to string (simplified and quoted)
    9981015 *
     
    17981815    EXPR_OP("bool",        90,      1,    expr_op_bool),
    17991816    EXPR_OP("num",         90,      1,    expr_op_num),
     1817    EXPR_OP("strlen",      90,      1,    expr_op_strlen),
    18001818    EXPR_OP("str",         90,      1,    expr_op_str),
    18011819    EXPR_OP("+",           80,      1,    expr_op_pluss),
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette