summaryrefslogtreecommitdiffstats
path: root/src/tools/qtextstream.cpp
diff options
context:
space:
mode:
authorFrancois Andriot <albator78@libertysurf.fr>2014-09-12 12:57:56 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-09-12 13:01:39 -0500
commitb716176cec88f5fa604b637a947b44b9ff165d5a (patch)
tree72177722906e1c4afc03bcc57b30cdbad5dd8f60 /src/tools/qtextstream.cpp
parente17513956503963f4d468342a5be6a0967aca97c (diff)
downloadqt3-b716176cec88f5fa604b637a947b44b9ff165d5a.tar.gz
qt3-b716176cec88f5fa604b637a947b44b9ff165d5a.zip
Fix qmake shared library naming
Add long long int support to TQTextStream Fix potential segmentation fault in QValueList Fix library naming in TQT Plugins This relates to Bug 2107
Diffstat (limited to 'src/tools/qtextstream.cpp')
-rw-r--r--src/tools/qtextstream.cpp31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/tools/qtextstream.cpp b/src/tools/qtextstream.cpp
index 63f9625..eb56eec 100644
--- a/src/tools/qtextstream.cpp
+++ b/src/tools/qtextstream.cpp
@@ -195,6 +195,7 @@
#define I_SHORT 0x0010
#define I_INT 0x0020
#define I_LONG 0x0030
+#define I_LONGLONG 0x0040
#define I_TYPE_MASK 0x00f0
#define I_BASE_2 QTS::bin
@@ -1862,7 +1863,7 @@ QTextStream &QTextStream::operator<<( char c )
return *this;
}
-QTextStream &QTextStream::output_int( int format, ulong n, bool neg )
+QTextStream &QTextStream::output_int( int format, unsigned long long n, bool neg )
{
static const char hexdigits_lower[] = "0123456789abcdef";
static const char hexdigits_upper[] = "0123456789ABCDEF";
@@ -1879,6 +1880,7 @@ QTextStream &QTextStream::output_int( int format, ulong n, bool neg )
case I_SHORT: len=16; break;
case I_INT: len=sizeof(int)*8; break;
case I_LONG: len=32; break;
+ case I_LONGLONG: len=64; break;
default: len = 0;
}
p = &buf[74]; // go reverse order
@@ -1925,7 +1927,7 @@ QTextStream &QTextStream::output_int( int format, ulong n, bool neg )
p = &buf[74];
*p = '\0';
if ( neg )
- n = (ulong)(-(long)n);
+ n = (unsigned long long)(-(long long)n);
do {
*--p = ((int)(n%10)) + '0';
n /= 10;
@@ -2041,6 +2043,31 @@ QTextStream &QTextStream::operator<<( unsigned long i )
return output_int( I_LONG | I_UNSIGNED, i, FALSE );
}
+/*!
+ \overload
+
+ Writes a \c long long \c int \a i to the stream and returns a reference
+ to the stream.
+*/
+
+QTextStream &QTextStream::operator<<( signed long long i )
+{
+ return output_int( I_LONGLONG | I_SIGNED, i, i < 0 );
+}
+
+
+/*!
+ \overload
+
+ Writes an \c unsigned \c long \c int \a i to the stream and
+ returns a reference to the stream.
+*/
+
+QTextStream &QTextStream::operator<<( unsigned long long i )
+{
+ return output_int( I_LONGLONG | I_UNSIGNED, i, FALSE );
+}
+
/*!
\overload