1
0
forked from 0ad/0ad

Corrected ICC errors and some warnings. Removed some unnecessarily verbose logging. Did minor things.

This was SVN commit r1718.
This commit is contained in:
Ykkrosh 2005-01-13 00:17:31 +00:00
parent 4720a00f98
commit 38b30e5eb4
18 changed files with 39 additions and 32 deletions

View File

@ -16,6 +16,16 @@ static SMaterialColor IdentityAmbient(0.2f, 0.2f, 0.2f, 1.0f);
static SMaterialColor IdentitySpecular(0.0f, 0.0f, 0.0f, 1.0f);
static SMaterialColor IdentityEmissive(0.0f, 0.0f, 0.0f, 1.0f);
bool SMaterialColor::operator ==(const SMaterialColor color)
{
return (
r == color.r &&
g == color.g &&
b == color.b &&
a == color.a
);
}
CMaterial::CMaterial()
: m_Diffuse(IdentityDiffuse),
m_Ambient(IdentityAmbient),

View File

@ -34,15 +34,7 @@ public:
b = color.b;
a = color.a;
}
bool operator ==(const SMaterialColor color)
{
return (
r == color.r &&
g == color.g &&
b == color.b &&
a == color.a
);
}
bool operator ==(const SMaterialColor color);
float Sum()
{

View File

@ -21,7 +21,7 @@ CModelDefPtr CMeshManager::GetMesh(const char *filename)
try
{
CModelDefPtr model (iter->second);
LOG(MESSAGE, "mesh", "Loading mesh '%s%' (cached)...", filename);
//LOG(MESSAGE, "mesh", "Loading mesh '%s%' (cached)...", filename);
return model;
}
// If the mesh has already been deleted, the weak_ptr -> shared_ptr
@ -37,7 +37,7 @@ CModelDefPtr CMeshManager::GetMesh(const char *filename)
if (!model)
return CModelDefPtr();
LOG(MESSAGE, "mesh", "Loading mesh '%s'...", filename);
//LOG(MESSAGE, "mesh", "Loading mesh '%s'...", filename);
m_MeshMap[fn] = model;
return model;
}

View File

@ -158,7 +158,7 @@ void CObjectManager::LoadObjects(int type)
} else {
object->m_FileName=dent.name;
AddObject(object,type);
LOG(NORMAL, LOG_CATEGORY, "CObjectManager::LoadObjects(): %s: XML Loaded", filename.c_str());
//LOG(NORMAL, LOG_CATEGORY, "CObjectManager::LoadObjects(): %s: XML Loaded", filename.c_str());
}
}
vfs_close_dir(dir);

View File

@ -524,7 +524,7 @@ void CGUI::UpdateObjects()
}
// Else actually update the real one
m_pAllObjects = AllObjects;
m_pAllObjects.swap(AllObjects);
}
bool CGUI::ObjectExists(const CStr& Name) const

View File

