ddnet/src/engine/client
Robert Müller faa9f27808 Declare variables as const when possible
According to cppcheck's `constVariable` error:

```
src\engine\client\backend\opengl\opengl_sl.cpp:74:43: style: Variable 'Define' can be declared as reference to const [constVariable]
  for(CGLSLCompiler::SGLSLCompilerDefine &Define : pCompiler->m_vDefines)
                                          ^

src\engine\client\backend\vulkan\backend_vulkan.cpp:2149:12: style: Variable 'GraphicThreadCommandBuffer' can be declared as reference to const [constVariable]
     auto &GraphicThreadCommandBuffer = m_vvThreadDrawCommandBuffers[i + 1][m_CurImageIndex];
           ^
src\engine\client\backend\vulkan\backend_vulkan.cpp:3192:9: style: Variable 'BufferObject' can be declared as reference to const [constVariable]
  auto &BufferObject = m_vBufferObjects[BufferObjectIndex];
        ^
src\engine\client\backend\vulkan\backend_vulkan.cpp:3200:10: style: Variable 'DescrSet' can be declared as reference to const [constVariable]
   auto &DescrSet = m_vTextures[State.m_Texture].m_VKStandard3DTexturedDescrSet;
         ^
src\engine\client\backend\vulkan\backend_vulkan.cpp:3810:13: style: Variable 'Mode' can be declared as reference to const [constVariable]
  for(auto &Mode : vPresentModeList)
            ^
src\engine\client\backend\vulkan\backend_vulkan.cpp:3818:13: style: Variable 'Mode' can be declared as reference to const [constVariable]
  for(auto &Mode : vPresentModeList)
            ^
src\engine\client\backend\vulkan\backend_vulkan.cpp:6511:10: style: Variable 'DescrSet' can be declared as reference to const [constVariable]
   auto &DescrSet = m_vTextures[pCommand->m_State.m_Texture].m_aVKStandardTexturedDescrSets[AddressModeIndex];
         ^
src\engine\client\backend\vulkan\backend_vulkan.cpp:6555:10: style: Variable 'DescrSet' can be declared as reference to const [constVariable]
   auto &DescrSet = m_vTextures[pCommand->m_State.m_Texture].m_VKStandard3DTexturedDescrSet;
         ^
src\engine\client\backend\vulkan\backend_vulkan.cpp:6660:9: style: Variable 'MemBlock' can be declared as reference to const [constVariable]
  auto &MemBlock = m_vBufferObjects[BufferIndex].m_BufferObject.m_Mem;
        ^
src\engine\client\backend\vulkan\backend_vulkan.cpp:6799:9: style: Variable 'BufferObject' can be declared as reference to const [constVariable]
  auto &BufferObject = m_vBufferObjects[BufferObjectIndex];
        ^
src\engine\client\backend\vulkan\backend_vulkan.cpp:6808:10: style: Variable 'DescrSet' can be declared as reference to const [constVariable]
   auto &DescrSet = m_vTextures[pCommand->m_State.m_Texture].m_aVKStandardTexturedDescrSets[AddressModeIndex];
         ^
src\engine\client\backend\vulkan\backend_vulkan.cpp:6902:9: style: Variable 'BufferObject' can be declared as reference to const [constVariable]
  auto &BufferObject = m_vBufferObjects[BufferObjectIndex];
        ^
src\engine\client\backend\vulkan\backend_vulkan.cpp:6907:9: style: Variable 'TextTextureDescr' can be declared as reference to const [constVariable]
  auto &TextTextureDescr = m_vTextures[pCommand->m_TextTextureIndex].m_VKTextDescrSet;
        ^
src\engine\client\backend\vulkan\backend_vulkan.cpp:6961:9: style: Variable 'BufferObject' can be declared as reference to const [constVariable]
  auto &BufferObject = m_vBufferObjects[BufferObjectIndex];
        ^
src\engine\client\backend\vulkan\backend_vulkan.cpp:6970:10: style: Variable 'DescrSet' can be declared as reference to const [constVariable]
   auto &DescrSet = m_vTextures[State.m_Texture].m_aVKStandardTexturedDescrSets[AddressModeIndex];
         ^

src\game\client\components\hud.cpp:178:8: style: Variable 'aFlagCarrier' can be declared as const array [constVariable]
   int aFlagCarrier[2] = {
       ^
src\game\client\components\hud.cpp:519:16: style: Variable 's_aTextWidth' can be declared as const array [constVariable]
  static float s_aTextWidth[5] = {s_TextWidth0, s_TextWidth00, s_TextWidth000, s_TextWidth0000, s_TextWidth00000};
               ^

src\game\client\components\killmessages.cpp:305:30: style: Variable 'Client' can be declared as reference to const [constVariable]
   CGameClient::CClientData &Client = GameClient()->m_aClients[m_aKillmsgs[r].m_KillerID];
                             ^
src\game\client\components\killmessages.cpp:314:30: style: Variable 'Client' can be declared as reference to const [constVariable]
   CGameClient::CClientData &Client = GameClient()->m_aClients[m_aKillmsgs[r].m_VictimID];
                             ^

src\game\client\components\menus_ingame.cpp:243:12: style: Variable 'pInfoByName' can be declared as reference to const [constVariable]
 for(auto &pInfoByName : m_pClient->m_Snap.m_apInfoByName)
           ^
src\game\client\components\menus_ingame.cpp:530:12: style: Variable 'pInfoByName' can be declared as reference to const [constVariable]
 for(auto &pInfoByName : m_pClient->m_Snap.m_apInfoByName)
           ^

src\game\client\components\players.cpp:767:44: style: Variable 'CharacterInfo' can be declared as reference to const [constVariable]
  CGameClient::CSnapState::CCharacterInfo &CharacterInfo = m_pClient->m_Snap.m_aCharacters[i];
                                           ^

src\game\client\components\spectator.cpp:122:27: style: Variable 'Snap' can be declared as reference to const [constVariable]
 CGameClient::CSnapState &Snap = pSelf->m_pClient->m_Snap;
                          ^
src\game\client\components\spectator.cpp:221:12: style: Variable 'pInfo' can be declared as reference to const [constVariable]
 for(auto &pInfo : m_pClient->m_Snap.m_apInfoByDDTeamName)
           ^

src\game\client\gameclient.cpp:2220:15: style: Variable 'OwnClientData' can be declared as reference to const [constVariable]
 CClientData &OwnClientData = m_aClients[ownID];
              ^
src\game\client\gameclient.cpp:2227:16: style: Variable 'cData' can be declared as reference to const [constVariable]
  CClientData &cData = m_aClients[i];
               ^

src\game\client\prediction\entities\character.cpp:397:11: style: Variable 'aSpreading' can be declared as const array [constVariable]
    float aSpreading[] = {-0.185f, -0.070f, 0, 0.070f, 0.185f};
          ^

src\game\client\prediction\entities\laser.cpp:53:9: style: Variable 'HitPos' can be declared as reference to const [constVariable]
  vec2 &HitPos = pHit->Core()->m_Pos;
        ^

src\game\editor\auto_map.cpp:507:18: style: Variable 'Index' can be declared as reference to const [constVariable]
       for(auto &Index : pRule->m_vIndexList)
                 ^
src\game\editor\auto_map.cpp:518:18: style: Variable 'Index' can be declared as reference to const [constVariable]
       for(auto &Index : pRule->m_vIndexList)
                 ^

src\game\editor\editor.cpp:118:12: style: Variable 'Item' can be declared as reference to const [constVariable]
 for(auto &Item : vList)
           ^
src\game\editor\editor.cpp:2983:11: style: Variable 'aAspects' can be declared as const array [constVariable]
    float aAspects[] = {4.0f / 3.0f, 16.0f / 10.0f, 5.0f / 4.0f, 16.0f / 9.0f};
          ^
src\game\editor\editor.cpp:3141:15: style: Variable 's_aShift' can be declared as const array [constVariable]
   static int s_aShift[] = {24, 16, 8, 0};
              ^

src\engine\server\server.cpp:2807:14: style: Variable 'Client' can be declared as reference to const [constVariable]
   for(auto &Client : m_aClients)
             ^

src\engine\server\sql_string_helpers.cpp:51:6: style: Variable 'aTimes' can be declared as const array [constVariable]
 int aTimes[7] =
     ^

src\test\secure_random.cpp:24:6: style: Variable 'BOUNDS' can be declared as const array [constVariable]
 int BOUNDS[] = {2, 3, 4, 5, 10, 100, 127, 128, 129};
     ^
```
2022-11-29 23:32:32 +01:00
..
backend Declare variables as const when possible 2022-11-29 23:32:32 +01:00
backend_sdl.cpp Fix misspellings 2022-10-25 13:51:56 -03:00
backend_sdl.h Fix misspellings 2022-10-25 13:51:56 -03:00
blocklist_driver.cpp Huge variable naming format 2022-07-08 18:01:29 +02:00
blocklist_driver.h Add Intel as vendor to the block list on windows 2021-05-06 12:23:40 +02:00
checksum.h Add some checksum functions to the client 2022-01-31 21:31:26 +01:00
client.cpp Remove redundant bitwise operand 2022-11-29 23:32:28 +01:00
client.h Remove // in ddnet:// url handler 2022-11-29 18:15:09 +01:00
demoedit.cpp Port some code to str_copy() template 2022-07-09 19:40:58 +03:00
demoedit.h Mark virtual function as override using a script: 2022-05-17 23:47:32 +02:00
discord.cpp Only announce servers using Steam/Discord integration which are registered 2022-10-09 16:16:54 +02:00
favorites.cpp Fix windows build 2022-09-27 13:45:58 +02:00
friends.cpp Port some code to str_copy() template 2022-07-09 19:40:58 +03:00
friends.h Organize engine-client includes 2022-06-17 17:46:43 +02:00
ghost.cpp Port some code to str_copy() template 2022-07-09 19:40:58 +03:00
ghost.h Port some code to str_copy() template 2022-07-09 19:40:58 +03:00
graphics_defines.h Remove GL includes from headers 2021-05-01 23:56:30 +02:00
graphics_threaded.cpp Use str_copy instead of str_format with format "%s" 2022-10-27 21:42:14 +02:00
graphics_threaded.h Fix misspellings 2022-10-25 13:51:56 -03:00
input.cpp Use traditional casts instead of functional-style casts 2022-11-06 11:52:21 +01:00
input.h Add IInput::ShiftIsPressed and IInput::AltIsPressed 2022-11-15 21:17:55 +01:00
keynames.h Remove all references to memset 2022-09-02 14:32:39 +02:00
notifications.cpp Emscripten support 2022-03-25 12:42:18 +01:00
notifications.h Libnotify support for linux client (#2099) 2020-04-14 17:53:53 +02:00
serverbrowser.cpp Remove support for legacy 64 player info protocol 2022-10-12 16:12:02 +02:00
serverbrowser.h Remove support for legacy 64 player info protocol 2022-10-12 16:12:02 +02:00
serverbrowser_http.cpp Use new ddnet.org domain 2022-08-30 10:09:06 +02:00
serverbrowser_http.h Allow multiple addresses per server in the serverbrowser 2022-07-10 16:52:07 +02:00
serverbrowser_ping_cache.cpp Allow multiple addresses per server in the serverbrowser 2022-07-10 16:52:07 +02:00
serverbrowser_ping_cache.h Allow multiple addresses per server in the serverbrowser 2022-07-10 16:52:07 +02:00
sound.cpp Let CKernel clean-up. Use unused CSound::Shutdown 2022-09-16 16:50:19 +02:00
sound.h Let CKernel clean-up. Use unused CSound::Shutdown 2022-09-16 16:50:19 +02:00
sqlite.cpp Make use of IO_MAX_PATH_LENGTH 2021-09-13 12:14:50 +02:00
steam.cpp Only announce servers using Steam/Discord integration which are registered 2022-10-09 16:16:54 +02:00
text.cpp Remove unused member SFontSizeChar::m_TouchTime 2022-11-29 23:28:37 +01:00
updater.cpp Use new ddnet.org domain 2022-08-30 10:09:06 +02:00
updater.h Use nullptr in generated and editor 2022-06-13 18:28:13 +02:00
video.cpp Fix deprecation warning in ffmpeg 5.1 (fixes #5681) 2022-07-31 00:58:15 +02:00
video.h Huge variable naming format 2022-07-08 18:01:29 +02:00