FAQ
andrey Tue Apr 19 13:30:08 2005 EDT

Modified files:
/php-src/main main.c
Log:
add INT_MAX and INT_SIZE constants.
#64bit machines are getting wider usage and these are needed


http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.623&r2=1.624&ty=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.623 php-src/main/main.c:1.624
--- php-src/main/main.c:1.623 Mon Apr 4 11:06:28 2005
+++ php-src/main/main.c Tue Apr 19 13:30:07 2005
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/

-/* $Id: main.c,v 1.623 2005/04/04 15:06:28 hirokawa Exp $ */
+/* $Id: main.c,v 1.624 2005/04/19 17:30:07 andrey Exp $ */

/* {{{ includes
*/
@@ -1437,6 +1437,8 @@
REGISTER_MAIN_STRINGL_CONSTANT("PHP_CONFIG_FILE_SCAN_DIR", PHP_CONFIG_FILE_SCAN_DIR, sizeof(PHP_CONFIG_FILE_SCAN_DIR)-1, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_STRINGL_CONSTANT("PHP_SHLIB_SUFFIX", PHP_SHLIB_SUFFIX, sizeof(PHP_SHLIB_SUFFIX)-1, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_STRINGL_CONSTANT("PHP_EOL", PHP_EOL, sizeof(PHP_EOL)-1, CONST_PERSISTENT | CONST_CS);
+ REGISTER_MAIN_LONG_CONSTANT("INT_MAX", LONG_MAX, CONST_PERSISTENT | CONST_CS);
+ REGISTER_MAIN_LONG_CONSTANT("INT_SIZE", sizeof(long), CONST_PERSISTENT | CONST_CS);
php_output_register_constants(TSRMLS_C);
php_rfc1867_register_constants(TSRMLS_C);

Search Discussions

  • Jani Taskinen at Apr 19, 2005 at 10:17 pm
    Why did you name them INT_* when they should be LONG_* ?

    --Jani

    On Tue, 19 Apr 2005, Andrey Hristov wrote:

    andrey Tue Apr 19 13:30:08 2005 EDT

    Modified files:
    /php-src/main main.c
    Log:
    add INT_MAX and INT_SIZE constants.
    #64bit machines are getting wider usage and these are needed


    http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.623&r2=1.624&ty=u
    Index: php-src/main/main.c
    diff -u php-src/main/main.c:1.623 php-src/main/main.c:1.624
    --- php-src/main/main.c:1.623 Mon Apr 4 11:06:28 2005
    +++ php-src/main/main.c Tue Apr 19 13:30:07 2005
    @@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
    */

    -/* $Id: main.c,v 1.623 2005/04/04 15:06:28 hirokawa Exp $ */
    +/* $Id: main.c,v 1.624 2005/04/19 17:30:07 andrey Exp $ */

    /* {{{ includes
    */
    @@ -1437,6 +1437,8 @@
    REGISTER_MAIN_STRINGL_CONSTANT("PHP_CONFIG_FILE_SCAN_DIR", PHP_CONFIG_FILE_SCAN_DIR, sizeof(PHP_CONFIG_FILE_SCAN_DIR)-1, CONST_PERSISTENT | CONST_CS);
    REGISTER_MAIN_STRINGL_CONSTANT("PHP_SHLIB_SUFFIX", PHP_SHLIB_SUFFIX, sizeof(PHP_SHLIB_SUFFIX)-1, CONST_PERSISTENT | CONST_CS);
    REGISTER_MAIN_STRINGL_CONSTANT("PHP_EOL", PHP_EOL, sizeof(PHP_EOL)-1, CONST_PERSISTENT | CONST_CS);
    + REGISTER_MAIN_LONG_CONSTANT("INT_MAX", LONG_MAX, CONST_PERSISTENT | CONST_CS);
    + REGISTER_MAIN_LONG_CONSTANT("INT_SIZE", sizeof(long), CONST_PERSISTENT | CONST_CS);
    php_output_register_constants(TSRMLS_C);
    php_rfc1867_register_constants(TSRMLS_C);
  • Andrey Hristov at Apr 19, 2005 at 10:18 pm
    Because the whole PHP documentation talks about ints, even the
    cast is (int) and the corresponding function intval() :)
    I thought before naming them :)

    Andrey

    Jani Taskinen wrote:
    Why did you name them INT_* when they should be LONG_* ?

    --Jani

    On Tue, 19 Apr 2005, Andrey Hristov wrote:

    andrey Tue Apr 19 13:30:08 2005 EDT

    Modified files:
    /php-src/main main.c
    Log:
    add INT_MAX and INT_SIZE constants.
    #64bit machines are getting wider usage and these are needed


    http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.623&r2=1.624&ty=u
    Index: php-src/main/main.c
    diff -u php-src/main/main.c:1.623 php-src/main/main.c:1.624
    --- php-src/main/main.c:1.623 Mon Apr 4 11:06:28 2005
    +++ php-src/main/main.c Tue Apr 19 13:30:07 2005
    @@ -18,7 +18,7 @@

    +----------------------------------------------------------------------+
    */

    -/* $Id: main.c,v 1.623 2005/04/04 15:06:28 hirokawa Exp $ */
    +/* $Id: main.c,v 1.624 2005/04/19 17:30:07 andrey Exp $ */

    /* {{{ includes
    */
    @@ -1437,6 +1437,8 @@
    REGISTER_MAIN_STRINGL_CONSTANT("PHP_CONFIG_FILE_SCAN_DIR",
    PHP_CONFIG_FILE_SCAN_DIR, sizeof(PHP_CONFIG_FILE_SCAN_DIR)-1,
    CONST_PERSISTENT | CONST_CS);
    REGISTER_MAIN_STRINGL_CONSTANT("PHP_SHLIB_SUFFIX",
    PHP_SHLIB_SUFFIX, sizeof(PHP_SHLIB_SUFFIX)-1, CONST_PERSISTENT |
    CONST_CS);
    REGISTER_MAIN_STRINGL_CONSTANT("PHP_EOL", PHP_EOL,
    sizeof(PHP_EOL)-1, CONST_PERSISTENT | CONST_CS);
    + REGISTER_MAIN_LONG_CONSTANT("INT_MAX", LONG_MAX, CONST_PERSISTENT
    CONST_CS);
    + REGISTER_MAIN_LONG_CONSTANT("INT_SIZE", sizeof(long),
    CONST_PERSISTENT | CONST_CS);
    php_output_register_constants(TSRMLS_C);
    php_rfc1867_register_constants(TSRMLS_C);
  • Jani Taskinen at Apr 20, 2005 at 5:25 am
    So that is why you have to keep using the wrong
    name for the type? In this particular instance I'd
    definately go with the LONG_* to not cause even more
    confusion..

    --Jani
    On Wed, 20 Apr 2005, Andrey Hristov wrote:

    Because the whole PHP documentation talks about ints, even the
    cast is (int) and the corresponding function intval() :)
    I thought before naming them :)

    Andrey

    Jani Taskinen wrote:
    Why did you name them INT_* when they should be LONG_* ?

    --Jani

    On Tue, 19 Apr 2005, Andrey Hristov wrote:

    andrey Tue Apr 19 13:30:08 2005 EDT

    Modified files:
    /php-src/main main.c
    Log:
    add INT_MAX and INT_SIZE constants.
    #64bit machines are getting wider usage and these are needed


    http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.623&r2=1.624&ty=u
    Index: php-src/main/main.c
    diff -u php-src/main/main.c:1.623 php-src/main/main.c:1.624
    --- php-src/main/main.c:1.623 Mon Apr 4 11:06:28 2005
    +++ php-src/main/main.c Tue Apr 19 13:30:07 2005
    @@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
    */

    -/* $Id: main.c,v 1.623 2005/04/04 15:06:28 hirokawa Exp $ */
    +/* $Id: main.c,v 1.624 2005/04/19 17:30:07 andrey Exp $ */

    /* {{{ includes
    */
    @@ -1437,6 +1437,8 @@
    REGISTER_MAIN_STRINGL_CONSTANT("PHP_CONFIG_FILE_SCAN_DIR",
    PHP_CONFIG_FILE_SCAN_DIR, sizeof(PHP_CONFIG_FILE_SCAN_DIR)-1,
    CONST_PERSISTENT | CONST_CS);
    REGISTER_MAIN_STRINGL_CONSTANT("PHP_SHLIB_SUFFIX", PHP_SHLIB_SUFFIX,
    sizeof(PHP_SHLIB_SUFFIX)-1, CONST_PERSISTENT | CONST_CS);
    REGISTER_MAIN_STRINGL_CONSTANT("PHP_EOL", PHP_EOL, sizeof(PHP_EOL)-1,
    CONST_PERSISTENT | CONST_CS);
    + REGISTER_MAIN_LONG_CONSTANT("INT_MAX", LONG_MAX, CONST_PERSISTENT |
    CONST_CS);
    + REGISTER_MAIN_LONG_CONSTANT("INT_SIZE", sizeof(long), CONST_PERSISTENT
    CONST_CS);
    php_output_register_constants(TSRMLS_C);
    php_rfc1867_register_constants(TSRMLS_C);
    --
    Donate @ http://pecl.php.net/wishlist.php/sniper
  • Derick Rethans at Apr 20, 2005 at 7:08 am

    On Wed, 20 Apr 2005, Jani Taskinen wrote:


    So that is why you have to keep using the wrong
    name for the type? In this particular instance I'd
    definately go with the LONG_* to not cause even more
    confusion..
    I agree.

    Derick
  • Marcus Boerger at Apr 20, 2005 at 8:09 am
    Hello Jani,

    the only one being confused by this might be you and some other
    c coders working on php extenions. To the PHP code writer it has
    always been type int or integer and many of them might not even
    know what type long is. That said Andrey was absolute right to
    chose that name. And please don't force someone to introduce
    inconsistency for some very unimportant reason. PHP already is
    inconsistently enough.

    marcus

    Wednesday, April 20, 2005, 7:02:26 AM, you wrote:

    So that is why you have to keep using the wrong
    name for the type? In this particular instance I'd
    definately go with the LONG_* to not cause even more
    confusion..
    --Jani
    On Wed, 20 Apr 2005, Andrey Hristov wrote:

    Because the whole PHP documentation talks about ints, even the
    cast is (int) and the corresponding function intval() :)
    I thought before naming them :)

    Andrey

    Jani Taskinen wrote:
    Why did you name them INT_* when they should be LONG_* ?

    --Jani

    On Tue, 19 Apr 2005, Andrey Hristov wrote:

    andrey Tue Apr 19 13:30:08 2005 EDT

    Modified files:
    /php-src/main main.c
    Log:
    add INT_MAX and INT_SIZE constants.
    #64bit machines are getting wider usage and these are needed


    http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.623&r2=1.624&ty=u
    Index: php-src/main/main.c
    diff -u php-src/main/main.c:1.623 php-src/main/main.c:1.624
    --- php-src/main/main.c:1.623 Mon Apr 4 11:06:28 2005
    +++ php-src/main/main.c Tue Apr 19 13:30:07 2005
    @@ -18,7 +18,7 @@

    +----------------------------------------------------------------------+
    */

    -/* $Id: main.c,v 1.623 2005/04/04 15:06:28 hirokawa Exp $ */
    +/* $Id: main.c,v 1.624 2005/04/19 17:30:07 andrey Exp $ */

    /* {{{ includes
    */
    @@ -1437,6 +1437,8 @@
    REGISTER_MAIN_STRINGL_CONSTANT("PHP_CONFIG_FILE_SCAN_DIR",
    PHP_CONFIG_FILE_SCAN_DIR, sizeof(PHP_CONFIG_FILE_SCAN_DIR)-1,
    CONST_PERSISTENT | CONST_CS);
    REGISTER_MAIN_STRINGL_CONSTANT("PHP_SHLIB_SUFFIX", PHP_SHLIB_SUFFIX,
    sizeof(PHP_SHLIB_SUFFIX)-1, CONST_PERSISTENT | CONST_CS);
    REGISTER_MAIN_STRINGL_CONSTANT("PHP_EOL", PHP_EOL, sizeof(PHP_EOL)-1,
    CONST_PERSISTENT | CONST_CS);
    + REGISTER_MAIN_LONG_CONSTANT("INT_MAX", LONG_MAX, CONST_PERSISTENT |
    CONST_CS);
    + REGISTER_MAIN_LONG_CONSTANT("INT_SIZE", sizeof(long), CONST_PERSISTENT
    CONST_CS);
    php_output_register_constants(TSRMLS_C);
    php_rfc1867_register_constants(TSRMLS_C);
    --
    Donate @ http://pecl.php.net/wishlist.php/sniper



    --
    Best regards,
    Marcus mailto:mail@marcus-boerger.de
  • Jani Taskinen at Apr 20, 2005 at 2:54 pm

    On Wed, 20 Apr 2005, Marcus Boerger wrote:

    the only one being confused by this might be you and some other
    c coders working on php extenions. To the PHP code writer it has
    Well, some people writing PHP code might have C background too.. :)
    always been type int or integer and many of them might not even
    know what type long is. That said Andrey was absolute right to
    After reconsidering this (and saying "int is long in PHP" hundred times)
    I think I can live with the INT_* :)

    --Jani
  • Andrey Hristov at Apr 27, 2005 at 9:24 pm
    andrey Wed Apr 27 17:24:38 2005 EDT

    Modified files:
    /php-src/main main.c
    Log:
    rename


    http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.624&r2=1.625&ty=u
    Index: php-src/main/main.c
    diff -u php-src/main/main.c:1.624 php-src/main/main.c:1.625
    --- php-src/main/main.c:1.624 Tue Apr 19 13:30:07 2005
    +++ php-src/main/main.c Wed Apr 27 17:24:37 2005
    @@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
    */

    -/* $Id: main.c,v 1.624 2005/04/19 17:30:07 andrey Exp $ */
    +/* $Id: main.c,v 1.625 2005/04/27 21:24:37 andrey Exp $ */

    /* {{{ includes
    */
    @@ -1437,8 +1437,8 @@
    REGISTER_MAIN_STRINGL_CONSTANT("PHP_CONFIG_FILE_SCAN_DIR", PHP_CONFIG_FILE_SCAN_DIR, sizeof(PHP_CONFIG_FILE_SCAN_DIR)-1, CONST_PERSISTENT | CONST_CS);
    REGISTER_MAIN_STRINGL_CONSTANT("PHP_SHLIB_SUFFIX", PHP_SHLIB_SUFFIX, sizeof(PHP_SHLIB_SUFFIX)-1, CONST_PERSISTENT | CONST_CS);
    REGISTER_MAIN_STRINGL_CONSTANT("PHP_EOL", PHP_EOL, sizeof(PHP_EOL)-1, CONST_PERSISTENT | CONST_CS);
    - REGISTER_MAIN_LONG_CONSTANT("INT_MAX", LONG_MAX, CONST_PERSISTENT | CONST_CS);
    - REGISTER_MAIN_LONG_CONSTANT("INT_SIZE", sizeof(long), CONST_PERSISTENT | CONST_CS);
    + REGISTER_MAIN_LONG_CONSTANT("PHP_INT_MAX", LONG_MAX, CONST_PERSISTENT | CONST_CS);
    + REGISTER_MAIN_LONG_CONSTANT("PHP_INT_SIZE", sizeof(long), CONST_PERSISTENT | CONST_CS);
    php_output_register_constants(TSRMLS_C);
    php_rfc1867_register_constants(TSRMLS_C);
  • Jani Taskinen at Apr 28, 2005 at 7:51 am
    sniper Thu Apr 28 03:50:54 2005 EDT

    Modified files:
    /php-src/main main.c
    Log:
    - Reorder request shutdown calls: Call all __destruct() functions and
    register_shutdown_function() callbacks before flushing output buffers
    and sending headers.
    - Fixes bug #30578 and possibly others related to output buffering.

    # Added some comments too about what happens and where


    http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.625&r2=1.626&ty=u
    Index: php-src/main/main.c
    diff -u php-src/main/main.c:1.625 php-src/main/main.c:1.626
    --- php-src/main/main.c:1.625 Wed Apr 27 17:24:37 2005
    +++ php-src/main/main.c Thu Apr 28 03:50:53 2005
    @@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
    */

    -/* $Id: main.c,v 1.625 2005/04/27 21:24:37 andrey Exp $ */
    +/* $Id: main.c,v 1.626 2005/04/28 07:50:53 sniper Exp $ */

    /* {{{ includes
    */
    @@ -1133,6 +1133,7 @@
    void php_request_shutdown_for_hook(void *dummy)
    {
    TSRMLS_FETCH();
    +
    if (PG(modules_activated)) zend_try {
    php_call_shutdown_functions(TSRMLS_C);
    } zend_end_try();
    @@ -1177,32 +1178,39 @@
    TSRMLS_FETCH();

    report_memleaks = PG(report_memleaks);
    +
    /* EG(opline_ptr) points into nirvana and therefore cannot be safely accessed
    * inside zend_executor callback functions.
    */
    EG(opline_ptr) = NULL;

    + /* 1. Call all possible __destruct() functions */
    zend_try {
    - php_end_ob_buffers((zend_bool)(SG(request_info).headers_only?0:1) TSRMLS_CC);
    + zend_call_destructors(TSRMLS_C);
    } zend_end_try();

    + /* 2. Call all possible shutdown functions registered with register_shutdown_function() */
    + if (PG(modules_activated)) zend_try {
    + php_call_shutdown_functions(TSRMLS_C);
    + } zend_end_try();
    +
    + /* 3. Flush all output buffers */
    zend_try {
    - sapi_send_headers(TSRMLS_C);
    + php_end_ob_buffers((zend_bool)(SG(request_info).headers_only?0:1) TSRMLS_CC);
    } zend_end_try();

    + /* 4. Send the set HTTP headers (note: This must be done AFTER php_end_ob_buffers() !!) */
    zend_try {
    - zend_call_destructors(TSRMLS_C);
    + sapi_send_headers(TSRMLS_C);
    } zend_end_try();

    - if (PG(modules_activated)) zend_try {
    - php_call_shutdown_functions(TSRMLS_C);
    - } zend_end_try();
    -
    + /* 5. Call all extensions RSHUTDOWN functions */
    if (PG(modules_activated)) {
    zend_deactivate_modules(TSRMLS_C);
    php_free_shutdown_functions(TSRMLS_C);
    }

    + /* 6. Destroy super-globals */
    zend_try {
    int i;

    @@ -1213,21 +1221,25 @@
    }
    } zend_end_try();

    -
    + /* 7. Shutdown scanner/executor/compiler and restore ini entries */
    zend_deactivate(TSRMLS_C);

    + /* 8. Call all extensions post-RSHUTDOWN functions */
    zend_try {
    zend_post_deactivate_modules(TSRMLS_C);
    } zend_end_try();

    + /* 9. SAPI related shutdown (free stuff) */
    zend_try {
    sapi_deactivate(TSRMLS_C);
    } zend_end_try();

    + /* 10. Free Willy (here be crashes) */
    zend_try {
    shutdown_memory_manager(CG(unclean_shutdown) || !report_memleaks, 0 TSRMLS_CC);
    } zend_end_try();

    + /* 11. Reset max_execution_time */
    zend_try {
    zend_unset_timeout(TSRMLS_C);
    } zend_end_try();

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-cvs @
categoriesphp
postedApr 19, '05 at 5:30p
activeApr 28, '05 at 7:51a
posts9
users6
websitephp.net

People

Translate

site design / logo © 2019 Grokbase