Skip to content

Commit 48f4178

Browse files
committed
Reformated the project.
1 parent 16fa68a commit 48f4178

File tree

27 files changed

+122
-190
lines changed

27 files changed

+122
-190
lines changed

DataStructure/Deque/Sources/DLinkedListDeque.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ void destroyDLDeque(void *deque) {
360360

361361
}
362362

363-
destroyDoublyLinkedList( ((DLDeque *) deque)->linkedList );
363+
destroyDoublyLinkedList(((DLDeque *) deque)->linkedList);
364364
free(deque);
365365

366366
}

DataStructure/Deque/Sources/Deque.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,6 @@ void destroyDeque(void *deque) {
462462
}
463463

464464
clearDeque(deque);
465-
free( ((Deque *) deque)->arr );
465+
free(((Deque *) deque)->arr);
466466
free(deque);
467467
}

DataStructure/Graphs/Sources/DirectedGraph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ void destroyDirGraph(void *graph) {
591591

592592
}
593593

594-
destroyHashMap( ((DirectedGraph *)graph)->nodes );
594+
destroyHashMap(((DirectedGraph *) graph)->nodes);
595595
free(graph);
596596

597597
}

DataStructure/Graphs/Sources/UndirectedGraph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ void destroyUDGraph(void *graph) {
851851

852852
}
853853

854-
destroyHashMap( ((UndirectedGraph *)graph)->nodes );
854+
destroyHashMap(((UndirectedGraph *) graph)->nodes);
855855
free(graph);
856856

857857
}

