zeev Wed Aug 20 19:00:08 2003 EDT Modified files: /php-src/main main.c Log: No need for those code blocks anymore... Index: php-src/main/main.c diff -u php-src/main/main.c:1.566 php-src/main/main.c:1.567 --- php-src/main/main.c:1.566 Mon Aug 18 23:25:00 2003 +++ php-src/main/main.c Wed Aug 20 19:00:08 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.566 2003/08/19 03:25:00 wez Exp $ */ +/* $Id: main.c,v 1.567 2003/08/20 23:00:08 zeev Exp $ */ /* {{{ includes */ @@ -849,63 +849,58 @@ TSRMLS_FETCH(); switch (message) { - case ZMSG_FAILED_INCLUDE_FOPEN: { - php_error_docref("function.include" TSRMLS_CC, E_WARNING, "Failed opening '%s' for inclusion (include_path='%s')", php_strip_url_passwd((char *) data), STR_PRINT(PG(include_path))); - } + case ZMSG_FAILED_INCLUDE_FOPEN: + php_error_docref("function.include" TSRMLS_CC, E_WARNING, "Failed opening '%s' for inclusion (include_path='%s')", php_strip_url_passwd((char *) data), STR_PRINT(PG(include_path))); break; - case ZMSG_FAILED_REQUIRE_FOPEN: { - php_error_docref("function.require" TSRMLS_CC, E_COMPILE_ERROR, "Failed opening required '%s' (include_path='%s')", php_strip_url_passwd((char *) data), STR_PRINT(PG(include_path))); - } + case ZMSG_FAILED_REQUIRE_FOPEN: + php_error_docref("function.require" TSRMLS_CC, E_COMPILE_ERROR, "Failed opening required '%s' (include_path='%s')", php_strip_url_passwd((char *) data), STR_PRINT(PG(include_path))); break; - case ZMSG_FAILED_HIGHLIGHT_FOPEN: { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed opening '%s' for highlighting", php_strip_url_passwd((char *) data)); - } + case ZMSG_FAILED_HIGHLIGHT_FOPEN: + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed opening '%s' for highlighting", php_strip_url_passwd((char *) data)); break; case ZMSG_MEMORY_LEAK_DETECTED: - case ZMSG_MEMORY_LEAK_REPEATED: { + case ZMSG_MEMORY_LEAK_REPEATED: #if ZEND_DEBUG - if ((EG(error_reporting)&E_WARNING) && PG(report_memleaks)) { - char memory_leak_buf[512]; + if ((EG(error_reporting)&E_WARNING) && PG(report_memleaks)) { + char memory_leak_buf[512]; - if (message==ZMSG_MEMORY_LEAK_DETECTED) { - zend_mem_header *t = (zend_mem_header *) data; - void *ptr = (void *)((char *)t+sizeof(zend_mem_header)+MEM_HEADER_PADDING); - - snprintf(memory_leak_buf, 512, "%s(%d) : Freeing 0x%.8lX (%d bytes), script=%s\n", t->filename, t->lineno, (unsigned long)ptr, t->size, SAFE_FILENAME(SG(request_info).path_translated)); - if (t->orig_filename) { - char relay_buf[512]; + if (message==ZMSG_MEMORY_LEAK_DETECTED) { + zend_mem_header *t = (zend_mem_header *) data; + void *ptr = (void *)((char *)t+sizeof(zend_mem_header)+MEM_HEADER_PADDING); + + snprintf(memory_leak_buf, 512, "%s(%d) : Freeing 0x%.8lX (%d bytes), script=%s\n", t->filename, t->lineno, (unsigned long)ptr, t->size, SAFE_FILENAME(SG(request_info).path_translated)); + if (t->orig_filename) { + char relay_buf[512]; - snprintf(relay_buf, 512, "%s(%d) : Actual location (location was relayed)\n", t->orig_filename, t->orig_lineno); - strcat(memory_leak_buf, relay_buf); - } - } else { - unsigned long leak_count = (unsigned long) data; - - snprintf(memory_leak_buf, 512, "Last leak repeated %ld time%s\n", leak_count, (leak_count>1?"s":"")); + snprintf(relay_buf, 512, "%s(%d) : Actual location (location was relayed)\n", t->orig_filename, t->orig_lineno); + strcat(memory_leak_buf, relay_buf); } + } else { + unsigned long leak_count = (unsigned long) data; + + snprintf(memory_leak_buf, 512, "Last leak repeated %ld time%s\n", leak_count, (leak_count>1?"s":"")); + } # if defined(PHP_WIN32) - OutputDebugString(memory_leak_buf); + OutputDebugString(memory_leak_buf); # else - fprintf(stderr, "%s", memory_leak_buf); + fprintf(stderr, "%s", memory_leak_buf); # endif - } -#endif } +#endif break; - case ZMSG_MEMORY_LEAKS_GRAND_TOTAL: { + case ZMSG_MEMORY_LEAKS_GRAND_TOTAL: #if ZEND_DEBUG - if ((EG(error_reporting)&E_WARNING) && PG(report_memleaks)) { - char memory_leak_buf[512]; + if ((EG(error_reporting)&E_WARNING) && PG(report_memleaks)) { + char memory_leak_buf[512]; - snprintf(memory_leak_buf, 512, "=== Total %d memory leaks detected ===\n", *((zend_uint *) data)); + snprintf(memory_leak_buf, 512, "=== Total %d memory leaks detected ===\n", *((zend_uint *) data)); # if defined(PHP_WIN32) - OutputDebugString(memory_leak_buf); + OutputDebugString(memory_leak_buf); # else - fprintf(stderr, "%s", memory_leak_buf); + fprintf(stderr, "%s", memory_leak_buf); # endif - } -#endif } +#endif break; case ZMSG_LOG_SCRIPT_NAME: { struct tm *ta, tmbuf;
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php