Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b1fd410eb9
|
||
|
|
3438a6981f
|
||
|
|
99118dffc6
|
||
|
|
86c68c4660
|
||
|
|
5c07ed46ee
|
||
|
|
d84dcd9f3b
|
||
|
|
df05dc7f62
|
||
|
|
0e1b32a1d5
|
||
|
|
436592e5f1
|
||
|
|
994daf8bfd
|
@@ -40,7 +40,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Configure Conan
|
- name: Configure Conan
|
||||||
run: |
|
run: |
|
||||||
conan profile detect --force
|
conan profile detect --force # Create a default profile
|
||||||
|
|
||||||
- name: Create build directory
|
- name: Create build directory
|
||||||
run: mkdir build
|
run: mkdir build
|
||||||
@@ -59,3 +59,5 @@ jobs:
|
|||||||
- name: Test with CTest (optional)
|
- name: Test with CTest (optional)
|
||||||
working-directory: build/Release
|
working-directory: build/Release
|
||||||
run: ctest -C Release
|
run: ctest -C Release
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -44,13 +44,15 @@ int is_list_init(struct node **list)
|
|||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int list_size(struct node **list)
|
int list_size(struct node **list)
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
struct node *tmp = *list;
|
struct node *tmp = *list;
|
||||||
|
|
||||||
|
struct node *in_tmp = NULL;
|
||||||
|
|
||||||
while (tmp != NULL || tmp->next != NULL) {
|
while (tmp != NULL || tmp->next != NULL) {
|
||||||
|
in_tmp = tmp;
|
||||||
tmp = tmp->next;
|
tmp = tmp->next;
|
||||||
|
|
||||||
++count;
|
++count;
|
||||||
@@ -79,7 +81,6 @@ void insert_at_begin(struct node **list, void *val, size_t val_size)
|
|||||||
tmp->next = *list;
|
tmp->next = *list;
|
||||||
*list = tmp;
|
*list = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void insert_at_end(struct node **list, void *val, size_t val_size)
|
void insert_at_end(struct node **list, void *val, size_t val_size)
|
||||||
{
|
{
|
||||||
struct node *tmp = (struct node*)malloc(sizeof(struct node));
|
struct node *tmp = (struct node*)malloc(sizeof(struct node));
|
||||||
@@ -101,7 +102,6 @@ void insert_at_end(struct node **list, void *val, size_t val_size)
|
|||||||
tmp->next->data = tmp_val;
|
tmp->next->data = tmp_val;
|
||||||
tmp->next->next = NULL;
|
tmp->next->next = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_list(struct node **list)
|
void free_list(struct node **list)
|
||||||
{
|
{
|
||||||
struct node *t = NULL;
|
struct node *t = NULL;
|
||||||
@@ -120,8 +120,8 @@ void free_list(struct node **list)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
while (l->next != NULL);
|
while (l->next != NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void traverse(struct node *list, void (*print_val)(struct node*))
|
void traverse(struct node *list, void (*print_val)(struct node*))
|
||||||
{
|
{
|
||||||
if (list == NULL)
|
if (list == NULL)
|
||||||
|
|||||||
Reference in New Issue
Block a user