aboutsummaryrefslogtreecommitdiff
path: root/dw/fltkui.cc
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2010-10-09 22:50:26 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2010-10-09 22:50:26 +0200
commit289364d31a9dcc694d0e277b503c512787402482 (patch)
tree0cd933ca96ba15e741c1c5ae12dcf9d5dca2963f /dw/fltkui.cc
parent61c58bd97a4bf9d217bd5e29ec3f76f92e398360 (diff)
make dillo compile with clang
* Variable length arrays are not allowed in C++. They are supported in C99 and gcc seems to accept them in C++ mode. Replace the few places where variable length arrays are used. * The widget member in ComplexButtonResource was colliding with the widget member of FltkResource, so rename it to childWidget.
Diffstat (limited to 'dw/fltkui.cc')
-rw-r--r--dw/fltkui.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/dw/fltkui.cc b/dw/fltkui.cc
index c1bfd873..07874f2c 100644
--- a/dw/fltkui.cc
+++ b/dw/fltkui.cc
@@ -989,7 +989,7 @@ template <class I> void FltkSelectionResource<I>::addItem (const char *str,
itemWidget->set_selected();
if (setSelectedItems ()) {
// Handle multiple item selection.
- int pos[widgetStack->stack->size ()];
+ int *pos = new int[widgetStack->stack->size ()];
int i;
Iterator <TypedPointer < ::fltk::Menu> > it;
for (it = widgetStack->stack->iterator (),
@@ -1000,6 +1000,7 @@ template <class I> void FltkSelectionResource<I>::addItem (const char *str,
pos[i] = p->getTypedValue()->children () - 1;
}
widgetStack->widget->set_item (pos, widgetStack->stack->size ());
+ delete [] pos;
}
}
}