Skip to content

Commit b485206

Browse files
committed
Change tabs to spaces and remove some blank lines
1 parent 047bc8d commit b485206

File tree

1 file changed

+24
-36
lines changed

1 file changed

+24
-36
lines changed

libgnucash/engine/gnc-date.cpp

Lines changed: 24 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ gnc_localtime (const time64 *secs)
116116
auto time = static_cast<struct tm*>(calloc(1, sizeof(struct tm)));
117117
if (gnc_localtime_r (secs, time) == NULL)
118118
{
119-
gnc_tm_free (time);
120-
return NULL;
119+
gnc_tm_free (time);
120+
return NULL;
121121
}
122122
return time;
123123
}
@@ -127,12 +127,12 @@ gnc_localtime_r (const time64 *secs, struct tm* time)
127127
{
128128
try
129129
{
130-
*time = static_cast<struct tm>(GncDateTime(*secs));
131-
return time;
130+
*time = static_cast<struct tm>(GncDateTime(*secs));
131+
return time;
132132
}
133133
catch(std::invalid_argument)
134134
{
135-
return NULL;
135+
return NULL;
136136
}
137137
}
138138

@@ -199,14 +199,14 @@ gnc_gmtime (const time64 *secs)
199199
{
200200
try
201201
{
202-
auto time = static_cast<struct tm*>(calloc(1, sizeof(struct tm)));
203-
GncDateTime gncdt(*secs);
204-
*time = gncdt.utc_tm();
205-
return time;
202+
auto time = static_cast<struct tm*>(calloc(1, sizeof(struct tm)));
203+
GncDateTime gncdt(*secs);
204+
*time = gncdt.utc_tm();
205+
return time;
206206
}
207207
catch(std::invalid_argument)
208208
{
209-
return NULL;
209+
return NULL;
210210
}
211211

212212
}
@@ -216,13 +216,13 @@ gnc_mktime (struct tm* time)
216216
{
217217
try
218218
{
219-
normalize_struct_tm (time);
220-
GncDateTime gncdt(*time);
221-
return static_cast<time64>(gncdt) - gncdt.offset();
219+
normalize_struct_tm (time);
220+
GncDateTime gncdt(*time);
221+
return static_cast<time64>(gncdt) - gncdt.offset();
222222
}
223223
catch(std::invalid_argument)
224224
{
225-
return 0;
225+
return 0;
226226
}
227227
}
228228

@@ -231,12 +231,12 @@ gnc_timegm (struct tm* time)
231231
{
232232
try
233233
{
234-
normalize_struct_tm(time);
235-
return static_cast<time64>(GncDateTime(*time));
234+
normalize_struct_tm(time);
235+
return static_cast<time64>(GncDateTime(*time));
236236
}
237237
catch(std::invalid_argument)
238238
{
239-
return 0;
239+
return 0;
240240
}
241241
}
242242

@@ -259,12 +259,11 @@ gnc_time (time64 *tbuf)
259259
gdouble
260260
gnc_difftime (const time64 secs1, const time64 secs2)
261261
{
262-
return (double)secs1 - (double)secs2;
262+
return (double)secs1 - (double)secs2;
263263
}
264264

265265
/****************************************************************************/
266266

267-
268267
const char*
269268
gnc_date_dateformat_to_string(QofDateFormat format)
270269
{
@@ -319,7 +318,6 @@ gnc_date_string_to_dateformat(const char* fmt_str, QofDateFormat *format)
319318
return FALSE;
320319
}
321320

322-
323321
const char*
324322
gnc_date_monthformat_to_string(GNCDateMonthFormat format)
325323
{
@@ -411,7 +409,6 @@ timespec_normalize(Timespec *t)
411409
return;
412410
}
413411

414-
415412
gboolean
416413
timespec_equal (const Timespec *ta, const Timespec *tb)
417414
{
@@ -738,14 +735,14 @@ floordiv(int a, int b)
738735
739736
Fully formatted UTC timestamp strings are converted separately.
740737
741-
param buff - pointer to date string
742-
param day - will store day of the month as 1 ... 31
743-
param month - will store month of the year as 1 ... 12
744-
param year - will store the year (4-digit)
738+
param buff - pointer to date string
739+
param day - will store day of the month as 1 ... 31
740+
param month - will store month of the year as 1 ... 12
741+
param year - will store the year (4-digit)
745742
746-
return TRUE if date appeared to be valid.
743+
return TRUE if date appeared to be valid.
747744
748-
Globals: global dateFormat value
745+
Globals: global dateFormat value
749746
*/
750747
static gboolean
751748
qof_scan_date_internal (const char *buff, int *day, int *month, int *year,
@@ -1045,7 +1042,6 @@ char dateSeparator (void)
10451042
}
10461043
break;
10471044
}
1048-
10491045
return '\0';
10501046
}
10511047

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

1182-
11831178
/********************************************************************\
11841179
\********************************************************************/
11851180

@@ -1248,7 +1243,6 @@ gnc_timespec_to_iso8601_buff (Timespec ts, char * buff)
12481243
PWARN("Error processing time64 %" PRId64 ": %s", ts.tv_sec, err.what());
12491244
return buff;
12501245
}
1251-
12521246
}
12531247

12541248
void
@@ -1287,7 +1281,6 @@ gnc_dmy2timespec_internal (int day, int month, int year, DayPart day_part)
12871281
}
12881282
}
12891283

1290-
12911284
Timespec
12921285
gnc_dmy2timespec (int day, int month, int year)
12931286
{
@@ -1371,11 +1364,8 @@ gnc_gdate_set_time64 (GDate* gd, time64 time)
13711364
g_date_set_dmy (gd, tm.tm_mday,
13721365
static_cast<GDateMonth>(tm.tm_mon + 1),
13731366
tm.tm_year + 1900);
1374-
13751367
}
13761368

1377-
1378-
13791369
Timespec gdate_to_timespec (GDate d)
13801370
{
13811371
return gnc_dmy2timespec_neutral (g_date_get_day(&d),
@@ -1423,7 +1413,6 @@ gnc_time64_get_day_end (time64 time_val)
14231413
return new_time;
14241414
}
14251415

1426-
14271416
/* ======================================================== */
14281417

14291418
void
@@ -1500,7 +1489,6 @@ timespec_get_type( void )
15001489
timespec_boxed_copy_func,
15011490
timespec_boxed_free_func );
15021491
}
1503-
15041492
return type;
15051493
}
15061494

0 commit comments

Comments
 (0)