Changeset: 2292dd331fac for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2292dd331fac
Modified Files:
clients/Tests/exports.stable.out
gdk/gdk.h
gdk/gdk_batop.c
gdk/gdk_private.h
gdk/gdk_qsort.c
gdk/gdk_ssort_impl.h
Branch: Mar2018
Log Message:
Add restrict qualifiers to pointers in sort functions.
diffs (89 lines):
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -253,8 +253,8 @@ gdk_return GDKmmapfile(str buffer, size_
int GDKms(void);
int GDKnr_threads;
void GDKprepareExit(void);
-void GDKqsort(void *h, void *t, const void *base, size_t n, int hs, int ts,
int tpe);
-void GDKqsort_rev(void *h, void *t, const void *base, size_t n, int hs, int
ts, int tpe);
+void GDKqsort(void *restrict h, void *restrict t, const void *restrict base,
size_t n, int hs, int ts, int tpe);
+void GDKqsort_rev(void *restrict h, void *restrict t, const void *restrict
base, size_t n, int hs, int ts, int tpe);
void *GDKrealloc(void *pold, size_t size)
__attribute__((__warn_unused_result__));
void GDKregister(MT_Id pid);
gdk_return GDKreleasemmap(void *ptr, size_t size, size_t id, str *msg);
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -1467,8 +1467,8 @@ gdk_export gdk_return BATsort(BAT **sort
__attribute__ ((__warn_unused_result__));
-gdk_export void GDKqsort(void *h, void *t, const void *base, size_t n, int hs,
int ts, int tpe);
-gdk_export void GDKqsort_rev(void *h, void *t, const void *base, size_t n, int
hs, int ts, int tpe);
+gdk_export void GDKqsort(void *restrict h, void *restrict t, const void
*restrict base, size_t n, int hs, int ts, int tpe);
+gdk_export void GDKqsort_rev(void *restrict h, void *restrict t, const void
*restrict base, size_t n, int hs, int ts, int tpe);
#define BATtordered(b) ((b)->ttype == TYPE_void || (b)->tsorted)
#define BATtrevordered(b) (((b)->ttype == TYPE_void &&
is_oid_nil((b)->tseqbase)) || (b)->trevsorted)
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -1278,7 +1278,7 @@ BATordered_rev(BAT *b)
* stable sort can produce an error (not enough memory available),
* "quick" sort does not produce errors */
static gdk_return
-do_sort(void *h, void *t, const void *base, size_t n, int hs, int ts, int tpe,
+do_sort(void *restrict h, void *restrict t, const void *restrict base, size_t
n, int hs, int ts, int tpe,
int reverse, int stable)
{
if (n <= 1) /* trivially sorted */
diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h
--- a/gdk/gdk_private.h
+++ b/gdk/gdk_private.h
@@ -141,10 +141,10 @@ void BBPdump(void); /* never called: fo
__hidden gdk_return GDKsave(int farmid, const char *nme, const char *ext, void
*buf, size_t size, storage_t mode, int dosync)
__attribute__((__warn_unused_result__))
__attribute__((__visibility__("hidden")));
-__hidden gdk_return GDKssort_rev(void *h, void *t, const void *base, size_t n,
int hs, int ts, int tpe)
+__hidden gdk_return GDKssort_rev(void *restrict h, void *restrict t, const
void *restrict base, size_t n, int hs, int ts, int tpe)
__attribute__((__warn_unused_result__))
__attribute__((__visibility__("hidden")));
-__hidden gdk_return GDKssort(void *h, void *t, const void *base, size_t n, int
hs, int ts, int tpe)
+__hidden gdk_return GDKssort(void *restrict h, void *restrict t, const void
*restrict base, size_t n, int hs, int ts, int tpe)
__attribute__((__warn_unused_result__))
__attribute__((__visibility__("hidden")));
__hidden gdk_return GDKunlink(int farmid, const char *dir, const char *nme,
const char *extension)
diff --git a/gdk/gdk_qsort.c b/gdk/gdk_qsort.c
--- a/gdk/gdk_qsort.c
+++ b/gdk/gdk_qsort.c
@@ -311,7 +311,7 @@ struct qsort_t {
/* the interface functions */
void
-GDKqsort(void *h, void *t, const void *base, size_t n, int hs, int ts, int tpe)
+GDKqsort(void *restrict h, void *restrict t, const void *restrict base, size_t
n, int hs, int ts, int tpe)
{
struct qsort_t buf;
@@ -365,7 +365,7 @@ GDKqsort(void *h, void *t, const void *b
}
void
-GDKqsort_rev(void *h, void *t, const void *base, size_t n, int hs, int ts, int
tpe)
+GDKqsort_rev(void *restrict h, void *restrict t, const void *restrict base,
size_t n, int hs, int ts, int tpe)
{
struct qsort_t buf;
diff --git a/gdk/gdk_ssort_impl.h b/gdk/gdk_ssort_impl.h
--- a/gdk/gdk_ssort_impl.h
+++ b/gdk/gdk_ssort_impl.h
@@ -797,7 +797,7 @@ do_ssort(MergeState *ms, ssize_t nremain
* the actual key is found at that offset (MonetDB var-sized
* atoms). */
gdk_return
-GDKssortimpl(void *h, void *t, const void *heap, size_t nitems,
+GDKssortimpl(void *restrict h, void *restrict t, const void *restrict heap,
size_t nitems,
int hs, int ts, int tpe)
{
char temp;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list