[PHP-CVS-DAILY] cvs: php-src / ChangeLog

2005-12-25 Thread changelog
changelog   Mon Dec 26 06:31:54 2005 EDT

  Modified files:  
/php-srcChangeLog 
  Log:
  ChangeLog update
  
http://cvs.php.net/viewcvs.cgi/php-src/ChangeLog?r1=1.2204r2=1.2205diff_format=u
Index: php-src/ChangeLog
diff -u php-src/ChangeLog:1.2204 php-src/ChangeLog:1.2205
--- php-src/ChangeLog:1.2204Sun Dec 25 06:31:45 2005
+++ php-src/ChangeLog   Mon Dec 26 06:31:53 2005
@@ -1,3 +1,81 @@
+2005-12-25  Antony Dovgal  [EMAIL PROTECTED]
+
+* ext/zlib/tests/compress_zlib_wrapper.phpt
+  ext/zlib/tests/compress_zlib_wrapper.phpt:
+  add missing skipif tag
+
+2005-12-25  Pierre-Alain Joye  [EMAIL PROTECTED]
+
+* ext/gd/tests/colorclosest.phpt:
+  - add colorclosestalpha tests
+
+* ext/gd/tests/colormatch.phpt
+  ext/gd/tests/colorresolve.phpt:
+  - add colorresolvealpha to colorresolve tests
+  - update colormatch
+
+* (PHP_5_1)
+  NEWS:
+  - imagecolormatch fix and changes
+
+* (PHP_5_1)
+  ext/gd/gd.c:
+  - MFH: raise warnings instead of errors in colormatch
+
+* ext/gd/gd.c:
+  - raise warning instread of errors in colormatch
+
+* (PHP_5_1)
+  ext/gd/gd.c
+  ext/gd/libgd/gd_topal.c
+  ext/gd/tests/colormatch.phpt:
+  - MFH: fix segfault/leak in imagecolormatch
+  - MFH: test for imagecolormatch
+
+* ext/gd/tests/colormatch.phpt
+  ext/gd/tests/colormatch.phpt:
+  
+  - fix leak/segfaults in imagecolormatch
+  - add tests for imagecolorexact and imagecolormatch
+The later is only about the segv
+
+* ext/gd/gd.c
+  ext/gd/libgd/gd_topal.c
+  ext/gd/tests/colorexact.phpt:
+  - fix leak/segfaults in imagecolormatch
+  - add tests for imagecolorexact and imagecolormatch
+The later is only about the segv
+
+2005-12-25  Rui Hirokawa  [EMAIL PROTECTED]
+
+* (PHP_5_1)
+  ext/mbstring/mb_gpc.c
+  ext/mbstring/mbstring.c
+  ext/mbstring/mbstring.h:
+  MFH: fixed #35711, added mbstring.strict_detection to detect the encoding
+  striktly.
+
+* ext/mbstring/mb_gpc.c
+  ext/mbstring/mbstring.c
+  ext/mbstring/mbstring.h:
+  fixed #35711, added mbstring.strict_detection to detect the encoding
+  striktly.
+
+2005-12-25  Zeev Suraski  [EMAIL PROTECTED]
+
+* sapi/cgi/cgi_main.c
+  sapi/cgi/config.w32
+  sapi/cgi/config9.m4:
+  Reimplement FastCGI interface
+  
+  Due to licensing restrictions that actually don't allow anybody to use
+  the libfcgi code without prior approval from Open Market, which is
+  impossible to obtain - we decided to reimplement this interface from
+  scratch.  The result is actually slightly faster, and more importantly,
+  clear of any copyright issues.
+  
+  Implementation by Dmitry
+
 2005-12-24  Pierre-Alain Joye  [EMAIL PROTECTED]
 
 * ext/gd/tests/colorclosest.phpt
@@ -20119,7 +20197,7 @@
 
 * (PHP_4_3)
   ext/standard/url_scanner_ex.re:
-  Missing $Id: ChangeLog,v 1.2204 2005/12/25 06:31:45 changelog Exp $ tag
+  Missing $Id: ChangeLog,v 1.2205 2005/12/26 06:31:53 changelog Exp $ tag
 
 * (PHP_5_0)
   ext/standard/url_scanner_ex.c:
@@ -23520,7 +23598,7 @@
   ext/session/mod_mm.h
   ext/session/mod_user.h
   ext/session/php_session.h:
-  - Missing $Id: ChangeLog,v 1.2204 2005/12/25 06:31:45 changelog Exp $ 
tags
+  - Missing $Id: ChangeLog,v 1.2205 2005/12/26 06:31:53 changelog Exp $ 
tags
 
 * (PHP_4_3)
   ext/session/session.c:
@@ -24001,7 +24079,7 @@
 
 * (PHP_4_3)
   Zend/zend_ini_scanner.l:
-  Missing $Id: ChangeLog,v 1.2204 2005/12/25 06:31:45 changelog Exp $ tag 
+ ws fix
+  Missing $Id: ChangeLog,v 1.2205 2005/12/26 06:31:53 changelog Exp $ tag 
+ ws fix
 
 * ZendEngine2/zend_ini_scanner.l
   ZendEngine2/zend_ini_scanner.l:
@@ -25475,7 +25553,7 @@
   ext/standard/url_scanner_ex.c
   ext/standard/url_scanner_ex.h
   ext/standard/url_scanner_ex.re:
-  Missing $Id: ChangeLog,v 1.2204 2005/12/25 06:31:45 changelog Exp $ tag
+  Missing $Id: ChangeLog,v 1.2205 2005/12/26 06:31:53 changelog Exp $ tag
 
 * ext/standard/credits_ext.h
   ext/standard/credits_sapi.h:


Re: [PHP-CVS] cvs: php-src(PHP_5_1) /ext/pdo_odbc odbc_driver.c

2005-12-25 Thread Markus Fischer

Hi Wez,

I've tested a snapshot 23th and it still crashes. See my comment in 
http://bugs.php.net/bug.php?id=35552 .


Thanks and mery christman,
- Markus

Wez Furlong wrote:

wez Wed Dec 14 04:56:22 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-src/ext/pdo_odbc	odbc_driver.c 
  Log:

  Possible fixes for #35552, #35592 and #35620.
  
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/pdo_odbc/odbc_driver.c?r1=1.27.2.1r2=1.27.2.2diff_format=u

Index: php-src/ext/pdo_odbc/odbc_driver.c
diff -u php-src/ext/pdo_odbc/odbc_driver.c:1.27.2.1 
php-src/ext/pdo_odbc/odbc_driver.c:1.27.2.2
--- php-src/ext/pdo_odbc/odbc_driver.c:1.27.2.1 Mon Sep 26 21:37:33 2005
+++ php-src/ext/pdo_odbc/odbc_driver.c  Wed Dec 14 04:56:22 2005
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: odbc_driver.c,v 1.27.2.1 2005/09/26 21:37:33 wez Exp $ */

+/* $Id: odbc_driver.c,v 1.27.2.2 2005/12/14 04:56:22 wez Exp $ */
 
 #ifdef HAVE_CONFIG_H

 #include config.h
@@ -58,8 +58,10 @@
 
 void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement, char *what, const char *file, int line TSRMLS_DC) /* {{{ */

 {
-   RETCODE rc;
-   SWORD   errmsgsize = 0;
+   SQLRETURN rc;
+   SQLSMALLINT errmsgsize = 0;
+   SQLHANDLE eh;
+   SQLSMALLINT htype, recno = 1;
pdo_odbc_db_handle *H = (pdo_odbc_db_handle*)dbh-driver_data;
pdo_odbc_errinfo *einfo = H-einfo;
pdo_odbc_stmt *S = NULL;
@@ -75,8 +77,19 @@
if (statement == SQL_NULL_HSTMT  S) {
statement = S-stmt;
}
-   
-   rc = SQLError(H-env, H-dbc, statement, einfo-last_state, 
einfo-last_error,
+
+   if (statement) {
+   htype = SQL_HANDLE_STMT;
+   eh = statement;
+   } else if (H-dbc) {
+   htype = SQL_HANDLE_DBC;
+   eh = H-dbc;
+   } else {
+   htype = SQL_HANDLE_ENV;
+   eh = H-env;
+   }
+
+   rc = SQLGetDiagRec(htype, eh, recno++, einfo-last_state, 
einfo-last_error,
einfo-last_err_msg, sizeof(einfo-last_err_msg)-1, 
errmsgsize);
 
 	if (rc != SQL_SUCCESS  rc != SQL_SUCCESS_WITH_INFO) {

@@ -94,6 +107,20 @@
zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, 
SQLSTATE[%s] %s: %d %s,
*pdo_err, what, einfo-last_error, 
einfo-last_err_msg);
}
+
+   /* just like a cursor, once you start pulling, you need to keep
+* going until the end; SQL Server (at least) will mess with the
+* actual cursor state if you don't finish retrieving all the
+* diagnostic records (which can be generated by PRINT statements
+* in the query, for instance). */
+   while (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) {
+   char discard_state[5];
+   char discard_buf[1024];
+   SQLINTEGER code;
+   rc = SQLGetDiagRec(htype, eh, recno++, discard_state, code,
+   discard_buf, sizeof(discard_buf)-1, 
errmsgsize);
+   }
+
 }
 /* }}} */
 
@@ -175,14 +202,12 @@

pdo_odbc_stmt_error(SQLPrepare);
}
 
+	stmt-driver_data = S;

+   stmt-methods = odbc_stmt_methods;
+
if (rc != SQL_SUCCESS  rc != SQL_SUCCESS_WITH_INFO) {
-   SQLFreeHandle(SQL_HANDLE_STMT, S-stmt);
return 0;
}
-
-   stmt-driver_data = S;
-   stmt-methods = odbc_stmt_methods;
-   
return 1;
 }
 



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



[PHP-CVS] cvs: php-src /sapi/cgi cgi_main.c config.w32 config9.m4

2005-12-25 Thread Zeev Suraski
zeevSun Dec 25 12:45:01 2005 EDT

  Modified files:  
/php-src/sapi/cgi   cgi_main.c config.w32 config9.m4 
  Log:
  Reimplement FastCGI interface
  
  Due to licensing restrictions that actually don't allow anybody to use
  the libfcgi code without prior approval from Open Market, which is
  impossible to obtain - we decided to reimplement this interface from
  scratch.  The result is actually slightly faster, and more importantly,
  clear of any copyright issues.
  
  Implementation by Dmitry
  
  
http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.272r2=1.273diff_format=u
Index: php-src/sapi/cgi/cgi_main.c
diff -u php-src/sapi/cgi/cgi_main.c:1.272 php-src/sapi/cgi/cgi_main.c:1.273
--- php-src/sapi/cgi/cgi_main.c:1.272   Fri Dec  9 16:58:02 2005
+++ php-src/sapi/cgi/cgi_main.c Sun Dec 25 12:45:01 2005
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: cgi_main.c,v 1.272 2005/12/09 16:58:02 dmitry Exp $ */
+/* $Id: cgi_main.c,v 1.273 2005/12/25 12:45:01 zeev Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -78,9 +78,8 @@
 
 #include php_getopt.h
 
-#include fcgi_config.h
-#include fcgiapp.h
-/* don't want to include fcgios.h, causes conflicts */
+#include fastcgi.h
+
 #ifdef PHP_WIN32
 extern int OS_SetImpersonate(void);
 #else
http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/config.w32?r1=1.3r2=1.4diff_format=u
Index: php-src/sapi/cgi/config.w32
diff -u php-src/sapi/cgi/config.w32:1.3 php-src/sapi/cgi/config.w32:1.4
--- php-src/sapi/cgi/config.w32:1.3 Wed Nov 23 18:08:51 2005
+++ php-src/sapi/cgi/config.w32 Sun Dec 25 12:45:01 2005
@@ -1,10 +1,9 @@
 // vim:ft=javascript
