Skip to content

Commit

Permalink
Change tabs to spaces and remove some blank lines
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob-IT committed Aug 20, 2017
1 parent 047bc8d commit b485206
Showing 1 changed file with 24 additions and 36 deletions.
60 changes: 24 additions & 36 deletions libgnucash/engine/gnc-date.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ gnc_localtime (const time64 *secs)
auto time = static_cast<struct tm*>(calloc(1, sizeof(struct tm)));
if (gnc_localtime_r (secs, time) == NULL)
{
gnc_tm_free (time);
return NULL;
gnc_tm_free (time);
return NULL;
}
return time;
}
Expand All @@ -127,12 +127,12 @@ gnc_localtime_r (const time64 *secs, struct tm* time)
{
try
{
*time = static_cast<struct tm>(GncDateTime(*secs));
return time;
*time = static_cast<struct tm>(GncDateTime(*secs));
return time;
}
catch(std::invalid_argument)
{
return NULL;
return NULL;
}
}

Expand Down Expand Up @@ -199,14 +199,14 @@ gnc_gmtime (const time64 *secs)
{
try
{
auto time = static_cast<struct tm*>(calloc(1, sizeof(struct tm)));
GncDateTime gncdt(*secs);
*time = gncdt.utc_tm();
return time;
auto time = static_cast<struct tm*>(calloc(1, sizeof(struct tm)));
GncDateTime gncdt(*secs);
*time = gncdt.utc_tm();
return time;
}
catch(std::invalid_argument)
{
return NULL;
return NULL;
}

}
Expand All @@ -216,13 +216,13 @@ gnc_mktime (struct tm* time)
{
try
{
normalize_struct_tm (time);
GncDateTime gncdt(*time);
return static_cast<time64>(gncdt) - gncdt.offset();
normalize_struct_tm (time);
GncDateTime gncdt(*time);
return static_cast<time64>(gncdt) - gncdt.offset();
}
catch(std::invalid_argument)
{
return 0;
return 0;
}
}

Expand All @@ -231,12 +231,12 @@ gnc_timegm (struct tm* time)
{
try
{
normalize_struct_tm(time);
return static_cast<time64>(GncDateTime(*time));
normalize_struct_tm(time);
return static_cast<time64>(GncDateTime(*time));
}
catch(std::invalid_argument)
{
return 0;
return 0;
}
}

Expand All @@ -259,12 +259,11 @@ gnc_time (time64 *tbuf)
gdouble
gnc_difftime (const time64 secs1, const time64 secs2)
{
return (double)secs1 - (double)secs2;
return (double)secs1 - (double)secs2;
}

/****************************************************************************/


const char*
gnc_date_dateformat_to_string(QofDateFormat format)
{
Expand Down Expand Up @@ -319,7 +318,6 @@ gnc_date_string_to_dateformat(const char* fmt_str, QofDateFormat *format)
return FALSE;
}


const char*
gnc_date_monthformat_to_string(GNCDateMonthFormat format)
{
Expand Down Expand Up @@ -411,7 +409,6 @@ timespec_normalize(Timespec *t)
return;
}


gboolean
timespec_equal (const Timespec *ta, const Timespec *tb)
{
Expand Down Expand Up @@ -738,14 +735,14 @@ floordiv(int a, int b)
Fully formatted UTC timestamp strings are converted separately.
param buff - pointer to date string
param day - will store day of the month as 1 ... 31
param month - will store month of the year as 1 ... 12
param year - will store the year (4-digit)
param buff - pointer to date string
param day - will store day of the month as 1 ... 31
param month - will store month of the year as 1 ... 12
param year - will store the year (4-digit)
return TRUE if date appeared to be valid.
return TRUE if date appeared to be valid.
Globals: global dateFormat value
Globals: global dateFormat value
*/
static gboolean
qof_scan_date_internal (const char *buff, int *day, int *month, int *year,
Expand Down Expand Up @@ -1045,7 +1042,6 @@ char dateSeparator (void)
}
break;
}

return '\0';
}

Expand Down Expand Up @@ -1179,7 +1175,6 @@ qof_strftime(gchar *buf, gsize max, const gchar *format, const struct tm *tm)
return retval;
}


/********************************************************************\
\********************************************************************/

Expand Down Expand Up @@ -1248,7 +1243,6 @@ gnc_timespec_to_iso8601_buff (Timespec ts, char * buff)
PWARN("Error processing time64 %" PRId64 ": %s", ts.tv_sec, err.what());
return buff;
}

}

void
Expand Down Expand Up @@ -1287,7 +1281,6 @@ gnc_dmy2timespec_internal (int day, int month, int year, DayPart day_part)
}
}


Timespec
gnc_dmy2timespec (int day, int month, int year)
{
Expand Down Expand Up @@ -1371,11 +1364,8 @@ gnc_gdate_set_time64 (GDate* gd, time64 time)
g_date_set_dmy (gd, tm.tm_mday,
static_cast<GDateMonth>(tm.tm_mon + 1),
tm.tm_year + 1900);

}



Timespec gdate_to_timespec (GDate d)
{
return gnc_dmy2timespec_neutral (g_date_get_day(&d),
Expand Down Expand Up @@ -1423,7 +1413,6 @@ gnc_time64_get_day_end (time64 time_val)
return new_time;
}


/* ======================================================== */

void
Expand Down Expand Up @@ -1500,7 +1489,6 @@ timespec_get_type( void )
timespec_boxed_copy_func,
timespec_boxed_free_func );
}

return type;
}

Expand Down

0 comments on commit b485206

Please sign in to comment.