DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2498
Version: 1.3-current


The problem is in Fl_PostScript_Graphics_Driver::rtl_draw

The two lines are not accepted by Visual C++ because n is not a constant.

  unsigned unis[n + 1];
  char out[n + 1];

A fix could be:


  unsigned int *unis = new unsigned int[n + 1];
  char *out = new char[n + 1];
  
and

  delete [] unis;
  delete [] out;

at the end of the method.  I have attached a patch for this, fltk
branch-1.3 revision 8139


Link: http://www.fltk.org/str.php?L2498
Version: 1.3-current
Index: src/Fl_PostScript.cxx
===================================================================
--- src/Fl_PostScript.cxx       (revision 8140)
+++ src/Fl_PostScript.cxx       (working copy)
@@ -1097,8 +1097,9 @@
 void Fl_PostScript_Graphics_Driver::rtl_draw(const char* str, int n, int x, 
int y) {
   const char *last = str + n;
   const char *str2 = str;
-  unsigned unis[n + 1];
-  char out[n + 1];
+  unsigned int *unis = new unsigned int[n + 1];
+  char *out = new char[n + 1];
+  
   int u = 0, len;
   char *p = out;
   double w = fl_width(str, n);
@@ -1111,6 +1112,9 @@
     p += len;
     }
   transformed_draw(out, p - out, x - w, y);
+
+  delete [] unis;
+  delete [] out;
 }
 
 struct matrix {double a, b, c, d, x, y;};
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to