Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: mozilla/nsprpub/pr/src/misc/prtime.c

Issue 12089033: Update to NSPR 4.9.5 Beta 2, part 2: actual changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mozilla/nsprpub/pr/src/misc/prinrval.c ('k') | mozilla/nsprpub/pr/src/pthreads/ptio.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public 2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 5
6 /* 6 /*
7 * prtime.c -- 7 * prtime.c --
8 * 8 *
9 * NSPR date and time functions 9 * NSPR date and time functions
10 * 10 *
(...skipping 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after
1688 a.tm_wday = tm->tm_wday; 1688 a.tm_wday = tm->tm_wday;
1689 a.tm_year = tm->tm_year - 1900; 1689 a.tm_year = tm->tm_year - 1900;
1690 a.tm_yday = tm->tm_yday; 1690 a.tm_yday = tm->tm_yday;
1691 a.tm_isdst = tm->tm_params.tp_dst_offset ? 1 : 0; 1691 a.tm_isdst = tm->tm_params.tp_dst_offset ? 1 : 0;
1692 1692
1693 /* 1693 /*
1694 * On some platforms, for example SunOS 4, struct tm has two 1694 * On some platforms, for example SunOS 4, struct tm has two
1695 * additional fields: tm_zone and tm_gmtoff. 1695 * additional fields: tm_zone and tm_gmtoff.
1696 */ 1696 */
1697 1697
1698 #if defined(SUNOS4) || (__GLIBC__ >= 2) || defined(XP_BEOS) \ 1698 #if (__GLIBC__ >= 2) || defined(XP_BEOS) \
1699 || defined(NETBSD) || defined(OPENBSD) || defined(FREEBSD) \ 1699 || defined(NETBSD) || defined(OPENBSD) || defined(FREEBSD) \
1700 || defined(DARWIN) || defined(SYMBIAN) || defined(ANDROID) 1700 || defined(DARWIN) || defined(SYMBIAN) || defined(ANDROID)
1701 a.tm_zone = NULL; 1701 a.tm_zone = NULL;
1702 a.tm_gmtoff = tm->tm_params.tp_gmt_offset + 1702 a.tm_gmtoff = tm->tm_params.tp_gmt_offset +
1703 tm->tm_params.tp_dst_offset; 1703 tm->tm_params.tp_dst_offset;
1704 #endif 1704 #endif
1705 } else { 1705 } else {
1706 ap = NULL; 1706 ap = NULL;
1707 } 1707 }
1708 1708
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
2002 /* Count the number of full weeks ( dayOfYear / 7 ) then add a week if ther e 2002 /* Count the number of full weeks ( dayOfYear / 7 ) then add a week if ther e
2003 * are any days left over ( dayOfYear % 7 ). Because we are only counting to 2003 * are any days left over ( dayOfYear % 7 ). Because we are only counting to
2004 * the first day of the week containing the given time, rather than to the 2004 * the first day of the week containing the given time, rather than to the
2005 * actual day representing the given time, any days in week 0 will be "abso rbed" 2005 * actual day representing the given time, any days in week 0 will be "abso rbed"
2006 * as extra days in the given week. 2006 * as extra days in the given week.
2007 */ 2007 */
2008 return (dayOfYear / 7) + ( (dayOfYear % 7) == 0 ? 0 : 1 ); 2008 return (dayOfYear / 7) + ( (dayOfYear % 7) == 0 ? 0 : 1 );
2009 } 2009 }
2010 } 2010 }
2011 2011
OLDNEW
« no previous file with comments | « mozilla/nsprpub/pr/src/misc/prinrval.c ('k') | mozilla/nsprpub/pr/src/pthreads/ptio.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698