Skip to content

Commit 3896f48

Browse files
committed
Fix some minor portability issues, per Chris K-L.
1 parent 30f665d commit 3896f48

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

contrib/pgbench/pgbench.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $Header: /cvsroot/pgsql/contrib/pgbench/pgbench.c,v 1.24 2003/06/10 09:07:15 ishii Exp $
2+
* $Header: /cvsroot/pgsql/contrib/pgbench/pgbench.c,v 1.25 2003/08/01 02:21:17 tgl Exp $
33
*
44
* pgbench: a simple TPC-B like benchmark program for PostgreSQL
55
* written by Tatsuo Ishii
@@ -41,6 +41,10 @@
4141
#include <sys/resource.h>
4242
#endif /* ! WIN32 */
4343

44+
extern char *optarg;
45+
extern int optind;
46+
47+
4448
/********************************************************************
4549
* some configurable parameters */
4650

@@ -661,10 +665,6 @@ printResults(
661665
int
662666
main(int argc, char **argv)
663667
{
664-
extern char *optarg;
665-
extern int optind,
666-
opterr,
667-
optopt;
668668
int c;
669669
int is_init_mode = 0; /* initialize mode? */
670670
int is_no_vacuum = 0; /* no vacuum at all before

contrib/pgstattuple/pgstattuple.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $Header: /cvsroot/pgsql/contrib/pgstattuple/pgstattuple.c,v 1.10 2003/06/12 08:02:53 momjian Exp $
2+
* $Header: /cvsroot/pgsql/contrib/pgstattuple/pgstattuple.c,v 1.11 2003/08/01 02:21:17 tgl Exp $
33
*
44
* Copyright (c) 2001,2002 Tatsuo Ishii
55
*
@@ -200,14 +200,14 @@ pgstattuple_real(Relation rel)
200200
for (i = 0; i < NCOLUMNS; i++)
201201
values[i] = (char *) palloc(NCHARS * sizeof(char));
202202
i = 0;
203-
snprintf(values[i++], NCHARS, "%lld", table_len);
204-
snprintf(values[i++], NCHARS, "%lld", tuple_count);
205-
snprintf(values[i++], NCHARS, "%lld", tuple_len);
203+
snprintf(values[i++], NCHARS, INT64_FORMAT, table_len);
204+
snprintf(values[i++], NCHARS, INT64_FORMAT, tuple_count);
205+
snprintf(values[i++], NCHARS, INT64_FORMAT, tuple_len);
206206
snprintf(values[i++], NCHARS, "%.2f", tuple_percent);
207-
snprintf(values[i++], NCHARS, "%lld", dead_tuple_count);
208-
snprintf(values[i++], NCHARS, "%lld", dead_tuple_len);
207+
snprintf(values[i++], NCHARS, INT64_FORMAT, dead_tuple_count);
208+
snprintf(values[i++], NCHARS, INT64_FORMAT, dead_tuple_len);
209209
snprintf(values[i++], NCHARS, "%.2f", dead_tuple_percent);
210-
snprintf(values[i++], NCHARS, "%lld", free_space);
210+
snprintf(values[i++], NCHARS, INT64_FORMAT, free_space);
211211
snprintf(values[i++], NCHARS, "%.2f", free_percent);
212212

213213
/* build a tuple */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy