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.
PHP_FUNCTION(variant_date_from_timestamp)
{
long timestamp;
+ time_t ttstamp;
SYSTEMTIME systime;
struct tm *tmv;
VARIANT res;
VariantInit(&res);
tzset();
- tmv = localtime(×tamp);
+ ttstamp = timestamp;
+ tmv = localtime(&ttstamp);
memset(&systime, 0, sizeof(systime));
systime.wDay = tmv->tm_mday;
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;
/* {{{ 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;
PHP_FUNCTION(idate)
{
zval **format, **timestamp;
- int t, ret;
+ int ret;
+ time_t t;
switch (ZEND_NUM_ARGS()) {
case 1:
}
/* }}} */
-PHPAPI long php_getlastmod(TSRMLS_D)
+PHPAPI time_t php_getlastmod(TSRMLS_D)
{
php_statpage(TSRMLS_C);
return BG(page_mtime);
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);