[PHP-CVS] com php-src: brought the ext/sybase_ct/config.w32 up to date: ext/sybase_ct/config.w32

2013-12-26 Thread Anatol Belski
Commit:5b0620831c41687950f1f34a225bea060122b503
Author:Anatol Belski a...@php.net Wed, 25 Dec 2013 23:29:42 +0100
Parents:   a2503c6af38d5a2de172a9a746719c4b12b53034
Branches:  PHP-5.5 PHP-5.6 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=5b0620831c41687950f1f34a225bea060122b503

Log:
brought the ext/sybase_ct/config.w32 up to date

Changed paths:
  M  ext/sybase_ct/config.w32


Diff:
diff --git a/ext/sybase_ct/config.w32 b/ext/sybase_ct/config.w32
index bf56bd1..c773b62 100644
--- a/ext/sybase_ct/config.w32
+++ b/ext/sybase_ct/config.w32
@@ -7,8 +7,11 @@ ARG_WITH(sybase-ct, SYBASE_CT support, no);
 if (PHP_SYBASE_CT != no) {
 
if (CHECK_HEADER_ADD_INCLUDE(ctpublic.h, CFLAGS_SYBASE_CT, 
PHP_PHP_BUILD + \\sybase\\include; + PHP_SYBASE_CT) 
-   CHECK_LIB(libcs.lib, sybase_ct, PHP_PHP_BUILD + 
\\sybase\\lib; + PHP_SYBASE_CT) 
-   CHECK_LIB(libct.lib, sybase_ct, PHP_PHP_BUILD + 
\\sybase\\lib; + PHP_SYBASE_CT)) {
+   (!X64  CHECK_LIB(libsybcs.lib, sybase_ct, 
PHP_PHP_BUILD + \\sybase\\lib; + PHP_SYBASE_CT) 
+   CHECK_LIB(libsybct.lib, sybase_ct, PHP_PHP_BUILD + 
\\sybase\\lib; + PHP_SYBASE_CT) ||
+   X64  CHECK_LIB(libsybcs64.lib, sybase_ct, 
PHP_PHP_BUILD + \\sybase\\lib; + PHP_SYBASE_CT) 
+   CHECK_LIB(libsybct64.lib, sybase_ct, PHP_PHP_BUILD 
+ \\sybase\\lib; + PHP_SYBASE_CT))
+   ) {
EXTENSION('sybase_ct', 'php_sybase_ct.c');
AC_DEFINE('HAVE_SYBASE_CT', 1);
} else {


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend.c

2013-12-23 Thread Anatol Belski
Commit:3f7a145b5abd66d1c77e65060d15702db4d36529
Author:Anatol Belski a...@php.net Mon, 23 Dec 2013 12:00:49 +0100
Parents:   f7b6db7555db9379547a1c9ead4051de1ffc8566 
f156e684ac290f4ec69564f653d3167cdb5c62be
Branches:  PHP-5.5 PHP-5.6 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=3f7a145b5abd66d1c77e65060d15702db4d36529

Log:
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  removed outdated IsDebuggerPresent declaration

Changed paths:
  MM  Zend/zend.c


Diff:



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



[PHP-CVS] com php-src: opcodes: Zend/zend_vm_opcodes.h

2013-12-23 Thread Anatol Belski
Commit:a2e77fb258763113e29948f82db49a64139022d4
Author:krakjoe joe.watk...@live.co.uk Sun, 22 Dec 2013 13:20:17 
+
Committer: Anatol Belski a...@php.net  Mon, 23 Dec 2013 12:29:01 +0100
Parents:   07e97f919d3d4d407debd70aa3c7ceb9e5d543db
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=a2e77fb258763113e29948f82db49a64139022d4

Log:
opcodes

Changed paths:
  M  Zend/zend_vm_opcodes.h


Diff:
diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h
index ed02663..d334e45 100644
--- a/Zend/zend_vm_opcodes.h
+++ b/Zend/zend_vm_opcodes.h
@@ -171,4 +171,4 @@ ZEND_API const char *zend_get_opcode_name(zend_uchar 
opcode);
 #define ZEND_FAST_RET163
 #define ZEND_RECV_VARIADIC   164
 
-#endif
+#endif
\ No newline at end of file


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.5' into PHP-5.6: Zend/zend.c

2013-12-23 Thread Anatol Belski
Commit:19039984e291bdfd4c9e44d0543ac190027ba042
Author:Anatol Belski a...@php.net Mon, 23 Dec 2013 12:01:10 +0100
Parents:   8650d2dda65cf7ac70bf83323ca8036d01dbe349 
3f7a145b5abd66d1c77e65060d15702db4d36529
Branches:  PHP-5.6 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=19039984e291bdfd4c9e44d0543ac190027ba042

Log:
Merge branch 'PHP-5.5' into PHP-5.6

* PHP-5.5:
  removed outdated IsDebuggerPresent declaration

Changed paths:
  MM  Zend/zend.c


Diff:



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



[PHP-CVS] com php-src: Merge branch 'master' into str_size_and_int64: Zend/zend_language_scanner.c

2013-12-23 Thread Anatol Belski
Commit:e540839c8b283a7b445ab6552f37f3b1ca0f2eaa
Author:Anatol Belski a...@php.net Mon, 23 Dec 2013 23:39:42 +0100
Parents:   63ea29a2067ce06e20dda861480d91624389f0f3 
392f6830a15aa670d7ad4de173175ed4e482ffdb
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=e540839c8b283a7b445ab6552f37f3b1ca0f2eaa

Log:
Merge branch 'master' into str_size_and_int64

Conflicts:
Zend/zend_vm_execute.h
ext/opcache/Optimizer/pass1_5.c
ext/opcache/ZendAccelerator.h

Changed paths:
  MM  Zend/zend_language_scanner.c


Diff:



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



[PHP-CVS] com php-src: removed outdated IsDebuggerPresent declaration: Zend/zend.c

2013-12-23 Thread Anatol Belski
Commit:ea7a70708f68b7952767260796da411b9fb400d6
Author:Anatol Belski a...@php.net Mon, 23 Dec 2013 11:53:47 +0100
Parents:   1c462a4e4d4ce375492995b014dcafe44825f6d3
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=ea7a70708f68b7952767260796da411b9fb400d6

Log:
removed outdated IsDebuggerPresent declaration

This piece of code seems to retain compatibility with some windows
versions before 2000. Today it's not relevant anymore and only
produces a warning C4273 because of the conflicting prototype. In
VC9 the declaration is present in winbase.h:4142, but available
is it already in winxp. Here's the doc link
http://msdn.microsoft.com/en-us/library/windows/desktop/ms680345(v=vs.85).aspx

Changed paths:
  M  Zend/zend.c


Diff:
diff --git a/Zend/zend.c b/Zend/zend.c
index 0c10b41..b6917e4 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -44,10 +44,6 @@
 # define GLOBAL_CONSTANTS_TABLEEG(zend_constants)
 #endif
 
-#if defined(ZEND_WIN32)  ZEND_DEBUG
-BOOL WINAPI IsDebuggerPresent(VOID);
-#endif
-
 /* true multithread-shared globals */
 ZEND_API zend_class_entry *zend_standard_class_def = NULL;
 ZEND_API zend_size_t (*zend_printf)(const char *format, ...);


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



[PHP-CVS] com php-src: removed the all style function arg formats 'l', 's', 'p': Zend/zend_API.c Zend/zend_operators.h

2013-12-23 Thread Anatol Belski
Commit:a06a89dba67bbe132128d7d569a2139d3f40f513
Author:Anatol Belski a...@php.net Mon, 23 Dec 2013 14:24:34 -0800
Parents:   389b4d411eaa331fa6480886153016fb29b8b7f5
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=a06a89dba67bbe132128d7d569a2139d3f40f513

Log:
removed the all style function arg formats 'l', 's', 'p'

Changed paths:
  M  Zend/zend_API.c
  M  Zend/zend_operators.h


Diff:
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index a37c23f..fd4bb6e 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -320,17 +320,9 @@ static const char *zend_parse_arg_impl(int arg_num, zval 
**arg, va_list *va, con
spec_walk++;
}
 
-#ifdef ZEND_ENABLE_INT64
 # define ZEND_CHECK_INT_RANGE c == 'I'
-#else
-# define ZEND_CHECK_INT_RANGE c == 'I' || c == 'L'
-#endif
 
switch (c) {
-#ifdef ZEND_ENABLE_INT64
-   case 'l':
-   case 'L':
-#endif
case 'i':
case 'I':
{
@@ -348,7 +340,7 @@ static const char *zend_parse_arg_impl(int arg_num, zval 
**arg, va_list *va, con
int type;
 
if ((type = 
is_numeric_string(Z_STRVAL_PP(arg), Z_STRSIZE_PP(arg), p, d, -1)) == 0) {
-   return long;
+   return 
integer;
} else if (type == 
IS_DOUBLE) {
if 
(ZEND_CHECK_INT_RANGE) {
if (d  
ZEND_INT_MAX) {
@@ -386,7 +378,7 @@ static const char *zend_parse_arg_impl(int arg_num, zval 
**arg, va_list *va, con
case IS_OBJECT:
case IS_RESOURCE:
default:
-   return long;
+   return integer;
}
}
break;
@@ -430,23 +422,15 @@ static const char *zend_parse_arg_impl(int arg_num, zval 
**arg, va_list *va, con
}
}
break;
-#ifdef ZEND_USE_LEGACY_STRING_TYPES
-   case 'p': /* Deprecated, Legacy int size */
-   case 's': /* Deprecated, Legacy int size */
-#endif
case 'P': /* New zend_size_t size */
case 'S': /* New zend_size_t size */
{
char **p = va_arg(*va, char **);
zend_size_t pl;
zend_size_t *plsize;
-   int *plint;
 
-   if (c == 'p' || c == 's') {
-   plint = va_arg(*va, int *);
-   } else {
-   plsize = va_arg(*va, zend_size_t *);
-   }
+   plsize = va_arg(*va, zend_size_t *);
+
switch (Z_TYPE_PP(arg)) {
case IS_NULL:
if (check_null) {
@@ -469,14 +453,14 @@ static const char *zend_parse_arg_impl(int arg_num, zval 
**arg, va_list *va, con
}
*p = Z_STRVAL_PP(arg);
pl = Z_STRSIZE_PP(arg);
-   if ((c == 'p' || c == 'P')  
CHECK_ZVAL_NULL_PATH(*arg)) {
+   if ((c == 'P')  
CHECK_ZVAL_NULL_PATH(*arg)) {
return a valid path;
}
break;
 
case IS_OBJECT:
if 
(parse_arg_object_to_string(arg, p, pl, IS_STRING TSRMLS_CC) == SUCCESS) {
-   if ((c == 'p' || c == 
'P')  CHECK_ZVAL_NULL_PATH(*arg)) {
+   if ((c == 'P')  
CHECK_ZVAL_NULL_PATH(*arg)) {
return a valid 
path;
}
break;
@@ -485,13 +469,10 @@ static const char *zend_parse_arg_impl(int arg_num, zval 
**arg, va_list *va, con
case IS_ARRAY:
case

[PHP-CVS] com php-src: stop warnings from unused opcode map: Zend/zend_vm_gen.php Zend/zend_vm_opcodes.c Zend/zend_vm_opcodes.h

2013-12-23 Thread Anatol Belski
Commit:f9affb5ae9ea32a572e6be1d073486ddb2d4df18
Author:krakjoe joe.watk...@live.co.uk Sun, 22 Dec 2013 13:00:51 
+
Committer: Anatol Belski a...@php.net  Mon, 23 Dec 2013 12:24:11 +0100
Parents:   aaca4ede153f9cf26277164d14f3499f76d0e69d
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=f9affb5ae9ea32a572e6be1d073486ddb2d4df18

Log:
stop warnings from unused opcode map

Changed paths:
  M  Zend/zend_vm_gen.php
  M  Zend/zend_vm_opcodes.c
  M  Zend/zend_vm_opcodes.h


Diff:
diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php
index 9996541..2088bf8 100644
--- a/Zend/zend_vm_gen.php
+++ b/Zend/zend_vm_gen.php
@@ -1208,8 +1208,8 @@ function gen_vm($def, $skel) {
out($f, $GLOBALS['header_text']);
 
fputs($f, #ifndef ZEND_VM_OPCODES_H\n#define ZEND_VM_OPCODES_H\n\n);
-   fputs($f, extern ZEND_API const char 
*zend_vm_opcodes_map[.($max_opcode + 1).];\n\n);
-
+   fputs($f, ZEND_API const char *zend_get_opcode_name(zend_uchar 
opcode);\n\n);
+   
foreach ($opcodes as $code = $dsc) {
$code = str_pad((string)$code,$code_len, ,STR_PAD_LEFT);
$op = str_pad($dsc[op],$max_opcode_len);
@@ -1225,14 +1225,19 @@ function gen_vm($def, $skel) {
 
// Insert header
out($f, $GLOBALS['header_text']);
-   fputs($f,#include stdio.h\n\n);
-
+   fputs($f,#include stdio.h\n);
+   fputs($f,#include zend.h\n\n);
+   
fputs($f,const char *zend_vm_opcodes_map[.($max_opcode + 1).] = 
{\n);
for ($i = 0; $i = $max_opcode; $i++) {

fputs($f,\t.(isset($opcodes[$i][op])?''.$opcodes[$i][op].'':NULL).,\n);
}
-   fputs($f, };\n);
-
+   fputs($f, };\n\n);
+   
+fputs($f, ZEND_API const char* zend_get_opcode_name(zend_uchar opcode) 
{\n);
+fputs($f, \treturn zend_vm_opcodes_map[opcode];\n);
+fputs($f, }\n);
+
fclose($f);
echo zend_vm_opcodes.c generated successfully.\n;
 
diff --git a/Zend/zend_vm_opcodes.c b/Zend/zend_vm_opcodes.c
index 04af26c..177c3fd 100644
--- a/Zend/zend_vm_opcodes.c
+++ b/Zend/zend_vm_opcodes.c
@@ -19,6 +19,7 @@
 */
 
 #include stdio.h
+#include zend.h
 
 const char *zend_vm_opcodes_map[165] = {
ZEND_NOP,
@@ -187,3 +188,7 @@ const char *zend_vm_opcodes_map[165] = {
ZEND_FAST_RET,
ZEND_RECV_VARIADIC,
 };
+
+ZEND_API const char* zend_get_opcode_name(zend_uchar opcode) {
+   return zend_vm_opcodes_map[opcode];
+}
diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h
index ad0d881..ed02663 100644
--- a/Zend/zend_vm_opcodes.h
+++ b/Zend/zend_vm_opcodes.h
@@ -21,7 +21,7 @@
 #ifndef ZEND_VM_OPCODES_H
 #define ZEND_VM_OPCODES_H
 
-extern ZEND_API const char *zend_vm_opcodes_map[165];
+ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);
 
 #define ZEND_NOP   0
 #define ZEND_ADD   1
@@ -171,4 +171,4 @@ extern ZEND_API const char *zend_vm_opcodes_map[165];
 #define ZEND_FAST_RET163
 #define ZEND_RECV_VARIADIC   164
 
-#endif
\ No newline at end of file
+#endif


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.6': Zend/zend.c

2013-12-23 Thread Anatol Belski
Commit:f4a96983e1ecf775c5310f223447a2fadf8683ce
Author:Anatol Belski a...@php.net Mon, 23 Dec 2013 12:01:26 +0100
Parents:   62fa84a0311c429e8a6742607e5da549b8f5c7a8 
19039984e291bdfd4c9e44d0543ac190027ba042
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=f4a96983e1ecf775c5310f223447a2fadf8683ce

Log:
Merge branch 'PHP-5.6'

* PHP-5.6:
  removed outdated IsDebuggerPresent declaration

Changed paths:
  MM  Zend/zend.c


Diff:



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



[PHP-CVS] com php-src: Fixed bug #66334 (Memory Leak in new pass1_5.c optimizations). (Terry): ext/opcache/Optimizer/pass1_5.c ext/opcache/tests/bug66334.phpt

2013-12-23 Thread Anatol Belski
Commit:c699696c438eeb3214d3a645110d03f98f8e979e
Author:Dmitry Stogov dmi...@zend.com Mon, 23 Dec 2013 16:04:10 
+0400
Committer: Anatol Belski a...@php.net  Mon, 23 Dec 2013 20:30:27 +0100
Parents:   8d64f0ee711b00c0fdda37e8e55615b0d2510269
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=c699696c438eeb3214d3a645110d03f98f8e979e

Log:
Fixed bug #66334 (Memory Leak in new pass1_5.c optimizations). (Terry)

Bugs:
https://bugs.php.net/66334

Changed paths:
  M  ext/opcache/Optimizer/pass1_5.c
  A  ext/opcache/tests/bug66334.phpt


Diff:
diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c
index 9de8590..68db08a 100644
--- a/ext/opcache/Optimizer/pass1_5.c
+++ b/ext/opcache/Optimizer/pass1_5.c
@@ -383,9 +383,11 @@ if (ZEND_OPTIMIZER_PASS_1  OPTIMIZATION_LEVEL) {
zend_module_entry *m;
char *lc_name = zend_str_tolower_dup(

Z_STRVAL(ZEND_OP1_LITERAL(opline - 1)), Z_STRSIZE(ZEND_OP1_LITERAL(opline - 
1)));
+   int found = 
zend_hash_find(module_registry,
+   lc_name, 
Z_STRSIZE(ZEND_OP1_LITERAL(opline - 1)) + 1, (void *)m) == SUCCESS;
 
-   if (zend_hash_find(module_registry,
-   lc_name, 
Z_STRSIZE(ZEND_OP1_LITERAL(opline - 1)) + 1, (void *)m) == FAILURE) {
+   efree(lc_name);
+   if (!found) {
if (!PG(enable_dl)) {
break;
} else {
@@ -405,7 +407,6 @@ if (ZEND_OPTIMIZER_PASS_1  OPTIMIZATION_LEVEL) {

literal_dtor(ZEND_OP1_LITERAL(opline));
MAKE_NOP(opline);
}
-   efree(lc_name);
} else if (Z_STRSIZE(ZEND_OP1_LITERAL(opline)) 
== sizeof(defined)-1 

!memcmp(Z_STRVAL(ZEND_OP1_LITERAL(opline)),
defined, 
sizeof(defined)-1)) {
diff --git a/ext/opcache/tests/bug66334.phpt b/ext/opcache/tests/bug66334.phpt
new file mode 100644
index 000..b2c6d7b
--- /dev/null
+++ b/ext/opcache/tests/bug66334.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #66334 (Memory Leak in new pass1_5.c optimizations)
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.file_update_protection=0
+enable_dl=0
+--SKIPIF--
+?php require_once('skipif.inc'); ?
+--FILE--
+?php
+if (extension_loaded(unknown_extension)) {
+   var_dump(1);
+} else {
+   var_dump(2);
+}
+--EXPECT--
+int(2)


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



[PHP-CVS] com php-src: Bump ZEND_MODULE_API_NO due to the TSRMLS change to zend_is_true(): Zend/zend_modules.h

2013-12-23 Thread Anatol Belski
Commit:78f2ded86a8a33b3320444d2a8c67b431da5a662
Author:Sara Golemon poll...@php.net Sun, 22 Dec 2013 14:10:59 
-0800
Committer: Anatol Belski a...@php.net  Mon, 23 Dec 2013 12:30:16 +0100
Parents:   a2e77fb258763113e29948f82db49a64139022d4
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=78f2ded86a8a33b3320444d2a8c67b431da5a662

Log:
Bump ZEND_MODULE_API_NO due to the TSRMLS change to zend_is_true()

Changed paths:
  M  Zend/zend_modules.h


Diff:
diff --git a/Zend/zend_modules.h b/Zend/zend_modules.h
index 00209a0..946406f 100644
--- a/Zend/zend_modules.h
+++ b/Zend/zend_modules.h
@@ -33,7 +33,7 @@
 #define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module TSRMLS_DC
 #define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module TSRMLS_CC
 
-#define ZEND_MODULE_API_NO 20131106
+#define ZEND_MODULE_API_NO 20131218
 #ifdef ZTS
 #define USING_ZTS 1
 #else


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



[PHP-CVS] com php-src: Merge remote-tracking branch 'origin/master' into str_size_and_int64: Zend/zend.c Zend/zend.h Zend/zend_execute.h Zend/zend_execute_API.c Zend/zend_interfaces.c Zend/zend_object

2013-12-18 Thread Anatol Belski
Commit:8432557dcda79c298c1fcfd47440940e398afaa4
Author:Anatol Belski a...@php.net Wed, 18 Dec 2013 15:07:42 +0100
Parents:   fcb28ea97f97cd85be1242fbb16ba5bca29f1cc7 
a8a36b7d52bc8b00dd8a6cbe32b1875b4c41cbcf
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=8432557dcda79c298c1fcfd47440940e398afaa4

Log:
Merge remote-tracking branch 'origin/master' into str_size_and_int64

Conflicts:
Zend/zend.c
Zend/zend.h
Zend/zend_execute.h
Zend/zend_vm_execute.h
main/SAPI.h

Changed paths:
  MM  Zend/zend.c
  MM  Zend/zend.h
  MM  Zend/zend_execute.h
  MM  Zend/zend_execute_API.c
  MM  Zend/zend_interfaces.c
  MM  Zend/zend_object_handlers.c
  MM  Zend/zend_vm_def.h
  MM  Zend/zend_vm_execute.h
  MM  ext/dom/php_dom.c
  MM  ext/mysqlnd/mysqlnd_net.c
  MM  ext/opcache/Optimizer/block_pass.c
  MM  ext/pcntl/pcntl.c
  MM  ext/soap/php_encoding.c
  MM  ext/spl/spl_array.c
  MM  ext/spl/spl_directory.c
  MM  ext/spl/spl_fixedarray.c
  MM  ext/spl/spl_iterators.c
  MM  ext/standard/array.c
  MM  ext/standard/basic_functions.c
  MM  ext/standard/ftp_fopen_wrapper.c
  MM  ext/standard/http_fopen_wrapper.c
  MM  ext/standard/type.c
  MM  ext/zip/php_zip.c
  MM  main/SAPI.c
  MM  main/SAPI.h
  MM  main/php_ini.c
  MM  main/streams/streams.c
  MM  main/streams/transports.c
  MM  main/streams/userspace.c
  MM  sapi/apache2handler/sapi_apache2.c
  MM  sapi/cgi/cgi_main.c
  MM  sapi/cli/php_cli.c
  MM  sapi/cli/php_cli_server.c
  MM  sapi/embed/php_embed.c

diff --cc Zend/zend.c
index 13dec8a,ad45028..c20e1ba
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@@ -56,11 -56,11 +56,11 @@@ ZEND_API FILE *(*zend_fopen)(const cha
  ZEND_API int (*zend_stream_open_function)(const char *filename, 
zend_file_handle *handle TSRMLS_DC);
  ZEND_API void (*zend_block_interruptions)(void);
  ZEND_API void (*zend_unblock_interruptions)(void);
- ZEND_API void (*zend_ticks_function)(int ticks);
+ ZEND_API void (*zend_ticks_function)(int ticks TSRMLS_DC);
 -ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const 
uint error_lineno, const char *format, va_list args);
 -int (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, 
va_list ap);
 +ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const 
zend_str_size_uint error_lineno, const char *format, va_list args);
- zend_str_size_int (*zend_vspprintf)(char **pbuf, zend_str_size_size_t 
max_len, const char *format, va_list ap);
++int (*zend_vspprintf)(char **pbuf, zend_str_size_size_t max_len, const char 
*format, va_list ap);
  ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC);
 -ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len 
TSRMLS_DC);
 +ZEND_API char *(*zend_resolve_path)(const char *filename, zend_str_size_int 
filename_len TSRMLS_DC);
  
  void (*zend_on_timeout)(int seconds TSRMLS_DC);
  
diff --cc Zend/zend.h
index f002aeb,f60ef68..3773946
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@@ -542,20 -542,20 +542,20 @@@ struct _zend_class_entry 
  
  #include zend_stream.h
  typedef struct _zend_utility_functions {
 -  void (*error_function)(int type, const char *error_filename, const uint 
error_lineno, const char *format, va_list args) 
ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
 -  int (*printf_function)(const char *format, ...) 
ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
 -  int (*write_function)(const char *str, uint str_length);
 +  void (*error_function)(int type, const char *error_filename, const 
zend_str_size_uint error_lineno, const char *format, va_list args) 
ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
 +  zend_str_size_int (*printf_function)(const char *format, ...) 
ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
 +  zend_str_size_int (*write_function)(const char *str, zend_str_size_uint 
str_length);
FILE *(*fopen_function)(const char *filename, char **opened_path 
TSRMLS_DC);
 -  void (*message_handler)(long message, const void *data TSRMLS_DC);
 +  void (*message_handler)(zend_int_t message, const void *data TSRMLS_DC);
void (*block_interruptions)(void);
void (*unblock_interruptions)(void);
 -  int (*get_configuration_directive)(const char *name, uint name_length, 
zval *contents);
 +  int (*get_configuration_directive)(const char *name, zend_str_size_uint 
name_length, zval *contents);
-   void (*ticks_function)(int ticks);
+   void (*ticks_function)(int ticks TSRMLS_DC);
void (*on_timeout)(int seconds TSRMLS_DC);
int (*stream_open_function)(const char *filename, zend_file_handle 
*handle TSRMLS_DC);
 -  int (*vspprintf_function)(char **pbuf, size_t max_len, const char 
*format, va_list ap);
 -  char *(*getenv_function)(char *name, size_t name_len TSRMLS_DC);
 -  char *(*resolve_path_function)(const char *filename, int filename_len 
TSRMLS_DC);
 +  zend_str_size_int (*vspprintf_function)(char **pbuf

[PHP-CVS] com php-src: size_t part for *.y files: Zend/zend_ini_parser.y Zend/zend_language_parser.y

2013-12-18 Thread Anatol Belski
Commit:0b8f946ea5648da8ac0830fb64d14cf43827eee1
Author:Anatol Belski a...@php.net Wed, 18 Dec 2013 14:53:48 -0800
Parents:   d5daea505f852e211ed097f1acbaf13fdf4d59b8
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=0b8f946ea5648da8ac0830fb64d14cf43827eee1

Log:
size_t part for *.y files

Changed paths:
  M  Zend/zend_ini_parser.y
  M  Zend/zend_language_parser.y


Diff:
diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y
index 1fa70c6..f2bb419 100644
--- a/Zend/zend_ini_parser.y
+++ b/Zend/zend_ini_parser.y
@@ -104,7 +104,7 @@ static void zend_ini_init_string(zval *result)
 */
 static void zend_ini_add_string(zval *result, zval *op1, zval *op2)
 {
-   zend_str_size length = Z_STRSIZE_P(op1) + Z_STRSIZE_P(op2);
+   zend_size_t length = Z_STRSIZE_P(op1) + Z_STRSIZE_P(op2);
 
Z_STRVAL_P(result) = (char *) realloc(Z_STRVAL_P(op1), length+1);
memcpy(Z_STRVAL_P(result)+Z_STRSIZE_P(op1), Z_STRVAL_P(op2), 
Z_STRSIZE_P(op2));
@@ -163,7 +163,7 @@ static void zend_ini_get_var(zval *result, zval *name 
TSRMLS_DC)
 static void ini_error(char *msg)
 {
char *error_buf;
-   zend_str_size error_buf_len;
+   zend_size_t error_buf_len;
char *currently_parsed_filename;
TSRMLS_FETCH();
 
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index 6028f8d..bf80230 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -1300,7 +1300,7 @@ static YYSIZE_T zend_yytnamerr(char *yyres, const char 
*yystr)
if (CG(parse_error) == 0) {
char buffer[120];
const unsigned char *end, *str, *tok1 = NULL, *tok2 = 
NULL;
-   zend_str_size len = 0, toklen = 0, yystr_len;
+   zend_size_t len = 0, toklen = 0, yystr_len;

CG(parse_error) = 1;


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



[PHP-CVS] com php-src: fix after merge: Zend/zend.c

2013-12-18 Thread Anatol Belski
Commit:74aea4e471aadeb854bf2a5dbc917f7ea783a281
Author:Anatol Belski a...@php.net Wed, 18 Dec 2013 15:18:02 +0100
Parents:   8432557dcda79c298c1fcfd47440940e398afaa4
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=74aea4e471aadeb854bf2a5dbc917f7ea783a281

Log:
fix after merge

Changed paths:
  M  Zend/zend.c


Diff:
diff --git a/Zend/zend.c b/Zend/zend.c
index c20e1ba..e16dbce 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -58,7 +58,7 @@ ZEND_API void (*zend_block_interruptions)(void);
 ZEND_API void (*zend_unblock_interruptions)(void);
 ZEND_API void (*zend_ticks_function)(int ticks TSRMLS_DC);
 ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const 
zend_str_size_uint error_lineno, const char *format, va_list args);
-int (*zend_vspprintf)(char **pbuf, zend_str_size_size_t max_len, const char 
*format, va_list ap);
+zend_str_size_int (*zend_vspprintf)(char **pbuf, zend_str_size_size_t max_len, 
const char *format, va_list ap);
 ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC);
 ZEND_API char *(*zend_resolve_path)(const char *filename, zend_str_size_int 
filename_len TSRMLS_DC);


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



[PHP-CVS] com php-src: size_t part for *.l files: Zend/zend_ini_scanner.l

2013-12-18 Thread Anatol Belski
Commit:8709cc6d600ffaef440b91b27ba1c6ebd4b23c7e
Author:Anatol Belski a...@php.net Wed, 18 Dec 2013 14:56:40 -0800
Parents:   0b8f946ea5648da8ac0830fb64d14cf43827eee1
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=8709cc6d600ffaef440b91b27ba1c6ebd4b23c7e

Log:
size_t part for *.l files

Changed paths:
  M  Zend/zend_ini_scanner.l


Diff:
diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l
index cb59b5b..ed7d76a 100644
--- a/Zend/zend_ini_scanner.l
+++ b/Zend/zend_ini_scanner.l
@@ -55,7 +55,7 @@
 #define yytext   ((char*)SCNG(yy_text))
 #define yyleng   SCNG(yy_leng)
 #define yyless(x)do {  YYCURSOR = (unsigned char*)yytext + x; \
-   yyleng   = 
(zend_str_size)x; } while(0)
+   yyleng   = 
(zend_size_t)x; } while(0)
 
 /* #define yymore() goto yymore_restart */
 
@@ -261,7 +261,7 @@ int zend_ini_prepare_string_for_scanning(char *str, int 
scanner_mode TSRMLS_DC)
 
 /* {{{ zend_ini_escape_string()
  */
-static void zend_ini_escape_string(zval *lval, char *str, zend_str_size_int 
len, char quote_type TSRMLS_DC)
+static void zend_ini_escape_string(zval *lval, char *str, zend_size_t len, 
char quote_type TSRMLS_DC)
 {
register char *s, *t;
char *end;


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



[PHP-CVS] com php-src: mass replacement for zend_size_t/php_size_t: Zend/zend.c Zend/zend.h Zend/zend_API.c Zend/zend_API.h Zend/zend_alloc.c Zend/zend_alloc.h Zend/zend_builtin_functions.c Zend/zend_

2013-12-18 Thread Anatol Belski
Commit:b1abe4ca21e10b04a8bae2d00e8113f4b2b02567
Author:Anatol Belski a...@php.net Wed, 18 Dec 2013 14:46:44 -0800
Parents:   6d938321ffc43a343b2afcee70d921cc931752d8
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=b1abe4ca21e10b04a8bae2d00e8113f4b2b02567

Log:
mass replacement for zend_size_t/php_size_t
  M  Zend/zend.c
  M  Zend/zend.h
  M  Zend/zend_API.c
  M  Zend/zend_API.h
  M  Zend/zend_alloc.c
  M  Zend/zend_alloc.h
  M  Zend/zend_builtin_functions.c
  M  Zend/zend_closures.c
  M  Zend/zend_compile.c
  M  Zend/zend_compile.h
  M  Zend/zend_constants.c
  M  Zend/zend_constants.h
  M  Zend/zend_exceptions.c
  M  Zend/zend_exceptions.h
  M  Zend/zend_execute.h
  M  Zend/zend_execute_API.c
  M  Zend/zend_hash.c
  M  Zend/zend_hash.h
  M  Zend/zend_highlight.c
  M  Zend/zend_highlight.h
  M  Zend/zend_ini.c
  M  Zend/zend_ini.h
  M  Zend/zend_ini_scanner.c
  M  Zend/zend_interfaces.c
  M  Zend/zend_interfaces.h
  M  Zend/zend_object_handlers.c
  M  Zend/zend_object_handlers.h
  M  Zend/zend_operators.c
  M  Zend/zend_operators.h
  M  Zend/zend_string.c
  M  Zend/zend_string.h
  M  Zend/zend_virtual_cwd.c
  M  Zend/zend_virtual_cwd.h
  M  Zend/zend_vm_def.h
  M  Zend/zend_vm_execute.h
  M  ext/bcmath/bcmath.c
  M  ext/bz2/bz2.c
  M  ext/com_dotnet/com_com.c
  M  ext/com_dotnet/com_dotnet.c
  M  ext/com_dotnet/com_handlers.c
  M  ext/com_dotnet/com_olechar.c
  M  ext/com_dotnet/com_persist.c
  M  ext/com_dotnet/com_saproxy.c
  M  ext/com_dotnet/com_typeinfo.c
  M  ext/com_dotnet/com_variant.c
  M  ext/com_dotnet/com_wrapper.c
  M  ext/com_dotnet/php_com_dotnet_internal.h
  M  ext/curl/curl_file.c
  M  ext/curl/interface.c
  M  ext/date/php_date.c
  M  ext/date/php_date.h
  M  ext/dba/dba.c
  M  ext/dom/attr.c
  M  ext/dom/cdatasection.c
  M  ext/dom/characterdata.c
  M  ext/dom/comment.c
  M  ext/dom/document.c
  M  ext/dom/documentfragment.c
  M  ext/dom/domimplementation.c
  M  ext/dom/element.c
  M  ext/dom/entityreference.c
  M  ext/dom/namednodemap.c
  M  ext/dom/node.c
  M  ext/dom/php_dom.c
  M  ext/dom/processinginstruction.c
  M  ext/dom/text.c
  M  ext/dom/xpath.c
  M  ext/enchant/enchant.c
  M  ext/ereg/ereg.c
  M  ext/exif/exif.c
  M  ext/fileinfo/fileinfo.c
  M  ext/fileinfo/libmagic/funcs.c
  M  ext/filter/filter.c
  M  ext/filter/logical_filters.c
  M  ext/filter/sanitizing_filters.c
  M  ext/ftp/ftp.c
  M  ext/ftp/ftp.h
  M  ext/ftp/php_ftp.c
  M  ext/gd/gd.c
  M  ext/gd/gd_ctx.c
  M  ext/gettext/gettext.c
  M  ext/gmp/gmp.c
  M  ext/hash/hash.c
  M  ext/hash/hash_haval.c
  M  ext/hash/hash_joaat.c
  M  ext/hash/hash_md.c
  M  ext/hash/hash_ripemd.c
  M  ext/hash/hash_sha.c
  M  ext/hash/php_hash.h
  M  ext/hash/php_hash_haval.h
  M  ext/hash/php_hash_joaat.h
  M  ext/hash/php_hash_md.h
  M  ext/hash/php_hash_ripemd.h
  M  ext/hash/php_hash_sha.h
  M  ext/iconv/iconv.c
  M  ext/imap/php_imap.c
  M  ext/interbase/ibase_blobs.c
  M  ext/interbase/ibase_query.c
  M  ext/interbase/ibase_service.c
  M  ext/interbase/interbase.c
  M  ext/intl/collator/collator_compare.c
  M  ext/intl/collator/collator_convert.c
  M  ext/intl/collator/collator_create.c
  M  ext/intl/collator/collator_is_numeric.c
  M  ext/intl/collator/collator_is_numeric.h
  M  ext/intl/collator/collator_sort.c
  M  ext/intl/converter/converter.c
  M  ext/intl/dateformat/dateformat_attr.c
  M  ext/intl/dateformat/dateformat_parse.c
  M  ext/intl/formatter/formatter_attr.c
  M  ext/intl/formatter/formatter_format.c
  M  ext/intl/formatter/formatter_main.c
  M  ext/intl/formatter/formatter_parse.c
  M  ext/intl/grapheme/grapheme_string.c
  M  ext/intl/grapheme/grapheme_util.c
  M  ext/intl/grapheme/grapheme_util.h
  M  ext/intl/idn/idn.c
  M  ext/intl/intl_convert.c
  M  ext/intl/intl_convert.h
  M  ext/intl/intl_convertcpp.h
  M  ext/intl/intl_data.h
  M  ext/intl/intl_error.c
  M  ext/intl/locale/locale_methods.c
  M  ext/intl/msgformat/msgformat.c
  M  ext/intl/msgformat/msgformat_attr.c
  M  ext/intl/msgformat/msgformat_format.c
  M  ext/intl/msgformat/msgformat_parse.c
  M  ext/intl/normalizer/normalizer_normalize.c
  M  ext/intl/resourcebundle/resourcebundle_class.c
  M  ext/intl/spoofchecker/spoofchecker_main.c
  M  ext/intl/transliterator/transliterator_class.c
  M  ext/intl/transliterator/transliterator_methods.c
  M  ext/json/JSON_parser.c
  M  ext/json/JSON_parser.h
  M  ext/json/json.c
  M  ext/json/php_json.h
  M  ext/ldap/ldap.c
  M  ext/libxml/libxml.c
  M  ext/mbstring/mb_gpc.c
  M  ext/mbstring/mbstring.c
  M  ext/mbstring/php_mbregex.c
  M  ext/mcrypt/mcrypt.c
  M  ext/mssql/php_mssql.c
  M  ext/mysql/php_mysql.c
  M  ext/mysqli/mysqli.c
  M  ext/mysqli/mysqli_api.c
  M  ext/mysqli/mysqli_nonapi.c
  M  ext/mysqlnd/mysqlnd_bt.c
  M  ext/mysqlnd/mysqlnd_debug.c
  M  ext/mysqlnd/mysqlnd_ps_codec.c
  M  ext/mysqlnd/mysqlnd_wireprotocol.c
  M  ext/mysqlnd/php_mysqlnd.c
  M  ext/oci8/oci8.c
  M  ext/oci8/oci8_collection.c
  M  ext/oci8/oci8_interface.c
  M

[PHP-CVS] com php-src: Z_STRLEN vs Z_STRSIZE: Zend/zend_compile.c

2013-12-17 Thread Anatol Belski
Commit:170c4d1fe66645682b9d37acd6bd4d38a280ee85
Author:Anatol Belski a...@php.net Tue, 17 Dec 2013 09:26:07 +0100
Parents:   167fdaa0e7aea1ea9729c5dfe229411b3de12eb2
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=170c4d1fe66645682b9d37acd6bd4d38a280ee85

Log:
Z_STRLEN vs Z_STRSIZE

Changed paths:
  M  Zend/zend_compile.c


Diff:
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 281ce63..285e735 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -666,7 +666,7 @@ void fetch_simple_variable_ex(znode *result, znode 
*varname, int bp, zend_uchar
 
hash = str_hash(Z_STRVAL(varname-u.constant), 
Z_STRSIZE(varname-u.constant));
if (!zend_is_auto_global_quick(Z_STRVAL(varname-u.constant), 
Z_STRSIZE(varname-u.constant), hash TSRMLS_CC) 
-   !(Z_STRLEN(varname-u.constant) == (sizeof(this)-1) 
+   !(Z_STRSIZE(varname-u.constant) == (sizeof(this)-1) 
  !memcmp(Z_STRVAL(varname-u.constant), this, 
sizeof(this) - 1)) 
(CG(active_op_array)-last == 0 ||
 
CG(active_op_array)-opcodes[CG(active_op_array)-last-1].opcode != 
ZEND_BEGIN_SILENCE)) {


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



[PHP-CVS] com php-src: revamp ext/pdo_firebird: ext/pdo_firebird/firebird_driver.c ext/pdo_firebird/firebird_statement.c

2013-12-17 Thread Anatol Belski
Commit:b90cc170b6cb517dc376269e1ef45e12b49fb941
Author:Anatol Belski a...@php.net Tue, 17 Dec 2013 10:14:55 +0100
Parents:   1337ba8a626fef796daaf709590af9bd4dda74fa
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=b90cc170b6cb517dc376269e1ef45e12b49fb941

Log:
revamp ext/pdo_firebird

Changed paths:
  M  ext/pdo_firebird/firebird_driver.c
  M  ext/pdo_firebird/firebird_statement.c


Diff:
diff --git a/ext/pdo_firebird/firebird_driver.c 
b/ext/pdo_firebird/firebird_driver.c
index 656751b..86511cf 100644
--- a/ext/pdo_firebird/firebird_driver.c
+++ b/ext/pdo_firebird/firebird_driver.c
@@ -35,7 +35,7 @@
 #include php_pdo_firebird.h
 #include php_pdo_firebird_int.h
 
-static int firebird_alloc_prepare_stmt(pdo_dbh_t*, const char*, php_int_t, 
XSQLDA*, isc_stmt_handle*,
+static int firebird_alloc_prepare_stmt(pdo_dbh_t*, const char*, zend_str_size, 
XSQLDA*, isc_stmt_handle*,
HashTable* TSRMLS_DC);
 
 /* map driver specific error message to PDO error */
@@ -220,7 +220,7 @@ static int firebird_handle_preparer(pdo_dbh_t *dbh, const 
char *sql, zend_str_si
 /* }}} */
 
 /* called by PDO to execute a statement that doesn't produce a result set */
-static php_int_t firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, 
php_int_t sql_len TSRMLS_DC) /* {{{ */
+static php_int_t firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, 
zend_str_size sql_len TSRMLS_DC) /* {{{ */
 {
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh-driver_data;
isc_stmt_handle stmt = NULL;
@@ -274,8 +274,8 @@ static php_int_t firebird_handle_doer(pdo_dbh_t *dbh, const 
char *sql, php_int_t
 /* }}} */
 
 /* called by the PDO SQL parser to add quotes to values that are copied into 
SQL */
-static int firebird_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int 
unquotedlen, /* {{{ */
-   char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC)
+static int firebird_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, 
zend_str_size_int unquotedlen, /* {{{ */
+   char **quoted, zend_str_size_int *quotedlen, enum pdo_param_type 
paramtype TSRMLS_DC)
 {
int qcount = 0;
char const *co, *l, *r;
diff --git a/ext/pdo_firebird/firebird_statement.c 
b/ext/pdo_firebird/firebird_statement.c
index 0e92c6d..acfa713 100644
--- a/ext/pdo_firebird/firebird_statement.c
+++ b/ext/pdo_firebird/firebird_statement.c
@@ -229,7 +229,9 @@ static int firebird_fetch_blob(pdo_stmt_t *stmt, int colno, 
char **ptr, /* {{{ *
char const bl_item = isc_info_blob_total_length;
char bl_info[20];
unsigned short i;
-   int result = *len = 0;
+   int result = 0;
+   
+   *len = 0;
 
if (isc_open_blob(H-isc_status, H-db, H-tr, blobh, blob_id)) {
RECORD_ERROR(stmt);
@@ -297,7 +299,7 @@ fetch_blob_end:
 }
 /* }}} */
 
-static int firebird_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr,  /* 
{{{ */
+static int firebird_stmt_get_col(pdo_stmt_t *stmt, php_int_t colno, char 
**ptr,  /* {{{ */
php_uint_t *len, int *caller_frees TSRMLS_DC)
 {
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt-driver_data;


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



[PHP-CVS] com php-src: fix function signature: ext/pdo_odbc/odbc_stmt.c

2013-12-17 Thread Anatol Belski
Commit:dc45cfe4018e22d524ced208b3ecba0674ab5b02
Author:Anatol Belski a...@php.net Tue, 17 Dec 2013 10:17:14 +0100
Parents:   b90cc170b6cb517dc376269e1ef45e12b49fb941
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=dc45cfe4018e22d524ced208b3ecba0674ab5b02

Log:
fix function signature

Changed paths:
  M  ext/pdo_odbc/odbc_stmt.c


Diff:
diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c
index 81158ab3..845617d 100644
--- a/ext/pdo_odbc/odbc_stmt.c
+++ b/ext/pdo_odbc/odbc_stmt.c
@@ -613,7 +613,7 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno 
TSRMLS_DC)
return 1;
 }
 
-static int odbc_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, 
php_uint_t *len, int *caller_frees TSRMLS_DC)
+static int odbc_stmt_get_col(pdo_stmt_t *stmt, php_int_t colno, char **ptr, 
php_uint_t *len, int *caller_frees TSRMLS_DC)
 {
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt-driver_data;
pdo_odbc_column *C = S-cols[colno];


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



[PHP-CVS] com php-src: fixed sapi/embed: sapi/embed/php_embed.c

2013-12-13 Thread Anatol Belski
Commit:4c68e810183f6b02ce7c2731ddecb4aca14c87f3
Author:Anatol Belski a...@php.net Sat, 14 Dec 2013 00:26:56 +0100
Parents:   009528ba439b6866ed498c40864ced33005e838c
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=4c68e810183f6b02ce7c2731ddecb4aca14c87f3

Log:
fixed sapi/embed

Changed paths:
  M  sapi/embed/php_embed.c


Diff:
diff --git a/sapi/embed/php_embed.c b/sapi/embed/php_embed.c
index 414b4db..0ed475c 100644
--- a/sapi/embed/php_embed.c
+++ b/sapi/embed/php_embed.c
@@ -44,10 +44,10 @@ static int php_embed_deactivate(TSRMLS_D)
return SUCCESS;
 }
 
-static inline size_t php_embed_single_write(const char *str, uint str_length)
+static inline size_t php_embed_single_write(const char *str, 
zend_str_size_uint str_length)
 {
 #ifdef PHP_WRITE_STDOUT
-   long ret;
+   php_int_t ret;
 
ret = write(STDOUT_FILENO, str, str_length);
if (ret = 0) return 0;
@@ -61,10 +61,10 @@ static inline size_t php_embed_single_write(const char 
*str, uint str_length)
 }
 
 
-static int php_embed_ub_write(const char *str, uint str_length TSRMLS_DC)
+static zend_str_size_int php_embed_ub_write(const char *str, 
zend_str_size_uint str_length TSRMLS_DC)
 {
const char *ptr = str;
-   uint remaining = str_length;
+   zend_str_size_uint remaining = str_length;
size_t ret;
 
while (remaining  0) {


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



[PHP-CVS] com php-src: Merge branch 'master' into str_size_and_int64: Zend/zend_API.c Zend/zend_API.h Zend/zend_compile.h Zend/zend_execute.c Zend/zend_object_handlers.c Zend/zend_vm_def.h Zend/zend_v

2013-12-13 Thread Anatol Belski
Commit:f806f4d0604f37799393c1a72fc5fdf12ca4f371
Author:Anatol Belski a...@php.net Fri, 13 Dec 2013 10:45:27 +0100
Parents:   e0c7899dddf0606480ebaf84be6c43d7bd613c58 
914de05bf59ba91d39b6b3f3e914fd2a456d0133
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=f806f4d0604f37799393c1a72fc5fdf12ca4f371

Log:
Merge branch 'master' into str_size_and_int64

Changed paths:
  MM  Zend/zend_API.c
  MM  Zend/zend_API.h
  MM  Zend/zend_compile.h
  MM  Zend/zend_execute.c
  MM  Zend/zend_object_handlers.c
  MM  Zend/zend_vm_def.h
  MM  Zend/zend_vm_execute.h
  MM  ext/opcache/ZendAccelerator.c
  MM  ext/opcache/ZendAccelerator.h
  MM  ext/opcache/zend_accelerator_module.c
  MM  main/main.c
  MM  sapi/cgi/cgi_main.c
  MM  sapi/cli/php_cli.c


Diff:



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



[PHP-CVS] com php-src: fixed ext/readline: ext/readline/readline.c

2013-12-13 Thread Anatol Belski
Commit:1040cdf8fc1e36381241342fbbc88ded93829a27
Author:Anatol Belski a...@php.net Fri, 13 Dec 2013 05:51:49 -0800
Parents:   985d8f0436bb6300c302a59dbfd66380029d9d6f
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=1040cdf8fc1e36381241342fbbc88ded93829a27

Log:
fixed ext/readline

Changed paths:
  M  ext/readline/readline.c


Diff:
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index d4032ca..6051858 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -211,10 +211,10 @@ PHP_MINFO_FUNCTION(readline)
 PHP_FUNCTION(readline)
 {
char *prompt = NULL;
-   int prompt_len;
+   zend_str_size_int prompt_len;
char *result;
 
-   if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |s!, 
prompt, prompt_len)) {
+   if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |S!, 
prompt, prompt_len)) {
RETURN_FALSE;
}
 
@@ -238,10 +238,11 @@ PHP_FUNCTION(readline_info)
 {
char *what = NULL;
zval **value = NULL;
-   int what_len, oldval;
+   zend_str_size_int what_len;
+   int oldval;
char *oldstr;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |sZ, what, 
what_len, value) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |SZ, what, 
what_len, value) == FAILURE) {
return;
}
 
@@ -334,9 +335,9 @@ PHP_FUNCTION(readline_info)
 PHP_FUNCTION(readline_add_history)
 {
char *arg;
-   int arg_len;
+   zend_str_size_int arg_len;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, arg, 
arg_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, S, arg, 
arg_len) == FAILURE) {
return;
}
 
@@ -389,9 +390,9 @@ PHP_FUNCTION(readline_list_history)
 PHP_FUNCTION(readline_read_history)
 {
char *arg = NULL;
-   int arg_len;
+   zend_str_size_int arg_len;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |p, arg, 
arg_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |P, arg, 
arg_len) == FAILURE) {
return;
}
 
@@ -413,9 +414,9 @@ PHP_FUNCTION(readline_read_history)
 PHP_FUNCTION(readline_write_history)
 {
char *arg = NULL;
-   int arg_len;
+   zend_str_size_int arg_len;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |p, arg, 
arg_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |P, arg, 
arg_len) == FAILURE) {
return;
}
 
@@ -576,9 +577,9 @@ PHP_FUNCTION(readline_callback_handler_install)
zval *callback;
char *name = NULL;
char *prompt;
-   int prompt_len;
+   zend_str_size_int prompt_len;
 
-   if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, sz, 
prompt, prompt_len, callback)) {
+   if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Sz, 
prompt, prompt_len, callback)) {
return;
}


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



[PHP-CVS] com php-src: revamp ext/dom: ext/dom/document.c

2013-12-13 Thread Anatol Belski
Commit:bdc565e67ad9cd1f14c987d2e54cd63653ce66a7
Author:Anatol Belski a...@php.net Thu, 12 Dec 2013 11:50:45 +0100
Parents:   e0c7899dddf0606480ebaf84be6c43d7bd613c58
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=bdc565e67ad9cd1f14c987d2e54cd63653ce66a7

Log:
revamp ext/dom

Changed paths:
  M  ext/dom/document.c


Diff:
diff --git a/ext/dom/document.c b/ext/dom/document.c
index 5bacc0f..04027d3 100644
--- a/ext/dom/document.c
+++ b/ext/dom/document.c
@@ -419,7 +419,7 @@ int dom_document_standalone_write(dom_object *obj, zval 
*newval TSRMLS_DC)
 {
zval value_copy;
xmlDoc *docp;
-   int standalone;
+   php_int_t standalone;
 
docp = (xmlDocPtr) dom_object_get_node(obj);
 
@@ -553,7 +553,7 @@ int dom_document_strict_error_checking_write(dom_object 
*obj, zval *newval TSRML
 
if (obj-document) {
doc_prop = dom_get_doc_props(obj-document);
-   doc_prop-stricterror = Z_LVAL_P(newval);
+   doc_prop-stricterror = Z_BVAL_P(newval);
}
 
if (newval == value_copy) {
@@ -596,7 +596,7 @@ int dom_document_format_output_write(dom_object *obj, zval 
*newval TSRMLS_DC)
 
if (obj-document) {
doc_prop = dom_get_doc_props(obj-document);
-   doc_prop-formatoutput = Z_LVAL_P(newval);
+   doc_prop-formatoutput = Z_BVAL_P(newval);
}
 
if (newval == value_copy) {
@@ -638,7 +638,7 @@ int dom_document_validate_on_parse_write(dom_object *obj, 
zval *newval TSRMLS_DC
 
if (obj-document) {
doc_prop = dom_get_doc_props(obj-document);
-   doc_prop-validateonparse = Z_LVAL_P(newval);
+   doc_prop-validateonparse = Z_BVAL_P(newval);
}
 
if (newval == value_copy) {
@@ -680,7 +680,7 @@ int dom_document_resolve_externals_write(dom_object *obj, 
zval *newval TSRMLS_DC
 
if (obj-document) {
doc_prop = dom_get_doc_props(obj-document);
-   doc_prop-resolveexternals = Z_LVAL_P(newval);
+   doc_prop-resolveexternals = Z_BVAL_P(newval);
}
 
if (newval == value_copy) {
@@ -722,7 +722,7 @@ int dom_document_preserve_whitespace_write(dom_object *obj, 
zval *newval TSRMLS_
 
if (obj-document) {
doc_prop = dom_get_doc_props(obj-document);
-   doc_prop-preservewhitespace = Z_LVAL_P(newval);
+   doc_prop-preservewhitespace = Z_BVAL_P(newval);
}
 
if (newval == value_copy) {
@@ -764,7 +764,7 @@ int dom_document_recover_write(dom_object *obj, zval 
*newval TSRMLS_DC)
 
if (obj-document) {
doc_prop = dom_get_doc_props(obj-document);
-   doc_prop-recover = Z_LVAL_P(newval);
+   doc_prop-recover = Z_BVAL_P(newval);
}
 
if (newval == value_copy) {
@@ -806,7 +806,7 @@ int dom_document_substitue_entities_write(dom_object *obj, 
zval *newval TSRMLS_D
 
if (obj-document) {
doc_prop = dom_get_doc_props(obj-document);
-   doc_prop-substituteentities = Z_LVAL_P(newval);
+   doc_prop-substituteentities = Z_BVAL_P(newval);
}
 
if (newval == value_copy) {
@@ -1032,6 +1032,11 @@ PHP_FUNCTION(dom_document_create_cdatasection)
return;
}
 
+   if (value_len  INT_MAX) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Input value is too 
long);
+   RETURN_FALSE;
+   }
+
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
 
node = xmlNewCDataBlock(docp, (xmlChar *) value, value_len);
@@ -1562,8 +1567,8 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, 
char *source, int sourc
dom_object *intern;
php_libxml_ref_obj *document = NULL;
int validate, recover, resolve_externals, keep_blanks, substitute_ent;
-   int resolved_path_len;
-   int old_error_reporting = 0;
+   zend_str_size_int resolved_path_len;
+   php_int_t old_error_reporting = 0;
char *directory=NULL, resolved_path[MAXPATHLEN];
 
if (id != NULL) {


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



[PHP-CVS] com php-src: revamp ext/pdo_mysql: ext/pdo_mysql/mysql_driver.c ext/pdo_mysql/mysql_statement.c

2013-12-11 Thread Anatol Belski
Commit:fa2a2c88fdb6286423bbd1c8cbe59547625dcf90
Author:Anatol Belski a...@php.net Wed, 11 Dec 2013 23:39:43 +0100
Parents:   6d5c56367ddde7d0ef79b402e37ae082fab33a8f
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=fa2a2c88fdb6286423bbd1c8cbe59547625dcf90

Log:
revamp ext/pdo_mysql

Changed paths:
  M  ext/pdo_mysql/mysql_driver.c
  M  ext/pdo_mysql/mysql_statement.c


Diff:
diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c
index f97dbd2..641fb5c 100644
--- a/ext/pdo_mysql/mysql_driver.c
+++ b/ext/pdo_mysql/mysql_driver.c
@@ -168,7 +168,7 @@ static int mysql_handle_preparer(pdo_dbh_t *dbh, const char 
*sql, zend_str_size
char *nsql = NULL;
zend_str_size_int nsql_len = 0;
int ret;
-   int server_version;
+   php_uint_t server_version;

PDO_DBG_ENTER(mysql_handle_preparer);
PDO_DBG_INF_FMT(dbh=%p, dbh);
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
index 5128366..4c4d0fb 100644
--- a/ext/pdo_mysql/mysql_statement.c
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -675,7 +675,7 @@ static int pdo_mysql_stmt_describe(pdo_stmt_t *stmt, int 
colno TSRMLS_DC) /* {{{
PDO_DBG_RETURN(1);
}
for (i = 0; i  stmt-column_count; i++) {
-   int namelen;
+   zend_str_size_int namelen;
 
if (S-H-fetch_table_names) {
namelen = spprintf(cols[i].name, 0, %s.%s, 
S-fields[i].table, S-fields[i].name);
@@ -702,7 +702,7 @@ static int pdo_mysql_stmt_describe(pdo_stmt_t *stmt, int 
colno TSRMLS_DC) /* {{{
 }
 /* }}} */
 
-static int pdo_mysql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, 
php_uint_t *len, int *caller_frees TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_get_col(pdo_stmt_t *stmt, php_int_t colno, char 
**ptr, php_uint_t *len, int *caller_frees TSRMLS_DC) /* {{{ */
 {
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt-driver_data;


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



[PHP-CVS] com php-src: Merge branch 'master' into str_size_and_int64: ext/sockets/sockaddr_conv.c

2013-12-11 Thread Anatol Belski
Commit:adb70b9923f2ba5212f5559a283c85b3c09e102a
Author:Anatol Belski a...@php.net Wed, 11 Dec 2013 19:29:21 +0100
Parents:   05fe153f490364f6f0931757d63e292650133580 
98d929290c7c18c8ea5309c6813e326e2f5d47a7
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=adb70b9923f2ba5212f5559a283c85b3c09e102a

Log:
Merge branch 'master' into str_size_and_int64

Changed paths:
  MM  ext/sockets/sockaddr_conv.c


Diff:



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



[PHP-CVS] com php-src: revamp range checks in ext/xml: ext/xml/xml.c

2013-12-10 Thread Anatol Belski
Commit:f195339006afa08889a0eab4c5b263c8cd8a054a
Author:Anatol Belski a...@php.net Tue, 10 Dec 2013 09:34:45 +0100
Parents:   f7f8c590a5e67e79d4b0ad8e687353a32054afaf
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=f195339006afa08889a0eab4c5b263c8cd8a054a

Log:
revamp range checks in ext/xml

Changed paths:
  M  ext/xml/xml.c


Diff:
diff --git a/ext/xml/xml.c b/ext/xml/xml.c
index f3571a9..24d5dcb 100644
--- a/ext/xml/xml.c
+++ b/ext/xml/xml.c
@@ -391,7 +391,7 @@ static zval *_xml_resource_zval(php_int_t value)
 static zval *_xml_string_zval(const char *str)
 {
zval *ret;
-   int len = strlen(str);
+   size_t len = strlen(str);
MAKE_STD_ZVAL(ret);
 
Z_TYPE_P(ret) = IS_STRING;
@@ -973,7 +973,7 @@ void _xml_characterDataHandler(void *userData, const 
XML_Char *s, int len)
if 
(zend_hash_find(Z_ARRVAL_PP(curtag),type,sizeof(type),(void **) mytype) == 
SUCCESS) {
if 
(!strcmp(Z_STRVAL_PP(mytype), cdata)) {
if 
(zend_hash_find(Z_ARRVAL_PP(curtag),value,sizeof(value),(void **) myval) 
== SUCCESS) {
-   int 
newlen = Z_STRSIZE_PP(myval) + decoded_len;
+   
zend_str_size_int newlen = Z_STRSIZE_PP(myval) + decoded_len;

Z_STRVAL_PP(myval) = erealloc(Z_STRVAL_PP(myval),newlen+1);

strncpy(Z_STRVAL_PP(myval) + Z_STRSIZE_PP(myval), decoded_value, decoded_len + 
1);

Z_STRSIZE_PP(myval) += decoded_len;
@@ -1115,7 +1115,7 @@ int _xml_externalEntityRefHandler(XML_Parser parserPtr,
args[4] = _xml_xmlchar_zval(publicId, 0, 
parser-target_encoding);
if ((retval = xml_call_handler(parser, 
parser-externalEntityRefHandler, parser-externalEntityRefPtr, 5, args))) {
convert_to_long(retval);
-   ret = Z_LVAL_P(retval);
+   ret = (0 == Z_LVAL_P(retval) ? 0 : 1) ;
efree(retval);
} else {
ret = 0;
@@ -1449,6 +1449,12 @@ PHP_FUNCTION(xml_parse)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rS|i, pind, 
data, data_len, isFinal) == FAILURE) {
return;
}
+
+   if (data_len  INT_MAX) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Input data is too 
long.);
+   RETURN_LONG(0);
+   }
+
ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, XML Parser, 
le_xml_parser);
 
parser-isparsing = 1;
@@ -1474,6 +1480,11 @@ PHP_FUNCTION(xml_parse_into_struct)
return;
}

+   if (data_len  INT_MAX) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Input data is too 
long.);
+   RETURN_LONG(0);
+   }
+
if (info) { 
zval_dtor(*info);
array_init(*info);
@@ -1629,15 +1640,19 @@ PHP_FUNCTION(xml_parser_set_option)
switch (opt) {
case PHP_XML_OPTION_CASE_FOLDING:
convert_to_long_ex(val);
-   parser-case_folding = Z_LVAL_PP(val);
+   parser-case_folding = (0 == Z_LVAL_PP(val) ? 0 : 1);
break;
case PHP_XML_OPTION_SKIP_TAGSTART:
convert_to_long_ex(val);
+   if (Z_LVAL_PP(val)  INT_MAX) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Character count is too big);
+   RETURN_FALSE;
+   }
parser-toffset = Z_LVAL_PP(val);
break;
case PHP_XML_OPTION_SKIP_WHITE:
convert_to_long_ex(val);
-   parser-skipwhite = Z_LVAL_PP(val);
+   parser-skipwhite = (0 == Z_LVAL_PP(val) ? 0 : 1);
break;
case PHP_XML_OPTION_TARGET_ENCODING: {
xml_encoding *enc;


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



[PHP-CVS] com php-src: revamp ext/xsl: ext/xsl/xsltprocessor.c

2013-12-10 Thread Anatol Belski
Commit:da62a38244ce7a6976be04da7d7ef48bda232324
Author:Anatol Belski a...@php.net Tue, 10 Dec 2013 10:15:47 +0100
Parents:   f195339006afa08889a0eab4c5b263c8cd8a054a
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=da62a38244ce7a6976be04da7d7ef48bda232324

Log:
revamp ext/xsl

Changed paths:
  M  ext/xsl/xsltprocessor.c


Diff:
diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c
index 7a381f5..a77dc62 100644
--- a/ext/xsl/xsltprocessor.c
+++ b/ext/xsl/xsltprocessor.c
@@ -444,7 +444,7 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
cloneDocu = std_hnd-read_property(id, member, BP_VAR_IS, NULL 
TSRMLS_CC);
if (Z_TYPE_P(cloneDocu) != IS_NULL) {
convert_to_long(cloneDocu);
-   clone_docu = Z_LVAL_P(cloneDocu);
+   clone_docu = (0 == Z_LVAL_P(cloneDocu) ? 0 : 1) ;
}
efree(member);
if (clone_docu == 0) {
@@ -490,7 +490,7 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, 
xsl_object *intern, xsltStyl
zend_object_handlers *std_hnd;
FILE *f;
int secPrefsError = 0;
-   int secPrefsValue, secPrefsIni;
+   php_int_t secPrefsValue, secPrefsIni;
xsltSecurityPrefsPtr secPrefs = NULL;
 
node = php_libxml_import_node(docp TSRMLS_CC);
@@ -544,7 +544,7 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, 
xsl_object *intern, xsltStyl
doXInclude = std_hnd-read_property(id, member, BP_VAR_IS, NULL 
TSRMLS_CC);
if (Z_TYPE_P(doXInclude) != IS_NULL) {
convert_to_long(doXInclude);
-   ctxt-xinclude = Z_LVAL_P(doXInclude);
+   ctxt-xinclude = (0 == Z_LVAL_P(doXInclude) ? 0 : 1);
}
efree(member);
 
@@ -665,7 +665,7 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc)
if (newdocp) {
if (ret_class) {
int found;
-   char *curclass_name;
+   const char *curclass_name;
zend_class_entry *curce, **ce;
php_libxml_node_object *interndoc;


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



[PHP-CVS] com php-src: more range checks for ext/sqlite3: ext/sqlite3/sqlite3.c

2013-12-10 Thread Anatol Belski
Commit:34e5236836e9da4a5f0a384c73d482eb27793286
Author:Anatol Belski a...@php.net Tue, 10 Dec 2013 15:40:19 +0100
Parents:   77d4db39571c092fff6883d92f38110c58d7f343
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=34e5236836e9da4a5f0a384c73d482eb27793286

Log:
more range checks for ext/sqlite3

Changed paths:
  M  ext/sqlite3/sqlite3.c


Diff:
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c
index 6f5d5e4..c43ef97 100644
--- a/ext/sqlite3/sqlite3.c
+++ b/ext/sqlite3/sqlite3.c
@@ -472,6 +472,11 @@ PHP_METHOD(sqlite3, prepare)
stmt_obj-db_obj = db_obj;
stmt_obj-db_obj_zval = getThis();
 
+   if (sql_len  INT_MAX) {
+   php_sqlite3_error(stmt_obj-db_obj, SQL statement is too 
long.);
+   RETURN_FALSE;
+   }
+
Z_ADDREF_P(object);
 
errcode = sqlite3_prepare_v2(db_obj-db, sql, sql_len, 
(stmt_obj-stmt), NULL);
@@ -531,6 +536,11 @@ PHP_METHOD(sqlite3, query)
stmt_obj-db_obj = db_obj;
stmt_obj-db_obj_zval = getThis();
 
+   if (sql_len  INT_MAX) {
+   php_sqlite3_error(stmt_obj-db_obj, SQL statement is too 
long.);
+   RETURN_FALSE;
+   }
+
Z_ADDREF_P(object);
 
return_code = sqlite3_prepare_v2(db_obj-db, sql, sql_len, 
(stmt_obj-stmt), NULL);
@@ -628,6 +638,11 @@ PHP_METHOD(sqlite3, querySingle)
RETURN_FALSE;
}
 
+   if (sql_len  INT_MAX) {
+   php_sqlite3_error(db_obj, SQL statement is too long.);
+   RETURN_FALSE;
+   }
+
/* If there was no return value then just execute the query */
if (!return_value_used) {
if (sqlite3_exec(db_obj-db, sql, NULL, NULL, errtext) != 
SQLITE_OK) {
@@ -1519,12 +1534,12 @@ PHP_METHOD(sqlite3stmt, execute)
case SQLITE_BLOB:
{
php_stream *stream = NULL;
-   int blength;
+   zend_str_size_int blength;
char *buffer = NULL;
if (Z_TYPE_P(param-parameter) == 
IS_RESOURCE) {

php_stream_from_zval_no_verify(stream, param-parameter);
if (stream == NULL) {
-   
php_sqlite3_error(stmt_obj-db_obj, Unable to read stream for parameter %ld, 
param-param_number);
+   
php_sqlite3_error(stmt_obj-db_obj, Unable to read stream for parameter %pd, 
param-param_number);
RETURN_FALSE;
}
blength = 
php_stream_copy_to_mem(stream, (void *)buffer, PHP_STREAM_COPY_ALL, 0);
@@ -1534,6 +1549,11 @@ PHP_METHOD(sqlite3stmt, execute)
buffer = 
Z_STRVAL_P(param-parameter);
}
 
+   if (blength  INT_MAX) {
+   
php_sqlite3_error(stmt_obj-db_obj, Input is too long for parameter %pd, 
param-param_number);
+   RETURN_FALSE;
+   }
+
sqlite3_bind_blob(stmt_obj-stmt, 
param-param_number, buffer, blength, SQLITE_TRANSIENT);
 
if (stream) {
@@ -1552,7 +1572,7 @@ PHP_METHOD(sqlite3stmt, execute)
break;
 
default:
-   php_sqlite3_error(stmt_obj-db_obj, 
Unknown parameter type: %ld for parameter %ld, param-type, 
param-param_number);
+   php_sqlite3_error(stmt_obj-db_obj, 
Unknown parameter type: %pd for parameter %pd, param-type, 
param-param_number);
RETURN_FALSE;
}
zend_hash_move_forward(stmt_obj-bound_params);
@@ -1613,6 +1633,11 @@ PHP_METHOD(sqlite3stmt, __construct)
return;
}
 
+   if (sql_len  INT_MAX) {
+   php_sqlite3_error(stmt_obj-db_obj, SQL string is too long);
+   RETURN_FALSE;
+   }
+
db_obj = (php_sqlite3_db_object *)zend_object_store_get_object(db_zval 
TSRMLS_CC);
 
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj-initialised, SQLite3)


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



[PHP-CVS] com php-src: Merge branch 'master' into str_size_and_int64: Zend/zend_builtin_functions.c Zend/zend_compile.c Zend/zend_execute_API.c Zend/zend_operators.h ext/opcache/Optimizer/pass1_5.c ex

2013-12-10 Thread Anatol Belski
Commit:27990438f184cfecd179a78231cfb04af6084f31
Author:Anatol Belski a...@php.net Tue, 10 Dec 2013 19:46:40 +0100
Parents:   34e5236836e9da4a5f0a384c73d482eb27793286 
8e29235b6c74a5eaaf4dec26e8e2aec92e3f44e1
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=27990438f184cfecd179a78231cfb04af6084f31

Log:
Merge branch 'master' into str_size_and_int64

Conflicts:
Zend/zend_builtin_functions.c
ext/opcache/Optimizer/pass1_5.c
ext/reflection/php_reflection.c
ext/soap/soap.c

Changed paths:
  MM  Zend/zend_builtin_functions.c
  MM  Zend/zend_compile.c
  MM  Zend/zend_execute_API.c
  MM  Zend/zend_operators.h
  MM  ext/opcache/Optimizer/pass1_5.c
  MM  ext/reflection/php_reflection.c
  MM  ext/soap/soap.c
  MM  sapi/cli/php_cli_server.c

diff --cc Zend/zend_builtin_functions.c
index 2b2de95,0a478a7..1d509ce
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@@ -2447,36 -2447,49 +2447,49 @@@ ZEND_FUNCTION(extension_loaded
 Returns an array with the names of functions belonging to the named 
extension */
  ZEND_FUNCTION(get_extension_funcs)
  {
-   char *extension_name;
-   zend_str_size extension_name_len;
+   char *extension_name, *lcname;
 -  int extension_name_len, array;
++  zend_str_size_int extension_name_len, array;
zend_module_entry *module;
-   const zend_function_entry *func;
- 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, S, 
extension_name, extension_name_len) == FAILURE) {
+   HashPosition iterator;
+   zend_function *zif;
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, 
extension_name, extension_name_len) == FAILURE) {
return;
}
- 
if (strncasecmp(extension_name, zend, sizeof(zend))) {
-   char *lcname = zend_str_tolower_dup(extension_name, 
extension_name_len);
-   if (zend_hash_find(module_registry, lcname,
-   extension_name_len+1, (void**)module) == FAILURE) {
-   efree(lcname);
-   RETURN_FALSE;
-   }
+   lcname = zend_str_tolower_dup(extension_name, 
extension_name_len);
+   } else {
+   lcname = estrdup(core);
+   }
+   if (zend_hash_find(module_registry, lcname,
+   extension_name_len+1, (void**)module) == FAILURE) {
efree(lcname);
+   RETURN_FALSE;
+   }
  
-   if (!(func = module-functions)) {
-   RETURN_FALSE;
-   }
+   zend_hash_internal_pointer_reset_ex(CG(function_table), iterator);
+   if (module-functions) {
+   /* avoid BC break, if functions list is empty, will return an 
empty array */
+   array_init(return_value);
+   array = 1;
} else {
-   func = builtin_functions;
+   array = 0;
+   }
+   while (zend_hash_get_current_data_ex(CG(function_table), (void **) 
zif, iterator) == SUCCESS) {
+   if (zif-common.type==ZEND_INTERNAL_FUNCTION
+zif-internal_function.module == module) {
+   if (!array) {
+   array_init(return_value);
+   array = 1;
+   }
+   add_next_index_string(return_value, 
zif-common.function_name, 1);
+   }
+   zend_hash_move_forward_ex(CG(function_table), iterator);
}
  
-   array_init(return_value);
+   efree(lcname);
  
-   while (func-fname) {
-   add_next_index_string(return_value, func-fname, 1);
-   func++;
+   if (!array) {
+   RETURN_FALSE;
}
  }
  /* }}} */
diff --cc ext/opcache/Optimizer/pass1_5.c
index 474c074,f173c3f..34a22e3
--- a/ext/opcache/Optimizer/pass1_5.c
+++ b/ext/opcache/Optimizer/pass1_5.c
@@@ -321,6 -321,27 +321,27 @@@ if (ZEND_OPTIMIZER_PASS_1  OPTIMIZATIO
break;
  
case ZEND_DO_FCALL:
+   /* define(name, scalar); */
+   if (collect_constants 
+   opline-extended_value == 2 
+   ZEND_OP1_TYPE(opline) == IS_CONST 
+   Z_TYPE(ZEND_OP1_LITERAL(opline)) == IS_STRING 
 -  Z_STRLEN(ZEND_OP1_LITERAL(opline)) == 
sizeof(define)-1 
 -  
zend_binary_strcasecmp(Z_STRVAL(ZEND_OP1_LITERAL(opline)), 
Z_STRLEN(ZEND_OP1_LITERAL(opline)), define, sizeof(define)-1) == 0 
++  Z_STRSIZE(ZEND_OP1_LITERAL(opline)) == 
sizeof(define)-1 
++  
zend_binary_strcasecmp(Z_STRVAL(ZEND_OP1_LITERAL(opline)), 
Z_STRSIZE(ZEND_OP1_LITERAL(opline)), define, sizeof(define)-1) == 0 
+   (opline-1)-opcode == ZEND_SEND_VAL

[PHP-CVS] com php-src: fixed return: ext/tidy/tidy.c

2013-12-10 Thread Anatol Belski
Commit:77d4db39571c092fff6883d92f38110c58d7f343
Author:Anatol Belski a...@php.net Tue, 10 Dec 2013 14:15:29 +0100
Parents:   a697297f5f328442994c6321c9661d1351036c4e
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=77d4db39571c092fff6883d92f38110c58d7f343

Log:
fixed return

Changed paths:
  M  ext/tidy/tidy.c


Diff:
diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c
index 69cd19e..7870ddf 100644
--- a/ext/tidy/tidy.c
+++ b/ext/tidy/tidy.c
@@ -606,7 +606,7 @@ static void 
php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
 
if (data_len  UINT_MAX) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Input data 
is too long);
-   RETVAL_FALSE;
+   RETURN_FALSE;
}
 
tidyBufInit(buf);


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



Re: [PHP-CVS] com php-src: more range checks for ext/tidy: ext/tidy/tidy.c

2013-12-10 Thread Anatol Belski
On Tue, December 10, 2013 13:55, Nikita Popov wrote:
 On Tue, Dec 10, 2013 at 1:41 PM, Anatol Belski a...@php.net wrote:


 Commit:a697297f5f328442994c6321c9661d1351036c4e
 Author:Anatol Belski a...@php.net Tue, 10 Dec 2013 13:41:49
 +0100
 Parents:   5acc0c0c5bf5afbd2b103a99adf51539874ccc48
 Branches:  str_size_and_int64


 Link:
 http://git.php.net/?p=php-src.git;a=commitdiff;h=a697297f5f328442994c632
 1c9661d1351036c4e


 Log:
 more range checks for ext/tidy

 Changed paths:
 M  ext/tidy/tidy.c



 Diff:
 diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index 94daef4..69cd19e
 100644
 --- a/ext/tidy/tidy.c
 +++ b/ext/tidy/tidy.c
 @@ -604,6 +604,11 @@ static void
 php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil if
 (data) {
 TidyBuffer buf;


 +   if (data_len  UINT_MAX) {
 +   php_error_docref(NULL TSRMLS_CC, E_WARNING,
 Input
 data is too long); +   RETVAL_FALSE;
 +   }



 RETVAL over RETURN intentional?


 Nikita



uups, of course not. Thanks for keeping eye on that :)

Regards

anatol


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



[PHP-CVS] com php-src: fix function params: Zend/zend_builtin_functions.c

2013-12-10 Thread Anatol Belski
Commit:19161b8d4e070b8d6c2efbd13157250f50081aa6
Author:Anatol Belski a...@php.net Tue, 10 Dec 2013 20:00:59 +0100
Parents:   27990438f184cfecd179a78231cfb04af6084f31
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=19161b8d4e070b8d6c2efbd13157250f50081aa6

Log:
fix function params

Changed paths:
  M  Zend/zend_builtin_functions.c


Diff:
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 1d509ce..cde65cd 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -2452,7 +2452,7 @@ ZEND_FUNCTION(get_extension_funcs)
zend_module_entry *module;
HashPosition iterator;
zend_function *zif;
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, 
extension_name, extension_name_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, S, 
extension_name, extension_name_len) == FAILURE) {
return;
}
if (strncasecmp(extension_name, zend, sizeof(zend))) {


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



[PHP-CVS] com php-src: Merge branch 'str_size_and_int64' into str_size_and_int64_openssl: ext/openssl/openssl.c

2013-12-09 Thread Anatol Belski
Commit:7e85b12b5375a4e10d83dce3c8f91e0d0a48f0e8
Author:Jakub Zelenka bu...@php.net Sun, 1 Dec 2013 20:04:58 +
Parents:   b34ce97417ffe7269a340982fe8b0f86983e12e7 
6b9396bd8ebe06567646bb77a78724474ac13ba8
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=7e85b12b5375a4e10d83dce3c8f91e0d0a48f0e8

Log:
Merge branch 'str_size_and_int64' into str_size_and_int64_openssl

Conflicts:
ext/openssl/openssl.c

Changed paths:
  MM  ext/openssl/openssl.c


Diff:
diff --cc ext/openssl/openssl.c
index 2fe8341,3bb1b06..335a39f
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@@ -5200,13 -5134,13 +5200,13 @@@ static int passwd_callback(char *buf, i
  
  GET_VER_OPT_STRING(passphrase, passphrase);
  
-   if (passphrase) {
-   if (Z_STRSIZE_PP(val)  num - 1) {
-   memcpy(buf, Z_STRVAL_PP(val), Z_STRSIZE_PP(val)+1);
-   return (int) Z_STRSIZE_PP(val);
-   }
-   }
+ if (passphrase) {
+ if (Z_STRSIZE_PP(val)  num - 1) {
+ memcpy(buf, Z_STRVAL_PP(val), Z_STRSIZE_PP(val)+1);
+ return Z_STRSIZE_PP(val);
+ }
+ }
 -return 0;
 +  return 0;
  }
  /* }}} */


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



[PHP-CVS] com php-src: Merge remote-tracking branch 'origin/master' into str_size_and_int64: Zend/zend_compile.c Zend/zend_compile.h Zend/zend_globals.h Zend/zend_language_parser.y main/streams/plain_

2013-12-09 Thread Anatol Belski
Commit:325224832babac68b4c7d0ab1f38db5ce1192cb1
Author:Anatol Belski a...@php.net Mon, 9 Dec 2013 10:20:04 +0100
Parents:   31a4d08d37e744789f1718b890cbb0a9f1b9728d 
912be1243207a334a856c0d759c978a3029fd6d5
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=325224832babac68b4c7d0ab1f38db5ce1192cb1

Log:
Merge remote-tracking branch 'origin/master' into str_size_and_int64

Conflicts:
Zend/zend_compile.c
Zend/zend_compile.h

Changed paths:
  MM  Zend/zend_compile.c
  MM  Zend/zend_compile.h
  MM  Zend/zend_globals.h
  MM  Zend/zend_language_parser.y
  MM  main/streams/plain_wrapper.c

diff --cc Zend/zend_compile.c
index 3da1084,35f5f30..77675f6
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@@ -417,12 -421,16 +421,16 @@@ int zend_add_ns_func_name_literal(zend_
lc_literal = zend_add_literal(CG(active_op_array), c TSRMLS_CC);
CALCULATE_LITERAL_HASH(lc_literal);
  
-   ns_separator = (const char*)zend_memrchr(Z_STRVAL_P(zv), '\\', 
Z_STRSIZE_P(zv)) + 1;
-   lc_len = Z_STRSIZE_P(zv) - (ns_separator - Z_STRVAL_P(zv));
-   lc_name = zend_str_tolower_dup(ns_separator, lc_len);
-   ZVAL_STRINGL(c, lc_name, lc_len, 0);
-   lc_literal = zend_add_literal(CG(active_op_array), c TSRMLS_CC);
-   CALCULATE_LITERAL_HASH(lc_literal);
+   ns_separator = (const char*)zend_memrchr(Z_STRVAL_P(zv), '\\', 
Z_STRLEN_P(zv));
+ 
+   if (ns_separator != NULL) {
+   ns_separator += 1;
 -  lc_len = Z_STRLEN_P(zv) - (ns_separator - Z_STRVAL_P(zv));
++  lc_len = Z_STRSIZE_P(zv) - (ns_separator - Z_STRVAL_P(zv));
+   lc_name = zend_str_tolower_dup(ns_separator, lc_len);
+   ZVAL_STRINGL(c, lc_name, lc_len, 0);
+   lc_literal = zend_add_literal(CG(active_op_array), c 
TSRMLS_CC);
+   CALCULATE_LITERAL_HASH(lc_literal);
+   }
  
return ret;
  }
@@@ -1703,14 -1725,15 +1725,15 @@@ void zend_do_begin_function_declaration
opline-op1_type = IS_CONST;
build_runtime_defined_function_key(key, lcname, name_len 
TSRMLS_CC);
opline-op1.constant = zend_add_literal(CG(active_op_array), 
key TSRMLS_CC);
 -  Z_HASH_P(CONSTANT(opline-op1.constant)) = 
zend_hash_func(Z_STRVAL(CONSTANT(opline-op1.constant)), 
Z_STRLEN(CONSTANT(opline-op1.constant)));
 +  Z_HASH_P(CONSTANT(opline-op1.constant)) = 
zend_hash_func(Z_STRVAL(CONSTANT(opline-op1.constant)), 
Z_STRSIZE(CONSTANT(opline-op1.constant)));
opline-op2_type = IS_CONST;
-   LITERAL_STRINGL(opline-op2, lcname, name_len, 0);
+   LITERAL_STRINGL(opline-op2, lcname, name_len, 1);
CALCULATE_LITERAL_HASH(opline-op2.constant);
opline-extended_value = ZEND_DECLARE_FUNCTION;
 -  zend_hash_quick_update(CG(function_table), Z_STRVAL(key), 
Z_STRLEN(key), Z_HASH_P(CONSTANT(opline-op1.constant)), op_array, 
sizeof(zend_op_array), (void **) CG(active_op_array));
 +  zend_hash_quick_update(CG(function_table), Z_STRVAL(key), 
Z_STRSIZE(key), Z_HASH_P(CONSTANT(opline-op1.constant)), op_array, 
sizeof(zend_op_array), (void **) CG(active_op_array));
zend_stack_push(CG(context_stack), (void *) CG(context), 
sizeof(CG(context)));
zend_init_compiler_context(TSRMLS_C);
+   str_efree(lcname);
}
  
if (CG(compiler_options)  ZEND_COMPILE_EXTENDED_INFO) {
@@@ -1931,9 -1954,9 +1954,9 @@@ int zend_do_begin_function_call(znode *
  {
zend_function *function;
char *lcname;
 -  char *is_compound = memchr(Z_STRVAL(function_name-u.constant), '\\', 
Z_STRLEN(function_name-u.constant));
 +  char *is_compound = memchr(Z_STRVAL(function_name-u.constant), '\\', 
Z_STRSIZE(function_name-u.constant));
  
-   zend_resolve_non_class_name(function_name, check_namespace TSRMLS_CC);
+   zend_resolve_function_name(function_name, check_namespace TSRMLS_CC);
  
if (check_namespace  CG(current_namespace)  !is_compound) {
/* We assume we call function from the current namespace
@@@ -2070,12 -2093,12 +2093,12 @@@ void zend_do_begin_dynamic_function_cal
  }
  /* }}} */
  
- void zend_resolve_non_class_name(znode *element_name, zend_bool 
check_namespace TSRMLS_DC) /* {{{ */
+ void zend_resolve_non_class_name(znode *element_name, zend_bool 
*check_namespace, zend_bool case_sensitive, HashTable *current_import_sub 
TSRMLS_DC) /* {{{ */
  {
znode tmp;
 -  int len;
 +  zend_str_size len;
zval **ns;
-   char *lcname, *compound = memchr(Z_STRVAL(element_name-u.constant), 
'\\', Z_STRSIZE(element_name-u.constant));
 -  char *lookup_name, *compound = 
memchr(Z_STRVAL(element_name-u.constant), '\\', 
Z_STRLEN(element_name-u.constant));
++  char *lookup_name, *compound = 
memchr(Z_STRVAL(element_name-u.constant

[PHP-CVS] com php-src: Fix typo: ext/openssl/openssl.c

2013-12-09 Thread Anatol Belski
Commit:8710929b78b728c3ef6d09309b7375ae236e78eb
Author:Jakub Zelenka bu...@php.net Mon, 2 Dec 2013 19:54:25 +
Parents:   1488acb3044d1cbac49d8996981307316ff2c108
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=8710929b78b728c3ef6d09309b7375ae236e78eb

Log:
Fix typo

Changed paths:
  M  ext/openssl/openssl.c


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 4fb2758..820e6c4 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -4750,7 +4750,7 @@ PHP_FUNCTION(openssl_sign)
sigbuf = emalloc(siglen + 1);
 
EVP_SignInit(md_ctx, mdtype);
-   EVP_SignUpdate(md_ctx, data, data_len);INT_MAX;
+   EVP_SignUpdate(md_ctx, data, data_len);
if (EVP_SignFinal (md_ctx, sigbuf,(unsigned int *)siglen, pkey)) {
zval_dtor(signature);
sigbuf[siglen] = '\0';


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



[PHP-CVS] com php-src: Add missing overflow checks: ext/openssl/openssl.c

2013-12-09 Thread Anatol Belski
Commit:fbfae33e398c874132ed21dc6ab93a7d8fcbc258
Author:Jakub Zelenka bu...@php.net Wed, 4 Dec 2013 19:01:39 +
Parents:   8710929b78b728c3ef6d09309b7375ae236e78eb
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=fbfae33e398c874132ed21dc6ab93a7d8fcbc258

Log:
Add missing overflow checks

Changed paths:
  M  ext/openssl/openssl.c


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 820e6c4..0a4f932 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -4856,6 +4856,12 @@ PHP_FUNCTION(openssl_seal)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Szza/|S, data, 
data_len, sealdata, ekeys, pubkeys, method, method_len) == FAILURE) {
return;
}
+
+   if (data_len  INT_MAX) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Data is too long; 
it needs to be at most %d bytes, not  ZEND_UINT_FMT,
+   INT_MAX, data_len);
+   RETURN_FALSE;
+   }

pubkeysht = HASH_OF(pubkeys);
nkeys = pubkeysht ? zend_hash_num_elements(pubkeysht) : 0;
@@ -4922,7 +4928,7 @@ PHP_FUNCTION(openssl_seal)
zval_dtor(sealdata);
buf[len1 + len2] = '\0';
buf = erealloc(buf, len1 + len2 + 1);
-   ZVAL_STRINGL(sealdata, (char *)buf, (zend_str_size_int)(len1 + 
len2), 0);
+   ZVAL_STRINGL(sealdata, (char *)buf, len1 + len2, 0);
 
zval_dtor(ekeys);
array_init(ekeys);
@@ -4984,6 +4990,17 @@ PHP_FUNCTION(openssl_open)
return;
}
 
+   if (data_len  INT_MAX) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Data is too long; 
it needs to be at most %d bytes, not  ZEND_UINT_FMT,
+   INT_MAX, data_len);
+   RETURN_FALSE;
+   }
+   if (ekey_len  INT_MAX) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Envelope key is 
too long; it needs to be at most %d bytes, not  ZEND_UINT_FMT,
+   INT_MAX, ekey_len);
+   RETURN_FALSE;
+   }
+
pkey = php_openssl_evp_from_zval(privkey, 0, , 0, keyresource 
TSRMLS_CC);
if (pkey == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, unable to coerce 
parameter 4 into a private key);
@@ -5022,7 +5039,7 @@ PHP_FUNCTION(openssl_open)
}
zval_dtor(opendata);
buf[len1 + len2] = '\0';
-   ZVAL_STRINGL(opendata, erealloc(buf, len1 + len2 + 1), 
(zend_str_size_int)(len1 + len2), 0);
+   ZVAL_STRINGL(opendata, erealloc(buf, len1 + len2 + 1), len1 + len2, 0);
RETURN_TRUE;
 }
 /* }}} */
@@ -5455,7 +5472,7 @@ static zend_bool php_openssl_validate_iv(char **piv, 
zend_str_size_int *piv_len,
 
iv_new = ecalloc(1, iv_required_len + 1);
 
-   if (*piv_len = 0) {
+   if (*piv_len == 0) {
/* BC behavior */
*piv_len = iv_required_len;
*piv = iv_new;
@@ -5494,6 +5511,18 @@ PHP_FUNCTION(openssl_encrypt)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, SSS|iS, data, 
data_len, method, method_len, password, password_len, options, iv, 
iv_len) == FAILURE) {
return;
}
+
+   if (data_len  INT_MAX) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Data is too long; 
it needs to be at most %d bytes, not  ZEND_UINT_FMT,
+   INT_MAX, data_len);
+   RETURN_FALSE;
+   }
+   if (password_len  INT_MAX) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Password is too 
long; it needs to be at most %d bytes, not  ZEND_UINT_FMT,
+   INT_MAX, password_len);
+   RETURN_FALSE;
+   }
+
cipher_type = EVP_get_cipherbyname(method);
if (!cipher_type) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown cipher 
algorithm);
@@ -5509,8 +5538,8 @@ PHP_FUNCTION(openssl_encrypt)
key = (unsigned char*)password;
}
 
-   max_iv_len = (zend_str_size_int)EVP_CIPHER_iv_length(cipher_type);
-   if (iv_len = 0  max_iv_len  0) {
+   max_iv_len = EVP_CIPHER_iv_length(cipher_type);
+   if (iv_len == 0  max_iv_len  0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Using an empty 
Initialization Vector (iv) is potentially insecure and not recommended);
}
free_iv = php_openssl_validate_iv(iv, iv_len, max_iv_len TSRMLS_CC);
@@ -5576,6 +5605,17 @@ PHP_FUNCTION(openssl_decrypt)
return;
}
 
+   if (data_len  INT_MAX) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Data is too long; 
it needs to be at most %d bytes, not  ZEND_UINT_FMT,
+   INT_MAX, data_len);
+   RETURN_FALSE;
+   }
+   if (password_len  INT_MAX) {
+   php_error_docref(NULL 

[PHP-CVS] com php-src: add some overflow checks and use correct msg formatting in openssl: ext/openssl/openssl.c

2013-12-09 Thread Anatol Belski
Commit:b34ce97417ffe7269a340982fe8b0f86983e12e7
Author:Jakub Zelenka bu...@php.net Sun, 1 Dec 2013 19:53:45 +
Parents:   215811e3fdb7b4f2786576851c8687c6249c4725
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=b34ce97417ffe7269a340982fe8b0f86983e12e7

Log:
add some overflow checks and use correct msg formatting in openssl

Changed paths:
  M  ext/openssl/openssl.c

diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index fb11458..2fe8341 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -812,7 +812,7 @@ static int add_oid_section(struct php_x509_request * req 
TSRMLS_DC) /* {{{ */
else \
varname = defval
 
-static const EVP_CIPHER * php_openssl_get_evp_cipher_from_algo(long algo);
+static const EVP_CIPHER * php_openssl_get_evp_cipher_from_algo(php_int_t algo);
 
 int openssl_spki_cleanup(const char *src, char *dest);
 
@@ -1302,6 +1302,9 @@ static X509 * php_openssl_x509_from_zval(zval ** val, int 
makeresource, php_int_
} else {
BIO *in;
 
+   if (Z_STRSIZE_PP(val)  INT_MAX) {
+   return NULL;
+   }
in = BIO_new_mem_buf(Z_STRVAL_PP(val), (int)Z_STRSIZE_PP(val));
if (in == NULL) {
return NULL;
@@ -1417,6 +1420,11 @@ PHP_FUNCTION(openssl_spki_new)
}
 
if (challenge) {
+   if (challenge_len  INT_MAX) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Challenge 
is too long; it needs to be at most %d bytes, not  ZEND_UINT_FMT,
+   INT_MAX, challenge_len);
+   goto cleanup;
+   }
ASN1_STRING_set(spki-spkac-challenge, challenge, 
(int)challenge_len);
}
 
@@ -1468,8 +1476,8 @@ cleanup:
Verifies spki returns boolean */
 PHP_FUNCTION(openssl_spki_verify)
 {
-   int i = 0;
zend_str_size_int spkstr_len;
+   int i = 0;
char *spkstr = NULL, * spkstr_cleaned = NULL;
 
EVP_PKEY *pkey = NULL;
@@ -2289,7 +2297,7 @@ static STACK_OF(X509) * php_array_to_X509_sk(zval ** 
zcerts TSRMLS_DC) /* {{{ */
HashPosition hpos;
zval ** zcertval;
STACK_OF(X509) * sk = NULL;
-X509 * cert;
+   X509 * cert;
php_int_t certresource;
 
sk = sk_X509_new_null();
@@ -2790,6 +2798,8 @@ static X509_REQ * php_openssl_csr_from_zval(zval ** val, 
int makeresource, php_i
return NULL;
}
in = BIO_new_file(filename, r);
+   } else if (Z_STRSIZE_PP(val)  INT_MAX) {
+   return NULL;
} else {
in = BIO_new_mem_buf(Z_STRVAL_PP(val), (int)Z_STRSIZE_PP(val));
}
@@ -2964,6 +2974,10 @@ PHP_FUNCTION(openssl_csr_sign)
if (!X509_set_version(new_cert, 2))
goto cleanup;
 
+   if (serial  LONG_MAX) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, The serial number 
is too high);
+   goto cleanup;
+   }
ASN1_INTEGER_set(X509_get_serialNumber(new_cert), (long)serial);

X509_set_subject_name(new_cert, X509_REQ_get_subject_name(csr));
@@ -2975,6 +2989,11 @@ PHP_FUNCTION(openssl_csr_sign)
goto cleanup;
}
X509_gmtime_adj(X509_get_notBefore(new_cert), 0);
+   if (num_days  (LONG_MAX / (60*60*24 + 1))) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, The number of days 
is too high; expected at most %ld days, not  ZEND_INT_FMT,
+   LONG_MAX / (60*60*24 + 1), num_days);
+   goto cleanup;
+   }
X509_gmtime_adj(X509_get_notAfter(new_cert), 
(long)60*60*24*(long)num_days);
i = X509_set_pubkey(new_cert, key);
if (!i) {
@@ -3287,6 +3306,8 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, 
int public_key, char *
BIO* in;
if (filename) {
in = BIO_new_file(filename, r);
+   } else if (Z_STRSIZE_PP(val)  INT_MAX) {
+   TMP_CLEAN;
} else {
in = BIO_new_mem_buf(Z_STRVAL_PP(val), 
(int)Z_STRSIZE_PP(val));
}
@@ -3305,6 +3326,8 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, 
int public_key, char *
TMP_CLEAN;
}
in = BIO_new_file(filename, r);
+   } else if (Z_STRSIZE_PP(val)  INT_MAX) {
+   TMP_CLEAN;
} else {
in = BIO_new_mem_buf(Z_STRVAL_PP(val), 
(int)Z_STRSIZE_PP(val));
}
@@ -3343,10 +3366,15 @@ static EVP_PKEY * 

[PHP-CVS] com php-src: fixes to rand: ext/standard/php_rand.h ext/standard/rand.c

2013-12-06 Thread Anatol Belski
Commit:0494cf46cfc09ae27cd555a339baca2695207126
Author:Anatol Belski a...@php.net Fri, 6 Dec 2013 22:12:28 +0100
Parents:   8b7a8aff1349051221df2769da4948765b904da7
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=0494cf46cfc09ae27cd555a339baca2695207126

Log:
fixes to rand

Changed paths:
  M  ext/standard/php_rand.h
  M  ext/standard/rand.c


Diff:
diff --git a/ext/standard/php_rand.h b/ext/standard/php_rand.h
index e831f32..336b986 100644
--- a/ext/standard/php_rand.h
+++ b/ext/standard/php_rand.h
@@ -41,19 +41,19 @@
 #endif
 
 #define RAND_RANGE(__n, __min, __max, __tmax) \
-(__n) = (__min) + (long) ((double) ( (double) (__max) - (__min) + 1.0) * 
((__n) / ((__tmax) + 1.0)))
+(__n) = (__min) + (php_int_t) ((double) ( (double) (__max) - (__min) + 
1.0) * ((__n) / ((__tmax) + 1.0)))
 
 /* MT Rand */
-#define PHP_MT_RAND_MAX ((long) (0x7FFF)) /* (131) - 1 */ 
+#define PHP_MT_RAND_MAX ((php_int_t) (0x7FFF)) /* (131) - 1 */ 
 
 #ifdef PHP_WIN32
-#define GENERATE_SEED() (((long) (time(0) * GetCurrentProcessId())) ^ ((long) 
(100.0 * php_combined_lcg(TSRMLS_C
+#define GENERATE_SEED() (((php_int_t) (time(0) * GetCurrentProcessId())) ^ 
((php_int_t) (100.0 * php_combined_lcg(TSRMLS_C
 #else
-#define GENERATE_SEED() (((long) (time(0) * getpid())) ^ ((long) (100.0 * 
php_combined_lcg(TSRMLS_C
+#define GENERATE_SEED() (((php_int_t) (time(0) * getpid())) ^ ((php_int_t) 
(100.0 * php_combined_lcg(TSRMLS_C
 #endif
 
-PHPAPI void php_srand(long seed TSRMLS_DC);
-PHPAPI long php_rand(TSRMLS_D);
+PHPAPI void php_srand(php_int_t seed TSRMLS_DC);
+PHPAPI php_int_t php_rand(TSRMLS_D);
 PHPAPI void php_mt_srand(php_uint32 seed TSRMLS_DC);
 PHPAPI php_uint32 php_mt_rand(TSRMLS_D);
 
diff --git a/ext/standard/rand.c b/ext/standard/rand.c
index fbaafe8..086a2e8 100644
--- a/ext/standard/rand.c
+++ b/ext/standard/rand.c
@@ -39,7 +39,7 @@
 
 /* {{{ php_srand
  */
-PHPAPI void php_srand(long seed TSRMLS_DC)
+PHPAPI void php_srand(php_int_t seed TSRMLS_DC)
 {
 #ifdef ZTS
BG(rand_seed) = (unsigned int) seed;
@@ -60,9 +60,9 @@ PHPAPI void php_srand(long seed TSRMLS_DC)
 
 /* {{{ php_rand
  */
-PHPAPI long php_rand(TSRMLS_D)
+PHPAPI php_int_t php_rand(TSRMLS_D)
 {
-   long ret;
+   php_int_t ret;
 
if (!BG(rand_is_seeded)) {
php_srand(GENERATE_SEED() TSRMLS_CC);


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



[PHP-CVS] com php-src: added range check for pcre ini entries: ext/pcre/php_pcre.c ext/pcre/php_pcre.h

2013-12-05 Thread Anatol Belski
Commit:4d703a4225977b0c6abb2f88c2fe56732d6452a1
Author:Anatol Belski a...@php.net Thu, 5 Dec 2013 12:08:19 +0100
Parents:   a0622d7c68f3b55068053aaa089f854ec59cb698
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=4d703a4225977b0c6abb2f88c2fe56732d6452a1

Log:
added range check for pcre ini entries

Changed paths:
  M  ext/pcre/php_pcre.c
  M  ext/pcre/php_pcre.h


Diff:
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 3daa8e8..05dad38 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -114,9 +114,41 @@ static PHP_GSHUTDOWN_FUNCTION(pcre) /* {{{ */
 }
 /* }}} */
 
+static PHP_INI_MH(OnChangeBacktrackLimit)
+{/*{{{*/
+   php_int_t i;
+
+   ZEND_ATOI(i, new_value);
+
+   if (i  (unsigned long)-1) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Value '%pd' is too 
big for pcre.backtrack_limit, i);
+   return FAILURE;
+   }
+
+   PCRE_G(backtrack_limit) = i;
+
+   return SUCCESS;
+}/*}}}*/
+
+static PHP_INI_MH(OnChangeRecursionLimit)
+{/*{{{*/
+   php_int_t i;
+
+   ZEND_ATOI(i, new_value);
+
+   if (i  (unsigned long)-1) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Value '%pd' is too 
big for pcre.recursion_limit, i);
+   return FAILURE;
+   }
+
+   PCRE_G(recursion_limit) = i;
+
+   return SUCCESS;
+}/*}}}*/
+
 PHP_INI_BEGIN()
-   STD_PHP_INI_ENTRY(pcre.backtrack_limit, 100, PHP_INI_ALL, 
OnUpdateLong, backtrack_limit, zend_pcre_globals, pcre_globals)
-   STD_PHP_INI_ENTRY(pcre.recursion_limit, 10, PHP_INI_ALL, 
OnUpdateLong, recursion_limit, zend_pcre_globals, pcre_globals)
+   PHP_INI_ENTRY(pcre.backtrack_limit, 100, PHP_INI_ALL, 
OnChangeBacktrackLimit)
+   PHP_INI_ENTRY(pcre.recursion_limit, 10, PHP_INI_ALL, 
OnChangeRecursionLimit)
 PHP_INI_END()
 
 
diff --git a/ext/pcre/php_pcre.h b/ext/pcre/php_pcre.h
index 5a94360..26d2756 100644
--- a/ext/pcre/php_pcre.h
+++ b/ext/pcre/php_pcre.h
@@ -68,8 +68,8 @@ PHPAPI void  php_pcre_grep_impl(   pcre_cache_entry *pce, 
zval *input, zval *ret
 
 ZEND_BEGIN_MODULE_GLOBALS(pcre)
HashTable pcre_cache;
-   long backtrack_limit;
-   long recursion_limit;
+   php_int_t backtrack_limit;
+   php_int_t recursion_limit;
int  error_code;
 ZEND_END_MODULE_GLOBALS(pcre)


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



[PHP-CVS] com php-src: integrated %pd into more ported extensions: ext/calendar/calendar.c ext/mysqli/mysqli_api.c ext/mysqli/mysqli_nonapi.c ext/mysqlnd/mysqlnd_bt.c ext/mysqlnd/mysqlnd_wireprotocol.

2013-12-05 Thread Anatol Belski
Commit:adb1e38468dcd50219c594ff2f71bb4d27ee01a4
Author:Anatol Belski a...@php.net Thu, 5 Dec 2013 14:35:06 +0100
Parents:   e8815370891e94de8a88af9e656a82eed968c084
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=adb1e38468dcd50219c594ff2f71bb4d27ee01a4

Log:
integrated %pd into more ported extensions

Changed paths:
  M  ext/calendar/calendar.c
  M  ext/mysqli/mysqli_api.c
  M  ext/mysqli/mysqli_nonapi.c
  M  ext/mysqlnd/mysqlnd_bt.c
  M  ext/mysqlnd/mysqlnd_wireprotocol.c
  M  ext/mysqlnd/php_mysqlnd.c
  M  ext/odbc/php_odbc.c
  M  ext/odbc/tests/config.inc
  M  ext/opcache/zend_accelerator_module.c
  M  ext/opcache/zend_shared_alloc.c
  M  ext/pdo/pdo_dbh.c
  M  ext/pdo/pdo_stmt.c
  M  ext/pdo_pgsql/pgsql_driver.c
  M  ext/pdo_pgsql/pgsql_statement.c
  M  ext/pgsql/tests/config.inc
  M  ext/phar/func_interceptors.c
  M  ext/simplexml/simplexml.c
  M  ext/snmp/snmp.c
  M  ext/soap/php_encoding.c
  M  ext/soap/php_http.c
  M  ext/soap/soap.c
  M  ext/sockets/conversions.c
  M  ext/sockets/multicast.c
  M  ext/sockets/sendrecvmsg.c
  M  ext/sockets/sockets.c
  M  ext/standard/math.c
  M  ext/standard/metaphone.c
  M  ext/wddx/wddx.c
  M  ext/xmlrpc/xmlrpc-epi-php.c
  M  ext/zip/php_zip.c
  M  ext/zlib/zlib_filter.c

diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c
index efdc58e..be9e73c 100644
--- a/ext/calendar/calendar.c
+++ b/ext/calendar/calendar.c
@@ -313,7 +313,7 @@ PHP_FUNCTION(cal_info)
 
 
if (cal != -1  (cal  0 || cal = CAL_NUM_CALS)) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid calendar 
ID %ld., cal);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid calendar 
ID %pd., cal);
RETURN_FALSE;
}
 
@@ -335,7 +335,7 @@ PHP_FUNCTION(cal_days_in_month)
}
 
if (cal  0 || cal = CAL_NUM_CALS) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid calendar 
ID %ld., cal);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid calendar 
ID %pd., cal);
RETURN_FALSE;
}
 
@@ -377,7 +377,7 @@ PHP_FUNCTION(cal_to_jd)
}
 
if (cal  0 || cal = CAL_NUM_CALS) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid calendar 
ID %ld., cal);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid calendar 
ID %pd., cal);
RETURN_FALSE;
}
 
@@ -399,7 +399,7 @@ PHP_FUNCTION(cal_from_jd)
}
 
if (cal  0 || cal = CAL_NUM_CALS) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid calendar 
ID %ld, cal);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid calendar 
ID %pd, cal);
RETURN_FALSE;
}
calendar = cal_conversion_table[cal];
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 0722c78..b78fc29 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -2303,7 +2303,7 @@ PHP_FUNCTION(mysqli_stmt_attr_set)
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
 
if (mode_in  0) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, mode should be 
non-negative, %ld passed, mode_in);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, mode should be 
non-negative, %pd passed, mode_in);
RETURN_FALSE;
}
 
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c
index 525f4f4..e409e25 100644
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -202,14 +202,14 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, 
zend_bool is_real_conne
}
}
if (MyG(max_links) != -1  MyG(num_links) = MyG(max_links)) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Too many open 
links (%ld), MyG(num_links));
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Too many open 
links (%pd), MyG(num_links));
goto err;
}
 
