*
*
* 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
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;
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;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
tp = (char *) palloc(size);
tuple = (IndexTuple) tp;
- memset(tp, 0, (int) size);
+ MemSet(tp, 0, (int) size);
DataFill((char *) tp + hoff,
tupleDescriptor,
*
*
* 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
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;
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 */
/* 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);
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);
*
*
* 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.
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);
/*
/* 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);
*
*
* 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
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 */
* 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));
}
*
*
* 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
* good when I know they're empty.
*/
- memset(page, 0, size);
+ MemSet(page, 0, size);
PageInit(page, size, sizeof(BTPageOpaqueData));
}
*
*
* 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
*
{
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;
{
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;
* _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)
{
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
nbytes = BTMaxStrategyNumber * sizeof(ScanKeyData);
xform = (ScanKey) palloc(nbytes);
- memset(xform, 0, nbytes);
+ MemSet(xform, 0, nbytes);
map = IndexStrategyGetStrategyMap(RelationGetIndexStrategy(relation),
BTMaxStrategyNumber,
attno);
/* initialization for new attno */
attno = cur->sk_attno;
- memset(xform, 0, nbytes);
+ MemSet(xform, 0, nbytes);
map = IndexStrategyGetStrategyMap(RelationGetIndexStrategy(relation),
BTMaxStrategyNumber,
attno);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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);
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);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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);
* 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 $
*
*-------------------------------------------------------------------------
*/
{
elog(FATAL, "AllocateAttribute: malloc failed");
}
- memset(attribute, 0, ATTRIBUTE_TUPLE_SIZE);
+ MemSet(attribute, 0, ATTRIBUTE_TUPLE_SIZE);
return (attribute);
}
*
*
* 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
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
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;
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;
}
*
*
* 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
*/
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.
* 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.
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
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
Oid fnArgs[8];
TupleDesc tupDesc;
- memset(fnArgs, 0, 8 * sizeof(Oid));
+ MemSet(fnArgs, 0, 8 * sizeof(Oid));
/* sanity checks */
if (!aggName)
*
*
* 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.
* have to worry about deleting them later.
* ----------------
*/
- memset(typeId, 0, 8 * sizeof(Oid));
+ MemSet(typeId, 0, 8 * sizeof(Oid));
if (!leftTypeName)
{
typeId[0] = rightTypeId;
*/
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 */
*/
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 */
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
Assert(PointerIsValid(probin));
parameterCount = 0;
- memset(typev, 0, 8 * sizeof(Oid));
+ MemSet(typev, 0, 8 * sizeof(Oid));
foreach(x, argList)
{
Value *t = lfirst(x);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
/*
* 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;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
}
*opOidP = tuple->t_oid;
- memset(argTypes, 0, 8 * sizeof(Oid));
+ MemSet(argTypes, 0, 8 * sizeof(Oid));
/*
* process the function arguments
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
return;
es = (ExplainState *) malloc(sizeof(ExplainState));
- memset(es, 0, sizeof(ExplainState));
+ MemSet(es, 0, sizeof(ExplainState));
es->printCost = true; /* default */
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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; */
}
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);
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));
bool isnull;
int found;
- memset(trigdesc, 0, sizeof(TriggerDesc));
+ MemSet(trigdesc, 0, sizeof(TriggerDesc));
ScanKeyEntryInitialize(&skey,
(bits16) 0x0,
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
/*
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);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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';
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
* 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.
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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 */
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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;
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;
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
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
{
struct hostent *hs;
- memset((char *) sin, 0, sizeof(*sin));
+ MemSet((char *) sin, 0, sizeof(*sin));
if (host)
{
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)
{
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);
*
*
* 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
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);
}
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
/* 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
* 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)
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
* 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)
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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] =
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;
*
*
* 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
*
for (i = 0; i < 4; ++i)
{
- memset(envEntry[i], 0, 2 * ARGV_SIZE);
+ MemSet(envEntry[i], 0, 2 * ARGV_SIZE);
}
/*
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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)
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
(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
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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));
}
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));
}
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
*/
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++)
LocalRefCount =
(long *) malloc(sizeof(long) * NLocBuffer);
- memset(LocalRefCount, 0, sizeof(long) * NLocBuffer);
+ MemSet(LocalRefCount, 0, sizeof(long) * NLocBuffer);
}
/*
}
}
- memset(LocalRefCount, 0, sizeof(long) * NLocBuffer);
+ MemSet(LocalRefCount, 0, sizeof(long) * NLocBuffer);
nextFreeLocalBuf = 0;
}
buf->buf_id = -i - 2;
}
- memset(LocalRefCount, 0, sizeof(long) * NLocBuffer);
+ MemSet(LocalRefCount, 0, sizeof(long) * NLocBuffer);
nextFreeLocalBuf = 0;
}
* 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:
*
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;
}
*
*
* 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
*
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++);
}
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
* 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 *)
bool found;
Assert(BindingTable);
- memset(item.key, 0, BTABLE_KEYSIZE);
+ MemSet(item.key, 0, BTABLE_KEYSIZE);
sprintf(item.key, "PID %d", pid);
SpinAcquire(BindingLock);
Assert(BindingTable);
- memset(item.key, 0, BTABLE_KEYSIZE);
+ MemSet(item.key, 0, BTABLE_KEYSIZE);
sprintf(item.key, "PID %d", pid);
SpinAcquire(BindingLock);
*
*
* 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
*/
if (!found)
{
- memset(ltable->ctl, 0, sizeof(LOCKCTL));
+ MemSet(ltable->ctl, 0, sizeof(LOCKCTL));
ltable->ctl->masterLock = LockMgrLock;
ltable->ctl->tableId = NumTables;
}
{
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;
* 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
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);
}
/* ----------------
* 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
* the lock stats.
* ---------------
*/
- memset(result->holders, 0, nLockTypes * sizeof(*(lock->holders)));
+ MemSet(result->holders, 0, nLockTypes * sizeof(*(lock->holders)));
result->nHolding = 0;
}
* 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);
*
*
* 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
* 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));
* 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;
* 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));
/* ----------------------------
* 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;
* zero'd.
* ------------------
*/
- memset(&tag, 0, sizeof(LOCKTAG));
+ MemSet(&tag, 0, sizeof(LOCKTAG));
tag.relId = linfo->lRelId.relId;
tag.dbId = linfo->lRelId.dbId;
* zero'd.
* ------------------
*/
- memset(&tag, 0, sizeof(LOCKTAG));
+ MemSet(&tag, 0, sizeof(LOCKTAG));
tag.relId = linfo->lRelId.relId;
tag.dbId = linfo->lRelId.dbId;
* 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;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
* 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 <sys/time.h>
#include <unistd.h>
* 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;
* 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
* 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))
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
* 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);
* 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));
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
/* 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);
{ /* 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++)
{
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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++)
{
if (nbytes == 0)
{
- memset(buffer, 0, BLCKSZ);
+ MemSet(buffer, 0, BLCKSZ);
}
else
{
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);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
if (IsPostmaster)
{
- memset(mmcacheblk, 0, mmsize);
+ MemSet(mmcacheblk, 0, mmsize);
SpinRelease(MMCacheLock);
return (SM_SUCCESS);
}
{
/* reading nonexistent pages is defined to fill them with zeroes */
SpinRelease(MMCacheLock);
- memset(buffer, 0, BLCKSZ);
+ MemSet(buffer, 0, BLCKSZ);
return (SM_SUCCESS);
}
*
*
* 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.
* 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),
*
*
* 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
if (!Quiet)
printf("\tAbortCurrentTransaction() at %s\n", ctime(&tim));
- memset(parser_input, 0, MAX_PARSE_BUFFER);
+ MemSet(parser_input, 0, MAX_PARSE_BUFFER);
AbortCurrentTransaction();
}
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 $");
}
/* ----------------
{
/* 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);
* (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 */
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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;
/* ----------------
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
{
char *emptyArray = palloc(sizeof(ArrayType));
- memset(emptyArray, 0, sizeof(ArrayType));
+ MemSet(emptyArray, 0, sizeof(ArrayType));
*(int32 *) emptyArray = sizeof(ArrayType);
return emptyArray;
}
&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);
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);
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)
if (!values[i])
{
values[i] = palloc(typlen);
- memset(values[i], 0, typlen);
+ MemSet(values[i], 0, typlen);
}
}
else
* 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;
* 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 <stdio.h>
}
/* 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))
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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;
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;
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;
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;
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;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
sprintf(out, fmt, value);
if ((ret = strlen(out)) > width)
{
- memset(ascii, '*', width - 2);
+ MemSet(ascii, '*', width - 2);
ascii[width] = 0;
return (0);
}
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
oc = (OidName) palloc(sizeof(OidNameData));
- memset(oc, 0, sizeof(OidNameData));
+ MemSet(oc, 0, sizeof(OidNameData));
for (inptr = inStr; *inptr && *inptr != ','; inptr++)
;
*
*
* 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
* ----------------
*/
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)
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
{
static char errBuf[64];
- memset(errBuf, 0, (int) sizeof(errBuf));
+ MemSet(errBuf, 0, (int) sizeof(errBuf));
switch (buildinfo.infotype)
{
case INFO_RELID:
* clear new reldesc
* ----------------
*/
- memset((char *) relation, 0, len);
+ MemSet((char *) relation, 0, len);
/* initialize attribute tuple form */
relation->rd_att = CreateTemplateTupleDesc(natts);
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
*/
len = sizeof(RelationData);
relation = (Relation) palloc(len);
- memset((char *) relation, 0, len);
+ MemSet((char *) relation, 0, len);
/* ----------------
* don't open the unix file yet..
*/
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);
/* ----------------
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],
* 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);
}
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)
*
*
* 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
void
zerocaches()
{
- memset((char *) SysCache, 0, SysCacheSize * sizeof(struct catcache *));
+ MemSet((char *) SysCache, 0, SysCacheSize * sizeof(struct catcache *));
}
/*
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
hashp = (HTAB *) MEM_ALLOC((unsigned long) sizeof(HTAB));
- memset(hashp, 0, sizeof(HTAB));
+ MemSet(hashp, 0, sizeof(HTAB));
if (flags & HASH_FUNCTION)
{
{
HHDR *hctl;
- memset(hashp->hctl, 0, sizeof(HHDR));
+ MemSet(hashp->hctl, 0, sizeof(HHDR));
hctl = hashp->hctl;
hctl->bsize = DEF_BUCKET_SIZE;
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;
return (0);
}
- memset((char *) segp, 0,
+ MemSet((char *) segp, 0,
(long) sizeof(SEGMENT) * hashp->hctl->ssize);
segOffset = MAKE_HASHOFFSET(hashp, segp);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
#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); \
}
#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); \
}
#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); \
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
"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
*
*/
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)
{
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);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
"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
/*
- * $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 <float.h> /* faked on sunos */
#include <stdio.h>
-#include <string.h> /* for memset() */
+#include <string.h> /* for MemSet() */
#include <postgres.h>
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])
{
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));
}
*/
text *new_t = (text *) palloc(VARSIZE(t));
- memset(new_t, 0, VARSIZE(t));
+ MemSet(new_t, 0, VARSIZE(t));
VARSIZE(new_t) = VARSIZE(t);