Завершил подключение встроенного qsort

This commit is contained in:
AZEN-SGG 2024-12-06 09:19:56 +03:00
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.

View file

@ -141,12 +141,12 @@ bool more(double a, double b) {
}
int compare(const void * ufirst, const void * usecond) {
double first = (double)ufirst;
double second = (double)usecond;
double first = *(double *)ufirst;
double second = *(double *)usecond;
if ((first - second) > eps) {
if ((first - second) > exp) {
return 1;
} else ((second - first) > eps) {
} else if ((second - first) > exp) {
return -1;
} else {
return 0;

View file

@ -12,7 +12,6 @@ CFLAGS = -mfpmath=sse \
-Wpointer-arith \
-Wformat-security \
-Wmissing-format-attribute \
-Wformat=1 \
-Wwrite-strings \
-Wcast-align \
-Wno-long-long \
@ -24,20 +23,19 @@ CFLAGS = -mfpmath=sse \
-Wdeclaration-after-statement \
-Wbad-function-cast \
-Wnested-externs \
-O3 \
-D_DEBUG -g \
-c
-O3 \
-D_DEBUG -g \
-c
all: main.o grouping.o tools.o
gcc main.o grouping.o tools.o -lssp && del *.o
a.exe
gcc main.o grouping.o tools.o -o a.out && rm -f *.o
./a.out
main.o: main.c
gcc $(CFLAGS) main.c
gcc $(CFLAGS) main.c -o main.o
grouping.o: grouping.c
gcc $(CFLAGS) grouping.c
gcc $(CFLAGS) grouping.c -o grouping.o
tools.o: tools.c
gcc $(CFLAGS) tools.c
gcc $(CFLAGS) tools.c -o tools.o