Skip to content
Snippets Groups Projects
Verified Commit f1100b68 authored by orestis.malaspin's avatar orestis.malaspin
Browse files

updated for CI

parent 492a2b5b
No related branches found
No related tags found
No related merge requests found
sorted_list_partiel
sorted_list_full
CC:=gcc
# SAN:=-fsanitize=address
CFLAGS:=-Wall -Wextra -pedantic -g $(SAN)
LDFLAGS:=-lm $(SAN)
EXECS := $(shell find . -type f -iname '*.c' | sed 's/\.c//g')
all: $(EXECS)
$(EXECS): %: %.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
@echo $@ >> .gitignore
.PHONY: clean all
clean:
rm -f *.o $(EXECS) .gitignore
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct _element {
int n;
......@@ -20,7 +21,8 @@ bool liste_est_vide(liste lst) {
}
// Retourne un pointeur sur l'élement avant l'emplacement d'insertion;
// ce pointeur est nul si la liste est vide ou si l'insertion est en tête de liste
// ce pointeur est nul si la liste est vide ou si l'insertion est en tête de
// liste
element *position(liste lst, int val) {
element *pos = lst;
if (liste_est_vide(lst) || val <= lst->n) {
......@@ -92,7 +94,8 @@ int main(int argc, char** argv) {
do {
printf("Insert: ");
scanf("%s", str);
if (0 == strcmp("quit",str)) break;
if (0 == strcmp("quit", str))
break;
lst = liste_inserer(lst, atoi(str));
print(lst);
printf("\n");
......@@ -100,7 +103,8 @@ int main(int argc, char** argv) {
do {
printf("Extract: ");
scanf("%s", str);
if (0 == strcmp("quit",str)) break;
if (0 == strcmp("quit", str))
break;
lst = liste_extraire(lst, atoi(str));
print(lst);
printf("\n");
......
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct _element {
int n;
......@@ -20,7 +21,8 @@ bool liste_est_vide(liste lst) {
}
// Retourne un pointeur sur l'élement avant l'emplacement d'insertion;
// ce pointeur est nul si la liste est vide ou si l'insertion est en tête de liste
// ce pointeur est nul si la liste est vide ou si l'insertion est en tête de
// liste
element *position(liste lst, int val) {
element *pos = lst;
if (liste_est_vide(lst) || val <= lst->n) {
......@@ -85,7 +87,8 @@ int main(int argc, char** argv) {
do {
printf("Insert: ");
scanf("%s", str);
if (0 == strcmp("quit",str)) break;
if (0 == strcmp("quit", str))
break;
lst = liste_inserer(lst, atoi(str));
print(lst);
printf("\n");
......@@ -93,7 +96,8 @@ int main(int argc, char** argv) {
do {
printf("Extract: ");
scanf("%s", str);
if (0 == strcmp("quit",str)) break;
if (0 == strcmp("quit", str))
break;
lst = liste_extraire(lst, atoi(str));
print(lst);
printf("\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment