Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C++ Warning C4305 and C4309

Status
Not open for further replies.

LdRavenz

Programmer
Nov 18, 2004
1
US
Hi guys,

I am haveing 6 warnings all involving C4305 and C4309 The lines thats causeing these errors is


if (sSummonPoints > DEF_MAXSUMMONPOINTS) sSummonPoints = DEF_MAXSUMMONPOINTS;

---------------------------------------------------------
m_pNpcList->m_sAppr2 = 0xF000;

---------------------------------------------------------

m_pNpcList->m_sAppr2 = 0xF000; // 10 aura no sphere 13 no name movable with magic (crash) test to 29
---------------------------------------------------------


Any help on this would be much appricated

Thanks
 
Both C4305 and C4309 are warnings about (constant) value truncation. For example, if m_sAppr2 has short type, it can't accept 0xF000 (positive int!) constant value (1111000000000000 binary is negative 16-bit short value!).
Revise this member attributes (assign larger int type to it) or ignore these warnings if you know it's safe...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top