aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEl-BG-1970 <elouangros@hotmail.com>2023-02-05 11:48:36 +0100
committerEl-BG-1970 <elouangros@hotmail.com>2023-02-05 11:48:36 +0100
commita565247c8e000482a4136a4e0f5bd113102a6d65 (patch)
tree056db839983797dd7795060e58b66a6ca3b3d3a4
parentc599aaf883472686fa2871ec48905b114c783180 (diff)
downloadorg-to-conky-a565247c8e000482a4136a4e0f5bd113102a6d65.tar.gz
added checks, moved from defines to pragma in header files
-rw-r--r--Makefile10
-rw-r--r--agenda_entry.h7
-rw-r--r--date.h7
3 files changed, 11 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index ac99cf1..8a71ad6 100644
--- a/Makefile
+++ b/Makefile
@@ -6,16 +6,17 @@ CC=clang --std=gnu99
CC=clang --std=c99
.endif
-CFLAGS=-Wall -Wextra -Werror -g
+CFLAGS=-Wall -Wextra -Werror -Weverything -pedantic
LIBS=
-BLDFLAGS=-O2 -g
+BLDFLAGS=-g
+RELFLAGS=-O2
TARGET=otc
DEPS=main.c agenda_entry.c date.c
HEAD=agenda_entry.h date.h
OBJ=${DEPS:.c=.o}
-.PHONY: all clean $(TARGET)
+.PHONY: all clean release $(TARGET)
all: $(TARGET)
@@ -27,5 +28,8 @@ $(OBJ): $(HEAD)
$(TARGET): $(OBJ)
$(CC) -o $@ $(OBJ) $(LIBS) $(BLDFLAGS)
+release: $(OBJ)
+ $(CC) -o $(TARGET) $(OBJ) $(LIBS) $(RELFLAGS)
+
clean:
rm -f *.o *~ *.core $(OBJ) $(TARGET)
diff --git a/agenda_entry.h b/agenda_entry.h
index 8f13b2d..ea9ea8a 100644
--- a/agenda_entry.h
+++ b/agenda_entry.h
@@ -1,4 +1,4 @@
-#ifndef __AGENDA_ENTRY_H__
+#pragma once
#include <stdlib.h>
#include <string.h>
#include "date.h"
@@ -8,10 +8,10 @@ typedef struct entry {
//struct entry *children;
//int8_t level;// nesting level of the entry
//char *todo; // TODO keyword
+ Date date; // scheduled or deadline date
char *tag; // tag keyword
char *title; // the actual entry
//char *text; // description (if there is one)
- Date date; // scheduled or deadline date
} entry;
char *next_word(char *str);
@@ -27,6 +27,3 @@ void merge_sort_entry_array(entry *arr, int n);
void sort_entry_array(entry *arr, int n);
void print_entry(entry e);
void destroy_entry(entry e);
-
-#define __AGENDA_ENTRY_H__
-#endif
diff --git a/date.h b/date.h
index b692d48..5adfc46 100644
--- a/date.h
+++ b/date.h
@@ -1,4 +1,4 @@
-#ifndef __DATE_H__
+#pragma once
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
@@ -28,11 +28,8 @@ void print_date(Date date);
char *print_date_to_string(Date date);
char *short_date_to_string(Date date);
-Date today();
+Date today(void);
Date tomorrow(Date td);
Date nextweek(Date td);
Date nextmonth(Date td);
Date nextmonday(Date td);
-
-#define __DATE_H__
-#endif