Просмотр исходного кода

gobj: Fix warnings due to GCC being terrible at static analysis

rdb 3 недель назад
Родитель
Сommit
b3ac6e7896
2 измененных файлов с 5 добавлено и 2 удалено
  1. 4 1
      panda/src/gobj/adaptiveLru.I
  2. 1 1
      panda/src/gobj/geom.cxx

+ 4 - 1
panda/src/gobj/adaptiveLru.I

@@ -134,7 +134,10 @@ get_lru() const {
  */
 INLINE void AdaptiveLruPage::
 dequeue_lru() {
-  enqueue_lru(nullptr);
+  if (_lru != nullptr) {
+    _lru->do_remove_page(this);
+    _lru = nullptr;
+  }
 }
 
 /**

+ 1 - 1
panda/src/gobj/geom.cxx

@@ -1373,7 +1373,7 @@ compute_internal_bounds(Geom::CData *cdata, Thread *current_thread) const {
     nassertv(!pmax.is_nan());
 
     // Then we put the bounding volume around both of those points.
-    PN_stdfloat avg_box_area;
+    PN_stdfloat avg_box_area {};
     switch (btype) {
     case BoundingVolume::BT_best:
     case BoundingVolume::BT_fastest: