summaryrefslogtreecommitdiff
path: root/src/Fl_Text_Display.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_Text_Display.cxx
parent9575eb0a1ffa8150f70f88b5f6b55f342c3c0088 (diff)
wip
Diffstat (limited to 'src/Fl_Text_Display.cxx')
-rw-r--r--src/Fl_Text_Display.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx
index 9e0aacc2f..650cf1b7d 100644
--- a/src/Fl_Text_Display.cxx
+++ b/src/Fl_Text_Display.cxx
@@ -131,7 +131,8 @@ Fl_Text_Display::Fl_Text_Display(int X, int Y, int W, int H, const char* l)
mLineStarts = new int[mNVisibleLines];
#if VISIBLE_LINES_INIT > 1
{ // Note: this code is unused unless mNVisibleLines is ever initialized > 1
- for (int i=1; i<mNVisibleLines; i++) mLineStarts[i] = -1;
+ int i;
+ for (i =1; i<mNVisibleLines; i++) mLineStarts[i] = -1;
}
#endif
mLineStarts[0] = 0;
@@ -462,7 +463,8 @@ void Fl_Text_Display::highlight_data(Fl_Text_Buffer *styleBuffer,
*/
int Fl_Text_Display::longest_vline() const {
int longest = 0;
- for (int i = 0; i < mNVisibleLines; i++)
+ int i;
+ for (i = 0; i < mNVisibleLines; i++)
longest = max(longest, measure_vline(i));
return longest;
}
@@ -560,7 +562,8 @@ void Fl_Text_Display::recalc_display() {
}
// End of optimization, see comment above.
- for (int again = 1; again;) {
+ int again;
+ for (again = 1; again;) {
again = 0;
/* In continuous wrap mode, a change in width affects the total number of
lines in the buffer, and can leave the top line number incorrect, and
@@ -2098,7 +2101,8 @@ int Fl_Text_Display::handle_vline(
// In DRAW_LINE mode, the first iteration of the loop will draw all
// backgrounds. The second iteration will draw the text, so that text
// overlapping background color changes will not be clipped.
- for (int loop=1; loop<=2; loop++) {
+ int loop;
+ for (loop =1; loop<=2; loop++) {
int mask = (loop==1) ? BG_ONLY_MASK : TEXT_ONLY_MASK;
startX = X;
startIndex = 0;
@@ -2623,7 +2627,8 @@ void Fl_Text_Display::draw_cursor( int X, int Y ) {
}
fl_color( mCursor_color );
- for ( int k = 0; k < nSegs; k++ ) {
+ int k;
+ for (k = 0; k < nSegs; k++ ) {
fl_line( segs[ k ].x1, segs[ k ].y1, segs[ k ].x2, segs[ k ].y2 );
}