* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/timezone/strftime.c,v 1.13 2008/02/19 12:06:35 mha Exp $
+ * $PostgreSQL: pgsql/src/timezone/strftime.c,v 1.14 2009/06/11 14:49:15 momjian Exp $
*/
#include "postgres.h"
static char *_conv(int, const char *, char *, const char *);
static char *_fmt(const char *, const struct pg_tm *, char *,
const char *, int *);
-static char * _yconv(const int, const int, const int, const int,
- char *, const char * const);
+static char *_yconv(const int, const int, const int, const int,
+ char *, const char *const);
#define IN_NONE 0
#define IN_SOME 1
{
*warnp = IN_ALL;
pt = _yconv(year, base, 0, 1,
- pt, ptlim);
+ pt, ptlim);
}
else
pt = _yconv(year, base, 1, 1,
- pt, ptlim);
+ pt, ptlim);
}
continue;
case 'v':
* with more only if necessary.
*/
static char *
-_yconv(const int a, const int b, const int convert_top,
- const int convert_yy, char *pt, const char * const ptlim)
+_yconv(const int a, const int b, const int convert_top,
+ const int convert_yy, char *pt, const char *const ptlim)
{
- int lead;
- int trail;
-
-#define DIVISOR 100
+ int lead;
+ int trail;
+
+#define DIVISOR 100
trail = a % DIVISOR + b % DIVISOR;
lead = a / DIVISOR + b / DIVISOR + trail / DIVISOR;
trail %= DIVISOR;
{
if (lead == 0 && trail < 0)
pt = _add("-0", pt, ptlim);
- else pt = _conv(lead, "%02d", pt, ptlim);
+ else
+ pt = _conv(lead, "%02d", pt, ptlim);
}
if (convert_yy)
pt = _conv(((trail < 0) ? -trail : trail), "%02d", pt, ptlim);
return pt;
}
-