[gs-cvs] rev 7960 - trunk/gs/src

alexcher at ghostscript.com alexcher at ghostscript.com
Sat May 12 10:09:18 PDT 2007


Author: alexcher
Date: 2007-05-12 10:09:18 -0700 (Sat, 12 May 2007)
New Revision: 7960

Modified:
   trunk/gs/src/gdevm24.c
Log:
Avoid a Valgrind warning and fix an error in debugging statistics collection,
where 0-th element of the table can be used before being assigned a value.

DIFFERENCES:
None


Modified: trunk/gs/src/gdevm24.c
===================================================================
--- trunk/gs/src/gdevm24.c	2007-05-12 15:46:44 UTC (rev 7959)
+++ trunk/gs/src/gdevm24.c	2007-05-12 17:09:18 UTC (rev 7960)
@@ -39,7 +39,7 @@
 	fprevc[257];
     double ftotal;
 } stats_mem24;
-static int prev_count;
+static int prev_count = 0;
 static uint prev_colors[256];
 # define INCR(v) (++(stats_mem24.v))
 #else
@@ -209,11 +209,10 @@
 		    else
 			--ci;
 		}
-		if (ci) {
+		if (ci)
 		    memmove(&prev_colors[1], &prev_colors[0],
 			    ci * sizeof(prev_colors[0]));
-		    prev_colors[0] = color;
-		}
+		prev_colors[0] = color;
 	    }
 #endif
 	    INCR(fcolor[min(w, 100)]);



More information about the gs-cvs mailing list