Author: matt
Date: 2010-10-28 11:02:20 -0700 (Thu, 28 Oct 2010)
New Revision: 7765
Log:
Fixed a bunch of warnings from gcc 4.4.5 . Most of these are parenthesis 
missing to make the precedence of && over || obvious. Ah well, why not... 

Modified:
   branches/branch-1.3/src/Fl.cxx
   branches/branch-1.3/src/Fl_Browser.cxx
   branches/branch-1.3/src/Fl_Help_View.cxx
   branches/branch-1.3/src/Fl_Input.cxx
   branches/branch-1.3/src/Fl_Input_.cxx
   branches/branch-1.3/src/Fl_Menu.cxx
   branches/branch-1.3/src/Fl_Preferences.cxx
   branches/branch-1.3/src/Fl_Scroll.cxx
   branches/branch-1.3/src/Fl_Shared_Image.cxx
   branches/branch-1.3/src/Fl_Tabs.cxx
   branches/branch-1.3/src/Fl_Text_Buffer.cxx
   branches/branch-1.3/src/Fl_Tile.cxx
   branches/branch-1.3/src/Fl_XPM_Image.cxx
   branches/branch-1.3/src/Fl_compose.cxx
   branches/branch-1.3/src/Fl_lock.cxx
   branches/branch-1.3/src/Fl_x.cxx
   branches/branch-1.3/src/fl_boxtype.cxx
   branches/branch-1.3/src/fl_color.cxx
   branches/branch-1.3/src/fl_draw_pixmap.cxx
   branches/branch-1.3/src/fl_font_xft.cxx
   branches/branch-1.3/src/fl_plastic.cxx
   branches/branch-1.3/src/fl_set_fonts_xft.cxx
   branches/branch-1.3/src/print_panel.cxx

Modified: branches/branch-1.3/src/Fl.cxx
===================================================================
--- branches/branch-1.3/src/Fl.cxx      2010-10-28 14:49:12 UTC (rev 7764)
+++ branches/branch-1.3/src/Fl.cxx      2010-10-28 18:02:20 UTC (rev 7765)
@@ -986,7 +986,7 @@
   switch (e) {
 
   case FL_CLOSE:
-    if (grab() || modal() && window != modal()) return 0;
+    if ( grab() || (modal() && window != modal()) ) return 0;
     wi->do_callback();
     return 1;
 

Modified: branches/branch-1.3/src/Fl_Browser.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Browser.cxx      2010-10-28 14:49:12 UTC (rev 
7764)
+++ branches/branch-1.3/src/Fl_Browser.cxx      2010-10-28 18:02:20 UTC (rev 
7765)
@@ -375,6 +375,7 @@
     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 @@
        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 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 @@
     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 @@
     //#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 @@
        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);

Modified: branches/branch-1.3/src/Fl_Help_View.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Help_View.cxx    2010-10-28 14:49:12 UTC (rev 
7764)
+++ branches/branch-1.3/src/Fl_Help_View.cxx    2010-10-28 18:02:20 UTC (rev 
7765)
@@ -3201,7 +3201,7 @@
     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

Modified: branches/branch-1.3/src/Fl_Input.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Input.cxx        2010-10-28 14:49:12 UTC (rev 
7764)
+++ branches/branch-1.3/src/Fl_Input.cxx        2010-10-28 18:02:20 UTC (rev 
7765)
@@ -123,12 +123,12 @@
       // 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 @@
         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;

Modified: branches/branch-1.3/src/Fl_Input_.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Input_.cxx       2010-10-28 14:49:12 UTC (rev 
7764)
+++ branches/branch-1.3/src/Fl_Input_.cxx       2010-10-28 18:02:20 UTC (rev 
7765)
@@ -844,7 +844,7 @@
 */
 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;

Modified: branches/branch-1.3/src/Fl_Menu.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Menu.cxx 2010-10-28 14:49:12 UTC (rev 7764)
+++ branches/branch-1.3/src/Fl_Menu.cxx 2010-10-28 18:02:20 UTC (rev 7765)
@@ -686,7 +686,7 @@
       }
       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 @@
   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;

