From 2c114f43c5cd4c9a717497ff77c9d42882a4d4fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sun, 16 Feb 2020 15:59:51 +0100 Subject: [PATCH] Code cleanup --- src/map/IMG/rgnfile.cpp | 10 +++++----- src/map/IMG/subfile.h | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/map/IMG/rgnfile.cpp b/src/map/IMG/rgnfile.cpp index ab38d832..58e15b3d 100644 --- a/src/map/IMG/rgnfile.cpp +++ b/src/map/IMG/rgnfile.cpp @@ -8,12 +8,12 @@ #include "rgnfile.h" -static quint64 pointId(qint32 x, qint32 y, quint32 type, quint32 labelPtr) +static quint64 pointId(const QPoint &pos, quint32 type, quint32 labelPtr) { quint64 id; - uint hash = qHash(QPair(qHash(QPair(x, y)), - labelPtr & 0x3FFFFF)); + uint hash = qHash(QPair(qHash(QPair(pos.x(), + pos.y())), labelPtr & 0x3FFFFF)); id = ((quint64)type)<<32 | hash; // Make country labels precedent over city labels if (!(type >= 0x1400 && type <= 0x153f)) @@ -342,7 +342,7 @@ bool RGNFile::pointObjects(Handle &hdl, const SubDiv *subdiv, point.type = (quint16)type<<8 | subtype; point.coordinates = Coordinates(toWGS24(pos.x()), toWGS24(pos.y())); - point.id = pointId(pos.x(), pos.y(), point.type, labelPtr & 0x3FFFFF); + point.id = pointId(pos, point.type, labelPtr & 0x3FFFFF); point.poi = labelPtr & 0x400000; if (lbl && (labelPtr & 0x3FFFFF)) point.label = lbl->label(lblHdl, labelPtr & 0x3FFFFF, point.poi, @@ -391,7 +391,7 @@ bool RGNFile::extPointObjects(Handle &hdl, const SubDiv *subdiv, LBLFile *lbl, continue; point.coordinates = Coordinates(toWGS24(pos.x()), toWGS24(pos.y())); - point.id = pointId(pos.x(), pos.y(), point.type, labelPtr & 0x3FFFFF); + point.id = pointId(pos, point.type, labelPtr & 0x3FFFFF); point.poi = labelPtr & 0x400000; if (lbl && (labelPtr & 0x3FFFFF)) point.label = lbl->label(lblHdl, labelPtr & 0x3FFFFF, point.poi); diff --git a/src/map/IMG/subfile.h b/src/map/IMG/subfile.h index a339d2d9..7886764a 100644 --- a/src/map/IMG/subfile.h +++ b/src/map/IMG/subfile.h @@ -2,7 +2,6 @@ #define SUBFILE_H #include -#include #include #include "img.h"