1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-02-17 16:20:48 +01:00

Added missing namespace

This commit is contained in:
Martin Tůma 2021-09-20 21:43:17 +02:00
parent f5078074cf
commit e47cbc9af3
10 changed files with 38 additions and 27 deletions

View File

@ -5,37 +5,40 @@
#define LS(val, bits) ((qint32)(((quint32)(val))<<(bits))) #define LS(val, bits) ((qint32)(((quint32)(val))<<(bits)))
inline double toWGS32(qint32 v) namespace Garmin
{ {
return ((double)v / (double)(1U<<31)) * 180.0; inline double toWGS32(qint32 v)
} {
return ((double)v / (double)(1U<<31)) * 180.0;
}
inline double toWGS24(qint32 v) inline double toWGS24(qint32 v)
{ {
return toWGS32(LS(v, 8)); return toWGS32(LS(v, 8));
} }
inline quint8 vs(const quint8 b0) inline quint8 vs(const quint8 b0)
{ {
static const quint8 sizes[] = {4, 1, 2, 1, 3, 1, 2, 1}; static const quint8 sizes[] = {4, 1, 2, 1, 3, 1, 2, 1};
return sizes[b0 & 0x07]; return sizes[b0 & 0x07];
} }
inline quint8 bs(const quint8 val) inline quint8 bs(const quint8 val)
{ {
return (val + 7) >> 3; return (val + 7) >> 3;
} }
inline quint8 byteSize(quint32 val) inline quint8 byteSize(quint32 val)
{ {
quint8 ret = 0; quint8 ret = 0;
do { do {
ret++; ret++;
val = val >> 8; val = val >> 8;
} while (val != 0); } while (val != 0);
return ret; return ret;
}
} }
#endif // GARMIN_H #endif // GARMIN_H

View File

@ -13,6 +13,7 @@
#include "address.h" #include "address.h"
#include "gpiparser.h" #include "gpiparser.h"
using namespace Garmin;
struct RecordHeader { struct RecordHeader {
quint16 type; quint16 type;

View File

@ -1,7 +1,7 @@
#include "common/garmin.h" #include "common/garmin.h"
#include "huffmantable.h" #include "huffmantable.h"
using namespace Garmin;
using namespace IMG; using namespace IMG;
static inline quint32 readVUint32(const quint8 *buffer, quint32 bytes) static inline quint32 readVUint32(const quint8 *buffer, quint32 bytes)

View File

@ -2,6 +2,7 @@
#include "subfile.h" #include "subfile.h"
#include "huffmantext.h" #include "huffmantext.h"
using namespace Garmin;
using namespace IMG; using namespace IMG;
static inline quint32 readVUint32(const quint8 *buffer, quint32 bytes) static inline quint32 readVUint32(const quint8 *buffer, quint32 bytes)

View File

@ -2,6 +2,7 @@
#include "rgnfile.h" #include "rgnfile.h"
#include "lblfile.h" #include "lblfile.h"
using namespace Garmin;
using namespace IMG; using namespace IMG;
enum Charset {Normal, Symbol, Special}; enum Charset {Normal, Symbol, Special};

View File

@ -6,6 +6,7 @@
#include "rgnfile.h" #include "rgnfile.h"
#include "netfile.h" #include "netfile.h"
using namespace Garmin;
using namespace IMG; using namespace IMG;
static bool readAdjCounts(BitStream4R &bs, QVector<quint16> &cnts, quint16 &mask) static bool readAdjCounts(BitStream4R &bs, QVector<quint16> &cnts, quint16 &mask)

View File

@ -1,6 +1,7 @@
#include "bitstream.h" #include "bitstream.h"
#include "nodfile.h" #include "nodfile.h"
using namespace Garmin;
using namespace IMG; using namespace IMG;
#define ARRAY_SIZE(array) \ #define ARRAY_SIZE(array) \

View File

@ -20,8 +20,9 @@ public:
quint32 id() const {return _id;} quint32 id() const {return _id;}
const RectC rect() const const RectC rect() const
{ {
return RectC(Coordinates(toWGS32(_rect.left()), toWGS32(_rect.top())), return RectC(Coordinates(Garmin::toWGS32(_rect.left()),
Coordinates(toWGS32(_rect.right()), toWGS32(_rect.bottom()))); Garmin::toWGS32(_rect.top())), Coordinates(
Garmin::toWGS32(_rect.right()), Garmin::toWGS32(_rect.bottom())));
} }
bool isValid() const {return (_lbl != 0);} bool isValid() const {return (_lbl != 0);}

View File

@ -8,6 +8,7 @@
#include "nodfile.h" #include "nodfile.h"
#include "rgnfile.h" #include "rgnfile.h"
using namespace Garmin;
using namespace IMG; using namespace IMG;
#define MASK(bits) ((1U << (bits)) - 1U) #define MASK(bits) ((1U << (bits)) - 1U)

View File

@ -2,6 +2,7 @@
#include "subdiv.h" #include "subdiv.h"
#include "trefile.h" #include "trefile.h"
using namespace Garmin;
using namespace IMG; using namespace IMG;
static inline double RB(qint32 val) static inline double RB(qint32 val)