]> git.sur5r.net Git - cc65/blobdiff - src/cc65/stdfunc.c
Adding functionality to StrBuf
[cc65] / src / cc65 / stdfunc.c
index f8f5533cd4bcb08d17187b8cc2bcf40bcbefd6ac..d3fc5ddabf525446a499a214e94b415608c5958a 100644 (file)
@@ -54,7 +54,7 @@
 
 
 
-static void StdFunc_strlen (struct expent*);
+static void StdFunc_strlen (ExprDesc*);
 
 
 
@@ -69,7 +69,7 @@ static void StdFunc_strlen (struct expent*);
  */
 static struct StdFuncDesc {
     const char*                Name;
-    void               (*Handler) (struct expent*);
+    void               (*Handler) (ExprDesc*);
 } StdFuncs [] = {
     {          "strlen",       StdFunc_strlen          },
 
@@ -107,10 +107,10 @@ static struct StdFuncDesc* FindFunc (const char* Name)
 
 
 
-static void StdFunc_strlen (struct expent* lval)
+static void StdFunc_strlen (ExprDesc* lval)
 /* Handle the strlen function */
 {
-    struct expent pval;
+    ExprDesc pval;
     static type ArgType[] = { T_PTR, T_SCHAR, T_END };
 
 
@@ -119,14 +119,14 @@ static void StdFunc_strlen (struct expent* lval)
 
     /* Check if the parameter is a const address */
     unsigned flags = 0;
-    unsigned pflags = pval.e_flags & ~E_MCTYPE;
+    unsigned pflags = pval.Flags & ~E_MCTYPE;
     if (pflags == E_MCONST) {
        /* Constant numeric address */
        flags |= CF_CONST | CF_ABSOLUTE;
-    } else if (k == 0 && ((pflags & E_MGLOBAL) != 0 || pval.e_flags == E_MEOFFS)) {
+    } else if (k == 0 && ((pflags & E_MGLOBAL) != 0 || pval.Flags == E_MEOFFS)) {
        /* Global array with or without offset */
        flags |= CF_CONST;
-       if (pval.e_flags & E_TGLAB) {
+       if (pval.Flags & E_TGLAB) {
            /* External linkage */
            flags |= CF_EXTERNAL;
        } else {
@@ -144,7 +144,7 @@ static void StdFunc_strlen (struct expent* lval)
     assignadjust (ArgType, &pval);
 
     /* Generate the strlen code */
-    g_strlen (flags, pval.e_name, pval.e_const);
+    g_strlen (flags, pval.Name, pval.ConstVal);
 
     /* We expect the closing brace */
     ConsumeRParen ();
@@ -169,11 +169,11 @@ int IsStdFunc (const char* Name)
 
 
 
-void HandleStdFunc (struct expent* lval)
+void HandleStdFunc (ExprDesc* lval)
 /* Generate code for a known standard function. */
 {
     /* Get a pointer to the table entry */
-    struct StdFuncDesc* F = FindFunc ((const char*) lval->e_name);
+    struct StdFuncDesc* F = FindFunc ((const char*) lval->Name);
     CHECK (F != 0);
 
     /* Call the handler function */