Commit 22f03030 authored by Bruce Momjian's avatar Bruce Momjian

Fix compile of entab to use stdarg.h. Clean up includes.

Marko Kreen
parent a4374f90
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.147 2005/05/26 15:26:00 momjian Exp $ * $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.148 2005/05/27 15:15:23 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -3461,12 +3461,9 @@ EncodeTimeOnly(struct pg_tm * tm, fsec_t fsec, int *tzp, int style, char *str) ...@@ -3461,12 +3461,9 @@ EncodeTimeOnly(struct pg_tm * tm, fsec_t fsec, int *tzp, int style, char *str)
#ifdef HAVE_INT64_TIMESTAMP #ifdef HAVE_INT64_TIMESTAMP
sprintf(str + strlen(str), ":%02d.%06d", tm->tm_sec, fsec); sprintf(str + strlen(str), ":%02d.%06d", tm->tm_sec, fsec);
#else #else
sprintf(str + strlen(str), ":%013.10f", tm->tm_sec + fsec); sprintf(str + strlen(str), ":%012.9f", tm->tm_sec + fsec);
#endif #endif
/* chop off trailing pairs of zeros... */ TrimTrailingZeros(str);
while (strcmp((str + strlen(str) - 2), "00") == 0 &&
*(str + strlen(str) - 3) != '.')
*(str + strlen(str) - 2) = '\0';
} }
else else
sprintf(str + strlen(str), ":%02d", tm->tm_sec); sprintf(str + strlen(str), ":%02d", tm->tm_sec);
...@@ -3804,7 +3801,7 @@ EncodeInterval(struct pg_tm * tm, fsec_t fsec, int style, char *str) ...@@ -3804,7 +3801,7 @@ EncodeInterval(struct pg_tm * tm, fsec_t fsec, int style, char *str)
sprintf(cp, ".%06d", Abs(fsec)); sprintf(cp, ".%06d", Abs(fsec));
#else #else
fsec += tm->tm_sec; fsec += tm->tm_sec;
sprintf(cp, ":%013.10f", fabs(fsec)); sprintf(cp, ":%012.9f", fabs(fsec));
#endif #endif
TrimTrailingZeros(cp); TrimTrailingZeros(cp);
cp += strlen(cp); cp += strlen(cp);
......
...@@ -511,7 +511,7 @@ EncodeInterval(struct tm * tm, fsec_t fsec, int style, char *str) ...@@ -511,7 +511,7 @@ EncodeInterval(struct tm * tm, fsec_t fsec, int style, char *str)
sprintf(cp, ".%06d", Abs(fsec)); sprintf(cp, ".%06d", Abs(fsec));
#else #else
fsec += tm->tm_sec; fsec += tm->tm_sec;
sprintf(cp, ":%013.10f", fabs(fsec)); sprintf(cp, ":%012.9f", fabs(fsec));
#endif #endif
TrimTrailingZeros(cp); TrimTrailingZeros(cp);
cp += strlen(cp); cp += strlen(cp);
......
...@@ -205,62 +205,62 @@ SET DateStyle = 'ISO'; ...@@ -205,62 +205,62 @@ SET DateStyle = 'ISO';
-- As of 7.4, allow time without time zone having a time zone specified -- As of 7.4, allow time without time zone having a time zone specified
SELECT time without time zone '040506.789+08'; SELECT time without time zone '040506.789+08';
time time
--------------- --------------
04:05:06.7890 04:05:06.789
(1 row) (1 row)
SELECT time without time zone '040506.789-08'; SELECT time without time zone '040506.789-08';
time time
--------------- --------------
04:05:06.7890 04:05:06.789
(1 row) (1 row)
SELECT time without time zone 'T040506.789+08'; SELECT time without time zone 'T040506.789+08';
time time
--------------- --------------
04:05:06.7890 04:05:06.789
(1 row) (1 row)
SELECT time without time zone 'T040506.789-08'; SELECT time without time zone 'T040506.789-08';
time time
--------------- --------------
04:05:06.7890 04:05:06.789
(1 row) (1 row)
SELECT time with time zone '040506.789+08'; SELECT time with time zone '040506.789+08';
timetz timetz
------------------ -----------------
04:05:06.7890+08 04:05:06.789+08
(1 row) (1 row)
SELECT time with time zone '040506.789-08'; SELECT time with time zone '040506.789-08';
timetz timetz
------------------ -----------------
04:05:06.7890-08 04:05:06.789-08
(1 row) (1 row)
SELECT time with time zone 'T040506.789+08'; SELECT time with time zone 'T040506.789+08';
timetz timetz
------------------ -----------------
04:05:06.7890+08 04:05:06.789+08
(1 row) (1 row)
SELECT time with time zone 'T040506.789-08'; SELECT time with time zone 'T040506.789-08';
timetz timetz
------------------ -----------------
04:05:06.7890-08 04:05:06.789-08
(1 row) (1 row)
SELECT time with time zone 'T040506.789 +08'; SELECT time with time zone 'T040506.789 +08';
timetz timetz
------------------ -----------------
04:05:06.7890+08 04:05:06.789+08
(1 row) (1 row)
SELECT time with time zone 'T040506.789 -08'; SELECT time with time zone 'T040506.789 -08';
timetz timetz
------------------ -----------------
04:05:06.7890-08 04:05:06.789-08
(1 row) (1 row)
SET DateStyle = 'Postgres, MDY'; SET DateStyle = 'Postgres, MDY';
......
...@@ -11,8 +11,13 @@ ...@@ -11,8 +11,13 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdarg.h>
#include "../../include/c.h" #if defined(WIN32) || defined(__CYGWIN__)
#define PG_BINARY_R "rb"
#else
#define PG_BINARY_R "r"
#endif
#define NUL '\0' #define NUL '\0'
...@@ -29,9 +34,7 @@ extern char *optarg; ...@@ -29,9 +34,7 @@ extern char *optarg;
extern int optind; extern int optind;
int int
main(argc, argv) main(int argc, char **argv)
int argc;
char **argv;
{ {
int tab_size = 8, int tab_size = 8,
min_spaces = 2, min_spaces = 2,
......
...@@ -19,15 +19,13 @@ ...@@ -19,15 +19,13 @@
/*VARARGS*/ /*VARARGS*/
void void
halt(const char *path, ...) halt(const char *format, ...)
{ {
va_list arg_ptr; va_list arg_ptr;
char *format, const char *pstr;
*pstr;
void (*sig_func) (); void (*sig_func) ();
va_start(arg_ptr, path); va_start(arg_ptr, format);
format = va_arg(arg_ptr, char *);
if (strncmp(format, "PERROR", 6) != 0) if (strncmp(format, "PERROR", 6) != 0)
vfprintf(stderr, format, arg_ptr); vfprintf(stderr, format, arg_ptr);
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment