[Scummvm-git-logs] scummvm master -> 938d267cc0a685fc3ba5691a21297d61c6e6561d
Strangerke
noreply at scummvm.org
Wed May 15 20:44:36 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:
938d267cc0 BAGEL: standardize error code variable name
Commit: 938d267cc0a685fc3ba5691a21297d61c6e6561d
https://github.com/scummvm/scummvm/commit/938d267cc0a685fc3ba5691a21297d61c6e6561d
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-05-15T21:42:15+01:00
Commit Message:
BAGEL: standardize error code variable name
Changed paths:
engines/bagel/baglib/button_object.cpp
engines/bagel/baglib/dev_dlg.cpp
engines/bagel/baglib/dossier_object.cpp
engines/bagel/baglib/event_sdev.cpp
engines/bagel/baglib/expression.cpp
engines/bagel/baglib/log_msg.cpp
engines/bagel/baglib/master_win.cpp
engines/bagel/baglib/moo.cpp
engines/bagel/baglib/pan_window.cpp
engines/bagel/baglib/pda.cpp
engines/bagel/baglib/rp_object.cpp
engines/bagel/baglib/sound_object.cpp
engines/bagel/baglib/storage_dev_win.cpp
engines/bagel/baglib/text_object.cpp
engines/bagel/baglib/time_object.cpp
engines/bagel/baglib/variable_object.cpp
engines/bagel/baglib/wield.cpp
engines/bagel/baglib/zoom_pda.cpp
engines/bagel/boflib/dat_file.cpp
engines/bagel/boflib/gfx/bitmap.cpp
engines/bagel/boflib/options.cpp
engines/bagel/boflib/sound.cpp
engines/bagel/spacebar/computer.cpp
engines/bagel/spacebar/sraf_computer.cpp
engines/bagel/spacebar/thud.cpp
diff --git a/engines/bagel/baglib/button_object.cpp b/engines/bagel/baglib/button_object.cpp
index c18d23c5ddd..470c2cc969d 100644
--- a/engines/bagel/baglib/button_object.cpp
+++ b/engines/bagel/baglib/button_object.cpp
@@ -50,7 +50,7 @@ CBagButtonObject::~CBagButtonObject() {
}
ErrorCode CBagButtonObject::attach() {
- ErrorCode rc = CBagSpriteObject::attach();
+ ErrorCode errorCode = CBagSpriteObject::attach();
if (getSprite()) {
getSprite()->setAnimated(false);
@@ -74,7 +74,7 @@ ErrorCode CBagButtonObject::attach() {
setPosition(NewPoint);
}
- return rc;
+ return errorCode;
}
ErrorCode CBagButtonObject::detach() {
@@ -328,9 +328,9 @@ ErrorCode CBagButtonObject::update(CBofBitmap *bmp, CBofPoint pt, CBofRect *srcR
}
if (getSprite() && ((getSprite()->getCelCount() > 1) || isVisible())) {
- ErrorCode err = CBagSpriteObject::update(bmp, pt, srcRect, maskColor);
+ ErrorCode errorCode = CBagSpriteObject::update(bmp, pt, srcRect, maskColor);
setDirty(bDirty);
- return err;
+ return errorCode;
}
return _errCode;
diff --git a/engines/bagel/baglib/dev_dlg.cpp b/engines/bagel/baglib/dev_dlg.cpp
index decaf2b64ea..3189a2545a1 100644
--- a/engines/bagel/baglib/dev_dlg.cpp
+++ b/engines/bagel/baglib/dev_dlg.cpp
@@ -193,26 +193,28 @@ void CDevDlg::setText(CBofString &text, CBofRect *textRect) {
assert(isValidObject(this));
_titleText = new CBofText;
- if (_titleText != nullptr) {
- _titleText->setupText(textRect, JUSTIFY_CENTER, FORMAT_DEFAULT);
- _titleText->setColor(CTEXT_WHITE);
- _titleText->SetSize(FONT_14POINT);
- _titleText->setWeight(TEXT_BOLD);
- _titleText->setText(text);
- }
+
+ if (_titleText == nullptr)
+ fatalError(ERR_MEMORY, "Unable to instantiate a new CBofText");
+
+ _titleText->setupText(textRect, JUSTIFY_CENTER, FORMAT_DEFAULT);
+ _titleText->setColor(CTEXT_WHITE);
+ _titleText->SetSize(FONT_14POINT);
+ _titleText->setWeight(TEXT_BOLD);
+ _titleText->setText(text);
}
// Override on render to do the painting, but call the default anyway.
ErrorCode CDevDlg::onRender(CBofBitmap *bmp, CBofRect *rect) {
assert(isValidObject(this));
- ErrorCode errCode = CBagStorageDevDlg::onRender(bmp, rect);
+ ErrorCode errorCode = CBagStorageDevDlg::onRender(bmp, rect);
if (_titleText != nullptr) {
_titleText->display(getBackdrop());
}
- return errCode;
+ return errorCode;
}
} // namespace Bagel
diff --git a/engines/bagel/baglib/dossier_object.cpp b/engines/bagel/baglib/dossier_object.cpp
index 79ab9c5b052..7ff8046ad80 100644
--- a/engines/bagel/baglib/dossier_object.cpp
+++ b/engines/bagel/baglib/dossier_object.cpp
@@ -222,7 +222,7 @@ ParseCodes CBagDossierObject::setInfo(CBagIfstream &istr) {
// Implement attach and detach just so we can set our own attributes
ErrorCode CBagDossierObject::attach() {
- ErrorCode ec = CBagTextObject::attach();
+ ErrorCode errorCode = CBagTextObject::attach();
// Keep track of the original text rectangle (for the dossier).
if (_dosRectInitFl == false) {
@@ -232,14 +232,14 @@ ErrorCode CBagDossierObject::attach() {
setVisible(false); // Don't display until needed.
setActive(false); // Not active until we need it.
- return ec;
+ return errorCode;
}
ErrorCode CBagDossierObject::detach() {
- ErrorCode ec = CBagTextObject::detach();
+ ErrorCode errorCode = CBagTextObject::detach();
setVisible(false); // Make this invisible, don't want it redrawn.
- return ec;
+ return errorCode;
}
// Called to splash one of these guys to the screen
diff --git a/engines/bagel/baglib/event_sdev.cpp b/engines/bagel/baglib/event_sdev.cpp
index b543625ea0e..692c300d576 100644
--- a/engines/bagel/baglib/event_sdev.cpp
+++ b/engines/bagel/baglib/event_sdev.cpp
@@ -28,7 +28,7 @@ namespace Bagel {
bool CBagEventSDev::_evalTurnEventsFl;
ErrorCode CBagEventSDev::attach() {
- ErrorCode errCode = CBagStorageDev::attach();
+ ErrorCode errorCode = CBagStorageDev::attach();
// Set the firstpaint flag and attach objects to allow
// for immediate run objects to run
@@ -37,7 +37,7 @@ ErrorCode CBagEventSDev::attach() {
attachActiveObjects();
}
- return errCode;
+ return errorCode;
}
@@ -46,7 +46,7 @@ ErrorCode CBagEventSDev::evaluateExpressions() {
if (CBagPDA::isMoviePlaying())
return ERR_NONE;
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
int count = getObjectCount();
for (int i = 0; i < count; ++i) {
@@ -67,10 +67,10 @@ ErrorCode CBagEventSDev::evaluateExpressions() {
posObj->detach();
}
} else
- errCode = ERR_FFIND;
+ errorCode = ERR_FFIND;
}
- return errCode;
+ return errorCode;
}
ErrorCode CBagTurnEventSDev::evaluateExpressions() {
@@ -79,7 +79,7 @@ ErrorCode CBagTurnEventSDev::evaluateExpressions() {
return ERR_UNKNOWN;
}
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
int count = getObjectCount();
for (int i = 0; i < count; ++i) {
CBagObject *posObj = getObjectByPos(i);
@@ -98,10 +98,10 @@ ErrorCode CBagTurnEventSDev::evaluateExpressions() {
posObj->detach();
}
} else
- errCode = ERR_FFIND;
+ errorCode = ERR_FFIND;
}
- return errCode;
+ return errorCode;
}
} // namespace Bagel
diff --git a/engines/bagel/baglib/expression.cpp b/engines/bagel/baglib/expression.cpp
index 7c53614ddde..da6cfab671a 100644
--- a/engines/bagel/baglib/expression.cpp
+++ b/engines/bagel/baglib/expression.cpp
@@ -665,7 +665,7 @@ ParseCodes CBagExpression::setInfo(CBagIfstream &istr) {
ErrorCode CBagExpression::getOperatorFromStream(CBagIfstream &istr, OPERATION &oper) {
- ErrorCode rc = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
char localBuff[256];
localBuff[0] = 0;
@@ -743,9 +743,9 @@ ErrorCode CBagExpression::getOperatorFromStream(CBagIfstream &istr, OPERATION &o
}
if (oper == OP_NONE)
- rc = ERR_UNKNOWN;
+ errorCode = ERR_UNKNOWN;
- return rc;
+ return errorCode;
}
} // namespace Bagel
diff --git a/engines/bagel/baglib/log_msg.cpp b/engines/bagel/baglib/log_msg.cpp
index 6b4d15c3067..01431505a19 100644
--- a/engines/bagel/baglib/log_msg.cpp
+++ b/engines/bagel/baglib/log_msg.cpp
@@ -205,7 +205,7 @@ void CBagLog::setCurFltPage(int fltPage) {
}
ErrorCode CBagLog::releaseMsg() {
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
int count = _queuedMsgList->getCount();
for (int i = 0; i < count; ++i) {
@@ -222,7 +222,7 @@ ErrorCode CBagLog::releaseMsg() {
}
_queuedMsgList->removeAll();
- return errCode;
+ return errorCode;
}
CBagObject *CBagLog::onNewUserObject(const CBofString &initStr) {
@@ -285,10 +285,10 @@ bool CBagLog::removeFromMsgQueue(CBagObject *deletedObj) {
}
ErrorCode CBagLog::activateLocalObject(CBagObject *bagObj) {
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
if (bagObj == nullptr)
- return errCode;
+ return errorCode;
if (bagObj->isMsgWaiting() ||
(bagObj->getType() == USER_OBJ && (bagObj->getInitInfo() != nullptr) && (*bagObj->getInitInfo() == "MSG"))) {
@@ -320,14 +320,14 @@ ErrorCode CBagLog::activateLocalObject(CBagObject *bagObj) {
}
}
} else {
- errCode = CBagStorageDev::activateLocalObject(bagObj);
+ errorCode = CBagStorageDev::activateLocalObject(bagObj);
}
- return errCode;
+ return errorCode;
}
ErrorCode CBagLog::playMsgQueue() {
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
int count = _queuedMsgList->getCount();
// Walk through the message queue and play all the messages
@@ -367,7 +367,7 @@ ErrorCode CBagLog::playMsgQueue() {
if (curObj) {
CRect r = getRect();
- errCode = CBagStorageDev::activateLocalObject(curObj);
+ errorCode = CBagStorageDev::activateLocalObject(curObj);
CBagMenu *objMenu = curObj->getMenuPtr();
if (objMenu)
objMenu->trackPopupMenu(0, 0, 0, CBofApp::getApp()->getMainWindow(), nullptr, &r);
@@ -400,7 +400,7 @@ ErrorCode CBagLog::playMsgQueue() {
}
}
- return errCode;
+ return errorCode;
}
CBagLogResidue::CBagLogResidue(int sdevWidth) : CBagTextObject() {
@@ -975,7 +975,7 @@ ErrorCode CBagLogClue::attach() {
assert(isValidObject(this));
- ErrorCode ec = CBagTextObject::attach();
+ ErrorCode errorCode = CBagTextObject::attach();
// Get what is defined in the script.
cFormat = getFileName();
@@ -994,7 +994,7 @@ ErrorCode CBagLogClue::attach() {
CBofString cStr(szClueStr);
setPSText(&cStr);
- return ec;
+ return errorCode;
}
ParseCodes CBagLogClue::setInfo(CBagIfstream &istr) {
diff --git a/engines/bagel/baglib/master_win.cpp b/engines/bagel/baglib/master_win.cpp
index 2bfb067bf80..b286306cb58 100644
--- a/engines/bagel/baglib/master_win.cpp
+++ b/engines/bagel/baglib/master_win.cpp
@@ -1944,7 +1944,7 @@ ErrorCode paintBeveledText(CBofWindow *win, CBofRect *rect, const CBofString &cS
CBofBitmap bmp(rect->width(), rect->height(), nullptr, false);
// Assume no error
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
CBofRect r = bmp.getRect();
CBofPalette *palette = nullptr;
@@ -1989,7 +1989,7 @@ ErrorCode paintBeveledText(CBofWindow *win, CBofRect *rect, const CBofString &cS
bmp.paint(win, rect);
- return errCode;
+ return errorCode;
}
ErrorCode waitForInput() {
diff --git a/engines/bagel/baglib/moo.cpp b/engines/bagel/baglib/moo.cpp
index 8e1d8e759bb..4f3c2b1d095 100644
--- a/engines/bagel/baglib/moo.cpp
+++ b/engines/bagel/baglib/moo.cpp
@@ -36,20 +36,20 @@ void CBagMoo::initialize() {
}
ErrorCode CBagMoo::update(CBofBitmap *pBmp, CBofPoint /*pt*/, CBofRect *pSrcRect, int nMaskColor) {
- ErrorCode ec = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
if (_pMovie) {
// Update the movie, assume only unzoomed pda right now
CBofPoint cPos(116, 61);
- ec = _pMovie->update(pBmp, cPos, pSrcRect, nMaskColor);
+ errorCode = _pMovie->update(pBmp, cPos, pSrcRect, nMaskColor);
// If we're done or we encountered an error, then roll over and die.
- if (ec != ERR_NONE || _pMovie->isModalDone()) {
+ if (errorCode != ERR_NONE || _pMovie->isModalDone()) {
stopMovie(true);
}
}
- return ec;
+ return errorCode;
}
CBagMoo::~CBagMoo() {
@@ -59,7 +59,7 @@ CBagMoo::~CBagMoo() {
}
ErrorCode CBagMoo::setPDAMovie(CBofString &s) {
- ErrorCode ec = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
// Should never happen, but just make sure.
if (_pMovie) {
@@ -75,14 +75,14 @@ ErrorCode CBagMoo::setPDAMovie(CBofString &s) {
_pMovie->setFileName(s);
// Attach this bad baby...
- ec = _pMovie->attach();
- if (ec == ERR_NONE) {
+ errorCode = _pMovie->attach();
+ if (errorCode == ERR_NONE) {
_pMovie->setModal(false);
_pMovie->setNumOfLoops(1);
}
}
- return ec;
+ return errorCode;
}
void CBagMoo::stopMovie(bool bResetPDA) {
diff --git a/engines/bagel/baglib/pan_window.cpp b/engines/bagel/baglib/pan_window.cpp
index 7c14dd96c04..191f583fb57 100644
--- a/engines/bagel/baglib/pan_window.cpp
+++ b/engines/bagel/baglib/pan_window.cpp
@@ -279,7 +279,7 @@ ErrorCode CBagPanWindow::onRender(CBofBitmap *pBmp, CBofRect *pRect) {
}
ErrorCode CBagPanWindow::paintObjects(CBofList<CBagObject *> *list, CBofBitmap *pBmp, CBofRect &viewRect, CBofList<CBofRect> *pUpdateArea, bool tempVar) {
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
// can't use a null pointer
assert(pBmp != nullptr);
@@ -362,7 +362,7 @@ ErrorCode CBagPanWindow::paintObjects(CBofList<CBagObject *> *list, CBofBitmap *
noObjectsUnderMouse();
}
- return errCode;
+ return errorCode;
}
// Delete the foreground objects
diff --git a/engines/bagel/baglib/pda.cpp b/engines/bagel/baglib/pda.cpp
index 3f7fd7d2a16..4d6491a4d80 100644
--- a/engines/bagel/baglib/pda.cpp
+++ b/engines/bagel/baglib/pda.cpp
@@ -86,18 +86,15 @@ CBagPDA::~CBagPDA() {
assert(isValidObject(this));
// Does not own list item, so no need to delete individual nodes
- if (_movieList) {
- delete _movieList;
- _movieList = nullptr;
- }
+ delete _movieList;
+ _movieList = nullptr;
}
ErrorCode CBagPDA::loadFile(const CBofString &sFile) {
assert(isValidObject(this));
- ErrorCode error;
-
- error = CBagStorageDev::loadFile(sFile);
+ ErrorCode errorCode = CBagStorageDev::loadFile(sFile);
+
if (_mooWnd) {
removeObject(_mooWnd);
}
@@ -111,12 +108,12 @@ ErrorCode CBagPDA::loadFile(const CBofString &sFile) {
removeObject(_logWnd);
}
- return error;
+ return errorCode;
}
ErrorCode CBagPDA::attach() {
CBagStorageDev *pSDev;
- ErrorCode rc = CBagStorageDevBmp::attach();
+ ErrorCode errorCode = CBagStorageDevBmp::attach();
// Get PDA state info
getPdaState();
@@ -139,7 +136,7 @@ ErrorCode CBagPDA::attach() {
_mooWnd->setAssociateWnd(getAssociateWnd());
_mooWnd->setTransparent(false);
_mooWnd->setVisible(false);
- rc = _mooWnd->attach();
+ errorCode = _mooWnd->attach();
}
}
@@ -151,10 +148,10 @@ ErrorCode CBagPDA::attach() {
_invWnd->setTransparent(false);
_invWnd->setVisible(false);
- rc = _invWnd->attach();
+ errorCode = _invWnd->attach();
} else {
bofMessageBox("No PDA INVENTORY found", __FILE__);
- rc = ERR_UNKNOWN;
+ errorCode = ERR_UNKNOWN;
}
}
@@ -166,10 +163,10 @@ ErrorCode CBagPDA::attach() {
_mapWnd->setTransparent(false);
_mapWnd->setVisible(false);
- rc = _mapWnd->attach();
+ errorCode = _mapWnd->attach();
} else {
bofMessageBox("No PDA MAP found", __FILE__);
- rc = ERR_UNKNOWN;
+ errorCode = ERR_UNKNOWN;
}
}
if (!_logWnd) {
@@ -180,7 +177,7 @@ ErrorCode CBagPDA::attach() {
_logWnd->setTransparent(false);
_logWnd->setVisible(false);
- rc = _logWnd->attach();
+ errorCode = _logWnd->attach();
}
}
if (_pdaMode == PDA_INV_MODE) {
@@ -191,7 +188,7 @@ ErrorCode CBagPDA::attach() {
showLog();
}
- return rc;
+ return errorCode;
}
void CBagPDA::setPosInWindow(int cx, int cy, int nDist) {
@@ -238,10 +235,10 @@ bool CBagPDA::showInventory() {
ErrorCode CBagPDA::update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcRect, int /* nMaskColor */) {
// Update the zoom button (it might need to blink).
handleZoomButton(false);
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
if (_hidePdaFl)
- return errCode;
+ return errorCode;
CBofRect r;
CBofRect *pr = pSrcRect;
@@ -308,7 +305,7 @@ ErrorCode CBagPDA::update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcRect, in
// If the official decree from on high has been given to update, do so!
if (bUpdate) {
- errCode = CBagStorageDevBmp::update(pBmp, pt, pr, _nMaskColor);
+ errorCode = CBagStorageDevBmp::update(pBmp, pt, pr, _nMaskColor);
}
// If the PDA is activating then redraw our black background
@@ -323,7 +320,7 @@ ErrorCode CBagPDA::update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcRect, in
setDirty(false);
}
- return errCode;
+ return errorCode;
}
diff --git a/engines/bagel/baglib/rp_object.cpp b/engines/bagel/baglib/rp_object.cpp
index e580b578403..39e0caa3b97 100644
--- a/engines/bagel/baglib/rp_object.cpp
+++ b/engines/bagel/baglib/rp_object.cpp
@@ -401,7 +401,7 @@ ErrorCode CBagRPObject::attach() {
_pRPList->addToTail(this);
- ErrorCode ec = CBagObject::attach();
+ ErrorCode errorCode = CBagObject::attach();
// If we haven't initialized this guys original rectangle, then do it
// here.
@@ -439,7 +439,7 @@ ErrorCode CBagRPObject::attach() {
break;
}
- return ec;
+ return errorCode;
}
ErrorCode CBagRPObject::detach() {
diff --git a/engines/bagel/baglib/sound_object.cpp b/engines/bagel/baglib/sound_object.cpp
index 8a4eb4e5575..b97b9899ef3 100644
--- a/engines/bagel/baglib/sound_object.cpp
+++ b/engines/bagel/baglib/sound_object.cpp
@@ -64,7 +64,7 @@ ErrorCode CBagSoundObject::attach(CBofWindow *pWnd) {
ErrorCode CBagSoundObject::newSound(CBofWindow *pWin) {
// assume no error
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
killSound();
@@ -74,10 +74,10 @@ ErrorCode CBagSoundObject::newSound(CBofWindow *pWin) {
_pSound->setQSlot(getState());
} else {
- errCode = ERR_MEMORY;
+ errorCode = ERR_MEMORY;
}
- return errCode;
+ return errorCode;
}
void CBagSoundObject::killSound() {
diff --git a/engines/bagel/baglib/storage_dev_win.cpp b/engines/bagel/baglib/storage_dev_win.cpp
index 4657618b143..22267f33948 100644
--- a/engines/bagel/baglib/storage_dev_win.cpp
+++ b/engines/bagel/baglib/storage_dev_win.cpp
@@ -189,31 +189,31 @@ bool CBagStorageDev::contains(CBagObject *pObj, bool bActive) {
ErrorCode CBagStorageDev::addObject(CBagObject *pObj, int /*nPos*/) {
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
// can't use a null pointer
assert(pObj != nullptr);
_pObjectList->addToTail(pObj);
- return errCode;
+ return errorCode;
}
ErrorCode CBagStorageDev::removeObject(CBagObject *pRObj) {
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
if (!_bForeignList) {
int nCount = getObjectCount();
for (int i = 0; i < nCount; ++i) {
if (pRObj == getObjectByPos(i)) {
_pObjectList->remove(i);
- return errCode;
+ return errorCode;
}
}
}
- return errCode;
+ return errorCode;
}
@@ -247,7 +247,7 @@ ErrorCode CBagStorageDev::activateLocalObject(const CBofString &sName) {
}
ErrorCode CBagStorageDev::deactivateLocalObject(CBagObject *pObj) {
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
if (pObj != nullptr) {
pObj->setLocal(false);
@@ -256,10 +256,10 @@ ErrorCode CBagStorageDev::deactivateLocalObject(CBagObject *pObj) {
pObj->detach();
}
} else {
- errCode = ERR_FFIND;
+ errorCode = ERR_FFIND;
}
- return errCode;
+ return errorCode;
}
@@ -307,7 +307,7 @@ CBofPoint CBagStorageDev::arrangeFloater(CBofPoint nPos, CBagObject *pObj) {
ErrorCode CBagStorageDev::attachActiveObjects() {
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
CBofPoint nArrangePos(0, 0); // Removed 5,5 padding
CBagLog::initArrangePages();
@@ -350,17 +350,17 @@ ErrorCode CBagStorageDev::attachActiveObjects() {
}
}
} else
- errCode = ERR_FFIND;
+ errorCode = ERR_FFIND;
}
}
CBagLog::arrangePages();
- return errCode;
+ return errorCode;
}
ErrorCode CBagStorageDev::detachActiveObjects() {
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
int nCount = getObjectCount();
if (nCount != 0) {
@@ -374,19 +374,19 @@ ErrorCode CBagStorageDev::detachActiveObjects() {
pObj->detach();
}
} else
- errCode = ERR_FFIND;
+ errorCode = ERR_FFIND;
}
}
- return errCode;
+ return errorCode;
}
ErrorCode CBagStorageDev::loadObjects() {
- ErrorCode errCode = ERR_NONE;
- return errCode;
+ ErrorCode errorCode = ERR_NONE;
+ return errorCode;
}
ErrorCode CBagStorageDev::releaseObjects() {
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
int nCount = getObjectCount();
if (!_bForeignList) {
@@ -399,7 +399,7 @@ ErrorCode CBagStorageDev::releaseObjects() {
_pObjectList->removeAll();
}
- return errCode;
+ return errorCode;
}
@@ -964,7 +964,7 @@ ParseCodes CBagStorageDev::setInfo(CBagIfstream &fpInput) {
ErrorCode CBagStorageDev::attach() {
// Assume no error
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
_bFirstPaint = true;
@@ -973,13 +973,13 @@ ErrorCode CBagStorageDev::attach() {
if ((pBmp != nullptr) && !pBmp->errorOccurred()) {
setBackground(pBmp);
- errCode = attachActiveObjects();
+ errorCode = attachActiveObjects();
} else {
- errCode = ERR_FOPEN;
+ errorCode = ERR_FOPEN;
}
}
- return errCode;
+ return errorCode;
}
@@ -1740,9 +1740,9 @@ ErrorCode CBagStorageDevDlg::loadFile(const CBofString &sFile) {
}
ErrorCode CBagStorageDevDlg::create(const char *pszName, CBofRect *pRect, CBofWindow *pParent, uint32 nControlID) {
- ErrorCode rc = CBofDialog::create(pszName, pRect, pParent, nControlID);
+ ErrorCode errorCode = CBofDialog::create(pszName, pRect, pParent, nControlID);
setCapture();
- return rc;
+ return errorCode;
}
diff --git a/engines/bagel/baglib/text_object.cpp b/engines/bagel/baglib/text_object.cpp
index c68482a779b..3ac64fd7032 100644
--- a/engines/bagel/baglib/text_object.cpp
+++ b/engines/bagel/baglib/text_object.cpp
@@ -71,7 +71,7 @@ ErrorCode CBagTextObject::update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcR
assert(pSrcRect != nullptr);
// assume no error
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
if ((pBmp != nullptr) && isAttached() && !(getText().isEmpty())) {
@@ -115,14 +115,14 @@ ErrorCode CBagTextObject::update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcR
r.left += 1;
}
- errCode = paintText(pBmp, &r, getText(), mapWindowsPointSize(nPointSize), TEXT_NORMAL, _nFGColor, JUSTIFY_WRAP, nFormat, _nTextFont);
+ errorCode = paintText(pBmp, &r, getText(), mapWindowsPointSize(nPointSize), TEXT_NORMAL, _nFGColor, JUSTIFY_WRAP, nFormat, _nTextFont);
// This object does not need to be updated now...
setDirty(false);
}
}
- return errCode;
+ return errorCode;
}
ErrorCode CBagTextObject::attach() {
diff --git a/engines/bagel/baglib/time_object.cpp b/engines/bagel/baglib/time_object.cpp
index 2a7b5656bd8..5cc820ce51e 100644
--- a/engines/bagel/baglib/time_object.cpp
+++ b/engines/bagel/baglib/time_object.cpp
@@ -236,7 +236,7 @@ ErrorCode CBagTimeObject::update(CBofBitmap *pBmp, CBofPoint pt, CBofRect * /*pS
char szLocalBuff[256];
szLocalBuff[0] = '\0';
CBofString sTimeString(szLocalBuff, 256);
- ErrorCode rc = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
CBagVar *xVar = g_VarManager->getVariable(_sVariable);
@@ -279,7 +279,7 @@ ErrorCode CBagTimeObject::update(CBofBitmap *pBmp, CBofPoint pt, CBofRect * /*pS
}
}
- return rc;
+ return errorCode;
}
} // namespace Bagel
diff --git a/engines/bagel/baglib/variable_object.cpp b/engines/bagel/baglib/variable_object.cpp
index 20e7f5d9260..a22ecf709e4 100644
--- a/engines/bagel/baglib/variable_object.cpp
+++ b/engines/bagel/baglib/variable_object.cpp
@@ -148,7 +148,7 @@ ParseCodes CBagVariableObject::setInfo(CBagIfstream &istr) {
}
ErrorCode CBagVariableObject::update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcRect, int) {
- ErrorCode rc = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
CBagVar *xVar = g_VarManager->getVariable(getFileName());
if (isAttached() && xVar && !(xVar->getValue().isEmpty())) {
@@ -165,28 +165,28 @@ ErrorCode CBagVariableObject::update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *p
pt.x += 5;
CBofRect r(pt, pSrcRect->size());
- rc = paintText(pBmp, &r, xVar->getValue(), mapFontPointSize(_nPointSize), TEXT_NORMAL, _nFGColor);
+ errorCode = paintText(pBmp, &r, xVar->getValue(), mapFontPointSize(_nPointSize), TEXT_NORMAL, _nFGColor);
// Don't need to redraw!
setDirty(false);
}
- return rc;
+ return errorCode;
}
ErrorCode CBagVariableObject::update(CBofWindow *pWnd, CBofPoint pt, CBofRect *pSrcRect, int) {
- ErrorCode rc = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
CBagVar *xVar = g_VarManager->getVariable(getFileName());
if (isAttached() && xVar && !(xVar->getValue().isEmpty())) {
CBofRect r(pt, pSrcRect->size());
- rc = paintText(pWnd, &r, xVar->getValue(), mapFontPointSize(_nPointSize), TEXT_NORMAL, _nFGColor);
+ errorCode = paintText(pWnd, &r, xVar->getValue(), mapFontPointSize(_nPointSize), TEXT_NORMAL, _nFGColor);
// Don't need to redraw!
setDirty(false);
}
- return rc;
+ return errorCode;
}
} // namespace Bagel
diff --git a/engines/bagel/baglib/wield.cpp b/engines/bagel/baglib/wield.cpp
index fb12bd8fe5d..a86d45a8b1d 100644
--- a/engines/bagel/baglib/wield.cpp
+++ b/engines/bagel/baglib/wield.cpp
@@ -41,9 +41,9 @@ CBagWield::~CBagWield() {
}
ErrorCode CBagWield::loadFile(const CBofString &sFile) {
- ErrorCode error = CBagStorageDev::loadFile(sFile);
+ ErrorCode errorCode = CBagStorageDev::loadFile(sFile);
- return error;
+ return errorCode;
}
ErrorCode CBagWield::attach() {
@@ -94,7 +94,7 @@ bool CBagWield::onObjInteraction(CBagObject *pObj, CBagStorageDev *pSDev) {
}
ErrorCode CBagWield::activateLocalObject(CBagObject *pObj) {
- ErrorCode errCode = ERR_UNKNOWN;
+ ErrorCode errorCode = ERR_UNKNOWN;
if (pObj != nullptr) {
// Since we can only hold one object at a time, put the object that
@@ -134,10 +134,10 @@ ErrorCode CBagWield::activateLocalObject(CBagObject *pObj) {
pObj->setPosition(cPos);
pObj->setFloating(false);
- errCode = CBagStorageDev::activateLocalObject(pObj);
+ errorCode = CBagStorageDev::activateLocalObject(pObj);
}
- return errCode;
+ return errorCode;
}
ErrorCode CBagWield::deactivateLocalObject(CBagObject *pObj) {
diff --git a/engines/bagel/baglib/zoom_pda.cpp b/engines/bagel/baglib/zoom_pda.cpp
index e269341a191..ba072c40e3b 100644
--- a/engines/bagel/baglib/zoom_pda.cpp
+++ b/engines/bagel/baglib/zoom_pda.cpp
@@ -134,8 +134,8 @@ ErrorCode SBZoomPda::attach() {
// Other classes need to know if we're zoomed
setZoomed(true);
- ErrorCode rc = CBagStorageDevWnd::attach();
- if (rc == ERR_NONE) {
+ ErrorCode errorCode = CBagStorageDevWnd::attach();
+ if (errorCode == ERR_NONE) {
CBagStorageDev *pSDev;
if (!_mooWnd) {
pSDev = g_SDevManager->getStorageDevice(ZOOM_MOO_WLD);
@@ -145,7 +145,7 @@ ErrorCode SBZoomPda::attach() {
_mooWnd->setAssociateWnd(getAssociateWnd());
_mooWnd->setTransparent(false);
_mooWnd->setVisible(false);
- rc = _mooWnd->attach();
+ errorCode = _mooWnd->attach();
}
} else {
// Already attached just update
@@ -160,10 +160,10 @@ ErrorCode SBZoomPda::attach() {
_invWnd->setTransparent(false);
_invWnd->setVisible(false);
- rc = _invWnd->attach();
+ errorCode = _invWnd->attach();
} else {
bofMessageBox("No PDA INVENTORY found", __FILE__);
- rc = ERR_UNKNOWN;
+ errorCode = ERR_UNKNOWN;
}
} else {
// Already attached just update
@@ -178,10 +178,10 @@ ErrorCode SBZoomPda::attach() {
_mapWnd->setTransparent(false);
_mapWnd->setVisible(false);
- rc = _mapWnd->attach();
+ errorCode = _mapWnd->attach();
} else {
bofMessageBox("No PDA MAP found", __FILE__);
- rc = ERR_UNKNOWN;
+ errorCode = ERR_UNKNOWN;
}
} else {
// Already attached just update
@@ -196,7 +196,7 @@ ErrorCode SBZoomPda::attach() {
_logWnd->setTransparent(false);
_logWnd->setVisible(false);
- rc = _logWnd->attach();
+ errorCode = _logWnd->attach();
}
} else {
// Already attached just update
@@ -219,7 +219,7 @@ ErrorCode SBZoomPda::attach() {
// Keep track of updates...
g_lZoomPDALastUpdate = 0;
- return rc;
+ return errorCode;
}
CBagObject *SBZoomPda::onNewButtonObject(const CBofString &) {
diff --git a/engines/bagel/boflib/dat_file.cpp b/engines/bagel/boflib/dat_file.cpp
index fa423edc38f..ebd4e8f6e2f 100644
--- a/engines/bagel/boflib/dat_file.cpp
+++ b/engines/bagel/boflib/dat_file.cpp
@@ -250,12 +250,12 @@ ErrorCode CBofDataFile::readHeader() {
seek(_lHeaderStart);
// Read header
- ErrorCode errCode = ERR_NONE;
- for (int i = 0; i < _lNumRecs && errCode == ERR_NONE; ++i) {
- errCode = read(_pHeader[i]);
+ ErrorCode errorCode = ERR_NONE;
+ for (int i = 0; i < _lNumRecs && errorCode == ERR_NONE; ++i) {
+ errorCode = read(_pHeader[i]);
}
- if (errCode == ERR_NONE) {
+ if (errorCode == ERR_NONE) {
uint32 lCrc = calculateCRC(&_pHeader->_lOffset, 4 * _lNumRecs);
if (lCrc != stHeaderInfo._lFootCrc) {
@@ -313,12 +313,12 @@ ErrorCode CBofDataFile::writeHeader() {
seek(_lHeaderStart);
// Write header to data file
- ErrorCode errCode = ERR_NONE;
- for (int i = 0; i < _lNumRecs && errCode == ERR_NONE; ++i) {
- errCode = write(_pHeader[i]);
+ ErrorCode errorCode = ERR_NONE;
+ for (int i = 0; i < _lNumRecs && errorCode == ERR_NONE; ++i) {
+ errorCode = write(_pHeader[i]);
}
- if (errCode == ERR_NONE) {
+ if (errorCode == ERR_NONE) {
// Header is now clean
_bHeaderDirty = false;
@@ -755,24 +755,24 @@ ErrorCode CBofDataFile::read(void *pDestBuf, int32 lBytes) {
ErrorCode CBofDataFile::read(HEAD_INFO &rec) {
byte buf[16];
- ErrorCode result = read(&buf[0], 16);
+ ErrorCode errorCode = read(&buf[0], 16);
Common::MemoryReadStream mem(buf, 16);
Common::Serializer s(&mem, nullptr);
rec.synchronize(s);
- return result;
+ return errorCode;
}
ErrorCode CBofDataFile::read(HEADER_REC &rec) {
byte buf[16];
- ErrorCode result = read(&buf[0], 16);
+ ErrorCode errorCode = read(&buf[0], 16);
Common::MemoryReadStream mem(buf, 16);
Common::Serializer s(&mem, nullptr);
rec.synchronize(s);
- return result;
+ return errorCode;
}
ErrorCode CBofDataFile::write(const void *pSrcBuf, int32 lBytes) {
diff --git a/engines/bagel/boflib/gfx/bitmap.cpp b/engines/bagel/boflib/gfx/bitmap.cpp
index 5d287d1b4f9..7838b82ce02 100644
--- a/engines/bagel/boflib/gfx/bitmap.cpp
+++ b/engines/bagel/boflib/gfx/bitmap.cpp
@@ -1117,8 +1117,7 @@ ErrorCode paintBitmap(CBofWindow *pWindow, const char *pszFileName, CBofRect *pD
assert(pWindow != nullptr);
assert(pszFileName != nullptr);
- // Assume no error
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode;
CBofBitmap *pBmp = new CBofBitmap(pszFileName, pPalette);
if (pBmp != nullptr) {
@@ -1130,15 +1129,15 @@ ErrorCode paintBitmap(CBofWindow *pWindow, const char *pszFileName, CBofRect *pD
if (pDstRect == nullptr)
pDstRect = &cRect;
- errCode = pBmp->paint(pWindow, pDstRect, pSrcRect, nMaskColor);
+ errorCode = pBmp->paint(pWindow, pDstRect, pSrcRect, nMaskColor);
delete pBmp;
} else {
- errCode = ERR_MEMORY;
+ errorCode = ERR_MEMORY;
}
- return errCode;
+ return errorCode;
}
Graphics::ManagedSurface CBofBitmap::getSurface() {
diff --git a/engines/bagel/boflib/options.cpp b/engines/bagel/boflib/options.cpp
index 79407c529b0..98f3b308a0c 100644
--- a/engines/bagel/boflib/options.cpp
+++ b/engines/bagel/boflib/options.cpp
@@ -72,7 +72,7 @@ ErrorCode CBofOptions::load() {
assert(isValidObject(this));
// Assume no error
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
// Free any previous option info
release();
@@ -93,7 +93,7 @@ ErrorCode CBofOptions::load() {
}
} else {
- errCode = ERR_MEMORY;
+ errorCode = ERR_MEMORY;
break;
}
}
@@ -106,10 +106,10 @@ ErrorCode CBofOptions::load() {
f.close();
} else {
- errCode = ERR_FOPEN;
+ errorCode = ERR_FOPEN;
}
- return errCode;
+ return errorCode;
}
void CBofOptions::release() {
@@ -128,7 +128,7 @@ void CBofOptions::release() {
ErrorCode CBofOptions::commit() {
assert(isValidObject(this));
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
if ((_pOptionList != nullptr) && _bDirty) {
// _pOptionList must always be the head of the list!
@@ -137,7 +137,7 @@ ErrorCode CBofOptions::commit() {
warning("TODO: Look into refactoring options to ConfMan if needed");
}
- return errCode;
+ return errorCode;
}
ErrorCode CBofOptions::writeSetting(const char *pszSection, const char *pszVar, const char *pszNewValue) {
@@ -149,7 +149,7 @@ ErrorCode CBofOptions::writeSetting(const char *pszSection, const char *pszVar,
char szValueBuf[MAX_OPTION_LEN];
// Assume no error
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
// Indicate that the options file needs to be updated
_bDirty = true;
@@ -192,7 +192,7 @@ ErrorCode CBofOptions::writeSetting(const char *pszSection, const char *pszVar,
pSection->Insert(pOption);
}
- return errCode;
+ return errorCode;
}
ErrorCode CBofOptions::writeSetting(const char *pszSection, const char *pszVar, int nNewValue) {
@@ -202,13 +202,10 @@ ErrorCode CBofOptions::writeSetting(const char *pszSection, const char *pszVar,
char szBuf[20];
- // Assume no error
- ErrorCode errCode = ERR_NONE;
-
Common::sprintf_s(szBuf, "%d", nNewValue);
- errCode = writeSetting(pszSection, pszVar, szBuf);
+ ErrorCode errorCode = writeSetting(pszSection, pszVar, szBuf);
- return errCode;
+ return errorCode;
}
ErrorCode CBofOptions::readSetting(const char *section, const char *option, char *stringValue, const char *defaultValue, uint32 maxLen) {
@@ -229,7 +226,7 @@ ErrorCode CBofOptions::readSetting(const char *section, const char *option, char
char szBuf[MAX_OPTION_LEN];
// Assume no error
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
// Assume we will need to use the default setting
Common::strcpy_s(stringValue, maxLen, defaultValue);
@@ -256,11 +253,11 @@ ErrorCode CBofOptions::readSetting(const char *section, const char *option, char
} else {
logError(buildString("Error in %s, section: %s, entry: %s", _szFileName, section, option));
- errCode = ERR_FTYPE;
+ errorCode = ERR_FTYPE;
}
}
- return errCode;
+ return errorCode;
}
ErrorCode CBofOptions::readSetting(const char *section, const char *option, int *intValue, int defaultValue) {
@@ -278,12 +275,12 @@ ErrorCode CBofOptions::readSetting(const char *section, const char *option, int
char szDefault[20], szBuf[20];
Common::sprintf_s(szDefault, "%d", defaultValue);
- ErrorCode errCode = readSetting(section, option, szBuf, szDefault, 20);
+ ErrorCode errorCode = readSetting(section, option, szBuf, szDefault, 20);
if (intValue != nullptr)
*intValue = atoi(szBuf);
- return errCode;
+ return errorCode;
}
ErrorCode CBofOptions::readSetting(const char *section, const char *option, bool *boolValue, bool defaultValue) {
@@ -299,9 +296,9 @@ ErrorCode CBofOptions::readSetting(const char *section, const char *option, bool
}
int v;
- ErrorCode errCode = readSetting(section, option, &v, defaultValue);
+ ErrorCode errorCode = readSetting(section, option, &v, defaultValue);
*boolValue = v != 0;
- return errCode;
+ return errorCode;
}
COption *CBofOptions::findSection(const char *pszSection) {
diff --git a/engines/bagel/boflib/sound.cpp b/engines/bagel/boflib/sound.cpp
index 8bc4c5e08c2..a636d00eed3 100644
--- a/engines/bagel/boflib/sound.cpp
+++ b/engines/bagel/boflib/sound.cpp
@@ -889,7 +889,7 @@ ErrorCode CBofSound::flushQueue(int nSlot) {
assert(nSlot >= 0 && nSlot < NUM_QUEUES);
// Assume no error
- ErrorCode errCode = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
// Remove all queued sounds
_cQueue[nSlot]->flush();
@@ -910,7 +910,7 @@ ErrorCode CBofSound::flushQueue(int nSlot) {
pSound = pNextSound;
}
- return errCode;
+ return errorCode;
}
void CBofSound::setQVol(int nSlot, int nVol) {
diff --git a/engines/bagel/spacebar/computer.cpp b/engines/bagel/spacebar/computer.cpp
index 03d7e3b1901..eee519d1744 100644
--- a/engines/bagel/spacebar/computer.cpp
+++ b/engines/bagel/spacebar/computer.cpp
@@ -131,16 +131,16 @@ void SBarComputer::onPaint(CBofRect *pRect) {
ErrorCode SBarComputer::attach() {
logInfo("Attaching SBarComputer...");
- ErrorCode rc = CBagStorageDevWnd::attach();
- if (rc == ERR_NONE) {
+ ErrorCode errorCode = CBagStorageDevWnd::attach();
+ if (errorCode == ERR_NONE) {
g_waitOKFl = false;
_pDrinkList = new CBofList<SBarCompItem>;
_pIngList = new CBofList<SBarCompItem>;
- rc = readDrnkFile();
- if (rc == ERR_NONE)
- rc = readIngFile();
+ errorCode = readDrnkFile();
+ if (errorCode == ERR_NONE)
+ errorCode = readIngFile();
// Create the list box that display the lists
createDrinksListBox();
@@ -182,7 +182,7 @@ ErrorCode SBarComputer::attach() {
CBagCursor::showSystemCursor();
- return rc;
+ return errorCode;
}
ErrorCode SBarComputer::detach() {
diff --git a/engines/bagel/spacebar/sraf_computer.cpp b/engines/bagel/spacebar/sraf_computer.cpp
index 466c7c68ed4..b305dcf8b0c 100644
--- a/engines/bagel/spacebar/sraf_computer.cpp
+++ b/engines/bagel/spacebar/sraf_computer.cpp
@@ -894,9 +894,9 @@ void SrafComputer::onPaint(CBofRect *pRect) {
}
ErrorCode SrafComputer::attach() {
- ErrorCode rc = CBagStorageDevWnd::attach();
+ ErrorCode errorCode = CBagStorageDevWnd::attach();
- if (rc == ERR_NONE) {
+ if (errorCode == ERR_NONE) {
// Build our main menu list
assert(_pMainList == nullptr);
@@ -997,47 +997,33 @@ ErrorCode SrafComputer::detach() {
// Delete our computer buttons
for (int i = 0; i < NUM_SRAFCOMPBUTT; i++) {
- if (_pButtons[i] != nullptr) {
- delete _pButtons[i];
- _pButtons[i] = nullptr;
- }
+ delete _pButtons[i];
+ _pButtons[i] = nullptr;
}
- if (_pLBox) {
- delete _pLBox;
- _pLBox = nullptr;
- }
+ delete _pLBox;
+ _pLBox = nullptr;
// (one extra staffer, durteen)
for (int i = 0; i < (NUM_STAFFERS + 1); i++) {
- if (_pStafferBmp[i] != nullptr) {
- delete _pStafferBmp[i];
- _pStafferBmp[i] = nullptr;
- }
+ delete _pStafferBmp[i];
+ _pStafferBmp[i] = nullptr;
}
// Get rid of our codewords...
- if (_pszGroup1Word) {
- delete _pszGroup1Word;
- _pszGroup1Word = nullptr;
- }
+ delete _pszGroup1Word;
+ _pszGroup1Word = nullptr;
- if (_pszGroup2Word) {
- delete _pszGroup2Word;
- _pszGroup2Word = nullptr;
- }
+ delete _pszGroup2Word;
+ _pszGroup2Word = nullptr;
- if (_pMainList != nullptr) {
- delete _pMainList;
- _pMainList = nullptr;
- }
+ delete _pMainList;
+ _pMainList = nullptr;
// The attach method will restore the state of the dispatched teams...,
// we can trash that info here.
- if (_pTeamList) {
- delete _pTeamList;
- _pTeamList = nullptr;
- }
+ delete _pTeamList;
+ _pTeamList = nullptr;
CBagStorageDevWnd::detach();
@@ -1157,16 +1143,16 @@ void SrafComputer::setQuit() {
}
ErrorCode SrafComputer::createListBox() {
- ErrorCode error = ERR_NONE;
+ ErrorCode errorCode = ERR_NONE;
if (_pLBox == nullptr) {
// We need to create one
_pLBox = new CBofListBox;
if (_pLBox != nullptr) {
- error = _pLBox->create("ListBox", &gCompDisplay, this);
- if (error != ERR_NONE) {
- return error;
+ errorCode = _pLBox->create("ListBox", &gCompDisplay, this);
+ if (errorCode != ERR_NONE) {
+ return errorCode;
}
}
}
@@ -1181,7 +1167,7 @@ ErrorCode SrafComputer::createListBox() {
_pLBox->setFont(FONT_MONO);
_pLBox->setFocus();
- return error;
+ return errorCode;
}
@@ -1301,8 +1287,8 @@ void SrafComputer::activateDealSummary() {
// load up the main list now with our deal summary data.
- ErrorCode error = createListBox();
- assert(error == ERR_NONE);
+ ErrorCode errorCode = createListBox();
+ assert(errorCode == ERR_NONE);
// Populate first line of list with header
@@ -1431,7 +1417,6 @@ void SrafComputer::activateDealSummary() {
}
void SrafComputer::activateBuyerBids() {
- ErrorCode error = ERR_NONE;
char szLocalBuff[256];
szLocalBuff[0] = '\0';
CBofString sStr(szLocalBuff, 256);
@@ -1449,8 +1434,8 @@ void SrafComputer::activateBuyerBids() {
deactivateMainScreen();
// Load up the main list now with our bid data.
- error = createListBox();
- assert(error == ERR_NONE);
+ ErrorCode errorCode = createListBox();
+ assert(errorCode == ERR_NONE);
// Make sure we start with the correct computer background
if (getBackdrop()) {
@@ -1551,8 +1536,8 @@ void SrafComputer::activateSellerBios() {
}
// Load up the main list now with our deal summary data.
- ErrorCode error = createListBox();
- assert(error == ERR_NONE);
+ ErrorCode errorCode = createListBox();
+ assert(errorCode == ERR_NONE);
// Populate first line of list with header
sStr = "SELLER BIOGRAPHIES";
@@ -1596,8 +1581,8 @@ void SrafComputer::activateOtherBios() {
}
// Load up the main list now with our deal summary data.
- ErrorCode error = createListBox();
- assert(error == ERR_NONE);
+ ErrorCode errorCode = createListBox();
+ assert(errorCode == ERR_NONE);
// Populate first line of list with header
sStr = "OTHER BIOGRAPHIES";
@@ -1640,8 +1625,8 @@ void SrafComputer::activateStaffBios() {
}
// Load up the main list now with our deal summary data.
- ErrorCode error = createListBox();
- assert(error == ERR_NONE);
+ ErrorCode errorCode = createListBox();
+ assert(errorCode == ERR_NONE);
// Populate first line of list with header
sStr = "STAFF BIOGRAPHIES";
@@ -1675,8 +1660,8 @@ void SrafComputer::activateDispatchTeam() {
deactivateMainScreen();
// Load up the main list now with our bid data.
- ErrorCode error = createListBox();
- assert(error == ERR_NONE);
+ ErrorCode errorCode = createListBox();
+ assert(errorCode == ERR_NONE);
// Make sure we start with the correct computer background
if (getBackdrop()) {
@@ -1876,7 +1861,6 @@ void SrafComputer::recalcDispatchList(int mExpansionFlag) {
void SrafComputer::activateCurrentEMail() {
- ErrorCode error = ERR_NONE;
char szLocalBuff[256];
szLocalBuff[0] = '\0';
CBofString sStr(szLocalBuff, 256);
@@ -1898,8 +1882,8 @@ void SrafComputer::activateCurrentEMail() {
// load up the main list now with our bid data.
- error = createListBox();
- assert(error == ERR_NONE);
+ ErrorCode errorCode = createListBox();
+ assert(errorCode == ERR_NONE);
// Make sure we start with the correct computer background
if (getBackdrop()) {
@@ -1935,7 +1919,6 @@ void SrafComputer::activateCurrentEMail() {
void SrafComputer::activateAudioSettings() {
- ErrorCode error = ERR_NONE;
char szLocalBuff[256];
szLocalBuff[0] = '\0';
CBofString sStr(szLocalBuff, 256);
@@ -1953,8 +1936,8 @@ void SrafComputer::activateAudioSettings() {
deactivateMainScreen();
// Load up the main list now with our bid data.
- error = createListBox();
- assert(error == ERR_NONE);
+ ErrorCode errorCode = createListBox();
+ assert(errorCode == ERR_NONE);
// Make sure we start with the correct computer background
if (getBackdrop()) {
@@ -2017,8 +2000,8 @@ void SrafComputer::activateRoboButler() {
deactivateMainScreen();
// Load up the main list now with our bid data.
- ErrorCode error = createListBox();
- assert(error == ERR_NONE);
+ ErrorCode errorCode = createListBox();
+ assert(errorCode == ERR_NONE);
// Make sure we start with the correct computer background
if (getBackdrop()) {
@@ -2109,8 +2092,8 @@ void SrafComputer::activateCheckTeams() {
deactivateMainScreen();
// Load up the main list now with our bid data.
- ErrorCode error = createListBox();
- assert(error == ERR_NONE);
+ ErrorCode errorCode = createListBox();
+ assert(errorCode == ERR_NONE);
// Make sure we start with the correct computer background
if (getBackdrop()) {
@@ -2378,8 +2361,8 @@ void SrafComputer::activateCodeWords() {
}
// Load up the main list now with our deal summary data.
- ErrorCode error = createListBox();
- assert(error == ERR_NONE);
+ ErrorCode errorCode = createListBox();
+ assert(errorCode == ERR_NONE);
// Populate first line of list with header
sStr = kCodeWordsHeader1;
@@ -3694,8 +3677,8 @@ void SrafComputer::activateMainScreen() {
_nListPointSize = kOtherPointSize;
_nListItemHeight = kLineItemHeight;
- ErrorCode error = createListBox();
- assert(error == ERR_NONE);
+ ErrorCode errorCode = createListBox();
+ assert(errorCode == ERR_NONE);
int numItems = _pMainList->getCount();
diff --git a/engines/bagel/spacebar/thud.cpp b/engines/bagel/spacebar/thud.cpp
index 6460870d412..da522a6658f 100644
--- a/engines/bagel/spacebar/thud.cpp
+++ b/engines/bagel/spacebar/thud.cpp
@@ -41,13 +41,13 @@ SBarThud::~SBarThud() {
}
ErrorCode SBarThud::loadFile(const CBofString &sFile) {
- ErrorCode error = CBagStorageDev::loadFile(sFile);
- return error;
+ ErrorCode errorCode = CBagStorageDev::loadFile(sFile);
+ return errorCode;
}
ErrorCode SBarThud::attach() {
int nActiveObj = 0;
- ErrorCode rc = CBagStorageDevBmp::attach();
+ ErrorCode errorCode = CBagStorageDevBmp::attach();
// save a copy of the you icon
_xYouBmp = new CBofBitmap(getBackgroundName());
@@ -75,7 +75,7 @@ ErrorCode SBarThud::attach() {
// The weild has been loaded with too many active objects
_nObjects = nActiveObj;
- return rc;
+ return errorCode;
}
ErrorCode SBarThud::detach() {
More information about the Scummvm-git-logs
mailing list