Author: fabien
Date: 2012-04-21 19:45:09 -0700 (Sat, 21 Apr 2012)
New Revision: 9373
Log:
Fixed linux 64 gcc 4.6.1 compilation problems

Modified:
   branches/branch-1.3/FL/glut.H
   branches/branch-1.3/configure.in
   branches/branch-1.3/src/fl_ask.cxx
   branches/branch-1.3/src/fl_draw_pixmap.cxx
   branches/branch-1.3/src/glut_compatability.cxx
   branches/branch-1.3/src/xutf8/utf8Input.c
   branches/branch-1.3/src/xutf8/utf8Wrap.c

Modified: branches/branch-1.3/FL/glut.H
===================================================================
--- branches/branch-1.3/FL/glut.H       2012-04-22 00:34:11 UTC (rev 9372)
+++ branches/branch-1.3/FL/glut.H       2012-04-22 02:45:09 UTC (rev 9373)
@@ -233,7 +233,11 @@
 
 // Warning: this cast may not work on all machines:
 inline void glutTimerFunc(unsigned int msec, void (*f)(int), int value) {
+#if defined(__LP64__)
+  Fl::add_timeout(msec*.001, (void (*)(void *))f, (void *) (long long) value);
+#else
   Fl::add_timeout(msec*.001, (void (*)(void *))f, (void *)value);
+#endif
 }
 
 inline void glutMenuStateFunc(void (*f)(int state)) {

Modified: branches/branch-1.3/configure.in
===================================================================
--- branches/branch-1.3/configure.in    2012-04-22 00:34:11 UTC (rev 9372)
+++ branches/branch-1.3/configure.in    2012-04-22 02:45:09 UTC (rev 9373)
@@ -487,7 +487,7 @@
 
 dnl Define both HAVE_SCANDIR... macros, if the POSIX compatible function is
 dnl available. Otherwise: check, whether any scandir prototype is available,
-dnl but don't use it on SunOS and QNX because of an incompatibility in pre-Y2K
+dnl but dont use it on SunOS and QNX because of an incompatibility in pre-Y2K
 dnl SunOS scandir versions. We assume, though, that the POSIX compatible
 dnl version on newer SunOS/Solaris versions works as expected.
 if test "$ac_cv_cxx_scandir_posix" = yes; then

Modified: branches/branch-1.3/src/fl_ask.cxx
===================================================================
--- branches/branch-1.3/src/fl_ask.cxx  2012-04-22 00:34:11 UTC (rev 9372)
+++ branches/branch-1.3/src/fl_ask.cxx  2012-04-22 02:45:09 UTC (rev 9373)
@@ -99,7 +99,11 @@
      else
        button[b] = new Fl_Button(x, 70, 90, 23);
      button[b]->align(FL_ALIGN_INSIDE|FL_ALIGN_WRAP);
+#if defined (__LP64__)
+     button[b]->callback(button_cb,(void *)(long long) b);
+#else
      button[b]->callback(button_cb,(void *)b);
+#endif
    }
  }
  button[0]->shortcut(FL_Escape);

Modified: branches/branch-1.3/src/fl_draw_pixmap.cxx
===================================================================
--- branches/branch-1.3/src/fl_draw_pixmap.cxx  2012-04-22 00:34:11 UTC (rev 
9372)
+++ branches/branch-1.3/src/fl_draw_pixmap.cxx  2012-04-22 02:45:09 UTC (rev 
9373)
@@ -209,7 +209,7 @@
   if (!fl_measure_pixmap(cdata, d.w, d.h)) return 0;
   const uchar*const* data = (const uchar*const*)(cdata+1);
   int transparent_index = -1;
-  uchar *transparent_c = (uchar *)0; // such that transparent_c[0,1,2] are the 
RGB of the transparent color
+//  uchar *transparent_c = (uchar *)0; // such that transparent_c[0,1,2] are 
the RGB of the transparent color
 #ifdef WIN32
   color_count = 0;
   used_colors = (uchar *)malloc(abs(ncolors)*3*sizeof(uchar));
@@ -230,7 +230,7 @@
 #endif
       transparent_index = ' ';
       Fl::get_color(bg, c[0], c[1], c[2]); c[3] = 0;
-      transparent_c = c;
+      // transparent_c = c;
       p += 4;
       ncolors--;
     }
@@ -316,7 +316,7 @@
         c[3] = 0;
 #endif
        transparent_index = ind;
-       transparent_c = c;
+       //transparent_c = c;
       }
     }
   }

Modified: branches/branch-1.3/src/glut_compatability.cxx
===================================================================
--- branches/branch-1.3/src/glut_compatability.cxx      2012-04-22 00:34:11 UTC 
(rev 9372)
+++ branches/branch-1.3/src/glut_compatability.cxx      2012-04-22 02:45:09 UTC 
(rev 9373)
@@ -333,7 +333,12 @@
   Fl_Menu_Item* i = additem(m);
   i->text = label;
   i->callback_ = (Fl_Callback*)(m->cb);
+
+#if defined(__LP64__)
+  i->user_data_ = (void *) (long long) value;
+#else
   i->user_data_ = (void *)value;
+#endif
 }
 
 void glutAddSubMenu(char *label, int submenu) {
@@ -350,7 +355,11 @@
   Fl_Menu_Item* i = &m->m[item-1];
   i->text = label;
   i->callback_ = (Fl_Callback*)(m->cb);
+#if defined(__LP64__)
+  i->user_data_ = (void *) (long long) value;
+#else
   i->user_data_ = (void *)value;
+#endif
   i->flags = 0;
 }
 

