summaryrefslogtreecommitdiff
path: root/src/Fl_Browser.cxx
diff options
context:
space:
mode:
authormaxim nikonov <maxim.nikonov@hqo.co>2026-02-06 18:12:40 +0500
committermaxim nikonov <maxim.nikonov@hqo.co>2026-02-06 18:12:40 +0500
commitb4995f979d127cea667b4e2b71c91e9db4ab52ef (patch)
treefbebc775e10932bace8d6a7c3481b1ba200c64db /src/Fl_Browser.cxx
parent9575eb0a1ffa8150f70f88b5f6b55f342c3c0088 (diff)
wip
Diffstat (limited to 'src/Fl_Browser.cxx')
-rw-r--r--src/Fl_Browser.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/Fl_Browser.cxx b/src/Fl_Browser.cxx
index 9228529e2..b51397c08 100644
--- a/src/Fl_Browser.cxx
+++ b/src/Fl_Browser.cxx
@@ -58,7 +58,8 @@ struct FL_BLINE { // data is in a linked list of these
Example of use:
\code
// Walk the browser from beginning to end
- for ( void *i=item_first(); i; i=item_next(i) ) {
+ void *i;
+ for (i =item_first(); i; i=item_next(i) ) {
printf("item label='%s'\n", item_text(i));
}
\endcode
@@ -88,7 +89,7 @@ void* Fl_Browser::item_prev(void* item) const {return ((FL_BLINE*)item)->prev;}
Example of use:
\code
// Walk the browser in reverse, from end to start
- for ( void *i=item_last(); i; i=item_prev(i) ) {
+ for (i =item_last(); i; i=item_prev(i) ) {
printf("item label='%s'\n", item_text(i));
}
\endcode
@@ -372,7 +373,8 @@ int Fl_Browser::item_height(void *item) const {
} else {
const int* i = column_widths();
// do each column separately as they may all set different fonts:
- for (char* str = l->txt; str && *str; str++) {
+ char *str;
+ for (str = l->txt; str && *str; str++) {
Fl_Font font = textfont(); // default font
int tsize = textsize(); // default size
if ( format_char() ) { // can be NULL
@@ -669,7 +671,8 @@ void Fl_Browser::textsize(Fl_Fontsize newSize) {
new_list();
full_height_ = 0;
if (lines == 0) return;
- for (FL_BLINE* itm=(FL_BLINE *)item_first(); itm; itm=(FL_BLINE *)item_next(itm)) {
+ FL_BLINE *itm;
+ for (itm =(FL_BLINE *)item_first(); itm; itm=(FL_BLINE *)item_next(itm)) {
full_height_ += item_height(itm) + linespacing();
}
}
@@ -679,7 +682,8 @@ void Fl_Browser::textsize(Fl_Fontsize newSize) {
\see add(), insert(), remove(), swap(int,int), clear()
*/
void Fl_Browser::clear() {
- for (FL_BLINE* l = first; l;) {
+ FL_BLINE *l;
+ for (l = first; l;) {
FL_BLINE* n = l->next;
free(l);
l = n;