Fix a number of build warnings

pull/16/head
Timothy Pearson 10 years ago
parent d80ccaf94c
commit e0b1bfb014

@ -1 +1 @@
Subproject commit 04db460623e1f235e7239f08fdcc2d0ef72636af Subproject commit 4dd97fad9e0c3f39abfd16d13e5b4c93d508513c

@ -170,11 +170,14 @@ bool KHttpProxySocketDevice::connect(const TQString& node, const TQString& servi
bool KHttpProxySocketDevice::parseServerReply() bool KHttpProxySocketDevice::parseServerReply()
{ {
// make sure we're connected // make sure we're connected
if (!TDESocketDevice::connect(d->proxy)) if (!TDESocketDevice::connect(d->proxy)) {
if (error() == InProgress) if (error() == InProgress) {
return true; return true;
else if (error() != NoError) }
else if (error() != NoError) {
return false; return false;
}
}
if (!d->request.isEmpty()) if (!d->request.isEmpty())
{ {

@ -292,7 +292,7 @@ KActiveSocketBase* TDEServerSocket::accept()
} }
else if (!listen()) else if (!listen())
// error happened during listen // error happened during listen
return false; return 0L;
} }
// check to see if we're doing a timeout // check to see if we're doing a timeout

@ -183,7 +183,7 @@ TQ_LONG TDESocketBuffer::consumeBuffer(char *destbuffer, TQ_LONG maxlen, bool di
{ {
// calculate how much we'll copy // calculate how much we'll copy
size_t to_copy = (*it).size() - offset; size_t to_copy = (*it).size() - offset;
if (to_copy > maxlen) if (to_copy > (size_t)maxlen)
to_copy = maxlen; to_copy = maxlen;
// do the copying // do the copying
@ -234,12 +234,12 @@ TQ_LONG TDESocketBuffer::sendTo(KActiveSocketBase* dev, TQ_LONG len)
return 0; return 0;
TQMutexLocker locker(&m_mutex); TQMutexLocker locker(&m_mutex);
TQValueListIterator<TQByteArray> it = m_list.begin(), TQValueListIterator<TQByteArray> it = m_list.begin(),
end = m_list.end(); end = m_list.end();
TQIODevice::Offset offset = m_offset; TQIODevice::Offset offset = m_offset;
TQ_LONG written = 0; TQ_LONG written = 0;
// walk the buffer // walk the buffer
while (it != end && (len || len == -1)) 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 // question is: how big should that buffer be? 2 kB should be enough
TQ_ULONG bufsize = 1460; TQ_ULONG bufsize = 1460;
if (len != -1 && len < bufsize) if ((len != -1) && ((TQ_ULONG)len < bufsize)) {
bufsize = len; bufsize = len;
}
TQByteArray buf(bufsize); TQByteArray buf(bufsize);
TQ_LONG count = 0; TQ_LONG count = 0;
@ -263,7 +264,7 @@ TQ_LONG TDESocketBuffer::sendTo(KActiveSocketBase* dev, TQ_LONG len)
} }
// see if we can still fit more // 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 // getting here means this buffer (*it) is larger than
// (bufsize - count) (even for count == 0). // (bufsize - count) (even for count == 0).

@ -296,16 +296,21 @@ KURL KBookmark::url() const
TQString KBookmark::icon() const TQString KBookmark::icon() const
{ {
TQString icon = element.attribute("icon"); TQString icon = element.attribute("icon");
if ( icon.isEmpty() ) if ( icon.isEmpty() ) {
// Default icon depends on URL for bookmarks, and is default directory // Default icon depends on URL for bookmarks, and is default directory
// icon for groups. // icon for groups.
if ( isGroup() ) if ( isGroup() ) {
icon = "bookmark_folder"; icon = "bookmark_folder";
else }
if ( isSeparator() ) else {
if ( isSeparator() ) {
icon = "eraser"; // whatever icon = "eraser"; // whatever
else }
else {
icon = KMimeType::iconForURL( url() ); icon = KMimeType::iconForURL( url() );
}
}
}
return icon; return icon;
} }

@ -255,6 +255,7 @@ void KBookmarkManager::convertToXBEL( TQDomElement & group )
{ {
TQDomElement e = n.toElement(); TQDomElement e = n.toElement();
if ( !e.isNull() ) if ( !e.isNull() )
{
if ( e.tagName() == "TEXT" ) if ( e.tagName() == "TEXT" )
{ {
e.setTagName("title"); e.setTagName("title");
@ -280,6 +281,7 @@ void KBookmarkManager::convertToXBEL( TQDomElement & group )
convertToXBEL( e ); convertToXBEL( e );
} }
else else
{
if ( e.tagName() == "BOOKMARK" ) if ( e.tagName() == "BOOKMARK" )
{ {
e.setTagName("bookmark"); // so much difference :-) e.setTagName("bookmark"); // so much difference :-)
@ -294,7 +296,11 @@ void KBookmarkManager::convertToXBEL( TQDomElement & group )
titleElem.appendChild( e.ownerDocument().createTextNode( text ) ); titleElem.appendChild( e.ownerDocument().createTextNode( text ) );
} }
else else
{
kdWarning(7043) << "Unknown tag " << e.tagName() << endl; kdWarning(7043) << "Unknown tag " << e.tagName() << endl;
}
}
}
n = n.nextSibling(); n = n.nextSibling();
} }
} }