Modified: branches/branch-1.3/src/xutf8/utf8Input.c
===================================================================
--- branches/branch-1.3/src/xutf8/utf8Input.c   2012-04-22 00:34:11 UTC (rev 
9372)
+++ branches/branch-1.3/src/xutf8/utf8Input.c   2012-04-22 02:45:09 UTC (rev 
9373)
@@ -62,10 +62,10 @@
   int i = 0;
 #endif
   int l = 0;
-  char *buf, *b;
+  char *buf; // , *b;
 
   if (len < 1) return 0;
-  b = buf = (char*) malloc((unsigned)len);
+  /*b = */ buf = (char*) malloc((unsigned)len);
   memcpy(buf, buffer_return, (unsigned) len);
 
 #if HAVE_LIBC_ICONV
@@ -83,17 +83,22 @@
       ucs = c; 
       i++;
     } else if (c >= 0xa1 && c < 0xff && len - i > 1 ) {
+
+#if 0 
       unsigned char b[2];
       b[0] = (unsigned char) c - 0x80;
       b[1] = (unsigned char) buf[i + 1] - 0x80;
+#endif
       ucs = ' '; i += 2;
     } else if (c == 0x8e &&  len - i > 3) {
-      unsigned char b[2];
       unsigned char c1 =  buf[i + 1];
       unsigned char c2 =  buf[i + 2];
       unsigned char c3 =  buf[i + 3];
+#if 0
+      unsigned char b[2];
       b[0] = (unsigned char)  buf[i + 2] - 0x80;
       b[1] = (unsigned char)  buf[i + 3] - 0x80;
+#endif
       if (c1 >= 0xa1 && c1 <= 0xb0) {
        if (c2 >= 0xa1 && c2 < 0xff && c3 >= 0xa1 && c3 < 0xff) {
          ucs = ' '; i += 4;

Modified: branches/branch-1.3/src/xutf8/utf8Wrap.c
===================================================================
--- branches/branch-1.3/src/xutf8/utf8Wrap.c    2012-04-22 00:34:11 UTC (rev 
9372)
+++ branches/branch-1.3/src/xutf8/utf8Wrap.c    2012-04-22 02:45:09 UTC (rev 
9373)
@@ -230,10 +230,10 @@
           XUtf8FontStruct *font_set) {
 
   int i;
-  char **list;
+  //char **list;
 
   i = 0;
-  list = NULL;
+  //list = NULL;
 
   font_set->fonts = (XFontStruct**) malloc(sizeof(XFontStruct*) *
                                            font_set->nb_font);
@@ -820,19 +820,19 @@
                     XFontStruct      **fnt,
                     unsigned short   *id) {
 
-  int             x;
+  //int             x;
   int             *encodings; /* encodings array */
   XFontStruct     **fonts;    /* fonts array */
   int             fnum;       /* index of the current font in the fonts array*/
-  int             i;          /* current byte in the XChar2b buffer */
+  //int             i;          /* current byte in the XChar2b buffer */
   int             first;      /* first valid font index */
-  int             last_fnum;  /* font index of the previous char */
+  //int             last_fnum;  /* font index of the previous char */
   int             nb_font;    /* quantity of fonts in the font array */
   char                   glyph[2];   /* byte1 and byte2 value of the UTF-8 
char */
   int             *ranges;    /* sub range of iso10646 */
 
   nb_font = font_set->nb_font;
-  x = 0;
+  //x = 0;
 
   if (nb_font < 1) {
     /* there is no font in the font_set :-( */
@@ -842,7 +842,7 @@
   ranges = font_set->ranges;
   fonts = font_set->fonts;
   encodings = font_set->encodings;
-  i = 0;
+  //i = 0;
   fnum = 0;
 
   while(fnum < nb_font && !fonts[fnum]) fnum++;
@@ -852,7 +852,7 @@
   }
 
   first = fnum;
-  last_fnum = fnum;
+  //last_fnum = fnum;
 
   /*
    * find the first encoding which can be used to
@@ -894,9 +894,9 @@
   XFontStruct  **fonts;    /* fonts array */
   Fl_XChar2b   buf[8];     /* drawing buffer */
   int          fnum;       /* index of the current font in the fonts array*/
-  int          i;          /* current byte in the XChar2b buffer */
+  //int                i;          /* current byte in the XChar2b buffer */
   int          first;      /* first valid font index */
-  int          last_fnum;  /* font index of the previous char */
+  //int                last_fnum;  /* font index of the previous char */
   int          nb_font;    /* quantity of fonts in the font array */
   char                 glyph[2];   /* byte1 and byte2 value of the UTF-8 char 
*/
   int          *ranges;    /* sub range of iso10646 */
@@ -913,7 +913,7 @@
   ranges = font_set->ranges;
   fonts = font_set->fonts;
   encodings = font_set->encodings;
-  i = 0;
+  //i = 0;
   fnum = 0;
 
   while(fnum < nb_font && !fonts[fnum]) fnum++;
@@ -923,7 +923,7 @@
   }
 
   first = fnum;
-  last_fnum = fnum;
+  //last_fnum = fnum;
 
   no_spc = XUtf8IsNonSpacing(ucs);
   if (no_spc) ucs = no_spc;

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

Reply via email to