Commit 3d76a9fbbe10b59fc7c98fa56b0d9b84df36c063

Just van Rossum 2000-03-02T01:15:37

added cast to the string literal for Text to shut up my compiler. (btw. this literal contains non 7-bit characters!) if compiled for MacOS - use the Mac path separator to get the base file name - don't append .ttf if no dot in the file name

diff --git a/demos/src/ftview.c b/demos/src/ftview.c
index 54f2973..49f5521 100644
--- a/demos/src/ftview.c
+++ b/demos/src/ftview.c
@@ -38,7 +38,7 @@
   char  Header[128];
   char* new_header = 0;
 
-  const unsigned char*  Text =
+  const unsigned char*  Text = (unsigned char*)
 "The quick brown fox jumped over the lazy dog 0123456789 \
 âêîûôäëïöüÿàùéèç &#~\"'(-`_^@)=+° ABCDEFGHIJKLMNOPQRSTUVWXYZ $£^¨*µù%!§:/;.,?<>";
 
@@ -61,7 +61,7 @@
   int  low_prec    = 1;       /* force low precision          */
   int  Num;                   /* current first glyph index    */
 
-  int    res = 96;
+  int    res = 72;
 
   static grColor  fore_color = { 127 };
 
@@ -586,13 +586,15 @@
     hinted      = 1;
     file_loaded = 0;
 
+#ifndef macintosh
     i = strlen( argv[file] );
     while ( i > 0 && argv[file][i] != '\\' && argv[file][i] != '/' )
     {
       if ( argv[file][i] == '.' )
         i = 0;
-        i--; 
+      i--; 
     }
+#endif
 
     filename[128] = '\0';
     alt_filename[128] = '\0';
@@ -600,11 +602,13 @@
     strncpy( filename, argv[file], 128 );
     strncpy( alt_filename, argv[file], 128 );
 
+#ifndef macintosh
     if ( i >= 0 )
     {
       strncpy( filename + strlen( filename ), ".ttf", 4 );
       strncpy( alt_filename + strlen( alt_filename ), ".ttc", 4 );
     }
+#endif
 
     /* Load face */