if (persistent  MyG(max_persistent) != -1 
(MyG(num_active_persistent) + MyG(num_inactive_persistent))= 
MyG(max_persistent))
{
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Too many open 
persistent links (%ld),
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Too many open 
persistent links (%pd),

MyG(num_active_persistent) + MyG(num_inactive_persistent));
goto err;
}
@@ -1108,7 +1108,7 @@ PHP_FUNCTION(mysqli_begin_transaction)
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
if (flags  0) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid value for 
parameter flags (%ld), flags);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid value for 
parameter flags (%pd), flags);
err = TRUE;
}
if (!name_len) {
diff --git

[PHP-CVS] com php-src: Merge branch 'master' into str_size_and_int64: ext/mysqli/mysqli_nonapi.c ext/mysqlnd/mysqlnd.c ext/mysqlnd/mysqlnd.h main/main.c

2013-12-05 Thread Anatol Belski
Commit:42b122275475b2dee809aeb0205340c3df3d4b42
Author:Anatol Belski a...@php.net Thu, 5 Dec 2013 08:37:37 +0100
Parents:   7228ac190a9d703f43fb57b6d6b395ab38e96ac0 
de3b9bc77c046625f743d556854eccfdddf5bf23
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=42b122275475b2dee809aeb0205340c3df3d4b42

Log:
Merge branch 'master' into str_size_and_int64

Changed paths:
  MM  ext/mysqli/mysqli_nonapi.c
  MM  ext/mysqlnd/mysqlnd.c
  MM  ext/mysqlnd/mysqlnd.h
  MM  main/main.c


Diff:
diff --cc ext/mysqli/mysqli_nonapi.c
index 26a7276,b5630c3..525f4f4
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@@ -773,11 -773,11 +773,11 @@@ PHP_FUNCTION(mysqli_poll
  {
zval*r_array, *e_array, *dont_poll_array;
MYSQLND **new_r_array = NULL, **new_e_array = NULL, 
**new_dont_poll_array = NULL;
 -  longsec = 0, usec = 0;
 +  php_int_t   sec = 0, usec = 0;
enum_func_status ret;
-   uintdesc_num;
+   int desc_num;
  
 -  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, a!a!al|l, 
r_array, e_array, dont_poll_array, sec, usec) == FAILURE) {
 +  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, a!a!ai|i, 
r_array, e_array, dont_poll_array, sec, usec) == FAILURE) {
return;
}
if (sec  0 || usec  0) {


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



[PHP-CVS] com php-src: implemented %pd format for snprintf and spprintf: main/snprintf.c main/snprintf.h main/spprintf.c

2013-12-05 Thread Anatol Belski
Commit:a0622d7c68f3b55068053aaa089f854ec59cb698
Author:Anatol Belski a...@php.net Thu, 5 Dec 2013 12:05:46 +0100
Parents:   42b122275475b2dee809aeb0205340c3df3d4b42
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=a0622d7c68f3b55068053aaa089f854ec59cb698

Log:
implemented %pd format for snprintf and spprintf

php_int_t var = 42;
php_printf(%pd, var);

Changed paths:
  M  main/snprintf.c
  M  main/snprintf.h
  M  main/spprintf.c


Diff:
diff --git a/main/snprintf.c b/main/snprintf.c
index 26f66ca..2deb9a5 100644
--- a/main/snprintf.c
+++ b/main/snprintf.c
@@ -759,6 +759,10 @@ static int format_converter(register buffy * odp, const 
char *fmt, va_list ap) /
modifier = LM_SIZE_T;
 #endif
break;
+   case 'p':
+   fmt++;
+   modifier = LM_PHP_INT_T;
+   break;
case 'h':
fmt++;
if (*fmt == 'h') {
@@ -822,6 +826,9 @@ static int format_converter(register buffy * odp, const 
char *fmt, va_list ap) /
i_num = (wide_int) 
va_arg(ap, ptrdiff_t);
break;
 #endif
+   case LM_PHP_INT_T:
+   i_num = (wide_int) 
va_arg(ap, php_uint_t);
+   break;
}
/*
 * The rest also applies to other 
integer formats, so fall
@@ -864,6 +871,9 @@ static int format_converter(register buffy * odp, const 
char *fmt, va_list ap) /
i_num = 
(wide_int) va_arg(ap, ptrdiff_t);
break;
 #endif
+   case LM_PHP_INT_T:
+   i_num = 
(wide_int) va_arg(ap, php_int_t);
+   break;
}
}
s = ap_php_conv_10(i_num, (*fmt) == 
'u', is_negative,
@@ -910,6 +920,9 @@ static int format_converter(register buffy * odp, const 
char *fmt, va_list ap) /
ui_num = (u_wide_int) 
va_arg(ap, ptrdiff_t);
break;
 #endif
+   case LM_PHP_INT_T:
+   ui_num = (u_wide_int) 
va_arg(ap, php_uint_t);
+   break;
}
s = ap_php_conv_p2(ui_num, 3, *fmt, 
num_buf[NUM_BUF_SIZE], s_len);
FIX_PRECISION(adjust_precision, 
precision, s, s_len);
@@ -949,6 +962,9 @@ static int format_converter(register buffy * odp, const 
char *fmt, va_list ap) /
ui_num = (u_wide_int) 
va_arg(ap, ptrdiff_t);
break;
 #endif
+   case LM_PHP_INT_T:
+   ui_num = (u_wide_int) 
va_arg(ap, php_uint_t);
+   break;
}
s = ap_php_conv_p2(ui_num, 4, *fmt, 
num_buf[NUM_BUF_SIZE], s_len);
FIX_PRECISION(adjust_precision, 
precision, s, s_len);
diff --git a/main/snprintf.h b/main/snprintf.h
index 88dbdf8..d63ddaf 100644
--- a/main/snprintf.h
+++ b/main/snprintf.h
@@ -137,7 +137,8 @@ typedef enum {
 #endif
LM_SIZE_T,
LM_LONG,
-   LM_LONG_DOUBLE
+   LM_LONG_DOUBLE,
+   LM_PHP_INT_T
 } length_modifier_e;
 
 #ifdef PHP_WIN32
diff --git a/main/spprintf.c b/main/spprintf.c
index db77cc8..3273a31 100644
--- a/main/spprintf.c
+++ b/main/spprintf.c
@@ -367,6 +367,10 @@ static void xbuf_format_converter(smart_str *xbuf, const 
char *fmt, va_list ap)
modifier = LM_SIZE_T;
 #endif
break;
+   case 'p':
+   fmt++;
+   modifier = LM_PHP_INT_T;
+   break;
case

[PHP-CVS] com php-src: basic fixes to ext/ftp: ext/ftp/ftp.c ext/ftp/ftp.h ext/ftp/php_ftp.c

2013-12-03 Thread Anatol Belski
Commit:727d14b8dd1423ec51096028ef7310fc996a7a23
Author:Anatol Belski a...@php.net Tue, 3 Dec 2013 12:09:12 +0100
Parents:   b13e715581fb7ced41bc19e16638ab677d82e973
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=727d14b8dd1423ec51096028ef7310fc996a7a23

Log:
basic fixes to ext/ftp

Changed paths:
  M  ext/ftp/ftp.c
  M  ext/ftp/ftp.h
  M  ext/ftp/php_ftp.c

diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c
index 30b3ba6..db90a81 100644
--- a/ext/ftp/ftp.c
+++ b/ext/ftp/ftp.c
@@ -121,7 +121,7 @@ union ipbox {
 /* {{{ ftp_open
  */
 ftpbuf_t*
-ftp_open(const char *host, short port, long timeout_sec TSRMLS_DC)
+ftp_open(const char *host, short port, php_int_t timeout_sec TSRMLS_DC)
 {
ftpbuf_t*ftp;
socklen_tsize;
@@ -244,7 +244,7 @@ ftp_login(ftpbuf_t *ftp, const char *user, const char *pass 
TSRMLS_DC)
 {
 #if HAVE_OPENSSL_EXT
SSL_CTX *ctx = NULL;
-   long ssl_ctx_options = SSL_OP_ALL;
+   php_int_t ssl_ctx_options = SSL_OP_ALL;
 #endif
if (ftp == NULL) {
return 0;
@@ -584,7 +584,7 @@ ftp_rmdir(ftpbuf_t *ftp, const char *dir)
 /* {{{ ftp_chmod
  */
 int
-ftp_chmod(ftpbuf_t *ftp, const int mode, const char *filename, const int 
filename_len)
+ftp_chmod(ftpbuf_t *ftp, const int mode, const char *filename, const 
zend_str_size_int filename_len)
 {
char *buffer;
 
@@ -612,7 +612,7 @@ ftp_chmod(ftpbuf_t *ftp, const int mode, const char 
*filename, const int filenam
 /* {{{ ftp_alloc
  */
 int
-ftp_alloc(ftpbuf_t *ftp, const long size, char **response)
+ftp_alloc(ftpbuf_t *ftp, const php_int_t size, char **response)
 {
char buffer[64];
 
@@ -787,7 +787,7 @@ ftp_pasv(ftpbuf_t *ftp, int pasv)
 /* {{{ ftp_get
  */
 int
-ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t 
type, long resumepos TSRMLS_DC)
+ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t 
type, php_int_t resumepos TSRMLS_DC)
 {
databuf_t   *data = NULL;
size_t  rcvd;
@@ -879,10 +879,10 @@ bail:
 /* {{{ ftp_put
  */
 int
-ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, 
long startpos TSRMLS_DC)
+ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, 
php_int_t startpos TSRMLS_DC)
 {
databuf_t   *data = NULL;
-   longsize;
+   php_int_t   size;
char*ptr;
int ch;
chararg[11];
@@ -956,7 +956,7 @@ bail:
 
 /* {{{ ftp_size
  */
-long
+php_int_t
 ftp_size(ftpbuf_t *ftp, const char *path)
 {
if (ftp == NULL) {
@@ -1223,7 +1223,7 @@ ftp_getresp(ftpbuf_t *ftp)
 int
 my_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len)
 {
-   longsize, sent;
+   php_int_t   size, sent;
 int n;
 
size = len;
@@ -1489,7 +1489,7 @@ data_accept(databuf_t *data, ftpbuf_t *ftp TSRMLS_DC)
 
 #if HAVE_OPENSSL_EXT
SSL_CTX *ctx;
-   long ssl_ctx_options = SSL_OP_ALL;
+   php_int_t ssl_ctx_options = SSL_OP_ALL;
 #endif
 
if (data-fd != -1) {
@@ -1707,7 +1707,7 @@ bail:
 /* {{{ ftp_nb_get
  */
 int
-ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t 
type, long resumepos TSRMLS_DC)
+ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t 
type, php_int_t resumepos TSRMLS_DC)
 {
databuf_t   *data = NULL;
chararg[11];
@@ -1824,7 +1824,7 @@ bail:
 /* {{{ ftp_nb_put
  */
 int
-ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t 
type, long startpos TSRMLS_DC)
+ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t 
type, php_int_t startpos TSRMLS_DC)
 {
databuf_t   *data = NULL;
chararg[11];
diff --git a/ext/ftp/ftp.h b/ext/ftp/ftp.h
index 69de7db..db84436 100644
--- a/ext/ftp/ftp.h
+++ b/ext/ftp/ftp.h
@@ -69,7 +69,7 @@ typedef struct ftpbuf
ftptype_t   type;   /* current transfer type */
int pasv;   /* 0=off; 1=pasv; 2=ready */
php_sockaddr_storagepasvaddr;   /* passive mode address */
-   longtimeout_sec;/* User configureable timeout (seconds) */
+   php_int_t   timeout_sec;/* User configureable timeout (seconds) 
*/
int autoseek;   /* User configureable autoseek 
flag */
 
int nb; /* nonblocking 
transfer in progress */
@@ -93,7 +93,7 @@ typedef struct ftpbuf
 /* open a FTP connection, returns ftpbuf (NULL on error)
  * port is the ftp port in network byte order, or 0 for the default
  */
-ftpbuf_t*  ftp_open(const char *host, short port, long timeout_sec 
TSRMLS_DC

[PHP-CVS] com php-src: basic fixes to ext/pdo_pgsql: ext/pdo_pgsql/pgsql_driver.c ext/pdo_pgsql/pgsql_statement.c ext/pdo_pgsql/php_pdo_pgsql_int.h

2013-12-03 Thread Anatol Belski
Commit:e23b051be0fe19e338a71eecc0df44afdc44a84e
Author:Anatol Belski a...@php.net Tue, 3 Dec 2013 09:53:22 +0100
Parents:   7193efebed2bef8f79770dc43fd6b1dbfd0fdecc
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=e23b051be0fe19e338a71eecc0df44afdc44a84e

Log:
basic fixes to ext/pdo_pgsql

Changed paths:
  M  ext/pdo_pgsql/pgsql_driver.c
  M  ext/pdo_pgsql/pgsql_statement.c
  M  ext/pdo_pgsql/php_pdo_pgsql_int.h

diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c
index cb89809..8bcabc2 100644
--- a/ext/pdo_pgsql/pgsql_driver.c
+++ b/ext/pdo_pgsql/pgsql_driver.c
@@ -152,8 +152,8 @@ static int pgsql_lob_flush(php_stream *stream TSRMLS_DC)
return 0;
 }
 
-static int pgsql_lob_seek(php_stream *stream, off_t offset, int whence,
-   off_t *newoffset TSRMLS_DC)
+static int pgsql_lob_seek(php_stream *stream, zend_off_t offset, int whence,
+   zend_off_t *newoffset TSRMLS_DC)
 {
struct pdo_pgsql_lob_self *self = (struct 
pdo_pgsql_lob_self*)stream-abstract;
int pos = lo_lseek(self-conn, self-lfd, offset, whence);
@@ -215,7 +215,7 @@ static int pgsql_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* 
{{{ */
 }
 /* }}} */
 
-static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, long 
sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, 
zend_str_size sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
 {
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh-driver_data;
pdo_pgsql_stmt *S = ecalloc(1, sizeof(pdo_pgsql_stmt));
@@ -223,7 +223,7 @@ static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char 
*sql, long sql_len,
 #if HAVE_PQPREPARE
int ret;
char *nsql = NULL;
-   int nsql_len = 0;
+   zend_str_size_int nsql_len = 0;
int emulate = 0;
 #endif
 
@@ -285,11 +285,11 @@ static int pgsql_handle_preparer(pdo_dbh_t *dbh, const 
char *sql, long sql_len,
return 1;
 }
 
-static long pgsql_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len 
TSRMLS_DC)
+static php_int_t pgsql_handle_doer(pdo_dbh_t *dbh, const char *sql, 
zend_str_size sql_len TSRMLS_DC)
 {
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh-driver_data;
PGresult *res;
-   long ret = 1;
+   php_int_t ret = 1;
ExecStatusType qs;

if (!(res = PQexec(H-server, sql))) {
@@ -304,13 +304,17 @@ static long pgsql_handle_doer(pdo_dbh_t *dbh, const char 
*sql, long sql_len TSRM
return -1;
}
H-pgoid = PQoidValue(res);
-   ret = (qs == PGRES_COMMAND_OK) ? atol(PQcmdTuples(res)) : 0L;
+   if (qs == PGRES_COMMAND_OK) {
+   ZEND_ATOI(ret, PQcmdTuples(res));
+   } else {
+   ret = 0L;
+   }
PQclear(res);
 
return ret;
 }
 
-static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int 
unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype 
TSRMLS_DC)
+static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, 
zend_str_size_int unquotedlen, char **quoted, zend_str_size_int *quotedlen, 
enum pdo_param_type paramtype TSRMLS_DC)
 {
unsigned char *escaped;
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh-driver_data;
@@ -347,7 +351,7 @@ static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char 
*unquoted, int unquote
return 1;
 }
 
-static char *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const char *name, 
unsigned int *len TSRMLS_DC)
+static char *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const char *name, 
zend_str_size_uint *len TSRMLS_DC)
 {
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh-driver_data;
char *id = NULL;
@@ -356,7 +360,7 @@ static char *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const 
char *name, unsigned
if (H-pgoid == InvalidOid) {
return NULL;
}
-   *len = spprintf(id, 0, %ld, (long) H-pgoid);
+   *len = spprintf(id, 0, ZEND_INT_FMT, (php_int_t) H-pgoid);
} else {
PGresult *res;
ExecStatusType status;
@@ -379,7 +383,7 @@ static char *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const 
char *name, unsigned
return id;
 }
 
-static int pdo_pgsql_get_attribute(pdo_dbh_t *dbh, long attr, zval 
*return_value TSRMLS_DC)
+static int pdo_pgsql_get_attribute(pdo_dbh_t *dbh, php_int_t attr, zval 
*return_value TSRMLS_DC)
 {
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh-driver_data;
 
@@ -521,13 +525,13 @@ static PHP_METHOD(PDO, pgsqlCopyFromArray)
zval *pg_rows;
 
char *table_name, *pg_delim = NULL, *pg_null_as = NULL, *pg_fields = 
NULL;
-   int table_name_len, pg_delim_len = 0, pg_null_as_len = 0, pg_fields_len;
+   zend_str_size_int table_name_len, pg_delim_len = 0, pg_null_as_len = 0, 
pg_fields_len;
char

[PHP-CVS] com php-src: basic fixes to ext/pdo_mysql: ext/pdo_mysql/mysql_driver.c ext/pdo_mysql/mysql_statement.c ext/pdo_mysql/pdo_mysql.c ext/pdo_mysql/php_pdo_mysql_int.h

2013-12-03 Thread Anatol Belski
Commit:b13e715581fb7ced41bc19e16638ab677d82e973
Author:Anatol Belski a...@php.net Tue, 3 Dec 2013 11:44:18 +0100
Parents:   0ee45382cdcab259494f941d9719647b83ccb3dc
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=b13e715581fb7ced41bc19e16638ab677d82e973

Log:
basic fixes to ext/pdo_mysql

Changed paths:
  M  ext/pdo_mysql/mysql_driver.c
  M  ext/pdo_mysql/mysql_statement.c
  M  ext/pdo_mysql/pdo_mysql.c
  M  ext/pdo_mysql/php_pdo_mysql_int.h

diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c
index cd86503..f97dbd2 100644
--- a/ext/pdo_mysql/mysql_driver.c
+++ b/ext/pdo_mysql/mysql_driver.c
@@ -161,12 +161,12 @@ static int mysql_handle_closer(pdo_dbh_t *dbh TSRMLS_DC)
 /* }}} */
 
 /* {{{ mysql_handle_preparer */
-static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, long 
sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, 
zend_str_size sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
 {
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh-driver_data;
pdo_mysql_stmt *S = ecalloc(1, sizeof(pdo_mysql_stmt));
char *nsql = NULL;
-   int nsql_len = 0;
+   zend_str_size_int nsql_len = 0;
int ret;
int server_version;

@@ -235,7 +235,7 @@ static int mysql_handle_preparer(pdo_dbh_t *dbh, const char 
*sql, long sql_len,
 #else
S-params = ecalloc(S-num_params, sizeof(MYSQL_BIND));
S-in_null = ecalloc(S-num_params, sizeof(my_bool));
-   S-in_length = ecalloc(S-num_params, sizeof(unsigned long));
+   S-in_length = ecalloc(S-num_params, sizeof(php_uint_t));
 #endif
}
dbh-alloc_own_columns = 1;
@@ -253,7 +253,7 @@ end:
 /* }}} */
 
 /* {{{ mysql_handle_doer */
-static long mysql_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len 
TSRMLS_DC)
+static php_int_t mysql_handle_doer(pdo_dbh_t *dbh, const char *sql, 
zend_str_size sql_len TSRMLS_DC)
 {
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh-driver_data;
PDO_DBG_ENTER(mysql_handle_doer);
@@ -288,7 +288,7 @@ static long mysql_handle_doer(pdo_dbh_t *dbh, const char 
*sql, long sql_len TSRM
 /* }}} */
 
 /* {{{ pdo_mysql_last_insert_id */
-static char *pdo_mysql_last_insert_id(pdo_dbh_t *dbh, const char *name, 
unsigned int *len TSRMLS_DC)
+static char *pdo_mysql_last_insert_id(pdo_dbh_t *dbh, const char *name, 
zend_str_size_uint *len TSRMLS_DC)
 {
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh-driver_data;
char *id = php_pdo_int64_to_str(mysql_insert_id(H-server) TSRMLS_CC);
@@ -299,7 +299,7 @@ static char *pdo_mysql_last_insert_id(pdo_dbh_t *dbh, const 
char *name, unsigned
 /* }}} */
 
 /* {{{ mysql_handle_quoter */
-static int mysql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int 
unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype  
TSRMLS_DC)
+static int mysql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, 
zend_str_size_int unquotedlen, char **quoted, zend_str_size_int *quotedlen, 
enum pdo_param_type paramtype  TSRMLS_DC)
 {
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh-driver_data;
PDO_DBG_ENTER(mysql_handle_quoter);
@@ -368,7 +368,7 @@ static inline int mysql_handle_autocommit(pdo_dbh_t *dbh 
TSRMLS_DC)
 /* }}} */
 
 /* {{{ pdo_mysql_set_attribute */
-static int pdo_mysql_set_attribute(pdo_dbh_t *dbh, long attr, zval *val 
TSRMLS_DC)
+static int pdo_mysql_set_attribute(pdo_dbh_t *dbh, php_int_t attr, zval *val 
TSRMLS_DC)
 {
PDO_DBG_ENTER(pdo_mysql_set_attribute);
PDO_DBG_INF_FMT(dbh=%p, dbh);
@@ -414,7 +414,7 @@ static int pdo_mysql_set_attribute(pdo_dbh_t *dbh, long 
attr, zval *val TSRMLS_D
 /* }}} */
 
 /* {{{ pdo_mysql_get_attribute */
-static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, long attr, zval 
*return_value TSRMLS_DC)
+static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, php_int_t attr, zval 
*return_value TSRMLS_DC)
 {
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh-driver_data;
 
@@ -557,8 +557,8 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval 
*driver_options TSRMLS_
;
 
 #if defined(PDO_USE_MYSQLND)
-   int dbname_len = 0;
-   int password_len = 0;
+   zend_str_size_int dbname_len = 0;
+   zend_str_size_int password_len = 0;
 #endif
PDO_DBG_ENTER(pdo_mysql_handle_factory);
PDO_DBG_INF_FMT(dbh=%p, dbh);
@@ -591,13 +591,13 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval 
*driver_options TSRMLS_
 
/* handle MySQL options */
if (driver_options) {
-   long connect_timeout = pdo_attr_lval(driver_options, 
PDO_ATTR_TIMEOUT, 30 TSRMLS_CC);
-   long local_infile = pdo_attr_lval(driver_options, 
PDO_MYSQL_ATTR_LOCAL_INFILE, 0 TSRMLS_CC);
+   php_int_t connect_timeout = pdo_attr_lval(driver_options

[PHP-CVS] com php-src: basic fixes to ext/pdo_sqlite: ext/pdo_sqlite/sqlite_driver.c ext/pdo_sqlite/sqlite_statement.c

2013-12-03 Thread Anatol Belski
Commit:7193efebed2bef8f79770dc43fd6b1dbfd0fdecc
Author:Anatol Belski a...@php.net Tue, 3 Dec 2013 09:51:01 +0100
Parents:   da7d62ea8aaf3f6f2d435df43591161e85cfc746
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=7193efebed2bef8f79770dc43fd6b1dbfd0fdecc

Log:
basic fixes to ext/pdo_sqlite

Changed paths:
  M  ext/pdo_sqlite/sqlite_driver.c
  M  ext/pdo_sqlite/sqlite_statement.c


Diff:
diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c
index 0f4a245..ffa882c 100644
--- a/ext/pdo_sqlite/sqlite_driver.c
+++ b/ext/pdo_sqlite/sqlite_driver.c
@@ -175,7 +175,7 @@ static int sqlite_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) 
/* {{{ */
 }
 /* }}} */
 
-static int sqlite_handle_preparer(pdo_dbh_t *dbh, const char *sql, long 
sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+static int sqlite_handle_preparer(pdo_dbh_t *dbh, const char *sql, 
zend_str_size sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
 {
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh-driver_data;
pdo_sqlite_stmt *S = ecalloc(1, sizeof(pdo_sqlite_stmt));
@@ -203,7 +203,7 @@ static int sqlite_handle_preparer(pdo_dbh_t *dbh, const 
char *sql, long sql_len,
return 0;
 }
 
-static long sqlite_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len 
TSRMLS_DC)
+static php_int_t sqlite_handle_doer(pdo_dbh_t *dbh, const char *sql, 
zend_str_size sql_len TSRMLS_DC)
 {
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh-driver_data;
char *errmsg = NULL;
@@ -219,7 +219,7 @@ static long sqlite_handle_doer(pdo_dbh_t *dbh, const char 
*sql, long sql_len TSR
}
 }
 
-static char *pdo_sqlite_last_insert_id(pdo_dbh_t *dbh, const char *name, 
unsigned int *len TSRMLS_DC)
+static char *pdo_sqlite_last_insert_id(pdo_dbh_t *dbh, const char *name, 
zend_str_size_uint *len TSRMLS_DC)
 {
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh-driver_data;
char *id;
@@ -230,7 +230,7 @@ static char *pdo_sqlite_last_insert_id(pdo_dbh_t *dbh, 
const char *name, unsigne
 }
 
 /* NB: doesn't handle binary strings... use prepared stmts for that */
-static int sqlite_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int 
unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype  
TSRMLS_DC)
+static int sqlite_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, 
zend_str_size_int unquotedlen, char **quoted, zend_str_size_int *quotedlen, 
enum pdo_param_type paramtype  TSRMLS_DC)
 {
*quoted = safe_emalloc(2, unquotedlen, 3);
sqlite3_snprintf(2*unquotedlen + 3, *quoted, '%q', unquoted);
@@ -280,7 +280,7 @@ static int sqlite_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
return 1;
 }
 
-static int pdo_sqlite_get_attribute(pdo_dbh_t *dbh, long attr, zval 
*return_value TSRMLS_DC)
+static int pdo_sqlite_get_attribute(pdo_dbh_t *dbh, php_int_t attr, zval 
*return_value TSRMLS_DC)
 {
switch (attr) {
case PDO_ATTR_CLIENT_VERSION:
@@ -295,7 +295,7 @@ static int pdo_sqlite_get_attribute(pdo_dbh_t *dbh, long 
attr, zval *return_valu
return 1;
 }
 
-static int pdo_sqlite_set_attr(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC)
+static int pdo_sqlite_set_attr(pdo_dbh_t *dbh, php_int_t attr, zval *val 
TSRMLS_DC)
 {
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh-driver_data;
 
@@ -421,7 +421,7 @@ static int do_callback(struct pdo_sqlite_fci *fc, zval *cb,
default:
convert_to_string_ex(retval);
sqlite3_result_text(context, 
Z_STRVAL_P(retval),
-   Z_STRLEN_P(retval), 
SQLITE_TRANSIENT);
+   Z_STRSIZE_P(retval), 
SQLITE_TRANSIENT);
break;
}
} else {
@@ -536,14 +536,14 @@ static PHP_METHOD(SQLite, sqliteCreateFunction)
struct pdo_sqlite_func *func;
zval *callback;
char *func_name;
-   int func_name_len;
-   long argc = -1;
+   zend_str_size_int func_name_len;
+   php_int_t argc = -1;
char *cbname = NULL;
pdo_dbh_t *dbh;
pdo_sqlite_db_handle *H;
int ret;
 
-   if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, sz|l,
+   if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Sz|i,
func_name, func_name_len, callback, argc)) {
RETURN_FALSE;
}
@@ -607,14 +607,14 @@ static PHP_METHOD(SQLite, sqliteCreateAggregate)
struct pdo_sqlite_func *func;
zval *step_callback, *fini_callback;
char *func_name;
-   int func_name_len;
-   long argc = -1;
+   zend_str_size_int func_name_len;
+   php_int_t argc = -1;
char *cbname = NULL;
pdo_dbh_t *dbh;
pdo_sqlite_db_handle *H

[PHP-CVS] com php-src: Leftover: Bump version to 5.7.0: Zend/zend.h

2013-12-03 Thread Anatol Belski
Commit:d1baf6c9d757ddb6b459414a83b045e205267094
Author:Sebastian Bergmann s...@sebastian-bergmann.de Tue, 3 Dec 
2013 07:42:37 +0100
Committer: Anatol Belski a...@php.net  Tue, 3 Dec 2013 10:19:11 +0100
Parents:   b3265e210805a6140cc49d6db712b77127163e5b
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=d1baf6c9d757ddb6b459414a83b045e205267094

Log:
Leftover: Bump version to 5.7.0

Changed paths:
  M  Zend/zend.h


Diff:
diff --git a/Zend/zend.h b/Zend/zend.h
index 9d36851..f002aeb 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -22,7 +22,7 @@
 #ifndef ZEND_H
 #define ZEND_H
 
-#define ZEND_VERSION 2.6.0-dev
+#define ZEND_VERSION 2.7.0-dev
 
 #define ZEND_ENGINE_2


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



[PHP-CVS] com php-src: basic fixes to ext/odbc: ext/odbc/birdstep.c ext/odbc/php_birdstep.h ext/odbc/php_odbc.c ext/odbc/php_odbc_includes.h

2013-12-03 Thread Anatol Belski
Commit:8e11fa2251ff74c494343ab3ff6dd1c7edfadd02
Author:Anatol Belski a...@php.net Tue, 3 Dec 2013 16:54:15 +0100
Parents:   727d14b8dd1423ec51096028ef7310fc996a7a23
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=8e11fa2251ff74c494343ab3ff6dd1c7edfadd02

Log:
basic fixes to ext/odbc

Changed paths:
  M  ext/odbc/birdstep.c
  M  ext/odbc/php_birdstep.h
  M  ext/odbc/php_odbc.c
  M  ext/odbc/php_odbc_includes.h

diff --git a/ext/odbc/birdstep.c b/ext/odbc/birdstep.c
index 0af58d0..98546b2 100644
--- a/ext/odbc/birdstep.c
+++ b/ext/odbc/birdstep.c
@@ -287,13 +287,13 @@ static void birdstep_del_result(HashTable *list,int ind)
 PHP_FUNCTION(birdstep_connect)
 {
char *serv, *user, *pass;
-   int serv_len, user_len, pass_len;
+   zend_str_size_int serv_len, user_len, pass_len;
RETCODE stat;
HDBC hdbc;
VConn *new;
-   long ind;
+   php_int_t ind;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, sss, serv, 
serv_len, user, user_len, pass, pass_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, SSS, serv, 
serv_len, user, user_len, pass, pass_len) == FAILURE) {
return;
}

@@ -324,10 +324,10 @@ PHP_FUNCTION(birdstep_connect)
  */
 PHP_FUNCTION(birdstep_close)
 {
-   long id;
+   php_int_t id;
VConn *conn;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, l, id) == 
FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, i, id) == 
FAILURE) {
return;
}
 
@@ -346,8 +346,9 @@ PHP_FUNCTION(birdstep_close)
 PHP_FUNCTION(birdstep_exec)
 {
char *query;
-   long ind;
-   int query_len, indx;
+   php_int_t ind;
+   zend_str_size_int query_len;
+   int indx;
VConn *conn;
Vresult *res;
RETCODE stat;
@@ -426,13 +427,13 @@ PHP_FUNCTION(birdstep_exec)
  */
 PHP_FUNCTION(birdstep_fetch)
 {
-   long ind;
+   php_int_t ind;
Vresult *res;
RETCODE stat;
UDWORD  row;
UWORD   RowStat[1];
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, l, ind) == 
FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, i, ind) == 
FAILURE) {
return;
}
 
@@ -460,7 +461,7 @@ PHP_FUNCTION(birdstep_fetch)
 PHP_FUNCTION(birdstep_result)
 {
zval **col;
-   long ind;
+   php_int_t ind;
Vresult *res;
RETCODE stat;
int i,sql_c_type;
@@ -469,7 +470,7 @@ PHP_FUNCTION(birdstep_result)
SWORD indx = -1;
char *field = NULL;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, lZ, ind, col) 
== FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, iZ, ind, col) 
== FAILURE) {
return;
}
 
@@ -553,10 +554,10 @@ l1:
  */
 PHP_FUNCTION(birdstep_freeresult)
 {
-   long ind;
+   php_int_t ind;
Vresult *res;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, l, ind) == 
FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, i, ind) == 
FAILURE) {
return;
}
 
@@ -572,11 +573,11 @@ PHP_FUNCTION(birdstep_freeresult)
  */
 PHP_FUNCTION(birdstep_autocommit)
 {
-   long id;
+   php_int_t id;
RETCODE stat;
VConn *conn;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, l, id) == 
FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, i, id) == 
FAILURE) {
return;
}
 
@@ -595,11 +596,11 @@ PHP_FUNCTION(birdstep_autocommit)
  */
 PHP_FUNCTION(birdstep_off_autocommit)
 {
-   long id;
+   php_int_t id;
RETCODE stat;
VConn *conn;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, l, id) == 
FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, i, id) == 
FAILURE) {
return;
}
 
