Browse Source

Fix a few GCC compile warnings

rdb 7 years ago
parent
commit
c9372c3699
2 changed files with 4 additions and 1 deletions
  1. 1 1
      dtool/src/dtoolbase/stl_compares.I
  2. 3 0
      panda/src/event/asyncTask.cxx

+ 1 - 1
dtool/src/dtoolbase/stl_compares.I

@@ -169,7 +169,7 @@ add_hash(size_t hash, const Key &key) {
 #ifdef _DEBUG
   // We assume that the sequence is laid out sequentially in memory.
   if (key.size() > 0) {
-    assert(&key[key.size() - 1] - &key[0] == key.size() - 1);
+    assert(&key[key.size() - 1] - &key[0] == (ptrdiff_t)key.size() - 1);
   }
 #endif
   size_t num_bytes = (key.size() * sizeof(key[0]));

+ 3 - 0
panda/src/event/asyncTask.cxx

@@ -403,6 +403,9 @@ unlock_and_do_task() {
   Thread *current_thread = Thread::get_current_thread();
   nassertr(current_thread->_current_task == nullptr, DS_interrupt);
 
+#ifdef __GNUC__
+  __attribute__((unused))
+#endif
   void *ptr = AtomicAdjust::compare_and_exchange_ptr
     (current_thread->_current_task, nullptr, (TypedReferenceCount *)this);