Trei warning-uri sursă

Înainte de a posta o problemă, caută în acest forum și poate găsești rezolvare.
Închis
Avatar utilizator
Heimdall
Nivel 1

Nivel 1
Mesaje: 63
Membru din: 31 Oct 2019, 03:13
Aprecieri: 51  
Mulţumiri: 12  
Medalii

*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!
I watch over you always, even when you think you are alone in this world.
Afișează semnătura
Avatar utilizator
Moț
Ţepar / Untrusted User

Ţepar / Untrusted User
Mesaje: 2825
Membru din: 03 Apr 2017, 15:00
Aprecieri: 216  
Mulţumiri: 3040  
Discord: Copiază ID
Medalii

char_item.cpp

Cod: Selectaţi tot

CBuffOnAttributes* pBuff;
cu

Cod: Selectaţi tot

 CBuffOnAttributes* pBuff = NULL;
shop.cpp

Cod: Selectaţi tot

                snprintf(buf, sizeof(buf), "%s FROM: %u TO: %u PRICE: %u", item->GetName(), ch->GetPlayerID(), m_pkPC->GetPlayerID(), llPrice);
cu

Cod: Selectaţi tot

                snprintf(buf, sizeof(buf), "%s FROM: %u TO: %u PRICE: %lld", item->GetName(), ch->GetPlayerID(), m_pkPC->GetPlayerID(), llPrice);
item_manager_read_tables.cpp

Cod: Selectaţi tot

            CDropItemGroup* pkGroup;
cu

Cod: Selectaţi tot

            CDropItemGroup* pkGroup = NULL;
Pentru acest mesaj, Moț for the post:
Heimdall
Imagine
Afișează semnătura
Avatar utilizator
Heimdall
Nivel 1

Nivel 1
Mesaje: 63
Membru din: 31 Oct 2019, 03:13
Aprecieri: 51  
Mulţumiri: 12  
Medalii

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'
I watch over you always, even when you think you are alone in this world.
Afișează semnătura
Avatar utilizator
Moț
Ţepar / Untrusted User

Ţepar / Untrusted User
Mesaje: 2825
Membru din: 03 Apr 2017, 15:00
Aprecieri: 216  
Mulţumiri: 3040  
Discord: Copiază ID
Medalii

Cod: Selectaţi tot

            snprintf(buf, sizeof(buf), "%s %u(%s) %u %u", item->GetName(), m_pkPC->GetPlayerID(), m_pkPC->GetName(), llPrice, item->GetCount());
cu

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());
cu

Cod: Selectaţi tot

            snprintf(buf, sizeof(buf), "%s %u(%s) %lld %u", item->GetName(), ch->GetPlayerID(), ch->GetName(), llPrice, item->GetCount());
Pentru acest mesaj, Moț for the post:
Heimdall
Imagine
Afișează semnătura
Avatar utilizator
Heimdall
Nivel 1

Nivel 1
Mesaje: 63
Membru din: 31 Oct 2019, 03:13
Aprecieri: 51  
Mulţumiri: 12  
Medalii

Rezolvat. Mulţumesc!
I watch over you always, even when you think you are alone in this world.
Afișează semnătura
Închis
Răspunsuri
4
Vizualizări
364
Răspunsuri
6
Vizualizări
527
Răspunsuri
8
Vizualizări
737
Răspunsuri
2
Vizualizări
329

Înapoi la “Probleme rezolvate”

  • Informaţie
  • Cine este conectat

    Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 1 vizitator