[Scummvm-git-logs] scummvm master -> eac530bbf8b05141a3226fc852396a67c0023026

dreammaster noreply at scummvm.org
Wed Oct 1 10:39:48 UTC 2025


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
55489a426c BAGEL: MINIGAMES: Fix Fuge Coverity warnings
47482218b2 BAGEL: MINIGAMES: Fix Life Coverity warnings
eac530bbf8 BAGEL: MINIGAMES: Clean up original hack in CMnk::TreeAlgo


Commit: 55489a426c7b32aa102b2c21a70c3c8ecf55cc8e
    https://github.com/scummvm/scummvm/commit/55489a426c7b32aa102b2c21a70c3c8ecf55cc8e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2025-10-01T03:26:49-07:00

Commit Message:
BAGEL: MINIGAMES: Fix Fuge Coverity warnings

Changed paths:
    engines/bagel/hodjnpodj/fuge/fuge.cpp
    engines/bagel/hodjnpodj/fuge/usercfg.h


diff --git a/engines/bagel/hodjnpodj/fuge/fuge.cpp b/engines/bagel/hodjnpodj/fuge/fuge.cpp
index 14d2a7655ae..e0b17e01408 100644
--- a/engines/bagel/hodjnpodj/fuge/fuge.cpp
+++ b/engines/bagel/hodjnpodj/fuge/fuge.cpp
@@ -477,7 +477,8 @@ CFugeWindow::CFugeWindow() : gvCenter(CENTER_X, CENTER_Y) {
 			//
 			RealignVectors();
 
-			errCode = LoadMasterSprites();
+			if (!errCode)
+				errCode = LoadMasterSprites();
 
 			if (!errCode)
 				errCode = LoadMasterSounds();
diff --git a/engines/bagel/hodjnpodj/fuge/usercfg.h b/engines/bagel/hodjnpodj/fuge/usercfg.h
index 1eaed5e8488..ea86ea97ec7 100644
--- a/engines/bagel/hodjnpodj/fuge/usercfg.h
+++ b/engines/bagel/hodjnpodj/fuge/usercfg.h
@@ -75,23 +75,23 @@ protected:
 	void OnPaint();
 	DECLARE_MESSAGE_MAP()
 
-	CText        *m_pTxtNumBalls;
-	CText        *m_pTxtStartLevel;
-	CText        *m_pTxtBallSpeed;
-	CText        *m_pTxtPaddleSize;
-	CScrollBar   *m_pScrollBar1;
-	CScrollBar   *m_pScrollBar2;
-	CScrollBar   *m_pScrollBar3;
-	CScrollBar   *m_pScrollBar4;
-	CCheckButton *m_pWallButton;
-
-	int           m_nNumBalls;
-	int           m_nStartLevel;
-	int           m_nBallSpeed;
-	int           m_nPaddleSize;
-	bool          m_bOutterWall;
-
-	bool        m_bSave;                    // True if should save theses values
+	CText        *m_pTxtNumBalls = nullptr;
+	CText        *m_pTxtStartLevel = nullptr;
+	CText        *m_pTxtBallSpeed = nullptr;
+	CText        *m_pTxtPaddleSize = nullptr;
+	CScrollBar   *m_pScrollBar1 = nullptr;
+	CScrollBar   *m_pScrollBar2 = nullptr;
+	CScrollBar   *m_pScrollBar3 = nullptr;
+	CScrollBar   *m_pScrollBar4 = nullptr;
+	CCheckButton *m_pWallButton = nullptr;
+
+	int           m_nNumBalls = 0;
+	int           m_nStartLevel = 0;
+	int           m_nBallSpeed = 0;
+	int           m_nPaddleSize = 0;
+	bool          m_bOutterWall = false;
+
+	bool        m_bSave = false;			// True if should save theses values
 };
 
 } // namespace Fuge


Commit: 47482218b23088da4d0358512d2b58d3406564f3
    https://github.com/scummvm/scummvm/commit/47482218b23088da4d0358512d2b58d3406564f3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2025-10-01T03:31:45-07:00

Commit Message:
BAGEL: MINIGAMES: Fix Life Coverity warnings

Changed paths:
    engines/bagel/hodjnpodj/life/game.cpp
    engines/bagel/hodjnpodj/life/life.h
    engines/bagel/hodjnpodj/life/usercfg.h


diff --git a/engines/bagel/hodjnpodj/life/game.cpp b/engines/bagel/hodjnpodj/life/game.cpp
index 8655ccc4d3c..db90a94d5fb 100644
--- a/engines/bagel/hodjnpodj/life/game.cpp
+++ b/engines/bagel/hodjnpodj/life/game.cpp
@@ -253,7 +253,7 @@ CMainWindow::CMainWindow(HWND hParentWnd, LPGAMESTRUCT lpGameInfo) {
 	                   EVOLVE_BUTTON_HEIGHT + EVOLVE_BUTTON_OFFSET_Y);
 	pEvolveButton = new CColorButton();
 	if (pEvolveButton != nullptr) {
-		(*pEvolveButton).Create("Evolve", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | BS_OWNERDRAW,
+		(void)(*pEvolveButton).Create("Evolve", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | BS_OWNERDRAW,
 		                        EvolveRect, this, IDC_EVOLVE);
 		(*pEvolveButton).SetPalette(pGamePalette);
 	}
diff --git a/engines/bagel/hodjnpodj/life/life.h b/engines/bagel/hodjnpodj/life/life.h
index 90fcaf1bbc1..d22c2b089d5 100644
--- a/engines/bagel/hodjnpodj/life/life.h
+++ b/engines/bagel/hodjnpodj/life/life.h
@@ -66,19 +66,19 @@ public:
 	}
 
 public:
