diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c index 5d4f6de..7c857df 100644 --- a/src/backend/utils/adt/datetime.c +++ b/src/backend/utils/adt/datetime.c @@ -3523,7 +3523,7 @@ EncodeTimeOnly(struct pg_tm * tm, fsec_t fsec, int *tzp, int style, char *str) * should be equal to the larger of MAX_TIME_PRECISION and * MAX_TIMESTAMP_PRECISION. */ - AppendSeconds(str+strlen(str), tm->tm_sec, fsec, true); + AppendSeconds(str + strlen(str), tm->tm_sec, fsec, true); if (tzp != NULL) EncodeTimezone(str, *tzp, style); @@ -3579,9 +3579,10 @@ EncodeDateTime(struct pg_tm * tm, fsec_t fsec, int *tzp, char **tzn, int style, * since it's unlikely there's any precision left ... */ #ifdef HAVE_INT64_TIMESTAMP - if (tm->tm_year <= 0) fsec = 0; + if (tm->tm_year <= 0) + fsec = 0; #endif - AppendSeconds(str+strlen(str), tm->tm_sec, fsec, true); + AppendSeconds(str + strlen(str), tm->tm_sec, fsec, true); /* * tzp == NULL indicates that we don't want *any* time zone info @@ -3616,9 +3617,10 @@ EncodeDateTime(struct pg_tm * tm, fsec_t fsec, int *tzp, char **tzn, int style, * since it's unlikely there's any precision left ... */ #ifdef HAVE_INT64_TIMESTAMP - if (tm->tm_year <= 0) fsec = 0; + if (tm->tm_year <= 0) + fsec = 0; #endif - AppendSeconds(str+strlen(str), tm->tm_sec, fsec, true); + AppendSeconds(str + strlen(str), tm->tm_sec, fsec, true); if (tzp != NULL && tm->tm_isdst >= 0) { @@ -3649,9 +3651,10 @@ EncodeDateTime(struct pg_tm * tm, fsec_t fsec, int *tzp, char **tzn, int style, * since it's unlikely there's any precision left ... */ #ifdef HAVE_INT64_TIMESTAMP - if (tm->tm_year <= 0) fsec = 0; + if (tm->tm_year <= 0) + fsec = 0; #endif - AppendSeconds(str+strlen(str), tm->tm_sec, fsec, true); + AppendSeconds(str + strlen(str), tm->tm_sec, fsec, true); if (tzp != NULL && tm->tm_isdst >= 0) { @@ -3690,9 +3693,10 @@ EncodeDateTime(struct pg_tm * tm, fsec_t fsec, int *tzp, char **tzn, int style, * since it's unlikely there's any precision left ... */ #ifdef HAVE_INT64_TIMESTAMP - if (tm->tm_year <= 0) fsec = 0; + if (tm->tm_year <= 0) + fsec = 0; #endif - AppendSeconds(str+strlen(str), tm->tm_sec, fsec, true); + AppendSeconds(str + strlen(str), tm->tm_sec, fsec, true); sprintf(str + strlen(str), " %04d", (tm->tm_year > 0) ? tm->tm_year : -(tm->tm_year - 1)); @@ -3730,14 +3734,15 @@ EncodeDateTime(struct pg_tm * tm, fsec_t fsec, int *tzp, char **tzn, int style, static char * AddVerboseIntPart(char * cp, int value, char *units, - bool * is_zero, bool *is_before) + bool * is_zero, bool *is_before) { - if (value==0) return cp; + if (value == 0) + return cp; cp += sprintf(cp, " "); if (*is_zero) *is_before = (value < 0); *is_zero = FALSE; - if ( (value < 0) ^ (*is_before) ) + if ((value < 0) ^ (*is_before)) cp += sprintf(cp, "-"); value = abs(value); cp += sprintf(cp, "%d %s%s", value, units, (value == 1) ? "" : "s"); @@ -3746,9 +3751,10 @@ AddVerboseIntPart(char * cp, int value, char *units, static char * AddPostgresIntPart(char * cp, int value, char *units, - bool * is_zero, bool *is_before) + bool * is_zero, bool *is_before) { - if (value==0) return cp; + if (value == 0) + return cp; cp += sprintf(cp, "%s%s%d %s%s", (!*is_zero) ? " " : "", (*is_before && value > 0) ? "+" : "", @@ -3936,9 +3942,9 @@ EncodeInterval(struct pg_tm * tm, fsec_t fsec, int style, char *str) { int minus = (hour < 0 || min < 0 || sec < 0 || fsec < 0); cp += sprintf(cp, "%s%s%02d:%02d:", - is_zero ? "" : " ", - minus ? "-" : is_before ? "+" : "", - abs(hour), abs(min)); + is_zero ? "" : " ", + minus ? "-" : is_before ? "+" : "", + abs(hour), abs(min)); AppendSeconds(cp, sec, fsec, true); } break;