Jump to content

Compiling warnings


Go to solution Solved by Kori,

Recommended Posts

Hey everyone.

I don't know what has caused this but i'm getting a bunch of the same warnings and i have no clue on how to fix them.

 

cmd_general.cpp: In function 'void do_inventory(LPCHARACTER, const char*, int, int)':
cmd_general.cpp:2283:13: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
   if (index >= INVENTORY_MAX_NUM)
       ~~~~~~^~~~~~~~~~~~~~~~~~~~
compiling cmd_gm.cpp
cmd_gm.cpp: In function 'void do_item_purge(LPCHARACTER, const char*, int, int)':
cmd_gm.cpp:970:17: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
   for (i = 0; i < INVENTORY_MAX_NUM; ++i)
               ~~^~~~~~~~~~~~~~~~~~~
cmd_gm.cpp:981:17: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
   for (i = 0; i < WEAR_MAX_NUM; ++i)
               ~~^~~~~~~~~~~~~~
cmd_gm.cpp:1002:17: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
   for (i = 0; i < BELT_INVENTORY_SLOT_COUNT; ++i)
               ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
cmd_gm.cpp: In function 'void do_all_skill_master(LPCHARACTER, const char*, int, int)':
cmd_gm.cpp:4433:20: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
  for (int i = 0; i < SKILL_MAX_NUM; i++)
                  ~~^~~~~~~~~~~~~~~
compiling cmd_oxevent.cpp
compiling config.cpp
config.cpp: In function 'bool __LoadConnectConfigFile(const char*)':
config.cpp:614:28: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
   while (*p != '\0' && cnt < (SKILL_MAX_LEVEL + 1))
                        ~~~~^~~~~~~~~~~~~~~~~~~~~~~
config.cpp:652:29: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
    while (*p != '\0' && cnt < (SKILL_MAX_LEVEL + 1))
                         ~~~~^~~~~~~~~~~~~~~~~~~~~~~
compiling constants.cpp
compiling crc32.cpp
compiling cube.cpp
cube.cpp: In function 'void Cube_add_item(LPCHARACTER, int, int)':
cube.cpp:616:40: warning: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Wsign-compare]
  if (inven_index<0 || INVENTORY_MAX_NUM<=inven_index)
                       ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
compiling db.cpp
compiling desc.cpp
desc.cpp: In member function 'void DESC::SendLoginSuccessPacket()':
desc.cpp:938:20: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
  for (int i = 0; i < PLAYER_PER_ACCOUNT; ++i)
                  ~~^~~~~~~~~~~~~~~~~~~~
compiling desc_client.cpp
'int' and 'unsigned int'compiling desc_manager.cpp
compiling desc_p2p.cpp
compiling dev_log.cpp
compiling dungeon.cpp
compiling empire_text_convert.cpp
compiling entity.cpp
compiling entity_view.cpp
compiling event.cpp
compiling event_queue.cpp
compiling exchange.cpp
exchange.cpp: In member function 'bool CExchange::CheckSpace()':
exchange.cpp:317:16: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
  for (i = 0; i < INVENTORY_PAGE_SIZE*1; ++i)
              ~~^~~~~~~~~~~~~~~~~~~~~~~
exchange.cpp:324:36: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
  for (i = INVENTORY_PAGE_SIZE*1; i < INVENTORY_PAGE_SIZE*2; ++i)
                                  ~~^~~~~~~~~~~~~~~~~~~~~~~
exchange.cpp:332:36: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
  for (i = INVENTORY_PAGE_SIZE*2; i < INVENTORY_PAGE_SIZE*3; ++i)
                                  ~~^~~~~~~~~~~~~~~~~~~~~~~
exchange.cpp:339:36: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
  for (i = INVENTORY_PAGE_SIZE*3; i < INVENTORY_PAGE_SIZE*4; ++i)
                                  ~~^~~~~~~~~~~~~~~~~~~~~~~
exchange.cpp:377:22: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
    for (int i = 0; i < DRAGON_SOUL_BOX_SIZE; i++)
                    ~~^~~~~~~~~~~~~~~~~~~~~~
