From 6a31527ac8a94d12732dda60dbbf0069e5cc1490 Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Thu, 7 Nov 2013 15:31:42 -0500 Subject: don't cast the return of calloc --- src/c/nnls.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/c/nnls.c b/src/c/nnls.c index f45bfec..a09debd 100644 --- a/src/c/nnls.c +++ b/src/c/nnls.c @@ -182,9 +182,9 @@ int64_t nnls_algorithm(double *a, int64_t m,int64_t n, double *b, double *x, dou return(2); /* Allocate memory for working space, if required */ - double *w = (double*)calloc(n, sizeof(double)); - double *zz = (double*)calloc(m, sizeof(double)); - int64_t *index = (int64_t*)calloc(n, sizeof(int64_t)); + double *w = calloc(n, sizeof(double)); + double *zz = calloc(m, sizeof(double)); + int64_t *index = calloc(n, sizeof(int64_t)); if(w == NULL || zz == NULL || index == NULL) return(2); @@ -398,7 +398,7 @@ int64_t nnls_algorithm(double *a, int64_t m,int64_t n, double *b, double *x, dou double *nnls(double *a_matrix, double *b_matrix, int64_t height, int64_t width) { - double *solution = (double*)calloc(height, sizeof(double)); + double *solution = calloc(height, sizeof(double)); if(solution == NULL) { fprintf(stderr, "could not allocate enough memory for nnls\n"); -- cgit v1.2.3