Changeset 170

Show
Ignore:
Timestamp:
02/21/06 17:45:43 (3 years ago)
Author:
hrak
Message:

* Ditched the variadic macros. They were kinda useless now anyway since they were only passing one arg. This should make the Win32 folks happy since Visual Studio 6 doesn't support variadic macros (its a C99 thing)
* Removed some excessive debug output.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/trunk/ChangeLog

    r169 r170  
     12006-02-21  Hans Rakers <hans at parse dot nl> 
     2 
     3        * Ditched the variadic macros. They were kinda useless now anyway since 
     4          they were only passing one arg. This should make the Win32 folks happy 
     5          since VC6 doesn't seem to support variadic macros (its a C99 thing) 
     6        * Removed some excessive debug output. 
     7 
    182006-02-20  Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 
    29 
  • eaccelerator/trunk/ea_restore.c

    r167 r170  
    719719                                                  zend_class_entry * to TSRMLS_DC) 
    720720{ 
    721         ea_debug_printf(EA_DEBUG, "restore_class_parent: restoring parent class %s of class %s\n", (char *) parent, to->name); 
    722721#ifdef ZEND_ENGINE_2 
    723722        zend_class_entry** parent_ptr = NULL; 
    724723        if (zend_lookup_class(parent, len, &parent_ptr TSRMLS_CC) != SUCCESS) 
    725724#else 
    726         ea_debug_hash_display(CG(class_table)); 
    727725        char *name_lc = estrndup(parent, len); 
    728726        zend_str_tolower(name_lc, len); 
     
    765763                fname_len = strlen(f->common.function_name); 
    766764                fname_lc = zend_str_tolower_dup(f->common.function_name, fname_len); 
    767                 ea_debug_printf(EA_DEBUG, "restore_class_methods: restoring function:%s scope:%s parent=%x scope=%x\n", fname_lc, ZEND_FN_SCOPE_NAME(f), to->parent, f->common.scope); 
    768765 
    769766                if (fname_len == cname_len && !memcmp(fname_lc, cname_lc, fname_len) &&  
     
    900897        to->default_static_members.pDestructor = ZVAL_PTR_DTOR; 
    901898         
    902         ea_debug_printf(EA_DEBUG, "restore_class_entry: static_members=%x, default_static_members=%x\n", from->static_members, &from->default_static_members); 
    903899        if (from->static_members != &(from->default_static_members)) { 
    904900                ALLOC_HASHTABLE(to->static_members); 
     
    908904                to->static_members = &(to->default_static_members); 
    909905        } 
    910         ea_debug_printf(EA_DEBUG, "restore_class_entry: to->static_members=%x, to->default_static_members=%x\n", to->static_members, &to->default_static_members); 
    911906#  else 
    912907        if (from->static_members != NULL) { 
  • eaccelerator/trunk/ea_store.c

    r166 r170  
    381381 
    382382typedef void *(*store_bucket_t) (void *TSRMLS_DC); 
    383 typedef void *(*check_bucket_t) (Bucket*, va_list); 
    384  
    385 #define store_hash_ex(to, from, start, store_bucket, check_bucket, ...) \ 
    386   store_hash_int(to, from, start, store_bucket, check_bucket, __VA_ARGS__
    387  
    388 #define store_hash(to, from, store_bucket, check_bucket, ...) \ 
    389   store_hash_ex(to, from, (from)->pListHead, store_bucket, check_bucket, __VA_ARGS__
     383typedef void *(*check_bucket_t) (Bucket*, zend_class_entry*); 
     384 
     385#define store_hash_ex(to, from, start, store_bucket, check_bucket, from_ce) \ 
     386  store_hash_int(to, from, start, store_bucket, check_bucket, from_ce
     387 
     388#define store_hash(to, from, store_bucket, check_bucket, from_ce) \ 
     389  store_hash_ex(to, from, (from)->pListHead, store_bucket, check_bucket, from_ce
    390390 
    391391#define store_zval_hash(to, from) \ 
     
    408408static void store_hash_int(HashTable * target, HashTable * source, 
    409409                                                   Bucket * start, store_bucket_t copy_bucket, 
    410                                                                    check_bucket_t check_bucket, ...) 
     410                                                                   check_bucket_t check_bucket, 
     411                                                                   zend_class_entry * from_ce) 
    411412{ 
    412413        Bucket *p, *np, *prev_p; 
     
    434435                        /* If a check function has been defined, run it */ 
    435436                        if (check_bucket) { 
    436                                 va_list args; 
    437                                 va_start(args, check_bucket); 
    438  
    439437                                /* If the check function returns ZEND_HASH_APPLY_REMOVE, don't store this record, skip over it */ 
    440                                 if(check_bucket(p, args)) { 
     438                                if(check_bucket(p, from_ce)) { 
    441439                                        p = p->pListNext; 
    442440                                        target->nNumOfElements--; 
     
    444442                                        continue; 
    445443                                } 
    446                                 va_end(args); 
    447444                        } 
    448445 
     
    767764 * zend_do_inherit_property_access_check 
    768765*/ 
    769 static int store_property_access_check(Bucket * p, va_list args
    770 { 
    771         zend_class_entry *from = va_arg(args, zend_class_entry*)
     766static int store_property_access_check(Bucket * p, zend_class_entry * from_ce
     767{ 
     768        zend_class_entry *from = from_ce
    772769        zend_class_entry *parent = from->parent; 
    773          
    774         ea_debug_printf(EA_DEBUG, "[%d] store_property_access_check enter. from=%x parent=%x arKey=%s\n", getpid(), from, parent, p->arKey); 
    775770         
    776771        if (parent) { 
     
    779774                // for now, just return keep 
    780775        } 
    781         ea_debug_printf(EA_DEBUG, "[%d] store_property_access_check result: keep\n", getpid()); 
    782776        return ZEND_HASH_APPLY_KEEP; 
    783777} 
    784778 
    785 static int store_static_member_access_check(Bucket * p, va_list args
    786 { 
    787         zend_class_entry *from = va_arg(args, zend_class_entry*)
     779static int store_static_member_access_check(Bucket * p, zend_class_entry * from_ce
     780{ 
     781        zend_class_entry *from = from_ce
    788782        zend_class_entry *parent = from->parent; 
    789783        zend_property_info *pinfo, *cinfo = NULL; 
     
    796790                /* unpack the \0classname\0membername\0 style property name to seperate vars */ 
    797791                zend_unmangle_property_name(p->arKey, &cname, &mname); 
    798                 ea_debug_printf(EA_DEBUG, "[%d] store_static_member_access_check: cname=%s, mname=%s\n", getpid(), cname, mname); 
    799792         
    800793                /* lookup the member's info in parent and child */ 
     
    804797                           inheritance will handle this properly on restore */ 
    805798                        if(cinfo->flags & ZEND_ACC_STATIC && (pinfo->flags & ZEND_ACC_PROTECTED && cinfo->flags & ZEND_ACC_PUBLIC)) { 
    806                                 ea_debug_printf(EA_DEBUG, "[%d] store_static_member_access_check: child static public, parent protected, result: skip\n", getpid()); 
    807799                                return ZEND_HASH_APPLY_REMOVE; 
    808800                        } 
     
    813805                        if(zend_hash_quick_find(parent->static_members, p->arKey, p->nKeyLength, p->h, (void**)&pprop) == SUCCESS) { 
    814806#  endif 
    815                                 ea_debug_printf(EA_DEBUG, "[%d] store_static_member_access_check: SUCCESS looking up arKey\n",getpid()); 
    816                                 ea_debug_printf(EA_DEBUG, "[%d] store_static_member_access_check: pprop=%x cprop=%x\n",getpid(), *pprop, *cprop); 
    817807                                if(*pprop == *cprop) { 
    818                                         ea_debug_printf(EA_DEBUG, "[%d] store_static_member_access_check: pprop == cprop, result: skip\n",getpid()); 
    819808                                        return ZEND_HASH_APPLY_REMOVE; 
    820809                                } 
     
    822811                } 
    823812        } 
    824         ea_debug_printf(EA_DEBUG, "[%d] store_static_member_access_check: result: keep\n",getpid()); 
    825813        return ZEND_HASH_APPLY_KEEP; 
    826814} 
     
    834822 * (e.g. "Cannot override final method") and the like. 
    835823 */ 
    836 static int store_function_inheritance_check(Bucket * p, va_list args
    837 { 
    838         zend_class_entry *from = va_arg(args, zend_class_entry*)
     824static int store_function_inheritance_check(Bucket * p, zend_class_entry * from_ce
     825{ 
     826        zend_class_entry *from = from_ce
    839827        zend_function *zf = p->pData; 
    840828         
     
    853841        EAG(mem) += sizeof(eaccelerator_class_entry); 
    854842        to->type = from->type; 
    855         ea_debug_printf(EA_DEBUG, "[%d] store_class_entry: class type=%d\n", getpid(), from->type); 
    856843        to->name = NULL; 
    857844        to->name_length = from->name_length; 
     
    898885        store_hash(&to->properties_info, &from->properties_info, (store_bucket_t) store_property_info, (check_bucket_t) store_property_access_check, from); 
    899886#  ifdef ZEND_ENGINE_2_1 
    900         ea_debug_printf(EA_DEBUG, "[%d] store_class_entry: from->static_members(%x), from->default_static_members(%x)\n", getpid(), from->static_members, &from->default_static_members); 
    901887        if((from->static_members != NULL) && (from->static_members != &from->default_static_members)) { 
    902888                store_zval_hash(&to->default_static_members, &from->default_static_members); 
     
    912898                to->static_members = &to->default_static_members; 
    913899        } 
    914         ea_debug_printf(EA_DEBUG, "[%d] store_class_entry: to->static_members(%x), to->default_static_members(%x)\n", getpid(), to->static_members, &to->default_static_members); 
    915900#  elif defined(ZEND_ENGINE_2) && !defined(ZEND_ENGINE_2_1) 
    916901        /* for php-5.0 */