From 3f365ba0fcc4d98f70c3c73f99ea782dd0d84622 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 18 Sep 1997 20:22:58 +0000 Subject: [PATCH] Inline memset() as MemSet(). --- src/backend/access/common/heaptuple.c | 6 +++--- src/backend/access/common/indextuple.c | 4 ++-- src/backend/access/common/tupdesc.c | 6 +++--- src/backend/access/gist/gist.c | 4 ++-- src/backend/access/hash/hashovfl.c | 8 ++++---- src/backend/access/hash/hashpage.c | 8 ++++---- src/backend/access/nbtree/nbtpage.c | 4 ++-- src/backend/access/nbtree/nbtsort.c | 8 ++++---- src/backend/access/nbtree/nbtutils.c | 6 +++--- src/backend/access/rtree/rtproc.c | 6 +++--- src/backend/access/rtree/rtree.c | 4 ++-- src/backend/bootstrap/bootstrap.c | 4 ++-- src/backend/catalog/heap.c | 8 ++++---- src/backend/catalog/index.c | 12 ++++++------ src/backend/catalog/pg_aggregate.c | 4 ++-- src/backend/catalog/pg_operator.c | 8 ++++---- src/backend/catalog/pg_proc.c | 4 ++-- src/backend/catalog/pg_type.c | 4 ++-- src/backend/commands/defind.c | 4 ++-- src/backend/commands/explain.c | 4 ++-- src/backend/commands/remove.c | 4 ++-- src/backend/commands/trigger.c | 6 +++--- src/backend/commands/view.c | 4 ++-- src/backend/executor/execMain.c | 4 ++-- src/backend/executor/execTuples.c | 4 ++-- src/backend/executor/execUtils.c | 4 ++-- src/backend/executor/functions.c | 4 ++-- src/backend/executor/nodeAgg.c | 10 +++++----- src/backend/libpq/pqcomm.c | 8 ++++---- src/backend/nodes/nodes.c | 4 ++-- src/backend/optimizer/util/plancat.c | 10 +++++----- src/backend/parser/analyze.c | 4 ++-- src/backend/parser/catalog_utils.c | 6 +++--- src/backend/postmaster/postmaster.c | 4 ++-- src/backend/rewrite/rewriteManip.c | 4 ++-- src/backend/storage/buffer/buf_init.c | 4 ++-- src/backend/storage/buffer/bufmgr.c | 6 +++--- src/backend/storage/buffer/localbuf.c | 10 +++++----- src/backend/storage/file/fd.c | 4 ++-- src/backend/storage/ipc/ipc.c | 4 ++-- src/backend/storage/ipc/shmem.c | 8 ++++---- src/backend/storage/lmgr/lock.c | 18 +++++++++--------- src/backend/storage/lmgr/multi.c | 16 ++++++++-------- src/backend/storage/lmgr/proc.c | 10 +++++----- src/backend/storage/lmgr/single.c | 6 +++--- src/backend/storage/page/bufpage.c | 6 +++--- src/backend/storage/smgr/md.c | 8 ++++---- src/backend/storage/smgr/mm.c | 6 +++--- src/backend/tcop/fastpath.c | 4 ++-- src/backend/tcop/postgres.c | 10 +++++----- src/backend/tcop/pquery.c | 4 ++-- src/backend/utils/adt/acl.c | 4 ++-- src/backend/utils/adt/arrayfuncs.c | 14 +++++++------- src/backend/utils/adt/cash.c | 4 ++-- src/backend/utils/adt/geo_ops.c | 12 ++++++------ src/backend/utils/adt/numutils.c | 4 ++-- src/backend/utils/adt/oidname.c | 4 ++-- src/backend/utils/cache/catcache.c | 4 ++-- src/backend/utils/cache/relcache.c | 18 +++++++++--------- src/backend/utils/cache/syscache.c | 4 ++-- src/backend/utils/fmgr/dfmgr.c | 4 ++-- src/backend/utils/hash/dynahash.c | 10 +++++----- src/backend/utils/mmgr/portalmem.c | 8 ++++---- src/bin/psql/psql.c | 4 ++-- src/interfaces/libpq/fe-connect.c | 8 ++++---- src/interfaces/libpq/fe-lobj.c | 4 ++-- src/test/regress/regress.c | 6 +++--- src/tutorial/C-code/funcs.c | 4 ++-- 68 files changed, 218 insertions(+), 218 deletions(-) diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c index a06b7ed31e..78f92190a2 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.25 1997/09/12 04:07:06 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.26 1997/09/18 20:19:36 momjian Exp $ * * NOTES * The old interface functions have been converted to macros @@ -853,7 +853,7 @@ heap_formtuple(TupleDesc tupleDescriptor, tp = (char *) palloc(len); tuple = (HeapTuple) tp; - memset(tp, 0, (int) len); + MemSet(tp, 0, (int) len); tuple->t_len = len; tuple->t_natts = numberOfAttributes; @@ -1011,7 +1011,7 @@ heap_addheader(uint32 natts, /* max domain index */ len += structlen; tp = (char *) palloc(len); tup = (HeapTuple) tp; - memset((char *) tup, 0, len); + MemSet((char *) tup, 0, len); tup->t_len = (short) len; /* XXX */ tp += tup->t_hoff = hoff; diff --git a/src/backend/access/common/indextuple.c b/src/backend/access/common/indextuple.c index d2f1ba92ab..8d3fba5909 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.18 1997/09/08 21:40:24 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.19 1997/09/18 20:19:37 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -77,7 +77,7 @@ index_formtuple(TupleDesc tupleDescriptor, tp = (char *) palloc(size); tuple = (IndexTuple) tp; - memset(tp, 0, (int) size); + MemSet(tp, 0, (int) size); DataFill((char *) tp + hoff, tupleDescriptor, diff --git a/src/backend/access/common/tupdesc.c b/src/backend/access/common/tupdesc.c index b86d687c9d..c690918f61 100644 --- a/src/backend/access/common/tupdesc.c +++ b/src/backend/access/common/tupdesc.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.25 1997/09/10 23:57:49 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.26 1997/09/18 20:19:38 momjian Exp $ * * NOTES * some of the executor utility code such as "ExecTypeFromTL" should be @@ -61,7 +61,7 @@ CreateTemplateTupleDesc(int natts) desc = (TupleDesc) palloc(sizeof(struct tupleDesc)); desc->attrs = (AttributeTupleForm *) palloc(size); desc->constr = NULL; - memset(desc->attrs, 0, size); + MemSet(desc->attrs, 0, size); desc->natts = natts; @@ -296,7 +296,7 @@ TupleDescInitEntry(TupleDesc desc, if (attributeName != NULL) namestrcpy(&(att->attname), attributeName); else - memset(att->attname.data, 0, NAMEDATALEN); + MemSet(att->attname.data, 0, NAMEDATALEN); att->attdisbursion = 0; /* dummy value */ diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c index a66244eda0..f39b49ce72 100644 --- a/src/backend/access/gist/gist.c +++ b/src/backend/access/gist/gist.c @@ -608,7 +608,7 @@ gistAdjustKeys(Relation r, /* generate and insert new tuple */ tupDesc = r->rd_att; isnull = (char *) palloc(r->rd_rel->relnatts); - memset(isnull, ' ', r->rd_rel->relnatts); + MemSet(isnull, ' ', r->rd_rel->relnatts); newtup = (IndexTuple) index_formtuple(tupDesc, (Datum *) ¢ry.pred, isnull); pfree(isnull); @@ -1029,7 +1029,7 @@ GISTInitBuffer(Buffer b, uint32 f) pageSize = BufferGetPageSize(b); page = BufferGetPage(b); - memset(page, 0, (int) pageSize); + MemSet(page, 0, (int) pageSize); PageInit(page, pageSize, sizeof(GISTPageOpaqueData)); opaque = (GISTPageOpaque) PageGetSpecialPointer(page); diff --git a/src/backend/access/hash/hashovfl.c b/src/backend/access/hash/hashovfl.c index 9954fb90d0..03e479cdcc 100644 --- a/src/backend/access/hash/hashovfl.c +++ b/src/backend/access/hash/hashovfl.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.12 1997/09/08 20:53:59 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.13 1997/09/18 20:19:43 momjian Exp $ * * NOTES * Overflow pages look like ordinary relation pages. @@ -334,7 +334,7 @@ _hash_freeovflpage(Relation rel, Buffer ovflbuf) nextblkno = ovflopaque->hasho_nextblkno; prevblkno = ovflopaque->hasho_prevblkno; bucket = ovflopaque->hasho_bucket; - memset(ovflpage, 0, BufferGetPageSize(ovflbuf)); + MemSet(ovflpage, 0, BufferGetPageSize(ovflbuf)); _hash_wrtbuf(rel, ovflbuf); /* @@ -460,8 +460,8 @@ _hash_initbitmap(Relation rel, /* set all of the bits above 'nbits' to 1 */ clearints = ((nbits - 1) >> INT_TO_BIT) + 1; clearbytes = clearints << INT_TO_BYTE; - memset((char *) freep, 0, clearbytes); - memset(((char *) freep) + clearbytes, 0xFF, + MemSet((char *) freep, 0, clearbytes); + MemSet(((char *) freep) + clearbytes, 0xFF, BMPGSZ_BYTE(metap) - clearbytes); freep[clearints - 1] = ALL_SET << (nbits & INT_MASK); diff --git a/src/backend/access/hash/hashpage.c b/src/backend/access/hash/hashpage.c index 259f3cbe20..9de4f28f42 100644 --- a/src/backend/access/hash/hashpage.c +++ b/src/backend/access/hash/hashpage.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.12 1997/09/08 20:54:03 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.13 1997/09/18 20:19:46 momjian Exp $ * * NOTES * Postgres hash pages look like ordinary relation pages. The opaque @@ -122,8 +122,8 @@ _hash_metapinit(Relation rel) lg2nelem = 1; /* _hash_log2(MAX(nelem, 2)) */ nbuckets = 2; /* 1 << lg2nelem */ - memset((char *) metap->hashm_spares, 0, sizeof(metap->hashm_spares)); - memset((char *) metap->hashm_mapp, 0, sizeof(metap->hashm_mapp)); + MemSet((char *) metap->hashm_spares, 0, sizeof(metap->hashm_spares)); + MemSet((char *) metap->hashm_mapp, 0, sizeof(metap->hashm_mapp)); metap->hashm_spares[lg2nelem] = 2; /* lg2nelem + 1 */ metap->hashm_spares[lg2nelem + 1] = 2; /* lg2nelem + 1 */ @@ -310,7 +310,7 @@ _hash_pageinit(Page page, Size size) * creating new pages is an infrequent occurrence and it makes me feel * good when I know they're empty. */ - memset(page, 0, size); + MemSet(page, 0, size); PageInit(page, size, sizeof(HashPageOpaqueData)); } diff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c index 7bd074c09a..5cb1279c74 100644 --- a/src/backend/access/nbtree/nbtpage.c +++ b/src/backend/access/nbtree/nbtpage.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.12 1997/09/08 20:54:15 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.13 1997/09/18 20:19:49 momjian Exp $ * * NOTES * Postgres btree pages look like ordinary relation pages. The opaque @@ -418,7 +418,7 @@ _bt_pageinit(Page page, Size size) * good when I know they're empty. */ - memset(page, 0, size); + MemSet(page, 0, size); PageInit(page, size, sizeof(BTPageOpaqueData)); } diff --git a/src/backend/access/nbtree/nbtsort.c b/src/backend/access/nbtree/nbtsort.c index 154c3a81bf..2f1cc3aba8 100644 --- a/src/backend/access/nbtree/nbtsort.c +++ b/src/backend/access/nbtree/nbtsort.c @@ -5,7 +5,7 @@ * * * IDENTIFICATION - * $Id: nbtsort.c,v 1.23 1997/09/08 21:41:28 momjian Exp $ + * $Id: nbtsort.c,v 1.24 1997/09/18 20:19:53 momjian Exp $ * * NOTES * @@ -565,7 +565,7 @@ _bt_spoolinit(Relation index, int ntapes, bool isunique) { elog(WARN, "_bt_spoolinit: out of memory"); } - memset((char *) btspool, 0, sizeof(BTSpool)); + MemSet((char *) btspool, 0, sizeof(BTSpool)); btspool->bts_ntapes = ntapes; btspool->bts_tape = 0; btspool->isunique = isunique; @@ -852,7 +852,7 @@ _bt_pagestate(Relation index, int flags, int level, bool doupper) { BTPageState *state = (BTPageState *) palloc(sizeof(BTPageState)); - memset((char *) state, 0, sizeof(BTPageState)); + MemSet((char *) state, 0, sizeof(BTPageState)); _bt_blnewpage(index, &(state->btps_buf), &(state->btps_page), flags); state->btps_firstoff = InvalidOffsetNumber; state->btps_lastoff = P_HIKEY; @@ -1216,7 +1216,7 @@ _bt_merge(Relation index, BTSpool *btspool) * _bt_taperead will return 0 only if the tape is actually at * EOF. */ - memset((char *) &q, 0, sizeof(BTPriQueue)); + MemSet((char *) &q, 0, sizeof(BTPriQueue)); goodtapes = 0; for (t = 0; t < btspool->bts_ntapes; ++t) { diff --git a/src/backend/access/nbtree/nbtutils.c b/src/backend/access/nbtree/nbtutils.c index 2b77d77d4b..1eef73fb3f 100644 --- a/src/backend/access/nbtree/nbtutils.c +++ b/src/backend/access/nbtree/nbtutils.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtutils.c,v 1.14 1997/09/08 21:41:31 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtutils.c,v 1.15 1997/09/18 20:19:55 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -139,7 +139,7 @@ _bt_orderkeys(Relation relation, BTScanOpaque so) nbytes = BTMaxStrategyNumber * sizeof(ScanKeyData); xform = (ScanKey) palloc(nbytes); - memset(xform, 0, nbytes); + MemSet(xform, 0, nbytes); map = IndexStrategyGetStrategyMap(RelationGetIndexStrategy(relation), BTMaxStrategyNumber, attno); @@ -243,7 +243,7 @@ _bt_orderkeys(Relation relation, BTScanOpaque so) /* initialization for new attno */ attno = cur->sk_attno; - memset(xform, 0, nbytes); + MemSet(xform, 0, nbytes); map = IndexStrategyGetStrategyMap(RelationGetIndexStrategy(relation), BTMaxStrategyNumber, attno); diff --git a/src/backend/access/rtree/rtproc.c b/src/backend/access/rtree/rtproc.c index d93285c231..d8c4ad42c3 100644 --- a/src/backend/access/rtree/rtproc.c +++ b/src/backend/access/rtree/rtproc.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.11 1997/09/08 21:41:37 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.12 1997/09/18 20:19:56 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -96,7 +96,7 @@ rt_poly_union(POLYGON *a, POLYGON *b) if (!PointerIsValid(p)) elog(WARN, "Cannot allocate polygon for union"); - memset((char *) p, 0, sizeof(POLYGON)); /* zero any holes */ + MemSet((char *) p, 0, sizeof(POLYGON)); /* zero any holes */ p->size = sizeof(POLYGON); p->npts = 0; p->boundbox.high.x = Max(a->boundbox.high.x, b->boundbox.high.x); @@ -138,7 +138,7 @@ rt_poly_inter(POLYGON *a, POLYGON *b) if (!PointerIsValid(p)) elog(WARN, "Cannot allocate polygon for intersection"); - memset((char *) p, 0, sizeof(POLYGON)); /* zero any holes */ + MemSet((char *) p, 0, sizeof(POLYGON)); /* zero any holes */ p->size = sizeof(POLYGON); p->npts = 0; p->boundbox.high.x = Min(a->boundbox.high.x, b->boundbox.high.x); diff --git a/src/backend/access/rtree/rtree.c b/src/backend/access/rtree/rtree.c index 02d8aaead3..9415fc1655 100644 --- a/src/backend/access/rtree/rtree.c +++ b/src/backend/access/rtree/rtree.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.17 1997/09/08 21:41:39 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.18 1997/09/18 20:19:59 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -892,7 +892,7 @@ RTInitBuffer(Buffer b, uint32 f) pageSize = BufferGetPageSize(b); page = BufferGetPage(b); - memset(page, 0, (int) pageSize); + MemSet(page, 0, (int) pageSize); PageInit(page, pageSize, sizeof(RTreePageOpaqueData)); opaque = (RTreePageOpaque) PageGetSpecialPointer(page); diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index 829ad1b634..7ad0c5c019 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.25 1997/09/08 21:42:01 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.26 1997/09/18 20:20:04 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -894,7 +894,7 @@ AllocateAttribute() { elog(FATAL, "AllocateAttribute: malloc failed"); } - memset(attribute, 0, ATTRIBUTE_TUPLE_SIZE); + MemSet(attribute, 0, ATTRIBUTE_TUPLE_SIZE); return (attribute); } diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index a3fd606403..6c485d112e 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.28 1997/09/08 21:42:16 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.29 1997/09/18 20:20:11 momjian Exp $ * * INTERFACE ROUTINES * heap_creatr() - Create an uncataloged heap relation @@ -278,7 +278,7 @@ heap_creatr(char *name, len = sizeof(RelationData); rdesc = (Relation) palloc(len); - memset((char *) rdesc, 0, len); + MemSet((char *) rdesc, 0, len); /* ---------- create a new tuple descriptor from the one passed in @@ -303,7 +303,7 @@ heap_creatr(char *name, rdesc->rd_rel = (Form_pg_class) palloc(sizeof *rdesc->rd_rel); - memset((char *) rdesc->rd_rel, 0, + MemSet((char *) rdesc->rd_rel, 0, sizeof *rdesc->rd_rel); namestrcpy(&(rdesc->rd_rel->relname), relname); rdesc->rd_rel->relkind = RELKIND_UNCATALOGED; @@ -1444,7 +1444,7 @@ InitTempRelList(void) tempRels = (TempRelList *) malloc(sizeof(TempRelList)); tempRels->size = TEMP_REL_LIST_SIZE; tempRels->rels = (Relation *) malloc(sizeof(Relation) * tempRels->size); - memset(tempRels->rels, 0, sizeof(Relation) * tempRels->size); + MemSet(tempRels->rels, 0, sizeof(Relation) * tempRels->size); tempRels->num = 0; } diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 7255593330..6c391d2107 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.22 1997/09/08 21:42:18 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.23 1997/09/18 20:20:14 momjian Exp $ * * * INTERFACE ROUTINES @@ -283,7 +283,7 @@ BuildFuncTupleDesc(FuncIndexInfo *funcInfo) */ funcTupDesc = CreateTemplateTupleDesc(1); funcTupDesc->attrs[0] = (AttributeTupleForm) palloc(ATTRIBUTE_TUPLE_SIZE); - memset(funcTupDesc->attrs[0], 0, ATTRIBUTE_TUPLE_SIZE); + MemSet(funcTupDesc->attrs[0], 0, ATTRIBUTE_TUPLE_SIZE); /* * Lookup the function for the return type. @@ -679,8 +679,8 @@ AppendAttributeTuples(Relation indexRelation, int numatts) * initialize null[], replace[] and value[] * ---------------- */ - memset(nullv, ' ', Natts_pg_attribute); - memset(replace, ' ', Natts_pg_attribute); + MemSet(nullv, ' ', Natts_pg_attribute); + MemSet(replace, ' ', Natts_pg_attribute); /* ---------------- * create the first attribute tuple. @@ -840,8 +840,8 @@ UpdateIndexRelation(Oid indexoid, attributeList = lnext(attributeList); } - memset((char *) &indexForm->indkey[0], 0, sizeof indexForm->indkey); - memset((char *) &indexForm->indclass[0], 0, sizeof indexForm->indclass); + MemSet((char *) &indexForm->indkey[0], 0, sizeof indexForm->indkey); + MemSet((char *) &indexForm->indclass[0], 0, sizeof indexForm->indclass); /* ---------------- * copy index key and op class information diff --git a/src/backend/catalog/pg_aggregate.c b/src/backend/catalog/pg_aggregate.c index 95287334a6..4c3b11c54c 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.8 1997/09/08 21:42:22 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.9 1997/09/18 20:20:15 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -80,7 +80,7 @@ AggregateCreate(char *aggName, Oid fnArgs[8]; TupleDesc tupDesc; - memset(fnArgs, 0, 8 * sizeof(Oid)); + MemSet(fnArgs, 0, 8 * sizeof(Oid)); /* sanity checks */ if (!aggName) diff --git a/src/backend/catalog/pg_operator.c b/src/backend/catalog/pg_operator.c index 422c212811..b3ede1b3cc 100644 --- a/src/backend/catalog/pg_operator.c +++ b/src/backend/catalog/pg_operator.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.13 1997/09/08 02:21:48 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.14 1997/09/18 20:20:18 momjian Exp $ * * NOTES * these routines moved here from commands/define.c and somewhat cleaned up. @@ -519,7 +519,7 @@ OperatorDef(char *operatorName, * have to worry about deleting them later. * ---------------- */ - memset(typeId, 0, 8 * sizeof(Oid)); + MemSet(typeId, 0, 8 * sizeof(Oid)); if (!leftTypeName) { typeId[0] = rightTypeId; @@ -556,7 +556,7 @@ OperatorDef(char *operatorName, */ if (restrictionName) { /* optional */ - memset(typeId, 0, 8 * sizeof(Oid)); + MemSet(typeId, 0, 8 * sizeof(Oid)); typeId[0] = OIDOID; /* operator OID */ typeId[1] = OIDOID; /* relation OID */ typeId[2] = INT2OID; /* attribute number */ @@ -581,7 +581,7 @@ OperatorDef(char *operatorName, */ if (joinName) { /* optional */ - memset(typeId, 0, 8 * sizeof(Oid)); + MemSet(typeId, 0, 8 * sizeof(Oid)); typeId[0] = OIDOID; /* operator OID */ typeId[1] = OIDOID; /* relation OID 1 */ typeId[2] = INT2OID; /* attribute number 1 */ diff --git a/src/backend/catalog/pg_proc.c b/src/backend/catalog/pg_proc.c index 50c74c8d78..9cbf4e3d7c 100644 --- a/src/backend/catalog/pg_proc.c +++ b/src/backend/catalog/pg_proc.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.8 1997/09/08 21:42:23 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.9 1997/09/18 20:20:18 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -81,7 +81,7 @@ ProcedureCreate(char *procedureName, Assert(PointerIsValid(probin)); parameterCount = 0; - memset(typev, 0, 8 * sizeof(Oid)); + MemSet(typev, 0, 8 * sizeof(Oid)); foreach(x, argList) { Value *t = lfirst(x); diff --git a/src/backend/catalog/pg_type.c b/src/backend/catalog/pg_type.c index b6fe76bc1f..0c2292ab29 100644 --- a/src/backend/catalog/pg_type.c +++ b/src/backend/catalog/pg_type.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.10 1997/09/08 21:42:24 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.11 1997/09/18 20:20:19 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -399,7 +399,7 @@ TypeCreate(char *typeName, /* * arguments to type input and output functions must be 0 */ - memset(argList, 0, 8 * sizeof(Oid)); + MemSet(argList, 0, 8 * sizeof(Oid)); procs[0] = inputProcedure; procs[1] = outputProcedure; diff --git a/src/backend/commands/defind.c b/src/backend/commands/defind.c index 8b48e638ce..66f5cb4205 100644 --- a/src/backend/commands/defind.c +++ b/src/backend/commands/defind.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.16 1997/09/08 21:42:35 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.17 1997/09/18 20:20:20 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -442,7 +442,7 @@ FuncIndexArgs(IndexElem *funcIndex, } *opOidP = tuple->t_oid; - memset(argTypes, 0, 8 * sizeof(Oid)); + MemSet(argTypes, 0, 8 * sizeof(Oid)); /* * process the function arguments diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 55a8d2b85d..c0a7412276 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.13 1997/09/08 21:42:40 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.14 1997/09/18 20:20:22 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -70,7 +70,7 @@ ExplainQuery(Query *query, bool verbose, CommandDest dest) return; es = (ExplainState *) malloc(sizeof(ExplainState)); - memset(es, 0, sizeof(ExplainState)); + MemSet(es, 0, sizeof(ExplainState)); es->printCost = true; /* default */ diff --git a/src/backend/commands/remove.c b/src/backend/commands/remove.c index 5a5f811d7e..daa37b6714 100644 --- a/src/backend/commands/remove.c +++ b/src/backend/commands/remove.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.14 1997/09/08 21:42:44 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.15 1997/09/18 20:20:24 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -347,7 +347,7 @@ RemoveFunction(char *functionName, /* function name to be removed */ char *typename; int i; - memset(argList, 0, 8 * sizeof(Oid)); + MemSet(argList, 0, 8 * sizeof(Oid)); for (i = 0; i < nargs; i++) { /* typename = ((TypeName*)(lfirst(argNameList)))->name; */ diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index 5aa70f52cb..0b02570dd9 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -129,7 +129,7 @@ CreateTrigger(CreateTrigStmt * stmt) } heap_endscan(tgscan); - memset(fargtypes, 0, 8 * sizeof(Oid)); + MemSet(fargtypes, 0, 8 * sizeof(Oid)); tuple = SearchSysCacheTuple(PRONAME, PointerGetDatum(stmt->funcname), 0, PointerGetDatum(fargtypes), 0); @@ -141,7 +141,7 @@ CreateTrigger(CreateTrigStmt * stmt) if (((Form_pg_proc) GETSTRUCT(tuple))->prolang != ClanguageId) elog(WARN, "CreateTrigger: only C functions are supported"); - memset(nulls, ' ', Natts_pg_trigger * sizeof(char)); + MemSet(nulls, ' ', Natts_pg_trigger * sizeof(char)); values[Anum_pg_trigger_tgrelid - 1] = ObjectIdGetDatum(rel->rd_id); values[Anum_pg_trigger_tgname - 1] = NameGetDatum(namein(stmt->trigname)); @@ -340,7 +340,7 @@ RelationBuildTriggers(Relation relation) bool isnull; int found; - memset(trigdesc, 0, sizeof(TriggerDesc)); + MemSet(trigdesc, 0, sizeof(TriggerDesc)); ScanKeyEntryInitialize(&skey, (bits16) 0x0, diff --git a/src/backend/commands/view.c b/src/backend/commands/view.c index 0c4c62074c..1af5a2cb86 100644 --- a/src/backend/commands/view.c +++ b/src/backend/commands/view.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.11 1997/09/08 21:42:50 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.12 1997/09/18 20:20:27 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -129,7 +129,7 @@ MakeRetrieveViewRuleName(char *viewName) /* char buf[100]; - memset(buf, 0, sizeof(buf)); + MemSet(buf, 0, sizeof(buf)); sprintf(buf, "_RET%.*s", NAMEDATALEN, viewName->data); buf[15] = '\0'; namestrcpy(rule_name, buf); diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index 91dc05922a..2048e632ca 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -26,7 +26,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.25 1997/09/08 21:42:57 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.26 1997/09/18 20:20:29 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1286,7 +1286,7 @@ ExecAttrDefault(Relation rel, HeapTuple tuple) repl = (char *) palloc(rel->rd_att->natts * sizeof(char)); replNull = (char *) palloc(rel->rd_att->natts * sizeof(char)); replValue = (Datum *) palloc(rel->rd_att->natts * sizeof(Datum)); - memset(repl, ' ', rel->rd_att->natts * sizeof(char)); + MemSet(repl, ' ', rel->rd_att->natts * sizeof(char)); } repl[attrdef[i].adnum - 1] = 'r'; diff --git a/src/backend/executor/execTuples.c b/src/backend/executor/execTuples.c index 7e13b95b7a..f513354e49 100644 --- a/src/backend/executor/execTuples.c +++ b/src/backend/executor/execTuples.c @@ -14,7 +14,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.9 1997/09/08 21:43:03 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.10 1997/09/18 20:20:32 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -174,7 +174,7 @@ ExecCreateTupleTable(int initialSize) /* initial number of slots in * clean out the slots we just allocated * ---------------- */ - memset(array, 0, initialSize * sizeof(TupleTableSlot)); + MemSet(array, 0, initialSize * sizeof(TupleTableSlot)); /* ---------------- * initialize the new table and return it to the caller. diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c index ad478e06e1..e25a76c71b 100644 --- a/src/backend/executor/execUtils.c +++ b/src/backend/executor/execUtils.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.18 1997/09/08 21:43:05 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.19 1997/09/18 20:20:35 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -516,7 +516,7 @@ ExecSetTypeInfo(int index, if (attName != (char *) NULL) strNcpy(att->attname.data, attName, NAMEDATALEN - 1); else - memset(att->attname.data, 0, NAMEDATALEN); + MemSet(att->attname.data, 0, NAMEDATALEN); att->atttypid = typeID; att->attdefrel = 0; /* dummy value */ diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c index 54aa08f53e..a2f143d862 100644 --- a/src/backend/executor/functions.c +++ b/src/backend/executor/functions.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.11 1997/09/12 04:07:41 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.12 1997/09/18 20:20:37 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -142,7 +142,7 @@ init_execution_state(FunctionCachePtr fcache, paramLI = (ParamListInfo) palloc((nargs + 1) * sizeof(ParamListInfoData)); - memset(paramLI, 0, nargs * sizeof(ParamListInfoData)); + MemSet(paramLI, 0, nargs * sizeof(ParamListInfoData)); estate->es_param_list_info = paramLI; diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index 0acb1c58b1..57e1dc721b 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -128,13 +128,13 @@ ExecAgg(Agg *node) nulls = node->aggstate->csstate.cstate.cs_ExprContext->ecxt_nulls; value2 = (Datum *) palloc(sizeof(Datum) * nagg); - memset(value2, 0, sizeof(Datum) * nagg); + MemSet(value2, 0, sizeof(Datum) * nagg); aggFuncInfo = (AggFuncInfo *) palloc(sizeof(AggFuncInfo) * nagg); - memset(aggFuncInfo, 0, sizeof(AggFuncInfo) * nagg); + MemSet(aggFuncInfo, 0, sizeof(AggFuncInfo) * nagg); noInitValue = (int *) palloc(sizeof(int) * nagg); - memset(noInitValue, 0, sizeof(noInitValue) * nagg); + MemSet(noInitValue, 0, sizeof(noInitValue) * nagg); outerPlan = outerPlan(node); oneTuple = NULL; @@ -524,9 +524,9 @@ ExecInitAgg(Agg *node, EState *estate, Plan *parent) econtext = aggstate->csstate.cstate.cs_ExprContext; econtext->ecxt_values = (Datum *) palloc(sizeof(Datum) * node->numAgg); - memset(econtext->ecxt_values, 0, sizeof(Datum) * node->numAgg); + MemSet(econtext->ecxt_values, 0, sizeof(Datum) * node->numAgg); econtext->ecxt_nulls = (char *) palloc(node->numAgg); - memset(econtext->ecxt_nulls, 0, node->numAgg); + MemSet(econtext->ecxt_nulls, 0, node->numAgg); /* * initializes child nodes diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c index 550e797d27..40a9f32c23 100644 --- a/src/backend/libpq/pqcomm.c +++ b/src/backend/libpq/pqcomm.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.22 1997/09/08 21:43:49 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.23 1997/09/18 20:20:39 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -448,7 +448,7 @@ pq_getinaddr(struct sockaddr_in * sin, { struct hostent *hs; - memset((char *) sin, 0, sizeof(*sin)); + MemSet((char *) sin, 0, sizeof(*sin)); if (host) { @@ -582,7 +582,7 @@ StreamServerPort(char *hostName, short portName, int *fdP) if (!hostName) hostName = "localhost"; - memset((char *) &sin, 0, sizeof sin); + MemSet((char *) &sin, 0, sizeof sin); if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { @@ -731,7 +731,7 @@ StreamOpen(char *hostName, short portName, Port *port) pqdebug("%s", PQerrormsg); return (STATUS_ERROR); } - memset((char *) &port->raddr, 0, sizeof(port->raddr)); + MemSet((char *) &port->raddr, 0, sizeof(port->raddr)); memmove((char *) &(port->raddr.sin_addr), (char *) hp->h_addr, hp->h_length); diff --git a/src/backend/nodes/nodes.c b/src/backend/nodes/nodes.c index 1abee00b84..cab477ca26 100644 --- a/src/backend/nodes/nodes.c +++ b/src/backend/nodes/nodes.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/nodes.c,v 1.3 1997/09/08 02:23:40 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/nodes.c,v 1.4 1997/09/18 20:20:43 momjian Exp $ * * HISTORY * Andrew Yu Oct 20, 1994 file creation @@ -39,7 +39,7 @@ newNode(Size size, NodeTag tag) Assert(size >= 4); /* need the tag, at least */ newNode = (Node *) palloc(size); - memset((char *) newNode, 0, size); + MemSet((char *) newNode, 0, size); newNode->type = tag; return (newNode); } diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c index 826a0e7b8e..6b4d5ee13d 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.9 1997/09/08 21:45:53 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.10 1997/09/18 20:20:50 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -120,7 +120,7 @@ index_info(Query *root, bool first, int relid, IdxInfoRetval *info) /* find the oid of the indexed relation */ indrelid = getrelid(relid, root->rtable); - memset(info, 0, sizeof(IdxInfoRetval)); + MemSet(info, 0, sizeof(IdxInfoRetval)); /* * the maximum number of elements in each of the following arrays is @@ -128,11 +128,11 @@ index_info(Query *root, bool first, int relid, IdxInfoRetval *info) * the array. */ info->indexkeys = (int *) palloc(sizeof(int) * 9); - memset(info->indexkeys, 0, sizeof(int) * 9); + MemSet(info->indexkeys, 0, sizeof(int) * 9); info->orderOprs = (Oid *) palloc(sizeof(Oid) * 9); - memset(info->orderOprs, 0, sizeof(Oid) * 9); + MemSet(info->orderOprs, 0, sizeof(Oid) * 9); info->classlist = (Oid *) palloc(sizeof(Oid) * 9); - memset(info->classlist, 0, sizeof(Oid) * 9); + MemSet(info->classlist, 0, sizeof(Oid) * 9); /* Find an index on the given relation */ if (first) diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 0b6ab10206..2008ab4d7d 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.43 1997/09/18 14:32:15 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.44 1997/09/18 20:20:58 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -2325,7 +2325,7 @@ ParseFunc(ParseState *pstate, char *funcname, List *fargs, int *curr_resno) * transform relation name arguments into * varnodes of the * appropriate form. */ - memset(&oid_array[0], 0, 8 * sizeof(Oid)); + MemSet(&oid_array[0], 0, 8 * sizeof(Oid)); nargs = 0; foreach(i, fargs) diff --git a/src/backend/parser/catalog_utils.c b/src/backend/parser/catalog_utils.c index 40a92879f7..884dece094 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.27 1997/09/13 03:11:51 thomas Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.28 1997/09/18 20:21:05 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1036,7 +1036,7 @@ func_get_candidates(char *funcname, int nargs) palloc(sizeof(struct _CandidateList)); current_candidate->args = (Oid *) palloc(8 * sizeof(Oid)); - memset(current_candidate->args, 0, 8 * sizeof(Oid)); + MemSet(current_candidate->args, 0, 8 * sizeof(Oid)); for (i = 0; i < nargs; i++) { current_candidate->args[i] = @@ -1475,7 +1475,7 @@ genxprod(InhPaths *arginh, int nargs) for (;;) { oneres = (Oid *) palloc(MAXFARGS * sizeof(Oid)); - memset(oneres, 0, MAXFARGS * sizeof(Oid)); + MemSet(oneres, 0, MAXFARGS * sizeof(Oid)); for (i = nargs - 1; i >= 0 && cur[i] > arginh[i].nsupers; i--) continue; diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index eb35b294f8..248d8ab144 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.57 1997/09/08 21:46:16 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.58 1997/09/18 20:21:08 momjian Exp $ * * NOTES * @@ -1051,7 +1051,7 @@ BackendStartup(StartupInfo *packet, /* client's startup packet */ for (i = 0; i < 4; ++i) { - memset(envEntry[i], 0, 2 * ARGV_SIZE); + MemSet(envEntry[i], 0, 2 * ARGV_SIZE); } /* diff --git a/src/backend/rewrite/rewriteManip.c b/src/backend/rewrite/rewriteManip.c index 513733fde6..f7e3896040 100644 --- a/src/backend/rewrite/rewriteManip.c +++ b/src/backend/rewrite/rewriteManip.c @@ -6,7 +6,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.7 1997/09/08 21:46:43 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.8 1997/09/18 20:21:11 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -339,7 +339,7 @@ nodeHandleRIRAttributeRule(Node **nodePtr, int this_varno = (int) ((Var *) node)->varno; NameData name_to_look_for; - memset(name_to_look_for.data, 0, NAMEDATALEN); + MemSet(name_to_look_for.data, 0, NAMEDATALEN); if (this_varno == rt_index && ((Var *) node)->varattno == attr_num) diff --git a/src/backend/storage/buffer/buf_init.c b/src/backend/storage/buffer/buf_init.c index 9b2f7a237c..738ca638de 100644 --- a/src/backend/storage/buffer/buf_init.c +++ b/src/backend/storage/buffer/buf_init.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_init.c,v 1.13 1997/09/18 14:19:58 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_init.c,v 1.14 1997/09/18 20:21:16 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -175,7 +175,7 @@ InitBufferPool(IPCKey key) (BMT_LIMIT * sizeof(bmtrace)) + sizeof(long), &foundDescs); if (!foundDescs) - memset(CurTraceBuf, 0, (BMT_LIMIT * sizeof(bmtrace)) + sizeof(long)); + MemSet(CurTraceBuf, 0, (BMT_LIMIT * sizeof(bmtrace)) + sizeof(long)); TraceBuf = (bmtrace *) & (CurTraceBuf[1]); #endif diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 0fc48c2052..b29a5e76ca 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.24 1997/09/18 14:20:00 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.25 1997/09/18 20:21:21 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -271,7 +271,7 @@ ReadBufferWithBufferLock(Relation reln, if (extend) { /* new buffers are zero-filled */ - memset((char *) MAKE_PTR(bufHdr->data), 0, BLCKSZ); + MemSet((char *) MAKE_PTR(bufHdr->data), 0, BLCKSZ); smgrextend(bufHdr->bufsmgr, reln, (char *) MAKE_PTR(bufHdr->data)); } @@ -286,7 +286,7 @@ ReadBufferWithBufferLock(Relation reln, if (extend) { /* new buffers are zero-filled */ - memset((char *) MAKE_PTR(bufHdr->data), 0, BLCKSZ); + MemSet((char *) MAKE_PTR(bufHdr->data), 0, BLCKSZ); status = smgrextend(bufHdr->bufsmgr, reln, (char *) MAKE_PTR(bufHdr->data)); } diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c index 480dee7a7c..2b5c72d9db 100644 --- a/src/backend/storage/buffer/localbuf.c +++ b/src/backend/storage/buffer/localbuf.c @@ -15,7 +15,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.11 1997/09/08 21:46:52 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.12 1997/09/18 20:21:22 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -228,7 +228,7 @@ InitLocalBuffer(void) */ LocalBufferDescriptors = (BufferDesc *) malloc(sizeof(BufferDesc) * NLocBuffer); - memset(LocalBufferDescriptors, 0, sizeof(BufferDesc) * NLocBuffer); + MemSet(LocalBufferDescriptors, 0, sizeof(BufferDesc) * NLocBuffer); nextFreeLocalBuf = 0; for (i = 0; i < NLocBuffer; i++) @@ -246,7 +246,7 @@ InitLocalBuffer(void) LocalRefCount = (long *) malloc(sizeof(long) * NLocBuffer); - memset(LocalRefCount, 0, sizeof(long) * NLocBuffer); + MemSet(LocalRefCount, 0, sizeof(long) * NLocBuffer); } /* @@ -283,7 +283,7 @@ LocalBufferSync(void) } } - memset(LocalRefCount, 0, sizeof(long) * NLocBuffer); + MemSet(LocalRefCount, 0, sizeof(long) * NLocBuffer); nextFreeLocalBuf = 0; } @@ -301,6 +301,6 @@ ResetLocalBufferPool(void) buf->buf_id = -i - 2; } - memset(LocalRefCount, 0, sizeof(long) * NLocBuffer); + MemSet(LocalRefCount, 0, sizeof(long) * NLocBuffer); nextFreeLocalBuf = 0; } diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index beb0170afe..4a4a943e93 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/storage/file/fd.c @@ -6,7 +6,7 @@ * Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Id: fd.c,v 1.25 1997/09/08 21:46:54 momjian Exp $ + * $Id: fd.c,v 1.26 1997/09/18 20:21:24 momjian Exp $ * * NOTES: * @@ -423,7 +423,7 @@ AllocateVfd() for (i = SizeVfdCache; i < 2 * SizeVfdCache; i++) { - memset((char *) &(VfdCache[i]), 0, sizeof(VfdCache[0])); + MemSet((char *) &(VfdCache[i]), 0, sizeof(VfdCache[0])); VfdCache[i].nextFree = i + 1; VfdCache[i].fd = VFD_CLOSED; } diff --git a/src/backend/storage/ipc/ipc.c b/src/backend/storage/ipc/ipc.c index 2ef50c5c91..adb357193b 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.15 1997/09/18 14:20:14 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.16 1997/09/18 20:21:26 momjian Exp $ * * NOTES * @@ -90,7 +90,7 @@ PrivateMemoryCreate(IpcMemoryKey memKey, IpcPrivateMem[memid].memptr = malloc(size); if (IpcPrivateMem[memid].memptr == NULL) elog(WARN, "PrivateMemoryCreate: not enough memory to malloc"); - memset(IpcPrivateMem[memid].memptr, 0, size); /* XXX PURIFY */ + MemSet(IpcPrivateMem[memid].memptr, 0, size); /* XXX PURIFY */ return (memid++); } diff --git a/src/backend/storage/ipc/shmem.c b/src/backend/storage/ipc/shmem.c index a83dc9b11c..1303c1bdef 100644 --- a/src/backend/storage/ipc/shmem.c +++ b/src/backend/storage/ipc/shmem.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.13 1997/09/08 21:47:09 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.14 1997/09/18 20:21:30 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -226,7 +226,7 @@ InitShmem(unsigned int key, unsigned int size) * there is an entry there, someone else created the table. Otherwise, * we did and we have to initialize it. */ - memset(item.key, 0, BTABLE_KEYSIZE); + MemSet(item.key, 0, BTABLE_KEYSIZE); strncpy(item.key, "BindingTable", BTABLE_KEYSIZE); result = (BindingEnt *) @@ -407,7 +407,7 @@ ShmemPIDLookup(int pid, SHMEM_OFFSET *locationPtr) bool found; Assert(BindingTable); - memset(item.key, 0, BTABLE_KEYSIZE); + MemSet(item.key, 0, BTABLE_KEYSIZE); sprintf(item.key, "PID %d", pid); SpinAcquire(BindingLock); @@ -455,7 +455,7 @@ ShmemPIDDestroy(int pid) Assert(BindingTable); - memset(item.key, 0, BTABLE_KEYSIZE); + MemSet(item.key, 0, BTABLE_KEYSIZE); sprintf(item.key, "PID %d", pid); SpinAcquire(BindingLock); diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c index c8abb92e46..116f431e3d 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.15 1997/09/18 14:20:22 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.16 1997/09/18 20:21:35 momjian Exp $ * * NOTES * Outside modules can create a lock table and acquire/release @@ -293,7 +293,7 @@ LockTabInit(char *tabName, */ if (!found) { - memset(ltable->ctl, 0, sizeof(LOCKCTL)); + MemSet(ltable->ctl, 0, sizeof(LOCKCTL)); ltable->ctl->masterLock = LockMgrLock; ltable->ctl->tableId = NumTables; } @@ -518,8 +518,8 @@ LockAcquire(LockTableId tableId, LOCKTAG *lockName, LOCKT lockt) { lock->mask = 0; ProcQueueInit(&(lock->waitProcs)); - memset((char *) lock->holders, 0, sizeof(int) * MAX_LOCKTYPES); - memset((char *) lock->activeHolders, 0, sizeof(int) * MAX_LOCKTYPES); + MemSet((char *) lock->holders, 0, sizeof(int) * MAX_LOCKTYPES); + MemSet((char *) lock->activeHolders, 0, sizeof(int) * MAX_LOCKTYPES); lock->nHolding = 0; lock->nActive = 0; @@ -541,7 +541,7 @@ LockAcquire(LockTableId tableId, LOCKTAG *lockName, LOCKT lockt) * word alignment and ensures hashing consistency). * ------------------ */ - memset(&item, 0, XID_TAGSIZE); /* must clear padding, needed */ + MemSet(&item, 0, XID_TAGSIZE); /* must clear padding, needed */ TransactionIdStore(myXid, &item.tag.xid); item.tag.lock = MAKE_OFFSET(lock); #if 0 @@ -571,7 +571,7 @@ LockAcquire(LockTableId tableId, LOCKTAG *lockName, LOCKT lockt) XID_PRINT("LockAcquire: queueing XidEnt", result); ProcAddLock(&result->queue); result->nHolding = 0; - memset((char *) result->holders, 0, sizeof(int) * MAX_LOCKTYPES); + MemSet((char *) result->holders, 0, sizeof(int) * MAX_LOCKTYPES); } /* ---------------- @@ -683,7 +683,7 @@ LockResolveConflicts(LOCKTAB *ltable, * word alignment and ensures hashing consistency. * ------------------ */ - memset(&item, 0, XID_TAGSIZE); + MemSet(&item, 0, XID_TAGSIZE); TransactionIdStore(xid, &item.tag.xid); item.tag.lock = MAKE_OFFSET(lock); #if 0 @@ -705,7 +705,7 @@ LockResolveConflicts(LOCKTAB *ltable, * the lock stats. * --------------- */ - memset(result->holders, 0, nLockTypes * sizeof(*(lock->holders))); + MemSet(result->holders, 0, nLockTypes * sizeof(*(lock->holders))); result->nHolding = 0; } @@ -951,7 +951,7 @@ LockRelease(LockTableId tableId, LOCKTAG *lockName, LOCKT lockt) * word alignment and ensures hashing consistency). * ------------------ */ - memset(&item, 0, XID_TAGSIZE); + MemSet(&item, 0, XID_TAGSIZE); TransactionIdStore(GetCurrentTransactionId(), &item.tag.xid); item.tag.lock = MAKE_OFFSET(lock); diff --git a/src/backend/storage/lmgr/multi.c b/src/backend/storage/lmgr/multi.c index f62129595d..6862111e2d 100644 --- a/src/backend/storage/lmgr/multi.c +++ b/src/backend/storage/lmgr/multi.c @@ -12,7 +12,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Attic/multi.c,v 1.7 1997/09/08 21:47:29 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Attic/multi.c,v 1.8 1997/09/18 20:21:38 momjian Exp $ * * NOTES: * (1) The lock.c module assumes that the caller here is doing @@ -128,7 +128,7 @@ MultiLockReln(LockInfo linfo, LOCKT lockt) * LOCKTAG has two bytes of padding, unfortunately. The hash function * will return miss if the padding bytes aren't zero'd. */ - memset(&tag, 0, sizeof(tag)); + MemSet(&tag, 0, sizeof(tag)); tag.relId = linfo->lRelId.relId; tag.dbId = linfo->lRelId.dbId; return (MultiAcquire(MultiTableId, &tag, lockt, RELN_LEVEL)); @@ -151,7 +151,7 @@ MultiLockTuple(LockInfo linfo, ItemPointer tidPtr, LOCKT lockt) * LOCKTAG has two bytes of padding, unfortunately. The hash function * will return miss if the padding bytes aren't zero'd. */ - memset(&tag, 0, sizeof(tag)); + MemSet(&tag, 0, sizeof(tag)); tag.relId = linfo->lRelId.relId; tag.dbId = linfo->lRelId.dbId; @@ -173,7 +173,7 @@ MultiLockPage(LockInfo linfo, ItemPointer tidPtr, LOCKT lockt) * LOCKTAG has two bytes of padding, unfortunately. The hash function * will return miss if the padding bytes aren't zero'd. */ - memset(&tag, 0, sizeof(tag)); + MemSet(&tag, 0, sizeof(tag)); /* ---------------------------- @@ -247,7 +247,7 @@ MultiAcquire(LockTableId tableId, * for the lower levels. Always start from the highest level and go * to the lowest level. */ - memset(tmpTag, 0, sizeof(*tmpTag)); + MemSet(tmpTag, 0, sizeof(*tmpTag)); tmpTag->relId = tag->relId; tmpTag->dbId = tag->dbId; @@ -319,7 +319,7 @@ MultiReleasePage(LockInfo linfo, ItemPointer tidPtr, LOCKT lockt) * zero'd. * ------------------ */ - memset(&tag, 0, sizeof(LOCKTAG)); + MemSet(&tag, 0, sizeof(LOCKTAG)); tag.relId = linfo->lRelId.relId; tag.dbId = linfo->lRelId.dbId; @@ -345,7 +345,7 @@ MultiReleaseReln(LockInfo linfo, LOCKT lockt) * zero'd. * ------------------ */ - memset(&tag, 0, sizeof(LOCKTAG)); + MemSet(&tag, 0, sizeof(LOCKTAG)); tag.relId = linfo->lRelId.relId; tag.dbId = linfo->lRelId.dbId; @@ -401,7 +401,7 @@ MultiRelease(LockTableId tableId, * Must zero out the tag to set padding byes to zero and ensure hashing * consistency. */ - memset(tmpTag, 0, sizeof(*tmpTag)); + MemSet(tmpTag, 0, sizeof(*tmpTag)); tmpTag->relId = tag->relId; tmpTag->dbId = tag->dbId; diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index 07abe6ce96..6c21f4e4a7 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.21 1997/09/08 21:47:30 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.22 1997/09/18 20:21:39 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -46,7 +46,7 @@ * This is so that we can support more backends. (system-wide semaphore * sets run out pretty fast.) -ay 4/95 * - * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.21 1997/09/08 21:47:30 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.22 1997/09/18 20:21:39 momjian Exp $ */ #include #include @@ -217,7 +217,7 @@ InitProcess(IPCKey key) * ProcStructLock to 1 as we have acquired this spinlock above but * didn't record it since we didn't have MyProc until now. */ - memset(MyProc->sLocks, 0, sizeof(MyProc->sLocks)); + MemSet(MyProc->sLocks, 0, sizeof(MyProc->sLocks)); MyProc->sLocks[ProcStructLock] = 1; @@ -271,7 +271,7 @@ InitProcess(IPCKey key) * this initialization is forever botched * ---------------- */ - memset(MyProc->sLocks, 0, MAX_SPINS * sizeof(*MyProc->sLocks)); + MemSet(MyProc->sLocks, 0, MAX_SPINS * sizeof(*MyProc->sLocks)); /* ------------------------- * Install ourselves in the binding table. The name to @@ -514,7 +514,7 @@ ProcSleep(PROC_QUEUE *queue, * to 0. * -------------- */ - memset(&timeval, 0, sizeof(struct itimerval)); + MemSet(&timeval, 0, sizeof(struct itimerval)); timeval.it_value.tv_sec = DEADLOCK_TIMEOUT; if (setitimer(ITIMER_REAL, &timeval, &dummy)) diff --git a/src/backend/storage/lmgr/single.c b/src/backend/storage/lmgr/single.c index 9e33b36617..3f5781a582 100644 --- a/src/backend/storage/lmgr/single.c +++ b/src/backend/storage/lmgr/single.c @@ -13,7 +13,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Attic/single.c,v 1.4 1997/09/08 02:29:20 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Attic/single.c,v 1.5 1997/09/18 20:21:40 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -40,7 +40,7 @@ SingleLockReln(LockInfo linfo, LOCKT lockt, int action) * LOCKTAG has two bytes of padding, unfortunately. The hash function * will return miss if the padding bytes aren't zero'd. */ - memset(&tag, 0, sizeof(tag)); + MemSet(&tag, 0, sizeof(tag)); tag.relId = linfo->lRelId.relId; tag.dbId = linfo->lRelId.dbId; BlockIdSet(&(tag.tupleId.ip_blkid), InvalidBlockNumber); @@ -72,7 +72,7 @@ SingleLockPage(LockInfo linfo, * LOCKTAG has two bytes of padding, unfortunately. The hash function * will return miss if the padding bytes aren't zero'd. */ - memset(&tag, 0, sizeof(tag)); + MemSet(&tag, 0, sizeof(tag)); tag.relId = linfo->lRelId.relId; tag.dbId = linfo->lRelId.dbId; BlockIdCopy(&(tag.tupleId.ip_blkid), &(tidPtr->ip_blkid)); diff --git a/src/backend/storage/page/bufpage.c b/src/backend/storage/page/bufpage.c index b888bb9ea2..f54eefd84e 100644 --- a/src/backend/storage/page/bufpage.c +++ b/src/backend/storage/page/bufpage.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/page/bufpage.c,v 1.10 1997/09/08 02:29:22 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/page/bufpage.c,v 1.11 1997/09/18 20:21:41 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -202,7 +202,7 @@ PageGetTempPage(Page page, Size specialSize) /* clear out the middle */ size = (pageSize - sizeof(PageHeaderData)) + sizeof(ItemIdData); size -= DOUBLEALIGN(specialSize); - memset((char *) &(thdr->pd_linp[0]), 0, size); + MemSet((char *) &(thdr->pd_linp[0]), 0, size); /* set high, low water marks */ thdr->pd_lower = sizeof(PageHeaderData) - sizeof(ItemIdData); @@ -311,7 +311,7 @@ PageRepairFragmentation(Page page) { /* nused != 0 */ itemidbase = (struct itemIdSortData *) palloc(sizeof(struct itemIdSortData) * nused); - memset((char *) itemidbase, 0, sizeof(struct itemIdSortData) * nused); + MemSet((char *) itemidbase, 0, sizeof(struct itemIdSortData) * nused); itemidptr = itemidbase; for (i = 0; i < nline; i++) { diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c index 340a970974..48d221ffd1 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.21 1997/09/08 21:47:32 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.22 1997/09/18 20:21:45 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -96,7 +96,7 @@ mdinit() if (Md_fdvec == (MdfdVec *) NULL) return (SM_FAIL); - memset(Md_fdvec, 0, Nfds * sizeof(MdfdVec)); + MemSet(Md_fdvec, 0, Nfds * sizeof(MdfdVec)); /* Set free list */ for (i = 0; i < Nfds; i++) @@ -362,7 +362,7 @@ mdread(Relation reln, BlockNumber blocknum, char *buffer) { if (nbytes == 0) { - memset(buffer, 0, BLCKSZ); + MemSet(buffer, 0, BLCKSZ); } else { @@ -695,7 +695,7 @@ _fdvec_alloc() oldcxt = MemoryContextSwitchTo(MdCxt); nvec = (MdfdVec *) palloc(Nfds * sizeof(MdfdVec)); - memset(nvec, 0, Nfds * sizeof(MdfdVec)); + MemSet(nvec, 0, Nfds * sizeof(MdfdVec)); memmove(nvec, (char *) Md_fdvec, CurFd * sizeof(MdfdVec)); pfree(Md_fdvec); diff --git a/src/backend/storage/smgr/mm.c b/src/backend/storage/smgr/mm.c index a365410bb1..c666644ebc 100644 --- a/src/backend/storage/smgr/mm.c +++ b/src/backend/storage/smgr/mm.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/smgr/Attic/mm.c,v 1.6 1997/09/08 02:29:33 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/smgr/Attic/mm.c,v 1.7 1997/09/18 20:21:53 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -141,7 +141,7 @@ mminit() if (IsPostmaster) { - memset(mmcacheblk, 0, mmsize); + MemSet(mmcacheblk, 0, mmsize); SpinRelease(MMCacheLock); return (SM_SUCCESS); } @@ -407,7 +407,7 @@ mmread(Relation reln, BlockNumber blocknum, char *buffer) { /* reading nonexistent pages is defined to fill them with zeroes */ SpinRelease(MMCacheLock); - memset(buffer, 0, BLCKSZ); + MemSet(buffer, 0, BLCKSZ); return (SM_SUCCESS); } diff --git a/src/backend/tcop/fastpath.c b/src/backend/tcop/fastpath.c index bc7845ca40..0573ea2fc8 100644 --- a/src/backend/tcop/fastpath.c +++ b/src/backend/tcop/fastpath.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/fastpath.c,v 1.6 1997/09/08 02:29:47 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/fastpath.c,v 1.7 1997/09/18 20:21:58 momjian Exp $ * * NOTES * This cruft is the server side of PQfn. @@ -202,7 +202,7 @@ update_fp_info(Oid func_id, struct fp_info * fip) * fp_info, since we can be interrupted (i.e., with an elog(WARN, * ...)) at any time. */ - memset((char *) fip, 0, (int) sizeof(struct fp_info)); + MemSet((char *) fip, 0, (int) sizeof(struct fp_info)); fip->funcid = InvalidOid; func_htp = SearchSysCacheTuple(PROOID, ObjectIdGetDatum(func_id), diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 4726071aaf..010ea1214c 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.48 1997/09/18 14:33:33 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.49 1997/09/18 20:22:03 momjian Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -1378,7 +1378,7 @@ PostgresMain(int argc, char *argv[]) if (!Quiet) printf("\tAbortCurrentTransaction() at %s\n", ctime(&tim)); - memset(parser_input, 0, MAX_PARSE_BUFFER); + MemSet(parser_input, 0, MAX_PARSE_BUFFER); AbortCurrentTransaction(); } @@ -1391,7 +1391,7 @@ PostgresMain(int argc, char *argv[]) if (IsUnderPostmaster == false) { puts("\nPOSTGRES backend interactive interface"); - puts("$Revision: 1.48 $ $Date: 1997/09/18 14:33:33 $"); + puts("$Revision: 1.49 $ $Date: 1997/09/18 20:22:03 $"); } /* ---------------- @@ -1426,7 +1426,7 @@ PostgresMain(int argc, char *argv[]) { /* new connection pending on our well-known port's socket */ newFE = (FrontEnd *) malloc(sizeof(FrontEnd)); - memset(newFE, 0, sizeof(FrontEnd)); + MemSet(newFE, 0, sizeof(FrontEnd)); newFE->fn_connected = false; newFE->fn_done = false; newPort = &(newFE->fn_port); @@ -1502,7 +1502,7 @@ PostgresMain(int argc, char *argv[]) * (1) read a command. * ---------------- */ - memset(parser_input, 0, MAX_PARSE_BUFFER); + MemSet(parser_input, 0, MAX_PARSE_BUFFER); firstchar = ReadCommand(parser_input, multiplexedBackend); /* process the command */ diff --git a/src/backend/tcop/pquery.c b/src/backend/tcop/pquery.c index c482c871d8..360f41303e 100644 --- a/src/backend/tcop/pquery.c +++ b/src/backend/tcop/pquery.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.10 1997/09/08 21:47:55 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.11 1997/09/18 20:22:05 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -97,7 +97,7 @@ CreateExecutorState(void) state->es_junkFilter = NULL; refcount = (long *) palloc(NBuffers * sizeof(long)); - memset((char *) refcount, 0, NBuffers * sizeof(long)); + MemSet((char *) refcount, 0, NBuffers * sizeof(long)); state->es_refcount = (int *) refcount; /* ---------------- diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c index 119bac40ef..f7467d29fd 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.17 1997/09/08 21:48:05 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.18 1997/09/18 20:22:08 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -192,7 +192,7 @@ makeacl(int n) size = ACL_N_SIZE(n); if (!(new_acl = (Acl *) palloc(size))) elog(WARN, "makeacl: palloc failed on %d\n", size); - memset((char *) new_acl, 0, size); + MemSet((char *) new_acl, 0, size); new_acl->size = size; new_acl->ndim = 1; new_acl->flags = 0; diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c index a9a32d11c5..6ba5f6b7e4 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.19 1997/09/08 21:48:09 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.20 1997/09/18 20:22:10 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -199,7 +199,7 @@ array_in(char *string, /* input array in external form */ { char *emptyArray = palloc(sizeof(ArrayType)); - memset(emptyArray, 0, sizeof(ArrayType)); + MemSet(emptyArray, 0, sizeof(ArrayType)); *(int32 *) emptyArray = sizeof(ArrayType); return emptyArray; } @@ -213,7 +213,7 @@ array_in(char *string, /* input array in external form */ &nbytes); nbytes += ARR_OVERHEAD(ndim); retval = (ArrayType *) palloc(nbytes); - memset(retval, 0, nbytes); + MemSet(retval, 0, nbytes); memmove(retval, (char *) &nbytes, sizeof(int)); memmove((char *) ARR_NDIM_PTR(retval), (char *) &ndim, sizeof(int)); SET_LO_FLAG(false, retval); @@ -240,7 +240,7 @@ array_in(char *string, /* input array in external form */ dim, typlen); nbytes = bytes + ARR_OVERHEAD(ndim); retval = (ArrayType *) palloc(nbytes); - memset(retval, 0, nbytes); + MemSet(retval, 0, nbytes); memmove(retval, (char *) &nbytes, sizeof(int)); memmove((char *) ARR_NDIM_PTR(retval), (char *) &ndim, sizeof(int)); SET_LO_FLAG(true, retval); @@ -391,7 +391,7 @@ _ReadArrayStr(char *arrayStr, for (i = 0; i < ndim; indx[i++] = 0); /* read array enclosed within {} */ values = (char **) palloc(nitems * sizeof(char *)); - memset(values, 0, nitems * sizeof(char *)); + MemSet(values, 0, nitems * sizeof(char *)); q = p = arrayStr; while (!eoArray) @@ -482,7 +482,7 @@ _ReadArrayStr(char *arrayStr, if (!values[i]) { values[i] = palloc(typlen); - memset(values[i], 0, typlen); + MemSet(values[i], 0, typlen); } } else @@ -788,7 +788,7 @@ array_dims(ArrayType *v, bool *isNull) * 33 since we assume 15 digits per number + ':' +'[]' */ save_p = p = (char *) palloc(nbytes + 4); - memset(save_p, 0, nbytes + 4); + MemSet(save_p, 0, nbytes + 4); dimv = ARR_DIMS(v); lb = ARR_LBOUND(v); p += 4; diff --git a/src/backend/utils/adt/cash.c b/src/backend/utils/adt/cash.c index 58b8451f63..46dc66ba6e 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.14 1997/09/13 12:05:32 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.15 1997/09/18 20:22:12 momjian Exp $ */ #include @@ -226,7 +226,7 @@ cash_out(Cash *in_value) } /* allow for trailing negative strings */ - memset(buf, ' ', CASH_BUFSZ); + MemSet(buf, ' ', CASH_BUFSZ); buf[TERMINATOR] = buf[LAST_PAREN] = '\0'; while (value || count > (point_pos - 2)) diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c index 031f754ee6..3458b48d89 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.23 1997/09/08 21:48:27 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.24 1997/09/18 20:22:13 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -2549,7 +2549,7 @@ poly_in(char *str) size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * npts); poly = PALLOC(size); - memset((char *) poly, 0, size); /* zero any holes */ + MemSet((char *) poly, 0, size); /* zero any holes */ poly->size = size; poly->npts = npts; @@ -3191,7 +3191,7 @@ upgradepath(PATH *path) npts = (path->npts - 1); size = offsetof(PATH, p[0]) +(sizeof(path->p[0]) * npts); result = PALLOC(size); - memset((char *) result, 0, size); + MemSet((char *) result, 0, size); result->size = size; result->npts = npts; @@ -3351,7 +3351,7 @@ upgradepoly(POLYGON *poly) size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * poly->npts); result = PALLOC(size); - memset((char *) result, 0, size); + MemSet((char *) result, 0, size); result->size = size; result->npts = poly->npts; @@ -3398,7 +3398,7 @@ revertpoly(POLYGON *poly) size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * poly->npts); result = PALLOC(size); - memset((char *) result, 0, size); + MemSet((char *) result, 0, size); result->size = size; result->npts = poly->npts; @@ -3996,7 +3996,7 @@ circle_poly(int npts, CIRCLE *circle) size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * npts); poly = PALLOC(size); - memset((char *) poly, 0, size); /* zero any holes */ + MemSet((char *) poly, 0, size); /* zero any holes */ poly->size = size; poly->npts = npts; diff --git a/src/backend/utils/adt/numutils.c b/src/backend/utils/adt/numutils.c index 3c698c93c4..dd33d41081 100644 --- a/src/backend/utils/adt/numutils.c +++ b/src/backend/utils/adt/numutils.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.15 1997/09/08 02:30:53 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.16 1997/09/18 20:22:15 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -154,7 +154,7 @@ ftoa(double value, char *ascii, int width, int prec1, char format) sprintf(out, fmt, value); if ((ret = strlen(out)) > width) { - memset(ascii, '*', width - 2); + MemSet(ascii, '*', width - 2); ascii[width] = 0; return (0); } diff --git a/src/backend/utils/adt/oidname.c b/src/backend/utils/adt/oidname.c index a6ff8e1a30..09bee543f8 100644 --- a/src/backend/utils/adt/oidname.c +++ b/src/backend/utils/adt/oidname.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidname.c,v 1.7 1997/09/08 21:48:37 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidname.c,v 1.8 1997/09/18 20:22:16 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -28,7 +28,7 @@ oidnamein(char *inStr) oc = (OidName) palloc(sizeof(OidNameData)); - memset(oc, 0, sizeof(OidNameData)); + MemSet(oc, 0, sizeof(OidNameData)); for (inptr = inStr; *inptr && *inptr != ','; inptr++) ; diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c index f0d41a7116..f63f22df0f 100644 --- a/src/backend/utils/cache/catcache.c +++ b/src/backend/utils/cache/catcache.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.15 1997/09/18 14:20:29 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.16 1997/09/18 20:22:18 momjian Exp $ * * Notes: * XXX This needs to use exception.h to handle recovery when @@ -676,7 +676,7 @@ InitSysCache(char *relname, * ---------------- */ cp = (CatCache *) palloc(sizeof(CatCache)); - memset((char *) cp, 0, sizeof(CatCache)); + MemSet((char *) cp, 0, sizeof(CatCache)); /* ---------------- * initialize the cache buckets (each bucket is a list header) diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 410355aa37..c930acc8bf 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.24 1997/09/12 06:57:04 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.25 1997/09/18 20:22:24 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -302,7 +302,7 @@ BuildDescInfoError(RelationBuildDescInfo buildinfo) { static char errBuf[64]; - memset(errBuf, 0, (int) sizeof(errBuf)); + MemSet(errBuf, 0, (int) sizeof(errBuf)); switch (buildinfo.infotype) { case INFO_RELID: @@ -494,7 +494,7 @@ AllocateRelationDesc(u_int natts, Form_pg_class relp) * clear new reldesc * ---------------- */ - memset((char *) relation, 0, len); + MemSet((char *) relation, 0, len); /* initialize attribute tuple form */ relation->rd_att = CreateTemplateTupleDesc(natts); @@ -670,7 +670,7 @@ build_tupdesc_ind(RelationBuildDescInfo buildinfo, constr->num_check = relation->rd_rel->relchecks; constr->check = (ConstrCheck *) palloc(constr->num_check * sizeof(ConstrCheck)); - memset(constr->check, 0, constr->num_check * sizeof(ConstrCheck)); + MemSet(constr->check, 0, constr->num_check * sizeof(ConstrCheck)); RelCheckFetch(relation); } else @@ -1043,7 +1043,7 @@ formrdesc(char *relationName, */ len = sizeof(RelationData); relation = (Relation) palloc(len); - memset((char *) relation, 0, len); + MemSet((char *) relation, 0, len); /* ---------------- * don't open the unix file yet.. @@ -1063,7 +1063,7 @@ formrdesc(char *relationName, */ relation->rd_rel = (Form_pg_class) palloc((Size) (sizeof(*relation->rd_rel))); - memset(relation->rd_rel, 0, sizeof(FormData_pg_class)); + MemSet(relation->rd_rel, 0, sizeof(FormData_pg_class)); namestrcpy(&relation->rd_rel->relname, relationName); /* ---------------- @@ -1106,7 +1106,7 @@ formrdesc(char *relationName, relation->rd_att->attrs[i] = (AttributeTupleForm) palloc(ATTRIBUTE_TUPLE_SIZE); - memset((char *) relation->rd_att->attrs[i], 0, + MemSet((char *) relation->rd_att->attrs[i], 0, ATTRIBUTE_TUPLE_SIZE); memmove((char *) relation->rd_att->attrs[i], (char *) &att[i], @@ -1657,7 +1657,7 @@ RelationInitialize(void) * create global caches * ---------------- */ - memset(&ctl, 0, (int) sizeof(ctl)); + MemSet(&ctl, 0, (int) sizeof(ctl)); ctl.keysize = sizeof(NameData); ctl.datasize = sizeof(Relation); RelationNameCache = hash_create(INITRELCACHESIZE, &ctl, HASH_ELEM); @@ -1932,7 +1932,7 @@ init_irels(void) } ird = irel[relno] = (Relation) palloc(len); - memset(ird, 0, len); + MemSet(ird, 0, len); /* then, read the Relation structure */ if ((nread = FileRead(fd, (char *) ird, len)) != len) diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c index 2a2fc2544e..149e99888e 100644 --- a/src/backend/utils/cache/syscache.c +++ b/src/backend/utils/cache/syscache.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.8 1997/09/12 04:08:35 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.9 1997/09/18 20:22:25 momjian Exp $ * * NOTES * These routines allow the parser/planner/executor to perform @@ -332,7 +332,7 @@ static int32 SysCacheSize = lengthof(cacheinfo); void zerocaches() { - memset((char *) SysCache, 0, SysCacheSize * sizeof(struct catcache *)); + MemSet((char *) SysCache, 0, SysCacheSize * sizeof(struct catcache *)); } /* diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c index 3c2e9a7086..d67069406b 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.12 1997/09/12 04:08:39 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.13 1997/09/18 20:22:27 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -189,7 +189,7 @@ handle_load(char *filename, char *funcname) malloc(sizeof(DynamicFileList)); file_scanner = file_tail->next; } - memset((char *) file_scanner, 0, sizeof(DynamicFileList)); + MemSet((char *) file_scanner, 0, sizeof(DynamicFileList)); strcpy(file_scanner->filename, filename); file_scanner->device = stat_buf.st_dev; diff --git a/src/backend/utils/hash/dynahash.c b/src/backend/utils/hash/dynahash.c index 5ea36ca943..b1c6fa4f44 100644 --- a/src/backend/utils/hash/dynahash.c +++ b/src/backend/utils/hash/dynahash.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.10 1997/09/08 21:49:13 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.11 1997/09/18 20:22:30 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -162,7 +162,7 @@ hash_create(int nelem, HASHCTL *info, int flags) hashp = (HTAB *) MEM_ALLOC((unsigned long) sizeof(HTAB)); - memset(hashp, 0, sizeof(HTAB)); + MemSet(hashp, 0, sizeof(HTAB)); if (flags & HASH_FUNCTION) { @@ -271,7 +271,7 @@ hdefault(HTAB *hashp) { HHDR *hctl; - memset(hashp->hctl, 0, sizeof(HHDR)); + MemSet(hashp->hctl, 0, sizeof(HHDR)); hctl = hashp->hctl; hctl->bsize = DEF_BUCKET_SIZE; @@ -829,7 +829,7 @@ dir_realloc(HTAB *hashp) if (p != NULL) { memmove(p, *p_ptr, old_dirsize); - memset(*p_ptr + old_dirsize, 0, new_dirsize - old_dirsize); + MemSet(*p_ptr + old_dirsize, 0, new_dirsize - old_dirsize); free((char *) *p_ptr); *p_ptr = p; hashp->hctl->dsize = new_dirsize; @@ -855,7 +855,7 @@ seg_alloc(HTAB *hashp) return (0); } - memset((char *) segp, 0, + MemSet((char *) segp, 0, (long) sizeof(SEGMENT) * hashp->hctl->ssize); segOffset = MAKE_HASHOFFSET(hashp, segp); diff --git a/src/backend/utils/mmgr/portalmem.c b/src/backend/utils/mmgr/portalmem.c index b56690320f..10f619e5ce 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.8 1997/09/08 21:49:31 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.9 1997/09/18 20:22:36 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -126,7 +126,7 @@ static HTAB *PortalHashTable = NULL; #define PortalHashTableLookup(NAME, PORTAL) \ { PortalHashEnt *hentry; bool found; char key[MAX_PORTALNAME_LEN]; \ - memset(key, 0, MAX_PORTALNAME_LEN); \ + MemSet(key, 0, MAX_PORTALNAME_LEN); \ sprintf(key, "%s", NAME); \ hentry = (PortalHashEnt*)hash_search(PortalHashTable, \ key, HASH_FIND, &found); \ @@ -139,7 +139,7 @@ static HTAB *PortalHashTable = NULL; } #define PortalHashTableInsert(PORTAL) \ { PortalHashEnt *hentry; bool found; char key[MAX_PORTALNAME_LEN]; \ - memset(key, 0, MAX_PORTALNAME_LEN); \ + MemSet(key, 0, MAX_PORTALNAME_LEN); \ sprintf(key, "%s", PORTAL->name); \ hentry = (PortalHashEnt*)hash_search(PortalHashTable, \ key, HASH_ENTER, &found); \ @@ -151,7 +151,7 @@ static HTAB *PortalHashTable = NULL; } #define PortalHashTableDelete(PORTAL) \ { PortalHashEnt *hentry; bool found; char key[MAX_PORTALNAME_LEN]; \ - memset(key, 0, MAX_PORTALNAME_LEN); \ + MemSet(key, 0, MAX_PORTALNAME_LEN); \ sprintf(key, "%s", PORTAL->name); \ hentry = (PortalHashEnt*)hash_search(PortalHashTable, \ key, HASH_REMOVE, &found); \ diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c index e832b9c0bf..5a75651ad8 100644 --- a/src/bin/psql/psql.c +++ b/src/bin/psql/psql.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.95 1997/09/13 13:03:41 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.96 1997/09/18 20:22:42 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1973,7 +1973,7 @@ main(int argc, char **argv) bool singleSlashCmd = 0; int c; - memset(&settings, 0, sizeof settings); + MemSet(&settings, 0, sizeof settings); settings.opt.align = 1; settings.opt.header = 1; settings.queryFout = stdout; diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index d208915776..942082b0d0 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.41 1997/09/08 21:55:36 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.42 1997/09/18 20:22:46 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -154,7 +154,7 @@ PQconnectdb(const char *conninfo) "FATAL: PQsetdb() -- unable to allocate memory for a PGconn"); return (PGconn *) NULL; } - memset((char *) conn, 0, sizeof(PGconn)); + MemSet((char *) conn, 0, sizeof(PGconn)); /* ---------- * Parse the conninfo string and get the fallback resources @@ -499,7 +499,7 @@ connectDB(PGconn *conn) * */ port = (Port *) malloc(sizeof(Port)); - memset((char *) port, 0, sizeof(Port)); + MemSet((char *) port, 0, sizeof(Port)); if (!(hp = gethostbyname(conn->pghost)) || hp->h_addrtype != AF_INET) { @@ -508,7 +508,7 @@ connectDB(PGconn *conn) conn->pghost); goto connect_errReturn; } - memset((char *) &port->raddr, 0, sizeof(port->raddr)); + MemSet((char *) &port->raddr, 0, sizeof(port->raddr)); memmove((char *) &(port->raddr.sin_addr), (char *) hp->h_addr, hp->h_length); diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 3af5dc0971..acf345a380 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-lobj.c,v 1.10 1997/09/08 21:55:43 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-lobj.c,v 1.11 1997/09/18 20:22:49 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -507,7 +507,7 @@ lo_initialize(PGconn *conn) "FATAL: malloc() failed in lo_initialize()\n"); return -1; } - memset((char *) lobjfuncs, 0, sizeof(PGlobjfuncs)); + MemSet((char *) lobjfuncs, 0, sizeof(PGlobjfuncs)); /* ---------------- * Execute the query to get all the functions at once diff --git a/src/test/regress/regress.c b/src/test/regress/regress.c index 85af5dad69..e602762df8 100644 --- a/src/test/regress/regress.c +++ b/src/test/regress/regress.c @@ -1,10 +1,10 @@ /* - * $Header: /cvsroot/pgsql/src/test/regress/regress.c,v 1.14 1997/09/11 09:13:28 vadim Exp $ + * $Header: /cvsroot/pgsql/src/test/regress/regress.c,v 1.15 1997/09/18 20:22:54 momjian Exp $ */ #include /* faked on sunos */ #include -#include /* for memset() */ +#include /* for MemSet() */ #include @@ -288,7 +288,7 @@ char *string; fprintf(stderr, "reverse_c16: palloc failed\n"); return (NULL); } - memset(new_string, 0, 16); + MemSet(new_string, 0, 16); for (i = 0; i < 16 && string[i]; ++i) ; if (i == 16 || !string[i]) diff --git a/src/tutorial/C-code/funcs.c b/src/tutorial/C-code/funcs.c index 0033e12429..5a70262f07 100644 --- a/src/tutorial/C-code/funcs.c +++ b/src/tutorial/C-code/funcs.c @@ -38,7 +38,7 @@ concat16(char16 *arg1, char16 *arg2) { char16 *new_c16 = (char16 *) palloc(sizeof(char16)); - memset(new_c16, 0, sizeof(char16)); + MemSet(new_c16, 0, sizeof(char16)); strncpy((char *) new_c16, (char *) arg1, 16); return (char16 *) (strncat((char *) new_c16, (char *) arg2, 16)); } @@ -52,7 +52,7 @@ copytext(text *t) */ text *new_t = (text *) palloc(VARSIZE(t)); - memset(new_t, 0, VARSIZE(t)); + MemSet(new_t, 0, VARSIZE(t)); VARSIZE(new_t) = VARSIZE(t); -- 2.40.0