Skip to content

Commit 2c89265

Browse files
committed
Fixed warnings.
1 parent 6c71cfe commit 2c89265

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

common/lc_model.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2401,7 +2401,6 @@ void lcModel::FocusNextTrainTrack()
24012401
return;
24022402

24032403
quint32 FocusSection = FocusPiece->GetFocusSection();
2404-
std::optional<lcMatrix44> Transform;
24052404
int ConnectionIndex = 0;
24062405

24072406
if (FocusSection != LC_PIECE_SECTION_INVALID && FocusSection != LC_PIECE_SECTION_POSITION)
@@ -2430,7 +2429,6 @@ void lcModel::FocusPreviousTrainTrack()
24302429
return;
24312430

24322431
quint32 FocusSection = FocusPiece->GetFocusSection();
2433-
std::optional<lcMatrix44> Transform;
24342432
int ConnectionIndex = 0;
24352433

24362434
if (FocusSection != LC_PIECE_SECTION_INVALID && FocusSection != LC_PIECE_SECTION_POSITION)

common/project.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,7 +1859,7 @@ bool Project::ExportPOVRay(const QString& FileName)
18591859
lcPiecesLibrary* Library = lcGetPiecesLibrary();
18601860
std::map<const PieceInfo*, std::pair<char[LC_PIECE_NAME_LEN + 1], int>> PieceTable;
18611861
size_t NumColors = gColorList.size();
1862-
std::vector<std::array<char, LC_MAX_COLOR_NAME + 3>> LgeoColorTable(NumColors);
1862+
std::vector<std::string> LgeoColorTable(NumColors);
18631863
std::vector<std::array<char, LC_MAX_COLOR_NAME + 3>> ColorTable(NumColors);
18641864

18651865
const std::vector<std::unique_ptr<lcLight>>& Lights = gMainWindow->GetActiveModel()->GetLights();
@@ -2291,12 +2291,12 @@ bool Project::ExportPOVRay(const QString& FileName)
22912291
if (sscanf(Line,"%d%s%s", &Code, Name, Flags) != 3)
22922292
continue;
22932293

2294-
size_t ColorIdx = lcGetColorIndex(Code);
2295-
if (ColorIdx >= NumColors)
2294+
size_t ColorIndex = lcGetColorIndex(Code);
2295+
2296+
if (ColorIndex >= NumColors)
22962297
continue;
22972298

2298-
strncpy(LgeoColorTable[ColorIdx].data(), Name, LgeoColorTable[ColorIdx].size());
2299-
LgeoColorTable[ColorIdx][LgeoColorTable[ColorIdx].size() - 1] = 0;
2299+
LgeoColorTable[ColorIndex] = Name;
23002300
}
23012301
}
23022302

@@ -2308,7 +2308,7 @@ bool Project::ExportPOVRay(const QString& FileName)
23082308
{
23092309
lcColor* Color = &gColorList[ColorIdx];
23102310

2311-
if (!LgeoColorTable[ColorIdx][0])
2311+
if (LgeoColorTable[ColorIdx].empty())
23122312
{
23132313
sprintf(ColorTable[ColorIdx].data(), "lc_%s", Color->SafeName);
23142314

@@ -2339,7 +2339,7 @@ bool Project::ExportPOVRay(const QString& FileName)
23392339
sprintf(ColorTable[ColorIdx].data(), "LDXColor%i", Color->Code);
23402340

23412341
sprintf(Line,"#ifndef (LDXColor%i) // %s\n#declare LDXColor%i = material { texture { %s } }\n#end\n\n",
2342-
Color->Code, Color->Name, Color->Code, LgeoColorTable[ColorIdx].data());
2342+
Color->Code, Color->Name, Color->Code, LgeoColorTable[ColorIdx].c_str());
23432343
}
23442344

23452345
POVFile.WriteLine(Line);
@@ -2354,12 +2354,12 @@ bool Project::ExportPOVRay(const QString& FileName)
23542354

23552355
sprintf(ColorTable[ColorIdx].data(), "LDXColor%i", Color->Code);
23562356

2357-
if (!LgeoColorTable[ColorIdx][0])
2357+
if (LgeoColorTable[ColorIdx].empty())
23582358
sprintf(Line, "#ifndef (lc_%s)\n#declare lc_%s = OpaqueColor(%g, %g, %g)\n#end\n\n",
23592359
Color->SafeName, Color->SafeName, Color->Value[0], Color->Value[1], Color->Value[2]);
23602360
else
23612361
sprintf(Line,"#ifndef (LDXColor%i) // %s\n#declare LDXColor%i = material { texture { %s } }\n#end\n\n",
2362-
Color->Code, Color->Name, Color->Code, LgeoColorTable[ColorIdx].data());
2362+
Color->Code, Color->Name, Color->Code, LgeoColorTable[ColorIdx].c_str());
23632363

23642364
POVFile.WriteLine(Line);
23652365
}

qt/lc_qutils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class lcElidableToolButton : public QToolButton
134134
}
135135

136136
protected:
137-
void paintEvent(QPaintEvent*)
137+
void paintEvent(QPaintEvent*) override
138138
{
139139
QStylePainter Painter(this);
140140
QStyleOptionToolButton Option;

0 commit comments

Comments
 (0)