-// $Id: config.w32,v 1.3 2005/11/23 18:08:51 dmitry Exp $
+// $Id: config.w32,v 1.4 2005/12/25 12:45:01 zeev Exp $
 
 ARG_ENABLE('cgi', 'Build CGI version of PHP', 'yes');
 
 if (PHP_CGI == yes) {
-   SAPI('cgi', 'cgi_main.c getopt.c', 'php-cgi.exe', '/I 
sapi/cgi/libfcgi/include /D FCGI_STATIC');
-   ADD_SOURCES('sapi/cgi/libfcgi', 'fcgi_stdio.c fcgiapp.c os_win32.c', 
'cgi');
+   SAPI('cgi', 'cgi_main.c getopt.c fastcgi.c', 'php-cgi.exe');
ADD_FLAG('LIBS_CGI', 'ws2_32.lib kernel32.lib advapi32.lib');
 }
http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/config9.m4?r1=1.18r2=1.19diff_format=u
Index: php-src/sapi/cgi/config9.m4
diff -u php-src/sapi/cgi/config9.m4:1.18 php-src/sapi/cgi/config9.m4:1.19
--- php-src/sapi/cgi/config9.m4:1.18Wed Nov 23 18:08:51 2005
+++ php-src/sapi/cgi/config9.m4 Sun Dec 25 12:45:01 2005
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config9.m4,v 1.18 2005/11/23 18:08:51 dmitry Exp $
+dnl $Id: config9.m4,v 1.19 2005/12/25 12:45:01 zeev Exp $
 dnl
 
 AC_ARG_ENABLE(cgi,
@@ -45,6 +45,32 @@
   if test $PHP_SAPI_CGI != no; then
 AC_MSG_RESULT(yes)
 
+AC_MSG_CHECKING([for socklen_t in sys/socket.h])
+AC_EGREP_HEADER([socklen_t], [sys/socket.h],
+  [AC_MSG_RESULT([yes])
+   AC_DEFINE([HAVE_SOCKLEN_T], [1],
+[Define if the socklen_t typedef is in sys/socket.h])],
+  AC_MSG_RESULT([no]))
+
+AC_MSG_CHECKING([for sun_len in sys/un.h])
+AC_EGREP_HEADER([sun_len], [sys/un.h],
+  [AC_MSG_RESULT([yes])
+   AC_DEFINE([HAVE_SOCKADDR_UN_SUN_LEN], [1],
+[Define if sockaddr_un in sys/un.h contains a sun_len component])],
+  AC_MSG_RESULT([no]))
+
+AC_MSG_CHECKING([whether cross-process locking is required by accept()])
+case `uname -sr` in
+  IRIX\ 5.* | SunOS\ 5.* | UNIX_System_V\ 4.0) 
+AC_MSG_RESULT([yes])
+AC_DEFINE([USE_LOCKING], [1], 
+  [Define if cross-process locking is required by accept()])
+  ;;
+  *)
+AC_MSG_RESULT([no])
+  ;;
+esac
+
 PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/cgi/Makefile.frag)
 case $host_alias in
   *cygwin* )
@@ -58,11 +84,8 @@
 
 PHP_TEST_WRITE_STDOUT
 
-PHP_ADD_BUILD_DIR($abs_builddir/sapi/cgi/libfcgi)
-PHP_FCGI_INCLUDE=-I$abs_srcdir/sapi/cgi/libfcgi/include
-
 INSTALL_IT=@echo \Installing PHP CGI into: 
\$(INSTALL_ROOT)\$(bindir)/\; \$(INSTALL) -m 0755 \$(SAPI_CGI_PATH) 
\$(INSTALL_ROOT)\$(bindir)/\$(program_prefix)php\$(program_suffix)\$(EXEEXT)
-PHP_SELECT_SAPI(cgi, program, libfcgi/fcgi_stdio.c libfcgi/fcgiapp.c 
libfcgi/os_unix.c cgi_main.c getopt.c, $PHP_FCGI_INCLUDE, '$(SAPI_CGI_PATH)')
+PHP_SELECT_SAPI(cgi, program, fastcgi.c cgi_main.c getopt.c, '', 
'$(SAPI_CGI_PATH)')
 
 case $host_alias in
   *aix*)

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



[PHP-CVS] cvs: php-src /ext/mbstring mb_gpc.c mbstring.c mbstring.h /ext/mbstring/libmbfl/mbfl mbfilter.c mbfilter.h

2005-12-25 Thread Rui Hirokawa
hirokawaSun Dec 25 15:21:54 2005 EDT

  Modified files:  
/php-src/ext/mbstring   mb_gpc.c mbstring.c mbstring.h 
/php-src/ext/mbstring/libmbfl/mbfl  mbfilter.c mbfilter.h 
  Log:
  fixed #35711, added mbstring.strict_detection to detect the encoding striktly.
  http://cvs.php.net/viewcvs.cgi/php-src/ext/mbstring/mb_gpc.c?r1=1.17r2=1.18diff_format=u
Index: php-src/ext/mbstring/mb_gpc.c
diff -u php-src/ext/mbstring/mb_gpc.c:1.17 php-src/ext/mbstring/mb_gpc.c:1.18
--- php-src/ext/mbstring/mb_gpc.c:1.17  Wed Aug  3 14:07:24 2005
+++ php-src/ext/mbstring/mb_gpc.c   Sun Dec 25 15:21:54 2005
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mb_gpc.c,v 1.17 2005/08/03 14:07:24 sniper Exp $ */
+/* $Id: mb_gpc.c,v 1.18 2005/12/25 15:21:54 hirokawa Exp $ */
 
 /* {{{ includes */
 #ifdef HAVE_CONFIG_H
@@ -266,7 +266,7 @@
} else {
/* auto detect */
from_encoding = mbfl_no_encoding_invalid;
-   identd = mbfl_encoding_detector_new((enum mbfl_no_encoding 
*)info-from_encodings, info-num_from_encodings);
+   identd = mbfl_encoding_detector_new((enum mbfl_no_encoding 
*)info-from_encodings, info-num_from_encodings, MBSTRG(strict_detection));
if (identd) {
n = 0;
while (n  num) {
http://cvs.php.net/viewcvs.cgi/php-src/ext/mbstring/mbstring.c?r1=1.232r2=1.233diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.232 
php-src/ext/mbstring/mbstring.c:1.233
--- php-src/ext/mbstring/mbstring.c:1.232   Fri Dec 23 11:14:54 2005
+++ php-src/ext/mbstring/mbstring.c Sun Dec 25 15:21:54 2005
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mbstring.c,v 1.232 2005/12/23 11:14:54 hirokawa Exp $ */
+/* $Id: mbstring.c,v 1.233 2005/12/25 15:21:54 hirokawa Exp $ */
 
 /*
  * PHP 4 Multibyte String module mbstring
@@ -733,6 +733,9 @@
 STD_PHP_INI_BOOLEAN(mbstring.encoding_translation, 0,
 PHP_INI_SYSTEM | PHP_INI_PERDIR, 
OnUpdate_mbstring_encoding_translation, 
 encoding_translation, zend_mbstring_globals, mbstring_globals) 
 
+
+STD_PHP_INI_BOOLEAN(mbstring.strict_detection, 0,
+PHP_INI_ALL, OnUpdateLong, strict_detection, zend_mbstring_globals, 
mbstring_globals)
 PHP_INI_END()
 /* }}} */
 
@@ -768,6 +771,7 @@
MBSTRG(current_filter_illegal_substchar) = 0x3f;/* '?' */
MBSTRG(func_overload) = 0;
MBSTRG(encoding_translation) = 0;
+   MBSTRG(strict_detection) = 0;
pglobals-outconv = NULL;
 #if HAVE_MBREGEX
_php_mb_regex_globals_ctor(pglobals TSRMLS_CC);
@@ -2021,7 +2025,7 @@
string.no_encoding = from_encoding;
} else if (size  1) {
/* auto detect */
-   from_encoding = mbfl_identify_encoding_no(string, 
list, size);
+   from_encoding = mbfl_identify_encoding_no(string, 
list, size, MBSTRG(strict_detection));
if (from_encoding != mbfl_no_encoding_invalid) {
string.no_encoding = from_encoding;
} else {
@@ -2213,7 +2217,7 @@
mbfl_string string;
const char *ret;
enum mbfl_no_encoding *elist;
-   int size, *list, strict = 0;
+   int size, *list, strict;
 
if (ZEND_NUM_ARGS() == 1) {
if (zend_get_parameters_ex(1, arg_str) == FAILURE) {
@@ -2263,6 +2267,9 @@
convert_to_long_ex(arg_strict);
strict = Z_LVAL_PP(arg_strict);
}
+   else {
+   strict = MBSTRG(strict_detection);
+   }
 
if (size  0  list != NULL) {
elist = list;
@@ -2554,7 +2561,7 @@
stack_max = PHP_MBSTR_STACK_BLOCK_SIZE;
stack = (zval ***)safe_emalloc(stack_max, sizeof(zval **), 0);
stack_level = 0;
-   identd = mbfl_encoding_detector_new(elist, elistsz);
+   identd = mbfl_encoding_detector_new(elist, elistsz, 
MBSTRG(strict_detection));
if (identd != NULL) {
n = 2;
while (n  argc || stack_level  0) {
@@ -3173,7 +3180,7 @@
orig_str.no_encoding = MBSTRG(current_internal_encoding);
if (orig_str.no_encoding == mbfl_no_encoding_invalid
|| orig_str.no_encoding == mbfl_no_encoding_pass) {
-   orig_str.no_encoding = 
mbfl_identify_encoding_no(orig_str, MBSTRG(current_detect_order_list), 
MBSTRG(current_detect_order_list_size));
+   orig_str.no_encoding = 
mbfl_identify_encoding_no(orig_str, MBSTRG(current_detect_order_list), 
MBSTRG(current_detect_order_list_size), MBSTRG(strict_detection));
  

[PHP-CVS] cvs: php-src(PHP_5_1) /ext/mbstring mb_gpc.c mbstring.c mbstring.h /ext/mbstring/libmbfl/mbfl mbfilter.c mbfilter.h

2005-12-25 Thread Rui Hirokawa
hirokawaSun Dec 25 15:23:55 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-src/ext/mbstring   mb_gpc.c mbstring.c mbstring.h 
/php-src/ext/mbstring/libmbfl/mbfl  mbfilter.c mbfilter.h 
  Log:
  MFH: fixed #35711, added mbstring.strict_detection to detect the encoding 
striktly.
  http://cvs.php.net/viewcvs.cgi/php-src/ext/mbstring/mb_gpc.c?r1=1.17r2=1.17.2.1diff_format=u
Index: php-src/ext/mbstring/mb_gpc.c
diff -u php-src/ext/mbstring/mb_gpc.c:1.17 
php-src/ext/mbstring/mb_gpc.c:1.17.2.1
--- php-src/ext/mbstring/mb_gpc.c:1.17  Wed Aug  3 14:07:24 2005
+++ php-src/ext/mbstring/mb_gpc.c   Sun Dec 25 15:23:55 2005
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mb_gpc.c,v 1.17 2005/08/03 14:07:24 sniper Exp $ */
+/* $Id: mb_gpc.c,v 1.17.2.1 2005/12/25 15:23:55 hirokawa Exp $ */
 
 /* {{{ includes */
 #ifdef HAVE_CONFIG_H
@@ -266,7 +266,7 @@
} else {
/* auto detect */
from_encoding = mbfl_no_encoding_invalid;
-   identd = mbfl_encoding_detector_new((enum mbfl_no_encoding 
*)info-from_encodings, info-num_from_encodings);
+   identd = mbfl_encoding_detector_new((enum mbfl_no_encoding 
*)info-from_encodings, info-num_from_encodings, MBSTRG(strict_detection));
if (identd) {
n = 0;
while (n  num) {
http://cvs.php.net/viewcvs.cgi/php-src/ext/mbstring/mbstring.c?r1=1.224.2.9r2=1.224.2.10diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.224.2.9 
php-src/ext/mbstring/mbstring.c:1.224.2.10
--- php-src/ext/mbstring/mbstring.c:1.224.2.9   Fri Dec 23 11:15:16 2005
+++ php-src/ext/mbstring/mbstring.c Sun Dec 25 15:23:55 2005
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mbstring.c,v 1.224.2.9 2005/12/23 11:15:16 hirokawa Exp $ */
+/* $Id: mbstring.c,v 1.224.2.10 2005/12/25 15:23:55 hirokawa Exp $ */
 
 /*
  * PHP 4 Multibyte String module mbstring
@@ -734,6 +734,9 @@
 STD_PHP_INI_BOOLEAN(mbstring.encoding_translation, 0,
 PHP_INI_SYSTEM | PHP_INI_PERDIR, 
OnUpdate_mbstring_encoding_translation, 
 encoding_translation, zend_mbstring_globals, mbstring_globals) 
 
+
+STD_PHP_INI_BOOLEAN(mbstring.strict_detection, 0,
+PHP_INI_ALL, OnUpdateLong, strict_detection, zend_mbstring_globals, 
mbstring_globals)
 PHP_INI_END()
 /* }}} */
 
@@ -769,6 +772,7 @@
MBSTRG(current_filter_illegal_substchar) = 0x3f;/* '?' */
MBSTRG(func_overload) = 0;
MBSTRG(encoding_translation) = 0;
+   MBSTRG(strict_detection) = 0;
pglobals-outconv = NULL;
 #if HAVE_MBREGEX
_php_mb_regex_globals_ctor(pglobals TSRMLS_CC);
@@ -2022,7 +2026,7 @@
string.no_encoding = from_encoding;
} else if (size  1) {
/* auto detect */
-   from_encoding = mbfl_identify_encoding_no(string, 
list, size);
+   from_encoding = mbfl_identify_encoding_no(string, 
list, size, MBSTRG(strict_detection));
if (from_encoding != mbfl_no_encoding_invalid) {
string.no_encoding = from_encoding;
} else {
@@ -2264,6 +2268,9 @@
convert_to_long_ex(arg_strict);
strict = Z_LVAL_PP(arg_strict);
}
+   else {
+   strict = MBSTRG(strict_detection);
+   }
 
if (size  0  list != NULL) {
elist = list;
@@ -2555,7 +2562,7 @@
stack_max = PHP_MBSTR_STACK_BLOCK_SIZE;
stack = (zval ***)safe_emalloc(stack_max, sizeof(zval **), 0);
stack_level = 0;
-   identd = mbfl_encoding_detector_new(elist, elistsz);
+   identd = mbfl_encoding_detector_new(elist, elistsz, 
MBSTRG(strict_detection));
if (identd != NULL) {
n = 2;
while (n  argc || stack_level  0) {
@@ -3174,7 +3181,7 @@
orig_str.no_encoding = MBSTRG(current_internal_encoding);
if (orig_str.no_encoding == mbfl_no_encoding_invalid
|| orig_str.no_encoding == mbfl_no_encoding_pass) {
-   orig_str.no_encoding = 
mbfl_identify_encoding_no(orig_str, MBSTRG(current_detect_order_list), 
MBSTRG(current_detect_order_list_size));
+   orig_str.no_encoding = 
mbfl_identify_encoding_no(orig_str, MBSTRG(current_detect_order_list), 
MBSTRG(current_detect_order_list_size), MBSTRG(strict_detection));
}
pstr = mbfl_mime_header_encode(orig_str, conv_str, tran_cs, 
head_enc, \n, sizeof(Subject: [PHP-jp ]));
if (pstr != NULL) {
@@ -3194,7 +3201,7 @@
 
if 

[PHP-CVS] cvs: php-src /ext/spl spl_iterators.c /ext/spl/tests array_004.phpt array_006.phpt array_008.phpt

2005-12-25 Thread Jani Taskinen
sniper  Sun Dec 25 16:03:38 2005 EDT

  Modified files:  
/php-src/ext/splspl_iterators.c 
/php-src/ext/spl/tests  array_004.phpt array_006.phpt array_008.phpt 
  Log:
  - Remove wrong inline usage (and fix bug #35796)
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.104r2=1.105diff_format=u
Index: php-src/ext/spl/spl_iterators.c
diff -u php-src/ext/spl/spl_iterators.c:1.104 
php-src/ext/spl/spl_iterators.c:1.105
--- php-src/ext/spl/spl_iterators.c:1.104   Thu Dec 22 00:38:05 2005
+++ php-src/ext/spl/spl_iterators.c Sun Dec 25 16:03:38 2005
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_iterators.c,v 1.104 2005/12/22 00:38:05 helly Exp $ */
+/* $Id: spl_iterators.c,v 1.105 2005/12/25 16:03:38 sniper Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -36,8 +36,6 @@
 #include spl_array.h
 #include spl_exceptions.h
 
-#define INLINE inline
-
 PHPAPI zend_class_entry *spl_ce_RecursiveIterator;
 PHPAPI zend_class_entry *spl_ce_RecursiveIteratorIterator;
 PHPAPI zend_class_entry *spl_ce_FilterIterator;
@@ -831,9 +829,9 @@
 }
 #endif
 
-static INLINE int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more 
TSRMLS_DC);
+static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more 
TSRMLS_DC);
 
-static INLINE spl_dual_it_object* 
spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *ce_inner, 
dual_it_type dit_type)
+static inline spl_dual_it_object* 
spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *ce_inner, 
dual_it_type dit_type)
 {
zval *zobject, *retval;
spl_dual_it_object   *intern;
@@ -990,14 +988,14 @@
}
 } /* }}} */
 
-static INLINE void spl_dual_it_require(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_dual_it_require(spl_dual_it_object *intern TSRMLS_DC)
 {
if (!intern-inner.iterator) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, The inner 
constructor wasn't initialized with an iterator instance);
}
 }
 
-static INLINE void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC)
 {
if (intern-inner.iterator  
intern-inner.iterator-funcs-invalidate_current) {

intern-inner.iterator-funcs-invalidate_current(intern-inner.iterator 
TSRMLS_CC);
@@ -1022,7 +1020,7 @@
}
 }
 
-static INLINE void spl_dual_it_rewind(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_dual_it_rewind(spl_dual_it_object *intern TSRMLS_DC)
 {
spl_dual_it_free(intern TSRMLS_CC);
intern-current.pos = 0;
@@ -1031,13 +1029,13 @@
}
 }
 
-static INLINE int spl_dual_it_valid(spl_dual_it_object *intern TSRMLS_DC)
+static inline int spl_dual_it_valid(spl_dual_it_object *intern TSRMLS_DC)
 {
/* FAILURE / SUCCESS */
return intern-inner.iterator-funcs-valid(intern-inner.iterator 
TSRMLS_CC);
 }
 
-static INLINE int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more 
TSRMLS_DC)
+static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more 
TSRMLS_DC)
 {
zval **data;
 
@@ -1057,7 +1055,7 @@
return FAILURE;
 }
 
-static INLINE void spl_dual_it_next(spl_dual_it_object *intern, int do_free 
TSRMLS_DC)
+static inline void spl_dual_it_next(spl_dual_it_object *intern, int do_free 
TSRMLS_DC)
 {
if (do_free) {
spl_dual_it_free(intern TSRMLS_CC);
@@ -1158,7 +1156,7 @@
spl_dual_it_fetch(intern, 1 TSRMLS_CC);
 } /* }}} */
 
-static INLINE void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern 
TSRMLS_DC)
+static inline void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern 
TSRMLS_DC)
 {
zval *retval;
 
@@ -1177,13 +1175,13 @@
spl_dual_it_free(intern TSRMLS_CC);
 }
 
-static INLINE void spl_filter_it_rewind(zval *zthis, spl_dual_it_object 
*intern TSRMLS_DC)
+static inline void spl_filter_it_rewind(zval *zthis, spl_dual_it_object 
*intern TSRMLS_DC)
 {
spl_dual_it_rewind(intern TSRMLS_CC);
spl_filter_it_fetch(zthis, intern TSRMLS_CC);
 }
 
-static INLINE void spl_filter_it_next(zval *zthis, spl_dual_it_object *intern 
TSRMLS_DC)
+static inline void spl_filter_it_next(zval *zthis, spl_dual_it_object *intern 
TSRMLS_DC)
 {
spl_dual_it_next(intern, 1 TSRMLS_CC);
spl_filter_it_fetch(zthis, intern TSRMLS_CC);
@@ -1336,7 +1334,7 @@
 #endif
 
 /* {{{ spl_dual_it_free_storage */
-static INLINE void spl_dual_it_free_storage(void *_object TSRMLS_DC)
+static inline void spl_dual_it_free_storage(void *_object TSRMLS_DC)
 {
spl_dual_it_object*object = (spl_dual_it_object *)_object;
 
@@ -1458,7 +1456,7 @@
 };
 #endif
 
-static INLINE int spl_limit_it_valid(spl_dual_it_object *intern TSRMLS_DC)
+static inline int spl_limit_it_valid(spl_dual_it_object *intern TSRMLS_DC)
 {
 

[PHP-CVS] cvs: php-src(PHP_5_1) /ext/spl spl_iterators.c

2005-12-25 Thread Jani Taskinen
sniper  Sun Dec 25 16:04:15 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-src/ext/splspl_iterators.c 
  Log:
  MFH
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.73.2.15r2=1.73.2.16diff_format=u
Index: php-src/ext/spl/spl_iterators.c
diff -u php-src/ext/spl/spl_iterators.c:1.73.2.15 
php-src/ext/spl/spl_iterators.c:1.73.2.16
--- php-src/ext/spl/spl_iterators.c:1.73.2.15   Thu Dec 22 00:37:07 2005
+++ php-src/ext/spl/spl_iterators.c Sun Dec 25 16:04:15 2005
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_iterators.c,v 1.73.2.15 2005/12/22 00:37:07 helly Exp $ */
+/* $Id: spl_iterators.c,v 1.73.2.16 2005/12/25 16:04:15 sniper Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -36,8 +36,6 @@
 #include spl_array.h
 #include spl_exceptions.h
 
-#define INLINE inline
-
 PHPAPI zend_class_entry *spl_ce_RecursiveIterator;
 PHPAPI zend_class_entry *spl_ce_RecursiveIteratorIterator;
 PHPAPI zend_class_entry *spl_ce_FilterIterator;
@@ -817,9 +815,9 @@
 }
 #endif
 
-static INLINE int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more 
TSRMLS_DC);
+static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more 
TSRMLS_DC);
 
-static INLINE spl_dual_it_object* 
spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *ce_inner, 
dual_it_type dit_type)
+static inline spl_dual_it_object* 
spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *ce_inner, 
dual_it_type dit_type)
 {
zval *zobject, *retval;
spl_dual_it_object   *intern;
@@ -956,14 +954,14 @@
}
 } /* }}} */
 
-static INLINE void spl_dual_it_require(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_dual_it_require(spl_dual_it_object *intern TSRMLS_DC)
 {
if (!intern-inner.iterator) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, The inner 
constructor wasn't initialized with an iterator instance);
}
 }
 
-static INLINE void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC)
 {
if (intern-inner.iterator  
intern-inner.iterator-funcs-invalidate_current) {

intern-inner.iterator-funcs-invalidate_current(intern-inner.iterator 
TSRMLS_CC);
@@ -988,7 +986,7 @@
}
 }
 
-static INLINE void spl_dual_it_rewind(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_dual_it_rewind(spl_dual_it_object *intern TSRMLS_DC)
 {
spl_dual_it_free(intern TSRMLS_CC);
intern-current.pos = 0;
@@ -997,13 +995,13 @@
}
 }
 
-static INLINE int spl_dual_it_valid(spl_dual_it_object *intern TSRMLS_DC)
+static inline int spl_dual_it_valid(spl_dual_it_object *intern TSRMLS_DC)
 {
/* FAILURE / SUCCESS */
return intern-inner.iterator-funcs-valid(intern-inner.iterator 
TSRMLS_CC);
 }
 
-static INLINE int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more 
TSRMLS_DC)
+static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more 
TSRMLS_DC)
 {
zval **data;
 
@@ -1023,7 +1021,7 @@
return FAILURE;
 }
 
-static INLINE void spl_dual_it_next(spl_dual_it_object *intern, int do_free 
TSRMLS_DC)
+static inline void spl_dual_it_next(spl_dual_it_object *intern, int do_free 
TSRMLS_DC)
 {
if (do_free) {
spl_dual_it_free(intern TSRMLS_CC);
@@ -1120,7 +1118,7 @@
spl_dual_it_fetch(intern, 1 TSRMLS_CC);
 } /* }}} */
 
-static INLINE void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern 
TSRMLS_DC)
+static inline void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern 
TSRMLS_DC)
 {
zval *retval;
 
@@ -1139,13 +1137,13 @@
spl_dual_it_free(intern TSRMLS_CC);
 }
 
-static INLINE void spl_filter_it_rewind(zval *zthis, spl_dual_it_object 
*intern TSRMLS_DC)
+static inline void spl_filter_it_rewind(zval *zthis, spl_dual_it_object 
*intern TSRMLS_DC)
 {
spl_dual_it_rewind(intern TSRMLS_CC);
spl_filter_it_fetch(zthis, intern TSRMLS_CC);
 }
 
-static INLINE void spl_filter_it_next(zval *zthis, spl_dual_it_object *intern 
TSRMLS_DC)
+static inline void spl_filter_it_next(zval *zthis, spl_dual_it_object *intern 
TSRMLS_DC)
 {
spl_dual_it_next(intern, 1 TSRMLS_CC);
spl_filter_it_fetch(zthis, intern TSRMLS_CC);
@@ -1240,7 +1238,7 @@
 } /* }}} */
 
 /* {{{ spl_dual_it_free_storage */
-static INLINE void spl_dual_it_free_storage(void *_object TSRMLS_DC)
+static inline void spl_dual_it_free_storage(void *_object TSRMLS_DC)
 {
spl_dual_it_object*object = (spl_dual_it_object *)_object;
 
@@ -1326,7 +1324,7 @@
{NULL, NULL, NULL}
 };
 
-static INLINE int spl_limit_it_valid(spl_dual_it_object *intern TSRMLS_DC)
+static inline int spl_limit_it_valid(spl_dual_it_object *intern TSRMLS_DC)
 {
/* FAILURE / SUCCESS */
if (intern-u.limit.count 

Re: [PHP-CVS] cvs: php-src /ext/spl spl_iterators.c /ext/spl/tests array_004.phpt array_006.phpt array_008.phpt

2005-12-25 Thread Marcus Boerger
Hello Jani,

  a, jani there was no wrong inline usage, just stupid compilers
ignoring the specs, and the way to fix it is to find the places where
an inline function is used as a non inline function and prodive a non
inline wrapper for it. Which is probably only one single instance.

regards
marcus

Sunday, December 25, 2005, 5:03:38 PM, you wrote:

 sniper  Sun Dec 25 16:03:38 2005 EDT

   Modified files:  
 /php-src/ext/splspl_iterators.c 
 /php-src/ext/spl/tests  array_004.phpt array_006.phpt array_008.phpt
   Log:
   - Remove wrong inline usage (and fix bug #35796)
   
 http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.104r2=1.105diff_format=u
 Index: php-src/ext/spl/spl_iterators.c
 diff -u php-src/ext/spl/spl_iterators.c:1.104
 php-src/ext/spl/spl_iterators.c:1.105
 --- php-src/ext/spl/spl_iterators.c:1.104   Thu Dec 22 00:38:05 2005
 +++ php-src/ext/spl/spl_iterators.c Sun Dec 25 16:03:38 2005
 @@ -16,7 +16,7 @@
 +--+
   */
  
 -/* $Id: spl_iterators.c,v 1.104 2005/12/22 00:38:05 helly Exp $ */
 +/* $Id: spl_iterators.c,v 1.105 2005/12/25 16:03:38 sniper Exp $ */
  
  #ifdef HAVE_CONFIG_H
  # include config.h
 @@ -36,8 +36,6 @@
  #include spl_array.h
  #include spl_exceptions.h
  
 -#define INLINE inline
 -
  PHPAPI zend_class_entry *spl_ce_RecursiveIterator;
  PHPAPI zend_class_entry *spl_ce_RecursiveIteratorIterator;
  PHPAPI zend_class_entry *spl_ce_FilterIterator;
 @@ -831,9 +829,9 @@
  }
  #endif
  
 -static INLINE int spl_dual_it_fetch(spl_dual_it_object *intern, int 
 check_more TSRMLS_DC);
 +static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int 
 check_more TSRMLS_DC);
  
 -static INLINE spl_dual_it_object*
 spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry 
 *ce_inner, dual_it_type dit_type)
 +static inline spl_dual_it_object*
 spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry 
 *ce_inner, dual_it_type dit_type)
  {
 zval *zobject, *retval;
 spl_dual_it_object   *intern;
 @@ -990,14 +988,14 @@
 }
  } /* }}} */
  
 -static INLINE void spl_dual_it_require(spl_dual_it_object *intern TSRMLS_DC)
 +static inline void spl_dual_it_require(spl_dual_it_object *intern TSRMLS_DC)
  {
 if (!intern-inner.iterator) {
 php_error_docref(NULL TSRMLS_CC, E_ERROR, The inner
 constructor wasn't initialized with an iterator instance);
 }
  }
  
 -static INLINE void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC)
 +static inline void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC)
  {
 if (intern-inner.iterator 
 intern-inner.iterator-funcs-invalidate_current) {

 intern-inner.iterator-funcs-invalidate_current(intern-inner.iterator 
 TSRMLS_CC);
 @@ -1022,7 +1020,7 @@
 }
  }
  
 -static INLINE void spl_dual_it_rewind(spl_dual_it_object *intern TSRMLS_DC)
 +static inline void spl_dual_it_rewind(spl_dual_it_object *intern TSRMLS_DC)
  {
 spl_dual_it_free(intern TSRMLS_CC);
 intern-current.pos = 0;
 @@ -1031,13 +1029,13 @@
 }
  }
  
 -static INLINE int spl_dual_it_valid(spl_dual_it_object *intern TSRMLS_DC)
 +static inline int spl_dual_it_valid(spl_dual_it_object *intern TSRMLS_DC)
  {
 /* FAILURE / SUCCESS */
 return
 intern-inner.iterator-funcs-valid(intern-inner.iterator TSRMLS_CC);
  }
  
 -static INLINE int spl_dual_it_fetch(spl_dual_it_object *intern, int 
 check_more TSRMLS_DC)
 +static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int 
 check_more TSRMLS_DC)
  {
 zval **data;
  
 @@ -1057,7 +1055,7 @@
 return FAILURE;
  }
  
 -static INLINE void spl_dual_it_next(spl_dual_it_object *intern, int do_free 
 TSRMLS_DC)
 +static inline void spl_dual_it_next(spl_dual_it_object *intern, int do_free 
 TSRMLS_DC)
  {
 if (do_free) {
 spl_dual_it_free(intern TSRMLS_CC);
 @@ -1158,7 +1156,7 @@
 spl_dual_it_fetch(intern, 1 TSRMLS_CC);
  } /* }}} */
  
 -static INLINE void spl_filter_it_fetch(zval *zthis, spl_dual_it_object 
 *intern TSRMLS_DC)
 +static inline void spl_filter_it_fetch(zval *zthis, spl_dual_it_object 
 *intern TSRMLS_DC)
  {
 zval *retval;
  
 @@ -1177,13 +1175,13 @@
 spl_dual_it_free(intern TSRMLS_CC);
  }
  
 -static INLINE void spl_filter_it_rewind(zval *zthis, spl_dual_it_object 
 *intern TSRMLS_DC)
 +static inline void spl_filter_it_rewind(zval *zthis, spl_dual_it_object 
 *intern TSRMLS_DC)
  {
 spl_dual_it_rewind(intern TSRMLS_CC);
 spl_filter_it_fetch(zthis, intern TSRMLS_CC);
  }
  
 -static INLINE void spl_filter_it_next(zval *zthis, spl_dual_it_object 
 *intern TSRMLS_DC)
 +static inline void spl_filter_it_next(zval *zthis, spl_dual_it_object 
 *intern TSRMLS_DC)
  {
 spl_dual_it_next(intern, 1 TSRMLS_CC);
 spl_filter_it_fetch(zthis, intern 

Re: [PHP-CVS] cvs: php-src /ext/spl spl_iterators.c /ext/spl/tests array_004.phpt array_006.phpt array_008.phpt

2005-12-25 Thread Jani Taskinen


It was wrong since you can safely use inline anywhere.
It's checked elsewhere and re-defined for each OS/compiler
properly. You're not supposed to create such macros yourself.

--Jani


On Sun, 25 Dec 2005, Marcus Boerger wrote:



Hello Jani,

 a, jani there was no wrong inline usage, just stupid compilers
ignoring the specs, and the way to fix it is to find the places where
an inline function is used as a non inline function and prodive a non
inline wrapper for it. Which is probably only one single instance.

regards
marcus

Sunday, December 25, 2005, 5:03:38 PM, you wrote:


sniper  Sun Dec 25 16:03:38 2005 EDT



  Modified files:
/php-src/ext/splspl_iterators.c
/php-src/ext/spl/tests  array_004.phpt array_006.phpt array_008.phpt
  Log:
  - Remove wrong inline usage (and fix bug #35796)

http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.104r2=1.105diff_format=u
Index: php-src/ext/spl/spl_iterators.c
diff -u php-src/ext/spl/spl_iterators.c:1.104
php-src/ext/spl/spl_iterators.c:1.105
--- php-src/ext/spl/spl_iterators.c:1.104   Thu Dec 22 00:38:05 2005
+++ php-src/ext/spl/spl_iterators.c Sun Dec 25 16:03:38 2005
@@ -16,7 +16,7 @@
+--+
  */

-/* $Id: spl_iterators.c,v 1.104 2005/12/22 00:38:05 helly Exp $ */
+/* $Id: spl_iterators.c,v 1.105 2005/12/25 16:03:38 sniper Exp $ */

 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -36,8 +36,6 @@
 #include spl_array.h
 #include spl_exceptions.h

-#define INLINE inline
-
 PHPAPI zend_class_entry *spl_ce_RecursiveIterator;
 PHPAPI zend_class_entry *spl_ce_RecursiveIteratorIterator;
 PHPAPI zend_class_entry *spl_ce_FilterIterator;
@@ -831,9 +829,9 @@
 }
 #endif

-static INLINE int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more 
TSRMLS_DC);
+static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more 
TSRMLS_DC);

-static INLINE spl_dual_it_object*
spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *ce_inner, 
dual_it_type dit_type)
+static inline spl_dual_it_object*
spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *ce_inner, 
dual_it_type dit_type)
 {
zval *zobject, *retval;
spl_dual_it_object   *intern;
@@ -990,14 +988,14 @@
}
 } /* }}} */

-static INLINE void spl_dual_it_require(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_dual_it_require(spl_dual_it_object *intern TSRMLS_DC)
 {
if (!intern-inner.iterator) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, The inner
constructor wasn't initialized with an iterator instance);
}
 }

-static INLINE void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC)
 {
if (intern-inner.iterator 
intern-inner.iterator-funcs-invalidate_current) {

intern-inner.iterator-funcs-invalidate_current(intern-inner.iterator 
TSRMLS_CC);
@@ -1022,7 +1020,7 @@
}
 }

-static INLINE void spl_dual_it_rewind(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_dual_it_rewind(spl_dual_it_object *intern TSRMLS_DC)
 {
spl_dual_it_free(intern TSRMLS_CC);
intern-current.pos = 0;
@@ -1031,13 +1029,13 @@
}
 }

-static INLINE int spl_dual_it_valid(spl_dual_it_object *intern TSRMLS_DC)
+static inline int spl_dual_it_valid(spl_dual_it_object *intern TSRMLS_DC)
 {
/* FAILURE / SUCCESS */
return
intern-inner.iterator-funcs-valid(intern-inner.iterator TSRMLS_CC);
 }

-static INLINE int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more 
TSRMLS_DC)
+static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more 
TSRMLS_DC)
 {
zval **data;

@@ -1057,7 +1055,7 @@
return FAILURE;
 }

-static INLINE void spl_dual_it_next(spl_dual_it_object *intern, int do_free 
TSRMLS_DC)
+static inline void spl_dual_it_next(spl_dual_it_object *intern, int do_free 
TSRMLS_DC)
 {
if (do_free) {
spl_dual_it_free(intern TSRMLS_CC);
@@ -1158,7 +1156,7 @@
spl_dual_it_fetch(intern, 1 TSRMLS_CC);
 } /* }}} */

-static INLINE void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern 
TSRMLS_DC)
+static inline void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern 
TSRMLS_DC)
 {
zval *retval;

@@ -1177,13 +1175,13 @@
spl_dual_it_free(intern TSRMLS_CC);
 }

-static INLINE void spl_filter_it_rewind(zval *zthis, spl_dual_it_object 
*intern TSRMLS_DC)
+static inline void spl_filter_it_rewind(zval *zthis, spl_dual_it_object 
*intern TSRMLS_DC)
 {
spl_dual_it_rewind(intern TSRMLS_CC);
spl_filter_it_fetch(zthis, intern TSRMLS_CC);
 }

-static INLINE void spl_filter_it_next(zval *zthis, spl_dual_it_object *intern 
TSRMLS_DC)
+static inline void spl_filter_it_next(zval *zthis, spl_dual_it_object *intern 
TSRMLS_DC)
 {

Re: [PHP-CVS] cvs: php-src /ext/spl spl_iterators.c /ext/spl/tests array_004.phpt array_006.phpt array_008.phpt

2005-12-25 Thread Marcus Boerger
Hello Jani,

  though what you said is also true, i can nolonger easily get rid of those
inline definitions for debugging purpose.

marcus

Sunday, December 25, 2005, 5:15:35 PM, you wrote:

  It was wrong since you can safely use inline anywhere.
  It's checked elsewhere and re-defined for each OS/compiler
  properly. You're not supposed to create such macros yourself.

  --Jani


 On Sun, 25 Dec 2005, Marcus Boerger wrote:


 Hello Jani,

  a, jani there was no wrong inline usage, just stupid compilers
 ignoring the specs, and the way to fix it is to find the places where
 an inline function is used as a non inline function and prodive a non
 inline wrapper for it. Which is probably only one single instance.

 regards
 marcus

 Sunday, December 25, 2005, 5:03:38 PM, you wrote:

 sniper  Sun Dec 25 16:03:38 2005 EDT

   Modified files:
 /php-src/ext/splspl_iterators.c
 /php-src/ext/spl/tests  array_004.phpt array_006.phpt array_008.phpt
   Log:
   - Remove wrong inline usage (and fix bug #35796)

 http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.104r2=1.105diff_format=u
 Index: php-src/ext/spl/spl_iterators.c
 diff -u php-src/ext/spl/spl_iterators.c:1.104
 php-src/ext/spl/spl_iterators.c:1.105
 --- php-src/ext/spl/spl_iterators.c:1.104   Thu Dec 22 00:38:05 2005
 +++ php-src/ext/spl/spl_iterators.c Sun Dec 25 16:03:38 2005
 @@ -16,7 +16,7 @@
 +--+
   */

 -/* $Id: spl_iterators.c,v 1.104 2005/12/22 00:38:05 helly Exp $ */
 +/* $Id: spl_iterators.c,v 1.105 2005/12/25 16:03:38 sniper Exp $ */

  #ifdef HAVE_CONFIG_H
  # include config.h
 @@ -36,8 +36,6 @@
  #include spl_array.h
  #include spl_exceptions.h

 -#define INLINE inline
 -
  PHPAPI zend_class_entry *spl_ce_RecursiveIterator;
  PHPAPI zend_class_entry *spl_ce_RecursiveIteratorIterator;
  PHPAPI zend_class_entry *spl_ce_FilterIterator;
 @@ -831,9 +829,9 @@
  }
  #endif

 -static INLINE int spl_dual_it_fetch(spl_dual_it_object *intern, int 
 check_more TSRMLS_DC);
 +static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int 
 check_more TSRMLS_DC);

 -static INLINE spl_dual_it_object*
 spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry 
 *ce_inner, dual_it_type dit_type)
 +static inline spl_dual_it_object*
 spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry 
 *ce_inner, dual_it_type dit_type)
  {
 zval *zobject, *retval;
 spl_dual_it_object   *intern;
 @@ -990,14 +988,14 @@
 }
  } /* }}} */

 -static INLINE void spl_dual_it_require(spl_dual_it_object *intern 
 TSRMLS_DC)
 +static inline void spl_dual_it_require(spl_dual_it_object *intern 
 TSRMLS_DC)
  {
 if (!intern-inner.iterator) {
 php_error_docref(NULL TSRMLS_CC, E_ERROR, The inner
 constructor wasn't initialized with an iterator instance);
 }
  }

 -static INLINE void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC)
 +static inline void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC)
  {
 if (intern-inner.iterator 
 intern-inner.iterator-funcs-invalidate_current) {

 intern-inner.iterator-funcs-invalidate_current(intern-inner.iterator 
 TSRMLS_CC);
 @@ -1022,7 +1020,7 @@
 }
  }

 -static INLINE void spl_dual_it_rewind(spl_dual_it_object *intern TSRMLS_DC)
 +static inline void spl_dual_it_rewind(spl_dual_it_object *intern TSRMLS_DC)
  {
 spl_dual_it_free(intern TSRMLS_CC);
 intern-current.pos = 0;
 @@ -1031,13 +1029,13 @@
 }
  }

 -static INLINE int spl_dual_it_valid(spl_dual_it_object *intern TSRMLS_DC)
 +static inline int spl_dual_it_valid(spl_dual_it_object *intern TSRMLS_DC)
  {
 /* FAILURE / SUCCESS */
 return
 intern-inner.iterator-funcs-valid(intern-inner.iterator TSRMLS_CC);
  }

 -static INLINE int spl_dual_it_fetch(spl_dual_it_object *intern, int 
 check_more TSRMLS_DC)
 +static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int 
 check_more TSRMLS_DC)
  {
 zval **data;

 @@ -1057,7 +1055,7 @@
 return FAILURE;
  }

 -static INLINE void spl_dual_it_next(spl_dual_it_object *intern, int 
 do_free TSRMLS_DC)
 +static inline void spl_dual_it_next(spl_dual_it_object *intern, int 
 do_free TSRMLS_DC)
  {
 if (do_free) {
 spl_dual_it_free(intern TSRMLS_CC);
 @@ -1158,7 +1156,7 @@
 spl_dual_it_fetch(intern, 1 TSRMLS_CC);
  } /* }}} */

 -static INLINE void spl_filter_it_fetch(zval *zthis, spl_dual_it_object 
 *intern TSRMLS_DC)
 +static inline void spl_filter_it_fetch(zval *zthis, spl_dual_it_object 
 *intern TSRMLS_DC)
  {
 zval *retval;

 @@ -1177,13 +1175,13 @@
 spl_dual_it_free(intern TSRMLS_CC);
  }

 -static INLINE void spl_filter_it_rewind(zval *zthis, spl_dual_it_object 
 *intern TSRMLS_DC)
 +static inline void spl_filter_it_rewind(zval *zthis, spl_dual_it_object 
 *intern TSRMLS_DC)
  {
   

Re: [PHP-CVS] cvs: php-src /ext/spl spl_iterators.c /ext/spl/tests array_004.phpt array_006.phpt array_008.phpt

2005-12-25 Thread Jani Taskinen


Easy:

#undef inline
#define inline


On Sun, 25 Dec 2005, Marcus Boerger wrote:



Hello Jani,

 though what you said is also true, i can nolonger easily get rid of those
inline definitions for debugging purpose.

marcus

Sunday, December 25, 2005, 5:15:35 PM, you wrote:


 It was wrong since you can safely use inline anywhere.
 It's checked elsewhere and re-defined for each OS/compiler
 properly. You're not supposed to create such macros yourself.



 --Jani




On Sun, 25 Dec 2005, Marcus Boerger wrote:




Hello Jani,

 a, jani there was no wrong inline usage, just stupid compilers
ignoring the specs, and the way to fix it is to find the places where
an inline function is used as a non inline function and prodive a non
inline wrapper for it. Which is probably only one single instance.

regards
marcus

Sunday, December 25, 2005, 5:03:38 PM, you wrote:


sniper  Sun Dec 25 16:03:38 2005 EDT



  Modified files:
/php-src/ext/splspl_iterators.c
/php-src/ext/spl/tests  array_004.phpt array_006.phpt array_008.phpt
  Log:
  - Remove wrong inline usage (and fix bug #35796)

http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.104r2=1.105diff_format=u
Index: php-src/ext/spl/spl_iterators.c
diff -u php-src/ext/spl/spl_iterators.c:1.104
php-src/ext/spl/spl_iterators.c:1.105
--- php-src/ext/spl/spl_iterators.c:1.104   Thu Dec 22 00:38:05 2005
+++ php-src/ext/spl/spl_iterators.c Sun Dec 25 16:03:38 2005
@@ -16,7 +16,7 @@
+--+
  */

-/* $Id: spl_iterators.c,v 1.104 2005/12/22 00:38:05 helly Exp $ */
+/* $Id: spl_iterators.c,v 1.105 2005/12/25 16:03:38 sniper Exp $ */

 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -36,8 +36,6 @@
 #include spl_array.h
 #include spl_exceptions.h

-#define INLINE inline
-
 PHPAPI zend_class_entry *spl_ce_RecursiveIterator;
 PHPAPI zend_class_entry *spl_ce_RecursiveIteratorIterator;
 PHPAPI zend_class_entry *spl_ce_FilterIterator;
@@ -831,9 +829,9 @@
 }
 #endif

-static INLINE int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more 
TSRMLS_DC);
+static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more 
TSRMLS_DC);

-static INLINE spl_dual_it_object*
spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *ce_inner, 
dual_it_type dit_type)
+static inline spl_dual_it_object*
spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *ce_inner, 
dual_it_type dit_type)
 {
zval *zobject, *retval;
spl_dual_it_object   *intern;
@@ -990,14 +988,14 @@
}
 } /* }}} */

-static INLINE void spl_dual_it_require(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_dual_it_require(spl_dual_it_object *intern TSRMLS_DC)
 {
if (!intern-inner.iterator) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, The inner
constructor wasn't initialized with an iterator instance);
}
 }

-static INLINE void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC)
 {
if (intern-inner.iterator 
intern-inner.iterator-funcs-invalidate_current) {

intern-inner.iterator-funcs-invalidate_current(intern-inner.iterator 
TSRMLS_CC);
@@ -1022,7 +1020,7 @@
}
 }

-static INLINE void spl_dual_it_rewind(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_dual_it_rewind(spl_dual_it_object *intern TSRMLS_DC)
 {
spl_dual_it_free(intern TSRMLS_CC);
intern-current.pos = 0;
@@ -1031,13 +1029,13 @@
}
 }

-static INLINE int spl_dual_it_valid(spl_dual_it_object *intern TSRMLS_DC)
+static inline int spl_dual_it_valid(spl_dual_it_object *intern TSRMLS_DC)
 {
/* FAILURE / SUCCESS */
return
intern-inner.iterator-funcs-valid(intern-inner.iterator TSRMLS_CC);
 }

-static INLINE int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more 
TSRMLS_DC)
+static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more 
TSRMLS_DC)
 {
zval **data;

@@ -1057,7 +1055,7 @@
return FAILURE;
 }

-static INLINE void spl_dual_it_next(spl_dual_it_object *intern, int do_free 
TSRMLS_DC)
+static inline void spl_dual_it_next(spl_dual_it_object *intern, int do_free 
TSRMLS_DC)
 {
if (do_free) {
spl_dual_it_free(intern TSRMLS_CC);
@@ -1158,7 +1156,7 @@
spl_dual_it_fetch(intern, 1 TSRMLS_CC);
 } /* }}} */

-static INLINE void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern 
TSRMLS_DC)
+static inline void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern 
TSRMLS_DC)
 {
zval *retval;

@@ -1177,13 +1175,13 @@
spl_dual_it_free(intern TSRMLS_CC);
 }

-static INLINE void spl_filter_it_rewind(zval *zthis, spl_dual_it_object 
*intern TSRMLS_DC)
+static inline void spl_filter_it_rewind(zval *zthis, spl_dual_it_object 
*intern TSRMLS_DC)
 {

[PHP-CVS] cvs: php-src /ext/gd gd.c /ext/gd/libgd gd_topal.c /ext/gd/tests colorexact.phpt colormatch.phpt

2005-12-25 Thread Pierre-Alain Joye
pajoye  Sun Dec 25 19:21:58 2005 EDT

  Added files: 
/php-src/ext/gd/tests   colorexact.phpt colormatch.phpt 

  Modified files:  
/php-src/ext/gd gd.c 
/php-src/ext/gd/libgd   gd_topal.c 
  Log:
  - fix leak/segfaults in imagecolormatch
  - add tests for imagecolorexact and imagecolormatch
The later is only about the segv
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/gd.c?r1=1.329r2=1.330diff_format=u
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.329 php-src/ext/gd/gd.c:1.330
--- php-src/ext/gd/gd.c:1.329   Thu Dec 22 23:22:26 2005
+++ php-src/ext/gd/gd.c Sun Dec 25 19:21:57 2005
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: gd.c,v 1.329 2005/12/22 23:22:26 pajoye Exp $ */
+/* $Id: gd.c,v 1.330 2005/12/25 19:21:57 pajoye Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -822,6 +822,10 @@
php_error_docref(NULL TSRMLS_CC, E_ERROR, Image1 and 
Image2 must be the same size );
RETURN_FALSE;
break;
+   case -4:
+   php_error_docref(NULL TSRMLS_CC, E_ERROR, Image2 must 
have at least one color );
+   RETURN_FALSE;
+   break;
}
 
RETURN_TRUE;
http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/libgd/gd_topal.c?r1=1.17r2=1.18diff_format=u
Index: php-src/ext/gd/libgd/gd_topal.c
diff -u php-src/ext/gd/libgd/gd_topal.c:1.17 
php-src/ext/gd/libgd/gd_topal.c:1.18
--- php-src/ext/gd/libgd/gd_topal.c:1.17Wed Aug 11 23:25:50 2004
+++ php-src/ext/gd/libgd/gd_topal.c Sun Dec 25 19:21:57 2005
@@ -2086,6 +2086,9 @@
if( (im1-sx != im2-sx) || (im1-sy != im2-sy) ) {
return -3; /* the images are meant to be the same dimensions */
}
+   if (im2-colorsTotal1) {
+   return -4; /* At least 1 color must be allocated */
+   }
 
buf = (unsigned long *)safe_emalloc(sizeof(unsigned long), 5 * 
im2-colorsTotal, 0);
memset( buf, 0, sizeof(unsigned long) * 5 * im2-colorsTotal );

http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/tests/colorexact.phpt?view=markuprev=1.1
Index: php-src/ext/gd/tests/colorexact.phpt
+++ php-src/ext/gd/tests/colorexact.phpt
--TEST--
imagecolorexact
--SKIPIF--
?php
if (!function_exists('imagecolorexact')) die(skip gd extension not 
available\n);
?
--FILE--
?php

$im = imagecreatetruecolor(5,5);
$c = imagecolorexact($im, 255,0,255);
$c2 = imagecolorexactalpha($im, 255,0,255, 100);

printf(%X\n, $c);
printf(%X\n, $c2);

imagedestroy($im);

$im = imagecreate(5,5);
$c = imagecolorallocate($im, 255,0,255);
$c2 = imagecolorallocate($im, 255,200,0);
$c3 = imagecolorallocatealpha($im, 255,200,0,100);

echo imagecolorexact($im, 255,0,255) . \n;
echo imagecolorexact($im, 255,200,0) . \n;
echo imagecolorexactalpha($im, 255,200,0,100) . \n;


// unallocated index
echo imagecolorexact($im, 12,12,12) . \n;

imagedestroy($im);
?
--EXPECTF--
FF00FF
64FF00FF
0
1
2
-1

