mirror of
https://github.com/fltk/fltk.git
synced 2026-06-05 08:06:35 +08:00
Fix compiler warnings (STR #2988) - final commit.
This commit includes all fixes from branch-1.3 (svn r 11243) and additional
fixes for warnings that crept in during the porting efforts, particularly
C++ ("//") comments in C and included header files, and some more.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11246 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -359,7 +359,7 @@ int CodeEditor::auto_indent(int, CodeEditor* e) {
|
||||
char *text = e->buffer()->text_range(start, pos);
|
||||
char *ptr;
|
||||
|
||||
for (ptr = text; isspace(*ptr); ptr ++);
|
||||
for (ptr = text; isspace(*ptr); ptr ++) {/*empty*/}
|
||||
*ptr = '\0';
|
||||
if (*text) {
|
||||
// use only a single 'insert' call to avoid redraw issues
|
||||
|
||||
+8
-8
@@ -522,7 +522,7 @@ int Widget_Browser::handle(int e) {
|
||||
k->visible = 1;
|
||||
if (k->is_parent() && !k->open_) {
|
||||
Fl_Type *j;
|
||||
for (j = k->next; j && j->level>k->level; j = j->next);
|
||||
for (j = k->next; j && j->level>k->level; j = j->next) {/*empty*/}
|
||||
k = j;
|
||||
} else
|
||||
k = k->next;
|
||||
@@ -579,7 +579,7 @@ void Fl_Type::add(Fl_Type *p) {
|
||||
Fl_Type *q;
|
||||
int newlevel;
|
||||
if (p) {
|
||||
for (q = p->next; q && q->level > p->level; q = q->next);
|
||||
for (q = p->next; q && q->level > p->level; q = q->next) {/*empty*/}
|
||||
newlevel = p->level+1;
|
||||
} else {
|
||||
q = 0;
|
||||
@@ -774,7 +774,7 @@ void select_all_cb(Fl_Widget *,void *) {
|
||||
Fl_Type *p = Fl_Type::current ? Fl_Type::current->parent : 0;
|
||||
if (in_this_only) {
|
||||
Fl_Type *t = p;
|
||||
for (; t && t != in_this_only; t = t->parent);
|
||||
for (; t && t != in_this_only; t = t->parent) {/*empty*/}
|
||||
if (t != in_this_only) p = in_this_only;
|
||||
}
|
||||
for (;;) {
|
||||
@@ -798,7 +798,7 @@ void select_none_cb(Fl_Widget *,void *) {
|
||||
Fl_Type *p = Fl_Type::current ? Fl_Type::current->parent : 0;
|
||||
if (in_this_only) {
|
||||
Fl_Type *t = p;
|
||||
for (; t && t != in_this_only; t = t->parent);
|
||||
for (; t && t != in_this_only; t = t->parent) {/*empty*/}
|
||||
if (t != in_this_only) p = in_this_only;
|
||||
}
|
||||
for (;;) {
|
||||
@@ -820,7 +820,7 @@ void select_none_cb(Fl_Widget *,void *) {
|
||||
|
||||
static void delete_children(Fl_Type *p) {
|
||||
Fl_Type *f;
|
||||
for (f = p; f && f->next && f->next->level > p->level; f = f->next);
|
||||
for (f = p; f && f->next && f->next->level > p->level; f = f->next) {/*empty*/}
|
||||
for (; f != p; ) {
|
||||
Fl_Type *g = f->prev;
|
||||
delete f;
|
||||
@@ -851,7 +851,7 @@ void Fl_Type::move_before(Fl_Type* g) {
|
||||
if (level != g->level) printf("move_before levels don't match! %d %d\n",
|
||||
level, g->level);
|
||||
Fl_Type* n;
|
||||
for (n = next; n && n->level > level; n = n->next);
|
||||
for (n = next; n && n->level > level; n = n->next) {/*empty*/}
|
||||
if (n == g) return;
|
||||
Fl_Type *l = n ? n->prev : Fl_Type::last;
|
||||
prev->next = n;
|
||||
@@ -875,7 +875,7 @@ void earlier_cb(Fl_Widget*,void*) {
|
||||
Fl_Type* nxt = f->next;
|
||||
if (f->selected) {
|
||||
Fl_Type* g;
|
||||
for (g = f->prev; g && g->level > f->level; g = g->prev);
|
||||
for (g = f->prev; g && g->level > f->level; g = g->prev) {/*empty*/}
|
||||
if (g && g->level == f->level && !g->selected) {
|
||||
f->move_before(g);
|
||||
mod = 1;
|
||||
@@ -893,7 +893,7 @@ void later_cb(Fl_Widget*,void*) {
|
||||
Fl_Type* prv = f->prev;
|
||||
if (f->selected) {
|
||||
Fl_Type* g;
|
||||
for (g = f->next; g && g->level > f->level; g = g->next);
|
||||
for (g = f->next; g && g->level > f->level; g = g->next) {/*empty*/}
|
||||
if (g && g->level == f->level && !g->selected) {
|
||||
g->move_before(f);
|
||||
mod = 1;
|
||||
|
||||
@@ -1976,7 +1976,7 @@ const char *array_name(Fl_Widget_Type *o) {
|
||||
Fl_Type *t = o->prev;
|
||||
Fl_Type *tp = o;
|
||||
const char *cn = o->class_name(1);
|
||||
for (; t && t->class_name(1) == cn; tp = t, t = t->prev);
|
||||
for (; t && t->class_name(1) == cn; tp = t, t = t->prev) {/*empty*/}
|
||||
for (t = tp; t && t->class_name(1) == cn; t = t->next) {
|
||||
if (t == o) {sawthis=1; continue;}
|
||||
const char *e = t->name();
|
||||
@@ -2710,7 +2710,7 @@ int Fl_Widget_Type::read_fdesign(const char* propname, const char* value) {
|
||||
if (sscanf(value,"%f %f %f %f",&x,&y,&w,&h) == 4) {
|
||||
if (fdesign_flip) {
|
||||
Fl_Type *p;
|
||||
for (p = parent; p && !p->is_window(); p = p->parent);
|
||||
for (p = parent; p && !p->is_window(); p = p->parent) {/*empty*/}
|
||||
if (p && p->is_widget()) y = ((Fl_Widget_Type*)p)->o->h()-(y+h);
|
||||
}
|
||||
x += pasteoffset;
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ fluid-shared$(EXEEXT): $(OBJECTS) ../src/$(DSONAME) ../src/$(FLDSONAME) \
|
||||
$(CXX) $(ARCHFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LINKSHARED) $(LDLIBS)
|
||||
|
||||
clean:
|
||||
-$(RM) *.o core.* *~ *.bck *.bck *.bak
|
||||
-$(RM) *.o core.* *~ *.bck *.bak
|
||||
-$(RM) core fluid$(EXEEXT) fluid-shared$(EXEEXT)
|
||||
-$(RM) fluid.app/Contents/MacOS/fluid$(EXEEXT)
|
||||
|
||||
|
||||
+1
-1
@@ -339,7 +339,7 @@ int write_file(const char *filename, int selected_only) {
|
||||
p->write();
|
||||
write_string("\n");
|
||||
int q = p->level;
|
||||
for (p = p->next; p && p->level > q; p = p->next);
|
||||
for (p = p->next; p && p->level > q; p = p->next) {/*empty*/}
|
||||
} else {
|
||||
p = p->next;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user