From c6c4e8d426bba89736d1fc79eb464c5b6d14935f Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Thu, 29 Jun 2017 01:13:05 +0000 Subject: Remove unnecessary Fl_Widget_Tracker from Fl_Dial's handle(). handle_push() doesn't call a callback, hence Fl_Widget_Tracker is not necessary. Added FALLTHROUGH and NOTREACHED comments. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12279 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Dial.cxx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/Fl_Dial.cxx b/src/Fl_Dial.cxx index a29163ddc..333c9d549 100644 --- a/src/Fl_Dial.cxx +++ b/src/Fl_Dial.cxx @@ -103,10 +103,9 @@ void Fl_Dial::draw() { */ int Fl_Dial::handle(int event, int X, int Y, int W, int H) { switch (event) { - case FL_PUSH: { - Fl_Widget_Tracker wp(this); + case FL_PUSH: handle_push(); - if (wp.deleted()) return 1; } + /* FALLTHROUGH */ case FL_DRAG: { int mx = (Fl::event_x()-X-W/2)*H; int my = (Fl::event_y()-Y-H/2)*W; @@ -124,12 +123,13 @@ int Fl_Dial::handle(int event, int X, int Y, int W, int H) { val = minimum() + (maximum()-minimum())*(angle-a1)/(a2-a1); } handle_drag(clamp(round(val))); - } return 1; + return 1; + } /* NOTREACHED */ case FL_RELEASE: handle_release(); return 1; - case FL_ENTER : /* FALLTHROUGH */ - case FL_LEAVE : + case FL_ENTER: /* FALLTHROUGH */ + case FL_LEAVE: return 1; default: return 0; @@ -163,8 +163,7 @@ Fl_Fill_Dial::Fl_Fill_Dial(int X,int Y,int W,int H, const char *L) Fl_Line_Dial::Fl_Line_Dial(int X,int Y,int W,int H, const char *L) -: Fl_Dial(X,Y,W,H,L) -{ +: Fl_Dial(X,Y,W,H,L) { type(FL_LINE_DIAL); } -- cgit v1.2.3