DataStructure/Lists/Sources/ArrayList.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ arrayListInitialization(int initialLength, void (*freeFun)(void *), int (*compar
1818
if (freeFun == NULL) {
1919
#ifdef C_DATASTRUCTURES_ERRORSTESTSTRUCT_H
2020
ERROR_TEST->errorCode = INVALID_ARG;
21-
return NULL;
21+
return NULL;
2222
#else
2323
fprintf(stderr, INVALID_ARG_MESSAGE, "free function", "array list data structure");
2424
exit(INVALID_ARG);
@@ -841,7 +841,7 @@ void destroyArrayList(void *list) {
841841
}
842842

843843
clearArrayList(list);
844-
free( ((ArrayList *) list)->arr );
844+
free(((ArrayList *) list)->arr);
845845
free(list);
846846

847847
}

DataStructure/Lists/Sources/Vector.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void vectorAdd(Vector *list, void *item) {
7979
if (list == NULL) {
8080
#ifdef C_DATASTRUCTURES_ERRORSTESTSTRUCT_H
8181
ERROR_TEST->errorCode = NULL_POINTER;
82-
return;
82+
return;
8383
#else
8484
fprintf(stderr, NULL_POINTER_MESSAGE, "vector", "vector data structure");
8585
exit(NULL_POINTER);
@@ -88,7 +88,7 @@ void vectorAdd(Vector *list, void *item) {
8888
} else if (item == NULL) {
8989
#ifdef C_DATASTRUCTURES_ERRORSTESTSTRUCT_H
9090
ERROR_TEST->errorCode = INVALID_ARG;
91-
return;
91+
return;
9292
#else
9393
fprintf(stderr, INVALID_ARG_MESSAGE, "item pointer", "vector data structure");
9494
exit(INVALID_ARG);
@@ -103,7 +103,7 @@ void vectorAdd(Vector *list, void *item) {
103103
if (list->arr == NULL) {
104104
#ifdef C_DATASTRUCTURES_ERRORSTESTSTRUCT_H
105105
ERROR_TEST->errorCode = FAILED_REALLOCATION;
106-
return;
106+
return;
107107
#else
108108
fprintf(stderr, FAILED_REALLOCATION_MESSAGE, "items memory", "vector data structure");
109109
exit(FAILED_REALLOCATION);
@@ -462,7 +462,7 @@ int vectorGetIndex(Vector *list, void *item) {
462462
} else if (list->comparator == NULL) {
463463
#ifdef C_DATASTRUCTURES_ERRORSTESTSTRUCT_H
464464
ERROR_TEST->errorCode = NULL_POINTER;
465-
return -1;
465+
return -1;
466466
#else
467467
fprintf(stderr, NULL_POINTER_MESSAGE, "comparator function", "vector data structure");
468468
exit(NULL_POINTER);
@@ -841,7 +841,7 @@ void destroyVector(void *list) {
841841
}
842842

843843
clearVector(list);
844-
free( ((Vector *) list)->arr );
844+
free(((Vector *) list)->arr);
845845
free(list);
846846

847847
}

DataStructure/Matrices/Sources/Matrix.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,9 +1007,9 @@ void destroyMatrix(void *matrix) {
10071007
clearMatrix(matrix);
10081008

10091009
for (int i = 0; i < ((Matrix *) matrix)->rowsNum; i++)
1010-
free( ((Matrix *) matrix)->rows[i] );
1010+
free(((Matrix *) matrix)->rows[i]);
10111011

1012-
free( ((Matrix *) matrix)->rows );
1012+
free(((Matrix *) matrix)->rows);
10131013
free(matrix);
10141014

10151015
}

DataStructure/Pairs/Headers/Pair.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ typedef struct Pair {
2424
void *sElem;
2525

2626
void (*fFreeFn)(void *);
27+
2728
void (*sFreeFn)(void *);
2829

2930
} Pair;

DataStructure/Pairs/Sources/Pair.c

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
#include "../../../Unit Test/CuTest/CuTest.h"
44

55

6-
7-
8-
9-
106
/** This function will allocate a new pair then it will return it's pointer.
117
*
128
* @param fElem the first element pointer
@@ -68,11 +64,6 @@ Pair *pairInitialization(void *fElem, void *sElem, void (*fFreeFn)(void *), void
6864
}
6965

7066

71-
72-
73-
74-
75-
7667
/** This function will return the first element in the pair.
7768
*
7869
* @param pair the pair pointer
@@ -96,9 +87,6 @@ void *pairGetFElem(Pair *pair) {
9687
}
9788

9889

99-
100-
101-
10290
/** This function will return the second element in the pair.
10391
*
10492
* @param pair the pair pointer
@@ -122,9 +110,6 @@ void *pairGetSElem(Pair *pair) {
122110
}
123111

124112

125-
126-
127-
128113
/** This function will set the first element in the pair.
129114
*
130115
* Note: this function will free the old element
@@ -160,9 +145,6 @@ void pairSetFElem(Pair *pair, void *newElem) {
160145
}
161146

162147

163-
164-
165-
166148
/** This function will set the second element in the pair.
167149
*
168150
* Note: this function will free the old element
@@ -198,10 +180,6 @@ void pairSetSElem(Pair *pair, void *newElem) {
198180
}
199181

200182

201-
202-
203-
204-
205183
/** This function will set the first element in the pair,
206184
* without freeing the old element.
207185
*
@@ -234,9 +212,6 @@ void pairSetFElemWtoFr(Pair *pair, void *newElem) {
234212
}
235213

236214

237-
238-
239-
240215
/** This function will set the second element in the pair,
241216
* without freeing the old element.
242217
*
@@ -269,10 +244,6 @@ void pairSetSElemWtoFr(Pair *pair, void *newElem) {
269244
}
270245

271246

272-
273-
274-
275-
276247
/** This function will swap the pair elements.
277248
*
278249
* @param pair the pair pointer
@@ -301,8 +272,6 @@ void pairSwapElements(Pair *pair) {
301272
}
302273

303274

304-
305-
306275
/** This function will destroy and free the pair and its elements.
307276
*
308277
* @param pair the pair pointer

DataStructure/Queues/Headers/HPriorityQueue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ typedef struct HPriorityQueue {
1212

1313
struct BinaryHeap *heap;
1414

15-
}HPriorityQueue;
15+
} HPriorityQueue;
1616

1717

1818
HPriorityQueue *hPriorityQueueInitialization(void (*freeFn)(void *), int (*cmp)(const void *, const void *));

0 commit comments

Comments
 (0)