summaryrefslogtreecommitdiff
path: root/nsprpub/pr/tests/parsetm.c
diff options
context:
space:
mode:
Diffstat (limited to 'nsprpub/pr/tests/parsetm.c')
-rw-r--r--nsprpub/pr/tests/parsetm.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/nsprpub/pr/tests/parsetm.c b/nsprpub/pr/tests/parsetm.c
index be1fc49132..0e25ffe68d 100644
--- a/nsprpub/pr/tests/parsetm.c
+++ b/nsprpub/pr/tests/parsetm.c
@@ -19,10 +19,11 @@
PRBool debug_mode = PR_TRUE;
static char *dayOfWeek[] =
- { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "???" };
+{ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "???" };
static char *month[] =
- { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "???" };
+{ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "???"
+};
static void PrintExplodedTime(const PRExplodedTime *et) {
PRInt32 totalOffset;
@@ -31,27 +32,32 @@ static void PrintExplodedTime(const PRExplodedTime *et) {
/* Print day of the week, month, day, hour, minute, and second */
if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ",
- dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
- et->tm_hour, et->tm_min, et->tm_sec);
+ dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
+ et->tm_hour, et->tm_min, et->tm_sec);
/* Print time zone */
totalOffset = et->tm_params.tp_gmt_offset + et->tm_params.tp_dst_offset;
if (totalOffset == 0) {
- if (debug_mode) printf("UTC ");
+ if (debug_mode) {
+ printf("UTC ");
+ }
} else {
sign = "+";
if (totalOffset < 0) {
- totalOffset = -totalOffset;
- sign = "-";
+ totalOffset = -totalOffset;
+ sign = "-";
}
hourOffset = totalOffset / 3600;
minOffset = (totalOffset % 3600) / 60;
- if (debug_mode)
+ if (debug_mode) {
printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
+ }
}
/* Print year */
- if (debug_mode) printf("%hd", et->tm_year);
+ if (debug_mode) {
+ printf("%hd", et->tm_year);
+ }
}
int main(int argc, char **argv)