Modified: branches/branch-1.3/src/Fl_Preferences.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Preferences.cxx  2010-10-28 14:49:12 UTC (rev 
7764)
+++ branches/branch-1.3/src/Fl_Preferences.cxx  2010-10-28 18:02:20 UTC (rev 
7765)
@@ -162,9 +162,7 @@
             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 @@
   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 @@
   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 (;;)
   {

Modified: branches/branch-1.3/src/Fl_Scroll.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Scroll.cxx       2010-10-28 14:49:12 UTC (rev 
7764)
+++ branches/branch-1.3/src/Fl_Scroll.cxx       2010-10-28 18:02:20 UTC (rev 
7765)
@@ -348,9 +348,9 @@
     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 {

Modified: branches/branch-1.3/src/Fl_Shared_Image.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Shared_Image.cxx 2010-10-28 14:49:12 UTC (rev 
7764)
+++ branches/branch-1.3/src/Fl_Shared_Image.cxx 2010-10-28 18:02:20 UTC (rev 
7765)
@@ -228,7 +228,7 @@
   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;

Modified: branches/branch-1.3/src/Fl_Tabs.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Tabs.cxx 2010-10-28 14:49:12 UTC (rev 7764)
+++ branches/branch-1.3/src/Fl_Tabs.cxx 2010-10-28 18:02:20 UTC (rev 7765)
@@ -246,7 +246,7 @@
 
 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;

Modified: branches/branch-1.3/src/Fl_Text_Buffer.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Text_Buffer.cxx  2010-10-28 14:49:12 UTC (rev 
7764)
+++ branches/branch-1.3/src/Fl_Text_Buffer.cxx  2010-10-28 18:02:20 UTC (rev 
7765)
@@ -414,7 +414,7 @@
 
 int Fl_Text_Buffer::undo(int *cursorPos)
 {
-  if (undowidget != this || !undocut && !undoinsert && !mCanUndo)
+  if (undowidget != this || (!undocut && !undoinsert && !mCanUndo) )
     return 0;
   
   int ilen = undocut;

Modified: branches/branch-1.3/src/Fl_Tile.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Tile.cxx 2010-10-28 14:49:12 UTC (rev 7764)
+++ branches/branch-1.3/src/Fl_Tile.cxx 2010-10-28 18:02:20 UTC (rev 7765)
@@ -52,17 +52,17 @@
     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);
   }

Modified: branches/branch-1.3/src/Fl_XPM_Image.cxx
===================================================================
--- branches/branch-1.3/src/Fl_XPM_Image.cxx    2010-10-28 14:49:12 UTC (rev 
7764)
+++ branches/branch-1.3/src/Fl_XPM_Image.cxx    2010-10-28 18:02:20 UTC (rev 
7765)
@@ -77,7 +77,7 @@
       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': {

Modified: branches/branch-1.3/src/Fl_compose.cxx
===================================================================
--- branches/branch-1.3/src/Fl_compose.cxx      2010-10-28 14:49:12 UTC (rev 
7764)
+++ branches/branch-1.3/src/Fl_compose.cxx      2010-10-28 18:02:20 UTC (rev 
7765)
@@ -176,7 +176,7 @@
     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;

Modified: branches/branch-1.3/src/Fl_lock.cxx
===================================================================
--- branches/branch-1.3/src/Fl_lock.cxx 2010-10-28 14:49:12 UTC (rev 7764)
+++ branches/branch-1.3/src/Fl_lock.cxx 2010-10-28 18:02:20 UTC (rev 7765)
@@ -304,7 +304,7 @@
 #  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 @@
 }
 
 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 @@
   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)

Modified: branches/branch-1.3/src/Fl_x.cxx
===================================================================
--- branches/branch-1.3/src/Fl_x.cxx    2010-10-28 14:49:12 UTC (rev 7764)
+++ branches/branch-1.3/src/Fl_x.cxx    2010-10-28 18:02:20 UTC (rev 7765)
@@ -350,19 +350,19 @@
 #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 @@
 #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 @@
 // 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_);

Modified: branches/branch-1.3/src/fl_boxtype.cxx
===================================================================
--- branches/branch-1.3/src/fl_boxtype.cxx      2010-10-28 14:49:12 UTC (rev 
7764)
+++ branches/branch-1.3/src/fl_boxtype.cxx      2010-10-28 18:02:20 UTC (rev 
7765)
@@ -81,19 +81,19 @@
   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 @@
   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;
   }

Modified: branches/branch-1.3/src/fl_color.cxx
===================================================================
--- branches/branch-1.3/src/fl_color.cxx        2010-10-28 14:49:12 UTC (rev 
7764)
+++ branches/branch-1.3/src/fl_color.cxx        2010-10-28 18:02:20 UTC (rev 
7765)
@@ -202,7 +202,7 @@
   }
   return result;
 #  else
-  return (color&mask) | (~mask)&(mask>>1);
+  return (color&mask) | ( (~mask)&(mask>>1) );
 #  endif
 }
 

Modified: branches/branch-1.3/src/fl_draw_pixmap.cxx
===================================================================
--- branches/branch-1.3/src/fl_draw_pixmap.cxx  2010-10-28 14:49:12 UTC (rev 
7764)
+++ branches/branch-1.3/src/fl_draw_pixmap.cxx  2010-10-28 18:02:20 UTC (rev 
7765)
@@ -63,7 +63,7 @@
 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;
 }
 

Modified: branches/branch-1.3/src/fl_font_xft.cxx
===================================================================
--- branches/branch-1.3/src/fl_font_xft.cxx     2010-10-28 14:49:12 UTC (rev 
7764)
+++ branches/branch-1.3/src/fl_font_xft.cxx     2010-10-28 18:02:20 UTC (rev 
7765)
@@ -587,7 +587,7 @@
 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...

Modified: branches/branch-1.3/src/fl_plastic.cxx
===================================================================
--- branches/branch-1.3/src/fl_plastic.cxx      2010-10-28 14:49:12 UTC (rev 
7764)
+++ branches/branch-1.3/src/fl_plastic.cxx      2010-10-28 18:02:20 UTC (rev 
7765)
@@ -87,13 +87,13 @@
   {
     // 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 @@
   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 @@
 
     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 @@
       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 @@
     // 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 @@
 
     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 @@
       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 @@
     // 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 @@
     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 @@
     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);

Modified: branches/branch-1.3/src/fl_set_fonts_xft.cxx
===================================================================
--- branches/branch-1.3/src/fl_set_fonts_xft.cxx        2010-10-28 14:49:12 UTC 
(rev 7764)
+++ branches/branch-1.3/src/fl_set_fonts_xft.cxx        2010-10-28 18:02:20 UTC 
(rev 7765)
@@ -116,7 +116,7 @@
   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)

Modified: branches/branch-1.3/src/print_panel.cxx
===================================================================
--- branches/branch-1.3/src/print_panel.cxx     2010-10-28 14:49:12 UTC (rev 
7764)
+++ branches/branch-1.3/src/print_panel.cxx     2010-10-28 18:02:20 UTC (rev 
7765)
@@ -574,7 +574,7 @@
   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';

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to