1
0
forked from 0ad/0ad

# Linux fixes.

Disabled CONFIG_USE_MMGR by default, since it seems unnecessary and it
makes debug builds slow (extremely slow under Valgrind) due to symbol
lookups when allocating memory.
Fixed minor warnings and errors.

This was SVN commit r4927.
This commit is contained in:
Ykkrosh 2007-02-25 21:11:57 +00:00
parent 5e9ef3fa03
commit c2b119e721
7 changed files with 13 additions and 9 deletions

View File

@ -100,6 +100,7 @@ function package_set_build_flags()
"-Wno-switch", -- enumeration value not handled in switch
"-Wno-reorder", -- order of initialization list in constructors
"-Wno-non-virtual-dtor",
"-Wno-invalid-offsetof", -- offsetof on non-POD types
-- do something (?) so that ccache can handle compilation with PCH enabled
"-fpch-preprocess",
@ -127,7 +128,7 @@ function package_set_build_flags()
}
package.defines = {
"__STDC_VERSION__=199901L",
"CONFIG_USE_MMGR",
-- "CONFIG_USE_MMGR",
}
end
end

View File

@ -248,7 +248,7 @@ void CModel::Update(float time)
// Make sure the last displayed frame is the final frame
// of the animation.
float nearlyEnd = duration - 1.f; // 1 msec
if (abs(oldAnimTime - nearlyEnd) < 1.f)
if (fabs(oldAnimTime - nearlyEnd) < 1.f)
SetAnimation(NULL);
else
m_AnimTime = nearlyEnd;

View File

@ -67,8 +67,10 @@ bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections
// Build the model:
/*
// remember the old model so we can replace any models using it later on
CModelDefPtr oldmodeldef = m_Model ? m_Model->GetModelDef() : CModelDefPtr();
*/
// try and create a model
CModelDefPtr modeldef (objectManager.GetMeshManager().GetMesh(m_ModelName));

View File

@ -162,10 +162,6 @@
# include <hash_set>
#endif
// Boost
#include <boost/utility.hpp> // noncopyable
// (further headers to be precompiled go here)
#endif // #if HAVE_PCH
@ -188,3 +184,7 @@
// note: mmgr.h activates mmgr or the VC debug heap or nothing depending
// on CONFIG_USE_MMGR and HAVE_VC_DEBUG_ALLOC settings.
# include "mmgr.h"
// Boost
#include <boost/utility.hpp> // noncopyable

View File

@ -154,7 +154,7 @@ CStr CProfileNodeTable::GetCellText(size_t row, size_t col)
else if (col == 4)
snprintf(buf, sizeof(buf), "%.1f", unlogged * 100.0f / g_Profiler.GetRoot()->GetFrameTime());
else if (col == 5)
snprintf(buf, sizeof(buf), "%d", unlogged_mallocs);
snprintf(buf, sizeof(buf), "%ld", unlogged_mallocs);
buf[sizeof(buf)-1] = '\0';
return CStr(buf);
@ -183,7 +183,7 @@ CStr CProfileNodeTable::GetCellText(size_t row, size_t col)
snprintf(buf, sizeof(buf), "%.1f", child->GetFrameTime() * 100.0 / node->GetFrameTime());
break;
case 5:
snprintf(buf, sizeof(buf), "%d", child->GetFrameMallocs());
snprintf(buf, sizeof(buf), "%ld", child->GetFrameMallocs());
break;
}
buf[sizeof(buf)-1] = '\0';

View File

@ -136,7 +136,7 @@ void CSimulation::Interpolate(double frameTime, double offset)
void CSimulation::Simulate()
{
float time = m_pTurnManager->GetTurnLength();
uint time = m_pTurnManager->GetTurnLength();
PROFILE_START( "scheduler tick" );
g_Scheduler.update(time);

View File

@ -2,6 +2,7 @@
#include "ScenarioEditor.h"
#include "wx/config.h"
#include "wx/evtloop.h"
#include "wx/tooltip.h"
#include "wx/image.h"