Fix compiler warnings (gcc 6.1).

Some of these warnings were benign (code formatting), but one of them
showed a potential bug (zero divide in test/fraciewer.cxx).

Fixed warnings:

 1 this 'while' clause does not guard... [-Wmisleading-indentation]
 1 this 'for' clause does not guard... [-Wmisleading-indentation]
 1 this 'else' clause does not guard... [-Wmisleading-indentation]



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11850 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Albrecht Schlosser 2016-07-29 09:24:04 +00:00
parent a633de6461
commit 17b9f6d6cb
3 changed files with 13 additions and 7 deletions

View File

@ -3,7 +3,7 @@
//
// Base Browser widget class for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2010 by Bill Spitzak and others.
// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@ -714,8 +714,9 @@ int Fl_Browser_::handle(int event) {
if (type()==FL_HOLD_BROWSER) {
switch (Fl::event_key()) {
case FL_Down:
while ((l = item_next(l)))
while ((l = item_next(l))) {
if (item_height(l)>0) {select_only(l, when()); break;}
}
return 1;
case FL_Up:
while ((l = item_prev(l))) {

View File

@ -35,10 +35,14 @@ static void drawhand(double ang,const float v[][2],Fl_Color fill,Fl_Color line)
{
fl_push_matrix();
fl_rotate(ang);
fl_color(fill); fl_begin_polygon();
int i; for (i=0; i<4; i++) fl_vertex(v[i][0],v[i][1]); fl_end_polygon();
fl_color(line); fl_begin_loop();
for (i=0; i<4; i++) fl_vertex(v[i][0],v[i][1]); fl_end_loop();
fl_color(fill);
fl_begin_polygon();
int i; for (i=0; i<4; i++) fl_vertex(v[i][0],v[i][1]);
fl_end_polygon();
fl_color(line);
fl_begin_loop();
for (i=0; i<4; i++) fl_vertex(v[i][0],v[i][1]);
fl_end_loop();
fl_pop_matrix();
}

View File

@ -483,8 +483,9 @@ static void normalize(GLfloat v[3])
if (d == 0)
fprintf(stderr, "Zero length vector in normalize\n");
else
else {
v[0] /= d; v[1] /= d; v[2] /= d;
}
}
/* calculates a normalized crossproduct to v1, v2 */