You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
remove trailing whitespace
This commit is contained in:
@@ -500,9 +500,9 @@ void _OS::set_icon(const Image& p_icon) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current datetime with consideration for utc and
|
||||
* Get current datetime with consideration for utc and
|
||||
* dst
|
||||
*/
|
||||
*/
|
||||
Dictionary _OS::get_datetime(bool utc) const {
|
||||
|
||||
Dictionary dated = get_date(utc);
|
||||
@@ -564,17 +564,17 @@ uint64_t _OS::get_unix_time_from_datetime(Dictionary datetime) const {
|
||||
|
||||
// Get all time values from the dictionary, set to zero if it doesn't exist.
|
||||
// Risk incorrect calculation over throwing errors
|
||||
unsigned int second = ((datetime.has(SECOND_KEY))?
|
||||
unsigned int second = ((datetime.has(SECOND_KEY))?
|
||||
static_cast<unsigned int>(datetime[SECOND_KEY]): 0);
|
||||
unsigned int minute = ((datetime.has(MINUTE_KEY))?
|
||||
unsigned int minute = ((datetime.has(MINUTE_KEY))?
|
||||
static_cast<unsigned int>(datetime[MINUTE_KEY]): 0);
|
||||
unsigned int hour = ((datetime.has(HOUR_KEY))?
|
||||
unsigned int hour = ((datetime.has(HOUR_KEY))?
|
||||
static_cast<unsigned int>(datetime[HOUR_KEY]): 0);
|
||||
unsigned int day = ((datetime.has(DAY_KEY))?
|
||||
unsigned int day = ((datetime.has(DAY_KEY))?
|
||||
static_cast<unsigned int>(datetime[DAY_KEY]): 0);
|
||||
unsigned int month = ((datetime.has(MONTH_KEY))?
|
||||
unsigned int month = ((datetime.has(MONTH_KEY))?
|
||||
static_cast<unsigned int>(datetime[MONTH_KEY]) -1: 0);
|
||||
unsigned int year = ((datetime.has(YEAR_KEY))?
|
||||
unsigned int year = ((datetime.has(YEAR_KEY))?
|
||||
static_cast<unsigned int>(datetime[YEAR_KEY]):0);
|
||||
|
||||
/// How many days come before each month (0-12)
|
||||
@@ -604,7 +604,7 @@ uint64_t _OS::get_unix_time_from_datetime(Dictionary datetime) const {
|
||||
ERR_FAIL_COND_V( day > MONTH_DAYS_TABLE[LEAPYEAR(year)][month], 0);
|
||||
|
||||
// Calculate all the seconds from months past in this year
|
||||
uint64_t SECONDS_FROM_MONTHS_PAST_THIS_YEAR =
|
||||
uint64_t SECONDS_FROM_MONTHS_PAST_THIS_YEAR =
|
||||
DAYS_PAST_THIS_YEAR_TABLE[LEAPYEAR(year)][month] * SECONDS_PER_DAY;
|
||||
|
||||
uint64_t SECONDS_FROM_YEARS_PAST = 0;
|
||||
@@ -614,13 +614,13 @@ uint64_t _OS::get_unix_time_from_datetime(Dictionary datetime) const {
|
||||
SECONDS_PER_DAY;
|
||||
}
|
||||
|
||||
uint64_t epoch =
|
||||
second +
|
||||
minute * SECONDS_PER_MINUTE +
|
||||
uint64_t epoch =
|
||||
second +
|
||||
minute * SECONDS_PER_MINUTE +
|
||||
hour * SECONDS_PER_HOUR +
|
||||
// Subtract 1 from day, since the current day isn't over yet
|
||||
// and we cannot count all 24 hours.
|
||||
(day-1) * SECONDS_PER_DAY +
|
||||
(day-1) * SECONDS_PER_DAY +
|
||||
SECONDS_FROM_MONTHS_PAST_THIS_YEAR +
|
||||
SECONDS_FROM_YEARS_PAST;
|
||||
return epoch;
|
||||
@@ -631,7 +631,7 @@ uint64_t _OS::get_unix_time_from_datetime(Dictionary datetime) const {
|
||||
* Get a dictionary of time values when given epoch time
|
||||
*
|
||||
* Dictionary Time values will be a union if values from #get_time
|
||||
* and #get_date dictionaries (with the exception of dst =
|
||||
* and #get_date dictionaries (with the exception of dst =
|
||||
* day light standard time, as it cannot be determined from epoch)
|
||||
*
|
||||
* @param unix_time_val epoch time to convert
|
||||
@@ -660,14 +660,14 @@ Dictionary _OS::get_datetime_from_unix_time( uint64_t unix_time_val) const {
|
||||
time.hour = dayclock / 3600;
|
||||
|
||||
/* day 0 was a thursday */
|
||||
date.weekday = static_cast<OS::Weekday>((dayno + 4) % 7);
|
||||
date.weekday = static_cast<OS::Weekday>((dayno + 4) % 7);
|
||||
|
||||
while (dayno >= YEARSIZE(year)) {
|
||||
dayno -= YEARSIZE(year);
|
||||
year++;
|
||||
}
|
||||
|
||||
date.year = year;
|
||||
date.year = year;
|
||||
|
||||
size_t imonth = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user