http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/tests/colormatch.phpt?view=markuprev=1.1
Index: php-src/ext/gd/tests/colormatch.phpt
+++ php-src/ext/gd/tests/colormatch.phpt
--TEST--
imagecolormatch
--SKIPIF--
?php
if (!function_exists('imagecolormatch')) die(skip gd extension not 
available\n);
?
--FILE--
?php

$im = imagecreatetruecolor(5,5);
$im2 = imagecreate(5,5);

imagecolormatch($im, $im2);

echo ok\n;

imagedestroy($im);
?
--EXPECTF--
Fatal error: imagecolormatch(): Image2 must have at least one color in %s on 
line %d

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



[PHP-CVS] cvs: php-src(PHP_5_1) /ext/gd gd.c /ext/gd/libgd gd_topal.c /ext/gd/tests colormatch.phpt

2005-12-25 Thread Pierre-Alain Joye
pajoye  Sun Dec 25 19:39:54 2005 EDT

  Added files: (Branch: PHP_5_1)
/php-src/ext/gd/tests   colormatch.phpt 

  Modified files:  
/php-src/ext/gd gd.c 
/php-src/ext/gd/libgd   gd_topal.c 
  Log:
  - MFH: fix segfault/leak in imagecolormatch
  - MFH: test for imagecolormatch
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/gd.c?r1=1.312.2.8r2=1.312.2.9diff_format=u
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.312.2.8 php-src/ext/gd/gd.c:1.312.2.9
--- php-src/ext/gd/gd.c:1.312.2.8   Sat Dec 17 17:46:59 2005
+++ php-src/ext/gd/gd.c Sun Dec 25 19:39:53 2005
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: gd.c,v 1.312.2.8 2005/12/17 17:46:59 pajoye Exp $ */
+/* $Id: gd.c,v 1.312.2.9 2005/12/25 19:39:53 pajoye Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -930,6 +930,10 @@
php_error_docref(NULL TSRMLS_CC, E_ERROR, Image1 and 
Image2 must be the same size );
RETURN_FALSE;
break;
+   case -4:
+   php_error_docref(NULL TSRMLS_CC, E_ERROR, Image2 must 
have at least one color );
+   RETURN_FALSE;
+   break;
}
 
RETURN_TRUE;
http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/libgd/gd_topal.c?r1=1.17r2=1.17.2.1diff_format=u
Index: php-src/ext/gd/libgd/gd_topal.c
diff -u php-src/ext/gd/libgd/gd_topal.c:1.17 
php-src/ext/gd/libgd/gd_topal.c:1.17.2.1
--- php-src/ext/gd/libgd/gd_topal.c:1.17Wed Aug 11 23:25:50 2004
+++ php-src/ext/gd/libgd/gd_topal.c Sun Dec 25 19:39:53 2005
@@ -2086,6 +2086,9 @@
if( (im1-sx != im2-sx) || (im1-sy != im2-sy) ) {
return -3; /* the images are meant to be the same dimensions */
}
+   if (im2-colorsTotal1) {
+   return -4; /* At least 1 color must be allocated */
+   }
 
buf = (unsigned long *)safe_emalloc(sizeof(unsigned long), 5 * 
im2-colorsTotal, 0);
memset( buf, 0, sizeof(unsigned long) * 5 * im2-colorsTotal );

http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/tests/colormatch.phpt?view=markuprev=1.1
Index: php-src/ext/gd/tests/colormatch.phpt
+++ php-src/ext/gd/tests/colormatch.phpt
--TEST--
imagecolormatch
--SKIPIF--
?php
if (!function_exists('imagecolormatch')) die(skip gd extension not 
available\n);
?
--FILE--
?php

$im = imagecreatetruecolor(5,5);
$im2 = imagecreate(5,5);

imagecolormatch($im, $im2);

echo ok\n;

imagedestroy($im);
?
--EXPECTF--
Fatal error: imagecolormatch(): Image2 must have at least one color in %s on 
line %d



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



[PHP-CVS] cvs: php-src(PHP_5_1) /ext/pdo_mysql mysql_driver.c

