NOISSUE tabs -> spaces

This commit is contained in:
Petr Mrázek
2018-07-15 14:51:05 +02:00
parent 03280cc62e
commit bbb3b3e6f6
577 changed files with 51938 additions and 51938 deletions

View File

@@ -61,40 +61,40 @@
// internal helper. Converts an integer value to an unique string token
template <typename T> struct HexString
{
inline HexString(const T t) : val(t)
{
}
inline HexString(const T t) : val(t)
{
}
inline void write(QChar *&dest) const
{
const ushort hexChars[] = {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
const char *c = reinterpret_cast<const char *>(&val);
for (uint i = 0; i < sizeof(T); ++i)
{
*dest++ = hexChars[*c & 0xf];
*dest++ = hexChars[(*c & 0xf0) >> 4];
++c;
}
}
const T val;
inline void write(QChar *&dest) const
{
const ushort hexChars[] = {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
const char *c = reinterpret_cast<const char *>(&val);
for (uint i = 0; i < sizeof(T); ++i)
{
*dest++ = hexChars[*c & 0xf];
*dest++ = hexChars[(*c & 0xf0) >> 4];
++c;
}
}
const T val;
};
// specialization to enable fast concatenating of our string tokens to a string
template <typename T> struct QConcatenable<HexString<T>>
{
typedef HexString<T> type;
enum
{
ExactSize = true
};
static int size(const HexString<T> &)
{
return sizeof(T) * 2;
}
static inline void appendTo(const HexString<T> &str, QChar *&out)
{
str.write(out);
}
typedef QString ConvertTo;
typedef HexString<T> type;
enum
{
ExactSize = true
};
static int size(const HexString<T> &)
{
return sizeof(T) * 2;
}
static inline void appendTo(const HexString<T> &str, QChar *&out)
{
str.write(out);
}
typedef QString ConvertTo;
};