Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/embryo

Dir     : e17/libs/embryo/src/lib


Modified Files:
        embryo_amx.c 


Log Message:


1. test.sma will become a comprehensive test now... starting anyway
2. fixed OP_SWITCH handling - man it was so broken!

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/embryo/src/lib/embryo_amx.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- embryo_amx.c        30 Mar 2004 09:35:50 -0000      1.15
+++ embryo_amx.c        15 May 2004 05:04:07 -0000      1.16
@@ -620,7 +620,7 @@
    for (i = 0; src[i] != 0; i++)
      {
        if ((void *)(&(str_cell[i])) >= (void *)(ep->base + hdr->stp)) return;
-       else if ((void *)(&(str_cell[i]) == (void *)(ep->base + hdr->stp - 1)))
+       else if ((void *)(&(str_cell[i])) == (void *)(ep->base + hdr->stp - 1))
          {
             str_cell[i] = 0;
             return;
@@ -1509,10 +1509,10 @@
             ep->hea = hea;
             ep->frm = frm;
             ep->stk = stk;
-            pri = ((Embryo_Native)offs)(ep, (Embryo_Cell *)(data + (int)stk));
-            if (ep->error != EMBRYO_ERROR_NONE)
+            num = _embryo_native_call(ep, offs, &pri, (Embryo_Cell *)(data + 
(int)stk));
+            if (num != EMBRYO_ERROR_NONE)
               {
-                 if (ep->error == EMBRYO_ERROR_SLEEP)
+                 if (num == EMBRYO_ERROR_SLEEP)
                    {
                       ep->pri = pri;
                       ep->alt = alt;
@@ -1529,13 +1529,20 @@
             break;
           case EMBRYO_OP_SWITCH:
               {
-                 Embryo_Cell *cptr;
-                 
-                 cptr = (Embryo_Cell *)*cip + 1; /* +1, to skip the "casetbl" opcode 
*/
-                 cip = (Embryo_Cell *)*(cptr + 1); /* preset to "none-matched" case */
-                 num = (int)*cptr; /* number of records in the case table */
-                 for (cptr += 2; (num > 0) && (*cptr != pri); num--, cptr += 2);
-                 if (num > 0) cip = (Embryo_Cell *)*(cptr + 1); /* case found */
+                 Embryo_Cell *cptr, *tbl;
+
+                 /* +1, to skip the "casetbl" opcode */
+                 cptr = (Embryo_Cell *)(code + (*cip)) + 1;
+                 /* number of records in the case table */
+                 num = (int)(*cptr);
+                 /* preset to "none-matched" case */
+                 cip = (Embryo_Cell *)(code + *(cptr + 1));
+                 for (cptr += 2; 
+                      (num > 0) && (*cptr != pri); 
+                      num--, cptr += 2);
+                 /* case found */
+                 if (num > 0)
+                   cip = (Embryo_Cell *)(code + *(cptr + 1));
               }
             break;
           case EMBRYO_OP_SWAP_PRI:




-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to