소스 검색

make it compile more quietly

Cary Sandvig 25 년 전
부모
커밋
173d6df423

+ 6 - 6
panda/src/gui/guiButton.I

@@ -47,7 +47,7 @@ INLINE void GuiButton::up(void) {
     switch_state(UP_ROLLOVER);
     break;
   default:
-    gui_cat->warning() << "got up from invalid state (" << _state << ")"
+    gui_cat->warning() << "got up from invalid state (" << (int)_state << ")"
 		       << endl;
   }
 }
@@ -61,7 +61,7 @@ INLINE void GuiButton::down(void) {
     switch_state(DOWN_ROLLOVER);
     break;
   default:
-    gui_cat->warning() << "got down from invalid state (" << _state << ")"
+    gui_cat->warning() << "got down from invalid state (" << (int)_state << ")"
 		       << endl;
   }
 }
@@ -77,8 +77,8 @@ INLINE void GuiButton::inactive(void) {
     switch_state(INACTIVE_ROLLOVER);
     break;
   default:
-    gui_cat->warning() << "got inactive from invalid state (" << _state << ")"
-		       << endl;
+    gui_cat->warning() << "got inactive from invalid state (" << (int)_state
+		       << ")" << endl;
   }
 }
 
@@ -95,8 +95,8 @@ INLINE void GuiButton::click(void) {
   case INACTIVE:
     break;
   default:
-    gui_cat->warning() << "got click from invalid state (" << _state << ")"
-		       << endl;
+    gui_cat->warning() << "got click from invalid state (" << (int)_state
+		       << ")" << endl;
   }
 }
 

+ 7 - 7
panda/src/gui/guiButton.cxx

@@ -86,7 +86,7 @@ void GuiButton::switch_state(GuiButton::States nstate) {
       _mgr->remove_label(_inactive);
     break;
   default:
-    gui_cat->warning() << "switching away from invalid state (" << _state
+    gui_cat->warning() << "switching away from invalid state (" << (int)_state
 		       << ")" << endl;
   }
   _state = nstate;
@@ -150,7 +150,7 @@ void GuiButton::switch_state(GuiButton::States nstate) {
     _rgn->trap_clicks(false);
     break;
   default:
-    gui_cat->warning() << "switched to invalid state (" << _state << ")"
+    gui_cat->warning() << "switched to invalid state (" << (int)_state << ")"
 		       << endl;
   }
 }
