diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c index 469a5ba252..998ce5a457 100644 --- a/src/backend/access/common/heaptuple.c +++ b/src/backend/access/common/heaptuple.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.59 1999/12/16 22:19:34 wieck Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.60 2000/01/15 02:59:17 petere Exp $ * * NOTES * The old interface functions have been converted to macros @@ -136,8 +136,9 @@ DataFill(char *data, *((int32 *) value[i])); break; default: - memmove(data, DatumGetPointer(value[i]), - att[i]->attlen); + Assert(att[i]->attlen >= 0); + memmove(data, DatumGetPointer(value[i]), + (size_t)(att[i]->attlen)); break; } data = (char *) att_addlength((long) data, att[i]->attlen, value[i]); @@ -324,8 +325,8 @@ nocachegetattr(HeapTuple tuple, Form_pg_attribute *att = tupleDesc->attrs; int slow = 0; /* do we have to walk nulls? */ - -#if IN_MACRO + (void)isnull; /*not used*/ +#ifdef IN_MACRO /* This is handled in the macro */ Assert(attnum > 0); @@ -346,7 +347,7 @@ nocachegetattr(HeapTuple tuple, if (HeapTupleNoNulls(tuple)) { -#if IN_MACRO +#ifdef IN_MACRO /* This is handled in the macro */ if (att[attnum]->attcacheoff != -1) { @@ -376,7 +377,7 @@ nocachegetattr(HeapTuple tuple, * ---------------- */ -#if IN_MACRO +#ifdef IN_MACRO /* This is handled in the macro */ if (att_isnull(attnum, bp)) { @@ -565,7 +566,7 @@ heap_copytuple(HeapTuple tuple) newTuple->t_datamcxt = CurrentMemoryContext; newTuple->t_data = (HeapTupleHeader) ((char *) newTuple + HEAPTUPLESIZE); memmove((char *) newTuple->t_data, - (char *) tuple->t_data, (int) tuple->t_len); + (char *) tuple->t_data, tuple->t_len); return newTuple; } @@ -589,7 +590,7 @@ heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest) dest->t_datamcxt = CurrentMemoryContext; dest->t_data = (HeapTupleHeader) palloc(src->t_len); memmove((char *) dest->t_data, - (char *) src->t_data, (int) src->t_len); + (char *) src->t_data, src->t_len); return; } @@ -655,7 +656,7 @@ heap_formtuple(TupleDesc tupleDescriptor, HeapTuple tuple; /* return tuple */ HeapTupleHeader td; /* tuple data */ int bitmaplen; - long len; + unsigned long len; int hoff; bool hasnull = false; int i; @@ -687,7 +688,7 @@ heap_formtuple(TupleDesc tupleDescriptor, tuple->t_datamcxt = CurrentMemoryContext; td = tuple->t_data = (HeapTupleHeader) ((char *) tuple + HEAPTUPLESIZE); - MemSet((char *) td, 0, (int) len); + MemSet((char *) td, 0, len); tuple->t_len = len; ItemPointerSetInvalid(&(tuple->t_self)); @@ -803,8 +804,6 @@ heap_modifytuple(HeapTuple tuple, void heap_freetuple(HeapTuple htup) { - extern int getpid(); - if (htup->t_data != NULL) if (htup->t_datamcxt != NULL && (char *)(htup->t_data) != ((char *) htup + HEAPTUPLESIZE)) @@ -828,7 +827,7 @@ heap_addheader(uint32 natts, /* max domain index */ { HeapTuple tuple; HeapTupleHeader td; /* tuple data */ - long len; + unsigned long len; int hoff; AssertArg(natts > 0); @@ -841,7 +840,7 @@ heap_addheader(uint32 natts, /* max domain index */ tuple->t_datamcxt = CurrentMemoryContext; td = tuple->t_data = (HeapTupleHeader) ((char *) tuple + HEAPTUPLESIZE); - MemSet((char *) td, 0, (int) len); + MemSet((char *) td, 0, len); tuple->t_len = len; ItemPointerSetInvalid(&(tuple->t_self)); @@ -850,7 +849,8 @@ heap_addheader(uint32 natts, /* max domain index */ td->t_infomask = 0; td->t_infomask |= HEAP_XMAX_INVALID; - memmove((char *) td + hoff, structure, structlen); + if (structlen > 0) + memmove((char *) td + hoff, structure, (size_t)structlen); return tuple; } diff --git a/src/backend/access/common/indextuple.c b/src/backend/access/common/indextuple.c index 9a096e8930..694aeca33f 100644 --- a/src/backend/access/common/indextuple.c +++ b/src/backend/access/common/indextuple.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.40 2000/01/11 03:33:11 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.41 2000/01/15 02:59:17 petere Exp $ * *------------------------------------------------------------------------- */ @@ -63,7 +63,7 @@ index_formtuple(TupleDesc tupleDescriptor, tp = (char *) palloc(size); tuple = (IndexTuple) tp; - MemSet(tp, 0, (int) size); + MemSet(tp, 0, size); DataFill((char *) tp + hoff, tupleDescriptor, @@ -133,6 +133,7 @@ nocache_index_getattr(IndexTuple tup, int data_off; /* tuple data offset */ Form_pg_attribute *att = tupleDesc->attrs; + (void)isnull; /* ---------------- * sanity checks * ---------------- diff --git a/src/backend/access/gist/gistscan.c b/src/backend/access/gist/gistscan.c index e7a864985a..a7d1faf43d 100644 --- a/src/backend/access/gist/gistscan.c +++ b/src/backend/access/gist/gistscan.c @@ -266,7 +266,7 @@ gistdropscan(IndexScanDesc s) prev = l; if (l == (GISTScanList) NULL) - elog(ERROR, "GiST scan list corrupted -- cannot find 0x%lx", s); + elog(ERROR, "GiST scan list corrupted -- cannot find 0x%p", (void*)s); if (prev == (GISTScanList) NULL) GISTScans = l->gsl_next; diff --git a/src/backend/access/hash/hashscan.c b/src/backend/access/hash/hashscan.c index d3bd838bc1..7e7b38c90c 100644 --- a/src/backend/access/hash/hashscan.c +++ b/src/backend/access/hash/hashscan.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.20 1999/07/15 23:02:55 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.21 2000/01/15 02:59:19 petere Exp $ * * NOTES * Because we can be doing an index scan on a relation while we @@ -74,7 +74,7 @@ _hash_dropscan(IndexScanDesc scan) last = chk; if (chk == (HashScanList) NULL) - elog(ERROR, "hash scan list trashed; can't find 0x%lx", scan); + elog(ERROR, "hash scan list trashed; can't find 0x%p", (void*)scan); if (last == (HashScanList) NULL) HashScans = chk->hashsl_next; diff --git a/src/backend/access/heap/hio.c b/src/backend/access/heap/hio.c index d21d219c10..9edd35e72d 100644 --- a/src/backend/access/heap/hio.c +++ b/src/backend/access/heap/hio.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Id: hio.c,v 1.27 1999/11/29 04:34:55 tgl Exp $ + * $Id: hio.c,v 1.28 2000/01/15 02:59:20 petere Exp $ * *------------------------------------------------------------------------- */ @@ -114,7 +114,7 @@ RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple) * this code should go away eventually. */ if (len > MaxTupleSize) - elog(ERROR, "Tuple is too big: size %d, max size %d", + elog(ERROR, "Tuple is too big: size %d, max size %ld", len, MaxTupleSize); /* diff --git a/src/backend/access/index/istrat.c b/src/backend/access/index/istrat.c index ee3477bedc..7169e2ec66 100644 --- a/src/backend/access/index/istrat.c +++ b/src/backend/access/index/istrat.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.38 1999/11/22 17:55:53 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.39 2000/01/15 02:59:21 petere Exp $ * *------------------------------------------------------------------------- */ @@ -502,8 +502,8 @@ OperatorRelationFillScanKeyEntry(Relation operatorRelation, { if (IsBootstrapProcessingMode()) heap_endscan(scan); - elog(ERROR, "OperatorObjectIdFillScanKeyEntry: unknown operator %lu", - (uint32) operatorObjectId); + elog(ERROR, "OperatorObjectIdFillScanKeyEntry: unknown operator %u", + operatorObjectId); } entry->sk_flags = 0; @@ -517,8 +517,8 @@ OperatorRelationFillScanKeyEntry(Relation operatorRelation, if (!RegProcedureIsValid(entry->sk_procedure)) { elog(ERROR, - "OperatorObjectIdFillScanKeyEntry: no procedure for operator %lu", - (uint32) operatorObjectId); + "OperatorObjectIdFillScanKeyEntry: no procedure for operator %u", + operatorObjectId); } } diff --git a/src/backend/access/nbtree/nbtinsert.c b/src/backend/access/nbtree/nbtinsert.c index 57c57997e3..dcbac83cf7 100644 --- a/src/backend/access/nbtree/nbtinsert.c +++ b/src/backend/access/nbtree/nbtinsert.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.52 1999/12/26 03:48:22 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.53 2000/01/15 02:59:23 petere Exp $ * *------------------------------------------------------------------------- */ @@ -275,7 +275,7 @@ _bt_insertonpg(Relation rel, * Note that at this point, itemsz doesn't include the ItemId. */ if (itemsz > (PageGetPageSize(page)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData)))/3 - sizeof(ItemIdData)) - elog(ERROR, "btree: index item size %d exceeds maximum %d", + elog(ERROR, "btree: index item size %d exceeds maximum %ld", itemsz, (PageGetPageSize(page)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData)))/3 - sizeof(ItemIdData)); diff --git a/src/backend/access/nbtree/nbtscan.c b/src/backend/access/nbtree/nbtscan.c index f5c1f7b99f..1b791db633 100644 --- a/src/backend/access/nbtree/nbtscan.c +++ b/src/backend/access/nbtree/nbtscan.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.28 1999/08/08 20:12:51 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.29 2000/01/15 02:59:23 petere Exp $ * * * NOTES @@ -95,7 +95,7 @@ _bt_dropscan(IndexScanDesc scan) last = chk; if (chk == (BTScanList) NULL) - elog(ERROR, "btree scan list trashed; can't find 0x%lx", scan); + elog(ERROR, "btree scan list trashed; can't find 0x%p", (void*)scan); if (last == (BTScanList) NULL) BTScans = chk->btsl_next; diff --git a/src/backend/access/nbtree/nbtsort.c b/src/backend/access/nbtree/nbtsort.c index fff65b7d79..c1f9e5403d 100644 --- a/src/backend/access/nbtree/nbtsort.c +++ b/src/backend/access/nbtree/nbtsort.c @@ -27,7 +27,7 @@ * Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsort.c,v 1.48 2000/01/08 21:24:49 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsort.c,v 1.49 2000/01/15 02:59:23 petere Exp $ * *------------------------------------------------------------------------- */ @@ -314,7 +314,7 @@ _bt_buildadd(Relation index, BTPageState *state, BTItem bti, int flags) * But during creation of an index, we don't go through there. */ if (btisz > (PageGetPageSize(npage)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData)))/3 - sizeof(ItemIdData)) - elog(ERROR, "btree: index item size %d exceeds maximum %d", + elog(ERROR, "btree: index item size %d exceeds maximum %ld", btisz, (PageGetPageSize(npage)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData)))/3 - sizeof(ItemIdData)); diff --git a/src/backend/access/rtree/rtscan.c b/src/backend/access/rtree/rtscan.c index 30bf065d12..f34bf50ba5 100644 --- a/src/backend/access/rtree/rtscan.c +++ b/src/backend/access/rtree/rtscan.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.29 1999/07/17 20:16:45 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.30 2000/01/15 02:59:25 petere Exp $ * *------------------------------------------------------------------------- */ @@ -267,7 +267,7 @@ rtdropscan(IndexScanDesc s) prev = l; if (l == (RTScanList) NULL) - elog(ERROR, "rtree scan list corrupted -- cannot find 0x%lx", s); + elog(ERROR, "rtree scan list corrupted -- cannot find 0x%p", (void*)s); if (prev == (RTScanList) NULL) RTScans = l->rtsl_next; diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index c07210bc5e..8e9f125996 100644 --- a/src/backend/bootstrap/bootstrap.c +++ b/src/backend/bootstrap/bootstrap.c @@ -7,7 +7,7 @@ * Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.76 2000/01/11 04:00:30 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.77 2000/01/15 02:59:27 petere Exp $ * *------------------------------------------------------------------------- */ @@ -771,7 +771,7 @@ cleanup() beenhere = 1; else { - elog(FATAL, "Memory manager fault: cleanup called twice.\n", stderr); + elog(FATAL, "Memory manager fault: cleanup called twice.\n"); proc_exit(1); } if (reldesc != (Relation) NULL) diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c index e5fcf1434c..b948553283 100644 --- a/src/backend/catalog/aclchk.c +++ b/src/backend/catalog/aclchk.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.33 2000/01/13 18:26:04 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.34 2000/01/15 02:59:28 petere Exp $ * * NOTES * See acl.h. @@ -264,7 +264,7 @@ aclcheck(char *relname, Acl *acl, AclId id, AclIdType idtype, AclMode mode) */ if (num < 1) { -#if ACLDEBUG_TRACE || 1 +#if defined(ACLDEBUG_TRACE) || 1 elog(DEBUG, "aclcheck: zero-length ACL, returning 1"); #endif return ACLCHECK_OK; diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c index fc2536f543..1523786aa9 100644 --- a/src/backend/catalog/catalog.c +++ b/src/backend/catalog/catalog.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.26 1999/11/22 17:55:56 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.27 2000/01/15 02:59:28 petere Exp $ * *------------------------------------------------------------------------- */ @@ -29,7 +29,7 @@ char * relpath(char *relname) { char *path; - int bufsize = 0; + size_t bufsize = 0; if (IsSharedSystemRelationName(relname)) { @@ -156,7 +156,7 @@ fillatt(TupleDesc tupleDesc) 0, 0, 0); if (!HeapTupleIsValid(tuple)) { - elog(ERROR, "fillatt: unknown atttypid %ld", + elog(ERROR, "fillatt: unknown atttypid %d", (*attributeP)->atttypid); } else diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index ad81df2316..23280ec567 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -417,7 +417,7 @@ init_sequence(char *caller, char *name) if (RelationGetRelid(seqrel) != elm->relid) { elog(NOTICE, "%s.%s: sequence was re-created", - name, caller, name); + name, caller); elm->relid = RelationGetRelid(seqrel); elm->cached = elm->last = elm->increment = 0; } diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c index ffbe98b97f..031512839c 100644 --- a/src/backend/commands/variable.c +++ b/src/backend/commands/variable.c @@ -2,7 +2,7 @@ * Routines for handling of 'SET var TO', * 'SHOW var' and 'RESET var' statements. * - * $Id: variable.c,v 1.26 1999/09/27 20:27:03 momjian Exp $ + * $Id: variable.c,v 1.27 2000/01/15 02:59:29 petere Exp $ * */ @@ -523,7 +523,7 @@ reset_timezone() { strcpy(tzbuf, "="); if (putenv(tzbuf) != 0) - elog(ERROR, "Unable to clear TZ environment variable", NULL); + elog(ERROR, "Unable to clear TZ environment variable"); tzset(); } diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index fc476fe267..fd87a89968 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.78 2000/01/09 00:26:34 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.79 2000/01/15 02:59:30 petere Exp $ * *------------------------------------------------------------------------- */ @@ -168,7 +168,7 @@ create_scan_node(Query *root, Path *best_path, List *tlist) break; default: - elog(ERROR, "create_scan_node: unknown node type", + elog(ERROR, "create_scan_node: unknown node type: %d", best_path->pathtype); break; } @@ -234,7 +234,7 @@ create_join_node(Query *root, JoinPath *best_path, List *tlist) inner_tlist); break; default: - elog(ERROR, "create_join_node: unknown node type", + elog(ERROR, "create_join_node: unknown node type: %d", best_path->path.pathtype); } diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c index fd49135765..6468ef528f 100644 --- a/src/backend/optimizer/util/plancat.c +++ b/src/backend/optimizer/util/plancat.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.43 2000/01/12 00:53:21 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.44 2000/01/15 02:59:31 petere Exp $ * *------------------------------------------------------------------------- */ @@ -410,7 +410,7 @@ restriction_selectivity(Oid functionObjectId, elog(ERROR, "restriction_selectivity: bad pointer"); if (*result < 0.0 || *result > 1.0) - elog(ERROR, "restriction_selectivity: bad value %lf", *result); + elog(ERROR, "restriction_selectivity: bad value %f", *result); return (Selectivity) *result; } @@ -446,7 +446,7 @@ join_selectivity(Oid functionObjectId, elog(ERROR, "join_selectivity: bad pointer"); if (*result < 0.0 || *result > 1.0) - elog(ERROR, "join_selectivity: bad value %lf", *result); + elog(ERROR, "join_selectivity: bad value %f", *result); return (Selectivity) *result; } diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 2ac263fb26..bf8494c18c 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -5,7 +5,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: analyze.c,v 1.128 2000/01/10 05:20:21 momjian Exp $ + * $Id: analyze.c,v 1.129 2000/01/15 02:59:31 petere Exp $ * *------------------------------------------------------------------------- */ @@ -732,7 +732,7 @@ transformCreateStmt(ParseState *pstate, CreateStmt *stmt) break; default: - elog(ERROR, "parser: unrecognized constraint (internal error)", NULL); + elog(ERROR, "parser: unrecognized constraint (internal error)"); break; } } @@ -1598,7 +1598,7 @@ transformForUpdate(Query *qry, List *forUpdate) i++; } if (l2 == NULL) - elog(ERROR, "FOR UPDATE: relation %s not found in FROM clause", lfirst(l)); + elog(ERROR, "FOR UPDATE: relation %s not found in FROM clause", strVal(lfirst(l))); } qry->rowMark = rowMark; diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 069af39f05..b7e3b6f47a 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.125 2000/01/14 22:11:34 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.126 2000/01/15 02:59:32 petere Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -3622,7 +3622,7 @@ Character: character '(' Iconst ')' if ($3 < 1) elog(ERROR,"length for '%s' type must be at least 1",$1); else if ($3 > MaxAttrSize) - elog(ERROR,"length for type '%s' cannot exceed %d",$1, + elog(ERROR,"length for type '%s' cannot exceed %ld",$1, MaxAttrSize); /* we actually implement this sort of like a varlen, so diff --git a/src/backend/parser/parse_node.c b/src/backend/parser/parse_node.c index c660df3826..544a4462dd 100644 --- a/src/backend/parser/parse_node.c +++ b/src/backend/parser/parse_node.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.34 1999/12/24 06:43:33 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.35 2000/01/15 02:59:32 petere Exp $ * *------------------------------------------------------------------------- */ @@ -261,7 +261,7 @@ transformArraySubscripts(ParseState *pstate, typeelement = type_struct_array->typelem; if (typeelement == InvalidOid) elog(ERROR, "transformArraySubscripts: type %s is not an array", - type_struct_array->typname); + NameStr(type_struct_array->typname)); /* Get the type tuple for the array element type */ type_tuple = SearchSysCacheTuple(TYPEOID, diff --git a/src/backend/parser/parse_type.c b/src/backend/parser/parse_type.c index d76d573de1..1a2693d69f 100644 --- a/src/backend/parser/parse_type.c +++ b/src/backend/parser/parse_type.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/parse_type.c,v 1.27 1999/11/22 17:56:21 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/parse_type.c,v 1.28 2000/01/15 02:59:32 petere Exp $ * *------------------------------------------------------------------------- */ @@ -226,7 +226,7 @@ GetArrayElementType(Oid typearray) if (type_struct_array->typelem == InvalidOid) { elog(ERROR, "GetArrayElementType: type %s is not an array", - type_struct_array->typname); + NameStr(type_struct_array->typname)); } return type_struct_array->typelem; diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 292fb728c1..4404aa53d3 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.69 2000/01/05 18:23:49 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.70 2000/01/15 02:59:33 petere Exp $ * *------------------------------------------------------------------------- */ @@ -1225,8 +1225,8 @@ BufferPoolCheckLeak() BufferDesc *buf = &(BufferDescriptors[i - 1]); elog(NOTICE, - "Buffer Leak: [%03d] (freeNext=%d, freePrev=%d, \ -relname=%s, blockNum=%d, flags=0x%x, refcount=%d %d)", + "Buffer Leak: [%03d] (freeNext=%ld, freePrev=%ld, \ +relname=%s, blockNum=%d, flags=0x%x, refcount=%d %ld)", i - 1, buf->freeNext, buf->freePrev, buf->sb_relname, buf->tag.blockNum, buf->flags, buf->refcount, PrivateRefCount[i - 1]); @@ -1536,8 +1536,8 @@ PrintBufferDescs() SpinAcquire(BufMgrLock); for (i = 0; i < NBuffers; ++i, ++buf) { - elog(DEBUG, "[%02d] (freeNext=%d, freePrev=%d, relname=%s, \ -blockNum=%d, flags=0x%x, refcount=%d %d)", + elog(DEBUG, "[%02d] (freeNext=%ld, freePrev=%ld, relname=%s, \ +blockNum=%d, flags=0x%x, refcount=%d %ld)", i, buf->freeNext, buf->freePrev, buf->sb_relname, buf->tag.blockNum, buf->flags, buf->refcount, PrivateRefCount[i]); @@ -1566,8 +1566,8 @@ PrintPinnedBufs() for (i = 0; i < NBuffers; ++i, ++buf) { if (PrivateRefCount[i] > 0) - elog(NOTICE, "[%02d] (freeNext=%d, freePrev=%d, relname=%s, \ -blockNum=%d, flags=0x%x, refcount=%d %d)\n", + elog(NOTICE, "[%02d] (freeNext=%ld, freePrev=%ld, relname=%s, \ +blockNum=%d, flags=0x%x, refcount=%d %ld)\n", i, buf->freeNext, buf->freePrev, buf->sb_relname, buf->tag.blockNum, buf->flags, buf->refcount, PrivateRefCount[i]); @@ -1668,7 +1668,7 @@ FlushRelationBuffers(Relation rel, BlockNumber block, bool doFlush) } if (LocalRefCount[i] > 0) { - elog(NOTICE, "FlushRelationBuffers(%s (local), %u): block %u is referenced (%d)", + elog(NOTICE, "FlushRelationBuffers(%s (local), %u): block %u is referenced (%ld)", RelationGetRelationName(rel), block, buf->tag.blockNum, LocalRefCount[i]); return -2; @@ -1694,7 +1694,7 @@ FlushRelationBuffers(Relation rel, BlockNumber block, bool doFlush) SpinRelease(BufMgrLock); if (FlushBuffer(i+1, false) != STATUS_OK) { - elog(NOTICE, "FlushRelationBuffers(%s, %u): block %u is dirty (private %d, global %d), could not flush it", + elog(NOTICE, "FlushRelationBuffers(%s, %u): block %u is dirty (private %ld, global %d), could not flush it", buf->sb_relname, block, buf->tag.blockNum, PrivateRefCount[i], buf->refcount); return -1; @@ -1704,7 +1704,7 @@ FlushRelationBuffers(Relation rel, BlockNumber block, bool doFlush) else { SpinRelease(BufMgrLock); - elog(NOTICE, "FlushRelationBuffers(%s, %u): block %u is dirty (private %d, global %d)", + elog(NOTICE, "FlushRelationBuffers(%s, %u): block %u is dirty (private %ld, global %d)", buf->sb_relname, block, buf->tag.blockNum, PrivateRefCount[i], buf->refcount); return -1; @@ -1713,7 +1713,7 @@ FlushRelationBuffers(Relation rel, BlockNumber block, bool doFlush) if (!(buf->flags & BM_FREE)) { SpinRelease(BufMgrLock); - elog(NOTICE, "FlushRelationBuffers(%s, %u): block %u is referenced (private %d, global %d)", + elog(NOTICE, "FlushRelationBuffers(%s, %u): block %u is referenced (private %ld, global %d)", buf->sb_relname, block, buf->tag.blockNum, PrivateRefCount[i], buf->refcount); return -2; @@ -2091,7 +2091,7 @@ LockBuffer(Buffer buffer, int mode) BufferLocks[buffer - 1] &= ~BL_W_LOCK; } else - elog(ERROR, "UNLockBuffer: buffer %u is not locked", buffer); + elog(ERROR, "UNLockBuffer: buffer %lu is not locked", buffer); } else if (mode == BUFFER_LOCK_SHARE) { diff --git a/src/backend/storage/ipc/ipc.c b/src/backend/storage/ipc/ipc.c index 5c4dc5052c..7676fd20e3 100644 --- a/src/backend/storage/ipc/ipc.c +++ b/src/backend/storage/ipc/ipc.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.43 1999/11/22 02:06:31 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.44 2000/01/15 02:59:34 petere Exp $ * * NOTES * @@ -554,7 +554,7 @@ static void IpcMemoryDetach(int status, char *shmaddr) { if (shmdt(shmaddr) < 0) - elog(NOTICE, "IpcMemoryDetach: shmdt(0x%x): %m", shmaddr); + elog(NOTICE, "IpcMemoryDetach: shmdt(0x%p): %m", shmaddr); } /****************************************************************************/ diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c index 26849f211b..0b898697e4 100644 --- a/src/backend/storage/lmgr/lock.c +++ b/src/backend/storage/lmgr/lock.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.63 1999/11/28 01:56:48 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.64 2000/01/15 02:59:35 petere Exp $ * * NOTES * Outside modules can create a lock table and acquire/release @@ -1362,7 +1362,7 @@ LockReleaseAll(LOCKMETHOD lockmethod, SHM_QUEUE *lockQueue) { /* Should never happen */ elog(NOTICE, - "LockReleaseAll: INVALID PID: [%u] [%d,%d,%d]", + "LockReleaseAll: INVALID PID: [%u] [%ld,%d,%d]", lock->tag.objId.blkno, xidLook->tag.lock, xidLook->tag.pid, xidLook->tag.xid); nleft++; diff --git a/src/backend/utils/adt/cash.c b/src/backend/utils/adt/cash.c index 0bc44f4b95..1dd31df343 100644 --- a/src/backend/utils/adt/cash.c +++ b/src/backend/utils/adt/cash.c @@ -9,7 +9,7 @@ * workings can be found in the book "Software Solutions in C" by * Dale Schumacher, Academic Press, ISBN: 0-12-632360-7. * - * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.32 1999/07/17 20:17:54 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.33 2000/01/15 02:59:36 petere Exp $ */ #include @@ -285,7 +285,7 @@ cash_out(Cash *in_value) if (minus) { if (!PointerIsValid(result = palloc(CASH_BUFSZ + 2 - count + strlen(nsymbol)))) - elog(ERROR, "Memory allocation failed, can't output cash", NULL); + elog(ERROR, "Memory allocation failed, can't output cash"); /* Position code of 0 means use parens */ if (convention == 0) @@ -298,7 +298,7 @@ cash_out(Cash *in_value) else { if (!PointerIsValid(result = palloc(CASH_BUFSZ + 2 - count))) - elog(ERROR, "Memory allocation failed, can't output cash", NULL); + elog(ERROR, "Memory allocation failed, can't output cash"); strcpy(result, buf + count); } @@ -374,7 +374,7 @@ cash_pl(Cash *c1, Cash *c2) return NULL; if (!PointerIsValid(result = palloc(sizeof(Cash)))) - elog(ERROR, "Memory allocation failed, can't add cash", NULL); + elog(ERROR, "Memory allocation failed, can't add cash"); *result = (*c1 + *c2); @@ -394,7 +394,7 @@ cash_mi(Cash *c1, Cash *c2) return NULL; if (!PointerIsValid(result = palloc(sizeof(Cash)))) - elog(ERROR, "Memory allocation failed, can't subtract cash", NULL); + elog(ERROR, "Memory allocation failed, can't subtract cash"); *result = (*c1 - *c2); @@ -414,7 +414,7 @@ cash_mul_flt8(Cash *c, float8 *f) return NULL; if (!PointerIsValid(result = palloc(sizeof(Cash)))) - elog(ERROR, "Memory allocation failed, can't multiply cash", NULL); + elog(ERROR, "Memory allocation failed, can't multiply cash"); *result = ((*f) * (*c)); @@ -447,7 +447,7 @@ cash_div_flt8(Cash *c, float8 *f) return NULL; if (!PointerIsValid(result = palloc(sizeof(Cash)))) - elog(ERROR, "Memory allocation failed, can't divide cash", NULL); + elog(ERROR, "Memory allocation failed, can't divide cash"); if (*f == 0.0) elog(ERROR, "cash_div: divide by 0.0 error"); @@ -469,7 +469,7 @@ cash_mul_flt4(Cash *c, float4 *f) return NULL; if (!PointerIsValid(result = palloc(sizeof(Cash)))) - elog(ERROR, "Memory allocation failed, can't multiply cash", NULL); + elog(ERROR, "Memory allocation failed, can't multiply cash"); *result = ((*f) * (*c)); @@ -502,7 +502,7 @@ cash_div_flt4(Cash *c, float4 *f) return NULL; if (!PointerIsValid(result = palloc(sizeof(Cash)))) - elog(ERROR, "Memory allocation failed, can't divide cash", NULL); + elog(ERROR, "Memory allocation failed, can't divide cash"); if (*f == 0.0) elog(ERROR, "cash_div: divide by 0.0 error"); @@ -525,7 +525,7 @@ cash_mul_int4(Cash *c, int4 i) return NULL; if (!PointerIsValid(result = palloc(sizeof(Cash)))) - elog(ERROR, "Memory allocation failed, can't multiply cash", NULL); + elog(ERROR, "Memory allocation failed, can't multiply cash"); *result = ((i) * (*c)); @@ -558,7 +558,7 @@ cash_div_int4(Cash *c, int4 i) return NULL; if (!PointerIsValid(result = palloc(sizeof(Cash)))) - elog(ERROR, "Memory allocation failed, can't divide cash", NULL); + elog(ERROR, "Memory allocation failed, can't divide cash"); if (i == 0) elog(ERROR, "cash_idiv: divide by 0 error"); @@ -581,7 +581,7 @@ cash_mul_int2(Cash *c, int2 s) return NULL; if (!PointerIsValid(result = palloc(sizeof(Cash)))) - elog(ERROR, "Memory allocation failed, can't multiply cash", NULL); + elog(ERROR, "Memory allocation failed, can't multiply cash"); *result = ((s) * (*c)); @@ -614,7 +614,7 @@ cash_div_int2(Cash *c, int2 s) return NULL; if (!PointerIsValid(result = palloc(sizeof(Cash)))) - elog(ERROR, "Memory allocation failed, can't divide cash", NULL); + elog(ERROR, "Memory allocation failed, can't divide cash"); if (s == 0) elog(ERROR, "cash_div: divide by 0 error"); @@ -637,7 +637,7 @@ cashlarger(Cash *c1, Cash *c2) return NULL; if (!PointerIsValid(result = palloc(sizeof(Cash)))) - elog(ERROR, "Memory allocation failed, can't return larger cash", NULL); + elog(ERROR, "Memory allocation failed, can't return larger cash"); *result = ((*c1 > *c2) ? *c1 : *c2); @@ -657,7 +657,7 @@ cashsmaller(Cash *c1, Cash *c2) return NULL; if (!PointerIsValid(result = palloc(sizeof(Cash)))) - elog(ERROR, "Memory allocation failed, can't return smaller cash", NULL); + elog(ERROR, "Memory allocation failed, can't return smaller cash"); *result = ((*c1 < *c2) ? *c1 : *c2); diff --git a/src/backend/utils/adt/date.c b/src/backend/utils/adt/date.c index 7045b6d209..c2144e8543 100644 --- a/src/backend/utils/adt/date.c +++ b/src/backend/utils/adt/date.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.39 2000/01/02 01:37:26 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.40 2000/01/15 02:59:36 petere Exp $ * * NOTES * This code is actually (almost) unused. @@ -133,7 +133,7 @@ reltimein(char *str) char lowstr[MAXDATELEN + 1]; if (!PointerIsValid(str)) - elog(ERROR, "Bad (null) date external representation", NULL); + elog(ERROR, "Bad (null) date external representation"); if (strlen(str) > MAXDATELEN) elog(ERROR, "Bad (length) reltime external representation '%s'", str); @@ -362,7 +362,7 @@ reltime_timespan(RelativeTime reltime) month; if (!PointerIsValid(result = palloc(sizeof(TimeSpan)))) - elog(ERROR, "Memory allocation failed, can't convert reltime to timespan", NULL); + elog(ERROR, "Memory allocation failed, can't convert reltime to timespan"); switch (reltime) { diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c index 508b2dffb2..2d733ccec5 100644 --- a/src/backend/utils/adt/datetime.c +++ b/src/backend/utils/adt/datetime.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.39 2000/01/02 01:37:26 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.40 2000/01/15 02:59:36 petere Exp $ * *------------------------------------------------------------------------- */ @@ -46,7 +46,7 @@ date_in(char *str) char lowstr[MAXDATELEN + 1]; if (!PointerIsValid(str)) - elog(ERROR, "Bad (null) date external representation", NULL); + elog(ERROR, "Bad (null) date external representation"); if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0) || (DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tzp) != 0)) @@ -199,10 +199,10 @@ date_datetime(DateADT dateVal) result = palloc(sizeof(DateTime)); if (date2tm(dateVal, &tz, tm, &fsec, &tzn) != 0) - elog(ERROR, "Unable to convert date to datetime", NULL); + elog(ERROR, "Unable to convert date to datetime"); if (tm2datetime(tm, fsec, &tz, result) != 0) - elog(ERROR, "Datetime out of range", NULL); + elog(ERROR, "Datetime out of range"); return result; } /* date_datetime() */ @@ -222,10 +222,10 @@ datetime_date(DateTime *datetime) char *tzn; if (!PointerIsValid(datetime)) - elog(ERROR, "Unable to convert null datetime to date", NULL); + elog(ERROR, "Unable to convert null datetime to date"); if (DATETIME_NOT_FINITE(*datetime)) - elog(ERROR, "Unable to convert datetime to date", NULL); + elog(ERROR, "Unable to convert datetime to date"); if (DATETIME_IS_EPOCH(*datetime)) { @@ -240,7 +240,7 @@ datetime_date(DateTime *datetime) else { if (datetime2tm(*datetime, &tz, tm, &fsec, &tzn) != 0) - elog(ERROR, "Unable to convert datetime to date", NULL); + elog(ERROR, "Unable to convert datetime to date"); } result = (date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - date2j(2000, 1, 1)); @@ -265,7 +265,7 @@ abstime_date(AbsoluteTime abstime) case INVALID_ABSTIME: case NOSTART_ABSTIME: case NOEND_ABSTIME: - elog(ERROR, "Unable to convert reserved abstime value to date", NULL); + elog(ERROR, "Unable to convert reserved abstime value to date"); /* * pretend to drop through to make compiler think that result @@ -387,7 +387,7 @@ time_in(char *str) int ftype[MAXDATEFIELDS]; if (!PointerIsValid(str)) - elog(ERROR, "Bad (null) time external representation", NULL); + elog(ERROR, "Bad (null) time external representation"); if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0) || (DecodeTimeOnly(field, ftype, nf, &dtype, tm, &fsec) != 0)) @@ -505,10 +505,10 @@ datetime_time(DateTime *datetime) char *tzn; if (!PointerIsValid(datetime)) - elog(ERROR, "Unable to convert null datetime to date", NULL); + elog(ERROR, "Unable to convert null datetime to date"); if (DATETIME_NOT_FINITE(*datetime)) - elog(ERROR, "Unable to convert datetime to date", NULL); + elog(ERROR, "Unable to convert datetime to date"); if (DATETIME_IS_EPOCH(*datetime)) { @@ -523,7 +523,7 @@ datetime_time(DateTime *datetime) else { if (datetime2tm(*datetime, &tz, tm, &fsec, &tzn) != 0) - elog(ERROR, "Unable to convert datetime to date", NULL); + elog(ERROR, "Unable to convert datetime to date"); } result = palloc(sizeof(TimeADT)); diff --git a/src/backend/utils/adt/dt.c b/src/backend/utils/adt/dt.c index a9ae4eebe3..e633613eca 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.80 2000/01/04 07:53:27 thomas Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.81 2000/01/15 02:59:36 petere Exp $ * *------------------------------------------------------------------------- */ @@ -114,7 +114,7 @@ datetime_in(char *str) char lowstr[MAXDATELEN + 1]; if (!PointerIsValid(str)) - elog(ERROR, "Bad (null) datetime external representation", NULL); + elog(ERROR, "Bad (null) datetime external representation"); if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0) || (DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tz) != 0)) @@ -223,7 +223,7 @@ timespan_in(char *str) fsec = 0; if (!PointerIsValid(str)) - elog(ERROR, "Bad (null) timespan external representation", NULL); + elog(ERROR, "Bad (null) timespan external representation"); if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0) || (DecodeDateDelta(field, ftype, nf, &dtype, tm, &fsec) != 0)) @@ -270,7 +270,7 @@ timespan_out(TimeSpan *span) return NULL; if (EncodeTimeSpan(tm, fsec, DateStyle, buf) != 0) - elog(ERROR, "Unable to format timespan", NULL); + elog(ERROR, "Unable to format timespan"); result = palloc(strlen(buf) + 1); @@ -841,7 +841,7 @@ datetime_pl_span(DateTime *datetime, TimeSpan *span) tm->tm_mday = (day_tab[isleap(tm->tm_year)][tm->tm_mon - 1]); if (tm2datetime(tm, fsec, &tz, &dt) != 0) - elog(ERROR, "Unable to add datetime and timespan", NULL); + elog(ERROR, "Unable to add datetime and timespan"); } else @@ -1037,7 +1037,7 @@ timespan_div(TimeSpan *span1, float8 *arg2) return NULL; if (!PointerIsValid(result = palloc(sizeof(TimeSpan)))) - elog(ERROR, "Memory allocation failed, can't divide timespans", NULL); + elog(ERROR, "Memory allocation failed, can't divide timespans"); if (*arg2 == 0.0) elog(ERROR, "timespan_div: divide by 0.0 error"); @@ -1164,11 +1164,11 @@ datetime_age(DateTime *datetime1, DateTime *datetime2) } if (tm2timespan(tm, fsec, result) != 0) - elog(ERROR, "Unable to decode datetime", NULL); + elog(ERROR, "Unable to decode datetime"); } else - elog(ERROR, "Unable to decode datetime", NULL); + elog(ERROR, "Unable to decode datetime"); return result; } /* datetime_age() */ @@ -1528,7 +1528,7 @@ timespan_trunc(text *units, TimeSpan *timespan) } else { - elog(NOTICE, "Timespan out of range", NULL); + elog(NOTICE, "Timespan out of range"); result = NULL; } @@ -1547,7 +1547,7 @@ timespan_trunc(text *units, TimeSpan *timespan) } else { - elog(ERROR, "Timespan units '%s' not recognized", units); + elog(ERROR, "Timespan units '%s' not recognized", textout(units)); result = NULL; } @@ -1688,14 +1688,14 @@ datetime_part(text *units, DateTime *datetime) case DTK_DOW: if (datetime2tm(dt, &tz, tm, &fsec, &tzn) != 0) - elog(ERROR, "Unable to encode datetime", NULL); + elog(ERROR, "Unable to encode datetime"); *result = j2day(date2j(tm->tm_year, tm->tm_mon, tm->tm_mday)); break; case DTK_DOY: if (datetime2tm(dt, &tz, tm, &fsec, &tzn) != 0) - elog(ERROR, "Unable to encode datetime", NULL); + elog(ERROR, "Unable to encode datetime"); *result = (date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - date2j(tm->tm_year, 1, 1) + 1); @@ -1754,7 +1754,7 @@ timespan_part(text *units, TimeSpan *timespan) if (TIMESPAN_IS_INVALID(*timespan)) { #if NOT_USED - elog(ERROR, "Timespan is not finite", NULL); + elog(ERROR, "Timespan is not finite"); #endif *result = 0; @@ -1815,14 +1815,14 @@ timespan_part(text *units, TimeSpan *timespan) break; default: - elog(ERROR, "Timespan units '%s' not yet supported", units); + elog(ERROR, "Timespan units '%s' not yet supported", textout(units)); result = NULL; } } else { - elog(NOTICE, "Timespan out of range", NULL); + elog(NOTICE, "Timespan out of range"); *result = 0; } @@ -1839,7 +1839,7 @@ timespan_part(text *units, TimeSpan *timespan) } else { - elog(ERROR, "Timespan units '%s' not recognized", units); + elog(ERROR, "Timespan units '%s' not recognized", textout(units)); *result = 0; } @@ -1889,7 +1889,7 @@ datetime_zone(text *zone, DateTime *datetime) * could return null but Postgres doesn't like that currently. - * tgl 97/06/12 */ - elog(ERROR, "Datetime is not finite", NULL); + elog(ERROR, "Datetime is not finite"); result = NULL; } @@ -1902,7 +1902,7 @@ datetime_zone(text *zone, DateTime *datetime) dt = dt2local(dt, tz); if (datetime2tm(dt, NULL, tm, &fsec, NULL) != 0) - elog(ERROR, "Datetime not legal", NULL); + elog(ERROR, "Datetime not legal"); up = upzone; lp = lowzone; diff --git a/src/backend/utils/adt/float.c b/src/backend/utils/adt/float.c index 6145ad0461..1a3eddb9ab 100644 --- a/src/backend/utils/adt/float.c +++ b/src/backend/utils/adt/float.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.51 1999/12/20 02:15:35 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.52 2000/01/15 02:59:37 petere Exp $ * *------------------------------------------------------------------------- */ @@ -830,10 +830,10 @@ dtoi4(float64 num) int32 result; if (!PointerIsValid(num)) - elog(ERROR, "dtoi4: unable to convert null", NULL); + elog(ERROR, "dtoi4: unable to convert null"); if ((*num < INT_MIN) || (*num > INT_MAX)) - elog(ERROR, "dtoi4: integer out of range", NULL); + elog(ERROR, "dtoi4: integer out of range"); result = rint(*num); return result; @@ -849,10 +849,10 @@ dtoi2(float64 num) int16 result; if (!PointerIsValid(num)) - elog(ERROR, "dtoi2: unable to convert null", NULL); + elog(ERROR, "dtoi2: unable to convert null"); if ((*num < SHRT_MIN) || (*num > SHRT_MAX)) - elog(ERROR, "dtoi2: integer out of range", NULL); + elog(ERROR, "dtoi2: integer out of range"); result = rint(*num); return result; @@ -898,10 +898,10 @@ ftoi4(float32 num) int32 result; if (!PointerIsValid(num)) - elog(ERROR, "ftoi4: unable to convert null", NULL); + elog(ERROR, "ftoi4: unable to convert null"); if ((*num < INT_MIN) || (*num > INT_MAX)) - elog(ERROR, "ftoi4: integer out of range", NULL); + elog(ERROR, "ftoi4: integer out of range"); result = rint(*num); return result; @@ -917,10 +917,10 @@ ftoi2(float32 num) int16 result; if (!PointerIsValid(num)) - elog(ERROR, "ftoi2: unable to convert null", NULL); + elog(ERROR, "ftoi2: unable to convert null"); if ((*num < SHRT_MIN) || (*num > SHRT_MAX)) - elog(ERROR, "ftoi2: integer out of range", NULL); + elog(ERROR, "ftoi2: integer out of range"); result = rint(*num); return result; diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c index b56b7f5d8d..5fc86c6a62 100644 --- a/src/backend/utils/adt/geo_ops.c +++ b/src/backend/utils/adt/geo_ops.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.46 1999/12/21 17:01:44 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.47 2000/01/15 02:59:37 petere Exp $ * *------------------------------------------------------------------------- */ @@ -282,7 +282,7 @@ path_encode(bool closed, int npts, Point *pt) { *cp++ = LDELIM; if (!pair_encode(pt->x, pt->y, cp)) - elog(ERROR, "Unable to format path", NULL); + elog(ERROR, "Unable to format path"); cp += strlen(cp); *cp++ = RDELIM; *cp++ = DELIM; @@ -352,7 +352,7 @@ box_in(char *str) y; if (!PointerIsValid(str)) - elog(ERROR, " Bad (null) box external representation", NULL); + elog(ERROR, " Bad (null) box external representation"); if ((!path_decode(FALSE, 2, str, &isopen, &s, &(box->high))) || (*s != '\0')) @@ -777,7 +777,7 @@ line_in(char *str) #endif if (!PointerIsValid(str)) - elog(ERROR, " Bad (null) line external representation", NULL); + elog(ERROR, " Bad (null) line external representation"); #ifdef ENABLE_LINE_TYPE if ((!path_decode(TRUE, 2, str, &isopen, &s, &(lseg.p[0]))) @@ -1645,7 +1645,7 @@ lseg_in(char *str) char *s; if (!PointerIsValid(str)) - elog(ERROR, " Bad (null) lseg external representation", NULL); + elog(ERROR, " Bad (null) lseg external representation"); lseg = palloc(sizeof(LSEG)); @@ -2193,7 +2193,7 @@ dist_cpoly(CIRCLE *circle, POLYGON *poly) LSEG seg; if (!PointerIsValid(circle) || !PointerIsValid(poly)) - elog(ERROR, "Invalid (null) input for distance", NULL); + elog(ERROR, "Invalid (null) input for distance"); if (point_inside(&(circle->center), poly->npts, poly->p)) { @@ -2669,7 +2669,7 @@ Point * close_lb(LINE *line, BOX *box) { /* think about this one for a while */ - elog(ERROR, "close_lb not implemented", NULL); + elog(ERROR, "close_lb not implemented"); return NULL; } @@ -2939,7 +2939,7 @@ make_bound_box(POLYGON *poly) box_fill(&(poly->boundbox), x1, x2, y1, y2); } else - elog(ERROR, "Unable to create bounding box for empty polygon", NULL); + elog(ERROR, "Unable to create bounding box for empty polygon"); } /*------------------------------------------------------------------ @@ -3540,7 +3540,7 @@ path_center(PATH *path) if (!PointerIsValid(path)) return NULL; - elog(ERROR, "path_center not implemented", NULL); + elog(ERROR, "path_center not implemented"); result = palloc(sizeof(Point)); result = NULL; @@ -3559,7 +3559,7 @@ path_poly(PATH *path) return NULL; if (!path->closed) - elog(ERROR, "Open path cannot be converted to polygon", NULL); + elog(ERROR, "Open path cannot be converted to polygon"); size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * path->npts); poly = palloc(size); @@ -3598,7 +3598,7 @@ upgradepath(PATH *path) return NULL; if (!isoldpath(path)) - elog(ERROR, "upgradepath: path already upgraded?", NULL); + elog(ERROR, "upgradepath: path already upgraded?"); npts = (path->npts - 1); size = offsetof(PATH, p[0]) +(sizeof(path->p[0]) * npts); @@ -3862,7 +3862,7 @@ circle_in(char *str) int depth = 0; if (!PointerIsValid(str)) - elog(ERROR, " Bad (null) circle external representation", NULL); + elog(ERROR, " Bad (null) circle external representation"); circle = palloc(sizeof(CIRCLE)); @@ -3927,13 +3927,13 @@ circle_out(CIRCLE *circle) *cp++ = LDELIM_C; *cp++ = LDELIM; if (!pair_encode(circle->center.x, circle->center.y, cp)) - elog(ERROR, "Unable to format circle", NULL); + elog(ERROR, "Unable to format circle"); cp += strlen(cp); *cp++ = RDELIM; *cp++ = DELIM; if (!single_encode(circle->radius, cp)) - elog(ERROR, "Unable to format circle", NULL); + elog(ERROR, "Unable to format circle"); cp += strlen(cp); *cp++ = RDELIM_C; @@ -4395,7 +4395,7 @@ circle_poly(int npts, CIRCLE *circle) return NULL; if (FPzero(circle->radius) || (npts < 2)) - elog(ERROR, "Unable to convert circle to polygon", NULL); + elog(ERROR, "Unable to convert circle to polygon"); size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * npts); poly = palloc(size); @@ -4431,7 +4431,7 @@ poly_circle(POLYGON *poly) return NULL; if (poly->npts < 2) - elog(ERROR, "Unable to convert polygon to circle", NULL); + elog(ERROR, "Unable to convert polygon to circle"); circle = palloc(sizeof(CIRCLE)); @@ -4452,7 +4452,7 @@ poly_circle(POLYGON *poly) circle->radius /= poly->npts; if (FPzero(circle->radius)) - elog(ERROR, "Unable to convert polygon to circle", NULL); + elog(ERROR, "Unable to convert polygon to circle"); return circle; } /* poly_circle() */ diff --git a/src/backend/utils/adt/nabstime.c b/src/backend/utils/adt/nabstime.c index 1b57d70c91..e2ad623a47 100644 --- a/src/backend/utils/adt/nabstime.c +++ b/src/backend/utils/adt/nabstime.c @@ -4,7 +4,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: nabstime.c,v 1.63 2000/01/02 01:37:27 momjian Exp $ + * $Id: nabstime.c,v 1.64 2000/01/15 02:59:38 petere Exp $ * */ #include @@ -265,7 +265,7 @@ nabstimein(char *str) ftype[MAXDATEFIELDS]; if (!PointerIsValid(str)) - elog(ERROR, "Bad (null) abstime external representation", NULL); + elog(ERROR, "Bad (null) abstime external representation"); if (strlen(str) > MAXDATELEN) elog(ERROR, "Bad (length) abstime external representation '%s'", str); @@ -552,7 +552,7 @@ abstime_datetime(AbsoluteTime abstime) DateTime *result; if (!PointerIsValid(result = palloc(sizeof(DateTime)))) - elog(ERROR, "Unable to allocate space to convert abstime to datetime", NULL); + elog(ERROR, "Unable to allocate space to convert abstime to datetime"); switch (abstime) { diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 8e473b558a..496fb94ddc 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -3,7 +3,7 @@ * out of its tuple * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.37 2000/01/05 18:23:50 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.38 2000/01/15 02:59:38 petere Exp $ * * This software is copyrighted by Jan Wieck - Hamburg. * @@ -411,10 +411,10 @@ pg_get_indexdef(Oid indexrelid) spirc = SPI_execp(plan_getam, spi_args, spi_nulls, 1); if (spirc != SPI_OK_SELECT) elog(ERROR, "failed to get pg_am tuple for index %s", - idxrelrec->relname); + NameStr(idxrelrec->relname)); if (SPI_processed != 1) elog(ERROR, "failed to get pg_am tuple for index %s", - idxrelrec->relname); + NameStr(idxrelrec->relname)); spi_tup = SPI_tuptable->vals[0]; spi_ttc = SPI_tuptable->tupdesc; spi_fno = SPI_fnumber(spi_ttc, "amname"); diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 5755926e9d..b711d768c0 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.46 2000/01/10 17:14:38 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.47 2000/01/15 02:59:38 petere Exp $ * *------------------------------------------------------------------------- */ @@ -760,7 +760,7 @@ btreesel(Oid operatorObjectId, if (!PointerIsValid(result)) elog(ERROR, "Btree Selectivity: bad pointer"); if (*result < 0.0 || *result > 1.0) - elog(ERROR, "Btree Selectivity: bad value %lf", *result); + elog(ERROR, "Btree Selectivity: bad value %f", *result); return result; } @@ -911,7 +911,7 @@ hashsel(Oid operatorObjectId, if (!PointerIsValid(result)) elog(ERROR, "Hash Table Selectivity: bad pointer"); if (*result < 0.0 || *result > 1.0) - elog(ERROR, "Hash Table Selectivity: bad value %lf", *result); + elog(ERROR, "Hash Table Selectivity: bad value %f", *result); return result; diff --git a/src/backend/utils/adt/tid.c b/src/backend/utils/adt/tid.c index dc243205e9..25c22cfb8c 100644 --- a/src/backend/utils/adt/tid.c +++ b/src/backend/utils/adt/tid.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/tid.c,v 1.13 1999/12/20 01:23:04 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/tid.c,v 1.14 2000/01/15 02:59:38 petere Exp $ * * NOTES * input routine largely stolen from boxin(). @@ -200,7 +200,7 @@ currtid_byrelname(const text *relname, ItemPointer tid) heap_close(rel, AccessShareLock); } else - elog(ERROR, "Relation %s not found", relname); + elog(ERROR, "Relation %s not found", textout((text *)relname)); pfree(str); return result; diff --git a/src/backend/utils/adt/varchar.c b/src/backend/utils/adt/varchar.c index 9ac113301d..c821a35a2d 100644 --- a/src/backend/utils/adt/varchar.c +++ b/src/backend/utils/adt/varchar.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.55 1999/11/07 23:08:24 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.56 2000/01/15 02:59:38 petere Exp $ * *------------------------------------------------------------------------- */ @@ -83,7 +83,7 @@ bpcharin(char *s, int dummy, int32 atttypmod) len = atttypmod - VARHDRSZ; if (len > MaxAttrSize) - elog(ERROR, "bpcharin: length of char() must be less than %d", + elog(ERROR, "bpcharin: length of char() must be less than %ld", MaxAttrSize); result = (char *) palloc(atttypmod); @@ -154,7 +154,7 @@ bpchar(char *s, int32 len) rlen = len - VARHDRSZ; if (rlen > MaxAttrSize) - elog(ERROR, "bpchar: length of char() must be less than %d", + elog(ERROR, "bpchar: length of char() must be less than %ld", MaxAttrSize); #ifdef STRINGDEBUG @@ -336,7 +336,7 @@ varcharin(char *s, int dummy, int32 atttypmod) len = atttypmod; /* clip the string at max length */ if (len > MaxAttrSize) - elog(ERROR, "varcharin: length of char() must be less than %d", + elog(ERROR, "varcharin: length of char() must be less than %ld", MaxAttrSize); result = (char *) palloc(len); @@ -408,7 +408,7 @@ varchar(char *s, int32 slen) #endif if (len > MaxAttrSize) - elog(ERROR, "varchar: length of varchar() must be less than %d", + elog(ERROR, "varchar: length of varchar() must be less than %ld", MaxAttrSize); result = (char *) palloc(slen); @@ -460,7 +460,7 @@ bpcharlen(char *arg) #endif if (!PointerIsValid(arg)) - elog(ERROR, "Bad (null) char() external representation", NULL); + elog(ERROR, "Bad (null) char() external representation"); #ifdef MULTIBYTE l = bcTruelen(arg); len = 0; @@ -482,7 +482,7 @@ int32 bpcharoctetlen(char *arg) { if (!PointerIsValid(arg)) - elog(ERROR, "Bad (null) char() external representation", NULL); + elog(ERROR, "Bad (null) char() external representation"); return bcTruelen(arg); } @@ -629,7 +629,7 @@ varcharlen(char *arg) #endif if (!PointerIsValid(arg)) - elog(ERROR, "Bad (null) varchar() external representation", NULL); + elog(ERROR, "Bad (null) varchar() external representation"); #ifdef MULTIBYTE len = 0; @@ -652,7 +652,7 @@ int32 varcharoctetlen(char *arg) { if (!PointerIsValid(arg)) - elog(ERROR, "Bad (null) varchar() external representation", NULL); + elog(ERROR, "Bad (null) varchar() external representation"); return VARSIZE(arg) - VARHDRSZ; } diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index 90f898fe97..aaa0ffd450 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.54 1999/11/07 23:08:24 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.55 2000/01/15 02:59:38 petere Exp $ * *------------------------------------------------------------------------- */ @@ -172,6 +172,7 @@ textin(char *inputText) * textout - converts internal representation to "..." */ char * + textout(text *vlena) { int len; diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 7eec36ddb0..ed11b77325 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.84 1999/12/30 05:05:11 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.85 2000/01/15 02:59:39 petere Exp $ * *------------------------------------------------------------------------- */ @@ -845,7 +845,7 @@ RelationBuildDesc(RelationBuildDescInfo buildinfo, Assert(fd >= -1); if (fd == -1) elog(NOTICE, "RelationIdBuildRelation: smgropen(%s): %m", - &relp->relname); + NameStr(relp->relname)); relation->rd_fd = fd; diff --git a/src/backend/utils/mmgr/portalmem.c b/src/backend/utils/mmgr/portalmem.c index aaec2dfd65..7d9ceecaae 100644 --- a/src/backend/utils/mmgr/portalmem.c +++ b/src/backend/utils/mmgr/portalmem.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.31 1999/12/10 03:56:03 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.32 2000/01/15 02:59:40 petere Exp $ * *------------------------------------------------------------------------- */ @@ -269,7 +269,7 @@ PortalHeapMemoryFree(PortalHeapMemory this, else { elog(NOTICE, - "PortalHeapMemoryFree: 0x%x not in alloc set!", + "PortalHeapMemoryFree: 0x%p not in alloc set!", pointer); #ifdef ALLOCFREE_ERROR_ABORT Assert(AllocSetContains(&block->setData, pointer)); diff --git a/src/include/port/linux.h b/src/include/port/linux.h index 345aac71b1..b2b4545a2a 100644 --- a/src/include/port/linux.h +++ b/src/include/port/linux.h @@ -29,7 +29,7 @@ typedef unsigned int slock_t; #endif -#if (__GLIBC__ >= 2) +#if defined(__GLIBC__) && (__GLIBC__ >= 2) #ifdef HAVE_INT_TIMEZONE #undef HAVE_INT_TIMEZONE #endif diff --git a/src/include/postgres.h b/src/include/postgres.h index 455b8f2329..d857613daf 100644 --- a/src/include/postgres.h +++ b/src/include/postgres.h @@ -6,7 +6,7 @@ * * Copyright (c) 1995, Regents of the University of California * - * $Id: postgres.h,v 1.34 2000/01/10 16:13:18 momjian Exp $ + * $Id: postgres.h,v 1.35 2000/01/15 02:59:41 petere Exp $ * *------------------------------------------------------------------------- */ @@ -210,6 +210,7 @@ typedef uint32 CommandId; #define CATALOG(x) \ typedef struct CppConcat(FormData_,x) +/* Huh? */ #define DATA(x) extern int errno #define DESCR(x) extern int errno #define DECLARE_INDEX(x) extern int errno diff --git a/src/include/storage/lock.h b/src/include/storage/lock.h index 8f0f834e0f..a8ad7e978d 100644 --- a/src/include/storage/lock.h +++ b/src/include/storage/lock.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: lock.h,v 1.34 1999/09/06 19:37:37 tgl Exp $ + * $Id: lock.h,v 1.35 2000/01/15 02:59:42 petere Exp $ * *------------------------------------------------------------------------- */ @@ -234,7 +234,6 @@ typedef struct LOCK #define LockLockTable() SpinAcquire(LockMgrLock); #define UnlockLockTable() SpinRelease(LockMgrLock); -extern SPINLOCK LockMgrLock; /* * function prototypes diff --git a/src/include/utils/int8.h b/src/include/utils/int8.h index b55cecf847..89d328af21 100644 --- a/src/include/utils/int8.h +++ b/src/include/utils/int8.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: int8.h,v 1.15 2000/01/10 16:13:22 momjian Exp $ + * $Id: int8.h,v 1.16 2000/01/15 02:59:43 petere Exp $ * * NOTES * These data types are supported on all 64-bit architectures, and may @@ -91,7 +91,7 @@ extern int64 *int48div(int32 val1, int64 *val2); extern int64 *int48(int32 val); extern int32 int84(int64 *val); -#if NOT_USED +#ifdef NOT_USED extern int64 *int2vector (int16 val); extern int16 int82(int64 *val);