Address a bunch of dead store issues found by the static analyzer.

Pretty much all of these fall into one of two categories:

* Variables that are obviously unneeded and in many cases completely unused – probably remnants of old code that was rewritten. These ones were deleted.

* Variables that look like they should be used but aren't. These ones have been suppressed, with a TODO message added as a reminder to investigate them in more detail later.
This commit is contained in:
2024-08-10 12:22:05 -04:00
parent 1d491e3b2a
commit f400a5b7de
12 changed files with 28 additions and 35 deletions

View File

@@ -465,10 +465,12 @@ bool tryLoadPictFromResourceFile(fs::path& gpath, sf::Image& graphics_store) {
FSRef file;
ResFileRefNum custRef;
OSErr err = FSPathMakeRef((const UInt8*)gpath.c_str(), &file, nullptr);
(void) err; // TODO: Should probably check this?
err = FSOpenResourceFile(&file, 0, nullptr, fsRdPerm, &custRef);
if(err != noErr) { // TODO: Is the error that would be returned if the resources were stored in the resource fork?
HFSUniStr255 rsrc;
err = FSGetResourceForkName(&rsrc);
(void) err; // TODO: Should probably check this?
err = FSOpenResourceFile(&file, rsrc.length, rsrc.unicode, fsRdPerm, &custRef);
if(err != noErr) {
showError("An old-style .meg graphics file was found, but neither data nor resource fork could be read.",noGraphics);