Завершил подключение встроенного qsort
This commit is contained in:
parent
a45af76154
commit
6e9934a2d8
5 changed files with 12 additions and 14 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -141,12 +141,12 @@ bool more(double a, double b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int compare(const void * ufirst, const void * usecond) {
|
int compare(const void * ufirst, const void * usecond) {
|
||||||
double first = (double)ufirst;
|
double first = *(double *)ufirst;
|
||||||
double second = (double)usecond;
|
double second = *(double *)usecond;
|
||||||
|
|
||||||
if ((first - second) > eps) {
|
if ((first - second) > exp) {
|
||||||
return 1;
|
return 1;
|
||||||
} else ((second - first) > eps) {
|
} else if ((second - first) > exp) {
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -12,7 +12,6 @@ CFLAGS = -mfpmath=sse \
|
||||||
-Wpointer-arith \
|
-Wpointer-arith \
|
||||||
-Wformat-security \
|
-Wformat-security \
|
||||||
-Wmissing-format-attribute \
|
-Wmissing-format-attribute \
|
||||||
-Wformat=1 \
|
|
||||||
-Wwrite-strings \
|
-Wwrite-strings \
|
||||||
-Wcast-align \
|
-Wcast-align \
|
||||||
-Wno-long-long \
|
-Wno-long-long \
|
||||||
|
@ -28,16 +27,15 @@ CFLAGS = -mfpmath=sse \
|
||||||
-D_DEBUG -g \
|
-D_DEBUG -g \
|
||||||
-c
|
-c
|
||||||
|
|
||||||
|
|
||||||
all: main.o grouping.o tools.o
|
all: main.o grouping.o tools.o
|
||||||
gcc main.o grouping.o tools.o -lssp && del *.o
|
gcc main.o grouping.o tools.o -o a.out && rm -f *.o
|
||||||
a.exe
|
./a.out
|
||||||
|
|
||||||
main.o: main.c
|
main.o: main.c
|
||||||
gcc $(CFLAGS) main.c
|
gcc $(CFLAGS) main.c -o main.o
|
||||||
|
|
||||||
grouping.o: grouping.c
|
grouping.o: grouping.c
|
||||||
gcc $(CFLAGS) grouping.c
|
gcc $(CFLAGS) grouping.c -o grouping.o
|
||||||
|
|
||||||
tools.o: tools.c
|
tools.o: tools.c
|
||||||
gcc $(CFLAGS) tools.c
|
gcc $(CFLAGS) tools.c -o tools.o
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue