From 3cbde93e1c5097dac54b0777d6cc8e90e54ac68e Mon Sep 17 00:00:00 2001 From: Dan Horák Date: Sep 13 2016 12:07:03 +0000 Subject: - update to 1.7.1 --- diff --git a/.gitignore b/.gitignore index d42e60e..93a9717 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /qmapshack-1.6.2.tar.gz /qmapshack-1.6.3.tar.gz /qmapshack-1.7.0.tar.gz +/qmapshack-1.7.1.tar.gz diff --git a/qmapshack-1.7.0-gcc4.patch b/qmapshack-1.7.0-gcc4.patch new file mode 100644 index 0000000..a51d04b --- /dev/null +++ b/qmapshack-1.7.0-gcc4.patch @@ -0,0 +1,717 @@ +commit 3c32b9273f4c87e40c494c2f9cf0001fc01432f7 +Author: kiozen +Date: Tue Sep 13 12:43:46 2016 +0200 + + Fix compile issues with GCC4 + +Notes (hg): + aa70ad6d89dcf884405aba14fa597166c208ced3 + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3f541c0..e6d37aa 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -25,7 +25,7 @@ set(APPLICATION_NAME qmapshack) + + set(APPLICATION_VERSION_MAJOR "1") + set(APPLICATION_VERSION_MINOR "7") +-set(APPLICATION_VERSION_PATCH "0") ++set(APPLICATION_VERSION_PATCH "1") + + add_definitions(-DVER_MAJOR=${APPLICATION_VERSION_MAJOR} -DVER_MINOR=${APPLICATION_VERSION_MINOR} -DVER_STEP=${APPLICATION_VERSION_PATCH} -DAPPLICATION_NAME=${PROJECT_NAME}) + +diff --git a/src/gis/prj/CDetailsPrj.cpp b/src/gis/prj/CDetailsPrj.cpp +index ffcabba..7f88f44 100644 +--- a/src/gis/prj/CDetailsPrj.cpp ++++ b/src/gis/prj/CDetailsPrj.cpp +@@ -373,7 +373,7 @@ void CDetailsPrj::drawInfo(QTextCursor& cursor, bool isReadOnly) + void CDetailsPrj::drawTrackSummary(QTextCursor& cursor, const QList trks, bool isReadOnly) + { + quint32 flags = 0; +- QMap summaries; ++ QMap summaries; + for(const CGisItemTrk* trk : trks) + { + const CActivityTrk& activities = trk->getActivities(); +diff --git a/src/gis/trk/CActivityTrk.cpp b/src/gis/trk/CActivityTrk.cpp +index 4859fee..1d0ce89 100644 +--- a/src/gis/trk/CActivityTrk.cpp ++++ b/src/gis/trk/CActivityTrk.cpp +@@ -132,7 +132,7 @@ void CActivityTrk::release() + cfg.endGroup(); // Activities + } + +-uint32_t CActivityTrk::selectActivity(QWidget *parent) ++quint32 CActivityTrk::selectActivity(QWidget *parent) + { + QMenu menu(parent); + +@@ -249,7 +249,7 @@ void CActivityTrk::printSummary(QString& str) const + printSummary(activitySummary, allFlags, str); + } + +-void CActivityTrk::printSummary(const QMap& summary, quint32 flags, QString& str) ++void CActivityTrk::printSummary(const QMap& summary, quint32 flags, QString& str) + { + QString val, unit; + +@@ -379,9 +379,9 @@ void CActivityTrk::printSummary(const QMap& summar + str += ""; + } + +-void CActivityTrk::sumUp(QMap &summary) const ++void CActivityTrk::sumUp(QMap &summary) const + { +- for(uint32_t flag : activitySummary.keys()) ++ for(quint32 flag : activitySummary.keys()) + { + const activity_summary_t &src = activitySummary[flag]; + activity_summary_t &dst = summary[flag]; +diff --git a/src/gis/trk/CActivityTrk.h b/src/gis/trk/CActivityTrk.h +index 6f5161b..a2675a6 100644 +--- a/src/gis/trk/CActivityTrk.h ++++ b/src/gis/trk/CActivityTrk.h +@@ -97,7 +97,7 @@ public: + + void getActivityNames(QStringList& names) const; + +- static uint32_t selectActivity(QWidget *parent); ++ static quint32 selectActivity(QWidget *parent); + + /** + @brief Convert internal summary to HTML table +@@ -110,14 +110,14 @@ public: + @param summary The array of summaries + @param str string to receive HTML + */ +- static void printSummary(const QMap &summary, quint32 flags, QString& str); ++ static void printSummary(const QMap &summary, quint32 flags, QString& str); + + + /** + @brief Add internal summary to given array of summaries + @param summary an array of summaries to hold the sum + */ +- void sumUp(QMap &summary) const; ++ void sumUp(QMap &summary) const; + + + const QList& getActivityRanges() const +@@ -143,7 +143,7 @@ private: + CGisItemTrk * trk; + quint32 allFlags; + QList activityRanges; +- QMap activitySummary; ++ QMap activitySummary; + }; + + #endif //CACTIVITYTRK_H +diff --git a/src/gis/trk/CDetailsTrk.cpp b/src/gis/trk/CDetailsTrk.cpp +index 7ea9302..f2cf0c9 100644 +--- a/src/gis/trk/CDetailsTrk.cpp ++++ b/src/gis/trk/CDetailsTrk.cpp +@@ -617,7 +617,7 @@ void CDetailsTrk::slotLinkActivated(const QUrl& url) + + void CDetailsTrk::slotSetActivities() + { +- uint32_t flags = CActivityTrk::selectActivity(this); ++ quint32 flags = CActivityTrk::selectActivity(this); + if(0 != flags) + { + trk.setActivity(flags); +diff --git a/src/gis/trk/CGisItemTrk.cpp b/src/gis/trk/CGisItemTrk.cpp +index 0eacddc..fd92b17 100644 +--- a/src/gis/trk/CGisItemTrk.cpp ++++ b/src/gis/trk/CGisItemTrk.cpp +@@ -2193,7 +2193,7 @@ void CGisItemTrk::setColor(int idx) + } + } + +-void CGisItemTrk::setActivity(uint32_t flag) ++void CGisItemTrk::setActivity(quint32 flag) + { + for(int s = 0; s < trk.segs.size(); s++) + { +@@ -2212,7 +2212,7 @@ void CGisItemTrk::setActivity(uint32_t flag) + changed(tr("Changed activity to '%1' for complete track.").arg(desc.name), desc.iconLarge); + } + +-void CGisItemTrk::setActivityRange(uint32_t flags) ++void CGisItemTrk::setActivityRange(quint32 flags) + { + if((mouseRange1 == nullptr) && (mouseRange2 == nullptr)) + { +diff --git a/src/gis/trk/CGisItemTrk.h b/src/gis/trk/CGisItemTrk.h +index de09dd3..f419d34 100644 +--- a/src/gis/trk/CGisItemTrk.h ++++ b/src/gis/trk/CGisItemTrk.h +@@ -452,7 +452,7 @@ public: + @brief Set the activity flag for all track points + @param flag one of trkpt_t::flag_e::eAct... + */ +- void setActivity(uint32_t flags); ++ void setActivity(quint32 flags); + + /** + @brief Sets the activity flag for a selected range of track points +@@ -460,7 +460,7 @@ public: + The range has to be selected already. The activity will be selected by a dialog displayed + in this method. + */ +- void setActivityRange(uint32_t flags); ++ void setActivityRange(quint32 flags); + + /** + @brief Copy a section into a new track object +diff --git a/src/helpers/Platform.h b/src/helpers/Platform.h +index 0194297..0fc2fbd 100644 +--- a/src/helpers/Platform.h ++++ b/src/helpers/Platform.h +@@ -51,23 +51,23 @@ + + Always use the macro + gar_endian(, ) +- where type may be int16_t, int32_t, int64_t, uint16_t, uint32_t, uint64_t, float or double. ++ where type may be int16_t, int32_t, int64_t, uint16_t, quint32, uint64_t, float or double. + The returned value will explicitly be cast'ed to . + + (b) the source is an unaligned 16, 32 or 64-bit value + + Always use the macro + gar_load(, ) +- where type may be int16_t, int32_t, int64_t, uint16_t, uint32_t, uint64_t, float or double. ++ where type may be int16_t, int32_t, int64_t, uint16_t, quint32, uint64_t, float or double. + The returned value will explicitly be cast'ed to . + + (c) the source is a pointer + + Always use the macro + gar_ptr_load(, ) +- where type may be int16_t, int32_t, int64_t, uint16_t, uint32_t, uint64_t, float or double ++ where type may be int16_t, int32_t, int64_t, uint16_t, quint32, uint64_t, float or double + or the special Garmin types int24_t or uint24_t. The returned value will be of type +- except for the Garmin types int24_t or uint24_t which will be int32_t or uint32_t, ++ except for the Garmin types int24_t or uint24_t which will be int32_t or quint32, + respectively, but have the uppermost 8 bits always set to 0. + + 2.2 Store data to Garmin +@@ -76,14 +76,14 @@ + + For unaligned variables, use the macro + gar_store(, , ) +- where type may be int16_t, int32_t, int64_t, uint16_t, uint32_t, uint64_t, float or double. ++ where type may be int16_t, int32_t, int64_t, uint16_t, quint32, uint64_t, float or double. + if the variable is aligned, use "destination = gar_endian(type, source)" which is faster. + + (b) the destination is a pointer + + For unaligned pointer destinations, use the macro + gar_ptr_store(, , ) +- where type may be int16_t, int32_t, int64_t, uint16_t, uint32_t, uint64_t, float or double ++ where type may be int16_t, int32_t, int64_t, uint16_t, quint32, uint64_t, float or double + or the special Garmin types int24_t or uint24_t. For a standard type and an aligned pointer + destination, use "*(type *)(ptr) = gar_endian(type, source)" which is faster. + +@@ -108,7 +108,7 @@ typedef __int32 int32_t; + typedef __int64 int64_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; +-typedef unsigned __int32 uint32_t; ++typedef unsigned __int32 quint32; + typedef unsigned __int64 uint64_t; + + #define qIsNaN(x) _isnan(x) +@@ -139,8 +139,8 @@ __gar_endian_uint16_t(uint16_t x) + } + + +-static inline uint32_t +-__gar_endian_uint32_t(uint32_t x) ++static inline quint32 ++__gar_endian_quint32(quint32 x) + { + return ((x & 0xff000000u) >> 24) | + ((x & 0x00ff0000u) >> 8) | +@@ -199,12 +199,12 @@ __gar_endian_float(float x) + { + union + { +- uint32_t _u; ++ quint32 _u; + float _f; + } _v; + + _v._f = x; +- _v._u = gar_endian(uint32_t, _v._u); ++ _v._u = gar_endian(quint32, _v._u); + return _v._f; + } + +@@ -246,12 +246,12 @@ __gar_endian_double(double x) + #define __gar_ptr_load_int32_t(p) (*((int32_t *)(p))) + #define __gar_ptr_load_int64_t(p) (*((int64_t *)(p))) + #define __gar_ptr_load_uint16_t(p) (*((uint16_t *)(p))) +-#define __gar_ptr_load_uint32_t(p) (*((uint32_t *)(p))) ++#define __gar_ptr_load_quint32(p) (*((quint32 *)(p))) + #define __gar_ptr_load_uint64_t(p) (*((uint64_t *)(p))) + #define __gar_ptr_load_float(p) (*((float *)(p))) + #define __gar_ptr_load_double(p) (*((double *)(p))) + // special Garmin types - map memory and clear extra bits +-#define __gar_ptr_load_uint24_t(p) (__gar_ptr_load_uint32_t(p) & 0x00FFFFFFu) ++#define __gar_ptr_load_uint24_t(p) (__gar_ptr_load_quint32(p) & 0x00FFFFFFu) + #define __gar_ptr_load_int24_t(p) (__gar_ptr_load_int32_t(p) & 0x00FFFFFFu) + + // store data to pointer - just assign after a proper cast +@@ -259,7 +259,7 @@ __gar_endian_double(double x) + #define __gar_ptr_store_int32_t(p, src) (*((int32_t *)(p))) = (src) + #define __gar_ptr_store_int64_t(p, src) (*((int64_t *)(p))) = (src) + #define __gar_ptr_store_uint16_t(p, src) (*((uint16_t *)(p))) = (src) +-#define __gar_ptr_store_uint32_t(p, src) (*((uint32_t *)(p))) = (src) ++#define __gar_ptr_store_quint32(p, src) (*((quint32 *)(p))) = (src) + #define __gar_ptr_store_uint64_t(p, src) (*((uint64_t *)(p))) = (src) + #define __gar_ptr_store_float(p, src) (*((float *)(p))) = (src) + #define __gar_ptr_store_double(p, src) (*((double *)(p))) = (src) +@@ -273,7 +273,7 @@ __gar_ptr_store_int24_t(uint8_t * p, int32_t src) + + + static inline void +-__gar_ptr_store_uint24_t(uint8_t * p, uint32_t src) ++__gar_ptr_store_uint24_t(uint8_t * p, quint32 src) + { + __gar_ptr_store_uint16_t(p, src & 0xffffu); + p[2] = src >> 16; +@@ -304,31 +304,31 @@ __gar_ptr_load_uint16_t(const uint8_t *p) + } + + +-static inline uint32_t ++static inline quint32 + __gar_ptr_load_uint24_t(const uint8_t *p) + { + #ifdef __powerpc__ +- register uint32_t temp; ++ register quint32 temp; + + asm __volatile__ ("lwbrx %0,0,%1" : "=r" (temp) : "b" (p), "m" (*p)); + asm __volatile__ ("rlwinm %0,%1,0,8,31" : "=r" (temp) : "r" (temp)); + return temp; + #else +- return (uint32_t)(p[0] | (p[1] << 8) | (p[2] << 16)); ++ return (quint32)(p[0] | (p[1] << 8) | (p[2] << 16)); + #endif + } + + +-static inline uint32_t +-__gar_ptr_load_uint32_t(const uint8_t *p) ++static inline quint32 ++__gar_ptr_load_quint32(const uint8_t *p) + { + #ifdef __powerpc__ +- register uint32_t temp; ++ register quint32 temp; + + asm __volatile__ ("lwbrx %0,0,%1" : "=r" (temp) : "b" (p), "m" (*p)); + return temp; + #else +- return (uint32_t)(p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24)); ++ return (quint32)(p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24)); + #endif + } + +@@ -336,8 +336,8 @@ __gar_ptr_load_uint32_t(const uint8_t *p) + static inline uint64_t + __gar_ptr_load_uint64_t(const uint8_t *p) + { +- return (uint64_t)__gar_ptr_load_uint32_t(p) | +- ((uint64_t)__gar_ptr_load_uint32_t(p + 4) << 32); ++ return (uint64_t)__gar_ptr_load_quint32(p) | ++ ((uint64_t)__gar_ptr_load_quint32(p + 4) << 32); + } + + +@@ -387,7 +387,7 @@ __gar_ptr_load_int32_t(const uint8_t *p) + static inline int64_t + __gar_ptr_load_int64_t(const uint8_t *p) + { +- return (int64_t)__gar_ptr_load_uint32_t(p) | ++ return (int64_t)__gar_ptr_load_quint32(p) | + ((int64_t)__gar_ptr_load_int32_t(p + 4) << 32); + } + +@@ -397,11 +397,11 @@ __gar_ptr_load_float(const uint8_t * p) + { + union + { +- uint32_t _u; ++ quint32 _u; + float _f; + } _v; + +- _v._u = gar_ptr_load(uint32_t, p); ++ _v._u = gar_ptr_load(quint32, p); + return _v._f; + } + +@@ -430,7 +430,7 @@ __gar_ptr_store_uint16_t(uint8_t *p, uint16_t src) + + + static inline void +-__gar_ptr_store_uint24_t(uint8_t *p, uint32_t src) ++__gar_ptr_store_uint24_t(uint8_t *p, quint32 src) + { + p[0] = src & 0xffu; + p[1] = (src >> 8) & 0xffu; +@@ -439,7 +439,7 @@ __gar_ptr_store_uint24_t(uint8_t *p, uint32_t src) + + + static inline void +-__gar_ptr_store_uint32_t(uint8_t *p, uint32_t src) ++__gar_ptr_store_quint32(uint8_t *p, quint32 src) + { + p[0] = src & 0xffu; + p[1] = (src >> 8) & 0xffu; +@@ -451,14 +451,14 @@ __gar_ptr_store_uint32_t(uint8_t *p, uint32_t src) + static inline void + __gar_ptr_store_uint64_t(uint8_t *p, uint64_t src) + { +- __gar_ptr_store_uint32_t(p, src & 0xffffffffu); +- __gar_ptr_store_uint32_t(p + 4, src >> 32); ++ __gar_ptr_store_quint32(p, src & 0xffffffffu); ++ __gar_ptr_store_quint32(p + 4, src >> 32); + } + + + #define __gar_ptr_store_int16_t(p, src) __gar_ptr_store_uint16_t(p, (uint16_t)src) +-#define __gar_ptr_store_int24_t(p, src) __gar_ptr_store_uint24_t(p, (uint32_t)src) +-#define __gar_ptr_store_int32_t(p, src) __gar_ptr_store_uint32_t(p, (uint32_t)src) ++#define __gar_ptr_store_int24_t(p, src) __gar_ptr_store_uint24_t(p, (quint32)src) ++#define __gar_ptr_store_int32_t(p, src) __gar_ptr_store_quint32(p, (quint32)src) + #define __gar_ptr_store_int64_t(p, src) __gar_ptr_store_uint64_t(p, (uint64_t)src) + + static inline void +diff --git a/src/map/CMapIMG.cpp b/src/map/CMapIMG.cpp +index ae2f0e3..214a5b3 100644 +--- a/src/map/CMapIMG.cpp ++++ b/src/map/CMapIMG.cpp +@@ -563,7 +563,7 @@ void CMapIMG::readBasics() + memcpy(tmpstr,pFATBlock->name,sizeof(pFATBlock->name) + sizeof(pFATBlock->type)); + tmpstr[sizeof(pFATBlock->name) + sizeof(pFATBlock->type)] = 0; + +- if(gar_load(uint32_t, pFATBlock->size) != 0 && !subfileNames.contains(tmpstr) && tmpstr[0] != 0x20) ++ if(gar_load(quint32, pFATBlock->size) != 0 && !subfileNames.contains(tmpstr) && tmpstr[0] != 0x20) + { + subfileNames << tmpstr; + +@@ -580,7 +580,7 @@ void CMapIMG::readBasics() + tmpstr[sizeof(pFATBlock->type)] = 0; + + subfile_part_t& part = subfile.parts[tmpstr]; +- part.size = gar_load(uint32_t, pFATBlock->size); ++ part.size = gar_load(quint32, pFATBlock->size); + part.offset = quint32(gar_load(uint16_t, pFATBlock->blocks[0]) * blocksize); + } + } +@@ -596,15 +596,15 @@ void CMapIMG::readBasics() + } + + // gmapsupp.img files do not have a data offset field +- if(gar_load(uint32_t, pImgHdr->dataoffset) == 0) ++ if(gar_load(quint32, pImgHdr->dataoffset) == 0) + { +- pImgHdr->dataoffset = gar_load(uint32_t, dataoffset); ++ pImgHdr->dataoffset = gar_load(quint32, dataoffset); + } + + // sometimes there are dummy blocks at the end of the FAT +- if(gar_load(uint32_t, pImgHdr->dataoffset) != dataoffset) ++ if(gar_load(quint32, pImgHdr->dataoffset) != dataoffset) + { +- dataoffset = gar_load(uint32_t, pImgHdr->dataoffset); ++ dataoffset = gar_load(quint32, pImgHdr->dataoffset); + } + + #ifdef DEBUG_SHOW_SECT_DESC +@@ -676,10 +676,10 @@ void CMapIMG::readSubfileBasics(subfile_desc_t& subfile, CFileExt &file) + #ifdef DEBUG_SHOW_TRE_DATA + qDebug() << "+++" << subfile.name << "+++"; + qDebug() << "TRE header length :" << gar_load(uint16_t, pTreHdr->length); +- qDebug() << "TRE1 offset :" << hex << gar_load(uint32_t, pTreHdr->tre1_offset); +- qDebug() << "TRE1 size :" << dec << gar_load(uint32_t, pTreHdr->tre1_size); +- qDebug() << "TRE2 offset :" << hex << gar_load(uint32_t, pTreHdr->tre2_offset); +- qDebug() << "TRE2 size :" << dec << gar_load(uint32_t, pTreHdr->tre2_size); ++ qDebug() << "TRE1 offset :" << hex << gar_load(quint32, pTreHdr->tre1_offset); ++ qDebug() << "TRE1 size :" << dec << gar_load(quint32, pTreHdr->tre1_size); ++ qDebug() << "TRE2 offset :" << hex << gar_load(quint32, pTreHdr->tre2_offset); ++ qDebug() << "TRE2 size :" << dec << gar_load(quint32, pTreHdr->tre2_size); + #endif // DEBUG_SHOW_TRE_DATA + + copyrights << QString(file.data(subfile.parts["TRE"].offset + gar_load(uint16_t, pTreHdr->length),0x7FFF)); +@@ -722,7 +722,7 @@ void CMapIMG::readSubfileBasics(subfile_desc_t& subfile, CFileExt &file) + #endif // DEBUG_SHOW_TRE_DATA + + QByteArray maplevel; +- readFile(file, subfile.parts["TRE"].offset + gar_load(uint32_t, pTreHdr->tre1_offset), gar_load(uint32_t, pTreHdr->tre1_size), maplevel); ++ readFile(file, subfile.parts["TRE"].offset + gar_load(quint32, pTreHdr->tre1_offset), gar_load(quint32, pTreHdr->tre1_size), maplevel); + const tre_map_level_t * pMapLevel = (const tre_map_level_t * )maplevel.data(); + + if(pTreHdr->flag & 0x80) +@@ -732,7 +732,7 @@ void CMapIMG::readSubfileBasics(subfile_desc_t& subfile, CFileExt &file) + "the one supplied by Garmin.")); + } + +- quint32 nlevels = gar_load(uint32_t, pTreHdr->tre1_size) / sizeof(tre_map_level_t); ++ quint32 nlevels = gar_load(quint32, pTreHdr->tre1_size) / sizeof(tre_map_level_t); + quint32 nsubdivs = 0; + quint32 nsubdivs_last = 0; + +@@ -765,7 +765,7 @@ void CMapIMG::readSubfileBasics(subfile_desc_t& subfile, CFileExt &file) + + // point to first 16 byte subdivision definition entry + QByteArray subdiv_n; +- readFile(file, subfile.parts["TRE"].offset + gar_load(uint32_t, pTreHdr->tre2_offset), gar_load(uint32_t, pTreHdr->tre2_size), subdiv_n); ++ readFile(file, subfile.parts["TRE"].offset + gar_load(quint32, pTreHdr->tre2_offset), gar_load(quint32, pTreHdr->tre2_size), subdiv_n); + tre_subdiv_next_t * pSubDivN = (tre_subdiv_next_t*)subdiv_n.data(); + + QVector subdivs; +@@ -777,15 +777,15 @@ void CMapIMG::readSubfileBasics(subfile_desc_t& subfile, CFileExt &file) + QByteArray rgnhdr; + readFile(file, subfile.parts["RGN"].offset, sizeof(hdr_rgn_t), rgnhdr); + hdr_rgn_t * pRgnHdr = (hdr_rgn_t*)rgnhdr.data(); +- quint32 rgnoff = /*subfile.parts["RGN"].offset +*/ gar_load(uint32_t, pRgnHdr->offset); ++ quint32 rgnoff = /*subfile.parts["RGN"].offset +*/ gar_load(quint32, pRgnHdr->offset); + +- quint32 rgnOffPolyg2 = /*subfile.parts["RGN"].offset +*/ gar_load(uint32_t, pRgnHdr->offset_polyg2); +- quint32 rgnOffPolyl2 = /*subfile.parts["RGN"].offset +*/ gar_load(uint32_t, pRgnHdr->offset_polyl2); +- quint32 rgnOffPoint2 = /*subfile.parts["RGN"].offset +*/ gar_load(uint32_t, pRgnHdr->offset_point2); ++ quint32 rgnOffPolyg2 = /*subfile.parts["RGN"].offset +*/ gar_load(quint32, pRgnHdr->offset_polyg2); ++ quint32 rgnOffPolyl2 = /*subfile.parts["RGN"].offset +*/ gar_load(quint32, pRgnHdr->offset_polyl2); ++ quint32 rgnOffPoint2 = /*subfile.parts["RGN"].offset +*/ gar_load(quint32, pRgnHdr->offset_point2); + +- quint32 rgnLenPolyg2 = /*subfile.parts["RGN"].offset +*/ gar_load(uint32_t, pRgnHdr->length_polyg2); +- quint32 rgnLenPolyl2 = /*subfile.parts["RGN"].offset +*/ gar_load(uint32_t, pRgnHdr->length_polyl2); +- quint32 rgnLenPoint2 = /*subfile.parts["RGN"].offset +*/ gar_load(uint32_t, pRgnHdr->length_point2); ++ quint32 rgnLenPolyg2 = /*subfile.parts["RGN"].offset +*/ gar_load(quint32, pRgnHdr->length_polyg2); ++ quint32 rgnLenPolyl2 = /*subfile.parts["RGN"].offset +*/ gar_load(quint32, pRgnHdr->length_polyl2); ++ quint32 rgnLenPoint2 = /*subfile.parts["RGN"].offset +*/ gar_load(quint32, pRgnHdr->length_point2); + + // qDebug() << "***" << hex << subfile.parts["RGN"].offset << (subfile.parts["RGN"].offset + subfile.parts["RGN"].size); + // qDebug() << "+++" << hex << rgnOffPolyg2 << (rgnOffPolyg2 + rgnLenPolyg2); +@@ -894,7 +894,7 @@ void CMapIMG::readSubfileBasics(subfile_desc_t& subfile, CFileExt &file) + ++pSubDivL; + ++subdiv; + } +- subdivs.last().rgn_end = gar_load(uint32_t, pRgnHdr->hdr_rgn_t::offset) + gar_load(uint32_t, pRgnHdr->hdr_rgn_t::length); ++ subdivs.last().rgn_end = gar_load(quint32, pRgnHdr->hdr_rgn_t::offset) + gar_load(quint32, pRgnHdr->hdr_rgn_t::length); + + // read extended NT elements + if((gar_load(uint16_t, pTreHdr->hdr_subfile_part_t::length) >= 0x9A) && pTreHdr->tre7_size && (gar_load(uint16_t, pTreHdr->tre7_rec_size) >= sizeof(tre_subdiv2_t))) +@@ -902,10 +902,10 @@ void CMapIMG::readSubfileBasics(subfile_desc_t& subfile, CFileExt &file) + //rgnoff = subfile.parts["RGN"].offset; + // qDebug() << subdivs.count() << (pTreHdr->tre7_size / pTreHdr->tre7_rec_size) << pTreHdr->tre7_rec_size; + QByteArray subdiv2; +- readFile(file, subfile.parts["TRE"].offset + gar_load(uint32_t, pTreHdr->tre7_offset), gar_load(uint32_t, pTreHdr->tre7_size), subdiv2); ++ readFile(file, subfile.parts["TRE"].offset + gar_load(quint32, pTreHdr->tre7_offset), gar_load(quint32, pTreHdr->tre7_size), subdiv2); + tre_subdiv2_t * pSubDiv2 = (tre_subdiv2_t*)subdiv2.data(); + +- // const quint32 entries1 = gar_load(uint32_t, pTreHdr->tre7_size) / gar_load(uint32_t, pTreHdr->tre7_rec_size); ++ // const quint32 entries1 = gar_load(quint32, pTreHdr->tre7_size) / gar_load(quint32, pTreHdr->tre7_rec_size); + // const quint32 entries2 = subdivs.size(); + + bool skipPois = ( gar_load(uint16_t, pTreHdr->tre7_rec_size) != sizeof(tre_subdiv2_t) ); +@@ -918,9 +918,9 @@ void CMapIMG::readSubfileBasics(subfile_desc_t& subfile, CFileExt &file) + + subdiv = subdivs.begin(); + subdiv_prev = subdivs.begin(); +- subdiv->offsetPolygons2 = gar_load(uint32_t, pSubDiv2->offsetPolygons) + rgnOffPolyg2; +- subdiv->offsetPolylines2 = gar_load(uint32_t, pSubDiv2->offsetPolyline) + rgnOffPolyl2; +- subdiv->offsetPoints2 = skipPois ? 0 : gar_load(uint32_t, pSubDiv2->offsetPoints) + rgnOffPoint2; ++ subdiv->offsetPolygons2 = gar_load(quint32, pSubDiv2->offsetPolygons) + rgnOffPolyg2; ++ subdiv->offsetPolylines2 = gar_load(quint32, pSubDiv2->offsetPolyline) + rgnOffPolyl2; ++ subdiv->offsetPoints2 = skipPois ? 0 : gar_load(quint32, pSubDiv2->offsetPoints) + rgnOffPoint2; + + ++subdiv; + pSubDiv2 = reinterpret_cast((quint8*)pSubDiv2 + gar_endian(uint16_t, pTreHdr->tre7_rec_size)); +@@ -933,9 +933,9 @@ void CMapIMG::readSubfileBasics(subfile_desc_t& subfile, CFileExt &file) + // } + // fprintf(stderr,"\n"); + +- subdiv->offsetPolygons2 = gar_load(uint32_t, pSubDiv2->offsetPolygons) + rgnOffPolyg2; +- subdiv->offsetPolylines2 = gar_load(uint32_t, pSubDiv2->offsetPolyline) + rgnOffPolyl2; +- subdiv->offsetPoints2 = skipPois ? 0 : gar_load(uint32_t, pSubDiv2->offsetPoints) + rgnOffPoint2; ++ subdiv->offsetPolygons2 = gar_load(quint32, pSubDiv2->offsetPolygons) + rgnOffPolyg2; ++ subdiv->offsetPolylines2 = gar_load(quint32, pSubDiv2->offsetPolyline) + rgnOffPolyl2; ++ subdiv->offsetPoints2 = skipPois ? 0 : gar_load(quint32, pSubDiv2->offsetPoints) + rgnOffPoint2; + + subdiv_prev->lengthPolygons2 = subdiv->offsetPolygons2 - subdiv_prev->offsetPolygons2; + subdiv_prev->lengthPolylines2 = subdiv->offsetPolylines2 - subdiv_prev->offsetPolylines2; +@@ -994,8 +994,8 @@ void CMapIMG::readSubfileBasics(subfile_desc_t& subfile, CFileExt &file) + readFile(file, subfile.parts["LBL"].offset, sizeof(hdr_lbl_t), lblhdr); + hdr_lbl_t * pLblHdr = (hdr_lbl_t*)lblhdr.data(); + +- quint32 offsetLbl1 = subfile.parts["LBL"].offset + gar_load(uint32_t, pLblHdr->lbl1_offset); +- quint32 offsetLbl6 = subfile.parts["LBL"].offset + gar_load(uint32_t, pLblHdr->lbl6_offset); ++ quint32 offsetLbl1 = subfile.parts["LBL"].offset + gar_load(quint32, pLblHdr->lbl1_offset); ++ quint32 offsetLbl6 = subfile.parts["LBL"].offset + gar_load(quint32, pLblHdr->lbl6_offset); + + QByteArray nethdr; + quint32 offsetNet1 = 0; +@@ -1004,7 +1004,7 @@ void CMapIMG::readSubfileBasics(subfile_desc_t& subfile, CFileExt &file) + { + readFile(file, subfile.parts["NET"].offset, sizeof(hdr_net_t), nethdr); + pNetHdr = (hdr_net_t*)nethdr.data(); +- offsetNet1 = subfile.parts["NET"].offset + gar_load(uint32_t, pNetHdr->net1_offset); ++ offsetNet1 = subfile.parts["NET"].offset + gar_load(quint32, pNetHdr->net1_offset); + } + + quint16 codepage = 0; +@@ -1035,11 +1035,11 @@ void CMapIMG::readSubfileBasics(subfile_desc_t& subfile, CFileExt &file) + + if(nullptr != subfile.strtbl) + { +- subfile.strtbl->registerLBL1(offsetLbl1, gar_load(uint32_t, pLblHdr->lbl1_length), pLblHdr->addr_shift); +- subfile.strtbl->registerLBL6(offsetLbl6, gar_load(uint32_t, pLblHdr->lbl6_length)); ++ subfile.strtbl->registerLBL1(offsetLbl1, gar_load(quint32, pLblHdr->lbl1_length), pLblHdr->addr_shift); ++ subfile.strtbl->registerLBL6(offsetLbl6, gar_load(quint32, pLblHdr->lbl6_length)); + if(nullptr != pNetHdr) + { +- subfile.strtbl->registerNET1(offsetNet1, gar_load(uint32_t, pNetHdr->net1_length), pNetHdr->net1_addr_shift); ++ subfile.strtbl->registerNET1(offsetNet1, gar_load(quint32, pNetHdr->net1_length), pNetHdr->net1_addr_shift); + } + } + } +diff --git a/src/map/CMapJNX.cpp b/src/map/CMapJNX.cpp +index 27bf463..716af20 100644 +--- a/src/map/CMapJNX.cpp ++++ b/src/map/CMapJNX.cpp +@@ -72,7 +72,7 @@ static quint32 scale2jnx(qreal scale) + table is built. It is (76437 / 4777) ^ (1/4). + */ + +- return (uint32_t)qFloor(0.5 + 76437 * exp(log(2.000032708011) * qFloor(0.5 + log(scale * 10 * 130.2084 / 76437) / log(2.000032708011) ) ) ); ++ return (quint32)qFloor(0.5 + 76437 * exp(log(2.000032708011) * qFloor(0.5 + log(scale * 10 * 130.2084 / 76437) / log(2.000032708011) ) ) ); + } + + +diff --git a/src/map/garmin/IGarminStrTbl.cpp b/src/map/garmin/IGarminStrTbl.cpp +index 229f8e3..8c3cdab 100644 +--- a/src/map/garmin/IGarminStrTbl.cpp ++++ b/src/map/garmin/IGarminStrTbl.cpp +@@ -120,8 +120,8 @@ quint32 IGarminStrTbl::calcOffset(CFileExt& file, const quint32 offset, type_e t + if(t == poi) + { + QByteArray buffer; +- readFile(file, offsetLBL6 + offset, sizeof(uint32_t), buffer); +- newOffset = gar_ptr_load(uint32_t, buffer.data()); ++ readFile(file, offsetLBL6 + offset, sizeof(quint32), buffer); ++ newOffset = gar_ptr_load(quint32, buffer.data()); + newOffset = (newOffset & 0x003FFFFF); + } + else if(t == net) +@@ -132,8 +132,8 @@ quint32 IGarminStrTbl::calcOffset(CFileExt& file, const quint32 offset, type_e t + } + + QByteArray data; +- readFile(file, offsetNET1 + (offset << addrshift2), sizeof(uint32_t), data); +- newOffset = gar_ptr_load(uint32_t, data.data()); ++ readFile(file, offsetNET1 + (offset << addrshift2), sizeof(quint32), data); ++ newOffset = gar_ptr_load(quint32, data.data()); + if(newOffset & 0x00400000) + { + return 0xFFFFFFFF; +diff --git a/src/mouse/CMouseRangeTrk.cpp b/src/mouse/CMouseRangeTrk.cpp +index e386558..a36d293 100644 +--- a/src/mouse/CMouseRangeTrk.cpp ++++ b/src/mouse/CMouseRangeTrk.cpp +@@ -122,7 +122,7 @@ void CMouseRangeTrk::mousePressEvent(QMouseEvent * e) + scrOptRange = new CScrOptRangeTrk(pt, trk, this); + connect(scrOptRange->toolHidePoints, &QToolButton::clicked, this, &CMouseRangeTrk::slotHidePoints); + connect(scrOptRange->toolShowPoints, &QToolButton::clicked, this, &CMouseRangeTrk::slotShowPoints); +- connect(scrOptRange, &CScrOptRangeTrk::activitySelected, this, &CMouseRangeTrk::slotActivity); ++ connect(scrOptRange.data(), &CScrOptRangeTrk::activitySelected, this, &CMouseRangeTrk::slotActivity); + connect(scrOptRange->toolCopy, &QToolButton::clicked, this, &CMouseRangeTrk::slotCopy); + + state = eStateRangeSelected; +@@ -265,7 +265,7 @@ void CMouseRangeTrk::slotShowPoints() + canvas->resetMouse(); + } + +-void CMouseRangeTrk::slotActivity(uint32_t flags) ++void CMouseRangeTrk::slotActivity(quint32 flags) + { + QMutexLocker lock(&IGisItem::mutexItems); + +diff --git a/src/mouse/CMouseRangeTrk.h b/src/mouse/CMouseRangeTrk.h +index f8b81ab..bf3a0cf 100644 +--- a/src/mouse/CMouseRangeTrk.h ++++ b/src/mouse/CMouseRangeTrk.h +@@ -45,7 +45,7 @@ public: + private slots: + void slotHidePoints(); + void slotShowPoints(); +- void slotActivity(uint32_t flags); ++ void slotActivity(quint32 flags); + void slotCopy(); + + private: +diff --git a/src/mouse/CScrOptRangeTrk.cpp b/src/mouse/CScrOptRangeTrk.cpp +index 8385562..3dc82f4 100644 +--- a/src/mouse/CScrOptRangeTrk.cpp ++++ b/src/mouse/CScrOptRangeTrk.cpp +@@ -62,7 +62,7 @@ void CScrOptRangeTrk::draw(QPainter& p) + + void CScrOptRangeTrk::selectActivity() + { +- uint32_t flags = CActivityTrk::selectActivity(this); ++ quint32 flags = CActivityTrk::selectActivity(this); + if(0 != flags) + { + emit activitySelected(flags); +diff --git a/src/mouse/CScrOptRangeTrk.h b/src/mouse/CScrOptRangeTrk.h +index 9463fcb..601f72c 100644 +--- a/src/mouse/CScrOptRangeTrk.h ++++ b/src/mouse/CScrOptRangeTrk.h +@@ -35,7 +35,7 @@ public: + void draw(QPainter& p) override; + + signals: +- void activitySelected(uint32_t flag); ++ void activitySelected(quint32 flag); + + private: + void selectActivity(); +diff --git a/src/plot/IPlot.cpp b/src/plot/IPlot.cpp +index 266c885..e586d4b 100644 +--- a/src/plot/IPlot.cpp ++++ b/src/plot/IPlot.cpp +@@ -421,7 +421,7 @@ void IPlot::mousePressEvent(QMouseEvent * e) + connect(scrOptRange->toolShowPoints, &QToolButton::clicked, this, &IPlot::slotShowPoints); + connect(scrOptRange->toolCopy, &QToolButton::clicked, this, &IPlot::slotCopy); + +- connect(scrOptRange, &CScrOptRangeTrk::activitySelected, this, &IPlot::slotActivity); ++ connect(scrOptRange.data(), &CScrOptRangeTrk::activitySelected, this, &IPlot::slotActivity); + + /* Adjust position of screen option widget if the widget is out of the visible area*/ + QRect r1 = scrOptRange->geometry(); +@@ -1281,7 +1281,7 @@ void IPlot::slotShowPoints() + slotStopRange(); + } + +-void IPlot::slotActivity(uint32_t flags) ++void IPlot::slotActivity(quint32 flags) + { + trk->setActivityRange(flags); + slotStopRange(); +diff --git a/src/plot/IPlot.h b/src/plot/IPlot.h +index f65e349..2bdc6ed 100644 +--- a/src/plot/IPlot.h ++++ b/src/plot/IPlot.h +@@ -65,7 +65,7 @@ private slots: + void slotSave(); + void slotHidePoints(); + void slotShowPoints(); +- void slotActivity(uint32_t flags); ++ void slotActivity(quint32 flags); + void slotCopy(); + void slotStopRange(); + void slotResetZoom(); diff --git a/qmapshack.spec b/qmapshack.spec index c477154..7e8ea3e 100644 --- a/qmapshack.spec +++ b/qmapshack.spec @@ -1,5 +1,5 @@ Name: qmapshack -Version: 1.7.0 +Version: 1.7.1 Release: 1%{?dist} Summary: GPS mapping and management tool @@ -82,6 +82,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop %changelog +* Tue Sep 13 2016 Dan Horák - 1.7.1-1 +- update to 1.7.1 + * Tue Sep 13 2016 Dan Horák - 1.7.0-1 - update to 1.7.0 diff --git a/sources b/sources index 06ec912..64e878d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -dbcd93b15e592ae2cd6f965e67d2d12b qmapshack-1.7.0.tar.gz +1265a4c009fa2fe9cd286b232a8277da qmapshack-1.7.1.tar.gz