Marcus Rueckert
68df2b695c
Accepted submit request 55204 from user msmeissn OBS-URL: https://build.opensuse.org/request/show/55204 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gsl?expand=0&rev=14
45 lines
1.2 KiB
Diff
45 lines
1.2 KiB
Diff
Index: gsl-1.11/sort/Makefile.am
|
|
===================================================================
|
|
--- gsl-1.11.orig/sort/Makefile.am
|
|
+++ gsl-1.11/sort/Makefile.am
|
|
@@ -10,7 +10,9 @@ noinst_HEADERS = sortvec_source.c sortve
|
|
TESTS = $(check_PROGRAMS)
|
|
|
|
check_PROGRAMS = test
|
|
|
|
+#test_source.lo_CFLAGS = -fwrapv
|
|
+
|
|
test_SOURCES = test.c
|
|
test_LDADD = libgslsort.la ../permutation/libgslpermutation.la ../vector/libgslvector.la ../block/libgslblock.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la
|
|
|
|
Index: gsl-1.11/sort/test_source.c
|
|
===================================================================
|
|
--- gsl-1.11.orig/sort/test_source.c
|
|
+++ gsl-1.11/sort/test_source.c
|
|
@@ -158,19 +158,19 @@ TYPE (test_sort_vector) (size_t N, size_
|
|
void
|
|
FUNCTION (my, initialize) (TYPE (gsl_vector) * v)
|
|
{
|
|
size_t i;
|
|
- ATOMIC k = 0;
|
|
- volatile ATOMIC kk;
|
|
+ ATOMIC maxk = 0;
|
|
|
|
/* Must be sorted initially */
|
|
|
|
for (i = 0; i < v->size; i++)
|
|
{
|
|
- kk = k;
|
|
- k++;
|
|
- /* Prevent overflow */
|
|
- if (k < kk) k = kk;
|
|
+ ATOMIC k = i;
|
|
+ if (k < maxk) /* prevent wrap around */
|
|
+ k = maxk;
|
|
+ else
|
|
+ maxk = k;
|
|
FUNCTION (gsl_vector, set) (v, i, k);
|
|
}
|
|
}
|
|
|