diff options
Diffstat (limited to 'src/Fl_x.cxx')
| -rw-r--r-- | src/Fl_x.cxx | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 373378e9b..b95c74a5b 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -1217,7 +1217,8 @@ static void react_to_screen_reconfiguration() { int old_count = Fl::screen_count(); int (*sizes)[4] = new int[old_count][4]; float *scales = new float[old_count]; - for (int screen = 0; screen < old_count; screen++) { + int screen; + for (screen = 0; screen < old_count; screen++) { Fl::screen_xywh(sizes[screen][0], sizes[screen][1], sizes[screen][2], sizes[screen][3], screen); scales[screen] = Fl::screen_scale(screen); } @@ -1227,7 +1228,7 @@ static void react_to_screen_reconfiguration() { // detect whether screen sizes were unchanged bool nochange = (old_count == Fl::screen_count()); if (nochange) { - for (int screen = 0; screen < old_count; screen++) { + for (screen = 0; screen < old_count; screen++) { int X,Y,W,H; Fl::screen_xywh(X,Y,W,H, screen); X /= scales[screen]; @@ -1243,12 +1244,12 @@ static void react_to_screen_reconfiguration() { delete[] sizes; if (nochange || (old_count == 1 && Fl::screen_count() == 1)) { // screen sizes did not change or single screen: re-use previous screen scale values - for (int screen = 0; screen < old_count; screen++) + for (screen = 0; screen < old_count; screen++) Fl::screen_driver()->scale(screen, scales[screen]); } else { Fl::screen_driver()->use_startup_scale_factor(); float new_scale = Fl::screen_driver()->scale(0); - for (int screen = 0; screen < Fl::screen_count(); screen++) { + for (screen = 0; screen < Fl::screen_count(); screen++) { Fl::screen_driver()->scale(screen, 1); Fl::screen_driver()->rescale_all_windows_from_screen(screen, new_scale, 1); } @@ -1269,7 +1270,8 @@ static void after_display_rescale(float *p_current_xft_dpi) { if (fabs(dpi - *p_current_xft_dpi) > 0.1) { *p_current_xft_dpi = dpi; float f = dpi / 96.; - for (int i = 0; i < Fl::screen_count(); i++) + int i; + for (i = 0; i < Fl::screen_count(); i++) Fl::screen_driver()->rescale_all_windows_from_screen(i, f, f); } } @@ -1291,7 +1293,8 @@ static void add_xid_vector(Window xid) { } static bool remove_xid_vector(Window xid) { - for (int pos = xid_vector_count - 1; pos >= 0; pos--) { + int pos; + for (pos = xid_vector_count - 1; pos >= 0; pos--) { if (xid_vector[pos] == xid) { if (pos != --xid_vector_count) xid_vector[pos] = xid_vector[xid_vector_count]; return true; @@ -1679,7 +1682,8 @@ int fl_handle(const XEvent& thisevent) } delete [] fl_dnd_source_types; fl_dnd_source_types = new Atom[count+1]; - for (unsigned i = 0; i < count; i++) { + unsigned i; + for (i = 0; i < count; i++) { fl_dnd_source_types[i] = ((Atom*)cm_buffer)[i]; } fl_dnd_source_types[count] = 0; @@ -2123,7 +2127,8 @@ int fl_handle(const XEvent& thisevent) unsigned long nitems; unsigned long *words = 0; if (0 == get_xwinprop(xid, fl_NET_WM_STATE, 64, &nitems, &words) ) { - for (unsigned long item = 0; item < nitems; item++) { + unsigned long item; + for (item = 0; item < nitems; item++) { if (words[item] == fl_NET_WM_STATE_FULLSCREEN) { fullscreen_state = 1; } @@ -2913,7 +2918,8 @@ static void icons_to_property(const Fl_RGB_Image *icons[], int count, unsigned long *data; sz = 0; - for (int i = 0;i < count;i++) + int i; + for (i = 0;i < count;i++) sz += 2 + icons[i]->data_w() * icons[i]->data_h(); // FIXME: Might want to sort the icons @@ -2921,7 +2927,7 @@ static void icons_to_property(const Fl_RGB_Image *icons[], int count, *property = data = new unsigned long[sz]; *len = sz; - for (int i = 0;i < count;i++) { + for (i = 0;i < count;i++) { const Fl_RGB_Image *image; image = icons[i]; @@ -2938,8 +2944,10 @@ static void icons_to_property(const Fl_RGB_Image *icons[], int count, const int extra_data = image->ld() ? (image->ld() - image->data_w() * image->d()) : 0; const uchar *in = (const uchar*)*image->data(); - for (int y = 0; y < image->data_h(); y++) { - for (int x = 0; x < image->data_w(); x++) { + int y; + for (y = 0; y < image->data_h(); y++) { + int x; + for (x = 0; x < image->data_w(); x++) { switch (image->d()) { case 1: *data = ( 0xff<<24) | (in[0]<<16) | (in[0]<<8) | in[0]; @@ -3151,8 +3159,10 @@ int Fl_X11_Window_Driver::set_cursor(const Fl_RGB_Image *image, int hotx, int ho const int extra_data = image->ld() ? (image->ld()-image->w()*image->d()) : 0; const uchar *i = (const uchar*)*image->data(); XcursorPixel *o = cursor->pixels; - for (int y = 0;y < image->h();y++) { - for (int x = 0;x < image->w();x++) { + int y; + for (y = 0;y < image->h();y++) { + int x; + for (x = 0;x < image->w();x++) { uchar r, g, b, a; switch (image->d()) { case 1: |
