cvs: php-src /ext/com_dotnet com_variant.c /ext/standard basic_functions.h datetime.c pageinfo.c pageinfo.h

From: Date: Sat, 13 Aug 2005 02:23:29 +0000
Subject: cvs: php-src /ext/com_dotnet com_variant.c /ext/standard basic_functions.h datetime.c pageinfo.c pageinfo.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-33353@lists.php.net to get a copy of this message
wez Fri Aug 12 22:23:29 2005 EDT Modified files: /php-src/ext/com_dotnet com_variant.c /php-src/ext/standard basic_functions.h datetime.c pageinfo.c pageinfo.h Log: vs.net 2005 introduces 64-bit time_t. I can't say that I think this is a great idea, but it does highlight a couple of dodgy areas where we assume that ints and longs are the same thing as time_t's. Let's try to ensure that we declare structure fields and function parameters with the correct type when we're talkingabout time_t's, to avoid possibly nasty problems with passing the wrong sized thing around. http://cvs.php.net/diff.php/php-src/ext/com_dotnet/com_variant.c?r1=1.11&r2=1.12&ty=u Index: php-src/ext/com_dotnet/com_variant.c diff -u php-src/ext/com_dotnet/com_variant.c:1.11 php-src/ext/com_dotnet/com_variant.c:1.12 --- php-src/ext/com_dotnet/com_variant.c:1.11 Wed Aug 3 10:06:43 2005 +++ php-src/ext/com_dotnet/com_variant.c Fri Aug 12 22:23:27 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: com_variant.c,v 1.11 2005/08/03 14:06:43 sniper Exp $ */ +/* $Id: com_variant.c,v 1.12 2005/08/13 02:23:27 wez Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -789,6 +789,7 @@ PHP_FUNCTION(variant_date_from_timestamp) { long timestamp; + time_t ttstamp; SYSTEMTIME systime; struct tm *tmv; VARIANT res; @@ -800,7 +801,8 @@ VariantInit(&res); tzset(); - tmv = localtime(&timestamp); + ttstamp = timestamp; + tmv = localtime(&ttstamp); memset(&systime, 0, sizeof(systime)); systime.wDay = tmv->tm_mday; http://cvs.php.net/diff.php/php-src/ext/standard/basic_functions.h?r1=1.139&r2=1.140&ty=u Index: php-src/ext/standard/basic_functions.h diff -u php-src/ext/standard/basic_functions.h:1.139 php-src/ext/standard/basic_functions.h:1.140 --- php-src/ext/standard/basic_functions.h:1.139 Wed Aug 3 10:07:57 2005 +++ php-src/ext/standard/basic_functions.h Fri Aug 12 22:23:29 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.h,v 1.139 2005/08/03 14:07:57 sniper Exp $ */ +/* $Id: basic_functions.h,v 1.140 2005/08/13 02:23:29 wez Exp $ */ #ifndef BASIC_FUNCTIONS_H #define BASIC_FUNCTIONS_H @@ -173,7 +173,7 @@ long page_uid; long page_gid; long page_inode; - long page_mtime; + time_t page_mtime; /* filestat.c && main/streams/streams.c */ char *CurrentStatFile, *CurrentLStatFile; http://cvs.php.net/diff.php/php-src/ext/standard/datetime.c?r1=1.134&r2=1.135&ty=u Index: php-src/ext/standard/datetime.c diff -u php-src/ext/standard/datetime.c:1.134 php-src/ext/standard/datetime.c:1.135 --- php-src/ext/standard/datetime.c:1.134 Wed Aug 3 10:07:57 2005 +++ php-src/ext/standard/datetime.c Fri Aug 12 22:23:29 2005 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: datetime.c,v 1.134 2005/08/03 14:07:57 sniper Exp $ */ +/* $Id: datetime.c,v 1.135 2005/08/13 02:23:29 wez Exp $ */ #if HAVE_STRPTIME #define _XOPEN_SOURCE @@ -71,7 +71,7 @@ /* {{{ php_idate */ -PHPAPI int php_idate(char format, int timestamp, int gm) +PHPAPI int php_idate(char format, time_t timestamp, int gm) { time_t the_time; struct tm *ta, tmbuf; @@ -178,7 +178,8 @@ PHP_FUNCTION(idate) { zval **format, **timestamp; - int t, ret; + int ret; + time_t t; switch (ZEND_NUM_ARGS()) { case 1: http://cvs.php.net/diff.php/php-src/ext/standard/pageinfo.c?r1=1.40&r2=1.41&ty=u Index: php-src/ext/standard/pageinfo.c diff -u php-src/ext/standard/pageinfo.c:1.40 php-src/ext/standard/pageinfo.c:1.41 --- php-src/ext/standard/pageinfo.c:1.40 Wed Aug 3 10:08:09 2005 +++ php-src/ext/standard/pageinfo.c Fri Aug 12 22:23:29 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pageinfo.c,v 1.40 2005/08/03 14:08:09 sniper Exp $ */ +/* $Id: pageinfo.c,v 1.41 2005/08/13 02:23:29 wez Exp $ */ #include "php.h" #include "pageinfo.h" @@ -158,7 +158,7 @@ } /* }}} */ -PHPAPI long php_getlastmod(TSRMLS_D) +PHPAPI time_t php_getlastmod(TSRMLS_D) { php_statpage(TSRMLS_C); return BG(page_mtime); http://cvs.php.net/diff.php/php-src/ext/standard/pageinfo.h?r1=1.14&r2=1.15&ty=u Index: php-src/ext/standard/pageinfo.h diff -u php-src/ext/standard/pageinfo.h:1.14 php-src/ext/standard/pageinfo.h:1.15 --- php-src/ext/standard/pageinfo.h:1.14 Wed Aug 3 10:08:09 2005 +++ php-src/ext/standard/pageinfo.h Fri Aug 12 22:23:29 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pageinfo.h,v 1.14 2005/08/03 14:08:09 sniper Exp $ */ +/* $Id: pageinfo.h,v 1.15 2005/08/13 02:23:29 wez Exp $ */ #ifndef PAGEINFO_H #define PAGEINFO_H @@ -28,7 +28,7 @@ PHP_FUNCTION(getlastmod); PHPAPI void php_statpage(TSRMLS_D); -PHPAPI long php_getlastmod(TSRMLS_D); +PHPAPI time_t php_getlastmod(TSRMLS_D); extern long php_getuid(void); extern long php_getgid(void);

« previous php.cvs (#33353) next »