From 3ac9d2fff321fa8f7996656b5a54a41461a0a84f Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 24 Jul 1997 20:19:10 +0000 Subject: [PATCH] Various compile errors concerning overflow due to shifts, unsigned, and bad prototypes, from Solaris, from Diab Jerius --- src/backend/catalog/pg_aggregate.c | 3 +- src/backend/optimizer/geqo/geqo_params.c | 3 +- src/backend/parser/catalog_utils.c | 3 +- src/backend/parser/parser.c | 4 +-- src/backend/rewrite/rewriteDefine.c | 4 +-- src/backend/storage/buffer/bufmgr.c | 3 +- src/backend/storage/ipc/sinvaladt.c | 9 +----- src/backend/storage/smgr/md.c | 3 +- src/backend/tcop/postgres.c | 5 +-- src/backend/tcop/utility.c | 5 ++- src/backend/utils/adt/acl.c | 3 +- src/backend/utils/adt/arrayfuncs.c | 6 ++-- src/backend/utils/adt/dt.c | 6 ++-- src/backend/utils/adt/filename.c | 4 +-- src/backend/utils/adt/oid.c | 6 +--- src/backend/utils/error/elog.c | 3 +- src/backend/utils/fmgr/dfmgr.c | 4 +-- src/backend/utils/init/postinit.c | 3 +- src/backend/utils/sort/psort.c | 3 +- src/include/regex/regex2.h | 40 ++++++++++++------------ src/template/sparc_solaris-cc | 2 +- 21 files changed, 51 insertions(+), 71 deletions(-) diff --git a/src/backend/catalog/pg_aggregate.c b/src/backend/catalog/pg_aggregate.c index 3e03110a72..13a3c48e9f 100644 --- a/src/backend/catalog/pg_aggregate.c +++ b/src/backend/catalog/pg_aggregate.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.4 1996/11/08 00:44:32 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.5 1997/07/24 20:11:47 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -269,7 +269,6 @@ AggNameGetInitVal(char *aggName, Oid basetype, int xfuncno, bool *isNull) Oid transtype; text *textInitVal; char *strInitVal, *initVal; - extern char *textout(); Assert(PointerIsValid(aggName)); Assert(PointerIsValid(isNull)); diff --git a/src/backend/optimizer/geqo/geqo_params.c b/src/backend/optimizer/geqo/geqo_params.c index 26d5def923..2e759996ee 100644 --- a/src/backend/optimizer/geqo/geqo_params.c +++ b/src/backend/optimizer/geqo/geqo_params.c @@ -5,7 +5,7 @@ * * Copyright (c) 1994, Regents of the University of California * -* $Id: geqo_params.c,v 1.2 1997/02/19 14:52:04 scrappy Exp $ +* $Id: geqo_params.c,v 1.3 1997/07/24 20:12:15 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -22,6 +22,7 @@ #include #include #include +#include #include "postgres.h" #include "miscadmin.h" diff --git a/src/backend/parser/catalog_utils.c b/src/backend/parser/catalog_utils.c index e848b75e59..3407e2e0ae 100644 --- a/src/backend/parser/catalog_utils.c +++ b/src/backend/parser/catalog_utils.c @@ -6,7 +6,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.18 1997/05/22 00:14:41 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.19 1997/07/24 20:13:01 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1477,7 +1477,6 @@ op_error(char *op, Oid arg1, Oid arg2) void func_error(char *caller, char *funcname, int nargs, Oid *argtypes) { - Type get_id_type(); char p[(NAMEDATALEN+2)*MAXFMGRARGS], *ptr; int i; diff --git a/src/backend/parser/parser.c b/src/backend/parser/parser.c index 66d6624f59..865e3db879 100644 --- a/src/backend/parser/parser.c +++ b/src/backend/parser/parser.c @@ -6,7 +6,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.18 1997/02/14 04:15:49 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.19 1997/07/24 20:13:21 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -447,7 +447,7 @@ ParseAgg(char *aggname, Oid basetype, Node *target) vartype = ((Expr*)target)->typeOid; if (basetype != vartype) { - Type tp1, tp2, get_id_type(); + Type tp1, tp2; tp1 = get_id_type(basetype); tp2 = get_id_type(vartype); diff --git a/src/backend/rewrite/rewriteDefine.c b/src/backend/rewrite/rewriteDefine.c index a7b6ebbc79..a9383fe53d 100644 --- a/src/backend/rewrite/rewriteDefine.c +++ b/src/backend/rewrite/rewriteDefine.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.2 1996/11/10 03:01:55 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.3 1997/07/24 20:13:33 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -192,8 +192,6 @@ DefineQueryRewrite(RuleStmt *stmt) Oid event_attype = 0; char *actionP, *event_qualP; - extern Oid att_typeid(); - if (event_obj->attrs) eslot_string = strVal(lfirst(event_obj->attrs)); else diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 85a812d80a..452aae878b 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.13 1997/04/18 08:30:08 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.14 1997/07/24 20:13:48 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1131,7 +1131,6 @@ BufferPoolCheckLeak() { register int i; int error = 0; - void PrintBufferDescs(); for (i = 1; i <= NBuffers; i++) { if (BufferIsValid(i)) { diff --git a/src/backend/storage/ipc/sinvaladt.c b/src/backend/storage/ipc/sinvaladt.c index 3c801729a2..d1443e04c7 100644 --- a/src/backend/storage/ipc/sinvaladt.c +++ b/src/backend/storage/ipc/sinvaladt.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.3 1996/11/06 06:49:10 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.4 1997/07/24 20:14:15 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -481,12 +481,6 @@ SISetDataEntry(SISeg *segP, SharedInvalidData *data) { Offset offsetToNewData; SISegEntry *eP, *lastP; - bool SISegFull(); - Offset SIEntryOffset(); - Offset SIGetStartFreeSpace(); - SISegEntry *SIGetFirstDataEntry(); - SISegEntry *SIGetNextDataEntry(); - SISegEntry *SIGetLastDataEntry(); if (!SIIncNumEntries(segP, 1)) return(false); /* no space */ @@ -542,7 +536,6 @@ bool SIDelDataEntry(SISeg *segP) { SISegEntry *e1P; - SISegEntry *SIGetFirstDataEntry(); if (!SIDecNumEntries(segP, 1)) { /* no entries in buffer */ diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c index c7dabb3cc3..a0d648bf68 100644 --- a/src/backend/storage/smgr/md.c +++ b/src/backend/storage/smgr/md.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.13 1997/05/22 17:08:33 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.14 1997/07/24 20:14:41 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -114,7 +114,6 @@ mdcreate(Relation reln) { int fd, vfd; char *path; - extern bool IsBootstrapProcessingMode(); path = relpath(&(reln->rd_rel->relname.data[0])); fd = FileNameOpenFile(path, O_RDWR|O_CREAT|O_EXCL, 0600); diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index a1f3638d50..57262eada5 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.33 1997/04/24 03:39:09 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.34 1997/07/24 20:15:03 momjian Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -54,6 +54,7 @@ #include "executor/execdebug.h" #include "executor/executor.h" #include "nodes/relation.h" +#include "nodes/print.h" #include "optimizer/cost.h" #include "optimizer/planner.h" @@ -1270,7 +1271,7 @@ PostgresMain(int argc, char *argv[]) */ if (IsUnderPostmaster == false) { puts("\nPOSTGRES backend interactive interface"); - puts("$Revision: 1.33 $ $Date: 1997/04/24 03:39:09 $"); + puts("$Revision: 1.34 $ $Date: 1997/07/24 20:15:03 $"); } /* ---------------- diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index fc5b09b4a1..e71214c5c6 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.17 1997/05/22 00:15:36 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.18 1997/07/24 20:15:18 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -476,7 +476,6 @@ ProcessUtility(Node *parsetree, { char *viewName = stmt->name; char *ruleName; - extern char *RewriteGetRuleEventRel(); #ifndef NO_SECURITY @@ -587,7 +586,7 @@ ProcessUtility(Node *parsetree, case T_LoadStmt: { LoadStmt *stmt = (LoadStmt *)parsetree; - FILE *fp, *fopen(); + FILE *fp; char *filename; commandTag = "LOAD"; diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c index fed00fa85b..908fc038b4 100644 --- a/src/backend/utils/adt/acl.c +++ b/src/backend/utils/adt/acl.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.9 1997/07/10 02:27:27 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.10 1997/07/24 20:15:36 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -86,7 +86,6 @@ aclparse(char *s, AclItem *aip, unsigned *modechg) { HeapTuple htp; char name[NAMEDATALEN+1]; - extern AclId get_grosysid(); Assert(s && aip && modechg); diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c index 34a379e7e3..a024bc5a54 100644 --- a/src/backend/utils/adt/arrayfuncs.c +++ b/src/backend/utils/adt/arrayfuncs.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.10 1996/11/08 05:59:38 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.11 1997/07/24 20:15:45 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1203,7 +1203,7 @@ _ArrayRange(int st[], int n, *dim, *lb, st_pos, prod[MAXDIM]; int span[MAXDIM], dist[MAXDIM], indx[MAXDIM]; int i, j, inc; - char *srcPtr, *array_seek(); + char *srcPtr; n = ARR_NDIM(array); dim = ARR_DIMS(array); lb = ARR_LBOUND(array); srcPtr = ARR_DATA_PTR(array); @@ -1232,7 +1232,7 @@ _ArrayClipCount(int stI[], int endpI[], ArrayType *array) int span[MAXDIM], dist[MAXDIM], indx[MAXDIM]; int i, j, inc, st[MAXDIM], endp[MAXDIM]; int count = 0; - char *ptr, *array_seek(); + char *ptr; n = ARR_NDIM(array); dim = ARR_DIMS(array); lb = ARR_LBOUND(array); ptr = ARR_DATA_PTR(array); diff --git a/src/backend/utils/adt/dt.c b/src/backend/utils/adt/dt.c index 4067dc2f82..4c45d85753 100644 --- a/src/backend/utils/adt/dt.c +++ b/src/backend/utils/adt/dt.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.28 1997/07/08 22:06:36 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.29 1997/07/24 20:15:53 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1703,8 +1703,8 @@ printf( "datetime_zone- zone %s type=%d value=%d\n", lowzone, type, val); *****************************************************************************/ /* definitions for squeezing values into "value" */ -#define ABS_SIGNBIT 0200 -#define VALMASK 0177 +#define ABS_SIGNBIT (char) 0200 +#define VALMASK (char) 0177 #define NEG(n) ((n)|ABS_SIGNBIT) #define SIGNEDCHAR(c) ((c)&ABS_SIGNBIT? -((c)&VALMASK): (c)) #define FROMVAL(tp) (-SIGNEDCHAR((tp)->value) * 10) /* uncompress */ diff --git a/src/backend/utils/adt/filename.c b/src/backend/utils/adt/filename.c index fe4e78c3f9..4d43b2d1ab 100644 --- a/src/backend/utils/adt/filename.c +++ b/src/backend/utils/adt/filename.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/filename.c,v 1.6 1997/02/14 04:17:47 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/filename.c,v 1.7 1997/07/24 20:16:11 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -25,7 +25,7 @@ char * filename_in(char *file) { - char *str, *getenv(); + char *str; int ind = 0; /* diff --git a/src/backend/utils/adt/oid.c b/src/backend/utils/adt/oid.c index 2154da090e..a89edac79b 100644 --- a/src/backend/utils/adt/oid.c +++ b/src/backend/utils/adt/oid.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.6 1997/03/14 23:20:52 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.7 1997/07/24 20:16:17 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -84,15 +84,11 @@ char *oid8out(Oid (*oidArray)[]) Oid oidin(char *s) { - extern int32 int4in(); - return(int4in(s)); } char *oidout(Oid o) { - extern char *int4out(); - return(int4out(o)); } diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c index 8ea3b3ce6f..c039e00102 100644 --- a/src/backend/utils/error/elog.c +++ b/src/backend/utils/error/elog.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.15 1997/03/18 21:40:39 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.16 1997/07/24 20:16:32 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -50,7 +50,6 @@ elog(int lev, const char *fmt, ... ) #ifndef PG_STANDALONE extern FILE *Pfout; #endif /* !PG_STANDALONE */ - time_t time(); #ifdef ELOG_TIMESTAMPS time_t tim; #endif diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c index 9db2d49a9f..df34b38959 100644 --- a/src/backend/utils/fmgr/dfmgr.c +++ b/src/backend/utils/fmgr/dfmgr.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.6 1997/02/14 04:18:02 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.7 1997/07/24 20:16:59 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -53,7 +53,7 @@ fmgr_dynamic(Oid procedureId, int *pronargs) Form_pg_proc procedureStruct; char *proname; char *probinattr, *probinstring; - func_ptr user_fn, handle_load(); + func_ptr user_fn; Relation rdesc; bool isnull; diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c index 9dbfcd6f11..7ed1b7f94f 100644 --- a/src/backend/utils/init/postinit.c +++ b/src/backend/utils/init/postinit.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.8 1997/02/14 04:18:20 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.9 1997/07/24 20:17:34 momjian Exp $ * * NOTES * InitPostgres() is the function called from PostgresMain @@ -354,7 +354,6 @@ InitUserid() void InitCommunication() { - char *getenv(); /* XXX style */ char *postid; char *postport; IPCKey key = 0; diff --git a/src/backend/utils/sort/psort.c b/src/backend/utils/sort/psort.c index 613fbff23d..7005666ce3 100644 --- a/src/backend/utils/sort/psort.c +++ b/src/backend/utils/sort/psort.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.4 1997/05/20 11:35:50 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.5 1997/07/24 20:18:07 momjian Exp $ * * NOTES * Sorts the first relation into the second relation. The sort may @@ -525,7 +525,6 @@ gettape() register struct tapelst *tp; FILE *file; static int tapeinit = 0; - char *mktemp(); tp = (struct tapelst *)palloc((unsigned)sizeof (struct tapelst)); if (!tapeinit) { diff --git a/src/include/regex/regex2.h b/src/include/regex/regex2.h index 0261b535d0..34d3f63663 100644 --- a/src/include/regex/regex2.h +++ b/src/include/regex/regex2.h @@ -87,26 +87,26 @@ typedef long sopno; #define SOP(op, opnd) ((op)|(opnd)) /* operators meaning operand */ /* (back, fwd are offsets) */ -#define OEND (1<