Browse Source

Clang-tidy: readability-else-after-return

pull/2243/head
Anders Jenbo 5 years ago
parent
commit
8f3266244a
  1. 3
      Source/DiabloUI/diabloui.cpp
  2. 12
      Source/controls/plrctrls.cpp
  3. 4
      Source/controls/touch.cpp
  4. 3
      Source/dvlnet/protocol_zt.cpp
  5. 6
      Source/loadsave.cpp
  6. 2
      Source/missiles.cpp
  7. 3
      Source/player.cpp

3
Source/DiabloUI/diabloui.cpp

@ -892,7 +892,8 @@ bool HandleMouseEventScrollBar(const SDL_Event &event, const UiScrollBar *uiSb)
if (IsInsideRect(event, UpArrowRect(uiSb))) {
scrollBarState.upArrowPressed = true;
return true;
} else if (IsInsideRect(event, DownArrowRect(uiSb))) {
}
if (IsInsideRect(event, DownArrowRect(uiSb))) {
scrollBarState.downArrowPressed = true;
return true;
}

12
Source/controls/plrctrls.cpp

@ -1124,13 +1124,17 @@ HandleLeftStickOrDPadFn GetLeftStickOrDPadGameUIHandler()
}
if (chrflag && plr[myplr]._pStatPts > 0) {
return &AttrIncBtnSnap;
} else if (spselflag) {
}
if (spselflag) {
return &HotSpellMove;
} else if (sbookflag) {
}
if (sbookflag) {
return &SpellBookMove;
} else if (questlog) {
}
if (questlog) {
return &QuestLogMove;
} else if (stextflag != STORE_NONE) {
}
if (stextflag != STORE_NONE) {
return &StoreMove;
}
return nullptr;

4
Source/controls/touch.cpp

@ -18,8 +18,8 @@ inline T clip(T v, T amin, T amax)
return amin;
if (v > amax)
return amax;
else
return v;
return v;
}
#define TOUCH_PORT_MAX_NUM 1

3
Source/dvlnet/protocol_zt.cpp

@ -135,7 +135,8 @@ bool protocol_zt::send_queued_peer(const endpoint &peer)
auto it = peer_list[peer].send_queue.front().begin();
peer_list[peer].send_queue.front().erase(it, it + r);
return true;
} else if (decltype(len)(r) == len) {
}
if (decltype(len)(r) == len) {
peer_list[peer].send_queue.pop_front();
} else {
throw protocol_exception();

6
Source/loadsave.cpp

@ -916,9 +916,11 @@ bool IsHeaderValid(uint32_t magicNumber)
if (magicNumber == LoadLE32("SHLF")) {
gbIsHellfireSaveGame = true;
return true;
} else if (!gbIsSpawn && magicNumber == LoadLE32("RETL")) {
}
if (!gbIsSpawn && magicNumber == LoadLE32("RETL")) {
return true;
} else if (!gbIsSpawn && magicNumber == LoadLE32("HELF")) {
}
if (!gbIsSpawn && magicNumber == LoadLE32("HELF")) {
gbIsHellfireSaveGame = true;
return true;
}

2
Source/missiles.cpp

@ -458,7 +458,7 @@ bool MonsterTrapHit(int m, int mindam, int maxdam, int dist, int t, bool shift)
#ifdef _DEBUG
if (hit < hper || debug_mode_dollar_sign || debug_mode_key_inverted_v || monster[m]._mmode == MM_STONE) {
#else
else if (hit < hper || monster[m]._mmode == MM_STONE) {
if (hit < hper || monster[m]._mmode == MM_STONE) {
#endif
dam = mindam + GenerateRnd(maxdam - mindam + 1);
if (!shift)

3
Source/player.cpp

@ -3322,7 +3322,8 @@ bool PlrDeathModeOK(int p)
}
if (player._pmode == PM_QUIT) {
return true;
} else if (player._pmode == PM_NEWLVL) {
}
if (player._pmode == PM_NEWLVL) {
return true;
}

Loading…
Cancel
Save