logo       

cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_execute.c: msg#00035

Subject: cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_execute.c
andi            Thu Aug 12 01:54:11 2004 EDT

  Modified files:              
    /ZendEngine2        zend_compile.c zend_compile.h zend_execute.c 
  Log:
  - Don't use magic numbers
  
  
http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?r1=1.575&r2=1.576&ty=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.575 ZendEngine2/zend_compile.c:1.576
--- ZendEngine2/zend_compile.c:1.575    Thu Aug 12 01:41:01 2004
+++ ZendEngine2/zend_compile.c  Thu Aug 12 01:54:11 2004
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_compile.c,v 1.575 2004/08/12 05:41:01 andi Exp $ */
+/* $Id: zend_compile.c,v 1.576 2004/08/12 05:54:11 andi Exp $ */
 
 #include "zend_language_parser.h"
 #include "zend.h"
@@ -3353,7 +3353,7 @@
                value = tmp;
 
                /* Mark extended_value in case both key and value are being 
used */
-               
CG(active_op_array)->opcodes[foreach_token->u.opline_num].extended_value |= 2;
+               
CG(active_op_array)->opcodes[foreach_token->u.opline_num].extended_value |= 
ZEND_FE_FETCH_WITH_KEY;
        }
 
        if ((key->op_type != IS_UNUSED) && (key->u.EA.type & 
ZEND_PARSED_REFERENCE_VARIABLE)) {
@@ -3366,7 +3366,7 @@
                        zend_error(E_COMPILE_ERROR, "Cannot create references 
to elements of a temporary array expression");
                }
                /* Mark extended_value for assign-by-reference */
-               
CG(active_op_array)->opcodes[foreach_token->u.opline_num].extended_value |= 1;
+               
CG(active_op_array)->opcodes[foreach_token->u.opline_num].extended_value |= 
ZEND_FE_FETCH_BYREF;
        }
 
        if (key->op_type != IS_UNUSED) {
http://cvs.php.net/diff.php/ZendEngine2/zend_compile.h?r1=1.287&r2=1.288&ty=u
Index: ZendEngine2/zend_compile.h
diff -u ZendEngine2/zend_compile.h:1.287 ZendEngine2/zend_compile.h:1.288
--- ZendEngine2/zend_compile.h:1.287    Mon Aug  2 04:27:57 2004
+++ ZendEngine2/zend_compile.h  Thu Aug 12 01:54:11 2004
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_compile.h,v 1.287 2004/08/02 08:27:57 helly Exp $ */
+/* $Id: zend_compile.h,v 1.288 2004/08/12 05:54:11 andi Exp $ */
 
 #ifndef ZEND_COMPILE_H
 #define ZEND_COMPILE_H
@@ -793,6 +793,9 @@
 
 #define ZEND_FETCH_STANDARD            0
 #define ZEND_FETCH_ADD_LOCK            1
+
+#define ZEND_FE_FETCH_BYREF    1
+#define ZEND_FE_FETCH_WITH_KEY 2
 
 #define ZEND_MEMBER_FUNC_CALL  1<<0
 
http://cvs.php.net/diff.php/ZendEngine2/zend_execute.c?r1=1.666&r2=1.667&ty=u
Index: ZendEngine2/zend_execute.c
diff -u ZendEngine2/zend_execute.c:1.666 ZendEngine2/zend_execute.c:1.667
--- ZendEngine2/zend_execute.c:1.666    Thu Aug 12 01:41:01 2004
+++ ZendEngine2/zend_execute.c  Thu Aug 12 01:54:11 2004
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_execute.c,v 1.666 2004/08/12 05:41:01 andi Exp $ */
+/* $Id: zend_execute.c,v 1.667 2004/08/12 05:54:11 andi Exp $ */
 
 #define ZEND_INTENSIVE_DEBUGGING 0
 
@@ -3779,8 +3779,7 @@
        HashTable *fe_ht;
        zend_object_iterator *iter = NULL;
        int key_type;
-       /* extended_value & 2 means that the key is also needed */
-       zend_bool use_key = opline->extended_value & 2;
+       zend_bool use_key = opline->extended_value & ZEND_FE_FETCH_WITH_KEY;
 
        PZVAL_LOCK(array);
 
@@ -3858,13 +3857,13 @@
                        break;
        }
 
-       if (opline->extended_value & 1) {
+       if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
                SEPARATE_ZVAL_IF_NOT_REF(value);
                (*value)->is_ref = 1;
        }
 
        if (!use_key) {
-               if (opline->extended_value & 1) {
+               if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
                        EX_T(opline->result.u.var).var.ptr_ptr = value;
                        (*value)->refcount++;
                } else {

-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe