Skip to content
This repository was archived by the owner on Dec 10, 2022. It is now read-only.

Commit c23fdb3

Browse files
committed
warnings
1 parent b28899c commit c23fdb3

10 files changed

+21
-21
lines changed

daedalus/DATFile.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ class DATFile {
374374
return;
375375
auto& parSymbol = getSymbolByName(name);
376376
parSymbol.classMemberOffset = int32_t(offsetOf(field));
377-
parSymbol.classMemberArraySize = std::max<uint32_t>(1u,std::extent<T>());
377+
parSymbol.classMemberArraySize = uint32_t(std::max<size_t>(1u,std::extent<T>()));
378378
}
379379

380380
private:

zenload/parserImplASCII.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ bool ParserImplASCII::readChunkStart(ZenParser::ChunkHeader& header)
4444
}
4545

4646
// Save chunks starting-position (right after chunk-header)
47-
header.startPosition = m_pParser->m_Seek;
47+
header.startPosition = uint32_t(m_pParser->m_Seek);
4848

4949
// Parse chunk-header
5050
std::string vobDescriptor(reinterpret_cast<const char*>(&m_pParser->m_Data[m_pParser->m_Seek]), tmpSeek - m_pParser->m_Seek);

zenload/parserImplBinSafe.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ bool ParserImplBinSafe::readChunkStart(ZenParser::ChunkHeader& header)
5353
}
5454

5555
// Save chunks starting-position (right after chunk-header)
56-
header.startPosition = m_pParser->m_Seek;
56+
header.startPosition = uint32_t(m_pParser->m_Seek);
5757

5858
std::string name;
5959
std::string className;

zenload/zCMesh.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -494,14 +494,13 @@ void zCMesh::packMesh(PackedMesh& mesh, float scale, bool removeDoubles)
494494
vx.Normal = m_Features[featidx].vertNormal;
495495

496496
// Add index to this very vertex
497-
newIndices.push_back(newVertices.size());
498-
497+
newIndices .push_back(uint32_t(newVertices.size()));
499498
newVertices.push_back(vx);
500499
}
501500
else
502501
{
503502
// Simply put an index to the existing new vertex
504-
newIndices.push_back((*it).second);
503+
newIndices.push_back(uint32_t((*it).second));
505504
}
506505

507506
// Store what this new index was before
@@ -527,7 +526,7 @@ void zCMesh::packMesh(PackedMesh& mesh, float scale, bool removeDoubles)
527526
vx.Normal = m_Features[featidx].vertNormal;
528527

529528
newVertices.push_back(vx);
530-
newIndices.push_back(newVertices.size() - 1);
529+
newIndices.push_back(uint32_t(newVertices.size() - 1));
531530
}
532531
}
533532

@@ -536,7 +535,7 @@ void zCMesh::packMesh(PackedMesh& mesh, float scale, bool removeDoubles)
536535
std::unordered_map<uint32_t, uint32_t> newMaterialSlotsByMatIndex;
537536
for (size_t i = 0, end = m_Materials.size(); i < end; i++)
538537
{
539-
materialsByTexture[m_Materials[i].texture] = i;
538+
materialsByTexture[m_Materials[i].texture] = uint32_t(i);
540539
}
541540

542541
// Assign materials to packed mesh

zenload/zCMeshSoftSkin.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ void zCMeshSoftSkin::packMesh(PackedSkeletalMesh& mesh, float scale) const
182182
{
183183
const zCProgMeshProto::SubMesh& sm = m_Mesh.getSubmesh(s);
184184

185-
unsigned int meshVxStart = mesh.vertices.size();
185+
uint32_t meshVxStart = uint32_t(mesh.vertices.size());
186186

187187
// Get data
188188
for (size_t i = 0; i < sm.m_WedgeList.size(); i++)
@@ -198,7 +198,7 @@ void zCMeshSoftSkin::packMesh(PackedSkeletalMesh& mesh, float scale) const
198198
}
199199

200200
// Mark when the submesh starts
201-
submeshIndexStarts.push_back(indices.size());
201+
submeshIndexStarts.push_back(uint32_t(indices.size()));
202202

203203
// And get the indices
204204
for (size_t i = 0; i < sm.m_TriangleList.size(); i++)

