Annotation of ports/graphics/cuneiform/patches/patch-cuneiform_src_Kern_rbal_src_gistogramma_cpp, Revision 1.1
1.1 ! yason 1: $OpenBSD$
! 2: --- cuneiform_src/Kern/rbal/src/gistogramma.cpp.orig Wed Jul 7 13:03:03 2010
! 3: +++ cuneiform_src/Kern/rbal/src/gistogramma.cpp Wed Jul 7 12:58:16 2010
! 4: @@ -56,22 +56,23 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
! 5:
! 6: #include "gistogramma.h"
! 7:
! 8: -int16_t *stat_gistoGramma(int16_t *X, int16_t n)
! 9: +int16_t *stat_gistoGramma(int16_t *X, int16_t *n)
! 10: {
! 11: if(X == NULL) return NULL;
! 12:
! 13: - int16_t xMax = X[stat_index_GlobMax(X, n, 1)];
! 14: - int16_t xMin = X[stat_index_GlobMin(X, n)];
! 15: + int16_t xMax = X[stat_index_GlobMax(X, *n, 1)];
! 16: + int16_t xMin = X[stat_index_GlobMin(X, *n)];
! 17: int16_t ng = xMax - xMin + 1;
! 18:
! 19: int16_t *G = (int16_t *) calloc(ng, sizeof(int16_t));
! 20: if(G == NULL)
! 21: return NULL;
! 22:
! 23: - for(int16_t i = 0; i < n; i++)
! 24: + for(int16_t i = 0; i < *n; i++)
! 25: {
! 26: G[X[i] - xMin]++;
! 27: }
! 28: + *n = ng;
! 29: return G;
! 30: }
! 31:
CVSweb