C++ Signed/unsigned mismatch
<p>I am having trouble getting some code to compile properly. Here are my errors:</p>

<p>warning C4018: '>=' : signed/unsigned mismatch</p>

<pre><code>if (m_baseRatingValue[CR_HASTE_MELEE] &gt;= sWorld-&gt;getIntConfig(CONFIG_PLAYER_HASTECAP_LIMIT))
</code></pre>

<p>warning C4018: '&lt;' : signed/unsigned mismatch</p>

<pre><code>else if (hasInstantHasteCap &amp;&amp; m_baseRatingValue[CR_HASTE_MELEE] &lt; sWorld-&gt;getIntConfig(CONFIG_PLAYER_HASTECAP_LIMIT))
</code></pre>

<p>Here is the full code:</p>

<pre><code>void Player::HasteCap()
{   
if (sWorld-&gt;getBoolConfig(CONFIG_PLAYER_HASTECAP_ENABLE))
    return;

bool hasInstantHasteCap = (GetFloatValue(UNIT_FIELD_BASEATTACKTIME + 0) == 1 
                        || GetFloatValue(UNIT_FIELD_BASEATTACKTIME + 1) == 1 
                        || GetFloatValue(UNIT_FIELD_BASEATTACKTIME + 2) == 1 
                        || GetFloatValue(UNIT_MOD_CAST_SPEED) == 0);

if (m_baseRatingValue[CR_HASTE_MELEE] &gt; sWorld-&gt;getIntConfig(CONFIG_PLAYER_HASTECAP_LIMIT))
{
    SetFloatValue(UNIT_MOD_CAST_SPEED, 0);
    SetFloatValue(UNIT_FIELD_BASEATTACKTIME + BASE_ATTACK, 1);
    SetFloatValue(UNIT_FIELD_BASEATTACKTIME + OFF_ATTACK, 1);
    SetFloatValue(UNIT_FIELD_BASEATTACKTIME + RANGED_ATTACK, 1);
}

else if (hasInstantHasteCap &amp;&amp; m_baseRatingValue[CR_HASTE_MELEE] &lt; sWorld-&gt;getIntConfig(CONFIG_PLAYER_HASTECAP_LIMIT))
{
    SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f);
    SetRegularAttackTime();
    ApplyCastTimePercentMod(m_baseRatingValue[CR_HASTE_SPELL] * GetRatingMultiplier(CR_HASTE_SPELL), true);

    if (GetShapeshiftForm())
    {
        SpellShapeshiftEntry const* ssEntry = sSpellShapeshiftStore.LookupEntry(GetShapeshiftForm());
        if (ssEntry &amp;&amp; ssEntry-&gt;attackSpeed)
        {
            SetAttackTime(BASE_ATTACK, ssEntry-&gt;attackSpeed);
            SetAttackTime(OFF_ATTACK, ssEntry-&gt;attackSpeed);
            SetAttackTime(RANGED_ATTACK, BASE_ATTACK_TIME);
        }
    }
}

if (CanModifyStats())
{
    UpdateDamagePhysical(BASE_ATTACK);
    UpdateDamagePhysical(OFF_ATTACK);
    UpdateDamagePhysical(RANGED_ATTACK);
}
</code></pre>

<p>}</p>