compiling file_loader.cpp
compiling fishing.cpp
compiling gm.cpp
compiling guild.cpp
compiling guild_manager.cpp
compiling guild_war.cpp
compiling horse_rider.cpp
compiling horsename_manager.cpp
compiling input.cpp
compiling input_auth.cpp
compiling input_db.cpp
input_db.cpp: In function 'bool GetServerLocation(TAccountTable&, BYTE)':
input_db.cpp:65:20: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
  for (int i = 0; i < PLAYER_PER_ACCOUNT; ++i)
                  ~~^~~~~~~~~~~~~~~~~~~~
input_db.cpp: In member function 'void CInputDB::PlayerLoad(LPDESC, const char*)':
input_db.cpp:485:20: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
  for (int i = 0; i < QUICKSLOT_MAX_NUM; ++i)
                  ~~^~~~~~~~~~~~~~~~~~~
input_db.cpp: In member function 'void CInputDB::EmpireSelect(LPDESC, const char*)':
input_db.cpp:1327:20: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
  for (int i = 0; i < PLAYER_PER_ACCOUNT; ++i)
                  ~~^~~~~~~~~~~~~~~~~~~~
compiling input_login.cpp
input_login.cpp: In member function 'void CInputLogin::Empire(LPDESC, const char*)':
input_login.cpp:843:21: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
   for (int i = 0; i < PLAYER_PER_ACCOUNT; ++i)
                   ~~^~~~~~~~~~~~~~~~~~~~
compiling input_main.cpp
input_main.cpp: In member function 'void CInputMain::Exchange(LPCHARACTER, const char*)':
input_main.cpp:1219:24: warning: comparison of integer expressions of different signedness: 'INT' {aka 'int'} and 'unsigned int' [-Wsign-compare]
      if (ch->GetGold() >= GOLD_MAX)
          ~~~~~~~~~~~~~~^~~~~~~~~~~
input_main.cpp: In member function 'int CInputMain::MyShop(LPCHARACTER, const char*, size_t)':
input_main.cpp:2969:20: warning: comparison of integer expressions of different signedness: 'INT' {aka 'int'} and 'unsigned int' [-Wsign-compare]
  if (ch->GetGold() >= GOLD_MAX)
      ~~~~~~~~~~~~~~^~~~~~~~~~~
compiling input_p2p.cpp
compiling input_teen.cpp
compiling input_udp.cpp
compiling ip_ban.cpp
compiling item.cpp
item.cpp: In member function 'int CItem::FindEquipCell(LPCHARACTER, int)':
item.cpp:533:55: warning: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Wsign-compare]
     if (WEAR_MAX_NUM + i * DS_SLOT_MAX + GetSubType() == iCandidateCell)
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
item.cpp: In member function 'void CItem::ModifyPoints(bool)':
item.cpp:702:43: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
     if ((pkItemAbsorbed->alValues[1] > 0) && (lDefGrade <= 0) || (pkItemAbsorbed->alValues[5] > 0) && (lDefGrade < 1))
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
compiling item_addon.cpp
compiling item_attribute.cpp
compiling item_manager.cpp
compiling item_manager_idrange.cpp
compiling locale.cpp
compiling locale_service.cpp
compiling log.cpp
compiling login_data.cpp
compiling lzo_manager.cpp
compiling marriage.cpp
compiling matrix_card.cpp
compiling messenger_manager.cpp
compiling mining.cpp
compiling mob_manager.cpp
mob_manager.cpp: In member function 'void CMob::AddSkillSplash(int, DWORD, DWORD)':
mob_manager.cpp:30:13: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
  if (iIndex >= MOB_SKILL_MAX_NUM || iIndex < 0)
      ~~~~~~~^~~~~~~~~~~~~~~~~~~~
mob_manager.cpp: In member function 'bool CMobManager::Initialize(TMobTable*, int)':
mob_manager.cpp:75:21: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
   for (int j = 0; j < MOB_SKILL_MAX_NUM; ++j)
                   ~~^~~~~~~~~~~~~~~~~~~


The game/db compile just fine i'm just having these annoying warnings.

Thank you all in advance.

Link to comment
Share on other sites

  • Solution
mob_manager.cpp: In member function 'bool CMobManager::Initialize(TMobTable*, int)':
mob_manager.cpp:75:21: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
   for (int j = 0; j < MOB_SKILL_MAX_NUM; ++j)

 

You can set the int to size_t

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.