xpcom/glue/nsQuickSort.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 /* We need this because Solaris' version of qsort is broken and
     8  * causes array bounds reads.
     9  */
    11 #ifndef nsQuickSort_h___
    12 #define nsQuickSort_h___
    14 #include "nscore.h"
    16 #ifdef __cplusplus
    17 extern "C" {
    18 #endif
    20 /**
    21  * Parameters:
    22  *  1. the array to sort
    23  *  2. the number of elements in the array
    24  *  3. the size of each array element
    25  *  4. comparison function taking two elements and parameter #5 and
    26  *     returning an integer:
    27  *      + less than zero if the first element should be before the second
    28  *      + 0 if the order of the elements does not matter
    29  *      + greater than zero if the second element should be before the first
    30  *  5. extra data to pass to comparison function
    31  */
    32 NS_COM_GLUE void NS_QuickSort(void *, unsigned int, unsigned int,
    33                               int (*)(const void *, const void *, void *), 
    34                               void *);
    36 #ifdef __cplusplus
    37 }
    38 #endif
    40 #endif /* nsQuickSort_h___ */

mercurial