From: Peter Johnson Date: Sat, 15 Mar 2003 21:59:55 +0000 (-0000) Subject: Use yasm__mergesort() in expr.c and use correct xmalloc/xfree in mergesort.c. X-Git-Tag: v0.2.0~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a682e85bd314eff8b190fb84bb382809a33b51ae;p=yasm Use yasm__mergesort() in expr.c and use correct xmalloc/xfree in mergesort.c. svn path=/trunk/yasm/; revision=852 --- diff --git a/libyasm/expr.c b/libyasm/expr.c index fe120100..26b1b06f 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -790,8 +790,8 @@ yasm_expr__order_terms(yasm_expr *e) * stable sort (multiple terms of same type are kept in the same * order). */ - mergesort(e->terms, (size_t)e->numterms, sizeof(yasm_expr__item), - expr_order_terms_compare); + yasm__mergesort(e->terms, (size_t)e->numterms, + sizeof(yasm_expr__item), expr_order_terms_compare); break; default: break; diff --git a/libyasm/mergesort.c b/libyasm/mergesort.c index 6014389b..5546e6be 100644 --- a/libyasm/mergesort.c +++ b/libyasm/mergesort.c @@ -133,7 +133,7 @@ yasm__mergesort(void *base, size_t nmemb, size_t size, if (!(size % ISIZE) && !(((char *)base - (char *)0) % ISIZE)) iflag = 1; - if ((list2 = xmalloc(nmemb * size + PSIZE)) == NULL) + if ((list2 = yasm_xmalloc(nmemb * size + PSIZE)) == NULL) return (-1); list1 = base; @@ -240,7 +240,7 @@ COPY: b = t; memmove(list2, list1, nmemb*size); list2 = list1; } - xfree(list2); + yasm_xfree(list2); return (0); #endif /*HAVE_MERGESORT*/ }