]> granicus.if.org Git - yasm/commitdiff
Use yasm__mergesort() in expr.c and use correct xmalloc/xfree in mergesort.c.
authorPeter Johnson <peter@tortall.net>
Sat, 15 Mar 2003 21:59:55 +0000 (21:59 -0000)
committerPeter Johnson <peter@tortall.net>
Sat, 15 Mar 2003 21:59:55 +0000 (21:59 -0000)
svn path=/trunk/yasm/; revision=852

libyasm/expr.c
libyasm/mergesort.c

index fe12010022c334d8e81ab00a0df72233fca3e43f..26b1b06f74b87e6f9e7bf5ada096e8f111ae5431 100644 (file)
@@ -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;
index 6014389bffe07831e3b0406dc2a0191384eda3ee..5546e6be6d97bd95b2fdf2e8baa7d58cfb39be08 100644 (file)
@@ -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*/
 }