Core/Misc: Fix a couple of warnings, some of them performance related

Errors were found using Cppcheck, open-source static analysis tool
This commit is contained in:
Nay committed 2013-01-04 23:14:14 +00:00
1 parent e0a5aabaf7
commit a509aea659
18 files changed
+25 -31

No files matched your search

+2 -4
View File
@@ -77,8 +77,7 @@ bool Model::ConvertToVMAPModel(const char * outfilename)
return false;
}
fwrite(szRawVMAPMagic, 8, 1, output);
uint32 nVertices = 0;
nVertices = header.nBoundingVertices;
uint32 nVertices = header.nBoundingVertices;
fwrite(&nVertices, sizeof(int), 1, output);
uint32 nofgroups = 1;
fwrite(&nofgroups,sizeof(uint32), 1, output);
@@ -91,8 +90,7 @@ bool Model::ConvertToVMAPModel(const char * outfilename)
wsize = sizeof(branches) + sizeof(uint32) * branches;
fwrite(&wsize, sizeof(int), 1, output);
fwrite(&branches,sizeof(branches), 1, output);
uint32 nIndexes = 0;
nIndexes = header.nBoundingTriangles;
uint32 nIndexes = header.nBoundingTriangles;
fwrite(&nIndexes,sizeof(uint32), 1, output);
fwrite("INDX",4, 1, output);
wsize = sizeof(uint32) + sizeof(unsigned short) * nIndexes;