@@ -165,10 +165,10 @@ void GuiButton::recompute_frame(void) {
 GuiButton::GuiButton(const string& name, GuiLabel* up, GuiLabel* up_roll,
 		     GuiLabel* down, GuiLabel* down_roll, GuiLabel* inactive)
   : GuiItem(name), _up(up), _up_rollover(up_roll), _down(down),
-    _down_rollover(down_roll), _inactive(inactive), _state(GuiButton::NONE),
-    _up_event(name + "-up"), _up_rollover_event(name + "-up-rollover"),
-    _down_event(name +"-down"), _down_rollover_event(name + "-down-rollover"),
-    _inactive_event(name + "-inactive") {
+    _down_rollover(down_roll), _inactive(inactive), _up_event(name + "-up"),
+    _up_rollover_event(name + "-up-rollover"), _down_event(name +"-down"),
+    _down_rollover_event(name + "-down-rollover"),
+    _inactive_event(name + "-inactive"), _state(GuiButton::NONE) {
   GetExtents(up, down, up_roll, down_roll, inactive, _left, _right, _bottom,
 	     _top);
   _rgn = new GuiRegion("button-" + name, _left, _right, _bottom, _top, true);
@@ -247,5 +247,5 @@ void GuiButton::output(ostream& os) const {
   os << "    inactive event - '" << _inactive_event << "'" << endl;
   os << "    rgn - 0x" << (void*)_rgn << endl;
   os << "      frame - " << _rgn->get_frame() << endl;
-  os << "    state - " << _state << endl;
+  os << "    state - " << (int)_state << endl;
 }

+ 1 - 1
panda/src/gui/guiButton.h

@@ -32,7 +32,7 @@ private:
 public:
   GuiButton(const string&, GuiLabel*, GuiLabel*, GuiLabel*, GuiLabel*,
 	    GuiLabel*);
-  ~GuiButton(void);
+  virtual ~GuiButton(void);
 
   virtual void manage(GuiManager*, EventHandler&);
   virtual void unmanage(void);

+ 3 - 3
panda/src/gui/guiFrame.cxx

@@ -7,7 +7,7 @@
 
 GuiFrame::Boxes::iterator GuiFrame::find_box(GuiItem* item) {
   bool found = false;
-  Boxes::iterator ret;
+  Boxes::iterator ret = _items.end();
   Boxes::iterator i;
   for (i=_items.begin(); (!found)&&(i!=_items.end()); ++i)
     if ((*i).get_item() == item) {
@@ -79,7 +79,7 @@ void GuiFrame::recompute_frame(void) {
 	  }
 	  break;
 	default:
-	  gui_cat->warning() << "unknown packing type (" << pack << ")"
+	  gui_cat->warning() << "unknown packing type (" << (int)pack << ")"
 			     << endl;
 	}
       }
@@ -198,7 +198,7 @@ void GuiFrame::output(ostream& os) const {
     int n = (*i).get_num_links();
     if (n > 0) {
       for (int j=0; j<n; ++j)
-	os << "      linked by " << (*i).get_nth_packing(j) << " to 0x"
+	os << "      linked by " << (int)((*i).get_nth_packing(j)) << " to 0x"
 	   << (void*)((*i).get_nth_to(j)) << endl;
     }
   }

+ 4 - 3
panda/src/gui/guiItem.cxx

@@ -9,9 +9,10 @@ void GuiItem::recompute_frame(void) {
 }
 
 GuiItem::GuiItem(const string& name) : Namable(name), _added_hooks(false),
-				       _mgr((GuiManager*)0L), _scale(1.),
-				       _pos(0., 0., 0.), _left(-1.),
-				       _right(1.), _bottom(-1.), _top(1.) {
+				       _scale(1.), _left(-1.), _right(1.),
+				       _bottom(-1.), _top(1.),
+				       _pos(0., 0., 0.),
+				       _mgr((GuiManager*)0L) {
 }
 
 GuiItem::~GuiItem(void) {

+ 1 - 1
panda/src/gui/guiItem.h

@@ -21,7 +21,7 @@ protected:
   virtual void recompute_frame(void) = 0;
 public:
   GuiItem(const string&);
-  ~GuiItem(void);
+  virtual ~GuiItem(void);
 
   virtual void manage(GuiManager*, EventHandler&) = 0;
   virtual void unmanage(void) = 0;

+ 6 - 5
panda/src/gui/guiLabel.I

@@ -3,13 +3,14 @@
 // 
 ////////////////////////////////////////////////////////////////////
 
-INLINE GuiLabel::GuiLabel(void) : _type(GuiLabel::NONE), _scale(1.),
-				  _pos(0., 0., 0.), _tex((Texture*)0L),
+INLINE GuiLabel::GuiLabel(void) : _type(GuiLabel::NONE),
 				  _arc((RenderRelation*)0L),
-				  _internal((RenderRelation*)0L),
+				  _tex((Texture*)0L),
+				  _internal((RenderRelation*)0L), _scale(1.),
+				  _pos(0., 0., 0.),
 				  _foreground(1., 1., 1., 1.),
-				  _background(0., 0., 0., 0.),
-				  _have_background(false) {
+				  _have_background(false),
+				  _background(0., 0., 0., 0.) {
 }
 
 INLINE Node* GuiLabel::get_geometry(void) const {

+ 1 - 1
panda/src/gui/guiManager.cxx

@@ -39,7 +39,7 @@ GuiManager* GuiManager::get_ptr(GraphicsWindow* w, MouseAndKeyboard* mak) {
     // first see if there is a mouseWatcher already under the MouseAndKeyboard
     bool has_watcher = false;
     TypeHandle dgt = DataRelation::get_class_type();
-    MouseWatcher* watcher;
+    MouseWatcher* watcher = (MouseWatcher*)0L;
     for (int i=0; i<mak->get_num_children(dgt); ++i)
       if (mak->get_child(dgt, i)->get_child()->get_type() ==
 	  MouseWatcher::get_class_type()) {

+ 1 - 1
panda/src/gui/guiRollover.h

@@ -23,7 +23,7 @@ private:
   virtual void recompute_frame(void);
 public:
   GuiRollover(const string&, GuiLabel*, GuiLabel*);
-  ~GuiRollover(void);
+  virtual ~GuiRollover(void);
 
   virtual void manage(GuiManager*, EventHandler&);
   virtual void unmanage(void);