@@ -618,11 +619,11 @@ PHP_FUNCTION(birdstep_off_autocommit)
  */
 PHP_FUNCTION(birdstep_commit)
 {
-   long id;
+   php_int_t id;
RETCODE stat;
VConn *conn;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, l, id) == 
FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, i, id) == 
FAILURE) {
return;
}
 
@@ -641,11 +642,11 @@ PHP_FUNCTION(birdstep_commit)
  */
 PHP_FUNCTION(birdstep_rollback)
 {
-   long id;
+   php_int_t id;
RETCODE stat;
VConn *conn;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, l, id) == 
FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, i, id) == 
FAILURE) {
return;
}
 
@@ -664,11 +665,11 @@ PHP_FUNCTION(birdstep_rollback)
  */
 PHP_FUNCTION(birdstep_fieldname)
 {
-   long ind, col;
+   php_int_t ind, col;
Vresult *res;
SWORD indx;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS

[PHP-CVS] com php-src: Support gmp_remroot() on GMP 4.1: ext/gmp/gmp.c

2013-12-03 Thread Anatol Belski
Commit:b3265e210805a6140cc49d6db712b77127163e5b
Author:Nikita Popov ni...@php.net Mon, 2 Dec 2013 20:10:08 +0100
Committer: Anatol Belski a...@php.net  Tue, 3 Dec 2013 10:19:10 +0100
Parents:   e23b051be0fe19e338a71eecc0df44afdc44a84e
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=b3265e210805a6140cc49d6db712b77127163e5b

Log:
Support gmp_remroot() on GMP 4.1

Changed paths:
  M  ext/gmp/gmp.c


Diff:
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
index aea010b..c49402d 100644
--- a/ext/gmp/gmp.c
+++ b/ext/gmp/gmp.c
@@ -204,9 +204,12 @@ typedef struct _gmp_temp {
 #define GMP_ROUND_PLUSINF   1
 #define GMP_ROUND_MINUSINF  2
 
+#define GMP_42_OR_NEWER \
+   ((__GNU_MP_VERSION = 5) || (__GNU_MP_VERSION = 4  
__GNU_MP_VERSION_MINOR = 2))
+
 /* The maximum base for input and output conversions is 62 from GMP 4.2
  * onwards. */
-#if (__GNU_MP_VERSION = 5) || (__GNU_MP_VERSION = 4  
__GNU_MP_VERSION_MINOR = 2)
+#if GMP_42_OR_NEWER
 #  define MAX_BASE 62
 #else
 #  define MAX_BASE 36
@@ -1455,7 +1458,15 @@ ZEND_FUNCTION(gmp_rootrem)
add_index_zval(return_value, 0, gmp_create(gmpnum_result1 TSRMLS_CC));
add_index_zval(return_value, 1, gmp_create(gmpnum_result2 TSRMLS_CC));
 
+#if GMP_42_OR_NEWER
mpz_rootrem(gmpnum_result1, gmpnum_result2, gmpnum_a, (unsigned long) 
nth);
+#else
+   mpz_root(gmpnum_result1, gmpnum_a, (unsigned long) nth);
+   mpz_pow_ui(gmpnum_result2, gmpnum_result1, (unsigned long) nth);
+   mpz_sub(gmpnum_result2, gmpnum_a, gmpnum_result2);
+   mpz_abs(gmpnum_result2, gmpnum_result2);
+#endif
+   
FREE_GMP_TEMP(temp_a);
 }
 /* }}} */


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



