diff --git a/src/common/ZipHandler.cxx b/src/common/ZipHandler.cxx index 2f861dcee..80a8e09db 100644 --- a/src/common/ZipHandler.cxx +++ b/src/common/ZipHandler.cxx @@ -17,9 +17,6 @@ // $Id$ //============================================================================ -// NOTE: This code generates many errors in Coverity, and is due to be -// replaced in an upcoming release. - #include #include #include @@ -380,8 +377,9 @@ const ZipHandler::zip_file_header* ZipHandler::zip_file_next_file(zip_file* zip) return nullptr; // NULL terminate the filename - zip->header.saved = zip->header.raw[ZIPCFN + zip->header.filename_length]; - zip->header.raw[ZIPCFN + zip->header.filename_length] = 0; + uInt32 size = ZIPCFN + zip->header.filename_length; + zip->header.saved = zip->header.raw[size]; + zip->header.raw[size] = 0; // Advance the position zip->cd_pos += zip->header.rawlength; diff --git a/src/common/ZipHandler.hxx b/src/common/ZipHandler.hxx index 7101dae13..d014d8b39 100644 --- a/src/common/ZipHandler.hxx +++ b/src/common/ZipHandler.hxx @@ -62,9 +62,6 @@ This class implements a thin wrapper around the zip file management code from the MAME project. - NOTE: This code generates many errors in Coverity, and is due to be - replaced in an upcoming release. - @author Wrapper class by Stephen Anthony, with main functionality by Aaron Giles */ @@ -247,7 +244,8 @@ class ZipHandler inline static uInt16 read_word(uInt8* buf) { - return (buf[1] << 8) | buf[0]; + uInt16 p0 = uInt16(buf[0]), p1 = uInt16(buf[1]); + return (p1 << 8) | p0; } inline static uInt32 read_dword(uInt8* buf) diff --git a/src/emucore/Console.cxx b/src/emucore/Console.cxx index bf097acd1..67fa483d5 100644 --- a/src/emucore/Console.cxx +++ b/src/emucore/Console.cxx @@ -460,8 +460,8 @@ void Console::initializeAudio() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Console::fry() const { - for(int ZPmem = 0; ZPmem < 0x100; ZPmem += rand() % 4) - mySystem->poke(ZPmem, mySystem->peek(ZPmem) & uInt8(rand()) % 256); + for(int i = 0; i < 0x100; i += mySystem->randGenerator().next() % 4) + mySystem->poke(i, mySystem->peek(i) & mySystem->randGenerator().next()); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -