callocMagic has same API argument convention as calloc()

This commit is contained in:
Darryl L. Miles 2025-02-13 08:09:55 +00:00 committed by R. Timothy Edwards
parent 26372f5d50
commit 4201f56048
5 changed files with 8 additions and 8 deletions

View File

@ -93,7 +93,7 @@ static BinArray *bpBinArrayNew(int dx, /* x diameter of bins */
/* allocate array */
size = sizeof(BinArray) + numBins*(sizeof(void *));
new = (BinArray *)callocMagic(size);
new = (BinArray *)callocMagic(1, size);
/* initial */
new->ba_bbox = *bbox;

View File

@ -194,7 +194,7 @@ glDMAlloc(dm, top, cap)
dm->dm_max = 0;
dm->dm_size = top + 1;
dm->dm_cap = cap;
dm->dm_value = (short *) callocMagic((unsigned) (sizeof (short) * dm->dm_size));
dm->dm_value = (short *) callocMagic(dm->dm_size, (unsigned) (sizeof (short)));
}
/*

View File

@ -192,7 +192,7 @@ glClientInit(chanList, netList)
}
for (net = netList->nnl_nets; net; net = net->nnet_next)
net->nnet_cdata = (ClientData) callocMagic((unsigned) (sizeof (NetClient)));
net->nnet_cdata = (ClientData) callocMagic(1, (unsigned) (sizeof (NetClient)));
}
/*

View File

@ -609,7 +609,7 @@ mzTechLayer(argc, argv)
}
/* Allocate new route layer */
new = (RouteLayer *) callocMagic((unsigned) (sizeof (RouteLayer)));
new = (RouteLayer *) callocMagic(1, (unsigned) (sizeof (RouteLayer)));
/* Initialize RouteType section */
mzInitRouteType(&(new->rl_routeType),tileType);
@ -1143,7 +1143,7 @@ mzTechContact(argc, argv)
if(tileType < 0) return;
/* allocate new route contact */
new = (RouteContact *) callocMagic((unsigned) (sizeof (RouteContact)));
new = (RouteContact *) callocMagic(1, (unsigned) (sizeof (RouteContact)));
/* initialize RouteType section:
* sets route type, initializes spacing array, etc.

View File

@ -73,7 +73,7 @@ extern IHashTable *IHashInit(
IHashTable *table;
table = (IHashTable *)mallocMagic(sizeof(IHashTable));
table->iht_table = (void **)callocMagic(sizeof(void *)*nBuckets);
table->iht_table = (void **)callocMagic(nBuckets, sizeof(void *));
table->iht_nBucketsInit = nBuckets;
table->iht_nBuckets = nBuckets;
table->iht_nEntries = 0;
@ -99,7 +99,7 @@ void IHashClear(IHashTable *table)
{
/* reinitial bucket array */
freeMagic((char *) table->iht_table);
table->iht_table = (void **)callocMagic(sizeof(void *)*table->iht_nBucketsInit);
table->iht_table = (void **)callocMagic(table->iht_nBucketsInit, sizeof(void *));
table->iht_nBuckets = table->iht_nBucketsInit;
table->iht_nEntries = 0;
@ -217,7 +217,7 @@ static void iHashResize(IHashTable *table)
int bucket;
/* alloc a new table */
table->iht_table = (void **)callocMagic(sizeof(void *)*newSize);
table->iht_table = (void **)callocMagic(newSize, sizeof(void *));
table->iht_nBuckets = newSize;
table->iht_nEntries = 0;