diff --git a/common/lc_colors.cpp b/common/lc_colors.cpp index bf26df47..40c60fd1 100644 --- a/common/lc_colors.cpp +++ b/common/lc_colors.cpp @@ -405,7 +405,7 @@ void lcLoadDefaultColors() int lcGetColorIndex(quint32 ColorCode) { - for (int ColorIdx = 0; ColorIdx < gColorList.size(); ColorIdx++) + for (size_t ColorIdx = 0; ColorIdx < gColorList.size(); ColorIdx++) if (gColorList[ColorIdx].Code == ColorCode) return ColorIdx; diff --git a/common/project.cpp b/common/project.cpp index bf09da95..3b6c4652 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -713,11 +713,11 @@ void Project::Export3DStudio(const QString& FileName) const int MaterialNameLength = 11; char MaterialName[32]; - for (int ColorIdx = 0; ColorIdx < gColorList.size(); ColorIdx++) + for (size_t ColorIdx = 0; ColorIdx < gColorList.size(); ColorIdx++) { lcColor* Color = &gColorList[ColorIdx]; - sprintf(MaterialName, "Material%03d", ColorIdx); + sprintf(MaterialName, "Material%03d", (int)ColorIdx); long MaterialStart = File.GetPosition(); File.WriteU16(0xAFFF); // CHK_MAT_ENTRY @@ -1701,7 +1701,7 @@ void Project::CreateHTMLPieceList(QTextStream& Stream, lcModel* Model, lcStep St Stream << QLatin1String("
\r\n"); - for (int ColorIdx = 0; ColorIdx < gColorList.size(); ColorIdx++) + for (size_t ColorIdx = 0; ColorIdx < gColorList.size(); ColorIdx++) { if (ColorsUsed[ColorIdx]) { @@ -2150,7 +2150,7 @@ bool Project::ExportPOVRay(const QString& FileName) if (sscanf(Line,"%d%s%s", &Code, Name, Flags) != 3) continue; - int Color = lcGetColorIndex(Code); + size_t Color = lcGetColorIndex(Code); if (Color >= NumColors) continue; @@ -2192,7 +2192,7 @@ bool Project::ExportPOVRay(const QString& FileName) POVFile.WriteLine("\n"); } - for (int ColorIdx = 0; ColorIdx < gColorList.size(); ColorIdx++) + for (size_t ColorIdx = 0; ColorIdx < gColorList.size(); ColorIdx++) { lcColor* Color = &gColorList[ColorIdx]; @@ -2217,7 +2217,7 @@ bool Project::ExportPOVRay(const QString& FileName) lcArray ColorTablePointer; ColorTablePointer.SetSize(NumColors); - for (int ColorIdx = 0; ColorIdx < NumColors; ColorIdx++) + for (size_t ColorIdx = 0; ColorIdx < NumColors; ColorIdx++) ColorTablePointer[ColorIdx] = ColorTable[ColorIdx].data(); auto GetMeshName = [](const lcModelPartsEntry& ModelPart, char* Name)
Piece