[PHP-CVS] com php-src: basic fixes for ext/mysql: ext/mysql/php_mysql.c ext/mysql/php_mysql_structs.h

2013-12-02 Thread Anatol Belski
Commit:ae2103ba408846441e4394bb4b5fd2b139bdb943
Author:Anatol Belski a...@php.net Sun, 1 Dec 2013 09:45:26 +0100
Parents:   eb922c6c9c604b5712e397dee4de89de47047a9b
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=ae2103ba408846441e4394bb4b5fd2b139bdb943

Log:
basic fixes for ext/mysql

Changed paths:
  M  ext/mysql/php_mysql.c
  M  ext/mysql/php_mysql_structs.h

diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 88bb9ab..7387f22 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -80,7 +80,7 @@ static int le_result, le_link, le_plink;
 #define SAFE_STRING(s) ((s)?(s):)
 
 #if MYSQL_VERSION_ID  32199 || defined(MYSQL_USE_MYSQLND)
-# define mysql_row_length_type unsigned long
+# define mysql_row_length_type php_uint_t
 # define HAVE_MYSQL_ERRNO
 #else
 # define mysql_row_length_type unsigned int
@@ -720,16 +720,16 @@ PHP_MINFO_FUNCTION(mysql)
 static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
 {
char *user=NULL, *passwd=NULL, *host_and_port=NULL, *socket=NULL, 
*tmp=NULL, *host=NULL;
-   int  user_len = 0, passwd_len = 0, host_len = 0;
+   zend_str_size_int  user_len = 0, passwd_len = 0, host_len = 0;
char *hashed_details=NULL;
int hashed_details_length, port = MYSQL_PORT;
-   long client_flags = 0;
+   php_int_t client_flags = 0;
php_mysql_conn *mysql=NULL;
 #if MYSQL_VERSION_ID = 32230
void (*handler) (int);
 #endif
zend_bool free_host=0, new_link=0;
-   long connect_timeout;
+   php_int_t connect_timeout;
 
 php_error_docref(NULL TSRMLS_CC,
  E_DEPRECATED,
@@ -775,13 +775,13 @@ static void 
php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
} else {
/* mysql_pconnect does not support new_link parameter */
if (persistent) {
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
|s!s!s!l, host_and_port, host_len,
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
|S!S!S!i, host_and_port, host_len,
user, 
user_len, passwd, passwd_len,

client_flags)==FAILURE) {
return;
}
} else {
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
|s!s!s!bl, host_and_port, host_len,
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
|S!S!S!bi, host_and_port, host_len,

user, user_len, passwd, passwd_len,

new_link, client_flags)==FAILURE) {
return;
@@ -961,13 +961,13 @@ static void 
php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
 */
if (!new_link  zend_hash_find(EG(regular_list), 
hashed_details, hashed_details_length+1,(void **) index_ptr)==SUCCESS) {
int type;
-   long link;
+   php_int_t link;
void *ptr;
 
if (Z_TYPE_P(index_ptr) != le_index_ptr) {
MYSQL_DO_CONNECT_RETURN_FALSE();
}
-   link = (long) index_ptr-ptr;
+   link = (php_int_t) index_ptr-ptr;
ptr = zend_list_find(link,type);   /* check if the 
link is still there */
if (ptr  (type==le_link || type==le_plink)) {
zend_list_addref(link);
@@ -1130,12 +1130,12 @@ PHP_FUNCTION(mysql_close)
 PHP_FUNCTION(mysql_select_db)
 {
char *db;
-   int db_len;
+   zend_str_size_int db_len;
zval *mysql_link = NULL;
int id = -1;
php_mysql_conn *mysql;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|r, db, 
db_len, mysql_link) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, S|r, db, 
db_len, mysql_link) == FAILURE) {
return;
}
 
@@ -1283,7 +1283,7 @@ PHP_FUNCTION(mysql_thread_id)
}
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, 
MySQL-Link, le_link, le_plink);
 
-   RETURN_LONG((long) mysql_thread_id(mysql-conn));
+   RETURN_LONG((php_int_t) mysql_thread_id(mysql-conn));
 }
 /* }}} */
 
@@ -1353,10 +1353,11 @@ PHP_FUNCTION(mysql_set_charset)
 {
zval *mysql_link = NULL;
char *csname;
-   int id = -1, csname_len;
+   int id = -1;
+   zend_str_size_int csname_len;
php_mysql_conn *mysql;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|r, csname, 
csname_len, mysql_link) == FAILURE

[PHP-CVS] com php-src: fixed ext/enchant: ext/enchant/enchant.c

2013-11-29 Thread Anatol Belski
Commit:4e2ddbc397f74c33c6f3514aede4e8d76bc54f53
Author:Anatol Belski a...@php.net Thu, 28 Nov 2013 13:59:55 +0100
Parents:   1e2cc1584594fd75ba742a7dd1b82a333e713890
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=4e2ddbc397f74c33c6f3514aede4e8d76bc54f53

Log:
fixed ext/enchant

Changed paths:
  M  ext/enchant/enchant.c


Diff:
diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
index 98b5c9f..1f92d58 100644
--- a/ext/enchant/enchant.c
+++ b/ext/enchant/enchant.c
@@ -40,14 +40,14 @@ typedef struct _broker_struct {
EnchantBroker   *pbroker;
enchant_dict**dict;
unsigned intdictcnt;
-   longrsrc_id;
+   php_int_t   rsrc_id;
 } _enchant_broker;
 
 typedef struct _dict_struct {
unsigned intid;
EnchantDict *pdict;
enchant_broker  *pbroker;
-   longrsrc_id;
+   php_int_t   rsrc_id;
enchant_dict*next;
enchant_dict*prev;
 } _enchant_dict;
@@ -421,11 +421,11 @@ PHP_FUNCTION(enchant_broker_set_dict_path)
 {
zval *broker;
enchant_broker *pbroker;
-   long dict_type;
+   php_int_t dict_type;
char *value;
-   int value_len;
+   zend_str_size_int value_len;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rls, broker, 
dict_type, value, value_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, riS, broker, 
dict_type, value, value_len) == FAILURE) {
RETURN_FALSE;
}
 
@@ -461,10 +461,10 @@ PHP_FUNCTION(enchant_broker_get_dict_path)
 {
zval *broker;
enchant_broker *pbroker;
-   long dict_type;
+   php_int_t dict_type;
char *value;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rl, broker, 
dict_type) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ri, broker, 
dict_type) == FAILURE) {
RETURN_FALSE;
}

@@ -534,10 +534,10 @@ PHP_FUNCTION(enchant_broker_request_dict)
enchant_dict *dict;
EnchantDict *d;
char *tag;
-   int taglen;
+   zend_str_size_int taglen;
int pos;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rs, broker, 
tag, taglen) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rS, broker, 
tag, taglen) == FAILURE) {
RETURN_FALSE;
}
 
@@ -588,10 +588,10 @@ PHP_FUNCTION(enchant_broker_request_pwl_dict)
enchant_dict *dict;
EnchantDict *d;
char *pwl;
-   int pwllen;
+   zend_str_size_int pwllen;
int pos;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rp, broker, 
pwl, pwllen) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rP, broker, 
pwl, pwllen) == FAILURE) {
RETURN_FALSE;
}
 
@@ -656,10 +656,10 @@ PHP_FUNCTION(enchant_broker_dict_exists)
 {
zval *broker;
char *tag;
-   int taglen;
+   zend_str_size_int taglen;
enchant_broker * pbroker;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rs, broker, 
tag, taglen) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rS, broker, 
tag, taglen) == FAILURE) {
RETURN_FALSE;
}
 
@@ -680,12 +680,12 @@ PHP_FUNCTION(enchant_broker_set_ordering)
 {
zval *broker;
char *pordering;
-   int porderinglen;
+   zend_str_size_int porderinglen;
char *ptag;
-   int ptaglen;
+   zend_str_size_int ptaglen;
enchant_broker * pbroker;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rss, broker, 
ptag, ptaglen, pordering, porderinglen) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rSS, broker, 
ptag, ptaglen, pordering, porderinglen) == FAILURE) {
RETURN_FALSE;
}
 
@@ -721,10 +721,10 @@ PHP_FUNCTION(enchant_dict_quick_check)
 {
zval *dict, *sugg = NULL;
char *word;
-   int wordlen;
+   zend_str_size_int wordlen;
enchant_dict *pdict;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rs|z/, dict, 
word, wordlen, sugg) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rS|z/, dict, 
word, wordlen, sugg) == FAILURE) {
RETURN_FALSE;
}
 
