diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-12-04 09:03:25 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-12-04 09:03:25 -0600 |
commit | e0b1bfb0140e1d484f71683e820731abdd0779d5 (patch) | |
tree | cf49f872577733fabde2d5b38c8c045e78dee9eb /tdecore/network/tdesocketbuffer.cpp | |
parent | d80ccaf94ce31d24834bf3051fb9438adf23e4fd (diff) | |
download | tdelibs-e0b1bfb0140e1d484f71683e820731abdd0779d5.tar.gz tdelibs-e0b1bfb0140e1d484f71683e820731abdd0779d5.zip |
Fix a number of build warnings
Diffstat (limited to 'tdecore/network/tdesocketbuffer.cpp')
-rw-r--r-- | tdecore/network/tdesocketbuffer.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tdecore/network/tdesocketbuffer.cpp b/tdecore/network/tdesocketbuffer.cpp index 33b8fe776..13c7c0447 100644 --- a/tdecore/network/tdesocketbuffer.cpp +++ b/tdecore/network/tdesocketbuffer.cpp @@ -183,7 +183,7 @@ TQ_LONG TDESocketBuffer::consumeBuffer(char *destbuffer, TQ_LONG maxlen, bool di { // calculate how much we'll copy size_t to_copy = (*it).size() - offset; - if (to_copy > maxlen) + if (to_copy > (size_t)maxlen) to_copy = maxlen; // do the copying @@ -234,12 +234,12 @@ TQ_LONG TDESocketBuffer::sendTo(KActiveSocketBase* dev, TQ_LONG len) return 0; TQMutexLocker locker(&m_mutex); - + TQValueListIterator<TQByteArray> it = m_list.begin(), end = m_list.end(); TQIODevice::Offset offset = m_offset; TQ_LONG written = 0; - + // walk the buffer while (it != end && (len || len == -1)) { @@ -249,8 +249,9 @@ TQ_LONG TDESocketBuffer::sendTo(KActiveSocketBase* dev, TQ_LONG len) // question is: how big should that buffer be? 2 kB should be enough TQ_ULONG bufsize = 1460; - if (len != -1 && len < bufsize) + if ((len != -1) && ((TQ_ULONG)len < bufsize)) { bufsize = len; + } TQByteArray buf(bufsize); TQ_LONG count = 0; @@ -263,7 +264,7 @@ TQ_LONG TDESocketBuffer::sendTo(KActiveSocketBase* dev, TQ_LONG len) } // see if we can still fit more - if (count < bufsize && it != end) + if ((TQ_ULONG)count < bufsize && it != end) { // getting here means this buffer (*it) is larger than // (bufsize - count) (even for count == 0). |