mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Change tabs to spaces and remove some blank lines
This commit is contained in:
parent
047bc8d69b
commit
b485206378
@ -116,8 +116,8 @@ gnc_localtime (const time64 *secs)
|
|||||||
auto time = static_cast<struct tm*>(calloc(1, sizeof(struct tm)));
|
auto time = static_cast<struct tm*>(calloc(1, sizeof(struct tm)));
|
||||||
if (gnc_localtime_r (secs, time) == NULL)
|
if (gnc_localtime_r (secs, time) == NULL)
|
||||||
{
|
{
|
||||||
gnc_tm_free (time);
|
gnc_tm_free (time);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
@ -127,12 +127,12 @@ gnc_localtime_r (const time64 *secs, struct tm* time)
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
*time = static_cast<struct tm>(GncDateTime(*secs));
|
*time = static_cast<struct tm>(GncDateTime(*secs));
|
||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
catch(std::invalid_argument)
|
catch(std::invalid_argument)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,14 +199,14 @@ gnc_gmtime (const time64 *secs)
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
auto time = static_cast<struct tm*>(calloc(1, sizeof(struct tm)));
|
auto time = static_cast<struct tm*>(calloc(1, sizeof(struct tm)));
|
||||||
GncDateTime gncdt(*secs);
|
GncDateTime gncdt(*secs);
|
||||||
*time = gncdt.utc_tm();
|
*time = gncdt.utc_tm();
|
||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
catch(std::invalid_argument)
|
catch(std::invalid_argument)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -216,13 +216,13 @@ gnc_mktime (struct tm* time)
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
normalize_struct_tm (time);
|
normalize_struct_tm (time);
|
||||||
GncDateTime gncdt(*time);
|
GncDateTime gncdt(*time);
|
||||||
return static_cast<time64>(gncdt) - gncdt.offset();
|
return static_cast<time64>(gncdt) - gncdt.offset();
|
||||||
}
|
}
|
||||||
catch(std::invalid_argument)
|
catch(std::invalid_argument)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,12 +231,12 @@ gnc_timegm (struct tm* time)
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
normalize_struct_tm(time);
|
normalize_struct_tm(time);
|
||||||
return static_cast<time64>(GncDateTime(*time));
|
return static_cast<time64>(GncDateTime(*time));
|
||||||
}
|
}
|
||||||
catch(std::invalid_argument)
|
catch(std::invalid_argument)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,12 +259,11 @@ gnc_time (time64 *tbuf)
|
|||||||
gdouble
|
gdouble
|
||||||
gnc_difftime (const time64 secs1, const time64 secs2)
|
gnc_difftime (const time64 secs1, const time64 secs2)
|
||||||
{
|
{
|
||||||
return (double)secs1 - (double)secs2;
|
return (double)secs1 - (double)secs2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
const char*
|
const char*
|
||||||
gnc_date_dateformat_to_string(QofDateFormat format)
|
gnc_date_dateformat_to_string(QofDateFormat format)
|
||||||
{
|
{
|
||||||
@ -319,7 +318,6 @@ gnc_date_string_to_dateformat(const char* fmt_str, QofDateFormat *format)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const char*
|
const char*
|
||||||
gnc_date_monthformat_to_string(GNCDateMonthFormat format)
|
gnc_date_monthformat_to_string(GNCDateMonthFormat format)
|
||||||
{
|
{
|
||||||
@ -411,7 +409,6 @@ timespec_normalize(Timespec *t)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
timespec_equal (const Timespec *ta, const Timespec *tb)
|
timespec_equal (const Timespec *ta, const Timespec *tb)
|
||||||
{
|
{
|
||||||
@ -738,14 +735,14 @@ floordiv(int a, int b)
|
|||||||
|
|
||||||
Fully formatted UTC timestamp strings are converted separately.
|
Fully formatted UTC timestamp strings are converted separately.
|
||||||
|
|
||||||
param buff - pointer to date string
|
param buff - pointer to date string
|
||||||
param day - will store day of the month as 1 ... 31
|
param day - will store day of the month as 1 ... 31
|
||||||
param month - will store month of the year as 1 ... 12
|
param month - will store month of the year as 1 ... 12
|
||||||
param year - will store the year (4-digit)
|
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
|
static gboolean
|
||||||
qof_scan_date_internal (const char *buff, int *day, int *month, int *year,
|
qof_scan_date_internal (const char *buff, int *day, int *month, int *year,
|
||||||
@ -1045,7 +1042,6 @@ char dateSeparator (void)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return '\0';
|
return '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1179,7 +1175,6 @@ qof_strftime(gchar *buf, gsize max, const gchar *format, const struct tm *tm)
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************\
|
/********************************************************************\
|
||||||
\********************************************************************/
|
\********************************************************************/
|
||||||
|
|
||||||
@ -1248,7 +1243,6 @@ gnc_timespec_to_iso8601_buff (Timespec ts, char * buff)
|
|||||||
PWARN("Error processing time64 %" PRId64 ": %s", ts.tv_sec, err.what());
|
PWARN("Error processing time64 %" PRId64 ": %s", ts.tv_sec, err.what());
|
||||||
return buff;
|
return buff;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -1287,7 +1281,6 @@ gnc_dmy2timespec_internal (int day, int month, int year, DayPart day_part)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Timespec
|
Timespec
|
||||||
gnc_dmy2timespec (int day, int month, int year)
|
gnc_dmy2timespec (int day, int month, int year)
|
||||||
{
|
{
|
||||||
@ -1371,11 +1364,8 @@ gnc_gdate_set_time64 (GDate* gd, time64 time)
|
|||||||
g_date_set_dmy (gd, tm.tm_mday,
|
g_date_set_dmy (gd, tm.tm_mday,
|
||||||
static_cast<GDateMonth>(tm.tm_mon + 1),
|
static_cast<GDateMonth>(tm.tm_mon + 1),
|
||||||
tm.tm_year + 1900);
|
tm.tm_year + 1900);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Timespec gdate_to_timespec (GDate d)
|
Timespec gdate_to_timespec (GDate d)
|
||||||
{
|
{
|
||||||
return gnc_dmy2timespec_neutral (g_date_get_day(&d),
|
return gnc_dmy2timespec_neutral (g_date_get_day(&d),
|
||||||
@ -1423,7 +1413,6 @@ gnc_time64_get_day_end (time64 time_val)
|
|||||||
return new_time;
|
return new_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ======================================================== */
|
/* ======================================================== */
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -1500,7 +1489,6 @@ timespec_get_type( void )
|
|||||||
timespec_boxed_copy_func,
|
timespec_boxed_copy_func,
|
||||||
timespec_boxed_free_func );
|
timespec_boxed_free_func );
|
||||||
}
|
}
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user