|
32 | 32 | #endif |
33 | 33 |
|
34 | 34 | #ifdef PHP_WIN32 |
35 | | -static __inline __int64 php_date_llabs( __int64 i ) { return i >= 0? i: -i; } |
| 35 | +static __inline unsigned __int64 php_date_llabs( __int64 i ) { return i >= 0 ? (unsigned __int64)i : -(unsigned __int64)i; } |
36 | 36 | #elif defined(__GNUC__) && __GNUC__ < 3 |
37 | | -static __inline __int64_t php_date_llabs( __int64_t i ) { return i >= 0 ? i : -i; } |
| 37 | +static __inline unsigned long long php_date_llabs( __int64_t i ) { return i >= 0 ? (unsigned long long)i : -(unsigned long long)i; } |
38 | 38 | #else |
39 | | -static inline long long php_date_llabs( long long i ) { return i >= 0 ? i : -i; } |
| 39 | +static inline unsigned long long php_date_llabs( long long i ) { return i >= 0 ? (unsigned long long)i : -(unsigned long long)i; } |
40 | 40 | #endif |
41 | 41 |
|
42 | 42 | #ifdef PHP_WIN32 |
@@ -742,9 +742,9 @@ static zend_string *date_format(const char *format, size_t format_len, const tim |
742 | 742 | /* year */ |
743 | 743 | case 'L': length = slprintf(buffer, sizeof(buffer), "%d", timelib_is_leap((int) t->y)); break; |
744 | 744 | case 'y': length = slprintf(buffer, sizeof(buffer), "%02d", (int) (t->y % 100)); break; |
745 | | - case 'Y': length = slprintf(buffer, sizeof(buffer), "%s%04lld", t->y < 0 ? "-" : "", php_date_llabs((timelib_sll) t->y)); break; |
746 | | - case 'x': length = slprintf(buffer, sizeof(buffer), "%s%04lld", t->y < 0 ? "-" : (t->y >= 10000 ? "+" : ""), php_date_llabs((timelib_sll) t->y)); break; |
747 | | - case 'X': length = slprintf(buffer, sizeof(buffer), "%s%04lld", t->y < 0 ? "-" : "+", php_date_llabs((timelib_sll) t->y)); break; |
| 745 | + case 'Y': length = slprintf(buffer, sizeof(buffer), "%s%04llu", t->y < 0 ? "-" : "", php_date_llabs((timelib_sll) t->y)); break; |
| 746 | + case 'x': length = slprintf(buffer, sizeof(buffer), "%s%04llu", t->y < 0 ? "-" : (t->y >= 10000 ? "+" : ""), php_date_llabs((timelib_sll) t->y)); break; |
| 747 | + case 'X': length = slprintf(buffer, sizeof(buffer), "%s%04llu", t->y < 0 ? "-" : "+", php_date_llabs((timelib_sll) t->y)); break; |
748 | 748 |
|
749 | 749 | /* time */ |
750 | 750 | case 'a': length = slprintf(buffer, sizeof(buffer), "%s", t->h >= 12 ? "pm" : "am"); break; |
|
0 commit comments