Index: /trunk/processor/head.m4
===================================================================
--- /trunk/processor/head.m4	(revision 859)
+++ /trunk/processor/head.m4	(revision 860)
@@ -354,5 +354,5 @@
 
 		for (i = 0; i < assert_names_count; ++i) {
-			if (!zend_hash_exists(done_names, assert_names[i], strlen(assert_names[i]) + 1)) {
+			if (!zend_u_hash_exists(done_names, IS_STRING, assert_names[i], strlen(assert_names[i]) + 1)) {
 				fprintf(stderr
 					, "missing field at %s `#'%d %s`' : %s\n"
Index: /trunk/processor/main.m4
===================================================================
--- /trunk/processor/main.m4	(revision 859)
+++ /trunk/processor/main.m4	(revision 860)
@@ -25,9 +25,9 @@
 define(`INDENT', `xc_dprint_indent(indent);')
 dnl }}}
-dnl {{{ ALLOC(1:dst, 2:type, 3:count=1, 4:clean=false, 5:forcetype=$2)
+dnl {{{ ALLOC(1:dst, 2:type, 3:count=1, 4:clean=false, 5:realtype=$2)
 define(`ALLOC', `
 	pushdef(`COUNT', `ifelse(`$3', `', `1', `$3')')
 	pushdef(`SIZE', `sizeof($2)ifelse(`$3', `', `', ` * $3')')
-	pushdef(`FORCETYPE', `ifelse(`$5', , `$2', `$5')')
+	pushdef(`REALTYPE', `ifelse(`$5', , `$2', `$5')')
 	/* allocate */
 	IFCALC(`
@@ -56,5 +56,5 @@
 			void *oldp = processor->p;
 		')
-		$1 = (FORCETYPE *) (processor->p = (char *) ALIGN(processor->p));
+		$1 = (REALTYPE *) (processor->p = (char *) ALIGN(processor->p));
 		ifelse(`$4', `', `
 				IFASSERT(`memsetptr($1, (void *) (unsigned long) __LINE__, SIZE);')
@@ -72,16 +72,17 @@
 	IFRESTORE(`ifelse(`$4', `', `
 			ifelse(
-				FORCETYPE*COUNT, `zval*1', `ALLOC_ZVAL($1);',
-				FORCETYPE*COUNT, `HashTable*1', `ALLOC_HASHTABLE($1);',
-				`', `', `$1 = (FORCETYPE *) emalloc(SIZE);')
+				REALTYPE*COUNT, `zval*1', `ALLOC_ZVAL($1);',
+				REALTYPE*COUNT, `HashTable*1', `ALLOC_HASHTABLE($1);',
+				`', `', `$1 = (REALTYPE *) emalloc(SIZE);')
 			IFASSERT(`memsetptr($1, (void *) __LINE__, SIZE);')
 		', `
-			$1 = (FORCETYPE *) ecalloc(COUNT, sizeof($2));
-		')
-	')
+			$1 = (REALTYPE *) ecalloc(COUNT, sizeof($2));
+		')
+	')
+	popdef(`REALTYPE')
 	popdef(`COUNT')
 	popdef(`SIZE')
 ')
-dnl CALLOC(1:dst, 2:type [, 3:count=1, 4:forcetype=$2 ])
+dnl CALLOC(1:dst, 2:type [, 3:count=1, 4:realtype=$2 ])
 define(`CALLOC', `ALLOC(`$1', `$2', `$3', `1', `$4')')
 dnl }}}
@@ -96,5 +97,5 @@
 		IFDASM(`add_assoc_unicodel_ex(dst, ZEND_STRS("$3"), ZSTR_U($2->name), $2->name_length, 1);')
 #else
-		IFDASM(`add_assoc_stringl_ex(dst, ZEND_STRS("$3"), $2->name, $2->name_length, 1);')
+		IFDASM(`add_assoc_stringl_ex(dst, ZEND_STRS("$3"), (char *) $2->name, $2->name_length, 1);')
 #endif
 	}
@@ -212,5 +213,5 @@
 	define(`ELEMENTS_DONE', defn(`ELEMENTS_DONE')`,"$1"')
 	IFASSERT(`dnl
-		if (zend_hash_exists(&done_names, "$1", sizeof("$1"))) {
+		if (zend_u_hash_exists(&done_names, IS_STRING, "$1", sizeof("$1"))) {
 			fprintf(stderr
 				, "duplicate field at %s `#'%d FUNC_NAME`' : %s\n"
Index: /trunk/processor/process.m4
===================================================================
--- /trunk/processor/process.m4	(revision 859)
+++ /trunk/processor/process.m4	(revision 860)
@@ -15,5 +15,7 @@
 dnl }}}
 define(`PROCESS_xc_ztstring', `dnl {{{ (1:elm)
+	pushdef(`REALPTRTYPE', `zend_class_entry')
 	PROC_STRING(`$1')
+	popdef(`REALPTRTYPE')
 ')
 dnl }}}
@@ -74,5 +76,5 @@
 	)
 ')
-define(`PROCESS_ARRAY', `dnl {{{ (1:count, 2:type, 3:elm, [4:force_type])
+define(`PROCESS_ARRAY', `dnl {{{ (1:count, 2:type, 3:elm, [4:real_type])
 	if (src->$3) {
 		int LOOPCOUNTER;
@@ -87,5 +89,5 @@
 					++LOOPCOUNTER) {
 				pushdef(`dst', `arr')
-				pushdef(`SRC', defn(`SRC') `[LOOPCOUNTER]')
+				pushdef(`SRC', `ifelse(`$4', `', `', `', `', `($2)')' defn(`SRC') `[LOOPCOUNTER]')
 				popdef(`add_assoc_bool_ex', `add_next_index_bool($1, $3)')
 				popdef(`add_assoc_string_ex', `add_next_index_string($1, $3)')
@@ -125,5 +127,5 @@
 				DISABLECHECK(`
 					pushdef(`DST', defn(`DST') `[LOOPCOUNTER]')
-					pushdef(`SRC', ((const char **) defn(`SRC'))`[LOOPCOUNTER]')
+					pushdef(`SRC', `ifelse(`$4', `', `', `', `', `($2)')' defn(`SRC') `[LOOPCOUNTER]')
 					PROCESS(`$2', `$3')
 					popdef(`SRC')
Index: /trunk/processor/string.m4
===================================================================
--- /trunk/processor/string.m4	(revision 859)
+++ /trunk/processor/string.m4	(revision 860)
@@ -60,9 +60,9 @@
 		')
 		IFCALC(`xc_calc_string_n(processor, ISTYPE, SRCSTR, $3 C_RELAYLINE);')
-		IFSTORE(`DSTPTR = ifelse(PTRTYPE,`char',`ZSTR_S',`ZSTR_U')(xc_store_string_n(processor, ISTYPE, SRCSTR, $3 C_RELAYLINE));')
+		IFSTORE(`DSTPTR = ifdef(`REALPTRTYPE', `(REALPTRTYPE() *)') ifelse(PTRTYPE,`char',`ZSTR_S',`ZSTR_U')(xc_store_string_n(processor, ISTYPE, SRCSTR, $3 C_RELAYLINE));')
 		IFRESTORE(`
-			DSTPTR = STRDUP() (SRCPTR, ($3) - 1);
+			DSTPTR = ifdef(`REALPTRTYPE', `(REALPTRTYPE() *)') STRDUP() (SRCPTR, ($3) - 1);
 		')
-		FIXPOINTER_EX(`PTRTYPE', DSTPTR)
+		FIXPOINTER_EX(ifdef(`REALPTRTYPE', `REALPTRTYPE()', `PTRTYPE'), DSTPTR)
 		IFDASM(`
 			ifelse(STRTYPE,zstr_uchar, `
@@ -70,7 +70,7 @@
 				', ` dnl else
 				ifelse(STRTYPE,zstr_char, `
-					add_assoc_stringl_ex(dst, ZEND_STRS("$4"), ZSTR_S($2), $3-1, 1);
+					add_assoc_stringl_ex(dst, ZEND_STRS("$4"), (char *) ZSTR_S($2), $3-1, 1);
 					', `
-					add_assoc_stringl_ex(dst, ZEND_STRS("$4"), $2, $3-1, 1);
+					add_assoc_stringl_ex(dst, ZEND_STRS("$4"), (char *) $2, $3-1, 1);
 				')
 			')
Index: /trunk/utils.c
===================================================================
--- /trunk/utils.c	(revision 859)
+++ /trunk/utils.c	(revision 860)
@@ -482,5 +482,5 @@
 
 #ifdef HAVE_XCACHE_CONSTANT
-void xc_install_constant(ZEND_24(const) char *filename, zend_constant *constant, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC) /* {{{ */
+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) /* {{{ */
 {
 	if (zend_u_hash_add(EG(zend_constants), type, key, len,
@@ -502,5 +502,5 @@
 /* }}} */
 #endif
-void xc_install_function(ZEND_24(const) char *filename, zend_function *func, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC) /* {{{ */
+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) /* {{{ */
 {
 	zend_bool istmpkey;
@@ -532,5 +532,5 @@
 }
 /* }}} */
-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) /* {{{ */
+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) /* {{{ */
 {
 	zend_bool istmpkey;
@@ -630,5 +630,5 @@
 #endif
 #ifdef ZEND_ENGINE_2_1
-static zend_bool xc_auto_global_callback(ZEND_24(const) char *name, uint name_len TSRMLS_DC) /* {{{ */
+static zend_bool xc_auto_global_callback(ZEND_24(NOTHING, const) char *name, uint name_len TSRMLS_DC) /* {{{ */
 {
 	return 0;
@@ -710,5 +710,5 @@
 /* }}} */
 #endif
-xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, ZEND_24(const) char *filename TSRMLS_DC) /* {{{ */
+xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, ZEND_24(NOTHING, const) char *filename TSRMLS_DC) /* {{{ */
 {
 	HashTable *h;
@@ -905,5 +905,5 @@
 	if (install != XC_NoInstall) {
 		CG(in_compilation)    = 1;
-		CG(compiled_filename) = ZEND_24((char *)) sandbox->filename;
+		CG(compiled_filename) = ZEND_24(NOTHING, (char *)) sandbox->filename;
 		CG(zend_lineno)       = 0;
 		xc_sandbox_install(sandbox, install TSRMLS_CC);
Index: /trunk/utils.h
===================================================================
--- /trunk/utils.h	(revision 859)
+++ /trunk/utils.h	(revision 860)
@@ -69,8 +69,8 @@
 /* installer */
 #ifdef HAVE_XCACHE_CONSTANT
-void xc_install_constant(ZEND_24(const) char *filename, zend_constant *constant, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC);
+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);
 #endif
-void xc_install_function(ZEND_24(const) char *filename, zend_function *func, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC);
-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);
+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);
+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);
 
 #if defined(E_STRICT) || defined(E_DEPRECATED)
@@ -81,5 +81,5 @@
 typedef struct {
 	int alloc;
-	ZEND_24(const) char *filename;
+	ZEND_24(NOTHING, const) char *filename;
 
 	HashTable orig_included_files;
@@ -122,5 +122,5 @@
 
 void xc_zend_class_add_ref(zend_class_entry ZESW(*ce, **ce));
-xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, ZEND_24(const) char *filename TSRMLS_DC);
+xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, ZEND_24(NOTHING, const) char *filename TSRMLS_DC);
 void xc_sandbox_free(xc_sandbox_t *sandbox, xc_install_action_t install TSRMLS_DC);
 
Index: /trunk/xcache.c
===================================================================
--- /trunk/xcache.c	(revision 859)
+++ /trunk/xcache.c	(revision 860)
@@ -1134,7 +1134,7 @@
 }
 /* }}} */
-static void xc_entry_init_key_php_entry(xc_entry_php_t *entry_php, ZEND_24(const) char *filepath TSRMLS_DC) /* {{{*/
-{
-	entry_php->filepath     = filepath;
+static void xc_entry_init_key_php_entry(xc_entry_php_t *entry_php, const char *filepath TSRMLS_DC) /* {{{*/
+{
+	entry_php->filepath     = ZEND_24((char *), NOTHING) filepath;
 	entry_php->filepath_len = strlen(entry_php->filepath);
 	entry_php->dirpath      = estrndup(entry_php->filepath, entry_php->filepath_len);
@@ -1696,5 +1696,5 @@
 
 	xc_undo_pass_two(compiler->new_php.op_array TSRMLS_CC);
-	xc_foreach_early_binding_class(compiler->new_php.op_array, xc_cache_early_binding_class_cb, (void *) compiler->new_php.SRMLS_CC);
+	xc_foreach_early_binding_class(compiler->new_php.op_array, xc_cache_early_binding_class_cb, (void *) &compiler->new_php TSRMLS_CC);
 	xc_redo_pass_two(compiler->new_php.op_array TSRMLS_CC);
 	/* }}} */
@@ -3145,12 +3145,11 @@
 PHP_FUNCTION(xcache_is_autoglobal)
 {
-	char *name;
-	int name_len;
-
-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+	zval *name;
+
+	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name) == FAILURE) {
 		return;
 	}
 
-	RETURN_BOOL(zend_hash_exists(CG(auto_globals), name, name_len + 1));
+	RETURN_BOOL(zend_u_hash_exists(CG(auto_globals), UG(unicode), Z_STRVAL_P(name), Z_STRLEN_P(name) + 1));
 }
 /* }}} */
Index: /trunk/xcache.h
===================================================================
--- /trunk/xcache.h	(revision 859)
+++ /trunk/xcache.h	(revision 860)
@@ -43,7 +43,7 @@
 #endif
 #ifdef ZEND_ENGINE_2_4
-#	define ZEND_24(x) x
-#else
-#	define ZEND_24(x)
+#	define ZEND_24(pre24, v24) v24
+#else
+#	define ZEND_24(pre24, v24) pre24
 #endif
 
@@ -191,20 +191,23 @@
 #ifndef IS_UNICODE
 #	define zend_u_hash_add(ht, type, arKey, nKeyLength, pData, nDataSize, pDest) \
- 	   zend_hash_add(ht, arKey, nKeyLength, pData, nDataSize, pDest)
+ 	   zend_hash_add(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength, pData, nDataSize, pDest)
 
 #	define zend_u_hash_quick_add(ht, type, arKey, nKeyLength, h, pData, nDataSize, pDest) \
- 	   zend_hash_quick_add(ht, arKey, nKeyLength, h, pData, nDataSize, pDest)
+ 	   zend_hash_quick_add(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength, h, pData, nDataSize, pDest)
 
 #	define zend_u_hash_update(ht, type, arKey, nKeyLength, pData, nDataSize, pDest) \
- 	   zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest)
+ 	   zend_hash_update(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength, pData, nDataSize, pDest)
 
 #	define zend_u_hash_quick_update(ht, type, arKey, nKeyLength, h, pData, nDataSize, pDest) \
- 	   zend_hash_quick_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest)
+ 	   zend_hash_quick_update(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength, h, pData, nDataSize, pDest)
 
 #	define zend_u_hash_find(ht, type, arKey, nKeyLength, pData) \
- 	   zend_hash_find(ht, arKey, nKeyLength, pData)
+ 	   zend_hash_find(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength, pData)
 
 #	define zend_u_hash_quick_find(ht, type, arKey, nKeyLength, h, pData) \
- 	   zend_hash_quick_find(ht, arKey, nKeyLength, h, pData)
+ 	   zend_hash_quick_find(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength, h, pData)
+
+#	define zend_u_hash_exists(ht, type, arKey, nKeyLength) \
+ 	   zend_hash_exists(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength)
 
 #	define add_u_assoc_zval_ex(arg, type, key, key_len, value) \
@@ -438,5 +441,5 @@
 
 	int    filepath_len;
-	ZEND_24(const) char *filepath;
+	ZEND_24(NOTHING, const) char *filepath;
 	int    dirpath_len;
 	char  *dirpath;