-	colony      *pColony;
-	double      m_dScore;
-	int         m_nCumLife;
-	int         m_nYears;
-	bool        m_bIsEvolving;
-	bool        m_bPrePlace;
+	colony *pColony = nullptr;
+	double m_dScore = 0.0;
+	int m_nCumLife = 0;
+	int m_nYears = 0;
+	bool m_bIsEvolving = false;
+	bool m_bPrePlace = false;
 
-	CText       *pYears, *pYearsText1, *pYearsText2,
-	            *pColonyStat, *pColonyStatText1,
-	            *pScore, *pColonyPlaced, *pTime;
+	CText *pYears = nullptr, *pYearsText1 = nullptr, *pYearsText2 = nullptr,
+		*pColonyStat = nullptr, *pColonyStatText1 = nullptr,
+		*pScore = nullptr, *pColonyPlaced = nullptr, *pTime = nullptr;
 
-	CSprite     *pBaseSprite[VILLAGES];
-	CCalendar   m_cCalendar;
+	CSprite *pBaseSprite[VILLAGES] = {};
+	CCalendar m_cCalendar;
 };
 
 } // namespace Life
diff --git a/engines/bagel/hodjnpodj/life/usercfg.h b/engines/bagel/hodjnpodj/life/usercfg.h
index f52949701ac..a6000f0e48e 100644
--- a/engines/bagel/hodjnpodj/life/usercfg.h
+++ b/engines/bagel/hodjnpodj/life/usercfg.h
@@ -63,17 +63,17 @@ namespace Life {
 
 class CUserCfgDlg : public CBmpDialog {
 private:
-	CString     mSpeedTable[SPEED];
-	int         m_nLife[LIFE_SETTINGS];
-	int         m_nTurns[TURNS_SETTINGS];
-	CText       *m_pVillages,
-	            *m_pSpeed,
-	            *m_pRounds;
+	CString mSpeedTable[SPEED];
+	int m_nLife[LIFE_SETTINGS] = {};
+	int m_nTurns[TURNS_SETTINGS] = {};
+	CText *m_pVillages = nullptr, *m_pSpeed = nullptr,
+		*m_pRounds = nullptr;
+
 public:
-	int         nSpeedTemp,             // remembers cur settings
-	            nTurnCounterTemp,
-	            nLifeTemp;
-	bool        bPrePlaceTemp;
+	int nSpeedTemp = 0,             // remembers cur settings
+		nTurnCounterTemp = 0,
+		nLifeTemp = 0;
+	bool bPrePlaceTemp = false;
 
 	CUserCfgDlg(CWnd *pParent = nullptr, CPalette *pPalette = nullptr, unsigned int = IDD_USERCFG);
 
@@ -84,9 +84,9 @@ public:
 	CString         m_DisplayRounds;
 	CString         m_DisplaySpeed;
 	CString         m_DisplayVillages;
-	CCheckButton    *m_pPrePlaceButton;                 // PrePlace check box
-	CColorButton    *m_pOKButton;                       // OKAY button on scroll
-	CColorButton    *m_pCancelButton;                   // Cancel button on scroll
+	CCheckButton    *m_pPrePlaceButton = nullptr;			// PrePlace check box
+	CColorButton    *m_pOKButton = nullptr;					// OKAY button on scroll
+	CColorButton    *m_pCancelButton = nullptr;				// Cancel button on scroll
 
 protected:
 	void ClearDialogImage();


Commit: eac530bbf8b05141a3226fc852396a67c0023026
    https://github.com/scummvm/scummvm/commit/eac530bbf8b05141a3226fc852396a67c0023026
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2025-10-01T03:38:41-07:00

Commit Message:
BAGEL: MINIGAMES: Clean up original hack in CMnk::TreeAlgo

The original adds a return true inside an allocation for loop,
resulting in a memory leak. So the whole method can basically
be ignored in favour of just a simple return true;

Changed paths:
    engines/bagel/hodjnpodj/mankala/mnklog.cpp


diff --git a/engines/bagel/hodjnpodj/mankala/mnklog.cpp b/engines/bagel/hodjnpodj/mankala/mnklog.cpp
index ccb62a26068..abc4f295b71 100644
--- a/engines/bagel/hodjnpodj/mankala/mnklog.cpp
+++ b/engines/bagel/hodjnpodj/mankala/mnklog.cpp
@@ -1478,31 +1478,7 @@ cleanup:
 */
 
 bool  CMnk::TreeAlgo(CMove *xpcMove) {
-	MOVE* pMoveArr[MAXMOVES],
-	      *pOrigMove;
-	HGLOBAL hMoveArr[MAXMOVES];
-//	char cFinalID;
-	short int   j,
-	      k;
-
-	for (j = 0; j < MAXMOVES; j++) {
-		if (!(hMoveArr[j] = GlobalAlloc(GHND, sizeof(MOVE))))
-			for (k = 0; k < j; k++) {
-				GlobalFree(hMoveArr[k]);
-			}
-		return true;          //for error.
-	}
-
-	pMoveArr[0] = (MOVE*) GlobalLock(hMoveArr[0]);
-
-	memcpy(&(pMoveArr[0]->iNumRocks[0]), &(xpcMove->m_iNumStones[0][2]), NUMPITS * sizeof(int));
-	pMoveArr[0]->iRocksInHomeBin = xpcMove->m_iNumStones[0][1];
-
-	pOrigMove = pMoveArr[0];
-
-	ExtendedStaticEvaluation(pMoveArr[0], pOrigMove, 0, 0);
-	return false;
-
+	return true;
 }
 
 




More information about the Scummvm-git-logs mailing list