The R Project SVN R

Rev

Rev 70060 | Rev 79901 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 70060 Rev 72341
Line 1... Line 1...
1
/*
1
/*
2
 *  R : A Computer Language for Statistical Data Analysis
2
 *  R : A Computer Language for Statistical Data Analysis
3
 *  Modifications copyright (C) 2007-2016  The R Core Team
3
 *  Modifications copyright (C) 2007-2017  The R Core Team
4
 *
4
 *
5
 *  This program is free software; you can redistribute it and/or modify
5
 *  This program is free software; you can redistribute it and/or modify
6
 *  it under the terms of the GNU General Public License as published by
6
 *  it under the terms of the GNU General Public License as published by
7
 *  the Free Software Foundation; either version 2 of the License, or
7
 *  the Free Software Foundation; either version 2 of the License, or
8
 *  (at your option) any later version.
8
 *  (at your option) any later version.
Line 1744... Line 1744...
1744
	yourtm.tm_sec = 0;
1744
	yourtm.tm_sec = 0;
1745
    }
1745
    }
1746
    /*
1746
    /*
1747
    ** Do a binary search (this works whatever time_t's type is).
1747
    ** Do a binary search (this works whatever time_t's type is).
1748
    */
1748
    */
1749
    if (!TYPE_SIGNED(time_t)) {
-
 
1750
	lo = 0;
-
 
1751
	hi = lo - 1;
-
 
1752
    } else {
-
 
1753
	lo = 1;
-
 
1754
	for (int i = 0; i < (int) TYPE_BIT(time_t) - 1; ++i)
-
 
1755
	    lo *= 2;
1749
    lo = time_t_min;
1756
	hi = -(lo + 1);
1750
    hi = time_t_max;
1757
    }
-
 
1758
    for ( ; ; ) {
1751
    for ( ; ; ) {
1759
	t = lo / 2 + hi / 2;
1752
	t = lo / 2 + hi / 2;
1760
	if (t < lo)
1753
	if (t < lo)
1761
	    t = lo;
1754
	    t = lo;
1762
	else if (t > hi)
1755
	else if (t > hi)