zenload/zCModelAni.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ zCModelAni::zCModelAni(const std::string& fileName, const VDFS::FileIndex& fileI
109109
void zCModelAni::readObjectData(ZenParser& parser)
110110
{
111111
// Information about the whole file we are reading here
112-
BinaryFileInfo fileInfo;
112+
// BinaryFileInfo fileInfo;
113113

114114
// Information about a single chunk
115115
BinaryChunkInfo chunkInfo;

zenload/zCModelMeshLib.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ zCModelMeshLib::zCModelMeshLib(const std::string& fileName, const VDFS::FileInde
6969
void zCModelMeshLib::loadMDM(ZenParser& parser)
7070
{
7171
// Information about the whole file we are reading here
72-
BinaryFileInfo fileInfo;
72+
// BinaryFileInfo fileInfo;
7373

7474
// Information about a single chunk
7575
BinaryChunkInfo chunkInfo;
@@ -144,7 +144,7 @@ void zCModelMeshLib::loadMDM(ZenParser& parser)
144144
void zCModelMeshLib::loadMDH(ZenParser& parser, float scale)
145145
{
146146
// Information about the whole file we are reading here
147-
BinaryFileInfo fileInfo;
147+
// BinaryFileInfo fileInfo;
148148

149149
// Information about a single chunk
150150
BinaryChunkInfo chunkInfo;

zenload/zCModelPrototype.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ void zCModelPrototype::readObjectData(ZenParser& parser)
162162

163163
Animation ani;
164164
ani.animationName = args[(int)EIdxAni::name];
165-
ani.layer = atoi(args[(int)EIdxAni::layer].c_str());
165+
ani.layer = atoi(args[(int)EIdxAni::layer].c_str());
166166
ani.nextAnimation = args[(int)EIdxAni::nextAni];
167-
ani.blendIn = atof(args[(int)EIdxAni::blendIn].c_str());
168-
ani.blendOut = atof(args[(int)EIdxAni::blendOut].c_str());
167+
ani.blendIn = float(atof(args[(int)EIdxAni::blendIn].c_str()));
168+
ani.blendOut = float(atof(args[(int)EIdxAni::blendOut].c_str()));
169169

170170
ani.ascName = args[(int)EIdxAni::ASC_Name];
171171
ani.aniReversed = args[(int)EIdxAni::aniDir] == "R";

zenload/zCProgMeshProto.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,11 @@ void zCProgMeshProto::readObjectData(ZenParser& parser)
127127
std::string mname = p2.readLine(false); // Read unused material name (Stored a second time later)
128128

129129
// Skip chunk headers - we know these are zCMaterial
130-
uint32_t chunksize = p2.readBinaryDWord();
131-
uint16_t version = p2.readBinaryWord();
130+
uint32_t chunksize = p2.readBinaryDWord();
131+
uint16_t version = p2.readBinaryWord();
132132
uint32_t objectIndex = p2.readBinaryDWord();
133+
(void)chunksize;
134+
(void)objectIndex;
133135

134136
p2.skipSpaces();
135137

@@ -236,7 +238,7 @@ void ZenLoad::zCProgMeshProto::packVertices(std::vector<WorldVertex>& vxs, std::
236238
{
237239
const SubMesh& sm = m_SubMeshes[s];
238240

239-
unsigned int meshVxStart = vxs.size();
241+
uint32_t meshVxStart = uint32_t(vxs.size());
240242

241243
// Get data
242244
for (size_t i = 0; i < sm.m_WedgeList.size(); i++)
@@ -253,7 +255,7 @@ void ZenLoad::zCProgMeshProto::packVertices(std::vector<WorldVertex>& vxs, std::
253255
}
254256

255257
// Mark when the submesh starts
256-
submeshIndexStarts.push_back(ixs.size());
258+
submeshIndexStarts.push_back(uint32_t(ixs.size()));
257259

258260
// And get the indices
259261
for (size_t i = 0; i < sm.m_TriangleList.size(); i++)

zenload/ztex2dds.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ namespace ZenLoad
112112
ZTEX_FILE_HEADER ZTexHeader;
113113
uint32_t BytesRead = 0;
114114
uint32_t DdsMagic;
115-
uint32_t BytesWritten;
116115
DDSURFACEDESC2 DdsHeader;
117116
int MipmapCount;
118117
int MipmapLevel;

0 commit comments

Comments
 (0)