Skip to content

Commit

Permalink
Merge pull request #22 from Garz4/main
Browse files Browse the repository at this point in the history
Sort things up
  • Loading branch information
urielgarciarivas authored Dec 3, 2023
2 parents 95f5e45 + 466ed41 commit 48a50f9
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 24 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 11 additions & 11 deletions DataStructures/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,33 @@
# https://github.com/zoningorg/zoning/blob/main/LICENSE

CC = gcc
CFLAGS = -Wall -Werror -Wpedantic
INC = ./src/linked_list.h ./src/sort_set.h
SRC = $(INC:.h=.c)
OBJ = $(INC:.h=.o)
CFLAGS = -Wall -Werror -Wpedantic -I./inc/
INC = ./inc/linked_list.h ./inc/sort_set.h
SRC = $(patsubst ./inc/%.h,./src/%.c,$(INC))
OBJ = $(patsubst ./inc/%.h,./obj/%.o,$(INC))

all: test
test: hash_map_test hash_set_test linked_list_test sort_map_test sort_set_test
( ./hash_map_test && ./hash_set_test && ./linked_list_test \
&& ./sort_map_test && ./sort_set_test ) ; make clean

./src/%.o: ./src/%.c
gcc -c $< -o $@
./obj/%.o: ./src/%.c
$(CC) $(CFLAGS) -c $^ -o $@

linked_list_test: test/linked_list_test.c $(OBJ)
$(CC) $(CFLAGS) $(INC) test/linked_list_test.c -o linked_list_test $(OBJ)
$(CC) $(CFLAGS) $(INC) $< -o $@ $(OBJ)

hash_map_test: test/hash_map_test.c $(OBJ)
$(CC) $(CFLAGS) $(INC) test/hash_map_test.c -o hash_map_test $(OBJ)
$(CC) $(CFLAGS) $(INC) $< -o $@ $(OBJ)

hash_set_test: test/hash_set_test.c $(OBJ)
$(CC) $(CFLAGS) $(INC) test/hash_set_test.c -o hash_set_test $(OBJ)
$(CC) $(CFLAGS) $(INC) $< -o $@ $(OBJ)

sort_map_test: test/sort_map_test.c $(OBJ)
$(CC) $(CFLAGS) $(INC) test/sort_map_test.c -o sort_map_test $(OBJ)
$(CC) $(CFLAGS) $(INC) $< -o $@ $(OBJ)

sort_set_test: test/sort_set_test.c $(OBJ)
$(CC) $(CFLAGS) $(INC) test/sort_set_test.c -o sort_set_test $(OBJ)
$(CC) $(CFLAGS) $(INC) $< -o $@ $(OBJ)

clean:
rm linked_list_test hash_map_test hash_set_test sort_map_test \
Expand Down
4 changes: 2 additions & 2 deletions DataStructures/src/linked_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#include <stdio.h>
#include <stdlib.h>

#include "linked_list.h"
#include "memory.h"
#include "../inc/linked_list.h"
#include "../inc/memory.h"

inline linked_list*
new_linked_list(int value) {
Expand Down
8 changes: 4 additions & 4 deletions DataStructures/src/sort_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#include <stdio.h>
#include <stdlib.h>

#include "memory.h"
#include "sort_set.h"
#include "../inc/memory.h"
#include "../inc/sort_set.h"

inline sort_set*
new_sort_set(int value) {
Expand Down Expand Up @@ -68,10 +68,10 @@ delete_sort_set(sort_set* set) {
if (set == NULL || set->root == NULL) {
return;
}

/*
sort_set_node* node;
sort_set_node* left;
sort_set_node* right;

*/
DEALLOCATE(set);
}
2 changes: 1 addition & 1 deletion DataStructures/test/array_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

#include "../../Testing/comparators.h"
#include "../src/array.h"
#include "../inc/array.h"

int main(void) {
START_TEST("array_test");
Expand Down
2 changes: 1 addition & 1 deletion DataStructures/test/hash_map_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <stdio.h>

#include "../../Testing/comparators.h"
#include "../src/hash_map.h"
#include "../inc/hash_map.h"

int main(void) {
START_TEST("hash_map_test");
Expand Down
2 changes: 1 addition & 1 deletion DataStructures/test/hash_set_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <stdio.h>

#include "../../Testing/comparators.h"
#include "../src/hash_set.h"
#include "../inc/hash_set.h"

int main(void) {
START_TEST("hash_set_test");
Expand Down
2 changes: 1 addition & 1 deletion DataStructures/test/linked_list_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

#include "../../Testing/comparators.h"
#include "../src/linked_list.h"
#include "../inc/linked_list.h"

int main(void) {
START_TEST("linked_list_test");
Expand Down
2 changes: 1 addition & 1 deletion DataStructures/test/sort_map_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <stdio.h>

#include "../../Testing/comparators.h"
#include "../src/sort_map.h"
#include "../inc/sort_map.h"

int main(void) {
START_TEST("sort_map_test");
Expand Down
2 changes: 1 addition & 1 deletion DataStructures/test/sort_set_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <stdio.h>

#include "../../Testing/comparators.h"
#include "../src/sort_set.h"
#include "../inc/sort_set.h"

int main(void) {
START_TEST("sort_set_test");
Expand Down
2 changes: 1 addition & 1 deletion Testing/results.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef RESULTS_H_
#define RESULTS_H_

#include "../DataStructures/src/memory.h"
#include "../DataStructures/inc/memory.h"
#include "../Terminal/outputstream.h"

#ifdef __cplusplus
Expand Down

0 comments on commit 48a50f9

Please sign in to comment.