1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 04:10:54 -08:00

Tidy up code from unused variable warnings.

Copied from Perforce
 Change: 178787
 ServerID: perforce.ravenbrook.com
This commit is contained in:
David Lovemore 2012-07-31 14:19:26 +01:00
parent c3a49e4c43
commit 2f11fd7b65
13 changed files with 28 additions and 46 deletions

View file

@ -168,7 +168,7 @@ Res ABQPeek(ABQ abq, CBSBlock *blockReturn)
/* ABQDelete -- delete a block from the ABQ */
Res ABQDelete(ABQ abq, CBSBlock block)
{
Index index, next, elements, in;
Index index, next, in;
CBSBlock *queue;
AVERT(ABQ, abq);
@ -178,7 +178,6 @@ Res ABQDelete(ABQ abq, CBSBlock block)
index = abq->out;
in = abq->in;
elements = abq->elements;
queue = abq->queue;
while (index != in) {

View file

@ -206,9 +206,7 @@ static void test(mps_ap_t leafap, mps_ap_t exactap, mps_ap_t weakap,
for(j = 0; j < ITERATIONS; ++j) {
for(i = 0; i < TABLE_SLOTS; ++i) {
mps_word_t *string;
string = alloc_string("spong", leafap);
(void)alloc_string("spong", leafap);
}
}

View file

@ -211,9 +211,7 @@ static void test(mps_ap_t leafap, mps_ap_t exactap, mps_ap_t weakap,
for(j = 0; j < ITERATIONS; ++j) {
for(i = 0; i < TABLE_SLOTS; ++i) {
mps_word_t *string;
string = alloc_string("spong", leafap);
(void)alloc_string("spong", leafap);
}
}

View file

@ -176,13 +176,11 @@ static void *test(void *arg, size_t s)
die(mps_arena_collect(arena), "collect");
printf(" Done.\n");
while (mps_message_poll(arena)) {
mps_word_t obj;
mps_addr_t objaddr;
cdie(mps_message_get(&message, arena,
mps_message_type_finalization()),
"get");
mps_message_finalization_ref(&objaddr, arena, message);
obj = (mps_word_t)objaddr;
mps_message_discard(arena, message);
++ final_this_time;
}
@ -216,13 +214,11 @@ static void *test(void *arg, size_t s)
die(mps_arena_collect(arena), "collect");
printf(" Done.\n");
while (mps_message_poll(arena)) {
mps_word_t obj;
mps_addr_t objaddr;
cdie(mps_message_get(&message, arena,
mps_message_type_finalization()),
"get");
mps_message_finalization_ref(&objaddr, arena, message);
obj = (mps_word_t)objaddr;
mps_message_discard(arena, message);
++ final_this_time;
}

View file

@ -129,24 +129,30 @@ int dylan_wrapper_check(mps_word_t *w)
/* The first field is traceable, the second field can be traced, */
/* but doesn't need to be. */
assert((ww[WP] == 1) || (ww[WP] == 3));
unused(ww);
/* Unpack the wrapper. */
class = w[WC]; /* class */
unused(class);
fh = w[WF]; /* fixed part header word */
fl = fh >> 2; /* fixed part length */
ff = fh & 3; /* fixed part format code */
vh = w[WV]; /* variable part header */
version = (vh >> (MPS_WORD_WIDTH - 8)) & 0xff;
assert(version == 2); /* Code in this file only works for version 2 */
unused(version);
reserved = (vh >> 8) & 0xff;
assert(reserved == 0);
unused(reserved);
vb = (vh >> 16) & 0xff;
unused(vb);
es = (vh & 0xff) >> 3;/* element size */
vf = vh & 7; /* variable part format code */
vt = w[WS]; /* vector total word (Dylan-tagged) */
t = vt >> 2; /* vector total length */
unused(t);
/* The second word is the class of the wrapped object. */
/* It would be good to check which pool this is in. */
@ -160,23 +166,26 @@ int dylan_wrapper_check(mps_word_t *w)
/* Fixed part format 3 is reserved. */
assert(ff != 3);
unused(ff);
/* Zero length fixed part is only legal in format 0. */
/* Current Dylan run-time does not honour this so I remove it for now */
/* We probably want this check as then we can scan without having to */
/* check for 0 fixed length fields as a special case */
/* assert(ff == 0 || fl != 0); */
unused(fl);
/* The fourth word contains the variable part format and element */
/* size. This assumes that DylanWorks is only going to use byte */
/* vectors in the non-word case. */
/* Variable part format 6 is reserved. */
assert(vf != 6);
unused(vf);
/* There should be no shift in word vector formats. */
assert((vf & 6) == 4 || es == 0);
unused(es);
/* The fifth word is the number of patterns in the pattern */
/* vector. This can be calculated from the fixed part length. */
/* The word is also tagged like a DylanWorks integer. */
@ -247,9 +256,11 @@ extern mps_addr_t dylan_weak_dependent(mps_addr_t parent)
ff = fword & 3;
/* traceable fixed part */
assert(ff == 1);
unused(ff);
fl = fword & ~(mps_word_t)3;
/* at least one fixed field */
assert(fl >= 1);
unused(fl);
return (mps_addr_t) object[1];
}
@ -555,7 +566,8 @@ extern mps_res_t dylan_scan1_weak(mps_ss_t mps_ss, mps_addr_t *object_io)
h = (mps_word_t)p[0];
/* object should not be forwarded (as there is no forwarding method) */
assert((h & 3) == 0);
unused(h);
res = mps_fix(mps_ss, p);
if ( res != MPS_RES_OK ) return res;
@ -576,7 +588,8 @@ extern mps_res_t dylan_scan1_weak(mps_ss_t mps_ss, mps_addr_t *object_io)
/* weak vectors should have traceable fixed format */
assert(ff == 1);
unused(ff);
assoc = (mps_addr_t *)p[0];
vword = w[WV];
@ -585,7 +598,8 @@ extern mps_res_t dylan_scan1_weak(mps_ss_t mps_ss, mps_addr_t *object_io)
/* weak vectors should be non-stretchy traceable */
assert(vf == 2);
unused(vf);
/* q is end of the object. There are fl fixed fields, vl variable */
/* fields and another slot that contains the vector length */
q = p + fl + vl + 1;

View file

@ -300,7 +300,8 @@ Res ChainCondemnAuto(double *mortalityReturn, Chain chain, Trace trace)
" (of $U)", (WriteFU)chain->genCount,
" of this chain $P.", (WriteFP)chain,
NULL ));
UNUSED(topCondemnedGenSerial); /* only used for DIAG */
/* Condemn everything in these zones. */
if (condemnedSet != ZoneSetEMPTY) {
res = TraceCondemnZones(trace, condemnedSet);

View file

@ -1583,7 +1583,6 @@ static Res amcScanNailed(Bool *totalReturn, ScanState ss, Pool pool,
static Res AMCScan(Bool *totalReturn, ScanState ss, Pool pool, Seg seg)
{
Addr base, limit;
Arena arena;
Format format;
AMC amc;
Res res;
@ -1597,7 +1596,6 @@ static Res AMCScan(Bool *totalReturn, ScanState ss, Pool pool, Seg seg)
format = pool->format;
arena = pool->arena;
if(amcSegHasNailboard(seg)) {
return amcScanNailed(totalReturn, ss, pool, seg, amc);

View file

@ -234,7 +234,6 @@ static Bool loSegFindFree(Addr *bReturn, Addr *lReturn,
Index baseIndex, limitIndex;
LO lo;
Seg seg;
Arena arena;
Count agrains;
Count bits;
Addr segBase;
@ -246,7 +245,6 @@ static Bool loSegFindFree(Addr *bReturn, Addr *lReturn,
lo = loseg->lo;
seg = LOSegSeg(loseg);
AVER(SizeIsAligned(size, LOPool(lo)->alignment));
arena = PoolArena(LOPool(lo));
/* agrains is the number of grains corresponding to the size */
/* of the allocation request */
@ -547,7 +545,6 @@ static Res LOBufferFill(Addr *baseReturn, Addr *limitReturn,
Ring node, nextNode;
LO lo;
LOSeg loseg;
Arena arena;
Addr base, limit;
AVER(baseReturn != NULL);
@ -562,8 +559,6 @@ static Res LOBufferFill(Addr *baseReturn, Addr *limitReturn,
AVER(SizeIsAligned(size, PoolAlignment(pool)));
AVER(BoolCheck(withReservoirPermit));
arena = PoolArena(pool);
/* Try to find a segment with enough space already. */
RING_FOR(node, &pool->segRing, nextNode) {
Seg seg = SegOfPoolRing(node);
@ -619,7 +614,6 @@ static void LOBufferEmpty(Pool pool, Buffer buffer, Addr init, Addr limit)
Seg seg;
LOSeg loseg;
Index baseIndex, initIndex, limitIndex;
Arena arena;
AVERT(Pool, pool);
lo = PARENT(LOStruct, poolStruct, pool);
@ -634,7 +628,6 @@ static void LOBufferEmpty(Pool pool, Buffer buffer, Addr init, Addr limit)
AVERT(LOSeg, loseg);
AVER(loseg->lo == lo);
arena = PoolArena(pool);
base = BufferBase(buffer);
segBase = SegBase(seg);

View file

@ -477,9 +477,6 @@ static MessageClassStruct MRGMessageClassStruct = {
*/
static void MRGSegPairDestroy(MRGRefSeg refseg, MRG mrg)
{
Pool pool;
pool = MRG2Pool(mrg);
RingRemove(&refseg->mrgRing);
RingFinish(&refseg->mrgRing);
refseg->sig = SigInvalid;

View file

@ -824,7 +824,6 @@ size_t mps_mv_size(mps_pool_t mps_pool)
Pool pool;
MV mv;
MVSpan span;
Arena arena;
Size f = 0;
Ring spans, node = NULL, nextNode; /* gcc whinge stop */
@ -833,7 +832,6 @@ size_t mps_mv_size(mps_pool_t mps_pool)
AVERT(Pool, pool);
mv = Pool2MV(pool);
AVERT(MV, mv);
arena = PoolArena(pool);
spans = &mv->spans;
RING_FOR(node, spans, nextNode) {

View file

@ -215,7 +215,6 @@ static void reservoirShrink(Reservoir reservoir, Size want)
Res ReservoirWithdraw(Addr *baseReturn, Tract *baseTractReturn,
Reservoir reservoir, Size size, Pool pool)
{
Pool respool;
Arena arena;
AVER(baseReturn != NULL);
@ -226,7 +225,6 @@ Res ReservoirWithdraw(Addr *baseReturn, Tract *baseTractReturn,
AVER(SizeIsAligned(size, ArenaAlign(arena)));
AVER(size > 0);
AVERT(Pool, pool);
respool = &reservoir->poolStruct;
/* @@@@ As a short-term measure, we only permit the reservoir to */
/* allocate single-page regions. */

View file

@ -231,8 +231,8 @@ static void SegFinish(Seg seg)
/* See <code/shield.c#shield.flush> */
ShieldFlush(PoolArena(SegPool(seg)));
base = SegBase(seg);
limit = SegLimit(seg);
TRACT_TRACT_FOR(tract, addr, arena, seg->firstTract, limit) {
AVER(TractCheck(tract)); /* <design/check/#type.no-sig> */
TractSetWhite(tract, TraceSetEMPTY);

View file

@ -433,14 +433,10 @@ static Bool AMSSegRegionIsFree(Seg seg, Addr base, Addr limit)
*/
static void AMSUnallocateRange(Seg seg, Addr base, Addr limit)
{
Pool pool;
AMS ams;
AMSSeg amsseg;
Index baseIndex, limitIndex;
/* parameters checked by caller */
pool = SegPool(seg);
ams = Pool2AMS(pool);
amsseg = Seg2AMSSeg(seg);
baseIndex = AMS_ADDR_INDEX(seg, base);
@ -475,14 +471,10 @@ static void AMSUnallocateRange(Seg seg, Addr base, Addr limit)
*/
static void AMSAllocateRange(Seg seg, Addr base, Addr limit)
{
Pool pool;
AMS ams;
AMSSeg amsseg;
Index baseIndex, limitIndex;
/* parameters checked by caller */
pool = SegPool(seg);
ams = Pool2AMS(pool);
amsseg = Seg2AMSSeg(seg);
baseIndex = AMS_ADDR_INDEX(seg, base);