diff options
| -rw-r--r-- | src/Fl.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_Browser.cxx | 9 | ||||
| -rw-r--r-- | src/Fl_Help_View.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_Input.cxx | 12 | ||||
| -rw-r--r-- | src/Fl_Input_.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_Menu.cxx | 7 | ||||
| -rw-r--r-- | src/Fl_Preferences.cxx | 19 | ||||
| -rw-r--r-- | src/Fl_Scroll.cxx | 6 | ||||
| -rw-r--r-- | src/Fl_Shared_Image.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_Tabs.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_Text_Buffer.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_Tile.cxx | 8 | ||||
| -rw-r--r-- | src/Fl_XPM_Image.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_compose.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_lock.cxx | 10 | ||||
| -rw-r--r-- | src/Fl_x.cxx | 14 | ||||
| -rw-r--r-- | src/fl_boxtype.cxx | 16 | ||||
| -rw-r--r-- | src/fl_color.cxx | 2 | ||||
| -rw-r--r-- | src/fl_draw_pixmap.cxx | 2 | ||||
| -rw-r--r-- | src/fl_font_xft.cxx | 2 | ||||
| -rw-r--r-- | src/fl_plastic.cxx | 60 | ||||
| -rw-r--r-- | src/fl_set_fonts_xft.cxx | 2 | ||||
| -rw-r--r-- | src/print_panel.cxx | 2 |
23 files changed, 99 insertions, 88 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index 55dedea96..c2e0c3eaf 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -986,7 +986,7 @@ int Fl::handle(int e, Fl_Window* window) switch (e) { case FL_CLOSE: - if (grab() || modal() && window != modal()) return 0; + if ( grab() || (modal() && window != modal()) ) return 0; wi->do_callback(); return 1; diff --git a/src/Fl_Browser.cxx b/src/Fl_Browser.cxx index 7a604f5db..84e700171 100644 --- a/src/Fl_Browser.cxx +++ b/src/Fl_Browser.cxx @@ -375,6 +375,7 @@ int Fl_Browser::item_height(void *item) const { if (hh > hmax) hmax = hh; } else { const int* i = column_widths(); + long int dummy; // do each column separately as they may all set different fonts: for (char* str = l->txt; str && *str; str++) { Fl_Font font = textfont(); // default font @@ -389,7 +390,7 @@ int Fl_Browser::item_height(void *item) const { case 'i': font = (Fl_Font)(font|FL_ITALIC); break; case 'f': case 't': font = FL_COURIER; break; case 'B': - case 'C': strtol(str, &str, 10); break;// skip a color number + case 'C': dummy = strtol(str, &str, 10); break;// skip a color number case 'F': font = (Fl_Font)strtol(str,&str,10); break; case 'S': tsize = strtol(str,&str,10); break; case 0: case '@': str--; @@ -442,6 +443,7 @@ int Fl_Browser::item_width(void *item) const { int done = 0; while (*str == format_char_ && str[1] && str[1] != format_char_) { + long int dummy; str ++; switch (*str++) { case 'l': case 'L': tsize = 24; break; @@ -451,7 +453,7 @@ int Fl_Browser::item_width(void *item) const { case 'i': font = (Fl_Font)(font|FL_ITALIC); break; case 'f': case 't': font = FL_COURIER; break; case 'B': - case 'C': strtol(str, &str, 10); break;// skip a color number + case 'C': dummy = strtol(str, &str, 10); break;// skip a color number case 'F': font = (Fl_Font)strtol(str, &str, 10); break; case 'S': tsize = strtol(str, &str, 10); break; case '.': @@ -536,6 +538,7 @@ void Fl_Browser::item_draw(void* item, int X, int Y, int W, int H) const { //#warning FIXME This maybe needs to be more UTF8 aware now...? //#endif /*__GNUC__*/ while (*str == format_char() && *++str && *str != format_char()) { + long int dummy; switch (*str++) { case 'l': case 'L': tsize = 24; break; case 'm': case 'M': tsize = 18; break; @@ -549,7 +552,7 @@ void Fl_Browser::item_draw(void* item, int X, int Y, int W, int H) const { if (!(l->flags & SELECTED)) { fl_color((Fl_Color)strtol(str, &str, 10)); fl_rectf(X, Y, w1, H); - } else strtol(str, &str, 10); + } else dummy = strtol(str, &str, 10); break; case 'C': lcol = (Fl_Color)strtol(str, &str, 10); diff --git a/src/Fl_Help_View.cxx b/src/Fl_Help_View.cxx index fe841b88e..38c6a293b 100644 --- a/src/Fl_Help_View.cxx +++ b/src/Fl_Help_View.cxx @@ -3201,7 +3201,7 @@ Fl_Help_View::load(const char *f)// I - Filename to load (may also have target) rewind(fp); value_ = (const char *)calloc(len + 1, 1); - fread((void *)value_, 1, len, fp); + if (fread((void *)value_, 1, len, fp)==0) { /* use default 0 */ } fclose(fp); } else diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx index b5ffb3f8f..0a7a05ea9 100644 --- a/src/Fl_Input.cxx +++ b/src/Fl_Input.cxx @@ -123,12 +123,12 @@ int Fl_Input::handle_key() { // find the insert position int ip = position()<mark() ? position() : mark(); // This is complex to allow "0xff12" hex to be typed: - if (!ip && (ascii == '+' || ascii == '-') + if ( (!ip && (ascii == '+' || ascii == '-')) || (ascii >= '0' && ascii <= '9') || (ip==1 && index(0)=='0' && (ascii=='x' || ascii == 'X')) - || (ip>1 && index(0)=='0' && (index(1)=='x'||index(1)=='X') - && (ascii>='A'&& ascii<='F' || ascii>='a'&& ascii<='f')) - || input_type()==FL_FLOAT_INPUT && ascii && strchr(legal_fp_chars, ascii)) + || (ip>1 && index(0)=='0' && (index(1)=='x'||index(1)=='X') + && ((ascii>='A'&& ascii<='F') || (ascii>='a'&& ascii<='f'))) + || (input_type()==FL_FLOAT_INPUT && ascii && strchr(legal_fp_chars, ascii))) { if (readonly()) fl_beep(); else replace(position(), mark(), &ascii, 1); @@ -532,8 +532,8 @@ int Fl_Input::handle(int event) { newpos = position(); position( oldpos, oldmark ); if (Fl::focus()==this && !Fl::event_state(FL_SHIFT) && input_type()!=FL_SECRET_INPUT && - (newpos >= mark() && newpos < position() || - newpos >= position() && newpos < mark())) { + ( (newpos >= mark() && newpos < position()) + || (newpos >= position() && newpos < mark())) ) { // user clicked in the selection, may be trying to drag drag_start = newpos; return 1; diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx index d39fe62d6..54decb328 100644 --- a/src/Fl_Input_.cxx +++ b/src/Fl_Input_.cxx @@ -844,7 +844,7 @@ int Fl_Input_::replace(int b, int e, const char* text, int ilen) { */ int Fl_Input_::undo() { was_up_down = 0; - if (undowidget != this || !undocut && !undoinsert) return 0; + if ( undowidget != this || (!undocut && !undoinsert) ) return 0; int ilen = undocut; int xlen = undoinsert; diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx index 21df2dc95..e924bc209 100644 --- a/src/Fl_Menu.cxx +++ b/src/Fl_Menu.cxx @@ -686,7 +686,7 @@ int menuwindow::early_hide_handle(int e) { } return 1; case FL_Right: - if (pp.menubar && (pp.menu_number<=0 || pp.menu_number==1 && pp.nummenus==2)) + if (pp.menubar && (pp.menu_number<=0 || (pp.menu_number==1 && pp.nummenus==2))) forward(0); else if (pp.menu_number < pp.nummenus-1) forward(pp.menu_number+1); return 1; @@ -774,8 +774,9 @@ int menuwindow::early_hide_handle(int e) { case FL_RELEASE: // Mouse must either be held down/dragged some, or this must be // the second click (not the one that popped up the menu): - if (!Fl::event_is_click() || pp.state == PUSH_STATE || - pp.menubar && pp.current_item && !pp.current_item->submenu() // button + if ( !Fl::event_is_click() + || pp.state == PUSH_STATE + || (pp.menubar && pp.current_item && !pp.current_item->submenu()) // button ) { #if 0 // makes the check/radio items leave the menu up const Fl_Menu_Item* m = pp.current_item; diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx index bc3df3d33..d8d3eaf10 100644 --- a/src/Fl_Preferences.cxx +++ b/src/Fl_Preferences.cxx @@ -162,9 +162,7 @@ const char *Fl_Preferences::newUUID() b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15]); } #else -# if defined(__GNUC__) -# warning Unix implementation of Fl_Preferences::newUUID() incomplete! -# endif /*__GNUC__*/ + // warning Unix implementation of Fl_Preferences::newUUID() incomplete! // #include <uuid/uuid.h> // void uuid_generate(uuid_t out); unsigned char b[16]; @@ -692,8 +690,13 @@ static char *decodeText( const char *src ) const char *s = src; for ( ; *s; s++, len++ ) { - if ( *s == '\\' ) - if ( isdigit( s[1] ) ) s+=3; else s+=1; + if ( *s == '\\' ) { + if ( isdigit( s[1] ) ) { + s+=3; + } else { + s+=1; + } + } } char *dst = (char*)malloc( len+1 ), *d = dst; for ( s = src; *s; s++ ) @@ -1267,9 +1270,9 @@ int Fl_Preferences::RootNode::read() if ( !f ) return -1; - fgets( buf, 1024, f ); - fgets( buf, 1024, f ); - fgets( buf, 1024, f ); + if (fgets( buf, 1024, f )==0) { /* ignore */ } + if (fgets( buf, 1024, f )==0) { /* ignore */ } + if (fgets( buf, 1024, f )==0) { /* ignore */ } Node *nd = prefs_->node; for (;;) { diff --git a/src/Fl_Scroll.cxx b/src/Fl_Scroll.cxx index 0089524dd..d4a187301 100644 --- a/src/Fl_Scroll.cxx +++ b/src/Fl_Scroll.cxx @@ -348,9 +348,9 @@ void Fl_Scroll::resize(int X, int Y, int W, int H) { o->position(o->x()+dx, o->y()+dy); } if (dw==0 && dh==0) { - char pad = (scrollbar.visible() && hscrollbar.visible()); - char al = (scrollbar.align()&FL_ALIGN_LEFT!=0); - char at = (scrollbar.align()&FL_ALIGN_TOP!=0); + char pad = ( scrollbar.visible() && hscrollbar.visible() ); + char al = ( (scrollbar.align() & FL_ALIGN_LEFT) != 0 ); + char at = ( (scrollbar.align() & FL_ALIGN_TOP) !=0 ); scrollbar.position(al?X:X+W-scrollbar.w(), (at&&pad)?Y+hscrollbar.h():Y); hscrollbar.position((al&&pad)?X+scrollbar.w():X, at?Y:Y+H-hscrollbar.h()); } else { diff --git a/src/Fl_Shared_Image.cxx b/src/Fl_Shared_Image.cxx index c3dc5fd6d..9839544f8 100644 --- a/src/Fl_Shared_Image.cxx +++ b/src/Fl_Shared_Image.cxx @@ -228,7 +228,7 @@ void Fl_Shared_Image::reload() { if (!name_) return; if ((fp = fl_fopen(name_, "rb")) != NULL) { - fread(header, 1, sizeof(header), fp); + if (fread(header, 1, sizeof(header), fp)==0) { /* ignore */ } fclose(fp); } else { return; diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx index 7ea3aae98..95f0384b8 100644 --- a/src/Fl_Tabs.cxx +++ b/src/Fl_Tabs.cxx @@ -246,7 +246,7 @@ int Fl_Tabs::handle(int event) { int Fl_Tabs::push(Fl_Widget *o) { if (push_ == o) return 0; - if (push_ && !push_->visible() || o && !o->visible()) + if ( (push_ && !push_->visible()) || (o && !o->visible()) ) redraw_tabs(); push_ = o; return 1; diff --git a/src/Fl_Text_Buffer.cxx b/src/Fl_Text_Buffer.cxx index a2c325464..002454462 100644 --- a/src/Fl_Text_Buffer.cxx +++ b/src/Fl_Text_Buffer.cxx @@ -414,7 +414,7 @@ void Fl_Text_Buffer::copy(Fl_Text_Buffer * fromBuf, int fromStart, int Fl_Text_Buffer::undo(int *cursorPos) { - if (undowidget != this || !undocut && !undoinsert && !mCanUndo) + if (undowidget != this || (!undocut && !undoinsert && !mCanUndo) ) return 0; int ilen = undocut; diff --git a/src/Fl_Tile.cxx b/src/Fl_Tile.cxx index a211fd673..a747a93ed 100644 --- a/src/Fl_Tile.cxx +++ b/src/Fl_Tile.cxx @@ -52,17 +52,17 @@ void Fl_Tile::position(int oix, int oiy, int newx, int newy) { int R = X+o->w(); if (oix) { int t = p[0]; - if (t == oix || t>oix && X<newx || t<oix && X>newx) X = newx; + if (t == oix || (t>oix && X<newx) || (t<oix && X>newx) ) X = newx; t = p[1]; - if (t == oix || t>oix && R<newx || t<oix && R>newx) R = newx; + if (t == oix || (t>oix && R<newx) || (t<oix && R>newx) ) R = newx; } int Y = o->y(); int B = Y+o->h(); if (oiy) { int t = p[2]; - if (t == oiy || t>oiy && Y<newy || t<oiy && Y>newy) Y = newy; + if (t == oiy || (t>oiy && Y<newy) || (t<oiy && Y>newy) ) Y = newy; t = p[3]; - if (t == oiy || t>oiy && B<newy || t<oiy && B>newy) B = newy; + if (t == oiy || (t>oiy && B<newy) || (t<oiy && B>newy) ) B = newy; } o->damage_resize(X,Y,R-X,B-Y); } diff --git a/src/Fl_XPM_Image.cxx b/src/Fl_XPM_Image.cxx index 270830781..2faeb11d9 100644 --- a/src/Fl_XPM_Image.cxx +++ b/src/Fl_XPM_Image.cxx @@ -77,7 +77,7 @@ Fl_XPM_Image::Fl_XPM_Image(const char *name) : Fl_Pixmap((char *const*)0) { if (*q == '\\') switch (*++q) { case '\r': case '\n': - fgets(q,(buffer+MAXSIZE+20)-q,f); break; + if (!fgets(q,(buffer+MAXSIZE+20)-q,f)) { /* no problem if we hit EOF */ } break; case 0: break; case 'x': { diff --git a/src/Fl_compose.cxx b/src/Fl_compose.cxx index 1601c74dd..d2f136012 100644 --- a/src/Fl_compose.cxx +++ b/src/Fl_compose.cxx @@ -176,7 +176,7 @@ int Fl::compose(int& del) { char c1 = char(compose_state); // retrieve first character // now search for the pair in either order: for (const char *p = compose_pairs; *p; p += 2) { - if (p[0] == ascii && p[1] == c1 || p[1] == ascii && p[0] == c1) { + if ( (p[0] == ascii && p[1] == c1) || (p[1] == ascii && p[0] == c1)) { int len = fl_utf8encode((p-compose_pairs)/2+0xA0, e_text); e_text[len] = '\0'; e_length = len; diff --git a/src/Fl_lock.cxx b/src/Fl_lock.cxx index 27787cd99..39d9a8368 100644 --- a/src/Fl_lock.cxx +++ b/src/Fl_lock.cxx @@ -304,7 +304,7 @@ static void unlock_function_rec() { # endif // PTHREAD_MUTEX_RECURSIVE void Fl::awake(void* msg) { - write(thread_filedes[1], &msg, sizeof(void*)); + if (write(thread_filedes[1], &msg, sizeof(void*))==0) { /* ignore */ } } static void* thread_message_; @@ -315,7 +315,9 @@ void* Fl::thread_message() { } static void thread_awake_cb(int fd, void*) { - read(fd, &thread_message_, sizeof(void*)); + if (read(fd, &thread_message_, sizeof(void*))==0) { + /* This should never happen */ + } Fl_Awake_Handler func; void *data; while (Fl::get_awake_handler_(func, data)==0) { @@ -331,7 +333,9 @@ void Fl::lock() { if (!thread_filedes[1]) { // Initialize thread communication pipe to let threads awake FLTK // from Fl::wait() - pipe(thread_filedes); + if (pipe(thread_filedes)==-1) { + /* this should not happen */ + } // Make the write side of the pipe non-blocking to avoid deadlock // conditions (STR #1537) diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index ee437f1d4..4467ff760 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -350,19 +350,19 @@ void fl_new_ic() #if USE_XFT #if defined(__GNUC__) -#warning XFT support here +// FIXME: warning XFT support here #endif /*__GNUC__*/ if (!fs) { fnt = NULL;//fl_get_font_xfld(0, 14); - if (!fnt) {fnt = "-misc-fixed-*";must_free_fnt=false;} + if (!fnt) {fnt = (char*)"-misc-fixed-*";must_free_fnt=false;} fs = XCreateFontSet(fl_display, fnt, &missing_list, &missing_count, &def_string); } #else if (!fs) { fnt = fl_get_font_xfld(0, 14); - if (!fnt) {fnt = "-misc-fixed-*";must_free_fnt=false;} + if (!fnt) {fnt = (char*)"-misc-fixed-*";must_free_fnt=false;} fs = XCreateFontSet(fl_display, fnt, &missing_list, &missing_count, &def_string); } @@ -465,16 +465,16 @@ void fl_set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win) #if USE_XFT #if defined(__GNUC__) -#warning XFT support here +// FIXME: warning XFT support here #endif /*__GNUC__*/ fnt = NULL; // fl_get_font_xfld(font, size); - if (!fnt) {fnt = "-misc-fixed-*";must_free_fnt=false;} + if (!fnt) {fnt = (char*)"-misc-fixed-*";must_free_fnt=false;} fs = XCreateFontSet(fl_display, fnt, &missing_list, &missing_count, &def_string); #else fnt = fl_get_font_xfld(font, size); - if (!fnt) {fnt = "-misc-fixed-*";must_free_fnt=false;} + if (!fnt) {fnt = (char*)"-misc-fixed-*";must_free_fnt=false;} fs = XCreateFontSet(fl_display, fnt, &missing_list, &missing_count, &def_string); #endif @@ -1725,7 +1725,7 @@ void Fl_Window::label(const char *name,const char *iname) { // contents are restored to the area, but this assumes the area // is cleared to background color. So this is disabled in this version. // Fl_Window *fl_boxcheat; -static inline int can_boxcheat(uchar b) {return (b==1 || (b&2) && b<=15);} +static inline int can_boxcheat(uchar b) {return (b==1 || ((b&2) && b<=15));} void Fl_Window::show() { image(Fl::scheme_bg_); diff --git a/src/fl_boxtype.cxx b/src/fl_boxtype.cxx index c8a824e5c..cbf11288c 100644 --- a/src/fl_boxtype.cxx +++ b/src/fl_boxtype.cxx @@ -81,19 +81,19 @@ void fl_frame(const char* s, int x, int y, int w, int h) { uchar *g = fl_gray_ramp(); if (h > 0 && w > 0) for (;*s;) { // draw top line: - fl_color(g[*s++]); + fl_color(g[(int)*s++]); fl_xyline(x, y, x+w-1); y++; if (--h <= 0) break; // draw left line: - fl_color(g[*s++]); + fl_color(g[(int)*s++]); fl_yxline(x, y+h-1, y); x++; if (--w <= 0) break; // draw bottom line: - fl_color(g[*s++]); + fl_color(g[(int)*s++]); fl_xyline(x, y+h-1, x+w-1); if (--h <= 0) break; // draw right line: - fl_color(g[*s++]); + fl_color(g[(int)*s++]); fl_yxline(x+w-1, y+h-1, y); if (--w <= 0) break; } @@ -115,19 +115,19 @@ void fl_frame2(const char* s, int x, int y, int w, int h) { uchar *g = fl_gray_ramp(); if (h > 0 && w > 0) for (;*s;) { // draw bottom line: - fl_color(g[*s++]); + fl_color(g[(int)*s++]); fl_xyline(x, y+h-1, x+w-1); if (--h <= 0) break; // draw right line: - fl_color(g[*s++]); + fl_color(g[(int)*s++]); fl_yxline(x+w-1, y+h-1, y); if (--w <= 0) break; // draw top line: - fl_color(g[*s++]); + fl_color(g[(int)*s++]); fl_xyline(x, y, x+w-1); y++; if (--h <= 0) break; // draw left line: - fl_color(g[*s++]); + fl_color(g[(int)*s++]); fl_yxline(x, y+h-1, y); x++; if (--w <= 0) break; } diff --git a/src/fl_color.cxx b/src/fl_color.cxx index 9c8c4bb25..b50b0794d 100644 --- a/src/fl_color.cxx +++ b/src/fl_color.cxx @@ -202,7 +202,7 @@ static inline uchar realcolor(uchar color, uchar mask) { } return result; # else - return (color&mask) | (~mask)&(mask>>1); + return (color&mask) | ( (~mask)&(mask>>1) ); # endif } diff --git a/src/fl_draw_pixmap.cxx b/src/fl_draw_pixmap.cxx index 8ece16718..e6e7909dc 100644 --- a/src/fl_draw_pixmap.cxx +++ b/src/fl_draw_pixmap.cxx @@ -63,7 +63,7 @@ int fl_measure_pixmap(/*const*/ char* const* data, int &w, int &h) { int fl_measure_pixmap(const char * const *cdata, int &w, int &h) { int i = sscanf(cdata[0],"%d%d%d%d",&w,&h,&ncolors,&chars_per_pixel); if (i<4 || w<=0 || h<=0 || - chars_per_pixel!=1 && chars_per_pixel!=2) return w=0; + (chars_per_pixel!=1 && chars_per_pixel!=2) ) return w=0; return 1; } diff --git a/src/fl_font_xft.cxx b/src/fl_font_xft.cxx index c249bc52a..88b8692a9 100644 --- a/src/fl_font_xft.cxx +++ b/src/fl_font_xft.cxx @@ -587,7 +587,7 @@ static void fl_drawUCS4(const FcChar32 *str, int n, int x, int y) { void Fl_Graphics_Driver::rtl_draw(const char* c, int n, int x, int y) { #if defined(__GNUC__) -#warning Need to improve this XFT right to left draw function +// FIXME: warning Need to improve this XFT right to left draw function #endif /*__GNUC__*/ // This actually draws LtoR, but aligned to R edge with the glyph order reversed... diff --git a/src/fl_plastic.cxx b/src/fl_plastic.cxx index 1cc4edae5..837f5fd76 100644 --- a/src/fl_plastic.cxx +++ b/src/fl_plastic.cxx @@ -87,13 +87,13 @@ static void frame_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) { { // Draw lines around the perimeter of the button, 4 colors per // circuit. - fl_color(shade_color(g[*c++], bc)); + fl_color(shade_color(g[(int)*c++], bc)); fl_line(x, y + h + b, x + w - 1, y + h + b, x + w + b - 1, y + h); - fl_color(shade_color(g[*c++], bc)); + fl_color(shade_color(g[(int)*c++], bc)); fl_line(x + w + b - 1, y + h, x + w + b - 1, y, x + w - 1, y - b); - fl_color(shade_color(g[*c++], bc)); + fl_color(shade_color(g[(int)*c++], bc)); fl_line(x + w - 1, y - b, x, y - b, x - b, y); - fl_color(shade_color(g[*c++], bc)); + fl_color(shade_color(g[(int)*c++], bc)); fl_line(x - b, y, x - b, y + h, x, y + h + b); } } @@ -106,45 +106,45 @@ static void frame_round(int x, int y, int w, int h, const char *c, Fl_Color bc) if (w==h) { for (; b > 1; b --, x ++, y ++, w -= 2, h -= 2) { - fl_color(shade_color(g[*c++], bc)); + fl_color(shade_color(g[(int)*c++], bc)); fl_arc(x, y, w, h, 45.0, 135.0); - fl_color(shade_color(g[*c++], bc)); + fl_color(shade_color(g[(int)*c++], bc)); fl_arc(x, y, w, h, 315.0, 405.0); - fl_color(shade_color(g[*c++], bc)); + fl_color(shade_color(g[(int)*c++], bc)); fl_arc(x, y, w, h, 225.0, 315.0); - fl_color(shade_color(g[*c++], bc)); + fl_color(shade_color(g[(int)*c++], bc)); fl_arc(x, y, w, h, 135.0, 225.0); } } else if (w>h) { int d = h/2; for (; b > 1; d--, b --, x ++, y ++, w -= 2, h -= 2) { - fl_color(shade_color(g[*c++], bc)); + fl_color(shade_color(g[(int)*c++], bc)); fl_arc(x, y, h, h, 90.0, 135.0); fl_xyline(x+d, y, x+w-d); fl_arc(x+w-h, y, h, h, 45.0, 90.0); - fl_color(shade_color(g[*c++], bc)); + fl_color(shade_color(g[(int)*c++], bc)); fl_arc(x+w-h, y, h, h, 315.0, 405.0); - fl_color(shade_color(g[*c++], bc)); + fl_color(shade_color(g[(int)*c++], bc)); fl_arc(x+w-h, y, h, h, 270.0, 315.0); fl_xyline(x+d, y+h-1, x+w-d); fl_arc(x, y, h, h, 225.0, 270.0); - fl_color(shade_color(g[*c++], bc)); + fl_color(shade_color(g[(int)*c++], bc)); fl_arc(x, y, h, h, 135.0, 225.0); } } else if (w<h) { int d = w/2; for (; b > 1; d--, b --, x ++, y ++, w -= 2, h -= 2) { - fl_color(shade_color(g[*c++], bc)); + fl_color(shade_color(g[(int)*c++], bc)); fl_arc(x, y, w, w, 45.0, 135.0); - fl_color(shade_color(g[*c++], bc)); + fl_color(shade_color(g[(int)*c++], bc)); fl_arc(x, y, w, w, 0.0, 45.0); fl_yxline(x+w-1, y+d, y+h-d); fl_arc(x, y+h-w, w, w, 315.0, 360.0); - fl_color(shade_color(g[*c++], bc)); + fl_color(shade_color(g[(int)*c++], bc)); fl_arc(x, y+h-w, w, w, 225.0, 315.0); - fl_color(shade_color(g[*c++], bc)); + fl_color(shade_color(g[(int)*c++], bc)); fl_arc(x, y+h-w, w, w, 180.0, 225.0); fl_yxline(x, y+d, y+h-d); fl_arc(x, y, w, w, 135.0, 180.0); @@ -166,7 +166,7 @@ static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) { for (i = 0, j = 0; j < chalf; i ++, j += cstep) { // Draw the top line and points... - fl_color(shade_color(g[c[i]], bc)); + fl_color(shade_color(g[(int)c[i]], bc)); fl_xyline(x + 1, y + i, x + w - 2); fl_color(shade_color(g[c[i] - 2], bc)); @@ -174,7 +174,7 @@ static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) { fl_point(x + w - 1, y + i + 1); // Draw the bottom line and points... - fl_color(shade_color(g[c[clen - i]], bc)); + fl_color(shade_color(g[(int)c[clen - i]], bc)); fl_xyline(x + 1, y + h - i, x + w - 2); fl_color(shade_color(g[c[clen - i] - 2], bc)); @@ -185,7 +185,7 @@ static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) { // Draw the interior and sides... i = chalf / cstep; - fl_color(shade_color(g[c[chalf]], bc)); + fl_color(shade_color(g[(int)c[chalf]], bc)); fl_rectf(x + 1, y + i, w - 2, h - 2 * i + 1); fl_color(shade_color(g[c[chalf] - 2], bc)); @@ -197,7 +197,7 @@ static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) { for (i = 0, j = 0; j < chalf; i ++, j += cstep) { // Draw the left line and points... - fl_color(shade_color(g[c[i]], bc)); + fl_color(shade_color(g[(int)c[i]], bc)); fl_yxline(x + i, y + 1, y + h - 1); fl_color(shade_color(g[c[i] - 2], bc)); @@ -205,7 +205,7 @@ static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) { fl_point(x + i + 1, y + h); // Draw the right line and points... - fl_color(shade_color(g[c[clen - i]], bc)); + fl_color(shade_color(g[(int)c[clen - i]], bc)); fl_yxline(x + w - 1 - i, y + 1, y + h - 1); fl_color(shade_color(g[c[clen - i] - 2], bc)); @@ -216,7 +216,7 @@ static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) { // Draw the interior, top, and bottom... i = chalf / cstep; - fl_color(shade_color(g[c[chalf]], bc)); + fl_color(shade_color(g[(int)c[chalf]], bc)); fl_rectf(x + i, y + 1, w - 2 * i, h - 1); fl_color(shade_color(g[c[chalf] - 2], bc)); @@ -236,20 +236,20 @@ static void shade_round(int x, int y, int w, int h, const char *c, Fl_Color bc) const int na = 8; for (i=0; i<chalf; i++, d--, x++, y++, w-=2, h-=2) { - fl_color(shade_color(g[c[i]], bc)); + fl_color(shade_color(g[(int)c[i]], bc)); fl_pie(x, y, h, h, 90.0, 135.0+i*na); fl_xyline(x+d, y, x+w-d); fl_pie(x+w-h, y, h, h, 45.0+i*na, 90.0); - fl_color(shade_color(g[c[i] - 2], bc)); + fl_color(shade_color(g[(int)c[i] - 2], bc)); fl_pie(x+w-h, y, h, h, 315.0+i*na, 405.0+i*na); - fl_color(shade_color(g[c[clen - i]], bc)); + fl_color(shade_color(g[(int)c[clen - i]], bc)); fl_pie(x+w-h, y, h, h, 270.0, 315.0+i*na); fl_xyline(x+d, y+h-1, x+w-d); fl_pie(x, y, h, h, 225.0+i*na, 270.0); - fl_color(shade_color(g[c[clen - i] - 2], bc)); + fl_color(shade_color(g[c[(int)clen - i] - 2], bc)); fl_pie(x, y, h, h, 135.0+i*na, 225.0+i*na); } - fl_color(shade_color(g[c[chalf]], bc)); + fl_color(shade_color(g[(int)c[chalf]], bc)); fl_rectf(x+d, y, w-h+1, h+1); fl_pie(x, y, h, h, 90.0, 270.0); fl_pie(x+w-h, y, h, h, 270.0, 90.0); @@ -258,20 +258,20 @@ static void shade_round(int x, int y, int w, int h, const char *c, Fl_Color bc) const int na = 8; for (i=0; i<chalf; i++, d--, x++, y++, w-=2, h-=2) { - fl_color(shade_color(g[c[i]], bc)); + fl_color(shade_color(g[(int)c[i]], bc)); fl_pie(x, y, w, w, 45.0+i*na, 135.0+i*na); fl_color(shade_color(g[c[i] - 2], bc)); fl_pie(x, y, w, w, 0.0, 45.0+i*na); fl_yxline(x+w-1, y+d, y+h-d); fl_pie(x, y+h-w, w, w, 315.0+i*na, 360.0); - fl_color(shade_color(g[c[clen - i]], bc)); + fl_color(shade_color(g[(int)c[clen - i]], bc)); fl_pie(x, y+h-w, w, w, 225.0+i*na, 315.0+i*na); fl_color(shade_color(g[c[clen - i] - 2], bc)); fl_pie(x, y+h-w, w, w, 180.0, 225.0+i*na); fl_yxline(x, y+d, y+h-d); fl_pie(x, y, w, w, 135.0+i*na, 180.0); } - fl_color(shade_color(g[c[chalf]], bc)); + fl_color(shade_color(g[(int)c[chalf]], bc)); fl_rectf(x, y+d, w+1, h-w+1); fl_pie(x, y, w, w, 0.0, 180.0); fl_pie(x, y+h-w, w, w, 180.0, 360.0); diff --git a/src/fl_set_fonts_xft.cxx b/src/fl_set_fonts_xft.cxx index 212626333..ff25a65f6 100644 --- a/src/fl_set_fonts_xft.cxx +++ b/src/fl_set_fonts_xft.cxx @@ -116,7 +116,7 @@ static void make_raw_name(char *raw, char *pretty) char *nm2 = strchr(pretty, ','); if(nm2) *nm2 = 0; // terminate name after first entry raw[0] = ' '; raw[1] = 0; // Default start of "raw name" text - strncat(raw, pretty, LOCAL_RAW_NAME_MAX); + strncat(raw, pretty, LOCAL_RAW_NAME_MAX-1); #endif // At this point, the name is "marked" as regular... if (style) diff --git a/src/print_panel.cxx b/src/print_panel.cxx index f63946c55..6672ead3a 100644 --- a/src/print_panel.cxx +++ b/src/print_panel.cxx @@ -574,7 +574,7 @@ void print_update_status() { if (print_choice->value()) { snprintf(command, sizeof(command), "lpstat -p '%s'", printer); if ((lpstat = popen(command, "r")) != NULL) { - fgets(status, sizeof(status), lpstat); + if (fgets(status, sizeof(status), lpstat)==0) { /* ignore */ } pclose(lpstat); } else strcpy(status, "printer status unavailable"); } else status[0] = '\0'; |
