Author: AlbrechtS
Date: 2011-10-19 02:38:03 -0700 (Wed, 19 Oct 2011)
New Revision: 9139
Log:
Removed unused variables (gcc 4.6 warning [-Wunused-but-set-variable])
(ported modifications of fltk 1.3, r 9137-9138).


Modified:
   branches/branch-3.0/src/fltk3/Browser.cxx
   branches/branch-3.0/src/fltk3/TextDisplay.cxx

Modified: branches/branch-3.0/src/fltk3/Browser.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/Browser.cxx   2011-10-19 09:22:52 UTC (rev 
9138)
+++ branches/branch-3.0/src/fltk3/Browser.cxx   2011-10-19 09:38:03 UTC (rev 
9139)
@@ -412,7 +412,6 @@
     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++) {
       fltk3::Font font = textfont(); // default font
@@ -427,7 +426,7 @@
        case 'i': font = (fltk3::Font)(font|fltk3::ITALIC); break;
        case 'f': case 't': font = fltk3::COURIER; break;
        case 'B':
-       case 'C': dummy = strtol(str, &str, 10); break;// skip a color number
+       case 'C': while (isdigit(*str & 255)) str++; break;// skip a color 
number
        case 'F': font = (fltk3::Font)strtol(str,&str,10); break;
        case 'S': tsize = strtol(str,&str,10); break;
        case 0: case '@': str--;
@@ -481,7 +480,6 @@
   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;
@@ -491,7 +489,7 @@
     case 'i': font = (fltk3::Font)(font|fltk3::ITALIC); break;
     case 'f': case 't': font = fltk3::COURIER; break;
     case 'B':
-    case 'C': dummy = strtol(str, &str, 10); break;// skip a color number
+    case 'C': while (isdigit(*str & 255)) str++; break;// skip a color number
     case 'F': font = (fltk3::Font)strtol(str, &str, 10); break;
     case 'S': tsize = strtol(str, &str, 10); break;
     case '.':
@@ -577,7 +575,6 @@
     //#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;
@@ -591,7 +588,7 @@
        if (!(l->flags & SELECTED)) {
          fltk3::color((fltk3::Color)strtol(str, &str, 10));
          fltk3::rectf(X, Y, w1, H);
-       } else dummy = strtol(str, &str, 10);
+       } else while (isdigit(*str & 255)) str++; // skip digits
         break;
       case 'C':
        lcol = (fltk3::Color)strtol(str, &str, 10);

Modified: branches/branch-3.0/src/fltk3/TextDisplay.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/TextDisplay.cxx       2011-10-19 09:22:52 UTC 
(rev 9138)
+++ branches/branch-3.0/src/fltk3/TextDisplay.cxx       2011-10-19 09:38:03 UTC 
(rev 9139)
@@ -817,7 +817,7 @@
 int fltk3::TextDisplay::position_to_xy( int pos, int* X, int* Y ) const {
   IS_UTF8_ALIGNED2(buffer(), pos)
 
-  int lineStartPos, fontHeight, lineLen;
+  int lineStartPos, fontHeight;
   int visLineNum;
   
   /* If position is not displayed, return false */
@@ -844,7 +844,6 @@
     *X = text_area.x - mHorizOffset;
     return 1;
   }
-  lineLen = vline_length( visLineNum );
   *X = text_area.x + handle_vline(GET_WIDTH, lineStartPos, pos-lineStartPos, 
0, 0, 0, 0, 0, 0) - mHorizOffset;
   return 1;
 }
@@ -2988,7 +2987,7 @@
   int nVisLines = mNVisibleLines;
   int *lineStarts = mLineStarts;
   int countFrom, lineStart;
-  int visLineNum = 0, nLines = 0, i;
+  int nLines = 0, i;
   /*
    ** Determine where to begin searching: either the previous newline, or
    ** if possible, limit to the start of the (original) previous displayed
@@ -3000,7 +2999,6 @@
         break;
     if (i > 0) {
       countFrom = lineStarts[i-1];
-      visLineNum = i-1;
     } else
       countFrom = buf->line_start(pos);
   } else

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

Reply via email to