[Scummvm-git-logs] scummvm master -> 3aba291b72f5bba99ede426c6f843b73d73eae34
Strangerke
noreply at scummvm.org
Sat May 18 20:59:55 UTC 2024
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
3aba291b72 BAGEL: Fix several PVS studio issues
Commit: 3aba291b72f5bba99ede426c6f843b73d73eae34
https://github.com/scummvm/scummvm/commit/3aba291b72f5bba99ede426c6f843b73d73eae34
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-05-18T21:59:42+01:00
Commit Message:
BAGEL: Fix several PVS studio issues
Changed paths:
engines/bagel/baglib/pan_bitmap.cpp
engines/bagel/baglib/pda.cpp
engines/bagel/baglib/rp_object.cpp
diff --git a/engines/bagel/baglib/pan_bitmap.cpp b/engines/bagel/baglib/pan_bitmap.cpp
index 5aa27d7794c..b05acfc3dc1 100644
--- a/engines/bagel/baglib/pan_bitmap.cpp
+++ b/engines/bagel/baglib/pan_bitmap.cpp
@@ -316,7 +316,7 @@ void CBagPanBitmap::setCorrWidth(int nWidth, bool bUpdate) {
while (nWidth >>= 1)
++i;
- if (i >= 0 && i < 6) {
+ if (i < 6) {
_nCorrWidth = i;
if (bUpdate) {
generateCosineTable();
diff --git a/engines/bagel/baglib/pda.cpp b/engines/bagel/baglib/pda.cpp
index 4d6491a4d80..1016a2758b0 100644
--- a/engines/bagel/baglib/pda.cpp
+++ b/engines/bagel/baglib/pda.cpp
@@ -282,7 +282,6 @@ ErrorCode CBagPDA::update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcRect, in
showLog();
}
- bool bUpdate = true;
bool bIsMovieWaiting = isMovieWaiting();
bool bMoviePlaying = false;
@@ -300,13 +299,10 @@ ErrorCode CBagPDA::update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcRect, in
} else if (_pdaMode == PDA_MOO_MODE) {
// If we're playing a pda movie, then make sure we continue to update.
bMoviePlaying = true;
- bUpdate = true;
}
// If the official decree from on high has been given to update, do so!
- if (bUpdate) {
- errorCode = CBagStorageDevBmp::update(pBmp, pt, pr, _nMaskColor);
- }
+ errorCode = CBagStorageDevBmp::update(pBmp, pt, pr, _nMaskColor);
// If the PDA is activating then redraw our black background
bool bWandAnimating = CBagCharacterObject::pdaWandAnimating();
diff --git a/engines/bagel/baglib/rp_object.cpp b/engines/bagel/baglib/rp_object.cpp
index 7d4d1af04e1..d328632fd11 100644
--- a/engines/bagel/baglib/rp_object.cpp
+++ b/engines/bagel/baglib/rp_object.cpp
@@ -161,7 +161,6 @@ CBagRPObject::~CBagRPObject() {
_pSaveVar = nullptr;
// Clear our statics, yes, I mean to do that here.
- _turnCount = nullptr;
_pLogStateVar = nullptr;
_pPrevLogStateVar = nullptr;
_pBarLogPages = nullptr;
@@ -1496,7 +1495,6 @@ bool CBagRPObject::initialize() {
// Cruise the dossier's for both lists and get pointers to the actual bagdoobj's.
// Search the current storage device for this object.
CBagStorageDev *pSDev;
- DossierObj *pDosObj;
if (zoomed()) {
pSDev = g_SDevManager->getStorageDevice(LOGZ_WLD);
@@ -1508,6 +1506,7 @@ bool CBagRPObject::initialize() {
// Scoff the dossier out of the LOG_WLD SDEV. If it's not there then hurl.
bool bDoUntouched = (_pTouchedList != _pUntouchedList);
int nCount = _pTouchedList->getCount();
+ DossierObj *pDosObj = nullptr;
for (int i = 0; i < nCount; i++) {
pDosObj = _pTouchedList->getNodeItem(i);
@@ -1555,17 +1554,16 @@ bool CBagRPObject::initialize() {
}
}
- // If we have a object name, make sure it is not active. Object name is the
+ // Make sure the object is not active. Object name is the
// line that shows up in the RP Review screen (such as "Voice Printer")
- if (_pObjectName) {
- // Give the dossier a back pointer so that it can respond to
- // mouse down events
- _pObjectName->setRPObject(this);
- _pObjectName->setVisible(false);
- _pObjectName->setActive(false);
- _pObjectName->setFloating(false);
- }
+ // Give the dossier a back pointer so that it can respond to
+ // mouse down events
+ _pObjectName->setRPObject(this);
+
+ _pObjectName->setVisible(false);
+ _pObjectName->setActive(false);
+ _pObjectName->setFloating(false);
return true;
}
More information about the Scummvm-git-logs
mailing list