Changeset 860
- Timestamp:
- 03/29/2012 04:54:33 AM (14 months ago)
- Location:
- trunk
- Files:
-
- 8 modified
-
processor/head.m4 (modified) (1 diff)
-
processor/main.m4 (modified) (5 diffs)
-
processor/process.m4 (modified) (4 diffs)
-
processor/string.m4 (modified) (2 diffs)
-
utils.c (modified) (6 diffs)
-
utils.h (modified) (3 diffs)
-
xcache.c (modified) (3 diffs)
-
xcache.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/processor/head.m4
r856 r860 354 354 355 355 for (i = 0; i < assert_names_count; ++i) { 356 if (!zend_ hash_exists(done_names, assert_names[i], strlen(assert_names[i]) + 1)) {356 if (!zend_u_hash_exists(done_names, IS_STRING, assert_names[i], strlen(assert_names[i]) + 1)) { 357 357 fprintf(stderr 358 358 , "missing field at %s `#'%d %s`' : %s\n" -
trunk/processor/main.m4
r856 r860 25 25 define(`INDENT', `xc_dprint_indent(indent);') 26 26 dnl }}} 27 dnl {{{ ALLOC(1:dst, 2:type, 3:count=1, 4:clean=false, 5: forcetype=$2)27 dnl {{{ ALLOC(1:dst, 2:type, 3:count=1, 4:clean=false, 5:realtype=$2) 28 28 define(`ALLOC', ` 29 29 pushdef(`COUNT', `ifelse(`$3', `', `1', `$3')') 30 30 pushdef(`SIZE', `sizeof($2)ifelse(`$3', `', `', ` * $3')') 31 pushdef(` FORCETYPE', `ifelse(`$5', , `$2', `$5')')31 pushdef(`REALTYPE', `ifelse(`$5', , `$2', `$5')') 32 32 /* allocate */ 33 33 IFCALC(` … … 56 56 void *oldp = processor->p; 57 57 ') 58 $1 = ( FORCETYPE *) (processor->p = (char *) ALIGN(processor->p));58 $1 = (REALTYPE *) (processor->p = (char *) ALIGN(processor->p)); 59 59 ifelse(`$4', `', ` 60 60 IFASSERT(`memsetptr($1, (void *) (unsigned long) __LINE__, SIZE);') … … 72 72 IFRESTORE(`ifelse(`$4', `', ` 73 73 ifelse( 74 FORCETYPE*COUNT, `zval*1', `ALLOC_ZVAL($1);',75 FORCETYPE*COUNT, `HashTable*1', `ALLOC_HASHTABLE($1);',76 `', `', `$1 = ( FORCETYPE *) emalloc(SIZE);')74 REALTYPE*COUNT, `zval*1', `ALLOC_ZVAL($1);', 75 REALTYPE*COUNT, `HashTable*1', `ALLOC_HASHTABLE($1);', 76 `', `', `$1 = (REALTYPE *) emalloc(SIZE);') 77 77 IFASSERT(`memsetptr($1, (void *) __LINE__, SIZE);') 78 78 ', ` 79 $1 = (FORCETYPE *) ecalloc(COUNT, sizeof($2)); 80 ') 81 ') 79 $1 = (REALTYPE *) ecalloc(COUNT, sizeof($2)); 80 ') 81 ') 82 popdef(`REALTYPE') 82 83 popdef(`COUNT') 83 84 popdef(`SIZE') 84 85 ') 85 dnl CALLOC(1:dst, 2:type [, 3:count=1, 4: forcetype=$2 ])86 dnl CALLOC(1:dst, 2:type [, 3:count=1, 4:realtype=$2 ]) 86 87 define(`CALLOC', `ALLOC(`$1', `$2', `$3', `1', `$4')') 87 88 dnl }}} … … 96 97 IFDASM(`add_assoc_unicodel_ex(dst, ZEND_STRS("$3"), ZSTR_U($2->name), $2->name_length, 1);') 97 98 #else 98 IFDASM(`add_assoc_stringl_ex(dst, ZEND_STRS("$3"), $2->name, $2->name_length, 1);')99 IFDASM(`add_assoc_stringl_ex(dst, ZEND_STRS("$3"), (char *) $2->name, $2->name_length, 1);') 99 100 #endif 100 101 } … … 212 213 define(`ELEMENTS_DONE', defn(`ELEMENTS_DONE')`,"$1"') 213 214 IFASSERT(`dnl 214 if (zend_ hash_exists(&done_names, "$1", sizeof("$1"))) {215 if (zend_u_hash_exists(&done_names, IS_STRING, "$1", sizeof("$1"))) { 215 216 fprintf(stderr 216 217 , "duplicate field at %s `#'%d FUNC_NAME`' : %s\n" -
trunk/processor/process.m4
r844 r860 15 15 dnl }}} 16 16 define(`PROCESS_xc_ztstring', `dnl {{{ (1:elm) 17 pushdef(`REALPTRTYPE', `zend_class_entry') 17 18 PROC_STRING(`$1') 19 popdef(`REALPTRTYPE') 18 20 ') 19 21 dnl }}} … … 74 76 ) 75 77 ') 76 define(`PROCESS_ARRAY', `dnl {{{ (1:count, 2:type, 3:elm, [4: force_type])78 define(`PROCESS_ARRAY', `dnl {{{ (1:count, 2:type, 3:elm, [4:real_type]) 77 79 if (src->$3) { 78 80 int LOOPCOUNTER; … … 87 89 ++LOOPCOUNTER) { 88 90 pushdef(`dst', `arr') 89 pushdef(`SRC', defn(`SRC') `[LOOPCOUNTER]')91 pushdef(`SRC', `ifelse(`$4', `', `', `', `', `($2)')' defn(`SRC') `[LOOPCOUNTER]') 90 92 popdef(`add_assoc_bool_ex', `add_next_index_bool($1, $3)') 91 93 popdef(`add_assoc_string_ex', `add_next_index_string($1, $3)') … … 125 127 DISABLECHECK(` 126 128 pushdef(`DST', defn(`DST') `[LOOPCOUNTER]') 127 pushdef(`SRC', ((const char **) defn(`SRC'))`[LOOPCOUNTER]')129 pushdef(`SRC', `ifelse(`$4', `', `', `', `', `($2)')' defn(`SRC') `[LOOPCOUNTER]') 128 130 PROCESS(`$2', `$3') 129 131 popdef(`SRC') -
trunk/processor/string.m4
r844 r860 60 60 ') 61 61 IFCALC(`xc_calc_string_n(processor, ISTYPE, SRCSTR, $3 C_RELAYLINE);') 62 IFSTORE(`DSTPTR = if else(PTRTYPE,`char',`ZSTR_S',`ZSTR_U')(xc_store_string_n(processor, ISTYPE, SRCSTR, $3 C_RELAYLINE));')62 IFSTORE(`DSTPTR = ifdef(`REALPTRTYPE', `(REALPTRTYPE() *)') ifelse(PTRTYPE,`char',`ZSTR_S',`ZSTR_U')(xc_store_string_n(processor, ISTYPE, SRCSTR, $3 C_RELAYLINE));') 63 63 IFRESTORE(` 64 DSTPTR = STRDUP() (SRCPTR, ($3) - 1);64 DSTPTR = ifdef(`REALPTRTYPE', `(REALPTRTYPE() *)') STRDUP() (SRCPTR, ($3) - 1); 65 65 ') 66 FIXPOINTER_EX( `PTRTYPE', DSTPTR)66 FIXPOINTER_EX(ifdef(`REALPTRTYPE', `REALPTRTYPE()', `PTRTYPE'), DSTPTR) 67 67 IFDASM(` 68 68 ifelse(STRTYPE,zstr_uchar, ` … … 70 70 ', ` dnl else 71 71 ifelse(STRTYPE,zstr_char, ` 72 add_assoc_stringl_ex(dst, ZEND_STRS("$4"), ZSTR_S($2), $3-1, 1);72 add_assoc_stringl_ex(dst, ZEND_STRS("$4"), (char *) ZSTR_S($2), $3-1, 1); 73 73 ', ` 74 add_assoc_stringl_ex(dst, ZEND_STRS("$4"), $2, $3-1, 1);74 add_assoc_stringl_ex(dst, ZEND_STRS("$4"), (char *) $2, $3-1, 1); 75 75 ') 76 76 ') -
trunk/utils.c
r853 r860 482 482 483 483 #ifdef HAVE_XCACHE_CONSTANT 484 void xc_install_constant(ZEND_24( const) char *filename, zend_constant *constant, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC) /* {{{ */484 void xc_install_constant(ZEND_24(NOTHING, const) char *filename, zend_constant *constant, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC) /* {{{ */ 485 485 { 486 486 if (zend_u_hash_add(EG(zend_constants), type, key, len, … … 502 502 /* }}} */ 503 503 #endif 504 void xc_install_function(ZEND_24( const) char *filename, zend_function *func, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC) /* {{{ */504 void xc_install_function(ZEND_24(NOTHING, const) char *filename, zend_function *func, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC) /* {{{ */ 505 505 { 506 506 zend_bool istmpkey; … … 532 532 } 533 533 /* }}} */ 534 ZESW(xc_cest_t *, void) xc_install_class(ZEND_24( const) char *filename, xc_cest_t *cest, int oplineno, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC) /* {{{ */534 ZESW(xc_cest_t *, void) xc_install_class(ZEND_24(NOTHING, const) char *filename, xc_cest_t *cest, int oplineno, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC) /* {{{ */ 535 535 { 536 536 zend_bool istmpkey; … … 630 630 #endif 631 631 #ifdef ZEND_ENGINE_2_1 632 static zend_bool xc_auto_global_callback(ZEND_24( const) char *name, uint name_len TSRMLS_DC) /* {{{ */632 static zend_bool xc_auto_global_callback(ZEND_24(NOTHING, const) char *name, uint name_len TSRMLS_DC) /* {{{ */ 633 633 { 634 634 return 0; … … 710 710 /* }}} */ 711 711 #endif 712 xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, ZEND_24( const) char *filename TSRMLS_DC) /* {{{ */712 xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, ZEND_24(NOTHING, const) char *filename TSRMLS_DC) /* {{{ */ 713 713 { 714 714 HashTable *h; … … 905 905 if (install != XC_NoInstall) { 906 906 CG(in_compilation) = 1; 907 CG(compiled_filename) = ZEND_24( (char *)) sandbox->filename;907 CG(compiled_filename) = ZEND_24(NOTHING, (char *)) sandbox->filename; 908 908 CG(zend_lineno) = 0; 909 909 xc_sandbox_install(sandbox, install TSRMLS_CC); -
trunk/utils.h
r847 r860 69 69 /* installer */ 70 70 #ifdef HAVE_XCACHE_CONSTANT 71 void xc_install_constant(ZEND_24( const) char *filename, zend_constant *constant, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC);71 void xc_install_constant(ZEND_24(NOTHING, const) char *filename, zend_constant *constant, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC); 72 72 #endif 73 void xc_install_function(ZEND_24( const) char *filename, zend_function *func, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC);74 ZESW(xc_cest_t *, void) xc_install_class(ZEND_24( const) char *filename, xc_cest_t *cest, int oplineno, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC);73 void xc_install_function(ZEND_24(NOTHING, const) char *filename, zend_function *func, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC); 74 ZESW(xc_cest_t *, void) xc_install_class(ZEND_24(NOTHING, const) char *filename, xc_cest_t *cest, int oplineno, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC); 75 75 76 76 #if defined(E_STRICT) || defined(E_DEPRECATED) … … 81 81 typedef struct { 82 82 int alloc; 83 ZEND_24( const) char *filename;83 ZEND_24(NOTHING, const) char *filename; 84 84 85 85 HashTable orig_included_files; … … 122 122 123 123 void xc_zend_class_add_ref(zend_class_entry ZESW(*ce, **ce)); 124 xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, ZEND_24( const) char *filename TSRMLS_DC);124 xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, ZEND_24(NOTHING, const) char *filename TSRMLS_DC); 125 125 void xc_sandbox_free(xc_sandbox_t *sandbox, xc_install_action_t install TSRMLS_DC); 126 126 -
trunk/xcache.c
r859 r860 1134 1134 } 1135 1135 /* }}} */ 1136 static void xc_entry_init_key_php_entry(xc_entry_php_t *entry_php, ZEND_24(const)char *filepath TSRMLS_DC) /* {{{*/1137 { 1138 entry_php->filepath = filepath;1136 static void xc_entry_init_key_php_entry(xc_entry_php_t *entry_php, const char *filepath TSRMLS_DC) /* {{{*/ 1137 { 1138 entry_php->filepath = ZEND_24((char *), NOTHING) filepath; 1139 1139 entry_php->filepath_len = strlen(entry_php->filepath); 1140 1140 entry_php->dirpath = estrndup(entry_php->filepath, entry_php->filepath_len); … … 1696 1696 1697 1697 xc_undo_pass_two(compiler->new_php.op_array TSRMLS_CC); 1698 xc_foreach_early_binding_class(compiler->new_php.op_array, xc_cache_early_binding_class_cb, (void *) compiler->new_php.SRMLS_CC);1698 xc_foreach_early_binding_class(compiler->new_php.op_array, xc_cache_early_binding_class_cb, (void *) &compiler->new_php TSRMLS_CC); 1699 1699 xc_redo_pass_two(compiler->new_php.op_array TSRMLS_CC); 1700 1700 /* }}} */ … … 3145 3145 PHP_FUNCTION(xcache_is_autoglobal) 3146 3146 { 3147 char *name; 3148 int name_len; 3149 3150 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { 3147 zval *name; 3148 3149 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name) == FAILURE) { 3151 3150 return; 3152 3151 } 3153 3152 3154 RETURN_BOOL(zend_ hash_exists(CG(auto_globals), name, name_len+ 1));3153 RETURN_BOOL(zend_u_hash_exists(CG(auto_globals), UG(unicode), Z_STRVAL_P(name), Z_STRLEN_P(name) + 1)); 3155 3154 } 3156 3155 /* }}} */ -
trunk/xcache.h
r859 r860 43 43 #endif 44 44 #ifdef ZEND_ENGINE_2_4 45 # define ZEND_24( x) x46 #else 47 # define ZEND_24( x)45 # define ZEND_24(pre24, v24) v24 46 #else 47 # define ZEND_24(pre24, v24) pre24 48 48 #endif 49 49 … … 191 191 #ifndef IS_UNICODE 192 192 # define zend_u_hash_add(ht, type, arKey, nKeyLength, pData, nDataSize, pDest) \ 193 zend_hash_add(ht, arKey, nKeyLength, pData, nDataSize, pDest)193 zend_hash_add(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength, pData, nDataSize, pDest) 194 194 195 195 # define zend_u_hash_quick_add(ht, type, arKey, nKeyLength, h, pData, nDataSize, pDest) \ 196 zend_hash_quick_add(ht, arKey, nKeyLength, h, pData, nDataSize, pDest)196 zend_hash_quick_add(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength, h, pData, nDataSize, pDest) 197 197 198 198 # define zend_u_hash_update(ht, type, arKey, nKeyLength, pData, nDataSize, pDest) \ 199 zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest)199 zend_hash_update(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength, pData, nDataSize, pDest) 200 200 201 201 # define zend_u_hash_quick_update(ht, type, arKey, nKeyLength, h, pData, nDataSize, pDest) \ 202 zend_hash_quick_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest)202 zend_hash_quick_update(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength, h, pData, nDataSize, pDest) 203 203 204 204 # define zend_u_hash_find(ht, type, arKey, nKeyLength, pData) \ 205 zend_hash_find(ht, arKey, nKeyLength, pData)205 zend_hash_find(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength, pData) 206 206 207 207 # define zend_u_hash_quick_find(ht, type, arKey, nKeyLength, h, pData) \ 208 zend_hash_quick_find(ht, arKey, nKeyLength, h, pData) 208 zend_hash_quick_find(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength, h, pData) 209 210 # define zend_u_hash_exists(ht, type, arKey, nKeyLength) \ 211 zend_hash_exists(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength) 209 212 210 213 # define add_u_assoc_zval_ex(arg, type, key, key_len, value) \ … … 438 441 439 442 int filepath_len; 440 ZEND_24( const) char *filepath;443 ZEND_24(NOTHING, const) char *filepath; 441 444 int dirpath_len; 442 445 char *dirpath;

