*Problemă/Întrebare: Trei warning sursă
Tipologie server:
*Resursă folosită: arhiva-descarcari/reupload-serverfiles- ... 64762.html
*ServerFiles utilizat:
*Syserr:
Poză:
*Detalii suplimentare:
Am rezolvat majoritatea warning-urilor, dar mai am trei (dintre care două sunt "la fel") de care nu pot scăpa. Şi anume:
char_item.cpp: In member function 'void CHARACTER::BuffOnAttr_ValueChange(BYTE, BYTE, BYTE)':
char_item.cpp:6553: warning: 'pBuff' may be used uninitialized in this function
char_item.cpp: https://pastebin.com/nDF6YyaN
shop.cpp: In member function 'virtual int CShop::Buy(CHARACTER*, BYTE)':
shop.cpp:339: warning: format '%u' expects type 'unsigned int', but argument 7 has type 'long long int'
shop.cpp:339: warning: format '%u' expects type 'unsigned int', but argument 7 has type 'long long int'
shop.cpp:352: warning: format '%u' expects type 'unsigned int', but argument 7 has type 'long long int'
shop.cpp:352: warning: format '%u' expects type 'unsigned int', but argument 7 has type 'long long int'
shop.cpp:355: warning: format '%u' expects type 'unsigned int', but argument 7 has type 'long long int'
shop.cpp:355: warning: format '%u' expects type 'unsigned int', but argument 7 has type 'long long int'
shop.cpp: https://pastebin.com/x3Y39FPx
item_manager_read_tables.cpp: In member function 'bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char*)':
item_manager_read_tables.cpp:627: warning: 'pkGroup' may be used uninitialized in this function
item_manager_read_tables.cpp: https://pastebin.com/mZvF4PWK
Poate cineva este dispus să-mi explice cum le pot rezolva.
Mulţumesc frumos!
Trei warning-uri sursă
- Moț
-

- Mesaje: 2825
- Membru din: 03 Apr 2017, 15:00
- Aprecieri: 216
- Mulţumiri: 3040
- Discord: Copiază ID
char_item.cpp
cu
shop.cpp
cu
item_manager_read_tables.cpp
cu
Cod: Selectaţi tot
CBuffOnAttributes* pBuff;Cod: Selectaţi tot
CBuffOnAttributes* pBuff = NULL;Cod: Selectaţi tot
snprintf(buf, sizeof(buf), "%s FROM: %u TO: %u PRICE: %u", item->GetName(), ch->GetPlayerID(), m_pkPC->GetPlayerID(), llPrice);Cod: Selectaţi tot
snprintf(buf, sizeof(buf), "%s FROM: %u TO: %u PRICE: %lld", item->GetName(), ch->GetPlayerID(), m_pkPC->GetPlayerID(), llPrice);Cod: Selectaţi tot
CDropItemGroup* pkGroup;Cod: Selectaţi tot
CDropItemGroup* pkGroup = NULL;Am încercat să folosesc %lld, dar tot nu-mi dau seama cum trebuie să fac cu celelalte două.
Mulţumesc anticipat!!
Mă refer la:
shop.cpp:352: warning: format '%d' expects type 'int', but argument 7 has type 'long long int'
shop.cpp:352: warning: format '%d' expects type 'int', but argument 7 has type 'long long int'
shop.cpp:355: warning: format '%d' expects type 'int', but argument 7 has type 'long long int'
shop.cpp:355: warning: format '%d' expects type 'int', but argument 7 has type 'long long int'
Mulţumesc anticipat!!
Mă refer la:
shop.cpp:352: warning: format '%d' expects type 'int', but argument 7 has type 'long long int'
shop.cpp:352: warning: format '%d' expects type 'int', but argument 7 has type 'long long int'
shop.cpp:355: warning: format '%d' expects type 'int', but argument 7 has type 'long long int'
shop.cpp:355: warning: format '%d' expects type 'int', but argument 7 has type 'long long int'
- Moț
-

- Mesaje: 2825
- Membru din: 03 Apr 2017, 15:00
- Aprecieri: 216
- Mulţumiri: 3040
- Discord: Copiază ID
Cod: Selectaţi tot
snprintf(buf, sizeof(buf), "%s %u(%s) %u %u", item->GetName(), m_pkPC->GetPlayerID(), m_pkPC->GetName(), llPrice, item->GetCount());Cod: Selectaţi tot
snprintf(buf, sizeof(buf), "%s %u(%s) %lld %u", item->GetName(), m_pkPC->GetPlayerID(), m_pkPC->GetName(), llPrice, item->GetCount());Cod: Selectaţi tot
snprintf(buf, sizeof(buf), "%s %u(%s) %u %u", item->GetName(), ch->GetPlayerID(), ch->GetName(), llPrice, item->GetCount());
Cod: Selectaţi tot
snprintf(buf, sizeof(buf), "%s %u(%s) %lld %u", item->GetName(), ch->GetPlayerID(), ch->GetName(), llPrice, item->GetCount());
-
- Informaţie
-
Cine este conectat
Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 1 vizitator