@@ -767,10 +767,10 @@ PHP_FUNCTION(enchant_dict_check)
 {
zval *dict;
char *word;
-   int wordlen;
+   zend_str_size_int wordlen;
enchant_dict *pdict;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rs, dict, 
word, wordlen) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rS, dict, 
word, wordlen) == FAILURE) {
RETURN_FALSE;
}
 
@@ -786,13 +786,13 @@ PHP_FUNCTION(enchant_dict_suggest)
 {
zval

[PHP-CVS] com php-src: basic fixes for ext/gd: ext/gd/gd.c ext/gd/gd_ctx.c

2013-11-29 Thread Anatol Belski
Commit:51d78c253318158371ce9d547d0637392b5428a5
Author:Anatol Belski a...@php.net Fri, 29 Nov 2013 08:53:32 +0100
Parents:   57db68e03d46da1b1a2244e001550739c8eec468
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=51d78c253318158371ce9d547d0637392b5428a5

Log:
basic fixes for ext/gd

Changed paths:
  M  ext/gd/gd.c
  M  ext/gd/gd_ctx.c

diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index d8a90f5..800a94e 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -1420,12 +1420,13 @@ PHP_GD_API int phpi_get_le_gd(void)
 PHP_FUNCTION(imageloadfont)
 {
char *file;
-   int file_name, hdr_size = sizeof(gdFont) - sizeof(char *);
+   zend_str_size_int file_name;
+   int hdr_size = sizeof(gdFont) - sizeof(char *);
int ind, body_size, n = 0, b, i, body_size_check;
gdFontPtr font;
php_stream *stream;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, file, 
file_name) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, S, file, 
file_name) == FAILURE) {
return;
}
 
@@ -1563,10 +1564,10 @@ PHP_FUNCTION(imagesetstyle)
Create a new true color image */
 PHP_FUNCTION(imagecreatetruecolor)
 {
-   long x_size, y_size;
+   php_int_t x_size, y_size;
gdImagePtr im;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ll, x_size, 
y_size) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ii, x_size, 
y_size) == FAILURE) {
return;
}
 
@@ -1608,10 +1609,10 @@ PHP_FUNCTION(imagetruecolortopalette)
 {
zval *IM;
zend_bool dither;
-   long ncolors;
+   php_int_t ncolors;
gdImagePtr im;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rbl, IM, 
dither, ncolors) == FAILURE)  {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rbi, IM, 
dither, ncolors) == FAILURE)  {
return;
}
 
@@ -1694,10 +1695,10 @@ PHP_FUNCTION(imagecolormatch)
 PHP_FUNCTION(imagesetthickness)
 {
zval *IM;
-   long thick;
+   php_int_t thick;
gdImagePtr im;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rl, IM, thick) 
== FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ri, IM, thick) 
== FAILURE) {
return;
}
 
@@ -1714,10 +1715,10 @@ PHP_FUNCTION(imagesetthickness)
 PHP_FUNCTION(imagefilledellipse)
 {
zval *IM;
-   long cx, cy, w, h, color;
+   php_int_t cx, cy, w, h, color;
gdImagePtr im;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rl, IM, 
cx, cy, w, h, color) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ri, IM, 
cx, cy, w, h, color) == FAILURE) {
return;
}
 
@@ -1734,11 +1735,11 @@ PHP_FUNCTION(imagefilledellipse)
 PHP_FUNCTION(imagefilledarc)
 {
zval *IM;
-   long cx, cy, w, h, ST, E, col, style;
+   php_int_t cx, cy, w, h, ST, E, col, style;
gdImagePtr im;
int e, st;

-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r, IM, 
cx, cy, w, h, ST, E, col, style) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r, IM, 
cx, cy, w, h, ST, E, col, style) == FAILURE) {
return;
}
 
@@ -1803,10 +1804,10 @@ PHP_FUNCTION(imagesavealpha)
 PHP_FUNCTION(imagelayereffect)
 {
zval *IM;
-   long effect;
+   php_int_t effect;
gdImagePtr im;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rl, IM, 
effect) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ri, IM, 
effect) == FAILURE) {
return;
}
 
@@ -1822,11 +1823,11 @@ PHP_FUNCTION(imagelayereffect)
 PHP_FUNCTION(imagecolorallocatealpha)
 {
zval *IM;
-   long red, green, blue, alpha;
+   php_int_t red, green, blue, alpha;
gdImagePtr im;
int ct = (-1);
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r, IM, 
red, green, blue, alpha) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r, IM, 
red, green, blue, alpha) == FAILURE) {
RETURN_FALSE;
}
 
@@ -1835,7 +1836,7 @@ PHP_FUNCTION(imagecolorallocatealpha)
if (ct  0) {
RETURN_FALSE;
}
-   RETURN_LONG((long)ct);
+   RETURN_LONG((php_int_t)ct);
 }
 /* }}} */
 
@@ -1844,10 +1845,10 @@ PHP_FUNCTION(imagecolorallocatealpha)
 PHP_FUNCTION(imagecolorresolvealpha)
 {
zval *IM;
-   long red, green, blue, alpha;
+   php_int_t red, green, blue, alpha;
gdImagePtr im;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r, IM, 
red, green, blue, alpha) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r, IM, 
red, green, blue, alpha) == FAILURE) {
return;
}
 
@@ -1862,10

[PHP-CVS] com php-src: reverted a couple of things in ext/phar for now, but all tests pass now: ext/phar/phar_internal.h ext/phar/phar_object.c ext/phar/stream.c

2013-11-29 Thread Anatol Belski
Commit:de453dbef6cc7a0ead22d82871331eb8c15a2b08
Author:Anatol Belski a...@php.net Thu, 28 Nov 2013 09:23:02 +0100
Parents:   d135198559cd14805b42a2ddbe48511674475c40
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=de453dbef6cc7a0ead22d82871331eb8c15a2b08

Log:
reverted a couple of things in ext/phar for now, but all tests pass now

Changed paths:
  M  ext/phar/phar_internal.h
  M  ext/phar/phar_object.c
  M  ext/phar/stream.c


Diff:
diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h
index 1a8bd1d..2f9320a 100644
--- a/ext/phar/phar_internal.h
+++ b/ext/phar/phar_internal.h
@@ -179,15 +179,15 @@ ZEND_BEGIN_MODULE_GLOBALS(phar)
void(*orig_stat)(INTERNAL_FUNCTION_PARAMETERS);
/* used for includes with . in them inside front controller */
char*   cwd;
-   zend_str_size_int cwd_len;
+   php_int_t cwd_len;
int cwd_init;
char*openssl_privatekey;
int openssl_privatekey_len;
/* phar_get_archive cache */
char*   last_phar_name;
-   zend_str_size_int last_phar_name_len;
+   int last_phar_name_len;
char*   last_alias;
-   zend_str_size_int last_alias_len;
+   int last_alias_len;
phar_archive_data* last_phar;
HashTable mime_types;
 ZEND_END_MODULE_GLOBALS(phar)
