From 6ef9691035623ba6945e237a41f0dca04db637bb Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 13 Dec 2011 11:49:27 -0800 Subject: gcc: fix unused variable warnings from GCC 4.6.1 --HG-- extra : rebase_source : f9e22de341493a25ac6106c16ac35c61c128a080 --- src/dev/sparc/mm_disk.cc | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'src/dev/sparc') diff --git a/src/dev/sparc/mm_disk.cc b/src/dev/sparc/mm_disk.cc index 1921f6d96..0095d9f1d 100644 --- a/src/dev/sparc/mm_disk.cc +++ b/src/dev/sparc/mm_disk.cc @@ -56,7 +56,6 @@ MmDisk::read(PacketPtr pkt) { Addr accessAddr; off_t sector; - off_t bytes_read; uint16_t d16; uint32_t d32; uint64_t d64; @@ -68,10 +67,16 @@ MmDisk::read(PacketPtr pkt) if (sector != curSector) { if (dirty) { - bytes_read = image->write(diskData, curSector); - assert(bytes_read == SectorSize); +#ifndef NDEBUG + off_t bytes_written = +#endif + image->write(diskData, curSector); + assert(bytes_written == SectorSize); } - bytes_read = image->read(diskData, sector); +#ifndef NDEBUG + off_t bytes_read = +#endif + image->read(diskData, sector); assert(bytes_read == SectorSize); curSector = sector; } @@ -109,7 +114,6 @@ MmDisk::write(PacketPtr pkt) { Addr accessAddr; off_t sector; - off_t bytes_read; uint16_t d16; uint32_t d32; uint64_t d64; @@ -121,10 +125,16 @@ MmDisk::write(PacketPtr pkt) if (sector != curSector) { if (dirty) { - bytes_read = image->write(diskData, curSector); - assert(bytes_read == SectorSize); +#ifndef NDEBUG + off_t bytes_written = +#endif + image->write(diskData, curSector); + assert(bytes_written == SectorSize); } - bytes_read = image->read(diskData, sector); +#ifndef NDEBUG + off_t bytes_read = +#endif + image->read(diskData, sector); assert(bytes_read == SectorSize); curSector = sector; } @@ -164,9 +174,11 @@ MmDisk::serialize(std::ostream &os) { // just write any dirty changes to the cow layer it will take care of // serialization - int bytes_read; if (dirty) { - bytes_read = image->write(diskData, curSector); +#ifndef NDEBUG + int bytes_read = +#endif + image->write(diskData, curSector); assert(bytes_read == SectorSize); } } -- cgit v1.2.3