Skip to content

Commit

Permalink
constellations: fix reading long integers
Browse files Browse the repository at this point in the history
  • Loading branch information
10110111 committed Feb 3, 2025
1 parent 072df96 commit d8d76fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 1 addition & 5 deletions src/core/modules/Constellation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,7 @@ bool Constellation::read(const QJsonObject& data, StarMgr *starMgr, const bool p
// Can be "thin" or "bold", but we don't support these modifiers yet, so ignore this entry
continue;
}
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
const int HP = polyLine[i].toInteger();
#else
const int HP = polyLine[i].toInt(); // Won't support Gaia id unless it fits into 32 bits
#endif
const int HP = StelUtils::getLongLong(polyLine[i]);
if (HP <= 0)
{
qWarning().nospace() << "Error in constellation " << abbreviation << ": bad HIP " << HP;
Expand Down
6 changes: 3 additions & 3 deletions src/core/modules/ConstellationMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,9 @@ void ConstellationMgr::loadLinesNamesAndArt(const QJsonArray &constellationsData
const int y2 = xy2[1].toInt();
const int x3 = xy3[0].toInt();
const int y3 = xy3[1].toInt();
const int hp1 = anchor1["hip"].toInt();
const int hp2 = anchor2["hip"].toInt();
const int hp3 = anchor3["hip"].toInt();
const int hp1 = StelUtils::getLongLong(anchor1["hip"]);
const int hp2 = StelUtils::getLongLong(anchor2["hip"]);
const int hp3 = StelUtils::getLongLong(anchor3["hip"]);

const auto texfile = imgData["file"].toString();

Expand Down

0 comments on commit d8d76fe

Please sign in to comment.