diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_File_Chooser2.cxx | 6 | ||||
| -rw-r--r-- | src/Fl_Graphics_Driver.cxx | 4 | ||||
| -rw-r--r-- | src/Fl_MacOS_Sys_Menu_Bar.mm | 16 | ||||
| -rw-r--r-- | src/Fl_Menu.cxx | 24 | ||||
| -rw-r--r-- | src/Fl_Screen_Driver.cxx | 6 | ||||
| -rw-r--r-- | src/Fl_Tabs.cxx | 4 | ||||
| -rw-r--r-- | src/Fl_Tooltip.cxx | 12 | ||||
| -rw-r--r-- | src/Fl_Tree_Item.cxx | 10 | ||||
| -rw-r--r-- | src/Fl_Widget_Surface.cxx | 20 | ||||
| -rw-r--r-- | src/Fl_Window.cxx | 50 | ||||
| -rw-r--r-- | src/Fl_cocoa.mm | 12 | ||||
| -rw-r--r-- | src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx | 10 | ||||
| -rw-r--r-- | src/drivers/PostScript/Fl_PostScript.cxx | 10 | ||||
| -rw-r--r-- | src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx | 4 | ||||
| -rw-r--r-- | src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx | 4 | ||||
| -rw-r--r-- | src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx | 16 | ||||
| -rw-r--r-- | src/fl_curve.cxx | 10 | ||||
| -rw-r--r-- | src/fl_draw_pixmap.cxx | 14 | ||||
| -rw-r--r-- | src/fl_file_dir.cxx | 6 |
19 files changed, 120 insertions, 118 deletions
diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx index 426dbfd51..80d842bcf 100644 --- a/src/Fl_File_Chooser2.cxx +++ b/src/Fl_File_Chooser2.cxx @@ -798,9 +798,9 @@ Fl_File_Chooser::fileNameCB() } // Make sure we have an absolute path... - int condition = directory_[0] != '\0' && filename[0] != '/'; - if (condition && Fl::system_driver()->colon_is_drive()) condition = !(isalpha(filename[0] & 255) && (!filename[1] || filename[1] == ':')); - if (condition) { + int dirIsRelative = directory_[0] != '\0' && filename[0] != '/'; + if (dirIsRelative && Fl::system_driver()->colon_is_drive()) dirIsRelative = !(isalpha(filename[0] & 255) && (!filename[1] || filename[1] == ':')); + if (dirIsRelative) { fl_filename_absolute(pathname, sizeof(pathname), filename); value(pathname); fileName->mark(fileName->position()); // no selection after expansion diff --git a/src/Fl_Graphics_Driver.cxx b/src/Fl_Graphics_Driver.cxx index 784e5b5c2..cf7caa1af 100644 --- a/src/Fl_Graphics_Driver.cxx +++ b/src/Fl_Graphics_Driver.cxx @@ -61,9 +61,9 @@ Fl_Graphics_Driver &Fl_Graphics_Driver::default_driver() /** see fl_text_extents() */ -void Fl_Graphics_Driver::text_extents(const char*t, int n, int& dx, int& dy, int& w, int& h) +void Fl_Graphics_Driver::text_extents(const char*t, int nChars, int& dx, int& dy, int& w, int& h) { - w = (int)width(t, n); + w = (int)width(t, nChars); h = - height(); dx = 0; dy = descent(); diff --git a/src/Fl_MacOS_Sys_Menu_Bar.mm b/src/Fl_MacOS_Sys_Menu_Bar.mm index 8b2987d58..eccc70a4f 100644 --- a/src/Fl_MacOS_Sys_Menu_Bar.mm +++ b/src/Fl_MacOS_Sys_Menu_Bar.mm @@ -123,25 +123,25 @@ const char *Fl_Mac_App_Menu::quit = "Quit %@"; [self setState:(item->value() ? NSOnState : NSOffState)]; } else if ( item->flags & FL_MENU_RADIO ) { // update the menu radio symbols - NSMenu* menu = [self menu]; - NSInteger flRank = [menu indexOfItem:self]; - NSInteger last = [menu numberOfItems] - 1; + NSMenu* this_menu = [self menu]; + NSInteger flRank = [this_menu indexOfItem:self]; + NSInteger last = [this_menu numberOfItems] - 1; int from = flRank; while(from > 0) { - if ([[menu itemAtIndex:from-1] isSeparatorItem]) break; - item = [(FLMenuItem*)[menu itemAtIndex:from-1] getFlItem]; + if ([[this_menu itemAtIndex:from-1] isSeparatorItem]) break; + item = [(FLMenuItem*)[this_menu itemAtIndex:from-1] getFlItem]; if ( !(item->flags & FL_MENU_RADIO) ) break; from--; } int to = flRank; while (to < last) { - if ([[menu itemAtIndex:to+1] isSeparatorItem]) break; - item = [(FLMenuItem*)[menu itemAtIndex:to+1] getFlItem]; + if ([[this_menu itemAtIndex:to+1] isSeparatorItem]) break; + item = [(FLMenuItem*)[this_menu itemAtIndex:to+1] getFlItem]; if (!(item->flags & FL_MENU_RADIO)) break; to++; } for(int i = from; i <= to; i++) { - NSMenuItem *nsitem = [menu itemAtIndex:i]; + NSMenuItem *nsitem = [this_menu itemAtIndex:i]; [nsitem setState:(nsitem != self ? NSOffState : NSOnState)]; } } diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx index 3ab303dea..51f6ce15a 100644 --- a/src/Fl_Menu.cxx +++ b/src/Fl_Menu.cxx @@ -1028,30 +1028,32 @@ const Fl_Menu_Item* Fl_Menu_Item::pulldown( The selected item (or NULL if none) is returned. <I>This does not do the callbacks or change the state of check or radio items.</I> - X,Y is the position of the mouse cursor, relative to the + The menu is positioned so the cursor is centered over the item + picked. This will work even if \p picked is in a submenu. + If \p picked is zero or not in the menu item table the menu is + positioned with the cursor in the top-left corner. + + \param[in] X,Y the position of the mouse cursor, relative to the window that got the most recent event (usually you can pass Fl::event_x() and Fl::event_y() unchanged here). - \p title is a character string title for the menu. If + \param[in] title a character string title for the menu. If non-zero a small box appears above the menu with the title in it. - The menu is positioned so the cursor is centered over the item - picked. This will work even if \p picked is in a submenu. - If \p picked is zero or not in the menu item table the menu is - positioned with the cursor in the top-left corner. - - \p button is a pointer to an Fl_Menu_ from which the color and + \param[in] menu_button is a pointer to an Fl_Menu_ from which the color and boxtypes for the menu are pulled. If NULL then defaults are used. + + \return a pointer to the menu item selected by the user, or NULL */ const Fl_Menu_Item* Fl_Menu_Item::popup( int X, int Y, const char* title, const Fl_Menu_Item* picked, - const Fl_Menu_* button - ) const { + const Fl_Menu_* menu_button +) const { static Fl_Menu_Item dummy; // static so it is all zeros dummy.text = title; - return pulldown(X, Y, 0, 0, picked, button, title ? &dummy : 0); + return pulldown(X, Y, 0, 0, picked, menu_button, title ? &dummy : 0); } /** diff --git a/src/Fl_Screen_Driver.cxx b/src/Fl_Screen_Driver.cxx index 1d812a047..2d70187ca 100644 --- a/src/Fl_Screen_Driver.cxx +++ b/src/Fl_Screen_Driver.cxx @@ -192,9 +192,9 @@ Fl_RGB_Image *Fl_Screen_Driver::traverse_to_gl_subwindows(Fl_Group *g, int x, in Fl_RGB_Image *full_img) { if ( g->as_gl_window() ) { - Fl_Device_Plugin *pi = Fl_Device_Plugin::opengl_plugin(); - if (!pi) return full_img; - full_img = pi->rectangle_capture(g, x, y, w, h); + Fl_Device_Plugin *plugin = Fl_Device_Plugin::opengl_plugin(); + if (!plugin) return full_img; + full_img = plugin->rectangle_capture(g, x, y, w, h); } else if ( g->as_window() ) { if (Fl_Window::current() != g) g->as_window()->make_current(); diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx index 353dc49a1..4cfb13401 100644 --- a/src/Fl_Tabs.cxx +++ b/src/Fl_Tabs.cxx @@ -204,7 +204,7 @@ int Fl_Tabs::handle(int event) { return 1; case FL_MOVE: { int ret = Fl_Group::handle(event); - Fl_Widget *o = Fl_Tooltip::current(), *n = o; + Fl_Widget *tooltip_widget = Fl_Tooltip::current(), *n = tooltip_widget; int H = tab_height(); if ( (H>=0) && (Fl::event_y()>y()+H) ) return ret; @@ -214,7 +214,7 @@ int Fl_Tabs::handle(int event) { n = which(Fl::event_x(), Fl::event_y()); if (!n) n = this; } - if (n!=o) + if (n!=tooltip_widget) Fl_Tooltip::enter(n); return ret; } case FL_FOCUS: diff --git a/src/Fl_Tooltip.cxx b/src/Fl_Tooltip.cxx index 06058df6e..b05e036f0 100644 --- a/src/Fl_Tooltip.cxx +++ b/src/Fl_Tooltip.cxx @@ -71,7 +71,7 @@ public: Fl_Widget* Fl_Tooltip::widget_ = 0; static Fl_TooltipBox *window = 0; -static int Y,H; +static int currentTooltipY, currentTooltipH; Fl_Window *Fl_Tooltip::current_window(void) { @@ -88,7 +88,7 @@ void Fl_TooltipBox::layout() { // find position on the screen of the widget: int ox = Fl::event_x_root(); - int oy = Y + H+2; + int oy = currentTooltipY + currentTooltipH+2; for (Fl_Widget* p = Fl_Tooltip::current(); p; p = p->window()) { oy += p->y(); } @@ -96,11 +96,11 @@ void Fl_TooltipBox::layout() { Fl::screen_xywh(scr_x, scr_y, scr_w, scr_h); if (ox+ww > scr_x+scr_w) ox = scr_x+scr_w - ww; if (ox < scr_x) ox = scr_x; - if (H > 30) { + if (currentTooltipH > 30) { oy = Fl::event_y_root()+13; if (oy+hh > scr_y+scr_h) oy -= 23+hh; } else { - if (oy+hh > scr_y+scr_h) oy -= (4+hh+H); + if (oy+hh > scr_y+scr_h) oy -= (4+hh+currentTooltipH); } if (oy < scr_y) oy = scr_y; @@ -277,11 +277,11 @@ void Fl_Tooltip::enter_area(Fl_Widget* wid, int x,int y,int w,int h, const char* return; } // do nothing if it is the same: - if (wid==widget_ /*&& x==X && y==Y && w==W && h==H*/ && t==tip) return; + if (wid==widget_ /*&& x==X && y==currentTooltipY && w==W && h==currentTooltipH*/ && t==tip) return; Fl::remove_timeout(tooltip_timeout); Fl::remove_timeout(recent_timeout); // remember it: - widget_ = wid; Y = y; H = h; tip = t; + widget_ = wid; currentTooltipY = y; currentTooltipH = h; tip = t; // popup the tooltip immediately if it was recently up: if (recent_tooltip) { if (window) window->hide(); diff --git a/src/Fl_Tree_Item.cxx b/src/Fl_Tree_Item.cxx index 666a54674..d78c3427c 100644 --- a/src/Fl_Tree_Item.cxx +++ b/src/Fl_Tree_Item.cxx @@ -1163,17 +1163,17 @@ void Fl_Tree_Item::draw(int X, int &Y, int W, Fl_Tree_Item *itemfocus, int child_w = W - (child_x-X); int child_y_start = Y; for ( int t=0; t<children(); t++ ) { - int lastchild = ((t+1)==children()) ? 1 : 0; - _children[t]->draw(child_x, Y, child_w, itemfocus, tree_item_xmax, lastchild, render); + int is_lastchild = ((t+1)==children()) ? 1 : 0; + _children[t]->draw(child_x, Y, child_w, itemfocus, tree_item_xmax, is_lastchild, render); } if ( has_children() && is_open() ) { Y += prefs.openchild_marginbottom(); // offset below open child tree } if ( ! lastchild ) { // Special 'clipped' calculation. (intentional variable shadowing) - int clipped = ((child_y_start < tree_top) && (Y < tree_top)) || - ((child_y_start > tree_bot) && (Y > tree_bot)); - if (render && !clipped ) + int is_clipped = ((child_y_start < tree_top) && (Y < tree_top)) || + ((child_y_start > tree_bot) && (Y > tree_bot)); + if (render && !is_clipped ) draw_vertical_connector(hconn_x, child_y_start, Y, prefs); } } diff --git a/src/Fl_Widget_Surface.cxx b/src/Fl_Widget_Surface.cxx index 5c6c45432..23597732b 100644 --- a/src/Fl_Widget_Surface.cxx +++ b/src/Fl_Widget_Surface.cxx @@ -68,9 +68,9 @@ void Fl_Widget_Surface::draw(Fl_Widget* widget, int delta_x, int delta_y) // we do some trickery to recognize OpenGL windows and draw them via a plugin int drawn_by_plugin = 0; if (widget->as_gl_window()) { - Fl_Device_Plugin *pi = Fl_Device_Plugin::opengl_plugin(); - if (pi) { - drawn_by_plugin = pi->print(widget); + Fl_Device_Plugin *plugin = Fl_Device_Plugin::opengl_plugin(); + if (plugin) { + drawn_by_plugin = plugin->print(widget); } } if (!drawn_by_plugin) { @@ -177,11 +177,11 @@ int Fl_Widget_Surface::printable_rect(int *w, int *h) {return 1;} /** Draws a window with its title bar and frame if any. - \p x_offset and \p y_offset are optional coordinates of where to position the window top left. + \p win_offset_x and \p win_offset_y are optional coordinates of where to position the window top left. Equivalent to draw() if \p win is a subwindow or has no border. Use Fl_Window::decorated_w() and Fl_Window::decorated_h() to get the size of the window. */ -void Fl_Widget_Surface::draw_decorated_window(Fl_Window *win, int x_offset, int y_offset) +void Fl_Widget_Surface::draw_decorated_window(Fl_Window *win, int win_offset_x, int win_offset_y) { Fl_RGB_Image *top=0, *left=0, *bottom=0, *right=0; if (win->border() && !win->parent()) { @@ -190,22 +190,22 @@ void Fl_Widget_Surface::draw_decorated_window(Fl_Window *win, int x_offset, int int wsides = left ? left->w() : 0; int toph = top ? top->h() : 0; if (top) { - top->draw(x_offset, y_offset); + top->draw(win_offset_x, win_offset_y); delete top; } if (left) { - left->draw(x_offset, y_offset + toph); + left->draw(win_offset_x, win_offset_y + toph); delete left; } if (right) { - right->draw(x_offset + wsides + win->w(), y_offset + toph); + right->draw(win_offset_x + wsides + win->w(), win_offset_y + toph); delete right; } if (bottom) { - bottom->draw(x_offset, y_offset + toph + win->h()); + bottom->draw(win_offset_x, win_offset_y + toph + win->h()); delete bottom; } - this->draw(win, x_offset + wsides, y_offset + toph); + this->draw(win, win_offset_x + wsides, win_offset_y + toph); } // diff --git a/src/Fl_Window.cxx b/src/Fl_Window.cxx index 12445db94..0cde4989d 100644 --- a/src/Fl_Window.cxx +++ b/src/Fl_Window.cxx @@ -587,23 +587,7 @@ int Fl_Window::handle(int ev) /** Sets the allowable range the user can resize this window to. This only works for top-level windows. - <UL> - <LI>\p minw and \p minh are the smallest the window can be. - Either value must be greater than 0.</LI> - <LI>\p maxw and \p maxh are the largest the window can be. If either is - <I>equal</I> to the minimum then you cannot resize in that direction. - If either is zero then FLTK picks a maximum size in that direction - such that the window will fill the screen.</LI> - <LI>\p dw and \p dh are size increments. The window will be constrained - to widths of minw + N * dw, where N is any non-negative integer. - If these are less or equal to 1 they are ignored (this is ignored - on Windows).</LI> - <LI>\p aspect is a flag that indicates that the window should preserve its - aspect ratio. This only works if both the maximum and minimum have - the same aspect ratio (ignored on Windows and by many X window managers). - </LI> - </UL> - + If this function is not called, FLTK tries to figure out the range from the setting of resizable(): <UL> @@ -619,15 +603,31 @@ int Fl_Window::handle(int ev) It is undefined what happens if the current size does not fit in the constraints passed to size_range(). + + \param[in] minWidth, minHeight The smallest the window can be. + Either value must be greater than 0. + \param[in] maxWidth, maxHeight The largest the window can be. If either is + equal to the minimum then you cannot resize in that direction. + If either is zero then FLTK picks a maximum size in that direction + such that the window will fill the screen. + \param[in] deltaX, deltaY These are size increments. The window will be + constrained to widths of <tt>minWidth + N * deltaX</tt>, where N is any + non-negative integer. If these are less or equal to 1 they are ignored. + (this is ignored on Windows) + \param[in] aspectRatio A flag that indicates that the window should preserve + its aspect ratio. This only works if both the maximum and minimum have + the same aspect ratio (ignored on Windows and by many X window managers). */ -void Fl_Window::size_range(int minw, int minh, int maxw, int maxh, int dw, int dh, int aspect) { - this->minw = minw; - this->minh = minh; - this->maxw = maxw; - this->maxh = maxh; - this->dw = dw; - this->dh = dh; - this->aspect = aspect; +void Fl_Window::size_range(int minWidth, int minHeight, + int maxWidth, int maxHeight, + int deltaX, int deltaY, int aspectRatio) { + minw = minWidth; + minh = minHeight; + maxw = maxWidth; + maxh = maxHeight; + dw = deltaX; + dh = deltaY; + aspect = aspectRatio; pWindowDriver->size_range(); } diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 778ac2ae9..5809dc28d 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -2204,9 +2204,9 @@ static FLTextInputContext* fltextinputcontext_instance = nil; Fl_Cocoa_Window_Driver *d = Fl_Cocoa_Window_Driver::driver(window); [self did_view_resolution_change]; if (d->wait_for_expose_value) { // 1st drawing of layer-backed GL window - Fl_Device_Plugin *pi = Fl_Device_Plugin::opengl_plugin(); - if (pi) { - [pi->context(window) update]; // layer-backed GL windows may be empty without this + Fl_Device_Plugin *plugin = Fl_Device_Plugin::opengl_plugin(); + if (plugin) { + [plugin->context(window) update]; // layer-backed GL windows may be empty without this } d->wait_for_expose_value = 0; } @@ -4265,9 +4265,9 @@ static NSBitmapImageRep* GL_rect_to_nsbitmap(Fl_Window *win, int x, int y, int w // captures a rectangle from a GL window and returns it as an allocated NSBitmapImageRep // the capture has high res on retina { - Fl_Device_Plugin *pi = Fl_Device_Plugin::opengl_plugin(); - if (!pi) return nil; - Fl_RGB_Image *img = pi->rectangle_capture(win, x, y, w, h); + Fl_Device_Plugin *plugin = Fl_Device_Plugin::opengl_plugin(); + if (!plugin) return nil; + Fl_RGB_Image *img = plugin->rectangle_capture(win, x, y, w, h); NSBitmapImageRep* bitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:img->w() pixelsHigh:img->h() bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace bytesPerRow:4*img->w() bitsPerPixel:32]; memset([bitmap bitmapData], 0xFF, [bitmap bytesPerPlane]); const uchar *from = img->array; diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx index 1f189300c..8fd33743d 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx +++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx @@ -106,13 +106,13 @@ void Fl_Cocoa_Window_Driver::destroy_double_buffer() void Fl_Cocoa_Window_Driver::draw_begin() { if (!Fl_Surface_Device::surface()->driver()->has_feature(Fl_Graphics_Driver::NATIVE)) return; - CGContextRef gc = (CGContextRef)Fl_Surface_Device::surface()->driver()->gc(); + CGContextRef my_gc = (CGContextRef)Fl_Surface_Device::surface()->driver()->gc(); if (shape_data_) { # if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 if (shape_data_->mask && (&CGContextClipToMask != NULL)) { - CGContextClipToMask(gc, CGRectMake(0,0,w(),h()), shape_data_->mask); // requires Mac OS 10.4 + CGContextClipToMask(my_gc, CGRectMake(0,0,w(),h()), shape_data_->mask); // requires Mac OS 10.4 } - CGContextSaveGState(gc); + CGContextSaveGState(my_gc); # endif } } @@ -143,8 +143,8 @@ void Fl_Cocoa_Window_Driver::draw_end() } # if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 if (Fl_Surface_Device::surface()->driver()->has_feature(Fl_Graphics_Driver::NATIVE)) { - CGContextRef gc = (CGContextRef)Fl_Surface_Device::surface()->driver()->gc(); - if (shape_data_) CGContextRestoreGState(gc); + CGContextRef my_gc = (CGContextRef)Fl_Surface_Device::surface()->driver()->gc(); + if (shape_data_) CGContextRestoreGState(my_gc); } # endif } diff --git a/src/drivers/PostScript/Fl_PostScript.cxx b/src/drivers/PostScript/Fl_PostScript.cxx index e62946392..4d74f0840 100644 --- a/src/drivers/PostScript/Fl_PostScript.cxx +++ b/src/drivers/PostScript/Fl_PostScript.cxx @@ -974,9 +974,9 @@ void Fl_PostScript_Graphics_Driver::color(unsigned char r, unsigned char g, unsi } } -void Fl_PostScript_Graphics_Driver::draw(int angle, const char *str, int n, int x, int y) +void Fl_PostScript_Graphics_Driver::draw(int rotation, const char *str, int n, int x, int y) { - fprintf(output, "GS %d %d translate %d rotate\n", x, y, - angle); + fprintf(output, "GS %d %d translate %d rotate\n", x, y, -rotation); this->transformed_draw(str, n, 0, 0); fprintf(output, "GR\n"); } @@ -1046,7 +1046,7 @@ void Fl_PostScript_Graphics_Driver::transformed_draw_extra(const char* str, int font(fontnum, old_size); fl_delete_offscreen(off); // compute the mask of what is not the background - uchar *mask = calc_mask(img, w2, h, bg_color); + uchar *img_mask = calc_mask(img, w2, h, bg_color); delete[] img; // write the string image to PostScript as a scaled bitmask scale = w2 / float(w); @@ -1055,14 +1055,14 @@ void Fl_PostScript_Graphics_Driver::transformed_draw_extra(const char* str, int int wmask = (w2+7)/8; void *rle85 = prepare_rle85(); for (int j = h - 1; j >= 0; j--){ - di = mask + j * wmask; + di = img_mask + j * wmask; for (int i = 0; i < wmask; i++){ write_rle85(*di, rle85); di++; } } close_rle85(rle85); fputc('\n', output); - delete[] mask; + delete[] img_mask; } static int is_in_table(unsigned utf) { diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx index 7e1717650..9c4acee95 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx @@ -152,8 +152,8 @@ const char* Fl_Quartz_Graphics_Driver::get_font_name(Fl_Font fnum, int* ap) { Fl_Fontdesc *f = fl_fonts + fnum; if (!f->fontname[0]) { this->set_fontname_in_fontdesc(f); - const char* p = f->name; - if (!p || !*p) {if (ap) *ap = 0; return "";} + const char* thisFont = f->name; + if (!thisFont || !*thisFont) {if (ap) *ap = 0; return "";} int type = 0; if (strstr(f->name, "Bold")) type |= FL_BOLD; if (strstr(f->name, "Italic") || strstr(f->name, "Oblique")) type |= FL_ITALIC; diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx index 2427c2084..bb4240864 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx @@ -310,8 +310,8 @@ void Fl_Quartz_Graphics_Driver::draw_CGImage(CGImageRef cgimg, int x, int y, int CGContextRestoreGState(gc_); } -void Fl_Quartz_Graphics_Driver::uncache_pixmap(fl_uintptr_t p) { - CGImageRelease((CGImageRef)p); +void Fl_Quartz_Graphics_Driver::uncache_pixmap(fl_uintptr_t pixmap_ref) { + CGImageRelease((CGImageRef)pixmap_ref); } // diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx index 88071d8df..1945ea55d 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx @@ -56,8 +56,8 @@ void Fl_Quartz_Graphics_Driver::line_style(int style, int width, char* dashes) { char *d = dashes; static CGFloat pattern[16]; if (d && *d) { - CGFloat *p = pattern; - while (*d) { *p++ = (float)*d++; } + CGFloat *pDst = pattern; + while (*d) { *pDst++ = (float)*d++; } quartz_line_pattern = pattern; quartz_line_pattern_size = d-dashes; } else if (style & 0xff) { @@ -71,14 +71,14 @@ void Fl_Quartz_Graphics_Driver::line_style(int style, int width, char* dashes) { dash = char(3*width); dot = gap = char(width); } - CGFloat *p = pattern; + CGFloat *pDst = pattern; switch (style & 0xff) { - case FL_DASH: *p++ = dash; *p++ = gap; break; - case FL_DOT: *p++ = dot; *p++ = gap; break; - case FL_DASHDOT: *p++ = dash; *p++ = gap; *p++ = dot; *p++ = gap; break; - case FL_DASHDOTDOT: *p++ = dash; *p++ = gap; *p++ = dot; *p++ = gap; *p++ = dot; *p++ = gap; break; + case FL_DASH: *pDst++ = dash; *pDst++ = gap; break; + case FL_DOT: *pDst++ = dot; *pDst++ = gap; break; + case FL_DASHDOT: *pDst++ = dash; *pDst++ = gap; *pDst++ = dot; *pDst++ = gap; break; + case FL_DASHDOTDOT: *pDst++ = dash; *pDst++ = gap; *pDst++ = dot; *pDst++ = gap; *pDst++ = dot; *pDst++ = gap; break; } - quartz_line_pattern_size = p-pattern; + quartz_line_pattern_size = pDst-pattern; quartz_line_pattern = pattern; } else { quartz_line_pattern = 0; diff --git a/src/fl_curve.cxx b/src/fl_curve.cxx index ec54e711c..73977af03 100644 --- a/src/fl_curve.cxx +++ b/src/fl_curve.cxx @@ -60,11 +60,11 @@ void Fl_Graphics_Driver::curve(double X0, double Y0, if (b > a) a = b; // use that to guess at the number of segments: - int n = int(sqrt(a)/4); - if (n > 1) { - if (n > 100) n = 100; // make huge curves not hang forever + int nSeg = int(sqrt(a)/4); + if (nSeg > 1) { + if (nSeg > 100) nSeg = 100; // make huge curves not hang forever - double e = 1.0/n; + double e = 1.0/nSeg; // calculate the coefficients of 3rd order equation: double xa = (x3-3*x2+3*x1-x); @@ -85,7 +85,7 @@ void Fl_Graphics_Driver::curve(double X0, double Y0, double dy2 = dy3 + 2*yb*e*e; // draw points 1 .. n-2: - for (int m=2; m<n; m++) { + for (int i=2; i<n; i++) { x += dx1; dx1 += dx2; dx2 += dx3; diff --git a/src/fl_draw_pixmap.cxx b/src/fl_draw_pixmap.cxx index 8669331c1..42b7e25f0 100644 --- a/src/fl_draw_pixmap.cxx +++ b/src/fl_draw_pixmap.cxx @@ -240,19 +240,19 @@ int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) { int W = (w+7)/8; uchar* bitmap = new uchar[W * h]; *p = bitmap; - const uchar *p = &buffer[3]; + const uchar *alphaPtr = &buffer[3]; uchar b = 0; for (int Y = 0; Y < h; Y++) { b = 0; - for (int X = 0, bit = 1; X < w; X++, p += 4) { - if (*p > 127) + for (int X = 0, bit = 1; X < w; X++, alphaPtr += 4) { + if (*alphaPtr > 127) b |= bit; - bit <<= 1; + bit <<= 1; if (bit > 0x80 || X == w-1) { - *bitmap++ = b; + *bitmap++ = b; bit = 1; - b = 0; - } + b = 0; + } } // if chars_per_pixel } // for Y } diff --git a/src/fl_file_dir.cxx b/src/fl_file_dir.cxx index 26247e4fc..ab16c55d7 100644 --- a/src/fl_file_dir.cxx +++ b/src/fl_file_dir.cxx @@ -34,14 +34,14 @@ static void callback(Fl_File_Chooser *, void*) { } // Pop up a file chooser dialog window and wait until it is closed... -static void popup(Fl_File_Chooser *fc) { - fc->show(); +static void popup(Fl_File_Chooser *filechooser) { + filechooser->show(); // deactivate Fl::grab(), because it is incompatible with modal windows Fl_Window* g = Fl::grab(); if (g) Fl::grab(0); - while (fc->shown()) + while (filechooser->shown()) Fl::wait(); if (g) // regrab the previous popup menu, if there was one |