2005-12-25 Thread Ilia Alshanetsky
iliaa   Sun Dec 25 20:30:40 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-src/ext/pdo_mysql  mysql_driver.c 
  Log:
  Make MySQL driver use ANSI complaint quoting style.
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/pdo_mysql/mysql_driver.c?r1=1.59.2.6r2=1.59.2.7diff_format=u
Index: php-src/ext/pdo_mysql/mysql_driver.c
diff -u php-src/ext/pdo_mysql/mysql_driver.c:1.59.2.6 
php-src/ext/pdo_mysql/mysql_driver.c:1.59.2.7
--- php-src/ext/pdo_mysql/mysql_driver.c:1.59.2.6   Fri Nov 25 12:56:04 2005
+++ php-src/ext/pdo_mysql/mysql_driver.cSun Dec 25 20:30:40 2005
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: mysql_driver.c,v 1.59.2.6 2005/11/25 12:56:04 tony2001 Exp $ */
+/* $Id: mysql_driver.c,v 1.59.2.7 2005/12/25 20:30:40 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -266,7 +266,7 @@
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh-driver_data;
*quoted = safe_emalloc(2, unquotedlen, 3);
*quotedlen = mysql_real_escape_string(H-server, *quoted + 1, unquoted, 
unquotedlen);
-   (*quoted)[0] =(*quoted)[++*quotedlen] = '';
+   (*quoted)[0] =(*quoted)[++*quotedlen] = '\'';
(*quoted)[++*quotedlen] = '\0';
return 1;
 }

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



[PHP-CVS] cvs: php-src /ext/pdo_mysql mysql_driver.c

2005-12-25 Thread Ilia Alshanetsky
iliaa   Sun Dec 25 20:30:56 2005 EDT

  Modified files:  
/php-src/ext/pdo_mysql  mysql_driver.c 
  Log:
  MFB51: Make MySQL driver use ANSI complaint quoting style. 
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/pdo_mysql/mysql_driver.c?r1=1.67r2=1.68diff_format=u
Index: php-src/ext/pdo_mysql/mysql_driver.c
diff -u php-src/ext/pdo_mysql/mysql_driver.c:1.67 
php-src/ext/pdo_mysql/mysql_driver.c:1.68
--- php-src/ext/pdo_mysql/mysql_driver.c:1.67   Fri Nov 25 12:54:18 2005
+++ php-src/ext/pdo_mysql/mysql_driver.cSun Dec 25 20:30:56 2005
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: mysql_driver.c,v 1.67 2005/11/25 12:54:18 tony2001 Exp $ */
+/* $Id: mysql_driver.c,v 1.68 2005/12/25 20:30:56 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -257,7 +257,7 @@
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh-driver_data;
*quoted = safe_emalloc(2, unquotedlen, 3);
*quotedlen = mysql_real_escape_string(H-server, *quoted + 1, unquoted, 
unquotedlen);
-   (*quoted)[0] =(*quoted)[++*quotedlen] = '';
+   (*quoted)[0] =(*quoted)[++*quotedlen] = '\'';
(*quoted)[++*quotedlen] = '\0';
return 1;
 }

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



[PHP-CVS] cvs: php-src /ext/gd gd.c

2005-12-25 Thread Pierre-Alain Joye
pajoye  Sun Dec 25 20:32:25 2005 EDT

  Modified files:  
/php-src/ext/gd gd.c 
  Log:
  - raise warning instread of errors in colormatch
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/gd.c?r1=1.330r2=1.331diff_format=u
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.330 php-src/ext/gd/gd.c:1.331
--- php-src/ext/gd/gd.c:1.330   Sun Dec 25 19:21:57 2005
+++ php-src/ext/gd/gd.c Sun Dec 25 20:32:25 2005
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: gd.c,v 1.330 2005/12/25 19:21:57 pajoye Exp $ */
+/* $Id: gd.c,v 1.331 2005/12/25 20:32:25 pajoye Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -811,19 +811,19 @@
result = gdImageColorMatch(im1, im2);
switch (result) {
case -1:
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, Image1 must 
be TrueColor );
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Image1 
must be TrueColor );
RETURN_FALSE;
break;
case -2:
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, Image2 must 
be Palette );
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Image2 
must be Palette );
RETURN_FALSE;
break;
case -3:
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, Image1 and 
Image2 must be the same size );
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Image1 and 
Image2 must be the same size );
RETURN_FALSE;
break;
case -4:
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, Image2 must 
have at least one color );
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Image2 
must have at least one color );
RETURN_FALSE;
break;
}

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



[PHP-CVS] cvs: php-src(PHP_5_1) /ext/gd gd.c

2005-12-25 Thread Pierre-Alain Joye
pajoye  Sun Dec 25 20:33:05 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-src/ext/gd gd.c 
  Log:
  - MFH: raise warnings instead of errors in colormatch
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/gd.c?r1=1.312.2.9r2=1.312.2.10diff_format=u
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.312.2.9 php-src/ext/gd/gd.c:1.312.2.10
--- php-src/ext/gd/gd.c:1.312.2.9   Sun Dec 25 19:39:53 2005
+++ php-src/ext/gd/gd.c Sun Dec 25 20:33:05 2005
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: gd.c,v 1.312.2.9 2005/12/25 19:39:53 pajoye Exp $ */
+/* $Id: gd.c,v 1.312.2.10 2005/12/25 20:33:05 pajoye Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -919,19 +919,19 @@
result = gdImageColorMatch(im1, im2);
switch (result) {
case -1:
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, Image1 must 
be TrueColor );
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Image1 
must be TrueColor );
RETURN_FALSE;
break;
case -2:
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, Image2 must 
be Palette );
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Image2 
must be Palette );
RETURN_FALSE;
break;
case -3:
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, Image1 and 
Image2 must be the same size );
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Image1 and 
Image2 must be the same size );
RETURN_FALSE;
break;
case -4:
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, Image2 must 
have at least one color );
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Image2 
must have at least one color );
RETURN_FALSE;
break;
}

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



[PHP-CVS] cvs: php-src(PHP_5_1) / NEWS

2005-12-25 Thread Pierre-Alain Joye
pajoye  Sun Dec 25 20:34:59 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-srcNEWS 
  Log:
  - imagecolormatch fix and changes
  
  
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.322r2=1.2027.2.323diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.322 php-src/NEWS:1.2027.2.323
--- php-src/NEWS:1.2027.2.322   Fri Dec 23 22:27:23 2005
+++ php-src/NEWSSun Dec 25 20:34:59 2005
@@ -11,7 +11,8 @@
   mbstring.func_overload is enabled). (Rui)
 - Fixed bug #29955 (mb_strtoupper() / lower() broken with Turkish encoding).
   (Rui)
-
+- Fixed segfault/leak in imagecolormatch (Pierre)
+- Raise warnings instead of errors in imagecolormatch (Pierre)
 22 Dec 2005, PHP 5.1.2RC1
 - Updated libsqlite in ext/sqlite to 2.8.17. (Ilia)
 - Updated libsqlite in ext/pdo_sqlite to 3.2.8. (Ilia)

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



[PHP-CVS] 跟,��,�T,工,作,技,能,提,升

2005-12-25 Thread 1月6日杭州举办
=

   跟,��,�T,工,作,技,能,提,升,�c,策,略,��,化,��,�� 

★�竺��⒓�([EMAIL PROTECTED])�W�T,��送一本《�艹龈�.��.�T》★
= 
 
主�k�挝唬合��J企�I管理
�r  �g:2006年01月6日(星期五 09:00-12:00 13:30-17:00)
地  �c:杭,州,�A,北,��,店
T  E   L:(0512)6 7 1 3 7 5 8 2 曾 小 姐  
  (021)5 1 0 8 3 2 6 9,方 先 生 
   (020) 3 3 5 5 6 3 2 2,�� 小 姐
F  A   X:(0512)6713 7583、(020)3479 5037  
�M  用:980元/人(包括�Y料�M、午餐以及上下午茶�c等)
�⒓游锛�:�u造�I生�a、生�a管理人�T、跟.��.�T,企�I中、基�又鞴芗坝嘘P
  部�T�I�罩鞴艿�
--
[EMAIL PROTECTED]
--
  我��加入WTO後, 涉外企�I�≡觯�需要大批高素�|的�绦嘘�伍,而跟.��.�T�t
[EMAIL PROTECTED] �Ω�.��.�T的社��需求一直�S持�^高水�剩��o��外�Q
加工企�I��是民�I企�I,�缀趺���企�I都需要跟.��.�T多名,但目前,���炔簧俑�.��.�T
由原企�I技�g人�T或高�拥墓芾砣��T��任,他���m有���H操作能力,但缺乏完整的知�R背
景,由於�ν赓Q�T例或品�|控制�l款或交���L期的�`操作,往往使企�I信�u和���a遭受
重大�p失。因此,企�I急需�Ω�.��.�T�M行���I培��一��企�I之存在、生存�c�l展,都
是以�橹骶��l的,作�橛��蔚母��M者,跟.��.�T的工作跨越了一��企�I�\作�w系的每
一���h��!�钠��I管理�碚f,跟.��.�T前途�o量!他是一���C合性工作,既要�t解企�I生
�a的管理�c流程,又要熟悉外�Q企�I的�\作方式,更要有高��的�贤ǜ�催能力。跟.��.�T
[EMAIL PROTECTED]
的特�e助理。要做理,先做跟.��.�T[EMAIL PROTECTED]
�W管理,最好的就是�母�.��.�T�_始。 
--
[EMAIL PROTECTED]
-
(1)分析能力-能�蚍治龀隹��舻奶攸c以及�a品的�r格��成,以利於���r。 
(2)�A�y能力-能�A�y出客�舻囊�求,企�I的生�a能力以及物料的供��情�r,便於接�巍�
生�a�c交��期的安排。 
(3)表�_能力-善用文字或�Z言�c客�暨M行�贤ǎ�能���蚀_地�蟪霎a品�r格、��格、��
量、商定交��期限、付款方式等。 
(4)���I知�R-跟.��.�T��具有�c跟�萎a品相��的���I知�R,�t解�a品的原材料特�c、
�碓醇俺煞郑�知道�a品的特�c、款式、品�|,以利於和客�艏吧��a人�T�贤��f�{。 
(5)�c生�a人�T共事的能力-能�蚺c���g、班�M及技�g人�T打成一片,使其自�X地完成
客�舻挠��巍� 
(6)人�H�P�S��理能力-�^好地��理�c客�簟⑸霞�、同事、企�I外部人�T的�P�S,通�^
他���硗瓿勺约合胍�做的事。 
(7)法律知�R-�t解合同法、票��法、法等�c跟�喂ぷ饔嘘P的法律知�R,做到知法、
守法、懂法、用法。 
(8)��判能力-具有��判的口才,�t解��判的程式�c技巧。 
(9)管理�c推�N能力-�ν���是一��推�N高手,�t是管理�f�{的行家。 
(10)物流知�R-�t解�\��、�b卸搬�\、保管、配送、�箨P等知�R。
---
[EMAIL PROTECTED]
---
一、跟.��.�T工作概述
1、�槭颤N�f跟.��.�T是一��企�I的��窗和�T�簦�
2、跟.��.�T��理���蔚墓ぷ髁鞒毯铜h��
3、跟.��.�T�ν庑枰���理哪些事�眨�
4、跟.��.�T如何站在客�粢�求的角度把事做好?
5、跟.��.�T如何跨部�T�_展工作?
案例:�C智的瓷�u推�N�T

二、跟.��.�T的工�S管理技能
1、如何分析�a能��荷?
2、如何�f�{�N��?
3、如何制定生�a?
4、如何控制生�a�M度?
5、如何督促物料到位元�M度?
6、如何�y��分析生�a�Y料?
7、如何�f�{��理生�a��常���}?
8、�a供�N失�{的症�睢⒃�因�c�Σ�
案例:Wal-mart如何管理供��工�S

三、出口型企�I跟�文J�
1、如何�_�J客�羲�需�悠罚�
2、接收客�粽�式���危�
3、制定各���g的具�w生�a?
4、制定各�N物料的需求?
5、跟�M生�a��施���r
6、��理交期延�t���}
7、�l��前的���涔ぷ�
8、完成後的�y��分析
案例:招�蔚奈宕蠹寄�
案例:�V�|企�I家、�刂萜��I家�_拓市�龅木�神

四、跟.��.�T工作策略
1、第一招:自始而�K,一竿子插到底
2、第二招:及�r掌握�Y��,克服�Y��不�ΨQ
3、第三招:�W工作�蟾�
4、第四招:善於�_��,事情��到桌面上�碚f
5、第五招:作�I��常�蟾�
6、第六招:表格化管理
7、第七招:��人另眼相看的看板管理
8、第八招:掌握主�樱�抓住牛鼻子
9、第九招:要有主�б庾R,跟催及�r有力
10、第十招:把注意力集中到有���}的部分

五、跟.��.�T自我革新能力培�B
1、分析���}�c解�Q���}的能力
2、�贤�能力--如何�M行有效的�贤�
3、��常保持九�l危�C意�R
4、工作方面的五��自我�u�b
5、跟.��.�T(主管)�碛械奈宸N勇��
6、跟.��.�T(主管)��具�涞奈宸N���T
�[�颍耗汶x哈佛有多�h

六、客�絷P�S管理
★�蚀_理解客�粢�求、抓住客�舻男摹⒋_保客���M意和忠�\;
-
�v��介�B:李先生
中��跟.��.�T培���<遥���港�_企�I管理研究中心理事�L,工�W�T士,高
��工程��,清�A大�W深圳研究院MBA,先後在美、日、�n�Y外企,港�_���Y企�I
�氖鹿芾砉ぷ鞫嗄辏��v任工程部工程��、�F�鲋鞴堋⑵焚|��理、生�a副��等��
�眨�在十�递d企管一��的摸爬�L打中�e累了�S富的管理,尤其深�O工�S生
�a、品�|、工程方面的管理�\作,��跨��公司��入的管理思想�H有研究,形成
了��具特色的���中脱u造企�I管理方法和�w系。李先生���v�r十多年�e累起��
�S富的生�a�u造�c管理,�M行�饪s�N�A,於2000-2004年�g,先後出版了
《品�|/生�a/工程……部�T主管跟我�W》系列、《��子行�IISO9001:
2000��施技法�c案例》、《卓越品�|管控》、《生�a�F�龉芸亍贰�《�}�εc物
料管控》、《�艹龈�.��.�T》等��籍,受到企�I界的高度重���K�o予了�O高的
�u�r。李先生���`�S富、�v授�^程列�e大量案例、特�e���{��用性和可操
作性,深受���n人�T的好�u和尊敬.至今李先生���M足企�I的���H需要,在全
��各地成功�e�k了百多�鲋v座,授�n人�颠_到�f多人次,�K���蛋偌移��I提供
�^管理咨��和服�铡�
≡

我--司�Q--定派�W--�T��--加《跟.��.�T工作技能提升�c策略��化 》,

��--�o--予--留--位

==真到0755 83524349 培--��--部收


�挝幻��Q:�� 系 人:___


���M:_�髡妫�_�W�T人�担�___


�W�T姓名:__ 付款方式: 1.�D��   2.�F金

≡≡


[PHP-CVS] cvs: php-src /ext/gd/tests colormatch.phpt colorresolve.phpt

2005-12-25 Thread Pierre-Alain Joye
pajoye  Sun Dec 25 21:45:05 2005 EDT

  Modified files:  
/php-src/ext/gd/tests   colormatch.phpt colorresolve.phpt 
  Log:
  - add colorresolvealpha to colorresolve tests
  - update colormatch
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/tests/colormatch.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/gd/tests/colormatch.phpt
diff -u php-src/ext/gd/tests/colormatch.phpt:1.1 
php-src/ext/gd/tests/colormatch.phpt:1.2
--- php-src/ext/gd/tests/colormatch.phpt:1.1Sun Dec 25 19:21:58 2005
+++ php-src/ext/gd/tests/colormatch.phptSun Dec 25 21:45:04 2005
@@ -12,10 +12,8 @@
 
 imagecolormatch($im, $im2);
 
-echo ok\n;
-
 imagedestroy($im);
 ?
 --EXPECTF--
-Fatal error: imagecolormatch(): Image2 must have at least one color in %s on 
line %d
+Warning: imagecolormatch(): Image2 must have at least one color in %s on line 
%d
 
http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/tests/colorresolve.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/gd/tests/colorresolve.phpt
diff -u php-src/ext/gd/tests/colorresolve.phpt:1.3 
php-src/ext/gd/tests/colorresolve.phpt:1.4
--- php-src/ext/gd/tests/colorresolve.phpt:1.3  Sat Dec 24 14:05:20 2005
+++ php-src/ext/gd/tests/colorresolve.phpt  Sun Dec 25 21:45:04 2005
@@ -35,6 +35,36 @@
 print_r(imagecolorsforindex($im, $c));
 
 
+
+// with alpha
+$im = imagecreatetruecolor(5,5);
+$c = imagecolorresolvealpha($im, 255,0,255, 100);
+printf(%X\n, $c);
+imagedestroy($im);
+
+$im = imagecreate(5,5);
+$c = imagecolorresolvealpha($im, 255,0,255,100);
+print_r(imagecolorsforindex($im, $c));
+imagedestroy($im);
+
+$im = imagecreate(5,5);
+for ($i=0; $i255; $i++) imagecolorresolvealpha($im, $i,0,0,1);
+$c = imagecolorresolvealpha($im, 255,0,0,1);
+print_r(imagecolorsforindex($im, $c));
+
+
+$im = imagecreate(5,5);
+for ($i=0; $i256; $i++) {
+   if ($i == 246) {
+   imagecolorresolvealpha($im, $i,10,10,1);
+   } else {
+   imagecolorresolvealpha($im, $i,0,0,100);
+   }
+}
+$c = imagecolorresolvealpha($im, 255,10,10,0);
+print_r(imagecolorsforindex($im, $c));
+
+
 ?
 --EXPECTF--
 FF00FF
@@ -59,3 +89,25 @@
 [blue] = 10
 [alpha] = 0
 )
+64FF00FF
+Array
+(
+[red] = 255
+[green] = 0
+[blue] = 255
+[alpha] = 100
+)
+Array
+(
+[red] = 255
+[green] = 0
+[blue] = 0
+[alpha] = 1
+)
+Array
+(
+[red] = 246
+[green] = 10
+[blue] = 10
+[alpha] = 1
+)

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



[PHP-CVS] cvs: php-src /ext/gd/tests colorclosest.phpt

2005-12-25 Thread Pierre-Alain Joye
pajoye  Sun Dec 25 22:02:53 2005 EDT

  Modified files:  
/php-src/ext/gd/tests   colorclosest.phpt 
  Log:
  - add colorclosestalpha tests
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/tests/colorclosest.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/gd/tests/colorclosest.phpt
diff -u php-src/ext/gd/tests/colorclosest.phpt:1.3 
php-src/ext/gd/tests/colorclosest.phpt:1.4
--- php-src/ext/gd/tests/colorclosest.phpt:1.3  Sat Dec 24 14:05:20 2005
+++ php-src/ext/gd/tests/colorclosest.phpt  Sun Dec 25 22:02:53 2005
@@ -17,8 +17,6 @@
 print_r(imagecolorsforindex($im, $c));
 imagedestroy($im);
 
-
-
 $im = imagecreate(5,5);
 imagecolorallocate($im, 255, 0, 255);
 $c = imagecolorclosest($im, 255,0,255);
@@ -42,6 +40,40 @@
 $c = imagecolorclosest($im, 255,10,10);
 print_r(imagecolorsforindex($im, $c));
 
+// with alpha
+$im = imagecreatetruecolor(5,5);
+$c = imagecolorclosestalpha($im, 255,0,255,100);
+printf(%X\n, $c);
+imagedestroy($im);
+
+$im = imagecreate(5,5);
+$c = imagecolorclosestalpha($im, 255,0,255,100);
+print_r(imagecolorsforindex($im, $c));
+imagedestroy($im);
+
+$im = imagecreate(5,5);
+imagecolorallocatealpha($im, 255, 0, 255, 1);
+$c = imagecolorclosestalpha($im, 255,0,255,1);
+print_r(imagecolorsforindex($im, $c));
+imagedestroy($im);
+
+$im = imagecreate(5,5);
+for ($i=0; $i255; $i++) imagecolorresolvealpha($im, $i,0,0,1);
+$c = imagecolorclosestalpha($im, 255,0,0,1);
+print_r(imagecolorsforindex($im, $c));
+
+
+$im = imagecreate(5,5);
+for ($i=0; $i256; $i++) {
+   if ($i == 246) {
+   imagecolorallocatealpha($im, $i,10,10,1);
+   } else {
+   imagecolorallocatealpha($im, $i,0,0,100);
+   }
+}
+$c = imagecolorclosestalpha($im, 255,10,10,1);
+print_r(imagecolorsforindex($im, $c));
+
 
 ?
 --EXPECTF--
@@ -69,3 +101,27 @@
 [blue] = 10
 [alpha] = 0
 )
+64FF00FF
+
+Warning: imagecolorsforindex(): Color index -1 out of range in %s on line %d
+Array
+(
+[red] = 255
+[green] = 0
+[blue] = 255
+[alpha] = 1
+)
+Array
+(
+[red] = 254
+[green] = 0
+[blue] = 0
+[alpha] = 1
+)
+Array
+(
+[red] = 246
+[green] = 10
+[blue] = 10
+[alpha] = 1
+)

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



[PHP-CVS] cvs: php-src(PHP_5_1) /ext/zlib/tests compress_zlib_wrapper.phpt

2005-12-25 Thread Antony Dovgal
tony2001Sun Dec 25 22:38:14 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-src/ext/zlib/tests compress_zlib_wrapper.phpt 
  Log:
  add missing skipif tag
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/zlib/tests/compress_zlib_wrapper.phpt?r1=1.2.2.1r2=1.2.2.2diff_format=u
Index: php-src/ext/zlib/tests/compress_zlib_wrapper.phpt
diff -u php-src/ext/zlib/tests/compress_zlib_wrapper.phpt:1.2.2.1 
php-src/ext/zlib/tests/compress_zlib_wrapper.phpt:1.2.2.2
--- php-src/ext/zlib/tests/compress_zlib_wrapper.phpt:1.2.2.1   Thu Oct 20 
19:22:09 2005
+++ php-src/ext/zlib/tests/compress_zlib_wrapper.phpt   Sun Dec 25 22:38:14 2005
@@ -1,5 +1,7 @@
 --TEST--
 compress.zlib:// wrapper
+--SKIPIF--
+?php if (!extension_loaded(zlib)) die(skip); ?
 --FILE--
 ?php
 

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



[PHP-CVS] cvs: php-src /ext/zlib/tests compress_zlib_wrapper.phpt

2005-12-25 Thread Antony Dovgal
tony2001Sun Dec 25 22:38:36 2005 EDT

  Modified files:  
/php-src/ext/zlib/tests compress_zlib_wrapper.phpt 
  Log:
  add missing skipif tag 
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/zlib/tests/compress_zlib_wrapper.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/zlib/tests/compress_zlib_wrapper.phpt
diff -u php-src/ext/zlib/tests/compress_zlib_wrapper.phpt:1.3 
php-src/ext/zlib/tests/compress_zlib_wrapper.phpt:1.4
--- php-src/ext/zlib/tests/compress_zlib_wrapper.phpt:1.3   Thu Oct 20 
19:22:55 2005
+++ php-src/ext/zlib/tests/compress_zlib_wrapper.phpt   Sun Dec 25 22:38:36 2005
@@ -1,5 +1,7 @@
 --TEST--
 compress.zlib:// wrapper
+--SKIPIF--
+?php if (!extension_loaded(zlib)) die(skip); ?
 --FILE--
 ?php
 

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



[PHP-CVS] cvs: php-src /ext/xsl php_xsl.c

2005-12-25 Thread Pierre-Alain Joye
pajoye  Mon Dec 26 00:54:13 2005 EDT

  Modified files:  
/php-src/ext/xslphp_xsl.c 
  Log:
  - #35805 add LIBXSLT_VERSION, LIBXSLT_DOTTED_VERSION, LIBEXSLT_VERSION and
   LIBEXSLT_DOTTED_VERSION
  
  MFH?
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/xsl/php_xsl.c?r1=1.35r2=1.36diff_format=u
Index: php-src/ext/xsl/php_xsl.c
diff -u php-src/ext/xsl/php_xsl.c:1.35 php-src/ext/xsl/php_xsl.c:1.36
--- php-src/ext/xsl/php_xsl.c:1.35  Tue Dec  6 02:24:53 2005
+++ php-src/ext/xsl/php_xsl.c   Mon Dec 26 00:54:12 2005
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_xsl.c,v 1.35 2005/12/06 02:24:53 sniper Exp $ */
+/* $Id: php_xsl.c,v 1.36 2005/12/26 00:54:12 pajoye Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -169,7 +169,13 @@
REGISTER_LONG_CONSTANT(XSL_CLONE_AUTO,  0, CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(XSL_CLONE_NEVER,-1, CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(XSL_CLONE_ALWAYS,1, CONST_CS | 
CONST_PERSISTENT);
+   REGISTER_LONG_CONSTANT(LIBXSLT_VERSION,   LIBXSLT_VERSION,
CONST_CS | CONST_PERSISTENT);
+   REGISTER_STRING_CONSTANT(LIBXSLT_DOTTED_VERSION,  
LIBXSLT_DOTTED_VERSION, CONST_CS | CONST_PERSISTENT);
 
+#if HAVE_XSL_EXSLT
+   REGISTER_LONG_CONSTANT(LIBEXSLT_VERSION,   LIBEXSLT_VERSION,  
  CONST_CS | CONST_PERSISTENT);
+   REGISTER_STRING_CONSTANT(LIBEXSLT_DOTTED_VERSION,  
LIBEXSLT_DOTTED_VERSION, CONST_CS | CONST_PERSISTENT);
+#endif
return SUCCESS;
 }
 /* }}} */

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



