Author: matt
Date: 2010-10-28 14:47:01 -0700 (Thu, 28 Oct 2010)
New Revision: 7767
Log:
Fixed the remaining warnings

Modified:
   branches/branch-1.3/FL/forms.H
   branches/branch-1.3/fluid/Fl_Function_Type.cxx
   branches/branch-1.3/fluid/Fl_Menu_Type.cxx
   branches/branch-1.3/fluid/Fl_Widget_Type.cxx
   branches/branch-1.3/fluid/Fl_Window_Type.cxx
   branches/branch-1.3/fluid/Fluid_Image.cxx
   branches/branch-1.3/fluid/code.cxx
   branches/branch-1.3/fluid/file.cxx
   branches/branch-1.3/fluid/print_panel.cxx
   branches/branch-1.3/fluid/print_panel.fl
   branches/branch-1.3/src/Fl_BMP_Image.cxx
   branches/branch-1.3/src/Fl_PNM_Image.cxx
   branches/branch-1.3/src/forms_compatability.cxx
   branches/branch-1.3/src/gl_draw.cxx
   branches/branch-1.3/test/demo.cxx
   branches/branch-1.3/test/navigation.cxx

Modified: branches/branch-1.3/FL/forms.H
===================================================================
--- branches/branch-1.3/FL/forms.H      2010-10-28 18:10:17 UTC (rev 7766)
+++ branches/branch-1.3/FL/forms.H      2010-10-28 21:47:01 UTC (rev 7767)
@@ -652,7 +652,7 @@
 FL_EXPORT void fl_show_message(const char *,const char *,const char *);
 FL_EXPORT void fl_show_alert(const char *,const char *,const char *,int=0);
 FL_EXPORT int fl_show_question(const char *,const char *,const char *);
