Changeset 1380 in svn for trunk/processor/hashtable.m4


Ignore:
Timestamp:
2013-09-22T16:45:46+02:00 (23 months ago)
Author:
Xuefer
Message:

make use of SRC/DST widely

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/hashtable.m4

    r1352 r1380  
    3434
    3535            DISABLECHECK(`
    36             for (srcBucket = src->pListHead; srcBucket != NULL; srcBucket = srcBucket->pListNext) {
     36            for (srcBucket = SRC(`pListHead'); srcBucket != NULL; srcBucket = srcBucket->pListNext) {
    3737                ALLOC_INIT_ZVAL(zv);
    3838                array_init(zv);
     
    7575
    7676#if defined(HARDENING_PATCH_HASH_PROTECT) && HARDENING_PATCH_HASH_PROTECT
    77         IFASM(`dst->canary = zend_hash_canary; DONE(canary)', `
     77        IFASM(`DST(`canary') = zend_hash_canary; DONE(canary)', `
    7878        dnl elseif
    79             IFRESTORE(`dst->canary = zend_hash_canary; DONE(canary)', `
     79            IFRESTORE(`DST(`canary') = zend_hash_canary; DONE(canary)', `
    8080                dnl else
    8181                PROCESS(unsigned int, canary)
     
    8787        PROCESS(uint, nNumOfElements)
    8888        PROCESS(ulong, nNextFreeElement)
    89         IFCOPY(`dst->pInternalPointer = NULL;   /* Used for element traversal */') DONE(pInternalPointer)
    90         IFCOPY(`dst->pListHead = NULL;') DONE(pListHead)
     89        IFCOPY(`DST(`pInternalPointer') = NULL; /* Used for element traversal */') DONE(pInternalPointer)
     90        IFCOPY(`DST(`pListHead') = NULL;') DONE(pListHead)
    9191#ifdef ZEND_ENGINE_2_4
    92         if (src->nTableMask) {
     92        if (SRC(`nTableMask')) {
    9393#endif
    94         CALLOC(dst->arBuckets, Bucket*, src->nTableSize)
     94        CALLOC(`DST(`arBuckets')', Bucket*, SRC(`nTableSize'))
    9595        DONE(arBuckets)
    9696        DISABLECHECK(`
    97         for (srcBucket = src->pListHead; srcBucket != NULL; srcBucket = srcBucket->pListNext) {
     97        for (srcBucket = SRC(`pListHead'); srcBucket != NULL; srcBucket = srcBucket->pListNext) {
    9898            ifelse($4, `', `', `
    9999                pushdef(`BUCKET', `srcBucket')
    100100                if ($4 == ZEND_HASH_APPLY_REMOVE) {
    101                     IFCOPY(`dst->nNumOfElements --;')
     101                    IFCOPY(`DST(`nNumOfElements') --;')
    102102                    continue;
    103103                }
     
    120120                memcpy(pnew, srcBucket, bucketsize);
    121121#endif
    122                 n = srcBucket->h & src->nTableMask;
     122                n = srcBucket->h & SRC(`nTableMask');
    123123                /* pnew into hash node chain */
    124124                pnew->pLast = NULL;
    125                 pnew->pNext = dst->arBuckets[n];
     125                pnew->pNext = DST(`arBuckets[n]');
    126126                if (pnew->pNext) {
    127127                    pnew->pNext->pLast = pnew;
    128128                }
    129                 dst->arBuckets[n] = pnew;
     129                DST(`arBuckets[n]') = pnew;
    130130            ')
    131131            IFDPRINT(`
     
    146146
    147147            if (first) {
    148                 IFCOPY(`dst->pListHead = pnew;')
     148                IFCOPY(`DST(`pListHead') = pnew;')
    149149                first = 0;
    150150            }
     
    163163#ifdef ZEND_ENGINE_2_4
    164164    }
    165     else { /* if (src->nTableMask) */
     165    else { /* if (SRC(`nTableMask')) */
    166166        DONE(arBuckets)
    167167    }
    168168#endif
    169         IFCOPY(`dst->pListTail = pnew;') DONE(pListTail)
    170         IFCOPY(`dst->pDestructor = src->pDestructor;') DONE(pDestructor)
     169        IFCOPY(`DST(`pListTail') = pnew;') DONE(pListTail)
     170        IFCOPY(`DST(`pDestructor') = SRC(`pDestructor');') DONE(pDestructor)
    171171        PROCESS(zend_bool, persistent)
    172172#ifdef IS_UNICODE
Note: See TracChangeset for help on using the changeset viewer.