From http://www.jwz.org/xscreensaver/xscreensaver-5.32.tar.gz
[xscreensaver] / hacks / fps.c
index 8a63ccff7fbabdd119fda1b0c55697d3f9c808e0..5704337408f5bff2c9038ea4f0e5c61b61c94e5f 100644 (file)
@@ -1,4 +1,4 @@
-/* fps, Copyright (c) 2001-2011 Jamie Zawinski <jwz@jwz.org>
+/* fps, Copyright (c) 2001-2014 Jamie Zawinski <jwz@jwz.org>
  * Draw a frames-per-second display (Xlib and OpenGL).
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
@@ -152,7 +152,7 @@ fps_compute (fps_state *st, unsigned long polys, double depth)
 
       if (depth >= 0.0)
         {
-          int L = strlen (st->string);
+          unsigned long L = strlen (st->string);
           char *s = st->string + L;
           strcat (s, "\nDepth: ");
           sprintf (s + strlen(s), "%.1f", depth);
@@ -198,7 +198,7 @@ string_width (XFontStruct *f, const char *c, int *height_ret)
 }
 
 
-/* This function is used only in Xlib mode.  For GL mode, see glx/fps-glx.c.
+/* This function is used only in Xlib mode.  For GL mode, see glx/fps-gl.c.
  */
 void
 fps_draw (fps_state *st)
@@ -241,7 +241,7 @@ fps_draw (fps_state *st)
       s = strchr (string, '\n');
       if (! s) s = string + strlen(string);
       XDrawString (st->dpy, st->window, st->draw_gc,
-                   x, y, string, s - string);
+                   x, y, string, (int) (s - string));
       string = s;
       string++;
       lines--;