@ -371,7 +371,7 @@ void GUIRenderer::UpdateDrawCallCache(DrawCalls &Calls, CStr &SpriteName, CRect
CRect ObjectSize = cit->m_Size.GetClientArea(Size);
if (ObjectSize.GetWidth() == 0 || ObjectSize.GetHeight() == 0)
if (ObjectSize.GetWidth() == 0.0 || ObjectSize.GetHeight() == 0.0)
{
LOG(ERROR, LOG_CATEGORY, "Error drawing sprite '%s': size %dx%d is partly zero", (const char*)SpriteName, (int)ObjectSize.GetWidth(), (int)ObjectSize.GetHeight());
continue; // as in, don't continue with this image

View File

@ -40,7 +40,7 @@ my @types = qw(
#// Extract everything from this file, above the /********/ line
open IN, $0 or die "Error opening $0: $!";
my $out = '';
my $out = "";
while (<IN>)
{
last if $_ eq "/********/\n";

View File

@ -116,7 +116,7 @@ void IGUIObject::AddToPointersMap(map_pObjects &ObjectMap)
// Now actually add this one
// notice we won't add it if it's doesn't have any parent
// (i.e. being the base object)
if (m_Name == string())
if (m_Name.Length() == 0)
{
throw PS_NEEDS_NAME;
}

View File

@ -880,7 +880,7 @@ static int raw_encode(TexInfo* t, const char* fn, u8* img, size_t img_size)
CHECK_ERR(fmt_8_or_24_or_32(t->bpp, t->flags));
// transforms
const int transforms = t->flags;
int transforms = t->flags;
transforms ^= TEX_BOTTOM_UP; // RAW is native bottom-up.
transforms ^= TEX_BGR; // RAW is native BGR.
transform(t, img, transforms);

View File

@ -117,7 +117,9 @@ extern int SDL_SetGamma(float r, float g, float b);
# endif
#endif
#ifdef _MSC_VER
// Debug-mode ICC doesn't like the intrinsics, so only use them
// for MSVC and non-debug ICC.
#if defined(_MSC_VER) && !( defined(__INTEL_COMPILER) && !defined(NDEBUG) )
#pragma intrinsic(_byteswap_ushort)
#pragma intrinsic(_byteswap_ulong)
#pragma intrinsic(_byteswap_uint64)

View File

@ -211,7 +211,6 @@ CStr CStr::UCase() const
// Retrieve the substring of the first n characters
CStr CStr::Left(size_t len) const
{
assert(len >= 0);
assert(len <= length());
return substr(0, len);
}
@ -219,7 +218,6 @@ CStr CStr::Left(size_t len) const
// Retrieve the substring of the last n characters
CStr CStr::Right(size_t len) const
{
assert(len >= 0);
assert(len <= length());
return substr(length()-len, len);
}

View File

@ -26,6 +26,16 @@ COverlay::~COverlay()
/*************************************************************************/
bool CColor::operator == (const CColor &color) const
{
return r==color.r &&
g==color.g &&
b==color.b &&
a==color.a;
}
/*************************************************************************/
CRect::CRect() :
left(0.f), top(0.f), right(0.f), bottom(0.f)
{

View File

@ -19,13 +19,7 @@ struct CColor
CColor() : r(-1.f), g(-1.f), b(-1.f), a(1.f) {}
CColor(float cr,float cg,float cb,float ca) : r(cr), g(cg), b(cb), a(ca) {}
bool operator == (const CColor &color) const
{
return r==color.r &&
g==color.g &&
b==color.b &&
a==color.a;
}
bool operator == (const CColor &color) const;
bool operator != (const CColor &color) const
{

View File

@ -306,7 +306,7 @@ FUNC_IMPL_GETARG(GetArgDouble, GetDouble, double)
// CallFunc(4,2) => CallFunc, 4, 2
// TODO Gee: Make Parser use CStr.
bool CParserLine::ParseString(const CParser& Parser, string strLine)
bool CParserLine::ParseString(const CParser& Parser, const std::string &strLine)
{
// Don't process empty string
if (strLine == string())

View File

@ -182,7 +182,7 @@ protected:
public:
// Interface
bool ParseString(const CParser& parser, std::string line);
bool ParseString(const CParser& parser, const std::string &line);
// Methods for getting arguments
// it returns success

View File

@ -9,11 +9,11 @@
using namespace VFSUtil;
// Because I'm lazy, and it saves a few lines of code in other places:
bool VFSUtil::FindFiles (CStr dirname, const char* filter, FileList& files)
bool VFSUtil::FindFiles (CStr& dirname, const char* filter, FileList& files)
{
files.clear();
Handle dir = vfs_open_dir(dirname.c_str());
Handle dir = vfs_open_dir(dirname);
if (dir <= 0)
{
LOG(ERROR, LOG_CATEGORY, "Error opening directory '%s' (%lld)", dirname.c_str(), dir);

View File

@ -12,6 +12,6 @@ namespace VFSUtil
// - anything else: pattern for name (may include '?' and '*' wildcards)
// 'files' is initially cleared, and undefined on failure.
// On failure, logs an error and returns false.
bool FindFiles(CStr dirname, const char* filter, FileList& files);
bool FindFiles(CStr& dirname, const char* filter, FileList& files);
};

View File

@ -31,6 +31,7 @@ void CPlayList::load(const char* file)
const char* playlist = (const char*)p;
const char* track;
debug_warn("TODO: This code looks quite suspicious");
while(sscanf(playlist, "%s\n", &track) == 1)
tracks.push_back(track);