Hi!
from about 2 days I'm fu**g work with this pieces of code , and i can't find the problem
can someone give me one "HINT", about this?????
Please!
Source Code:
Code
- #ifdef ENABLE_ANNOUNCE_REFINE
- int m_nTableMin[] = {141, 151, 161, 171, 181, 191};
- int m_nTableMax[] = {149, 159, 169, 179, 189, 199};
- for (int i = 0; i < _countof (m_nTableMin); i++)
- {
- for (int j = 0; j < _countof (m_nTableMax); j++)
- {
- if (m_nTableMin[i] <= pkNewItem->GetVnum() and pkNewItem->GetVnum() <= m_nTableMax[j])
- {
- char buf[1024];
- char itemlink[256];
- int len;
- len = snprintf (itemlink, sizeof (itemlink), "item:%x:%x:%x:%x:%x", pkNewItem->GetVnum(), pkNewItem->GetFlag(), pkNewItem->GetSocket (0), pkNewItem->GetSocket (1), pkNewItem->GetSocket (2));
- for (int i = 0; i < ITEM_ATTRIBUTE_MAX_NUM; ++i)
- if (pkNewItem->GetAttributeType (i))
- {
- len += snprintf (itemlink + len, sizeof (itemlink) - len, ":%x:%d", pkNewItem->GetAttributeType (i), pkNewItem->GetAttributeValue (i));
- }
- snprintf (buf, sizeof (buf), "|cffffc700|H%s|h[%s]|h|r", itemlink, pkNewItem->GetName());
- char szUpgradeAnnouncement[QUERY_MAX_LEN];
- snprintf (szUpgradeAnnouncement, sizeof (szUpgradeAnnouncement), LC_TEXT ("Refine info %s %s."), GetName(), buf);
- BroadcastNotice (szUpgradeAnnouncement);
- break;
- }
- }
- }
- #endif
Warning Compile:
Code
- char_item.cpp: In member function 'bool CHARACTER::DoRefine(LPITEM, bool)':
- char_item.cpp:928:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
- for (int i = 0; i < _countof (m_nTableMin); i++)
- char_item.cpp:930:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
- for (int j = 0; j < _countof (m_nTableMax); j++)
- char_item.cpp:932:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
- if (m_nTableMin[i] <= pkNewItem->GetVnum() and pkNewItem->GetVnum() <= m_nTableMax[j])
- ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
- char_item.cpp:932:74: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
- if (m_nTableMin[i] <= pkNewItem->GetVnum() and pkNewItem->GetVnum() <= m_nTableMax[j])
- ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
- char_item.cpp:938:195: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'long int' [-Wformat=]
- len = snprintf (itemlink, sizeof (itemlink), "item:%x:%x:%x:%x:%x", pkNewItem->GetVnum(), pkNewItem->GetFlag(), pkNewItem->GetSocket (0), pkNewItem->GetSocket (1), pkNewItem->GetSocket (2));
- ^
- char_item.cpp:938:195: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'long int' [-Wformat=]
- char_item.cpp:938:195: warning: format '%x' expects argument of type 'unsigned int', but argument 7 has type 'long int' [-Wformat=]
- char_item.cpp:938:195: warning: format '%x' expects argument of type 'unsigned int', but argument 8 has type 'long int' [-Wformat=]