While compiling the BtS SDK I came across this:
For C2664, the affected code is in red font, and C2660 the affected code is in blue font:
How do I fix this?
I tried commenting out the C2660 errors, and that seemed to do the trick... however, is this the right way to resolve this, or is commenting out the lines in question a band-aid fix?
Code:
Project : CvGameCoreDLL
Compiler : Microsoft Visual C++ Toolkit 2003 (called directly)
Directory : C:\Games\Sid Meier's Civilization IV\Beyond the Sword\CvGameCoreDLL\
--------------------------------------------------------------------------------
Switching to target: Final Release
CvInfos.cpp
[COLOR="Red"]CvInfos.cpp(6395) : error C2664: 'void CvXMLLoadUtility::SetVariableListTagPair(int ** ,const TCHAR *,int,int,int)' : cannot convert parameter 3 from 'std::vector<_Ty>' to 'int'
with
[
_Ty=CvSpecialistInfo *
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
CvInfos.cpp(6472) : error C2660: 'CvXMLLoadUtility::FindInInfoClass' : function does not take 4 arguments
CvInfos.cpp(6520) : error C2660: 'CvXMLLoadUtility::FindInInfoClass' : function does not take 4 arguments[/COLOR]
Process terminated with status 1 (0 minutes, 4 seconds)
3 errors, 0 warnings
For C2664, the affected code is in red font, and C2660 the affected code is in blue font:
Code:
// < Changes Start >
[COLOR="Red"]pXML->SetVariableListTagPair(&m_paiFreeSpecialistCount, "FreeSpecialistCounts", GC.getSpecialistInfo(), sizeof(GC.getSpecialistInfo((SpecialistTypes)0)), GC.getNumSpecialistInfos());[/COLOR]
if (gDLL->getXMLIFace()->SetToChildByTagName(pXML->GetXML(),"TradeCommerceModifiers"))
{
pXML->SetYields(&m_piTradeCommerceModifier);
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
else
{
pXML->InitList(&m_piTradeCommerceModifier, NUM_COMMERCE_TYPES);
}
if (gDLL->getXMLIFace()->SetToChildByTagName(pXML->GetXML(),"SpecialistExtraYields"))
{
pXML->SetCommerce(&m_piSpecialistExtraYield);
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
else
{
pXML->InitList(&m_piSpecialistExtraYield, NUM_YIELD_TYPES);
}
if (gDLL->getXMLIFace()->SetToChildByTagName(pXML->GetXML(),"StateReligionYieldModifiers"))
{
pXML->SetYields(&m_piStateReligionYieldModifier);
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
else
{
pXML->InitList(&m_piStateReligionYieldModifier, NUM_YIELD_TYPES);
}
if (gDLL->getXMLIFace()->SetToChildByTagName(pXML->GetXML(),"StateReligionCommerceModifiers"))
{
pXML->SetCommerce(&m_piStateReligionCommerceModifier);
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
else
{
pXML->InitList(&m_piStateReligionCommerceModifier, NUM_COMMERCE_TYPES);
}
if (gDLL->getXMLIFace()->SetToChildByTagName(pXML->GetXML(),"NonStateReligionYieldModifiers"))
{
pXML->SetYields(&m_piNonStateReligionYieldModifier);
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
else
{
pXML->InitList(&m_piNonStateReligionYieldModifier, NUM_YIELD_TYPES);
}
if (gDLL->getXMLIFace()->SetToChildByTagName(pXML->GetXML(),"NonStateReligionCommerceModifiers"))
{
pXML->SetCommerce(&m_piNonStateReligionCommerceModifier);
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
else
{
pXML->InitList(&m_piNonStateReligionCommerceModifier, NUM_COMMERCE_TYPES);
}
// initialize the boolean list to the correct size and all the booleans to false
FAssertMsg((GC.getNumBuildingInfos() > 0) && (NUM_YIELD_TYPES) > 0,"either the number of Building infos is zero or less or the number of yield types is zero or less");
pXML->Init2DIntList(&m_ppiBuildingYieldChanges, GC.getNumBuildingInfos(), NUM_YIELD_TYPES);
if (gDLL->getXMLIFace()->SetToChildByTagName(pXML->GetXML(),"BuildingYieldChanges"))
{
if (pXML->SkipToNextVal())
{
iNumSibs = gDLL->getXMLIFace()->GetNumChildren(pXML->GetXML());
if (gDLL->getXMLIFace()->SetToChild(pXML->GetXML()))
{
if (0 < iNumSibs)
{
for (j=0;j<iNumSibs;j++)
{
pXML->GetChildXmlValByName(szTextVal, "BuildingType");
[COLOR="Blue"]iIndex = pXML->FindInInfoClass(szTextVal, GC.getBuildingInfo(), sizeof(GC.getBuildingInfo((BuildingTypes)0)), GC.getNumBuildingInfos());[/COLOR]
if (iIndex > -1)
{
// delete the array since it will be reallocated
SAFE_DELETE_ARRAY(m_ppiBuildingYieldChanges[iIndex]);
// if we can set the current xml node to it's next sibling
if (gDLL->getXMLIFace()->SetToChildByTagName(pXML->GetXML(),"BuildingYields"))
{
// call the function that sets the yield change variable
pXML->SetYields(&m_ppiBuildingYieldChanges[iIndex]);
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
else
{
pXML->InitList(&m_ppiBuildingYieldChanges[iIndex], NUM_YIELD_TYPES);
}
}
if (!gDLL->getXMLIFace()->NextSibling(pXML->GetXML()))
{
break;
}
}
}
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
}
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
// initialize the boolean list to the correct size and all the booleans to false
FAssertMsg((GC.getNumBuildingInfos() > 0) && (NUM_COMMERCE_TYPES) > 0,"either the number of Building infos is zero or less or the number of commerce types is zero or less");
pXML->Init2DIntList(&m_ppiBuildingCommerceChanges, GC.getNumBuildingInfos(), NUM_COMMERCE_TYPES);
if (gDLL->getXMLIFace()->SetToChildByTagName(pXML->GetXML(),"BuildingCommerceChanges"))
{
if (pXML->SkipToNextVal())
{
iNumSibs = gDLL->getXMLIFace()->GetNumChildren(pXML->GetXML());
if (gDLL->getXMLIFace()->SetToChild(pXML->GetXML()))
{
if (0 < iNumSibs)
{
for (j=0;j<iNumSibs;j++)
{
pXML->GetChildXmlValByName(szTextVal, "BuildingType");
[COLOR="blue"]iIndex = pXML->FindInInfoClass(szTextVal, GC.getBuildingInfo(), sizeof(GC.getBuildingInfo((BuildingTypes)0)), GC.getNumBuildingInfos());[/COLOR]
if (iIndex > -1)
{
// delete the array since it will be reallocated
SAFE_DELETE_ARRAY(m_ppiBuildingCommerceChanges[iIndex]);
// if we can set the current xml node to it's next sibling
if (gDLL->getXMLIFace()->SetToChildByTagName(pXML->GetXML(),"BuildingCommerces"))
{
// call the function that sets the commerce change variable
pXML->SetYields(&m_ppiBuildingCommerceChanges[iIndex]);
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
else
{
pXML->InitList(&m_ppiBuildingCommerceChanges[iIndex], NUM_COMMERCE_TYPES);
}
}
if (!gDLL->getXMLIFace()->NextSibling(pXML->GetXML()))
{
break;
}
}
}
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
}
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
// < Changes End >
How do I fix this?
I tried commenting out the C2660 errors, and that seemed to do the trick... however, is this the right way to resolve this, or is commenting out the lines in question a band-aid fix?