cvs: php-src /ext/date php_date.c php_date.h /ext/date/lib timelib.h
| From: | Wez Furlong | Date: | Fri, 12 Aug 2005 23:46:42 +0000 |
| Subject: | cvs: php-src /ext/date php_date.c php_date.h /ext/date/lib timelib.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-33351@lists.php.net to get a copy of this message | ||
wez Fri Aug 12 19:46:42 2005 EDT
Modified files:
/php-src/ext/date php_date.c php_date.h
/php-src/ext/date/lib timelib.h
Log:
sizeof(time_t) !== sizeof(int)
also, sizeof(timelib_sll) != sizeof(int)
We get loads of truncation errors int this code when we assign 64 values into smaller ints.
http://cvs.php.net/diff.php/php-src/ext/date/php_date.c?r1=1.44&r2=1.45&ty=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.44 php-src/ext/date/php_date.c:1.45
--- php-src/ext/date/php_date.c:1.44 Tue Aug 9 17:07:53 2005
+++ php-src/ext/date/php_date.c Fri Aug 12 19:46:41 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_date.c,v 1.44 2005/08/09 21:07:53 derick Exp $ */
+/* $Id: php_date.c,v 1.45 2005/08/12 23:46:41 wez Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -328,7 +328,7 @@
"Sun", "Mon", "Tue", "Wed", "Thu",
"Fri", "Sat"
};
-static char *english_suffix(int number)
+static char *english_suffix(timelib_sll number)
{
if (number >= 10 && number <= 19) {
return "th";
@@ -471,7 +471,7 @@
{
char *format;
int format_len;
- long ts = time(NULL);
+ time_t ts = time(NULL);
char *string;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format,
&format_len, &ts) == FAILURE) {
@@ -484,7 +484,7 @@
}
/* }}} */
-PHPAPI char *php_format_date(char *format, int format_len, long ts, int localtime TSRMLS_DC) /* {{{
*/
+PHPAPI char *php_format_date(char *format, int format_len, time_t ts, int localtime TSRMLS_DC) /*
{{{ */
{
timelib_time *t;
timelib_tzinfo *tzi;
http://cvs.php.net/diff.php/php-src/ext/date/php_date.h?r1=1.17&r2=1.18&ty=u
Index: php-src/ext/date/php_date.h
diff -u php-src/ext/date/php_date.h:1.17 php-src/ext/date/php_date.h:1.18
--- php-src/ext/date/php_date.h:1.17 Wed Aug 3 10:06:45 2005
+++ php-src/ext/date/php_date.h Fri Aug 12 19:46:41 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_date.h,v 1.17 2005/08/03 14:06:45 sniper Exp $ */
+/* $Id: php_date.h,v 1.18 2005/08/12 23:46:41 wez Exp $ */
#ifndef PHP_DATE_H
#define PHP_DATE_H
@@ -87,6 +87,6 @@
#define _php_strftime php_strftime
PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm);
#endif
-PHPAPI char *php_format_date(char *format, int format_len, long ts, int localtime TSRMLS_DC);
+PHPAPI char *php_format_date(char *format, int format_len, time_t ts, int localtime TSRMLS_DC);
#endif /* PHP_DATE_H */
http://cvs.php.net/diff.php/php-src/ext/date/lib/timelib.h?r1=1.10&r2=1.11&ty=u
Index: php-src/ext/date/lib/timelib.h
diff -u php-src/ext/date/lib/timelib.h:1.10 php-src/ext/date/lib/timelib.h:1.11
--- php-src/ext/date/lib/timelib.h:1.10 Wed Aug 3 10:06:49 2005
+++ php-src/ext/date/lib/timelib.h Fri Aug 12 19:46:42 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: timelib.h,v 1.10 2005/08/03 14:06:49 sniper Exp $ */
+/* $Id: timelib.h,v 1.11 2005/08/12 23:46:42 wez Exp $ */
#ifndef __TIMELIB_H__
#define __TIMELIB_H__
@@ -34,7 +34,7 @@
#define LONG_MIN (- LONG_MAX - 1)
#endif
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) && !defined(strcasecmp)
#define strcasecmp stricmp
#endif