@ -69,7 +69,6 @@ void ForwardingSlaveBase::prepareUDSEntry(TDEIO::UDSEntry &entry,
kdDebug() << "ForwardingSlaveBase::prepareUDSEntry: listing==" kdDebug() << "ForwardingSlaveBase::prepareUDSEntry: listing=="
<< listing << endl; << listing << endl;
bool url_found = false;
TQString name; TQString name;
KURL url; KURL url;
@ -87,7 +86,6 @@ void ForwardingSlaveBase::prepareUDSEntry(TDEIO::UDSEntry &entry,
kdDebug() << "Name = " << name << endl; kdDebug() << "Name = " << name << endl;
break; break;
case TDEIO::UDS_URL: case TDEIO::UDS_URL:
url_found = true;
url = (*it).m_str; url = (*it).m_str;
if (listing) if (listing)
{ {

@ -4308,7 +4308,7 @@ void DeleteJob::slotResult( Job *job )
UDSEntry entry = ((StatJob*)job)->statResult(); UDSEntry entry = ((StatJob*)job)->statResult();
bool bDir = false; bool bDir = false;
bool bLink = false; bool bLink = false;
TDEIO::filesize_t size = (TDEIO::filesize_t)-1; // TDEIO::filesize_t size = (TDEIO::filesize_t)-1;
UDSEntry::ConstIterator it2 = entry.begin(); UDSEntry::ConstIterator it2 = entry.begin();
int atomsFound(0); int atomsFound(0);
for( ; it2 != entry.end(); it2++ ) for( ; it2 != entry.end(); it2++ )
@ -4325,7 +4325,7 @@ void DeleteJob::slotResult( Job *job )
} }
else if ( ((*it2).m_uds) == UDS_SIZE ) else if ( ((*it2).m_uds) == UDS_SIZE )
{ {
size = (*it2).m_long; // size = (*it2).m_long;
atomsFound++; atomsFound++;
} }
if (atomsFound==3) break; if (atomsFound==3) break;

@ -627,9 +627,9 @@ kdDebug(7040) << "dev->at() now : " << dev->at() << endl;
else else
{ {
// kdDebug(7040) << "before interesting dev->at(): " << dev->at() << endl; // kdDebug(7040) << "before interesting dev->at(): " << dev->at() << endl;
bool success; /* bool success;
success = dev->at( dev->at() + compr_size ); // can this fail ??? success = dev->at( dev->at() + compr_size ); // can this fail ???
/* kdDebug(7040) << "after interesting dev->at(): " << dev->at() << endl; kdDebug(7040) << "after interesting dev->at(): " << dev->at() << endl;
if ( success ) if ( success )
kdDebug(7040) << "dev->at was successful... " << endl; kdDebug(7040) << "dev->at was successful... " << endl;
else else

@ -734,21 +734,25 @@ void SlaveBase::sigsegv_handler(int sig)
// call malloc.. and get in a nice recursive malloc loop // call malloc.. and get in a nice recursive malloc loop
char buffer[120]; char buffer[120];
snprintf(buffer, sizeof(buffer), "tdeioslave: ####### CRASH ###### protocol = %s pid = %d signal = %d\n", s_protocol, getpid(), sig); snprintf(buffer, sizeof(buffer), "tdeioslave: ####### CRASH ###### protocol = %s pid = %d signal = %d\n", s_protocol, getpid(), sig);
write(2, buffer, strlen(buffer)); if (write(2, buffer, strlen(buffer)) >= 0) {
#ifdef SECURE_DEBUG #ifdef SECURE_DEBUG
kdBacktraceFD(); kdBacktraceFD();
#else // SECURE_DEBUG #else // SECURE_DEBUG
// Screw the malloc issue! We want nice demangled backtrace! // Screw the malloc issue! We want nice demangled backtraces!
// Anyway we are not supposed to go into infinite loop because next signal // Anyway we are not supposed to go into infinite loop because next signal
// will kill us. If you are unlucky and there is a second crash during // will kill us. If you are unlucky and there is a second crash during
// backtrase in your system, you can define SECURE_DEBUG to avoid it // backtrase in your system, you can define SECURE_DEBUG to avoid it
// Extra sync here so we are sure even if the backtrace will fail // Extra sync here so we are sure even if the backtrace will fail
// we will pass at least some crash message. // we will pass at least some crash message.
fsync(2); fsync(2);
TQString backtrace = kdBacktrace(); TQString backtrace = kdBacktrace();
write(2, backtrace.ascii(), backtrace.length()); if (write(2, backtrace.ascii(), backtrace.length()) < 0) {
// FIXME
// Could not write crash information
}
#endif // SECURE_DEBUG #endif // SECURE_DEBUG
}
::exit(1); ::exit(1);
#endif #endif
} }

@ -533,11 +533,15 @@ void SlaveInterface::sigpipe_handler(int)
{ {
int saved_errno = errno; int saved_errno = errno;
// Using kdDebug from a signal handler is not a good idea. // Using kdDebug from a signal handler is not a good idea.
#ifndef NDEBUG #ifndef NDEBUG
char msg[1000]; char msg[1000];
sprintf(msg, "*** SIGPIPE *** (ignored, pid = %ld)\n", (long) getpid()); sprintf(msg, "*** SIGPIPE *** (ignored, pid = %ld)\n", (long) getpid());
write(2, msg, strlen(msg)); if (write(2, msg, strlen(msg)) < 0) {
#endif // FIXME
// Could not write error message
// Triple fault? ;-)
}
#endif
// Do nothing. // Do nothing.
// dispatch will return false and that will trigger ERR_SLAVE_DIED in slave.cpp // dispatch will return false and that will trigger ERR_SLAVE_DIED in slave.cpp

Loading…
Cancel
Save