Browse Source

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.
migration/RELEASE_1_0_0
Wez Furlong 21 years ago
parent
commit
c2909b377b
  1. 4
      ext/com_dotnet/com_variant.c
  2. 2
      ext/standard/basic_functions.h
  3. 5
      ext/standard/datetime.c
  4. 2
      ext/standard/pageinfo.c
  5. 2
      ext/standard/pageinfo.h

4
ext/com_dotnet/com_variant.c

@ -789,6 +789,7 @@ PHP_FUNCTION(variant_date_to_timestamp)
PHP_FUNCTION(variant_date_from_timestamp)
{
long timestamp;
time_t ttstamp;
SYSTEMTIME systime;
struct tm *tmv;
VARIANT res;
@ -800,7 +801,8 @@ PHP_FUNCTION(variant_date_from_timestamp)
VariantInit(&res);
tzset();
tmv = localtime(&timestamp);
ttstamp = timestamp;
tmv = localtime(&ttstamp);
memset(&systime, 0, sizeof(systime));
systime.wDay = tmv->tm_mday;

2
ext/standard/basic_functions.h

@ -173,7 +173,7 @@ typedef struct _php_basic_globals {
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;

5
ext/standard/datetime.c

@ -71,7 +71,7 @@ static int phpday_tab[2][12] = {
/* {{{ 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 @@ PHPAPI int php_idate(char format, int timestamp, int gm)
PHP_FUNCTION(idate)
{
zval **format, **timestamp;
int t, ret;
int ret;
time_t t;
switch (ZEND_NUM_ARGS()) {
case 1:

2
ext/standard/pageinfo.c

@ -158,7 +158,7 @@ PHP_FUNCTION(getmyinode)
}
/* }}} */
PHPAPI long php_getlastmod(TSRMLS_D)
PHPAPI time_t php_getlastmod(TSRMLS_D)
{
php_statpage(TSRMLS_C);
return BG(page_mtime);

2
ext/standard/pageinfo.h

@ -28,7 +28,7 @@ PHP_FUNCTION(getmyinode);
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);

Loading…
Cancel
Save