diff --git a/client/CPreGame.cpp b/client/CPreGame.cpp index 5c4d870b9..d1bd2d0ff 100644 --- a/client/CPreGame.cpp +++ b/client/CPreGame.cpp @@ -3740,7 +3740,7 @@ void CBonusSelection::startMap() if(LOCPLINT) // we're currently ingame, so ask for starting new map and end game { GH.popInt(this); - LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[67], [=] + LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[67], [=]() { updateCampaignState(); endGame(); @@ -3758,7 +3758,7 @@ void CBonusSelection::startMap() void CBonusSelection::restartMap() { GH.popInt(this); - LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[67], [=] + LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[67], [=]() { updateCampaignState(); auto si = new StartInfo(startInfo); diff --git a/client/battle/CBattleInterface.cpp b/client/battle/CBattleInterface.cpp index 1589932c8..399778b35 100644 --- a/client/battle/CBattleInterface.cpp +++ b/client/battle/CBattleInterface.cpp @@ -2233,7 +2233,7 @@ void CBattleInterface::handleHex(BattleHex myNumber, int eventType) consoleMsg = (boost::format(CGI->generaltexth->allTexts[294]) % activeStack->getName()).str(); //Move %s here } - realizeAction = [=] + realizeAction = [=]() { if(activeStack->doubleWide()) { @@ -2256,7 +2256,7 @@ void CBattleInterface::handleHex(BattleHex myNumber, int eventType) { setBattleCursor(myNumber); //handle direction of cursor and attackable tile setCursor = false; //don't overwrite settings from the call above //TODO: what does it mean? - realizeAction = [=] + realizeAction = [=]() { BattleHex attackFromHex = fromWhichHexAttack(myNumber); if (attackFromHex >= 0) //we can be in this line when unreachable creature is L - clicked (as of revision 1308) @@ -2333,7 +2333,7 @@ void CBattleInterface::handleHex(BattleHex myNumber, int eventType) break; case RISE_DEMONS: cursorType = ECursor::SPELLBOOK; - realizeAction = [=] + realizeAction = [=]() { giveCommand(Battle::DAEMON_SUMMONING, myNumber, activeStack->ID); }; @@ -2395,7 +2395,7 @@ void CBattleInterface::handleHex(BattleHex myNumber, int eventType) break; } - realizeAction = [=] + realizeAction = [=]() { if (secondaryTarget) //select that target now { @@ -2794,7 +2794,7 @@ void CBattleInterface::requestAutofightingAIToTakeAction() { assert(curInt->isAutoFightOn); - boost::thread aiThread([&] + boost::thread aiThread([&]() { auto ba = make_unique(curInt->autofightingAI->activeStack(activeStack)); diff --git a/client/windows/CAdvmapInterface.cpp b/client/windows/CAdvmapInterface.cpp index a44795a0e..1a9dd5faf 100644 --- a/client/windows/CAdvmapInterface.cpp +++ b/client/windows/CAdvmapInterface.cpp @@ -1226,8 +1226,8 @@ void CAdvMapInt::keyPressed(const SDL_KeyboardEvent & key) if(isActive() && LOCPLINT->ctrlPressed()) { LOCPLINT->showYesNoDialog("Are you sure you want to restart game?", - []{ LOCPLINT->sendCustomEvent(RESTART_GAME); }, - []{}, true); + [](){ LOCPLINT->sendCustomEvent(RESTART_GAME); }, + [](){}, true); } return; case SDLK_SPACE: //space - try to revisit current object with selected hero diff --git a/client/windows/CCastleInterface.cpp b/client/windows/CCastleInterface.cpp index 1d33e1c1b..09321faaa 100644 --- a/client/windows/CCastleInterface.cpp +++ b/client/windows/CCastleInterface.cpp @@ -828,9 +828,9 @@ void CCastleBuildings::enterMagesGuild() } else { - CFunctionList onYes = [this]{ openMagesGuild(); }; + CFunctionList onYes = [this](){ openMagesGuild(); }; CFunctionList onNo = onYes; - onYes += [hero]{ LOCPLINT->cb->buyArtifact(hero, ArtifactID::SPELLBOOK); }; + onYes += [hero](){ LOCPLINT->cb->buyArtifact(hero, ArtifactID::SPELLBOOK); }; std::vector components(1, new CComponent(CComponent::artifact,ArtifactID::SPELLBOOK,0)); LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[214], onYes, onNo, true, components); @@ -1760,7 +1760,7 @@ CBlacksmithDialog::CBlacksmithDialog(bool possible, CreatureID creMachineID, Art cancel = new CButton(Point(224, 312), "ICANCEL.DEF", CButton::tooltip(text), [&](){ close(); }, SDLK_ESCAPE); if(possible) - buy->addCallback([=]{ LOCPLINT->cb->buyArtifact(LOCPLINT->cb->getHero(hid),aid); }); + buy->addCallback([=](){ LOCPLINT->cb->buyArtifact(LOCPLINT->cb->getHero(hid),aid); }); else buy->block(true); diff --git a/client/windows/CCreatureWindow.cpp b/client/windows/CCreatureWindow.cpp index a66c47419..82392d35d 100644 --- a/client/windows/CCreatureWindow.cpp +++ b/client/windows/CCreatureWindow.cpp @@ -469,7 +469,7 @@ void CStackWindow::CWindowSection::createCommander() if(parent->selectedSkill == index) parent->setSelection(index, icon); - icon->callback = [=] + icon->callback = [=]() { parent->setSelection(index, icon); }; @@ -496,7 +496,7 @@ CIntObject * CStackWindow::createSkillEntry(int index) const auto bonus = CGI->creh->skillRequirements[skillID-100].first; const CStackInstance *stack = info->commander; CCommanderSkillIcon * icon = new CCommanderSkillIcon(new CPicture(stack->bonusToGraphics(bonus)), [](){}); - icon->callback = [=] + icon->callback = [=]() { setSelection(skillID, icon); }; diff --git a/client/windows/CSpellWindow.cpp b/client/windows/CSpellWindow.cpp index 3076e9ec3..16d12037a 100644 --- a/client/windows/CSpellWindow.cpp +++ b/client/windows/CSpellWindow.cpp @@ -633,7 +633,7 @@ void CSpellWindow::SpellArea::clickLeft(tribool down, bool previousState) const CGHeroInstance *h = owner->myHero; GH.popInt(owner); - auto guard = vstd::makeScopeGuard([this] + auto guard = vstd::makeScopeGuard([this]() { owner->myInt->spellbookSettings.spellbookLastTabAdvmap = owner->selectedTab; owner->myInt->spellbookSettings.spellbokLastPageAdvmap = owner->currentPage; diff --git a/client/windows/GUIClasses.cpp b/client/windows/GUIClasses.cpp index 6718e83f9..2cec68ca8 100644 --- a/client/windows/GUIClasses.cpp +++ b/client/windows/GUIClasses.cpp @@ -645,7 +645,7 @@ void CSystemOptionsWindow::setGameRes(int index) void CSystemOptionsWindow::bquitf() { - LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[578], [this]{ closeAndPushEvent(SDL_USEREVENT, FORCE_QUIT); }, 0); + LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[578], [this](){ closeAndPushEvent(SDL_USEREVENT, FORCE_QUIT); }, 0); } void CSystemOptionsWindow::breturnf() @@ -655,7 +655,7 @@ void CSystemOptionsWindow::breturnf() void CSystemOptionsWindow::bmainmenuf() { - LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[578], [this]{ closeAndPushEvent(SDL_USEREVENT, RETURN_TO_MAIN_MENU); }, 0); + LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[578], [this](){ closeAndPushEvent(SDL_USEREVENT, RETURN_TO_MAIN_MENU); }, 0); } void CSystemOptionsWindow::bloadf() @@ -672,7 +672,7 @@ void CSystemOptionsWindow::bsavef() void CSystemOptionsWindow::brestartf() { - LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[67], [this]{ closeAndPushEvent(SDL_USEREVENT, RESTART_GAME); }, 0); + LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[67], [this](){ closeAndPushEvent(SDL_USEREVENT, RESTART_GAME); }, 0); } void CSystemOptionsWindow::closeAndPushEvent(int eventType, int code) @@ -985,7 +985,7 @@ CExchangeWindow::CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2, //buttons quit = new CButton(Point(732, 567), "IOKAY.DEF", CGI->generaltexth->zelp[600], std::bind(&CExchangeWindow::close, this), SDLK_RETURN); if(queryID.getNum() > 0) - quit->addCallback([=]{ LOCPLINT->cb->selectionMade(0, queryID); }); + quit->addCallback([=](){ LOCPLINT->cb->selectionMade(0, queryID); }); questlogButton[0] = new CButton(Point( 10, 44), "hsbtns4.def", CButton::tooltip(CGI->generaltexth->heroscrn[0]), std::bind(&CExchangeWindow::questlog,this, 0)); questlogButton[1] = new CButton(Point(740, 44), "hsbtns4.def", CButton::tooltip(CGI->generaltexth->heroscrn[0]), std::bind(&CExchangeWindow::questlog,this, 1)); @@ -1348,7 +1348,7 @@ CUnivConfirmWindow::CUnivConfirmWindow(CUniversityWindow * PARENT, int SKILL, bo boost::replace_first(text, "%s", CGI->generaltexth->skillName[SKILL]); boost::replace_first(text, "%d", "2000"); - confirm= new CButton(Point(148, 299), "IBY6432.DEF", CButton::tooltip(hoverText, text), [=]{makeDeal(SKILL);}, SDLK_RETURN); + confirm= new CButton(Point(148, 299), "IBY6432.DEF", CButton::tooltip(hoverText, text), [=](){makeDeal(SKILL);}, SDLK_RETURN); confirm->block(!available); cancel = new CButton(Point(252,299), "ICANCEL.DEF", CGI->generaltexth->zelp[631], [&](){ close(); }, SDLK_ESCAPE); @@ -1380,7 +1380,7 @@ CHillFortWindow::CHillFortWindow(const CGHeroInstance *visitor, const CGObjectIn for (int i = 0; i < slotsCount; i++) { - upgrade[i] = new CButton(Point(107 + i * 76, 171), "", CButton::tooltip(getTextForSlot(SlotID(i))), [=]{ makeDeal(SlotID(i)); }, SDLK_1 + i); + upgrade[i] = new CButton(Point(107 + i * 76, 171), "", CButton::tooltip(getTextForSlot(SlotID(i))), [=](){ makeDeal(SlotID(i)); }, SDLK_1 + i); for (auto image : { "APHLF1R.DEF", "APHLF1Y.DEF", "APHLF1G.DEF" }) upgrade[i]->addImage(image); diff --git a/lib/JsonDetail.cpp b/lib/JsonDetail.cpp index 0e37fe604..f5b4fbbd0 100644 --- a/lib/JsonDetail.cpp +++ b/lib/JsonDetail.cpp @@ -771,7 +771,7 @@ namespace { validator.currentPath.push_back(JsonNode()); validator.currentPath.back().Float() = index; - auto onExit = vstd::makeScopeGuard([&] + auto onExit = vstd::makeScopeGuard([&]() { validator.currentPath.pop_back(); }); @@ -920,7 +920,7 @@ namespace { validator.currentPath.push_back(JsonNode()); validator.currentPath.back().String() = nodeName; - auto onExit = vstd::makeScopeGuard([&] + auto onExit = vstd::makeScopeGuard([&]() { validator.currentPath.pop_back(); }); diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index d578565c5..31c7412b2 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -3806,7 +3806,7 @@ bool CGameHandler::makeBattleAction(BattleAction &ba) StartAction startAction(ba); sendAndApply(&startAction); - return vstd::makeScopeGuard([&] + return vstd::makeScopeGuard([&]() { sendAndApply(&end_action); });