[BACK]Return to patch-cuneiform_src_Kern_rbal_src_gistogramma_cpp CVS log [TXT][DIR] Up to [local] / ports / graphics / cuneiform / patches

File: [local] / ports / graphics / cuneiform / patches / patch-cuneiform_src_Kern_rbal_src_gistogramma_cpp (download)

Revision 1.1, Sat Oct 23 12:25:59 2010 UTC (13 years, 6 months ago) by yason
Branch: MAIN
CVS Tags: HEAD

patches from Vadim Zhukov

$OpenBSD$
--- cuneiform_src/Kern/rbal/src/gistogramma.cpp.orig	Wed Jul  7 13:03:03 2010
+++ cuneiform_src/Kern/rbal/src/gistogramma.cpp	Wed Jul  7 12:58:16 2010
@@ -56,22 +56,23 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
 
 #include "gistogramma.h"
 
-int16_t *stat_gistoGramma(int16_t *X, int16_t n)
+int16_t *stat_gistoGramma(int16_t *X, int16_t *n)
 {
 	if(X == NULL) return NULL;
 
-	int16_t xMax = X[stat_index_GlobMax(X, n, 1)];
-	int16_t xMin = X[stat_index_GlobMin(X, n)];
+	int16_t xMax = X[stat_index_GlobMax(X, *n, 1)];
+	int16_t xMin = X[stat_index_GlobMin(X, *n)];
 	int16_t   ng = xMax - xMin + 1;
 
 	int16_t *G = (int16_t *) calloc(ng, sizeof(int16_t));
 	if(G == NULL)
 		return NULL;
 
-	for(int16_t i = 0; i < n; i++)
+	for(int16_t i = 0; i < *n; i++)
 	{
 		G[X[i] - xMin]++;
 	}
+	*n = ng;
 	return G;
 }