[PHP-CVS] cvs: php-src(PHP_5_1) /ext/xsl php_xsl.c

2005-12-25 Thread Pierre-Alain Joye
pajoye  Mon Dec 26 00:56:41 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-src/ext/xslphp_xsl.c 
  Log:
  - MFH: #35805 add LIBXSLT_VERSION, LIBXSLT_DOTTED_VERSION, LIBEXSLT_VERSION
and LIBEXSLT_DOTTED_VERSION
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/xsl/php_xsl.c?r1=1.32.2.3r2=1.32.2.4diff_format=u
Index: php-src/ext/xsl/php_xsl.c
diff -u php-src/ext/xsl/php_xsl.c:1.32.2.3 php-src/ext/xsl/php_xsl.c:1.32.2.4
--- php-src/ext/xsl/php_xsl.c:1.32.2.3  Tue Dec  6 02:25:36 2005
+++ php-src/ext/xsl/php_xsl.c   Mon Dec 26 00:56:41 2005
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_xsl.c,v 1.32.2.3 2005/12/06 02:25:36 sniper Exp $ */
+/* $Id: php_xsl.c,v 1.32.2.4 2005/12/26 00:56:41 pajoye Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -170,6 +170,14 @@
REGISTER_LONG_CONSTANT(XSL_CLONE_NEVER,-1, CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(XSL_CLONE_ALWAYS,1, CONST_CS | 
CONST_PERSISTENT);
 
+   REGISTER_LONG_CONSTANT(LIBXSLT_VERSION,   LIBXSLT_VERSION,
CONST_CS | CONST_PERSISTENT);
+   REGISTER_STRING_CONSTANT(LIBXSLT_DOTTED_VERSION,  
LIBXSLT_DOTTED_VERSION, CONST_CS | CONST_PERSISTENT);
+
+#if HAVE_XSL_EXSLT
+   REGISTER_LONG_CONSTANT(LIBEXSLT_VERSION,   LIBEXSLT_VERSION,  
  CONST_CS | CONST_PERSISTENT);
+   REGISTER_STRING_CONSTANT(LIBEXSLT_DOTTED_VERSION,  
LIBEXSLT_DOTTED_VERSION, CONST_CS | CONST_PERSISTENT);
+#endif
+
return SUCCESS;
 }
 /* }}} */

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



[PHP-CVS] cvs: php-src(PHP_5_1) / NEWS

2005-12-25 Thread Pierre-Alain Joye
pajoye  Mon Dec 26 00:59:33 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-srcNEWS 
  Log:
  - xslt/exslt versions constants entry
  
  
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.323r2=1.2027.2.324diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.323 php-src/NEWS:1.2027.2.324
--- php-src/NEWS:1.2027.2.323   Sun Dec 25 20:34:59 2005
+++ php-src/NEWSMon Dec 26 00:59:32 2005
@@ -13,6 +13,9 @@
   (Rui)
 - Fixed segfault/leak in imagecolormatch (Pierre)
 - Raise warnings instead of errors in imagecolormatch (Pierre)
+- add constants to determine the libxslt and libexslt version
+  LIBXSLT_VERSION, LIBXSLT_DOTTED_VERSION, LIBEXSLT_VERSION
+  LIBEXSLT_DOTTED_VERSION (Pierre)
 22 Dec 2005, PHP 5.1.2RC1
 - Updated libsqlite in ext/sqlite to 2.8.17. (Ilia)
 - Updated libsqlite in ext/pdo_sqlite to 3.2.8. (Ilia)

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



[PHP-CVS] cvs: php-src /sapi/cgi fastcgi.c fastcgi.h

2005-12-25 Thread Zeev Suraski
zeevMon Dec 26 07:25:45 2005 EDT

  Added files: 
/php-src/sapi/cgi   fastcgi.c fastcgi.h 
  Log:
  Commit missing files - sorry!
  
  
http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/fastcgi.c?view=markuprev=1.1
Index: php-src/sapi/cgi/fastcgi.c
+++ php-src/sapi/cgi/fastcgi.c
/*
   +--+
   | PHP Version 5|
   +--+
   | Copyright (c) 1997-2005 The PHP Group|
   +--+
   | This source file is subject to version 3.0 of the PHP license,   |
   | that 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_0.txt.  |
   | If you did not receive a copy of the PHP license and are unable to   |
   | obtain it through the world-wide-web, please send a note to  |
   | [EMAIL PROTECTED] so we can mail you a copy immediately.   |
   +--+
   | Authors: Dmitry Stogov [EMAIL PROTECTED] |
   +--+
*/

/* $Id: fastcgi.c,v 1.1 2005/12/26 07:25:45 zeev Exp $ */

#include php_config.h
#include fastcgi.h

#include string.h
#include stdlib.h
#include stdio.h
#include stdarg.h
#include errno.h

#ifndef MAXPATHLEN
#  ifdef PATH_MAX
#define MAXPATHLEN PATH_MAX
#  else
#define MAXPATHLEN 512
#  endif
#endif

#ifdef _WIN32

#include windows.h

# define inline__inline
# define vsnprintf _vsnprintf

typedef int socklen_t;
typedef int ssize_t;
typedef unsigned int size_t;

struct sockaddr_un {
short   sun_family;
charsun_path[MAXPATHLEN];
};

static HANDLE fcgi_accept_mutex = INVALID_HANDLE_VALUE;
static int is_impersonate = 0;

#define FCGI_LOCK(fd) \
if (fcgi_accept_mutex != INVALID_HANDLE_VALUE) { \
DWORD ret; \
while ((ret = WaitForSingleObject(fcgi_accept_mutex, 1000)) == 
WAIT_TIMEOUT) { \
if (in_shutdown) return -1; \
} \
if (ret == WAIT_FAILED) { \
fprintf(stderr, WaitForSingleObject() failed\n); \
return -1; \
} \
}

#define FCGI_UNLOCK(fd) \
if (fcgi_accept_mutex != INVALID_HANDLE_VALUE) { \
ReleaseMutex(fcgi_accept_mutex); \
}

#else

# include sys/types.h
# include sys/stat.h
# include unistd.h
# include fcntl.h
# include sys/socket.h
# include sys/un.h
# include netinet/in.h
# include arpa/inet.h
# include netdb.h
# include sys/signal.h

# ifndef HAVE_SOCKLEN_T
typedef unsigned int socklen_t;
# endif

# ifdef USE_LOCKING
#  define FCGI_LOCK(fd) 
\
do {
\
struct flock lock;  
\
lock.l_type = F_WRLCK;  
\
lock.l_start = 0;   
\
lock.l_whence = SEEK_SET;   
\
lock.l_len = 0; 
\
if (fcntl(fd, F_SETLKW, lock) != -1) { \
break;  
\
} else if (errno != EINTR || in_shutdown) { \
return -1;  
\
}   
\
} while (1)

#  define FCGI_UNLOCK(fd)   
\
do {
\
int orig_errno = errno; 
\
while (1) { 
\
struct flock lock;  
\
lock.l_type = F_UNLCK;  
\
lock.l_start = 0;   
\
lock.l_whence = SEEK_SET;   
\
lock.l_len = 0; 

[PHP-CVS] cvs: php-src /sapi/cgi fastcgi.c

2005-12-25 Thread Sebastian Bergmann
sebastian   Mon Dec 26 07:56:38 2005 EDT

  Modified files:  
/php-src/sapi/cgi   fastcgi.c 
  Log:
  Fix Windows build.
  
http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/fastcgi.c?r1=1.1r2=1.2diff_format=u
Index: php-src/sapi/cgi/fastcgi.c
diff -u php-src/sapi/cgi/fastcgi.c:1.1 php-src/sapi/cgi/fastcgi.c:1.2
--- php-src/sapi/cgi/fastcgi.c:1.1  Mon Dec 26 07:25:45 2005
+++ php-src/sapi/cgi/fastcgi.c  Mon Dec 26 07:56:37 2005
@@ -16,9 +16,8 @@
+--+
 */
 
-/* $Id: fastcgi.c,v 1.1 2005/12/26 07:25:45 zeev Exp $ */
+/* $Id: fastcgi.c,v 1.2 2005/12/26 07:56:37 sebastian Exp $ */
 
-#include php_config.h
 #include fastcgi.h
 
 #include string.h
@@ -73,6 +72,7 @@
 
 #else
 
+# include php_config.h
 # include sys/types.h
 # include sys/stat.h
 # include unistd.h

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