@@ -244,7 +244,7 @@ typedef struct _phar_entry_info {
/* when changing compression, save old flags in case fp is NULL */
php_uint32   old_flags;
zval *metadata;
-   zend_str_size_int  metadata_len; /* only used for 
cached manifests */
+   int  metadata_len; /* only used for cached 
manifests */
php_uint32   filename_len;
char *filename;
enum phar_fp_typefp_type;
@@ -287,12 +287,12 @@ typedef struct _phar_entry_info {
 /* information about a phar file (the archive itself) */
 struct _phar_archive_data {
char *fname;
-   int  fname_len;
+   zend_str_size_int  fname_len;
/* for phar_detect_fname_ext, this stores the location of the file 
extension within fname */
char *ext;
zend_str_size_int  ext_len;
char *alias;
-   zend_str_size_int  alias_len;
+   int  alias_len;
char version[12];
size_t   internal_file_start;
size_t   halt_offset;
@@ -312,7 +312,7 @@ struct _phar_archive_data {
zend_str_size_int  sig_len;
char *signature;
zval *metadata;
-   zend_str_size_int  metadata_len; /* only used for 
cached manifests */
+   int  metadata_len; /* only used for cached 
manifests */
uint phar_pos;
/* if 1, then this alias was manually specified by the user and is not 
a permanent alias */
unsigned int is_temporary_alias:1;
@@ -456,7 +456,7 @@ static inline zend_off_t phar_get_fp_offset(phar_entry_info 
*entry TSRMLS_DC)
 
 typedef struct _phar_mime_type {
char *mime;
-   zend_str_size_int len;
+   int len;
/* one of PHAR_MIME_* */
char type;
 } phar_mime_type;
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index aac24a6..54b641b 100644
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -1978,7 +1978,7 @@ PHP_METHOD(Phar, isFileFormat)
 static int phar_copy_file_contents(phar_entry_info *entry, php_stream *fp 
TSRMLS_DC) /* {{{ */
 {
char *error;
-   off_t offset;
+   zend_off_t offset;
phar_entry_info *link;
 
if (FAILURE == phar_open_entry_fp(entry, error, 1 TSRMLS_CC)) {
diff --git a/ext/phar/stream.c b/ext/phar/stream.c
index 6a2bb6c..4ba0e1f 100644
--- a/ext/phar/stream.c
+++ b/ext/phar/stream.c
@@ -413,7 +413,7 @@ static int phar_stream_seek(php_stream *stream, zend_off_t 
offset, int whence, z
default:
temp = 0;
}
-   if (temp  data-zero + (off_t) entry-uncompressed_filesize) {
+   if (temp  data-zero + (zend_off_t) entry-uncompressed_filesize) {
*newoffset = -1;
return -1;
}


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



[PHP-CVS] com php-src: further fixes for ext/gd: ext/gd/gd.c

2013-11-29 Thread Anatol Belski
Commit:3659dcd98c5a4dcfcad2129e59e0794f4dcac1ca
Author:Anatol Belski a...@php.net Fri, 29 Nov 2013 09:18:13 +0100
Parents:   51d78c253318158371ce9d547d0637392b5428a5
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=3659dcd98c5a4dcfcad2129e59e0794f4dcac1ca

Log:
further fixes for ext/gd

Changed paths:
  M  ext/gd/gd.c


Diff:
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 800a94e..fa944c6 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -1422,7 +1422,8 @@ PHP_FUNCTION(imageloadfont)
char *file;
zend_str_size_int file_name;
int hdr_size = sizeof(gdFont) - sizeof(char *);
-   int ind, body_size, n = 0, b, i, body_size_check;
+   int ind, body_size, n = 0, b;
+   zend_off_t body_size_check, i;
gdFontPtr font;
php_stream *stream;
 
@@ -3396,7 +3397,7 @@ PHP_FUNCTION(imagefilledpolygon)
 
 /* {{{ php_find_gd_font
  */
-static gdFontPtr php_find_gd_font(int size TSRMLS_DC)
+static gdFontPtr php_find_gd_font(php_int_t size TSRMLS_DC)
 {
gdFontPtr font;
int ind_type;
@@ -3830,7 +3831,7 @@ static void 
php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
do {
zval ** item;
char * key;
-   ulong num_key;
+   php_uint_t num_key;
 
if (zend_hash_get_current_key_ex(HASH_OF(EXT), key, 
NULL, num_key, 0, pos) != HASH_KEY_IS_STRING) {
continue;


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



[PHP-CVS] com php-src: Merge branch 'master' into str_size_and_int64: Zend/zend_API.c Zend/zend_compile.c Zend/zend_compile.h Zend/zend_execute.c Zend/zend_vm_def.h Zend/zend_vm_execute.h ext/date/php

2013-11-29 Thread Anatol Belski
Commit:3f7522a652d2c90ca594cdb02b4083ce64213e46
Author:Anatol Belski a...@php.net Thu, 28 Nov 2013 09:29:12 +0100
Parents:   de453dbef6cc7a0ead22d82871331eb8c15a2b08 
98f3c410d9c93e64c4e109b8f55e6d2f5cdabaac
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=3f7522a652d2c90ca594cdb02b4083ce64213e46

Log:
Merge branch 'master' into str_size_and_int64

Changed paths:
  MM  Zend/zend_API.c
  MM  Zend/zend_compile.c
  MM  Zend/zend_compile.h
  MM  Zend/zend_execute.c
  MM  Zend/zend_vm_def.h
  MM  Zend/zend_vm_execute.h
  MM  ext/date/php_date.c


Diff:
diff --cc Zend/zend_execute.c
index 85b8cd8,5aea39e..aab1dc9
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@@ -1313,9 -1310,9 +1310,9 @@@ static void zend_fetch_dimension_addres
Z_STRVAL_P(ptr) = (char*)emalloc(2);
Z_STRVAL_P(ptr)[0] = 
Z_STRVAL_P(container)[Z_LVAL_P(dim)];
Z_STRVAL_P(ptr)[1] = 0;
 -  Z_STRLEN_P(ptr) = 1;
 +  Z_STRSIZE_P(ptr) = 1;
}
-   AI_SET_PTR(result, ptr);
+   result-var.ptr = ptr;
return;
}
break;
diff --cc Zend/zend_vm_def.h
index 4640e42,6eca6d0..3821374
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@@ -1962,10 -1951,10 +1951,10 @@@ ZEND_VM_HELPER(zend_do_fcall_common_hel
LOAD_OPLINE();
  
if (fbc-type == ZEND_INTERNAL_FUNCTION) {
-   if (fbc-common.arg_info) {
+   if (fbc-common.fn_flags  ZEND_ACC_HAS_TYPE_HINTS) {
zend_uint i=0;
zval **p = (zval**)EX(function_state).arguments;
 -  ulong arg_count = opline-extended_value;
 +  zend_uint_t arg_count = opline-extended_value;
  
while (arg_count0) {
zend_verify_arg_type(fbc, ++i, *(p-arg_count), 
0 TSRMLS_CC);
diff --cc Zend/zend_vm_execute.h
index 0a7912b,dcb1183..0e38bb7
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@@ -530,10 -530,10 +530,10 @@@ static int ZEND_FASTCALL zend_do_fcall_
LOAD_OPLINE();
  
if (fbc-type == ZEND_INTERNAL_FUNCTION) {
-   if (fbc-common.arg_info) {
+   if (fbc-common.fn_flags  ZEND_ACC_HAS_TYPE_HINTS) {
zend_uint i=0;
zval **p = (zval**)EX(function_state).arguments;
 -  ulong arg_count = opline-extended_value;
 +  zend_uint_t arg_count = opline-extended_value;
  
while (arg_count0) {
zend_verify_arg_type(fbc, ++i, *(p-arg_count), 
0 TSRMLS_CC);


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



[PHP-CVS] com php-src: fixed ext/xml: ext/xml/expat_compat.h ext/xml/php_xml.h ext/xml/xml.c

2013-11-29 Thread Anatol Belski
Commit:262fca3a39137a22c5fb237e453e68ef64dce126
Author:Anatol Belski a...@php.net Thu, 28 Nov 2013 19:46:08 +0100
Parents:   d9a036cc3065aeb45cd818ce810e316780a458b7
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=262fca3a39137a22c5fb237e453e68ef64dce126

Log:
fixed ext/xml

Changed paths:
  M  ext/xml/expat_compat.h
  M  ext/xml/php_xml.h
  M  ext/xml/xml.c

diff --git a/ext/xml/expat_compat.h b/ext/xml/expat_compat.h
index 1c94e45..1312e51 100644
--- a/ext/xml/expat_compat.h
+++ b/ext/xml/expat_compat.h
@@ -5,7 +5,7 @@
| Copyright (c) 1997-2013 The PHP Group|
+--+
| This source file is subject to version 3.01 of the PHP license,  |
-   | that is bundled with this package in the file LICENSE, and is|
+bundled with this package in the file LICENSE, and is|
| available through the world-wide-web at the following url:   |
| http://www.php.net/license/3_01.txt  |
| If you did not receive a copy of the PHP license and are unable to   |
diff --git a/ext/xml/php_xml.h b/ext/xml/php_xml.h
index 7766834..42de397 100644
--- a/ext/xml/php_xml.h
+++ b/ext/xml/php_xml.h
@@ -134,8 +134,8 @@ PHP_FUNCTION(utf8_decode);
 PHP_FUNCTION(xml_parse_into_struct);
 
 PHPAPI char *_xml_zval_strdup(zval *val);
-PHPAPI char *xml_utf8_decode(const XML_Char *, int, int *, const XML_Char *);
-PHPAPI char *xml_utf8_encode(const char *s, int len, int *newlen, const 
XML_Char *encoding);
+PHPAPI char *xml_utf8_decode(const XML_Char *, zend_str_size_int, 
zend_str_size_int *, const XML_Char *);
+PHPAPI char *xml_utf8_encode(const char *s, zend_str_size_int len, 
zend_str_size_int *newlen, const XML_Char *encoding);
 
 #endif /* HAVE_LIBEXPAT */
 
diff --git a/ext/xml/xml.c b/ext/xml/xml.c
index 1ef01c8..f3571a9 100644
--- a/ext/xml/xml.c
+++ b/ext/xml/xml.c
@@ -78,7 +78,7 @@ inline static char xml_decode_iso_8859_1(unsigned short);
 inline static unsigned short xml_encode_us_ascii(unsigned char);
 inline static char xml_decode_us_ascii(unsigned short);
 static zval *xml_call_handler(xml_parser *, zval *, zend_function *, int, zval 
**);
-static zval *_xml_xmlchar_zval(const XML_Char *, int, const XML_Char *);
+static zval *_xml_xmlchar_zval(const XML_Char *, zend_str_size_int, const 
XML_Char *);
 static int _xml_xmlcharlen(const XML_Char *);
 static void _xml_add_to_info(xml_parser *parser,char *name);
 inline static char *_xml_decode_tag(xml_parser *parser, const char *tag);
@@ -373,7 +373,7 @@ PHP_MINFO_FUNCTION(xml)
 /* }}} */
 
 /* {{{ extension-internal functions */
-static zval *_xml_resource_zval(long value)
+static zval *_xml_resource_zval(php_int_t value)
 {
zval *ret;
TSRMLS_FETCH();
@@ -395,12 +395,12 @@ static zval *_xml_string_zval(const char *str)
MAKE_STD_ZVAL(ret);
 
Z_TYPE_P(ret) = IS_STRING;
-   Z_STRLEN_P(ret) = len;
+   Z_STRSIZE_P(ret) = len;
Z_STRVAL_P(ret) = estrndup(str, len);
return ret;
 }
 
-static zval *_xml_xmlchar_zval(const XML_Char *s, int len, const XML_Char 
*encoding)
+static zval *_xml_xmlchar_zval(const XML_Char *s, zend_str_size_int len, const 
XML_Char *encoding)
 {
zval *ret;
MAKE_STD_ZVAL(ret);
@@ -413,7 +413,7 @@ static zval *_xml_xmlchar_zval(const XML_Char *s, int len, 
const XML_Char *encod
len = _xml_xmlcharlen(s);
}
Z_TYPE_P(ret) = IS_STRING;
-   Z_STRVAL_P(ret) = xml_utf8_decode(s, len, Z_STRLEN_P(ret), encoding);
+   Z_STRVAL_P(ret) = xml_utf8_decode(s, len, Z_STRSIZE_P(ret), encoding);
return ret;
 }
 /* }}} */
@@ -488,7 +488,7 @@ static void xml_set_handler(zval **handler, zval **data)
if (Z_TYPE_PP(data) != IS_ARRAY  Z_TYPE_PP(data) != IS_OBJECT) {
 
convert_to_string_ex(data);
-   if (Z_STRLEN_PP(data) == 0) {
+   if (Z_STRSIZE_PP(data) == 0) {
*handler = NULL;
return;
}
@@ -607,9 +607,9 @@ static xml_encoding *xml_get_encoding(const XML_Char *name)
 /* }}} */
 
 /* {{{ xml_utf8_encode */
-PHPAPI char *xml_utf8_encode(const char *s, int len, int *newlen, const 
XML_Char *encoding)
+PHPAPI char *xml_utf8_encode(const char *s, zend_str_size_int len, 
zend_str_size_int *newlen, const XML_Char *encoding)
 {
-   int pos = len;
+   zend_str_size_int pos = len;
char *newbuf;
unsigned int c;
unsigned short (*encoder)(unsigned char) = NULL;
@@ -661,7 +661,7 @@ PHPAPI char *xml_utf8_encode(const char *s, int len, int 
*newlen, const XML_Char
 /* }}} */
 
 /* {{{ xml_utf8_decode */
-PHPAPI char *xml_utf8_decode(const XML_Char *s, int len, int *newlen, const 
XML_Char *encoding)
+PHPAPI char *xml_utf8_decode(const XML_Char *s, zend_str_size_int len, 
zend_str_size_int *newlen, const XML_Char

[PHP-CVS] com php-src: fixed ext/wddx: ext/wddx/php_wddx_api.h ext/wddx/wddx.c

2013-11-29 Thread Anatol Belski
Commit:ef54a95b7184899c63b4bd7be400c4621dd36360
Author:Anatol Belski a...@php.net Thu, 28 Nov 2013 20:00:27 +0100
Parents:   262fca3a39137a22c5fb237e453e68ef64dce126
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=ef54a95b7184899c63b4bd7be400c4621dd36360

Log:
fixed ext/wddx

Changed paths:
  M  ext/wddx/php_wddx_api.h
  M  ext/wddx/wddx.c

diff --git a/ext/wddx/php_wddx_api.h b/ext/wddx/php_wddx_api.h
index 1a01945..9487c15 100644
--- a/ext/wddx/php_wddx_api.h
+++ b/ext/wddx/php_wddx_api.h
@@ -57,11 +57,11 @@ typedef smart_str wddx_packet;
 wddx_packet* php_wddx_constructor(void);
 voidphp_wddx_destructor(wddx_packet *packet);
 
-voidphp_wddx_packet_start(wddx_packet *packet, char *comment, int 
comment_len);
+voidphp_wddx_packet_start(wddx_packet *packet, char *comment, 
zend_str_size_int comment_len);
 voidphp_wddx_packet_end(wddx_packet *packet);
 
-voidphp_wddx_serialize_var(wddx_packet *packet, zval *var, char 
*name, int name_len TSRMLS_DC);
-int php_wddx_deserialize_ex(char *, int, zval *return_value);
+voidphp_wddx_serialize_var(wddx_packet *packet, zval *var, char 
*name, zend_str_size_int name_len TSRMLS_DC);
+int php_wddx_deserialize_ex(char *, zend_str_size_int, zval 
*return_value);
 #define php_wddx_gather(packet) estrndup(packet-c, packet-len)
 
 #endif /* PHP_WDDX_API_H */
diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c
index afeca90..8ed2d35 100644
--- a/ext/wddx/wddx.c
+++ b/ext/wddx/wddx.c
@@ -295,9 +295,9 @@ PS_SERIALIZER_DECODE_FUNC(wddx)
zval *retval;
zval **ent;
char *key;
-   uint key_length;
+   zend_str_size_uint key_length;
char tmp[128];
-   ulong idx;
+   php_uint_t idx;
int hash_type;
int ret;
 
@@ -366,7 +366,7 @@ PHP_MINFO_FUNCTION(wddx)
 
 /* {{{ php_wddx_packet_start
  */
-void php_wddx_packet_start(wddx_packet *packet, char *comment, int comment_len)
+void php_wddx_packet_start(wddx_packet *packet, char *comment, 
zend_str_size_int comment_len)
 {
php_wddx_add_chunk_static(packet, WDDX_PACKET_S);
if (comment) {
@@ -403,11 +403,11 @@ static void php_wddx_serialize_string(wddx_packet 
*packet, zval *var TSRMLS_DC)
 {
php_wddx_add_chunk_static(packet, WDDX_STRING_S);
 
-   if (Z_STRLEN_P(var)  0) {
+   if (Z_STRSIZE_P(var)  0) {
char *buf;
size_t buf_len;
 
-   buf = php_escape_html_entities(Z_STRVAL_P(var), 
Z_STRLEN_P(var), buf_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
+   buf = php_escape_html_entities(Z_STRVAL_P(var), 
Z_STRSIZE_P(var), buf_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
 
php_wddx_add_chunk_ex(packet, buf, buf_len);
 
@@ -458,7 +458,7 @@ static void php_wddx_serialize_object(wddx_packet *packet, 
zval *obj)
zval **ent, *fname, **varname;
zval *retval = NULL;
const char *key;
-   ulong idx;
+   php_uint_t idx;
char tmp_buf[WDDX_BUF_LEN];
HashTable *objhash, *sleephash;
TSRMLS_FETCH();
@@ -496,15 +496,15 @@ static void php_wddx_serialize_object(wddx_packet 
*packet, zval *obj)
continue;
}
 
-   if (zend_hash_find(objhash, 
Z_STRVAL_PP(varname), Z_STRLEN_PP(varname)+1, (void **)ent) == SUCCESS) {
-   php_wddx_serialize_var(packet, *ent, 
Z_STRVAL_PP(varname), Z_STRLEN_PP(varname) TSRMLS_CC);
+   if (zend_hash_find(objhash, 
Z_STRVAL_PP(varname), Z_STRSIZE_PP(varname)+1, (void **)ent) == SUCCESS) {
+   php_wddx_serialize_var(packet, *ent, 
Z_STRVAL_PP(varname), Z_STRSIZE_PP(varname) TSRMLS_CC);
}
}

php_wddx_add_chunk_static(packet, WDDX_STRUCT_E);
}
} else {
-   uint key_len;
+   zend_str_size_uint key_len;
 
PHP_CLASS_ATTRIBUTES;
 
@@ -556,12 +556,12 @@ static void php_wddx_serialize_array(wddx_packet *packet, 
zval *arr)
 {
zval **ent;
char *key;
-   uint key_len;
+   zend_str_size_uint key_len;
int is_struct = 0, ent_type;
-   ulong idx;
+   php_uint_t idx;
HashTable *target_hash;
char tmp_buf[WDDX_BUF_LEN];
-   ulong ind = 0;
+   php_uint_t ind = 0;
int type;
TSRMLS_FETCH();
 
@@ -624,7 +624,7 @@ static void php_wddx_serialize_array(wddx_packet *packet, 
zval *arr)
 
 /* {{{ php_wddx_serialize_var
  */
-void php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name, int 
name_len TSRMLS_DC)
+void php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name, 
zend_str_size_int name_len TSRMLS_DC)
 {
HashTable *ht;
 
@@ -700,8 +700,8

[PHP-CVS] com php-src: fixed ext/ctype: ext/ctype/ctype.c

2013-11-29 Thread Anatol Belski
Commit:46448539b0482875473d66c20a8e319578e41a4d
Author:Anatol Belski a...@php.net Thu, 28 Nov 2013 09:53:00 +0100
Parents:   3f7522a652d2c90ca594cdb02b4083ce64213e46
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=46448539b0482875473d66c20a8e319578e41a4d

Log:
fixed ext/ctype

Changed paths:
  M  ext/ctype/ctype.c


Diff:
diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c
index e2698f5..a7b7536 100644
--- a/ext/ctype/ctype.c
+++ b/ext/ctype/ctype.c
@@ -159,7 +159,7 @@ static PHP_MINFO_FUNCTION(ctype)
tmp = *c; \
} \
if (Z_TYPE(tmp) == IS_STRING) { \
-   char *p = Z_STRVAL(tmp), *e = Z_STRVAL(tmp) + Z_STRLEN(tmp); \
+   char *p = Z_STRVAL(tmp), *e = Z_STRVAL(tmp) + Z_STRSIZE(tmp); \
if (e == p) {   \
if (Z_TYPE_P(c) == IS_LONG) zval_dtor(tmp); \
RETURN_FALSE;   \


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



[PHP-CVS] com php-src: Merge branch 'master' into str_size_and_int64: Zend/Zend.dsp Zend/ZendTS.dsp Zend/zend.h Zend/zend_API.c Zend/zend_builtin_functions.c Zend/zend_compile.c Zend/zend_compile.h Ze

2013-11-29 Thread Anatol Belski
Commit:5ced3db9714c02d2fd40370f632f23d047f51987
Author:Anatol Belski a...@php.net Thu, 28 Nov 2013 17:27:59 +0100
Parents:   a7862de2db615f351fd746bd2fb87564b9631e73 
0d65cd50ddd409d37b208ae3fc5adbb7b22d1379
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=5ced3db9714c02d2fd40370f632f23d047f51987

Log:
Merge branch 'master' into str_size_and_int64

Conflicts:
Zend/zend.h
Zend/zend_hash.c
Zend/zend_hash.h
Zend/zend_language_parser.y
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

Changed paths:
  MM  Zend/Zend.dsp
  MM  Zend/ZendTS.dsp
  MM  Zend/zend.h
  MM  Zend/zend_API.c
  MM  Zend/zend_builtin_functions.c
  MM  Zend/zend_compile.c
  MM  Zend/zend_compile.h
  MM  Zend/zend_execute_API.c
  MM  Zend/zend_hash.c
  MM  Zend/zend_hash.h
  MM  Zend/zend_language_parser.y
  MM  Zend/zend_operators.h
  MM  Zend/zend_ts_hash.c
  MM  Zend/zend_ts_hash.h
  MM  Zend/zend_vm_def.h
  MM  Zend/zend_vm_execute.h
  MM  configure.in
  MM  ext/date/lib/timelib.h
  MM  ext/date/php_date.c
  MM  ext/reflection/php_reflection.c
  MM  win32/build/config.w32

diff --cc Zend/zend.h
index 01db626,1c86d57..9e3fc06
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@@ -317,9 -317,10 +317,10 @@@ typedef struct _zend_object 
  } zend_object;
  
  #include zend_object_handlers.h
+ #include zend_ast.h
  
  typedef union _zvalue_value {
 -  long lval;  /* long value */
 +  zend_int_t lval;/* long value */
double dval;/* double value */
struct {
char *val;
@@@ -587,8 -589,8 +589,9 @@@ typedef int (*zend_write_func_t)(const 
  #define IS_RESOURCE   7
  #define IS_CONSTANT   8
  #define IS_CONSTANT_ARRAY 9
- #define IS_CALLABLE   10
+ #define IS_CONSTANT_AST   10
+ #define IS_CALLABLE   11
 +#define IS_LONG IS_INT
  
  /* Ugly hack to support constants as static array indices */
  #define IS_CONSTANT_TYPE_MASK 0x00f
diff --cc Zend/zend_compile.c
index 3cc95b5,8f870c6..8f964fb
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@@ -1908,14 -1908,14 +1908,14 @@@ void zend_do_receive_param(zend_uchar o
}
} else {
cur_arg_info-type_hint = IS_OBJECT;
 -  if (ZEND_FETCH_CLASS_DEFAULT == 
zend_get_class_fetch_type(Z_STRVAL(class_type-u.constant), 
Z_STRLEN(class_type-u.constant))) {
 +  if (ZEND_FETCH_CLASS_DEFAULT == 
zend_get_class_fetch_type(Z_STRVAL(class_type-u.constant), 
Z_STRSIZE(class_type-u.constant))) {
zend_resolve_class_name(class_type 
TSRMLS_CC);
}
 -  Z_STRVAL(class_type-u.constant) = 
(char*)zend_new_interned_string(Z_STRVAL(class_type-u.constant), 
Z_STRLEN(class_type-u.constant) + 1, 1 TSRMLS_CC);
 +  Z_STRVAL(class_type-u.constant) = 
(char*)zend_new_interned_string(Z_STRVAL(class_type-u.constant), 
Z_STRSIZE(class_type-u.constant) + 1, 1 TSRMLS_CC);
cur_arg_info-class_name = 
Z_STRVAL(class_type-u.constant);
 -  cur_arg_info-class_name_len = 
Z_STRLEN(class_type-u.constant);
 +  cur_arg_info-class_name_len = 
Z_STRSIZE(class_type-u.constant);
if (op == ZEND_RECV_INIT) {
-   if (Z_TYPE(initialization-u.constant) 
== IS_NULL || (Z_TYPE(initialization-u.constant) == IS_CONSTANT  
!strcasecmp(Z_STRVAL(initialization-u.constant), NULL))) {
+   if (Z_TYPE(initialization-u.constant) 
== IS_NULL || (Z_TYPE(initialization-u.constant) == IS_CONSTANT  
!strcasecmp(Z_STRVAL(initialization-u.constant), NULL)) || 
Z_TYPE(initialization-u.constant) == IS_CONSTANT_AST) {
cur_arg_info-allow_null = 1;
} else {

zend_error_noreturn(E_COMPILE_ERROR, Default value for parameters with a class 
type hint can only be NULL);
@@@ -5778,14 -5777,28 +5777,28 @@@ void zend_do_add_static_array_element(z
case IS_CONSTANT:
/* Ugly hack to denote that this value has a 
constant index */
Z_TYPE_P(element) |= IS_CONSTANT_INDEX;
 -  Z_STRVAL(offset-u.constant) = 
erealloc(Z_STRVAL(offset-u.constant), Z_STRLEN(offset-u.constant)+3);
 -  
Z_STRVAL(offset-u.constant)[Z_STRLEN(offset-u.constant)+1] = 
Z_TYPE(offset-u.constant);
 -  
Z_STRVAL(offset-u.constant)[Z_STRLEN(offset-u.constant)+2] = 0;
 -  
zend_symtable_update

[PHP-CVS] com php-src: fixed ext/xsl: ext/xsl/php_xsl.h ext/xsl/xsltprocessor.c

2013-11-29 Thread Anatol Belski
Commit:d9a036cc3065aeb45cd818ce810e316780a458b7
Author:Anatol Belski a...@php.net Thu, 28 Nov 2013 19:18:38 +0100
Parents:   9e5c10e487db678be9c37d729de4cda1f1888d12
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=d9a036cc3065aeb45cd818ce810e316780a458b7

Log:
fixed ext/xsl

Changed paths:
  M  ext/xsl/php_xsl.h
  M  ext/xsl/xsltprocessor.c


Diff:
diff --git a/ext/xsl/php_xsl.h b/ext/xsl/php_xsl.h
index e1a792e..dd34210 100644
--- a/ext/xsl/php_xsl.h
+++ b/ext/xsl/php_xsl.h
@@ -65,7 +65,7 @@ typedef struct _xsl_object {
HashTable *node_list;
php_libxml_node_object *doc;
char *profiling;
-   long securityPrefs;
+   php_int_t securityPrefs;
int securityPrefsSet;
 } xsl_object;
 
diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c
index af11104..2e0ed1f 100644
--- a/ext/xsl/xsltprocessor.c
+++ b/ext/xsl/xsltprocessor.c
@@ -137,7 +137,7 @@ static char **php_xsl_xslt_make_params(HashTable *parht, 
int xpath_params TSRMLS
int parsize;
zval **value;
char *xpath_expr, *string_key = NULL;
-   ulong num_key;
+   php_uint_t num_key;
char **params = NULL;
int i = 0;
 
@@ -162,7 +162,7 @@ static char **php_xsl_xslt_make_params(HashTable *parht, 
int xpath_params TSRMLS
if (!xpath_params) {
xpath_expr = 
php_xsl_xslt_string_to_xpathexpr(Z_STRVAL_PP(value) TSRMLS_CC);
} else {
-   xpath_expr = estrndup(Z_STRVAL_PP(value), 
Z_STRLEN_PP(value));
+   xpath_expr = estrndup(Z_STRVAL_PP(value), 
Z_STRSIZE_PP(value));
}
if (xpath_expr) {
params[i++] = string_key;
@@ -644,7 +644,8 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc)
zval *id, *docp = NULL;
xmlDoc *newdocp;
xsltStylesheetPtr sheetp;
-   int ret, ret_class_len=0;
+   int ret;
+   zend_str_size_int ret_class_len=0;
char *ret_class = NULL;
xsl_object *intern;
 
@@ -652,7 +653,7 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc)
intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
sheetp = (xsltStylesheetPtr) intern-ptr;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, o|s!, docp, 
ret_class, ret_class_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, o|S!, docp, 
ret_class, ret_class_len) == FAILURE) {
RETURN_FALSE;
}
 
@@ -701,7 +702,8 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri)
zval *id, *docp = NULL;
xmlDoc *newdocp;
xsltStylesheetPtr sheetp;
-   int ret, uri_len;
+   int ret;
+   zend_str_size_int uri_len;
char *uri;
xsl_object *intern;

@@ -709,7 +711,7 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri)
intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);
sheetp = (xsltStylesheetPtr) intern-ptr;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, op, docp, uri, 
uri_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, oP, docp, uri, 
uri_len) == FAILURE) {
RETURN_FALSE;
}
 
@@ -772,11 +774,11 @@ PHP_FUNCTION(xsl_xsltprocessor_set_parameter)
zval *array_value, **entry, *new_string;
xsl_object *intern;
char *string_key, *name, *value, *namespace;
-   ulong idx;
-   int string_key_len, namespace_len, name_len, value_len;
+   php_uint_t idx;
+   zend_str_size_int string_key_len, namespace_len, name_len, value_len;
DOM_GET_THIS(id);
 
-   if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() 
TSRMLS_CC, sa, namespace, namespace_len, array_value) == SUCCESS) {
+   if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() 
TSRMLS_CC, Sa, namespace, namespace_len, array_value) == SUCCESS) {
intern = (xsl_object *)zend_object_store_get_object(id 
TSRMLS_CC);
zend_hash_internal_pointer_reset(Z_ARRVAL_P(array_value));
 
@@ -798,7 +800,7 @@ PHP_FUNCTION(xsl_xsltprocessor_set_parameter)
}
RETURN_TRUE;
 
-   } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 
ZEND_NUM_ARGS() TSRMLS_CC, sss, namespace, namespace_len, name, name_len, 
value, value_len) == SUCCESS) {
+   } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 
ZEND_NUM_ARGS() TSRMLS_CC, SSS, namespace, namespace_len, name, name_len, 
value, value_len) == SUCCESS) {

intern = (xsl_object *)zend_object_store_get_object(id 
TSRMLS_CC);

@@ -819,14 +821,14 @@ PHP_FUNCTION(xsl_xsltprocessor_set_parameter)
 PHP_FUNCTION(xsl_xsltprocessor_get_parameter)
 {
zval *id;
-   int name_len = 0, namespace_len = 0

[PHP-CVS] com php-src: fixed ext/zip: ext/zip/php_zip.c ext/zip/php_zip.h ext/zip/zip_stream.c

2013-11-29 Thread Anatol Belski
Commit:9e5c10e487db678be9c37d729de4cda1f1888d12
Author:Anatol Belski a...@php.net Thu, 28 Nov 2013 19:02:34 +0100
Parents:   d8fbc23002b4a6edf5b0684f4a1aa560925cf653
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=9e5c10e487db678be9c37d729de4cda1f1888d12

Log:
fixed ext/zip

Changed paths:
  M  ext/zip/php_zip.c
  M  ext/zip/php_zip.h
  M  ext/zip/zip_stream.c

diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index cd1d7cd..b428f21 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -52,11 +52,11 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_close);
 #endif
 
 #if PHP_VERSION_ID  50400
-#define ARG_PATH s
+#define ARG_PATH S
 #define KEY_ARG_DC
 #define KEY_ARG_CC
 #else
-#define ARG_PATH p
+#define ARG_PATH P
 #define KEY_ARG_DC , const zend_literal *key
 #define KEY_ARG_CC , key
 #endif
@@ -101,7 +101,7 @@ static int le_zip_entry;
if (zip_set_file_comment(intern, index, NULL, 0)  0) { \
RETURN_FALSE; \
} \
-   } else if (zip_set_file_comment(intern, index, comment, comment_len)  
0) { \
+   } else if (zip_set_file_comment(intern, index, comment, 
(int)comment_len)  0) { \
RETURN_FALSE; \
} \
RETURN_TRUE;
@@ -151,13 +151,15 @@ static char * php_zip_make_relative_path(char *path, int 
path_len) /* {{{ */
 
 #ifdef PHP_ZIP_USE_OO
 /* {{{ php_zip_extract_file */
-static int php_zip_extract_file(struct zip * za, char *dest, char *file, int 
file_len TSRMLS_DC)
+static int php_zip_extract_file(struct zip * za, char *dest, char *file, 
zend_str_size_int file_len TSRMLS_DC)
 {
php_stream_statbuf ssb;
struct zip_file *zf;
struct zip_stat sb;
char b[8192];
-   int n, len, ret;
+   php_int_t n;
+   zend_str_size_int len;
+   int ret;
php_stream *stream;
char *fullpath;
char *file_dirname_fullpath;
@@ -346,12 +348,12 @@ static int php_zip_add_file(struct zip *za, const char 
*filename, size_t filenam
 }
 /* }}} */
 
-static int php_zip_parse_options(zval *options, long *remove_all_path,
-   char **remove_path, int *remove_path_len, char **add_path, int 
*add_path_len TSRMLS_DC) /* {{{ */
+static int php_zip_parse_options(zval *options, php_int_t *remove_all_path,
+   char **remove_path, zend_str_size_int *remove_path_len, char 
**add_path, zend_str_size_int *add_path_len TSRMLS_DC) /* {{{ */
 {
zval **option;
if (zend_hash_find(HASH_OF(options), remove_all_path, 
sizeof(remove_all_path), (void **)option) == SUCCESS) {
-   long opt;
+   php_int_t opt;
if (Z_TYPE_PP(option) != IS_LONG) {
zval tmp = **option;
zval_copy_ctor(tmp);
@@ -370,17 +372,17 @@ static int php_zip_parse_options(zval *options, long 
*remove_all_path,
return -1;
}
 
-   if (Z_STRLEN_PP(option)  1) {
+   if (Z_STRSIZE_PP(option)  1) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, Empty 
string given as remove_path option);
return -1;
}
 
-   if (Z_STRLEN_PP(option) = MAXPATHLEN) {
+   if (Z_STRSIZE_PP(option) = MAXPATHLEN) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
remove_path string is too long (max: %i, %i given),
-   MAXPATHLEN - 1, 
Z_STRLEN_PP(option));
+   MAXPATHLEN - 1, 
Z_STRSIZE_PP(option));
return -1;
}
-   *remove_path_len = Z_STRLEN_PP(option);
+   *remove_path_len = Z_STRSIZE_PP(option);
*remove_path = Z_STRVAL_PP(option);
}
 
@@ -390,17 +392,17 @@ static int php_zip_parse_options(zval *options, long 
*remove_all_path,
return -1;
}
 
-   if (Z_STRLEN_PP(option)  1) {
+   if (Z_STRSIZE_PP(option)  1) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, Empty 
string given as the add_path option);
return -1;
}
 
-   if (Z_STRLEN_PP(option) = MAXPATHLEN) {
+   if (Z_STRSIZE_PP(option) = MAXPATHLEN) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, add_path 
string too long (max: %i, %i given),
-   MAXPATHLEN - 1, 
Z_STRLEN_PP(option));
+   MAXPATHLEN - 1, 
Z_STRSIZE_PP(option));
return -1;
}
-   *add_path_len = Z_STRLEN_PP(option);
+   *add_path_len = Z_STRSIZE_PP(option);
*add_path = Z_STRVAL_PP(option);
}
return 1;
@@ -476,10 +478,10 @@ static char * php_zipobj_get_filename(ze_zip_object *obj 
TSRMLS_DC

[PHP-CVS] com php-src: basic fixes for ext/exif: ext/exif/exif.c

2013-11-29 Thread Anatol Belski
Commit:fd7d31973ac0a50c415fae9acf891c52f9e4779f
Author:Anatol Belski a...@php.net Thu, 28 Nov 2013 14:36:20 +0100
Parents:   4e2ddbc397f74c33c6f3514aede4e8d76bc54f53
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=fd7d31973ac0a50c415fae9acf891c52f9e4779f

Log:
basic fixes for ext/exif

Changed paths:
  M  ext/exif/exif.c


Diff:
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index f886bb4..8b3b8f7 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -2337,10 +2337,10 @@ static char * exif_get_markername(int marker)
Get headername for index or false if not defined */
 PHP_FUNCTION(exif_tagname)
 {
-   long tag;
+   php_int_t tag;
char *szTemp;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, l, tag) == 
FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, i, tag) == 
FAILURE) {
return;
}
 
@@ -3845,7 +3845,7 @@ static int exif_discard_imageinfo(image_info_type 
*ImageInfo)
 static int exif_read_file(image_info_type *ImageInfo, char *FileName, int 
read_thumbnail, int read_all TSRMLS_DC)
 {
int ret;
-   struct stat st;
+   zend_stat_t st;
 
/* Start with an empty image information structure. */
memset(ImageInfo, 0, sizeof(*ImageInfo));
@@ -3907,14 +3907,14 @@ static int exif_read_file(image_info_type *ImageInfo, 
char *FileName, int read_t
 PHP_FUNCTION(exif_read_data)
 {
char *p_name, *p_sections_needed = NULL;
-   int p_name_len, p_sections_needed_len = 0;
+   zend_str_size_int p_name_len, p_sections_needed_len = 0;
zend_bool sub_arrays=0, read_thumbnail=0, read_all=0;
 
int i, ret, sections_needed=0;
image_info_type ImageInfo;
char tmp[64], *sections_str, *s;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, p|sbb, p_name, 
p_name_len, p_sections_needed, p_sections_needed_len, sub_arrays, 
read_thumbnail) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, P|Sbb, p_name, 
p_name_len, p_sections_needed, p_sections_needed_len, sub_arrays, 
read_thumbnail) == FAILURE) {
return;
}
 
@@ -4086,7 +4086,8 @@ PHP_FUNCTION(exif_thumbnail)
 {
zval *p_width = 0, *p_height = 0, *p_imagetype = 0;
char *p_name;
-   int p_name_len, ret, arg_c = ZEND_NUM_ARGS();
+   zend_str_size_int p_name_len;
+   int ret, arg_c = ZEND_NUM_ARGS();
image_info_type ImageInfo;
 
memset(ImageInfo, 0, sizeof(ImageInfo));
@@ -4095,7 +4096,7 @@ PHP_FUNCTION(exif_thumbnail)
WRONG_PARAM_COUNT;
}
 
-   if (zend_parse_parameters(arg_c TSRMLS_CC, p|z/z/z/, p_name, 
p_name_len, p_width, p_height, p_imagetype) == FAILURE) {
+   if (zend_parse_parameters(arg_c TSRMLS_CC, P|z/z/z/, p_name, 
p_name_len, p_width, p_height, p_imagetype) == FAILURE) {
return;
}
 
@@ -4149,11 +4150,11 @@ PHP_FUNCTION(exif_thumbnail)
 PHP_FUNCTION(exif_imagetype)
 {
char *imagefile;
-   int imagefile_len;
+   zend_str_size_int imagefile_len;
php_stream * stream;
int itype = 0;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, imagefile, 
imagefile_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, S, imagefile, 
imagefile_len) == FAILURE) {
return;
}


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



[PHP-CVS] com php-src: fixed ext/fileinfo: ext/fileinfo/fileinfo.c ext/fileinfo/libmagic/apprentice.c ext/fileinfo/libmagic/cdf.c ext/fileinfo/libmagic/compress.c ext/fileinfo/libmagic/elfclass.h ext/

2013-11-29 Thread Anatol Belski
Commit:57db68e03d46da1b1a2244e001550739c8eec468
Author:Anatol Belski a...@php.net Thu, 28 Nov 2013 23:44:24 +0100
Parents:   ef54a95b7184899c63b4bd7be400c4621dd36360
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=57db68e03d46da1b1a2244e001550739c8eec468

Log:
fixed ext/fileinfo

XXX update libmagic.patch

Changed paths:
  M  ext/fileinfo/fileinfo.c
  M  ext/fileinfo/libmagic/apprentice.c
  M  ext/fileinfo/libmagic/cdf.c
  M  ext/fileinfo/libmagic/compress.c
  M  ext/fileinfo/libmagic/elfclass.h
  M  ext/fileinfo/libmagic/file.h
  M  ext/fileinfo/libmagic/fsmagic.c
  M  ext/fileinfo/libmagic/funcs.c
  M  ext/fileinfo/libmagic/readcdf.c
  M  ext/fileinfo/libmagic/readelf.c
  M  ext/fileinfo/libmagic/softmagic.c

diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c
index 799891e..9d6bf6a 100644
--- a/ext/fileinfo/fileinfo.c
+++ b/ext/fileinfo/fileinfo.c
@@ -44,7 +44,7 @@
 
 /* {{{ macros and type definitions */
 struct php_fileinfo {
-   long options;
+   php_int_t options;
struct magic_set *magic;
 };
 
@@ -177,7 +177,7 @@ zend_function_entry finfo_class_functions[] = {
 /* }}} */
 
 #define FINFO_SET_OPTION(magic, options) \
-   if (magic_setflags(magic, options) == -1) { \
+   if (magic_setflags(magic, (int)options) == -1) { \
php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to set 
option '%ld' %d:%s, \
options, magic_errno(magic), 
magic_error(magic)); \
RETURN_FALSE; \
@@ -289,14 +289,14 @@ PHP_MINFO_FUNCTION(fileinfo)
Create a new fileinfo resource. */
 PHP_FUNCTION(finfo_open)
 {
-   long options = MAGIC_NONE;
+   php_int_t options = MAGIC_NONE;
char *file = NULL;
-   int file_len = 0;
+   zend_str_size_int file_len = 0;
struct php_fileinfo *finfo;
FILEINFO_DECLARE_INIT_OBJECT(object)
char resolved_path[MAXPATHLEN];
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |lp, options, 
file, file_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |iP, options, 
file, file_len) == FAILURE) {
FILEINFO_DESTROY_OBJECT(object);
RETURN_FALSE;
}
@@ -380,18 +380,18 @@ PHP_FUNCTION(finfo_close)
Set libmagic configuration options. */
 PHP_FUNCTION(finfo_set_flags)
 {
-   long options;
+   php_int_t options;
struct php_fileinfo *finfo;
zval *zfinfo;
FILEINFO_DECLARE_INIT_OBJECT(object)
 
if (object) {
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, l, 
options) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, i, 
options) == FAILURE) {
RETURN_FALSE;
}
FILEINFO_FROM_OBJECT(finfo, object);
} else {
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rl, 
zfinfo, options) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ri, 
zfinfo, options) == FAILURE) {
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE(finfo, struct php_fileinfo *, zfinfo, -1, 
file_info, le_fileinfo);
@@ -410,9 +410,9 @@ PHP_FUNCTION(finfo_set_flags)
 
 static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int 
mimetype_emu) /* {{{ */
 {
-   long options = 0;
+   php_int_t options = 0;
char *ret_val = NULL, *buffer = NULL;
-   int buffer_len;
+   zend_str_size_int buffer_len;
struct php_fileinfo *finfo = NULL;
zval *zfinfo, *zcontext = NULL;
zval *what;
@@ -431,7 +431,7 @@ static void 
_php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
switch (Z_TYPE_P(what)) {
case IS_STRING:
buffer = Z_STRVAL_P(what);
-   buffer_len = Z_STRLEN_P(what);
+   buffer_len = Z_STRSIZE_P(what);
mode = FILEINFO_MODE_FILE;
break;
 
@@ -450,13 +450,13 @@ static void 
_php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
goto common;
}
} else if (object) {
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|lr, 
buffer, buffer_len, options, zcontext) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, S|ir, 
buffer, buffer_len, options, zcontext) == FAILURE) {
RETURN_FALSE;
}
FILEINFO_FROM_OBJECT(finfo, object);
magic = finfo-magic;
} else {
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rs|lr, 
zfinfo, buffer, buffer_len, options, zcontext) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rS|ir, 
zfinfo, buffer

[PHP-CVS] com php-src: fixed ext/curl: ext/curl/curl_file.c ext/curl/interface.c ext/curl/multi.c ext/curl/php_curl.h ext/curl/share.c

2013-11-29 Thread Anatol Belski
Commit:1e2cc1584594fd75ba742a7dd1b82a333e713890
Author:Anatol Belski a...@php.net Thu, 28 Nov 2013 13:45:09 +0100
Parents:   46448539b0482875473d66c20a8e319578e41a4d
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=1e2cc1584594fd75ba742a7dd1b82a333e713890

Log:
fixed ext/curl

Changed paths:
  M  ext/curl/curl_file.c
  M  ext/curl/interface.c
  M  ext/curl/multi.c
  M  ext/curl/php_curl.h
  M  ext/curl/share.c

diff --git a/ext/curl/curl_file.c b/ext/curl/curl_file.c
index 91dfd27..ef626da 100644
--- a/ext/curl/curl_file.c
+++ b/ext/curl/curl_file.c
@@ -32,10 +32,10 @@ PHP_CURL_API zend_class_entry *curl_CURLFile_class;
 static void curlfile_ctor(INTERNAL_FUNCTION_PARAMETERS)
 {
char *fname = NULL, *mime = NULL, *postname = NULL;
-   int fname_len, mime_len, postname_len;
+   zend_str_size_int fname_len, mime_len, postname_len;
zval *cf = return_value;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|ss, fname, 
fname_len, mime, mime_len, postname, postname_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, S|SS, fname, 
fname_len, mime, mime_len, postname, postname_len) == FAILURE) {
return;
}
 
@@ -85,9 +85,9 @@ static void curlfile_get_property(char *name, 
INTERNAL_FUNCTION_PARAMETERS)
 static void curlfile_set_property(char *name, INTERNAL_FUNCTION_PARAMETERS)
 {
char *arg = NULL;
-   int arg_len;
+   zend_str_size_int arg_len;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, arg, 
arg_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, S, arg, 
arg_len) == FAILURE) {
return;
}
zend_update_property_string(curl_CURLFile_class, getThis(), name, 
strlen(name), arg TSRMLS_CC);
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 5913159..08da632 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -154,7 +154,7 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc 
TSRMLS_DC);
 
 #define SAVE_CURL_ERROR(__handle, __err) (__handle)-err.no = (int) __err;
 
-#define CAAL(s, v) add_assoc_long_ex(return_value, s, sizeof(s), (long) v);
+#define CAAL(s, v) add_assoc_long_ex(return_value, s, sizeof(s), (php_int_t) 
v);
 #define CAAD(s, v) add_assoc_double_ex(return_value, s, sizeof(s), (double) v);
 #define CAAS(s, v) add_assoc_string_ex(return_value, s, sizeof(s), (char *) (v 
? v : ), 1);
 #define CAAZ(s, v) add_assoc_zval_ex(return_value, s, sizeof(s), (zval *) v);
@@ -165,7 +165,7 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc 
TSRMLS_DC);
 # define php_curl_ret(__ret) RETVAL_FALSE; return;
 #endif
 
-static int php_curl_option_url(php_curl *ch, const char *url, const int len 
TSRMLS_DC) /* {{{ */
+static int php_curl_option_url(php_curl *ch, const char *url, const 
zend_str_size_int len TSRMLS_DC) /* {{{ */
 {
CURLcode error = CURLE_OK;
 #if LIBCURL_VERSION_NUM  0x071100
@@ -1283,7 +1283,7 @@ static size_t curl_write(char *data, size_t size, size_t 
nmemb, void *ctx)
return fwrite(data, size, nmemb, t-fp);
case PHP_CURL_RETURN:
if (length  0) {
-   smart_str_appendl(t-buf, data, (int) length);
+   smart_str_appendl(t-buf, data, (php_int_t) 
length);
}
break;
case PHP_CURL_USER: {
@@ -1340,11 +1340,11 @@ static size_t curl_write(char *data, size_t size, 
size_t nmemb, void *ctx)
 #if LIBCURL_VERSION_NUM = 0x071500 /* Available since 7.21.0 */
 /* {{{ curl_fnmatch
  */
-static int curl_fnmatch(void *ctx, const char *pattern, const char *string)
+static php_int_t curl_fnmatch(void *ctx, const char *pattern, const char 
*string)
 {
php_curl   *ch = (php_curl *) ctx;
php_curl_fnmatch *t = ch-handlers-fnmatch;
-   int rval = CURL_FNMATCHFUNC_FAIL;
+   php_int_t rval = CURL_FNMATCHFUNC_FAIL;
switch (t-method) {
case PHP_CURL_USER: {
zval **argv[3];
@@ -1436,10 +1436,10 @@ static size_t curl_progress(void *clientp, double 
dltotal, double dlnow, double
 
ZVAL_RESOURCE(handle, ch-id);
zend_list_addref(ch-id);
-   ZVAL_LONG(zdltotal, (long) dltotal);
-   ZVAL_LONG(zdlnow, (long) dlnow);
-   ZVAL_LONG(zultotal, (long) ultotal);
-   ZVAL_LONG(zulnow, (long) ulnow);
+   ZVAL_LONG(zdltotal, (php_int_t) dltotal);
+   ZVAL_LONG(zdlnow, (php_int_t) dlnow);
+   ZVAL_LONG(zultotal, (php_int_t) ultotal);
+   ZVAL_LONG(zulnow, (php_int_t) ulnow);
 
argv[0] = handle;
argv[1] = zdltotal;
@@ -1489,7 +1489,7 @@ static size_t curl_read(char

[PHP-CVS] com php-src: fix after automerge: Zend/zend_language_parser.y

2013-11-29 Thread Anatol Belski
Commit:91e6fb75d5adfae3c6fc6fc122f631b6eabeb493
Author:Anatol Belski a...@php.net Thu, 28 Nov 2013 17:44:05 +0100
Parents:   5ced3db9714c02d2fd40370f632f23d047f51987
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=91e6fb75d5adfae3c6fc6fc122f631b6eabeb493

Log:
fix after automerge

Changed paths:
  M  Zend/zend_language_parser.y


Diff:
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index cf9ec67..f73c6aa 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -962,7 +962,7 @@ static_scalar_value:
|   static_class_name_scalar{ $$.u.ast = 
zend_ast_create_constant($1.u.constant); }
|   namespace_name  { zend_do_fetch_constant($$, NULL, 
$1, ZEND_CT, 1 TSRMLS_CC); $$.u.ast = 
zend_ast_create_constant($$.u.constant); }
|   T_NAMESPACE T_NS_SEPARATOR namespace_name { $$.op_type = 
IS_CONST; ZVAL_EMPTY_STRING($$.u.constant);  zend_do_build_namespace_name($$, 
$$, $3 TSRMLS_CC); $3 = $$; zend_do_fetch_constant($$, NULL, $3, ZEND_CT, 0 
TSRMLS_CC); $$.u.ast = zend_ast_create_constant($$.u.constant); }
-   |   T_NS_SEPARATOR namespace_name { char *tmp = 
estrndup(Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); memcpy((tmp[1]), 
Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); tmp[0] = '\\'; 
efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; 
++Z_STRLEN($2.u.constant); zend_do_fetch_constant($$, NULL, $2, ZEND_CT, 0 
TSRMLS_CC); $$.u.ast = zend_ast_create_constant($$.u.constant); }
+   |   T_NS_SEPARATOR namespace_name { char *tmp = 
estrndup(Z_STRVAL($2.u.constant), Z_STRSIZE($2.u.constant)+1); 
memcpy((tmp[1]), Z_STRVAL($2.u.constant), Z_STRSIZE($2.u.constant)+1); tmp[0] 
= '\\'; efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; 
++Z_STRSIZE($2.u.constant); zend_do_fetch_constant($$, NULL, $2, ZEND_CT, 0 
TSRMLS_CC); $$.u.ast = zend_ast_create_constant($$.u.constant); }
|   static_class_constant { $$.u.ast = 
zend_ast_create_constant($1.u.constant); }
|   T_CLASS_C   { $$.u.ast = 
zend_ast_create_constant($1.u.constant); }
|   static_operation { $$ = $1; }


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



[PHP-CVS] com php-src: fixed ext/filter: ext/filter/filter.c ext/filter/logical_filters.c ext/filter/php_filter.h ext/filter/sanitizing_filters.c

2013-11-29 Thread Anatol Belski
Commit:a7862de2db615f351fd746bd2fb87564b9631e73
Author:Anatol Belski a...@php.net Thu, 28 Nov 2013 17:16:25 +0100
Parents:   fd7d31973ac0a50c415fae9acf891c52f9e4779f
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=a7862de2db615f351fd746bd2fb87564b9631e73

Log:
fixed ext/filter

Changed paths:
  M  ext/filter/filter.c
  M  ext/filter/logical_filters.c
  M  ext/filter/php_filter.h
  M  ext/filter/sanitizing_filters.c

diff --git a/ext/filter/filter.c b/ext/filter/filter.c
index 12aebcf..d521486 100644
--- a/ext/filter/filter.c
+++ b/ext/filter/filter.c
@@ -77,7 +77,7 @@ static const filter_list_entry filter_list[] = {
 #define PARSE_SESSION 6
 #endif
 
-static unsigned int php_sapi_filter(int arg, char *var, char **val, unsigned 
int val_len, unsigned int *new_val_len TSRMLS_DC);
+static unsigned int php_sapi_filter(int arg, char *var, char **val, 
zend_str_size_uint val_len, zend_str_size_uint *new_val_len TSRMLS_DC);
 static unsigned int php_sapi_filter_init(TSRMLS_D);
 
 /* {{{ arginfo */
@@ -327,7 +327,7 @@ PHP_MINFO_FUNCTION(filter)
 }
 /* }}} */
 
-static filter_list_entry php_find_filter(long id) /* {{{ */
+static filter_list_entry php_find_filter(php_int_t id) /* {{{ */
 {
int i, size = sizeof(filter_list) / sizeof(filter_list_entry);
 
@@ -358,7 +358,7 @@ static unsigned int php_sapi_filter_init(TSRMLS_D)
return SUCCESS;
 }
 
-static void php_zval_filter(zval **value, long filter, long flags, zval 
*options, char* charset, zend_bool copy TSRMLS_DC) /* {{{ */
+static void php_zval_filter(zval **value, php_int_t filter, php_int_t flags, 
zval *options, char* charset, zend_bool copy TSRMLS_DC) /* {{{ */
 {
filter_list_entry  filter_func;
 
@@ -404,7 +404,7 @@ static void php_zval_filter(zval **value, long filter, long 
flags, zval *options
 }
 /* }}} */
 
-static unsigned int php_sapi_filter(int arg, char *var, char **val, unsigned 
int val_len, unsigned int *new_val_len TSRMLS_DC) /* {{{ */
+static unsigned int php_sapi_filter(int arg, char *var, char **val, 
zend_str_size_uint val_len, zend_str_size_uint *new_val_len TSRMLS_DC) /* {{{ */
 {
zval  new_var, raw_var;
zval *array_ptr = NULL, *orig_array_ptr = NULL;
@@ -449,7 +449,7 @@ static unsigned int php_sapi_filter(int arg, char *var, 
char **val, unsigned int
 
if (array_ptr) {
/* Store the RAW variable internally */
-   Z_STRLEN(raw_var) = val_len;
+   Z_STRSIZE(raw_var) = val_len;
Z_STRVAL(raw_var) = estrndup(*val, val_len);
Z_TYPE(raw_var) = IS_STRING;
 
@@ -458,7 +458,7 @@ static unsigned int php_sapi_filter(int arg, char *var, 
char **val, unsigned int
 
if (val_len) {
/* Register mangled variable */
-   Z_STRLEN(new_var) = val_len;
+   Z_STRSIZE(new_var) = val_len;
Z_TYPE(new_var) = IS_STRING;
 
if (IF_G(default_filter) != FILTER_UNSAFE_RAW) {
@@ -479,11 +479,11 @@ static unsigned int php_sapi_filter(int arg, char *var, 
char **val, unsigned int
 
if (retval) {
if (new_val_len) {
-   *new_val_len = Z_STRLEN(new_var);
+   *new_val_len = Z_STRSIZE(new_var);
}
efree(*val);
-   if (Z_STRLEN(new_var)) {
-   *val = estrndup(Z_STRVAL(new_var), Z_STRLEN(new_var));
+   if (Z_STRSIZE(new_var)) {
+   *val = estrndup(Z_STRVAL(new_var), Z_STRSIZE(new_var));
} else {
*val = estrdup();
}
@@ -494,7 +494,7 @@ static unsigned int php_sapi_filter(int arg, char *var, 
char **val, unsigned int
 }
 /* }}} */
 
-static void php_zval_filter_recursive(zval **value, long filter, long flags, 
zval *options, char *charset, zend_bool copy TSRMLS_DC) /* {{{ */
+static void php_zval_filter_recursive(zval **value, php_int_t filter, 
php_int_t flags, zval *options, char *charset, zend_bool copy TSRMLS_DC) /* {{{ 
*/
 {
if (Z_TYPE_PP(value) == IS_ARRAY) {
zval **element;
@@ -523,7 +523,7 @@ static void php_zval_filter_recursive(zval **value, long 
filter, long flags, zva
 }
 /* }}} */
 
-static zval *php_filter_get_storage(long arg TSRMLS_DC)/* {{{ */
+static zval *php_filter_get_storage(php_int_t arg TSRMLS_DC)/* {{{ */
 
 {
zval *array_ptr = NULL;
@@ -569,12 +569,12 @@ static zval *php_filter_get_storage(long arg TSRMLS_DC)/* 
{{{ */
  */
 PHP_FUNCTION(filter_has_var)
 {
-   longarg;
+   php_int_targ;
char   *var;
-   int var_len;
+   zend_str_size_int var_len;
zval   *array_ptr = NULL;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ls, arg, var, 
var_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, iS, arg, var, 
var_len) == FAILURE

[PHP-CVS] com php-src: basic fixes to ext/hash: ext/hash/hash.c ext/hash/hash_haval.c ext/hash/hash_joaat.c ext/hash/hash_md.c ext/hash/hash_ripemd.c ext/hash/hash_sha.c ext/hash/php_hash.h ext/hash/p

2013-11-27 Thread Anatol Belski
Commit:81158446748d3153c5defe479b3083601d366d03
Author:Anatol Belski a...@php.net Wed, 27 Nov 2013 10:33:08 +0100
Parents:   0336763311e0d4ad44ac47b88f4e39ecd8503247
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=81158446748d3153c5defe479b3083601d366d03

Log:
basic fixes to ext/hash

Changed paths:
  M  ext/hash/hash.c
  M  ext/hash/hash_haval.c
  M  ext/hash/hash_joaat.c
  M  ext/hash/hash_md.c
  M  ext/hash/hash_ripemd.c
  M  ext/hash/hash_sha.c
  M  ext/hash/php_hash.h
  M  ext/hash/php_hash_haval.h
  M  ext/hash/php_hash_joaat.h
  M  ext/hash/php_hash_md.h
  M  ext/hash/php_hash_ripemd.h
  M  ext/hash/php_hash_sha.h

diff --git a/ext/hash/hash.c b/ext/hash/hash.c
index 87f19c5..b4d48ff 100644
--- a/ext/hash/hash.c
+++ b/ext/hash/hash.c
@@ -86,7 +86,7 @@ static struct mhash_bc_entry mhash_to_hash[MHASH_NUM_ALGOS] = 
{
 
 /* Hash Registry Access */
 
-PHP_HASH_API const php_hash_ops *php_hash_fetch_ops(const char *algo, int 
algo_len) /* {{{ */
+PHP_HASH_API const php_hash_ops *php_hash_fetch_ops(const char *algo, 
zend_str_size_int algo_len) /* {{{ */
 {
php_hash_ops *ops;
char *lower = estrndup(algo, algo_len);
@@ -103,7 +103,7 @@ PHP_HASH_API const php_hash_ops *php_hash_fetch_ops(const 
char *algo, int algo_l
 
 PHP_HASH_API void php_hash_register_algo(const char *algo, const php_hash_ops 
*ops) /* {{{ */
 {
-   int algo_len = strlen(algo);
+   zend_str_size_int algo_len = strlen(algo);
char *lower = estrndup(algo, algo_len);

zend_str_tolower(lower, algo_len);
@@ -126,13 +126,13 @@ PHP_HASH_API int php_hash_copy(const void *ops, void 
*orig_context, void *dest_c
 static void php_hash_do_hash(INTERNAL_FUNCTION_PARAMETERS, int isfilename, 
zend_bool raw_output_default) /* {{{ */
 {
char *algo, *data, *digest;
-   int algo_len, data_len;
+   zend_str_size_int algo_len, data_len;
zend_bool raw_output = raw_output_default;
const php_hash_ops *ops;
void *context;
php_stream *stream = NULL;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss|b, algo, 
algo_len, data, data_len, raw_output) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, SS|b, algo, 
algo_len, data, data_len, raw_output) == FAILURE) {
return;
}
 
@@ -203,21 +203,21 @@ PHP_FUNCTION(hash_file)
 }
 /* }}} */
 
-static inline void php_hash_string_xor_char(unsigned char *out, const unsigned 
char *in, const unsigned char xor_with, const int length) {
-   int i;
+static inline void php_hash_string_xor_char(unsigned char *out, const unsigned 
char *in, const unsigned char xor_with, const zend_str_size_int length) {
+   zend_str_size_int i;
for (i=0; i  length; i++) {
out[i] = in[i] ^ xor_with;
}
 }
 
-static inline void php_hash_string_xor(unsigned char *out, const unsigned char 
*in, const unsigned char *xor_with, const int length) {
-   int i;
+static inline void php_hash_string_xor(unsigned char *out, const unsigned char 
*in, const unsigned char *xor_with, const zend_str_size_int length) {
+   zend_str_size_int i;
for (i=0; i  length; i++) {
out[i] = in[i] ^ xor_with[i];
}
 }
 
-static inline void php_hash_hmac_prep_key(unsigned char *K, const php_hash_ops 
*ops, void *context, const unsigned char *key, const int key_len) {
+static inline void php_hash_hmac_prep_key(unsigned char *K, const php_hash_ops 
*ops, void *context, const unsigned char *key, const zend_str_size_int key_len) 
{
memset(K, 0, ops-block_size);
if (key_len  ops-block_size) {
/* Reduce the key first */
@@ -231,7 +231,7 @@ static inline void php_hash_hmac_prep_key(unsigned char *K, 
const php_hash_ops *
php_hash_string_xor_char(K, K, 0x36, ops-block_size);
 }
 
-static inline void php_hash_hmac_round(unsigned char *final, const 
php_hash_ops *ops, void *context, const unsigned char *key, const unsigned char 
*data, const long data_size) {
+static inline void php_hash_hmac_round(unsigned char *final, const 
php_hash_ops *ops, void *context, const unsigned char *key, const unsigned char 
*data, const php_int_t data_size) {
ops-hash_init(context);
ops-hash_update(context, key, ops-block_size);
ops-hash_update(context, data, data_size);
@@ -241,13 +241,13 @@ static inline void php_hash_hmac_round(unsigned char 
*final, const php_hash_ops
 static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int 
isfilename, zend_bool raw_output_default) /* {{{ */
 {
char *algo, *data, *digest, *key, *K;
-   int algo_len, data_len, key_len;
+   zend_str_size_int algo_len, data_len, key_len;
zend_bool raw_output = raw_output_default;
const php_hash_ops *ops;
void *context;
php_stream *stream = NULL;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, sss|b, algo

[PHP-CVS] com php-src: fix function definition: Zend/zend_virtual_cwd.c

2013-11-27 Thread Anatol Belski
Commit:bec270ffc877815e9feffd80eecf9f807f6d6c89
Author:Anatol Belski a...@php.net Wed, 27 Nov 2013 04:58:57 -0800
Parents:   b9c19f5d74acefe1697816c8babef420499f0a14
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=bec270ffc877815e9feffd80eecf9f807f6d6c89

Log:
fix function definition

Changed paths:
  M  Zend/zend_virtual_cwd.c


Diff:
diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c
index 1fe6f1d..0b60a74 100644
--- a/Zend/zend_virtual_cwd.c
+++ b/Zend/zend_virtual_cwd.c
@@ -750,7 +750,7 @@ static inline realpath_cache_bucket* 
realpath_cache_find(const char *path, zend_
 }
 /* }}} */
 
-CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int 
path_len, time_t t TSRMLS_DC) /* {{{ */
+CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, 
zend_str_size_int path_len, time_t t TSRMLS_DC) /* {{{ */
 {
return realpath_cache_find(path, path_len, t TSRMLS_CC);
 }


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



[PHP-CVS] com php-src: fixed ext/bz2: ext/bz2/bz2.c

2013-11-26 Thread Anatol Belski
Commit:7e856fb09ba0a41ec487e4959e8c32f94da89605
Author:Anatol Belski a...@php.net Tue, 26 Nov 2013 10:54:36 +0100
Parents:   a45082e78d710a9f302efaf817400438759f6b23
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=7e856fb09ba0a41ec487e4959e8c32f94da89605

Log:
fixed ext/bz2

Changed paths:
  M  ext/bz2/bz2.c


Diff:
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c
index 4adaa47..e6448d7 100644
--- a/ext/bz2/bz2.c
+++ b/ext/bz2/bz2.c
@@ -328,10 +328,10 @@ static PHP_MINFO_FUNCTION(bz2)
 static PHP_FUNCTION(bzread)
 {
zval *bz;
-   long len = 1024;
+   php_int_t len = 1024;
php_stream *stream;
 
-   if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r|l, 
bz, len)) {
+   if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r|i, 
bz, len)) {
RETURN_FALSE;
}

@@ -343,15 +343,15 @@ static PHP_FUNCTION(bzread)
}
 
Z_STRVAL_P(return_value) = emalloc(len + 1);
-   Z_STRLEN_P(return_value) = php_stream_read(stream, 
Z_STRVAL_P(return_value), len);
+   Z_STRSIZE_P(return_value) = php_stream_read(stream, 
Z_STRVAL_P(return_value), len);

-   if (Z_STRLEN_P(return_value)  0) {
+   if (Z_STRSIZE_P(return_value)  0) {
efree(Z_STRVAL_P(return_value));
php_error_docref(NULL TSRMLS_CC, E_WARNING, could not read 
valid bz2 data from stream);
RETURN_FALSE;   
}

-   Z_STRVAL_P(return_value)[Z_STRLEN_P(return_value)] = 0;
+   Z_STRVAL_P(return_value)[Z_STRSIZE_P(return_value)] = 0;
Z_TYPE_P(return_value) = IS_STRING;
 }
 /* }}} */
@@ -362,12 +362,12 @@ static PHP_FUNCTION(bzopen)
 {
zval**file;   /* The file to open */
char *mode;   /* The mode to open the stream with */
-   int  mode_len;
+   zend_str_size_int  mode_len;
 
BZFILE   *bz; /* The compressed file stream */
php_stream *stream = NULL;

-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Zs, file, 
mode, mode_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ZS, file, 
mode, mode_len) == FAILURE) {
return;
}
 
@@ -378,7 +378,7 @@ static PHP_FUNCTION(bzopen)
 
/* If it's not a resource its a string containing the filename to open 
*/
if (Z_TYPE_PP(file) == IS_STRING) {
-   if (Z_STRLEN_PP(file) == 0) {
+   if (Z_STRSIZE_PP(file) == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, filename 
cannot be empty);
RETURN_FALSE;
}
@@ -479,19 +479,19 @@ static PHP_FUNCTION(bzerror)
 static PHP_FUNCTION(bzcompress)
 {
char *source;  /* Source data to compress */
-   long  zblock_size = 0; /* Optional block size to use */
-   long  zwork_factor = 0;/* Optional work factor to use */
+   php_int_t  zblock_size = 0; /* Optional block size to use */
+   php_int_t  zwork_factor = 0;/* Optional work factor to use 
*/
char *dest = NULL; /* Destination to place the 
compressed data into */
int   error,   /* Error Container */
  block_size  = 4, /* Block size for 
compression algorithm */
  work_factor = 0, /* Work factor for 
compression algorithm */
  argc;/* Argument count */
-   int   source_len;  /* Length of the source data */
+   zend_str_size_int   source_len;  /* Length of the 
source data */
unsigned int  dest_len;/* Length of the destination buffer 
*/ 
 
argc = ZEND_NUM_ARGS();
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|ll, source, 
source_len, zblock_size, zwork_factor) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, S|ii, source, 
source_len, zblock_size, zwork_factor) == FAILURE) {
return;
}
 
@@ -532,8 +532,9 @@ static PHP_FUNCTION(bzcompress)
 static PHP_FUNCTION(bzdecompress)
 {
char *source, *dest;
-   int source_len, error;
-   long small = 0;
+   zend_str_size_int source_len;
+   int error;
+   php_int_t small = 0;
 #if defined(PHP_WIN32)
unsigned __int64 size = 0;
 #else
@@ -541,7 +542,7 @@ static PHP_FUNCTION(bzdecompress)
 #endif
bz_stream bzs;
 
-   if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|l, 
source, source_len, small)) {
+   if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, S|i, 
source, source_len, small)) {
RETURN_FALSE;
}


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



[PHP-CVS] com php-src: converted simplexml ext: ext/simplexml/simplexml.c

2013-11-21 Thread Anatol Belski
Commit:015d179e4912f42376b2793a11f24034c873a5fc
Author:Anatol Belski a...@php.net Thu, 21 Nov 2013 16:17:10 +0100
Parents:   607f97cefaa852ae3f33d77ee6ad040047f1394b
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=015d179e4912f42376b2793a11f24034c873a5fc

Log:
converted simplexml ext

Changed paths:
  M  ext/simplexml/simplexml.c

diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index eba46b9..c52f0b5 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -140,9 +140,9 @@ static inline int match_ns(php_sxe_object *sxe, xmlNodePtr 
node, xmlChar *name,
 }
 /* }}} */
 
-static xmlNodePtr sxe_get_element_by_offset(php_sxe_object *sxe, long offset, 
xmlNodePtr node, long *cnt) /* {{{ */
+static xmlNodePtr sxe_get_element_by_offset(php_sxe_object *sxe, php_int_t 
offset, xmlNodePtr node, php_int_t *cnt) /* {{{ */
 {
-   long nodendx = 0;
+   php_int_t nodendx = 0;
 
if (sxe-iter.type == SXE_ITER_NONE) {
if (offset == 0) {
@@ -332,7 +332,7 @@ static zval * sxe_prop_dim_read(zval *object, zval *member, 
zend_bool elements,

php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, node, NULL 
TSRMLS_CC);
}
if (!member || Z_TYPE_P(member) == IS_LONG) {
-   long cnt = 0;
+   php_int_t cnt = 0;
xmlNodePtr mynode = node;
 
if (sxe-iter.type == SXE_ITER_CHILD) {
@@ -462,7 +462,7 @@ static int sxe_prop_dim_write(zval *object, zval *member, 
zval *value, zend_bool
int nodendx = 0;
int test = 0;
int new_value = 0;
-   longcnt = 0;
+   php_int_tcnt = 0;
int retval = SUCCESS;
zvaltmp_zv, trim_zv, value_copy;
 
@@ -485,12 +485,12 @@ static int sxe_prop_dim_write(zval *object, zval *member, 
zval *value, zend_bool
trim_zv = *member;
zval_copy_ctor(trim_zv);
convert_to_string(trim_zv);
-   php_trim(Z_STRVAL(trim_zv), Z_STRLEN(trim_zv), NULL, 0, 
tmp_zv, 3 TSRMLS_CC);
+   php_trim(Z_STRVAL(trim_zv), Z_STRSIZE(trim_zv), NULL, 
0, tmp_zv, 3 TSRMLS_CC);
zval_dtor(trim_zv);
member = tmp_zv;
}
 
-   if (!Z_STRLEN_P(member)) {
+   if (!Z_STRSIZE_P(member)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Cannot 
write or create unnamed %s, attribs ? attribute : element);
if (member == tmp_zv) {
zval_dtor(tmp_zv);
@@ -1037,7 +1037,7 @@ static void sxe_properties_add(HashTable *rv, char *name, 
int namelen, zval *val
 {
zval  **data_ptr;
zval  *newptr;
-   ulong h = zend_hash_func(name, namelen);
+   php_uint_t h = zend_hash_func(name, namelen);
 
if (zend_hash_quick_find(rv, name, namelen, h, (void **) data_ptr) == 
SUCCESS) {
if (Z_TYPE_PP(data_ptr) == IS_ARRAY) {
@@ -1246,7 +1246,7 @@ SXE_METHOD(xpath)
php_sxe_object*sxe;
zval  *value;
char  *query;
-   intquery_len;
+   zend_str_size_intquery_len;
inti;
intnsnbr = 0;
xmlNsPtr  *ns = NULL;
@@ -1254,7 +1254,7 @@ SXE_METHOD(xpath)
xmlNodeSetPtr  result;
xmlNodePtr nodeptr;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, query, 
query_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, S, query, 
query_len) == FAILURE) {
return;
}
 
@@ -1332,10 +1332,10 @@ SXE_METHOD(xpath)
 SXE_METHOD(registerXPathNamespace)
 {
php_sxe_object*sxe;
-   int prefix_len, ns_uri_len;
+   zend_str_size_int prefix_len, ns_uri_len;
char *prefix, *ns_uri;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss, prefix, 
prefix_len, ns_uri, ns_uri_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, SS, prefix, 
prefix_len, ns_uri, ns_uri_len) == FAILURE) {
return;
}
 
@@ -1360,16 +1360,16 @@ SXE_METHOD(asXML)
xmlNodePtr  node;
xmlOutputBufferPtr  outbuf;
xmlChar*strval;
-   int strval_len;
+   zend_str_size_int strval_len;
char   *filename;
-   int filename_len;
+   zend_str_size_int filename_len;
 
if (ZEND_NUM_ARGS()  1) {
RETURN_FALSE;
}
 
if (ZEND_NUM_ARGS

[PHP-CVS] com php-src: first shot for php-cgi for size_t and php_int_t: main/SAPI.h sapi/cgi/cgi_main.c sapi/cgi/fastcgi.c sapi/cgi/fastcgi.h sapi/cli/php_cli_server.c

2013-11-21 Thread Anatol Belski
Commit:51003463ef0c67ff83e40cbbc66464c86a7e0feb
Author:Anatol Belski a...@php.net Thu, 21 Nov 2013 13:26:56 +0100
Parents:   fb27e16f01a4b96deaec6eb237f26753ae2a27ee
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=51003463ef0c67ff83e40cbbc66464c86a7e0feb

Log:
first shot for php-cgi for size_t and php_int_t

Changed paths:
  M  main/SAPI.h
  M  sapi/cgi/cgi_main.c
  M  sapi/cgi/fastcgi.c
  M  sapi/cgi/fastcgi.h
  M  sapi/cli/php_cli_server.c

diff --git a/main/SAPI.h b/main/SAPI.h
index 124d0cc..7d27b65 100644
--- a/main/SAPI.h
+++ b/main/SAPI.h
@@ -237,7 +237,7 @@ struct _sapi_module_struct {
int (*send_headers)(sapi_headers_struct *sapi_headers TSRMLS_DC);
void (*send_header)(sapi_header_struct *sapi_header, void 
*server_context TSRMLS_DC);
 
-   zend_str_size_int (*read_post)(char *buffer, uint count_bytes 
TSRMLS_DC);
+   zend_str_size_int (*read_post)(char *buffer, zend_str_size_uint 
count_bytes TSRMLS_DC);
char *(*read_cookies)(TSRMLS_D);
 
void (*register_server_variables)(zval *track_vars_array TSRMLS_DC);
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 422dabb..b1a703e 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -269,10 +269,10 @@ static void print_extensions(TSRMLS_D)
 #define STDOUT_FILENO 1
 #endif
 
-static inline size_t sapi_cgi_single_write(const char *str, uint str_length 
TSRMLS_DC)
+static inline size_t sapi_cgi_single_write(const char *str, zend_str_size_uint 
str_length TSRMLS_DC)
 {
 #ifdef PHP_WRITE_STDOUT
-   long ret;
+   int ret;
 
ret = write(STDOUT_FILENO, str, str_length);
if (ret = 0) return 0;
@@ -285,11 +285,11 @@ static inline size_t sapi_cgi_single_write(const char 
*str, uint str_length TSRM
 #endif
 }
 
-static int sapi_cgi_ub_write(const char *str, uint str_length TSRMLS_DC)
+static zend_str_size_int sapi_cgi_ub_write(const char *str, zend_str_size_uint 
str_length TSRMLS_DC)
 {
const char *ptr = str;
-   uint remaining = str_length;
-   size_t ret;
+   zend_str_size_uint remaining = str_length;
+   zend_str_size_int ret;
 
while (remaining  0) {
ret = sapi_cgi_single_write(ptr, remaining TSRMLS_CC);
@@ -304,14 +304,14 @@ static int sapi_cgi_ub_write(const char *str, uint 
str_length TSRMLS_DC)
return str_length;
 }
 
-static int sapi_fcgi_ub_write(const char *str, uint str_length TSRMLS_DC)
+static zend_str_size_int sapi_fcgi_ub_write(const char *str, 
zend_str_size_uint str_length TSRMLS_DC)
 {
const char *ptr = str;
-   uint remaining = str_length;
+   zend_str_size_uint remaining = str_length;
fcgi_request *request = (fcgi_request*) SG(server_context);
 
while (remaining  0) {
-   long ret = fcgi_write(request, FCGI_STDOUT, ptr, remaining);
+   php_int_t ret = fcgi_write(request, FCGI_STDOUT, ptr, 
remaining);
 
if (ret = 0) {
php_handle_aborted_connection();
@@ -503,14 +503,13 @@ static int sapi_cgi_send_headers(sapi_headers_struct 
*sapi_headers TSRMLS_DC)
 # define STDIN_FILENO 0
 #endif
 
-static int sapi_cgi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
+static zend_str_size_int sapi_cgi_read_post(char *buffer, zend_str_size_uint 
count_bytes TSRMLS_DC)
 {
-   uint read_bytes = 0;
-   int tmp_read_bytes;
+   zend_str_size_uint read_bytes = 0;
 
count_bytes = MIN(count_bytes, SG(request_info).content_length - 
SG(read_post_bytes));
while (read_bytes  count_bytes) {
-   tmp_read_bytes = read(STDIN_FILENO, buffer + read_bytes, 
count_bytes - read_bytes);
+   int tmp_read_bytes = read(STDIN_FILENO, buffer + read_bytes, 
count_bytes - read_bytes);
if (tmp_read_bytes = 0) {
break;
}
@@ -519,7 +518,7 @@ static int sapi_cgi_read_post(char *buffer, uint 
count_bytes TSRMLS_DC)
return read_bytes;
 }
 
-static int sapi_fcgi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
+static zend_str_size_int sapi_fcgi_read_post(char *buffer, zend_str_size_uint 
count_bytes TSRMLS_DC)
 {
uint read_bytes = 0;
int tmp_read_bytes;
@@ -616,11 +615,11 @@ static char *sapi_fcgi_read_cookies(TSRMLS_D)
return FCGI_GETENV(request, HTTP_COOKIE);
 }
 
-static void cgi_php_load_env_var(char *var, unsigned int var_len, char *val, 
unsigned int val_len, void *arg TSRMLS_DC)
+static void cgi_php_load_env_var(char *var, zend_str_size_uint var_len, char 
*val, zend_str_size_uint val_len, void *arg TSRMLS_DC)
 {
zval *array_ptr = (zval*)arg;   
int filter_arg = (array_ptr == 
PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER;
-   unsigned int new_val_len;
+   zend_str_size_uint new_val_len;
 
if (sapi_module.input_filter(filter_arg, var, val, strlen(val), 
new_val_len TSRMLS_CC

[PHP-CVS] com php-src: fixed libxml: ext/libxml/libxml.c

2013-11-21 Thread Anatol Belski
Commit:607f97cefaa852ae3f33d77ee6ad040047f1394b
Author:Anatol Belski a...@php.net Thu, 21 Nov 2013 15:08:39 +0100
Parents:   51003463ef0c67ff83e40cbbc66464c86a7e0feb
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=607f97cefaa852ae3f33d77ee6ad040047f1394b

Log:
fixed libxml

Changed paths:
  M  ext/libxml/libxml.c


Diff:
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index 05b8df4..418ec11 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -88,7 +88,7 @@ static PHP_MINIT_FUNCTION(libxml);
 static PHP_RINIT_FUNCTION(libxml);
 static PHP_MSHUTDOWN_FUNCTION(libxml);
 static PHP_MINFO_FUNCTION(libxml);
-static int php_libxml_post_deactivate();
+static int php_libxml_post_deactivate(void);
 
 /* }}} */
 
@@ -356,13 +356,13 @@ static void 
*php_libxml_streams_IO_open_write_wrapper(const char *filename)
 static int php_libxml_streams_IO_read(void *context, char *buffer, int len)
 {
TSRMLS_FETCH();
-   return php_stream_read((php_stream*)context, buffer, len);
+   return (int)php_stream_read((php_stream*)context, buffer, len);
 }
 
 static int php_libxml_streams_IO_write(void *context, const char *buffer, int 
len)
 {
TSRMLS_FETCH();
-   return php_stream_write((php_stream*)context, buffer, len);
+   return (int)php_stream_write((php_stream*)context, buffer, len);
 }
 
 static int php_libxml_streams_IO_close(void *context)
@@ -515,7 +515,7 @@ void php_libxml_issue_error(int level, const char *msg 
TSRMLS_DC)
 static void php_libxml_internal_error_handler(int error_type, void *ctx, const 
char **msg, va_list ap)
 {
char *buf;
-   int len, len_iter, output = 0;
+   zend_str_size_int len, len_iter, output = 0;
 
TSRMLS_FETCH();
 
@@ -876,7 +876,7 @@ static PHP_MSHUTDOWN_FUNCTION(libxml)
return SUCCESS;
 }
 
-static int php_libxml_post_deactivate()
+static int php_libxml_post_deactivate(void)
 {
TSRMLS_FETCH();
/* reset libxml generic error handling */


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



[PHP-CVS] com php-src: fixed the skipif part: sapi/cli/tests/upload_2G.phpt

2013-11-21 Thread Anatol Belski
Commit:fb27e16f01a4b96deaec6eb237f26753ae2a27ee
Author:Anatol Belski a...@php.net Thu, 21 Nov 2013 11:54:35 +0100
Parents:   c63f8bdfba87edeb2c31c043b04977fb8275490d
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=fb27e16f01a4b96deaec6eb237f26753ae2a27ee

Log:
fixed the skipif part

Changed paths:
  M  sapi/cli/tests/upload_2G.phpt


Diff:
diff --git a/sapi/cli/tests/upload_2G.phpt b/sapi/cli/tests/upload_2G.phpt
index b8416ea..a172ccd 100644
--- a/sapi/cli/tests/upload_2G.phpt
+++ b/sapi/cli/tests/upload_2G.phpt
@@ -8,18 +8,36 @@ if (PHP_INT_SIZE  8) {
die(skip need PHP_INT_SIZE=8);
 }
 
-if ($f = fopen(/proc/meminfo,r)) {
+$enough_free_ram = false;
+if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
+   exec(c:\\Windows\\System32\\systeminfo.exe, $out);
+
+   foreach($out as $ln) {
+   $s = Virtual Memory: Available:;
+   if (false !== strpos($ln, $s)) {
+   $p = /$s\s*([0-9,\.]+)\*s/;
+   if (preg_match(/$s\s*([0-9,\.]+)/, $ln, $m)) {
+   $ram = str_replace(array(,, .), , 
$m[1])/1024;
+   if ($ram  3) {
+   $enough_free_ram = true;
+   break;
+   }
+   }
+   }
+   }
+} else if ($f = fopen(/proc/meminfo,r)) {
while (!feof($f)) {
if (!strncmp($line = fgets($f), MemFree, 7)) {
if (substr($line,8)/1024/1024  3) {
$enough_free_ram = true;
+   break;
}
}
}
 }
 
 if (empty($enough_free_ram)) {
-   die(need +3G free RAM);
+   die(skip need +3G free RAM);
 }
 ?
 --FILE--


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



[PHP-CVS] com php-src: fixed test: ext/standard/tests/serialize/serialization_error_002.phpt

2013-11-21 Thread Anatol Belski
Commit:345032946c9143d0d343ef1b5de12b6130780fdf
Author:Anatol Belski a...@php.net Thu, 21 Nov 2013 21:24:47 +0100
Parents:   ce098222696b505b93faea37414446740dbd9846
Branches:  PHP-5.4 PHP-5.5 PHP-5.6 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=345032946c9143d0d343ef1b5de12b6130780fdf

Log:
fixed test

Changed paths:
  M  ext/standard/tests/serialize/serialization_error_002.phpt


Diff:
diff --git a/ext/standard/tests/serialize/serialization_error_002.phpt 
b/ext/standard/tests/serialize/serialization_error_002.phpt
index 6b4f6e3..70f35e4 100644
--- a/ext/standard/tests/serialize/serialization_error_002.phpt
+++ b/ext/standard/tests/serialize/serialization_error_002.phpt
@@ -43,7 +43,7 @@ echo Done;
 *** Testing unserialize() error/boolean distinction ***
 string(4) b:0;
 
-Notice: unserialize(): Error at offset 0 of 27 bytes in 
%s/serialization_error_002.php on line 20
+Notice: unserialize(): Error at offset 0 of 27 bytes in 
%s%eserialization_error_002.php on line 20
 bool(false)
 bool(false)
 unserialize error and deserialized false are identical? 1


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.5' into PHP-5.6: Zend/zend_operators.h

2013-11-20 Thread Anatol Belski
Commit:c694d1df7babdea108c96dde03db81b1e3e26af6
Author:Anatol Belski a...@php.net Wed, 20 Nov 2013 10:12:06 +0100
Parents:   bf91f101a6a869d3d93647622449f5c40b95b0d1 
18b2b2a0bca38cba7d17ac931362249975b79f65
Branches:  PHP-5.6 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=c694d1df7babdea108c96dde03db81b1e3e26af6

Log:
Merge branch 'PHP-5.5' into PHP-5.6

* PHP-5.5:
  permanently deactivate that place, not on runtime only

Changed paths:
  MM  Zend/zend_operators.h


Diff:



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



[PHP-CVS] com php-src: fixed key length datatype: sapi/cli/php_cli_server.c

2013-11-20 Thread Anatol Belski
Commit:726d803375c082e2e3d517bef5018caf565bc55b
Author:Anatol Belski a...@php.net Tue, 19 Nov 2013 14:51:20 +0100
Parents:   e7b54a3aa7b0ce14600838a86f89b170da16efad
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=726d803375c082e2e3d517bef5018caf565bc55b

Log:
fixed key length datatype

Changed paths:
  M  sapi/cli/php_cli_server.c


Diff:
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index c24746e..cc133a7 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -477,7 +477,7 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */
php_cli_server_client *client;
HashTable *headers;
char *key;
-   uint key_len;
+   zend_str_size key_len;
char **value_pointer;
HashPosition pos;


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



[PHP-CVS] com php-src: removed debugbreak: ext/iconv/iconv.c

2013-11-20 Thread Anatol Belski
Commit:5e3d047a074eb22ec97b1bfd87c58cf00d01d18e
Author:Anatol Belski a...@php.net Wed, 20 Nov 2013 17:15:01 +0100
Parents:   7156c5cb393b4a55d9c82b40218fae9b24c1816f
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=5e3d047a074eb22ec97b1bfd87c58cf00d01d18e

Log:
removed debugbreak

Changed paths:
  M  ext/iconv/iconv.c


Diff:
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index b706104..a5e6046 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -2043,7 +2043,7 @@ PHP_FUNCTION(iconv_strpos)
php_iconv_err_t err;
 
zend_str_size_uint retval;
-__debugbreak();
+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, SS|iS,
haystk, haystk_len, ndl, ndl_len,
offset, charset, charset_len) == FAILURE) {


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



[PHP-CVS] com php-src: datatype fixes for iconv: ext/iconv/iconv.c main/SAPI.c main/SAPI.h

2013-11-20 Thread Anatol Belski
Commit:7156c5cb393b4a55d9c82b40218fae9b24c1816f
Author:Anatol Belski a...@php.net Wed, 20 Nov 2013 17:11:10 +0100
Parents:   6a60a038593db369f6275b440350a12aaa9649c1
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=7156c5cb393b4a55d9c82b40218fae9b24c1816f

Log:
datatype fixes for iconv

Changed paths:
  M  ext/iconv/iconv.c
  M  main/SAPI.c
  M  main/SAPI.h

diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index 21d775c..b706104 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -196,15 +196,15 @@ static php_iconv_err_t _php_iconv_appendc(smart_str *d, 
const char c, iconv_t cd
 
 static void _php_iconv_show_error(php_iconv_err_t err, const char 
*out_charset, const char *in_charset TSRMLS_DC);
 
-static php_iconv_err_t _php_iconv_strlen(unsigned int *pretval, const char 
*str, size_t nbytes, const char *enc);
+static php_iconv_err_t _php_iconv_strlen(zend_str_size_uint *pretval, const 
char *str, size_t nbytes, const char *enc);
 
-static php_iconv_err_t _php_iconv_substr(smart_str *pretval, const char *str, 
size_t nbytes, int offset, int len, const char *enc);
+static php_iconv_err_t _php_iconv_substr(smart_str *pretval, const char *str, 
size_t nbytes, php_int_t offset, php_int_t len, const char *enc);
 
-static php_iconv_err_t _php_iconv_strpos(unsigned int *pretval, const char 
*haystk, size_t haystk_nbytes, const char *ndl, size_t ndl_nbytes, int offset, 
const char *enc);
+static php_iconv_err_t _php_iconv_strpos(zend_str_size_uint *pretval, const 
char *haystk, size_t haystk_nbytes, const char *ndl, size_t ndl_nbytes, 
php_int_t offset, const char *enc);
 
-static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char 
*fname, size_t fname_nbytes, const char *fval, size_t fval_nbytes, unsigned int 
max_line_len, const char *lfchars, php_iconv_enc_scheme_t enc_scheme, const 
char *out_charset, const char *enc);
+static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char 
*fname, size_t fname_nbytes, const char *fval, size_t fval_nbytes, 
zend_str_size_uint max_line_len, const char *lfchars, php_iconv_enc_scheme_t 
enc_scheme, const char *out_charset, const char *enc);
 
-static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char 
*str, size_t str_nbytes, const char *enc, const char **next_pos, int mode);
+static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char 
*str, size_t str_nbytes, const char *enc, const char **next_pos, php_int_t 
mode);
 
 static php_iconv_err_t php_iconv_stream_filter_register_factory(TSRMLS_D);
 static php_iconv_err_t php_iconv_stream_filter_unregister_factory(TSRMLS_D);
@@ -332,7 +332,8 @@ static php_output_handler 
*php_iconv_output_handler_init(const char *handler_nam
 static int php_iconv_output_handler(void **nothing, php_output_context 
*output_context)
 {
char *s, *content_type, *mimetype = NULL;
-   int output_status, mimetype_len = 0;
+   int output_status;
+   zend_str_size_int mimetype_len = 0;
PHP_OUTPUT_TSRMLS(output_context);
 
if (output_context-op  PHP_OUTPUT_HANDLER_START) {
@@ -353,13 +354,13 @@ static int php_iconv_output_handler(void **nothing, 
php_output_context *output_c
}
 
if (mimetype != NULL  !(output_context-op  
PHP_OUTPUT_HANDLER_CLEAN)) {
-   int len;
+   php_int_t len;
char *p = strstr(ICONVG(output_encoding), //);
 
if (p) {
-   len = spprintf(content_type, 0, 
Content-Type:%.*s; charset=%.*s, mimetype_len ? mimetype_len : (int) 
strlen(mimetype), mimetype, (int)(p - ICONVG(output_encoding)), 
ICONVG(output_encoding));
+   len = spprintf(content_type, 0, 
Content-Type:%.*s; charset=%.*s, mimetype_len ? mimetype_len : 
(zend_str_size_int) strlen(mimetype), mimetype, (zend_str_size_int)(p - 
ICONVG(output_encoding)), ICONVG(output_encoding));
} else {
-   len = spprintf(content_type, 0, 
Content-Type:%.*s; charset=%s, mimetype_len ? mimetype_len : (int) 
strlen(mimetype), mimetype, ICONVG(output_encoding));
+   len = spprintf(content_type, 0, 
Content-Type:%.*s; charset=%s, mimetype_len ? mimetype_len : 
(zend_str_size_int) strlen(mimetype), mimetype, ICONVG(output_encoding));
}
if (content_type  SUCCESS == 
sapi_add_header(content_type, len, 0)) {
SG(sapi_headers).send_default_content_type = 0;
@@ -639,7 +640,7 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char 
*in_p, size_t in_len,
 /* }}} */
 
 /* {{{ _php_iconv_strlen() */
-static php_iconv_err_t _php_iconv_strlen(unsigned int *pretval, const char 
*str, size_t nbytes, const char *enc)
+static php_iconv_err_t _php_iconv_strlen(zend_str_size_uint *pretval, const 
char *str

[PHP-CVS] com php-src: fixed undefined behaviour in array_sum: ext/standard/array.c

2013-11-15 Thread Anatol Belski
Commit:a80567a9290523b1db9dcb9422ecc970a978dd16
Author:Anatol Belski a...@php.net Thu, 14 Nov 2013 14:59:08 +0100
Parents:   e93c9ae26a454c67f84d022f510b8d582d73a9e8
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=a80567a9290523b1db9dcb9422ecc970a978dd16

Log:
fixed undefined behaviour in array_sum

The exact situation is when passing same pointer twice to
fast_add_function(). This prorably has to be fixed in mainstream too.

Changed paths:
  M  ext/standard/array.c


Diff:
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 295d98c..5df4e14 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -4072,7 +4072,8 @@ PHP_FUNCTION(array_sum)
 {
zval *input,
 **entry,
-entry_n;
+entry_n,
+entry_m;
HashPosition pos;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, a, input) == 
FAILURE) {
@@ -4088,10 +4089,12 @@ PHP_FUNCTION(array_sum)
if (Z_TYPE_PP(entry) == IS_ARRAY || Z_TYPE_PP(entry) == 
IS_OBJECT) {
continue;
}
+   Z_LVAL(entry_m) = Z_LVAL_P(return_value);
+   Z_TYPE(entry_m) = Z_TYPE_P(return_value);
entry_n = **entry;
zval_copy_ctor(entry_n);
convert_scalar_to_number(entry_n TSRMLS_CC);
-   fast_add_function(return_value, return_value, entry_n 
TSRMLS_CC);
+   fast_add_function(return_value, entry_m, entry_n TSRMLS_CC);
}
 }
 /* }}} */


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



[PHP-CVS] com php-src: fixed 64 bit pass by ref: Zend/zend_object_handlers.h main/php_variables.c main/streams/memory.c win32/registry.c win32/sendmail.c

2013-11-09 Thread Anatol Belski
Commit:27a86a4402022bf5ba180a6dbb46cf86c9a05b72
Author:Anatol Belski a...@php.net Sat, 9 Nov 2013 02:09:14 +0100
Parents:   5615326e1f216ee1d8884bdab89f0b79dfb76218
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=27a86a4402022bf5ba180a6dbb46cf86c9a05b72

Log:
fixed 64 bit pass by ref

Changed paths:
  M  Zend/zend_object_handlers.h
  M  main/php_variables.c
  M  main/streams/memory.c
  M  win32/registry.c
  M  win32/sendmail.c


Diff:
diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h
index be30af2..7fb6a92 100644
--- a/Zend/zend_object_handlers.h
+++ b/Zend/zend_object_handlers.h
@@ -108,7 +108,7 @@ typedef int (*zend_object_cast_t)(zval *readobj, zval 
*retval, int type TSRMLS_D
 
 /* updates *count to hold the number of elements present and returns SUCCESS.
  * Returns FAILURE if the object does not have any sense of overloaded 
dimensions */
-typedef int (*zend_object_count_elements_t)(zval *object, long *count 
TSRMLS_DC);
+typedef int (*zend_object_count_elements_t)(zval *object, zend_int_t *count 
TSRMLS_DC);
 
 typedef int (*zend_object_get_closure_t)(zval *obj, zend_class_entry **ce_ptr, 
union _zend_function **fptr_ptr, zval **zobj_ptr TSRMLS_DC);
 
diff --git a/main/php_variables.c b/main/php_variables.c
index 97d5ea1..22eae39 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -243,8 +243,7 @@ static zend_bool add_post_var(zval *arr, post_var_data_t 
*var, zend_bool eof TSR
 {
char *ksep, *vsep;
size_t klen, vlen;
-   /* FIXME: string-size_t */
-   unsigned int new_vlen;
+   zend_str_size_uint new_vlen;
 
if (var-ptr = var-end) {
return 0;
diff --git a/main/streams/memory.c b/main/streams/memory.c
index ac6e1ee..ba51136 100644
--- a/main/streams/memory.c
+++ b/main/streams/memory.c
@@ -22,7 +22,7 @@
 #include php.h
 
 PHPAPI int php_url_decode(char *str, int len);
-PHPAPI unsigned char *php_base64_decode(const unsigned char *str, int length, 
int *ret_length);
+PHPAPI unsigned char *php_base64_decode(const unsigned char *str, int length, 
zend_str_size_int *ret_length);
 
 /* Memory streams use a dynamic memory buffer to emulate a stream.
  * You can use php_stream_memory_open to create a readonly stream
diff --git a/win32/registry.c b/win32/registry.c
index e13a0fc..66ee096 100644
--- a/win32/registry.c
+++ b/win32/registry.c
@@ -100,7 +100,7 @@ static int LoadDirectory(HashTable *directories, HKEY key, 
char *path, int path_
if (parent_ht) {
HashPosition pos;
char *index;
-   uint index_len;
+   zend_str_size_uint index_len;
zend_uint_t num;
zval **tmpdata;
 
@@ -172,7 +172,7 @@ static void delete_internal_hashtable(void *data)
 void UpdateIniFromRegistry(char *path TSRMLS_DC)
 {
char *p, *orig_path;
-   int path_len;
+   zend_str_size_int path_len;
HashTable **pht;
 
if(!path) {
@@ -253,7 +253,7 @@ void UpdateIniFromRegistry(char *path TSRMLS_DC)
HashTable *ht = *pht;
HashPosition pos;
char *index;
-   uint index_len;
+   zend_str_size_uint index_len;
zend_uint_t num;
zval **data;
 
diff --git a/win32/sendmail.c b/win32/sendmail.c
index 93e68f4..da33651 100644
--- a/win32/sendmail.c
+++ b/win32/sendmail.c
@@ -157,7 +157,7 @@ static char *php_win32_mail_trim_header(char *header 
TSRMLS_DC)
 #if HAVE_PCRE || HAVE_BUNDLED_PCRE

char *result, *result2;
-   int result_len;
+   zend_str_size_int result_len;
zval *replace;
 
if (!header) {
@@ -388,7 +388,7 @@ static int SendText(char *RPath, char *Subject, char 
*mailTo, char *mailCc, char
char *server_response = NULL;
char *stripped_header  = NULL;
char *data_cln;
-   int data_cln_len;
+   zend_str_size_int data_cln_len;
 
/* check for NULL parameters */
if (data == NULL)


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



[PHP-CVS] com php-src: too much for a compare func: ext/standard/array.c

2013-11-09 Thread Anatol Belski
Commit:c2e228b77dcd015a2fc7679d6e62044100e66ce0
Author:Anatol Belski a...@php.net Sat, 9 Nov 2013 09:18:42 +0100
Parents:   27a86a4402022bf5ba180a6dbb46cf86c9a05b72
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=c2e228b77dcd015a2fc7679d6e62044100e66ce0

Log:
too much for a compare func

Changed paths:
  M  ext/standard/array.c


Diff:
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 218df54..4363e31 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -2924,7 +2924,7 @@ static int zval_compare(zval **a, zval **b TSRMLS_DC) /* 
{{{ */
 }
 /* }}} */
 
-static php_int_t zval_user_compare(zval **a, zval **b TSRMLS_DC) /* {{{ */
+static int zval_user_compare(zval **a, zval **b TSRMLS_DC) /* {{{ */
 {
zval **args[2];
zval *retval_ptr = NULL;


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



[PHP-CVS] com php-src: fixes to array funcs: ext/standard/array.c

2013-11-04 Thread Anatol Belski
Commit:48e63da6599d360b817617857237015196f9083e
Author:Anatol Belski a...@php.net Mon, 4 Nov 2013 10:45:58 +0100
Parents:   642a8b870a14f15a64d3200e832ecd56a0a35873
Branches:  str_size_and_int64

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=48e63da6599d360b817617857237015196f9083e

Log:
fixes to array funcs

Changed paths:
  M  ext/standard/array.c


Diff:
diff --git a/ext/standard/array.c b/ext/standard/array.c
index b68a763..eb5c5e7 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -1287,7 +1287,7 @@ PHPAPI int php_prefix_varname(zval *result, zval *prefix, 
char *var_name, zend_s
 PHP_FUNCTION(extract)
 {
zval *var_array, *prefix = NULL;
-   long extract_type = EXTR_OVERWRITE;
+   php_int_t extract_type = EXTR_OVERWRITE;
zval **entry, *data;
char *var_name;
ulong num_key;
@@ -1296,7 +1296,7 @@ PHP_FUNCTION(extract)
int extract_refs = 0;
HashPosition pos;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, a|lz/, 
var_array, extract_type, prefix) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, a|iz/, 
var_array, extract_type, prefix) == FAILURE) {
return;
}
 
@@ -2685,14 +2685,14 @@ PHP_FUNCTION(array_pad)
zval ***pads;   /* Array to pass to splice */
HashTable *new_hash;/* Return value from splice */
HashTable  old_hash;
-   long pad_size;  /* Size to pad to */
-   long pad_size_abs;  /* Absolute value of pad_size */
+   php_int_t pad_size; /* Size to pad to */
+   php_int_t pad_size_abs; /* Absolute value of pad_size */
int input_size; /* Size of the input array */
int num_pads;   /* How many pads do we need */
int do_pad; /* Whether we should do padding at all 
*/
int i;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, alz, input, 
pad_size, pad_value) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, aiz, input, 
pad_size, pad_value) == FAILURE) {
return;
}
 
@@ -2788,10 +2788,10 @@ PHP_FUNCTION(array_change_key_case)
char *new_key;
zend_str_size str_key_len;
ulong num_key;
-   long change_to_upper=0;
+   php_int_t change_to_upper=0;
HashPosition pos;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, a|l, array, 
change_to_upper) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, a|i, array, 
change_to_upper) == FAILURE) {
return;
}
 
@@ -2834,9 +2834,9 @@ PHP_FUNCTION(array_unique)
};
struct bucketindex *arTmp, *cmpdata, *lastkept;
unsigned int i;
-   long sort_type = PHP_SORT_STRING;
+   php_int_t sort_type = PHP_SORT_STRING;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, a|l, array, 
sort_type) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, a|i, array, 
sort_type) == FAILURE) {
return;
}
 
@@ -4001,19 +4001,20 @@ PHP_FUNCTION(array_multisort)
 }
 /* }}} */
 
+/* XXX not finished yet, continue after php_rand is worky on 64 bit */
 /* {{{ proto mixed array_rand(array input [, int num_req])
Return key/keys for random entry/entries in the array */
 PHP_FUNCTION(array_rand)
 {
zval *input;
-   long randval, num_req = 1;
+   php_int_t randval, num_req = 1;
int num_avail, key_type;
char *string_key;
zend_str_size string_key_len;
ulong num_key;
HashPosition pos;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, a|l, input, 
num_req) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, a|i, input, 
num_req) == FAILURE) {
return;
}
 
@@ -4213,7 +4214,7 @@ PHP_FUNCTION(array_filter)
zval *retval = NULL;
 zval *key = NULL;
zend_bool have_callback = 0;
-   long use_type = 0;
+   php_int_t use_type = 0;
char *string_key;
zend_fcall_info fci = empty_fcall_info;
zend_fcall_info_cache fci_cache = empty_fcall_info_cache;
@@ -4221,7 +4222,7 @@ PHP_FUNCTION(array_filter)
ulong num_key;
HashPosition pos;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, a|fl, array, 
fci, fci_cache, use_type) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, a|fi, array, 
fci, fci_cache, use_type) == FAILURE) {
return;
}
 
@@ -4477,7 +4478,7 @@ PHP_FUNCTION(array_key_exists)
 PHP_FUNCTION(array_chunk)
 {
int argc = ZEND_NUM_ARGS(), key_type, num_in;
-   long size, current = 0;
+   php_int_t size, current = 0;
char *str_key;
zend_str_size str_key_len;
ulong num_key;
@@ -4487,7 +4488,7 @@ PHP_FUNCTION(array_chunk)
zval **entry;
HashPosition pos

[PHP-CVS] com php-src: fixed skeleton to produce the normalized ext version macros: ext/skeleton/php_skeleton.h ext/skeleton/skeleton.c

2013-10-14 Thread Anatol Belski
Commit:7a038ccbe61c88b007a3a3ba1580185058792e91
Author:Anatol Belski a...@php.net Mon, 14 Oct 2013 14:18:43 +0200
Parents:   960b4e81f316528fc554ec1bff7daf46faa7129f
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=7a038ccbe61c88b007a3a3ba1580185058792e91

Log:
fixed skeleton to produce the normalized ext version macros

See http://news.php.net/php.pecl.dev/11191 for more info.

Changed paths:
  M  ext/skeleton/php_skeleton.h
  M  ext/skeleton/skeleton.c


Diff:
diff --git a/ext/skeleton/php_skeleton.h b/ext/skeleton/php_skeleton.h
index 495907b..0716ae0 100644
--- a/ext/skeleton/php_skeleton.h
+++ b/ext/skeleton/php_skeleton.h
@@ -6,6 +6,8 @@
 extern zend_module_entry extname_module_entry;
 #define phpext_extname_ptr extname_module_entry
 
+#define PHP_EXTNAME_VERSION 0.1.0 /* Replace with version number for your 
extension */
+
 #ifdef PHP_WIN32
 #  define PHP_EXTNAME_API __declspec(dllexport)
 #elif defined(__GNUC__)  __GNUC__ = 4
diff --git a/ext/skeleton/skeleton.c b/ext/skeleton/skeleton.c
index ee4ea74..2e37344 100644
--- a/ext/skeleton/skeleton.c
+++ b/ext/skeleton/skeleton.c
@@ -41,7 +41,7 @@ zend_module_entry extname_module_entry = {
PHP_RSHUTDOWN(extname), /* Replace with NULL if there's nothing to do 
at request end */
PHP_MINFO(extname),
 #if ZEND_MODULE_API_NO = 20010901
-   0.1, /* Replace with version number for your extension */
+   PHP_EXTNAME_VERSION,
 #endif
STANDARD_MODULE_PROPERTIES
 };


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



[PHP-CVS] com php-src: fixed failing tests for ICU = 51.2: ext/intl/tests/bug58756_MessageFormatter.phpt ext/intl/tests/collator_asort.phpt ext/intl/tests/collator_compare.phpt ext/intl/tests/collato

2013-10-07 Thread Anatol Belski
Commit:4840b0a749454335218f6131892031333d66142d
Author:Anatol Belski a...@php.net Mon, 7 Oct 2013 13:49:10 +0200
Parents:   fa40290fb76370c923e8f048daf1af144ff87604
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=4840b0a749454335218f6131892031333d66142d

Log:
fixed failing tests for ICU = 51.2

Changed paths:
  M  ext/intl/tests/bug58756_MessageFormatter.phpt
  M  ext/intl/tests/collator_asort.phpt
  M  ext/intl/tests/collator_compare.phpt
  M  ext/intl/tests/collator_get_sort_key.phpt
  M  ext/intl/tests/collator_sort.phpt
  M  ext/intl/tests/collator_sort_with_sort_keys.phpt
  M  ext/intl/tests/dateformat_calendars.phpt
  M  ext/intl/tests/dateformat_create_cal_arg.phpt
  M  ext/intl/tests/dateformat_format.phpt
  M  ext/intl/tests/dateformat_formatObject_calendar.phpt
  M  ext/intl/tests/dateformat_formatObject_datetime.phpt
  M  ext/intl/tests/dateformat_format_parse.phpt
  M  ext/intl/tests/dateformat_get_set_calendar.phpt
  M  ext/intl/tests/dateformat_get_set_timezone.phpt
  M  ext/intl/tests/dateformat_set_timezone_id2.phpt
  M  ext/intl/tests/dateformat_timezone_arg_variations.phpt
  M  ext/intl/tests/formatter_get_locale.phpt
  M  ext/intl/tests/locale_filter_matches2.phpt
  M  ext/intl/tests/locale_get_display_name2.phpt
  M  ext/intl/tests/locale_get_display_region2.phpt
  M  ext/intl/tests/locale_lookup.phpt
  M  ext/intl/tests/msgfmt_format_intlcalendar.phpt
  M  ext/intl/tests/resourcebundle_null_mandatory_args.phpt
  M  ext/intl/tests/timezone_getDisplayName_variant2-49+.phpt

diff --git a/ext/intl/tests/bug58756_MessageFormatter.phpt 
b/ext/intl/tests/bug58756_MessageFormatter.phpt
index bbe96b7..18566b6 100644
--- a/ext/intl/tests/bug58756_MessageFormatter.phpt
+++ b/ext/intl/tests/bug58756_MessageFormatter.phpt
@@ -4,6 +4,9 @@ Bug #58756: w.r.t MessageFormatter
 ?php
 if (!extension_loaded('intl'))
die('skip intl extension not enabled');
+if (version_compare(INTL_ICU_VERSION, '51.2') =  0)
+   die('skip for ICU  51.2');
+?
 --FILE--
 ?php
 ini_set(intl.error_level, E_WARNING);
@@ -31,4 +34,4 @@ echo msgf2: , $msgf-format(array($time, 'date')),  ,
 --EXPECT--
 date:  Tuesday, July 7, 2009 8:41:13 PM EDT
 msgf:  Tuesday, July 7, 2009 8:41:13 PM EDT
-==DONE==
\ No newline at end of file
+==DONE==
diff --git a/ext/intl/tests/collator_asort.phpt 
b/ext/intl/tests/collator_asort.phpt
index a614ddc..308f3a3 100644
--- a/ext/intl/tests/collator_asort.phpt
+++ b/ext/intl/tests/collator_asort.phpt
@@ -2,6 +2,7 @@
 asort()
 --SKIPIF--
 ?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?
+?php if (version_compare(INTL_ICU_VERSION, '51.2') =  0) die('skip for ICU  
51.2'); ?
 --FILE--
 ?php
 
diff --git a/ext/intl/tests/collator_compare.phpt 
b/ext/intl/tests/collator_compare.phpt
index f10b570..7c07204 100644
--- a/ext/intl/tests/collator_compare.phpt
+++ b/ext/intl/tests/collator_compare.phpt
@@ -2,6 +2,7 @@
 compare()
 --SKIPIF--
 ?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?
+?php if (version_compare(INTL_ICU_VERSION, '51.2') =  0) die('skip for ICU  
51.2'); ?
 --FILE--
 ?php
 
diff --git a/ext/intl/tests/collator_get_sort_key.phpt 
b/ext/intl/tests/collator_get_sort_key.phpt
index a9c4d71..58240d4 100644
--- a/ext/intl/tests/collator_get_sort_key.phpt
+++ b/ext/intl/tests/collator_get_sort_key.phpt
@@ -3,6 +3,8 @@ collator_get_sort_key()
 --SKIPIF--
 ?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?
 ?php if(version_compare(INTL_ICU_VERSION, '4.8')  0) print 'skip ICU = 4.8 
only'; ?
+?php /* XXX Obviously it fails somewhere between = 4.8 and  51.2 */ 
+if (version_compare(INTL_ICU_VERSION, '51.2') =  0) die('skip for ICU  
51.2'); ?
 --FILE--
 ?php
 
@@ -95,4 +97,4 @@ key: 5c0a161801070107
 source: жжж
 key: 5c3a3a3a01070107
 source: эюя
-key: 5d3b3f4501070107
\ No newline at end of file
+key: 5d3b3f4501070107
diff --git a/ext/intl/tests/collator_sort.phpt 
b/ext/intl/tests/collator_sort.phpt
index 5cefe2f..e16eeea 100644
--- a/ext/intl/tests/collator_sort.phpt
+++ b/ext/intl/tests/collator_sort.phpt
@@ -2,6 +2,7 @@
 sort()
 --SKIPIF--
 ?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?
+?php if (version_compare(INTL_ICU_VERSION, '51.2') =  0) die('skip for ICU  
51.2'); ?
 --FILE--
 ?php
 
diff --git a/ext/intl/tests/collator_sort_with_sort_keys.phpt 
b/ext/intl/tests/collator_sort_with_sort_keys.phpt
index 2f489d7..8be9c97 100644
--- a/ext/intl/tests/collator_sort_with_sort_keys.phpt
+++ b/ext/intl/tests/collator_sort_with_sort_keys.phpt
@@ -2,6 +2,7 @@
 sort_with_sort_keys()
 --SKIPIF--
 ?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?
+?php if (version_compare(INTL_ICU_VERSION, '51.2') =  0) die('skip for ICU  
51.2'); ?
 --FILE--
 ?php
 
diff --git a/ext/intl/tests/dateformat_calendars.phpt 
b/ext/intl/tests/dateformat_calendars.phpt
index 6af02e5..2239af2 100644
--- a/ext/intl/tests/dateformat_calendars.phpt
+++ b/ext/intl/tests/dateformat_calendars.phpt
@@ -4,8 +4,8 @@ IntlDateFormatter

[PHP-CVS] com php-src: Merge branch 'PHP-5.5': sapi/cli/php_cli_server.c

2013-10-07 Thread Anatol Belski
Commit:4fe7ec33f1eef1ae0344acef6189911e03066b25
Author:Anatol Belski a...@php.net Mon, 7 Oct 2013 13:50:59 +0200
Parents:   9c7dbb0487f5991fde03873ea8f5e66d6688415f 
0117eb747e1b36a301d58fa29aa3ae48b5aa2ac7
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=4fe7ec33f1eef1ae0344acef6189911e03066b25

Log:
Merge branch 'PHP-5.5'

* PHP-5.5:
  added fixed tests for ICU = 51.2
  fixed failing tests for ICU = 51.2
  FIX BUG #65219 - Typo correction
  FIX BUG #65219 - USE DB not being sent for FreeTDS version  0.92 FreeTDS 
0.92 does not support DBSETLDBNAME option and therefore will not work with SQL 
Azure. Fallback to dbuse command in letter versions.
  - Fixed bug #65818 (Segfault with built-in webserver and chunked transfer 
encoding)
  - BFN

Bugs:
https://bugs.php.net/65219
https://bugs.php.net/65818

Changed paths:
  MM  sapi/cli/php_cli_server.c


Diff:



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



[PHP-CVS] com php-src: Fixed bug #65678 the test cli_process_title_windows will fails on particular environnement: sapi/cli/tests/cli_process_title_windows.phpt

2013-09-20 Thread Anatol Belski
Commit:8f146c2bb0dcba3307f08a839554be056e660f34
Author:Anatol Belski a...@php.net Fri, 20 Sep 2013 15:59:33 +0200
Parents:   dfa43d55dd996fb06c7bb4d5efcae3fc78131cdc
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=8f146c2bb0dcba3307f08a839554be056e660f34

Log:
Fixed bug #65678 the test cli_process_title_windows will fails on particular 
environnement

Patch by Pierre Renaudet

Bugs:
https://bugs.php.net/65678

Changed paths:
  M  sapi/cli/tests/cli_process_title_windows.phpt


Diff:
diff --git a/sapi/cli/tests/cli_process_title_windows.phpt 
b/sapi/cli/tests/cli_process_title_windows.phpt
index 309c09c..472f9c1 100644
--- a/sapi/cli/tests/cli_process_title_windows.phpt
+++ b/sapi/cli/tests/cli_process_title_windows.phpt
@@ -20,7 +20,7 @@ if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')
 // no warnings/errors.
 
 $is_windows8 = false;
-$ps_output = shell_exec(PowerShell \(Get-Host).UI.RawUI.WindowTitle\);
+$ps_output = shell_exec(PowerShell -NoProfile 
\(Get-Host).UI.RawUI.WindowTitle\);
 if ($ps_output === null)
 {
   echo Get-Host failed\n;
@@ -28,7 +28,8 @@ if ($ps_output === null)
 }
 
 $ps_output = trim($ps_output);
-if (($ps_output == Windows PowerShell) || ($ps_output == Administrator: 
Windows PowerShell))
+$end_title_windows8 = : Windows PowerShell;
+if (($ps_output == Windows PowerShell) || (strlen($ps_output)  
strlen($end_title_windows8)  substr($ps_output,-strlen($end_title_windows8)) 
=== $end_title_windows8))
   $is_windows8 = true;
 
 echo *** Testing setting the process title ***\n;
@@ -45,7 +46,7 @@ if ($is_windows8)
 }
 else
 {
-  $loaded_title = shell_exec(PowerShell \get-process cmd*,powershell* | 
Select-Object mainWindowTitle | ft -hide\);
+  $loaded_title = shell_exec(PowerShell -NoProfile \get-process 
cmd*,powershell* | Select-Object mainWindowTitle | ft -hide\);
 
   if ($loaded_title === null)
   {


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



Re: [PHP-CVS] com php-src: fix build - PRIu64 vs %I64u: main/php_variables.c

2013-09-18 Thread Anatol Belski
On Wed, September 18, 2013 09:52, Michael Wallner wrote:
 On 17 September 2013 16:02, Anatol Belski a...@php.net wrote:

 Commit:4a85b5e190d6651bee26bbbeff4ed09d2932f352
 Author:Anatol Belski a...@php.net Tue, 17 Sep 2013 16:02:08
 +0200
 Parents:   e6084da4735c945cb071c4d9259ea0d702eb77c6
 Branches:  master


 Link:
 http://git.php.net/?p=php-src.git;a=commitdiff;h=4a85b5e190d6651bee26bb
 beff4ed09d2932f352

 Log:
 fix build - PRIu64 vs %I64u


 How about adding such constants to win32/php_stdint.h instead?


 --
 Regards,
 Mike



That's a good idea, i also thought about macrifying all those at once. Not
sure it belongs to stdint, it's actually more like printf format. I'll do
this anyway, have to look for a right place.

Regards

Anatol


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



Re: [PHP-CVS] com php-src: fix build - PRIu64 vs %I64u: main/php_variables.c

2013-09-18 Thread Anatol Belski
On Wed, September 18, 2013 10:59, Michael Wallner wrote:
 Hi Anatol!


 On 18 September 2013 10:34, Anatol Belski a...@php.net wrote:

 That's a good idea, i also thought about macrifying all those at once.
 Not
 sure it belongs to stdint, it's actually more like printf format. I'll
 do this anyway, have to look for a right place.

 POSIX has it in inttypes.h




 --
 Regards,
 Mike



Hi Michael,

oki then, i'll rework this fix to put it to win/php_stdint.h

Regards

Anatol


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



[PHP-CVS] com php-src: better way to fix PRIu64 availability on windows: main/php_variables.c win32/php_inttypes.h

2013-09-18 Thread Anatol Belski
Commit:86dfe7be49a674358e69003413c4a48bee3463ed
Author:Anatol Belski a...@php.net Wed, 18 Sep 2013 15:14:36 +0200
Parents:   dc7015d4e4c2f9cb139ccb2befc4075f6a228a24
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=86dfe7be49a674358e69003413c4a48bee3463ed

Log:
better way to fix PRIu64 availability on windows

Changed paths:
  M  main/php_variables.c
  A  win32/php_inttypes.h

diff --git a/main/php_variables.c b/main/php_variables.c
index 353aa63..ab9aee3 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -29,6 +29,9 @@
 #include php_content_types.h
 #include SAPI.h
 #include zend_globals.h
+#ifdef PHP_WIN32
+# include win32/php_inttypes.h
+#endif
 
 /* for systems that need to override reading of environment variables */
 void _php_import_environment_variables(zval *array_ptr TSRMLS_DC);
@@ -292,11 +295,7 @@ static inline int add_post_vars(zval *arr, post_var_data_t 
*vars, zend_bool eof
while (add_post_var(arr, vars, eof TSRMLS_CC)) {
if (++vars-cnt  max_vars) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,
-#ifdef PHP_WIN32
-   Input variables exceeded %I64u. 
-#else
Input variables exceeded % PRIu64 . 
-#endif
To increase the limit change 
max_input_vars in php.ini.,
max_vars);
return FAILURE;
diff --git a/win32/php_inttypes.h b/win32/php_inttypes.h
new file mode 100644
index 000..2554277
--- /dev/null
+++ b/win32/php_inttypes.h
@@ -0,0 +1,305 @@
+// ISO C9x  compliant inttypes.h for Microsoft Visual Studio
+// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 
+// 
+//  Copyright (c) 2006 Alexander Chemeris
+// 
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+// 
+//   1. Redistributions of source code must retain the above copyright notice,
+//  this list of conditions and the following disclaimer.
+// 
+//   2. Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+// 
+//   3. The name of the author may be used to endorse or promote products
+//  derived from this software without specific prior written permission.
+// 
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// 
+///
+
+#ifndef _MSC_VER // [
+#error Use this header only with Microsoft Visual C++ compilers!
+#endif // _MSC_VER ]
+
+#ifndef _MSC_INTTYPES_H_ // [
+#define _MSC_INTTYPES_H_
+
+#if _MSC_VER  1000
+#pragma once
+#endif
+
+#include stdint.h
+
+// 7.8 Format conversion of integer types
+
+typedef struct {
+   intmax_t quot;
+   intmax_t rem;
+} imaxdiv_t;
+
+// 7.8.1 Macros for format specifiers
+
+#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [   See footnote 
185 at page 198
+
+// The fprintf macros for signed integers are:
+#define PRId8   d
+#define PRIi8   i
+#define PRIdLEAST8  d
+#define PRIiLEAST8  i
+#define PRIdFAST8   d
+#define PRIiFAST8   i
+
+#define PRId16   hd
+#define PRIi16   hi
+#define PRIdLEAST16  hd
+#define PRIiLEAST16  hi
+#define PRIdFAST16   hd
+#define PRIiFAST16   hi
+
+#define PRId32   I32d
+#define PRIi32   I32i
+#define PRIdLEAST32  I32d
+#define PRIiLEAST32  I32i
+#define PRIdFAST32   I32d
+#define PRIiFAST32   I32i
+
+#define PRId64   I64d
+#define PRIi64   I64i
+#define PRIdLEAST64  I64d
+#define PRIiLEAST64  I64i
+#define PRIdFAST64   I64d
+#define PRIiFAST64   I64i
+
+#define PRIdMAX I64d
+#define PRIiMAX I64i
+
+#define PRIdPTR Id
+#define PRIiPTR Ii
+
+// The fprintf macros for unsigned integers are:
+#define PRIo8   o
+#define PRIu8   u
+#define PRIx8   x
+#define PRIX8   X
+#define PRIoLEAST8  o
+#define PRIuLEAST8  u
+#define PRIxLEAST8  x
+#define PRIXLEAST8  X
+#define PRIoFAST8   o
+#define PRIuFAST8   u
+#define PRIxFAST8   x
+#define PRIXFAST8   X
+
+#define PRIo16

[PHP-CVS] com php-src: let the libsqlite3 symbols be exported in dll: ext/sqlite3/config.w32

2013-09-17 Thread Anatol Belski
Commit:41d78110ffd576a9afa352426ed2c15ab7308bec
Author:Anatol Belski a...@php.net Tue, 17 Sep 2013 13:05:44 +0200
Parents:   512734b58dc4e231971901cb87656d67c87e7645
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=41d78110ffd576a9afa352426ed2c15ab7308bec

Log:
let the libsqlite3 symbols be exported in dll

Changed paths:
  M  ext/sqlite3/config.w32


Diff:
diff --git a/ext/sqlite3/config.w32 b/ext/sqlite3/config.w32
index 01e4625..8ddb6b9 100644
--- a/ext/sqlite3/config.w32
+++ b/ext/sqlite3/config.w32
@@ -4,7 +4,7 @@
 ARG_WITH(sqlite3, SQLite 3 support, no);
 
 if (PHP_SQLITE3 != no) {
-   ADD_FLAG(CFLAGS_SQLITE3, /D SQLITE_THREADSAFE= + (PHP_ZTS == yes 
? 1 : 0) +  /D SQLITE_ENABLE_FTS3=1 /D SQLITE_ENABLE_COLUMN_METADATA=1 /D 
SQLITE_CORE=1 );
+   ADD_FLAG(CFLAGS_SQLITE3, /D SQLITE_THREADSAFE= + (PHP_ZTS == yes 
? 1 : 0) +  /D SQLITE_ENABLE_FTS3=1 /D SQLITE_ENABLE_COLUMN_METADATA=1 /D 
SQLITE_CORE=1 /D SQLITE_API=__declspec(dllexport) );
EXTENSION(sqlite3, sqlite3.c, null, /I + configure_module_dirname 
+ /libsqlite /I + configure_module_dirname);
 
ADD_SOURCES(configure_module_dirname + /libsqlite, sqlite3.c, 
sqlite3);


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



[PHP-CVS] com php-src: fix build - PRIu64 vs %I64u: main/php_variables.c

2013-09-17 Thread Anatol Belski
Commit:4a85b5e190d6651bee26bbbeff4ed09d2932f352
Author:Anatol Belski a...@php.net Tue, 17 Sep 2013 16:02:08 +0200
Parents:   e6084da4735c945cb071c4d9259ea0d702eb77c6
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=4a85b5e190d6651bee26bbbeff4ed09d2932f352

Log:
fix build - PRIu64 vs %I64u

Changed paths:
  M  main/php_variables.c


Diff:
diff --git a/main/php_variables.c b/main/php_variables.c
index af3a6aa..353aa63 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -292,7 +292,11 @@ static inline int add_post_vars(zval *arr, post_var_data_t 
*vars, zend_bool eof
while (add_post_var(arr, vars, eof TSRMLS_CC)) {
if (++vars-cnt  max_vars) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,
+#ifdef PHP_WIN32
+   Input variables exceeded %I64u. 
+#else
Input variables exceeded % PRIu64 . 
+#endif
To increase the limit change 
max_input_vars in php.ini.,
max_vars);
return FAILURE;


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



[PHP-CVS] com php-src: updated lib versions: win32/build/libs_version.txt

2013-08-28 Thread Anatol Belski
Commit:3745bdadc03a146fd37a3528658abc86bc8494df
Author:Anatol Belski a...@php.net Wed, 28 Aug 2013 14:43:00 +0200
Parents:   e6424d89e9419e610ea95484081b9c26b0a7c044
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=3745bdadc03a146fd37a3528658abc86bc8494df

Log:
updated lib versions

Changed paths:
  M  win32/build/libs_version.txt


Diff:
diff --git a/win32/build/libs_version.txt b/win32/build/libs_version.txt
index 897d77b..ddbd925 100644
--- a/win32/build/libs_version.txt
+++ b/win32/build/libs_version.txt
@@ -1,6 +1,6 @@
 bz2-1.0.6
 cclient-2007e
-freetype-2.4.3
+freetype-2.4.10
 icu-49.1.2
 jpeglib-8
 libcurl-7.30.0


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



[PHP-CVS] com php-src: updated lib versions, the vc11 ones only matter now: win32/build/libs_version.txt

2013-08-28 Thread Anatol Belski
Commit:51016262a7ea8d0fad2edc0305484ff47f4ba9d7
Author:Anatol Belski a...@php.net Wed, 28 Aug 2013 14:25:39 +0200
Parents:   0119bbba6b97e8657a92b0dc6327b04aad9532e7
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=51016262a7ea8d0fad2edc0305484ff47f4ba9d7

Log:
updated lib versions, the vc11 ones only matter now

Changed paths:
  M  win32/build/libs_version.txt


Diff:
diff --git a/win32/build/libs_version.txt b/win32/build/libs_version.txt
index 096d723..123a75d 100644
--- a/win32/build/libs_version.txt
+++ b/win32/build/libs_version.txt
@@ -1,25 +1,17 @@
 bz2-1.0.6
-cclient-2007e
 cclient-2007f
 freetype-2.4.10
-icu-49.1.2
 icu-50.1.2
-jpeglib-8
 jpeglib-9
 libcurl-7.30.0
 libiconv-1.14
 libmcrypt-2.5.8
 libmpir-2.5.1
 libmpir-2.6.0
-libpng-1.2.50
-libpng-1.5.13
-libpq-8.3.6
+libpng-1.5.14
 libpq-9.2.2
 libssh2-1.4.2
-libtidy-20090325
 libtidy-20090406
 libxslt-1.1.27
-libxml-2.7.8
 libxml-2.9.1
-openssl-0.9.8y
 openssl-1.0.1e


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



[PHP-CVS] com php-src: removed the /Wp64 switch as we use true 64 bit compiler now: win32/build/config.w32 win32/build/config.w32.phpize.in

2013-08-28 Thread Anatol Belski
Commit:bd677b43a78ebc0779ed64781172225d15b35671
Author:Anatol Belski a...@php.net Wed, 28 Aug 2013 15:10:05 +0200
Parents:   5a525bc823c6defbba151f05b9c729de11f4ff5b
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=bd677b43a78ebc0779ed64781172225d15b35671

Log:
removed the /Wp64 switch as we use true 64 bit compiler now

Changed paths:
  M  win32/build/config.w32
  M  win32/build/config.w32.phpize.in


Diff:
diff --git a/win32/build/config.w32 b/win32/build/config.w32
index 3face08..3401205 100644
--- a/win32/build/config.w32
+++ b/win32/build/config.w32
@@ -155,7 +155,7 @@ if (VCVERS = 1400) {
// disable annoying warnings.  In addition, time_t defaults
// to 64-bit.  Ask for 32-bit.
if (X64) {
-   ADD_FLAG('CFLAGS', ' /wd4996 /Wp64 ');
+   ADD_FLAG('CFLAGS', ' /wd4996 ');
} else {
ADD_FLAG('CFLAGS', ' /wd4996 /D_USE_32BIT_TIME_T=1 ');
}
diff --git a/win32/build/config.w32.phpize.in b/win32/build/config.w32.phpize.in
index b8bf45e..7b3b406 100644
--- a/win32/build/config.w32.phpize.in
+++ b/win32/build/config.w32.phpize.in
@@ -134,7 +134,7 @@ if (VCVERS = 1400) {
// disable annoying warnings.  In addition, time_t defaults
// to 64-bit.  Ask for 32-bit.
if (X64) {
-   ADD_FLAG('CFLAGS', ' /wd4996 /Wp64 ');
+   ADD_FLAG('CFLAGS', ' /wd4996 ');
} else {
ADD_FLAG('CFLAGS', ' /wd4996 /D_USE_32BIT_TIME_T=1 ');
}


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



[PHP-CVS] com php-src: ensure the test doesn't fail because of tz warning: ext/date/tests/bug65184.phpt

2013-08-23 Thread Anatol Belski
Commit:a2b1546f3b59095b65a5624494c778078cb5a87f
Author:Anatol Belski a...@php.net Fri, 23 Aug 2013 16:40:28 +0200
Parents:   686402a865d13b5cf331a5fc1966e6f35046eb4d
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=a2b1546f3b59095b65a5624494c778078cb5a87f

Log:
ensure the test doesn't fail because of tz warning

Changed paths:
  M  ext/date/tests/bug65184.phpt


Diff:
diff --git a/ext/date/tests/bug65184.phpt b/ext/date/tests/bug65184.phpt
index adfd8d8..9bb6855 100644
--- a/ext/date/tests/bug65184.phpt
+++ b/ext/date/tests/bug65184.phpt
@@ -6,6 +6,8 @@ if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
 die(skip Test is valid for Windows);
 }
 ?
+--INI--
+date.timezone = UTC
 --FILE--
 ?php
setlocale(LC_ALL, 'Japanese_Japan.932');


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



[PHP-CVS] com php-src: Suppress static analyzer warnings in specialized executor: Zend/zend_vm_execute.h Zend/zend_vm_gen.php

2013-08-23 Thread Anatol Belski
Commit:716fc80fda937bedba786445d6b1854c48af12f8
Author:Anatol Belski a...@php.net Fri, 23 Aug 2013 17:41:07 +0200
Parents:   38f9c515cdee7c7c0e1c204ba24027de04e3936e
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=716fc80fda937bedba786445d6b1854c48af12f8

Log:
Suppress static analyzer warnings in specialized executor

As things like if(0) will be removed by the compiler, no need
to see that tons of warnings with static analyzer enabled.

Changed paths:
  M  Zend/zend_vm_execute.h
  M  Zend/zend_vm_gen.php


Diff:
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index a80d9a4..2ba6bfe 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -20,6 +20,13 @@
 
 #ifdef ZEND_WIN32
 # pragma warning(once : 4101)
+# pragma warning(once : 6235)
+# pragma warning(once : 6237)
+# pragma warning(once : 6239)
+# pragma warning(once : 6240)
+# pragma warning(once : 6285)
+# pragma warning(once : 6286)
+# pragma warning(once : 6326)
 #endif
 static user_opcode_handler_t zend_user_opcode_handlers[256] = {
(user_opcode_handler_t)NULL,
diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php
index 9a75711..9b2877b 100644
--- a/Zend/zend_vm_gen.php
+++ b/Zend/zend_vm_gen.php
@@ -1189,8 +1189,26 @@ function gen_vm($def, $skel) {
// Insert header
out($f, $GLOBALS['header_text']);
 
+   out($f, #ifdef ZEND_WIN32\n);
// Suppress free_op1 warnings on Windows
-   out($f, #ifdef ZEND_WIN32\n# pragma warning(once : 4101)\n#endif\n);
+   out($f, # pragma warning(once : 4101)\n);
+   if (ZEND_VM_SPEC) {
+   // Suppress (non-zero constant || expression) warnings on 
windows
+   out($f, # pragma warning(once : 6235)\n);
+   // Suppress (zero  expression) warnings on windows
+   out($f, # pragma warning(once : 6237)\n);
+   // Suppress (non-zero constant  expression) warnings on 
windows
+   out($f, # pragma warning(once : 6239)\n);
+   // Suppress (expression  non-zero constant) warnings on 
windows
+   out($f, # pragma warning(once : 6240)\n);
+   // Suppress (non-zero constant || non-zero constant) 
warnings on windows
+   out($f, # pragma warning(once : 6285)\n);
+   // Suppress (non-zero constant || expression) warnings on 
windows
+   out($f, # pragma warning(once : 6286)\n);
+   // Suppress constant with constant comparsion warnings on 
windows
+   out($f, # pragma warning(once : 6326)\n);
+   }
+   out($f, #endif\n);

// Support for ZEND_USER_OPCODE
out($f, static user_opcode_handler_t zend_user_opcode_handlers[256] = 
{\n);


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.5': Zend/zend_vm_execute.h Zend/zend_vm_gen.php

2013-08-23 Thread Anatol Belski
Commit:07fa043cc3cb2c76f8b42915a64a43d0429f7c00
Author:Anatol Belski a...@php.net Fri, 23 Aug 2013 17:45:45 +0200
Parents:   77303a32481519b888061b8851771fb111c13c54 
716fc80fda937bedba786445d6b1854c48af12f8
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=07fa043cc3cb2c76f8b42915a64a43d0429f7c00

Log:
Merge branch 'PHP-5.5'

* PHP-5.5:
  Suppress static analyzer warnings in specialized executor
  Update NEWS

Changed paths:
  MM  Zend/zend_vm_execute.h
  MM  Zend/zend_vm_gen.php


Diff:



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



[PHP-CVS] com php-src: split the glob() test to test different basedir: ext/standard/tests/file/glob_variation3.phpt ext/standard/tests/file/glob_variation4.phpt ext/standard/tests/file/glob_variation

2013-08-20 Thread Anatol Belski
Commit:827100df823e5a36c97b808407e775f5d203164c
Author:Anatol Belski a...@php.net Tue, 20 Aug 2013 13:39:30 +0200
Parents:   8da7aa7e4189f0be434b7c936840429302e021b6
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=827100df823e5a36c97b808407e775f5d203164c

Log:
split the glob() test to test different basedir

Changed paths:
  M  ext/standard/tests/file/glob_variation3.phpt
  A  ext/standard/tests/file/glob_variation4.phpt
  A  ext/standard/tests/file/glob_variation5.phpt
  A  ext/standard/tests/file/glob_variation6.phpt


Diff:
diff --git a/ext/standard/tests/file/glob_variation3.phpt 
b/ext/standard/tests/file/glob_variation3.phpt
index 9c57ada..c50f8a8 100644
--- a/ext/standard/tests/file/glob_variation3.phpt
+++ b/ext/standard/tests/file/glob_variation3.phpt
@@ -5,22 +5,7 @@ Test glob() function: ensure no platform difference
 $path = dirname(__FILE__);
 
 ini_set('open_basedir', NULL);
-var_dump(glob($path/*.none));
-var_dump(glob($path/?.none));
-var_dump(glob($path/*{hello,world}.none));
-var_dump(glob($path/*/nothere));
-var_dump(glob($path/[aoeu]*.none));
-var_dump(glob($path/directly_not_exists));
 
-ini_set('open_basedir', $path);
-var_dump(glob($path/*.none));
-var_dump(glob($path/?.none));
-var_dump(glob($path/*{hello,world}.none));
-var_dump(glob($path/*/nothere));
-var_dump(glob($path/[aoeu]*.none));
-var_dump(glob($path/directly_not_exists));
-
-ini_set('open_basedir', '/tmp');
 var_dump(glob($path/*.none));
 var_dump(glob($path/?.none));
 var_dump(glob($path/*{hello,world}.none));
@@ -28,6 +13,7 @@ var_dump(glob($path/*/nothere));
 var_dump(glob($path/[aoeu]*.none));
 var_dump(glob($path/directly_not_exists));
 
+var_dump(empty(ini_get('open_basedir')));
 ?
 ==DONE==
 --EXPECT--
@@ -43,28 +29,5 @@ array(0) {
 }
 array(0) {
 }
-array(0) {
-}
-array(0) {
-}
-array(0) {
-}
-array(0) {
-}
-array(0) {
-}
-array(0) {
-}
-array(0) {
-}
-array(0) {
-}
-array(0) {
-}
-array(0) {
-}
-array(0) {
-}
-array(0) {
-}
+bool(true)
 ==DONE==
diff --git a/ext/standard/tests/file/glob_variation4.phpt 
b/ext/standard/tests/file/glob_variation4.phpt
new file mode 100644
index 000..00d8f64
--- /dev/null
+++ b/ext/standard/tests/file/glob_variation4.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Test glob() function: ensure no platform difference, variation 2
+--FILE--
+?php
+$path = dirname(__FILE__);
+
+ini_set('open_basedir', $path);
+
+var_dump(glob($path/*.none));
+var_dump(glob($path/?.none));
+var_dump(glob($path/*{hello,world}.none));
+var_dump(glob($path/*/nothere));
+var_dump(glob($path/[aoeu]*.none));
+var_dump(glob($path/directly_not_exists));
+
+var_dump($path == ini_get('open_basedir'));
+?
+==DONE==
+--EXPECT--
+array(0) {
+}
+array(0) {
+}
+array(0) {
+}
+array(0) {
+}
+array(0) {
+}
+array(0) {
+}
+bool(true)
+==DONE==
diff --git a/ext/standard/tests/file/glob_variation5.phpt 
b/ext/standard/tests/file/glob_variation5.phpt
new file mode 100644
index 000..10db400
--- /dev/null
+++ b/ext/standard/tests/file/glob_variation5.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Test glob() function: ensure no platform difference, variation 3
+--SKIPIF--
+?php if( substr(PHP_OS, 0, 3) == WIN ) {die('skip not valid on Windows');} 
?
+--FILE--
+?php
+$path = dirname(__FILE__);
+
+ini_set('open_basedir', '/tmp');
+
+var_dump(glob($path/*.none));
+var_dump(glob($path/?.none));
+var_dump(glob($path/*{hello,world}.none));
+var_dump(glob($path/*/nothere));
+var_dump(glob($path/[aoeu]*.none));
+var_dump(glob($path/directly_not_exists));
+
+var_dump('/tmp' == ini_get('open_basedir'));
+?
+==DONE==
+--EXPECT--
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(true)
+==DONE==
diff --git a/ext/standard/tests/file/glob_variation6.phpt 
b/ext/standard/tests/file/glob_variation6.phpt
new file mode 100644
index 000..9cd9c2b
--- /dev/null
+++ b/ext/standard/tests/file/glob_variation6.phpt
@@ -0,0 +1,35 @@
+--TEST--
+Test glob() function: ensure no platform difference, variation 4
+--SKIPIF--
+?php if( substr(PHP_OS, 0, 3) != WIN ) {die('skip only valid on Windows');} 
?
+--FILE--
+?php
+$path = dirname(__FILE__);
+
+ini_set('open_basedir', 'c:\\windows');
+
+var_dump(glob($path/*.none));
+var_dump(glob($path/?.none));
+var_dump(glob($path/*{hello,world}.none));
+var_dump(glob($path/*/nothere));
+var_dump(glob($path/[aoeu]*.none));
+var_dump(glob($path/directly_not_exists));
+
+var_dump('c:\\windows' == ini_get('open_basedir'));
+?
+==DONE==
+--EXPECT--
+array(0) {
+}
+array(0) {
+}
+array(0) {
+}
+array(0) {
+}
+array(0) {
+}
+array(0) {
+}
+bool(true)
+==DONE==


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



[PHP-CVS] com php-src: added new glob() test: ext/standard/tests/file/glob_variation3.phpt

2013-08-19 Thread Anatol Belski
Commit:4bad49e3bcb8851b6bdf7ce8e8405a12d0eec6d0
Author:Anatol Belski a...@php.net Mon, 19 Aug 2013 11:17:13 +0200
Parents:   cf96aa155ec5e9fbee7af339ca7d4dd98c2086a4
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=4bad49e3bcb8851b6bdf7ce8e8405a12d0eec6d0

Log:
added new glob() test

Changed paths:
  A  ext/standard/tests/file/glob_variation3.phpt


Diff:
diff --git a/ext/standard/tests/file/glob_variation3.phpt 
b/ext/standard/tests/file/glob_variation3.phpt
new file mode 100644
index 000..9e1e28b
--- /dev/null
+++ b/ext/standard/tests/file/glob_variation3.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Test glob() function: ensure no platform difference
+--FILE--
+?php
+$path = dirname(__FILE__);
+
+ini_set('open_basedir', NULL);
+var_dump(glob($path/*.none));
+
+ini_set('open_basedir', $path);
+var_dump(glob($path/*.none));
+
+?
+==DONE==
+--EXPECT--
+array(0) {
+}
+bool(false)
+==DONE==


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



[PHP-CVS] com php-src: modified the new glob() test for master: ext/standard/tests/file/glob_variation3.phpt

2013-08-19 Thread Anatol Belski
Commit:f61b648da4df521b0aaed1c588ae3ac3ab2e540b
Author:Anatol Belski a...@php.net Mon, 19 Aug 2013 11:22:18 +0200
Parents:   6c570ad322c7f21b2a9f59c85fd1619b83656b1d
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=f61b648da4df521b0aaed1c588ae3ac3ab2e540b

Log:
modified the new glob() test for master

Changed paths:
  M  ext/standard/tests/file/glob_variation3.phpt


Diff:
diff --git a/ext/standard/tests/file/glob_variation3.phpt 
b/ext/standard/tests/file/glob_variation3.phpt
index 9e1e28b..4f504e6 100644
--- a/ext/standard/tests/file/glob_variation3.phpt
+++ b/ext/standard/tests/file/glob_variation3.phpt
@@ -15,5 +15,6 @@ var_dump(glob($path/*.none));
 --EXPECT--
 array(0) {
 }
-bool(false)
+array(0) {
+}
 ==DONE==


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



  1   2   3   >