-inline const char *fl_show_input(const char *l,const char*d=0) {return 
fl_input(l,d);}
+inline const char *fl_show_input(const char *l,const char*d=0) {return 
fl_input("%s",d,l);}
 FL_EXPORT /*const*/ char *fl_show_simple_input(const char *label, const char 
*deflt = 0);
 FL_EXPORT int fl_show_choice(
     const char *m1,

Modified: branches/branch-1.3/fluid/Fl_Function_Type.cxx
===================================================================
--- branches/branch-1.3/fluid/Fl_Function_Type.cxx      2010-10-28 18:10:17 UTC 
(rev 7766)
+++ branches/branch-1.3/fluid/Fl_Function_Type.cxx      2010-10-28 21:47:01 UTC 
(rev 7767)
@@ -188,7 +188,7 @@
   function_panel->show();
   const char* message = 0;
   for (;;) { // repeat as long as there are errors
-    if (message) fl_alert(message);
+    if (message) fl_alert("%s", message);
     for (;;) {
       Fl_Widget* w = Fl::readqueue();
       if (w == f_panel_cancel) goto BREAK2;
@@ -332,7 +332,7 @@
           skipc = skipc ? 0 : 1;
         if(!skips && !skipc && plevel==1 && *nptr =='=' && 
            !(nc && *(nptr-1)=='\'') ) // ignore '=' case 
-          while(*++nptr  && (skips || skipc || (*nptr!=',' && *nptr!=')' || 
plevel!=1) )) {
+          while(*++nptr  && (skips || skipc || ( (*nptr!=',' && *nptr!=')') || 
plevel!=1) )) {
             if ( *nptr=='"' &&  *(nptr-1)!='\\' ) 
               skips = skips ? 0 : 1;
             else if(!skips && *nptr=='\'' &&  *(nptr-1)!='\\')
@@ -374,7 +374,7 @@
           skipc = skipc ? 0 : 1;
         if(!skips && !skipc && plevel==1 && *nptr =='=' && 
            !(nc && *(nptr-1)=='\'') ) // ignore '=' case 
-          while(*++nptr  && (skips || skipc || (*nptr!=',' && *nptr!=')' || 
plevel!=1) )) {
+          while(*++nptr  && (skips || skipc || ( (*nptr!=',' && *nptr!=')') || 
plevel!=1) )) {
             if ( *nptr=='"' &&  *(nptr-1)!='\\' ) 
               skips = skips ? 0 : 1;
             else if(!skips && *nptr=='\'' &&  *(nptr-1)!='\\')
@@ -449,7 +449,7 @@
   code_panel->show();
   const char* message = 0;
   for (;;) { // repeat as long as there are errors
-    if (message) fl_alert(message);
+    if (message) fl_alert("%s", message);
     for (;;) {
       Fl_Widget* w = Fl::readqueue();
       if (w == code_panel_cancel) goto BREAK2;
@@ -516,7 +516,7 @@
   codeblock_panel->show();
   const char* message = 0;
   for (;;) { // repeat as long as there are errors
-    if (message) fl_alert(message);
+    if (message) fl_alert("%s", message);
     for (;;) {
       Fl_Widget* w = Fl::readqueue();
       if (w == codeblock_panel_cancel) goto BREAK2;
@@ -620,7 +620,7 @@
   decl_panel->show();
   const char* message = 0;
   for (;;) { // repeat as long as there are errors
-    if (message) fl_alert(message);
+    if (message) fl_alert("%s", message);
     for (;;) {
       Fl_Widget* w = Fl::readqueue();
       if (w == decl_panel_cancel) goto BREAK2;
@@ -668,11 +668,10 @@
   const char* c = name();
   if (!c) return;
   // handle a few keywords differently if inside a class
-  if (is_in_class() && (
-                        !strncmp(c,"class",5) && isspace(c[5])
-                        || !strncmp(c,"typedef",7) && isspace(c[7])
-                        || !strncmp(c,"FL_EXPORT",9) && isspace(c[9])
-                        || !strncmp(c,"struct",6) && isspace(c[6])
+  if (is_in_class() && (   (!strncmp(c,"class",5) && isspace(c[5]))
+                        || (!strncmp(c,"typedef",7) && isspace(c[7]))
+                        || (!strncmp(c,"FL_EXPORT",9) && isspace(c[9]))
+                        || (!strncmp(c,"struct",6) && isspace(c[6]))
                         ) ) {
     write_public(public_);
     write_comment_h("  ");
@@ -680,12 +679,12 @@
     return;
   }
   // handle putting #include, extern, using or typedef into decl:
-  if (!isalpha(*c) && *c != '~'
-      || !strncmp(c,"extern",6) && isspace(c[6])
-      || !strncmp(c,"class",5) && isspace(c[5])
-      || !strncmp(c,"typedef",7) && isspace(c[7])
-      || !strncmp(c,"using",5) && isspace(c[5])
-      || !strncmp(c,"FL_EXPORT",9) && isspace(c[9])
+  if (   (!isalpha(*c) && *c != '~')
+      || (!strncmp(c,"extern",6) && isspace(c[6]))
+      || (!strncmp(c,"class",5) && isspace(c[5]))
+      || (!strncmp(c,"typedef",7) && isspace(c[7]))
+      || (!strncmp(c,"using",5) && isspace(c[5]))
+      || (!strncmp(c,"FL_EXPORT",9) && isspace(c[9]))
       //    || !strncmp(c,"struct",6) && isspace(c[6])
       ) {
     if (public_) {
@@ -779,7 +778,7 @@
   data_panel->show();
   const char* message = 0;
   for (;;) { // repeat as long as there are errors
-    if (message) fl_alert(message);
+    if (message) fl_alert("%s", message);
     for (;;) {
       Fl_Widget* w = Fl::readqueue();
       if (w == data_panel_cancel) goto BREAK2;
@@ -881,7 +880,7 @@
       fseek(f, 0, SEEK_SET);
       if (nData) {
         data = (char*)calloc(nData, 1);
-        fread(data, nData, 1, f);
+        if (fread(data, nData, 1, f)==0) { /* use default */ }
       }
       fclose(f);
     }
@@ -980,7 +979,7 @@
   declblock_panel->show();
   const char* message = 0;
   for (;;) { // repeat as long as there are errors
-    if (message) fl_alert(message);
+    if (message) fl_alert("%s", message);
     for (;;) {
       Fl_Widget* w = Fl::readqueue();
       if (w == declblock_panel_cancel) goto BREAK2;
@@ -1103,7 +1102,7 @@
   char itempath[256]; itempath[0] = 0;
   int last_selected_item = 0;
   for (;;) { // repeat as long as there are errors
-    if (message) fl_alert(message);
+    if (message) fl_alert("%s", message);
     for (;;) {
       Fl_Widget* w = Fl::readqueue();
       if (w == comment_panel_cancel) goto BREAK2;
@@ -1359,7 +1358,7 @@
   char *na=0,*pr=0,*p=0; // name and prefix substrings
   
   for (;;) { // repeat as long as there are errors
-    if (message) fl_alert(message);
+    if (message) fl_alert("%s", message);
     for (;;) {
       Fl_Widget* w = Fl::readqueue();
       if (w == c_panel_cancel) goto BREAK2;

Modified: branches/branch-1.3/fluid/Fl_Menu_Type.cxx
===================================================================
--- branches/branch-1.3/fluid/Fl_Menu_Type.cxx  2010-10-28 18:10:17 UTC (rev 
7766)
+++ branches/branch-1.3/fluid/Fl_Menu_Type.cxx  2010-10-28 21:47:01 UTC (rev 
7767)
@@ -112,10 +112,10 @@
   Fl_Type* q = Fl_Type::current;
   Fl_Type* p = q;
   if (p) {
-    if (force_parent && q->is_menu_item() || !q->is_parent()) p = p->parent;
+    if ( (force_parent && q->is_menu_item()) || !q->is_parent()) p = p->parent;
   }
   force_parent = 0;
-  if (!p || !(p->is_menu_button() || p->is_menu_item() && p->is_parent())) {
+  if (!p || !(p->is_menu_button() || (p->is_menu_item() && p->is_parent()))) {
     fl_message("Please select a menu to add to");
     return 0;
   }
@@ -565,17 +565,17 @@
   if (e == FL_KEYBOARD) {
     if (!value()) return 0;
     int v = Fl::event_text()[0];
-    if (v > 32 && v < 0x7f || v > 0xa0 && v <= 0xff) {
+    if ( (v > 32 && v < 0x7f) || (v > 0xa0 && v <= 0xff) ) {
       if (isupper(v)) {
         v = tolower(v);
         v |= FL_SHIFT;
       }
-      v = v | Fl::event_state()&(FL_META|FL_ALT|FL_CTRL);
+      v = v | (Fl::event_state()&(FL_META|FL_ALT|FL_CTRL));
     } else {
-      v = Fl::event_state()&(FL_META|FL_ALT|FL_CTRL|FL_SHIFT) | 
Fl::event_key();
+      v = (Fl::event_state()&(FL_META|FL_ALT|FL_CTRL|FL_SHIFT)) | 
Fl::event_key();
       if (v == FL_BackSpace && svalue) v = 0;
     }
-               if (v != svalue) {svalue = v; set_changed(); redraw(); 
do_callback(); }
+    if (v != svalue) {svalue = v; set_changed(); redraw(); do_callback(); }
     return 1;
   } else if (e == FL_UNFOCUS) {
     int c = changed(); value(0); if (c) set_changed();

Modified: branches/branch-1.3/fluid/Fl_Widget_Type.cxx
===================================================================
--- branches/branch-1.3/fluid/Fl_Widget_Type.cxx        2010-10-28 18:10:17 UTC 
(rev 7766)
+++ branches/branch-1.3/fluid/Fl_Widget_Type.cxx        2010-10-28 21:47:01 UTC 
(rev 7767)
@@ -260,7 +260,7 @@
 Fl_Type *sort(Fl_Type *parent) {
   Fl_Type *f,*n=0;
   for (f = parent ? parent->next : Fl_Type::first; ; f = n) {
-    if (!f || parent && f->level <= parent->level) return f;
+    if (!f || (parent && f->level <= parent->level)) return f;
     n = sort(f);
     if (!f->selected || (!f->is_widget() || f->is_menu_item())) continue;
     Fl_Widget* fw = ((Fl_Widget_Type*)f)->o;
@@ -1940,7 +1940,7 @@
     if (!e) continue;
     if (strncmp(c,e,d-c)) continue;
     int n1 = atoi(e+(d-c)+1);
-    if (n1 > num || n1==num && sawthis) return 0;
+    if (n1 > num || (n1==num && sawthis)) return 0;
   }
   static char buffer[128];
   // MRS: we want strncpy() here...

Modified: branches/branch-1.3/fluid/Fl_Window_Type.cxx
===================================================================
--- branches/branch-1.3/fluid/Fl_Window_Type.cxx        2010-10-28 18:10:17 UTC 
(rev 7766)
+++ branches/branch-1.3/fluid/Fl_Window_Type.cxx        2010-10-28 21:47:01 UTC 
(rev 7767)
@@ -573,10 +573,34 @@
     R += dx;
     T += dy;
   } else {
-    if (drag&LEFT) if (X==bx) X += dx; else if (X<bx+dx) X = bx+dx;
-    if (drag&TOP) if (Y==by) Y += dy; else if (Y<by+dy) Y = by+dy;
-    if (drag&RIGHT) if (R==br) R += dx; else if (R>br+dx) R = br+dx;
-    if (drag&BOTTOM) if (T==bt) T += dy; else if (T>bt+dx) T = bt+dx;
+    if (drag&LEFT) {
+      if (X==bx) {
+        X += dx; 
+      } else {
+        if (X<bx+dx) X = bx+dx;
+      }
+    }
+    if (drag&TOP) {
+      if (Y==by) {
+        Y += dy;
+      } else {
+        if (Y<by+dy) Y = by+dy;
+      }
+    }
+    if (drag&RIGHT) {
+      if (R==br) {
+        R += dx; 
+      } else {
+        if (R>br+dx) R = br+dx;
+      }
+    }
+    if (drag&BOTTOM) {
+      if (T==bt) {
+        T += dy; 
+      } else {
+        if (T>bt+dx) T = bt+dx;
+      }
+    }
   }
   if (R<X) {int n = X; X = R; R = n;}
   if (T<Y) {int n = Y; Y = T; T = n;}

Modified: branches/branch-1.3/fluid/Fluid_Image.cxx
===================================================================
--- branches/branch-1.3/fluid/Fluid_Image.cxx   2010-10-28 18:10:17 UTC (rev 
7766)
+++ branches/branch-1.3/fluid/Fluid_Image.cxx   2010-10-28 21:47:01 UTC (rev 
7767)
@@ -120,7 +120,7 @@
       fseek(f, 0, SEEK_SET);
       if (nData) {
         char *data = (char*)calloc(nData, 1);
-        fread(data, nData, 1, f);
+        if (fread(data, nData, 1, f)==0) { /* ignore */ }
         write_cdata(data, nData);
         free(data);
       }

Modified: branches/branch-1.3/fluid/code.cxx
===================================================================
--- branches/branch-1.3/fluid/code.cxx  2010-10-28 18:10:17 UTC (rev 7766)
+++ branches/branch-1.3/fluid/code.cxx  2010-10-28 21:47:01 UTC (rev 7767)
@@ -47,7 +47,7 @@
 // return true if c can be in a C identifier.  I needed this so
 // it is not messed up by locale settings:
 int is_id(char c) {
-  return c>='a' && c<='z' || c>='A' && c<='Z' || c>='0' && c<='9' || c=='_';
+  return (c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9') || 
c=='_';
 }
 
 ////////////////////////////////////////////////////////////////
@@ -215,7 +215,7 @@
       // consume them as part of the quoted sequence.  Use string constant
       // pasting to avoid this:
       c = *w;
-      if (w < e && (c>='0'&&c<='9' || c>='a'&&c<='f' || c>='A'&&c<='F')) {
+      if (w < e && ( (c>='0'&&c<='9') || (c>='a'&&c<='f') || (c>='A'&&c<='F') 
)) {
        putc('\"', code_file); linelength++;
        if (linelength >= 79) {fputs("\n",code_file); linelength = 0;}
        putc('\"', code_file); linelength++;

Modified: branches/branch-1.3/fluid/file.cxx
===================================================================
--- branches/branch-1.3/fluid/file.cxx  2010-10-28 18:10:17 UTC (rev 7766)
+++ branches/branch-1.3/fluid/file.cxx  2010-10-28 21:47:01 UTC (rev 7767)
@@ -159,7 +159,7 @@
   if (!fin) {
     char buffer[1024];
     vsnprintf(buffer, sizeof(buffer), format, args);
-    fl_message(buffer);
+    fl_message("%s", buffer);
   } else {
     fprintf(stderr, "%s:%d: ", fname, lineno);
     vfprintf(stderr, format, args);

Modified: branches/branch-1.3/fluid/print_panel.cxx
===================================================================
--- branches/branch-1.3/fluid/print_panel.cxx   2010-10-28 18:10:17 UTC (rev 
7766)
+++ branches/branch-1.3/fluid/print_panel.cxx   2010-10-28 21:47:01 UTC (rev 
7767)
@@ -564,7 +564,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';

Modified: branches/branch-1.3/fluid/print_panel.fl
===================================================================
--- branches/branch-1.3/fluid/print_panel.fl    2010-10-28 18:10:17 UTC (rev 
7766)
+++ branches/branch-1.3/fluid/print_panel.fl    2010-10-28 21:47:01 UTC (rev 
7767)
@@ -344,7 +344,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';

Modified: branches/branch-1.3/src/Fl_BMP_Image.cxx
===================================================================
--- branches/branch-1.3/src/Fl_BMP_Image.cxx    2010-10-28 18:10:17 UTC (rev 
7766)
+++ branches/branch-1.3/src/Fl_BMP_Image.cxx    2010-10-28 21:47:01 UTC (rev 
7767)
@@ -177,7 +177,7 @@
 
   for (repcount = 0; repcount < colors_used; repcount ++) {
     // Read BGR color...
-    fread(colormap[repcount], 1, 3, fp);
+    if (fread(colormap[repcount], 1, 3, fp)==0) { /* ignore */ }
 
     // Skip pad byte for new BMP files...
     if (info_size > 12) getc(fp);

Modified: branches/branch-1.3/src/Fl_PNM_Image.cxx
===================================================================
--- branches/branch-1.3/src/Fl_PNM_Image.cxx    2010-10-28 18:10:17 UTC (rev 
7766)
+++ branches/branch-1.3/src/Fl_PNM_Image.cxx    2010-10-28 21:47:01 UTC (rev 
7767)
@@ -166,7 +166,7 @@
       case 5 :
       case 6 :
         if (maxval < 256) {
-          fread(ptr, w(), d(), fp);
+          if (fread(ptr, w(), d(), fp)) { /* ignored */ }
         } else {
           for (x = d() * w(); x > 0; x --) {
             val = (uchar)getc(fp);

Modified: branches/branch-1.3/src/forms_compatability.cxx
===================================================================
--- branches/branch-1.3/src/forms_compatability.cxx     2010-10-28 18:10:17 UTC 
(rev 7766)
+++ branches/branch-1.3/src/forms_compatability.cxx     2010-10-28 21:47:01 UTC 
(rev 7767)
@@ -204,7 +204,7 @@
 }
 
 char *fl_show_simple_input(const char *str1, const char *defstr) {
-  const char *r = fl_input(str1, defstr);
+  const char *r = fl_input("%s", defstr, str1);
   return (char *)(r ? r : defstr);
 }
 

Modified: branches/branch-1.3/src/gl_draw.cxx
===================================================================
--- branches/branch-1.3/src/gl_draw.cxx 2010-10-28 18:10:17 UTC (rev 7766)
+++ branches/branch-1.3/src/gl_draw.cxx 2010-10-28 21:47:01 UTC (rev 7767)
@@ -84,8 +84,8 @@
 #else // Fltk-1.1.8 style GL font selection
 
 #if defined (USE_X11) // X-windows options follow, either XFT or "plain" X
-#  warning Ideally, for XFT, we really need a glXUseXftFont implementation 
here...
-#  warning GL font selection is basically wrong here
+// FIXME:  warning Ideally, for XFT, we really need a glXUseXftFont 
implementation here...
+// FIXME:  warning GL font selection is basically wrong here
 /* OksiD had a fairly sophisticated scheme for storing multiple X fonts in a 
XUtf8FontStruct,
  * then sorting through them at draw time (for normal X rendering) to find 
which one can
  * render the current glyph... But for now, just use the first font in the 
list for GL...

Modified: branches/branch-1.3/test/demo.cxx
===================================================================
--- branches/branch-1.3/test/demo.cxx   2010-10-28 18:10:17 UTC (rev 7766)
+++ branches/branch-1.3/test/demo.cxx   2010-10-28 21:47:01 UTC (rev 7767)
@@ -417,7 +417,7 @@
     char* command = new char[icommand_length+5]; // 5 for extra './' and ' 
&\0' 
     
     sprintf(command, "./%s &", menus[men].icommand[bn]);
-    system(command);
+    if (system(command)==-1) { /* ignore */ }
     
     delete[] command;
 #endif // WIN32
@@ -518,7 +518,10 @@
   if (buf!=fname)
     strcpy(buf,fname);
   const char *c = fl_filename_name(buf);
-  if (c > buf) {buf[c-buf] = 0; chdir(buf);}
+  if (c > buf) {
+    buf[c-buf] = 0; 
+    if (chdir(buf)==-1) { /* ignore */ }
+  }
   push_menu("@main");
   form->show(argc,argv);
   Fl::run();

Modified: branches/branch-1.3/test/navigation.cxx
===================================================================
--- branches/branch-1.3/test/navigation.cxx     2010-10-28 18:10:17 UTC (rev 
7766)
+++ branches/branch-1.3/test/navigation.cxx     2010-10-28 21:47:01 UTC (rev 
7767)
@@ -57,8 +57,7 @@
       Fl_Widget *o = window.child(n);
       if (x<o->x()+o->w() && x+w>o->x() &&
          y<o->y()+o->h() && y+h>o->y()) break;
-      if (   (!j && (y < o->y())
-          || (y == o->y() && x < o->x())) ) j = o;
+      if ( !j && ( y<o->y() || (y==o->y() && x<o->x()) ) ) j = o;
     }
     // skip if intersection:
     if (n < window.children()) continue;

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

Reply via email to