diff options
author | Oskar <[email protected]> | 2024-04-14 13:12:36 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-04-14 13:12:36 +0200 |
commit | 5adffffc05eef954a606e28e8f769ce0a31c83c7 (patch) | |
tree | cd8a689b5fd57fde206f2e98e0dbfda3f83742f1 | |
parent | 94cca5bee677e31a084101f1afc506c0a0b9c65e (diff) |
Makefile changes, added gnu11 std and added -Wpedantic for better
warnings
-rw-r--r-- | 7ed.c | 2 | ||||
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | TODO | 12 | ||||
-rw-r--r-- | startmode.c | 8 |
4 files changed, 16 insertions, 14 deletions
@@ -6,7 +6,7 @@ #include "input.h" #include <stdint.h> -#define VERSION 1 +#define VERSION 2 #define USAGE "7ed [OPTION] [FILENAME]\n" \ "\nVALID COMMAND-LINE OPTIONS:\n\n"\ " -v Prints out the version number\n"\ @@ -1,6 +1,6 @@ CC=gcc -CFLAGS_TESTBIN=-O3 -Wfatal-errors -Wall -Werror -Wextra -g -fsanitize=address -CFLAGS=-O2 -flto -march=native -DNDEBUG -fomit-frame-pointer -s -static +CFLAGS_TESTBIN=-O3 -Wfatal-errors -Wall -Werror -Wextra -g -fsanitize=address -Wpedantic -std=gnu11 +CFLAGS=-O3 -flto -march=native -DNDEBUG -fomit-frame-pointer -s -static -std=gnu11 TARGET=7ed TESTTARGET=7ed-TESTING INSTALL_DIRECTORY=/usr/local/bin @@ -24,6 +24,6 @@ install: echo "$(TARGET) was installed to $(INSTALL_DIRECTORY)" release: - echo "CC 7ed.c functions.c startmode.c editmode.c ---> $(TARGET)" - $(CC) $(CFLAGS) 7ed.c functions.c startmode.c editmode.c -o $(TARGET) + echo "CC 7ed.c functions.c startmode.c editmode.c i_validation.c process_multiples.c ---> $(TARGET)" + $(CC) $(CFLAGS) 7ed.c functions.c startmode.c editmode.c input.c i_validation.c process_multiples.c -o $(TARGET) echo "$(TARGET) is done." @@ -1,8 +1,10 @@ TODO list. This is mostly so i can plan more granularly and remember small stuff i was working on last time and what i should prioritise first. This is not my overall big planning board. (1 highest prio, 10 lowest) -1 - Start working on X -1 - Start working on D -2 - Re-write new_line and remove_line_contents for better performance. (They are very inefficient) -2 - All L and N functionality is done. Did some testing and made some fixes. I will keep this here for now in case i find anything more. -2 - Not really a TODO point but more of an observation and a realisation i have made. I could have just used regex to do the validation of my commands. How about that... Well im too far in (sunk cost fallacy or whatever its called). +1 - Remove testing code, add comments for future me. +1 - Perform full test of the whole program +1 - Re-write USAGE +2 - Re-write Makefile to make it easier +2 - Add some quality of life features +3 - Re-write new_line and remove_line_contents for better performance. (They are very inefficient) +4 - Not really a TODO point but more of an observation and a realisation i have made. I could have just used regex to do the validation of my commands. How about that... Well im too far in (sunk cost fallacy or whatever its called). diff --git a/startmode.c b/startmode.c index e7175a2..372cc94 100644 --- a/startmode.c +++ b/startmode.c @@ -46,7 +46,7 @@ int call_singles(char single, uint64_t focus, char *filename) { switch(single) { case 'p': - case 'P': + case 'P': { char *line; size_t start; @@ -57,7 +57,7 @@ int call_singles(char single, uint64_t focus, char *filename) { fprintf(stdout, "%s", line); free(line); - break; + break; } case 'e': case 'E': @@ -65,14 +65,14 @@ int call_singles(char single, uint64_t focus, char *filename) { break; case 'c': - case 'C': + case 'C': { int dnl = display_name_linecount(filename); if (dnl == 1) { return EXIT_FAILURE; } - break; + break; } case 'q': case 'Q': |