Browse Source

Fix a number of build warnings

tags/r14.0.0
Timothy Pearson 4 years ago
parent
commit
e0b1bfb014

+ 1
- 1
admin

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

+ 6
- 3
tdecore/network/khttpproxysocketdevice.cpp View File

@@ -170,11 +170,14 @@ bool KHttpProxySocketDevice::connect(const TQString& node, const TQString& servi
170 170
 bool KHttpProxySocketDevice::parseServerReply()
171 171
 {
172 172
   // make sure we're connected
173
-  if (!TDESocketDevice::connect(d->proxy))
174
-    if (error() == InProgress)
173
+  if (!TDESocketDevice::connect(d->proxy)) {
174
+    if (error() == InProgress) {
175 175
       return true;
176
-    else if (error() != NoError)
176
+    }
177
+    else if (error() != NoError) {
177 178
       return false;
179
+    }
180
+  }
178 181
 
179 182
   if (!d->request.isEmpty())
180 183
     {

+ 1
- 1
tdecore/network/kserversocket.cpp View File

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

+ 6
- 5
tdecore/network/tdesocketbuffer.cpp View File

@@ -183,7 +183,7 @@ TQ_LONG TDESocketBuffer::consumeBuffer(char *destbuffer, TQ_LONG maxlen, bool di
183 183
     {
184 184
       // calculate how much we'll copy
185 185
       size_t to_copy = (*it).size() - offset;
186
-      if (to_copy > maxlen)
186
+      if (to_copy > (size_t)maxlen)
187 187
 	to_copy = maxlen;
188 188
 
189 189
       // do the copying
@@ -234,12 +234,12 @@ TQ_LONG TDESocketBuffer::sendTo(KActiveSocketBase* dev, TQ_LONG len)
234 234
     return 0;
235 235
 
236 236
   TQMutexLocker locker(&m_mutex);
237
-  
237
+
238 238
   TQValueListIterator<TQByteArray> it = m_list.begin(),
239 239
     end = m_list.end();
240 240
   TQIODevice::Offset offset = m_offset;
241 241
   TQ_LONG written = 0;
242
-  
242
+
243 243
   // walk the buffer
244 244
   while (it != end && (len || len == -1))
245 245
     {
@@ -249,8 +249,9 @@ TQ_LONG TDESocketBuffer::sendTo(KActiveSocketBase* dev, TQ_LONG len)
249 249
       // question is: how big should that buffer be? 2 kB should be enough
250 250
 
251 251
       TQ_ULONG bufsize = 1460;
252
-      if (len != -1 && len < bufsize)
252
+      if ((len != -1) && ((TQ_ULONG)len < bufsize)) {
253 253
 	bufsize = len;
254
+      }
254 255
       TQByteArray buf(bufsize);
255 256
       TQ_LONG count = 0;
256 257
 
@@ -263,7 +264,7 @@ TQ_LONG TDESocketBuffer::sendTo(KActiveSocketBase* dev, TQ_LONG len)
263 264
 	}
264 265
 
265 266
       // see if we can still fit more
266
-      if (count < bufsize && it != end)
267
+      if ((TQ_ULONG)count < bufsize && it != end)
267 268
 	{
268 269
 	  // getting here means this buffer (*it) is larger than
269 270
 	  // (bufsize - count) (even for count == 0).

+ 10
- 5
tdeio/bookmarks/kbookmark.cc View File

@@ -296,16 +296,21 @@ KURL KBookmark::url() const
296 296
 TQString KBookmark::icon() const
297 297
 {
298 298
     TQString icon = element.attribute("icon");
299
-    if ( icon.isEmpty() )
299
+    if ( icon.isEmpty() ) {
300 300
         // Default icon depends on URL for bookmarks, and is default directory
301 301
         // icon for groups.
302
-        if ( isGroup() )
302
+        if ( isGroup() ) {
303 303
             icon = "bookmark_folder";
304
-        else
305
-            if ( isSeparator() )
304
+	}
305
+        else {
306
+            if ( isSeparator() ) {
306 307
                 icon = "eraser"; // whatever
307
-            else
308
+	    }
309
+            else {
308 310
                 icon = KMimeType::iconForURL( url() );
311
+	    }
312
+	}
313
+    }
309 314
     return icon;
310 315
 }
311 316
 

+ 6
- 0
tdeio/bookmarks/kbookmarkmanager.cc View File

@@ -255,6 +255,7 @@ void KBookmarkManager::convertToXBEL( TQDomElement & group )
255 255
     {
256 256
         TQDomElement e = n.toElement();
257 257
         if ( !e.isNull() )
258
+	{
258 259
             if ( e.tagName() == "TEXT" )
259 260
             {
260 261
                 e.setTagName("title");
@@ -280,6 +281,7 @@ void KBookmarkManager::convertToXBEL( TQDomElement & group )
280 281
                 convertToXBEL( e );
281 282
             }
282 283
             else
284
+	    {
283 285
                 if ( e.tagName() == "BOOKMARK" )
284 286
                 {
285 287
                     e.setTagName("bookmark"); // so much difference :-)
@@ -294,7 +296,11 @@ void KBookmarkManager::convertToXBEL( TQDomElement & group )
294 296
                     titleElem.appendChild( e.ownerDocument().createTextNode( text ) );
295 297
                 }
296 298
                 else
299
+		{
297 300
                     kdWarning(7043) << "Unknown tag " << e.tagName() << endl;
301
+		}
302
+	    }
303
+	}
298 304
         n = n.nextSibling();
299 305
     }
300 306
 }

+ 0
- 2
tdeio/tdeio/forwardingslavebase.cpp View File

@@ -69,7 +69,6 @@ void ForwardingSlaveBase::prepareUDSEntry(TDEIO::UDSEntry &entry,
69 69
     kdDebug() << "ForwardingSlaveBase::prepareUDSEntry: listing=="
70 70
               << listing << endl;
71 71
 
72
-    bool url_found = false;
73 72
     TQString name;
74 73
     KURL url;
75 74
 
@@ -87,7 +86,6 @@ void ForwardingSlaveBase::prepareUDSEntry(TDEIO::UDSEntry &entry,
87 86
             kdDebug() << "Name = " << name << endl;
88 87
 	    break;
89 88
         case TDEIO::UDS_URL:
90
-            url_found = true;
91 89
             url = (*it).m_str;
92 90
 	    if (listing)
93 91
             {

+ 2
- 2
tdeio/tdeio/job.cpp View File

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

+ 2
- 2
tdeio/tdeio/kzip.cpp View File

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

+ 9
- 5
tdeio/tdeio/slavebase.cpp View File

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

+ 7
- 3
tdeio/tdeio/slaveinterface.cpp View File

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

Loading…
Cancel
Save